ooo-build r14389 - in trunk: . patches patches/dev300 patches/lwp
- From: pflin svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r14389 - in trunk: . patches patches/dev300 patches/lwp
- Date: Wed, 22 Oct 2008 06:44:06 +0000 (UTC)
Author: pflin
Date: Wed Oct 22 06:44:05 2008
New Revision: 14389
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14389&view=rev
Log:
Integrate WordPro import filter from cws ooo11lotusfilter.
Added:
trunk/patches/lwp/
trunk/patches/lwp/Makefile.am
trunk/patches/lwp/cws-ooo11lotusfilter-lwp-filter-component.diff
trunk/patches/lwp/cws-ooo11lotusfilter-lwp-filter.diff
trunk/patches/lwp/cws-ooo11lotusfilter-lwp-xfilter.diff
trunk/patches/lwp/lwp-filter-component.diff
- copied unchanged from r14386, /trunk/patches/dev300/lwp-filter-component.diff
Removed:
trunk/patches/dev300/lwp-filter-component.diff
Modified:
trunk/ChangeLog
trunk/configure.in
trunk/patches/Makefile.am
trunk/patches/dev300/apply
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Wed Oct 22 06:44:05 2008
@@ -1417,6 +1417,7 @@
patches/postgresql/Makefile
patches/scsolver/Makefile
patches/unittesting/Makefile
+patches/lwp/Makefile
patches/64bit/Makefile
po/Makefile
po/sdf-templates/Makefile
Modified: trunk/patches/Makefile.am
==============================================================================
--- trunk/patches/Makefile.am (original)
+++ trunk/patches/Makefile.am Wed Oct 22 06:44:05 2008
@@ -1,3 +1,3 @@
-SUBDIRS=64bit cairo dev300 emf+ evo2 gstreamer hotfixes mono ooxml vba postgresql scsolver unittesting
+SUBDIRS=64bit cairo dev300 emf+ evo2 gstreamer hotfixes mono ooxml vba postgresql scsolver unittesting lwp
EXTRA_DIST=README apply.pl.in $(wildcard *.diff)
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Wed Oct 22 06:44:05 2008
@@ -5,7 +5,7 @@
# -------- Options --------
-PATCHPATH=.:../evo2:../vba:../mono:../64bit:../cairo:../gstreamer:../ooxml:../postgresql:../emf+:../unittesting:../scsolver
+PATCHPATH=.:../evo2:../vba:../mono:../64bit:../cairo:../gstreamer:../ooxml:../postgresql:../emf+:../unittesting:../scsolver:../lwp
OLDEST_SUPPORTED=dev300-m28 ooo300-m0
@@ -1427,6 +1427,10 @@
[ Lwp ]
# Lotus Word Pro Import Filter
lwp-filter-component.diff, i#11215, noelpwer
+# Integrate cws ooo11lotusfilter for WordPro filter
+cws-ooo11lotusfilter-lwp-filter-component.diff, Fong
+cws-ooo11lotusfilter-lwp-filter.diff, Fong
+cws-ooo11lotusfilter-lwp-xfilter.diff, Fong
[ Win32Only ]
Added: trunk/patches/lwp/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/patches/lwp/Makefile.am Wed Oct 22 06:44:05 2008
@@ -0,0 +1 @@
+EXTRA_DIST = $(wildcard *.diff)
Added: trunk/patches/lwp/cws-ooo11lotusfilter-lwp-filter-component.diff
==============================================================================
--- (empty file)
+++ trunk/patches/lwp/cws-ooo11lotusfilter-lwp-filter-component.diff Wed Oct 22 06:44:05 2008
@@ -0,0 +1,177 @@
+diff -urp '--exclude=unxlngx6.pro' lotuswordpro.bak/prj/build.lst lotuswordpro/prj/build.lst
+--- lotuswordpro.bak/prj/build.lst 2008-10-22 14:01:16.000000000 +0800
++++ lotuswordpro/prj/build.lst 2008-10-22 11:42:21.000000000 +0800
+@@ -1,4 +1,5 @@
+ wp lotuswordpro : sfx2 sot svx comphelper NULL
+ wp lotuswordpro usr1 - all lwp_mkout NULL
+ wp lotuswordpro\source\filter nmake - all lwp_filter NULL
+-wp lotuswordpro\util nmake - all lwp_util lwp_filter NULL
++wp lotuswordpro\source\filter\xfilter nmake - all lwp_xfilter NULL
++wp lotuswordpro\util nmake - all lwp_util lwp_filter lwp_xfilter NULL
+diff -urp '--exclude=unxlngx6.pro' lotuswordpro.bak/source/filter/LotusWordProImportFilter.cxx lotuswordpro/source/filter/LotusWordProImportFilter.cxx
+--- lotuswordpro.bak/source/filter/LotusWordProImportFilter.cxx 2008-10-22 14:01:16.000000000 +0800
++++ lotuswordpro/source/filter/LotusWordProImportFilter.cxx 2008-10-22 11:42:21.000000000 +0800
+@@ -19,6 +19,8 @@
+
+ #include <vector>
+
++#include "lwpfilter.hxx"
++
+ using namespace ::rtl;
+ using namespace com::sun::star;
+ using rtl::OString;
+@@ -252,11 +254,13 @@ sal_Bool SAL_CALL LotusWordProImportFilt
+ uno::Reference< XDocumentHandler > xInternalHandler( mxMSF->createInstance( sXMLImportService ), UNO_QUERY );
+ uno::Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY);
+ xImporter->setTargetDocument(mxDoc);
+-
+- SimpleXMLImporter xmlImporter( xInternalHandler, inputStream );
+- xmlImporter.import();
++/*
++ SimpleXMLImporter xmlImporter( xInternalHandler, inputStream );
++ xmlImporter.import();
++ return sal_True;
++*/
++ return ( ReadWordproFile( &inputStream, xInternalHandler) == 0 );
+
+- return sal_True;
+ }
+
+ sal_Bool SAL_CALL LotusWordProImportFilter::filter( const Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+diff -urp '--exclude=unxlngx6.pro' lotuswordpro.bak/source/filter/makefile.mk lotuswordpro/source/filter/makefile.mk
+--- lotuswordpro.bak/source/filter/makefile.mk 2008-10-22 14:01:16.000000000 +0800
++++ lotuswordpro/source/filter/makefile.mk 2008-10-22 11:42:21.000000000 +0800
+@@ -8,6 +8,103 @@ ENABLE_EXCEPTIONS=true
+
+ SLOFILES= \
+ $(SLO)$/LotusWordProImportFilter.obj \
+- $(SLO)$/genericfilter.obj
++ $(SLO)$/genericfilter.obj \
++ $(SLO)$/lwpfilter.obj \
++ $(SLO)$/bencont.obj \
++ $(SLO)$/benlist.obj \
++ $(SLO)$/benname.obj \
++ $(SLO)$/benobj.obj \
++ $(SLO)$/benval.obj \
++ $(SLO)$/tocread.obj \
++ $(SLO)$/utbenvs.obj \
++ $(SLO)$/utlist.obj \
++ $(SLO)$/lwp9reader.obj \
++ $(SLO)$/lwpatomholder.obj \
++ $(SLO)$/lwpbasetype.obj \
++ $(SLO)$/lwpcolor.obj \
++ $(SLO)$/lwpcontent.obj \
++ $(SLO)$/lwpdefobj.obj \
++ $(SLO)$/lwpdlvlist.obj \
++ $(SLO)$/lwpdivinfo.obj \
++ $(SLO)$/lwpdivopts.obj \
++ $(SLO)$/lwpdoc.obj \
++ $(SLO)$/lwpfilehdr.obj \
++ $(SLO)$/lwpfont.obj \
++ $(SLO)$/lwpfoundry.obj \
++ $(SLO)$/lwpfrib.obj \
++ $(SLO)$/lwpfribtext.obj \
++ $(SLO)$/lwpfribframe.obj \
++ $(SLO)$/lwpfribbreaks.obj \
++ $(SLO)$/lwpfribsection.obj \
++ $(SLO)$/lwpfribptr.obj \
++ $(SLO)$/lwpfribtable.obj \
++ $(SLO)$/lwpholder.obj \
++ $(SLO)$/lwpidxmgr.obj \
++ $(SLO)$/lwplayout.obj \
++ $(SLO)$/lwplaypiece.obj \
++ $(SLO)$/lwplnopts.obj \
++ $(SLO)$/lwptablelayout.obj \
++ $(SLO)$/lwprowlayout.obj \
++ $(SLO)$/lwpcelllayout.obj \
++ $(SLO)$/lwpframelayout.obj \
++ $(SLO)$/lwppagelayout.obj \
++ $(SLO)$/lwpobj.obj \
++ $(SLO)$/lwpobjhdr.obj \
++ $(SLO)$/lwpobjid.obj \
++ $(SLO)$/lwpobjfactory.obj \
++ $(SLO)$/lwpobjstrm.obj \
++ $(SLO)$/lwppara.obj \
++ $(SLO)$/lwppara1.obj \
++ $(SLO)$/lwpparastyle.obj \
++ $(SLO)$/lwpprtinfo.obj \
++ $(SLO)$/lwpborderstuff.obj \
++ $(SLO)$/lwpparaborderoverride.obj \
++ $(SLO)$/lwpstory.obj \
++ $(SLO)$/lwpnumberingoverride.obj \
++ $(SLO)$/lwpcharborderoverride.obj \
++ $(SLO)$/lwpbreaksoverride.obj \
++ $(SLO)$/lwpbackgroundstuff.obj \
++ $(SLO)$/lwptabrack.obj \
++ $(SLO)$/lwpcharacterstyle.obj \
++ $(SLO)$/lwpoverride.obj \
++ $(SLO)$/lwpsortopt.obj \
++ $(SLO)$/lwpsvstream.obj \
++ $(SLO)$/lwptoc.obj \
++ $(SLO)$/lwptools.obj \
++ $(SLO)$/lwpusrdicts.obj \
++ $(SLO)$/lwpuidoc.obj \
++ $(SLO)$/lwpdllist.obj \
++ $(SLO)$/lwpparaproperty.obj \
++ $(SLO)$/lwpsilverbullet.obj \
++ $(SLO)$/lwpcharsetmgr.obj \
++ $(SLO)$/lwpsection.obj \
++ $(SLO)$/lwppagehint.obj \
++ $(SLO)$/lwpsdwfileloader.obj \
++ $(SLO)$/lwpoleobject.obj \
++ $(SLO)$/lwpbulletstylemgr.obj \
++ $(SLO)$/lwpsdwgrouploaderv0102.obj \
++ $(SLO)$/lwpgrfobj.obj \
++ $(SLO)$/lwpdropcapmgr.obj \
++ $(SLO)$/lwptblcell.obj \
++ $(SLO)$/lwptable.obj \
++ $(SLO)$/lwpmarker.obj \
++ $(SLO)$/lwpproplist.obj \
++ $(SLO)$/lwphyperlinkmgr.obj \
++ $(SLO)$/lwpvpointer.obj \
++ $(SLO)$/lwpdrawobj.obj \
++ $(SLO)$/lwpsdwrect.obj \
++ $(SLO)$/lwpfootnote.obj \
++ $(SLO)$/lwpfnlayout.obj \
++ $(SLO)$/lwpdocdata.obj \
++ $(SLO)$/lwpnotes.obj \
++ $(SLO)$/lwpverdocument.obj \
++ $(SLO)$/localtime.obj \
++ $(SLO)$/lwpfribmark.obj \
++ $(SLO)$/lwpbookmarkmgr.obj \
++ $(SLO)$/lwptblformula.obj\
++ $(SLO)$/lwpnumericfmt.obj \
++ $(SLO)$/lwpchangemgr.obj \
++ $(SLO)$/explode.obj \
++ $(SLO)$/lwpglobalmgr.obj
+
+ .INCLUDE : target.mk
+diff -urp '--exclude=unxlngx6.pro' lotuswordpro.bak/util/makefile.mk lotuswordpro/util/makefile.mk
+--- lotuswordpro.bak/util/makefile.mk 2008-10-22 14:01:16.000000000 +0800
++++ lotuswordpro/util/makefile.mk 2008-10-22 11:42:21.000000000 +0800
+@@ -7,7 +7,8 @@ VERSION=$(UPD)
+
+ LIB1TARGET= $(SLB)$/$(TARGET).lib
+ LIB1FILES= \
+- $(SLB)$/filter.lib
++ $(SLB)$/filter.lib \
++ $(SLB)$/xfilter.lib
+ SHL1LIBS=$(LIB1TARGET)
+ SHL1STDLIBS+= \
+ $(TOOLSLIB) \
+@@ -16,6 +17,15 @@ SHL1STDLIBS+= \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(SALLIB) \
++ $(SFXLIB) \
++ $(SOTLIB) \
++ $(VCLLIB) \
++ $(ICUUCLIB) \
++ $(ICUINLIB) \
++ $(ICULELIB) \
++ $(SVXLIB) \
++ $(GOODIESLIB) \
++ $(SVTOOLLIB) \
+ $(XMLOFFLIB)
+
+ SHL1TARGET = $(TARGET)$(DLLPOSTFIX)
Added: trunk/patches/lwp/cws-ooo11lotusfilter-lwp-filter.diff
==============================================================================
--- (empty file)
+++ trunk/patches/lwp/cws-ooo11lotusfilter-lwp-filter.diff Wed Oct 22 06:44:05 2008
@@ -0,0 +1,61797 @@
+diff -urNp lotuswordpro.bak/source/filter/bencont.cxx lotuswordpro/source/filter/bencont.cxx
+--- lotuswordpro.bak/source/filter/bencont.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/bencont.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,716 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "first.hxx"
++#include "assert.h"
++#include <stdio.h>
++#include <sot/storinfo.hxx>
++namespace OpenStormBento
++{
++
++// String definitions
++const char gsBenMagicBytes[] = BEN_MAGIC_BYTES;
++
++/**
++* New bento container from file stream
++* @param pointer to length of bento file
++* @param pointer to pointer of Bento Container object
++* @return error code
++*/
++ULONG BenOpenContainer(LwpSvStream * pStream, pLtcBenContainer * ppContainer)
++{
++ BenError Err;
++
++ *ppContainer = NULL;
++
++ if (NULL == pStream)
++ {
++ return BenErr_ContainerWithNoObjects;
++ }
++
++ pLtcBenContainer pContainer = new LtcBenContainer(pStream);
++ if ((Err = pContainer->Open()) != BenErr_OK) // delete two inputs
++ {
++ delete pContainer;
++ return BenErr_InvalidTOC;
++ }
++
++ *ppContainer = pContainer;
++ return BenErr_OK;
++}
++BenError
++LtcBenContainer::Close()
++{
++ return BenErr_OK;
++}
++
++LtcBenContainer::~LtcBenContainer()
++{
++ Close();
++}
++
++BenError
++LtcBenContainer::Open() // delete two inputs
++{
++ BenError Err;
++ CBenTOCReader TOCReader(this);
++ if ((Err = TOCReader.ReadLabelAndTOC()) != BenErr_OK)
++ {
++ return Err;
++ }
++ return BenErr_OK;
++}
++
++void
++LtcBenContainer::Release()
++{
++ delete this;
++}
++
++BenError
++LtcBenContainer::RegisterPropertyName(const char * sPropertyName,
++ pCBenPropertyName * ppPropertyName)
++{
++ pCBenNamedObjectListElmt pPrevNamedObjectListElmt;
++ pCBenNamedObject pNamedObject = FindNamedObject(&cNamedObjects,
++ sPropertyName, &pPrevNamedObjectListElmt);
++
++ if (pNamedObject != NULL)
++ {
++ if (! pNamedObject->IsPropertyName())
++ return BenErr_NameConflict;
++ else *ppPropertyName = (pCBenPropertyName) pNamedObject;
++ }
++ else
++ {
++ pCBenIDListElmt pPrevObject;
++ if (FindID(&cObjects, cNextAvailObjectID, &pPrevObject) != NULL)
++ return BenErr_DuplicateObjectID;
++
++ *ppPropertyName = new CBenPropertyName(this, cNextAvailObjectID,
++ (pCBenObject) pPrevObject, sPropertyName, pPrevNamedObjectListElmt);
++ ++cNextAvailObjectID;
++ }
++
++ return BenErr_OK;
++}
++
++BenError
++LtcBenContainer::RegisterTypeName(const char * sTypeName,
++ pCBenTypeName * ppTypeName)
++{
++ pCBenNamedObjectListElmt pPrevNamedObjectListElmt;
++ pCBenNamedObject pNamedObject = FindNamedObject(&cNamedObjects, sTypeName,
++ &pPrevNamedObjectListElmt);
++
++ if (pNamedObject != NULL)
++ {
++ if (! pNamedObject->IsTypeName())
++ return BenErr_NameConflict;
++ else *ppTypeName = (pCBenTypeName) pNamedObject;
++ }
++ else
++ {
++ pCBenIDListElmt pPrevObject;
++ if (FindID(&cObjects, cNextAvailObjectID, &pPrevObject) != NULL)
++ return BenErr_DuplicateObjectID;
++
++ *ppTypeName = new CBenTypeName(this, cNextAvailObjectID,
++ (pCBenObject) pPrevObject, sTypeName, pPrevNamedObjectListElmt);
++ ++cNextAvailObjectID;
++ }
++
++ return BenErr_OK;
++}
++
++BenError
++LtcBenContainer::NewObject(pCBenObject * ppBenObject)
++{
++ pCBenIDListElmt pPrev;
++ if (FindID(&cObjects, cNextAvailObjectID, &pPrev) != NULL)
++ return BenErr_DuplicateObjectID;
++
++ *ppBenObject = new CBenObject(this, cNextAvailObjectID, pPrev);
++
++ ++cNextAvailObjectID;
++ return BenErr_OK;
++}
++
++pCBenObject
++LtcBenContainer::GetNextObject(pCBenObject pCurrObject)
++{
++ return (pCBenObject) cObjects.GetNextOrNULL(pCurrObject);
++}
++
++pCBenObject
++LtcBenContainer::FindNextObjectWithProperty(pCBenObject pCurrObject,
++ BenObjectID PropertyID)
++{
++ while ((pCurrObject = GetNextObject(pCurrObject)) != NULL)
++ if (pCurrObject->UseProperty(PropertyID) != NULL)
++ return pCurrObject;
++
++ return NULL;
++}
++
++pCBenObject
++LtcBenContainer::FindObject(BenObjectID ObjectID)
++{
++ return (pCBenObject) FindID(&cObjects, ObjectID, NULL);
++}
++
++/**
++* Construction
++* @param Bento file stream pointer
++* @return
++*/
++LtcBenContainer::LtcBenContainer(LwpSvStream * pStream)
++{
++ cpStream = pStream;
++ pStream->Seek(STREAM_SEEK_TO_END);
++ m_ulLength = pStream->Tell();
++ pStream->Seek(STREAM_SEEK_TO_BEGIN);
++}
++
++/**
++* Read buffer fro bento file with specified buffer
++* @date 07/05/2004
++* @param buffer pointer
++* @param buffer size
++* @param number of bytes read
++* @return BenError
++*/
++BenError LtcBenContainer::Read(BenDataPtr pBuffer, unsigned long MaxSize,
++ unsigned long * pAmtRead)
++{
++ *pAmtRead = cpStream->Read(pBuffer, MaxSize);
++ return BenErr_OK;
++}
++/**
++* Read buffer from bento file with specified size
++* @date 07/05/2004
++* @param buffer pointer
++* @param number of bytes to be read
++* @return BenError
++*/
++BenError LtcBenContainer::ReadKnownSize(BenDataPtr pBuffer, unsigned long Amt)
++{
++ ULONG ulLength;
++ ulLength = cpStream->Read(pBuffer, Amt);
++ if(ulLength == Amt)
++ {
++ return BenErr_OK;
++ }
++ return BenErr_ReadPastEndOfContainer;
++}
++/**
++* Seek to position from the beginning of the bento file
++* @date 07/05/2004
++* @param position in container file from beginning
++* @return BenError
++*/
++BenError LtcBenContainer::SeekToPosition(BenContainerPos Pos)
++{
++ cpStream->Seek(Pos);
++ return BenErr_OK;
++}
++/**
++* Seek to position compare to end of bento file
++* @date 07/05/2004
++* @param position in container file from end
++* @return BenError
++*/
++BenError LtcBenContainer::SeekFromEnd(long Offset)
++{
++ cpStream->Seek(STREAM_SEEK_TO_END);
++ cpStream->SeekRel(Offset);
++
++ return BenErr_OK;
++}
++/**
++* Get position in the bento file
++* @date 07/05/2004
++* @param pointer of current position in container file from end
++* @return BenError
++*/
++BenError LtcBenContainer::GetPosition(BenContainerPos * pPosition)
++{
++ *pPosition = cpStream->Tell();
++ return BenErr_OK;
++}
++/**
++* Find the next value stream with property name
++* @date 07/05/2004
++* @param string of property name
++* @param current value stream pointer with the property name
++* @return next value stream pointer with the property names
++*/
++LtcUtBenValueStream * LtcBenContainer::FindNextValueStreamWithPropertyName(const char * sPropertyName, LtcUtBenValueStream * pCurrentValueStream)
++{
++ CBenPropertyName * pPropertyName;
++ RegisterPropertyName(sPropertyName, &pPropertyName); // Get property name object
++
++ if (NULL == pPropertyName)
++ return NULL; // Property not exist
++
++ // Get current object
++ CBenObject * pObj = NULL;
++ if (pCurrentValueStream != NULL)
++ {
++ pObj = pCurrentValueStream->GetValue()->GetProperty()->GetBenObject();
++ }
++
++
++ pObj =FindNextObjectWithProperty(pObj, pPropertyName->GetID()); // Get next object with same property name
++ if (NULL == pObj)
++ return NULL;
++
++ CBenValue * pValue;
++ LtcUtBenValueStream * pValueStream;
++
++ pValue = pObj->UseValue(pPropertyName->GetID());
++
++ pValueStream = new LtcUtBenValueStream(pValue);
++
++ return pValueStream;
++}
++
++/**
++* Find the unique value stream with property name
++* @date 07/05/2004
++* @param string of property name
++* @return the only value stream pointer with the property names
++*/
++LtcUtBenValueStream * LtcBenContainer::FindValueStreamWithPropertyName(const char * sPropertyName)
++{
++ return FindNextValueStreamWithPropertyName(sPropertyName, NULL);
++}
++/**
++* Find the unique value stream with property name and Object ID
++* @date 10/24/2005
++* @param object ID
++* @param string of property name
++* @return the only value stream pointer with the property names
++*/
++LtcUtBenValueStream * LtcBenContainer::FindObjectValueStreamWithObjectIDAndProperty(BenObjectID ObjectID, const char * sPropertyName)
++{
++ CBenPropertyName * pPropertyName;
++ RegisterPropertyName(sPropertyName, &pPropertyName); // Get property name object
++ if (NULL == pPropertyName)
++ return NULL; // Property not exist
++ // Get current object
++ CBenObject * pObj = NULL;
++ pObj = FindObject(ObjectID); // Get object with object ID
++ if (NULL == pObj)
++ return NULL;
++ CBenValue * pValue;
++ LtcUtBenValueStream * pValueStream;
++ pValue = pObj->UseValue(pPropertyName->GetID());
++ pValueStream = new LtcUtBenValueStream(pValue);
++ return pValueStream;
++}
++/**
++* <description>
++* @date 07/05/2004
++* @param pointer to length of bento file
++* @return BenError
++*/
++BenError LtcBenContainer::GetSize(ULONG * pLength)
++{
++ *pLength = m_ulLength;
++ return BenErr_OK;
++}
++
++sal_uInt32 GetSvStreamSize(SvStream * pStream)
++{
++ sal_uInt32 nCurPos = pStream->Tell();
++ pStream->Seek(STREAM_SEEK_TO_END);
++ sal_uInt32 ulLength = pStream->Tell();
++ pStream->Seek(nCurPos);
++
++ return ulLength;
++}
++/**
++* Find hazily according to part of property name
++* @date 01/31/2005
++* @param
++* @return the value stream pointers vector with the property names
++*/
++BenError LtcBenContainer::CreateGraphicStreams(std::vector<SvStream *> * pStreamVector)
++{
++ /* traverse all named objects to find all the graphic property names */
++ CBenObject * pObj= NULL;
++ char *pName;
++ std::vector<std::string> aGrPropertyVector ;
++ while(pObj = GetNextObject(pObj) )
++ {
++ if(pObj->IsNamedObject())
++ {
++ CBenNamedObject * pNamedObj = static_cast<CBenNamedObject *>(pObj);
++ if(!pNamedObj->IsPropertyName())
++ continue;
++
++ // Gr2E,41FDD458-S
++ // Gr2E,41FDD458-D
++ pName = const_cast<char *>(pNamedObj->GetName());
++ if ( (pName[0] == 'G')
++ && (pName[1] == 'r')
++ &&( (pName[14] == 'D') || (pName[14] == 'S') ) )
++ {
++ aGrPropertyVector.push_back(std::string(pName));
++ }
++ }
++ }
++
++ /* traverse the found properties and construct the stream vectors */
++ std::vector<std::string>::iterator itor;
++ for (itor = aGrPropertyVector.begin(); itor != aGrPropertyVector.end(); itor ++)
++ {
++ // get property names with suffix of S&D
++ char sSName[32], sDName[32];
++ strcpy(sSName, itor->c_str());
++ strcpy(sDName, itor->c_str());
++ sSName[14] = 'S';
++ sDName[14] = 'D';
++
++ // erase strings in vector
++ std::vector<std::string>::iterator itorSearch;
++ for (itorSearch = aGrPropertyVector.begin(); itorSearch != aGrPropertyVector.end(); itorSearch ++)
++ {
++ if( (*itorSearch == sSName) || (*itorSearch == sDName) )
++ {
++ std::vector<std::string>::iterator itorDel = itorSearch;
++ aGrPropertyVector.erase(itorDel);
++ }
++ }
++
++ // get S&D's stream and merge them together
++ {
++ SvStream *pD = NULL, *pS = NULL;
++
++ pS = FindValueStreamWithPropertyName(sSName);
++ assert(pS != NULL);
++ pD = FindValueStreamWithPropertyName(sDName);
++ assert(pD != NULL);
++
++ sal_uInt32 nDLen = GetSvStreamSize(pD);
++ sal_uInt32 nLen = GetSvStreamSize(pS) + nDLen;
++ assert(nLen > 0);
++ char * pBuf = new char[nLen];
++ assert(pBuf != NULL);
++ char * pPointer = pBuf;
++ pD->Read(pPointer, nDLen);
++ pPointer += nDLen;
++ pS->Read(pPointer, nLen - nDLen);
++
++ delete pS;
++ delete pD;
++
++ SvMemoryStream * pStream = new SvMemoryStream(pBuf, nLen, STREAM_READ);
++ assert(pStream != NULL);
++
++ pStreamVector->push_back(pStream);
++ }
++ }
++
++ aGrPropertyVector.clear();
++ return BenErr_OK;
++}
++
++/**
++* Find hazily according to object ID
++* @date 01/31/2005
++* @param pObjectname - format as "GrXX,XXXXXXXX" wherein XX is high part of object ID, and XXXXXXXX is low part
++* @return the value stream pointers with the property names
++*/
++BenError LtcBenContainer::CreateGraphicStream(SvStream * &pStream, const char *pObjectName)
++{
++ if (!pObjectName)
++ {
++ pStream = NULL;
++ return BenErr_NamedObjectError;
++ }
++ // construct the string of property name
++ char sSName[64]="";
++ char sDName[64]="";
++
++ sprintf(sSName, "%s-S", pObjectName);
++ sprintf(sDName, "%s-D", pObjectName);
++
++ /* traverse the found properties and construct the stream vectors */
++ SvMemoryStream * pMemStream = NULL;
++ // get S&D's stream and merge them together
++ SvStream *pD = NULL, *pS = NULL;
++
++ pS = FindValueStreamWithPropertyName(sSName);
++ pD = FindValueStreamWithPropertyName(sDName);
++
++
++ sal_uInt32 nDLen = 0;
++ if(pD)
++ {
++ nDLen = GetSvStreamSize(pD);
++ }
++ sal_uInt32 nLen = nDLen;
++ if(pS)
++ {
++ nLen += GetSvStreamSize(pS) ;
++ }
++
++ assert(nLen > 0);
++ char * pBuf = new char[nLen];
++ assert(pBuf != NULL);
++ char * pPointer = pBuf;
++ if(pD)
++ {
++ pD->Read(pPointer, nDLen);
++ delete pD;
++ }
++ pPointer += nDLen;
++ if(pS)
++ {
++ pS->Read(pPointer, nLen - nDLen);
++ delete pS;
++ }
++
++ pMemStream = new SvMemoryStream(pBuf, nLen, STREAM_READ);
++ assert(pMemStream != NULL);
++
++ pStream = pMemStream;
++ return BenErr_OK;
++}
++/**
++* Find ole object stream according to object name
++* @date 10/24/2005
++* @param
++* @return the value ole storage stream pointers
++*/
++#include <tools/globname.hxx>
++SotStorageStreamRef LtcBenContainer::ConvertAswStorageToOLE2Stream(const char * sObjectName)
++{
++ SotStorageStreamRef xOleObjStm;
++
++ SvStream* pOleStorageStream = NULL;
++ //Get Ole Storage stream
++ AswEntry aEntry;
++ pOleStorageStream = FindOLEStorageStreamWithObjectName(sObjectName, aEntry);
++
++ if( !pOleStorageStream )
++ return xOleObjStm;
++ //Find it, create Ole stream
++ //xOleObjStm = new SotStorageStream(String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Ole-Object" ) ));
++ xOleObjStm = new SotStorageStream(String());
++ if( xOleObjStm->GetError() )
++ return xOleObjStm;
++ xOleObjStm->SetBufferSize( 0xff00 );
++
++ SotStorageRef xOleObjStor = new SotStorage( *xOleObjStm );
++ if( xOleObjStor->GetError() )
++ return xOleObjStm;
++ //Set class id
++ ClsId aClsId = aEntry.GetClassId();
++ SvGlobalName aGName( aClsId.n1, aClsId.n2, aClsId.n3, aClsId.n4,
++ aClsId.n5, aClsId.n6,aClsId.n7,aClsId.n8,
++ aClsId.n9,aClsId.n10,aClsId.n11);
++ xOleObjStor->SetClass( aGName, 0, String());
++
++ xOleObjStor->SetVersion( SOFFICE_FILEFORMAT_60 );
++ std::string aOleStreamName("OleStream");
++ sal_uInt32 nDLen = 0;
++ nDLen = GetSvStreamSize(pOleStorageStream);
++ for(sal_uInt32 nIndex = 0; nIndex < nDLen / ASWENTRY_SIZE; nIndex ++)
++ {
++ AswEntry aOleEntry;
++ ReadAswEntry(pOleStorageStream, aOleEntry);
++ if(aOleEntry.GetType()== BEN_STGTY_STREAM)
++ {
++ SvStream* pOleStream = FindObjectValueStreamWithObjectIDAndProperty(aOleEntry.GetObjectID(), aOleStreamName.c_str());
++ if(pOleStream)
++ {
++ String strName;
++ aOleEntry.GetName(strName);
++ SotStorageStreamRef xStm = xOleObjStor->OpenSotStream( strName );
++ if( xStm->GetError() )
++ break;
++ xStm->SetBufferSize( 8192 );
++ (*pOleStream) >> (*xStm);
++ xStm->Commit();
++ delete pOleStream;
++ pOleStream = NULL;
++ }
++ }
++ }
++ xOleObjStor->Commit();
++ xOleObjStm->Commit();
++
++ return xOleObjStm;
++}
++/**
++* Find ole object storage stream data according to object name
++* @date 10/24/2005
++* @param
++* @return the value ole storage stream data pointers
++*/
++LtcUtBenValueStream* LtcBenContainer::FindOLEStorageStreamWithObjectName(const char * sObjectName, AswEntry& rEntry)
++{
++ if (!sObjectName)
++ return NULL;
++
++ //Find OleRootStorage stream
++ std::string aRootStroageName("OleRootStorage");
++ std::string aOleStroageName("OleStorage");
++ LtcUtBenValueStream* pRootStream = NULL;
++ pRootStream = FindValueStreamWithPropertyName(aRootStroageName.c_str());
++ if(!pRootStream)
++ return NULL;
++ //Read root storage data and find the ole storage object id according to the object name
++ sal_uInt32 nDLen = 0;
++ nDLen = GetSvStreamSize(pRootStream);
++ for(sal_uInt32 nIndex = 0; nIndex < nDLen / ASWENTRY_SIZE; nIndex ++)
++ {
++ //Get entry
++ ReadAswEntry(pRootStream, rEntry);
++ String sObjName;
++ rEntry.GetName(sObjName);
++ if(sObjName.EqualsAscii(sObjectName))
++ {
++ //Find it
++ delete pRootStream;
++ return FindObjectValueStreamWithObjectIDAndProperty(rEntry.GetObjectID(), aOleStroageName.c_str());
++ }
++ }
++
++ // Not find
++ if(pRootStream)
++ {
++ delete pRootStream;
++ }
++
++ return NULL;
++}
++void LtcBenContainer::ReadAswEntry(SvStream * pStream, AswEntry & rEntry)
++{
++ char* pBuf = new char[ASWENTRY_SIZE];
++ pStream->Read(pBuf, ASWENTRY_SIZE);
++ rEntry.Load(pBuf);
++ delete[] pBuf;
++}
++////////////////////////////////////////////////////////////////////
++//classs AswEntry
++AswEntry::AswEntry()
++{
++ Init();
++}
++void AswEntry::Init()
++{
++ memset( this, 0, sizeof (AswEntry));
++}
++void AswEntry::SetName( const String& rName )
++{
++ int i;
++ for( i = 0; i < rName.Len() && i < 68; i++ )
++ nName[ i ] = rName.GetChar( i );
++ while( i < 68 )
++ nName[ i++ ] = 0;
++}
++void AswEntry::GetName(String & rName) const
++{
++ rName = nName;
++}
++void AswEntry::Store( void* pTo )
++{
++ SvMemoryStream r( (sal_Char *)pTo, ASWENTRY_SIZE, STREAM_WRITE );
++ for( short i = 0; i < 68; i++ )
++ r << nName[ i ]; // 00 name as WCHAR
++ r<< nMtime[ 0 ] // 42 entry type
++ << nMtime[ 1 ] // 43 0 or 1 (tree balance?)
++ << nCtime[ 0 ] // 44 left node entry
++ << nCtime[ 1 ] // 48 right node entry
++ << nAtime[ 0 ] // 44 left node entry
++ << nAtime[ 1 ]; // 48 right node entry
++ r.Write(&aClsId ,16); // 50 class ID (optional)
++ r<< nStatebits // 60 state flags(?)
++ << nType
++ << nObjectIDRef // 64 modification time
++ << nMversion // 6C creation and access time
++ << nLversion // 6C creation and access time
++ << nReserved[ 0 ] // 74 starting block (either direct or translated)
++ << nReserved[ 1 ]; // 78 file size
++}
++void AswEntry::Load( const void* pFrom )
++{
++ SvMemoryStream r( (sal_Char *)pFrom, ASWENTRY_SIZE, STREAM_WRITE );
++ for( short i = 0; i < 68; i++ )
++ r >> nName[ i ]; // 00 name as WCHAR
++ r>> nMtime[ 0 ] // 42 entry type
++ >> nMtime[ 1 ] // 43 0 or 1 (tree balance?)
++ >> nCtime[ 0 ] // 44 left node entry
++ >> nCtime[ 1 ] // 48 right node entry
++ >> nAtime[ 0 ] // 44 left node entry
++ >> nAtime[ 1 ]; // 48 right node entry
++ r.Read(&aClsId,16); // 50 class ID (optional)
++ r>> nStatebits // 60 state flags(?)
++ >> nType
++ >> nObjectIDRef // 64 modification time
++ >> nMversion // 6C creation and access time
++ >> nLversion // 6C creation and access time
++ >> nReserved[ 0 ] // 74 starting block (either direct or translated)
++ >> nReserved[ 1 ]; // 78 file size
++}
++void AswEntry::SetClassId( const ClsId& r )
++{
++ memcpy( &aClsId, &r, sizeof( ClsId ) );
++}
++///////////////////////////////////////////////////////////////////
++}// end namespace OpenStormBento
+diff -urNp lotuswordpro.bak/source/filter/benlist.cxx lotuswordpro/source/filter/benlist.cxx
+--- lotuswordpro.bak/source/filter/benlist.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/benlist.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,121 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "first.hxx"
++namespace OpenStormBento
++{
++
++pCBenNamedObject
++FindNamedObject(pCUtList pList, const char * sName,
++ pCBenNamedObjectListElmt * ppPrev)
++{
++ pCUtListElmt pTerminating = pList->GetTerminating();
++ for (pCUtListElmt pCurr = pList->GetLast(); pCurr != pTerminating;
++ pCurr = pCurr->GetPrev())
++ {
++ pCBenNamedObjectListElmt pCurrNamedObjectListElmt =
++ (pCBenNamedObjectListElmt) pCurr;
++
++
++ //Old code
++// int Comp = strcmp(sName, pCurrNamedObjectListElmt->GetNamedObject()->
++// GetName());
++ int Comp = strcmp(sName, pCurrNamedObjectListElmt->GetNamedObject()->
++ GetNameCStr());
++
++
++ if (Comp == 0)
++ return pCurrNamedObjectListElmt->GetNamedObject();
++ else if (Comp < 0)
++ continue;
++ else
++ {
++ if (ppPrev != NULL)
++ *ppPrev = pCurrNamedObjectListElmt;
++ return NULL;
++ }
++ }
++
++ if (ppPrev != NULL)
++ *ppPrev = (pCBenNamedObjectListElmt) pTerminating;
++ return NULL;
++}
++
++// Assume list is of BenIDListElmt list elements, sorted by ID
++pCBenIDListElmt
++FindID(pCUtList pList, BenObjectID ObjectID, pCBenIDListElmt * ppPrev)
++{
++ pCUtListElmt pTerminating = pList->GetTerminating();
++ for (pCUtListElmt pCurr = pList->GetLast(); pCurr != pTerminating;
++ pCurr = pCurr->GetPrev())
++ {
++ pCBenIDListElmt pCurrIDListElmt = (pCBenIDListElmt) pCurr;
++
++ if (ObjectID == pCurrIDListElmt->GetID())
++ return pCurrIDListElmt;
++ else if (ObjectID < pCurrIDListElmt->GetID())
++ continue;
++ else
++ {
++ if (ppPrev != NULL)
++ *ppPrev = pCurrIDListElmt;
++ return NULL;
++ }
++ }
++
++ if (ppPrev != NULL)
++ *ppPrev = (pCBenIDListElmt) pTerminating;
++ return NULL;
++}
++} //end namespace OpenStormBento
+diff -urNp lotuswordpro.bak/source/filter/benname.cxx lotuswordpro/source/filter/benname.cxx
+--- lotuswordpro.bak/source/filter/benname.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/benname.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,91 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "first.hxx"
++namespace OpenStormBento
++{
++#if 0
++CBenNamedObject::CBenNamedObject(pLtcBenContainer pContainer,
++ BenObjectID ObjectID, pCBenObject pPrevObject, const char * sName,
++ pCBenNamedObjectListElmt pPrevNamedObjectListElmt) :
++ CBenObject(pContainer, ObjectID, pPrevObject), csName(sName),
++ cNameListElmt(this, pPrevNamedObjectListElmt)
++{
++}
++#endif
++ // changed by to remove warning 2004-06-24
++CBenNamedObject::CBenNamedObject(pLtcBenContainer pContainer,
++ BenObjectID ObjectID, pCBenObject pPrevObject, const char * sName,
++ pCBenNamedObjectListElmt pPrevNamedObjectListElmt) :
++ CBenObject(pContainer, ObjectID, pPrevObject), csName(sName),
++ cNameListElmt( pPrevNamedObjectListElmt)
++{
++ cNameListElmt.SetNamedObject(this);
++}
++
++UtBool CBenNamedObject::IsNamedObject()
++{ return UT_TRUE; }
++
++UtBool CBenNamedObject::IsPropertyName()
++{ return UT_FALSE; }
++
++UtBool CBenNamedObject::IsTypeName()
++{ return UT_FALSE; }
++
++UtBool CBenPropertyName::IsPropertyName()
++{ return UT_TRUE; }
++
++UtBool CBenTypeName::IsTypeName()
++{ return UT_TRUE; }
++} // end namespace OpenStormBento
+diff -urNp lotuswordpro.bak/source/filter/benobj.cxx lotuswordpro/source/filter/benobj.cxx
+--- lotuswordpro.bak/source/filter/benobj.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/benobj.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,128 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "first.hxx"
++namespace OpenStormBento
++{
++
++UtBool
++CBenObject::IsNamedObject()
++{
++ return UT_FALSE;
++}
++
++pCBenProperty
++CBenObject::GetNextProperty(pCBenProperty pCurrProperty)
++{
++ return (pCBenProperty) cProperties.GetNextOrNULL(pCurrProperty);
++}
++
++pCBenProperty
++CBenObject::UseProperty(BenObjectID PropertyID)
++{
++ pCBenIDListElmt pPrev;
++ return (pCBenProperty) FindID(&cProperties, PropertyID, &pPrev);
++}
++
++void
++CBenObject::DeleteProperty(pCBenProperty pProperty)
++{
++ delete pProperty;
++}
++
++pCBenValue
++CBenObject::UseValue(BenObjectID PropertyID)
++{
++ pCBenProperty pProperty = UseProperty(PropertyID);
++ if (pProperty == NULL)
++ return NULL;
++ return pProperty->UseValue();
++}
++
++pCBenValue
++CBenObject::UseValueWithPropertyName(const char * sPropertyName)
++{
++ pCBenPropertyName pPropertyName;
++ if (GetContainer()->RegisterPropertyName(sPropertyName, &pPropertyName)
++ != BenErr_OK)
++ return NULL;
++
++ return UseValue(pPropertyName->GetID());
++}
++
++pCBenValue
++CBenObject::UseSingleValue()
++{
++ if (cProperties.IsEmpty() || cProperties.ContainsAtLeastTwoItems())
++ return NULL;
++ pCBenProperty pProperty = (pCBenProperty) cProperties.GetFirst();
++ return pProperty->UseValue();
++}
++
++BenError
++CBenObject::NewValue(BenObjectID PropertyID, BenObjectID TypeID, pCBenValue *
++ ppValue)
++{
++ pCBenIDListElmt pPrevProperty;
++ pCBenProperty pProperty = (pCBenProperty) FindID(&cProperties,
++ PropertyID, &pPrevProperty);
++ if (pProperty != NULL)
++ return BenErr_PropertyAlreadyExists;
++
++ pProperty = new CBenProperty(this, PropertyID, TypeID, pPrevProperty);
++ *ppValue = pProperty->UseValue();
++
++ return BenErr_OK;
++}
++}// end namespace OpenStormBento
+diff -urNp lotuswordpro.bak/source/filter/bento.hxx lotuswordpro/source/filter/bento.hxx
+--- lotuswordpro.bak/source/filter/bento.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/bento.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,567 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef BENTO_H
++#define BENTO_H
++
++#include <string>
++#include <vector>
++#include "lwpsvstream.hxx"
++
++#define BEN_CC __stdcall
++#ifdef COMP_BENTO
++#define BEN_EXPORT __declspec(dllexport)
++#else
++#define BEN_EXPORT
++#endif
++
++using namespace std;
++
++#include "ut.hxx"
++#include "utlist.hxx"
++// removed for WordPro filter, 2005-01-27
++//#include <scerrors.hxx> // error code defined for SC
++//#include <filter.hxx> // error code defined for SC filters
++#include <tools/stream.hxx> // SvStream definition
++#include <sot/storage.hxx> // SotStorageStream definition, add by 10/24/2005
++
++namespace OpenStormBento
++{
++
++#define BEN_CURR_MAJOR_VERSION 2
++#define BEN_CURR_MINOR_VERSION 0
++#define BEN_MAGIC_BYTES_SIZE 8
++#define BEN_LABEL_SIZE 24
++
++#define BEN_MAGIC_BYTES "\xA4""CM""\xA5""Hdr""\xD7"
++//For Ole2DirectoryStruct, Add by 10/24/2005
++#define BEN_STGTY_STORAGE 1
++#define BEN_STGTY_STREAM 2
++#define ASWENTRY_SIZE 204
++struct ClsId
++{
++ INT32 n1;
++ INT16 n2, n3;
++ UINT8 n4, n5, n6, n7, n8, n9, n10, n11;
++};
++class AswEntry //total length: 204
++{
++ UINT16 nName[ 68 ]; //Name of IStorage or IStream referenced by this entry, length = 136
++ INT32 nMtime[ 2 ];
++ INT32 nCtime[ 2 ];
++ INT32 nAtime[ 2 ];
++ ClsId aClsId; //CLSID from OLE 2 IStorage::SetClass call
++ UINT32 nStatebits; //State bits from OLE 2 IStorage::SetStateBits call
++ UINT32 nType; // STGTY_STORAGE: 1 or STGTY_STREAM:2,
++ UINT32 nObjectIDRef; //Persistent Bento reference to Bento object for this IStorage or IStream
++ UINT32 nMversion;
++ UINT32 nLversion;
++ UINT32 nReserved[2]; //skip 16 char
++public:
++ AswEntry();
++ void Init(); // initialize the data
++ void SetName( const String& ); // store a name (ASCII, up to 32 chars)
++ void GetName( String& rName ) const;
++ void Load( const void* );
++ void Store( void* );
++ UINT32 GetType() const { return nType; }
++ void SetType( UINT32 t ) { nType = t;}
++ const ClsId& GetClassId() const { return aClsId;}
++ void SetClassId( const ClsId& );
++ void SetObjectID(UINT32 id) { nObjectIDRef = id;}
++ UINT32 GetObjectID() const { return nObjectIDRef;}
++};
++//End by
++
++enum BenError
++{
++ BenErr_OK = 0,
++ BenErr_NameConflict = 1,
++ BenErr_DuplicateObjectID = 2,
++ BenErr_UnknownBentoFormatVersion = 3,
++ BenErr_NamedObjectError = 4,
++ BenErr_NamedObjectIllegalValue = 5,
++ BenErr_InvalidTOC = 6,
++ BenErr_64BitOffsetNotSupported = 7,
++ BenErr_ReadPastEndOfTOC = 8,
++ BenErr_ContainerWithNoObjects = 9,
++ BenErr_ObjectWithNoProperties = 10,
++ BenErr_PropertyWithNoValues = 11,
++ BenErr_IllegalInMemoryTOC = 12,
++ BenErr_PropertyAlreadyExists = 13,
++ BenErr_UnexpectedEndOfFile = 14,
++ BenErr_InvalidWriteOffset = 15,
++ BenErr_InvalidImmediateWrite = 16,
++ BenErr_TOCSeedError = 17,
++ BenErr_ReadPastEndOfContainer = 18,
++ BenErr_DuplicateName = 19,
++ BenErr_BadReferencedList = 20,
++ BenErr_IllegalContinuedImmediate = 21,
++ BenErr_NotBentoContainer = 22,
++ BenErr_PropertyWithMoreThanOneValue = 23
++
++ // IMPORTANT - UtStream errors (UtErr_....) are also valid Bento
++ // errors. They have codes of 100 and higher. When, say, a Bento
++ // container open fails due to an access violation (somebody else, say,
++ // has it open exclusive), will get a UtErr code. If define own
++ // subclass of UtStream (custom handler), can define own error codes--
++ // those should start at 200
++};
++/*
++ * These two functions are useless in SODC
++ *
++inline UtError BenToUtError(BenError Err)
++{
++ if (Err == 0 || Err >= 100)
++ return (UtError) Err;
++ else return UtErr_Fail;
++}
++
++inline BenError UtToBenError(UtError Err)
++{ UT_ASSERT(Err == 0 || Err >= 100); return (BenError) Err; }
++enum BenSeekMode {
++ BenSeek_FromStart = 1,
++ BenSeek_FromCurr = 2,
++ BenSeek_FromEnd = 3
++};
++*/
++
++UtDefClassP(LtcBenContainer);
++UtDefClassP(CBenIDListElmt);
++UtDefClassP(CBenObject);
++UtDefClassP(CBenProperty);
++UtDefClassP(CBenReference);
++UtDefClassP(CBenValue);
++UtDefClassP(CBenValueSegment);
++UtDefClassP(CBenNamedObjectListElmt);
++UtDefClassP(CBenNamedObject);
++UtDefClassP(CBenPropertyName);
++UtDefClassP(CBenTypeName);
++
++typedef unsigned char BenByte;
++typedef unsigned short BenWord;
++typedef unsigned long BenDWord;
++typedef void * BenDataPtr;
++typedef const void * BenConstDataPtr;
++
++typedef unsigned long BenContainerPos;
++typedef unsigned long BenObjectID;
++typedef unsigned long BenGeneration;
++
++ULONG BenOpenContainer(LwpSvStream * pStream, pLtcBenContainer * ppContainer);
++
++class CBenIDListElmt : public CUtListElmt
++{
++public: // Internal methods
++ CBenIDListElmt(BenObjectID ID, pCBenIDListElmt pPrev) : CUtListElmt(pPrev)
++ { cID = ID; }
++ CBenIDListElmt(BenObjectID ID) { cID = ID; }
++ BenObjectID GetID() { return cID; }
++
++private: // Data
++ BenObjectID cID;
++};
++
++class CBenNamedObjectListElmt : public CUtListElmt
++{
++public: // Methods
++ // added by to remove warning 2004-06-24
++ CBenNamedObjectListElmt(pCBenNamedObjectListElmt pPrev) : CUtListElmt(pPrev)
++ { cpNamedObject = NULL; }
++ void SetNamedObject(pCBenNamedObject pObj)
++ {
++ cpNamedObject = pObj;
++ }
++
++ CBenNamedObjectListElmt(pCBenNamedObject pNamedObject,
++ pCBenNamedObjectListElmt pPrev) : CUtListElmt(pPrev)
++ { cpNamedObject = pNamedObject; }
++ pCBenNamedObject GetNamedObject() { return cpNamedObject; }
++
++private: // Data
++ pCBenNamedObject cpNamedObject;
++};
++
++class LtcUtBenValueStream : public SvStream
++{
++public:
++ LtcUtBenValueStream(pCBenValue pValue);
++ ~LtcUtBenValueStream();
++
++public: // Overridden methods
++#if 0 // Deleted by 2004-06-16
++ UtError Open(UtBool /* OpenNew */, UtStrmOpenFlags /* Flags */);
++ UtError Close();
++ UtError Seek(long Offset, UtSeekMode Mode);
++ UtError GetPosition(unsigned long * pPosition);
++ UtError GetSize(unsigned long * pSize);
++ UtError Read(UtStrmDataPtr pBuffer, unsigned long MaxSize,
++ unsigned long * pAmtRead);
++ UtError Write(UtConstStrmDataPtr pBuffer, unsigned long Size,
++ unsigned long * pAmtWritten);
++ UtError Flush();
++#endif
++
++ /* added by */
++ CBenValue * GetValue(){ return cpValue; };
++ ULONG GetSize() { return m_ulValueLength; };
++protected: // Overridden methods
++
++ virtual ULONG GetData( void* pData, ULONG nSize );
++ virtual ULONG PutData( const void* pData, ULONG nSize );
++ virtual ULONG SeekPos( ULONG nPos );
++ virtual void SetSize( ULONG nSize );
++ virtual void FlushData();
++
++#if 0// Deleted by 2004-06-16
++ UtError TruncateSize(unsigned long Size);
++#endif
++private: // Data
++ pCBenValue cpValue;
++ unsigned long cCurrentPosition;
++
++ ULONG m_ulValueLength; // Added by , sum of length of all sub-valuesegments
++// void GetAmountLeft(ULONG * pAmtLeft); useless in SODC
++};
++
++class LtcBenContainer
++{
++public:
++ BenError Open();
++ void Release(); // Deletes container object--last call
++ BenError Close();
++ BenError RegisterTypeName(const char * sTypeName,
++ pCBenTypeName * ppTypeName);
++ BenError RegisterPropertyName(const char * sPropertyName,
++ pCBenPropertyName * ppPropertyName);
++ // Pass NULL to begin iteration. Done when returns NULL.
++ // Objects are returned in order of increasing ID
++ pCBenObject GetNextObject(pCBenObject pCurrObject);
++ pCBenObject FindObject(BenObjectID ObjectID);
++ pCBenObject FindNextObjectWithProperty(pCBenObject pCurrObject,
++ BenObjectID PropertyID);
++ BenError BEN_EXPORT NewObject(pCBenObject * ppBenObject);
++
++public: // Internal methods
++ LtcBenContainer(LwpSvStream * pStream);
++ ~LtcBenContainer();
++
++ BenError Read(BenDataPtr pBuffer, unsigned long MaxSize,
++ unsigned long * pAmtRead);
++ BenError ReadKnownSize(BenDataPtr pBuffer, unsigned long Amt);
++ BenError SeekToPosition(BenContainerPos Pos);
++ BenError SeekFromEnd(long Offset);
++
++ BenError GetPosition(BenContainerPos * pPosition);
++
++ BenObjectID GetNextAvailObjectID() { return cNextAvailObjectID; }
++ void SetNextAvailObjectID(BenObjectID ID) { cNextAvailObjectID = ID; }
++ pCUtList GetObjects() { return &cObjects; }
++ pCUtList GetNamedObjects() { return &cNamedObjects; }
++
++ // Added by 2004-06-10
++ LtcUtBenValueStream * FindNextValueStreamWithPropertyName(const char * sPropertyName, LtcUtBenValueStream * pCurrentValueStream);
++ LtcUtBenValueStream * FindValueStreamWithPropertyName(const char * sPropertyName);
++ LtcUtBenValueStream * FindObjectValueStreamWithObjectIDAndProperty(BenObjectID ObjectID, const char * sPropertyName);
++ BenError CreateGraphicStreams(std::vector<SvStream *> * pStreamVector) ;
++ BenError CreateGraphicStream(SvStream * &pStream, const char *pObjectName);
++ //Add by 10/24/2005
++ SotStorageStreamRef ConvertAswStorageToOLE2Stream(const char * sObjectName);
++ LtcUtBenValueStream * FindOLEStorageStreamWithObjectName(const char * sObjectName, AswEntry& rDirStruct);
++ void ReadAswEntry(SvStream * pStream, AswEntry& rEntry);
++
++ BenError GetSize(ULONG * pLength);
++ LwpSvStream * GetStream()
++ {
++ return cpStream;
++ };
++private: // Data
++ CUtOwningList cObjects;
++ CUtList cNamedObjects;
++ LwpSvStream * cpStream;
++ ULONG m_ulLength; // Added for TOCRead.cpp
++ BenObjectID cNextAvailObjectID; // for new object
++};
++
++class CBenObject : public CBenIDListElmt
++{
++public:
++ pCBenProperty GetNextProperty(pCBenProperty pCurrProperty);
++ pCBenProperty UseProperty(BenObjectID PropertyID);
++ void DeleteProperty(pCBenProperty pProperty);
++ pCBenValue UseValue(BenObjectID PropertyID);
++ pCBenValue UseSingleValue();
++ // Inefficient to use this method if will use property multiple times--
++ // instead register property and call UseProperty with property ID
++ pCBenValue UseValueWithPropertyName(const char * sPropertyName);
++ virtual UtBool IsNamedObject();
++ pLtcBenContainer GetContainer() { return cpContainer; }
++ BenObjectID GetObjectID() { return GetID(); }
++ BenError BEN_EXPORT NewValue(BenObjectID PropertyID, BenObjectID TypeID,
++ pCBenValue * ppValue);
++public: // Internal methods
++ CBenObject(pLtcBenContainer pContainer, BenObjectID ObjectID,
++ pCBenIDListElmt pPrev) : CBenIDListElmt(ObjectID, pPrev)
++ { cpContainer = pContainer; }
++ pCUtList GetProperties() { return &cProperties; }
++
++private: // Data
++ pLtcBenContainer cpContainer;
++ CUtOwningList cProperties;
++};
++
++class CBenValue : public CBenIDListElmt
++{
++public:
++ unsigned long GetValueSize();
++ BenError ReadValueData(BenDataPtr pBuffer,
++ unsigned long Offset, unsigned long MaxSize, unsigned long * pAmtRead);
++ BenError ReadValueDataKnownSize(BenDataPtr pBuffer,
++ unsigned long Offset, unsigned long Amt);
++
++ BenError BEN_EXPORT WriteValueData(BenConstDataPtr pBuffer,
++ unsigned long Offset, unsigned long Size);
++ BenError BEN_EXPORT WriteValueData(BenConstDataPtr pBuffer,
++ unsigned long Offset, unsigned long Size, unsigned long * pAmtWritten);
++ BenError BEN_EXPORT WriteImmediateValueData(BenConstDataPtr pBuffer,
++ unsigned short Size);
++ BenError BEN_EXPORT TruncateValueSize(unsigned long NewSize);
++ BenError BEN_EXPORT NewReference(BenObjectID ReferencedObjectID,
++ pCBenReference pReference);
++ BenObjectID BEN_EXPORT GetReferencedObject(pCBenReference pReference);
++
++
++ pCBenProperty BEN_EXPORT GetProperty() { return cpProperty; }
++
++public: // Internal methods
++ // added by to remove WARNING 2004-06-24
++ CBenValue(BenObjectID TypeID):CBenIDListElmt(TypeID)
++ {
++ cpProperty = NULL;
++ cpReferencedList = NULL;
++ }
++
++ void SetProperty(pCBenProperty pProperty)
++ {
++ cpProperty = pProperty;
++ }
++
++ CBenValue(pCBenProperty pProperty, BenObjectID TypeID) :
++ CBenIDListElmt(TypeID)
++ {
++ cpProperty = pProperty;
++ cpReferencedList = NULL;
++ }
++ BenObjectID GetTypeNameID() { return GetID(); }
++ inline pCBenValueSegment GetNextValueSegment(pCBenValueSegment
++ pCurrValueSegment);
++ inline pLtcBenContainer GetContainer();
++ pCUtList GetValueSegments() { return &cValueSegments; }
++ BenObjectID GetReferencedListID();
++ // Currently, no generation support
++ BenGeneration GetGeneration() { return 1; }
++
++private: // Data
++ pCBenProperty cpProperty;
++ CUtOwningList cValueSegments;
++ pCBenValue cpReferencedList;
++ unsigned long cReferencedObjectsSize;
++};
++
++class CBenProperty : public CBenIDListElmt
++{
++public:
++ // In the Apple Bento, a property can have multiple values, each of a
++ // different type. But we never use it that way, so in this code a
++ // property has exactly one value
++
++ pCBenValue UseValue() { return &cValue; }
++ pCBenObject GetBenObject() { return cpObject; }
++ pLtcBenContainer GetContainer() { return GetBenObject()->GetContainer(); }
++
++public: // Internal methods
++#if 0
++ CBenProperty(pCBenObject pObject, BenObjectID PropertyID,
++ BenObjectID TypeID, pCBenIDListElmt pPrevProperty) :
++ CBenIDListElmt(PropertyID, pPrevProperty), cValue(this, TypeID)
++ { cpObject = pObject; }
++#endif
++ // changed by to remove WARNING here 2004-06-24
++ CBenProperty(pCBenObject pObject, BenObjectID PropertyID,
++ BenObjectID TypeID, pCBenIDListElmt pPrevProperty) :
++ CBenIDListElmt(PropertyID, pPrevProperty), cValue(TypeID)
++ {
++ cpObject = pObject;
++ cValue.SetProperty(this);
++ }
++
++BenObjectID GetPropertyNameID() { return GetID(); }
++
++private: // Data
++ pCBenObject cpObject;
++ CBenValue cValue;
++};
++
++// In our implementation, reference is always just the object ID for the
++// object referenced (but you shouldn't assume that)
++#define BEN_REFERENCE_SIZE 4
++
++class CBenReference
++{
++public: // Methods
++ BenByte * GetData() { return cData; }
++
++private: // Data
++ BenByte cData[BEN_REFERENCE_SIZE];
++};
++
++class CBenValueSegment : public CUtListElmt
++{
++public: // Internal methods
++ CBenValueSegment(pCBenValue pValue, BenContainerPos Pos,
++ unsigned long Size) : CUtListElmt(pValue->GetValueSegments())
++ { cpValue = pValue; cImmediate = UT_FALSE; cPos = Pos;
++ cSize = Size; }
++ CBenValueSegment(pCBenValue pValue, BenConstDataPtr pImmData,
++ unsigned short Size) : CUtListElmt(pValue->GetValueSegments())
++ { cpValue = pValue; cImmediate = UT_TRUE;
++ UtHugeMemcpy(cImmData, pImmData, Size); cSize = Size; }
++ CBenValueSegment(BenContainerPos Pos, unsigned long Size)
++ { cpValue = NULL; cImmediate = UT_FALSE; cPos = Pos;
++ cSize = Size; }
++ CBenValueSegment(BenConstDataPtr pImmData, unsigned short Size)
++ { cpValue = NULL; cImmediate = UT_TRUE;
++ UtHugeMemcpy(cImmData, pImmData, Size); cSize = Size; }
++ UtBool IsLast()
++ {
++ return cpValue == NULL || cpValue->GetValueSegments()->GetLast() ==
++ this;
++ }
++ UtBool IsImmediate() { return cImmediate; }
++ BenContainerPos GetPosition() { return cPos; }
++ unsigned long GetSize() { return cSize; }
++ void SetSize(unsigned long Size) { cSize = Size; }
++ BenByte * GetImmediateData() { return cImmData; }
++
++private: // Data
++ pCBenValue cpValue;
++ UtBool cImmediate;
++ union
++ {
++ BenContainerPos cPos;
++ BenByte cImmData[4];
++ };
++ unsigned long cSize;
++};
++
++inline pCBenValueSegment CBenValue::GetNextValueSegment(pCBenValueSegment
++ pCurrValueSegment)
++{ return (pCBenValueSegment) cValueSegments.GetNextOrNULL(pCurrValueSegment); }
++
++inline pLtcBenContainer CBenValue::GetContainer()
++{ return GetProperty()->GetContainer(); }
++
++class CBenNamedObject : public CBenObject
++{
++public: // Methods
++ virtual UtBool IsNamedObject();
++ virtual UtBool IsPropertyName();
++ virtual UtBool IsTypeName();
++
++public: // Internal methods
++ CBenNamedObject(pLtcBenContainer pContainer, BenObjectID ObjectID,
++ pCBenObject pPrevObject, const char * sName,
++ pCBenNamedObjectListElmt pPrevNamedObjectListElmt);
++ const char * GetName() { return csName.data(); }
++
++
++ const char * GetNameCStr() { return csName.c_str(); }
++
++
++ void SetPosition(BenContainerPos Pos) { cPos = Pos; }
++ BenContainerPos GetPosition(void) { return cPos; }
++ size_t GetLength(void) { return csName.length()+ 1; }
++ pCBenNamedObjectListElmt GetNameListElmt() { return &cNameListElmt; }
++
++private: // Data
++ string csName;
++ CBenNamedObjectListElmt cNameListElmt;
++ BenContainerPos cPos;
++};
++
++class CBenPropertyName : public CBenNamedObject
++{
++public: // Internal methods
++ CBenPropertyName(pLtcBenContainer pContainer, BenObjectID ObjectID,
++ pCBenObject pPrevObject, const char * sName,
++ pCBenNamedObjectListElmt pPrevNamedObjectListElmt) :
++ CBenNamedObject(pContainer, ObjectID, pPrevObject, sName,
++ pPrevNamedObjectListElmt) { ; }
++ virtual UtBool IsPropertyName();
++};
++
++class CBenTypeName : public CBenNamedObject
++{
++public: // Internal methods
++ CBenTypeName(pLtcBenContainer pContainer, BenObjectID ObjectID,
++ pCBenObject pPrevObject, const char * sName,
++ pCBenNamedObjectListElmt pPrevNamedObjectListElmt) :
++ CBenNamedObject(pContainer, ObjectID, pPrevObject, sName,
++ pPrevNamedObjectListElmt) { ; }
++ virtual UtBool IsTypeName();
++};
++
++
++} // end namespace OpenStormBento
++#endif
+diff -urNp lotuswordpro.bak/source/filter/bentoid.hxx lotuswordpro/source/filter/bentoid.hxx
+--- lotuswordpro.bak/source/filter/bentoid.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/bentoid.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,110 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef BENTOID_H
++#define BENTOID_H
++
++namespace OpenStormBento
++{
++
++#define BEN_OBJID_TOC 1 // TOC object ID
++#define BEN_PROPID_TOC_SEED 2 // TOC object starting seed
++#define BEN_PROPID_TOC_MIN_SEED 3 // TOC object minimum seed
++#define BEN_PROPID_TOC_OBJECT 4 // TOC object
++#define BEN_PROPID_TOC_CONTAINER 5 // TOC object entire container
++#define BEN_PROPID_TOC_DELETED 6 // TOC object amount deleted
++#define BEN_TYPEID_TOC_TYPE 19 // TOC object property value type
++#define BEN_OBJID_WRITEABLE 20 // Predefined ID's below this value will be
++ // written to container TOC. Predefined IDs
++ // above this are not written
++#define BEN_TYPEID_7_BIT_ASCII 21 // 7-bit ASCII
++#define BEN_PROPID_GLOBAL_TYPE_NAME 23 // Global type name
++#define BEN_PROPID_GLOBAL_PROPERTY_NAME 24 // Global property name
++#define BEN_PROPID_OBJ_REFERENCES 31 // Referenced objects from an object
++#define BEN_TYPEID_OBJ_REFERENCES_DATA 32 // Reference data
++#define BEN_OBJID_MIN_GENERAL_ID 100 // Min object ID for general std objects
++
++#define BEN_NEW_OBJECT 1 // object + property + type
++#define BEN_NEW_PROPERTY 2 // property + type
++#define BEN_NEW_TYPE 3 // type
++#define BEN_EXPLICIT_GEN 4 // generation
++
++#define BEN_SEGMENT_CODE_START 5
++#define BEN_OFFSET4_LEN4 5 // 4-byte offset + 4-byte length
++#define BEN_CONT_OFFSET4_LEN4 6 // continued 4-byte offset + 4-byte length
++#define BEN_OFFSET8_LEN4 7 // 8-byte offset + 4-byte length
++#define BEN_CONT_OFFSET8_LEN4 8 // continued 8-byte offset + 4-byte length
++#define BEN_IMMEDIATE0 9 // immediate (length = 0)
++#define BEN_IMMEDIATE1 10 // immediate (length = 1)
++#define BEN_IMMEDIATE2 11 // immediate (length = 2)
++#define BEN_IMMEDIATE3 12 // immediate (length = 3)
++#define BEN_IMMEDIATE4 13 // immediate (length = 4)
++#define BEN_CONT_IMMEDIATE4 14 // continued immediate (length = 4)
++#define BEN_SEGMENT_CODE_END 14
++
++#define BEN_REFERENCE_LIST_ID 15 // references recording object ID
++#define BEN_RESERVED4B 16
++#define BEN_RESERVED4C 17
++#define BEN_RESERVED8A 18 // reserved for future use of 8 byte entry
++#define BEN_RESERVED8B 19 // reserved for future use of 8 byte entry
++#define BEN_RESERVED8C 20 // reserved for future use of 8 byte entry
++#define BEN_RESERVED12A 21 // reserved for future use of 12 byte entry
++#define BEN_RESERVED12B 22 // reserved for future use of 12 byte entry
++#define BEN_RESERVED12C 23 // reserved for future use of 12 byte entry
++#define BEN_END_OF_BUFFER 24 // end of current buffer, go to next
++#define BEN_READ_PAST_END_OF_TOC 50 // Our code
++#define BEN_NOOP 0xFF
++
++}// end OpenStormBento namespace
++#endif
+diff -urNp lotuswordpro.bak/source/filter/benval.cxx lotuswordpro/source/filter/benval.cxx
+--- lotuswordpro.bak/source/filter/benval.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/benval.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,348 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "first.hxx"
++#include "assert.h"
++namespace OpenStormBento
++{
++
++unsigned long
++CBenValue::GetValueSize()
++{
++ unsigned long Size = 0;
++ pCBenValueSegment pCurr = NULL;
++ while ((pCurr = GetNextValueSegment(pCurr)) != NULL)
++ Size += pCurr->GetSize();
++ return Size;
++}
++
++BenError
++CBenValue::ReadValueData(BenDataPtr pReadBuffer, unsigned long Offset,
++ unsigned long Amt, unsigned long * pAmtRead)
++{
++ BenError Err;
++ unsigned long SegOffset = 0;
++ *pAmtRead = 0;
++ pCBenValueSegment pCurrSeg = NULL;
++ pLtcBenContainer pContainer = GetContainer();
++ BenByteDataPtr pBuffer = (BenByteDataPtr) pReadBuffer;
++
++ /// pReadBuffer -- pointer to buffer of read result, allocated outside this function
++ /// Offset -- read buffer's start offset address, relative value in the whole value stream
++ /// Amt -- read buffer's size
++ /// pAmtRead -- return the actual read size
++
++ /// SegOffset -- current segment's start address offset, relative value in the whole value stream
++
++ while ((pCurrSeg = GetNextValueSegment(pCurrSeg)) != NULL)
++ {
++ if (Amt == 0) /// whole buffer is full now, so return
++ return BenErr_OK;
++
++ if (SegOffset <= Offset && Offset < SegOffset + pCurrSeg->GetSize()) /// begin at current segment
++ {
++ unsigned long OffsetIntoSeg = Offset - SegOffset; /// relative value in this value segment stream
++
++ unsigned long AmtThisSeg = UtMin(Amt, pCurrSeg->GetSize() -
++ OffsetIntoSeg); /// size read in this segment, it's minimal value between Amt &
++ /// remain part from OffsetIntoSeg to the end of this segment
++
++ unsigned long AmtReadThisSeg; /// actual read size in this segment
++ if (pCurrSeg->IsImmediate())
++ {
++ UtHugeMemcpy(pBuffer, pCurrSeg->GetImmediateData() +
++ OffsetIntoSeg, AmtThisSeg);
++ AmtReadThisSeg = AmtThisSeg;
++ }
++ else
++ {
++ if ((Err = pContainer->SeekToPosition(pCurrSeg->GetPosition() +
++ OffsetIntoSeg)) != BenErr_OK)
++ return Err;
++
++ if ((Err = pContainer->Read(pBuffer, AmtThisSeg,
++ &AmtReadThisSeg)) != BenErr_OK)
++ return Err;
++ }
++
++ *pAmtRead += AmtReadThisSeg;
++
++ if (AmtThisSeg != AmtReadThisSeg)
++ return BenErr_UnexpectedEndOfFile;
++
++ pBuffer += AmtReadThisSeg;
++ Offset += AmtReadThisSeg;
++ Amt -= AmtReadThisSeg;
++ }
++
++ SegOffset += pCurrSeg->GetSize();
++ }
++ return BenErr_OK;
++}
++
++BenError
++CBenValue::ReadValueDataKnownSize(BenDataPtr pBuffer, unsigned long Offset,
++ unsigned long Amt)
++{
++ unsigned long AmtRead;
++ BenError Err = ReadValueData(pBuffer, Offset, Amt, &AmtRead);
++
++ if (Err == UtErr_OK && AmtRead != Amt)
++ Err = (BenError) UtErr_Fail;
++
++ return Err;
++}
++
++BenError
++CBenValue::WriteValueData(BenConstDataPtr pWriteBuffer, unsigned long Offset,
++ unsigned long Amt, unsigned long * pAmtWritten)
++{
++#if 0// Deleted by 2004-06-16
++ unsigned long AmtWritten;
++ if (pAmtWritten == NULL)
++ pAmtWritten = &AmtWritten;
++
++ *pAmtWritten = 0;
++
++ if (Amt == 0)
++ return BenErr_OK;
++
++ unsigned long SegOffset = 0;
++ pCBenValueSegment pCurrSeg = NULL;
++ BenError Err;
++ pLtcBenContainer pContainer = GetContainer();
++ BenConstByteDataPtr pBuffer = (BenConstByteDataPtr) pWriteBuffer;
++
++ while ((pCurrSeg = GetNextValueSegment(pCurrSeg)) != NULL)
++ {
++ if (Amt == 0)
++ return BenErr_OK;
++
++ if (SegOffset <= Offset && Offset < SegOffset + pCurrSeg->GetSize())
++ {
++ unsigned long OffsetIntoSeg = Offset - SegOffset;
++
++ unsigned long AmtThisSeg = UtMin(Amt, pCurrSeg->GetSize() -
++ OffsetIntoSeg);
++
++ if (pCurrSeg->IsImmediate())
++ {
++ UtHugeMemcpy(pCurrSeg->GetImmediateData() + OffsetIntoSeg,
++ pBuffer, AmtThisSeg);
++ *pAmtWritten += AmtThisSeg;
++ }
++ else
++ {
++ if ((Err = pContainer->SeekToPosition(pCurrSeg->GetPosition()
++ + OffsetIntoSeg)) != BenErr_OK)
++ return Err;
++
++ unsigned long AmtWrittenThisWrite;
++ Err = pContainer->Write(pBuffer, AmtThisSeg,
++ &AmtWrittenThisWrite);
++ *pAmtWritten += AmtWrittenThisWrite;
++ if (Err != BenErr_OK)
++ return Err;
++ }
++
++ pBuffer += AmtThisSeg;
++ Offset += AmtThisSeg;
++ Amt -= AmtThisSeg;
++ }
++
++ SegOffset += pCurrSeg->GetSize();
++ }
++
++ if (Offset > SegOffset)
++ {
++ assert(! "Write past end of value");
++ return BenErr_InvalidWriteOffset;
++ }
++
++ if (Amt == 0)
++ return BenErr_OK;
++
++ if ((Err = pContainer->SeekFromEnd(0)) != BenErr_OK)
++ return Err;
++
++ BenContainerPos EndFilePos;
++ if ((Err = pContainer->GetPosition(&EndFilePos)) != BenErr_OK)
++ return Err;
++
++ unsigned long AmtWrittenThisWrite;
++ Err = pContainer->Write(pBuffer, Amt, &AmtWrittenThisWrite);
++ *pAmtWritten += AmtWrittenThisWrite;
++ if (Err != BenErr_OK)
++ return Err;
++
++ pCBenValueSegment pLastSeg = (pCBenValueSegment) (
++ cValueSegments.GetLast() == cValueSegments.GetTerminating() ?
++ NULL : cValueSegments.GetLast() );
++ if (pLastSeg != NULL && ! pLastSeg->IsImmediate() &&
++ pLastSeg->GetPosition() + pLastSeg->GetSize() == EndFilePos)
++ pLastSeg->SetSize(pLastSeg->GetSize() + Amt);
++ else new CBenValueSegment(this, EndFilePos, Amt);
++#endif
++ return BenErr_OK;
++}
++
++BenError
++CBenValue::TruncateValueSize(unsigned long NewSize)
++{
++ unsigned long SegOffset = 0;
++
++ pCBenValueSegment pCurrSeg = GetNextValueSegment(NULL);
++ while (pCurrSeg != NULL)
++ {
++ pCBenValueSegment pNextSeg = GetNextValueSegment(pCurrSeg);
++
++ long SegSize = UtMin((long) pCurrSeg->GetSize(), (long) NewSize -
++ (long) SegOffset);
++
++ if (SegSize <= 0)
++ delete pCurrSeg;
++ else pCurrSeg->SetSize(SegSize);
++
++ SegOffset += SegSize;
++ pCurrSeg = pNextSeg;
++ }
++
++ return BenErr_OK;
++}
++
++BenError
++CBenValue::WriteValueData(BenConstDataPtr pWriteBuffer, unsigned long Offset,
++ unsigned long Amt)
++{
++ unsigned long AmtWritten;
++ return WriteValueData(pWriteBuffer, Offset, Amt, &AmtWritten);
++}
++
++BenError
++CBenValue::WriteImmediateValueData(BenConstDataPtr pBuffer,
++ unsigned short Size)
++{
++ // Only one write can be an immediate value in current implementation
++ if (cValueSegments.GetFirst() != cValueSegments.GetTerminating() ||
++ Size > 4)
++ return BenErr_InvalidImmediateWrite;
++
++ if (Size == 0)
++ return BenErr_OK;
++
++ new CBenValueSegment(this, pBuffer, Size);
++ return BenErr_OK;
++}
++
++BenError
++CBenValue::NewReference(BenObjectID ReferencedObjectID, pCBenReference
++ pReference)
++{
++ BenError Err;
++
++ if (cpReferencedList == NULL)
++ {
++ pLtcBenContainer pContainer = cpProperty->GetContainer();
++
++ pCBenObject pNewObject;
++ if ((Err = pContainer->NewObject(&pNewObject)) != BenErr_OK)
++ return Err;
++
++ pCBenValue pNewValue;
++ if ((Err = pNewObject->NewValue(BEN_PROPID_OBJ_REFERENCES,
++ BEN_TYPEID_OBJ_REFERENCES_DATA, &pNewValue)) != BenErr_OK)
++ {
++ delete pNewObject;
++ return Err;
++ }
++
++ cpReferencedList = pNewValue;
++ cReferencedObjectsSize = 0;
++ }
++
++ BenByte Buffer[8];
++ UtPutIntelDWord(Buffer, ReferencedObjectID);
++ UtPutIntelDWord(Buffer + 4, ReferencedObjectID);
++
++ UtPutIntelDWord(pReference->GetData(), ReferencedObjectID);
++
++ if ((Err = cpReferencedList->WriteValueData(Buffer,
++ cReferencedObjectsSize, 8)) != BenErr_OK)
++ return Err;
++
++ cReferencedObjectsSize += 8;
++ return BenErr_OK;
++}
++
++BenObjectID
++CBenValue::GetReferencedObject(pCBenReference pReference)
++{
++ return UtGetIntelDWord(pReference->GetData());
++}
++
++BenObjectID
++CBenValue::GetReferencedListID()
++{
++ if (cpReferencedList != NULL)
++ return cpReferencedList->GetProperty()->GetBenObject()->GetID();
++ else
++ {
++#ifdef BENUTIL_SUPPORT
++ return cReferencedListID;
++#else
++ return 0;
++#endif
++ }
++}
++}//end namespace OpenStormBento
+diff -urNp lotuswordpro.bak/source/filter/explode.cxx lotuswordpro/source/filter/explode.cxx
+--- lotuswordpro.bak/source/filter/explode.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/explode.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,648 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include <assert.h>
++#include "explode.hxx"
++#include <math.h>
++ const static char Tree1String[][32] = {
++ "101",
++ "11",
++ "100",
++ "011",
++ "0101",
++ "0100",
++ "0011",
++ "00101",
++ "00100",
++ "00011",
++ "00010",
++ "000011",
++ "000010",
++ "000001",
++ "0000001",
++ "0000000",
++ };
++
++ const static char Tree2String[][32] = {
++ "11" ,
++ "1011" ,
++ "1010" ,
++ "10011" ,
++ "10010" ,
++ "10001" ,
++ "10000" ,
++ "011111" ,
++ "011110" ,
++ "011101" ,
++ "011100" ,
++ "011011" ,
++ "011010" ,
++ "011001" ,
++ "011000" ,
++ "010111" ,
++ "010110" ,
++ "010101" ,
++ "010100" ,
++ "010011" ,
++ "010010" ,
++ "010001" ,
++ "0100001" ,
++ "0100000" ,
++ "0011111" ,
++ "0011110" ,
++ "0011101" ,
++ "0011100" ,
++ "0011011" ,
++ "0011010" ,
++ "0011001" ,
++ "0011000" ,
++ "0010111" ,
++ "0010110" ,
++ "0010101" ,
++ "0010100" ,
++ "0010011" ,
++ "0010010" ,
++ "0010001" ,
++ "0010000" ,
++ "0001111" ,
++ "0001110" ,
++ "0001101" ,
++ "0001100" ,
++ "0001011" ,
++ "0001010" ,
++ "0001001" ,
++ "0001000" ,
++ "00001111",
++ "00001110",
++ "00001101",
++ "00001100",
++ "00001011",
++ "00001010",
++ "00001001",
++ "00001000",
++ "00000111",
++ "00000110",
++ "00000101",
++ "00000100",
++ "00000011",
++ "00000010",
++ "00000001",
++ "00000000",
++ };
++
++Decompression::Decompression(SvStream * pInStream, SvStream * pOutStream):
++ m_pInStream(pInStream), m_pOutStream(pOutStream), m_pBuffer(m_Buffer), m_nOutputBufferPos(0),
++ m_nBitsLeft(0), m_nBytesLeft(0), m_nCurrent4Byte(0)
++{
++ if (!m_pInStream || !m_pOutStream )
++ {
++ assert(sal_False);
++ }
++ ConstructTree1();
++ ConstructTree2();
++ fillArray();
++}
++/**
++ * @descr read specified bits from input stream
++ * @argument iCount - number of bits to be read, less than 31
++ * @argument nBits - bits read
++ * @return 0 - read OK, otherwise error
++ */
++sal_uInt32 Decompression::ReadBits(sal_uInt16 iCount, sal_uInt32 & nBits)
++{
++ if ( (iCount == 0) || (iCount > 32 ) )
++ {
++ return 1;
++ }
++
++ sal_uInt32 val = 0; /* bit accumulator */
++
++ /* load at least need bits into val */
++ val = m_nCurrent4Byte;
++ while (m_nBitsLeft < iCount)
++ {
++ if (m_nBytesLeft == 0)
++ {
++ m_nBytesLeft = m_pInStream->Read(m_Buffer, CHUNK);
++ m_pBuffer = m_Buffer;
++ if (m_nBytesLeft == 0) return 1;
++ }
++ val |= (sal_uInt32)(*m_pBuffer++) << m_nBitsLeft; /* load eight bits */
++ m_nBytesLeft --;
++ m_nBitsLeft += 8;
++ }
++
++ /* drop need bits and update buffer, always zero to seven bits left */
++ m_nCurrent4Byte = val >> iCount;
++ m_nBitsLeft -= iCount;
++
++ /* return need bits, zeroing the bits above that */
++ nBits = val & ((1 << iCount) - 1);
++
++ return 0;
++}
++/**
++ * @descr decompress input and write output
++ * @return 0 - read OK, otherwise error
++ */
++sal_Int32 Decompression::explode()
++{
++ /* The first 2 bytes are parameters */
++ sal_uInt32 P1;
++ if (0 != ReadBits(8, P1))/* 0 or 1 */
++ return -1;
++
++ /* I think this means 0=binary and 1=ascii file, but in RESOURCEs I saw always 0 */
++ if (P1 >= 1) // changed per 's review comments
++ return -1;
++
++ sal_uInt32 P2;
++ if (0 != ReadBits(8, P2))
++ return -1;
++
++ /* must be 4,5 or 6 and it is a parameter for the decompression algorithm */
++ if (P2 < 4 || P2 > 6)
++ return -2;
++
++ m_nOutputBufferPos = 0;
++ /* Now, a bit stream follows, which is decoded as described below: */
++ /* The algorithm terminates as soon as it runs out of bits. */
++ while(sal_True)
++ {
++ // read 1 bit (take bits from the lowest value (LSB) to the MSB i.e. bit 0, bit 1 etc ...)
++ sal_uInt32 iBit;
++ if (0 != ReadBits(1, iBit))
++ break;
++ if ( 0 == (iBit & 0x01) )
++ {
++ //if the bit is 0 read 8 bits and write it to the output as it is.
++ sal_uInt32 symbol;
++ if (0 != ReadBits(8, symbol))
++ break;
++ m_Output[m_nOutputBufferPos++] = (sal_uInt8)symbol;
++ if (m_nOutputBufferPos == MAXWIN)
++ {
++ m_pOutStream->Write(m_Output, m_nOutputBufferPos);
++ m_nOutputBufferPos = 0;
++ }
++ continue;
++ }
++ // if the bit is 1 we have here a length/distance pair:
++ // -decode a number with Hufmman Tree #1; variable bit length, result is 0x00 .. 0x0F -> L1
++ sal_uInt32 L1 = Decode(m_Tree1);
++ sal_uInt32 Length;
++ if (L1 <= 7)
++ {
++ //if L1 <= 7:
++ // LENGTH = L1 + 2
++ Length = L1 + 2;
++ }
++ else
++ {
++ // if L1 > 7
++ // read more (L1-7) bits -> L2
++ // LENGTH = L2 + M[L1-7] + 2
++ sal_uInt32 L2;
++ if (0 != ReadBits((sal_uInt16)(L1 - 7), L2))
++ break;
++ Length = L2 + 2 + m_iArrayOfM[L1 -7];
++ }
++ if (Length == 519)
++ {
++ // end of compressed data
++ break;
++ }
++
++ // - decode another number with Hufmann Tree #2 giving result 0x00..0x3F -> D1
++ sal_uInt32 D1 = Decode(m_Tree2);
++ sal_uInt32 D2;
++ if (Length == 2)
++ {
++ // if LENGTH == 2
++ // D1 = D1 << 2
++ // read 2 bits -> D2
++ D1 = D1 << 2;
++ if (0 != ReadBits(2, D2))
++ break;
++ }
++ else
++ {
++ // else
++ // D1 = D1 << P2 // the parameter 2
++ // read P2 bits -> D2
++ D1 = D1 << P2;
++ if (0 != ReadBits((sal_uInt16)P2, D2))
++ break;
++ }
++ // DISTANCE = (D1 | D2) + 1
++ sal_uInt32 distance = (D1 | D2) + 1;
++
++ // - now copy LENGTH bytes from (output_ptr-DISTANCE) to output_ptr
++ // write current buffer to output
++ m_pOutStream->Write(m_Output, m_nOutputBufferPos);
++ m_nOutputBufferPos = 0;
++
++ // remember current position
++ sal_uInt32 nOutputPos = m_pOutStream->Tell();
++ if (distance > nOutputPos)
++ return -3; // format error
++
++ m_pOutStream->Flush();
++ // point back to copy position and read bytes
++ m_pOutStream->SeekRel((long)-distance);
++ sal_uInt8 sTemp[MAXWIN];
++ sal_uInt32 nRead = distance > Length? Length:distance;
++ m_pOutStream->Read(sTemp, nRead);
++ if (nRead != Length)
++ {
++ // fill the buffer with read content repeatly until full
++ for (sal_uInt32 i=nRead; i<Length; i++)
++ {
++ sTemp[i] = sTemp[i-nRead];
++ }
++ }
++
++ // restore output stream position
++ m_pOutStream->Seek(nOutputPos);
++
++ // write current buffer to output
++ m_pOutStream->Write(sTemp, Length);
++ }
++ return 0;
++}
++/**
++ * @descr bits to string
++ * @return
++ */
++void Decompression::ToString(sal_uInt32 nBits, sal_Char *pChar, sal_uInt32 nLen)
++{
++ sal_uInt32 nBit;
++ for (sal_uInt32 i=nLen; i > 0; i--)
++ {
++ nBit = (nBits >> (i -1) ) & 0x01;
++ pChar[nLen - i] = nBit ? '1':'0';
++ }
++ pChar[nLen] = '\0';
++ return;
++}
++
++/**
++ * @descr decode tree 1 for length
++ * @return the decoded value
++ */
++sal_uInt32 Decompression::Decode(HuffmanTreeNode * pRoot)
++{
++ sal_uInt32 nRet;
++ sal_uInt32 nRead, nReadAlready;
++
++ if( 0 != ReadBits(1, nReadAlready))
++ return 0; // something wrong
++
++ for (sal_uInt16 i=2; i <= 8; i++)
++ {
++ if ( 0 != ReadBits(1, nRead))
++ return 0; // something wrong
++
++ nReadAlready = (nReadAlready << 1) | (nRead & 0x01);
++
++ sal_Char sCode[16];
++ ToString(nReadAlready, sCode, i);
++ nRet = pRoot->QueryValue(sCode);
++ if (nRet != 0xffffffff)
++ {
++ break;
++ }
++ }
++ return nRet;
++}
++/**
++ * @descr construct tree 1 for length
++ * @return
++ */
++void Decompression::ConstructTree1()
++{ // Huffman Tree #1
++ // The first huffman tree (the Section called Decompression algorithm HUFFMAN) contains the length values. It is described by the following table:
++ // value (hex) code (binary)
++ // 0 101
++ // 1 11
++ // 2 100
++ // 3 011
++ // 4 0101
++ // 5 0100
++ // 6 0011
++ // 7 0010 1
++ // 8 0010 0
++ // 9 0001 1
++ // a 0001 0
++ // b 0000 11
++ // c 0000 10
++ // d 0000 01
++ // e 0000 001
++ // f 0000 000
++ m_Tree1 = new HuffmanTreeNode();
++ for (sal_uInt32 i=0; i< 16; i++)
++ {
++ m_Tree1->InsertNode(i, Tree1String[i]);
++ }
++ /*
++ m_Tree1->InsertNode(0, "101");
++ m_Tree1->InsertNode(1, "11");
++ m_Tree1->InsertNode(2, "100");
++ m_Tree1->InsertNode(3, "011");
++ m_Tree1->InsertNode(4, "0101");
++ m_Tree1->InsertNode(5, "0100");
++ m_Tree1->InsertNode(6, "0011");
++ m_Tree1->InsertNode(7, "00101");
++ m_Tree1->InsertNode(8, "00100");
++ m_Tree1->InsertNode(9, "00011");
++ m_Tree1->InsertNode(10, "00010");
++ m_Tree1->InsertNode(11, "000011");
++ m_Tree1->InsertNode(12, "000010");
++ m_Tree1->InsertNode(13, "000001");
++ m_Tree1->InsertNode(14, "0000001");
++ m_Tree1->InsertNode(15, "0000000");
++ */
++}
++/**
++ * @descr construct tree 2 for distance
++ * @return
++ */
++void Decompression::ConstructTree2()
++{
++
++ m_Tree2 = new HuffmanTreeNode();
++ for (sal_uInt32 i=0; i< 64; i++)
++ {
++ m_Tree2->InsertNode(i, Tree2String[i]);
++ }
++#if 0
++ m_Tree2 = new HuffmanTreeNode();
++ //Huffman Tree #2
++ //The second huffman code tree contains the distance values. It can be built from the following table:
++ //value (hex) code (binary)
++ //00 11
++ //01 1011
++ //02 1010
++ //03 1001 1
++ //04 1001 0
++ //05 1000 1
++ //06 1000 0
++ //07 0111 11
++ //08 0111 10
++ //09 0111 01
++ //0a 0111 00
++ //0b 0110 11
++ //0c 0110 10
++ //0d 0110 01
++ //0e 0110 00
++ //0f 0101 11
++ m_Tree2->InsertNode(0x0, "11");
++ m_Tree2->InsertNode(0x1, "1011");
++ m_Tree2->InsertNode(0x2, "1010");
++ m_Tree2->InsertNode(0x3, "10011");
++ m_Tree2->InsertNode(0x4, "10010");
++ m_Tree2->InsertNode(0x5, "10001");
++ m_Tree2->InsertNode(0x6, "10000");
++ m_Tree2->InsertNode(0x7, "011111");
++ m_Tree2->InsertNode(0x8, "011110");
++ m_Tree2->InsertNode(0x9, "011101");
++ m_Tree2->InsertNode(0x0a, "011100");
++ m_Tree2->InsertNode(0x0b, "011011");
++ m_Tree2->InsertNode(0x0c, "011010");
++ m_Tree2->InsertNode(0x0d, "011001");
++ m_Tree2->InsertNode(0x0e, "011000");
++ m_Tree2->InsertNode(0x0f, "010111");
++ //10 0101 10
++ //11 0101 01
++ //12 0101 00
++ //13 0100 11
++ //14 0100 10
++ //15 0100 01
++ //16 0100 001
++ //17 0100 000
++ //18 0011 111
++ //19 0011 110
++ // 1a 0011 101
++ // 1b 0011 100
++ // 1c 0011 011
++ // 1d 0011 010
++ // 1e 0011 001
++ // 1f 0011 000
++ m_Tree2->InsertNode(0x10, "010110");
++ m_Tree2->InsertNode(0x11, "010101");
++ m_Tree2->InsertNode(0x12, "010100");
++ m_Tree2->InsertNode(0x13, "010011");
++ m_Tree2->InsertNode(0x14, "010010");
++ m_Tree2->InsertNode(0x15, "010001");
++ m_Tree2->InsertNode(0x16, "0100001");
++ m_Tree2->InsertNode(0x17, "0100000");
++ m_Tree2->InsertNode(0x18, "0011111");
++ m_Tree2->InsertNode(0x19, "0011110");
++ m_Tree2->InsertNode(0x1a, "0011101");
++ m_Tree2->InsertNode(0x1b, "0011100");
++ m_Tree2->InsertNode(0x1c, "0011011");
++ m_Tree2->InsertNode(0x1d, "0011010");
++ m_Tree2->InsertNode(0x1e, "0011001");
++ m_Tree2->InsertNode(0x1f, "0011000");
++ //20 0010 111
++ //21 0010 110
++ //22 0010 101
++ //23 0010 100
++ //24 0010 011
++ //25 0010 010
++ //26 0010 001
++ //27 0010 000
++ //28 0001 111
++ //29 0001 110
++ // 2a 0001 101
++ // 2b 0001 100
++ // 2c 0001 011
++ // 2d 0001 010
++ // 2e 0001 001
++ // 2f 0001 000
++ m_Tree2->InsertNode(0x20, "0010111");
++ m_Tree2->InsertNode(0x21, "0010110");
++ m_Tree2->InsertNode(0x22, "0010101");
++ m_Tree2->InsertNode(0x23, "0010100");
++ m_Tree2->InsertNode(0x24, "0010011");
++ m_Tree2->InsertNode(0x25, "0010010");
++ m_Tree2->InsertNode(0x26, "0010001");
++ m_Tree2->InsertNode(0x27, "0010000");
++ m_Tree2->InsertNode(0x28, "0001111");
++ m_Tree2->InsertNode(0x29, "0001110");
++ m_Tree2->InsertNode(0x2a, "0001101");
++ m_Tree2->InsertNode(0x2b, "0001100");
++ m_Tree2->InsertNode(0x2c, "0001011");
++ m_Tree2->InsertNode(0x2d, "0001010");
++ m_Tree2->InsertNode(0x2e, "0001001");
++ m_Tree2->InsertNode(0x2f, "0001000");
++ //30 0000 1111
++ //31 0000 1110
++ //32 0000 1101
++ //33 0000 1100
++ //34 0000 1011
++ //35 0000 1010
++ //36 0000 1001
++ //37 0000 1000
++ //38 0000 0111
++ //39 0000 0110
++ // 3a 0000 0101
++ // 3b 0000 0100
++ // 3c 0000 0011
++ // 3d 0000 0010
++ // 3e 0000 0001
++ // 3f 0000 0000
++ m_Tree2->InsertNode(0x30, "00001111");
++ m_Tree2->InsertNode(0x31, "00001110");
++ m_Tree2->InsertNode(0x32, "00001101");
++ m_Tree2->InsertNode(0x33, "00001100");
++ m_Tree2->InsertNode(0x34, "00001011");
++ m_Tree2->InsertNode(0x35, "00001010");
++ m_Tree2->InsertNode(0x36, "00001001");
++ m_Tree2->InsertNode(0x37, "00001000");
++ m_Tree2->InsertNode(0x38, "00000111");
++ m_Tree2->InsertNode(0x39, "00000110");
++ m_Tree2->InsertNode(0x3a, "00000101");
++ m_Tree2->InsertNode(0x3b, "00000100");
++ m_Tree2->InsertNode(0x3c, "00000011");
++ m_Tree2->InsertNode(0x3d, "00000010");
++ m_Tree2->InsertNode(0x3e, "00000001");
++ m_Tree2->InsertNode(0x3f, "00000000");
++#endif
++ //where bits should be read from the left to the right.
++}
++/**
++ * @descr
++ * @return
++ */
++void Decompression::fillArray()
++{
++ m_iArrayOfM[0] = 7;
++ for (int i=1; i < 16; i++)
++ {
++ double dR = 2.0;
++ m_iArrayOfM[i] = m_iArrayOfM[i - 1]+ (sal_uInt32)pow(dR, i-1);//2
++ }
++}
++
++HuffmanTreeNode::HuffmanTreeNode(sal_uInt32 nValue , HuffmanTreeNode * pLeft , HuffmanTreeNode * pRight )
++{
++ value = nValue;
++ left = pLeft;
++ right = pRight;
++}
++HuffmanTreeNode::~HuffmanTreeNode()
++{
++ if (left)
++ {
++ delete left;
++ left = NULL;
++ }
++ if (right)
++ {
++ delete right;
++ right = NULL;
++ }
++}
++
++HuffmanTreeNode * HuffmanTreeNode::InsertNode(sal_uInt32 nValue, const sal_Char * pInCode)
++{
++ HuffmanTreeNode *pNew = new HuffmanTreeNode(nValue);
++ sal_Char pCode[32];
++ strcpy(pCode, pInCode );
++
++ // query its parents
++ sal_Char cLast = pCode[strlen(pCode) - 1];
++ pCode[strlen(pCode) - 1] = '\0';
++ HuffmanTreeNode * pParent = QueryNode(pCode);
++ if (!pParent)
++ {
++ pParent = InsertNode(0xffffffff, pCode);
++ }
++ if (cLast == '0')
++ pParent->left = pNew;
++ else // (cChar == '1')
++ pParent->right = pNew;
++
++ return pNew;
++}
++HuffmanTreeNode * HuffmanTreeNode::QueryNode(const sal_Char * pCode)
++{
++ sal_uInt32 nLen = strlen(pCode);
++
++ HuffmanTreeNode * pNode = this; // this is the root
++ for(sal_uInt32 i=0; i<nLen && pNode; i++)
++ {
++ sal_Char cChar= pCode[i];
++ if (cChar == '0')
++ {
++ pNode = pNode->left;
++ }
++ else // (cChar == '1')
++ {
++ pNode = pNode->right;
++ }
++ }
++ return pNode;
++}
++
++sal_uInt32 HuffmanTreeNode::QueryValue(const sal_Char * pCode)
++{
++ HuffmanTreeNode * pNode =QueryNode(pCode);
++ if (pNode)
++ return pNode->value;
++
++ return 0xffffffff;
++}
++
+diff -urNp lotuswordpro.bak/source/filter/explode.hxx lotuswordpro/source/filter/explode.hxx
+--- lotuswordpro.bak/source/filter/explode.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/explode.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,125 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _EXPLODE_HXX_
++#define _EXPLODE_HXX_
++
++#include <tools/stream.hxx>
++
++class HuffmanTreeNode
++{
++public:
++ HuffmanTreeNode * left;
++ HuffmanTreeNode * right;
++ sal_uInt32 value;
++
++ HuffmanTreeNode(sal_uInt32 value = 0xffffffff, HuffmanTreeNode * left = NULL, HuffmanTreeNode * right = NULL) ;
++ ~HuffmanTreeNode() ;
++ HuffmanTreeNode * InsertNode(sal_uInt32 nValue, const sal_Char * pInCode);
++ HuffmanTreeNode * QueryNode(const sal_Char *pCode);
++ sal_uInt32 QueryValue(const sal_Char *pCode);
++};
++
++
++/**
++ * @brief
++ * define the function type for input read, output write
++ */
++#define CHUNK 16384
++#define MAXWIN 4096 /* maximum window size */
++class Decompression
++{
++public:
++ Decompression(SvStream * pInStream, SvStream * pOutStream);
++ ~Decompression()
++ {
++ delete m_Tree1;
++ delete m_Tree2;
++ };
++ /**
++ * @brief
++ * decompress from instream to outstream
++ */
++ sal_Int32 explode();
++ sal_uInt32 ReadBits(sal_uInt16 iCount, sal_uInt32 & nBits) ;
++ sal_uInt32 Decode(HuffmanTreeNode * pRoot);
++
++ /**
++ * @brief
++ * compressed/decompressed stream
++ */
++ SvStream *m_pInStream;
++ SvStream *m_pOutStream;
++
++ sal_uInt32 m_nCurrent4Byte; // bit buffer
++ sal_uInt32 m_nBitsLeft; // number of bits remained in bit buffer
++
++ sal_uInt8 m_Buffer[CHUNK]; // input byte buffer
++ sal_uInt8 *m_pBuffer; // pointer to input buffer
++ sal_uInt32 m_nBytesLeft; // number of bytes remained in byte buffer
++
++ sal_uInt8 m_Output[MAXWIN]; // output byte buffer
++ sal_uInt32 m_nOutputBufferPos; // pointer to output buffer
++
++ sal_uInt32 m_iArrayOfM[16];
++
++
++ HuffmanTreeNode *m_Tree1, *m_Tree2;
++
++ void ConstructTree1();
++ void ConstructTree2();
++ void fillArray();
++ void ToString(sal_uInt32 nBits, sal_Char *pChar, sal_uInt32 nLen);
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/first.hxx lotuswordpro/source/filter/first.hxx
+--- lotuswordpro.bak/source/filter/first.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/first.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,81 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef FIRST_HXX
++#define FIRST_HXX
++
++//#include "utfirst.h" // Deleted by 2004-06-16
++#include "bento.hxx" // Public header
++
++//#define ASSERT(cond) UT_ASSERT(cond) // Deleted by 2004-06-16
++namespace OpenStormBento
++{
++// String constants
++extern const char gsBenMagicBytes[];
++
++typedef BenByte * BenByteDataPtr;
++typedef const BenByte * BenConstByteDataPtr;
++
++pCBenNamedObject FindNamedObject(pCUtList pList, const char * sName,
++ pCBenNamedObjectListElmt * ppPrev);
++
++pCBenIDListElmt FindID(pCUtList pList, BenObjectID ObjectID,
++ pCBenIDListElmt * ppPrev);
++} // end namespace
++
++// Private headers
++#include "bentoid.hxx"
++#include "tocread.hxx"
++//#include "tocwrite.h" // Deleted by 2004-06-16
++#endif
+diff -urNp lotuswordpro.bak/source/filter/localtime.cxx lotuswordpro/source/filter/localtime.cxx
+--- lotuswordpro.bak/source/filter/localtime.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/localtime.cxx 2008-10-22 12:00:18.000000000 +0800
+@@ -0,0 +1,189 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "localtime.hxx"
++#include <unicode/timezone.h>
++//End by
++const long DAY_SEC =24 * 60 * 60;
++const long YEAR_SEC = 365 * DAY_SEC;
++const long FOURYEAR_SEC = 4 * YEAR_SEC + DAY_SEC;
++const long LONG_MAX=2147483647;
++const long TIMEZONE = -28800;
++//01-01-70 was a Thursday
++const long BASE_DOW = 4;
++
++long _lpdays[] = {-1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};
++
++long _days[] = {-1, 30, 58, 89, 119, 150, 180, 211, 242, 272, 303, 333, 364};
++
++bool LtgGmTime(long rtime,LtTm& rtm)
++{
++ if (rtime < 0)
++ {
++ return false;
++ }
++ //is-current-year-a-leap-year flag
++ int islpyr = 0;
++
++ long tmptim;
++ long caltim = rtime;
++ tmptim = (long)(caltim / FOURYEAR_SEC);
++ caltim -= ((long)tmptim * FOURYEAR_SEC);
++
++ //
++ //Determine which year of the interval
++ //
++ // 1970, 1974, 1978,...,etc.
++ tmptim = (tmptim * 4) + 70;
++
++ if (caltim >= YEAR_SEC)
++ {
++ //1971, 1975, 1979,...,etc.
++ tmptim++;
++ caltim -= YEAR_SEC;
++
++ if ( caltim >= YEAR_SEC )
++ {
++ // 1972, 1976, 1980,...,etc.
++ tmptim++;
++ caltim -= YEAR_SEC;
++
++ //Note, it takes 366 days-worth of seconds to get past a leap year.
++ if (caltim >= (YEAR_SEC + DAY_SEC))
++ {
++ //1973, 1977, 1981,...,etc.
++ tmptim++;
++ caltim -= (YEAR_SEC + DAY_SEC);
++ }
++ else
++ {
++ //In a leap year after all, set the flag.
++ islpyr++;
++ }
++ }
++ }
++
++ //
++ //tmptim now holds the value for tm_year. caltim now holds the
++ //number of elapsed seconds since the beginning of that year.
++ //
++ rtm.tm_year = tmptim;
++ //
++ //Determine days since January 1 (0 - 365). This is the tm_yday value.
++ //Leave caltim with number of elapsed seconds in that day.
++ //
++ rtm.tm_yday = (long)(caltim / DAY_SEC);
++ caltim -= (long)(rtm.tm_yday) * DAY_SEC;
++ //
++ //Determine months since January (0 - 11) and day of month (1 - 31)
++ //
++ long* mdays;
++ if ( islpyr )
++ {
++ mdays = _lpdays;
++ }
++ else
++ {
++ mdays = _days;
++ }
++
++ for ( tmptim = 1 ; mdays[tmptim] < rtm.tm_yday ; tmptim++ ) ;
++
++ rtm.tm_mon = --tmptim;
++
++ rtm.tm_mday = rtm.tm_yday - mdays[tmptim];
++
++ //
++ //Determine days since Sunday (0 - 6)
++ //
++ rtm.tm_wday = ((long)(rtime / DAY_SEC) + BASE_DOW) % 7;
++ //
++ //Determine hours since midnight (0 - 23), minutes after the hour
++ //(0 - 59), and seconds after the minute (0 - 59).
++ //
++ rtm.tm_hour = (long)(caltim / 3600);
++ caltim -= (long)rtm.tm_hour * 3600;
++
++ rtm.tm_min = (long)(caltim / 60);
++ rtm.tm_sec = (long)(caltim - (rtm.tm_min) * 60);
++
++ rtm.tm_isdst = 0;
++
++ //
++ //
++ //
++ //adjust year & month
++ rtm.tm_year += 1900;
++ ++(rtm.tm_mon);
++
++ return true;
++
++};
++bool LtgLocalTime(long rtime,LtTm& rtm)
++{
++ long ltime;
++ if (rtime < 0)
++ {
++ return false;
++ }
++
++ if ((rtime > 3 * DAY_SEC)&&(rtime < LONG_MAX - 3 * DAY_SEC))
++ {
++ TimeZone* pLocalZone = TimeZone::createDefault();
++ long offset = (pLocalZone->getRawOffset())/1000;
++ ltime = rtime + offset;
++ return LtgGmTime(ltime,rtm);
++ }
++ return false;
++};
+diff -urNp lotuswordpro.bak/source/filter/localtime.hxx lotuswordpro/source/filter/localtime.hxx
+--- lotuswordpro.bak/source/filter/localtime.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/localtime.hxx 2008-10-22 11:57:59.000000000 +0800
+@@ -0,0 +1,73 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _LWPTIME_HXX_
++#define _LWPTIME_HXX_
++
++struct LtTm
++{
++ long tm_sec; /* seconds after the minute - [0,59] */
++ long tm_min; /* minutes after the hour - [0,59] */
++ long tm_hour; /* hours since midnight - [0,23] */
++ long tm_mday; /* day of the month - [1,31] */
++ long tm_mon; /* months since January - [0,11] */
++ long tm_year; /* years since 1900 */
++ long tm_wday; /* days since Sunday - [0,6] */
++ long tm_yday; /* days since January 1 - [0,365] */
++ long tm_isdst; /* daylight savings time flag */
++};
++bool LtgGmTime(long rtime,LtTm& rtm);
++bool LtgLocalTime(long rtime,LtTm& rtm);
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwp9reader.cxx lotuswordpro/source/filter/lwp9reader.cxx
+--- lotuswordpro.bak/source/filter/lwp9reader.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwp9reader.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,291 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _LWP9READER_HXX
++#include "lwp9reader.hxx"
++#endif
++#include "lwpglobalmgr.hxx"
++#include "lwpunoheader.hxx"
++#include "lwparrowstyles.hxx"
++#include "lwpobjhdr.hxx"
++#include "lwpdoc.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "lwpdocdata.hxx"
++#include "lwpbookmarkmgr.hxx"
++#include "lwpchangemgr.hxx"
++#include <tools/stream.hxx>
++
++Lwp9Reader::Lwp9Reader (LwpSvStream* pInputStream, IXFStream* pStream)
++ : m_pDocStream(pInputStream), m_pStream(pStream), m_LwpFileHdr()
++{}
++
++/**
++ * @descr The entrance of Word Pro 9 import filter.
++ **/
++void Lwp9Reader::Read()
++{
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance(m_pDocStream);
++ m_pObjMgr = pGlobal->GetLwpObjFactory();
++
++ //Commented out by , 10/26/2005
++ //Read Ole object in LwpOleObject::XFConverter to support Ole in Linux
++ //ReadOleObjects();
++
++ ReadFileHeader();
++ //Does not support Word Pro 96 and previous versions
++ if(LwpFileHeader::m_nFileRevision>=0x000B)
++ {
++ ReadIndex();
++ ParseDocument();
++ }
++ LwpGlobalMgr::DeleteInstance();
++}
++
++/**
++ * @descr Read the OLE objects.
++ */
++void Lwp9Reader::ReadOleObjects()
++{
++#if 0
++#ifdef WIN32
++ if(m_pObjMgr)
++ {
++ // Get the buffer of the whole file
++ LwpSvStream* pRawStream = m_pDocStream;
++ sal_Int64 nCurPos = pRawStream->Tell();
++ sal_uInt32 nSize = static_cast<sal_uInt32>(pRawStream->Seek(STREAM_SEEK_TO_END));
++ BYTE* pBuf = new BYTE[nSize];
++
++ if(pBuf == NULL) // this buffer may be too big
++ {
++ assert(sal_False);
++ return;
++ }
++ pRawStream->Seek(STREAM_SEEK_TO_BEGIN);
++ pRawStream->Read(pBuf,nSize);
++ pRawStream->Seek(nCurPos);
++
++ // Break the buffer into separate objects by ASWAN lib
++ BYTE* pOut = NULL;
++ sal_uInt32 nWritten;
++ CBenStorageConverter benConverter;
++ benConverter.Convert(pBuf, nSize, (void**)&pOut, &nWritten);
++ delete[] pBuf;
++
++ if (NULL != pOut)
++ {
++ SvStream* pMemStream = new SvMemoryStream(pOut, nWritten, STREAM_READ|STREAM_WRITE);
++ SvStorageRef objStor = new SvStorage(pMemStream, true); // set true to let SvStorage free the memstream.
++ m_pObjMgr->SetOleObjInfo(objStor);
++ }
++
++ }
++#endif
++#endif
++}
++/**
++ * @descr Read the LWP7 object.
++ */
++void Lwp9Reader::ReadFileHeader()
++{
++ m_pDocStream->Seek(LwpSvStream::LWP_STREAM_BASE);
++
++ //Remember to initialize the LwpFileHeader::m_nFileRevision first.
++ LwpFileHeader::m_nFileRevision = 0;
++
++ LwpObjectHeader objHdr;
++ objHdr.Read(*m_pDocStream);
++ sal_Int64 pos = m_pDocStream->Tell();
++ m_LwpFileHdr.Read(m_pDocStream);
++ m_pDocStream->Seek(pos+objHdr.GetSize());
++
++}
++
++/**
++ * @descr Read the index objects at the end of the WordProData stream
++ */
++void Lwp9Reader::ReadIndex()
++{
++ sal_Int64 oldpos = m_pDocStream->Tell();
++ sal_uInt32 rootoffset = m_LwpFileHdr.GetRootIndexOffset();
++ m_pDocStream->Seek(rootoffset + LwpSvStream::LWP_STREAM_BASE);
++ m_pObjMgr->ReadIndex(m_pDocStream);
++ m_pDocStream->Seek(oldpos);
++}
++
++/**
++ * @descr Read all objects
++ * This function is replaced by the read on demand model
++ * Reserverd for future use
++*/
++void Lwp9Reader::DumpAllObjects()
++{
++ sal_Int64 nFileSize = GetFileSize();
++ sal_Int64 nFilePos = m_pDocStream->Tell();
++
++ while(true)
++ {
++ LwpObjectHeader objHdr;
++ objHdr.Read(*m_pDocStream);
++ nFilePos = m_pDocStream->Tell();
++ //Stop when reaching the index object
++ if(objHdr.GetTag() >= VO_ROOTLEAFOBJINDEX)
++ {
++ break;
++ }
++ //Stop when the length exceeds the file length
++ if(nFilePos + objHdr.GetSize() > nFileSize)
++ {
++ assert(false);
++ break;
++ }
++ m_pObjMgr->CreateObject(objHdr.GetTag(), objHdr);
++ m_pDocStream->Seek(nFilePos+objHdr.GetSize());
++ }
++}
++
++/**
++ * @descr Get file size
++*/
++sal_Int64 Lwp9Reader::GetFileSize()
++{
++ sal_Int64 pos = m_pDocStream->Tell();
++ m_pDocStream->Seek(0);
++
++ sal_Int64 size = m_pDocStream->Seek( STREAM_SEEK_TO_END);
++ m_pDocStream->Seek(pos);
++ return(size);
++}
++
++/**
++ * @descr Parse all document content
++*/
++void Lwp9Reader::ParseDocument()
++{
++ WriteDocHeader();
++
++ //Get root document
++ LwpDocument* doc = static_cast<LwpDocument*> ( m_LwpFileHdr.GetDocID()->obj() );
++
++ //Parse Doc Data
++ LwpDocData *pDocData = static_cast<LwpDocData*>((doc->GetDocData())->obj());
++ if (pDocData!=NULL)
++ {
++ pDocData->Parse(m_pStream);
++ }
++
++ //Register Styles
++ RegisteArrowStyles();
++ doc->RegisterStyle();
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ pXFStyleManager->ToXml(m_pStream);
++
++ //Parse document content
++ m_pStream->GetAttrList()->Clear();
++ m_pStream->StartElement( A2OUSTR("office:body") );
++
++ //Parse change list, add by
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ LwpChangeMgr* pChangeMgr = pGlobal->GetLwpChangeMgr();
++ pChangeMgr->ConvertAllChange(m_pStream);
++
++ doc->Parse(m_pStream);
++ m_pStream->EndElement(::rtl::OUString::createFromAscii("office:body"));
++
++ WriteDocEnd();
++}
++
++/**
++ * @descr Write xml document header
++ */
++void Lwp9Reader::WriteDocHeader()
++{
++ m_pStream->StartDocument();
++
++ IXFAttrList *pAttrList = m_pStream->GetAttrList();
++
++ pAttrList->AddAttribute( A2OUSTR("xmlns:office"), A2OUSTR("http://openoffice.org/2000/office") );
++ pAttrList->AddAttribute( A2OUSTR("xmlns:style"), A2OUSTR("http://openoffice.org/2000/style") );
++ pAttrList->AddAttribute( A2OUSTR("xmlns:text"), A2OUSTR("http://openoffice.org/2000/text") );
++ pAttrList->AddAttribute( A2OUSTR("xmlns:table"), A2OUSTR("http://openoffice.org/2000/table") );
++ pAttrList->AddAttribute( A2OUSTR("xmlns:draw"), A2OUSTR("http://openoffice.org/2000/drawing") );
++
++ pAttrList->AddAttribute( A2OUSTR("xmlns:fo"), A2OUSTR("http://www.w3.org/1999/XSL/Format") );
++ pAttrList->AddAttribute( A2OUSTR("xmlns:xlink"), A2OUSTR("http://www.w3.org/1999/xlink") );
++ pAttrList->AddAttribute( A2OUSTR("xmlns:number"), A2OUSTR("http://openoffice.org/2000/datastyle") );
++ pAttrList->AddAttribute( A2OUSTR("xmlns:svg"), A2OUSTR("http://www.w3.org/2000/svg") );
++ pAttrList->AddAttribute( A2OUSTR("xmlns:chart"), A2OUSTR("http://openoffice.org/2000/chart") );
++
++ pAttrList->AddAttribute( A2OUSTR("xmlns:dr3d"), A2OUSTR("http://openoffice.org/2000/dr3d") );
++ pAttrList->AddAttribute( A2OUSTR("xmlns:math"), A2OUSTR("http://www.w3.org/1998/Math/MathML") );
++ pAttrList->AddAttribute( A2OUSTR("xmlns:form"), A2OUSTR("http://openoffice.org/2000/form") );
++ pAttrList->AddAttribute( A2OUSTR("xmlns:script"), A2OUSTR("http://openoffice.org/2000/script") );
++ pAttrList->AddAttribute( A2OUSTR("xmlns:dc"), A2OUSTR("http://purl.org/dc/elements/1.1/") );
++
++ pAttrList->AddAttribute( A2OUSTR("xmlns:meta"), A2OUSTR("http://openoffice.org/2000/meta") );
++ pAttrList->AddAttribute( A2OUSTR("office:class"), A2OUSTR("text"));
++ pAttrList->AddAttribute( A2OUSTR("office:version"), A2OUSTR("1.0"));
++
++ m_pStream->StartElement( ::rtl::OUString::createFromAscii("office:document") );
++ pAttrList->Clear();
++
++}
++/**
++ * @descr Write xml document end
++ */
++void Lwp9Reader::WriteDocEnd()
++{
++ m_pStream->EndElement(::rtl::OUString::createFromAscii("office:document"));
++ m_pStream->EndDocument();
++}
+diff -urNp lotuswordpro.bak/source/filter/lwp9reader.hxx lotuswordpro/source/filter/lwp9reader.hxx
+--- lotuswordpro.bak/source/filter/lwp9reader.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwp9reader.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,89 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _LWP9READER_HXX
++#define _LWP9READER_HXX
++
++#include "lwpheader.hxx"
++#include "lwpunoheader.hxx"
++#include "lwpsvstream.hxx"
++#include "lwpfilehdr.hxx"
++#include "lwpobjfactory.hxx"
++#include "xfilter/ixfstream.hxx"
++/**
++ * @brief Reader framework class for Lotus Word Pro 9 file
++*/
++class Lwp9Reader
++{
++ public:
++ Lwp9Reader(LwpSvStream* InputStream, IXFStream* pStream);
++ ~Lwp9Reader(){};
++ private:
++ LwpSvStream* m_pDocStream;
++ IXFStream* m_pStream;
++ LwpObjectFactory* m_pObjMgr;
++ LwpFileHeader m_LwpFileHdr; //LWP7 object
++ protected:
++ sal_Int64 GetFileSize();
++ void ReadFileHeader();
++ void ReadIndex();
++ void DumpAllObjects();
++ void ParseDocument();
++ void WriteDocHeader();
++ void WriteDocEnd();
++ void ReadOleObjects();
++ public:
++ void Read();
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwparrowstyles.hxx lotuswordpro/source/filter/lwparrowstyles.hxx
+--- lotuswordpro.bak/source/filter/lwparrowstyles.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwparrowstyles.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,101 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _LWPARROWSTYLES_HXX
++#define _LWPARROWSTYLES_HXX
++
++#include "xfilter/xfarrowstyle.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "lwpglobalmgr.hxx"
++
++/**
++ * @descr Registe arrow styles that are not directly support by SODC.
++ * There are three kinds,revsered arrow,revered concave arrow and revsered
++ * line arrow. this function should be called before the three arrows be used.
++ */
++void RegisteArrowStyles()
++{
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ if (!pXFStyleManager)
++ return;
++ //reversed arrow:
++ XFArrowStyle *pArrowStyle100 = new XFArrowStyle();
++ pArrowStyle100->SetArrowName( A2OUSTR("arrow100") );
++ pArrowStyle100->SetViewbox(A2OUSTR("0 0 140 200"));
++ pArrowStyle100->SetSVGPath(A2OUSTR("M0 180 L70 0 L140 180 L120 180 L70 30 L20 180 L0 180"));
++ pXFStyleManager->AddStyle(pArrowStyle100);
++
++ //reversed arrow:
++ XFArrowStyle *pArrowStyle1 = new XFArrowStyle();
++ pArrowStyle1->SetArrowName( A2OUSTR("reverse arrow") );
++ pArrowStyle1->SetViewbox(A2OUSTR("0 0 140 200"));
++ pArrowStyle1->SetSVGPath(A2OUSTR("M0 0 L70 200 L140 0"));
++ pXFStyleManager->AddStyle(pArrowStyle1);
++
++ //reversed concave arrow
++ XFArrowStyle *pArrowStyle2 = new XFArrowStyle();
++ pArrowStyle2->SetArrowName( A2OUSTR("reverse concave arrow") );
++ pArrowStyle2->SetViewbox(A2OUSTR("0 0 140 200"));
++ pArrowStyle2->SetSVGPath(A2OUSTR("M0 0 L80 200 L160 0 L80 100"));
++ pXFStyleManager->AddStyle(pArrowStyle2);
++
++ //reversed line arrow
++ XFArrowStyle *pArrowStyle3 = new XFArrowStyle();
++ pArrowStyle3->SetArrowName( A2OUSTR("reverse line arrow") );
++ pArrowStyle3->SetViewbox(A2OUSTR("0 0 140 200"));
++ pArrowStyle3->SetSVGPath(A2OUSTR("M0 0 L70 200 L140 0L110 0 L70 160 L20 0 L0 0"));
++ pXFStyleManager->AddStyle(pArrowStyle3);
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpatomholder.cxx lotuswordpro/source/filter/lwpatomholder.cxx
+--- lotuswordpro.bak/source/filter/lwpatomholder.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpatomholder.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,109 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "lwpatomholder.hxx"
++#include "lwptools.hxx"
++#include <osl/thread.h>
++#include <rtl/textenc.h>
++
++LwpAtomHolder::LwpAtomHolder()
++ : m_nAtom(0), m_nAssocAtom(0)
++{}
++
++LwpAtomHolder::~LwpAtomHolder()
++{}
++/**
++ * @descr read atomholder from object stream
++ * the default encoding used in Word Pro is 1252
++*/
++void LwpAtomHolder::Read(LwpObjectStream *pStrm)
++{
++ //Refered to lwp: file40.cpp, QuickReadAtomHolder()
++
++ sal_uInt16 len, diskSize;
++ pStrm->QuickRead(&diskSize, sizeof(diskSize));
++ pStrm->QuickRead(&len, sizeof(len));
++
++ if (len == 0 || diskSize == 0) {
++ m_nAtom = BAD_ATOM;
++ m_nAssocAtom = BAD_ATOM;
++ return;
++ }
++ m_nAtom = m_nAssocAtom = len;
++
++ //rtl_TextEncoding rEncode = gsl_getSystemTextEncoding();
++ rtl_TextEncoding rEncode = RTL_TEXTENCODING_MS_1252;
++ len = LwpTools::QuickReadUnicode(pStrm, m_String, diskSize-sizeof(diskSize), rEncode);
++}
++/**
++ * @descr skip the atom holder in object stream
++*/
++void LwpAtomHolder::Skip(LwpObjectStream *pStrm)
++{
++ sal_uInt16 holdersize;
++ pStrm->QuickRead(&holdersize, sizeof(holdersize));
++ pStrm->SeekRel(holdersize);
++ m_nAtom = m_nAssocAtom = BAD_ATOM;
++}
++/**
++ * @descr read path atom
++ * No use now for lwp filter, just skip the atom
++*/
++void LwpAtomHolder::ReadPathAtom(LwpObjectStream *pStrm)
++{
++ //Refered to lwp: file40.cpp, QuickReadPathAtom()
++ // TODO: Read the data. Now just skip it. The method to skip is same as above.
++ Skip(pStrm);
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpatomholder.hxx lotuswordpro/source/filter/lwpatomholder.hxx
+--- lotuswordpro.bak/source/filter/lwpatomholder.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpatomholder.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,86 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _LWPATOMHOLDER_HXX
++#define _LWPATOMHOLDER_HXX
++
++#include "lwpheader.hxx"
++#include "lwpdefs.hxx"
++#include "lwpobjstrm.hxx"
++/**
++ * @brief AtomHolder class of Word Pro to hold a string
++*/
++class LwpAtomHolder
++{
++public:
++ LwpAtomHolder();
++ ~LwpAtomHolder();
++private:
++ sal_Int32 m_nAtom;
++ sal_Int32 m_nAssocAtom;
++ OUString m_String;
++ //OUString m_UniString; //no use temporarily
++public:
++ void Read(LwpObjectStream *pStrm);
++ void ReadPathAtom(LwpObjectStream *pStrm);
++ void Skip(LwpObjectStream *pStrm);
++ OUString str(){return m_String;}
++ inline sal_Bool HasValue();
++};
++inline sal_Bool LwpAtomHolder::HasValue()
++{
++ return (m_nAtom != BAD_ATOM);
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpbackgroundoverride.hxx lotuswordpro/source/filter/lwpbackgroundoverride.hxx
+--- lotuswordpro.bak/source/filter/lwpbackgroundoverride.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpbackgroundoverride.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,91 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _LWPBACKGROUNDOVERRIDE_HXX
++#define _LWPBACKGROUNDOVERRIDE_HXX
++
++
++#include "lwpoverride.hxx"
++#include "lwpbackgroundstuff.hxx"
++
++class LwpObjectStream;
++class LwpBackgroundOverride : public LwpOverride
++{
++
++public:
++ LwpBackgroundOverride(){};
++ virtual ~LwpBackgroundOverride(){}
++
++
++public:
++ virtual void Read(LwpObjectStream *pStrm)
++ {
++ if (pStrm->QuickReadBool())
++ {
++ ReadCommon(pStrm);
++
++ m_aStuff.Read(pStrm);
++ }
++
++ pStrm->SkipExtra();
++ }
++
++ LwpColor GetBackColor(){ return m_aStuff.m_aFillColor; }
++ LwpBackgroundStuff* GetBGStuff() { return &m_aStuff; }
++
++private:
++ LwpBackgroundStuff m_aStuff;
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpbackgroundstuff.cxx lotuswordpro/source/filter/lwpbackgroundstuff.cxx
+--- lotuswordpro.bak/source/filter/lwpbackgroundstuff.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpbackgroundstuff.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,183 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype
++ * Implemention of class LwpBackgroundStuff.
++ */
++
++#include "lwpbackgroundstuff.hxx"
++#include "lwppttntbl.hxx"
++#include "xfilter/xfbgimage.hxx"
++
++#include "tools/stream.hxx"
++#include "vcl/bmpacc.hxx"
++#include "svx/xbitmap.hxx"
++
++
++void LwpBackgroundStuff::Read(LwpObjectStream* pStrm)
++{
++ pStrm->QuickRead(&m_nID, sizeof(m_nID));
++ m_aFillColor.Read(pStrm);
++ m_aPatternColor.Read(pStrm);
++ pStrm->SkipExtra();
++}
++
++void LwpBackgroundStuff::GetPattern(sal_uInt16 btPttnIndex, sal_uInt8* pPttnArray)
++{
++ if (btPttnIndex > 71)
++ {
++ assert(false);
++ return;
++ }
++ if (pPttnArray)
++ {
++ assert((2 < btPttnIndex) && (btPttnIndex < 72));
++ sal_uInt8* pTempArray = s_pLwpPatternTab[btPttnIndex];
++ for(sal_uInt8 i = 0; i < 32; i++)
++ {
++ pPttnArray[i] = (i%4 == 0) ? pTempArray[7-i/4] : 0;
++ }
++ }
++}
++
++LwpColor* LwpBackgroundStuff::GetFillColor()
++{
++ if (m_nID == BACK_PATTERN)
++ {
++ return &m_aPatternColor;
++ }
++
++ return &m_aFillColor;
++}
++
++XFBGImage* LwpBackgroundStuff::GetFillPattern()
++{
++ // not pattern fill?
++ if (!this->IsPatternFill())
++ {
++ return NULL;
++ }
++
++ // get pattern array from pattern table
++ sal_uInt8* pPttnArray = new sal_uInt8 [32];
++ this->GetPattern(m_nID, pPttnArray);
++
++ // create bitmap object from the pattern array
++ Bitmap aBmp( Size(8, 8), 1 );
++ BitmapWriteAccess* pWA = aBmp.AcquireWriteAccess();
++ sal_uInt8* pBuf = pWA->GetBuffer();
++ memcpy(pBuf, pPttnArray, 32);
++ aBmp.ReleaseAccess(pWA);
++
++ if (pPttnArray)
++ {
++ delete [] pPttnArray;
++ pPttnArray = NULL;
++ }
++
++ // create XOBitmap object from bitmap object
++ XOBitmap aXOBitmap;
++ aXOBitmap.SetBitmap( aBmp );
++ aXOBitmap.Bitmap2Array();
++ aXOBitmap.SetBitmapType( XBITMAP_8X8 );
++
++ // set back/fore-ground colors
++ if (m_aFillColor.IsValidColor() && m_aPatternColor.IsValidColor())
++ {
++ Color aBackColor(static_cast<sal_uInt8>(m_aFillColor.GetRed()),
++ static_cast<sal_uInt8>(m_aFillColor.GetGreen()),
++ static_cast<sal_uInt8>(m_aFillColor.GetBlue()));
++ Color aForeColor(static_cast<sal_uInt8>(m_aPatternColor.GetRed()),
++ static_cast<sal_uInt8>(m_aPatternColor.GetGreen()),
++ static_cast<sal_uInt8>(m_aPatternColor.GetBlue()));
++
++ if( aXOBitmap.GetBackgroundColor() == COL_BLACK )
++ {
++ aXOBitmap.SetPixelColor( aBackColor );
++ aXOBitmap.SetBackgroundColor( aForeColor );
++ }
++ else
++ {
++ aXOBitmap.SetPixelColor( aForeColor );
++ aXOBitmap.SetBackgroundColor( aBackColor );
++ }
++ }
++
++ // transfer image data from XOBitmap->SvStream->BYTE-Array
++ SvMemoryStream aPicMemStream;
++ aXOBitmap.Array2Bitmap();
++ aXOBitmap.GetBitmap().Write(aPicMemStream);
++ sal_uInt32 nSize = aPicMemStream.GetSize();
++ sal_uInt8* pImageBuff = new sal_uInt8 [nSize];
++ memcpy(pImageBuff, aPicMemStream.GetData(), nSize);
++
++ // create XFBGImage object.
++ XFBGImage* pXFBGImage = new XFBGImage();
++ pXFBGImage->SetImageData(pImageBuff, nSize);
++
++ if (pImageBuff)
++ {
++ delete [] pImageBuff;
++ pImageBuff = NULL;
++ }
++
++
++ pXFBGImage->SetRepeate();
++ // end of add
++
++ return pXFBGImage;
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpbackgroundstuff.hxx lotuswordpro/source/filter/lwpbackgroundstuff.hxx
+--- lotuswordpro.bak/source/filter/lwpbackgroundstuff.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpbackgroundstuff.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,169 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++* @file
++* Backgound object of Wordpro.
++************************************************************************/
++/*************************************************************************
++* Change History
++* 2005-01-12 Create and implement.
++************************************************************************/
++#ifndef _LWPBACKGROUNDSTUFF_HXX
++#define _LWPBACKGROUNDSTUFF_HXX
++#include "lwpcolor.hxx"
++
++/* background patterns */
++#define BACK_TRANSPARENT 0
++#define BACK_FILL 1
++#define BACK_PATTERN 2
++#define BACK_10PCTDOTS 3
++#define BACK_30PCTDOTS 4
++#define BACK_50PCTDOTS 5
++#define BACK_75PCTDOTS 6
++#define BACK_90PCTDOTS 7
++#define BACK_90PCTINVDOTS 8
++#define BACK_75PCTINVDOTS 9
++#define BACK_50PCTINVDOTS 10
++#define BACK_30PCTINVDOTS 11
++#define BACK_10PCTINVDOTS 12
++#define BACK_MARBLES 13
++#define BACK_STARRYNIGHT 14
++#define BACK_DIAGTHICK 15
++#define BACK_DIAGTHIN 16
++#define BACK_DIAGDOUBLE 17
++#define BACK_DIAGDOUBLENARROW 18
++#define BACK_DIAGTRIPLE 19
++#define BACK_DIAGSINGLEWIDE 20
++#define BACK_DIAGTHICKINV 21
++#define BACK_DIAGTHININV 22
++#define BACK_DIAGDOUBLEINV 23
++#define BACK_DIAGDOUBLENARROWINV 24
++#define BACK_DIAGTRIPLEINV 25
++#define BACK_DIAGSINGLEWIDEINV 26
++#define BACK_CHAINLINKSMALLINV 27
++#define BACK_CHAINLINKSMALL 28
++#define BACK_CHAINLINKMEDIUM 29
++#define BACK_CHAINLINKLARGE 30
++#define BACK_HORZSTRIPE1 31
++#define BACK_HORZSTRIPE2 32
++#define BACK_HORZSTRIPE3 33
++#define BACK_HORZSTRIPE4 34
++#define BACK_VERTSTRIPE1 35
++#define BACK_VERTSTRIPE2 36
++#define BACK_VERTSTRIPE3 37
++#define BACK_VERTSTRIPE4 38
++#define BACK_GRIDSMALL 39
++#define BACK_GRIDMEDIUM 40
++#define BACK_GRIDLARGE 41
++#define BACK_BOXDOT 42
++#define BACK_GOLFGREEN 43
++#define BACK_DITZ 44
++#define BACK_HORZWEAVE 45
++#define BACK_APPLEPIE 46
++#define BACK_BRICK 47
++#define BACK_DIAGBRICK 48
++#define BACK_CHECKER1 49
++#define BACK_CHECKER2 50
++#define BACK_CHECKER3 51
++#define BACK_CHECKER4 52
++#define BACK_CHECKER5 53
++#define BACK_SNOWFLAKE 54
++#define BACK_MARGARITA 55
++#define BACK_SIDEHARP 56
++#define BACK_SCALES 57
++#define BACK_TAYLOR 58
++#define BACK_BUBBLES 59
++#define BACK_ARGYLE 60
++#define BACK_INDIAN1 61
++#define BACK_INDIAN3 62
++#define BACK_PEACHPIE 63
++#define BACK_GRADIENT1 64
++#define BACK_GRADIENT2 65
++#define BACK_GRADIENT3 66
++#define BACK_GRADIENT4 67
++#define BACK_GRADIENT5 68
++#define BACK_GRADIENT6 69
++#define BACK_GRADIENT7 70
++#define BACK_GRADIENT8 71
++
++class XFBGImage;
++class LwpBackgroundStuff
++{
++public:
++ LwpBackgroundStuff()
++ {
++ m_nID = 0;
++ }
++
++private:
++ void GetPattern(sal_uInt16 btPttnIndex, sal_uInt8* pPttnArray);
++
++public:
++ void Read(LwpObjectStream *pStrm);
++ LwpColor* GetFillColor();
++ XFBGImage* GetFillPattern();
++
++ inline sal_Bool IsTransparent() {return (m_nID == BACK_TRANSPARENT);}
++ inline sal_Bool IsPatternFill() { return (sal_Bool)(m_nID > 2 && m_nID < 72); }
++
++ friend class LwpBackgroundOverride;
++private:
++ sal_uInt16 m_nID;
++ LwpColor m_aFillColor;
++ LwpColor m_aPatternColor;
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwpbasetype.cxx lotuswordpro/source/filter/lwpbasetype.cxx
+--- lotuswordpro.bak/source/filter/lwpbasetype.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpbasetype.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,93 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "lwpbasetype.hxx"
++/**
++ * @descr read PonoseNumber from object stream
++*/
++void LwpPanoseNumber::Read(LwpObjectStream *pStrm)
++{
++ pStrm->QuickRead(&m_nFamilyType, sizeof(m_nFamilyType));
++ pStrm->QuickRead(&m_nSerifStyle, sizeof(m_nSerifStyle));
++ pStrm->QuickRead(&m_nWeight, sizeof(m_nWeight));
++ pStrm->QuickRead(&m_nProportion, sizeof(m_nProportion));
++ pStrm->QuickRead(&m_nContrast, sizeof(m_nContrast));
++ pStrm->QuickRead(&m_nStrokeVariation, sizeof(m_nStrokeVariation));
++ pStrm->QuickRead(&m_nArmStyle, sizeof(m_nArmStyle));
++ pStrm->QuickRead(&m_nLetterform, sizeof(m_nLetterform));
++ pStrm->QuickRead(&m_nMidline, sizeof(m_nMidline));
++ pStrm->QuickRead(&m_nXHeight, sizeof(m_nXHeight));
++
++}
++LwpPoint::LwpPoint()
++{
++ Reset();
++}
++/**
++ * @descr read point from object stream
++*/
++void LwpPoint::Read(LwpObjectStream *pStrm)
++{
++ pStrm->QuickRead(&m_nX, sizeof(m_nX));
++ pStrm->QuickRead(&m_nY, sizeof(m_nY));
++}
++/**
++ * @descr reset to zero
++*/
++void LwpPoint::Reset()
++{
++ m_nX=0L;
++ m_nY=0L;
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpbasetype.hxx lotuswordpro/source/filter/lwpbasetype.hxx
+--- lotuswordpro.bak/source/filter/lwpbasetype.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpbasetype.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,117 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * basic classes for Word Pro filter,
++ * PanoseNumber, Point
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++
++#ifndef _LWPBASETYPE_HXX
++#define _LWPBASETYPE_HXX
++
++#include "lwpobjstrm.hxx"
++#include "lwpheader.hxx"
++
++/**
++ * @brief used for lwpfont for font description
++*/
++class LwpPanoseNumber
++{
++public:
++ LwpPanoseNumber(){};
++ ~LwpPanoseNumber(){};
++public:
++ void Read(LwpObjectStream *pStrm);
++private:
++ sal_uInt8 m_nFamilyType;
++ sal_uInt8 m_nSerifStyle;
++ sal_uInt8 m_nWeight;
++ sal_uInt8 m_nProportion;
++ sal_uInt8 m_nContrast;
++ sal_uInt8 m_nStrokeVariation;
++ sal_uInt8 m_nArmStyle;
++ sal_uInt8 m_nLetterform;
++ sal_uInt8 m_nMidline;
++ sal_uInt8 m_nXHeight;
++};
++/**
++ * @brief point class
++*/
++class LwpPoint
++{
++public:
++ LwpPoint();
++ void Read(LwpObjectStream *pStrm);
++ void Reset();
++ inline const sal_Int32 GetX();
++ inline const sal_Int32 GetY();
++ inline void SetX(sal_Int32 nX);
++ inline void SetY(sal_Int32 nY);
++protected:
++ sal_Int32 m_nX;
++ sal_Int32 m_nY;
++};
++
++const sal_Int32 LwpPoint::GetX(){return m_nX;}
++const sal_Int32 LwpPoint::GetY(){return m_nY;}
++void LwpPoint::SetX(sal_Int32 nX){m_nX = nX;}
++void LwpPoint::SetY(sal_Int32 nY){m_nY = nY;}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpbookmarkmgr.cxx lotuswordpro/source/filter/lwpbookmarkmgr.cxx
+--- lotuswordpro.bak/source/filter/lwpbookmarkmgr.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpbookmarkmgr.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,112 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "lwpbookmarkmgr.hxx"
++
++void LwpBookmarkMgr::AddXFBookmarkStart(OUString sName,XFBookmarkStart* pMark)
++{
++ std::map<OUString,XFBookmarkStart*>::iterator iter;
++ iter = m_MapStart.find(sName);
++ if (iter == m_MapStart.end())//not find
++ {
++ m_MapStart[sName] = pMark;
++ }
++ else //have exist the same bookmark name
++ {
++ XFBookmarkStart* pFind = iter->second;
++ OUString totalName = pFind->GetDivision() + A2OUSTR(":");
++ totalName += pFind->GetName();
++ pFind->SetName(totalName);
++ m_MapStart[totalName] = pFind;
++ m_MapStart[sName] = pMark;
++ }
++}
++void LwpBookmarkMgr::AddXFBookmarkEnd(OUString sName,XFBookmarkEnd* pMark)
++{
++ std::map<OUString,XFBookmarkEnd*>::iterator iter;
++ iter = m_MapEnd.find(sName);
++ if (iter == m_MapEnd.end())//not find
++ {
++ m_MapEnd[sName] = pMark;
++ }
++ else //have exist the same bookmark name
++ {
++ XFBookmarkEnd* pFind = iter->second;
++ OUString totalName = pFind->GetDivision() + A2OUSTR(":");
++ totalName += pFind->GetName();
++ pFind->SetName(totalName);
++ m_MapEnd[totalName] = pFind;
++ m_MapEnd[sName] = pMark;
++ }
++}
++sal_Bool LwpBookmarkMgr::FindBookmark(OUString sName)
++{
++ std::map<OUString,XFBookmarkStart*>::iterator iter;
++ iter = m_MapStart.find(sName);
++ if (iter != m_MapStart.end())
++ return sal_True;
++ else
++ return sal_False;
++}
++
++LwpBookmarkMgr::LwpBookmarkMgr()
++{
++ m_MapStart.clear();
++ m_MapEnd.clear();
++}
++LwpBookmarkMgr::~LwpBookmarkMgr()
++{
++ m_MapStart.clear();
++ m_MapEnd.clear();
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpbookmarkmgr.hxx lotuswordpro/source/filter/lwpbookmarkmgr.hxx
+--- lotuswordpro.bak/source/filter/lwpbookmarkmgr.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpbookmarkmgr.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,84 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ May 2005 Created
++ ************************************************************************/
++#ifndef _LWPBOOKMARKMGR_HXX_
++#define _LWPBOOKMARKMGR_HXX_
++
++#include "lwpfilehdr.hxx"
++#include <map>
++
++#include "xfilter/xfbookmark.hxx"
++
++class LwpBookmarkMgr
++{
++public:
++ void AddXFBookmarkEnd(OUString sName,XFBookmarkEnd* pMark);
++ void AddXFBookmarkStart(OUString sName,XFBookmarkStart* pMark);
++ sal_Bool FindBookmark(OUString sName);
++ ~LwpBookmarkMgr();
++ LwpBookmarkMgr();
++private:
++ std::map<OUString,XFBookmarkStart*> m_MapStart;
++ std::map<OUString,XFBookmarkEnd*> m_MapEnd;
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpborderstuff.cxx lotuswordpro/source/filter/lwpborderstuff.cxx
+--- lotuswordpro.bak/source/filter/lwpborderstuff.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpborderstuff.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,247 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++* @file
++* Border stuff of Wordpro.
++************************************************************************/
++/*************************************************************************
++* Change History
++* 2005-01-11 Create and implement.
++* 2005-01-17 Add Get** functions.
++************************************************************************/
++#include "lwpborderstuff.hxx"
++#include "lwpstyledef.hxx"
++#include "lwpfilehdr.hxx"
++#include "lwptools.hxx"
++
++LwpBorderStuff::LwpBorderStuff()
++{
++ m_nSides = 0;
++ m_nValid = 0;
++
++ m_nBoderGroupIDLeft = 0;
++ m_nBoderGroupIDRight = 0;
++ m_nBoderGroupIDTop = 0;
++ m_nBoderGroupIDBottom = 0;
++
++ m_nGroupIndent = 0;
++
++ m_nWidthLeft = 0;
++ m_nWidthTop = 0;
++ m_nWidthRight = 0;
++ m_nWidthBottom = 0;
++}
++
++void LwpBorderStuff::Read(LwpObjectStream *pStrm)
++{
++ pStrm->QuickRead(&m_nSides, sizeof(m_nSides) );
++ if( m_nSides&LEFT )
++ {
++ pStrm->QuickRead(&m_nBoderGroupIDLeft, sizeof(m_nBoderGroupIDLeft));
++ pStrm->QuickRead(&m_nWidthLeft, sizeof(m_nWidthLeft));
++ m_aColorLeft.Read(pStrm);
++
++ if( LwpFileHeader::m_nFileRevision < 0x000b )
++ {
++ pStrm->SeekRel(8);
++ }
++ }
++
++ if( m_nSides&RIGHT )
++ {
++ pStrm->QuickRead(&m_nBoderGroupIDRight, sizeof(m_nBoderGroupIDRight));
++ pStrm->QuickRead(&m_nWidthRight, sizeof(m_nWidthRight));
++ m_aColorRight.Read(pStrm);
++
++ if( LwpFileHeader::m_nFileRevision < 0x000b )
++ {
++ pStrm->SeekRel(8);
++ }
++ }
++
++ if( m_nSides&TOP )
++ {
++ pStrm->QuickRead(&m_nBoderGroupIDTop, sizeof(m_nBoderGroupIDTop));
++ pStrm->QuickRead(&m_nWidthTop, sizeof(m_nWidthTop));
++ m_aColorTop.Read(pStrm);
++
++ if( LwpFileHeader::m_nFileRevision < 0x000b )
++ {
++ pStrm->SeekRel(8);
++ }
++ }
++
++ if( m_nSides&BOTTOM )
++ {
++ pStrm->QuickRead(&m_nBoderGroupIDBottom, sizeof(m_nBoderGroupIDBottom));
++ pStrm->QuickRead(&m_nWidthBottom, sizeof(m_nWidthBottom));
++ m_aColorBottom.Read(pStrm);
++
++ if( LwpFileHeader::m_nFileRevision < 0x000b )
++ {
++ pStrm->SeekRel(8);
++ }
++ }
++
++ pStrm->QuickRead( &m_nGroupIndent, sizeof(m_nGroupIndent) );
++ pStrm->QuickRead( &m_nValid, sizeof(m_nValid) );
++ pStrm->SkipExtra();
++
++ if( LwpFileHeader::m_nFileRevision < 0x0010 )
++ {
++ if( m_nBoderGroupIDLeft&EXTERNAL_ID )
++ {
++ m_nBoderGroupIDLeft = BGRP_SOLID;
++ }
++ if( m_nBoderGroupIDRight&EXTERNAL_ID )
++ {
++ m_nBoderGroupIDRight = BGRP_SOLID;
++ }
++ if( m_nBoderGroupIDTop&EXTERNAL_ID )
++ {
++ m_nBoderGroupIDTop = BGRP_SOLID;
++ }
++ if( m_nBoderGroupIDBottom&EXTERNAL_ID )
++ {
++ m_nBoderGroupIDBottom = BGRP_SOLID;
++ }
++ }
++}
++
++sal_Bool LwpBorderStuff::HasSide(sal_uInt16 side)
++{
++ return m_nSides&side;
++}
++
++sal_uInt16 LwpBorderStuff::GetSideType(sal_uInt16 side)
++{
++ switch(side)
++ {
++ case LEFT:
++ return m_nBoderGroupIDLeft;
++ break;
++ case RIGHT:
++ return m_nBoderGroupIDRight;
++ break;
++ case TOP:
++ return m_nBoderGroupIDTop;
++ break;
++ case BOTTOM:
++ return m_nBoderGroupIDBottom;
++ break;
++ }
++}
++
++LwpColor LwpBorderStuff::GetSideColor(sal_uInt16 side)
++{
++ switch(side)
++ {
++ case LEFT:
++ return m_aColorLeft;
++ break;
++ case RIGHT:
++ return m_aColorRight;
++ break;
++ case TOP:
++ return m_aColorTop;
++ break;
++ case BOTTOM:
++ return m_aColorBottom;
++ break;
++ }
++}
++
++float LwpBorderStuff::GetSideWidth(sal_uInt16 side)
++{
++ switch(side)
++ {
++ case LEFT:
++ return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nWidthLeft));
++ break;
++ case RIGHT:
++ return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nWidthRight));
++ break;
++ case TOP:
++ return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nWidthTop));
++ break;
++ case BOTTOM:
++ return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nWidthBottom));
++ break;
++ }
++}
++
++void LwpBorderStuff::operator = (const LwpBorderStuff& rOther)
++{
++ m_nSides = rOther.m_nSides;
++ m_nValid = rOther.m_nValid;
++
++ m_nBoderGroupIDLeft = rOther.m_nBoderGroupIDLeft;
++ m_nBoderGroupIDRight = rOther.m_nBoderGroupIDRight;
++ m_nBoderGroupIDTop = rOther.m_nBoderGroupIDTop;
++ m_nBoderGroupIDBottom = rOther.m_nBoderGroupIDBottom;
++
++ m_nGroupIndent = rOther.m_nGroupIndent;
++
++ m_nWidthLeft = rOther.m_nWidthLeft;
++ m_nWidthTop = rOther.m_nWidthTop;
++ m_nWidthRight = rOther.m_nWidthRight;
++ m_nWidthBottom = rOther.m_nWidthBottom;
++
++ m_aColorLeft = rOther.m_aColorLeft;
++ m_aColorRight = rOther.m_aColorRight;
++ m_aColorTop = rOther.m_aColorTop;
++ m_aColorBottom = rOther.m_aColorBottom;
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpborderstuff.hxx lotuswordpro/source/filter/lwpborderstuff.hxx
+--- lotuswordpro.bak/source/filter/lwpborderstuff.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpborderstuff.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,119 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++* @file
++* Border stuff of Wordpro.
++************************************************************************/
++/*************************************************************************
++* Change History
++* 2005-01-11 Create and implement.
++************************************************************************/
++#ifndef _LWPBORDERSTUFF_HXX
++#define _LWPBORDERSTUFF_HXX
++
++#include "lwpcolor.hxx"
++
++class LwpBorderStuff
++{
++public:
++ LwpBorderStuff();
++
++ enum BorderType
++ {
++ NOSIDE = 0,
++ LEFT = 1,
++ RIGHT = 2,
++ TOP = 4,
++ BOTTOM = 8,
++ ALLSIDE = 15,
++ TEMPORARY = 0xff00
++ };
++
++public:
++ void Read(LwpObjectStream *pStrm);
++
++ sal_uInt16 GetSide(){ return m_nSides; }
++ sal_Bool HasSide(sal_uInt16 side);
++ sal_uInt16 GetSideType(sal_uInt16 side);
++ LwpColor GetSideColor(sal_uInt16 side);
++ float GetSideWidth(sal_uInt16 side);
++ //add by , 01/26/2004
++ void operator = (const LwpBorderStuff& rOther);
++ //end
++ friend class LwpParaBorderOverride;
++private:
++ sal_uInt16 m_nSides;
++ sal_uInt16 m_nValid;
++
++ sal_uInt16 m_nBoderGroupIDLeft;
++ sal_uInt16 m_nBoderGroupIDRight;
++ sal_uInt16 m_nBoderGroupIDTop;
++ sal_uInt16 m_nBoderGroupIDBottom;
++
++ sal_Int32 m_nGroupIndent;
++
++ sal_Int32 m_nWidthLeft;
++ sal_Int32 m_nWidthTop;
++ sal_Int32 m_nWidthRight;
++ sal_Int32 m_nWidthBottom;
++
++ LwpColor m_aColorLeft;
++ LwpColor m_aColorRight;
++ LwpColor m_aColorTop;
++ LwpColor m_aColorBottom;
++
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpbreaksoverride.cxx lotuswordpro/source/filter/lwpbreaksoverride.cxx
+--- lotuswordpro.bak/source/filter/lwpbreaksoverride.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpbreaksoverride.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,280 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++* @file
++* Breaks override of Wordpro.
++************************************************************************/
++/*************************************************************************
++* Change History
++* 2005-01-12 Create and implement.
++************************************************************************/
++#include "lwpbreaksoverride.hxx"
++#include "lwpobjstrm.hxx"
++#include "lwpatomholder.hxx"
++
++
++LwpBreaksOverride::LwpBreaksOverride()
++{
++ m_pNextStyle = new LwpAtomHolder();
++}
++
++LwpBreaksOverride::~LwpBreaksOverride()
++{
++ if( m_pNextStyle )
++ delete m_pNextStyle;
++}
++
++void LwpBreaksOverride::Read(LwpObjectStream *pStrm)
++{
++ if (pStrm->QuickReadBool())
++ {
++ ReadCommon(pStrm);
++
++ m_pNextStyle->Read(pStrm);
++ }
++
++ pStrm->SkipExtra();
++}
++
++//add by , 01/28/2005
++void LwpBreaksOverride::Override(LwpBreaksOverride* pOther)
++{
++ if (m_nApply & BO_PAGEBEFORE)
++ {
++ if (IsPageBreakBeforeOverridden())
++ {
++ pOther->OverridePageBreakBefore(IsPageBreakBefore());
++ }
++ else
++ {
++ pOther->RevertPageBreakBefore();
++ }
++ }
++ if (m_nApply & BO_PAGEAFTER)
++ {
++ if (IsPageBreakAfterOverridden())
++ {
++ pOther->OverridePageBreakAfter(IsPageBreakAfter());
++ }
++ else
++ {
++ pOther->RevertPageBreakAfter();
++ }
++ }
++ if (m_nApply & BO_KEEPTOGETHER)
++ {
++ if (IsPageBreakWithinOverridden())
++ {
++ pOther->OverridePageBreakWithin(IsPageBreakWithin());
++ }
++ else
++ {
++ pOther->RevertPageBreakWithin();
++ }
++ }
++ if (m_nApply & BO_COLBEFORE)
++ {
++ if (IsColumnBreakBeforeOverridden())
++ {
++ pOther->OverrideColumnBreakBefore(IsColumnBreakBefore());
++ }
++ else
++ {
++ pOther->RevertColumnBreakBefore();
++ }
++ }
++ if (m_nApply & BO_COLAFTER)
++ {
++ if (IsColumnBreakAfterOverridden())
++ {
++ pOther->OverrideColumnBreakAfter(IsColumnBreakAfter());
++ }
++ else
++ {
++ pOther->RevertColumnBreakAfter();
++ }
++ }
++ if (m_nApply & BO_KEEPPREV)
++ {
++ if (IsKeepWithPreviousOverridden())
++ {
++ pOther->OverrideKeepWithPrevious(IsKeepWithPrevious());
++ }
++ else
++ {
++ pOther->RevertKeepWithPrevious();
++ }
++ }
++ if (m_nApply & BO_KEEPNEXT)
++ {
++ if (IsKeepWithNextOverridden())
++ {
++ pOther->OverrideKeepWithNext(IsKeepWithNext());
++ }
++ else
++ {
++ pOther->RevertKeepWithNext();
++ }
++ }
++ if (m_nApply & BO_USENEXTSTYLE)
++ {
++ if (IsUseNextStyleOverridden())
++ {
++ pOther->OverrideUseNextStyle(IsUseNextStyle());
++ }
++ else
++ {
++ pOther->RevertUseNextStyle();
++ }
++ }
++}
++
++void LwpBreaksOverride::operator=(const LwpOverride& rOther)
++{
++ LwpOverride::operator=(rOther);
++
++ // copy m_pNextStyle...
++}
++
++void LwpBreaksOverride::OverridePageBreakBefore(sal_Bool bVal)
++{
++ if(bVal)
++ {
++ LwpOverride::Override(BO_PAGEBEFORE, STATE_ON);
++ }
++ else
++ {
++ LwpOverride::Override(BO_PAGEBEFORE, STATE_OFF);
++ }
++}
++void LwpBreaksOverride::OverridePageBreakAfter(sal_Bool bVal)
++{
++ if(bVal)
++ {
++ LwpOverride::Override(BO_PAGEAFTER, STATE_ON);
++ }
++ else
++ {
++ LwpOverride::Override(BO_PAGEAFTER, STATE_OFF);
++ }
++}
++void LwpBreaksOverride::OverridePageBreakWithin(sal_Bool bVal)
++{
++ // Note the flipped logic
++ if(!bVal)
++ {
++ LwpOverride::Override(BO_KEEPTOGETHER, STATE_ON);
++ }
++ else
++ {
++ LwpOverride::Override(BO_KEEPTOGETHER, STATE_OFF);
++ }
++}
++void LwpBreaksOverride::OverrideColumnBreakBefore(sal_Bool bVal)
++{
++ if(bVal)
++ {
++ LwpOverride::Override(BO_COLBEFORE, STATE_ON);
++ }
++ else
++ {
++ LwpOverride::Override(BO_COLBEFORE, STATE_OFF);
++ }
++}
++void LwpBreaksOverride::OverrideColumnBreakAfter(sal_Bool bVal)
++{
++ if(bVal)
++ {
++ LwpOverride::Override(BO_COLAFTER, STATE_ON);
++ }
++ else
++ {
++ LwpOverride::Override(BO_COLAFTER, STATE_OFF);
++ }
++}
++void LwpBreaksOverride::OverrideKeepWithNext(sal_Bool bVal)
++{
++ if(bVal)
++ {
++ LwpOverride::Override(BO_KEEPNEXT, STATE_ON);
++ }
++ else
++ {
++ LwpOverride::Override(BO_KEEPNEXT, STATE_OFF);
++ }
++}
++void LwpBreaksOverride::OverrideKeepWithPrevious(sal_Bool bVal)
++{
++ if(bVal)
++ {
++ LwpOverride::Override(BO_KEEPPREV, STATE_ON);
++ }
++ else
++ {
++ LwpOverride::Override(BO_KEEPPREV, STATE_OFF);
++ }
++}
++void LwpBreaksOverride::OverrideUseNextStyle(sal_Bool bVal)
++{
++ if(bVal)
++ {
++ LwpOverride::Override(BO_USENEXTSTYLE, STATE_ON);
++ }
++ else
++ {
++ LwpOverride::Override(BO_USENEXTSTYLE, STATE_OFF);
++ }
++}
++//end add
+diff -urNp lotuswordpro.bak/source/filter/lwpbreaksoverride.hxx lotuswordpro/source/filter/lwpbreaksoverride.hxx
+--- lotuswordpro.bak/source/filter/lwpbreaksoverride.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpbreaksoverride.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,248 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++* @file
++* Breaks override of Wordpro.
++************************************************************************/
++/*************************************************************************
++* Change History
++* 2005-01-12 Create and implement.
++************************************************************************/
++#ifndef _LWPBREAKSOVERRIDE_HXX
++#define _LWPBREAKSOVERRIDE_HXX
++
++#include "lwpoverride.hxx"
++
++class LwpObjectStream;
++class LwpAtomHolder;
++class LwpBreaksOverride : public LwpOverride
++{
++
++public:
++ LwpBreaksOverride();
++ virtual ~LwpBreaksOverride();
++
++ enum
++ {
++ BO_PAGEBEFORE = 0x01, // page break before this style
++ BO_PAGEAFTER = 0x02, // page break after this style
++ BO_KEEPTOGETHER = 0x04,
++ BO_COLBEFORE = 0x08, // col break before this style
++ BO_COLAFTER = 0x10, // col break after this style
++ BO_KEEPPREV = 0x20, // not with-PAGE BEF, COL BEF or WITHIN
++ BO_KEEPNEXT = 0x40, // not with-PAGE AFT, COL AFT or WITHIN
++ BO_USENEXTSTYLE = 0x80, // use next style name
++ BO_NEXTSTYLE = 0x100 // next style name
++ };
++public:
++ virtual void Read(LwpObjectStream *pStrm);
++
++ //add by , 01/28/2005
++ void Override(LwpBreaksOverride* pOther);
++
++ void operator=(const LwpOverride& rOther);
++
++ inline sal_Bool IsPageBreakBefore();
++ inline sal_Bool IsPageBreakAfter();
++ inline sal_Bool IsPageBreakWithin();
++ inline sal_Bool IsColumnBreakBefore();
++ inline sal_Bool IsColumnBreakAfter();
++ inline sal_Bool IsKeepWithNext();
++ inline sal_Bool IsKeepWithPrevious();
++ inline sal_Bool IsUseNextStyle();
++
++ inline sal_Bool IsPageBreakBeforeOverridden();
++ inline sal_Bool IsPageBreakAfterOverridden();
++ inline sal_Bool IsPageBreakWithinOverridden();
++ inline sal_Bool IsColumnBreakBeforeOverridden();
++ inline sal_Bool IsColumnBreakAfterOverridden();
++ inline sal_Bool IsKeepWithNextOverridden();
++ inline sal_Bool IsKeepWithPreviousOverridden();
++ inline sal_Bool IsUseNextStyleOverridden();
++
++ inline void RevertPageBreakBefore();
++ inline void RevertPageBreakAfter();
++ inline void RevertPageBreakWithin();
++ inline void RevertColumnBreakBefore();
++ inline void RevertColumnBreakAfter();
++ inline void RevertKeepWithNext();
++ inline void RevertKeepWithPrevious();
++ inline void RevertUseNextStyle();
++
++
++ void OverridePageBreakBefore(sal_Bool bVal);
++ void OverridePageBreakAfter(sal_Bool bVal);
++ void OverridePageBreakWithin(sal_Bool bVal);
++ void OverrideColumnBreakBefore(sal_Bool bVal);
++ void OverrideColumnBreakAfter(sal_Bool bVal);
++ void OverrideKeepWithNext(sal_Bool bVal);
++ void OverrideKeepWithPrevious(sal_Bool bVal);
++ void OverrideUseNextStyle(sal_Bool bVal);
++
++
++ inline LwpAtomHolder* GetNextStyle();
++ //end add
++
++private:
++ LwpAtomHolder *m_pNextStyle;
++};
++
++inline sal_Bool LwpBreaksOverride::IsPageBreakBefore()
++{
++ return (sal_Bool)((m_nValues & BO_PAGEBEFORE) != 0);
++}
++
++inline sal_Bool LwpBreaksOverride::IsPageBreakAfter()
++{
++ return (sal_Bool)((m_nValues & BO_PAGEAFTER) != 0);
++}
++inline sal_Bool LwpBreaksOverride::IsPageBreakWithin()
++{
++ return (sal_Bool)((m_nValues & BO_KEEPTOGETHER) != 0);
++}
++inline sal_Bool LwpBreaksOverride::IsColumnBreakBefore()
++{
++ return (sal_Bool)((m_nValues & BO_COLBEFORE) != 0);
++}
++inline sal_Bool LwpBreaksOverride::IsColumnBreakAfter()
++{
++ return (sal_Bool)((m_nValues & BO_COLAFTER) != 0);
++}
++inline sal_Bool LwpBreaksOverride::IsKeepWithNext()
++{
++ return (sal_Bool)((m_nValues & BO_KEEPNEXT) != 0);
++}
++inline sal_Bool LwpBreaksOverride::IsKeepWithPrevious()
++{
++ return (sal_Bool)((m_nValues & BO_KEEPPREV) != 0);
++}
++inline sal_Bool LwpBreaksOverride::IsUseNextStyle()
++{
++ return (sal_Bool)((m_nValues & BO_USENEXTSTYLE) != 0);
++}
++
++inline sal_Bool LwpBreaksOverride::IsPageBreakBeforeOverridden()
++{
++ return (sal_Bool)((m_nOverride& BO_PAGEBEFORE) != 0);
++}
++inline sal_Bool LwpBreaksOverride::IsPageBreakAfterOverridden()
++{
++ return (sal_Bool)((m_nOverride& BO_PAGEAFTER) != 0);
++}
++inline sal_Bool LwpBreaksOverride::IsPageBreakWithinOverridden()
++{
++ return (sal_Bool)((m_nOverride& BO_KEEPTOGETHER) != 0);
++}
++inline sal_Bool LwpBreaksOverride::IsColumnBreakBeforeOverridden()
++{
++ return (sal_Bool)((m_nOverride& BO_COLBEFORE) != 0);
++}
++inline sal_Bool LwpBreaksOverride::IsColumnBreakAfterOverridden()
++{
++ return (sal_Bool)((m_nOverride& BO_COLAFTER) != 0);
++}
++inline sal_Bool LwpBreaksOverride::IsKeepWithNextOverridden()
++{
++ return (sal_Bool)((m_nOverride& BO_KEEPNEXT) != 0);
++}
++inline sal_Bool LwpBreaksOverride::IsKeepWithPreviousOverridden()
++{
++ return (sal_Bool)((m_nOverride& BO_KEEPPREV) != 0);
++}
++inline sal_Bool LwpBreaksOverride::IsUseNextStyleOverridden()
++{
++ return (sal_Bool)((m_nOverride& BO_USENEXTSTYLE) != 0);
++}
++
++inline void LwpBreaksOverride::RevertPageBreakBefore()
++{
++ LwpOverride::Override(BO_PAGEBEFORE, STATE_STYLE);
++}
++inline void LwpBreaksOverride::RevertPageBreakAfter()
++{
++ LwpOverride::Override(BO_PAGEAFTER, STATE_STYLE);
++}
++inline void LwpBreaksOverride::RevertPageBreakWithin()
++{
++ LwpOverride::Override(BO_KEEPTOGETHER, STATE_STYLE);
++}
++inline void LwpBreaksOverride::RevertColumnBreakBefore()
++{
++ LwpOverride::Override(BO_COLBEFORE, STATE_STYLE);
++}
++inline void LwpBreaksOverride::RevertColumnBreakAfter()
++{
++ LwpOverride::Override(BO_COLAFTER, STATE_STYLE);
++}
++inline void LwpBreaksOverride::RevertKeepWithNext()
++{
++ LwpOverride::Override(BO_KEEPNEXT, STATE_STYLE);
++}
++inline void LwpBreaksOverride::RevertKeepWithPrevious()
++{
++ LwpOverride::Override(BO_KEEPPREV, STATE_STYLE);
++}
++inline void LwpBreaksOverride::RevertUseNextStyle()
++{
++ LwpOverride::Override(BO_USENEXTSTYLE, STATE_STYLE);
++}
++
++inline LwpAtomHolder* LwpBreaksOverride::GetNextStyle()
++{
++ return m_pNextStyle;
++}
++
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpbulletstylemgr.cxx lotuswordpro/source/filter/lwpbulletstylemgr.cxx
+--- lotuswordpro.bak/source/filter/lwpbulletstylemgr.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpbulletstylemgr.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,590 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++#include "lwpbulletstylemgr.hxx"
++#include "lwpdoc.hxx"
++#include "lwpstory.hxx"
++#include "lwpdivinfo.hxx"
++#include "lwppara.hxx"
++#include "lwpsilverbullet.hxx"
++#include "lwptools.hxx"
++#include "lwpparaproperty.hxx"
++#include "xfilter/xfliststyle.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xflist.hxx"
++#include "lwpglobalmgr.hxx"
++
++LwpBulletStyleMgr::LwpBulletStyleMgr() :
++m_pBulletList(NULL), m_bContinue(sal_True), m_bIsBulletSkipped(sal_False), m_nCurrentPos(0xFF)
++{
++}
++
++LwpBulletStyleMgr::~LwpBulletStyleMgr()
++{
++ if (m_pBulletList)
++ {
++ delete m_pBulletList;
++ }
++
++ m_vIDsPairList.clear();
++ m_vStyleNameList.clear();
++}
++
++/**
++ * @short Register bullet style to style-list. The function only register the bullet and single customized numbering
++ * not inluding the numbering sequence.
++ * @param pPara pointer to the current paragraph which has a bullet/numbering.
++ * @param pBullOver pointer to the bulletoverride of current paragraph.
++ * @param pIndent pointer to the indentoverride of current paragraph.
++ */
++rtl::OUString LwpBulletStyleMgr::RegisterBulletStyle(LwpPara* pPara, LwpBulletOverride* pBullOver,
++ LwpIndentOverride* pIndent)
++{
++ if(!pPara || !pIndent || !pBullOver)
++ {
++// assert(false);
++ return rtl::OUString::createFromAscii("");
++ }
++
++ LwpSilverBullet* pSilverBullet = pPara->GetSilverBullet();
++ if (!pSilverBullet)
++ {
++ assert(false);
++ return rtl::OUString::createFromAscii("");
++ }
++
++ LwpPara* pBulletPara = pSilverBullet->GetBulletPara();
++ if (!pBulletPara)
++ {
++ assert(false);
++ return rtl::OUString::createFromAscii("");
++ }
++
++ LwpParaProperty* pProp = pPara->GetProperty(PP_LOCAL_INDENT);
++ LwpParaIndentProperty* pIndentProp = NULL;
++ LwpObjectID aIndentID;
++ if (pProp)
++ {
++ pIndentProp = static_cast<LwpParaIndentProperty*>(pProp);
++ aIndentID = pIndentProp->GetIndentID();
++ }
++
++ LwpObjectID aBulletID = pBullOver->GetSilverBullet();
++ LwpBulletOverride aBulletOver = *pBullOver;
++
++ sal_uInt16 nNameIndex = 0;
++ std::vector <OverridePair>::iterator iter;
++ for(iter = m_vIDsPairList.begin(); iter != m_vIDsPairList.end(); iter++)
++ {
++ if (iter->first.GetSilverBullet() == aBulletID && iter->second == aIndentID
++ && iter->first.IsRightAligned() == pBullOver->IsRightAligned())
++ {
++ return m_vStyleNameList[nNameIndex];
++ }
++ else
++ {
++ nNameIndex++;
++ }
++ }
++
++ m_vIDsPairList.push_back(std::make_pair(aBulletOver, aIndentID));
++ rtl::OUString aStyleName;
++
++ LwpFribPtr* pBulletParaFribs = pBulletPara->GetFribs();
++ sal_Bool bIsNumbering = (sal_Bool)(pBulletParaFribs->HasFrib(FRIB_TAG_PARANUMBER) != 0);
++
++ enumXFAlignType eAlign = enumXFAlignStart;
++ if (pBullOver->IsRightAligned())
++ {
++ eAlign = enumXFAlignEnd;
++ }
++
++ XFListStyle* pListStyle = new XFListStyle();
++ XFStyleManager* pXFStyleMgr = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++
++ if (!bIsNumbering)
++ {
++ for (sal_uInt8 nC = 1; nC < 11; nC++)
++ {
++ pListStyle->SetListBullet(nC, pSilverBullet->GetBulletChar(), pSilverBullet->GetBulletFontName(),
++ pSilverBullet->GetPrefix(), pSilverBullet->GetSuffix());
++
++ if (pIndent->GetMRest() > 0.001)
++ {
++ pListStyle->SetListPosition(nC, 0.0,
++ LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(pIndent->GetMRest())), 0.0, eAlign);
++ }
++ else
++ {
++ pListStyle->SetListPosition(nC, 0.0,
++ 0.0, LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(pIndent->GetMFirst())), eAlign);
++ }
++ }
++
++ aStyleName = pXFStyleMgr->AddStyle(pListStyle)->GetStyleName();
++ }
++ else
++ {
++ rtl::OUString aPrefix = rtl::OUString::createFromAscii("");
++
++ LwpFrib* pFrib = pBulletParaFribs->HasFrib(FRIB_TAG_DOCVAR);
++ LwpFribDocVar* pDocVarFrib = NULL;
++ if (pFrib)
++ {
++ pDocVarFrib = static_cast<LwpFribDocVar*>(pFrib);
++// ModifierInfo* pInfo = pDocVarFrib->GetModifiers();
++ switch (pDocVarFrib->GetType())
++ {
++ case 0x000D: // division name
++ aPrefix = this->GetDivisionName();
++ break;
++ case 0x000E: // section name
++ aPrefix = this->GetSectionName(pPara);
++ break;
++ }
++ }
++ ParaNumbering aParaNumbering;
++ pBulletPara->GetParaNumber(1, &aParaNumbering);
++ LwpFribParaNumber* pParaNumber = aParaNumbering.pParaNumber;
++ if (pParaNumber)
++ {
++ for (sal_uInt8 nPos = 1; nPos < 10; nPos++)
++ {
++ aPrefix = rtl::OUString::createFromAscii("");
++ if (pParaNumber->GetStyleID() != NUMCHAR_other)
++ {
++ XFNumFmt aFmt;
++ if (aParaNumbering.pPrefix)
++ {
++ aPrefix += aParaNumbering.pPrefix->GetText();
++// aFmt.SetPrefix(aParaNumbering.pPrefix->GetText() + aAdditionalInfoName);
++ }
++
++ rtl::OUString aNumber = LwpSilverBullet::GetNumCharByStyleID(pParaNumber);
++ if (pParaNumber->GetStyleID() == NUMCHAR_01 || pParaNumber->GetStyleID() == NUMCHAR_Chinese4)
++ {
++ aPrefix += rtl::OUString::createFromAscii("0");
++ }
++ aFmt.SetPrefix(aPrefix);
++
++ aFmt.SetFormat(aNumber);
++
++ if (aParaNumbering.pSuffix)
++ {
++ aFmt.SetSuffix(aParaNumbering.pSuffix->GetText());
++ }
++
++ //set numbering format into the style-list.
++ pListStyle->SetListNumber(nPos, aFmt, pParaNumber->GetStart()+1);
++
++ }
++ else
++ {
++ rtl::OUString aPrefix, aSuffix;
++ if (aParaNumbering.pPrefix)
++ {
++ aPrefix = aParaNumbering.pPrefix->GetText();
++ }
++ if (aParaNumbering.pSuffix)
++ {
++ aSuffix = aParaNumbering.pSuffix->GetText();
++ }
++
++ pListStyle->SetListBullet(nPos, LwpSilverBullet::GetNumCharByStyleID(pParaNumber).toChar(),
++ rtl::OUString::createFromAscii("Times New Roman"), aPrefix, aSuffix);
++ }
++
++ pListStyle->SetListPosition(nPos, 0.0, 0.635, 0.0);
++ }
++ aStyleName = pXFStyleMgr->AddStyle(pListStyle)->GetStyleName();
++ }
++
++ }
++
++ m_vStyleNameList.push_back(aStyleName);
++ return aStyleName;
++
++}
++
++/**
++ * @short No use now.
++ * @param rContent
++ * @param nFontID
++ * @param pIndent
++ */
++/*rtl::OUString LwpBulletStyleMgr::RegisterBulletStyle(const rtl::OUString& rContent, sal_uInt32 nFontID, LwpIndentOverride* pIndent)
++{
++ if (!pIndent)
++ {
++ assert(false);
++ }
++
++ if (!m_pFoundry)
++ {
++ return rtl::OUString::createFromAscii("");
++ }
++ LwpFontManager* pFontMgr = m_pFoundry->GetFontManger();
++
++ rtl::OUString aFontName = pFontMgr->GetNameByID(nFontID);
++ UChar32 cBulletChar = rContent.toChar();
++ rtl::OUString aSuffix = rContent.copy(1);
++ XFListStyle* pListStyle = new XFListStyle();
++ XFStyleManager* pXFStyleMgr = XFStyleManager::Instance();
++
++ for (sal_uInt8 nC = 1; nC < 11; nC++)
++ {
++ pListStyle->SetListBullet(nC, cBulletChar, aFontName, rtl::OUString::createFromAscii(""), aSuffix);
++
++ if (pIndent->GetMRest() > 0.001)
++ {
++ pListStyle->SetListPosition(nC, 0.0,
++ LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(pIndent->GetMRest())), 0.0);
++ }
++ else
++ {
++ pListStyle->SetListPosition(nC, 0.0,
++ 0.0, LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(pIndent->GetMFirst())));
++ }
++ }
++ return pXFStyleMgr->AddStyle(pListStyle);
++}*/
++
++/**
++ * @short No use now.
++ * @param pListStyle
++ * @param pXFStyleMgr
++ */
++/*void LwpBulletStyleMgr::CreateNewListStyle(XFListStyle*& pListStyle, XFStyleManager* pXFStyleMgr)
++{
++ pListStyle = new XFListStyle();
++ m_aBulletStyleList.push_back(pListStyle);
++ m_aCurrentStyleName = pXFStyleMgr->AddStyle(pListStyle);
++}*/
++
++/**
++ * @short No use now.
++ * @param pSilverBullet
++ * @param nLevel
++ */
++/*rtl::OUString LwpBulletStyleMgr::AddStyleToList(LwpSilverBullet* pSilverBullet, sal_uInt16 nLevel)
++{
++ XFListStyle* pListStyle = NULL;
++ XFStyleManager* pXFStyleMgr = XFStyleManager::Instance();
++
++ if (m_aBulletStyleList.empty())
++ {
++ // pListStyle = new XFListStyle();
++ // m_aBulletStyleList.push_back(pListStyle);
++ // m_aCurrentStyleName = pXFStyleMgr->AddStyle(pListStyle);
++ // this->CreateNewListStyle(pListStyle, pXFStyleMgr);
++ if (pSilverBullet->IsBulletOrdered())
++ {
++ m_strCurrentNumberingName = pSilverBullet->GetNumberingName();
++ }
++ else
++ {
++ m_nCurrentChar = pSilverBullet->GetBulletChar();
++ m_strCurrentFontName = pSilverBullet->GetBulletFontName();
++ }
++ }
++ else if (nLevel == 1)
++ {
++ if (pSilverBullet->IsBulletOrdered())
++ {
++ if (m_strCurrentNumberingName == pSilverBullet->GetNumberingName())
++ {
++ pListStyle = m_aBulletStyleList.back();
++ }
++ else
++ {
++ this->CreateNewListStyle(pListStyle, pXFStyleMgr);
++ }
++ }
++ else
++ {
++ if ((m_nCurrentChar == pSilverBullet->GetBulletChar()) &&
++ (m_strCurrentFontName == pSilverBullet->GetBulletFontName()))
++ {
++ pListStyle = m_aBulletStyleList.back();
++ }
++ else
++ {
++ this->CreateNewListStyle(pListStyle, pXFStyleMgr);
++ }
++ }
++ }
++ else
++ {
++ pListStyle = m_aBulletStyleList.back();
++ }
++
++ if (pSilverBullet->IsBulletOrdered())
++ {
++// pListStyle->SetListNumber(int level, XFNumFmt & fmt, sal_Int16 start);
++ }
++ else
++ {
++ pListStyle->SetListBullet(nLevel, pSilverBullet->GetBulletChar(), pSilverBullet->GetBulletFontName(),
++ pSilverBullet->GetPrefix(), pSilverBullet->GetSuffix());
++ }
++
++ return m_aCurrentStyleName;
++}*/
++
++/**
++ * @short Output bullet list header, such as <text:ordered-list> and <text:list-item>
++ * @param pOutputStream pointer of XFstream to be written in.
++ * @param bIsOrdered if the list if ordered or not.
++ * @param rStyleName style name of the list
++ * @param nLevel level of the paragraph
++ */
++void LwpBulletStyleMgr::OutputBulletListHeader(IXFStream* pOutputStream, sal_Bool bIsOrdered,
++ const rtl::OUString& rStyleName, sal_Int16 nLevel, sal_Bool bIsBulletSkiped)
++{
++ if (nLevel == 0)
++ {
++ return;
++ }
++
++ m_bIsBulletSkipped = bIsBulletSkiped;
++
++ if (m_pBulletList)
++ {
++ delete m_pBulletList;
++ }
++
++ m_pBulletList = new XFList();
++
++ //todo: need judge here.
++ sal_Bool bContinue = m_bContinue;
++
++ if (bIsOrdered)
++ {
++ m_pBulletList->SetOrdered(sal_True);
++ }
++ else
++ {
++ bContinue = sal_False;
++ m_pBulletList->SetOrdered(sal_False);
++ }
++ m_pBulletList->SetStyleName(rStyleName);
++// if (nLevels < 0)
++// {
++// m_pBulletList->StartList(pOutputStream);
++// }
++// else
++// {
++ for (sal_uInt8 nC = 0; nC < nLevel; nC++)
++ {
++ //continue numbering
++ if (nC == nLevel-1)
++ {
++ m_pBulletList->StartList(pOutputStream, bContinue);
++ }
++ else
++ {
++ m_pBulletList->StartList(pOutputStream);
++ }
++ if ((nC == nLevel-1) && bIsBulletSkiped)
++ {
++ XFList::StartListHeader(pOutputStream);
++ }
++ else
++ {
++ XFList::StartListItem(pOutputStream);
++ }
++ }
++// }
++}
++
++#include "xfilter/xflistitem.hxx"
++//Create nested XFList and XFItems and then add it to XFContentContainer(pCont)
++//Return the inner XFItem created.
++XFContentContainer* LwpBulletStyleMgr::AddBulletList(
++ XFContentContainer* pCont, sal_Bool bIsOrdered,
++ const rtl::OUString& rStyleName, sal_Int16 nLevel, sal_Bool bIsBulletSkiped)
++{
++ assert(nLevel>0);
++
++ m_bIsBulletSkipped = bIsBulletSkiped;
++
++ //todo: need judge here.
++ sal_Bool bContinue = m_bContinue;
++
++ XFList* theList;
++ XFList* prevList = NULL;
++ XFListItem* theItem;
++ XFListItem* InnerItem = NULL;
++ for (sal_Int8 nC = nLevel-1; nC >= 0; nC--)
++ {
++ theList = new XFList();
++ theItem = new XFListItem();
++ theList->Add(theItem);
++
++ if (bIsOrdered)
++ {
++ theList->SetOrdered(sal_True);
++ }
++ else
++ {
++ bContinue = sal_False;
++ theList->SetOrdered(sal_False);
++ }
++
++ if (nC == nLevel-1)
++ {
++ theList->SetContinueNumber(bContinue);
++ }
++ //Add the outer list to pCont
++ if (nC == 0)
++ {
++ theList->SetStyleName(rStyleName);
++ pCont->Add(theList);
++ }
++
++ if ((nC == nLevel-1) && bIsBulletSkiped)
++ {
++ theItem->SetIsHeader(sal_True);
++
++ theList->SetContinueNumber(sal_True);
++ // end of add
++ }
++
++ if(nC == nLevel-1)
++ {
++ InnerItem = theItem;
++ }
++
++ if(prevList)
++ {
++ theItem->Add(prevList);
++ }
++ prevList = theList;
++ }
++ return InnerItem;
++}
++
++/**
++ * @short Output bullet list header, such as </text:ordered-list> and </text:list-item>
++ * @param pOutputStream pointer of XFstream to be written in.
++ * @param nLevel level of the paragraph
++ */
++void LwpBulletStyleMgr::OutputBulletListTail(IXFStream* pOutputStream, sal_uInt16 nLevel)
++{
++ if ( !m_pBulletList )
++ {
++ return;
++ }
++
++ for (sal_uInt8 nC = 0; nC < nLevel; nC++)
++ {
++ if (m_bIsBulletSkipped)
++ {
++ XFList::EndListHeader(pOutputStream);
++ m_bIsBulletSkipped = sal_False;
++ }
++ else
++ {
++ XFList::EndListItem(pOutputStream);
++ }
++ m_pBulletList->EndList(pOutputStream);
++ }
++}
++
++rtl::OUString LwpBulletStyleMgr::GetDivisionName()
++{
++ if (!m_pFoundry)
++ {
++ return rtl::OUString::createFromAscii("");
++ }
++
++ rtl::OUString aRet = rtl::OUString::createFromAscii("");
++
++ LwpDocument* pDoc = m_pFoundry->GetDocument();
++ if (pDoc)
++ {
++ LwpObjectID* pID = pDoc->GetDivInfoID();
++ if (!pID->IsNull())
++ {
++ aRet = static_cast<LwpDivInfo*>(pID->obj(VO_DIVISIONINFO))->GetDivName();
++ }
++ }
++
++ return aRet;
++}
++
++rtl::OUString LwpBulletStyleMgr::GetSectionName(LwpPara* pPara)
++{
++ LwpObjectID* pStoryID = pPara->GetStoryID();
++ if (pStoryID->IsNull())
++ {
++ return rtl::OUString::createFromAscii("");
++ }
++
++ LwpStory* pStory = static_cast<LwpStory*>(pStoryID->obj(VO_STORY));
++ if (!pStory)
++ {
++ return rtl::OUString::createFromAscii("");
++ }
++
++ return pStory->GetSectionName();
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpbulletstylemgr.hxx lotuswordpro/source/filter/lwpbulletstylemgr.hxx
+--- lotuswordpro.bak/source/filter/lwpbulletstylemgr.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpbulletstylemgr.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,168 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++#ifndef _LWPBULLETSTYLEMGR_HXX
++#define _LWPBULLETSTYLEMGR_HXX
++
++#include "lwpheader.hxx"
++#include "lwpfoundry.hxx"
++#include "lwpobjid.hxx"
++#include "lwpnumberingoverride.hxx"
++#include <utility>
++#include "xfilter/xfcontentcontainer.hxx"
++
++class XFListStyle;
++class XFList;
++class LwpPara;
++class LwpSilverBullet;
++class XFStyleManager;
++class LwpIndentOverride;
++class LwpBulletOverride;
++class LwpFribParaNumber;
++
++class LwpBulletStyleMgr
++{
++public:
++ LwpBulletStyleMgr();
++ virtual ~LwpBulletStyleMgr();
++ rtl::OUString RegisterBulletStyle(LwpPara* pPara, LwpBulletOverride* pBullOver,
++ LwpIndentOverride* pIndent);
++// rtl::OUString RegisterBulletStyle(const rtl::OUString& rContent, sal_uInt32 nFontID, LwpIndentOverride* pIndent);
++// rtl::OUString AddStyleToList(LwpSilverBullet* pSilverBullet, sal_uInt16 nLevel);
++ inline void SetFoundry(LwpFoundry* pFoundry);
++ inline void SetContinueFlag(sal_Bool bFlag);
++ void OutputBulletListHeader(IXFStream* pOutputStream, sal_Bool bIsOrdered,
++ const rtl::OUString& rStyleName, sal_Int16 nLevel, sal_Bool bIsBulletSkiped);
++ //Added by Helen
++ XFContentContainer* AddBulletList(XFContentContainer* pCont, sal_Bool bIsOrdered,
++ const rtl::OUString& rStyleName, sal_Int16 nLevel, sal_Bool bIsBulletSkiped);
++ //End of Add
++ void OutputBulletListTail(IXFStream* pOutputStream, sal_uInt16 nLevel);
++ inline void SetCurrentPos(sal_uInt16 nNewPos);
++ inline void SetCurrentSilverBullet(const LwpObjectID& rNewID);
++ inline LwpObjectID GetCurrentSilverBullet();
++ inline sal_uInt16 GetCurrentPos() const;
++ inline void SetCurrentNumOver(const LwpNumberingOverride& rOther);
++ inline LwpNumberingOverride* GetCurrentNumOver();
++
++private:
++// void CreateNewListStyle(XFListStyle*& pListStyle, XFStyleManager* pXFStyleMgr);
++ rtl::OUString GetDivisionName();
++ rtl::OUString GetSectionName(LwpPara* pPara);
++
++private:
++// std::vector <XFListStyle*> m_aBulletStyleList;
++ typedef std::pair<LwpBulletOverride, LwpObjectID> OverridePair;
++ std::vector <rtl::OUString> m_vStyleNameList;
++ std::vector <OverridePair> m_vIDsPairList;
++ rtl::OUString m_aCurrentStyleName;
++ LwpFoundry* m_pFoundry;
++ XFList* m_pBulletList;
++// UChar32 m_nCurrentChar;
++// rtl::OUString m_strCurrentFontName;
++// rtl::OUString m_strCurrentNumberingName;
++ sal_Bool m_bContinue;
++ sal_Bool m_bIsBulletSkipped;
++ LwpObjectID m_aCurrentNumberingID;
++ LwpNumberingOverride m_aCurrentNumOverride;
++ sal_uInt16 m_nCurrentPos;
++
++};
++
++inline void LwpBulletStyleMgr::SetFoundry(LwpFoundry* pFoundry)
++{
++ m_pFoundry = pFoundry;
++}
++inline void LwpBulletStyleMgr::SetContinueFlag(sal_Bool bFlag)
++{
++ m_bContinue = bFlag;
++}
++
++inline void LwpBulletStyleMgr::SetCurrentPos(sal_uInt16 nNewPos)
++{
++ m_nCurrentPos = nNewPos;
++}
++inline void LwpBulletStyleMgr::SetCurrentSilverBullet(const LwpObjectID& rNewID)
++{
++ m_aCurrentNumberingID = rNewID;
++}
++
++inline LwpObjectID LwpBulletStyleMgr::GetCurrentSilverBullet()
++{
++ return m_aCurrentNumberingID;
++}
++
++inline sal_uInt16 LwpBulletStyleMgr::GetCurrentPos() const
++{
++ return m_nCurrentPos;
++}
++
++inline void LwpBulletStyleMgr::SetCurrentNumOver(const LwpNumberingOverride& rOther)
++{
++ m_aCurrentNumOverride = rOther;
++}
++inline LwpNumberingOverride* LwpBulletStyleMgr::GetCurrentNumOver()
++{
++ return &m_aCurrentNumOverride;
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpcelllayout.cxx lotuswordpro/source/filter/lwpcelllayout.cxx
+--- lotuswordpro.bak/source/filter/lwpcelllayout.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpcelllayout.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,956 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - cell layouts
++ */
++/*************************************************************************
++ * Change History
++ April 2005 Created
++ ************************************************************************/
++#include "lwpcelllayout.hxx"
++#include "lwpfoundry.hxx"
++#include "lwpobjfactory.hxx"
++#include "lwptblcell.hxx"
++#include "lwptblformula.hxx"
++#include "lwpholder.hxx"
++#include "lwpnumericfmt.hxx"
++#include "lwptable.hxx"
++#include "lwpglobalmgr.hxx"
++
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xfcell.hxx"
++#include "xfilter/xfcellstyle.hxx"
++#include "xfilter/xfcolstyle.hxx"
++
++LwpCellLayout::LwpCellLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpMiddleLayout(objHdr, pStrm)
++{}
++
++LwpCellLayout::~LwpCellLayout()
++{}
++
++/**
++ * @short Get table layout pointer, if default cell layout, return NULL
++ * @param LwpTableLayout *
++ * @return
++ */
++LwpTableLayout * LwpCellLayout::GetTableLayout()
++{
++ LwpRowLayout * pRow = static_cast<LwpRowLayout *>(GetParent()->obj());
++ if(!pRow)
++ {
++ return NULL;
++ }
++ LwpTableLayout * pTableLayout = pRow->GetParentTableLayout();
++ return pTableLayout;
++}
++/**
++ * @short Get table pointer, if default cell layout, return NULL
++ * @param LwpTable *
++ * @return
++ */
++LwpTable * LwpCellLayout::GetTable()
++{
++ LwpTableLayout * pTableLayout = GetTableLayout();
++ if(!pTableLayout)
++ {
++ return NULL;
++ }
++ LwpTable *pTable = pTableLayout->GetTable();
++ return pTable;
++}
++/**
++ * @short Set current cell layout to cell layout map
++ * @param
++ * @return
++ */
++void LwpCellLayout::SetCellMap()
++{
++ // this function is called from LwpTableLayout, so it can't be NULL
++ GetTableLayout()->SetWordProCellMap(crowid, ccolid, this);
++}
++/**
++ * @short Get actual width of this cell layout
++ * @param
++ * @return width (cm)
++ */
++double LwpCellLayout::GetActualWidth()
++{
++ //Get table layout
++ LwpTableLayout * pTableLayout = GetTableLayout();
++
++ if (pTableLayout == NULL)
++ {
++ return GetGeometryWidth();
++ }
++
++ OUString strColStyle = pTableLayout->GetColumnWidth(ccolid);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ XFColStyle *pStyle = static_cast<XFColStyle *>(pXFStyleManager->FindStyle(strColStyle));
++ if(pStyle)
++ {
++ return pStyle->GetWidth();
++ }
++
++ return GetGeometryWidth();
++}
++
++/**
++ * @short Apply padding to cell style
++ * @param pCellStyle - pointer of XFCellStyle
++ * @return
++ */
++void LwpCellLayout::ApplyPadding(XFCellStyle *pCellStyle)
++{
++ double fLeft = GetMarginsValue(MARGIN_LEFT);
++ double fRight = GetMarginsValue(MARGIN_RIGHT);
++ double fTop = GetMarginsValue(MARGIN_TOP);
++ double fBottom = GetMarginsValue(MARGIN_BOTTOM);
++ pCellStyle->SetPadding((float)fLeft,(float)fRight,(float)fTop,(float)fBottom);
++}
++/**
++ * @short Apply border to cell style according to cell position, default cell layout won't use this function
++ * @param
++ * @return pCellStyle - pointer of XFCellStyle
++ */
++void LwpCellLayout::ApplyBorders(XFCellStyle *pCellStyle)
++{
++ // judge cell border type
++ LwpCellBorderType eType = GetCellBorderType(crowid, ccolid, GetTableLayout());
++
++ // get left cell and judge if neighbour border is different
++ XFBorders * pBorders = GetXFBorders();
++ if(!pBorders)
++ {
++ return;
++ }
++
++ switch (eType)
++ {
++ case enumNoBottomBorder:
++ pBorders->SetWidth(enumXFBorderBottom, 0);
++ break;
++ case enumNoLeftBorder:
++ pBorders->SetWidth(enumXFBorderLeft, 0);
++ break;
++ case enumNoLeftNoBottomBorder:
++ pBorders->SetWidth(enumXFBorderBottom, 0);
++ pBorders->SetWidth(enumXFBorderLeft, 0);
++ break;
++ case enumWholeBorder:
++ break;
++ default:
++ assert(sal_False);
++ }
++ pCellStyle->SetBorders(pBorders);
++}
++/**
++ * @short Apply watermark to cell style
++ * @param pCellStyle - pointer of XFCellStyle
++ * @return
++ */
++void LwpCellLayout::ApplyWatermark(XFCellStyle *pCellStyle)
++{
++ XFBGImage* pBGImage = GetXFBGImage();
++ if(pBGImage)
++ {
++ pCellStyle->SetBackImage(pBGImage);
++ }
++}
++
++/**
++ * @short Apply pattern fill to cell style
++ * @param pCellStyle - pointer of XFCellStyle
++ * @return
++ */
++void LwpCellLayout::ApplyPatternFill(XFCellStyle* pCellStyle)
++{
++ XFBGImage* pXFBGImage = this->GetFillPattern();
++ if (pXFBGImage)
++ {
++ pCellStyle->SetBackImage(pXFBGImage);
++ }
++}
++
++/**
++ * @short Apply background to cell style
++ * @param pCellStyle - pointer of XFCellStyle
++ * @return
++ */
++void LwpCellLayout::ApplyBackGround(XFCellStyle* pCellStyle)
++{
++ if (this->IsPatternFill())
++ {
++ ApplyPatternFill(pCellStyle);
++ }
++ else
++ {
++ ApplyBackColor(pCellStyle);
++ }
++}
++/**
++ * @short Apply back color to cell style
++ * @param pCellStyle - pointer of XFCellStyle
++ * @return
++ */
++void LwpCellLayout::ApplyBackColor(XFCellStyle *pCellStyle)
++{
++ LwpColor* pColor = GetBackColor();
++ if(pColor && pColor->IsValidColor())
++ {
++ XFColor aXFColor(pColor->To24Color());
++ pCellStyle->SetBackColor(aXFColor);
++ }
++}
++/**
++ * @short register style of cell layout
++ * @param pCellStyle The style of the cell, which would be applied to the cell.
++ * @return
++ */
++void LwpCellLayout::ApplyFmtStyle(XFCellStyle *pCellStyle)
++{
++ LwpLayoutNumerics* pLayoutNumerics =(LwpLayoutNumerics*)cLayNumerics.obj();
++ if (!pLayoutNumerics)
++ {
++ // if current layout doesn't have format, go to based on layout
++ LwpCellLayout* pCellLayout = (LwpCellLayout*)m_BasedOnStyle.obj();
++ if (pCellLayout)
++ {
++ pLayoutNumerics = (LwpLayoutNumerics*)pCellLayout->GetNumericsObject()->obj();
++ }
++ }
++
++ // apply format style
++ if (pLayoutNumerics)
++ {
++ XFStyle* pStyle = pLayoutNumerics->Convert();
++ if (pStyle)
++ {
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_NumfmtName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++ pCellStyle->SetDataStyle(m_NumfmtName);//modified by ,2005/11/30
++ }
++ }
++
++ return;
++}
++/**
++ * @short get style name according to cell position, only table default cells use this function
++ * @param nRow - default cell position row number
++ * @param nCol - default cell position col number
++ * @return OUString - registered cell style name
++ */
++OUString LwpCellLayout::GetCellStyleName(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout)
++{
++ // judge cell border type
++ LwpCellBorderType eType = GetCellBorderType(nRow, nCol, pTableLayout);
++ return m_CellStyleNames[eType];
++}
++/**
++* Make the XFCell
++* @date 03/26/2005
++* @param aTableID - ID of the table which this cell belongs to
++* @param bIsTopRow - whether current cell is top row
++* @param bIsRightCol - whether current cell is the rightest column
++* @return XFCell*
++*/
++XFCell* LwpCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol)
++{
++ // if cell layout is aTableID's default cell layout
++ // it can't have any content, bypass these code
++ LwpTable * pTable = static_cast<LwpTable *>(aTableID.obj());
++ if (!pTable)
++ {
++ assert(sal_False);
++ return NULL;
++ }
++ XFCell * pXFCell = new XFCell();
++ OUString aStyleName = m_StyleName;
++
++ // if cell layout is aTableID's default cell layout
++ // we should judt its style by current positon
++ if (*pTable->GetDefaultCellStyle() == *GetObjectID())
++ {
++ aStyleName = GetCellStyleName(nRow, nCol, pTable->GetTableLayout());
++ }
++
++ // content of cell
++ LwpStory* pStory =(LwpStory*) m_Content.obj();
++ if (pStory)
++ {
++ pStory->XFConvert(pXFCell);
++ }
++
++ ApplyProtect(pXFCell, aTableID);
++ pXFCell->SetStyleName(aStyleName);
++ return pXFCell;
++}
++
++LwpPara* LwpCellLayout::GetLastParaOfPreviousStory()
++{
++ LwpObjectID* pPreStoryID = this->GetPreviousCellStory();
++ if (pPreStoryID && !(pPreStoryID->IsNull()))
++ {
++ LwpStory* pPreStory = static_cast<LwpStory*>(pPreStoryID->obj(VO_STORY));
++ return static_cast<LwpPara*>(pPreStory->GetLastPara()->obj(VO_PARA));
++ }
++ else
++ {
++ return NULL;
++ }
++}
++
++/**
++ * @short Get previous cell which used for bullet inside cell
++ * @param
++ * @return LwpObjectID * - object ID of cell content story
++ */
++LwpObjectID * LwpCellLayout::GetPreviousCellStory()
++{
++ LwpTable *pTable = GetTable();
++ if (!pTable)
++ {
++ assert(sal_False);
++ return NULL;
++ }
++ sal_uInt16 nRow = crowid;
++ sal_uInt16 nCol = ccolid;
++
++ // if table is reset paragraph in columns, get cell on the top side of current cell
++ if (pTable->IsNumberDown())
++ {
++ if (nRow == 0)
++ {
++ return NULL;
++ }
++ nRow -=1;
++ }
++ else
++ {
++ // if not, get cell on the left side of current cell
++ if (nCol == 0)
++ {
++ if (nRow == 0)
++ {
++ return NULL;
++ }
++ else
++ {
++ nRow--;
++ nCol = pTable->GetColumn() - 1;
++ }
++ }
++ else
++ {
++ nCol -=1;
++ }
++ }
++
++ // get the object id pointer of previous cell story
++ LwpTableLayout * pTableLayout = GetTableLayout();
++ if (!pTableLayout)
++ {
++ assert(sal_False);
++ return NULL;
++ }
++ return pTableLayout->SearchCellStoryMap(nRow, nCol);
++}
++
++/**
++ * @short judge border type by cell neighbour
++ * @param nRow
++ * @param nCol
++ * @param pTableLayout
++ * @return LwpCellBorderType
++ */
++LwpCellBorderType LwpCellLayout::GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout)
++{
++ if (!pTableLayout)
++ {
++ assert(sal_False);
++ return enumWholeBorder;
++ }
++
++ // get left cell and judge if neighbour border is different
++ XFBorders * pBorders = GetXFBorders();
++ if(!pBorders)
++ {
++ return enumWholeBorder;
++ }
++ XFBorder *pLeftBorder = pBorders->GetLeft();
++ XFBorder *pBottomBorder = pBorders->GetBottom();
++ sal_Bool bNoLeftBorder = sal_False;
++ sal_Bool bNoBottomBorder = sal_False;
++
++ LwpCellLayout * pLeftNeighbour = GetCellByRowCol(nRow, GetLeftColID(nCol), pTableLayout);
++ if (pLeftNeighbour)
++ {
++ XFBorders * pNeighbourBorders = pLeftNeighbour->GetXFBorders();
++ if (pNeighbourBorders)
++ {
++ XFBorder * pRightBorder = pNeighbourBorders->GetRight();
++ if (*pLeftBorder == *pRightBorder)
++ {
++ // for these 2 types cell, left border should be ignored for sake of avoiding duplication border
++ // but if left border is different with right border of left cell
++ // we should not ignored it
++ bNoLeftBorder = sal_True;
++ }
++ delete pNeighbourBorders;
++ }
++
++ }
++
++ LwpCellLayout * pBelowNeighbour = GetCellByRowCol(GetBelowRowID(nRow), nCol, pTableLayout);
++ if (pBelowNeighbour) //&& (eType == enumRightNotLastCellBorder || eType == enumLeftNotLastCellBorder) )
++ {
++ XFBorders * pBelowBorders = pBelowNeighbour->GetXFBorders();
++ if (pBelowBorders)
++ {
++ XFBorder * pTopBorder = pBelowBorders->GetTop();
++ if (*pTopBorder == *pBottomBorder)
++ {
++ // for these 2 types cell, bottom border should be ignored for sake of avoiding duplication border
++ // but if bottom border is different with right border of left cell
++ // we should not ignored it
++ bNoBottomBorder = sal_True;
++ }
++ delete pBelowBorders;
++ }
++ }
++
++ delete pBorders;
++
++ if (bNoBottomBorder)
++ {
++ if (bNoLeftBorder)
++ {
++ return enumNoLeftNoBottomBorder;
++ }
++ return enumNoBottomBorder;
++ }
++ if (bNoLeftBorder)
++ {
++ return enumNoLeftBorder;
++ }
++ return enumWholeBorder;
++}
++
++/**
++ * @short Get neighbour cell by specifying ROW+COL
++ * @param nRow
++ * @param nCol
++ * @return LwpCellLayout *
++ */
++LwpCellLayout * LwpCellLayout::GetCellByRowCol(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout)
++{
++ return pTableLayout->GetCellByRowCol(nRow, nCol);
++}
++/**
++ * @short Register table's default cell layout
++ * @param
++ * @return
++ */
++void LwpCellLayout::RegisterDefaultCell()
++{
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ for (sal_uInt16 eLoop = enumWholeBorder; eLoop < enumCellBorderTopLimit; eLoop++)
++ {
++ // register cell style
++ XFCellStyle *pCellStyle = new XFCellStyle();
++
++ ApplyPadding(pCellStyle);
++ ApplyBackColor(pCellStyle);
++ ApplyWatermark(pCellStyle);
++ ApplyFmtStyle(pCellStyle);
++ pCellStyle->SetAlignType(enumXFAlignNone, GetVerticalAlignmentType());
++
++ XFBorders * pBorders = GetXFBorders();
++ if (pBorders)
++ {
++ switch(eLoop)
++ {
++ case enumNoBottomBorder:
++ // _
++ //| |
++ //
++ // remove bottom line
++ pBorders->SetWidth(enumXFBorderBottom, 0);
++ break;
++ case enumNoLeftNoBottomBorder:
++ // _
++ // |
++ //
++ // remove left and bottom
++ pBorders->SetWidth(enumXFBorderLeft, 0);
++ pBorders->SetWidth(enumXFBorderBottom, 0);
++ break;
++ case enumWholeBorder:
++ //--
++ //||
++ //--
++ // nothing to remove
++ break;
++ case enumNoLeftBorder:
++ //
++ //| |
++ //--
++ // remove left line
++ pBorders->SetWidth(enumXFBorderLeft, 0);
++ break;
++ default:
++ assert(sal_False);
++ }
++ pCellStyle->SetBorders(pBorders);
++ }
++ m_CellStyleNames[eLoop] = pXFStyleManager->AddStyle(pCellStyle)->GetStyleName();
++ }
++}
++/**
++ * @short Register 4 types of cell style and register content styles
++ * @param
++ * @param
++ * @param
++ * @return
++ */
++void LwpCellLayout::RegisterStyle()
++{
++ LwpVirtualLayout * pParent = static_cast<LwpVirtualLayout *>(GetParent()->obj());
++ if (!pParent || pParent->GetLayoutType() != LWP_ROW_LAYOUT)
++ {
++ // default cell layout, we must register 4 styles for it
++ RegisterDefaultCell();
++ return;
++ }
++
++ // register cell style
++ XFCellStyle *pCellStyle = new XFCellStyle();
++
++ ApplyPadding(pCellStyle);
++// ApplyBackColor(pCellStyle);
++ ApplyBackGround(pCellStyle);
++ ApplyWatermark(pCellStyle);
++ ApplyFmtStyle(pCellStyle);
++ ApplyBorders(pCellStyle);
++
++ pCellStyle->SetAlignType(enumXFAlignNone, GetVerticalAlignmentType());
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_StyleName = pXFStyleManager->AddStyle(pCellStyle)->GetStyleName();
++
++ // content object register styles
++ LwpObject * pObj = m_Content.obj();
++ if (pObj)
++ {
++ pObj->SetFoundry(m_pFoundry);
++ pObj->RegisterStyle();
++ }
++
++ //register child layout style
++ RegisterChildStyle();
++ /*
++ LwpVirtualLayout* pLayout = static_cast<LwpVirtualLayout*>(GetChildHead()->obj());
++ while(pLayout)
++ {
++ pLayout->SetFoundry(m_pFoundry);
++ pLayout->RegisterStyle();
++ pLayout = static_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj());
++ }
++ */
++}
++/**
++ * @short Read cell layout
++ * @param
++ * @return
++ */
++void LwpCellLayout::Read()
++{
++ LwpObjectStream* pStrm = m_pObjStrm;
++
++ LwpMiddleLayout::Read();
++
++ // before the layout hierarchy rework
++ if (LwpFileHeader::m_nFileRevision < 0x000b)
++ {
++ assert(sal_False);
++ }
++ else
++ {
++ crowid = pStrm->QuickReaduInt16();
++ ccolid = (sal_uInt8) pStrm->QuickReaduInt16(); // written as a lushort
++
++ sal_uInt16 type;
++
++ type = pStrm->QuickReaduInt16();
++ pStrm->SkipExtra();
++ cType = (LeaderDotType)type;
++
++ cLayNumerics.ReadIndexed(pStrm);
++ cLayDiagonalLine.ReadIndexed(pStrm);
++
++ pStrm->SkipExtra();
++ }
++}
++/**
++ * @short Get leader char
++ * @param none
++ * @return char ascii, if none, return 0
++ */
++sal_uInt8 LwpCellLayout::GetLeaderChar()
++{
++ switch(cType)
++ {
++ case LDT_NONE:
++ return 0;
++ case LDT_DOTS:
++ return '.';
++ case LDT_DASHES:
++ return '-';
++ case LDT_UNDERSCORES:
++ return '_';
++ default:
++ assert(sal_False);
++ }
++ return 0;
++}
++/**
++* Apply protect attribute to cell of table
++* @date 04/04/2005
++* @param aTableID - ID of the table which the cell belongs to
++* @param
++* @return XFCell*
++*/
++void LwpCellLayout::ApplyProtect(XFCell * pCell, LwpObjectID aTableID)
++{
++ sal_Bool bProtected = sal_False;
++ // judge current cell
++ if (IsProtected())
++ {
++ bProtected = sal_True;
++ }
++ else
++ {
++ // judge base on
++ LwpCellLayout * pBase = static_cast<LwpCellLayout *>(m_BasedOnStyle.obj());
++ if (pBase && pBase->IsProtected())
++ {
++ bProtected = sal_True;
++ }
++ else
++ {
++ // judge whole table
++ LwpTable * pTable = static_cast<LwpTable *>(aTableID.obj());
++ LwpTableLayout * pTableLayout = static_cast<LwpTableLayout *>(pTable->GetTableLayout());
++ LwpSuperTableLayout * pSuper = pTableLayout->GetSuperTableLayout();
++ if (pSuper && pSuper->IsProtected())
++ {
++ bProtected = sal_True;
++ }
++ }
++ }
++
++ pCell->SetProtect(bProtected);
++}
++
++
++LwpConnectedCellLayout::LwpConnectedCellLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpCellLayout(objHdr, pStrm)
++{}
++
++LwpConnectedCellLayout::~LwpConnectedCellLayout()
++{}
++/**
++ * @short Set current connected cell layout to cell layout map
++ * @param pCellLayoutMap - cell layout map reference
++ * @return
++ */
++void LwpConnectedCellLayout::SetCellMap()
++{
++ // this function is called from LwpTableLayout, so it can't be NULL
++ LwpTableLayout * pTableLayout = GetTableLayout();
++ sal_uInt16 nRowSpan = m_nRealrowspan;
++
++ for (sal_uInt16 iLoop = 0; iLoop < nRowSpan; iLoop ++)
++ {
++ for (sal_uInt16 jLoop = 0; jLoop < cnumcols; jLoop ++)
++ pTableLayout->SetWordProCellMap(iLoop + crowid, jLoop + ccolid, this);
++ }
++}
++
++/**
++ * @short judge border type by cell neighbour
++ * @param nRow
++ * @param nCol
++ * @param pTableLayout
++ * @return LwpCellBorderType
++ */
++LwpCellBorderType LwpConnectedCellLayout::GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout)
++{
++ if (!pTableLayout)
++ {
++ assert(sal_False);
++ return enumWholeBorder;
++ }
++
++ sal_uInt16 nRowSpan = m_nRealrowspan;
++
++ // get left cell and judge if neighbour border is different
++ XFBorders * pBorders = GetXFBorders();
++ if(!pBorders)
++ {
++ return enumWholeBorder;
++ }
++ XFBorder *pLeftBorder = pBorders->GetLeft();
++ XFBorder *pBottomBorder = pBorders->GetBottom();
++ sal_Bool bNoLeftBorder = sal_True;
++ sal_Bool bNoBottomBorder = sal_True;
++
++ if (nCol == 0)
++ {
++ bNoLeftBorder = sal_False;
++ }
++ else
++ {
++ for (sal_uInt16 iLoop=0; iLoop < nRowSpan; iLoop++)
++ {
++ LwpCellLayout * pLeftNeighbour = GetCellByRowCol(nRow+iLoop, GetLeftColID(nCol), pTableLayout);
++ if (pLeftNeighbour)
++ {
++ XFBorders * pNeighbourBorders = pLeftNeighbour->GetXFBorders();
++ if (pNeighbourBorders)
++ {
++ XFBorder * pRightBorder = pNeighbourBorders->GetRight();
++ if (*pLeftBorder != *pRightBorder)
++ {
++ // if left border is different with right border of left cell
++ // we should not ignored it
++ bNoLeftBorder = sal_False;
++ break;
++ }
++ delete pNeighbourBorders;
++ }
++ }
++ }
++ }
++
++ if ( (nRow + nRowSpan) == pTableLayout->GetTable()->GetRow() )
++ {
++ bNoBottomBorder = sal_False;
++ }
++ else
++ {
++ for (sal_uInt16 iLoop = 0; iLoop < cnumcols; iLoop ++)
++ {
++ LwpCellLayout * pBelowNeighbour = GetCellByRowCol(nRow + nRowSpan, nCol+iLoop, pTableLayout);
++ if (pBelowNeighbour)
++ {
++ XFBorders * pBelowBorders = pBelowNeighbour->GetXFBorders();
++ if (pBelowBorders)
++ {
++ XFBorder * pTopBorder = pBelowBorders->GetTop();
++ if (*pTopBorder != *pBottomBorder)
++ {
++ // if bottom border is different with right border of left cell
++ // we should not ignored it
++ bNoBottomBorder = sal_False;
++ break;
++ }
++ delete pBelowBorders;
++ }
++ }
++ }
++ }
++ delete pBorders;
++
++ if (bNoBottomBorder)
++ {
++ if (bNoLeftBorder)
++ {
++ return enumNoLeftNoBottomBorder;
++ }
++ return enumNoBottomBorder;
++ }
++ if (bNoLeftBorder)
++ {
++ return enumNoLeftBorder;
++ }
++ return enumWholeBorder;
++}
++/**
++ * @short Read connected cell layout
++ * @param
++ * @return
++ */
++void LwpConnectedCellLayout::Read()
++{
++ LwpCellLayout::Read();
++ sal_uInt16 numcols;
++
++ cnumrows = m_pObjStrm->QuickReaduInt16();
++ numcols = m_pObjStrm->QuickReaduInt16(); // written as a lushort
++ cnumcols = (sal_uInt8)numcols;
++
++ m_nRealrowspan = cnumrows;
++ m_nRealcolspan = cnumcols;
++
++ m_pObjStrm->SkipExtra();
++}
++XFCell* LwpConnectedCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol)
++{
++ XFCell * pXFCell = LwpCellLayout::ConvertCell(aTableID, nRow, nCol);
++ pXFCell->SetColumnSpaned(cnumcols);
++// if(!m_bSplitFlag)
++// {
++// }
++ return pXFCell;
++}
++/**
++ * @short parse connected cell layout
++ * @param pOutputStream - output stream
++ * @return
++ */
++ void LwpConnectedCellLayout::Parse(IXFStream* pOutputStream)
++{
++}
++
++LwpHiddenCellLayout::LwpHiddenCellLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpCellLayout(objHdr, pStrm)
++{}
++
++LwpHiddenCellLayout::~LwpHiddenCellLayout()
++{}
++/**
++ * @short Set current hidden cell layout to cell layout map
++ * @param
++ * @return
++ */
++void LwpHiddenCellLayout::SetCellMap()
++{
++ return;
++}
++/**
++ * @short Read hidden cell layout
++ * @param
++ * @return
++ */
++void LwpHiddenCellLayout::Read()
++{
++ LwpCellLayout::Read();
++
++ cconnectedlayout.ReadIndexed(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++
++}
++/**
++ * @short Convert hidden cell layout
++ * @param aTableID - Object ID of table
++ * @return XFCell * - pointer to converted cell
++ */
++
++XFCell* LwpHiddenCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol)
++{
++ if (!cconnectedlayout.obj())
++ return NULL;
++ LwpConnectedCellLayout* pConnCell = static_cast<LwpConnectedCellLayout* >(cconnectedlayout.obj());
++
++ if (nRow < (pConnCell->GetNumrows()+pConnCell->GetRowID()))
++ return NULL;
++ // if the hidden cell should be displayed for limit of SODC
++ // use the default cell layout
++ XFCell* pXFCell = NULL;
++ LwpTable *pTable = static_cast<LwpTable *>(aTableID.obj());
++ if (pTable)
++ {
++ LwpCellLayout *pDefault = static_cast<LwpCellLayout *>(pTable->GetDefaultCellStyle()->obj());
++ if (pDefault)
++ {
++ pXFCell = pDefault->ConvertCell(aTableID, nRow, nCol);
++ }
++ else
++ {
++ pXFCell = pConnCell->ConvertCell(aTableID, nRow, nCol);
++ }
++ pXFCell->SetColumnSpaned(pConnCell->GetNumcols());
++ }
++ else
++ {
++ assert(sal_False);
++ }
++ return pXFCell;
++}
++/**
++ * @short parse hidden cell layout
++ * @param pOutputStream - output stream
++ * @return
++ */
++ void LwpHiddenCellLayout::Parse(IXFStream* pOutputStream)
++{
++}
++
++
++LwpParallelColumnsBlock::LwpParallelColumnsBlock(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpCellLayout(objHdr, pStrm)
++{}
++
++LwpParallelColumnsBlock::~LwpParallelColumnsBlock()
++{}
++
++void LwpParallelColumnsBlock::Read()
++{
++ LwpCellLayout::Read();
++ m_pObjStrm->SkipExtra();
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpcelllayout.hxx lotuswordpro/source/filter/lwpcelllayout.hxx
+--- lotuswordpro.bak/source/filter/lwpcelllayout.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpcelllayout.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,209 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - cell layouts
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++#ifndef _LWPCELLLAYOUT_HXX
++#define _LWPCELLLAYOUT_HXX
++#include <vector>
++#include <map>
++#include "lwplayout.hxx"
++#include "lwptablelayout.hxx"
++
++typedef enum
++{
++ enumWholeBorder = 0,
++ enumNoLeftBorder,
++ enumNoBottomBorder,
++ enumNoLeftNoBottomBorder,
++ enumCellBorderTopLimit = 4,
++} LwpCellBorderType;
++
++
++class XFCell;
++class XFCellStyle;
++class LwpCellList;
++class LwpTable;
++class LwpTableLayout;
++/**
++ * @brief
++ * VO_CELLLAYOUT object
++ */
++class LwpCellLayout : public LwpMiddleLayout
++{
++public:
++ LwpCellLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpCellLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_CELL_LAYOUT;}
++ virtual XFCell* ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol);
++ sal_uInt16 GetRowID(){return crowid;};
++ sal_uInt8 GetColID(){return ccolid;};
++ void RegisterStyle();
++ LwpObjectID * GetNumericsObject() {return &cLayNumerics;};
++ LwpObjectID * GetPreviousCellStory();
++ virtual LwpPara* GetLastParaOfPreviousStory();
++ LwpTableLayout * GetTableLayout();
++ virtual void SetCellMap(void);
++ double GetActualWidth();
++ sal_uInt8 GetLeaderChar();
++ OUString GetNumfmtName(){return m_NumfmtName;}
++protected:
++ void Read();
++// LwpTableLayout * GetTableLayout();
++ LwpTable * GetTable();
++ void ApplyPadding(XFCellStyle* pCellStyle);
++ void ApplyBorders(XFCellStyle* pCellStyle);
++ // add by , 06/03/2005
++ void ApplyPatternFill(XFCellStyle* pCellStyle);
++ void ApplyBackGround(XFCellStyle* pCellStyle);
++ // end add
++ void ApplyBackColor(XFCellStyle* pCellStyle);
++ void ApplyWatermark(XFCellStyle* pCellStyle);
++ void ApplyProtect(XFCell * pCell, LwpObjectID aTableID);
++ void ApplyFmtStyle(XFCellStyle *pCellStyle);
++ OUString GetCellStyleName(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout);
++ void RegisterDefaultCell();
++ virtual LwpCellBorderType GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout);
++ LwpCellLayout * GetCellByRowCol(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout);
++ virtual sal_uInt16 GetLeftColID(sal_uInt16 nCol){return nCol - 1; };
++ virtual sal_uInt16 GetBelowRowID(sal_uInt16 nRow){return nRow + 1; };
++
++ sal_uInt16 crowid;
++ sal_uInt8 ccolid;
++ LwpObjectID cLayNumerics;
++ LwpObjectID cLayDiagonalLine;
++
++ enum LeaderDotType
++ {
++ LDT_NONE = 0,
++ LDT_DOTS = 1,
++ LDT_DASHES = 2,
++ LDT_UNDERSCORES = 3
++ };
++ LeaderDotType cType;
++ OUString m_CellStyleNames[enumCellBorderTopLimit];
++
++ OUString m_NumfmtName;//Add by , to support number color,2005/11/30
++private:
++ LwpCellList* GetCellList(LwpFoundry* pFoundry, LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt8 nCol);
++};
++
++/**
++ * @brief
++ * VO_HIDDENCELLLAYOUT object
++ */
++class LwpHiddenCellLayout : public LwpCellLayout
++{
++public:
++ LwpHiddenCellLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpHiddenCellLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_HIDDEN_CELL_LAYOUT;}
++ virtual void Parse(IXFStream* pOutputStream);
++ virtual XFCell* ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol);
++ void RegisterStyle(){};
++ virtual void SetCellMap(void);
++protected:
++ void Read();
++ LwpObjectID cconnectedlayout;
++};
++
++/**
++ * @brief
++ * VO_CONNECTEDCELLLAYOUT object
++ */
++class LwpConnectedCellLayout : public LwpCellLayout
++{
++public:
++ LwpConnectedCellLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpConnectedCellLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_CONNECTED_CELL_LAYOUT;}
++ virtual void Parse(IXFStream* pOutputStream);
++ virtual XFCell* ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol);
++ sal_uInt16 GetNumrows(){return m_nRealrowspan;}
++ sal_uInt8 GetNumcols(){return m_nRealcolspan;}
++ virtual void SetCellMap(void);
++ void SetNumrows(sal_uInt16 nVal){m_nRealrowspan = nVal;}
++ void SetNumcols(sal_uInt8 nVal){m_nRealcolspan = nVal;}
++protected:
++ void Read();
++ virtual sal_uInt16 GetBelowRowID(sal_uInt16 nRow){return nRow + m_nRealrowspan; };
++ virtual LwpCellBorderType GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout);
++ sal_uInt16 cnumrows;
++ sal_uInt8 cnumcols;
++// sal_Bool m_bSplitFlag;
++ sal_uInt16 m_nRealrowspan;
++ sal_uInt8 m_nRealcolspan;
++};
++/**
++ * @brief
++ * VO_PCOLBLOCK object
++ */
++
++class LwpParallelColumnsBlock : public LwpCellLayout
++{
++public:
++ LwpParallelColumnsBlock(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpParallelColumnsBlock();
++protected:
++ void Read();
++
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpchangemgr.cxx lotuswordpro/source/filter/lwpchangemgr.cxx
+--- lotuswordpro.bak/source/filter/lwpchangemgr.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpchangemgr.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,384 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jun 2005 Created
++ ************************************************************************/
++#include "lwpchangemgr.hxx"
++#include <rtl/ustring.hxx>
++#include "lwppara.hxx"
++#include "lwpfribheader.hxx"
++#include "lwpfribptr.hxx"
++#include "lwpfrib.hxx"
++#include "lwpstory.hxx"
++#include "lwpfribsection.hxx"
++#include "lwpsection.hxx"
++#include "lwpfribbreaks.hxx"
++#include "lwpfribframe.hxx"
++#include "lwpfribtable.hxx"
++#include "lwphyperlinkmgr.hxx"
++#include "lwpfootnote.hxx"
++#include "lwpnotes.hxx"
++#include "lwpfribmark.hxx"
++#include "xfilter/xftextspan.hxx"
++#include "xfilter/xftextcontent.hxx"
++#include "xfilter/xftabstop.hxx"
++#include "xfilter/xflinebreak.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xfhyperlink.hxx"
++
++LwpChangeMgr::LwpChangeMgr()
++{
++ m_nCounter = 0;
++ m_DocFribMap.clear();
++ m_HeadFootFribMap.clear();
++ m_pFribMap = &m_DocFribMap;
++ m_ChangeList.clear();
++}
++LwpChangeMgr::~LwpChangeMgr()
++{
++ m_pFribMap=NULL;
++ m_DocFribMap.clear();
++ m_HeadFootFribMap.clear();
++ m_ChangeList.clear();
++}
++
++void LwpChangeMgr::AddChangeFrib(LwpFrib* pFrib)
++{
++ m_nCounter++;
++ OUString sID = A2OUSTR("ct")+ Int32ToOUString(m_nCounter);
++ m_pFribMap->insert(std::pair<LwpFrib*,OUString>(pFrib,sID));
++}
++
++OUString LwpChangeMgr::GetChangeID(LwpFrib* pFrib)
++{
++ std::map<LwpFrib*,OUString>::iterator iter;
++ iter = m_pFribMap->find(pFrib);
++ if (iter == m_pFribMap->end())
++ return A2OUSTR("");
++ else
++ return iter->second;
++}
++
++void LwpChangeMgr::ConvertAllChange(IXFStream* pStream)
++{
++ std::map<LwpFrib*,OUString>::iterator iter;
++ for (iter=m_DocFribMap.begin();iter !=m_DocFribMap.end();iter++)
++ {
++ if (iter->first->GetRevisionType() == LwpFrib::REV_INSERT)
++ {
++ XFChangeInsert* pInsert = new XFChangeInsert;
++ pInsert->SetChangeID(iter->second);
++ pInsert->SetEditor(iter->first->GetEditor());
++ m_ChangeList.push_back(pInsert);
++ }
++ else if (iter->first->GetRevisionType() == LwpFrib::REV_DELETE)
++ {
++ XFChangeDelete* pDelete = new XFChangeDelete;
++ pDelete->SetChangeID(iter->second);
++ pDelete->SetEditor(iter->first->GetEditor());
++/// ConvertFribContent(pDelete,iter->first); //delete tmp,note by ,2005/7/1
++ m_ChangeList.push_back(pDelete);
++ }
++ }
++
++ std::vector<XFChangeRegion*>::iterator iter1;
++ pStream->GetAttrList()->Clear();
++ if (m_ChangeList.size() == 0)
++ return;
++//Add by ,for disable change tracking,2005/11/21
++ pStream->GetAttrList()->AddAttribute( A2OUSTR("text:track-changes"),A2OUSTR("false"));
++//Add end
++ pStream->StartElement( A2OUSTR("text:tracked-changes") );
++ for (iter1=m_ChangeList.begin();iter1 !=m_ChangeList.end();iter1++)
++ (*iter1)->ToXml(pStream);
++
++ pStream->EndElement(A2OUSTR("text:tracked-changes"));
++
++// m_DocFribMap.clear();
++
++ for (iter1=m_ChangeList.begin();iter1 !=m_ChangeList.end();iter1++)
++ {
++ delete *iter1;
++ *iter1=NULL;
++ }
++ m_ChangeList.clear();
++}
++void LwpChangeMgr::SetHeadFootFribMap(sal_Bool bFlag)
++{
++ if (bFlag == sal_True)
++ m_pFribMap = &m_HeadFootFribMap;
++ else
++ {
++ m_HeadFootFribMap.clear();
++ m_pFribMap = &m_DocFribMap;
++ }
++}
++
++void LwpChangeMgr::SetHeadFootChange(XFContentContainer* pCont)
++{
++ std::map<LwpFrib*,OUString>::iterator iter;
++ XFChangeList* pChangeList = new XFChangeList;
++
++ for (iter=m_HeadFootFribMap.begin();iter !=m_HeadFootFribMap.end();iter++)
++ {
++ if (iter->first->GetRevisionType() == LwpFrib::REV_INSERT)
++ {
++ XFChangeInsert* pInsert = new XFChangeInsert;
++ pInsert->SetChangeID(iter->second);
++ pInsert->SetEditor(iter->first->GetEditor());
++ pChangeList->Add(pInsert);
++ }
++ else if (iter->first->GetRevisionType() == LwpFrib::REV_DELETE)
++ {
++ XFChangeDelete* pDelete = new XFChangeDelete;
++ pDelete->SetChangeID(iter->second);
++ pDelete->SetEditor(iter->first->GetEditor());
++ pChangeList->Add(pDelete);
++ }
++ }
++
++ pCont->Add(pChangeList);
++
++// m_HeadFootFribMap.clear();
++}
++
++void LwpChangeMgr::ConvertFribContent(XFContentContainer* pCont, LwpFrib* pFrib)
++{
++ XFParagraph* pXFPara = new XFParagraph;
++ LwpPara* pPara = pFrib->GetMyPara();
++ if (pPara)
++ pXFPara->SetStyleName(pPara->GetStyleName());
++
++ switch(pFrib->GetType())//copy code from class lwpfribptr
++ {
++ case FRIB_TAG_TEXT:
++ {
++ LwpFribText* textFrib= static_cast<LwpFribText*>(pFrib);
++ textFrib->XFConvert(pXFPara,pPara->GetStory());
++ }
++ break;
++ case FRIB_TAG_TAB:
++ {
++ LwpFribTab* tabFrib = static_cast<LwpFribTab*>(pFrib);
++ if (pFrib->m_ModFlag)
++ {
++ XFTextSpan *pSpan = new XFTextSpan();
++ pSpan->SetStyleName(tabFrib->GetStyleName());
++ XFTabStop *pTab = new XFTabStop();
++ pSpan->Add(pTab);
++ pXFPara->Add(pSpan);
++ }
++ else
++ {
++ XFTabStop *pTab = new XFTabStop();
++ pXFPara->Add(pTab);
++ }
++ }
++ break;
++/* case FRIB_TAG_SECTION:
++ {
++ delete pXFPara;
++ LwpFribSection* pSectionFrib = static_cast<LwpFribSection*>(pFrib);
++ pSectionFrib->ParseSection();
++ }
++ break;
++ case FRIB_TAG_PAGEBREAK:
++ {
++ LwpFribPageBreak* pPageBreak = static_cast<LwpFribPageBreak*>(pFrib);
++ LwpPageLayout* pLayout = static_cast<LwpPageLayout*>(pPageBreak->GetLayout()->obj());
++ if(pLayout)
++ {
++ pPageBreak->ParseLayout();
++ }
++ else
++ {
++ if (pPageBreak->IsLastFrib() == sal_True)
++ {
++ pXFPara->SetStyleName( pPageBreak->GetStyleName() );
++ }
++ else
++ {
++ //parse pagebreak
++ XFParagraph *pNewPara = new XFParagraph();
++ pNewPara->SetStyleName(pFrib->GetStyleName());
++ pPara->AddXFContent(pNewPara);
++ }
++ }
++ }
++ break;
++ case FRIB_TAG_COLBREAK:
++ {
++ XFParagraph *pNewPara = new XFParagraph();
++ pNewPara->SetStyleName(pFrib->GetStyleName());
++ pPara->AddXFContent(pNewPara);
++ }
++ break;
++*/ case FRIB_TAG_LINEBREAK:
++ {
++ XFLineBreak *pLineBreak = new XFLineBreak();
++ pXFPara->Add(pLineBreak);
++ }
++ break;
++ case FRIB_TAG_UNICODE: //fall through
++ case FRIB_TAG_UNICODE2: //fall through
++ case FRIB_TAG_UNICODE3: //fall through
++ {
++ LwpFribUnicode* unicodeFrib= static_cast<LwpFribUnicode*>(pFrib);
++ unicodeFrib->XFConvert(pXFPara,pPara->GetStory());
++ }
++ break;
++ case FRIB_TAG_HARDSPACE:
++ {
++ rtl::OUString sHardSpace(sal_Unicode(0x00a0));
++ LwpHyperlinkMgr* pHyperlink =
++ pPara->GetStory()->GetHyperlinkMgr();
++ if (pHyperlink->GetHyperlinkFlag())
++ pFrib->ConvertHyperLink(pXFPara,pHyperlink,sHardSpace);
++ else
++ pFrib->ConvertChars(pXFPara,sHardSpace);
++ }
++ break;
++ case FRIB_TAG_SOFTHYPHEN:
++ {
++ rtl::OUString sSoftHyphen(sal_Unicode(0x00ad));
++ pFrib->ConvertChars(pXFPara,sSoftHyphen);
++ }
++ break;
++/* case FRIB_TAG_FRAME:
++ {
++ LwpFribFrame* frameFrib= static_cast<LwpFribFrame*>(pFrib);
++ LwpObject* pLayout = frameFrib->GetLayout();
++ if (pLayout->GetTag() == VO_DROPCAPLAYOUT)
++ {
++ pPara->GetFoundry()->GetDropcapMgr()->SetXFPara(pXFPara);
++ //LwpObject* pDropCap = frameFrib->GetLayout();
++ //pDropCap ->XFConvert(m_pXFPara);
++ }
++ //pLayout->XFConvert(m_pXFPara);
++ frameFrib->XFConvert(pXFPara);
++ }
++ break;
++*/ case FRIB_TAG_CHBLOCK:
++ {
++ LwpFribCHBlock* chbFrib = static_cast<LwpFribCHBlock*>(pFrib);
++ chbFrib->XFConvert(pXFPara,pPara->GetStory());
++ }
++ break;
++/* case FRIB_TAG_TABLE:
++ {
++ LwpFribTable* tableFrib = static_cast<LwpFribTable*>(pFrib);
++ //tableFrib->XFConvert(m_pPara->GetXFContainer());
++ tableFrib->XFConvert(pXFPara);
++ }
++ break;
++*/ case FRIB_TAG_BOOKMARK:
++ {
++ LwpFribBookMark* bookmarkFrib = static_cast<LwpFribBookMark*>(pFrib);
++ bookmarkFrib->XFConvert(pXFPara);
++ }
++ break;
++ case FRIB_TAG_FOOTNOTE:
++ {
++ LwpFribFootnote* pFootnoteFrib = static_cast<LwpFribFootnote*>(pFrib);
++ pFootnoteFrib->XFConvert(pXFPara);
++ break;
++ }
++ case FRIB_TAG_FIELD:
++ {
++ LwpFribField* fieldFrib = static_cast<LwpFribField*>(pFrib);
++ fieldFrib->XFConvert(pXFPara);
++ break;
++ }
++ case FRIB_TAG_NOTE:
++ {
++ LwpFribNote* pNoteFrib = static_cast<LwpFribNote*>(pFrib);
++ pNoteFrib->XFConvert(pXFPara);
++ break;
++ }
++ case FRIB_TAG_PAGENUMBER:
++ {
++ LwpFribPageNumber* pagenumFrib = static_cast<LwpFribPageNumber*>(pFrib);
++ pagenumFrib->XFConvert(pXFPara);
++ break;
++ }
++ case FRIB_TAG_DOCVAR:
++ {
++ LwpFribDocVar* docFrib = static_cast<LwpFribDocVar*>(pFrib);
++ docFrib->XFConvert(pXFPara);
++ break;
++ }
++ case FRIB_TAG_RUBYMARKER:
++ {
++ LwpFribRubyMarker* rubyFrib = static_cast<LwpFribRubyMarker*>(pFrib);
++ rubyFrib->XFConvert(pXFPara);
++ break;
++ }
++ case FRIB_TAG_RUBYFRAME:
++ {
++ LwpFribRubyFrame* rubyfrmeFrib = static_cast<LwpFribRubyFrame*>(pFrib);
++ rubyfrmeFrib->XFConvert(pXFPara);
++ break;
++ }
++ default :
++ break;
++ }
++ pCont->Add(pXFPara);
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpchangemgr.hxx lotuswordpro/source/filter/lwpchangemgr.hxx
+--- lotuswordpro.bak/source/filter/lwpchangemgr.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpchangemgr.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,95 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jun 2005 Created
++ ************************************************************************/
++#ifndef _LWPCHANGEMGR_HXX_
++#define _LWPCHANGEMGR_HXX_
++
++#include <map>
++#include <vector>
++#include "lwpfrib.hxx"
++#include "lwpobjstrm.hxx"
++#include "lwpbasetype.hxx"
++#include "lwpoverride.hxx"
++#include "lwpfoundry.hxx"
++#include "xfilter/xfchange.hxx"
++#include "xfilter/xfcontentcontainer.hxx"
++
++class LwpChangeMgr
++{
++public:
++ void AddChangeFrib(LwpFrib* pFrib);
++ OUString GetChangeID(LwpFrib* pFrib);
++ void ConvertAllChange(IXFStream* pStream);
++ void SetHeadFootFribMap(sal_Bool bFlag);
++ void SetHeadFootChange(XFContentContainer* pCont);
++ ~LwpChangeMgr();
++ LwpChangeMgr();
++private:
++ std::map<LwpFrib*,OUString>* m_pFribMap;
++ std::map<LwpFrib*,OUString> m_DocFribMap;
++ std::map<LwpFrib*,OUString> m_HeadFootFribMap;
++ std::vector<XFChangeRegion*> m_ChangeList;
++ sal_uInt32 m_nCounter;
++ void ConvertFribContent(XFContentContainer* pCont, LwpFrib* pFrib);
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpcharacterstyle.cxx lotuswordpro/source/filter/lwpcharacterstyle.cxx
+--- lotuswordpro.bak/source/filter/lwpcharacterstyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpcharacterstyle.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,207 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpcharacterstyle.hxx"
++#include "lwpfilehdr.hxx"
++#include "lwptools.hxx"
++#include "lwpoverride.hxx"
++#include "lwpatomholder.hxx"
++#include "lwpfont.hxx"
++#include "lwpfoundry.hxx"
++#include "lwpcharborderoverride.hxx"
++
++/*class LwpTextStyle*/
++LwpTextStyle::LwpTextStyle(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpDLNFPVList(objHdr, pStrm),
++ m_nFontID(0), m_nFinalFontID(0), m_nCSFlags(0), m_nUseCount(0),
++ m_pDescription(new LwpAtomHolder), m_pLangOverride(new LwpTextLanguageOverride),
++ m_pTxtAttrOverride(new LwpTextAttributeOverride),
++ m_pCharacterBorderOverride(new LwpCharacterBorderOverride),
++ m_pAmikakeOverride(new LwpAmikakeOverride),
++ m_nStyleDefinition(0), m_nKey(0)
++{
++}
++
++void LwpTextStyle::Read()
++{
++ LwpDLNFPVList::Read();
++ ReadCommon();
++}
++
++LwpTextStyle::~LwpTextStyle()
++{
++ if (m_pDescription)
++ {
++ delete m_pDescription;
++ }
++ if (m_pLangOverride)
++ {
++ delete m_pLangOverride;
++ }
++ if (m_pTxtAttrOverride)
++ {
++ delete m_pTxtAttrOverride;
++ }
++ if (m_pCharacterBorderOverride)
++ {
++ delete m_pCharacterBorderOverride;
++ }
++ if (m_pAmikakeOverride)
++ {
++ delete m_pAmikakeOverride;
++ }
++}
++
++void LwpTextStyle::ReadCommon()
++{
++ m_pObjStrm->QuickRead(&m_nFontID, 4);
++ m_pObjStrm->QuickRead(&m_nFinalFontID, 4);
++ m_pObjStrm->QuickRead(&m_nCSFlags, 2);
++ m_pObjStrm->QuickRead(&m_nUseCount, 4);
++
++ m_pDescription->Read(m_pObjStrm);
++
++ m_pLangOverride->Read(m_pObjStrm);
++ m_pTxtAttrOverride->Read(m_pObjStrm);
++//#ifdef AMIKAKE
++ if (LwpFileHeader::m_nFileRevision < 0x000B)
++ {
++ m_pCharacterBorderOverride->Read(m_pObjStrm);
++ m_pAmikakeOverride->Read(m_pObjStrm);
++ }
++ else
++ {
++ m_CharacterBorder.ReadIndexed(m_pObjStrm);
++ m_Amikake.ReadIndexed(m_pObjStrm);
++ }
++//#endif
++ sal_uInt16 nCount = 6;
++ if (LwpFileHeader::m_nFileRevision > 0x0005)
++ {
++ m_pObjStrm->QuickRead(&nCount, 2);
++ }
++
++ m_FaceStyle.ReadIndexed(m_pObjStrm);
++
++ if (nCount > 1)
++ {
++ m_SizeStyle.ReadIndexed(m_pObjStrm);
++ m_AttributeStyle.ReadIndexed(m_pObjStrm);
++ m_FontStyle.ReadIndexed(m_pObjStrm);
++ m_CharacterBorderStyle.ReadIndexed(m_pObjStrm);
++ m_AmikakeStyle.ReadIndexed(m_pObjStrm);
++ }
++
++ if (m_pObjStrm->CheckExtra())
++ {
++ m_pObjStrm->QuickRead(&m_nStyleDefinition, 4);
++
++ if (m_pObjStrm->CheckExtra())
++ {
++ m_pObjStrm->QuickRead(&m_nKey, 2);
++ m_pObjStrm->SkipExtra();
++ }
++ }
++
++}
++
++#include "xfilter/xfparastyle.hxx"
++#include "xfilter/xffont.hxx"
++
++void LwpTextStyle::RegisterStyle()
++{
++ if (!m_pFoundry)
++ {
++ assert(false);
++ return;
++ }
++
++ XFTextStyle* pStyle = new XFTextStyle();
++
++ //Set name
++ OUString styleName = GetName()->str();
++ pStyle->SetStyleName(styleName);
++
++ //Create font
++ LwpFontManager* pFontMgr = m_pFoundry->GetFontManger();
++ XFFont* pFont = pFontMgr->CreateFont(m_nFinalFontID);
++ pStyle->SetFont(pFont);
++
++ //Set other properties if needed
++
++ //Add style
++ LwpStyleManager* pStyleMgr = m_pFoundry->GetStyleManager();
++ pStyleMgr->AddStyle(*GetObjectID(), pStyle);
++
++}
++
++/*class LwpCharacterStyle*/
++LwpCharacterStyle::LwpCharacterStyle(LwpObjectHeader& objHdr, LwpSvStream* pStrm) :
++LwpTextStyle(objHdr, pStrm)
++{
++}
++
++void LwpCharacterStyle::Read()
++{
++ LwpTextStyle::Read();
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpcharacterstyle.hxx lotuswordpro/source/filter/lwpcharacterstyle.hxx
+--- lotuswordpro.bak/source/filter/lwpcharacterstyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpcharacterstyle.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,137 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++#ifndef _LWPCHARACTERSTYLE_HXX
++#define _LWPCHARACTERSTYLE_HXX
++
++#include "lwpobj.hxx"
++#include "lwpdlvlist.hxx"
++
++
++class LwpAtomHolder;
++class LwpTextLanguageOverride;
++class LwpTextAttributeOverride;
++class LwpCharacterBorderOverride;
++class LwpAmikakeOverride;
++
++class LwpTextStyle : public LwpDLNFPVList
++{
++public:
++ LwpTextStyle(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++
++ virtual ~LwpTextStyle();
++
++ inline sal_uInt32 GetFinalFontID() const;
++
++ virtual void RegisterStyle();
++
++protected:
++ void ReadCommon();
++ void Read();
++
++protected:
++
++ sal_uInt32 m_nFontID;
++ sal_uInt32 m_nFinalFontID;
++ sal_uInt16 m_nCSFlags;
++ sal_uInt32 m_nUseCount;
++
++ LwpAtomHolder* m_pDescription;
++ LwpTextLanguageOverride* m_pLangOverride;
++ LwpTextAttributeOverride* m_pTxtAttrOverride;
++
++ LwpCharacterBorderOverride* m_pCharacterBorderOverride;
++ LwpAmikakeOverride* m_pAmikakeOverride;
++
++ LwpObjectID m_CharacterBorder;
++ LwpObjectID m_Amikake;
++ LwpObjectID m_FaceStyle;
++
++ LwpObjectID m_SizeStyle;
++ LwpObjectID m_AttributeStyle;
++ LwpObjectID m_FontStyle;
++ LwpObjectID m_CharacterBorderStyle;
++ LwpObjectID m_AmikakeStyle;
++
++ sal_uInt32 m_nStyleDefinition;
++// sal_uInt16 m_nBasedOnCount;
++ sal_uInt16 m_nKey;
++
++};
++
++inline sal_uInt32 LwpTextStyle::GetFinalFontID() const
++{
++ return m_nFinalFontID;
++}
++
++class LwpCharacterStyle : public LwpTextStyle
++{
++public:
++ LwpCharacterStyle(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++
++ void Read();
++
++private:
++
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpcharborderoverride.cxx lotuswordpro/source/filter/lwpcharborderoverride.cxx
+--- lotuswordpro.bak/source/filter/lwpcharborderoverride.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpcharborderoverride.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,148 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpcharborderoverride.hxx"
++#include "lwpborderstuff.hxx"
++#include "lwpmargins.hxx"
++
++LwpCharacterBorderOverride::LwpCharacterBorderOverride() :
++m_pBorderStuff(new LwpBorderStuff), m_pMargins(new LwpMargins)
++{
++}
++
++LwpCharacterBorderOverride::~LwpCharacterBorderOverride()
++{
++ if (m_pBorderStuff)
++ {
++ delete m_pBorderStuff;
++ }
++ if (m_pMargins)
++ {
++ delete m_pMargins;
++ }
++}
++
++void LwpCharacterBorderOverride::Read(LwpObjectStream* pStrm)
++{
++ if (pStrm->QuickReadBool())
++ {
++ ReadCommon(pStrm);
++ m_pBorderStuff->Read(pStrm);
++ m_pMargins->Read(pStrm);
++ pStrm->QuickRead(&m_nAboveWidth, 4);
++ pStrm->QuickRead(&m_nBelowWidth, 4);
++ }
++
++ pStrm->SkipExtra();
++}
++
++void LwpCharacterBorderOverride::Override(LwpCharacterBorderOverride* pOther)
++{
++ if (m_nApply & PBO_STUFF)
++ {
++ if (this->IsBorderStuffOverridden())
++ {
++ pOther->OverrideBorderStuff(m_pBorderStuff);
++ }
++ else
++ {
++ pOther->RevertBorderStuff();
++ }
++ }
++
++ if (m_nApply & PBO_MARGINS)
++ {
++ if (this->IsMarginsOverridden())
++ {
++ pOther->OverrideMargins(m_pMargins);
++ }
++ else
++ {
++ pOther->RevertMargins();
++ }
++ }
++
++ if (m_nApply & PBO_ABOVE)
++ {
++ if (this->IsAboveWidthOverridden())
++ {
++ pOther->OverrideAboveWidth(m_nAboveWidth);
++ }
++ else
++ {
++ pOther->RevertAboveWidth();
++ }
++ }
++
++ if (m_nApply & PBO_BELOW)
++ {
++ if (this->IsBelowWidthOverridden())
++ {
++ pOther->OverrideBelowWidth(m_nBelowWidth);
++ }
++ else
++ {
++ pOther->RevertBelowWidth();
++ }
++ }
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpcharborderoverride.hxx lotuswordpro/source/filter/lwpcharborderoverride.hxx
+--- lotuswordpro.bak/source/filter/lwpcharborderoverride.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpcharborderoverride.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,195 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPCHARBORDEROVERRIDE_HXX
++#define _LWPCHARBORDEROVERRIDE_HXX
++
++#include "lwpoverride.hxx"
++
++class LwpBorderStuff;
++class LwpMargins;
++class LwpCharacterBorderOverride : public LwpOverride
++{
++public:
++ LwpCharacterBorderOverride();
++
++ virtual ~LwpCharacterBorderOverride();
++
++ void Read(LwpObjectStream* pStrm);
++
++ void Override(LwpCharacterBorderOverride* pOther);
++
++ inline LwpBorderStuff* GetBorderStuff();
++ inline LwpMargins* GetMargins();
++ inline sal_Int32 GetAboveWidth() const;
++ inline sal_Int32 GetBelowWidth() const;
++
++ inline sal_Bool IsBorderStuffOverridden();
++ inline sal_Bool IsMarginsOverridden();
++ inline sal_Bool IsAboveWidthOverridden();
++ inline sal_Bool IsBelowWidthOverridden();
++
++ inline void OverrideBorderStuff(LwpBorderStuff* pOther);
++ inline void OverrideMargins(LwpMargins* pOther);
++ inline void OverrideAboveWidth(sal_Int32 nNewWidth);
++ inline void OverrideBelowWidth(sal_uInt32 nNewWidth);
++
++ inline void RevertBorderStuff();
++ inline void RevertMargins();
++ inline void RevertAboveWidth();
++ inline void RevertBelowWidth();
++
++private:
++ LwpBorderStuff* m_pBorderStuff;
++ LwpMargins* m_pMargins;
++ sal_Int32 m_nAboveWidth;
++ sal_Int32 m_nBelowWidth;
++
++ enum
++ {
++ PBO_STUFF = 0x01,
++ PBO_MARGINS = 0x04,
++ PBO_ABOVE = 0x40,
++ PBO_BELOW = 0x80
++ };
++};
++
++inline LwpMargins* LwpCharacterBorderOverride::GetMargins()
++{
++ return m_pMargins;
++}
++
++inline LwpBorderStuff* LwpCharacterBorderOverride::GetBorderStuff()
++{
++ return m_pBorderStuff;
++}
++
++inline sal_Int32 LwpCharacterBorderOverride::GetAboveWidth() const
++{
++ return m_nAboveWidth;
++}
++
++inline sal_Int32 LwpCharacterBorderOverride::GetBelowWidth() const
++{
++ return m_nBelowWidth;
++}
++
++inline sal_Bool LwpCharacterBorderOverride::IsBorderStuffOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_STUFF) != 0);
++}
++
++inline sal_Bool LwpCharacterBorderOverride::IsMarginsOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_MARGINS) != 0);
++}
++
++inline sal_Bool LwpCharacterBorderOverride::IsAboveWidthOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_ABOVE) != 0);
++}
++
++inline sal_Bool LwpCharacterBorderOverride::IsBelowWidthOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_BELOW) != 0);
++}
++
++inline void LwpCharacterBorderOverride::OverrideBorderStuff(LwpBorderStuff* pOther)
++{
++ m_pBorderStuff = pOther;
++ LwpOverride::Override(PBO_STUFF, STATE_ON);
++}
++inline void LwpCharacterBorderOverride::OverrideMargins(LwpMargins* pOther)
++{
++ m_pMargins = pOther;
++ LwpOverride::Override(PBO_MARGINS, STATE_ON);
++}
++inline void LwpCharacterBorderOverride::OverrideAboveWidth(sal_Int32 nNewWidth)
++{
++ m_nAboveWidth = nNewWidth;
++ LwpOverride::Override(PBO_ABOVE, STATE_ON);
++}
++inline void LwpCharacterBorderOverride::OverrideBelowWidth(sal_uInt32 nNewWidth)
++{
++ m_nBelowWidth = nNewWidth;
++ LwpOverride::Override(PBO_BELOW, STATE_ON);
++}
++
++inline void LwpCharacterBorderOverride::RevertBorderStuff()
++{
++ LwpOverride::Override(PBO_STUFF, STATE_STYLE);
++}
++inline void LwpCharacterBorderOverride::RevertMargins()
++{
++ LwpOverride::Override(PBO_MARGINS, STATE_STYLE);
++}
++inline void LwpCharacterBorderOverride::RevertAboveWidth()
++{
++ LwpOverride::Override(PBO_ABOVE, STATE_STYLE);
++}
++inline void LwpCharacterBorderOverride::RevertBelowWidth()
++{
++ LwpOverride::Override(PBO_BELOW, STATE_STYLE);
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpcharsetmgr.cxx lotuswordpro/source/filter/lwpcharsetmgr.cxx
+--- lotuswordpro.bak/source/filter/lwpcharsetmgr.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpcharsetmgr.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,119 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++#include "lwpcharsetmgr.hxx"
++//Added by yanjun for SS migration : 2007-12-21
++#include "rtl/textenc.h"
++//End
++LwpCharSetMgr* LwpCharSetMgr::Instance = NULL;
++
++LwpCharSetMgr* LwpCharSetMgr::GetInstance()
++{
++ if (Instance == NULL)
++ Instance = new LwpCharSetMgr;
++ return Instance;
++}
++
++void LwpCharSetMgr::SetCodePageMap()
++{//sal_uInt16 wordproCode,rtl_TextEncoding encoding, tmp hardcoding, 1-18
++/* m_CodePageMap[256] =
++ m_CodePageMap[259] =
++ m_CodePageMap[819] =
++ m_CodePageMap[921] =*/
++ m_CodePageMap[437] = RTL_TEXTENCODING_ASCII_US;
++ m_CodePageMap[850] = RTL_TEXTENCODING_IBM_850;
++ //m_CodePageMap[851] = RTL_TEXTENCODING_IBM_851;
++ m_CodePageMap[852] = RTL_TEXTENCODING_IBM_852;
++ m_CodePageMap[857] = RTL_TEXTENCODING_IBM_857;
++ m_CodePageMap[860] = RTL_TEXTENCODING_IBM_860;
++ m_CodePageMap[863] = RTL_TEXTENCODING_IBM_863;
++ m_CodePageMap[865] = RTL_TEXTENCODING_IBM_865;
++ m_CodePageMap[866] = RTL_TEXTENCODING_IBM_866;
++ m_CodePageMap[869] = RTL_TEXTENCODING_IBM_869;
++ m_CodePageMap[874] = RTL_TEXTENCODING_MS_874;//thai
++ m_CodePageMap[932] = RTL_TEXTENCODING_MS_932; //japanese
++ m_CodePageMap[936] = RTL_TEXTENCODING_MS_936; //chinese simple
++ m_CodePageMap[949] = RTL_TEXTENCODING_MS_949;//korean
++ m_CodePageMap[950] = RTL_TEXTENCODING_BIG5;//chinese traditional
++ m_CodePageMap[1250] = RTL_TEXTENCODING_MS_1250;//Central European
++ m_CodePageMap[1252] = RTL_TEXTENCODING_MS_1252;
++ m_CodePageMap[1251] = RTL_TEXTENCODING_MS_1251; //ukrainian belarusian macedonian russian
++ m_CodePageMap[1253] = RTL_TEXTENCODING_MS_1253;//greek
++ m_CodePageMap[1254] = RTL_TEXTENCODING_MS_1254;//Turkish
++ m_CodePageMap[1255] = RTL_TEXTENCODING_MS_1255;//hebrew
++ m_CodePageMap[1256] = RTL_TEXTENCODING_MS_1256;//arabic
++ m_CodePageMap[1257] = RTL_TEXTENCODING_MS_1257;//estonian
++}
++
++rtl_TextEncoding LwpCharSetMgr::GetTextCharEncoding(sal_uInt16 wordproCode)
++{
++ std::map<sal_uInt16,rtl_TextEncoding>::iterator
++ pos = m_CodePageMap.find(wordproCode);
++ if (pos != m_CodePageMap.end())
++ return m_CodePageMap[wordproCode];
++ return GetTextCharEncoding();
++}
++
++rtl_TextEncoding LwpCharSetMgr::GetTextCharEncoding()
++{
++ return RTL_TEXTENCODING_MS_1252;//here should be a default value,1252 or get from platform, 1-18
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpcharsetmgr.hxx lotuswordpro/source/filter/lwpcharsetmgr.hxx
+--- lotuswordpro.bak/source/filter/lwpcharsetmgr.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpcharsetmgr.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,87 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++#ifndef _LWPCHARSETMGR_HXX
++#define _LWPCHARSETMGR_HXX
++
++#include "lwpfilehdr.hxx"
++#include <map>
++//#include <pair>
++
++class LwpCharSetMgr
++{
++public:
++ LwpCharSetMgr(){SetCodePageMap();};
++ ~LwpCharSetMgr(){};
++ static LwpCharSetMgr* GetInstance();
++ void SetCodePageMap();
++ rtl_TextEncoding GetTextCharEncoding(sal_uInt16 wordproCode);
++ rtl_TextEncoding GetTextCharEncoding();
++private:
++ std::map<sal_uInt16,rtl_TextEncoding> m_CodePageMap;
++ static LwpCharSetMgr* Instance;
++};
++
++
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwpchartstreamtools.cxx lotuswordpro/source/filter/lwpchartstreamtools.cxx
+--- lotuswordpro.bak/source/filter/lwpchartstreamtools.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpchartstreamtools.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,360 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*****************************************************************************
++* Change History
++* <<Date>> <<Name of editor>> <<Description>>
++2005/2 draft code for implementation of chart stream helpers
++****************************************************************************/
++
++/**
++ * @file
++ * For LWP filter architecture prototype
++*/
++
++#include "lwpchartstreamtools.hxx"
++#include "xfilter/xfdrawchart.hxx"
++#include "xfilter/xfparagraph.hxx"
++
++#include <com/sun/star/xml/sax/SAXParseException.hpp>
++
++/**
++* @short Get the chart stream from bento layer
++* @descr
++* @param pDocStream the document stream
++* @param pChartName The name of the requested chart stream
++* @return pStream The chart stream, may be NULL
++*/
++SvStream* LwpChartStreamTools::GetChartStream(LwpSvStream* pDocStream, const char* pChartName)
++{
++ // if small file, use the compressed stream for BENTO
++ LwpSvStream *pSvStream = pDocStream->GetCompressedStream() ? pDocStream->GetCompressedStream(): pDocStream;
++
++ SvStream* pStream = NULL;
++ pSvStream->Seek(0);
++ OpenStormBento::LtcBenContainer* pContainer = NULL;;
++ ULONG nRet = OpenStormBento::BenOpenContainer(pSvStream,&pContainer);
++ if ( 0==nRet )
++ {
++ pStream = pContainer->FindValueStreamWithPropertyName(pChartName);
++ }
++ return pStream;
++}
++
++/**
++* @short Output the chart into output stream
++* @param aChartRect the rectangle of the chart
++* @param pXChartStrm Chart stream
++* @param pOutputStream the output stream
++*/
++void LwpChartStreamTools::OutputChart(XFRect aChartRect, IXFContent* pXChartStrm, IXFStream* pOutputStream)
++{
++ XFDrawChart* pXChart = new XFDrawChart;
++ pXChart->SetPosition(aChartRect);
++ pXChart->Add(pXChartStrm);
++
++ //write to xml
++ XFParagraph xpara;
++ xpara.Add(pXChart);
++ xpara.ToXml(pOutputStream);
++}
++
++void LwpChartStreamTools::OutputChart(XFRect aChartRect, IXFContent* pXChartStrm, XFContentContainer* pCont, OUString strStyleName)
++{
++ XFDrawChart* pXChart = new XFDrawChart;
++ pXChart->SetStyleName( strStyleName);
++ pXChart->SetPosition(aChartRect);
++ pXChart->SetAnchorType(enumXFAnchorFrame);
++ pXChart->Add(pXChartStrm);
++
++ pCont->Add(pXChart);
++
++ //write to xml
++ /*XFParagraph* pPara = new XFParagraph();
++ pPara->Add(pXChart);
++ pCont->Add(pPara);
++ */
++}
++
++/**
++* @short Get the stream length
++* @param pStream the stream
++* @param the stream length
++*/
++INT32 LwpChartStreamTools::GetStreamLen(SvStream* pStream)
++{
++ UINT32 nPos = pStream->Tell();
++ pStream->Seek(STREAM_SEEK_TO_END);
++ INT32 nStrmLen = pStream->Tell();
++ pStream->Seek(nPos);
++ return nStrmLen;
++}
++
++/**
++* @short Make the chart storage object
++* @param pStream the chart stream
++* @param aChartRect the rectangle of the chart
++* @param xIPObj [out]the inplace object
++* @param xStorage [out]the storage object of the chart
++*/
++#include "lwpchartwrapper.hxx"
++void LwpChartStreamTools::MakeChartStorage( SvStream* pStream, Rectangle aChartRect, SvInPlaceObjectRef& xIPObj, SvStorageRef& xStorage)
++{
++ // SfxItemSet aItemSet( rDoc.GetAttrPool()); //Style of chart area
++ INT32 nStrmLen = GetStreamLen(pStream);
++ LtcLwpChartWrapper aChart(pStream,nStrmLen);
++ aChart.CreateChart(aChartRect,xIPObj,xStorage);
++ aChart.Read();
++}
++
++/**
++* @short Translate the storage to XML stream
++* @param xStorage [out]the storage object of a chart
++* @param xIPObj [in]the inplace object
++*/
++#include "schxmlwrapper.hxx"
++void LwpChartStreamTools::ChartToXML(SvStorageRef xStorage, SvInPlaceObjectRef xIPObj)
++{
++ xStorage->SetVersion( SOFFICE_FILEFORMAT_60 );
++
++ SfxInPlaceObjectRef aSfxObj( xIPObj );
++ SfxObjectShell* pSh = aSfxObj->GetObjectShell();
++ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel = pSh->GetModel();
++
++ SchXMLWrapper aFilter( xModel, *xStorage, sal_False );
++
++ // update user info before writing
++ pSh->UpdateDocInfoForSave();
++
++ aFilter.Export();
++}
++
++//void LwpChartStreamTools::ChartToXML(SvStorageRef xStorage, SvInPlaceObjectRef xIPObj)
++//{
++// xStorage->SetVersion( SOFFICE_FILEFORMAT_60 );
++//
++// SfxInPlaceObjectRef aSfxObj( xIPObj );
++// SfxObjectShell* pSh = aSfxObj->GetObjectShell();
++// pSh->Save();
++//}
++
++/**
++* @short Get the xml stream from the storage
++* @param xStorage the storage object
++* @param aStrmName the stream name
++*/
++SvStorageStreamRef LwpChartStreamTools::GetStream(SvStorageRef xStorage, String aStrmName)
++{
++ SvStorageStreamRef rStream;
++ if( ! xStorage->IsStream( aStrmName) )
++ {
++ assert(false);
++ }
++ else
++ {
++ rStream = xStorage->OpenStream( aStrmName, STREAM_READ | STREAM_NOCREATE );
++ }
++ return rStream;
++}
++
++/**
++* @short Dump the xml stream into a file
++*/
++void LwpChartStreamTools::DumpStream(SvStorageStreamRef rStream, char* aName)
++{
++ INT32 nLen = GetStreamLen(&rStream);
++ char* pBuf = new char[nLen];
++ rStream->Read(pBuf, nLen);
++ std::ofstream aFile(aName, ios_base::out);
++ aFile.write(pBuf,nLen);
++ rStream->Seek(0);
++}
++
++/**
++* @short Get the name of chart stream
++* @param pID the id of the VO_Graphic object, which map to a chart stream.
++* @return the name of the chart stream
++*/
++const char* LwpChartStreamTools::GetChartName(LwpObjectID* pID)
++{
++#define MAX_STREAMORSTORAGENAME 32 //The value is got from wordpro source
++ static char pChartName[MAX_STREAMORSTORAGENAME];
++
++ char aGrStrmPrefix[] = "Gr";
++ char aDataStrmSuffix[] = "-D";
++
++ sprintf( (char*)pChartName,"%s%lX,%lX%s", aGrStrmPrefix,pID->GetHigh(),
++ pID->GetLow(),aDataStrmSuffix);
++
++ return pChartName;
++}
++
++/**
++* @short Parse the chart stream in Bento layer.
++* @descr
++* @param pOutputStream the pointer to IXFStream, which output the xml content.
++* @return
++* @todo any error code return are needed?
++*/
++void LwpChartStreamTools::ParseChart( LwpSvStream* pDocStream,
++ LwpObjectID* pID,
++ Rectangle aRectIn100thMM,
++ XFRect aRectInCM,
++ IXFStream* pOutputStream)
++{
++ XFChartStream* pXFChartStrm = new XFChartStream;
++
++ try
++ {
++ //GetChartName
++ const char* pChartName = GetChartName(pID);
++
++ //Get chart stream
++ SvStream* pStream = GetChartStream( pDocStream, pChartName );
++ if (!pStream)
++ {
++ assert(false);
++ return;
++ }
++
++ SvInPlaceObjectRef xIPObj;
++ SvStorageRef xStorage;
++
++ MakeChartStorage( pStream, aRectIn100thMM, xIPObj, xStorage);
++ ChartToXML(xStorage, xIPObj);
++// SvStorageStreamRef rStyleStream = GetStream(xStorage,String::CreateFromAscii( "styles.xml" ));
++ SvStorageStreamRef rCntStream = GetStream(xStorage,String::CreateFromAscii( "content.xml" ));
++// DumpStream(rCntStream,"d:\\allinone.xml");
++ if (rCntStream.Is())
++ {
++ pXFChartStrm->SetChartStream(rCntStream);
++ }
++
++ OutputChart( aRectInCM, pXFChartStrm, pOutputStream);
++
++ delete pStream;
++ }
++ catch (com::sun::star::xml::sax::SAXParseException&) {
++ assert(false);
++ }
++ catch( com::sun::star::xml::sax::SAXException& )
++ {
++ assert(false);
++ }
++ catch( com::sun::star::io::IOException&)
++ {
++ assert(false);
++ }
++ catch( com::sun::star::uno::Exception&)
++ {
++ assert(false);
++ }
++}
++
++void LwpChartStreamTools::ParseChart( LwpSvStream* pDocStream,
++ LwpObjectID* pID,
++ Rectangle aRectIn100thMM,
++ XFRect aRectInCM,
++ XFContentContainer* pCont,
++ OUString strStyleName)
++{
++ XFChartStream* pXFChartStrm = new XFChartStream;
++
++ try
++ {
++ //GetChartName
++ const char* pChartName = GetChartName(pID);
++
++ //Get chart stream
++ SvStream* pStream = GetChartStream( pDocStream, pChartName );
++ if (!pStream)
++ {
++ assert(false);
++ return;
++ }
++
++ SvInPlaceObjectRef xIPObj;
++ SvStorageRef xStorage;
++
++ MakeChartStorage( pStream, aRectIn100thMM, xIPObj, xStorage);
++ ChartToXML(xStorage, xIPObj);
++// SvStorageStreamRef rStyleStream = GetStream(xStorage,String::CreateFromAscii( "styles.xml" ));
++ SvStorageStreamRef rCntStream = GetStream(xStorage,String::CreateFromAscii( "content.xml" ));
++// DumpStream(rCntStream,"d:\\allinone.xml");
++ if (rCntStream.Is())
++ {
++ pXFChartStrm->SetChartStream(rCntStream);
++ }
++
++ OutputChart( aRectInCM, pXFChartStrm, pCont, strStyleName);
++
++ delete pStream;
++ }
++ catch (com::sun::star::xml::sax::SAXParseException& ) {
++ assert(false);
++ }
++ catch( com::sun::star::xml::sax::SAXException& )
++ {
++ assert(false);
++ }
++ catch( com::sun::star::io::IOException&)
++ {
++ assert(false);
++ }
++ catch( com::sun::star::uno::Exception&)
++ {
++ assert(false);
++ }
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpchartstreamtools.hxx lotuswordpro/source/filter/lwpchartstreamtools.hxx
+--- lotuswordpro.bak/source/filter/lwpchartstreamtools.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpchartstreamtools.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,150 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*****************************************************************************
++* Change History
++* <<Date>> <<Name of editor>> <<Description>>
++2005/2 draft code for chart stream helpers
++****************************************************************************/
++
++/**
++ * @file
++ * For LWP filter architecture prototype
++*/
++
++#ifndef LWPCHARTSTREAMTOOLS_HXX_
++#define LWPCHARTSTREAMTOOLS_HXX_
++
++#include <tools/stream.hxx>
++#include "bento.hxx"
++#include <tools/gen.hxx>
++#include <so3/ipobj.hxx>
++
++#include "lwpobjid.hxx"
++#include "lwpobjfactory.hxx"
++
++//For sax parser
++#ifndef _COM_SUN_STAR_XML_SAX_INPUTSOURCE_HPP_
++#include <com/sun/star/xml/sax/InputSource.hpp>
++#endif
++
++#ifndef _COM_SUN_STAR_XML_SAX_XDTDHANDLER_HPP_
++#include <com/sun/star/xml/sax/XDTDHandler.hpp>
++#endif
++
++#ifndef _COM_SUN_STAR_XML_SAX_XPARSER_HPP_
++#include <com/sun/star/xml/sax/XParser.hpp>
++#endif
++
++#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
++#include <comphelper/processfactory.hxx>
++#endif
++
++//using namespace ::com::sun::star;
++using namespace ::rtl;
++using namespace comphelper;
++
++#include "xfilter/xfchartxmlhandler.hxx"
++#include "xfilter/xfrect.hxx"
++class IXFContent;
++
++/**
++* @brief
++* tools class for chart stream process
++*/
++
++class LwpChartStreamTools
++{
++public:
++ static SvStream* GetChartStream(LwpSvStream* pDocStream, const char* pChartName);
++
++ static void OutputChart(XFRect aChartRect, IXFContent* pXChartStrm, IXFStream* pOutputStream);
++
++ //Added by for XFConvert refactor, 03/31/2005
++ static void OutputChart(XFRect aChartRect, IXFContent* pXChartStrm, XFContentContainer* pCont, OUString strStyleName);
++ //End of Add
++
++ static INT32 GetStreamLen(SvStream* pStream);
++
++ static void MakeChartStorage( SvStream* pStream,
++ Rectangle aChartRect,
++ SvInPlaceObjectRef& xIPObj,
++ SvStorageRef& xStorage);
++
++ static void ChartToXML(SvStorageRef xStorage, SvInPlaceObjectRef xIPObj);
++
++ static SvStorageStreamRef GetStream(SvStorageRef xStorage, String aStrmName);
++
++ static void DumpStream(SvStorageStreamRef rStream, char* aName);
++
++ static const char* GetChartName(LwpObjectID* pID);
++
++public:
++ static void ParseChart( LwpSvStream* pDocStream,
++ LwpObjectID* pID,
++ Rectangle aRectIn100thMM,
++ XFRect aRectInCM,
++ IXFStream* pOutputStream);
++ //Added by for XFConvert refactor, 03/31/2005
++ static void ParseChart( LwpSvStream* pDocStream,
++ LwpObjectID* pID,
++ Rectangle aRectIn100thMM,
++ XFRect aRectInCM,
++ XFContentContainer* pCont,
++ OUString strStyleName);
++ //End of Add
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwpchartwrapper.cxx lotuswordpro/source/filter/lwpchartwrapper.cxx
+--- lotuswordpro.bak/source/filter/lwpchartwrapper.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpchartwrapper.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,93 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++
++#include "lwpchartwrapper.hxx"
++#include <sschart/charttools.hxx>
++using namespace NAME_CHART;
++
++LtcLwpChartWrapper::LtcLwpChartWrapper(SvStream* pStream,UINT32 nStrmLen)
++{
++ m_pImpChart.reset(new LtcImpChart(pStream,nStrmLen) );
++
++ m_spDatahandler.reset(new ltcDataWindowHandler());
++ m_pImpChart->SetData(m_spDatahandler);
++}
++
++sal_Bool LtcLwpChartWrapper::Read()
++{
++ sal_Bool bRet = sal_False;
++ m_pImpChart->SetStrmOffset(0);
++ chtFltError eRet = m_pImpChart->Read();
++ if (eChtERR_OK==eRet)
++ {
++ bRet = sal_True;
++ }
++ return bRet;
++}
++
++void LtcLwpChartWrapper::CreateChart(Rectangle aChartRect,SvInPlaceObjectRef& xIPObj,SvStorageRef& xStorage)
++{
++ m_pImpChart->CreateChartObj(aChartRect, xIPObj, xStorage);
++}
++
++//////////////////////////////////////////////////////////////////////////
++void LtcLwpChartDataHandler::ApplyAreaStyle()
++{
++ CHART_TYPE eChartType = GetChartType();
++ if ( eChartType==RADAR || eChartType==RADAR_AREA )
++ {
++ LtcChartTools::ApplyRadarDefaultArea(this,m_xChartDoc);
++ }
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpchartwrapper.hxx lotuswordpro/source/filter/lwpchartwrapper.hxx
+--- lotuswordpro.bak/source/filter/lwpchartwrapper.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpchartwrapper.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,79 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef LWPCHARTWRAPPER_HXX_
++#define LWPCHARTWRAPPER_HXX_
++
++#include <sschart/ltcimpchart.hxx>
++#include <boost/shared_ptr.hpp>
++
++class LtcLwpChartWrapper
++{
++public:
++ LtcLwpChartWrapper(SvStream* pStream,UINT32 nStrmLen);
++ sal_Bool Read();
++ void CreateChart(Rectangle aChartRect,SvInPlaceObjectRef& xIPObj,SvStorageRef& xStorage);
++
++private:
++ auto_ptr<NAME_CHART::LtcImpChart> m_pImpChart;
++ boost::shared_ptr<NAME_CHART::ltcDataWindowHandler> m_spDatahandler;
++};
++
++class LtcLwpChartDataHandler: public NAME_CHART::ltcDataWindowHandler
++{
++public:
++ void ApplyAreaStyle();
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpcolor.cxx lotuswordpro/source/filter/lwpcolor.cxx
+--- lotuswordpro.bak/source/filter/lwpcolor.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpcolor.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,149 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpcolor.hxx"
++/**
++ * @descr read color and then resolve the RGB values
++*/
++void LwpColor::Read(LwpObjectStream *pStrm)
++{
++ pStrm->QuickRead(&m_nRed, sizeof(m_nRed));
++ pStrm->QuickRead(&m_nGreen, sizeof(m_nGreen));
++ pStrm->QuickRead(&m_nBlue, sizeof(m_nBlue));
++ pStrm->QuickRead(&m_nExtra, sizeof(m_nExtra));
++ ResolveRGB();
++}
++
++/**
++ * @descr return the BGR format
++*/
++sal_uInt32 LwpColor::To24Color()
++{
++ return ((m_nRed >> 8) |
++ (m_nGreen & 0xFF00) |
++ (static_cast<sal_uInt32>((m_nBlue & 0xFF00) << 8)));
++}
++/**
++ * @descr resolver RGB values per the extra bytes
++*/
++void LwpColor::ResolveRGB()
++{
++ switch(m_nExtra)
++ {
++ case AGLRGB_RGB:
++ break;
++ case AGLRGB_RED:
++ m_nRed = 0xFFFF;
++ m_nGreen = 0x0000;
++ m_nBlue = 0x0000;
++ break;
++ case AGLRGB_GREEN:
++ m_nRed = 0x0000;
++ m_nGreen = 0xFFFF;
++ m_nBlue = 0x0000;
++ break;
++ case AGLRGB_BLUE:
++ m_nRed = 0x0000;
++ m_nGreen = 0x0000;
++ m_nBlue = 0xFFFF;
++ break;
++ case AGLRGB_BLACK:
++ m_nRed = 0x0000;
++ m_nGreen = 0x0000;
++ m_nBlue = 0x0000;
++ break;
++ case AGLRGB_WHITE:
++ m_nRed = 0xFFFF;
++ m_nGreen = 0xFFFF;
++ m_nBlue = 0xFFFF;
++ break;
++ case AGLRGB_GRAY:
++ m_nRed = 0x8080;
++ m_nGreen = 0x8080;
++ m_nBlue = 0x8080;
++ break;
++ case AGLRGB_LTGRAY:
++ m_nRed = 0xC0C0;
++ m_nGreen = 0xC0C0;
++ m_nBlue = 0xC0C0;
++ break;
++ case AGLRGB_DKGRAY:
++ m_nRed = 0x4040;
++ m_nGreen = 0x4040;
++ m_nBlue = 0x4040;
++ break;
++ case AGLRGB_INVALID:
++ case AGLRGB_TRANSPARENT:
++ default:
++ m_nRed = 0;
++ m_nGreen = 0;
++ m_nBlue = 0;
++ }
++}
++void LwpColor::operator = (const LwpColor& rOther)
++{
++ m_nRed = rOther.m_nRed;
++ m_nGreen = rOther.m_nGreen;
++ m_nBlue = rOther.m_nBlue;
++ m_nExtra = rOther.m_nExtra;
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpcolor.hxx lotuswordpro/source/filter/lwpcolor.hxx
+--- lotuswordpro.bak/source/filter/lwpcolor.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpcolor.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,130 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPCOLOR_HXX
++#define _LWPCOLOR_HXX
++
++#include "lwpobjstrm.hxx"
++#include "lwpheader.hxx"
++/**
++ * @brief lwpcolor class
++ * (red, green, blue, extra)
++*/
++class LwpColor
++{
++public:
++ LwpColor():m_nRed(0), m_nGreen(0), m_nBlue(0), m_nExtra(0){};
++ ~LwpColor(){};
++public:
++ void Read(LwpObjectStream *pStrm);
++ sal_uInt16 GetRed();
++ sal_uInt16 GetGreen();
++ sal_uInt16 GetBlue();
++ BOOL IsValidColor();
++ sal_uInt32 To24Color();
++ //add by , 01/26/2005
++ void operator = (const LwpColor& rOther);
++ //end
++ sal_Bool IsTransparent();
++private:
++ sal_uInt16 m_nRed; // When extra is AGLRGB_INDEX, m_nRed holds the
++ sal_uInt16 m_nGreen; // hi 16 bits and m_nGreen holds the lo 16 bits of
++ sal_uInt16 m_nBlue; // the 32-bit LUT index.
++ sal_uInt16 m_nExtra;
++ enum ColorOverride {
++ AGLRGB_RGB = 0,
++ AGLRGB_BLACK = 1,
++ AGLRGB_WHITE = 2,
++ AGLRGB_GRAY = 3,
++ AGLRGB_LTGRAY = 4,
++ AGLRGB_DKGRAY = 5,
++ AGLRGB_RED = 6,
++ AGLRGB_GREEN = 7,
++ AGLRGB_BLUE = 8,
++ AGLRGB_INDEX = 98,
++ AGLRGB_INVALID = 99,
++ AGLRGB_TRANSPARENT = 100
++ };
++ void ResolveRGB();
++};
++inline sal_uInt16 LwpColor::GetRed()
++{
++ return m_nRed;
++}
++inline sal_uInt16 LwpColor::GetGreen()
++{
++ return m_nGreen;
++}
++inline sal_uInt16 LwpColor::GetBlue()
++{
++ return m_nBlue;
++}
++inline BOOL LwpColor::IsValidColor()
++{
++ return ((m_nExtra!=AGLRGB_INVALID) && (m_nExtra!=AGLRGB_TRANSPARENT));
++}
++inline sal_Bool LwpColor::IsTransparent()
++{
++ return (m_nExtra==AGLRGB_TRANSPARENT);
++}
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpcontent.cxx lotuswordpro/source/filter/lwpcontent.cxx
+--- lotuswordpro.bak/source/filter/lwpcontent.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpcontent.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,154 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpstory.hxx"
++#include "lwpfilehdr.hxx"
++#include "lwpholder.hxx"
++
++LwpHeadContent::LwpHeadContent(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpContent(objHdr, pStrm)
++{}
++
++
++void LwpHeadContent::Read()
++{
++ LwpContent::Read();
++ m_pObjStrm->SkipExtra();
++}
++
++LwpContent::LwpContent(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpDLNFVList(objHdr, pStrm)
++{}
++void LwpContent::Read()
++{
++ LwpDLNFVList::Read();
++
++ LwpObjectStream* pStrm = m_pObjStrm;
++
++ m_LayoutsWithMe.Read(pStrm);
++ //sal_uInt16 nFlagsSkip;
++ //pStrm->QuickRead(&nFlagsSkip, sizeof(nFlagsSkip));
++ pStrm->QuickRead(&m_nFlags, sizeof(m_nFlags));
++ m_nFlags &= ~(CF_CHANGED | CF_DISABLEVALUECHECKING);
++ //LwpAtomHolder ClassName;
++ //ClassName.Read(pStrm);
++ m_ClassName.Read(pStrm);
++
++ LwpObjectID SkipID;
++ if(LwpFileHeader::m_nFileRevision >= 0x0006)
++ {
++ //SkipID.ReadIndexed(pStrm);
++ //SkipID.ReadIndexed(pStrm);
++ m_NextEnumerated.ReadIndexed(pStrm);
++ m_PreviousEnumerated.ReadIndexed(pStrm);
++ }
++
++ if (LwpFileHeader::m_nFileRevision >= 0x0007)
++ {
++ if(LwpFileHeader::m_nFileRevision < 0x000B)
++ {
++ SkipID.ReadIndexed(pStrm);
++ pStrm->SkipExtra();
++ }
++ else
++ {
++ sal_uInt8 HasNotify;
++ pStrm->QuickRead(&HasNotify, sizeof(HasNotify));
++ if(HasNotify)
++ {
++ SkipID.ReadIndexed(pStrm);
++ pStrm->SkipExtra();
++ }
++ }
++ }
++
++ pStrm->SkipExtra();
++}
++
++LwpVirtualLayout* LwpContent::GetLayout(LwpVirtualLayout* pStartLayout)
++{
++ return m_LayoutsWithMe.GetLayout(pStartLayout);
++}
++
++sal_Bool LwpContent::HasNonEmbeddedLayouts()
++{
++ LwpVirtualLayout* pLayout = NULL;
++ while(pLayout = GetLayout(pLayout))
++ {
++ if(!pLayout->NoContentReference())
++ return sal_True;
++ }
++ return sal_False;
++}
++
++sal_Bool LwpContent::IsStyleContent()
++{
++ LwpVirtualLayout* pLayout = NULL;
++ while(pLayout = GetLayout(pLayout))
++ {
++ if(pLayout->IsStyleLayout())
++ return sal_True;
++ }
++ return sal_False;
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpcontent.hxx lotuswordpro/source/filter/lwpcontent.hxx
+--- lotuswordpro.bak/source/filter/lwpcontent.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpcontent.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,158 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * LwpContent, LwpHeadContent: base class for Word Pro content object
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPCONTENT_HXX
++#define _LWPCONTENT_HXX
++
++#include "lwpheader.hxx"
++#include "lwpobj.hxx"
++#include "lwpatomholder.hxx"
++#include "lwplayout.hxx"
++#include "lwphyperlinkmgr.hxx"
++/**
++ * @brief
++ * Base class of all Lwp content objects
++ */
++class LwpContent : public LwpDLNFVList
++{
++public:
++ LwpContent(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpContent(){};
++protected:
++ LwpAssociatedLayouts m_LayoutsWithMe;
++ sal_uInt16 m_nFlags;
++ LwpAtomHolder m_ClassName;
++ LwpObjectID m_NextEnumerated;
++ LwpObjectID m_PreviousEnumerated;
++ /* Flag bits */
++ enum
++ {
++ CF_CHANGED = 0x0001,
++ CF_MODIFIED = 0x0004,
++ CF_LOCAL = 0x0008,
++ CF_INFOOTNOTE = 0x0010,
++ CF_METACHANGED = 0x0020,
++ CF_PRIVATE = 0x0040,
++ CF_DEACTIVATED = 0x0080,
++ CF_VALUECHANGED = 0x0100,
++ CF_DISABLEVALUECHECKING = 0x0200,
++ CF_DONTNOTIFYDOCUMENT = 0x0400, // for numeric formatting
++ CF_ISOVERRIDE = 0x0800,
++ CF_ISBULLET = 0x1000,
++ CF_CONTINUEDON = 0x2000,
++ CF_CONTINUEDFROM = 0x4000,
++
++ // Bits that should be transferred when we duplicate a content
++ CF_COPYMASK = (CF_MODIFIED | CF_PRIVATE)
++ };
++protected:
++ void Read();
++public:
++ inline LwpAssociatedLayouts* GetLayoutsWithMe();
++ LwpVirtualLayout* GetLayout(LwpVirtualLayout* pStartLayout);
++ inline sal_Bool IsActive();
++ virtual sal_Bool IsTable();
++ inline OUString GetClassName();
++ inline LwpContent* GetNextEnumerated();
++ sal_Bool HasNonEmbeddedLayouts();
++ sal_Bool IsStyleContent();
++};
++
++LwpAssociatedLayouts* LwpContent::GetLayoutsWithMe()
++{
++ return &m_LayoutsWithMe;
++}
++
++inline sal_Bool LwpContent::IsActive()
++{
++ return !(m_nFlags & CF_DEACTIVATED);
++}
++
++inline sal_Bool LwpContent::IsTable()
++{
++ return sal_False;
++}
++
++inline OUString LwpContent::GetClassName()
++{
++ return m_ClassName.str();
++}
++
++inline LwpContent* LwpContent::GetNextEnumerated()
++{
++ return static_cast<LwpContent*>(m_NextEnumerated.obj());
++}
++/**
++ * @brief
++ * Head object of content list
++ */
++class LwpHeadContent : public LwpContent
++{
++public:
++ LwpHeadContent(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpHeadContent(){};
++protected:
++ void Read();
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpdefobj.cxx lotuswordpro/source/filter/lwpdefobj.cxx
+--- lotuswordpro.bak/source/filter/lwpdefobj.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdefobj.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,88 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpdefobj.hxx"
++
++LwpDefaultObject::LwpDefaultObject(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ :LwpObject(objHdr, pStrm),m_DataBuffer(NULL)
++{}
++
++LwpDefaultObject::~LwpDefaultObject()
++{
++ if(m_DataBuffer)
++ {
++ delete [] m_DataBuffer;
++ m_DataBuffer = NULL;
++ }
++}
++
++void LwpDefaultObject::Read()
++{
++ if(m_DataBuffer)
++ {
++ delete [] m_DataBuffer;
++ m_DataBuffer = NULL;
++ }
++ m_DataBuffer = new sal_uInt8[m_ObjHdr.GetSize()];
++ m_pObjStrm->QuickRead(m_DataBuffer, m_ObjHdr.GetSize());
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpdefobj.hxx lotuswordpro/source/filter/lwpdefobj.hxx
+--- lotuswordpro.bak/source/filter/lwpdefobj.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdefobj.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,81 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef LWPDEFAULTOBJECT_HXX_
++#define LWPDEFAULTOBJECT_HXX_
++
++#include "lwpobj.hxx"
++#include "lwpheader.hxx"
++
++class LwpDefaultObject : public LwpObject
++{
++public:
++ LwpDefaultObject(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpDefaultObject();
++private:
++ sal_uInt8 *m_DataBuffer;
++public:
++ //inline sal_uInt8* GetBuffer(){return m_DataBuffer;}
++ void Read();
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpdefs.hxx lotuswordpro/source/filter/lwpdefs.hxx
+--- lotuswordpro.bak/source/filter/lwpdefs.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdefs.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,423 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * definitions for all object types VO_TYPE
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPDEFS_HXX
++#define _LWPDEFS_HXX
++
++#define BAD_OFFSET 0xFFFFFFFFUL
++#define BAD_ATOM ((sal_Int32)(-1)) // Invalid Atom ID
++
++//Please remove the item from the commented defines after you add the tag to the following enum.
++enum VO_TYPE
++{
++ VO_PARA = 0,
++ VO_DOCUMENT = 5,
++ VO_STORY = 13,
++ VO_VERQTR = 40,
++ VO_HEADCONTENT = 47,
++ VO_HEADLAYOUT = 142,
++ VO_PAGELAYOUT = 143,
++ VO_DOCSOCK = 155,
++ VO_DIVISIONINFO = 7,
++ VO_HEADHOLDER = 90,
++ VO_DIVOPTS = 176,
++ VO_DOCDATA = 137,
++ VO_HEADERLAYOUT = 139,
++ VO_FOOTERLAYOUT = 140,
++ VO_FRAMELAYOUT = 141,
++ VO_TOCSUPERTABLELAYOUT = 149,
++ VO_TOCLEVELDATA = 171,
++ VO_LAYOUTGEOMETRY = 185,
++ VO_LAYOUTSCALE = 186,
++ VO_LAYOUTMARGINS = 187,
++ VO_LAYOUTCOLUMNS = 188,
++ VO_LAYOUTBORDERSTUFF = 189,
++ VO_LAYOUTGUTTERSTUFF = 190,
++ VO_LAYOUTBACKGROUNDSTUFF = 191,
++ VO_LAYOUTJOINSTUFF = 192,
++ VO_LAYOUTSHADOW = 193,
++ VO_LAYOUTNUMERICS = 194,
++ VO_LAYOUTRELATIVITY = 195,
++ VO_LAYOUTEXTERNALBORDERSTUFF = 219,
++ VO_GRAPHIC = 41,
++ VO_VERGTR = 205,
++
++ // 01/12/2005
++ VO_PARASTYLE = 23,
++ VO_CHARACTERSTYLE = 106,
++ VO_SILVERBULLET = 127,
++ VO_ALIGNMENTPIECE = 196,
++ VO_INDENTPIECE = 197,
++ VO_SPACINGPIECE = 199,
++ VO_CHARBORDERPIECE = 202,
++ VO_AMIKAKEPIECE = 203,
++ // end
++
++ // start
++ VO_TABRACK = 38,
++ VO_PARABORDERPIECE = 198,
++ VO_BREAKSPIECE = 200,
++ VO_NUMBERINGPIECE = 201,
++ VO_TABPIECE = 204,
++ VO_PARABACKGROUNDPIECE = 218,
++ // end
++ // 02/01/2005
++ VO_SECTION = 136,
++ VO_INDEXSECTION = 48,
++ VO_HEADTAILHOLDER = 169,
++ VO_PAGEHINT = 10,
++ VO_OBJECTHOLDER = 98,
++ VO_POBJECTHOLDER = 133,
++ // added for OLE
++ VO_OLEOBJECT = 54,
++ // end OLE
++
++ // added for table
++ VO_TABLE = 17,
++ VO_CELLLAYOUT = 18,
++ VO_SUPERTABLELAYOUT = 109,
++ VO_TABLELAYOUT = 31,
++ VO_SUPERTABLE = 115,
++ VO_ROWLAYOUT = 32,
++ VO_ROWLIST = 76,
++ VO_CELLLIST = 74,
++ VO_NUMERICVALUE = 123,
++ VO_FORMULAINFO = 82,
++ VO_COLUMNLAYOUT = 35,
++ VO_TABLERANGE = 66,
++ VO_CELLRANGE = 67,
++ VO_FOLDER = 75,
++ VO_DEPENDENT = 77,
++ VO_CONNECTEDCELLLAYOUT = 28,
++ VO_HIDDENCELLLAYOUT = 29,
++ VO_TABLEHEADINGLAYOUT = 117,
++ VO_ROWHEADINGLAYOUT = 118,
++ VO_TABLEHEADING = 209,
++ VO_TABLEHINT = 19,
++ // end table
++
++ //add by
++ VO_DROPCAPLAYOUT = 217,
++ VO_CHBLKMARKER = 94,
++ VO_PROPLIST = 165,
++ VO_BOOKMARK = 64,
++ VO_FIELDMARKER = 87,
++ //add end
++
++ //for footnote
++ VO_FOOTNOTE = 53,
++ VO_FOOTNOTEOPTS = 177,
++ VO_FOOTNOTELAYOUT = 65,
++ VO_FNROWLAYOUT = 59,
++ VO_FNCELLLAYOUT = 61,
++ VO_ENDNOTELAYOUT = 138,
++ VO_ENSUPERTABLELAYOUT = 113,
++ VO_FNSUPERTABLELAYOUT = 111,
++ VO_FOOTNOTETABLE = 58,
++ VO_CONTONLAYOUT = 145,
++ VO_CONTFROMLAYOUT = 146,
++
++ //for frame group
++ VO_GROUPLAYOUT = 108,
++ VO_GROUPFRAME = 173,
++
++ //For index manager
++ VO_ROOTLEAFOBJINDEX = 0xFFFB, // Root Index with no kids
++ VO_ROOTOBJINDEX = 0xFFFC, // Root Index with kids
++
++ //Add new type of index
++ VO_OBJINDEX = 0xFFFD, // Obj Index with kids
++
++ VO_LEAFOBJINDEX = 0xFFFE , // Leaf Index
++
++ VO_LISTLIST = 100,
++
++ //For comment notes
++ VO_NOTELAYOUT = 159,
++ VO_NOTEHEADERLAYOUT = 178,
++ VO_NOTETEXTLAYOUT = 166,
++ VO_VPLAYOUT = 132,
++
++ // for parallel column
++ VO_SUPERPARALLELCOLUMNLAYOUT = 174,
++ VO_PCOLLAYOUT = 206,
++ VO_PCOLBLOCK = 207,
++ VO_PARALLELCOLUMNS = 163,
++
++ //for ruby mark
++ VO_RUBYMARKER = 179,
++ VO_RUBYLAYOUT = 180,
++
++ VO_GLOSSARY = 157,
++ VO_SUPERGLOSSARYLAYOUT = 175,
++ //for default tab distance
++ VO_VERDOCUMENT = 161,
++
++
++ //The last one
++ VO_INVALID = -1
++};
++
++/*
++ static const VO_OBJINDEX = 0xFFFD ; // Intermediate Level Index
++*/
++/*
++#define VO_LAYOUT 1
++#define VO_NOTIFY 2
++#define VO_LINE 3
++#define VO_PRESENT 4
++#define VO_PAGECONTAINER 6
++#define VO_COLUMN 8
++#define VO_CELLGADGET 9
++#define VO_PAGEHINT 10
++#define VO_PANE 11
++#define VO_SUBPAGECONTAINER 12
++#define VO_TABSEG 14
++#define VO_FRAMECONTAINER 15
++#define VO_LINEHINT 16
++#define VO_TABLE 17
++#define VO_CELLLAYOUT 18
++#define VO_TABLEHINT 19
++#define VO_CELLCONTAINER 20
++#define VO_TABLECONTAINER 21
++#define VO_ROWCONTAINER 22
++
++#define VO_COVERCELLCONTAINER 24
++#define VO_HIDDENCELLCONTAINER 25
++#define VO_SPACESHAPE 26
++#define VO_TABLEHEADINGCONTAINER 27
++#define VO_CONNECTEDCELLLAYOUT 28
++#define VO_HIDDENCELLLAYOUT 29
++#define VO_SUPERLINE 30
++#define VO_TABLELAYOUT 31
++#define VO_ROWLAYOUT 32
++#define VO_TABLEROWCACHE 33
++#define VO_TABLECOLUMNCACHE 34
++#define VO_COLUMNLAYOUT 35
++#define VO_HANDLENODE 36
++#define VO_FORMATLISTNODE 37
++
++#define VO_TEMPPAGEHINT 39
++
++#define VO_COLLAPSEGADGET 42
++#define VO_PERMISSIVELAYOUT 43
++#define VO_ELEVATORGADGET 44
++#define VO_STORYMARKER 45
++#define VO_HEADCONTAINER 46
++
++
++#define VO_NAMEDOUTLINESEQ 49
++#define VO_VIEWPORTCONTAINER 50
++#define VO_PRESENTATIONINFO 51
++#define VO_OBJECTINDEX 52
++
++#define VO_OLEOBJECT 54
++#define VO_FOOTNOTECONTAINER 55
++#define VO_LITTLEPAGEGADGET 56
++#define VO_OUTLINEBUTTONGADGET 57
++
++#define VO_FNROWLAYOUT 59
++#define VO_FNROWCONTAINER 60
++#define VO_FNCELLLAYOUT 61
++#define VO_FNCELLCONTAINER 62
++#define VO_3DBUTTONGADGET 63
++#define VO_BOOKMARK 64
++
++#define VO_TABLERANGE 66
++#define VO_CELLRANGE 67
++#define VO_REVLINEGADGET 68
++#define VO_REVCHARGADGET 69
++#define VO_SCROLLBUTTONGADGET 70
++#define VO_VSCROLLBARGADGET 71
++#define VO_HSCROLLBARGADGET 72
++#define VO_SCROLLBARGADGET 73
++#define VO_CELLLIST 74
++#define VO_FOLDER 75
++#define VO_ROWLIST 76
++#define VO_DEPENDENT 77
++#define VO_NUMBERHINT 78
++#define VO_MARKER 79
++#define VO_NOTEGADGET 80
++#define VO_DDELINK 81
++#define VO_FORMULAINFO 82
++#define VO_THUMBGADGET 83
++#define VO_GHOSTTHUMBGADGET 84
++#define VO_BOOKMARKGADGET 85
++#define VO_LINKGADGET 86
++
++#define VO_CHECKPOINT 88
++#define VO_STORYCHECKPOINT 89
++
++#define VO_TABLEMARKER 91
++#define VO_TABLECHECKPOINT 92
++#define VO_FOOTNOTELISTLIST 93
++#define VO_CHBLKMARKER 94
++#define VO_ROWGADGET 95
++#define VO_COLUMNGADGET 96
++#define VO_CORNERGADGET 97
++
++#define VO_GRAPHICOLECHECKPOINT 99
++
++#define VO_DEMANDLOADER 101
++#define VO_COLUMNSIZEGADGET 102
++#define VO_ROWSIZEGADGET 103
++#define VO_CELLMOVEGADGET 104
++#define VO_CELLSELECTIONGADGET 105
++#define VO_CHARACTERSTYLE 106
++#define VO_GROUPCONTAINER 107
++
++#define VO_SUPERTABLELAYOUT 109
++#define VO_SUPERTABLECONTAINER 110
++
++#define VO_FNSUPERTABLECONTAINER 112
++
++#define VO_ENSUPERTABLECONTAINER 114
++#define VO_SUPERTABLE 115
++#define VO_ROWCOLUMNSIZEGADGET 116
++#define VO_TABLEHEADINGLAYOUT 117
++#define VO_ROWHEADINGLAYOUT 118
++#define VO_TOMBSTONE 119
++#define VO_CAPTION 120
++#define VO_VERCONTROL 121
++#define VO_ANCHORGADGET 122
++#define VO_NUMERICVALUE 123
++#define VO_TEXTVALUE 124
++#define VO_REFERENCEVALUE 125
++#define VO_DLTREENODE 126
++
++#define VO_PARADATAHOLDER 128
++#define VO_NOTIFYPERSISTENT 129
++#define VO_TYPVERCONTROL 130
++#define VO_USRVERCONTROL 131
++#define VO_POBJECTHOLDER 133
++#define VO_CELLNUMBERHINT 134
++#define VO_STXINFO 135 // SmarText object
++
++
++
++
++
++
++
++#define VO_MARKERLIST 144
++
++#define VO_NAMEDVERCONTROL 147
++#define VO_DIRTBAG 148
++
++#define VO_OBJPTRHOLDER 150
++#define VO_COLUMNWIDTHCACHE 151
++#define VO_NOTIFYLISTHOLDER 152
++#define VO_OBJECTHOLDERNV 153
++#define VO_BASELINEGADGET 154
++
++#define VO_DLVOLISTHEADHOLDER 156
++#define VO_DELETEDTEXTGADGET 158
++
++#define VO_FOOTNOTESEEN 160
++
++#define VO_OUTLINESEQITEM 162
++
++#define VO_CHBGADGET 164
++#define VO_PROPLIST 165
++#define VO_STXMANAGER 167 // SmarText object
++#define VO_STXLINK 168 // SmarText object
++
++#define VO_VERPTR 170
++
++#define VO_VERDOCINFO 172
++
++
++#ifdef RUBY
++
++#define VO_RUBYGADGET 181
++#endif
++#define VO_OLEGADGET 182
++#define VO_AMIASWPSEUDOOBJHOLDER 183
++#define VO_LONGHOLDER 184
++
++
++#define VO_REVA_MAXTYPES 186
++
++
++
++#define VO_CONNECTEDBLOCK 208
++#define VO_TABLEHEADING 209
++#define VO_BOOKMARKMARKERLIST 210
++#define VO_FIELDMARKERLIST 211
++#define VO_CHBMARKERLIST 212
++#define VO_DDEMARKERLIST 213
++#define VO_RUBYMARKERLIST 214
++#ifdef RUBY
++#define VO_RUBYMARKERGADGET 215
++#endif
++#define VO_DROPCAPCONTAINER 216
++
++
++
++#define VO_LAYOUTEXTERNALJOINSTUFF 220
++
++
++#define VO_OBJINDEX 0xFFFD // Intermediate Level Index
++*/
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpdivinfo.cxx lotuswordpro/source/filter/lwpdivinfo.cxx
+--- lotuswordpro.bak/source/filter/lwpdivinfo.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdivinfo.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,174 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpdivinfo.hxx"
++#include "lwpobjstrm.hxx"
++#include "lwpfilehdr.hxx"
++#include "lwpholder.hxx"
++#include "lwppagehint.hxx"
++
++LwpDivInfo::LwpDivInfo(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpObject(objHdr, pStrm)
++{}
++
++LwpDivInfo::~LwpDivInfo(){}
++
++void LwpDivInfo::Read()
++{
++
++ SkipFront();
++ m_ParentID.ReadIndexed(m_pObjStrm);
++ if (LwpFileHeader::m_nFileRevision < 0x0006)
++ {
++ m_pObjStrm->SkipExtra();
++ }
++ m_Name.Read(m_pObjStrm);
++ if (LwpFileHeader::m_nFileRevision < 0x0006)
++ {
++ m_pObjStrm->SkipExtra();
++ }
++
++ m_LayoutID.ReadIndexed(m_pObjStrm);
++ m_pObjStrm->QuickRead(&m_nFlags, sizeof(m_nFlags));
++ if (LwpFileHeader::m_nFileRevision < 0x0010) // In 98, graphic links count too
++ {
++ if ((m_nFlags & DI_ANYOLEDDELINKS) == 0)
++ m_nFlags &= ~DI_KNOWIFANYOLEDDELINKS;
++ }
++
++ m_ExternalName.Read(m_pObjStrm);
++ m_ExternalType.Read(m_pObjStrm);
++ m_ClassName.Read(m_pObjStrm);
++ m_InitialLayoutID.ReadIndexed(m_pObjStrm);
++
++ m_pObjStrm->QuickRead(&m_nPageNoStyle, sizeof(m_nPageNoStyle));
++ m_TabColor.Read(m_pObjStrm);
++
++ // read filler page stuff
++ m_FillerPageTextID.ReadIndexed(m_pObjStrm);
++
++ // read external file object stuff
++ sal_uInt16 type;
++ m_pObjStrm->QuickRead(&type, sizeof(type));
++ //cpExternalFile = LNULL;
++
++ assert(type==0);
++ m_pObjStrm->SkipExtra();
++
++}
++
++void LwpDivInfo::SkipFront()
++{
++ LwpObjectID toSkip;
++
++ toSkip.ReadIndexed(m_pObjStrm); // skip ListNext;
++ if (LwpFileHeader::m_nFileRevision < 0x0006)
++ {
++ m_pObjStrm->SkipExtra();
++ }
++ toSkip.ReadIndexed(m_pObjStrm); // skip ListPrevious;
++ if (LwpFileHeader::m_nFileRevision < 0x0006)
++ {
++ m_pObjStrm->SkipExtra();
++ }
++ toSkip.ReadIndexed(m_pObjStrm); // skip Head;
++ if (LwpFileHeader::m_nFileRevision < 0x0006)
++ {
++ toSkip.ReadIndexed(m_pObjStrm); //skip tail
++ m_pObjStrm->SkipExtra();
++ }
++}
++
++void LwpDivInfo::GetNumberOfPages(sal_uInt16 & nPageno)
++{
++ if(IsGotoable())
++ {
++ if (IsOleDivision())
++ {
++ //not support now
++ return;
++ }
++ else
++ {
++ nPageno += GetMaxNumberOfPages();
++ }
++ }
++}
++
++sal_uInt16 LwpDivInfo::GetMaxNumberOfPages()
++{
++ LwpDocument* pDiv = GetDivision();
++ if(!pDiv)
++ return 0;
++ LwpDLVListHeadTailHolder* pHeadTail = static_cast<LwpDLVListHeadTailHolder*>(pDiv->GetPageHintsID()->obj());
++ if(pHeadTail)
++ {
++ LwpPageHint* pPageHint =static_cast<LwpPageHint*>(pHeadTail->GetTail()->obj());
++ if(pPageHint && !pPageHint->GetPageLayoutID()->IsNull())
++ {
++ return pPageHint->GetPageNumber();
++ }
++ }
++
++ return 0;
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpdivinfo.hxx lotuswordpro/source/filter/lwpdivinfo.hxx
+--- lotuswordpro.bak/source/filter/lwpdivinfo.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdivinfo.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,166 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPDIVINFO_HXX
++#define _LWPDIVINFO_HXX
++
++#include "lwpobj.hxx"
++#include "lwpobjid.hxx"
++#include "lwpatomholder.hxx"
++#include "lwpcolor.hxx"
++#include "lwpheader.hxx"
++#include "lwpdoc.hxx"
++
++#define STR_OleDivisionClassName "OLEDivision"
++
++
++class LwpDivInfo : public LwpObject
++{
++public:
++ LwpDivInfo(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ ~LwpDivInfo();
++ LwpObjectID* GetInitialLayoutID(){ return &m_InitialLayoutID;}
++ LwpObjectID* GetFillerPageTextID(){ return &m_FillerPageTextID;}
++ // add by ,03/14/2004
++ rtl::OUString GetDivName() { return m_Name.str(); }
++ // end add
++
++ rtl::OUString GetClassName() { return m_ClassName.str(); }
++ inline sal_Bool HasContents();
++ inline sal_Bool IsOleDivision();
++ inline sal_Bool IsScrollable();
++ inline sal_Bool IsGotoable();
++ inline LwpDocument* GetDivision();
++ void GetNumberOfPages(sal_uInt16& nPageno);
++ sal_uInt16 GetMaxNumberOfPages();
++ LwpAtomHolder* GetExternalName(){return &m_ExternalName;};
++protected:
++ void Read();
++private:
++ LwpObjectID m_ParentID;
++ LwpAtomHolder m_Name;
++ LwpObjectID m_LayoutID;
++ sal_uInt16 m_nFlags;
++ LwpAtomHolder m_ExternalName;
++ LwpAtomHolder m_ExternalType;
++ LwpAtomHolder m_ClassName;
++ LwpObjectID m_InitialLayoutID;
++ //pCDLVOListHeadHolder cPresInfo;
++
++ sal_uInt16 m_nPageNoStyle;
++ LwpColor m_TabColor;
++ LwpObjectID m_FillerPageTextID;
++
++ enum
++ {
++ DI_SCROLLABLE = 0x01,
++ DI_HASCONTENTS = 0x02,
++ DI_EXPANDED = 0x04,
++ DI_SHOWSTAB = 0x08,
++
++ DI_MUDPUPPY = 0x10,
++ DI_NOTDELETABLE = 0x20,
++ DI_BEGINGROUP = 0x40,
++ DI_GROUP = 0x80,
++
++ DI_ENDGROUP = 0x100,
++ DI_SUPPRESS_FILLER_PAGE_HEADERS = 0x200,
++ DI_EXTERNALFILE = 0x400,
++ DI_FIXED = 0x800,
++
++ DI_KNOWIFANYOLEDDELINKS = 0x1000,
++ DI_ANYOLEDDELINKS = 0x2000
++ };
++
++ void SkipFront();
++
++};
++
++inline sal_Bool LwpDivInfo::HasContents()
++{
++ return (m_nFlags & DI_HASCONTENTS) ? sal_True : sal_False;
++}
++
++inline sal_Bool LwpDivInfo::IsOleDivision()
++{
++ OUString strClassName = GetClassName();
++ if (strClassName.equals(A2OUSTR(STR_OleDivisionClassName)))
++ return sal_True;
++ return sal_False;
++}
++
++inline sal_Bool LwpDivInfo::IsScrollable()
++{
++ return (m_nFlags & DI_SCROLLABLE) ? sal_True : sal_False;
++}
++
++inline sal_Bool LwpDivInfo::IsGotoable()
++{
++ return HasContents() && (IsScrollable() || IsOleDivision());
++}
++
++inline LwpDocument* LwpDivInfo::GetDivision()
++{
++ return static_cast<LwpDocument*>(m_ParentID.obj());
++}
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpdivopts.cxx lotuswordpro/source/filter/lwpdivopts.cxx
+--- lotuswordpro.bak/source/filter/lwpdivopts.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdivopts.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,135 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpdivopts.hxx"
++#include "lwpfilehdr.hxx"
++
++LwpHyphenOptions::LwpHyphenOptions()
++{}
++
++LwpHyphenOptions::~LwpHyphenOptions()
++{}
++
++void LwpHyphenOptions::Read(LwpObjectStream *pStrm)
++{
++ pStrm->QuickRead(&m_nFlags, sizeof(m_nFlags));
++ pStrm->QuickRead(&m_nZoneBefore, sizeof(m_nZoneBefore));
++ pStrm->QuickRead(&m_nZoneAfter, sizeof(m_nZoneAfter));
++ pStrm->QuickRead(&m_nMaxLines, sizeof(m_nMaxLines));
++ pStrm->SkipExtra();
++}
++
++
++
++LwpTextLanguage::LwpTextLanguage(){};
++LwpTextLanguage::~LwpTextLanguage(){}
++
++void LwpTextLanguage::Read(LwpObjectStream *pStrm)
++{
++ pStrm->QuickRead(&m_nLanguage, sizeof(m_nLanguage));
++ pStrm->SkipExtra();
++
++ if( LwpFileHeader::m_nFileRevision <= 0x0a)
++ m_nLanguage = ConvertFrom96(m_nLanguage);
++}
++
++sal_uInt16 LwpTextLanguage::ConvertFrom96(sal_uInt16 orgLang)
++{
++ // Reading a Word Pro 96 into Word Pro 97
++ switch (orgLang)
++ {
++ case 0x2809U: // AMI_MEDICAL 96
++ orgLang = 0x8409U; //0x8409U 97
++ break;
++ case 0x2C09U: // AMI_BRMEDICAL 96
++ orgLang = 0x8809U; // 0x8809U 97
++ break;
++ case 0x3409U: // AMI_BRITISHMEDIZE 96
++ orgLang = 0x8C09U; // 0x8C09U 97
++ break;
++ case 0x3009U: // AMI_BRITISHIZE 96
++ orgLang = 0x1009U; // 0x1009U 97
++ break;
++ case 0x819U: // AMI_RUSSIANIO 96
++ orgLang = 0x8419U; // 0x8419U 97
++ break;
++ }
++ return orgLang;
++}
++
++LwpDivisionOptions::LwpDivisionOptions(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpObject(objHdr, pStrm)
++{}
++
++LwpDivisionOptions::~LwpDivisionOptions()
++{}
++
++void LwpDivisionOptions::Read()
++{
++ m_HyphOpts.Read(m_pObjStrm);
++ m_pObjStrm->QuickRead(&m_nOptionFlag, sizeof(m_nOptionFlag));
++ m_Lang.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++
++
+diff -urNp lotuswordpro.bak/source/filter/lwpdivopts.hxx lotuswordpro/source/filter/lwpdivopts.hxx
+--- lotuswordpro.bak/source/filter/lwpdivopts.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdivopts.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,120 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPDIVISIONOPTIONS_HXX
++#define _LWPDIVISIONOPTIONS_HXX
++
++#include "lwpobj.hxx"
++#include "lwpobjid.hxx"
++#include "lwpatomholder.hxx"
++#include "lwpcolor.hxx"
++#include "lwpheader.hxx"
++
++class LwpHyphenOptions
++{
++public:
++ LwpHyphenOptions();
++ ~LwpHyphenOptions();
++ void Read(LwpObjectStream *pStrm);
++private:
++ sal_uInt16 m_nFlags;
++ sal_uInt16 m_nZoneBefore;
++ sal_uInt16 m_nZoneAfter;
++ sal_uInt16 m_nMaxLines;
++};
++
++
++/*
++Text languange.
++This class which holds identifiers for language and dialect.
++DESCRIPTION You can mark text as being a certain language. When we spell
++ check or grammar check we'll use this info to determine which dictionary
++ to use.
++ The only reserved value is 0, which means "default language". The
++ default language is specified by the document.
++*/
++class LwpTextLanguage
++{
++public:
++ LwpTextLanguage();
++ ~LwpTextLanguage();
++ void Read(LwpObjectStream *pStrm);
++private:
++ sal_uInt16 ConvertFrom96(sal_uInt16 orgLang);
++ sal_uInt16 m_nLanguage;
++};
++
++
++class LwpDivisionOptions : public LwpObject
++{
++public:
++ LwpDivisionOptions(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ ~LwpDivisionOptions();
++protected:
++ void Read();
++private:
++ LwpHyphenOptions m_HyphOpts;
++ sal_uInt16 m_nOptionFlag;
++ LwpTextLanguage m_Lang;
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpdllist.cxx lotuswordpro/source/filter/lwpdllist.cxx
+--- lotuswordpro.bak/source/filter/lwpdllist.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdllist.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,99 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * double linked class implementation
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpdllist.hxx"
++
++LwpDLList::LwpDLList(LwpDLList* Next, LwpDLList* Previous)
++{
++ insert(Next, Previous);
++}
++
++LwpDLList::LwpDLList(void)
++{
++ m_pNext = m_pPrevious = NULL;
++}
++
++void
++LwpDLList::insert(LwpDLList* Next,LwpDLList* Previous)
++{
++ if (Next)
++ Next->SetPrevious(this);
++ if (Previous)
++ Previous->SetNext(this);
++ m_pNext = Next;
++ m_pPrevious = Previous;
++}
++
++LwpDLList::~LwpDLList(void)
++{
++ remove();
++}
++
++void LwpDLList::remove()
++{
++ /* fix up other links */
++ if(m_pPrevious)
++ m_pPrevious->SetNext(m_pNext);
++ if(m_pNext)
++ m_pNext->SetPrevious(m_pPrevious);
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpdllist.hxx lotuswordpro/source/filter/lwpdllist.hxx
+--- lotuswordpro.bak/source/filter/lwpdllist.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdllist.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,104 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * double linked list
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPDLLIST_HXX_
++#define _LWPDLLIST_HXX_
++#include "lwpheader.hxx"
++class LwpDLList
++{
++public:
++ LwpDLList(LwpDLList*,LwpDLList*);
++ LwpDLList(void);
++ virtual ~LwpDLList();
++ void insert(LwpDLList*, LwpDLList*);
++ void remove(void);
++ LwpDLList* GetNext(void);
++ LwpDLList* GetPrevious(void);
++ void SetNext(LwpDLList*);
++ void SetPrevious(LwpDLList*);
++private:
++ LwpDLList* m_pNext;
++ LwpDLList* m_pPrevious;
++};
++
++inline LwpDLList* LwpDLList::GetNext(void)
++{
++ return m_pNext;
++}
++
++inline void LwpDLList::SetNext(LwpDLList* Next)
++{
++ m_pNext = Next;
++}
++
++inline LwpDLList* LwpDLList::GetPrevious(void)
++{
++ return m_pPrevious;
++}
++
++inline void LwpDLList::SetPrevious(LwpDLList* Previous)
++{
++ m_pPrevious = Previous;
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpdlvlist.cxx lotuswordpro/source/filter/lwpdlvlist.cxx
+--- lotuswordpro.bak/source/filter/lwpdlvlist.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdlvlist.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,185 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * list class implementation
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpdlvlist.hxx"
++#include "lwpfilehdr.hxx"
++#include "lwpproplist.hxx"
++
++LwpDLVList::LwpDLVList(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpObject(objHdr, pStrm)
++{}
++/**
++ * @descr Read LwpDLVList data from object stream
++ **/
++void LwpDLVList::Read()
++{
++ LwpObjectStream* pObjStrm = m_pObjStrm;
++ m_ListNext.ReadIndexed(pObjStrm);
++ if( LwpFileHeader::m_nFileRevision < 0x0006 )
++ pObjStrm->SkipExtra();
++
++ m_ListPrevious.ReadIndexed(pObjStrm);
++ if( LwpFileHeader::m_nFileRevision < 0x0006 )
++ pObjStrm->SkipExtra();
++
++}
++LwpDLNFVList::LwpDLNFVList(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpDLVList(objHdr, pStrm)
++{}
++/**
++ * @descr Read LwpDLNFVList data from object stream
++ **/
++void LwpDLNFVList::Read()
++{
++ LwpDLVList::Read();
++
++ LwpObjectStream* pObjStrm = m_pObjStrm;
++
++ m_ChildHead.ReadIndexed(pObjStrm);
++ if( LwpFileHeader::m_nFileRevision < 0x0006 || !m_ChildHead.IsNull() )
++ m_ChildTail.ReadIndexed(pObjStrm);
++ if( LwpFileHeader::m_nFileRevision < 0x0006 )
++ pObjStrm->SkipExtra();
++
++ m_Parent.ReadIndexed(pObjStrm);
++ if( LwpFileHeader::m_nFileRevision < 0x0006 )
++ pObjStrm->SkipExtra();
++
++ ReadName(pObjStrm);
++}
++/**
++ * @descr Read name of LwpDLNFVList from object stream
++ **/
++void LwpDLNFVList::ReadName(LwpObjectStream* pObjStrm)
++{
++ m_Name.Read(pObjStrm);
++ if( LwpFileHeader::m_nFileRevision < 0x0006 )
++ pObjStrm->SkipExtra();
++}
++/**
++ * @descr ctor of LwpDLNFPVList from object stream
++ * Note that m_bHasProperties is initialized to true
++ **/
++LwpDLNFPVList::LwpDLNFPVList(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpDLNFVList(objHdr, pStrm),
++ m_bHasProperties(sal_True),m_pPropList(NULL)
++{}
++/**
++ * @descr Read name of LwpDLNFVList from object stream
++ **/
++void LwpDLNFPVList::Read()
++{
++ LwpDLNFVList::Read();
++
++ LwpObjectStream* pObjStrm = m_pObjStrm;
++ ReadPropertyList(pObjStrm);
++ pObjStrm->SkipExtra();
++}
++/**
++ * @descr Read property list
++ **/
++void LwpDLNFPVList::ReadPropertyList(LwpObjectStream* pObjStrm)
++{
++ if( LwpFileHeader::m_nFileRevision >= 0x0000B)
++ {
++ pObjStrm->QuickRead(&m_bHasProperties, sizeof(m_bHasProperties));
++ if (m_bHasProperties)
++ {
++ m_pPropList = new LwpPropList;
++ m_pPropList->Read(pObjStrm);
++ }
++ }
++}
++/**
++ * @descr release property list
++ **/
++LwpDLNFPVList::~LwpDLNFPVList()
++{
++ if(m_pPropList)
++ {
++ delete m_pPropList;
++ }
++}
++
++/**
++ * @descr Read head id and tail id
++ **/
++void LwpDLVListHeadTail::Read(LwpObjectStream* pObjStrm)
++{
++ m_ListHead.ReadIndexed(pObjStrm);
++ if( (LwpFileHeader::m_nFileRevision < 0x0006) || !m_ListHead.IsNull())
++ {
++ m_ListTail.ReadIndexed(pObjStrm);
++ }
++ if( LwpFileHeader::m_nFileRevision < 0x0006)
++ {
++ pObjStrm->SkipExtra();
++ }
++}
++/**
++ * @descr Read head id
++ **/
++void LwpDLVListHead::Read(LwpObjectStream* pObjStrm)
++{
++ m_objHead.ReadIndexed(pObjStrm);
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpdlvlist.hxx lotuswordpro/source/filter/lwpdlvlist.hxx
+--- lotuswordpro.bak/source/filter/lwpdlvlist.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdlvlist.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,205 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * list related class
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef LWPDLVLIST_HXX_
++#define LWPDLVLIST_HXX_
++
++#include "lwpatomholder.hxx"
++#include "lwpobj.hxx"
++/**
++ * @brief Double Linked Virtual List
++*/
++class LwpDLVList : public LwpObject
++{
++public:
++ LwpDLVList(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpDLVList(){};
++protected:
++ LwpObjectID m_ListPrevious;
++ LwpObjectID m_ListNext;
++protected:
++ void Read();
++public:
++ inline LwpObjectID* GetNext();
++ inline LwpObjectID* GetPrevious();
++};
++LwpObjectID* LwpDLVList::GetNext()
++{
++ return &m_ListNext;
++}
++LwpObjectID* LwpDLVList::GetPrevious()
++{
++ return &m_ListPrevious;
++}
++/**
++ * @brief Double Linked Named Family Virtual List
++*/
++class LwpDLNFVList : public LwpDLVList
++{
++public:
++ LwpDLNFVList(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpDLNFVList(){};
++protected:
++ LwpObjectID m_ChildHead;
++ LwpObjectID m_ChildTail;
++ LwpObjectID m_Parent;
++ LwpAtomHolder m_Name;
++protected:
++ void Read();
++ void ReadName(LwpObjectStream* pObjStrm);
++public:
++ // 01/17/2005
++ inline LwpAtomHolder* GetName();
++ //end
++ inline LwpObjectID* GetChildHead();
++ inline LwpObjectID* GetChildTail();
++ inline LwpObjectID* GetParent();
++};
++
++LwpAtomHolder* LwpDLNFVList::GetName()
++{
++ return &m_Name;
++}
++
++LwpObjectID* LwpDLNFVList::GetChildHead()
++{
++ return &m_ChildHead;
++}
++
++LwpObjectID* LwpDLNFVList::GetChildTail()
++{
++ return &m_ChildTail;
++}
++
++LwpObjectID* LwpDLNFVList::GetParent()
++{
++ return &m_Parent;
++}
++
++class LwpPropList;
++/**
++ * @brief Double Linked Named Family Properties Virtual List
++*/
++class LwpDLNFPVList : public LwpDLNFVList
++{
++public:
++ LwpDLNFPVList(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpDLNFPVList();
++protected:
++ sal_Bool m_bHasProperties;
++ LwpPropList* m_pPropList;
++protected:
++ void Read();
++ void ReadPropertyList(LwpObjectStream* pObjStrm);
++public:
++ inline LwpPropList* GetPropList();
++};
++
++LwpPropList* LwpDLNFPVList::GetPropList()
++{
++ return m_pPropList;
++}
++
++/**
++ * @brief Double Linked Virtual List Head Tail
++*/
++class LwpDLVListHeadTail
++{
++public:
++ LwpDLVListHeadTail(){};
++ void Read(LwpObjectStream* pObjStrm);
++private:
++ LwpObjectID m_ListHead;
++ LwpObjectID m_ListTail;
++public:
++ inline LwpObjectID* GetHead();
++ inline LwpObjectID* GetTail();
++};
++LwpObjectID* LwpDLVListHeadTail::GetHead()
++{
++ return &m_ListHead;
++}
++LwpObjectID* LwpDLVListHeadTail::GetTail()
++{
++ return &m_ListTail;
++}
++
++/**
++ * @brief Double Linked Virtual List Head
++*/
++class LwpDLVListHead
++{
++public:
++ LwpDLVListHead(){};
++ ~LwpDLVListHead(){};
++ void Read(LwpObjectStream* pObjStrm);
++ inline LwpObjectID* GetFirst();
++protected:
++ LwpObjectID m_objHead;//LwpDLVList
++};
++LwpObjectID* LwpDLVListHead::GetFirst()
++{
++ return &m_objHead;
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpdoc.cxx lotuswordpro/source/filter/lwpdoc.cxx
+--- lotuswordpro.bak/source/filter/lwpdoc.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdoc.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,830 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "lwpglobalmgr.hxx"
++#include "lwpdoc.hxx"
++#include "lwpfootnote.hxx"
++#include "lwppagehint.hxx"
++#include "lwpdivinfo.hxx"
++#include "lwpholder.hxx"
++#include "lwpparastyle.hxx"
++#include "lwpstory.hxx"
++#include "lwppara.hxx"
++#include "lwpsilverbullet.hxx"
++#include "lwplayout.hxx"
++#include "lwppagelayout.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#ifndef _OSL_THREAD_H_
++#include <osl/thread.h>
++#endif
++
++LwpDocument::LwpDocument(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpDLNFPVList(objHdr, pStrm), m_pLnOpts(NULL)
++{}
++
++LwpDocument::~LwpDocument()
++{
++ if(m_pLnOpts)
++ {
++ delete m_pLnOpts;
++ }
++ if(m_pFoundry)
++ {
++ delete m_pFoundry;
++ }
++}
++/**
++ * @descr Read VO_Document from object stream
++ **/
++void LwpDocument::Read()
++{
++ LwpDLNFPVList::Read();
++
++ ReadPlug();
++
++ m_pObjStrm->QuickRead(&m_nPersistentFlags, sizeof(m_nPersistentFlags));
++
++ //Skip the SortOption and UIDocument
++ {
++ LwpSortOption m_DocSort( m_pObjStrm );
++ LwpUIDocument m_UIDoc( m_pObjStrm );
++ }
++
++ m_pLnOpts = new LwpLineNumberOptions(m_pObjStrm);
++
++ //Skip LwpUserDictFiles
++ {
++ LwpUserDictFiles m_UsrDicts( m_pObjStrm );
++ }
++
++ if( !IsChildDoc())
++ {
++ //Skip LwpPrinterInfo
++ LwpPrinterInfo m_PrtInfo( m_pObjStrm );
++ }
++
++ m_pFoundry = new LwpFoundry(m_pObjStrm, this);
++
++ m_DivOpts.ReadIndexed(m_pObjStrm);
++
++ if(!IsChildDoc())
++ {
++ m_FootnoteOpts.ReadIndexed(m_pObjStrm);
++ m_DocData.ReadIndexed(m_pObjStrm);
++ }
++ else
++ {
++ //Skip the docdata used in old version
++ LwpObjectID dummyDocData;
++ dummyDocData.ReadIndexed(m_pObjStrm);
++ }
++ m_DivInfo.ReadIndexed(m_pObjStrm);
++ m_Epoch.Read(m_pObjStrm);
++ m_WYSIWYGPageHints.ReadIndexed(m_pObjStrm);
++ m_VerDoc.ReadIndexed(m_pObjStrm);
++ m_STXInfo.ReadIndexed(m_pObjStrm);
++}
++
++/**
++ * @descr Read plug related data from m_pObjStram
++ **/
++void LwpDocument::ReadPlug()
++{
++ m_DocSockID.ReadIndexed(m_pObjStrm);
++ m_pObjStrm->QuickRead(&m_nFlags, sizeof(m_nFlags));
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++ * @descr Parse obj to IXFStream
++ **/
++void LwpDocument::Parse(IXFStream* pOutputStream)
++{
++ //check the name and skip script division
++ if (!IsSkippedDivision())
++ {
++ //the frames which anchor are to page must output before other contents
++ ParseFrameInPage(pOutputStream);
++ ParseDocContent(pOutputStream);
++ }
++
++ LwpObject* pDocSock = GetSocket()->obj( VO_DOCSOCK );
++ if(pDocSock!=NULL)
++ {
++ pDocSock->Parse(pOutputStream);
++ }
++}
++
++sal_Bool LwpDocument::IsSkippedDivision()
++{
++ OUString sDivName;
++ sal_uInt8 ret = sal_False;
++ LwpDivInfo* pDiv = static_cast<LwpDivInfo*>(GetDivInfoID()->obj(VO_DIVISIONINFO));
++ if (pDiv == NULL)
++ return sal_True;
++ sDivName = pDiv->GetDivName();
++ if (sDivName.getLength()>0 && !pDiv->IsGotoable())//including toa,scripts division
++ return sal_True;
++ //skip endnote division
++ OUString strClassName = pDiv->GetClassName();
++ if (strClassName.equals(A2OUSTR(STR_DivisionEndnote))
++ || strClassName.equals(A2OUSTR(STR_DivisionGroupEndnote))
++ || strClassName.equals(A2OUSTR(STR_DocumentEndnote)))
++ {
++ LwpPageLayout* pPageLayout =static_cast<LwpPageLayout*>(pDiv->GetInitialLayoutID()->obj(VO_PAGELAYOUT));
++ if(pPageLayout)
++ {
++ LwpStory* pStory = static_cast<LwpStory*>(pPageLayout->GetContent()->obj(VO_STORY));
++ if(pStory)
++ {
++ //This judgement maybe have problem. If there is only one para in the story,
++ //this endnote division has no other contents except endnote table.
++ LwpObjectID* pFirst = pStory->GetFirstPara();
++ LwpObjectID* pLast = pStory->GetLastPara();
++ if(*pFirst == *pLast)
++ ret = sal_True;
++ }
++ }
++ }
++ return ret;
++}
++
++/**
++ * @descr Register all styles in this division
++ */
++void LwpDocument::RegisterStyle()
++{
++ RegisterDefaultParaStyles();
++ RegisterGraphicsStyles();
++ RegisterBulletStyles();
++
++ RegisterTextStyles();
++ RegisterLayoutStyles();
++ RegisterStylesInPara();
++
++ RegisterLinenumberStyles();
++ RegisterFootnoteStyles();
++
++ //Register styles in other document connected with this document: next doc, children doc
++ LwpObject* pDocSock = GetSocket()->obj();
++ if(pDocSock!=NULL)
++ {
++ pDocSock->RegisterStyle();
++ }
++}
++/**
++ * @descr Register all named para styles
++ */
++void LwpDocument::RegisterTextStyles()
++{
++ //Register all text styles: para styles, character styles
++ LwpDLVListHeadHolder* pParaStyleHolder = static_cast<LwpDLVListHeadHolder*>(m_pFoundry->GetTextStyleHead()->obj());
++ if(pParaStyleHolder)
++ {
++ LwpTextStyle* pParaStyle = static_cast<LwpTextStyle*> (pParaStyleHolder->GetHeadID()->obj());
++ while(pParaStyle)
++ {
++ pParaStyle->SetFoundry(m_pFoundry);
++ pParaStyle->RegisterStyle();
++ pParaStyle = static_cast<LwpParaStyle*>(pParaStyle->GetNext()->obj());
++ }
++ }
++ ChangeStyleName();//add by ,for click here block,05/5/26
++}
++/**
++ * @descr Register all layouts styles (page master and master page)
++ * All para styles used in master page (header and footer) are registered and then showed
++ */
++void LwpDocument::RegisterLayoutStyles()
++{
++ //Register all layout styles, before register all styles in para
++ m_pFoundry->RegisterAllLayouts();
++
++ //set initial pagelayout in story for parsing pagelayout
++ LwpDivInfo* pDivInfo = static_cast<LwpDivInfo*> (m_DivInfo.obj( VO_DIVISIONINFO));
++ LwpPageLayout* pPageLayout = NULL;
++ if(pDivInfo)
++ {
++ pPageLayout =static_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID()->obj(VO_PAGELAYOUT));
++ if(pPageLayout)
++ {
++ //In Ole division, the content of pagelayout is VO_OLEOBJECT
++ LwpStory* pStory = static_cast<LwpStory*>(pPageLayout->GetContent()->obj(VO_STORY));
++ if(pStory)
++ {
++ //add all the pagelayout in order into the pagelayout list;
++ pStory->SortPageLayout();
++ pStory->SetCurrentLayout(pPageLayout);
++ }
++ }
++ }
++}
++/**
++ * @descr Register all styles used in para
++ */
++void LwpDocument::RegisterStylesInPara()
++{
++ //Register all automatic styles in para
++ LwpHeadContent* pContent = static_cast<LwpHeadContent*> (m_pFoundry->GetContentManager()->GetContentList()->obj());
++ if(pContent)
++ {
++ LwpStory* pStory = static_cast<LwpStory*>(pContent->GetChildHead()->obj(VO_STORY));
++ while(pStory)
++ {
++ //Register the child para
++ pStory->SetFoundry(m_pFoundry);
++ pStory->RegisterStyle();
++ pStory = static_cast<LwpStory*>(pStory->GetNext()->obj(VO_STORY));
++ }
++ }
++}
++/**
++ * @descr Register all bullet styles used in this division
++ */
++void LwpDocument::RegisterBulletStyles()
++{
++ //Register bullet styles
++ LwpDLVListHeadHolder* mBulletHead = static_cast<LwpDLVListHeadHolder*>
++ (m_pFoundry->GetBulletManagerID()->obj(VO_HEADHOLDER));
++ if( mBulletHead )
++ {
++ LwpSilverBullet* pBullet = static_cast<LwpSilverBullet*>
++ (mBulletHead->GetHeadID()->obj());
++ while(pBullet)
++ {
++ pBullet->SetFoundry(m_pFoundry);
++ pBullet->RegisterStyle();
++ pBullet = static_cast<LwpSilverBullet*> (pBullet->GetNext()->obj());
++ }
++ }
++}
++/**
++ * @descr Register all styles used in VO_Graphic
++ */
++void LwpDocument::RegisterGraphicsStyles()
++{
++ //Register all graphics styles, the first object should register the next;
++ LwpObject* pGraphic = m_pFoundry->GetGraphicListHead()->obj(VO_GRAPHIC);
++ if(pGraphic)
++ {
++ pGraphic->SetFoundry(m_pFoundry);
++ pGraphic->RegisterStyle();
++ }
++}
++/**
++ * @descr Register line number styles
++ */
++void LwpDocument::RegisterLinenumberStyles()
++{
++ if (!m_pLnOpts)
++ return;
++ m_pLnOpts->RegisterStyle();
++}
++
++/**
++* @descr Register footnote/endnote configuration for the entire document
++*/
++void LwpDocument::RegisterFootnoteStyles()
++{
++ //Register footnote and endnote configuration for the entire document
++ if(!m_FootnoteOpts.IsNull())
++ {
++ LwpFootnoteOptions* pFootnoteOpts = static_cast<LwpFootnoteOptions*>(m_FootnoteOpts.obj());
++ if (pFootnoteOpts)
++ {
++ pFootnoteOpts->SetMasterPage(A2OUSTR("Endnote"));
++ pFootnoteOpts->RegisterStyle();
++ }
++ }
++ //Register endnote page style for endnote configuration, use the last division that has endnote for the endnote page style
++ //This page style must register after its division default styles have registered
++ LwpDocument* pEndnoteDiv = GetLastDivisionThatHasEndnote();
++ if(this == pEndnoteDiv)
++ {
++ LwpDLVListHeadTailHolder* pHeadTail = static_cast<LwpDLVListHeadTailHolder*>(GetPageHintsID()->obj());
++ if(pHeadTail)
++ {
++ LwpPageHint* pPageHint =static_cast<LwpPageHint*>(pHeadTail->GetTail()->obj());
++ if(pPageHint && !pPageHint->GetPageLayoutID()->IsNull())
++ {
++ LwpPageLayout* pPageLayout = static_cast<LwpPageLayout*>(pPageHint->GetPageLayoutID()->obj());
++ if(pPageLayout)
++ {
++ pPageLayout->SetFoundry(GetFoundry());
++ pPageLayout->RegisterEndnoteStyle();
++ }
++ }
++ }
++ }
++}
++
++/**
++* @descr Register default para styles
++*/
++#include "lwpverdocument.hxx"
++void LwpDocument::RegisterDefaultParaStyles()
++{
++ if(!IsChildDoc())
++ {
++ //Get First Division
++ //LwpDocument* pFirstDoc = GetFirstDivision();
++ LwpDocument* pFirstDoc = GetFirstDivisionWithContentsThatIsNotOLE();
++ if(pFirstDoc)
++ {
++ LwpVerDocument* pVerDoc = static_cast<LwpVerDocument*>(pFirstDoc->GetVerDoc()->obj());
++ if(pVerDoc)
++ {
++ pVerDoc->RegisterStyle();
++ }
++ }
++
++ }
++}
++
++/**
++ * @descr Parse content in this division to IXFStream
++ * LwpDocument->LwpDivInfo->LwpPageLayout.Parse()
++ */
++void LwpDocument::ParseDocContent(IXFStream* pOutputStream)
++{
++ //Parse content in PageLayout
++ LwpDivInfo* pDivInfo = static_cast<LwpDivInfo*> (m_DivInfo.obj());
++ if(pDivInfo==NULL) return;
++
++ LwpObject* pLayoutObj = pDivInfo->GetInitialLayoutID()->obj();
++ if(pLayoutObj==NULL)
++ {
++ //Cause crash when parsing master document, master document not supported now.
++ //ParseMasterDoc(pOutputStream);
++ return;
++ }
++ pLayoutObj->SetFoundry(m_pFoundry);
++ pLayoutObj->Parse(pOutputStream);
++}
++/**
++ * @descr Parse master doc in this division to IXFStream
++ *
++ */
++void LwpDocument::ParseMasterDoc(IXFStream* pOutputStream)
++{
++ LwpDivInfo* pDivInfo = static_cast<LwpDivInfo*> (m_DivInfo.obj());
++ if(pDivInfo==NULL) return;
++ LwpAtomHolder* pExternal = pDivInfo->GetExternalName();
++ if(pExternal && pExternal->HasValue())
++ {
++ OUString linkedfilepath = pExternal->str();
++ OUString fileURL = LwpTools::convertToFileUrl(OUStringToOString(linkedfilepath, osl_getThreadTextEncoding()));
++ XFSection* pSection = new XFSection();
++ pSection->SetSourceLink( fileURL);
++ pSection->ToXml(pOutputStream);
++ delete pSection;
++ }
++}
++/**
++ * @descr Get the footnoteoptions from the root document
++ */
++LwpObjectID* LwpDocument::GetValidFootnoteOpts()
++{
++ LwpDocument* pRoot = GetRootDocument();
++ if(pRoot)
++ {
++ return pRoot->GetFootnoteOpts();
++ }
++ return NULL;
++}
++
++/**
++ * @descr Get the endnote type
++ */
++sal_uInt16 LwpDocument::GetEndnoteType()
++{
++ LwpDivInfo* pDivInfo =static_cast<LwpDivInfo*>(GetDivInfoID()->obj());
++ if (!pDivInfo)
++ return FN_DONTCARE;
++ OUString strClassName = pDivInfo->GetClassName();
++ if (strClassName.equals(A2OUSTR(STR_DivisionEndnote)))
++ return FN_DIVISION_SEPARATE;
++ if (strClassName.equals(A2OUSTR(STR_DivisionGroupEndnote)))
++ return FN_DIVISIONGROUP_SEPARATE;
++ if (strClassName.equals(A2OUSTR(STR_DocumentEndnote)))
++ return FN_DOCUMENT_SEPARATE;
++ return FN_DONTCARE;
++}
++/**
++ * @descr Get previous division
++ */
++LwpDocument* LwpDocument::GetPreviousDivision()
++{
++ LwpDocSock* pDocSock = static_cast<LwpDocSock*>(GetSocket()->obj());
++ if(pDocSock)
++ {
++ return static_cast<LwpDocument*>(pDocSock->GetPrevious()->obj());
++ }
++ return NULL;
++}
++/**
++ * @descr Get next division
++ */
++ LwpDocument* LwpDocument::GetNextDivision()
++{
++ LwpDocSock* pDocSock = static_cast<LwpDocSock*>(GetSocket()->obj());
++ if(pDocSock)
++ {
++ return static_cast<LwpDocument*>(pDocSock->GetNext()->obj());
++ }
++ return NULL;
++}
++/**
++ * @descr Get parent division
++ */
++ LwpDocument* LwpDocument::GetParentDivision()
++{
++ LwpDocSock* pDocSock = static_cast<LwpDocSock*>(GetSocket()->obj());
++ if(pDocSock)
++ {
++ return static_cast<LwpDocument*>(pDocSock->GetParent()->obj());
++ }
++ return NULL;
++}
++/**
++ * @descr Get previous division in group, copy from lwp source code
++ */
++ LwpDocument* LwpDocument::GetPreviousInGroup()
++{
++ LwpDocument* pPrev = NULL;
++
++ for (pPrev = GetPreviousDivision(); pPrev; pPrev = pPrev->GetPreviousDivision())
++ {
++ LwpDivInfo* pDivInfo =static_cast<LwpDivInfo*>(pPrev->GetDivInfoID()->obj());
++ if(pDivInfo && pDivInfo->HasContents())
++ return pPrev;
++ }
++ return NULL;
++}
++/**
++ * @descr Get previous division in group, copy from lwp source code
++ */
++ LwpDocument* LwpDocument::GetNextInGroup()
++{
++ LwpDocument* pNext = NULL;
++
++ for (pNext = GetNextDivision(); pNext; pNext = pNext->GetNextDivision())
++ {
++ LwpDivInfo* pDivInfo =static_cast<LwpDivInfo*>(pNext->GetDivInfoID()->obj());
++ if(pDivInfo && pDivInfo->HasContents())
++ return pNext;
++ }
++
++ return NULL;
++}
++/**
++ * @descr Get previous division which has contents, copy from lwp source code
++ */
++ LwpDocument* LwpDocument::GetPreviousDivisionWithContents()
++{
++ if(GetPreviousDivision())
++ {
++ LwpDocument* pDoc = GetPreviousDivision()->GetLastDivisionWithContents();
++ if (pDoc)
++ return pDoc;
++ }
++ if(GetParentDivision())
++ return GetParentDivision()->GetPreviousDivisionWithContents();
++ return NULL;
++}
++ /**
++ * @descr Get last division which has contents, copy from lwp source code
++ */
++ LwpDocument* LwpDocument::GetLastDivisionWithContents()
++{
++ LwpDivInfo* pDivInfo =static_cast<LwpDivInfo*>(GetDivInfoID()->obj());
++ if(pDivInfo && pDivInfo->HasContents())
++ {
++ return this;
++ }
++
++ LwpDocument* pDivision = GetLastDivision();
++ LwpDocument* pContentDivision = NULL;
++
++ while(pDivision)
++ {
++ pContentDivision = pDivision->GetLastDivisionWithContents();
++ if(pContentDivision)
++ {
++ return pContentDivision;
++ }
++ pDivision = pDivision->GetPreviousDivision();
++ }
++
++ return NULL;
++}
++ /**
++ * @descr Get last division in group which has contents, copy from lwp source code
++ */
++ LwpDocument* LwpDocument::GetLastInGroupWithContents()
++{
++ LwpDocument* pLast = NULL;
++ LwpDocument* pNext = this;
++
++ while (pNext)
++ {
++ LwpDivInfo* pDivInfo =static_cast<LwpDivInfo*>(pNext->GetDivInfoID()->obj());
++ if (pDivInfo && pDivInfo->HasContents())
++ pLast = pNext;
++ pNext = pNext->GetNextInGroup();
++ }
++ if (pLast)
++ return pLast;
++ return NULL;
++}
++ /**
++ * @descr Get last division
++ */
++ LwpDocument* LwpDocument::GetLastDivision()
++{
++ LwpDocSock* pDocSock = static_cast<LwpDocSock*>(GetSocket()->obj());
++ if(pDocSock)
++ return static_cast<LwpDocument*>(pDocSock->GetChildTail()->obj());
++ return NULL;
++}
++
++ /**
++ * @descr Get first division
++ */
++ LwpDocument* LwpDocument::GetFirstDivision()
++{
++ LwpDocSock* pDocSock = static_cast<LwpDocSock*>(GetSocket()->obj());
++ if(pDocSock)
++ return static_cast<LwpDocument*>(pDocSock->GetChildHead()->obj());
++ return NULL;
++}
++
++ /**
++ * @descr Get root document
++ */
++ LwpDocument* LwpDocument::GetRootDocument()
++{
++ LwpDocument* pRoot = this;
++ while(pRoot)
++ {
++ if(!pRoot->IsChildDoc())
++ return pRoot;
++ pRoot = pRoot->GetParentDivision();
++ }
++ return NULL;
++}
++ /**
++ * @descr Get first division with contents that is not ole, copy from lwp-source code
++ */
++ LwpDocument* LwpDocument::GetFirstDivisionWithContentsThatIsNotOLE()
++{
++ LwpDivInfo* pDivInfo =static_cast<LwpDivInfo*>(GetDivInfoID()->obj());
++ if(pDivInfo && pDivInfo->HasContents()
++ && !pDivInfo->IsOleDivision())
++ return this;
++
++ LwpDocument* pDivision = GetFirstDivision();
++
++ LwpDocument* pContentDivision = NULL;
++
++ while (pDivision)
++ {
++ pContentDivision = pDivision->GetFirstDivisionWithContentsThatIsNotOLE();
++ if(pContentDivision)
++ return pContentDivision;
++ pDivision = pDivision->GetNextDivision();
++ }
++ return NULL;
++}
++ /**
++ * @descr Get last division that has endnote
++ */
++ LwpDocument* LwpDocument::GetLastDivisionThatHasEndnote()
++{
++ LwpDocument* pRoot = GetRootDocument();
++ LwpDocument *pLastDoc = pRoot->GetLastDivisionWithContents();
++ while(pLastDoc)
++ {
++ if(pLastDoc->GetEnSuperTableLayout())
++ return pLastDoc;
++ pLastDoc = pLastDoc->GetPreviousDivisionWithContents();
++ }
++ return NULL;
++
++}
++ /**
++ * @descr Get endnote supertable layout, every division has only one endnote supertable layout.
++ */
++ LwpVirtualLayout* LwpDocument::GetEnSuperTableLayout()
++{
++ LwpHeadLayout* pHeadLayout =static_cast<LwpHeadLayout*>(GetFoundry()->GetLayout()->obj());
++ if(pHeadLayout)
++ {
++ return pHeadLayout->FindEnSuperTableLayout();
++ }
++ return NULL;
++}
++
++/**
++ * @descr Get the numbers of page before pEndDivision, copy from lwp source code
++ */
++ sal_Bool LwpDocument::GetNumberOfPages(LwpDocument* pEndDivision, sal_uInt16& nCount)
++{
++ if(this == pEndDivision)
++ return sal_True;
++
++ LwpDivInfo* pDivInfo = static_cast<LwpDivInfo*>(m_DivInfo.obj());
++ if(pDivInfo)
++ {
++ pDivInfo->GetNumberOfPages(nCount);
++ }
++
++ LwpDocument* pDivision = GetFirstDivision();
++ while(pDivision)
++ {
++ if(pDivision->GetNumberOfPages(pEndDivision,nCount))
++ return sal_True;
++ pDivision = pDivision->GetNextDivision();
++
++ }
++ return sal_False;
++}
++/**
++ * @descr Get the numbers of page before curruent division
++ */
++sal_uInt16 LwpDocument::GetNumberOfPagesBefore()
++{
++ sal_uInt16 nPageNumber = 0;
++ LwpDocument* pRoot = GetRootDocument();
++ if(pRoot)
++ pRoot->GetNumberOfPages(this,nPageNumber);
++ return nPageNumber;
++}
++ /**
++ * @descr Get the numbers of page before this division
++ */
++ sal_uInt16 LwpDocument::GetMaxNumberOfPages()
++{
++ sal_uInt16 nPageNumber = 0;
++ MaxNumberOfPages(nPageNumber);
++ return nPageNumber;
++}
++ /**
++ * @descr Get Max number of pages
++ */
++ void LwpDocument::MaxNumberOfPages(sal_uInt16& nNumPages)
++{
++ LwpDocument* pDivision = GetFirstDivision();
++
++ LwpDivInfo* pDivInfo = static_cast<LwpDivInfo*>(m_DivInfo.obj());
++ if(pDivInfo)
++ nNumPages += pDivInfo->GetMaxNumberOfPages();
++ while(pDivision)
++ {
++ pDivision->MaxNumberOfPages(nNumPages);
++ pDivision = pDivision->GetNextDivision();
++ }
++}
++ /**
++ * @descr Parse the frame which anchor is to page before parse other contents,
++ * This method is called when the document is root document.
++ */
++void LwpDocument::ParseFrameInPage(IXFStream * pOutputStream)
++{
++ if(IsChildDoc())
++ return;
++
++ XFContentContainer* pXFContainer = new XFContentContainer;
++
++ XFConvertFrameInPage(pXFContainer);
++
++ pXFContainer->ToXml(pOutputStream);
++ delete pXFContainer;
++ pXFContainer = NULL;
++}
++ /**
++ * @descr Parse the frame which anchor is to page in the entire document
++ */
++void LwpDocument::XFConvertFrameInPage(XFContentContainer * pCont)
++{
++ LwpDocument* pDivision = GetFirstDivision();
++
++ LwpDivInfo* pDivInfo = static_cast<LwpDivInfo*> (GetDivInfoID()->obj());
++ if(pDivInfo)
++ {
++ LwpPageLayout* pPageLayout =static_cast<LwpPageLayout*>(pDivInfo->GetInitialLayoutID()->obj());
++ if(pPageLayout)
++ {
++ LwpStory* pStory = static_cast<LwpStory*>(pPageLayout->GetContent()->obj());
++ if(pStory)
++ pStory->XFConvertFrameInPage(pCont);
++ }
++ }
++ while(pDivision)
++ {
++ pDivision->XFConvertFrameInPage(pCont);
++ pDivision = pDivision->GetNextDivision();
++ }
++}
++ /**
++ * @descr change click here to placeholder
++ */
++void LwpDocument::ChangeStyleName()
++{
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ XFTextStyle* pStyle = static_cast<XFTextStyle*>(pXFStyleManager->FindStyle(A2OUSTR("ClickHere")));
++ if (pStyle)
++ {
++ pStyle->SetStyleName(A2OUSTR("Placeholder"));
++ }
++}
++LwpDocSock::LwpDocSock(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ :LwpDLNFVList(objHdr, pStrm)
++{}
++
++ /**
++ * @descr read VO_DOCSOCK from file
++ */
++void LwpDocSock::Read()
++{
++ LwpDLNFVList::Read();
++ m_Doc.ReadIndexed(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++ /**
++ * @descr register styles in documents plugged
++ */
++void LwpDocSock::RegisterStyle()
++{
++ LwpObject* pDoc = GetNext()->obj();
++ if(pDoc)
++ pDoc->RegisterStyle();
++
++ pDoc = GetChildHead()->obj();
++ if(pDoc)
++ pDoc->RegisterStyle();
++}
++ /**
++ * @descr parse contents of documents plugged
++ */
++void LwpDocSock::Parse(IXFStream* pOutputStream)
++{
++ LwpObject* pDoc = GetChildHead()->obj();
++ if(pDoc)
++ pDoc->Parse(pOutputStream);
++
++ pDoc = GetNext()->obj();
++ if(pDoc)
++ pDoc->Parse(pOutputStream);
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpdocdata.cxx lotuswordpro/source/filter/lwpdocdata.cxx
+--- lotuswordpro.bak/source/filter/lwpdocdata.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdocdata.cxx 2008-10-22 11:56:02.000000000 +0800
+@@ -0,0 +1,395 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "lwpdocdata.hxx"
++#include "xfilter/xfofficemeta.hxx"
++#include "localtime.hxx"
++#include <rtl/ustrbuf.hxx>
++#include "lwpfilehdr.hxx"
++#include "lwpglobalmgr.hxx"
++
++//std::map<sal_uInt16,LwpEditorAttr*> LwpDocData::m_EditorAttrMap;
++
++LwpDocData::LwpDocData(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ :LwpObject(objHdr, pStrm)//m_pEditorAttrList(0)
++{}
++
++LwpDocData::~LwpDocData()
++{
++}
++void LwpDocData::SkipExtra(LwpSvStream* pStream)
++{
++ sal_uInt16 extra;
++ pStream->Read(&extra,2);
++ while(extra != 0)
++ {
++ pStream->SeekRel(extra);
++ pStream->Read(&extra,2);
++ }
++}
++void LwpDocData::SkipAtomHandler(LwpSvStream* pStream)
++{
++ sal_uInt16 disksize;
++ sal_uInt16 len;
++ pStream->Read(&disksize,2);
++ pStream->Read(&len,2);
++ if(len)pStream->SeekRel(disksize-2);
++}
++void LwpDocData::Read()
++{
++ //XFDateTime
++ //////////////////////////////////////////////////////////////////////////
++ //doc options
++ //cOptionFlag
++ m_DocOptions.nOptionFlag = m_pObjStrm->QuickReaduInt16();
++ //cEncrypt1Password
++ m_DocOptions.encrypt1password.Read(m_pObjStrm);
++ //cEncrypt2Password
++ m_DocOptions.encrypt2password.Read(m_pObjStrm);
++ //cCharecterSet
++ m_DocOptions.characterSet.Read(m_pObjStrm);
++ //cGrammerSet
++ m_DocOptions.grammerSet.Read(m_pObjStrm);
++ //cShowMarginMarks
++ m_DocOptions.nMarginMarks = m_pObjStrm->QuickReaduInt16();
++ //cMarginMarksLocation
++ m_DocOptions.nMarginMarksLocation = m_pObjStrm->QuickReaduInt16();
++ //cMarginMarksChar
++ m_DocOptions.nMarginMarksChar = m_pObjStrm->QuickReaduInt16();
++ m_pObjStrm->SkipExtra();
++ //////////////////////////////////////////////////////////////////////////
++ //doc info
++ //cDescription
++ m_DocInfo.description.Read(m_pObjStrm);
++ //cKeyWord
++ m_DocInfo.keywords.Read(m_pObjStrm);
++ //cCreatedBy
++ m_DocInfo.createdBy.Read(m_pObjStrm);
++ //cCreationTime
++ m_DocInfo.nCreationTime = m_pObjStrm->QuickReadInt32();
++ LtgLocalTime(m_DocInfo.nCreationTime,m_nCreationTime);
++ //cLastRevisionTime
++ m_DocInfo.nLastRevisionTime = m_pObjStrm->QuickReadInt32();
++ LtgLocalTime(m_DocInfo.nLastRevisionTime,m_nLastRevisionTime);
++ //cTotalEditTime
++ m_DocInfo.nTotalEditTime = m_pObjStrm->QuickReadInt32();
++
++ m_nTotalEditTime.tm_hour = m_DocInfo.nTotalEditTime / 60;
++ m_nTotalEditTime.tm_min = m_DocInfo.nTotalEditTime % 60;
++ m_nTotalEditTime.tm_sec = 0;
++ //cpVerDocInfo
++ m_DocInfo.cpVerDocInfo.ReadIndexed(m_pObjStrm);
++
++ //EditorList
++ m_DocInfo.nNumEditedBy = m_pObjStrm->QuickReaduInt16();
++ LwpAtomHolder* pCDLNList = new LwpAtomHolder[m_DocInfo.nNumEditedBy];
++ LwpAtomHolder* pEditorList = new LwpAtomHolder[m_DocInfo.nNumEditedBy];
++ sal_uInt16 i = 0;
++ for ( i = 0; i < m_DocInfo.nNumEditedBy; i++)
++ {
++ //CDLNList
++ pCDLNList[i].Read(m_pObjStrm); //cName
++ m_pObjStrm->SkipExtra();
++ //CEditedBy
++ pEditorList[i].Read(m_pObjStrm); //cName
++ m_pObjStrm->SkipExtra();
++ }
++
++ m_pObjStrm->SkipExtra();
++
++ delete [] pCDLNList;
++ delete [] pEditorList;
++ //////////////////////////////////////////////////////////////////////////
++ //doc control
++ //cGreeting
++ m_DocControl.cGreeting.Read(m_pObjStrm);
++ //cFlags
++ m_DocControl.nFlags = m_pObjStrm->QuickReaduInt16();
++
++ //cDocControlProtection
++ m_DocControl.nDocControlProtection = m_pObjStrm->QuickReaduInt16();
++ //Len
++ m_DocControl.nLen1 = m_pObjStrm->QuickReaduInt16();
++ //skip doc control password string
++ m_pObjStrm->SeekRel(m_DocControl.nLen1);
++
++ //cFileProtection
++ m_DocControl.nFileProtection = m_pObjStrm->QuickReaduInt16();
++ //Len
++ m_DocControl.nLen2 = m_pObjStrm->QuickReaduInt16();
++ //skip file password string
++ m_pObjStrm->SeekRel(m_DocControl.nLen2);
++
++ //cAutoVersioning
++ m_DocControl.nAutoVersioning = m_pObjStrm->QuickReaduInt16();
++ //cDocControlOnlyEditor
++ m_DocControl.cDocControlOnlyEditor.Read(m_pObjStrm);
++ //cEditorVerification
++ m_DocControl.nEditorVerification = m_pObjStrm->QuickReaduInt16();
++
++ m_pObjStrm->SkipExtra();
++ //////////////////////////////////////////////////////////////////////////
++ //editor list
++ //numeditors
++ sal_uInt16 numeditors = m_pObjStrm->QuickReaduInt16();
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++
++ for (i = 0;i<numeditors;i++)
++ {
++ LwpEditorAttr* pEditorAttr = new LwpEditorAttr;
++ //cName
++ pEditorAttr->cName.Read(m_pObjStrm);
++ //cInitials
++ pEditorAttr->cInitials.Read(m_pObjStrm);
++ //cHiLite
++ pEditorAttr->cHiLiteColor.Read(m_pObjStrm);
++
++ //cID
++ pEditorAttr->nID = m_pObjStrm->QuickReaduInt16();
++
++ //cInsFontOver
++ //CFontAttributeOverride --cAttrBits
++ pEditorAttr->cInsFontOver.cFontAttributeOverride.cAttrBits = m_pObjStrm->QuickReaduInt16();
++ //CFontAttributeOverride --cAttrOverrideBits
++ pEditorAttr->cInsFontOver.cFontAttributeOverride.cAttrOverrideBits = m_pObjStrm->QuickReaduInt16();
++ //CFontAttributeOverride --cAttrApplyBits
++ pEditorAttr->cInsFontOver.cFontAttributeOverride.cAttrApplyBits = m_pObjStrm->QuickReaduInt16();
++ //CFontAttributeOverride --cAttrOverrideBits2
++ pEditorAttr->cInsFontOver.cFontAttributeOverride.cAttrOverrideBits2 = m_pObjStrm->QuickReaduInt8();
++ //CFontAttributeOverride --cAttrApplyBits2
++ pEditorAttr->cInsFontOver.cFontAttributeOverride.cAttrApplyBits2 = m_pObjStrm->QuickReaduInt8();
++ //CFontAttributeOverride --cCase
++ pEditorAttr->cInsFontOver.cFontAttributeOverride.cCase = m_pObjStrm->QuickReaduInt8();
++ //CFontAttributeOverride --cUnder
++ pEditorAttr->cInsFontOver.cFontAttributeOverride.cUnder = m_pObjStrm->QuickReaduInt8();
++ m_pObjStrm->SkipExtra();
++ //CFontDescriptionOverrideBase--cOverrideBits
++ pEditorAttr->cInsFontOver.cFontDescriptionOverrideBase.cOverrideBits = m_pObjStrm->QuickReaduInt8();
++ //CFontDescriptionOverrideBase--cApplyBits
++ pEditorAttr->cInsFontOver.cFontDescriptionOverrideBase.cApplyBits = m_pObjStrm->QuickReaduInt8();
++ //CFontDescriptionOverrideBase--cPointSize
++ pEditorAttr->cInsFontOver.cFontDescriptionOverrideBase.cPointSize = m_pObjStrm->QuickReadInt32();
++ //CFontDescriptionOverrideBase--cOverstrike
++ pEditorAttr->cInsFontOver.cFontDescriptionOverrideBase.cOverstrike = m_pObjStrm->QuickReaduInt8();
++ //CFontDescriptionOverrideBase--cTightness
++ pEditorAttr->cInsFontOver.cFontDescriptionOverrideBase.cTightness = m_pObjStrm->QuickReaduInt16();
++ //CFontDescriptionOverrideBase--cColor
++ pEditorAttr->cInsFontOver.cFontDescriptionOverrideBase.cColor.Read(m_pObjStrm);
++
++ //CFontDescriptionOverrideBase--cBackgroundColor
++ pEditorAttr->cInsFontOver.cFontDescriptionOverrideBase.cBackgroundColor.Read(m_pObjStrm);
++
++ m_pObjStrm->SkipExtra();
++ //cFaceName
++ pEditorAttr->cInsFontOver.cFaceName.Read(m_pObjStrm);
++ //cAltFaceName
++ pEditorAttr->cInsFontOver.cAltFaceName.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++
++ //cDelFontOver
++ //CFontAttributeOverride --cAttrBits
++ pEditorAttr->cDelFontOver.cFontAttributeOverride.cAttrBits = m_pObjStrm->QuickReaduInt16();
++ //CFontAttributeOverride --cAttrOverrideBits
++ pEditorAttr->cDelFontOver.cFontAttributeOverride.cAttrOverrideBits = m_pObjStrm->QuickReaduInt16();
++ //CFontAttributeOverride --cAttrApplyBits
++ pEditorAttr->cDelFontOver.cFontAttributeOverride.cAttrApplyBits = m_pObjStrm->QuickReaduInt16();
++ //CFontAttributeOverride --cAttrOverrideBits2
++ pEditorAttr->cDelFontOver.cFontAttributeOverride.cAttrOverrideBits2 = m_pObjStrm->QuickReaduInt8();
++ //CFontAttributeOverride --cAttrApplyBits2
++ pEditorAttr->cDelFontOver.cFontAttributeOverride.cAttrApplyBits2 = m_pObjStrm->QuickReaduInt8();
++ //CFontAttributeOverride --cCase
++ pEditorAttr->cDelFontOver.cFontAttributeOverride.cCase = m_pObjStrm->QuickReaduInt8();
++ //CFontAttributeOverride --cUnder
++ pEditorAttr->cDelFontOver.cFontAttributeOverride.cUnder = m_pObjStrm->QuickReaduInt8();
++ m_pObjStrm->SkipExtra();
++ //CFontDescriptionOverrideBase--cOverrideBits
++ pEditorAttr->cDelFontOver.cFontDescriptionOverrideBase.cOverrideBits = m_pObjStrm->QuickReaduInt8();
++ //CFontDescriptionOverrideBase--cApplyBits
++ pEditorAttr->cDelFontOver.cFontDescriptionOverrideBase.cApplyBits = m_pObjStrm->QuickReaduInt8();
++ //CFontDescriptionOverrideBase--cPointSize
++ pEditorAttr->cDelFontOver.cFontDescriptionOverrideBase.cPointSize = m_pObjStrm->QuickReadInt32();
++ //CFontDescriptionOverrideBase--cOverstrike
++ pEditorAttr->cDelFontOver.cFontDescriptionOverrideBase.cOverstrike = m_pObjStrm->QuickReaduInt8();
++ //CFontDescriptionOverrideBase--cTightness
++ pEditorAttr->cDelFontOver.cFontDescriptionOverrideBase.cTightness = m_pObjStrm->QuickReaduInt16();
++ //CFontDescriptionOverrideBase--cColor
++ pEditorAttr->cDelFontOver.cFontDescriptionOverrideBase.cColor.Read(m_pObjStrm);
++
++ //CFontDescriptionOverrideBase--cBackgroundColor
++ pEditorAttr->cDelFontOver.cFontDescriptionOverrideBase.cBackgroundColor.Read(m_pObjStrm);
++
++ m_pObjStrm->SkipExtra();
++ //cFaceName
++ pEditorAttr->cDelFontOver.cFaceName.Read(m_pObjStrm);
++ //cAltFaceName
++ pEditorAttr->cDelFontOver.cAltFaceName.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++
++ //cAbilities
++ pEditorAttr->nAbilities = m_pObjStrm->QuickReaduInt16();
++ //cLocks
++ pEditorAttr->nLocks = m_pObjStrm->QuickReaduInt16();
++ //cSuggestions
++ pEditorAttr->nSuggestions = m_pObjStrm->QuickReaduInt16();
++
++ //cDelTextAttr
++ //m_pEditorAttrList[i].cDelTextAttr.Read(m_pObjStrm);
++ if (m_pObjStrm->QuickReadBool())
++ {
++ pEditorAttr->cDelTextAttr.cOverride.cValues = m_pObjStrm->QuickReaduInt16();
++ pEditorAttr->cDelTextAttr.cOverride.cOverride = m_pObjStrm->QuickReaduInt16();
++ pEditorAttr->cDelTextAttr.cOverride.cApply = m_pObjStrm->QuickReaduInt16();
++ m_pObjStrm->SkipExtra();
++ pEditorAttr->cDelTextAttr.cHideLevels = m_pObjStrm->QuickReaduInt16();
++
++ if (LwpFileHeader::m_nFileRevision>= 0x000b)
++ {
++ pEditorAttr->cDelTextAttr.cBaselineOffset = m_pObjStrm->QuickReadInt32();
++ }
++ else
++ {
++ pEditorAttr->cDelTextAttr.cBaselineOffset = 0;
++ }
++ }
++ m_pObjStrm->SkipExtra();
++
++ m_pObjStrm->SkipExtra();
++
++ pGlobal->SetEditorAttrMap(pEditorAttr->nID, pEditorAttr);
++ }
++}
++rtl::OUString LwpDocData::DateTimeToOUString(LtTm& dt)
++{
++ rtl::OUStringBuffer buf;
++ buf.append((sal_Int32)dt.tm_year);
++ buf.append( A2OUSTR("-") );
++ buf.append((sal_Int32)dt.tm_mon);
++ buf.append( A2OUSTR("-") );
++ buf.append((sal_Int32)dt.tm_mday);
++ buf.append( A2OUSTR("T") );
++ buf.append((sal_Int32)dt.tm_hour);
++ buf.append( A2OUSTR(":") );
++ buf.append((sal_Int32)dt.tm_min);
++ buf.append( A2OUSTR(":") );
++ buf.append((sal_Int32)dt.tm_sec);
++ buf.append( A2OUSTR(".") );
++ buf.append((sal_Int32)0);
++
++ return buf.makeStringAndClear();
++}
++rtl::OUString LwpDocData::TimeToOUString(LtTm& dt)
++{
++ //PT3H43M44S
++ rtl::OUStringBuffer buf;
++ buf.append( A2OUSTR("PT") );
++ buf.append((sal_Int32)dt.tm_hour);
++ buf.append( A2OUSTR("H") );
++ buf.append((sal_Int32)dt.tm_min);
++ buf.append( A2OUSTR("M") );
++ buf.append((sal_Int32)dt.tm_sec);
++ buf.append( A2OUSTR("S") );
++
++ return buf.makeStringAndClear();
++}
++void LwpDocData::Parse(IXFStream *pOutputStream)
++{
++ //<!DOCTYPE office:document-meta PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "office.dtd">
++ //<office:document-meta xmlns:office="http://openoffice.org/2000/office" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" office:version="1.0">
++ //</office:document-meta>
++ XFOfficeMeta xfMeta;
++ xfMeta.SetCreator(m_DocInfo.createdBy.str());
++ xfMeta.SetDescription(m_DocInfo.description.str());
++ xfMeta.SetKeywords(m_DocInfo.keywords.str());
++ xfMeta.SetCreationTime(DateTimeToOUString(m_nCreationTime));
++ xfMeta.SetLastTime(DateTimeToOUString(m_nLastRevisionTime));
++ xfMeta.SetEditTime(TimeToOUString(m_nTotalEditTime));
++ xfMeta.ToXml(pOutputStream);
++}
++/*
++OUString LwpDocData::GetEditorName(sal_uInt8 nID)
++{
++ std::map<sal_uInt16,LwpEditorAttr*>::iterator iter;
++ iter = m_EditorAttrMap.find(nID);
++ if (iter != m_EditorAttrMap.end())
++ return iter->second->cName.str();
++ return A2OUSTR("");
++}
++
++XFColor LwpDocData::GetHighLightColor(sal_uInt8 nID)
++{
++ std::map<sal_uInt16,LwpEditorAttr*>::iterator iter;
++
++ iter = m_EditorAttrMap.find(nID);
++ if (iter != m_EditorAttrMap.end())
++ {
++ LwpColor aLwpColor = iter->second->cHiLiteColor;
++ XFColor aColor(aLwpColor.GetRed(),aLwpColor.GetGreen(),aLwpColor.GetBlue());
++ return aColor;
++ }
++ else
++ {
++ XFColor aColor(255,255,0);//yellow
++ return aColor;
++ }
++}
++void LwpDocData::Reset()
++{
++ std::map<sal_uInt16,LwpEditorAttr*>::iterator iter;
++ for (iter =m_EditorAttrMap.begin();iter != m_EditorAttrMap.end(); iter++)
++ {
++ delete iter->second;
++ iter->second = NULL;
++ }
++ m_EditorAttrMap.clear();
++}*/
+diff -urNp lotuswordpro.bak/source/filter/lwpdocdata.hxx lotuswordpro/source/filter/lwpdocdata.hxx
+--- lotuswordpro.bak/source/filter/lwpdocdata.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdocdata.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,191 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef LWPDOCDATA_HXX_
++#define LWPDOCDATA_HXX_
++#include "lwpobj.hxx"
++#include "lwpatomholder.hxx"
++#include "localtime.hxx"
++#include "lwpcolor.hxx"
++#include "xfilter/xfcolor.hxx"
++#include <map>
++
++struct LwpDocOptions
++{
++ sal_uInt16 nOptionFlag;
++ LwpAtomHolder encrypt1password;
++ LwpAtomHolder encrypt2password;
++ LwpAtomHolder characterSet;
++ LwpAtomHolder grammerSet;
++ sal_uInt16 nMarginMarks;
++ sal_uInt16 nMarginMarksLocation;
++ sal_uInt16 nMarginMarksChar;
++};
++struct LwpDocInfo
++{
++ LwpAtomHolder description;
++ LwpAtomHolder keywords;
++ LwpAtomHolder createdBy;
++ sal_Int32 nCreationTime;
++ sal_Int32 nLastRevisionTime;
++ sal_Int32 nTotalEditTime;
++ LwpObjectID cpVerDocInfo;
++ sal_uInt16 nNumEditedBy;
++ //skip editor list
++};
++struct LwpDocControl
++{
++ LwpAtomHolder cGreeting;
++ sal_uInt16 nFlags;
++ sal_uInt16 nDocControlProtection;
++ sal_uInt16 nLen1;
++ //skip doc control password string
++ sal_uInt16 nFileProtection;
++ sal_uInt16 nLen2;
++ //skip file password string
++ sal_uInt16 nAutoVersioning;
++ LwpAtomHolder cDocControlOnlyEditor;
++ sal_uInt16 nEditorVerification;
++};
++struct lcolor
++{
++ sal_uInt16 cred; // When extra is AGLRGB_INDEX, cred holds the
++ sal_uInt16 cgreen; // hi 16 bits and cgreen holds the lo 16 bits of
++ sal_uInt16 cblue; // the 32-bit LUT index.
++ sal_uInt16 cextra;
++};
++struct LwpFontDescriptionOverrideBase
++{
++ sal_uInt8 cOverrideBits;
++ sal_uInt8 cApplyBits;
++ sal_Int32 cPointSize;
++ sal_uInt8 cOverstrike;
++ sal_uInt16 cTightness;
++ //lcolor cColor;
++ //lcolor cBackgroundColor;
++ LwpColor cColor;
++ LwpColor cBackgroundColor;
++};
++struct LwpFontAttributeOverride
++{
++ sal_uInt16 cAttrBits;
++ sal_uInt16 cAttrOverrideBits;
++ sal_uInt16 cAttrApplyBits;
++ sal_uInt8 cAttrOverrideBits2;
++ sal_uInt8 cAttrApplyBits2;
++ sal_uInt8 cCase;
++ sal_uInt8 cUnder;
++};
++struct LwpFontDescriptionOverride
++{
++ LwpFontAttributeOverride cFontAttributeOverride;
++ LwpFontDescriptionOverrideBase cFontDescriptionOverrideBase;
++ LwpAtomHolder cFaceName;
++ LwpAtomHolder cAltFaceName;
++};
++struct LwpOverrideOg
++{
++ sal_uInt16 cValues;
++ sal_uInt16 cOverride;
++ sal_uInt16 cApply;
++};
++struct LwpTextAttributeOverrideOg
++{
++ LwpOverrideOg cOverride;
++ sal_uInt16 cHideLevels;
++ sal_Int32 cBaselineOffset;
++};
++struct LwpEditorAttr
++{
++ LwpAtomHolder cName;
++ LwpAtomHolder cInitials;
++ LwpColor cHiLiteColor;
++ sal_uInt16 nID;
++ LwpFontDescriptionOverride cInsFontOver;
++ LwpFontDescriptionOverride cDelFontOver;
++ sal_uInt16 nAbilities;
++ sal_uInt16 nLocks;
++ sal_uInt16 nSuggestions;
++ LwpTextAttributeOverrideOg cDelTextAttr;
++};
++class LwpDocData : public LwpObject
++{
++public:
++ LwpDocData(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpDocData();
++private:
++ LwpDocOptions m_DocOptions;
++ LwpDocInfo m_DocInfo;
++ LwpDocControl m_DocControl;
++// static std::map<sal_uInt16,LwpEditorAttr*> m_EditorAttrMap;
++private:
++ LtTm m_nCreationTime;
++ LtTm m_nLastRevisionTime;
++ LtTm m_nTotalEditTime;
++private:
++ void SkipExtra(LwpSvStream* pStream);
++ void SkipAtomHandler(LwpSvStream* pStream);
++ rtl::OUString DateTimeToOUString(LtTm& dt);
++ rtl::OUString TimeToOUString(LtTm& dt);
++
++public:
++ //inline sal_uInt8* GetBuffer(){return m_DataBuffer;}
++ void Read();
++ void Parse(IXFStream *pOutputStream);
++// LwpEditorAttr* GetEditorList(){return m_pEditorAttrList;}
++ //static OUString GetEditorName(sal_uInt8 nID);
++ //static XFColor GetHighLightColor(sal_uInt8 nID);
++ //static void Reset();
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpdoc.hxx lotuswordpro/source/filter/lwpdoc.hxx
+--- lotuswordpro.bak/source/filter/lwpdoc.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdoc.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,248 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * LwpDocument header file
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ Jun 2005 Code cleaning by change some members to local variables in Read()
++ ************************************************************************/
++
++#ifndef _LWPDOCUMENT_HXX
++#define _LWPDOCUMENT_HXX
++
++
++#include "lwpobj.hxx"
++#include "lwpsortopt.hxx"
++#include "lwpuidoc.hxx"
++#include "lwplnopts.hxx"
++#include "lwpusrdicts.hxx"
++#include "lwpprtinfo.hxx"
++#include "lwpdlvlist.hxx"
++#include "lwpheader.hxx"
++#include "lwpfoundry.hxx"
++
++class IXFStream;
++class LwpVirtualLayout;
++/**
++ * @brief Document object, represent document and division
++*/
++class LwpDocument : public LwpDLNFPVList
++{
++public:
++ LwpDocument(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpDocument();
++
++private:
++ //Data members in file format
++ LwpObjectID m_DocSockID;
++ sal_uInt16 m_nFlags;
++ sal_uInt32 m_nPersistentFlags;
++ enum
++ {
++ DOC_PROTECTED = 0x00000004UL,
++ /*#define DOC_USECONTENTS 0x00000008UL
++ #define DOC_LOCKREVISIONS 0x00000200UL
++ #define DOC_LOCAL 0x00000400UL
++ */
++ DOC_CHILDDOC = 0x00000800UL
++ /*#define DOC_DOPREVIEW 0x02000000UL
++ #define DOC_REBUILDENDNOTES 0x04000000UL
++ #define DOC_FILEPROTECTION 0x10000000UL
++ #define DOC_PERSISTENTBITS (DOC_PROTECTED | DOC_USECONTENTS | DOC_LOCKREVISIONS | DOC_LOCAL | DOC_CHILDDOC | DOC_DOPREVIEW | DOC_REBUILDENDNOTES | DOC_FILEPROTECTION)
++ */
++ };
++
++ //Code cleaning by change some members to local variables in Read()
++ //Reserve the comments for future use
++ //LwpSortOption* m_pDocSort;
++ //LwpUIDocument* m_pUIDoc;
++ LwpLineNumberOptions* m_pLnOpts;
++ //LwpUserDictFiles* m_pUsrDicts;
++ //LwpPrinterInfo* m_pPrtInfo;
++
++ LwpObjectID m_DivOpts;
++ LwpObjectID m_FootnoteOpts;
++ LwpObjectID m_DocData;
++ LwpObjectID m_DivInfo;
++ LwpAtomHolder m_Epoch;
++
++ LwpObjectID m_WYSIWYGPageHints;
++ LwpObjectID m_VerDoc;
++ LwpObjectID m_STXInfo;
++
++protected:
++ void Read();
++ void ReadPlug();
++ void ParseDocContent(IXFStream* pOutputStream);
++ void RegisterTextStyles();
++ void RegisterLayoutStyles();
++
++ void RegisterStylesInPara();
++ void RegisterBulletStyles();
++ void RegisterGraphicsStyles();
++ void RegisterLinenumberStyles();
++ void RegisterFootnoteStyles();
++ void RegisterDefaultParaStyles();
++ void ParseMasterDoc(IXFStream* pOutputStream);
++
++public:
++ void Parse(IXFStream* pOutputStream);
++ void RegisterStyle();
++
++ inline sal_Bool IsChildDoc();
++ inline sal_Bool HonorProtection();
++ inline LwpObjectID* GetContentList();
++ inline LwpObjectID* GetDocData();
++ inline LwpObjectID* GetSocket();
++
++ inline LwpFoundry* GetFoundry();
++ inline LwpObjectID* GetDivInfoID();
++ inline LwpObjectID* GetPageHintsID();
++ inline LwpObjectID* GetFootnoteOpts();
++ inline LwpObjectID* GetVerDoc();
++ LwpObjectID* GetValidFootnoteOpts();
++
++ sal_uInt16 GetEndnoteType();
++ LwpDocument* GetPreviousDivision();
++ LwpDocument* GetNextDivision();
++ LwpDocument* GetParentDivision();
++ LwpDocument* GetPreviousInGroup();
++
++ LwpDocument* GetNextInGroup();
++ LwpDocument* GetPreviousDivisionWithContents();
++ LwpDocument* GetLastDivisionWithContents();
++ LwpDocument* GetLastInGroupWithContents();
++ LwpDocument* GetRootDocument();
++ LwpDocument* GetFirstDivisionWithContentsThatIsNotOLE();
++ LwpDocument* GetLastDivisionThatHasEndnote();
++
++ LwpDocument* GetLastDivision();
++ LwpDocument* GetFirstDivision();
++ LwpVirtualLayout* GetEnSuperTableLayout();
++ sal_Bool GetNumberOfPages(LwpDocument* pEndDivision, sal_uInt16& nCount);
++ sal_uInt16 GetMaxNumberOfPages();
++
++ sal_uInt16 GetNumberOfPagesBefore();
++ void ParseFrameInPage(IXFStream* pOutputStream);
++
++private:
++ void MaxNumberOfPages(sal_uInt16& nNumPages);
++ void XFConvertFrameInPage(XFContentContainer* pCont);
++ void ChangeStyleName();
++ sal_Bool IsSkippedDivision();//add by
++};
++
++inline sal_Bool LwpDocument::IsChildDoc()
++{
++ return (sal_Bool) ((m_nPersistentFlags & DOC_CHILDDOC) ? TRUE : FALSE);
++}
++inline sal_Bool LwpDocument::HonorProtection()
++{
++ return m_nPersistentFlags & DOC_PROTECTED ? sal_True : sal_False;
++}
++inline LwpObjectID* LwpDocument::GetContentList()
++{
++ return(m_pFoundry->GetContentManager()->GetContentList());
++}
++inline LwpObjectID* LwpDocument::GetSocket()
++{
++ return &m_DocSockID;
++}
++inline LwpFoundry* LwpDocument::GetFoundry()
++{
++ return m_pFoundry;
++}
++inline LwpObjectID* LwpDocument::GetDivInfoID()
++{
++ return &m_DivInfo;
++}
++inline LwpObjectID* LwpDocument::GetPageHintsID()
++{
++ return &m_WYSIWYGPageHints;
++}
++inline LwpObjectID* LwpDocument::GetFootnoteOpts()
++{
++ return &m_FootnoteOpts;
++}
++inline LwpObjectID* LwpDocument::GetDocData()
++{
++ return &m_DocData;
++}
++inline LwpObjectID* LwpDocument::GetVerDoc()
++{
++ return &m_VerDoc;
++}
++
++/**
++ * @brief DocumentSock object, divisions are embedded by document socket object
++*/
++class LwpDocSock : public LwpDLNFVList
++{
++public:
++ LwpDocSock(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpDocSock(){};
++private:
++ LwpObjectID m_Doc;
++protected:
++ void Read();
++public:
++ void RegisterStyle();
++ void Parse(IXFStream* pOutputStream);
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpdrawobj.cxx lotuswordpro/source/filter/lwpdrawobj.cxx
+--- lotuswordpro.bak/source/filter/lwpdrawobj.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdrawobj.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,1552 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * Implementation file of LwpDrawObjcts and associated class like LwpDrawGroup, LwpDrawRectange
++ * and so on.
++ */
++#include "lwpglobalmgr.hxx"
++#include "lwpdrawobj.hxx"
++#include "lwptools.hxx"
++#include <tools/stream.hxx>
++
++#include "xfilter/xfframe.hxx"
++
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xfdrawstyle.hxx"
++#include "xfilter/xftextstyle.hxx"
++#include "xfilter/xfparastyle.hxx"
++#include "xfilter/xfimagestyle.hxx"
++#include "xfilter/xftextboxstyle.hxx"
++#include "xfilter/xfparagraph.hxx"
++#include "xfilter/xftextspan.hxx"
++#include "xfilter/xffont.hxx"
++
++#include "xfilter/xfdrawrect.hxx"
++#include "xfilter/xfdrawpath.hxx"
++#include "xfilter/xfdrawline.hxx"
++#include "xfilter/xfdrawpolygon.hxx"
++#include "xfilter/xfdrawellipse.hxx"
++#include "xfilter/xfdrawcircle.hxx"
++#include "xfilter/xfimage.hxx"
++
++#include "lwpcharsetmgr.hxx"
++#include "lwpsdwrect.hxx"
++
++/**
++ * @descr Constructor of class LwpDrawObj
++ * @param pStream The memory stream which contains the lwp-sdw draw objects
++ */
++LwpDrawObj::LwpDrawObj(SvStream * pStream, DrawingOffsetAndScale* pTransData) :
++m_pStream(pStream), m_pTransData(pTransData), m_eType(OT_UNDEFINED)
++{
++ this->ReadObjHeaderRecord();
++}
++
++/**
++ * @descr read the header record data of lwp-sdw-object
++ */
++void LwpDrawObj::ReadObjHeaderRecord()
++{
++ //flags
++ m_pStream->SeekRel(1);
++
++ //record Length
++ m_pStream->Read(&m_aObjHeader.nRecLen, sizeof(m_aObjHeader.nRecLen));
++
++ //boundrect
++ m_pStream->Read(&m_aObjHeader.nLeft, sizeof(m_aObjHeader.nLeft));
++ m_pStream->Read(&m_aObjHeader.nTop, sizeof(m_aObjHeader.nTop));
++ m_pStream->Read(&m_aObjHeader.nRight, sizeof(m_aObjHeader.nRight));
++ m_pStream->Read(&m_aObjHeader.nBottom, sizeof(m_aObjHeader.nBottom));
++
++ //nextObj, prevObj
++ m_pStream->SeekRel(4);
++}
++
++/**
++ * @descr read the style of closed lwp-sdw-object like: rectangle, ellipse and so on.
++ */
++void LwpDrawObj::ReadClosedObjStyle()
++{
++ if ((m_eType != OT_POLYGON) && (m_eType != OT_TEXTART))
++ {
++ m_pStream->SeekRel(8);
++ }
++
++ m_pStream->Read(&m_aClosedObjStyleRec.nLineWidth, sizeof(m_aClosedObjStyleRec.nLineWidth));
++ m_pStream->Read(&m_aClosedObjStyleRec.nLineStyle, sizeof(m_aClosedObjStyleRec.nLineStyle));
++
++ // pen color
++ m_pStream->Read(&m_aClosedObjStyleRec.aPenColor.nR, 1);
++ m_pStream->Read(&m_aClosedObjStyleRec.aPenColor.nG, 1);
++ m_pStream->Read(&m_aClosedObjStyleRec.aPenColor.nB, 1);
++ m_pStream->Read(&m_aClosedObjStyleRec.aPenColor.unused, 1);
++
++ // foreground color
++ m_pStream->Read(&m_aClosedObjStyleRec.aForeColor.nR, 1);
++ m_pStream->Read(&m_aClosedObjStyleRec.aForeColor.nG, 1);
++ m_pStream->Read(&m_aClosedObjStyleRec.aForeColor.nB, 1);
++ m_pStream->Read(&m_aClosedObjStyleRec.aForeColor.unused, 1);
++
++ // background color
++ m_pStream->Read(&m_aClosedObjStyleRec.aBackColor.nR, 1);
++ m_pStream->Read(&m_aClosedObjStyleRec.aBackColor.nG, 1);
++ m_pStream->Read(&m_aClosedObjStyleRec.aBackColor.nB, 1);
++ m_pStream->Read(&m_aClosedObjStyleRec.aBackColor.unused, 1);
++
++ // fill style
++ m_pStream->Read(&m_aClosedObjStyleRec.nFillType, sizeof(m_aClosedObjStyleRec.nFillType));
++ m_pStream->Read(m_aClosedObjStyleRec.pFillPattern, sizeof(m_aClosedObjStyleRec.pFillPattern));
++}
++
++/**
++ * @descr set fill style of drawing objects
++ * @param pStyle pointer of the drawing xfstyle.
++ */
++void LwpDrawObj::SetFillStyle(XFDrawStyle* pStyle)
++{
++ if (!pStyle)
++ {
++ assert(false);
++ return;
++ }
++
++ XFColor aForeColor(m_aClosedObjStyleRec.aForeColor.nR,
++ m_aClosedObjStyleRec.aForeColor.nG, m_aClosedObjStyleRec.aForeColor.nB);
++ XFColor aBackColor(m_aClosedObjStyleRec.aBackColor.nR,
++ m_aClosedObjStyleRec.aBackColor.nG, m_aClosedObjStyleRec.aBackColor.nB);
++
++ switch (m_aClosedObjStyleRec.nFillType)
++ {
++ default: //fall through!
++ case FT_TRANSPARENT:
++ {
++ // set fill style : none
++ break;
++ }
++ case FT_SOLID:
++ {
++ pStyle->SetAreaColor(aForeColor);
++ break;
++ }
++ case FT_HORZHATCH:
++ {
++ pStyle->SetAreaColor(aBackColor);
++ pStyle->SetAreaLineStyle(enumXFAreaLineSingle, 0, 0.12, aForeColor);
++ break;
++ }
++ case FT_VERTHATCH:
++ {
++ pStyle->SetAreaColor(aBackColor);
++ pStyle->SetAreaLineStyle(enumXFAreaLineSingle, 90, 0.12, aForeColor);
++ break;
++ }
++ case FT_FDIAGHATCH:
++ {
++ pStyle->SetAreaColor(aBackColor);
++ pStyle->SetAreaLineStyle(enumXFAreaLineSingle, 135, 0.09, aForeColor);
++ break;
++ }
++ case FT_BDIAGHATCH:
++ {
++ pStyle->SetAreaColor(aBackColor);
++ pStyle->SetAreaLineStyle(enumXFAreaLineSingle, 45, 0.09, aForeColor);
++ break;
++ }
++ case FT_CROSSHATCH:
++ {
++ pStyle->SetAreaColor(aBackColor);
++ pStyle->SetAreaLineStyle(enumXFAreaLineCrossed, 0, 0.12, aForeColor);
++ break;
++ }
++ case FT_DIAGCROSSHATCH:
++ {
++ pStyle->SetAreaColor(aBackColor);
++ pStyle->SetAreaLineStyle(enumXFAreaLineCrossed, 45, 0.095, aForeColor);
++ break;
++ }
++ }
++}
++
++/**
++ * @descr set line/border style of drawing objects.
++ * @param pStyle pointer of the drawing xfstyle.
++ * @param nWidth width of line/border.
++ * @param nLineStyle flag of line/border style: none, dot or solid.
++ * @param rColor color of line/border.
++ */
++void LwpDrawObj::SetLineStyle(XFDrawStyle* pStyle, sal_uInt8 nWidth, sal_uInt8 nLineStyle,
++ const SdwColor& rColor)
++{
++ if (!pStyle)
++ {
++ assert(false);
++ return;
++ }
++ if (nWidth == 0)
++ {
++ nLineStyle = LS_NULL;
++ }
++
++ if (nLineStyle == LS_NULL)
++ {
++ // set stroke:none
++ return;
++ }
++
++ if (nLineStyle == LS_DOT)
++ {
++ pStyle->SetLineDashStyle(enumXFLineDash, 1, 1, 0.05, 0.05, 0.05);
++ }
++
++ // line width
++ double fWidth = (double)nWidth/TWIPS_PER_CM;
++
++ // line color
++ XFColor aXFColor(rColor.nR, rColor.nG, rColor.nB);
++
++ pStyle->SetLineStyle(fWidth, aXFColor);
++}
++
++/**
++ * @descr set position of a drawing object in the frame.
++ * @param pObj pointer of the xf-drawing object
++ */
++void LwpDrawObj::SetPosition(XFFrame* pObj)
++{
++ double fOffsetX = 0.00, fOffsetY = 0.00;
++ double fScaleX = 1.00, fScaleY = 1.00;
++ if (m_pTransData)
++ {
++ fOffsetX = m_pTransData->fOffsetX;
++ fOffsetY = m_pTransData->fOffsetY;
++ fScaleX = m_pTransData->fScaleX;
++ fScaleY = m_pTransData->fScaleY;
++ }
++
++ pObj->SetPosition((double)m_aObjHeader.nLeft/TWIPS_PER_CM * fScaleX+ fOffsetX,
++ (double)m_aObjHeader.nTop/TWIPS_PER_CM * fScaleY + fOffsetY,
++ (double)(m_aObjHeader.nRight-m_aObjHeader.nLeft)/TWIPS_PER_CM * fScaleX,
++ (double)(m_aObjHeader.nBottom-m_aObjHeader.nTop)/TWIPS_PER_CM * fScaleY);
++}
++
++/**
++ * @descr set arrowhead of a xf-drawing object. only opened drawing objects can be assigned arrowheads
++ * @param pOpenedObjStyle the xf-drawing object which will be set arrowhead.
++ * @param nArrowFlag arrowhead flags of the object.
++ */
++void LwpDrawObj::SetArrowHead(XFDrawStyle* pOpenedObjStyle, sal_uInt8 nArrowFlag, sal_uInt8 nLineWidth)
++{
++ // no arrowhead
++ if (!nArrowFlag)
++ {
++ return;
++ }
++
++ if (!pOpenedObjStyle)
++ {
++ assert(false);
++ return;
++ }
++
++ // arrowhead flag of an object's start side
++ sal_uInt8 nLeftArrow = nArrowFlag & 0x0F;
++
++ // arrowhead flag of an object's end side
++ sal_uInt8 nRightArrow = (nArrowFlag & 0xF0) >> 4;
++
++ double fWidth_inch = (double)nLineWidth/TWIPS_PER_CM;
++ double fArrowSize_inch = fWidth_inch + 0.08;
++ double fArrowSize = fArrowSize_inch * CM_PER_INCH;
++
++ if (nLeftArrow)
++ {
++ pOpenedObjStyle->SetArrowStart( this->GetArrowName(nLeftArrow), fArrowSize, sal_True);
++ }
++ if (nRightArrow)
++ {
++ pOpenedObjStyle->SetArrowEnd( this->GetArrowName(nRightArrow), fArrowSize, sal_True);
++ }
++
++}
++
++/**
++ * @descr get arrow style name according to the flag.
++ * @param nArrowStyle style of the arrowhead.
++ * @return nWhichSide style name of the arrowhead.
++ */
++rtl::OUString LwpDrawObj::GetArrowName(sal_uInt8 nArrowStyle)
++{
++ // style name of arrowhead
++ rtl::OUString aArrowName;
++
++ switch(nArrowStyle)
++ {
++ default:
++ case AH_ARROW_FULLARROW:
++ aArrowName = rtl::OUString::createFromAscii("Symmetric arrow");
++ break;
++ case AH_ARROW_HALFARROW:
++ aArrowName = rtl::OUString::createFromAscii("Arrow concave");
++ break;
++ case AH_ARROW_LINEARROW:
++ aArrowName = rtl::OUString::createFromAscii("arrow100");
++ break;
++ case AH_ARROW_INVFULLARROW:
++ aArrowName = rtl::OUString::createFromAscii("reverse arrow");
++ break;
++ case AH_ARROW_INVHALFARROW:
++ aArrowName = rtl::OUString::createFromAscii("reverse concave arrow");
++ break;
++ case AH_ARROW_INVLINEARROW:
++ aArrowName = rtl::OUString::createFromAscii("reverse line arrow");
++ break;
++ case AH_ARROW_TEE:
++ aArrowName = rtl::OUString::createFromAscii("Dimension lines");
++ break;
++ case AH_ARROW_SQUARE:
++ aArrowName = rtl::OUString::createFromAscii("Square");
++ break;
++ case AH_ARROW_CIRCLE:
++ aArrowName = rtl::OUString::createFromAscii("Circle");
++ break;
++ }
++
++ return aArrowName;
++}
++
++/**
++ * @descr template method of creating drawing object from Lwp-Model to XF-Model
++ * @return pointer of the drawing object of XF-Model.
++ */
++XFFrame* LwpDrawObj::CreateXFDrawObject()
++{
++ // read records
++ this->Read();
++
++ // register style
++ rtl::OUString aStyleName = this->RegisterStyle();
++
++ // create XF-Objects
++ XFFrame* pXFObj = NULL;
++ if (m_pTransData
++ && FABS(m_pTransData->fOffsetX - m_pTransData->fLeftMargin) < THRESHOLD
++ && FABS(m_pTransData->fOffsetY - m_pTransData->fTopMargin) < THRESHOLD
++ && FABS(m_pTransData->fScaleX - 1.0) < THRESHOLD
++ && FABS(m_pTransData->fScaleY - 1.0) < THRESHOLD)
++ {
++ pXFObj = this->CreateStandardDrawObj(aStyleName);
++ }
++ else
++ {
++ pXFObj = this->CreateDrawObj(aStyleName);
++ }
++
++ // set anchor type
++ if (pXFObj)
++ {
++ pXFObj->SetAnchorType(enumXFAnchorFrame);
++ }
++
++ return pXFObj;
++}
++
++/**
++ * @descr Constructor of class LwpDrawLine
++ * @param pStream The memory stream which contains the lwp-sdw draw objects
++ */
++LwpDrawLine::LwpDrawLine(SvStream * pStream, DrawingOffsetAndScale* pTransData)
++: LwpDrawObj(pStream, pTransData)
++{
++}
++
++/**
++ * @descr reading function of class LwpDrawLine
++ */
++void LwpDrawLine::Read()
++{
++ m_pStream->Read(&m_aLineRec.nStartX, sizeof(m_aLineRec.nStartX));
++ m_pStream->Read(&m_aLineRec.nStartY, sizeof(m_aLineRec.nStartY));
++ m_pStream->Read(&m_aLineRec.nEndX, sizeof(m_aLineRec.nEndX));
++ m_pStream->Read(&m_aLineRec.nEndY, sizeof(m_aLineRec.nEndY));
++ m_pStream->Read(&m_aLineRec.nLineWidth, sizeof(m_aLineRec.nLineWidth));
++ m_pStream->Read(&m_aLineRec.nLineEnd,sizeof(m_aLineRec.nLineEnd));
++ m_pStream->Read(&m_aLineRec.nLineStyle, sizeof(m_aLineRec.nLineStyle));
++
++ m_pStream->Read(&m_aLineRec.aPenColor.nR, 1);
++ m_pStream->Read(&m_aLineRec.aPenColor.nG, 1);
++ m_pStream->Read(&m_aLineRec.aPenColor.nB, 1);
++ m_pStream->Read(&m_aLineRec.aPenColor.unused, 1);
++}
++
++rtl::OUString LwpDrawLine::RegisterStyle()
++{
++ XFDrawStyle* pStyle = new XFDrawStyle();
++
++ // set line style
++ this->SetLineStyle(pStyle, m_aLineRec.nLineWidth, m_aLineRec.nLineStyle, m_aLineRec.aPenColor);
++
++ // set arrow head
++ this->SetArrowHead(pStyle, m_aLineRec.nLineEnd, m_aLineRec.nLineWidth);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ return pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++
++}
++
++XFFrame* LwpDrawLine::CreateDrawObj(const rtl::OUString& rStyleName )
++{
++ XFDrawPath* pLine = new XFDrawPath();
++ pLine->MoveTo(XFPoint((double)(m_aLineRec.nStartX)/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)(m_aLineRec.nStartY)/TWIPS_PER_CM * m_pTransData->fScaleY));
++ pLine->LineTo(XFPoint((double)(m_aLineRec.nEndX)/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)(m_aLineRec.nEndY)/TWIPS_PER_CM * m_pTransData->fScaleY));
++ this->SetPosition(pLine);
++
++ pLine->SetStyleName(rStyleName);
++
++ return pLine;
++}
++
++XFFrame* LwpDrawLine::CreateStandardDrawObj(const OUString& rStyleName)
++{
++ XFDrawLine* pLine = new XFDrawLine();
++ pLine->SetStartPoint((double)(m_aLineRec.nStartX)/TWIPS_PER_CM,(double)(m_aLineRec.nStartY)/TWIPS_PER_CM);
++ pLine->SetEndPoint((double)(m_aLineRec.nEndX)/TWIPS_PER_CM,(double)(m_aLineRec.nEndY)/TWIPS_PER_CM);
++
++ pLine->SetStyleName(rStyleName);
++ return pLine;
++}
++
++/**
++ * @descr Constructor of class LwpDrawPolyLine
++ * @param pStream The memory stream which contains the lwp-sdw draw objects
++ */
++LwpDrawPolyLine::LwpDrawPolyLine(SvStream * pStream, DrawingOffsetAndScale* pTransData)
++: LwpDrawObj(pStream, pTransData), m_pVector(NULL)
++{
++}
++LwpDrawPolyLine::~LwpDrawPolyLine()
++{
++ if (m_pVector)
++ {
++ delete [] m_pVector;
++ m_pVector = NULL;
++ }
++}
++
++/**
++ * @descr reading function of class LwpDrawPolyLine
++ */
++void LwpDrawPolyLine::Read()
++{
++ m_pStream->Read(&m_aPolyLineRec.nLineWidth, 1);
++ m_pStream->Read(&m_aPolyLineRec.nLineEnd, 1);
++ m_pStream->Read(&m_aPolyLineRec.nLineStyle, 1);
++ m_pStream->Read(&m_aPolyLineRec.aPenColor.nR, 1);
++ m_pStream->Read(&m_aPolyLineRec.aPenColor.nG, 1);
++ m_pStream->Read(&m_aPolyLineRec.aPenColor.nB, 1);
++ m_pStream->Read(&m_aPolyLineRec.aPenColor.unused, 1);
++ m_pStream->Read(&m_aPolyLineRec.nNumPoints, 2);
++
++ m_pVector= new SdwPoint [m_aPolyLineRec.nNumPoints];
++
++ for (sal_uInt16 nC = 0; nC < m_aPolyLineRec.nNumPoints; nC++)
++ {
++ m_pStream->Read(&m_pVector[nC].x,2);
++ m_pStream->Read(&m_pVector[nC].y,2);
++ }
++}
++
++rtl::OUString LwpDrawPolyLine::RegisterStyle()
++{
++ XFDrawStyle* pStyle = new XFDrawStyle();
++
++ // set line style
++ this->SetLineStyle(pStyle, m_aPolyLineRec.nLineWidth, m_aPolyLineRec.nLineStyle,
++ m_aPolyLineRec.aPenColor);
++
++ // set arrow head
++ this->SetArrowHead(pStyle, m_aPolyLineRec.nLineEnd, m_aPolyLineRec.nLineWidth);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ return pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++}
++
++XFFrame* LwpDrawPolyLine::CreateDrawObj(const rtl::OUString& rStyleName )
++{
++ XFDrawPath* pPolyline = new XFDrawPath();
++ pPolyline->MoveTo(XFPoint((double)m_pVector[0].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_pVector[0].y/TWIPS_PER_CM * m_pTransData->fScaleY));
++ for (sal_uInt8 nC = 1; nC < m_aPolyLineRec.nNumPoints; nC++)
++ {
++ pPolyline->LineTo(XFPoint((double)m_pVector[nC].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_pVector[nC].y/TWIPS_PER_CM * m_pTransData->fScaleY));
++ }
++ this->SetPosition(pPolyline);
++
++ pPolyline->SetStyleName(rStyleName);
++
++ return pPolyline;
++}
++
++XFFrame* LwpDrawPolyLine::CreateStandardDrawObj(const OUString& rStyleName)
++{
++ XFDrawPolyline* pPolyline = new XFDrawPolyline();
++ for (sal_uInt8 nC = 0; nC < m_aPolyLineRec.nNumPoints; nC++)
++ {
++ pPolyline->AddPoint((double)m_pVector[nC].x/TWIPS_PER_CM,
++ (double)m_pVector[nC].y/TWIPS_PER_CM);
++ }
++
++ pPolyline->SetStyleName(rStyleName);
++
++ return pPolyline;
++}
++
++/**
++ * @descr Constructor of class LwpDrawPolygon
++ * @param pStream The memory stream which contains the lwp-sdw draw objects
++ */
++LwpDrawPolygon::LwpDrawPolygon(SvStream * pStream, DrawingOffsetAndScale* pTransData)
++: LwpDrawObj(pStream, pTransData)
++{
++}
++LwpDrawPolygon::~LwpDrawPolygon()
++{
++ if (m_pVector)
++ {
++ delete m_pVector;
++ m_pVector = NULL;
++ }
++}
++
++/**
++ * @descr reading function of class LwpDrawPolygon
++ */
++void LwpDrawPolygon::Read()
++{
++ this->ReadClosedObjStyle();
++ m_pStream->Read(&m_nNumPoints, sizeof(m_nNumPoints));
++
++ m_pVector = new SdwPoint [m_nNumPoints];
++
++ for (sal_uInt16 nC = 0; nC < m_nNumPoints; nC++)
++ {
++ m_pStream->Read(&m_pVector[nC].x, 2);
++ m_pStream->Read(&m_pVector[nC].y, 2);
++ }
++}
++
++rtl::OUString LwpDrawPolygon::RegisterStyle()
++{
++ XFDrawStyle* pStyle = new XFDrawStyle();
++
++ // set line style
++ this->SetLineStyle(pStyle, m_aClosedObjStyleRec.nLineWidth, m_aClosedObjStyleRec.nLineStyle,
++ m_aClosedObjStyleRec.aPenColor);
++
++ // set fill style
++ this->SetFillStyle(pStyle);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ return pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++}
++
++XFFrame* LwpDrawPolygon::CreateDrawObj(const rtl::OUString& rStyleName)
++{
++ XFDrawPath* pPolygon = new XFDrawPath();
++ pPolygon->MoveTo(XFPoint((double)m_pVector[0].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_pVector[0].y/TWIPS_PER_CM * m_pTransData->fScaleY));
++ for (sal_uInt16 nC = 1; nC < m_nNumPoints; nC++)
++ {
++ pPolygon->LineTo(XFPoint((double)m_pVector[nC].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_pVector[nC].y/TWIPS_PER_CM * m_pTransData->fScaleY));
++ }
++ pPolygon->ClosePath();
++ this->SetPosition(pPolygon);
++ pPolygon->SetStyleName(rStyleName);
++
++ return pPolygon;
++}
++
++XFFrame* LwpDrawPolygon::CreateStandardDrawObj(const OUString& rStyleName)
++{
++ XFDrawPolygon* pPolygon = new XFDrawPolygon();
++ for (sal_uInt16 nC = 0; nC < m_nNumPoints; nC++)
++ {
++ pPolygon->AddPoint((double)m_pVector[nC].x/TWIPS_PER_CM,
++ (double)m_pVector[nC].y/TWIPS_PER_CM);
++ }
++
++ pPolygon->SetStyleName(rStyleName);
++
++ return pPolygon;
++}
++
++/**
++ * @descr Constructor of class LwpDrawRectangle
++ * @param pStream The memory stream which contains the lwp-sdw draw objects
++ */
++LwpDrawRectangle::LwpDrawRectangle(SvStream * pStream, DrawingOffsetAndScale* pTransData)
++: LwpDrawObj(pStream, pTransData)
++{
++}
++
++/**
++ * @descr reading function of class LwpDrawRectangle
++ */
++void LwpDrawRectangle::Read()
++{
++ this->ReadClosedObjStyle();
++
++
++ sal_uInt8 nPointsCount;
++ if (m_eType == OT_RNDRECT)
++ {
++ nPointsCount = 16;
++ m_pStream->SeekRel(4); // corner points
++ }
++ else
++ {
++ nPointsCount = 4;
++ }
++
++ for (sal_uInt8 nC = 0; nC < nPointsCount; nC++)
++ {
++ m_pStream->Read(&m_aVector[nC].x,2);
++ m_pStream->Read(&m_aVector[nC].y,2);
++ }
++}
++
++rtl::OUString LwpDrawRectangle::RegisterStyle()
++{
++ XFDrawStyle* pStyle = new XFDrawStyle();
++
++ // set line style
++ this->SetLineStyle(pStyle, m_aClosedObjStyleRec.nLineWidth, m_aClosedObjStyleRec.nLineStyle,
++ m_aClosedObjStyleRec.aPenColor);
++
++ // set fill style
++ this->SetFillStyle(pStyle);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ return pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++}
++
++XFFrame* LwpDrawRectangle::CreateDrawObj(const rtl::OUString& rStyleName)
++{
++ if (m_eType == OT_RNDRECT)
++ {
++ return this->CreateRoundedRect(rStyleName);
++ }
++ else
++ {
++ XFDrawPath* pRect = new XFDrawPath();
++ pRect->MoveTo(XFPoint((double)m_aVector[0].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_aVector[0].y/TWIPS_PER_CM * m_pTransData->fScaleY));
++ for (sal_uInt8 nC = 1; nC < 4; nC++)
++ {
++ pRect->LineTo(XFPoint((double)m_aVector[nC].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_aVector[nC].y/TWIPS_PER_CM * m_pTransData->fScaleY));
++ }
++ pRect->LineTo(XFPoint((double)m_aVector[0].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_aVector[0].y/TWIPS_PER_CM * m_pTransData->fScaleY));
++ pRect->ClosePath(sal_True);
++ this->SetPosition(pRect);
++
++ pRect->SetStyleName(rStyleName);
++
++ return pRect;
++ }
++}
++
++XFFrame* LwpDrawRectangle::CreateRoundedRect(const rtl::OUString& rStyleName)
++{
++ XFDrawPath* pRoundedRect = new XFDrawPath();
++ pRoundedRect->MoveTo(XFPoint((double)m_aVector[0].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_aVector[0].y/TWIPS_PER_CM * m_pTransData->fScaleY));
++
++ sal_uInt8 nPtIndex = 1;
++ for (sal_uInt8 nC = 0; nC < 7; nC++)
++ {
++ if (nC%2 == 0)
++ {
++ XFPoint aCtrl1((double)m_aVector[nPtIndex].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_aVector[nPtIndex].y/TWIPS_PER_CM * m_pTransData->fScaleY);
++ nPtIndex++;
++ XFPoint aCtrl2((double)m_aVector[nPtIndex].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_aVector[nPtIndex].y/TWIPS_PER_CM * m_pTransData->fScaleY);
++ nPtIndex++;
++ XFPoint aDest((double)m_aVector[nPtIndex].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_aVector[nPtIndex].y/TWIPS_PER_CM * m_pTransData->fScaleY);
++ nPtIndex++;
++
++ pRoundedRect->CurveTo(aDest, aCtrl1, aCtrl2);
++ }
++ else
++ {
++ XFPoint aDest((double)m_aVector[nPtIndex].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_aVector[nPtIndex].y/TWIPS_PER_CM * m_pTransData->fScaleY);
++ nPtIndex++;
++
++ pRoundedRect->LineTo(aDest);
++ }
++ }
++
++ pRoundedRect->LineTo(XFPoint((double)m_aVector[0].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_aVector[0].y/TWIPS_PER_CM * m_pTransData->fScaleY));
++ pRoundedRect->ClosePath(sal_True);
++ this->SetPosition(pRoundedRect);
++
++ pRoundedRect->SetStyleName(rStyleName);
++
++ return pRoundedRect;
++}
++
++XFFrame* LwpDrawRectangle::CreateStandardDrawObj(const OUString& rStyleName)
++{
++ if (m_eType == OT_RNDRECT)
++ {
++ return this->CreateRoundedRect(rStyleName);
++ }
++ else
++ {
++ XFDrawRect* pRect = new XFDrawRect();
++ double fStartX, fStartY, fWidth, fHeight;
++ double fRotAngle = 0.0;
++ SdwRectangle aSdwRect;
++ Rectangle aOriginalRect;
++ Point aPt0, aPt1, aPt2, aPt3;
++
++ aPt0.setX(m_aVector[0].x); aPt0.setY(m_aVector[0].y);
++ aPt1.setX(m_aVector[1].x); aPt1.setY(m_aVector[1].y);
++ aPt2.setX(m_aVector[2].x); aPt2.setY(m_aVector[2].y);
++ aPt3.setX(m_aVector[3].x); aPt3.setY(m_aVector[3].y);
++
++ aSdwRect = SdwRectangle(aPt0, aPt1, aPt2, aPt3);
++ if (aSdwRect.IsRectRotated())
++ {
++ aOriginalRect = aSdwRect.GetOriginalRect();
++ fRotAngle = aSdwRect.GetRotationAngle();
++ }
++ else
++ {
++ aOriginalRect = Rectangle(aPt0, aPt2);
++ }
++
++ fStartX = aOriginalRect.TopLeft().X();
++ fStartY = aOriginalRect.TopLeft().Y();
++ fWidth = aOriginalRect.GetWidth();
++ fHeight = aOriginalRect.GetHeight();
++
++ pRect->SetStartPoint(XFPoint(fStartX/TWIPS_PER_CM + m_pTransData->fOffsetX,
++ fStartY/TWIPS_PER_CM + m_pTransData->fOffsetY));
++ pRect->SetSize(fWidth/TWIPS_PER_CM, fHeight/TWIPS_PER_CM);
++
++ if (aSdwRect.IsRectRotated())
++ {
++ pRect->SetRotate( fRotAngle / PI * 180);// aXFCenter);
++ }
++
++ pRect->SetStyleName(rStyleName);
++
++ return pRect;
++ }
++}
++
++/**
++ * @descr Constructor of class LwpDrawEllipse
++ * @param pStream The memory stream which contains the lwp-sdw draw objects
++ */
++LwpDrawEllipse::LwpDrawEllipse(SvStream * pStream, DrawingOffsetAndScale* pTransData)
++: LwpDrawObj(pStream, pTransData)
++{
++}
++
++/**
++ * @descr reading function of class LwpDrawEllipse
++ */
++void LwpDrawEllipse::Read()
++{
++ this->ReadClosedObjStyle();
++
++ for (sal_uInt8 nC = 0; nC < 13; nC++)
++ {
++ m_pStream->Read(&m_aVector[nC].x,2);
++ m_pStream->Read(&m_aVector[nC].y,2);
++ }
++}
++
++rtl::OUString LwpDrawEllipse::RegisterStyle()
++{
++ XFDrawStyle* pStyle = new XFDrawStyle();
++
++ // set line style
++ this->SetLineStyle(pStyle, m_aClosedObjStyleRec.nLineWidth, m_aClosedObjStyleRec.nLineStyle,
++ m_aClosedObjStyleRec.aPenColor);
++
++ // set fill style
++ this->SetFillStyle(pStyle);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ return pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++}
++
++XFFrame* LwpDrawEllipse::CreateDrawObj(const rtl::OUString& rStyleName )
++{
++ XFDrawPath* pEllipse = new XFDrawPath();
++ pEllipse->MoveTo(XFPoint((double)m_aVector[0].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_aVector[0].y/TWIPS_PER_CM * m_pTransData->fScaleY));
++ sal_uInt8 nPtIndex = 1;
++ for (sal_uInt8 nC = 0; nC < 4; nC++)
++ {
++ XFPoint aCtrl1((double)m_aVector[nPtIndex].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_aVector[nPtIndex].y/TWIPS_PER_CM * m_pTransData->fScaleY);
++ nPtIndex++;
++ XFPoint aCtrl2((double)m_aVector[nPtIndex].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_aVector[nPtIndex].y/TWIPS_PER_CM * m_pTransData->fScaleY);
++ nPtIndex++;
++ XFPoint aDest((double)m_aVector[nPtIndex].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_aVector[nPtIndex].y/TWIPS_PER_CM * m_pTransData->fScaleY);
++ nPtIndex++;
++
++ pEllipse->CurveTo(aDest, aCtrl1, aCtrl2);
++ }
++ pEllipse->ClosePath(sal_True);
++ this->SetPosition(pEllipse);
++
++ pEllipse->SetStyleName(rStyleName);
++
++ return pEllipse;
++}
++
++XFFrame* LwpDrawEllipse::CreateStandardDrawObj(const OUString& rStyleName)
++{
++ return this->CreateDrawObj(rStyleName);
++}
++
++/**
++ * @descr Constructor of class LwpDrawArc
++ * @param pStream The memory stream which contains the lwp-sdw draw objects
++ */
++LwpDrawArc::LwpDrawArc(SvStream * pStream, DrawingOffsetAndScale* pTransData)
++: LwpDrawObj(pStream, pTransData)
++{
++}
++
++/**
++ * @descr reading function of class LwpDrawArc
++ */
++void LwpDrawArc::Read()
++{
++ m_pStream->SeekRel(16);// arcRect, startPt, endPt
++
++ m_pStream->Read(&m_aArcRec.nLineWidth, sizeof(m_aArcRec.nLineWidth));
++ m_pStream->Read(&m_aArcRec.nLineStyle, sizeof(m_aArcRec.nLineStyle));
++ m_pStream->Read(&m_aArcRec.aPenColor.nR, 1);
++ m_pStream->Read(&m_aArcRec.aPenColor.nG, 1);
++ m_pStream->Read(&m_aArcRec.aPenColor.nB, 1);
++ m_pStream->Read(&m_aArcRec.aPenColor.unused, 1);
++ m_pStream->Read(&m_aArcRec.nLineEnd, sizeof(m_aArcRec.nLineEnd));
++
++ for (sal_uInt8 nC = 0; nC < 4; nC++)
++ {
++ m_pStream->Read(&m_aVector[nC].x,2);
++ m_pStream->Read(&m_aVector[nC].y,2);
++ }
++}
++
++rtl::OUString LwpDrawArc::RegisterStyle()
++{
++ XFDrawStyle* pStyle = new XFDrawStyle();
++
++ // set line style
++ this->SetLineStyle(pStyle, m_aArcRec.nLineWidth, m_aArcRec.nLineStyle,
++ m_aArcRec.aPenColor);
++
++ // set arrow head
++ this->SetArrowHead(pStyle, m_aArcRec.nLineEnd, m_aArcRec.nLineWidth);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ return pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++}
++
++XFFrame* LwpDrawArc::CreateDrawObj(const rtl::OUString& rStyleName )
++{
++ XFDrawPath* pArc = new XFDrawPath();
++ pArc->MoveTo(XFPoint((double)m_aVector[0].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_aVector[0].y/TWIPS_PER_CM * m_pTransData->fScaleY));
++ XFPoint aDest((double)m_aVector[3].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_aVector[3].y/TWIPS_PER_CM * m_pTransData->fScaleY);
++ XFPoint aCtl1((double)m_aVector[1].x/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)m_aVector[1].y/TWIPS_PER_CM * m_pTransData->fScaleY);
++ XFPoint aCtl2((double)m_aVector[2].x/TWIPS_PER_CM* m_pTransData->fScaleX,
++ (double)m_aVector[2].y/TWIPS_PER_CM * m_pTransData->fScaleY);
++ pArc->CurveTo(aDest, aCtl1, aCtl2);
++// pArc->CurveTo(XFPoint((double)m_aVector[3].x/TWIPS_PER_CM, (double)m_aVector[3].y/TWIPS_PER_CM),
++// XFPoint((double)m_aVector[1].x/TWIPS_PER_CM, (double)m_aVector[1].y/TWIPS_PER_CM),
++// XFPoint((double)m_aVector[2].x/TWIPS_PER_CM, (double)m_aVector[2].y/TWIPS_PER_CM));
++ this->SetPosition(pArc);
++
++ pArc->SetStyleName(rStyleName);
++
++ return pArc;
++}
++
++XFFrame* LwpDrawArc::CreateStandardDrawObj(const OUString& rStyleName)
++{
++ return this->CreateDrawObj(rStyleName);
++}
++
++/**
++ * @descr Constructor of class LwpDrawTextBox
++ * @param pStream The memory stream which contains the lwp-sdw draw objects
++ */
++LwpDrawTextBox::LwpDrawTextBox(SvStream* pStream) : LwpDrawObj(pStream)
++{
++}
++
++LwpDrawTextBox::~LwpDrawTextBox()
++{
++ if (m_aTextRec.pTextString)
++ {
++ delete [] m_aTextRec.pTextString;
++ m_aTextRec.pTextString = NULL;
++ }
++}
++
++void LwpDrawTextBox::SetFontStyle(XFFont* pFont, SdwTextBoxRecord* pRec)
++{
++ // color
++ XFColor aXFColor(pRec->aTextColor.nR, pRec->aTextColor.nG,
++ pRec->aTextColor.nB);
++ pFont->SetColor(aXFColor);
++ //size
++ pFont->SetFontSize(pRec->nTextSize/20);
++ // bold
++ pFont->SetBold((sal_Bool)((pRec->nTextAttrs & TA_BOLD) != 0));
++ // italic
++ pFont->SetItalic((sal_Bool)((pRec->nTextAttrs & TA_ITALIC) != 0));
++ // strike-through
++ if (pRec->nTextAttrs & TA_STRIKETHRU)
++ {
++ pFont->SetCrossout(enumXFCrossoutSignel);
++ }
++ else
++ {
++ pFont->SetCrossout(enumXFCrossoutNone);
++ }
++ // underline
++ if (pRec->nTextAttrs & TA_UNDERLINE)
++ {
++ pFont->SetUnderline(enumXFUnderlineSingle);
++ }
++ else if (pRec->nTextAttrs & TA_WORDUNDERLINE)
++ {
++ pFont->SetUnderline(enumXFUnderlineSingle, sal_True);
++ }
++ else if (pRec->nTextAttrs & TA_DOUBLEUNDER)
++ {
++ pFont->SetUnderline(enumXFUnderlineDouble);
++ }
++ else
++ {
++ pFont->SetUnderline(enumXFUnderlineNone);
++ }
++ // small-caps
++ if (pRec->nTextAttrs & TA_SMALLCAPS)
++ {
++ pFont->SetTransform(enumXFTransformSmallCaps);
++ }
++}
++
++/**
++ * @descr reading function of class LwpDrawTextBox
++ */
++void LwpDrawTextBox::Read()
++{
++ m_pStream->Read(&m_aVector.x, 2);
++ m_pStream->Read(&m_aVector.y, 2);
++ m_pStream->Read(&m_aTextRec.nTextWidth, sizeof(m_aTextRec.nTextWidth));
++
++ if (m_aTextRec.nTextWidth == 0)
++ {
++ m_aTextRec.nTextWidth = 1;
++ }
++
++ m_pStream->Read(&m_aTextRec.nTextHeight, sizeof(m_aTextRec.nTextHeight));
++ m_pStream->Read(m_aTextRec.tmpTextFaceName, DRAW_FACESIZE);
++ m_pStream->SeekRel(1);// PitchAndFamily
++
++ m_pStream->Read(&m_aTextRec.nTextSize, sizeof(m_aTextRec.nTextSize));
++
++ bool TextSizeIsCellHeight = true;
++ if (m_aTextRec.nTextSize < 0)
++ {
++ TextSizeIsCellHeight = false;
++ m_aTextRec.nTextSize = -m_aTextRec.nTextSize;
++ }
++
++ //color
++ m_pStream->Read(&m_aTextRec.aTextColor.nR, 1);
++ m_pStream->Read(&m_aTextRec.aTextColor.nG, 1);
++ m_pStream->Read(&m_aTextRec.aTextColor.nB, 1);
++ m_pStream->Read(&m_aTextRec.aTextColor.unused, 1);
++
++ m_pStream->Read(&m_aTextRec.nTextAttrs, sizeof(m_aTextRec.nTextAttrs));
++ m_pStream->Read(&m_aTextRec.nTextCharacterSet, sizeof(m_aTextRec.nTextCharacterSet));
++ m_pStream->Read(&m_aTextRec.nTextRotation, sizeof(m_aTextRec.nTextRotation));
++ m_pStream->Read(&m_aTextRec.nTextExtraSpacing, sizeof(m_aTextRec.nTextExtraSpacing));
++
++ /*#ifdef JAPANESE_ENABLED //For Amipro Support KOBA-WADA
++ lubyte compText[3];
++ lsshort TextLength;
++ lubyte * pTextString;
++ cBinaryData.GetUBytes(compText, 2);
++ compText[2] = '\0';
++ if (compText[0] == 0 && compText[1] == 0 && recLen > 105 )
++ {
++ // AmiPro R3.1J's extended text object format
++ TextLength = recLen - 71 - 34;
++ cBinaryData.SkipUBytes(32);
++
++ pTextString = new lubyte[TextLength];
++
++ LASSERT(pTextString != LNULL);
++
++ cBinaryData.GetUBytes(pTextString, TextLength);
++ }
++ else
++ {
++ // AmiPro R3.X original text object format
++
++ // some draw files in version 1.2 have an extra byte following '\0'.
++ // can't rely on that, so read in the whole string into memory.
++ TextLength = recLen - 71;
++ pTextString = new lubyte[TextLength];
++
++ LASSERT(pTextString != LNULL);
++
++ strcpy((char *)pTextString, (const char *)compText);
++ cBinaryData.GetUBytes(pTextString + 2, TextLength - 2);
++ }
++#else*/
++ // some draw files in version 1.2 have an extra byte following '\0'.
++ // can't rely on that, so read in the whole string into memory.
++
++ // the 71 is the fixed length before text content in textbox record
++ sal_Int16 TextLength = m_aObjHeader.nRecLen - 71;
++ m_aTextRec.pTextString = new sal_uInt8 [TextLength];
++
++ m_pStream->Read(m_aTextRec.pTextString, TextLength);
++
++//#endif // AmiPro
++
++}
++
++rtl::OUString LwpDrawTextBox::RegisterStyle()
++{
++ XFParaStyle* pStyle = new XFParaStyle();
++
++ // font style
++ // the pFont need to be deleted myself?
++ XFFont* pFont = new XFFont();
++
++ rtl_TextEncoding aEncoding = RTL_TEXTENCODING_MS_1252;
++ rtl::OUString aFontName = rtl::OUString((sal_Char*)m_aTextRec.tmpTextFaceName,
++ strlen((char*)m_aTextRec.tmpTextFaceName), aEncoding);
++ pFont->SetFontName(aFontName);
++
++ this->SetFontStyle(pFont, &m_aTextRec);
++
++ pStyle->SetFont(pFont);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ return pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++}
++
++XFFrame* LwpDrawTextBox::CreateDrawObj(const rtl::OUString& rStyleName )
++{
++ XFFrame* pTextBox = new XFFrame(sal_True);
++/* this->SetPosition(pTextBox);
++ XFRect aBoundRect((double)m_aObjHeader.nLeft/TWIPS_PER_CM, (double)m_aObjHeader.nTop/TWIPS_PER_CM,
++ (double)(m_aObjHeader.nRight-m_aObjHeader.nLeft)/TWIPS_PER_CM, (double)(m_aObjHeader.nBottom-m_aObjHeader.nTop)/TWIPS_PER_CM);
++ pTextBox->SetPosition(aBoundRect);*/
++
++ sal_Int16 TextLength = m_aObjHeader.nRecLen - 71;
++ rtl_TextEncoding aEncoding;
++ if (!m_aTextRec.nTextCharacterSet)
++ {
++ aEncoding = gsl_getSystemTextEncoding();
++ }
++ else
++ {
++ // temporary code, need to create Encoding from the value of nTextCharacterSet
++ aEncoding = LwpCharSetMgr::GetInstance()->GetTextCharEncoding();
++ }
++
++// XFTextSpan* pTextSpan = new XFTextSpan();
++// pTextSpan->SetText(rtl::OUString((sal_Char*)m_aTextRec.pTextString, (TextLength-2), aEncoding));
++// pTextSpan->SetStyleName(rStyleName);
++
++ XFParagraph* pXFPara = new XFParagraph();
++ pXFPara->Add(rtl::OUString((sal_Char*)m_aTextRec.pTextString, (TextLength-2), aEncoding));
++ pXFPara->SetStyleName(rStyleName);
++
++ pTextBox->Add(pXFPara);
++ this->SetPosition(pTextBox);
++
++ /*
++ XFFrameStyle* pBoxStyle = new XFFrameStyle();
++ pBoxStyle->SetYPosType(enumXFFrameYPosFromTop, enumXFFrameYRelFrame);
++ pBoxStyle->SetXPosType(enumXFFrameXPosFromLeft, enumXFFrameXRelFrame);
++ pBoxStyle->SetPadding(0.0, 0.0, 0.0, 0.0);
++ */
++ XFTextBoxStyle* pBoxStyle = new XFTextBoxStyle();
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ OUString sName = pXFStyleManager->AddStyle(pBoxStyle)->GetStyleName();
++ pTextBox->SetStyleName(sName);
++
++ //todo: add the interface for rotating textbox
++// if (m_aTextRec.nTextRotation)
++// {
++// double fAngle = double(3600-m_aTextRec.nTextRotation)/10;
++// pTextBox->SetRotate(fAngle);
++// }
++
++ return pTextBox;
++}
++
++XFFrame* LwpDrawTextBox::CreateStandardDrawObj(const OUString& rStyleName)
++{
++ return this->CreateDrawObj(rStyleName);
++}
++
++/**
++ * @descr Constructor of class LwpDrawTextBox
++ * @param pStream The memory stream which contains the lwp-sdw draw objects
++ */
++LwpDrawTextArt::LwpDrawTextArt(SvStream* pStream, DrawingOffsetAndScale* pTransData)
++: LwpDrawObj(pStream, pTransData)
++{
++}
++
++LwpDrawTextArt::~LwpDrawTextArt()
++{
++ if (m_aTextArtRec.aPath[0].pPts)
++ {
++ delete [] m_aTextArtRec.aPath[0].pPts;
++ m_aTextArtRec.aPath[0].pPts = NULL;
++ }
++ if (m_aTextArtRec.aPath[1].pPts)
++ {
++ delete [] m_aTextArtRec.aPath[1].pPts;
++ m_aTextArtRec.aPath[1].pPts = NULL;
++ }
++ if (m_aTextArtRec.pTextString)
++ {
++ delete [] m_aTextArtRec.pTextString;
++ m_aTextArtRec.pTextString = NULL;
++ }
++
++}
++
++void LwpDrawTextArt::CreateFWPath(XFDrawPath* pPath)
++{
++ sal_Int16 nX, nY;
++ nX = (m_aTextArtRec.aPath[0].pPts[0].x + m_aTextArtRec.aPath[1].pPts[0].x) / 2;
++ nY = (m_aTextArtRec.aPath[0].pPts[0].y + m_aTextArtRec.aPath[1].pPts[0].y) / 2;
++ XFPoint aStart((double)nX/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)nY/TWIPS_PER_CM * m_pTransData->fScaleY);
++ pPath->MoveTo(aStart);
++
++ sal_uInt8 nPtIndex = 1;
++ for (sal_uInt8 nC = 1; nC <= m_aTextArtRec.aPath[0].n; nC++)
++ {
++ nX = (m_aTextArtRec.aPath[0].pPts[nPtIndex].x + m_aTextArtRec.aPath[1].pPts[nPtIndex].x) / 2;
++ nY = (m_aTextArtRec.aPath[0].pPts[nPtIndex].y + m_aTextArtRec.aPath[1].pPts[nPtIndex].y) / 2;
++ XFPoint aCtrl1((double)nX/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)nY/TWIPS_PER_CM * m_pTransData->fScaleY);
++
++ nPtIndex++;
++ nX = (m_aTextArtRec.aPath[0].pPts[nPtIndex].x + m_aTextArtRec.aPath[1].pPts[nPtIndex].x) / 2;
++ nY = (m_aTextArtRec.aPath[0].pPts[nPtIndex].y + m_aTextArtRec.aPath[1].pPts[nPtIndex].y) / 2;
++ XFPoint aCtrl2((double)nX/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)nY/TWIPS_PER_CM * m_pTransData->fScaleY);
++
++ nPtIndex++;
++ nX = (m_aTextArtRec.aPath[0].pPts[nPtIndex].x + m_aTextArtRec.aPath[1].pPts[nPtIndex].x) / 2;
++ nY = (m_aTextArtRec.aPath[0].pPts[nPtIndex].y + m_aTextArtRec.aPath[1].pPts[nPtIndex].y) / 2;
++ XFPoint aDest((double)nX/TWIPS_PER_CM * m_pTransData->fScaleX,
++ (double)nY/TWIPS_PER_CM * m_pTransData->fScaleY);
++
++ pPath->CurveTo(aDest, aCtrl1, aCtrl2);
++ }
++}
++
++void LwpDrawTextArt::Read()
++{
++ for (sal_uInt8 nC = 0; nC < 4; nC++)
++ {
++ m_pStream->Read(&m_aVector[nC].x, 2);
++ m_pStream->Read(&m_aVector[nC].y, 2);
++ }
++
++ this->ReadClosedObjStyle();
++ m_aTextArtRec.aTextColor = m_aClosedObjStyleRec.aForeColor;
++
++ m_pStream->Read(&m_aTextArtRec.nIndex, 1);
++ m_pStream->Read(&m_aTextArtRec.nRotation, 2);
++
++ sal_uInt16 nPointNumber;
++ sal_Int16 nX, nY;
++ m_pStream->Read(&nPointNumber, 2);
++ m_aTextArtRec.aPath[0].n = nPointNumber;
++ m_aTextArtRec.aPath[0].pPts = new SdwPoint [nPointNumber*3+1];
++ sal_uInt16 nPt = 0;
++ for ( nPt = 0; nPt <= nPointNumber*3; nPt++)
++ {
++ m_pStream->Read(&nX, 2);
++ m_pStream->Read(&nY, 2);
++ m_aTextArtRec.aPath[0].pPts[nPt].x = nX;
++ m_aTextArtRec.aPath[0].pPts[nPt].y = nY;
++ }
++
++ m_pStream->Read(&nPointNumber, 2);
++ m_aTextArtRec.aPath[1].n = nPointNumber;
++ m_aTextArtRec.aPath[1].pPts = new SdwPoint [nPointNumber*3+1];
++ for (nPt = 0; nPt <= nPointNumber*3; nPt++)
++ {
++ m_pStream->Read(&nX, 2);
++ m_pStream->Read(&nY, 2);
++ m_aTextArtRec.aPath[1].pPts[nPt].x = nX;
++ m_aTextArtRec.aPath[1].pPts[nPt].y = nY;
++ }
++
++ m_pStream->SeekRel(1);
++
++ m_pStream->Read(m_aTextArtRec.tmpTextFaceName, DRAW_FACESIZE);
++ m_pStream->SeekRel(1);// PitchAndFamily
++
++ m_pStream->Read(&m_aTextArtRec.nTextSize, sizeof(m_aTextArtRec.nTextSize));
++ bool TextSizeIsCellHeight = true;
++ if (m_aTextArtRec.nTextSize < 0)
++ {
++ TextSizeIsCellHeight = false;
++ m_aTextArtRec.nTextSize = -m_aTextArtRec.nTextSize;
++ }
++
++ m_pStream->Read(&m_aTextArtRec.nTextAttrs, sizeof(m_aTextArtRec.nTextAttrs));
++ m_pStream->Read(&m_aTextArtRec.nTextCharacterSet, sizeof(m_aTextArtRec.nTextCharacterSet));
++// m_pStream->Read(&m_aTextArtRec.nTextRotation, sizeof(m_aTextArtRec.nTextRotation));
++ m_aTextArtRec.nTextRotation = 0;
++ m_pStream->Read(&m_aTextArtRec.nTextExtraSpacing, sizeof(m_aTextArtRec.nTextExtraSpacing));
++
++ const sal_uInt16 nTextArtFixedLength = 105;
++ m_aTextArtRec.nTextLen = m_aObjHeader.nRecLen - nTextArtFixedLength
++ - (m_aTextArtRec.aPath[0].n*3 + 1)*4
++ - (m_aTextArtRec.aPath[1].n*3 + 1)*4;
++
++ m_aTextArtRec.pTextString = new sal_uInt8 [m_aTextArtRec.nTextLen];
++ m_pStream->Read(m_aTextArtRec.pTextString, m_aTextArtRec.nTextLen);
++ m_aTextArtRec.pTextString[m_aTextArtRec.nTextLen-1] = 0;
++
++}
++
++rtl::OUString LwpDrawTextArt::RegisterStyle()
++{
++ XFParaStyle* pStyle = new XFParaStyle();
++
++ // font style
++ // the pFont need to be deleted myself?
++ XFFont* pFont = new XFFont();
++
++ rtl_TextEncoding aEncoding = RTL_TEXTENCODING_MS_1252;
++ rtl::OUString aFontName = rtl::OUString((sal_Char*)m_aTextArtRec.tmpTextFaceName,
++ strlen((char*)m_aTextArtRec.tmpTextFaceName), aEncoding);
++ pFont->SetFontName(aFontName);
++
++ LwpDrawTextBox::SetFontStyle(pFont, &m_aTextArtRec);
++
++ pStyle->SetFont(pFont);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ return pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++}
++
++XFFrame* LwpDrawTextArt::CreateDrawObj(const rtl::OUString& rStyleName)
++{
++ XFFrame* pRetObj = NULL;
++ XFDrawStyle* pStyle = new XFDrawStyle();
++
++ pRetObj = new XFDrawPath();
++ XFDrawPath* pFWPath = static_cast<XFDrawPath*>(pRetObj);
++ this->CreateFWPath(pFWPath);
++ pStyle->SetFontWorkStyle(0, enumXFFWSlantY, enumXFFWAdjustAutosize);
++
++ this->SetPosition(pRetObj);
++
++ rtl_TextEncoding aEncoding;
++ if (!m_aTextArtRec.nTextCharacterSet)
++ {
++ aEncoding = gsl_getSystemTextEncoding();
++ }
++ else
++ {
++ // temporary code, need to create Encoding from the value of nTextCharacterSet
++ aEncoding = LwpCharSetMgr::GetInstance()->GetTextCharEncoding();
++ }
++
++ XFParagraph* pXFPara = new XFParagraph();
++ pXFPara->Add(rtl::OUString((sal_Char*)m_aTextArtRec.pTextString, (m_aTextArtRec.nTextLen-1), aEncoding));
++ pXFPara->SetStyleName(rStyleName);
++ pRetObj->Add(pXFPara);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ pRetObj->SetStyleName(pXFStyleManager->AddStyle(pStyle)->GetStyleName());
++
++ return pRetObj;
++}
++
++XFFrame* LwpDrawTextArt::CreateStandardDrawObj(const rtl::OUString& rStyleName )
++{
++ return this->CreateDrawObj(rStyleName);
++}
++
++
++/**
++ * @descr Constructor of class LwpDrawMetafile
++ * @param pStream The memory stream which contains the lwp-sdw draw objects
++ */
++LwpDrawMetafile::LwpDrawMetafile(SvStream* pStream) : LwpDrawObj(pStream)
++{
++}
++
++/**
++ * @descr reading function of class LwpDrawMetafile
++ */
++void LwpDrawMetafile::Read()
++{
++ m_pStream->SeekRel(m_aObjHeader.nRecLen -16);
++}
++
++/**
++ * @descr Constructor of class LwpDrawBitmap
++ * @param pStream The memory stream which contains the lwp-sdw draw objects
++ */
++LwpDrawBitmap::LwpDrawBitmap(SvStream* pStream) : LwpDrawObj(pStream), m_pImageData(NULL)
++{
++}
++
++LwpDrawBitmap::~LwpDrawBitmap()
++{
++ if (m_pImageData)
++ {
++ delete [] m_pImageData;
++ m_pImageData = NULL;
++ }
++}
++
++/**
++ * @descr reading function of class LwpDrawBitmap
++ */
++void LwpDrawBitmap::Read()
++{
++ m_pStream->Read(&m_aBmpRec.nTranslation, sizeof(m_aBmpRec.nTranslation));
++ m_pStream->Read(&m_aBmpRec.nRotation, sizeof(m_aBmpRec.nRotation));
++
++ // 20 == length of draw-specific fields.
++ // 14 == length of bmp file header.
++ m_aBmpRec.nFileSize = m_aObjHeader.nRecLen - 20 + 14;
++ m_pImageData = new sal_uInt8 [m_aBmpRec.nFileSize];
++
++ BmpInfoHeader2 aInfoHeader2;
++ m_pStream->Read(&aInfoHeader2.nHeaderLen, 4);
++
++ sal_uInt32 N;
++ sal_uInt32 rgbTableSize;
++
++ if (aInfoHeader2.nHeaderLen == sizeof(BmpInfoHeader))
++ {
++ m_pStream->Read(&aInfoHeader2.nWidth, 2);
++ m_pStream->Read(&aInfoHeader2.nHeight, 2);
++ m_pStream->Read(&aInfoHeader2.nPlanes, 2);
++ m_pStream->Read(&aInfoHeader2.nBitCount, 2);
++
++ N = aInfoHeader2.nPlanes * aInfoHeader2.nBitCount;
++ if (N == 24)
++ {
++ rgbTableSize = 0;
++ }
++ else
++ {
++ rgbTableSize = 3 * (1 << N);
++ }
++ }
++ else
++ {
++ m_pStream->Read(&aInfoHeader2.nWidth, 4);
++ m_pStream->Read(&aInfoHeader2.nHeight, 4);
++ m_pStream->Read(&aInfoHeader2.nPlanes, 2);
++ m_pStream->Read(&aInfoHeader2.nBitCount, 2);
++ N = aInfoHeader2.nPlanes * aInfoHeader2.nBitCount;
++ if (N == 24)
++ {
++ rgbTableSize = 0;
++ }
++ else
++ {
++ rgbTableSize = 4 * (1 << N);
++ }
++
++ }
++
++ sal_uInt32 nOffBits = 14 + aInfoHeader2.nHeaderLen + rgbTableSize;
++ m_pImageData[0] = 'B';
++ m_pImageData[1] = 'M';
++ m_pImageData[2] = (sal_uInt8)m_aBmpRec.nFileSize;
++ m_pImageData[3] = (sal_uInt8)(m_aBmpRec.nFileSize >> 8);
++ m_pImageData[4] = (sal_uInt8)(m_aBmpRec.nFileSize >> 16);
++ m_pImageData[5] = (sal_uInt8)(m_aBmpRec.nFileSize >> 24);
++ m_pImageData[6] = 0;
++ m_pImageData[7] = 0;
++ m_pImageData[8] = 0;
++ m_pImageData[9] = 0;
++ m_pImageData[10] = (sal_uInt8)nOffBits;
++ m_pImageData[11] = (sal_uInt8)(nOffBits >> 8);
++ m_pImageData[12] = (sal_uInt8)(nOffBits >> 16);
++ m_pImageData[13] = (sal_uInt8)(nOffBits >> 24);
++
++ sal_uInt32 nDIBRemaining;
++ sal_uInt8* pPicData = m_pImageData;
++ if (aInfoHeader2.nHeaderLen== sizeof(BmpInfoHeader))
++ {
++ m_pImageData[14] = (sal_uInt8)aInfoHeader2.nHeaderLen;
++ m_pImageData[15] = (sal_uInt8)(aInfoHeader2.nHeaderLen >> 8);
++ m_pImageData[16] = (sal_uInt8)(aInfoHeader2.nHeaderLen >> 16);
++ m_pImageData[17] = (sal_uInt8)(aInfoHeader2.nHeaderLen >> 24);
++ m_pImageData[18] = (sal_uInt8)aInfoHeader2.nWidth;
++ m_pImageData[19] = (sal_uInt8)(aInfoHeader2.nWidth >> 8);
++ m_pImageData[20] = (sal_uInt8)aInfoHeader2.nHeight;
++ m_pImageData[21] = (sal_uInt8)(aInfoHeader2.nHeight >> 8);
++ m_pImageData[22] = (sal_uInt8)aInfoHeader2.nPlanes;
++ m_pImageData[23] = (sal_uInt8)(aInfoHeader2.nPlanes >> 8);
++ m_pImageData[24] = (sal_uInt8)aInfoHeader2.nBitCount;
++ m_pImageData[25] = (sal_uInt8)(aInfoHeader2.nBitCount >> 8);
++
++ nDIBRemaining = m_aBmpRec.nFileSize - 26;
++ pPicData += 26*sizeof(sal_uInt8);
++ }
++ else
++ {
++ m_pImageData[14] = (sal_uInt8)aInfoHeader2.nHeaderLen;
++ m_pImageData[15] = (sal_uInt8)(aInfoHeader2.nHeaderLen >> 8);
++ m_pImageData[16] = (sal_uInt8)(aInfoHeader2.nHeaderLen >> 16);
++ m_pImageData[17] = (sal_uInt8)(aInfoHeader2.nHeaderLen >> 24);
++ m_pImageData[18] = (sal_uInt8)aInfoHeader2.nWidth;
++ m_pImageData[19] = (sal_uInt8)(aInfoHeader2.nWidth >> 8);
++ m_pImageData[20] = (sal_uInt8)(aInfoHeader2.nWidth >> 16);
++ m_pImageData[21] = (sal_uInt8)(aInfoHeader2.nWidth >> 24);
++ m_pImageData[22] = (sal_uInt8)aInfoHeader2.nHeight;
++ m_pImageData[23] = (sal_uInt8)(aInfoHeader2.nHeight >> 8);
++ m_pImageData[24] = (sal_uInt8)(aInfoHeader2.nHeight >> 16);
++ m_pImageData[25] = (sal_uInt8)(aInfoHeader2.nHeight >> 24);
++ m_pImageData[26] = (sal_uInt8)aInfoHeader2.nPlanes;
++ m_pImageData[27] = (sal_uInt8)(aInfoHeader2.nPlanes >> 8);
++ m_pImageData[28] = (sal_uInt8)aInfoHeader2.nBitCount;
++ m_pImageData[29] = (sal_uInt8)(aInfoHeader2.nBitCount >> 8);
++
++ nDIBRemaining = m_aBmpRec.nFileSize - 30;
++ pPicData += 30*sizeof(sal_uInt8);
++ }
++
++ m_pStream->Read(pPicData, nDIBRemaining);
++
++/* FILE* pStream;
++ pStream = fopen( "drawing_test.bmp", "w+" );
++ fwrite(m_pImageData, sizeof(sal_uInt8), m_aBmpRec.nFileSize, pStream);
++ fclose( pStream );
++*/
++}
++
++rtl::OUString LwpDrawBitmap::RegisterStyle()
++{
++ XFImageStyle* pBmpStyle = new XFImageStyle();
++ pBmpStyle->SetYPosType(enumXFFrameYPosFromTop, enumXFFrameYRelFrame);
++ pBmpStyle->SetXPosType(enumXFFrameXPosFromLeft, enumXFFrameXRelFrame);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ return pXFStyleManager->AddStyle(pBmpStyle)->GetStyleName();
++}
++
++XFFrame* LwpDrawBitmap::CreateDrawObj(const rtl::OUString& rStyleName)
++{
++ XFImage* pImage = new XFImage();
++ pImage->SetImageData(m_pImageData, m_aBmpRec.nFileSize);
++ this->SetPosition(pImage);
++
++ pImage->SetStyleName(rStyleName);
++
++ return pImage;
++}
++
++XFFrame* LwpDrawBitmap::CreateStandardDrawObj(const OUString& rStyleName)
++{
++ return this->CreateDrawObj(rStyleName);
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpdrawobj.hxx lotuswordpro/source/filter/lwpdrawobj.hxx
+--- lotuswordpro.bak/source/filter/lwpdrawobj.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdrawobj.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,376 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * The file declares the LwpDrawObjcts and associated class like LwpDrawGroup, LwpDrawRectange
++ * and so on.
++ */
++
++#ifndef _LWPDRAWOBJ_HXX
++#define _LWPDRAWOBJ_HXX
++
++#include "lwpsdwdrawheader.hxx"
++
++class SvStream;
++class XFFrame;
++class XFDrawStyle;
++
++/**
++ * @brief
++ * Lwp-base-draw object.
++ */
++class LwpDrawObj
++{
++protected:
++ DrawObjectType m_eType;
++ SvStream* m_pStream;
++ SdwDrawObjHeader m_aObjHeader;
++ SdwClosedObjStyleRec m_aClosedObjStyleRec;
++ DrawingOffsetAndScale* m_pTransData;
++
++public:
++ LwpDrawObj(SvStream* pStream, DrawingOffsetAndScale* pTransData = NULL);
++ virtual ~LwpDrawObj() {};
++
++private:
++ void ReadObjHeaderRecord();
++
++protected:
++ void ReadClosedObjStyle();
++ void SetFillStyle(XFDrawStyle* pStyle);
++ void SetLineStyle(XFDrawStyle* pStyle, sal_uInt8 nWidth, sal_uInt8 nLineStyle,
++ const SdwColor& rColor);
++ void SetPosition(XFFrame* pObj);
++ void SetArrowHead(XFDrawStyle* pOpenedObjStyle, sal_uInt8 nArrowFlag, sal_uInt8 nLineWidth);
++ rtl::OUString GetArrowName(sal_uInt8 nArrowStyle);
++
++protected:
++ /**
++ * @descr read out the record of a draw object.
++ */
++ virtual void Read() = 0;
++
++ /**
++ * @descr register styles of a draw object according to the saved records data.
++ * @return the style name which has been registered.
++ */
++ virtual rtl::OUString RegisterStyle() = 0;
++
++ /**
++ * @descr create XF-draw object and assign the style name to it.
++ * @param style name.
++ * @return pointer of the created XF-draw object.
++ */
++ virtual XFFrame* CreateDrawObj(const rtl::OUString& rStyleName) = 0;
++
++ /**
++ * @descr create XF-draw object and assign the style name to it.
++ * @param style name.
++ * @return pointer of the created XF-draw object.
++ */
++ virtual XFFrame* CreateStandardDrawObj(const rtl::OUString& rStyleName) = 0;
++
++public:
++ /**
++ * @descr create a completed XF-draw object(read data, register styles and create XF-draw object)
++ * @return pointer of the created competed XF-draw object.
++ */
++ XFFrame* CreateXFDrawObject();
++
++ /**
++ * @param type of the object.
++ * @descr set the type to the draw object.
++ */
++ inline void SetObjectType(DrawObjectType eType) { m_eType = eType; }
++
++ /**
++ * @descr get the type of the draw object.
++ * @return the type of the object.
++ */
++ inline DrawObjectType GetObjectType() const { return m_eType; }
++};
++
++
++/**
++ * @brief
++ * Lwp-draw-group object.
++ */
++class LwpDrawGroup : public LwpDrawObj
++{
++public:
++ LwpDrawGroup(SvStream* pStream) : LwpDrawObj(pStream) {}
++ virtual ~LwpDrawGroup() {}
++
++protected:
++ virtual void Read() {}
++ virtual rtl::OUString RegisterStyle() { return rtl::OUString::createFromAscii(""); }
++ virtual XFFrame* CreateDrawObj(const rtl::OUString& rStyleName) { return NULL; }
++ virtual XFFrame* CreateStandardDrawObj(const rtl::OUString& rStyleName) { return NULL; }
++};
++
++
++/**
++ * @brief
++ * Lwp-draw-line object.
++ */
++class LwpDrawLine : public LwpDrawObj
++{
++private:
++ SdwLineRecord m_aLineRec;
++
++public:
++ LwpDrawLine(SvStream * pStream, DrawingOffsetAndScale* pTransData);
++ virtual ~LwpDrawLine() {};
++
++protected:
++ virtual void Read();
++ virtual rtl::OUString RegisterStyle();
++ virtual XFFrame* CreateDrawObj(const rtl::OUString& rStyleName);
++ virtual XFFrame* CreateStandardDrawObj(const rtl::OUString& rStyleName);
++};
++
++/**
++ * @brief
++ * Lwp-draw-polyline object.
++ */
++class LwpDrawPolyLine : public LwpDrawObj
++{
++private:
++ SdwPolyLineRecord m_aPolyLineRec;
++ SdwPoint* m_pVector;
++
++public:
++ LwpDrawPolyLine(SvStream * pStream, DrawingOffsetAndScale* pTransData);
++ virtual ~LwpDrawPolyLine();
++
++protected:
++ virtual void Read();
++ virtual rtl::OUString RegisterStyle();
++ virtual XFFrame* CreateDrawObj(const rtl::OUString& rStyleName);
++ virtual XFFrame* CreateStandardDrawObj(const rtl::OUString& rStyleName);
++};
++
++
++ /**
++ * @brief
++ * Lwp-draw-polygon object.
++ */
++class LwpDrawPolygon : public LwpDrawObj
++{
++private:
++ sal_uInt16 m_nNumPoints;
++ SdwPoint* m_pVector;
++
++public:
++ LwpDrawPolygon(SvStream * pStream, DrawingOffsetAndScale* pTransData);
++ virtual ~LwpDrawPolygon();
++
++protected:
++ virtual void Read();
++ virtual rtl::OUString RegisterStyle();
++ virtual XFFrame* CreateDrawObj(const rtl::OUString& rStyleName);
++ virtual XFFrame* CreateStandardDrawObj(const rtl::OUString& rStyleName);
++};
++
++/**
++ * @brief
++ * Lwp-draw-rectangle(rounded-corner rectangle) object.
++ */
++class LwpDrawRectangle : public LwpDrawObj
++{
++private:
++ SdwPoint m_aVector[16];
++
++public:
++ LwpDrawRectangle(SvStream* pStream, DrawingOffsetAndScale* pTransData);
++ virtual ~LwpDrawRectangle(){}
++
++protected:
++ virtual void Read();
++ virtual rtl::OUString RegisterStyle();
++ virtual XFFrame* CreateDrawObj(const rtl::OUString& rStyleName);
++ virtual XFFrame* CreateStandardDrawObj(const rtl::OUString& rStyleName);
++
++private:
++ XFFrame* CreateRoundedRect(const rtl::OUString& rStyleName);
++};
++
++/**
++ * @brief
++ * Lwp-draw-ellipse object.
++ */
++class LwpDrawEllipse : public LwpDrawObj
++{
++private:
++ SdwPoint m_aVector[13];
++
++public:
++ LwpDrawEllipse(SvStream * pStream, DrawingOffsetAndScale* pTransData);
++ virtual ~LwpDrawEllipse(){};
++
++protected:
++ virtual void Read();
++ virtual rtl::OUString RegisterStyle();
++ virtual XFFrame* CreateDrawObj(const rtl::OUString& rStyleName);
++ virtual XFFrame* CreateStandardDrawObj(const rtl::OUString& rStyleName);
++};
++
++
++/**
++ * @brief
++ * Lwp-draw-arc object.
++ */
++class LwpDrawArc : public LwpDrawObj
++{
++private:
++ SdwArcRecord m_aArcRec;
++ SdwPoint m_aVector[4];
++
++public:
++ LwpDrawArc(SvStream * pStream, DrawingOffsetAndScale* pTransData);
++ virtual ~LwpDrawArc() {};
++
++protected:
++ virtual void Read();
++ virtual rtl::OUString RegisterStyle();
++ virtual XFFrame* CreateDrawObj(const rtl::OUString& rStyleName);
++ virtual XFFrame* CreateStandardDrawObj(const rtl::OUString& rStyleName);
++};
++
++/**
++ * @brief
++ * Lwp-draw-textbox object.
++ */
++class XFFont;
++class LwpDrawTextBox : public LwpDrawObj
++{
++private:
++ SdwTextBoxRecord m_aTextRec;
++ SdwPoint m_aVector;
++
++public:
++ LwpDrawTextBox(SvStream* pStream);
++ virtual ~LwpDrawTextBox();
++ static void SetFontStyle(XFFont* pFont, SdwTextBoxRecord* pRec);
++
++protected:
++ virtual void Read();
++ virtual rtl::OUString RegisterStyle();
++ virtual XFFrame* CreateDrawObj(const rtl::OUString& rStyleName);
++ virtual XFFrame* CreateStandardDrawObj(const rtl::OUString& rStyleName);
++};
++
++/**
++ * @brief
++ * Lwp-draw-curved-text object.
++ */
++class XFDrawPath;
++class LwpDrawTextArt : public LwpDrawObj
++{
++private:
++ SdwTextArt m_aTextArtRec;
++ SdwPoint m_aVector[4];
++
++private:
++ void CreateFWPath(XFDrawPath* pPath);
++
++public:
++ LwpDrawTextArt(SvStream* pStream, DrawingOffsetAndScale* pTransData);
++ virtual ~LwpDrawTextArt();
++
++protected:
++ virtual void Read();
++ virtual rtl::OUString RegisterStyle();
++ virtual XFFrame* CreateDrawObj(const rtl::OUString& rStyleName);
++ virtual XFFrame* CreateStandardDrawObj(const rtl::OUString& rStyleName);
++};
++
++/**
++ * @brief
++ * Lwp-draw-metafile object.
++ */
++class LwpDrawMetafile : public LwpDrawObj
++{
++public:
++ LwpDrawMetafile(SvStream* pStream);
++ virtual ~LwpDrawMetafile() {}
++
++protected:
++ virtual void Read();
++ virtual rtl::OUString RegisterStyle() {return rtl::OUString::createFromAscii("");}
++ virtual XFFrame* CreateDrawObj(const rtl::OUString& rStyleName){return NULL;}
++ virtual XFFrame* CreateStandardDrawObj(const rtl::OUString& rStyleName){return NULL;}
++};
++
++/**
++ * @brief
++ * Lwp-draw-bitmap object.
++ */
++class LwpDrawBitmap : public LwpDrawObj
++{
++private:
++ SdwBmpRecord m_aBmpRec;
++ sal_uInt8* m_pImageData;
++public:
++ LwpDrawBitmap(SvStream* pStream);
++ virtual ~LwpDrawBitmap();
++
++protected:
++ virtual void Read();
++ virtual rtl::OUString RegisterStyle();
++ virtual XFFrame* CreateDrawObj(const rtl::OUString& rStyleName);
++ virtual XFFrame* CreateStandardDrawObj(const rtl::OUString& rStyleName);
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpdropcapmgr.cxx lotuswordpro/source/filter/lwpdropcapmgr.cxx
+--- lotuswordpro.bak/source/filter/lwpdropcapmgr.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdropcapmgr.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,82 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Mar 2005 reated
++ ************************************************************************/
++#include "lwpdropcapmgr.hxx"
++
++LwpDropcapMgr::LwpDropcapMgr()
++{
++ m_pXFPara = NULL;
++}
++
++LwpDropcapMgr::~LwpDropcapMgr()
++{
++}
++
++void LwpDropcapMgr::SetXFPara(XFParagraph* pXFPara)
++{
++ m_pXFPara = pXFPara;
++}
++
++XFParagraph* LwpDropcapMgr::GetXFPara()
++{
++ return m_pXFPara;
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpdropcapmgr.hxx lotuswordpro/source/filter/lwpdropcapmgr.hxx
+--- lotuswordpro.bak/source/filter/lwpdropcapmgr.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpdropcapmgr.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,79 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Mar 2005 created
++ ************************************************************************/
++
++#ifndef _LWPDROPCAPMGR_HXX
++#define _LWPDROPCAPMGR_HXX
++
++#include "xfilter/xfparagraph.hxx"
++
++class LwpDropcapMgr
++{
++public:
++ LwpDropcapMgr();
++ ~LwpDropcapMgr();
++ void SetXFPara(XFParagraph* pXFPara);
++ XFParagraph* GetXFPara();
++private:
++ XFParagraph* m_pXFPara;
++};
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpfilehdr.cxx lotuswordpro/source/filter/lwpfilehdr.cxx
+--- lotuswordpro.bak/source/filter/lwpfilehdr.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfilehdr.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,84 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "lwpfilehdr.hxx"
++#include "lwpdefs.hxx"
++
++//Word Pro 96: 0x0a,
++sal_uInt16 LwpFileHeader::m_nFileRevision = 0;
++
++LwpFileHeader::LwpFileHeader()
++ :m_nAppRevision(0),
++ m_nAppReleaseNo(0), m_nRequiredAppRevision(0), m_nRequiredFileRevision(0),
++ m_cDocumentID(), m_nRootIndexOffset(0)
++{}
++/**
++ * @descr read file header object from svstream
++ */
++sal_uInt32 LwpFileHeader::Read(LwpSvStream *pStrm)
++{
++ sal_uInt32 len = 0;
++ len += pStrm->Read(&m_nAppRevision, sizeof(m_nAppRevision));
++ len += pStrm->Read(&m_nFileRevision, sizeof(m_nFileRevision));
++ len += pStrm->Read(&m_nAppReleaseNo, sizeof(m_nAppReleaseNo));
++ len += pStrm->Read(&m_nRequiredAppRevision, sizeof(m_nRequiredAppRevision));
++ len += pStrm->Read(&m_nRequiredFileRevision, sizeof(m_nRequiredFileRevision));
++ len += m_cDocumentID.Read(pStrm);
++ if (m_nFileRevision < 0x000B)
++ m_nRootIndexOffset = BAD_OFFSET;
++ else
++ len += pStrm->Read(&m_nRootIndexOffset, sizeof(m_nRootIndexOffset));
++ return(len);
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpfilehdr.hxx lotuswordpro/source/filter/lwpfilehdr.hxx
+--- lotuswordpro.bak/source/filter/lwpfilehdr.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfilehdr.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,89 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _LWPFILEHEADER_HXX
++#define _LWPFILEHEADER_HXX
++
++#include "lwpobjid.hxx"
++/**
++ * @brief LWP7 object
++*/
++class LwpFileHeader
++{
++public:
++ LwpFileHeader();
++ ~LwpFileHeader(){};
++private: //data member
++ sal_uInt16 m_nAppRevision;
++ sal_uInt16 m_nAppReleaseNo;
++ sal_uInt16 m_nRequiredAppRevision;
++ sal_uInt16 m_nRequiredFileRevision;
++ LwpObjectID m_cDocumentID;
++ sal_uInt32 m_nRootIndexOffset;
++public:
++ static sal_uInt16 m_nFileRevision;
++ sal_uInt32 Read(LwpSvStream *pStrm);
++ sal_uInt32 GetRootIndexOffset();
++ LwpObjectID* GetDocID();
++};
++inline sal_uInt32 LwpFileHeader::GetRootIndexOffset()
++{
++ return m_nRootIndexOffset;
++}
++inline LwpObjectID* LwpFileHeader::GetDocID()
++{
++ return &m_cDocumentID;
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpfilter.cxx lotuswordpro/source/filter/lwpfilter.cxx
+--- lotuswordpro.bak/source/filter/lwpfilter.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfilter.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,593 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Circle object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-1-17 create this file.
++ ************************************************************************/
++#include "lwpfilter.hxx"
++#include "lwpresource.hxx"
++//for sax stream
++#include "xfilter/xfsaxstream.hxx"
++#include "xfilter/xffilestream.hxx"
++//for file parser
++#include "lwp9reader.hxx"
++#include "lwpsvstream.hxx"
++//for container reset
++#include "xfilter/xffontfactory.hxx"
++#include "xfilter/xfstylemanager.hxx"
++
++#include <osl/file.h>
++#include <osl/file.hxx>
++#include <vcl/svapp.hxx>
++//#include <vcl/vclasynload.hxx>
++#include <xmloff/attrlist.hxx>
++#include <com/sun/star/io/IOException.hpp>
++#include <com/sun/star/frame/XDesktop.hpp>
++#include <com/sun/star/frame/XController.hpp>
++#include <com/sun/star/text/XTextDocument.hpp>
++#include <com/sun/star/text/XText.hpp>
++
++#include <tools/stream.hxx>
++#include <sfx2/docfile.hxx>
++
++using namespace ::cppu;
++using namespace ::com::sun::star::lang;
++using namespace ::com::sun::star::frame;
++using namespace ::com::sun::star::text;
++using namespace ::com::sun::star::io;
++using namespace ::com::sun::star::registry;
++using namespace ::com::sun::star::document;
++using namespace ::com::sun::star::beans;
++using namespace ::com::sun::star::xml::sax;
++using namespace ::com::sun::star;
++using ::rtl::OUString;
++using ::com::sun::star::uno::Sequence;
++
++sal_Bool IsWordproFile( uno::Reference<XInputStream>& rInputStream);
++sal_Bool IsWordproFile(rtl::OUString file);
++
++LWPFilterReader::LWPFilterReader()
++{
++}
++
++LWPFilterReader::~LWPFilterReader()
++{
++}
++
++sal_Bool LWPFilterReader::filter( const Sequence< PropertyValue >& aDescriptor )
++ throw( RuntimeException )
++{
++ uno::Reference< XInputStream> xInputStream;
++ ::rtl::OUString sURL;
++ for( sal_Int32 i = 0; i < aDescriptor.getLength(); i++ )
++ {
++ if( aDescriptor[i].Name == OUString::createFromAscii( "InputStream" ) )
++ aDescriptor[i].Value >>= xInputStream;
++ if( aDescriptor[i].Name == OUString::createFromAscii( "URL" ) )
++ aDescriptor[i].Value >>= sURL;
++ }
++
++ if ( !xInputStream.is() )
++ {
++ OSL_ASSERT( 0 );
++ return sal_False;
++ }
++
++ OString sFileName;
++ sFileName = ::rtl::OUStringToOString(sURL, RTL_TEXTENCODING_INFO_ASCII);
++
++ SvFileStream inputStream( sURL, STREAM_READ );
++ if ( inputStream.IsEof() || ( inputStream.GetError() != SVSTREAM_OK ) )
++ return sal_False;
++
++
++ return (ReadWordproFile( &inputStream ,m_DocumentHandler) == 0);
++}
++
++void LWPFilterReader::cancel() throw (com::sun::star::uno::RuntimeException)
++{
++}
++
++uno::Reference< XInterface > LWPFilterImportFilter_CreateInstance(
++ const uno::Reference< XMultiServiceFactory >& rSMgr ) throw( Exception )
++{
++ LWPFilterImportFilter *p = new LWPFilterImportFilter( rSMgr );
++
++ return uno::Reference< XInterface > ( (OWeakObject* )p );
++}
++
++Sequence< OUString > LWPFilterImportFilter::getSupportedServiceNames_Static( void ) throw ()
++{
++ Sequence< OUString > aRet(1);
++ aRet.getArray()[0] = LWPFilterImportFilter::getImplementationName_Static();
++ return aRet;
++}
++
++LWPFilterImportFilter::LWPFilterImportFilter( const uno::Reference< XMultiServiceFactory >& xFact )
++{
++ //OUString sService = OUString( SwXMLImport_getImplementationName ); //STR_WRITER_IMPORTER_NAME
++
++ try
++ {
++ uno::Reference< XDocumentHandler > xDoc( xFact->createInstance( OUString::createFromAscii( STR_WRITER_IMPORTER_NAME ) ), UNO_QUERY );
++
++ LWPFilterReader *p = new LWPFilterReader;
++ p->setDocumentHandler( xDoc );
++
++ uno::Reference< XImporter > xImporter = uno::Reference< XImporter >( xDoc, UNO_QUERY );
++ rImporter = xImporter;
++ uno::Reference< XFilter > xFilter = uno::Reference< XFilter >( p );
++ rFilter = xFilter;
++ }
++ catch( Exception & )
++ {
++ exit( 1 );
++ }
++}
++
++LWPFilterImportFilter::~LWPFilterImportFilter()
++{
++}
++
++sal_Bool LWPFilterImportFilter::filter( const Sequence< PropertyValue >& aDescriptor )
++ throw( RuntimeException )
++{
++ sal_Bool ret = rFilter->filter( aDescriptor );
++
++ return ret;
++}
++
++void LWPFilterImportFilter::cancel() throw (::com::sun::star::uno::RuntimeException)
++{
++ rFilter->cancel();
++}
++
++void LWPFilterImportFilter::setTargetDocument( const uno::Reference< XComponent >& xDoc )
++ throw( IllegalArgumentException, RuntimeException )
++{
++ rImporter->setTargetDocument( xDoc );
++}
++
++OUString LWPFilterImportFilter::getImplementationName_Static() throw()
++{
++ return OUString::createFromAscii( STR_IMPLEMENTATION_NAME );
++}
++
++OUString LWPFilterImportFilter::getImplementationName() throw()
++{
++ return OUString::createFromAscii( STR_IMPLEMENTATION_NAME );
++}
++
++sal_Bool LWPFilterImportFilter::supportsService( const OUString& ServiceName ) throw()
++{
++ Sequence< OUString > aSNL = getSupportedServiceNames();
++ const OUString *pArray = aSNL.getConstArray();
++
++ for ( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
++ {
++ if ( pArray[i] == ServiceName ) return sal_True;
++ }
++
++ return sal_False;
++}
++
++Sequence< OUString> LWPFilterImportFilter::getSupportedServiceNames( void ) throw()
++{
++ Sequence< OUString > seq(1);
++ seq.getArray()[0] = OUString::createFromAscii( STR_SERVICE_NAME );
++ return seq;
++}
++
++
++::rtl::OUString SAL_CALL LWPFilterImportFilter::detect( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
++ throw (::com::sun::star::uno::RuntimeException)
++{
++ rtl::OUString ret;
++ rtl::OUString aTypeName; // a name describing the type (from MediaDescriptor, usually from flat detection)
++ // opening as template is done when a parameter tells to do so and a template filter can be detected
++ // (otherwise no valid filter would be found) or if the detected filter is a template filter and
++ // there is no parameter that forbids to open as template
++ sal_Bool bOpenAsTemplate = sal_False;
++ sal_Int32 nPropertyCount = aDescriptor.getLength();
++ for( sal_Int32 nProperty=0; nProperty<nPropertyCount; ++nProperty )
++ {
++ if( aDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("TypeName")) )
++ {
++ aDescriptor[nProperty].Value >>= aTypeName;
++ }
++ else if( aDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("AsTemplate")) )
++ {
++ bOpenAsTemplate = sal_True;
++ }
++ }
++
++ for( sal_Int32 i = 0; i < aDescriptor.getLength(); i++ )
++ {
++ OUString strTemp;
++ aDescriptor[i].Value >>= strTemp;
++ if( aDescriptor[i].Name == OUString::createFromAscii( "InputStream" ) )
++ {
++ uno::Reference< XInputStream> rInputStream;
++ aDescriptor[i].Value >>= rInputStream;
++ //
++ // TRANSFORM IMPLEMENTATION HERE!!!!!!
++ // and call m_DocumentHandler's SAX mDochods
++ //
++ if( IsWordproFile(rInputStream) )
++ {
++ if( aTypeName == OUString(RTL_CONSTASCII_USTRINGPARAM("wordpro_template")) )
++ {
++ if(!bOpenAsTemplate)
++ {
++ aDescriptor.realloc( nPropertyCount + 1 );
++ aDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("AsTemplate");
++ aDescriptor[nPropertyCount].Value <<= sal_True;
++ }
++ return OUString::createFromAscii("wordpro_template");
++ }
++ else
++ {
++ return OUString::createFromAscii("wordpro");
++ }
++ }
++ return ret;
++ }
++ else if( aDescriptor[i].Name == OUString::createFromAscii( "URL" ) )
++ {
++ OUString sURL;
++ OUString sFileName;
++
++ aDescriptor[i].Value >>= sURL;
++ /*
++ osl::FileBase::RC rc = osl::FileBase::getSystemPathFromFileURL( sURL, sFileName );
++ if(rc != osl::FileBase::E_None)
++ {
++ SAXException except;
++ except.Message = OUString( RTL_CONSTASCII_USTRINGPARAM( "GDocting system path from URL failed!"));
++ throw except;
++ }
++ */
++ //end with .lwp:
++ if( IsWordproFile(sURL) )
++ {
++ if( aTypeName == OUString(RTL_CONSTASCII_USTRINGPARAM("wordpro_template")) )
++ {
++ if(!bOpenAsTemplate)
++ {
++ aDescriptor.realloc( nPropertyCount + 1 );
++ aDescriptor[nPropertyCount].Name = ::rtl::OUString::createFromAscii("AsTemplate");
++ aDescriptor[nPropertyCount].Value <<= sal_True;
++ }
++ return OUString::createFromAscii("wordpro_template");
++ }
++ else
++ {
++ return OUString::createFromAscii("wordpro");
++ }
++ }
++ return ret;
++ }
++ }
++ return ret;
++}
++#if 0
++EXTERN_C void SAL_CALL
++component_getImplementationEnvironment(const sal_Char** ppEnvTypeName, uno_Environment** ppEnv)
++{
++ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
++}
++
++EXTERN_C sal_Bool SAL_CALL
++component_writeInfo(void* pServiceManager, void* pRegistryKey)
++{
++ if (pRegistryKey)
++ {
++ try
++ {
++ uno::Reference< XRegistryKey > xKey( reinterpret_cast<XRegistryKey*>(pRegistryKey) );
++
++ uno::Reference< XRegistryKey > xNewKey = xKey->createKey( OUString::createFromAscii( IMPLEMENTATION_NAME ) );
++ xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
++
++ xNewKey->createKey( OUString::createFromAscii( STR_SERVICE_NAME ) );
++
++ return sal_True;
++ }
++ catch (InvalidRegistryException &)
++ {
++ OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
++ }
++ }
++ return sal_False;
++}
++
++EXTERN_C void* SAL_CALL
++component_getFactory(const sal_Char* pImplName, void* pServiceManager, void* pRegistryKey)
++{
++ void * pRet = 0;
++
++ if(pServiceManager )
++ {
++ uno::Reference< XSingleServiceFactory > xRet;
++ uno::Reference< XMultiServiceFactory > xSMgr = reinterpret_cast< XMultiServiceFactory * > ( pServiceManager );
++
++ OUString aImplementationName = OUString::createFromAscii( pImplName );
++
++ if(aImplementationName == OUString::createFromAscii( STR_IMPLEMENTATION_NAME ) )
++ {
++ xRet = createSingleFactory( xSMgr, aImplementationName,
++ LWPFilterImportFilter_CreateInstance,
++ LWPFilterImportFilter::getSupportedServiceNames_Static() );
++ }
++ if (xRet.is())
++ {
++ xRet->acquire();
++ pRet = xRet.get();
++ }
++ }
++
++ return pRet;
++}
++#endif
++
++ /**
++ * @descr decompressed small file
++ * @param pCompressed - real file stream
++ * @param pDecompressed - file decompressed, create inside, caller should delete it
++ * @return success - sal_True, fail - sal_False
++ */
++#include "bento.hxx"
++using namespace OpenStormBento;
++#include "explode.hxx"
++ sal_Bool Decompress(SvStream *pCompressed, SvStream * & pDecompressed)
++{
++ pCompressed->Seek(0);
++ pDecompressed = new SvMemoryStream(4096, 4096);
++ unsigned char buffer[512];
++ pCompressed->Read(buffer, 16);
++ pDecompressed->Write(buffer, 16);
++
++ LwpSvStream * pLwpStream = new LwpSvStream(pCompressed);
++ LtcBenContainer* pBentoContainer;
++ ULONG ulRet = BenOpenContainer(pLwpStream, &pBentoContainer);
++ LtcUtBenValueStream * pWordProData = (LtcUtBenValueStream *)pBentoContainer->FindValueStreamWithPropertyName("WordProData");
++
++ // decompressing
++ Decompression decompress(pWordProData, pDecompressed);
++ if (0!= decompress.explode())
++ {
++ delete pDecompressed;
++ pDecompressed = NULL;
++ delete pWordProData;
++ delete pLwpStream;
++ return sal_False;
++ }
++
++ sal_uInt32 nPos = pWordProData->GetSize();
++ nPos += 0x10;
++
++ pCompressed->Seek(nPos);
++ while (sal_uInt32 iRead = pCompressed->Read(buffer, 512))
++ {
++ pDecompressed->Write(buffer, iRead);
++ }
++
++ delete pWordProData;
++ delete pLwpStream;
++ return sal_True;
++}
++
++ /**
++ * @descr Get LwpSvStream, if small file, both compressed/decompressed stream
++ * Otherwise, only normal stream
++ * @param pStream - real file stream
++ * @param LwpSvStream * , created inside, deleted outside
++ * @param sal_Bool, sal_True -
++ */
++ sal_Bool GetLwpSvStream(SvStream *pStream, LwpSvStream * & pLwpSvStream)
++{
++ SvStream * pDecompressed = NULL;
++
++ sal_uInt32 nTag;
++ pStream->Seek(0x10);
++ pStream->Read(&nTag, sizeof(nTag));
++ if (nTag != 0x3750574c) // "LWP7"
++ {
++ // small file, needs decompression
++ if (!Decompress(pStream, pDecompressed))
++ {
++ pLwpSvStream = NULL;
++ return sal_True;
++ }
++ pStream->Seek(0);
++ pDecompressed->Seek(0);
++ }
++
++ pLwpSvStream = NULL;
++ sal_Bool bCompressed = sal_False;
++ if (pDecompressed)
++ {
++ LwpSvStream *pOriginalLwpSvStream = new LwpSvStream(pStream);
++ pLwpSvStream = new LwpSvStream(pDecompressed, pOriginalLwpSvStream);
++ bCompressed = sal_True;
++ }
++ else
++ {
++ pLwpSvStream = new LwpSvStream(pStream);
++ }
++ return bCompressed;
++}
++int ReadWordproFile(SvStream* pStream, uno::Reference<XDocumentHandler>& xHandler)
++{
++ try
++ {
++ LwpSvStream *pLwpSvStream = NULL;
++ SvStream * pDecompressed = NULL;
++ if ( GetLwpSvStream(pStream, pLwpSvStream) && pLwpSvStream)
++ {
++ pDecompressed = pLwpSvStream->GetStream();
++ }
++ if (!pLwpSvStream)
++ {
++ // nothing returned, fail when uncompressing
++ return 1;
++ }
++
++ IXFStream *pStrm = new XFSaxStream(xHandler);
++ Lwp9Reader reader(pLwpSvStream, pStrm);
++ //Reset all static objects,because this function may be called many times.
++ XFGlobalReset();
++ reader.Read();
++
++ // added by
++
++ if (pDecompressed)
++ {
++ delete pDecompressed;
++ LwpSvStream * pTemp = pLwpSvStream->GetCompressedStream();
++ delete pTemp;
++ }
++ delete pLwpSvStream;
++ // end added by
++
++ delete pStrm;
++ return 0;
++ }
++ catch (...)
++ {
++ return 1;
++ }
++ return 1;
++}
++
++void ErrorMsg(int iErrCode)
++{
++
++}
++
++/**
++ * @descr Compare if pBuf equals with the first 16 bytes
++ * @param pBuf that contains the file data
++ * @return if equals with the Word Pro characteristic strings
++ */
++sal_Bool IsWordProStr(const sal_Int8 *pBuf)
++{
++ sal_Bool bRet = sal_True;
++ const sal_Int8 pLotusLwp[] =
++ {
++ 0x57, 0x6F, 0x72, 0x64,
++ 0x50, 0x72, 0x6F
++#if 0
++ , 0,
++ 0, 0, 0, 0,
++ 0, 0, 0, 0
++#endif
++ };
++ for(int i=0; i<sizeof(pLotusLwp); i++)
++ {
++ if( pBuf[i] != pLotusLwp[i] )
++ {
++ bRet = sal_False;
++ }
++ }
++ return bRet;
++}
++
++sal_Bool IsWordproFile(rtl::OUString file)
++{
++ sal_Bool bRet = sal_False;
++ SfxMedium aMedium( file, STREAM_STD_READ, FALSE);
++ SvStream* pStm = aMedium.GetInStream();
++
++ if(pStm)
++ {
++ sal_Int8 buf[16];
++ bRet = sal_True;
++ sal_Int32 nRead = -1;
++
++ pStm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
++ pStm->Seek(STREAM_SEEK_TO_BEGIN);
++ nRead = pStm->Read(buf, sizeof(buf));
++ if( nRead< sizeof(buf) )
++ bRet = sal_False;
++ else
++ bRet = IsWordProStr(buf);
++ }
++ return bRet;
++}
++
++
++sal_Bool IsWordproFile( uno::Reference<XInputStream>& rInputStream)
++{
++ Sequence<sal_Int8> aData;
++ sal_Int32 nRead = -1;
++ sal_Bool bRet = sal_False;
++
++ nRead = rInputStream->readBytes(aData,16);
++ if( nRead != 16 )
++ {
++ bRet = sal_False;
++ }
++ else
++ {
++ const sal_Int8 *data = aData.getConstArray();
++ bRet = IsWordProStr(data);
++ }
++ return bRet;
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpfilter.hxx lotuswordpro/source/filter/lwpfilter.hxx
+--- lotuswordpro.bak/source/filter/lwpfilter.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfilter.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,185 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Circle object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-17 create this file.
++ ************************************************************************/
++#ifndef _LWPFILTER_HXX
++#define _LWPFILTER_HXX
++
++#include <cppuhelper/implbase1.hxx>
++#include <cppuhelper/implbase4.hxx>
++#include <cppuhelper/factory.hxx>
++
++#include <com/sun/star/document/XFilter.hpp>
++#include <com/sun/star/document/XImporter.hpp>
++#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
++#include <com/sun/star/xml/sax/SAXException.hpp>
++#include <com/sun/star/lang/XServiceInfo.hpp>
++#include <com/sun/star/io/XInputStream.hpp>
++#include <com/sun/star/document/XExtendedFilterDetection.hpp>
++#include <com/sun/star/text/XTextDocument.hpp>
++#include <tools/stream.hxx>
++
++using namespace ::rtl;
++using namespace ::cppu;
++using namespace ::com::sun::star::lang;
++using namespace ::com::sun::star::io;
++using namespace ::com::sun::star::registry;
++using namespace ::com::sun::star::document;
++using namespace ::com::sun::star::beans;
++using namespace ::com::sun::star::xml::sax;
++using namespace ::com::sun::star::uno;
++using namespace ::com::sun::star::text;
++using namespace ::com::sun::star;
++
++#define EXTERN_C extern "C"
++
++/**
++ * @brief
++ * Implements the XFilter interface.
++ * This is not the entry for the filter, but a proto of LwpFilterImportFilter.
++ */
++class LWPFilterReader : public WeakImplHelper1< XFilter >
++{
++public:
++ LWPFilterReader();
++ ~LWPFilterReader();
++
++public:
++ /**
++ * @descr loading the file. It's call be SfxObejctShell::ImportFrom.
++ * @param aDescriptor the parameters include file URL or XInputStream obejct, from which the filter can
++ * get which file to import.
++ */
++ virtual sal_Bool SAL_CALL filter( const Sequence< PropertyValue >& aDescriptor )
++ throw( RuntimeException );
++
++ /**
++ * @descr stop loading the file.
++ */
++ virtual void SAL_CALL cancel() throw (com::sun::star::uno::RuntimeException);
++
++ /**
++ * @descr get the XDocumentHandler interface.
++ */
++ void setDocumentHandler( uno::Reference< XDocumentHandler >& xHandler )
++ {
++ m_DocumentHandler = xHandler;
++ }
++
++private:
++ uno::Reference< XDocumentHandler > m_DocumentHandler;
++};
++
++/**
++ * @brief
++ * Main entry for the xml filter framework.
++ * It's called by SfxObjectShell::ImportFrom.
++ */
++class LWPFilterImportFilter : public WeakImplHelper4< XFilter, XImporter, XServiceInfo, XExtendedFilterDetection >
++{
++public:
++ LWPFilterImportFilter( const uno::Reference< XMultiServiceFactory >& xFact );
++ ~LWPFilterImportFilter();
++
++public:
++ static Sequence< OUString > getSupportedServiceNames_Static( void ) throw();
++
++ static OUString getImplementationName_Static() throw();
++public:
++ /**
++ * @descr see LWPFilterReader::filter.
++ */
++ virtual sal_Bool SAL_CALL filter( const Sequence< PropertyValue >& aDescriptor )
++ throw( RuntimeException );
++
++ /**
++ * @descr see LWPFilterReader::cancel.
++ */
++ virtual void SAL_CALL cancel() throw (com::sun::star::uno::RuntimeException);
++
++ // XImporter
++ virtual void SAL_CALL setTargetDocument( const uno::Reference< XComponent >& xDoc)
++ throw( IllegalArgumentException, RuntimeException );
++
++ // XServiceInfo
++ OUString SAL_CALL getImplementationName() throw ();
++
++ Sequence< OUString > SAL_CALL getSupportedServiceNames(void) throw ();
++
++ sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw ();
++
++ /**
++ * @descr function of interface XExtendedFilterDetection. If this interface is registed, it will be called whenever
++ * a file is to be loaded.
++ */
++ virtual ::rtl::OUString SAL_CALL detect( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Descriptor ) throw (::com::sun::star::uno::RuntimeException);
++
++public:
++ uno::Reference< XFilter > rFilter;
++ uno::Reference< XImporter > rImporter;
++};
++
++int ReadWordproFile(String& strName,uno::Reference<XDocumentHandler>& XDoc);
++//test code
++int ReadWordproFile(SvStream* pStream, uno::Reference<XDocumentHandler>& XDoc);
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwpfnlayout.cxx lotuswordpro/source/filter/lwpfnlayout.cxx
+--- lotuswordpro.bak/source/filter/lwpfnlayout.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfnlayout.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,395 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - footnote layouts
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++
++#include "lwpfnlayout.hxx"
++
++LwpFootnoteLayout::LwpFootnoteLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ :LwpTableLayout(objHdr, pStrm)
++{
++}
++
++LwpFootnoteLayout::~LwpFootnoteLayout()
++{}
++
++/**
++ * @descr Read object info
++ */
++void LwpFootnoteLayout::Read()
++{
++ LwpTableLayout::Read();
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++ * @descr Do nothing
++ */
++void LwpFootnoteLayout::RegisterStyle()
++{
++}
++
++/**
++ * @descr Do nothing
++ */
++void LwpFootnoteLayout::XFConvert(XFContentContainer * pCont)
++{
++}
++
++LwpFnRowLayout::LwpFnRowLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ :LwpRowLayout(objHdr, pStrm)
++{
++}
++
++LwpFnRowLayout::~LwpFnRowLayout()
++{}
++
++/**
++ * @descr Read object info
++ */
++void LwpFnRowLayout::Read()
++{
++ LwpRowLayout::Read();
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++ * @descr Register footnote/endnote contents style
++ */
++void LwpFnRowLayout::RegisterStyle()
++{
++ // register cells' style
++ LwpObjectID *pCellID= GetChildHead();
++ LwpCellLayout * pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj());
++
++ while(pCellLayout)
++ {
++ pCellLayout->SetFoundry(m_pFoundry);
++ pCellLayout->RegisterStyle();
++ pCellID = pCellLayout->GetNext();
++ pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj());
++ }
++}
++
++/**
++ * @descr Do nothing
++ */
++void LwpFnRowLayout::XFConvert(XFContentContainer * pCont)
++{
++}
++
++LwpFnCellLayout::LwpFnCellLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ :LwpCellLayout(objHdr, pStrm)
++{
++}
++
++LwpFnCellLayout::~LwpFnCellLayout()
++{}
++
++/**
++ * @descr Read object info
++ */
++void LwpFnCellLayout::Read()
++{
++ LwpCellLayout::Read();
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++ * @descr Register footnote/endnote contents style
++ */
++void LwpFnCellLayout::RegisterStyle()
++{
++ // content object register styles
++ LwpObject * pObj = m_Content.obj();
++ if (pObj)
++ {
++ pObj->SetFoundry(m_pFoundry);
++ pObj->RegisterStyle();
++ }
++}
++
++/**
++ * @descr Do nothing
++ */
++void LwpFnCellLayout::XFConvert(XFContentContainer * pCont)
++{
++}
++
++LwpEndnoteLayout::LwpEndnoteLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ :LwpTableLayout(objHdr, pStrm)
++{
++}
++
++LwpEndnoteLayout::~LwpEndnoteLayout()
++{}
++
++/**
++ * @descr Read object info
++ */
++void LwpEndnoteLayout::Read()
++{
++ LwpTableLayout::Read();
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++ * @descr Register footnote/endnote contents style
++ */
++void LwpEndnoteLayout::RegisterStyle()
++{
++ // register style of rows
++ LwpObjectID *pRowID = GetChildHead();
++ LwpRowLayout * pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj());
++ while (pRowLayout)
++ {
++ pRowLayout->SetFoundry(m_pFoundry);
++ pRowLayout->RegisterStyle();
++
++ pRowID = pRowLayout->GetNext();
++ pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj());
++ }
++}
++
++/**
++ * @descr Do nothing
++ */
++void LwpEndnoteLayout::XFConvert(XFContentContainer * pCont)
++{
++}
++
++LwpEnSuperTableLayout::LwpEnSuperTableLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ :LwpSuperTableLayout(objHdr, pStrm)
++{
++}
++
++LwpEnSuperTableLayout::~LwpEnSuperTableLayout()
++{}
++
++/**
++ * @descr Read object info
++ */
++void LwpEnSuperTableLayout::Read()
++{
++ LwpSuperTableLayout::Read();
++ m_pObjStrm->SkipExtra();
++}
++
++void LwpEnSuperTableLayout::RegisterStyle()
++{
++ // if this layout is style of real table entry
++ LwpVirtualLayout* pTableLayout = GetMainTableLayout();
++ if (pTableLayout != NULL)
++ {
++ pTableLayout->SetFoundry(m_pFoundry);
++ pTableLayout->RegisterStyle();;
++ }
++}
++
++/**
++ * @descr Do nothing
++ */
++void LwpEnSuperTableLayout::XFConvert(XFContentContainer * pCont)
++{
++}
++
++/**
++ * @short Get child endnote layout
++ * @return pointer to endnote layout
++ */
++ LwpVirtualLayout* LwpEnSuperTableLayout::GetMainTableLayout()
++{
++ LwpObjectID *pID = GetChildTail();
++
++ while(pID && !pID->IsNull())
++ {
++ LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(pID->obj());
++ if(!pLayout)
++ {
++ break;
++ }
++ if (pLayout && pLayout->GetLayoutType() == LWP_ENDNOTE_LAYOUT)
++ {
++ return pLayout;
++ }
++ pID = pLayout->GetPrevious();
++ }
++
++ return NULL;
++}
++
++LwpFnSuperTableLayout::LwpFnSuperTableLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ :LwpEnSuperTableLayout(objHdr, pStrm)
++{
++}
++
++LwpFnSuperTableLayout::~LwpFnSuperTableLayout()
++{}
++
++/**
++ * @descr Read object info
++ */
++void LwpFnSuperTableLayout::Read()
++{
++ LwpEnSuperTableLayout::Read();
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++ * @descr Do nothing
++ */
++void LwpFnSuperTableLayout::RegisterStyle()
++{
++}
++
++/**
++ * @descr Do nothing
++ */
++void LwpFnSuperTableLayout::XFConvert(XFContentContainer * pCont)
++{
++}
++
++/**
++ * @short Get child footnote layout
++ * @return pointer to footnote layout
++ */
++LwpVirtualLayout* LwpFnSuperTableLayout::GetMainTableLayout()
++{
++ LwpObjectID *pID = GetChildTail();
++
++ while(pID && !pID->IsNull())
++ {
++ LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(pID->obj());
++ if(!pLayout)
++ {
++ break;
++ }
++ if (pLayout && pLayout->GetLayoutType() == LWP_FOOTNOTE_LAYOUT)
++ {
++ return pLayout;
++ }
++ pID = pLayout->GetPrevious();
++ }
++
++ return NULL;
++}
++
++LwpContFromLayout::LwpContFromLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ :LwpPlacableLayout(objHdr, pStrm)
++{
++}
++
++LwpContFromLayout::~LwpContFromLayout()
++{}
++
++/**
++ * @descr Read object info
++ */
++void LwpContFromLayout::Read()
++{
++ LwpPlacableLayout::Read();
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++ * @descr Do nothing
++ */
++void LwpContFromLayout::RegisterStyle()
++{
++}
++
++/**
++ * @descr Do nothing
++ */
++void LwpContFromLayout::XFConvert(XFContentContainer * pCont)
++{
++}
++
++LwpContOnLayout::LwpContOnLayout(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ :LwpPlacableLayout(objHdr, pStrm)
++{
++}
++
++LwpContOnLayout::~LwpContOnLayout()
++{}
++
++/**
++ * @descr Read object info
++ */
++void LwpContOnLayout::Read()
++{
++ LwpPlacableLayout::Read();
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++ * @descr Do nothing
++ */
++void LwpContOnLayout::RegisterStyle()
++{
++}
++
++/**
++ * @descr Do nothing
++ */
++void LwpContOnLayout::XFConvert(XFContentContainer * pCont)
++{
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpfnlayout.hxx lotuswordpro/source/filter/lwpfnlayout.hxx
+--- lotuswordpro.bak/source/filter/lwpfnlayout.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfnlayout.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,195 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - footnote layouts
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++#ifndef _LWP_FNLAYOUT_HXX
++#define _LWP_FNLAYOUT_HXX
++
++#include "lwptablelayout.hxx"
++
++/**
++ * @brief VO_FOOTNOTELAYOUT object
++ *
++*/
++class LwpFootnoteLayout : public LwpTableLayout
++{
++public:
++ LwpFootnoteLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpFootnoteLayout();
++ void RegisterStyle();
++ virtual void XFConvert(XFContentContainer * pCont);
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_FOOTNOTE_LAYOUT;}
++protected:
++ void Read();
++};
++
++/**
++ * @brief VO_FNROWLAYOUT object
++ *
++*/
++class LwpFnRowLayout : public LwpRowLayout
++{
++public:
++ LwpFnRowLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpFnRowLayout();
++ void RegisterStyle();
++ virtual void XFConvert(XFContentContainer * pCont);
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_FOOTNOTE_ROW_LAYOUT;}
++protected:
++ void Read();
++};
++
++/**
++ * @brief VO_FNCELLLAYOUT object
++ *
++*/
++class LwpFnCellLayout : public LwpCellLayout
++{
++public:
++ LwpFnCellLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpFnCellLayout();
++ void RegisterStyle();
++ virtual void XFConvert(XFContentContainer * pCont);
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_FOOTNOTE_CELL_LAYOUT;}
++protected:
++ void Read();
++};
++
++/**
++ * @brief VO_ENDNOTELAYOUT object
++ *
++*/
++class LwpEndnoteLayout : public LwpTableLayout
++{
++public:
++ LwpEndnoteLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpEndnoteLayout();
++ void RegisterStyle();
++ virtual void XFConvert(XFContentContainer * pCont);
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_ENDNOTE_LAYOUT;}
++protected:
++ void Read();
++};
++
++/**
++ * @brief VO_ENSUPERTABLELAYOUT object
++ *
++*/
++class LwpEnSuperTableLayout : public LwpSuperTableLayout
++{
++public:
++ LwpEnSuperTableLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpEnSuperTableLayout();
++ void RegisterStyle();
++ void XFConvert(XFContentContainer* pCont);
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_ENDNOTE_SUPERTABLE_LAYOUT;}
++ virtual LwpVirtualLayout* GetMainTableLayout();
++protected:
++ void Read();
++};
++
++/**
++ * @brief VO_FNSUPERTABLELAYOUT object
++ *
++*/
++class LwpFnSuperTableLayout : public LwpEnSuperTableLayout
++{
++public:
++ LwpFnSuperTableLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpFnSuperTableLayout();
++ void RegisterStyle();
++ void XFConvert(XFContentContainer* pCont);
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_FOOTNOTE_SUPERTABLE_LAYOUT;}
++ virtual LwpVirtualLayout* GetMainTableLayout();
++protected:
++ void Read();
++};
++
++/**
++ * @brief VO_CONTFROMLAYOUT object
++ *
++*/
++class LwpContFromLayout : public LwpPlacableLayout
++{
++public:
++ LwpContFromLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpContFromLayout();
++ void RegisterStyle();
++ void XFConvert(XFContentContainer* pCont);
++protected:
++ void Read();
++};
++
++/**
++ * @brief VO_CONTONLAYOUT object
++ *
++*/
++class LwpContOnLayout : public LwpPlacableLayout
++{
++public:
++ LwpContOnLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpContOnLayout();
++ void RegisterStyle();
++ void XFConvert(XFContentContainer* pCont);
++protected:
++ void Read();
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpfont.cxx lotuswordpro/source/filter/lwpfont.cxx
+--- lotuswordpro.bak/source/filter/lwpfont.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfont.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,556 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "lwpglobalmgr.hxx"
++#include "lwpfont.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xffontfactory.hxx"
++
++void LwpFontAttrEntry::Read(LwpObjectStream *pStrm)
++{
++ pStrm->QuickRead(&m_nAttrBits, sizeof(m_nAttrBits));
++ pStrm->QuickRead(&m_nAttrOverrideBits, sizeof(m_nAttrOverrideBits));
++ pStrm->QuickRead(&m_nAttrApplyBits, sizeof(m_nAttrApplyBits));
++ pStrm->QuickRead(&m_nAttrOverrideBits2, sizeof(m_nAttrOverrideBits2));
++ pStrm->QuickRead(&m_nAttrApplyBits2, sizeof(m_nAttrApplyBits2));
++ pStrm->QuickRead(&m_nCase, sizeof(m_nCase));
++ pStrm->QuickRead(&m_nUnder, sizeof(m_nUnder));
++ pStrm->SkipExtra();
++}
++
++#include "xfilter/xfdefs.hxx"
++void LwpFontAttrEntry::Override( XFFont*pFont )
++{
++ if (IsBoldOverridden())
++ pFont->SetBold(Is(BOLD));
++
++ if (IsItalicOverridden())
++ pFont->SetItalic(Is(ITALIC));
++
++ if (IsStrikeThruOverridden())
++ {
++ if(Is(STRIKETHRU))
++ {
++ pFont->SetCrossout(enumXFCrossoutSignel);
++ }
++ else
++ {
++ pFont->SetCrossout(enumXFCrossoutNone);
++ }
++ }
++
++ if (IsSuperOverridden())
++ {
++ if(Is(SUPERSCRIPT))
++ pFont->SetPosition(TRUE);
++ }
++
++ if (IsSubOverridden())
++ {
++ if(Is(SUBSCRIPT))
++ pFont->SetPosition(FALSE);
++ }
++
++ if (IsUnderlineOverridden())
++ {
++ switch(m_nUnder)
++ {
++ case UNDER_SINGLE:
++ pFont->SetUnderline(enumXFUnderlineSingle);
++ break;
++ case UNDER_DOUBLE:
++ pFont->SetUnderline(enumXFUnderlineDouble);
++ break;
++ case UNDER_WORD_SINGLE:
++ pFont->SetUnderline(enumXFUnderlineSingle, true);
++ break;
++ case UNDER_WORD_DOUBLE:
++ pFont->SetUnderline(enumXFUnderlineSingle, true);
++ break;
++ case UNDER_DONTCARE: //fall through
++ case UNDER_OFF: //fall through
++ case UNDER_STYLE: //fall through
++ default:
++ break;
++ //do nothing;
++ }
++ }
++
++ if (IsCaseOverridden())
++ {
++ switch(m_nCase)
++ {
++ case CASE_UPPER:
++ pFont->SetTransform(enumXFTransformUpper);
++ break;
++ case CASE_LOWER:
++ pFont->SetTransform(enumXFTransformLower);
++ break;
++ case CASE_NORMAL:
++ pFont->SetTransform(enumXFTransformNone);
++ break;
++ case CASE_INITCAPS:
++ pFont->SetTransform(enumXFTransformCapitalize);
++ break;
++ case CASE_STYLE: //fall through
++ case CASE_DONTCARE: //fall through
++ default:
++ //do nothing
++ ;
++ }
++ }
++
++ //Please note that, put the SmallCaps setting after the case setting,
++ //for SmallCaps has higher priority than LowerCase but low
++ if (IsSmallCapsOverridden())
++ {
++ if( pFont->GetTransform()!=enumXFTransformUpper ) //SmallCaps should not override upper case
++ {
++ if(Is(SMALLCAPS))
++ pFont->SetTransform(enumXFTransformSmallCaps);
++ }
++ }
++
++ // TODO: tightness
++ //if (IsTightnessOverridden())
++ // pFont->SetTightness(cTightness);*/
++}
++
++BOOL LwpFontAttrEntry::Is(sal_uInt16 Attr)
++{
++ return (0 != (m_nAttrBits & Attr));
++}
++
++BOOL LwpFontAttrEntry::IsBoldOverridden()
++{
++ return (0 != (m_nAttrOverrideBits & BOLD));
++}
++
++BOOL LwpFontAttrEntry::IsItalicOverridden()
++{
++ return (0 != (m_nAttrOverrideBits & ITALIC));
++}
++BOOL LwpFontAttrEntry::IsStrikeThruOverridden()
++{
++ return (0 != (m_nAttrOverrideBits & STRIKETHRU));
++}
++BOOL LwpFontAttrEntry::IsSmallCapsOverridden()
++{
++ return (0 != (m_nAttrOverrideBits & SMALLCAPS));
++}
++BOOL LwpFontAttrEntry::IsSuperOverridden()
++{
++ return (0 != (m_nAttrOverrideBits & SUPERSCRIPT));
++
++}
++BOOL LwpFontAttrEntry::IsSubOverridden()
++{
++ return (0 != (m_nAttrOverrideBits & SUBSCRIPT));
++
++}
++
++BOOL LwpFontAttrEntry::IsSuperSubOverridden()
++{
++ return (0 != (m_nAttrOverrideBits
++ & (SUPERSCRIPT | SUBSCRIPT)));
++}
++
++BOOL LwpFontAttrEntry::IsUnderlineOverridden()
++{
++ return (0 != (m_nAttrOverrideBits2 & UNDER));
++}
++BOOL LwpFontAttrEntry::IsCaseOverridden()
++{
++ return (0 != (m_nAttrOverrideBits2 & CASE));
++}
++
++void LwpFontTableEntry::Read(LwpObjectStream *pStrm)
++{
++ m_WindowsFaceName.Read(pStrm);
++
++ // use the m_WindowsFaceName to set the m_FaceName temporarily
++ m_FaceName = m_WindowsFaceName;
++
++ //Skip the panoseNumber
++ //m_PanoseNumber.Read(pStrm);
++ LwpPanoseNumber thePanoseToSkip;
++ thePanoseToSkip.Read(pStrm);
++
++ pStrm->SkipExtra();
++
++ RegisterFontDecl();
++}
++
++OUString LwpFontTableEntry::GetFaceName()
++{
++ return (m_WindowsFaceName.str());
++}
++
++void LwpFontTableEntry::RegisterFontDecl()
++{
++ if(m_FaceName.str().getLength()==0) return;
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ XFFontDecl aFontDecl1( m_FaceName.str(), m_FaceName.str(), false );
++ pXFStyleManager->AddFontDecl(aFontDecl1);
++}
++
++LwpFontTable::LwpFontTable()
++ : m_pFontEntries(NULL)
++{}
++
++void LwpFontTable::Read(LwpObjectStream *pStrm)
++{
++ m_pFontEntries = NULL;
++ pStrm->QuickRead(&m_nCount, sizeof(m_nCount));
++ if(m_nCount>0)
++ {
++ m_pFontEntries = new LwpFontTableEntry[m_nCount];
++ for(sal_uInt16 i=0; i<m_nCount; i++)
++ {
++ m_pFontEntries[i].Read(pStrm);
++ }
++ }
++ pStrm->SkipExtra();
++}
++
++OUString LwpFontTable::GetFaceName(sal_uInt16 index) //index: start from 1
++{
++ assert(index>0);
++ if (index < 1)//add by , for fix crash,2005/12/20
++ return OUString::createFromAscii("");//add end
++ return m_pFontEntries[index-1].GetFaceName();
++}
++
++LwpFontTable::~LwpFontTable()
++{
++ if(m_pFontEntries)
++ {
++ delete [] m_pFontEntries;
++ m_pFontEntries = NULL;
++ }
++}
++
++void LwpFontNameEntry::Read(LwpObjectStream *pStrm)
++{
++ //Read CFontDescriptionOverrideBase
++ pStrm->QuickRead(&m_nOverrideBits, sizeof(m_nOverrideBits));
++ pStrm->QuickRead(&m_nApplyBits, sizeof(m_nApplyBits));
++ pStrm->QuickRead(&m_nPointSize, sizeof(m_nPointSize));
++ pStrm->QuickRead(&m_nOverstrike, sizeof(m_nOverstrike));
++ pStrm->QuickRead(&m_nTightness, sizeof(m_nTightness));
++ m_Color.Read(pStrm);
++ m_BackColor.Read(pStrm);
++ pStrm->SkipExtra();
++
++ //Read data of LwpFontNameEntry
++ pStrm->QuickRead(&m_nFaceName, sizeof(m_nFaceName));
++ pStrm->QuickRead(&m_nAltFaceName, sizeof(m_nAltFaceName));
++ pStrm->SkipExtra();
++}
++#include "xfilter/xfcolor.hxx"
++void LwpFontNameEntry::Override(XFFont* pFont)
++{
++ if (IsPointSizeOverridden())
++ pFont->SetFontSize(static_cast<sal_uInt8>(m_nPointSize/65536L));
++
++ if (IsColorOverridden() && m_Color.IsValidColor())
++ {
++ XFColor aColor(m_Color.To24Color());
++ pFont->SetColor(aColor);
++ }
++
++
++ if (IsBackgroundColorOverridden() )
++ {
++ if (m_BackColor.IsValidColor())
++ {
++ XFColor aColor(m_BackColor.To24Color());
++ pFont->SetBackColor( aColor );
++ }
++ else if (m_BackColor.IsTransparent())
++ {
++ pFont->SetBackColorTransparent();
++ }
++ }
++
++ // TODO: tightness
++ //if (IsTightnessOverridden())
++ // pFont->SetTightness(cTightness);
++}
++
++BOOL LwpFontNameEntry::IsFaceNameOverridden()
++{
++ return (0 != (m_nOverrideBits & FACENAME));
++}
++
++BOOL LwpFontNameEntry::IsAltFaceNameOverridden()
++{
++ return (0 != (m_nOverrideBits & ALTFACENAME));
++}
++
++BOOL LwpFontNameEntry::IsPointSizeOverridden()
++{
++ return (0 != (m_nOverrideBits & POINTSIZE));
++}
++
++BOOL LwpFontNameEntry::IsColorOverridden()
++{
++ return (0 != (m_nOverrideBits & COLOR));
++}
++
++BOOL LwpFontNameEntry::IsBackgroundColorOverridden()
++{
++ return (0 != (m_nOverrideBits & BKCOLOR));
++}
++
++BOOL LwpFontNameEntry::IsTightnessOverridden()
++{
++ return (0 != (m_nOverrideBits & TIGHTNESS));
++}
++
++BOOL LwpFontNameEntry::IsAnythingOverridden()
++{
++ return (0 != (m_nOverrideBits & ALL_BITS));
++}
++
++
++LwpFontNameManager::LwpFontNameManager()
++ :m_pFontNames(NULL)
++{}
++
++LwpFontNameManager::~LwpFontNameManager()
++{
++ if(m_pFontNames)
++ {
++ delete [] m_pFontNames;
++ m_pFontNames = NULL;
++ }
++}
++
++void LwpFontNameManager::Read(LwpObjectStream *pStrm)
++{
++ pStrm->QuickRead(&m_nCount, sizeof(m_nCount));
++ if(m_nCount>0)
++ {
++ m_pFontNames = new LwpFontNameEntry[m_nCount];
++ for(sal_uInt16 i=0; i<m_nCount; i++)
++ {
++ m_pFontNames[i].Read(pStrm);
++ }
++ }
++ m_FontTbl.Read(pStrm);
++ pStrm->SkipExtra();
++}
++
++void LwpFontNameManager::Override(sal_uInt16 index, XFFont* pFont)
++ //index: start from 1
++{
++ if(index<1) return;
++ m_pFontNames[index-1].Override(pFont);
++ if(m_pFontNames[index-1].IsFaceNameOverridden())
++ pFont->SetFontName(m_FontTbl.GetFaceName(m_pFontNames[index-1].GetFaceID()));
++ if(m_pFontNames[index-1].IsAltFaceNameOverridden())
++ pFont->SetFontNameAsia(m_FontTbl.GetFaceName(m_pFontNames[index-1].GetAltFaceID()));
++}
++OUString LwpFontNameManager::GetNameByIndex(sal_uInt16 index)
++{
++ sal_uInt16 nameindex = m_pFontNames[index-1].GetFaceID();
++ return (m_FontTbl.GetFaceName(nameindex));
++}
++
++/*void LwpFontNameManager::Override(sal_uInt16 baseID, sal_uInt16 overID, XFFont* pFont)
++{
++ //Override
++ m_pFontNames[overID-1]. Override(&m_pFontNames[baseID-1], pFont);
++}
++
++void LwpFontAttrManager::Override(sal_uInt16 baseID, sal_uInt16 overID, XFFont*pFont)
++{
++ m_pFontAttrs[overID-1]. Override(&m_pFontAttrs[baseID-1], pFont);
++}*/
++
++void LwpFontAttrManager::Read(LwpObjectStream *pStrm) {
++ pStrm->QuickRead(&m_nCount, sizeof(m_nCount));
++ m_pFontAttrs = new LwpFontAttrEntry[m_nCount];
++
++ for(sal_uInt16 i=0; i<m_nCount; i++)
++ {
++ m_pFontAttrs[i].Read(pStrm);
++ }
++ pStrm->SkipExtra();
++}
++
++void LwpFontAttrManager::Override(sal_uInt16 index, XFFont* pFont)
++ //index: start from 1
++{
++ if(index<1) return;
++ m_pFontAttrs[index-1].Override(pFont);
++}
++
++LwpFontAttrManager::~LwpFontAttrManager()
++{
++ if(m_pFontAttrs)
++ delete []m_pFontAttrs;
++}
++
++void LwpFontManager::Read(LwpObjectStream *pStrm)
++{
++ m_FNMgr.Read(pStrm);
++ m_AttrMgr.Read(pStrm);
++ pStrm->SkipExtra();
++
++}
++
++#include "xfilter/xftextstyle.hxx"
++
++/*
++VO_PARASTYLE call this method to add its style to XFStyleManager based on the fontID
++1. Construct the text style based on the fontID
++2. Add the style to XFStyleManager, and return the <office:styles> style name
++3. Add it to LwpParaStyleMap.
++Note: A temporary method for only font support phase. The next AddStyle should be used later.
++// To be replaced by LwpStyleManager::AddStyle() and the following CreateFont()
++*/
++/*void LwpFontManager::AddStyle(LwpObjectID styleObjID, sal_uInt32 fontID, OUString styleName)
++{
++ XFTextStyle* pStyle = new XFTextStyle(); //to be deleted by XFStyleManager
++ AddStyle(styleObjID, fontID, styleName, pStyle);
++}*/
++
++/*
++VO_PARASTYLE/VO_CHARACTERSTYLE call this method to add its style to XFStyleManager based on the fontID
++1. Construct the text style based on the fontID
++2. Add the style to XFStyleManager, and return the <office:styles> style name
++3. Add it to LwpParaStyleMap.
++Prerequisite: pStyle has been created and the paragraph properties has been set to it.
++//To be replaced by LwpStyleManager::AddStyle() and the following CreateFont()
++*/
++/*void LwpFontManager::AddStyle(LwpObjectID styleObjID, sal_uInt32 fontID, OUString styleName, XFTextStyle* pStyle)
++{
++ assert(pStyle);
++ XFFont* pFont = CreateFont(fontID);
++ pStyle->SetFont(pFont);
++ pStyle->SetStyleName(styleName);
++ XFStyleManager::AddStyle(pStyle);
++ m_StyleList.insert(LwpParaStyleMap::value_type(styleObjID, styleName));
++}*/
++
++/*
++Create XFFont based on the fotID
++*/
++XFFont* LwpFontManager::CreateFont(sal_uInt32 fontID)
++{
++ XFFont* pFont = new XFFont();
++ SetDfltFont(pFont);
++ m_FNMgr.Override(GetFontNameIndex(fontID), pFont);
++ m_AttrMgr.Override(GetFontAttrIndex(fontID), pFont);
++ return pFont;
++}
++
++/*
++Called XFFont based on the override result of two font ids.
++Refer to CFontManager::OverrideID
++*/
++//OUString LwpFontManager::GetOverrideStyle(sal_uInt32 fontID, sal_uInt32 overID)
++XFFont* LwpFontManager::CreateOverrideFont(sal_uInt32 fontID, sal_uInt32 overID)
++{
++ XFFont* pFont = new XFFont(); //To be deleted by XFFontFactory
++ SetDfltFont(pFont);
++ if(fontID)
++ {
++ Override(fontID, pFont);
++ }
++ if(overID)
++ {
++ Override(overID, pFont);
++ }
++ return pFont;
++}
++
++void LwpFontManager::Override(sal_uInt32 fontID, XFFont* pFont)
++{
++ m_FNMgr.Override(GetFontNameIndex(fontID), pFont);
++ m_AttrMgr.Override(GetFontAttrIndex(fontID), pFont);
++}
++
++
++/*
++Called by VO_PARA to get style name based on the Para Style ID
++1) Get style from LwpParaStyleMap based on the LwpObjectID of VO_PARASTYLE.
++2) Prerequisite: VO_PARASTYLE should call AddStyle first.
++3) Return empty string if no style found.
++//To be replaced by OUString LwpStyleManager::GetStyle(const LwpObjectID &styleID)
++*/
++/*OUString LwpFontManager::GetParaStyle(const LwpObjectID &styleID)
++{
++ LwpParaStyleMap::const_iterator it = m_StyleList.find(styleID);
++ if (it != m_StyleList.end()) {
++ return((*it).second);
++ }
++ return OUString();
++}*/
++
++void LwpFontManager::SetDfltFont(XFFont* pFont)
++{
++ // TODO: Set default XFFont values in lwp filter
++ //color:black, background color: transparent, Orientation: left to right, top to bottom, others: 0
++ //Refer to CFontDescription::CFontDescription(void)
++ //Did not find anything special
++ //pFont->SetColor(XFColor(0,0,0));
++}
++
++OUString LwpFontManager::GetNameByID(sal_uInt32 fontID)
++{
++ return ( m_FNMgr.GetNameByIndex(GetFontNameIndex(fontID)) );//use font id for bullet? note by ,2005/7/5
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpfont.hxx lotuswordpro/source/filter/lwpfont.hxx
+--- lotuswordpro.bak/source/filter/lwpfont.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfont.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,283 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Font manager related classes header file
++ * LwpFontTableEntry, LwpFontTable, LwpFontNameEntry,
++ * LwpFontAttrEntry, LwpFontNameManager,LwpFontAttrManager,
++ * LwpFontManager
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPFONT_HXX
++#define _LWPFONT_HXX
++
++#include "lwpheader.hxx"
++#include "lwpobjstrm.hxx"
++#include "lwpatomholder.hxx"
++#include "lwpcolor.hxx"
++#include "lwpbasetype.hxx"
++#include "lwpobj.hxx"
++#include "xfilter/xffont.hxx"
++#include "xfilter/xftextstyle.hxx"
++
++class LwpFontTableEntry
++{
++public:
++ LwpFontTableEntry(){};
++ ~LwpFontTableEntry(){};
++public:
++ void Read(LwpObjectStream *pStrm);
++ OUString GetFaceName();
++private:
++ LwpAtomHolder m_WindowsFaceName; //font face name under windows
++ LwpAtomHolder m_FaceName; //font face name
++ void RegisterFontDecl();
++ //Not useful now, so skip
++ //LwpPanoseNumber m_PanoseNumber;
++};
++
++class LwpFontTable
++{
++public:
++ LwpFontTable();
++ ~LwpFontTable();
++public:
++ void Read(LwpObjectStream *pStrm);
++ OUString GetFaceName(sal_uInt16 index); //index: start from 1
++// void RegisterFontDecls();
++private:
++ sal_uInt16 m_nCount;
++ LwpFontTableEntry* m_pFontEntries;
++};
++
++
++class LwpFontNameEntry
++{
++public:
++ LwpFontNameEntry(){};
++ ~LwpFontNameEntry(){};
++public:
++ void Read(LwpObjectStream *pStrm);
++ inline sal_uInt16 GetFaceID(){return m_nFaceName;};
++ inline sal_uInt16 GetAltFaceID(){return m_nAltFaceName;};
++ void Override(XFFont* pFont);
++ inline BOOL IsFaceNameOverridden();
++ inline BOOL IsAltFaceNameOverridden();
++private:
++ //Data of CFontDescriptionOverrideBase
++ sal_uInt8 m_nOverrideBits;
++ sal_uInt8 m_nApplyBits;
++ sal_uInt32 m_nPointSize;
++ sal_uInt16 m_nOverstrike;
++ sal_uInt16 m_nTightness;
++ LwpColor m_Color;
++ LwpColor m_BackColor;
++ //Data of LwpFontNameEntry
++ sal_uInt16 m_nFaceName; //CFontTableID
++ sal_uInt16 m_nAltFaceName; //CFontTableID
++ enum
++ {
++ POINTSIZE = 0x01,
++ COLOR = 0x02,
++ OVERSTRIKE = 0x04,
++ TIGHTNESS = 0x08,
++ FACENAME = 0x10,
++ BKCOLOR = 0x20,
++ ALTFACENAME = 0x40,
++ ALL_BITS = (POINTSIZE | COLOR | OVERSTRIKE
++ | ALTFACENAME
++ | TIGHTNESS | FACENAME | BKCOLOR)
++ };
++
++ inline BOOL IsPointSizeOverridden();
++ inline BOOL IsColorOverridden();
++ inline BOOL IsBackgroundColorOverridden();
++ inline BOOL IsTightnessOverridden();
++ inline BOOL IsAnythingOverridden();
++};
++
++class LwpFontNameManager
++{
++public:
++ LwpFontNameManager();
++ ~LwpFontNameManager();
++ OUString GetNameByIndex(sal_uInt16 index);
++private:
++ sal_uInt16 m_nCount;
++ LwpFontNameEntry* m_pFontNames;
++ LwpFontTable m_FontTbl;
++
++public:
++ void Read(LwpObjectStream *pStrm);
++ void Override(sal_uInt16 index, XFFont* pFont);
++};
++
++class LwpFontAttrEntry
++{
++public:
++ LwpFontAttrEntry(){};
++ ~LwpFontAttrEntry(){};
++public:
++ void Read(LwpObjectStream *pStrm);
++ void Override(XFFont*pFont);
++private:
++ sal_uInt16 m_nAttrBits;
++ sal_uInt16 m_nAttrOverrideBits;
++ sal_uInt16 m_nAttrApplyBits;
++ sal_uInt8 m_nAttrOverrideBits2;
++ sal_uInt8 m_nAttrApplyBits2;
++ sal_uInt8 m_nCase;
++ sal_uInt8 m_nUnder;
++ enum
++ {
++ BOLD = 0x0001,
++ ITALIC = 0x0002,
++ STRIKETHRU = 0x0004,
++
++ SUPERSCRIPT = 0x0100,
++ SUBSCRIPT = 0x0200,
++
++ SMALLCAPS = 0x0400,
++
++ ALL_ATTRS = BOLD | ITALIC | STRIKETHRU
++ | SUPERSCRIPT | SUBSCRIPT
++ | SMALLCAPS,
++
++ CASE_DONTCARE = 0,
++ CASE_NORMAL = 1,
++ CASE_UPPER = 2,
++ CASE_LOWER = 3,
++ CASE_INITCAPS = 4,
++ CASE_STYLE = 7,
++
++ UNDER_DONTCARE = 0,
++ UNDER_OFF = 1,
++ UNDER_SINGLE = 2,
++ UNDER_DOUBLE = 3,
++ UNDER_WORD_SINGLE = 4,
++ UNDER_WORD_DOUBLE = 5,
++ UNDER_STYLE = 7,
++
++ CASE = 0x01,
++ UNDER = 0x02,
++ ALL_ATTRS2 = CASE | UNDER
++ };
++ BOOL Is(sal_uInt16 Attr);
++ BOOL IsBoldOverridden();
++ BOOL IsItalicOverridden();
++ BOOL IsStrikeThruOverridden();
++ BOOL IsSmallCapsOverridden();
++ BOOL IsSuperOverridden();
++ BOOL IsSubOverridden();
++ BOOL IsSuperSubOverridden();
++ BOOL IsUnderlineOverridden();
++ BOOL IsCaseOverridden();
++
++};
++
++class LwpFontAttrManager
++{
++public:
++ LwpFontAttrManager():m_pFontAttrs(NULL){};
++ ~LwpFontAttrManager();
++public:
++ void Read(LwpObjectStream *pStrm);
++ void Override(sal_uInt16 index, XFFont*pFont);
++private:
++ sal_uInt16 m_nCount;
++ LwpFontAttrEntry* m_pFontAttrs;
++};
++
++class LwpFontManager
++{
++public:
++ LwpFontManager(){};
++ ~LwpFontManager(){};
++private:
++ LwpFontNameManager m_FNMgr;
++ LwpFontAttrManager m_AttrMgr;
++ sal_uInt32 m_nDlfTxtStyleFontID;
++
++public:
++ void Read(LwpObjectStream *pStrm);
++ XFFont* CreateOverrideFont(sal_uInt32 fontID, sal_uInt32 overID);
++ XFFont* CreateFont(sal_uInt32 fontID);
++ OUString GetNameByID(sal_uInt32 fontID);
++ //void AddStyle(LwpObjectID styleObjID, sal_uInt32 fontID, OUString styleName);
++ //void AddStyle(LwpObjectID styleObjID, sal_uInt32 fontID, OUString styleName, XFTextStyle* pStyle);
++ //OUString GetOverrideStyle(sal_uInt32 fontID, sal_uInt32 overID);
++
++private:
++ void Override(sal_uInt32 fontID, XFFont* pFont);
++ inline sal_uInt16 GetFontNameIndex(sal_uInt32 fontID);
++ inline sal_uInt16 GetFontAttrIndex(sal_uInt32 fontID);
++ void SetDfltFont(XFFont* pFont);
++};
++
++sal_uInt16 LwpFontManager::GetFontNameIndex(sal_uInt32 fontID)
++{
++ return static_cast<sal_uInt16>((fontID>>16)&0xFFFF);
++}
++
++sal_uInt16 LwpFontManager::GetFontAttrIndex(sal_uInt32 fontID)
++{
++ return static_cast<sal_uInt16>(fontID);
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpfootnote.cxx lotuswordpro/source/filter/lwpfootnote.cxx
+--- lotuswordpro.bak/source/filter/lwpfootnote.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfootnote.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,595 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * footnote
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++#include "lwpfootnote.hxx"
++#include "lwpstory.hxx"
++#include "xfilter/xffootnote.hxx"
++#include "xfilter/xfendnote.hxx"
++#include "xfilter/xffootnoteconfig.hxx"
++#include "xfilter/xfendnoteconfig.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xftextspan.hxx"
++#include "lwppara.hxx"
++#include "lwpdoc.hxx"
++#include "lwpfnlayout.hxx"
++#include "lwpglobalmgr.hxx"
++
++LwpFribFootnote::LwpFribFootnote(LwpPara* pPara ):LwpFrib(pPara)
++{
++}
++
++/**
++ * @descr read footnote frib information
++ */
++void LwpFribFootnote::Read(LwpObjectStream *pObjStrm, sal_uInt16 len)
++{
++ m_Footnote.ReadIndexed(pObjStrm);
++}
++
++/**
++ * @descr Register footnote style by calling LwpFootnote::RegisterStyle()
++ */
++void LwpFribFootnote::RegisterStyle()
++{
++ LwpFootnote* pFootnote = GetFootnote();
++ if(pFootnote)
++ {
++ //register footnote number font style
++ LwpFrib::RegisterStyle(m_pPara->GetFoundry());
++ //register footnote content style
++ pFootnote->SetFoundry(m_pPara->GetFoundry());
++ pFootnote->RegisterStyle();
++ }
++}
++
++/**
++ * @descr Parse footnote by calling LwpFootnote::XFConvert()
++ */
++void LwpFribFootnote::XFConvert(XFContentContainer* pCont)
++{
++ LwpFootnote* pFootnote = GetFootnote();
++ if(pFootnote)
++ {
++ XFContentContainer* pContent = NULL;
++ if(pFootnote->GetType() == FN_FOOTNOTE)
++ {
++ pContent = new XFFootNote();
++ }
++ else
++ {
++ pContent = new XFEndNote();
++ }
++ pFootnote->XFConvert(pContent);
++ if(m_ModFlag)
++ {
++ //set footnote number font style
++ XFTextSpan *pSpan = new XFTextSpan();
++ pSpan->SetStyleName(GetStyleName());
++ //add the xffootnote into the content container
++ pSpan->Add(pContent);
++ pCont->Add(pSpan);
++ }
++ else
++ {
++ pCont->Add(pContent);
++ }
++ }
++}
++
++/**
++ * @descr Get foonote object
++ */
++LwpFootnote* LwpFribFootnote::GetFootnote()
++{
++ return static_cast<LwpFootnote*>(m_Footnote.obj());
++}
++
++
++LwpFootnote::LwpFootnote(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ : LwpOrderedObject(objHdr, pStrm)
++{
++}
++
++LwpFootnote::~LwpFootnote()
++{
++
++}
++
++/**
++ * @descr Read foonote object
++ */
++void LwpFootnote::Read()
++{
++ LwpOrderedObject::Read();
++ m_pObjStrm->QuickRead(&m_nType, sizeof(m_nType));
++ m_pObjStrm->QuickRead(&m_nRow, sizeof(m_nRow));
++ m_Content.ReadIndexed(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++ * @descr Register footnote style
++ */
++void LwpFootnote::RegisterStyle()
++{
++ //Only register footnote contents style,
++ //Endnote contents style registers in LwpEnSuperTableLayout::RegisterStyle
++ if(m_nType == FN_FOOTNOTE)
++ {
++ LwpContent* pContent = FindFootnoteContent();
++ if(pContent)
++ {
++ pContent->SetFoundry(m_pFoundry);
++ pContent->RegisterStyle();
++ }
++ }
++}
++
++/**
++ * @descr Parse footnote
++ */
++void LwpFootnote::XFConvert(XFContentContainer * pCont)
++{
++ LwpContent* pContent = FindFootnoteContent();
++ if(pContent)
++ {
++ pContent->XFConvert(pCont);
++ }
++}
++
++/**
++ * @descr Get endnote cell layout which contains current endnote content
++ */
++LwpCellLayout* LwpFootnote::GetCellLayout()
++{
++ LwpEnSuperTableLayout* pEnSuperLayout = FindFootnoteTableLayout();
++ if(pEnSuperLayout)
++ {
++ LwpTableLayout* pTableLayout = static_cast<LwpTableLayout*>(pEnSuperLayout->GetMainTableLayout());
++ if(pTableLayout)
++ {
++ LwpRowLayout* pRowLayout = pTableLayout->GetRowLayout(m_nRow);
++ if(pRowLayout)
++ {
++ return static_cast<LwpCellLayout*>(pRowLayout->GetChildHead()->obj());
++ }
++ }
++ }
++ return NULL;
++}
++/**
++ * @descr Get endnote supertable layout which contains current endnote content, not used now
++ */
++LwpEnSuperTableLayout* LwpFootnote::GetEnSuperTableLayout()
++{
++ LwpDocument* pDivision = GetFootnoteTableDivision();
++ if(pDivision)
++ return static_cast<LwpEnSuperTableLayout*>(pDivision->GetEnSuperTableLayout());
++ return NULL;
++}
++
++/**
++ * @descr Get division which footnote table contains current footnote content, copy from lwp source code
++ */
++LwpDocument* LwpFootnote::GetFootnoteTableDivision()
++{
++ if(!m_pFoundry)
++ return NULL;
++
++ LwpDocument* pPrev =NULL;
++ LwpDocument* pDivision = NULL;
++ LwpDocument* pFootnoteDivision =NULL;
++
++ // Make sure the footnote does belong to some division
++ // The division might not have a DivisionInfo if it's being Destruct()ed
++ pPrev = m_pFoundry->GetDocument();
++ pFootnoteDivision = pPrev;
++ if (!pPrev || pPrev->GetDivInfoID()->IsNull())
++ return NULL;
++
++ switch (m_nType)
++ {
++ case FN_FOOTNOTE:
++ {
++ // Footnotes always use the source division
++ return pFootnoteDivision;
++ }
++ case FN_DIVISION:
++ {
++ // Start with the footnote's division
++ pDivision = pPrev;
++ break;
++ }
++ case FN_DIVISION_SEPARATE:
++ {
++ // It had better be the next division
++ pDivision = pPrev->GetNextDivision();
++ break;
++ }
++ case FN_DIVISIONGROUP:
++ case FN_DIVISIONGROUP_SEPARATE:
++ {
++ pDivision = pPrev->GetLastInGroupWithContents();
++ pPrev = pDivision;
++ break;
++ }
++ case FN_DOCUMENT:
++ case FN_DOCUMENT_SEPARATE:
++ {
++ pDivision = pFootnoteDivision->GetRootDocument();
++ if (pDivision)
++ pDivision = pDivision->GetLastDivisionWithContents();
++ pPrev = pDivision;
++ break;
++ }
++
++ }
++
++ // Make sure we're using the proper endnote division, if it's separate
++ if (m_nType & FN_MASK_SEPARATE)
++ pDivision = GetEndnoteDivision(pDivision);
++ // Don't use a division that's specifically for endnotes
++ else
++ {
++ while (pDivision)
++ {
++ if (pDivision->GetEndnoteType() == FN_DONTCARE)
++ break;
++ if (m_nType == FN_DIVISIONGROUP)
++ pDivision = pDivision->GetPreviousInGroup();
++ else
++ pDivision = pDivision->GetPreviousDivisionWithContents();
++ }
++ }
++ if (pDivision)
++ return pDivision;
++ return NULL;
++}
++
++/**
++ * @descr Get division which endnote table contains current endnote content, copy from lwp source code
++ */
++LwpDocument* LwpFootnote::GetEndnoteDivision(LwpDocument* pPossible)
++{
++ LwpDocument* pDivision = pPossible;
++ sal_uInt16 nDivType;
++
++ // In case we have multiple endnote divisions, walk backwards until
++ // we find one.
++ while (pDivision)
++ {
++ // Do we already have the right division?
++ nDivType = pDivision->GetEndnoteType();
++ if (nDivType == m_nType)
++ return pDivision;
++ // When we hit the first non-endnote division, stop looking.
++ // -- SDC 10/8/96
++ if (nDivType == FN_DONTCARE)
++ break;
++ pDivision = pDivision->GetPreviousDivision();
++ }
++ return NULL;
++}
++
++/**
++ * @descr Get footnote table class name
++ */
++OUString LwpFootnote::GetTableClass()
++{
++ OUString strClassName;
++ switch (GetType() & FN_MASK_BASE)
++ {
++ case FN_BASE_FOOTNOTE:
++ {
++ strClassName = A2OUSTR(STR_DivisionFootnote);
++ break;
++ }
++ case FN_BASE_DOCUMENT:
++ {
++ strClassName = A2OUSTR(STR_DocumentEndnote);
++ break;
++ }
++ case FN_BASE_DIVISION:
++ {
++ strClassName = A2OUSTR(STR_DivisionEndnote);
++ break;
++ }
++ case FN_BASE_DIVISIONGROUP:
++ {
++ strClassName = A2OUSTR(STR_DivisionGroupEndnote);
++ break;
++ }
++ }
++ return strClassName;
++}
++
++/**
++ * @descr Find footnote tablelayout, copy from lwp source code
++ */
++LwpEnSuperTableLayout* LwpFootnote::FindFootnoteTableLayout()
++{
++ LwpDocument* pDivision = GetFootnoteTableDivision();
++ if(!pDivision)
++ return NULL;
++
++ LwpFoundry* pFoundry = pDivision->GetFoundry();
++ OUString strClassName = GetTableClass();
++ if(strClassName.getLength() ==0 )
++ return NULL;
++
++ LwpContent* pContent = NULL;
++
++ while ((pContent = pFoundry->EnumContents(pContent)) != NULL)
++ if (pContent->IsTable() && (strClassName.equals(pContent->GetClassName())) &&
++ pContent->IsActive() && pContent->GetLayout(NULL))
++ {
++ // Found it!
++ return (LwpEnSuperTableLayout *)
++ ((LwpTable*)pContent)->GetSuperTableLayout();
++ }
++
++ return NULL;
++}
++
++/**
++ * @descr Find footnote table, not used now
++ */
++LwpTable* LwpFootnote::FindFootnoteTable()
++{
++ LwpEnSuperTableLayout* pLayout = FindFootnoteTableLayout();
++ //if (!ShouldBeInTable(Footnote)) return NULL;
++ return GetFootnoteTable(pLayout);
++}
++
++/**
++ * @descr Find footnote table, not used now
++ */
++LwpTable* LwpFootnote::GetFootnoteTable(LwpEnSuperTableLayout * pLayout)
++{
++ if(pLayout)
++ {
++ LwpEndnoteLayout* pEndnoteLayout = static_cast<LwpEndnoteLayout*>(pLayout->GetMainTableLayout());
++ if(pEndnoteLayout)
++ return static_cast<LwpTable*>(pEndnoteLayout->GetContent()->obj());
++ }
++ return NULL;
++}
++
++/**
++ * @descr Find footnote contents
++ */
++LwpContent* LwpFootnote::FindFootnoteContent()
++{
++ LwpContent* pContent = static_cast<LwpContent*>(m_Content.obj());
++ //if the content has layout, the content has footnote contents;
++ //or looking for the celllayout and return the footnote contents.
++ if(pContent && pContent->GetLayout(NULL))
++ return pContent;
++
++ LwpCellLayout* pCellLayout = GetCellLayout();
++ if(pCellLayout)
++ {
++ pContent =static_cast<LwpContent*>(pCellLayout->GetContent()->obj());
++ }
++
++ return pContent;
++}
++
++LwpFootnoteTable::LwpFootnoteTable(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ : LwpTable(objHdr, pStrm)
++{
++}
++
++void LwpFootnoteTable::Read()
++{
++ LwpTable::Read();
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++ * @descr Read footnote number options information
++ */
++void LwpFootnoteNumberOptions::Read(LwpObjectStream *pObjStrm)
++{
++ pObjStrm->QuickRead(&m_nFlag, sizeof(m_nFlag));
++ pObjStrm->QuickRead(&m_nStartingNumber, sizeof(m_nStartingNumber));
++ m_LeadingText.Read(pObjStrm);
++ m_TrailingText.Read(pObjStrm);
++ pObjStrm->SkipExtra();
++}
++
++/**
++ * @descr Read footnote seperator options information
++ */
++void LwpFootnoteSeparatorOptions::Read(LwpObjectStream *pObjStrm)
++{
++ pObjStrm->QuickRead(&m_nFlag, sizeof(m_nFlag));
++ pObjStrm->QuickRead(&m_nLength, sizeof(m_nLength));
++ pObjStrm->QuickRead(&m_nIndent, sizeof(m_nIndent));
++ pObjStrm->QuickRead(&m_nAbove, sizeof(m_nAbove));
++ pObjStrm->QuickRead(&m_nBelow, sizeof(m_nBelow));
++ m_BorderStuff.Read(pObjStrm);
++ pObjStrm->SkipExtra();
++
++}
++
++
++LwpFootnoteOptions::LwpFootnoteOptions(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ : LwpObject(objHdr, pStrm)
++{
++}
++
++LwpFootnoteOptions::~LwpFootnoteOptions()
++{
++
++}
++
++/**
++ * @descr Register footnote options object
++ */
++void LwpFootnoteOptions::Read()
++{
++ m_pObjStrm->QuickRead(&m_nFlag, sizeof(m_nFlag));
++ m_FootnoteNumbering.Read(m_pObjStrm);
++ m_EndnoteDivisionNumbering.Read(m_pObjStrm);
++ m_EndnoteDivisionGroupNumbering.Read(m_pObjStrm);
++ m_EndnoteDocNumbering.Read(m_pObjStrm);
++ m_FootnoteSeparator.Read(m_pObjStrm);
++ m_FootnoteContinuedSeparator.Read(m_pObjStrm);
++ m_ContinuedOnMessage.Read(m_pObjStrm);
++ m_ContinuedFromMessage.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++ * @descr Register footnote options style
++ */
++void LwpFootnoteOptions::RegisterStyle()
++{
++ RegisterFootnoteStyle();
++ RegisterEndnoteStyle();
++}
++
++/**
++ * @descr Register footnote configuration information
++ */
++void LwpFootnoteOptions::RegisterFootnoteStyle()
++{
++ XFFootnoteConfig* pFootnoteConfig = new XFFootnoteConfig();
++ pFootnoteConfig->SetStartValue(m_FootnoteNumbering.GetStartingNumber() -1);
++ pFootnoteConfig->SetNumPrefix(m_FootnoteNumbering.GetLeadingText());
++ pFootnoteConfig->SetNumSuffix(m_FootnoteNumbering.GetTrailingText());
++ if(m_FootnoteNumbering.GetReset() == LwpFootnoteNumberOptions::RESET_PAGE)
++ {
++ pFootnoteConfig->SetRestartOnPage();
++ }
++ if(GetContinuedFrom())
++ {
++ pFootnoteConfig->SetMessageFrom(GetContinuedFromMessage());
++ }
++ if(GetContinuedOn())
++ {
++ pFootnoteConfig->SetMessageOn(GetContinuedOnMessage());
++ }
++
++ pFootnoteConfig->SetMasterPage( m_strMasterPage);
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ pXFStyleManager->SetFootnoteConfig(pFootnoteConfig);
++
++}
++
++/**
++ * @descr Register endnote configuration information
++ */
++void LwpFootnoteOptions::RegisterEndnoteStyle()
++{
++ XFEndnoteConfig* pEndnoteConfig = new XFEndnoteConfig();
++ pEndnoteConfig->SetStartValue(m_EndnoteDocNumbering.GetStartingNumber() -1);
++ OUString message = m_EndnoteDocNumbering.GetLeadingText();
++ if(message.getLength() == 0)
++ {
++ message = A2OUSTR("[");//default prefix
++ }
++ pEndnoteConfig->SetNumPrefix(message);
++ message = m_EndnoteDocNumbering.GetTrailingText();
++ if(message.getLength() == 0)
++ {
++ message = A2OUSTR("]");//default suffix
++ }
++ pEndnoteConfig->SetNumSuffix(message);
++ if(m_EndnoteDocNumbering.GetReset() == LwpFootnoteNumberOptions::RESET_PAGE)
++ {
++ pEndnoteConfig->SetRestartOnPage();
++ }
++
++ pEndnoteConfig->SetMasterPage( m_strMasterPage);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ pXFStyleManager->SetEndnoteConfig(pEndnoteConfig);
++}
++
++
++/**
++ * @descr Get continue on message
++ */
++OUString LwpFootnoteOptions::GetContinuedOnMessage()
++{
++ if(m_ContinuedOnMessage.HasValue())
++ {
++ return m_ContinuedOnMessage.str();
++ }
++ // else reture defauls message
++ return A2OUSTR(STRID_FOOTCONTINUEDON);
++}
++
++/**
++ * @descr Get continue from message
++ */
++OUString LwpFootnoteOptions::GetContinuedFromMessage()
++{
++ if(m_ContinuedFromMessage.HasValue())
++ {
++ return m_ContinuedFromMessage.str();
++ }
++ // else reture defauls message
++ return A2OUSTR(STRID_FOOTCONTINUEDFROM);
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpfootnote.hxx lotuswordpro/source/filter/lwpfootnote.hxx
+--- lotuswordpro.bak/source/filter/lwpfootnote.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfootnote.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,285 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * footnote
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++#ifndef _LWPFRIBFOOTNOTE_HXX_
++#define _LWPFRIBFOOTNOTE_HXX_
++
++#include "lwpfrib.hxx"
++#include "lwpobj.hxx"
++#include "lwpsection.hxx"
++#include "lwpborderstuff.hxx"
++
++// Footnote types are built up from these numbers
++#define FN_MASK_ENDNOTE 0x80
++#define FN_MASK_SEPARATE 0x40
++#define FN_MASK_DEACTIVATED 0x20
++#define FN_MASK_BASE (0x0f | FN_MASK_ENDNOTE)
++#define FN_BASE_DONTCARE 0
++#define FN_BASE_FOOTNOTE 1
++#define FN_BASE_DIVISION (2 | FN_MASK_ENDNOTE)
++#define FN_BASE_DIVISIONGROUP (3 | FN_MASK_ENDNOTE)
++#define FN_BASE_DOCUMENT (4 | FN_MASK_ENDNOTE)
++
++// Here are the real footnote types
++#define FN_DONTCARE (FN_BASE_DONTCARE)
++#define FN_FOOTNOTE (FN_BASE_FOOTNOTE)
++#define FN_DIVISION (FN_BASE_DIVISION)
++#define FN_DIVISION_SEPARATE (FN_BASE_DIVISION | FN_MASK_SEPARATE)
++#define FN_DIVISIONGROUP (FN_BASE_DIVISIONGROUP)
++#define FN_DIVISIONGROUP_SEPARATE (FN_BASE_DIVISIONGROUP | FN_MASK_SEPARATE)
++#define FN_DOCUMENT (FN_BASE_DOCUMENT)
++#define FN_DOCUMENT_SEPARATE (FN_BASE_DOCUMENT | FN_MASK_SEPARATE)
++#define STRID_FOOTCONTINUEDFROM "Continued from previous page..."
++#define STRID_FOOTCONTINUEDON "Continued on next page..."
++//Footnote table types, the string may have to do with local language
++#define STR_DivisionFootnote "DivisionFootnote"
++#define STR_DivisionEndnote "DivisionEndnote"
++#define STR_DivisionGroupEndnote "DivisionGroupEndnote"
++#define STR_DocumentEndnote "DocumentEndnote"
++
++/**
++ * @brief Footnote frib object
++*/
++class LwpFootnote;
++class LwpFribFootnote: public LwpFrib
++{
++
++public:
++ LwpFribFootnote(LwpPara* pPara );
++ ~LwpFribFootnote(){};
++ void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++ void RegisterStyle();
++ void XFConvert(XFContentContainer* pCont);
++ LwpFootnote* GetFootnote();
++
++private:
++ LwpObjectID m_Footnote;
++};
++
++/**
++ * @brief VO_FOOTNOTE object
++*/
++class LwpSuperTableLayout;
++class LwpEnSuperTableLayout;
++class LwpFnSuperTableLayout;
++class LwpCellLayout;
++class LwpDocument;
++class LwpTable;
++class LwpFootnote : public LwpOrderedObject
++{
++public:
++ LwpFootnote(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpFootnote();
++ void RegisterStyle();
++ void XFConvert(XFContentContainer * pCont);
++protected:
++ void Read();
++private:
++ sal_uInt16 m_nType;
++ sal_uInt16 m_nRow;
++ LwpObjectID m_Content;
++public:
++ sal_uInt16 GetType(){ return m_nType;}
++private:
++ LwpCellLayout* GetCellLayout();
++ LwpEnSuperTableLayout* GetEnSuperTableLayout();
++ LwpDocument* GetFootnoteTableDivision();
++ LwpDocument* GetEndnoteDivision(LwpDocument* pPossible);
++ LwpEnSuperTableLayout* FindFootnoteTableLayout();
++ LwpTable* FindFootnoteTable();
++ LwpTable* GetFootnoteTable(LwpEnSuperTableLayout* pLayout);
++ LwpContent* FindFootnoteContent();
++ OUString GetTableClass();
++};
++
++/**
++ * @brief VO_FOOTNOTETABLE object
++*/
++#include "lwptable.hxx"
++class LwpFootnoteTable : public LwpTable
++{
++public:
++ LwpFootnoteTable(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpFootnoteTable(){};
++protected:
++ void Read();
++};
++
++/**
++ * @brief footnote number options information
++*/
++class LwpFootnoteNumberOptions
++{
++public:
++ LwpFootnoteNumberOptions(){};
++ ~LwpFootnoteNumberOptions(){};
++ void Read(LwpObjectStream* pObjStrm);
++private:
++ sal_uInt16 m_nFlag;
++ sal_uInt16 m_nStartingNumber;
++ LwpAtomHolder m_LeadingText;
++ LwpAtomHolder m_TrailingText;
++public:
++ enum // for flag
++ {
++ RESET_DOCUMENT = 0x00, // i.e., never reset the numbering
++ RESET_PAGE = 0x01,
++ RESET_DIVISION = 0x02,
++ RESET_DIVISIONGROUP = 0x04,
++ RESET_MASK = (RESET_PAGE | RESET_DIVISION | RESET_DIVISIONGROUP |
++ RESET_DOCUMENT),
++ SUPERSCRIPT_REFERENCE = 0x10
++ };
++public:
++ sal_uInt16 GetStartingNumber(){ return m_nStartingNumber;}
++ OUString GetLeadingText(){ return m_LeadingText.str();}
++ OUString GetTrailingText(){ return m_TrailingText.str();}
++ sal_uInt16 GetReset(){ return static_cast<sal_uInt16>(m_nFlag & RESET_MASK);}
++};
++
++/**
++ * @brief footnote separator options information
++*/
++class LwpFootnoteSeparatorOptions
++{
++public:
++ LwpFootnoteSeparatorOptions(){};
++ ~LwpFootnoteSeparatorOptions(){};
++ void Read(LwpObjectStream* pObjStrm);
++private:
++ sal_uInt16 m_nFlag;
++ sal_uInt32 m_nLength;
++ sal_uInt32 m_nIndent;
++ sal_uInt32 m_nAbove;
++ sal_uInt32 m_nBelow;
++ LwpBorderStuff m_BorderStuff;
++public:
++ enum // for flag
++ {
++ HAS_SEPARATOR = 0x01,
++ CUSTOM_LENGTH = 0x02
++ };
++public:
++ sal_uInt32 GetFlag(){ return m_nFlag;}
++ sal_uInt32 GetLength(){ return m_nLength;}
++ sal_uInt32 GetIndent(){ return m_nIndent;}
++ sal_uInt32 GetAbove(){ return m_nAbove;}
++ sal_uInt32 GetBelow(){ return m_nBelow;}
++ LwpBorderStuff* GetBorderStuff(){ return &m_BorderStuff;}
++ sal_Bool HasCustomLength(){ return (m_nFlag & CUSTOM_LENGTH) != 0;}
++ sal_Bool HasSeparator(){ return (m_nFlag & HAS_SEPARATOR) != 0;}
++ float GetTopBorderWidth(){ return m_BorderStuff.GetSideWidth(LwpBorderStuff::TOP);}
++ LwpColor GetTopBorderColor(){ return m_BorderStuff.GetSideColor(LwpBorderStuff::TOP);}
++};
++
++/**
++ * @brief VO_FOOTNOTEOPTS object
++*/
++class LwpFootnoteOptions : public LwpObject
++{
++public:
++ LwpFootnoteOptions(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpFootnoteOptions();
++ void RegisterStyle();
++protected:
++ void Read();
++ void RegisterFootnoteStyle();
++ void RegisterEndnoteStyle();
++private:
++ sal_uInt16 m_nFlag;
++ LwpFootnoteNumberOptions m_FootnoteNumbering;
++ LwpFootnoteNumberOptions m_EndnoteDivisionNumbering;
++ LwpFootnoteNumberOptions m_EndnoteDivisionGroupNumbering;
++ LwpFootnoteNumberOptions m_EndnoteDocNumbering;
++ LwpFootnoteSeparatorOptions m_FootnoteSeparator;
++ LwpFootnoteSeparatorOptions m_FootnoteContinuedSeparator;
++ LwpAtomHolder m_ContinuedOnMessage;
++ LwpAtomHolder m_ContinuedFromMessage;
++ OUString m_strMasterPage;
++ enum
++ {
++ FO_REPEAT = 0x0001,
++ FO_CONTINUEFROM = 0x0002,
++ FO_CONTINUEON = 0x0004,
++ FO_ON_CENTER = 0x0008,
++ FO_ON_RIGHT = 0x0010,
++ FO_ON_ALIGNMASK = FO_ON_CENTER | FO_ON_RIGHT,
++ FO_FROM_CENTER = 0x0020,
++ FO_FROM_RIGHT = 0x0040,
++ FO_FROM_ALIGNMASK = FO_FROM_CENTER | FO_FROM_RIGHT
++ };
++
++public:
++ LwpFootnoteNumberOptions* GetFootnoteNumbering(){ return &m_FootnoteNumbering;}
++ LwpFootnoteNumberOptions* GetEndnoteDivisionNumbering(){ return &m_EndnoteDivisionNumbering;}
++ LwpFootnoteNumberOptions* GetEndnoteDivisionGroupNumbering(){ return &m_EndnoteDivisionGroupNumbering;}
++ LwpFootnoteNumberOptions* GetEndnoteDocNumbering(){ return &m_EndnoteDocNumbering;}
++ LwpFootnoteSeparatorOptions* GetFootnoteSeparator(){ return &m_FootnoteSeparator;}
++ LwpFootnoteSeparatorOptions* GetFootnoteContinuedSeparator(){ return &m_FootnoteContinuedSeparator;}
++ sal_Bool GetContinuedFrom(){ return ((m_nFlag & FO_CONTINUEFROM) != 0);}
++ sal_Bool GetContinuedOn(){ return ((m_nFlag & FO_CONTINUEON) != 0);}
++ OUString GetContinuedOnMessage();
++ OUString GetContinuedFromMessage();
++ void SetMasterPage(OUString strMasterPage){ m_strMasterPage = strMasterPage;}
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpfoundry.cxx lotuswordpro/source/filter/lwpfoundry.cxx
+--- lotuswordpro.bak/source/filter/lwpfoundry.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfoundry.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,580 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpfoundry.hxx"
++#include "lwpfilehdr.hxx"
++#include "lwpdoc.hxx"
++#include "lwpmarker.hxx"
++#include "lwpholder.hxx"
++#include "lwpbulletstylemgr.hxx"
++#include "lwpcontent.hxx"
++#include "lwpvpointer.hxx"
++#include "lwpsection.hxx"
++#include "lwpcharacterstyle.hxx"
++#include "lwpglobalmgr.hxx"
++
++LwpFoundry::LwpFoundry(LwpObjectStream *pStrm, LwpDocument* pDoc)
++ : m_pDoc(pDoc), m_pPieceMgr(NULL), m_pStyleMgr(NULL)
++{
++ Read(pStrm);
++ m_pDropcapMgr = new LwpDropcapMgr;
++ m_pBulletStyleMgr = new LwpBulletStyleMgr();
++ m_pBulletStyleMgr->SetFoundry(this);
++}
++
++LwpFoundry::~LwpFoundry()
++{
++ if(m_pPieceMgr)
++ {
++ delete m_pPieceMgr;
++ }
++ if(m_pStyleMgr)
++ {
++ delete m_pStyleMgr;
++ }
++ if (m_pDropcapMgr)
++ delete m_pDropcapMgr;
++ if (m_pBulletStyleMgr)
++ {
++ delete m_pBulletStyleMgr;
++ }
++}
++
++void LwpFoundry::Read(LwpObjectStream *pStrm)
++{
++ if (!m_pDoc->IsChildDoc())
++ {
++ m_VerMgr.Read(pStrm);
++ }
++ m_ObjMgr.Read(pStrm);
++
++ m_MarkerHead.ReadIndexed(pStrm);
++ m_FootnoteMgr.ReadIndexed(pStrm);
++
++ m_NumMgr.Read(pStrm);
++ m_BulMgr.Read(pStrm);
++
++ m_SectionList.Read(pStrm);
++ m_Layout.ReadIndexed(pStrm);
++
++ ReadStyles(pStrm);
++
++ m_BookMarkHead.ReadIndexed(pStrm);
++ m_DdeLinkHead.ReadIndexed(pStrm);
++ m_DirtBagHead.ReadIndexed(pStrm);
++ m_NamedOutlineSeqHead.ReadIndexed(pStrm);
++
++ m_EnumLayoutHead.ReadIndexed(pStrm);
++ m_EnumLayoutTail.ReadIndexed(pStrm);
++ m_NamedObjects.ReadIndexed(pStrm);
++
++ pStrm->QuickRead(&m_nLastClickHere, sizeof(m_nLastClickHere));
++ m_SmartTextMgr.ReadIndexed(pStrm);
++
++ m_ContentMgr.Read(pStrm);
++ m_FontMgr.Read(pStrm);
++
++ if (!m_pDoc->IsChildDoc() && LwpFileHeader::m_nFileRevision >= 0x000B)
++ {
++ m_pPieceMgr = new LwpPieceManager();
++
++ m_pPieceMgr->Read(pStrm);
++ }
++
++ if( LwpFileHeader::m_nFileRevision >= 0x000B)
++ {
++ m_DftDropCapStyle.ReadIndexed(pStrm);
++ }
++ if( LwpFileHeader::m_nFileRevision >= 0x000F)
++ {
++ m_DftHeaderStyle.ReadIndexed(pStrm);
++ m_DftFooterStyle.ReadIndexed(pStrm);
++ }
++ pStrm->SkipExtra();
++
++ m_pStyleMgr = new LwpStyleManager();
++ m_pStyleMgr->SetFoundry(this);
++}
++
++
++void LwpFoundry::ReadStyles(LwpObjectStream *pStrm)
++{
++ m_TextStyle.ReadIndexed(pStrm);
++ m_DefaultTextStyle.ReadIndexed(pStrm);
++ m_DefaultClickStyle.ReadIndexed(pStrm);
++ m_PageStyle.ReadIndexed(pStrm);
++ m_FrameStyle.ReadIndexed(pStrm);
++
++ m_TableStyle.ReadIndexed(pStrm);
++ m_CellStyle.ReadIndexed(pStrm);
++ m_DftFrameStyle.ReadIndexed(pStrm);
++ m_DftPageStyle.ReadIndexed(pStrm);
++ m_DftTableStyle.ReadIndexed(pStrm);
++
++ m_DftCellStyle.ReadIndexed(pStrm);
++ m_DftColumnStyle.ReadIndexed(pStrm);
++ m_DftLeftColumnStyle.ReadIndexed(pStrm);
++ m_DftRighColumnStyle.ReadIndexed(pStrm);
++
++}
++
++#include "xfilter/xfstylemanager.hxx"
++#include "lwplayout.hxx"
++
++void LwpFoundry::RegisterAllLayouts()
++{
++ //Register CellStyle
++ LwpObject* pStyle = m_CellStyle.obj();
++ if( pStyle )
++ {
++ pStyle->SetFoundry(this);
++ pStyle->RegisterStyle();
++ }
++
++ //register content page layout list: Layout
++ pStyle = m_Layout.obj();
++ if( pStyle )
++ {
++ pStyle->SetFoundry(this);
++ pStyle->RegisterStyle();
++ }
++
++ //Register page style layout list: PageStyle, such as "Default Page"
++ pStyle = m_PageStyle.obj();
++ if( pStyle )
++ {
++ pStyle->SetFoundry(this);
++ pStyle->RegisterStyle();
++ }
++
++ //Register FrameStyle
++ pStyle = m_FrameStyle.obj();
++ if( pStyle )
++ {
++ pStyle->SetFoundry(this);
++ pStyle->RegisterStyle();
++ }
++
++}
++
++LwpBookMark* LwpFoundry::GetBookMark(LwpObjectID objMarker)
++{
++ LwpDLVListHeadHolder* pHeadHolder= static_cast
++ <LwpDLVListHeadHolder*>(m_BookMarkHead.obj());
++ LwpObjectID* pObjID = pHeadHolder->GetHeadID();
++ LwpBookMark* pBookMark;
++ if (pObjID)
++ pBookMark = static_cast<LwpBookMark*>(pObjID->obj());
++ else
++ return NULL;
++
++ while (pBookMark)
++ {
++ if (pBookMark->IsRightMarker(objMarker))
++ return pBookMark;
++ pObjID = pBookMark->GetNext();
++ if (pObjID)
++ pBookMark = static_cast<LwpBookMark*>(pObjID->obj());
++ else
++ return NULL;
++ }
++ return NULL;
++}
++
++sal_Bool LwpFoundry::FindBookMarkByName(OUString sName)
++{
++ LwpDLVListHeadHolder* pHeadHolder= static_cast
++ <LwpDLVListHeadHolder*>(m_BookMarkHead.obj());
++ LwpObjectID* pObjID = pHeadHolder->GetHeadID();
++ LwpBookMark* pBookMark;
++ if (pObjID)
++ pBookMark = static_cast<LwpBookMark*>(pObjID->obj());
++ else
++ return NULL;
++
++ while (pBookMark)
++ {
++ if (pBookMark->IsRightName(sName))
++ return sal_True;
++ pObjID = pBookMark->GetNext();
++ if (pObjID)
++ pBookMark = static_cast<LwpBookMark*>(pObjID->obj());
++ else
++ return sal_False;
++ }
++ return sal_False;
++}
++
++/**
++* @descr: Get next content
++*
++*/
++LwpContent* LwpFoundry::EnumContents(LwpContent * pContent)
++{
++ return GetContentManager()->EnumContents(pContent);
++}
++
++/**
++* @descr: Get next section
++*
++*/
++LwpSection* LwpFoundry::EnumSections(LwpSection * pSection)
++{
++ return static_cast<LwpSection*>(m_SectionList.Enumerate(pSection));
++}
++
++/**
++* @descr: Get default text style id
++*
++*/
++LwpObjectID * LwpFoundry::GetDefaultTextStyle()
++{
++ LwpVersionedPointer * pPointer = static_cast<LwpVersionedPointer *>(m_DefaultTextStyle.obj());
++ if (!pPointer)
++ return NULL;
++
++ return pPointer->GetPointer();
++}
++
++/**
++* @descr: Get paragraph style object id according to its style name
++*
++*/
++LwpObjectID * LwpFoundry::FindParaStyleByName(OUString name)
++{
++ //Register all text styles: para styles, character styles
++ LwpDLVListHeadHolder* pParaStyleHolder = static_cast<LwpDLVListHeadHolder*>(GetTextStyleHead()->obj());
++ if(pParaStyleHolder)
++ {
++ LwpTextStyle* pParaStyle = static_cast<LwpTextStyle*> (pParaStyleHolder->GetHeadID()->obj());
++ while(pParaStyle)
++ {
++ OUString strName = pParaStyle->GetName()->str();
++ if(strName == name)
++ return pParaStyle->GetObjectID();
++ pParaStyle = static_cast<LwpTextStyle*>(pParaStyle->GetNext()->obj());
++ }
++ }
++
++ return NULL;
++}
++
++/**
++* @descr: Get style name registed according the original style name
++*
++*/
++OUString LwpFoundry::FindActuralStyleName(OUString name)
++{
++ LwpObjectID* pID = FindParaStyleByName(name);
++ if(pID)
++ {
++ IXFStyle* pStyle = GetStyleManager()->GetStyle(*pID);
++ if(pStyle)
++ {
++ return pStyle->GetStyleName();
++ }
++ }
++
++ return name;
++}
++
++void LwpVersionManager::Read(LwpObjectStream *pStrm)
++{
++ // TODO: skip the data for prototype
++ Skip(pStrm);
++}
++
++void LwpVersionManager::Skip(LwpObjectStream *pStrm)
++{
++
++ sal_uInt32 cNextUserVersionID;
++ pStrm->QuickRead(&cNextUserVersionID, sizeof(cNextUserVersionID));
++
++ sal_uInt16 Count;
++ pStrm->QuickRead(&Count, sizeof(Count));
++
++ sal_uInt32 tag;
++ while(Count--)
++ {
++ pStrm->QuickRead(&tag, sizeof(tag));
++ USHORT len;
++ switch(tag)
++ {
++ case TAG_USER_VERSION:
++ // TODO: skip the CUserVersionControl
++ pStrm->QuickRead(&len, sizeof(len));
++ pStrm->SeekRel(len);
++ //pStrm->SkipExtra(); //The length has included the extra
++ break;
++
++ default:
++ pStrm->QuickRead(&len, sizeof(USHORT));
++ pStrm->SeekRel(len);
++ pStrm->SkipExtra();
++ break;
++ }
++ }
++ pStrm->SkipExtra();
++}
++
++void LwpObjectManager::Read(LwpObjectStream *pStrm)
++{
++
++ LwpObjectID dummy;
++ dummy.Read(pStrm);
++ // TODO: judge if we need to set the cDelta by the dummy id
++
++ m_Division.ReadIndexed(pStrm);
++ pStrm->SkipExtra();
++}
++
++void LwpNumberManager::Read(LwpObjectStream *pStrm)
++{
++ m_TableRange.ReadIndexed(pStrm);
++ pStrm->SkipExtra();
++}
++
++void LwpBulletManager::Read(LwpObjectStream *pStrm)
++{
++ m_Head.ReadIndexed(pStrm);
++ pStrm->SkipExtra();
++}
++
++void LwpContentManager::Read(LwpObjectStream *pStrm)
++{
++ m_ContentList.ReadIndexed(pStrm);
++
++ // TODO: to judge the file revision
++
++ m_EnumHead.ReadIndexed(pStrm);
++ m_EnumTail.ReadIndexed(pStrm);
++
++ m_OleObjCount.ReadIndexed(pStrm);
++
++ if( LwpFileHeader::m_nFileRevision >= 0x000B)
++ {
++ m_GrapHead.ReadIndexed(pStrm);
++ m_GrapTail.ReadIndexed(pStrm);
++ m_OleHead.ReadIndexed(pStrm);
++ m_OleTail.ReadIndexed(pStrm);
++ }
++
++ pStrm->SkipExtra();
++}
++
++/**
++* @descr: Get next content
++*
++*/
++LwpContent* LwpContentManager::EnumContents(LwpContent* pContent)
++{
++ if(pContent)
++ return pContent->GetNextEnumerated();
++ LwpVersionedPointer* pPointer = static_cast<LwpVersionedPointer*>(m_EnumHead.obj());
++ return pPointer ? static_cast<LwpContent*>(pPointer->GetPointer()->obj()) : NULL;
++}
++
++void LwpPieceManager::Read(LwpObjectStream *pStrm)
++{
++ m_GeometryPieceList.ReadIndexed(pStrm);
++ m_ScalePieceList.ReadIndexed(pStrm);
++ m_MarginsPieceList.ReadIndexed(pStrm);
++ m_ColumnsPieceList.ReadIndexed(pStrm);
++ m_BorderStuffPieceList.ReadIndexed(pStrm);
++
++ m_GutterStuffPieceList.ReadIndexed(pStrm);
++ m_BackgroundStuffPieceList.ReadIndexed(pStrm);
++ m_JoinStuffPieceList.ReadIndexed(pStrm);
++ m_ShadowPieceList.ReadIndexed(pStrm);
++ m_NumericsPieceList.ReadIndexed(pStrm);
++
++ m_RelativityPieceList.ReadIndexed(pStrm);
++ m_AlignmentPieceList.ReadIndexed(pStrm);
++ m_IndentPieceList.ReadIndexed(pStrm);
++ m_ParaBorderPieceList.ReadIndexed(pStrm);
++ m_SpacingPieceList.ReadIndexed(pStrm);
++
++ m_BreaksPieceList.ReadIndexed(pStrm);
++ m_NumberingPieceList.ReadIndexed(pStrm);
++ m_TabPieceList.ReadIndexed(pStrm);
++ m_CharacterBorderPieceList.ReadIndexed(pStrm);
++ m_AmikakePieceList.ReadIndexed(pStrm);
++
++ if(pStrm->CheckExtra())
++ {
++ m_ParaBackgroundPieceList.ReadIndexed(pStrm);
++ m_ExternalBorderStuffPieceList.ReadIndexed(pStrm);
++ m_ExternalJoinStuffPieceList.ReadIndexed(pStrm);
++ pStrm->SkipExtra();
++ }
++}
++
++void LwpOrderedObjectManager::Read(LwpObjectStream *pStrm)
++{
++ m_Head.ReadIndexed(pStrm);
++}
++
++/**
++* @descr: Get next orderedobject, copy from lwp source code
++*
++*/
++LwpOrderedObject* LwpOrderedObjectManager::Enumerate(LwpOrderedObject * pLast)
++{
++ // If Last has a next, return it.
++ if(pLast && !pLast->GetNext()->IsNull())
++ return static_cast<LwpOrderedObject*>(pLast->GetNext()->obj());
++
++ LwpListList* pList = NULL;
++ if(pLast)
++ {
++ // We're at the end of Last's list (not Liszt's list).
++ // Start with the next active list
++ pList = static_cast<LwpListList*>(pLast->GetListList()->obj());
++ pList= GetNextActiveListList(pList);
++ }
++ else
++ {
++ // Start with the first active ListList
++ pList = GetNextActiveListList(NULL);
++ }
++
++ if(pList)
++ {
++ return static_cast<LwpOrderedObject*>(pList->GetHead()->obj());
++ }
++
++ return NULL;
++}
++
++/**
++* @descr: Get next listlist object, copy from lwp source code
++*
++*/
++LwpListList* LwpOrderedObjectManager::GetNextActiveListList(LwpListList * pLast)
++{
++ LwpListList* pList = NULL;
++ LwpContent* pContent = NULL;
++ if(pLast)
++ pList = static_cast<LwpListList*>(pLast->GetNext()->obj());
++ else
++ {
++ LwpDLVListHeadHolder* pHeadHolder= static_cast<LwpDLVListHeadHolder*>(m_Head.obj());
++ if(pHeadHolder)
++ {
++ pList = static_cast<LwpListList*>(pHeadHolder->GetHeadID()->obj());
++ }
++ }
++
++ while(pList)
++ {
++ pContent = static_cast<LwpContent*>(pList->GetObject()->obj());
++ if(pContent && pContent->HasNonEmbeddedLayouts() &&
++ !pContent->IsStyleContent())
++ return pList;
++ pList = static_cast<LwpListList*>(pList->GetNext()->obj());
++ }
++ return NULL;
++}
++
++LwpStyleManager::LwpStyleManager()
++{}
++
++LwpStyleManager::~LwpStyleManager()
++{
++ m_StyleList.clear();
++}
++
++
++#include "xfilter/xfstylemanager.hxx"
++/*
++VO_PARASTYLE/VO_CHARACTERSTYLE call this method to add its created style to XFStyleManager
++1. Add the style to XFStyleManager, and return the <office:styles> style name
++2. Add it to LwpParaStyleMap.
++Prerequisite: pStyle has been created and all properties has been set to it.
++Return the XFStyle* added by XFStyleManager
++*/
++IXFStyle* LwpStyleManager::AddStyle(LwpObjectID styleObjID, IXFStyle* pStyle)
++{
++ assert(pStyle);
++ //pStyle may change if same style is found in XFStyleManager
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ pStyle = pXFStyleManager->AddStyle(pStyle);
++ m_StyleList.insert(LwpStyleMap::value_type(styleObjID, pStyle));
++ return pStyle;
++}
++
++/*
++Called by VO_PARA or other objects to get style name based on the Style object ID
++1) Get style from LwpParaStyleMap based on the LwpObjectID of VO_PARASTYLE.
++Prerequisite: VO_PARASTYLE/VO_CHARACTERSTYLE should call AddStyle first.
++Return empty string if no style found.
++*/
++IXFStyle* LwpStyleManager::GetStyle(const LwpObjectID &styleObjID)
++{
++ LwpStyleMap::const_iterator it = m_StyleList.find(styleObjID);
++ if (it != m_StyleList.end()) {
++ return((*it).second);
++ }
++ return NULL;
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpfoundry.hxx lotuswordpro/source/filter/lwpfoundry.hxx
+--- lotuswordpro.bak/source/filter/lwpfoundry.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfoundry.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,326 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPFOUNDRY_HXX
++#define _LWPFOUNDRY_HXX
++
++#include "lwpheader.hxx"
++
++#ifndef _LWPOBJECTID_HXX
++#include "lwpobjid.hxx"
++#endif
++
++#ifndef _LWPOBJECTSTREAM_HXX
++#include "lwpobjstrm.hxx"
++#endif
++
++#include "lwpcolor.hxx"
++#include "lwpbasetype.hxx"
++#include "lwpfont.hxx"
++#include "lwpdropcapmgr.hxx"
++class LwpDocument;
++class LwpBookMark;
++
++#include <vector>
++#define TAG_USER_VERSION 0x72655655UL // "UVer"
++
++
++class LwpVersionManager
++{
++public:
++ LwpVersionManager(){};
++ ~LwpVersionManager(){};
++public:
++ void Read(LwpObjectStream *pStrm);
++ void Skip(LwpObjectStream *pStrm);
++};
++
++class LwpObjectManager
++{
++public:
++ LwpObjectManager(){};
++ ~LwpObjectManager(){};
++private:
++ LwpObjectID m_Division;
++public:
++ void Read(LwpObjectStream *pStrm);
++};
++
++class LwpNumberManager
++{
++public:
++ LwpNumberManager(){};
++ ~LwpNumberManager(){};
++private:
++ LwpObjectID m_TableRange;
++public:
++ void Read(LwpObjectStream *pStrm);
++ LwpObjectID GetTableRangeID(){ return m_TableRange;}
++};
++
++class LwpBulletManager
++{
++public:
++ LwpBulletManager(){};
++ ~LwpBulletManager(){};
++private:
++ LwpObjectID m_Head;
++public:
++ void Read(LwpObjectStream *pStrm);
++ LwpObjectID* GetHeadID() { return &m_Head;}
++};
++
++class LwpContent;
++class LwpContentManager
++{
++public:
++ LwpContentManager(){};
++ ~LwpContentManager(){};
++private:
++ LwpObjectID m_ContentList;
++ LwpObjectID m_EnumHead;
++ LwpObjectID m_EnumTail;
++ LwpObjectID m_OleObjCount;
++ sal_uInt32 m_oldOleObjCount;
++
++ LwpObjectID m_GrapHead;
++ LwpObjectID m_GrapTail;
++ LwpObjectID m_OleHead;
++ LwpObjectID m_OleTail;
++public:
++ inline LwpObjectID* GetContentList() { return &m_ContentList; }
++ inline LwpObjectID* GetGraphicListHead() { return &m_GrapHead; }
++ LwpContent* EnumContents(LwpContent* pContent);
++
++public:
++ void Read(LwpObjectStream *pStrm);
++};
++
++class LwpPieceManager
++{
++public:
++ LwpPieceManager(){};
++ ~LwpPieceManager(){};
++private:
++ LwpObjectID m_GeometryPieceList;
++ LwpObjectID m_ScalePieceList;
++ LwpObjectID m_MarginsPieceList;
++ LwpObjectID m_ColumnsPieceList;
++ LwpObjectID m_BorderStuffPieceList;
++ LwpObjectID m_GutterStuffPieceList;
++ LwpObjectID m_BackgroundStuffPieceList;
++ LwpObjectID m_JoinStuffPieceList;
++ LwpObjectID m_ShadowPieceList;
++ LwpObjectID m_NumericsPieceList;
++ LwpObjectID m_RelativityPieceList;
++ LwpObjectID m_AlignmentPieceList;
++ LwpObjectID m_IndentPieceList;
++ LwpObjectID m_ParaBorderPieceList;
++ LwpObjectID m_SpacingPieceList;
++ LwpObjectID m_BreaksPieceList;
++ LwpObjectID m_NumberingPieceList;
++ LwpObjectID m_TabPieceList;
++ LwpObjectID m_CharacterBorderPieceList;
++ LwpObjectID m_AmikakePieceList;
++
++ LwpObjectID m_ParaBackgroundPieceList;
++ LwpObjectID m_ExternalBorderStuffPieceList;
++ LwpObjectID m_ExternalJoinStuffPieceList;
++
++public:
++ void Read(LwpObjectStream *pStrm);
++};
++
++class LwpOrderedObject;
++class LwpListList;
++class LwpOrderedObjectManager
++{
++public:
++ LwpOrderedObjectManager(){};
++ ~LwpOrderedObjectManager(){};
++protected:
++ LwpObjectID m_Head;
++public:
++ void Read(LwpObjectStream *pStrm);
++ LwpObjectID* GetHeadID() { return &m_Head;};
++ LwpOrderedObject* Enumerate(LwpOrderedObject* pLast);
++protected:
++ LwpListList* GetNextActiveListList(LwpListList* pLast);
++};
++
++class LwpStyleManager;
++class LwpSection;
++class LwpBulletStyleMgr;
++class LwpFoundry
++{
++public:
++ LwpFoundry( LwpObjectStream *pStrm, LwpDocument* pDoc );
++ ~LwpFoundry();
++ void Read(LwpObjectStream *pStrm);
++ void RegisterAllLayouts();
++private:
++ LwpDocument* m_pDoc;
++private: //file members
++ LwpVersionManager m_VerMgr;
++ LwpObjectManager m_ObjMgr;
++ LwpObjectID m_MarkerHead;
++ LwpObjectID m_FootnoteMgr;
++ LwpNumberManager m_NumMgr;
++ LwpBulletManager m_BulMgr;
++ LwpOrderedObjectManager m_SectionList;
++
++ LwpObjectID m_Layout; //The head layout
++ LwpObjectID m_TextStyle;
++ LwpObjectID m_DefaultTextStyle;
++ LwpObjectID m_DefaultClickStyle;
++ LwpObjectID m_PageStyle;
++ LwpObjectID m_FrameStyle;
++ LwpObjectID m_TableStyle;
++ LwpObjectID m_CellStyle;
++ LwpObjectID m_DftFrameStyle;
++ LwpObjectID m_DftPageStyle;
++ LwpObjectID m_DftTableStyle;
++ LwpObjectID m_DftCellStyle;
++ LwpObjectID m_DftColumnStyle;
++ LwpObjectID m_DftLeftColumnStyle;
++ LwpObjectID m_DftRighColumnStyle;
++
++ LwpObjectID m_BookMarkHead;
++ LwpObjectID m_DdeLinkHead;
++ LwpObjectID m_DirtBagHead;
++ LwpObjectID m_NamedOutlineSeqHead;
++ LwpObjectID m_EnumLayoutHead;
++ LwpObjectID m_EnumLayoutTail;
++
++ LwpObjectID m_NamedObjects;
++ sal_uInt32 m_nLastClickHere;
++
++ LwpObjectID m_SmartTextMgr;
++
++ LwpContentManager m_ContentMgr;
++ LwpFontManager m_FontMgr;
++ LwpPieceManager* m_pPieceMgr;
++
++ LwpObjectID m_DftDropCapStyle;
++ LwpObjectID m_DftHeaderStyle;
++
++ LwpObjectID m_DftFooterStyle;
++private:
++ void ReadStyles(LwpObjectStream *pStrm);
++public:
++ inline LwpContentManager* GetContentManager() { return &m_ContentMgr; }
++ inline LwpObjectID* GetGraphicListHead() { return m_ContentMgr.GetGraphicListHead(); }
++ inline LwpFontManager* GetFontManger() { return &m_FontMgr;}
++ inline LwpObjectID* GetTextStyleHead() { return &m_TextStyle;}
++ inline LwpObjectID* GetLayout() {return &m_Layout;}
++ inline LwpObjectID* GetBulletManagerID() { return m_BulMgr.GetHeadID();}
++ inline LwpDocument* GetDocument(){ return m_pDoc;}
++ inline LwpNumberManager* GetNumberManager() { return &m_NumMgr;}
++ LwpObjectID * GetDefaultTextStyle() ;
++private:
++ LwpStyleManager* m_pStyleMgr;
++ LwpDropcapMgr* m_pDropcapMgr;
++ LwpBulletStyleMgr* m_pBulletStyleMgr;
++public:
++ inline LwpStyleManager* GetStyleManager() { return m_pStyleMgr;}
++ LwpBookMark* GetBookMark(LwpObjectID objMarker);
++ sal_Bool FindBookMarkByName(OUString sName);
++ LwpDropcapMgr* GetDropcapMgr(){return m_pDropcapMgr;}
++ LwpContent* EnumContents(LwpContent* pContent);
++ LwpSection* EnumSections(LwpSection* pSection);
++ LwpBulletStyleMgr* GetBulletStyleMgr(){return m_pBulletStyleMgr;}
++
++ LwpObjectID* FindParaStyleByName(OUString name);
++ OUString FindActuralStyleName(OUString name);
++};
++
++class LwpStyleManager
++{
++public:
++ LwpStyleManager();
++ ~LwpStyleManager();
++private:
++ LwpFoundry* m_pFoundry;
++ struct hashFunc
++ {
++ size_t operator()( const LwpObjectID& rName ) const
++ {
++ return rName.HashCode();
++ }
++ };
++ struct eqFunc
++ {
++ bool operator()( const LwpObjectID& rKey1, const LwpObjectID& rKey2 ) const
++ {
++ return(rKey1==rKey2);
++ }
++ };
++
++ typedef std::hash_map<LwpObjectID, IXFStyle*, hashFunc, eqFunc> LwpStyleMap;
++ LwpStyleMap m_StyleList;
++public:
++ void SetFoundry(LwpFoundry* pFoundry){m_pFoundry = pFoundry;}
++ IXFStyle* AddStyle(LwpObjectID styleObjID, IXFStyle* pStyle);
++ IXFStyle* GetStyle(const LwpObjectID &styleObjID);
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpframelayout.cxx lotuswordpro/source/filter/lwpframelayout.cxx
+--- lotuswordpro.bak/source/filter/lwpframelayout.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpframelayout.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,1281 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * the class for VO_FrameLayout
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++Mar 2005 Created
++ ************************************************************************/
++#include "lwpframelayout.hxx"
++#include "lwppara.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xfparagraph.hxx"
++#include "xfilter/xffloatframe.hxx"
++#include "xfilter/xfrubystyle.hxx"
++#include "lwppagelayout.hxx"
++#include "lwpoleobject.hxx"
++#include "lwptablelayout.hxx"
++#include "lwpgrfobj.hxx"
++#include "lwpglobalmgr.hxx"
++
++LwpFrame::LwpFrame(LwpPlacableLayout* pLayout):m_pLayout(pLayout)
++{
++}
++
++LwpFrame::~LwpFrame()
++{
++}
++/**
++* @descr: parse frame
++* @param: register frame style
++* @param: pFrameStyle - Frame Style object
++*
++*/
++void LwpFrame::RegisterStyle(XFFrameStyle* pFrameStyle)
++{
++ ApplyWrapType(pFrameStyle);
++ ApplyMargins(pFrameStyle);
++ ApplyPadding(pFrameStyle);
++ ApplyBorders(pFrameStyle);
++ ApplyColumns(pFrameStyle);
++ ApplyShadow(pFrameStyle);
++ ApplyBackGround(pFrameStyle);
++ ApplyWatermark(pFrameStyle);
++// ApplyBackColor(pFrameStyle);
++ ApplyProtect(pFrameStyle);
++ ApplyTextDir(pFrameStyle);
++ ApplyPosType(pFrameStyle);
++
++ pFrameStyle->SetStyleName(m_pLayout->GetName()->str());
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_StyleName = pXFStyleManager->AddStyle(pFrameStyle)->GetStyleName();
++ m_pLayout->SetStyleName(m_StyleName);
++}
++/**
++* @descr: parse frame and set frame properties
++* @param: pXFFrame - XFFrame object
++* @param: nPageNo - the page number that the frame anchors
++*
++*/
++ void LwpFrame::Parse(XFFrame* pXFFrame, sal_Int32 nPageNo)
++ {
++ //set the frame style name
++ pXFFrame->SetStyleName(m_StyleName);
++
++ //SetAnchorType and position,if it's page anchor,set the page number.
++ ParseAnchorType(pXFFrame);
++ if(nPageNo>0)
++ {
++ pXFFrame->SetAnchorPage(nPageNo);
++ }
++
++ //Set frame Name
++ OUString aFrameName = m_pLayout->GetName()->str();
++ if(aFrameName.getLength())
++ {
++ //cause the bug of SODC, the linkframe name can not be "Frame1", so I change the frame name
++ /*if(aFrameName.equals(A2OUSTR("Frame1")))
++ {
++ aFrameName = A2OUSTR("Frame1_COPY");
++ }
++ pXFFrame->SetName(aFrameName);*/
++ pXFFrame->SetName(m_StyleName);
++ }
++
++ LwpLayoutGeometry* pLayoutGeo = m_pLayout->GetGeometry();
++ //Set frame Width and height
++ if(pLayoutGeo)
++ {
++ double fWidth = m_pLayout->GetWidth();
++ double fHeight = m_pLayout->GetHeight();
++
++ pXFFrame->SetWidth( fWidth );
++ pXFFrame->SetHeight( fHeight );
++
++ //Get content obj;
++ LwpObject* pObj = m_pLayout->GetContent()->obj();
++ if(m_pLayout->IsGroupHead()&&(m_pLayout->IsMinimumHeight()))
++ {
++ //process grouplayout height. there is problems now
++ pXFFrame->SetHeight( fHeight );
++ }
++ /*
++ else if(m_pLayout->IsFitGraphic() && pObj && pObj->GetTag() == VO_GRAPHIC)
++ {
++ //If is graphic, get original size and set it;
++ LwpGraphicObject* pGrpObj = static_cast<LwpGraphicObject*>(pObj);
++ long nHeight =0, nWidth =0;
++ pGrpObj->GetGrafOrgSize(nWidth, nHeight);
++ //add margins to the width and height;
++ fWidth = (double)nWidth/TWIPS_PER_CM + m_pLayout->GetMarginsValue(MARGIN_LEFT) + m_pLayout->GetMarginsValue(MARGIN_RIGHT);
++ fHeight = (double)nHeight/TWIPS_PER_CM + m_pLayout->GetMarginsValue(MARGIN_TOP) + m_pLayout->GetMarginsValue(MARGIN_BOTTOM);
++ pXFFrame->SetWidth(fWidth);
++ pXFFrame->SetHeight(fHeight);
++ }
++ */
++ else if(m_pLayout->IsAutoGrow())
++ {
++ pXFFrame->SetMinHeight( fHeight );
++ }
++ }
++
++ if(m_pLayout->IsFrame())
++ {
++ //Set frame link. Only frame layout has this feature
++ LwpFrameLayout* pLayout= static_cast<LwpFrameLayout*>(m_pLayout);
++ pXFFrame->SetNextLink(pLayout->GetNextLinkName());
++ }
++
++ }
++/**
++* @descr: parse frame relative to page, frame or cell
++* @param: pCont - content container which contains the frame
++*
++*/
++ void LwpFrame::XFConvert(XFContentContainer* pCont)
++ {
++ //parse the frame which anchor to page
++ LwpVirtualLayout* pParent = m_pLayout->GetParentLayout();
++ if(pParent->IsPage()&& pParent->GetParentLayout()->IsPage())
++ {
++ //for mirror page, problems exist if the parent layout is header or footer layout,
++ pParent = pParent->GetParentLayout();
++ }
++ if(m_pLayout->IsAnchorPage()&& pParent->IsPage())
++ {
++ //get parent layout
++ if(m_pLayout->IsUseOnPage())
++ {
++ sal_Int32 nPageNo = pParent->GetPageNumber(m_pLayout->GetUsePage());
++ if(nPageNo>0)
++ m_pLayout->XFConvertFrame(pCont, nPageNo);
++ }
++ else if(m_pLayout->IsUseOnAllPages())
++ {
++ sal_Int32 nFirst = pParent->GetPageNumber(FIRST_LAYOUTPAGENO);
++ sal_Int32 nLast = pParent->GetPageNumber(LAST_LAYOUTPAGENO);
++ if(nLast > 0)
++ m_pLayout->XFConvertFrame(pCont, nFirst, nLast, sal_True);
++
++ }
++ else if(m_pLayout->IsUseOnAllOddPages()||m_pLayout->IsUseOnAllEvenPages())
++ {
++ sal_Int32 nFirst = pParent->GetPageNumber(FIRST_LAYOUTPAGENO);
++ sal_Int32 nLast = pParent->GetPageNumber(LAST_LAYOUTPAGENO);
++ if(nLast > 0)
++ {
++ sal_uInt16 first = static_cast<sal_uInt16>(nFirst);
++ if((m_pLayout->IsUseOnAllOddPages() && !LwpTools::IsOddNumber(first))
++ || (m_pLayout->IsUseOnAllEvenPages() && !LwpTools::IsEvenNumber(first)))
++ nFirst++;
++ if(nFirst <= nLast)
++ {
++ m_pLayout->XFConvertFrame(pCont, nFirst, nLast, sal_False);
++ }
++ }
++ }
++ }
++ else
++ {
++ m_pLayout->XFConvertFrame(pCont);
++ }
++
++ }
++/**
++* @descr: set frame wrap type style
++* @param: pFrameStyle - Frame Style object
++*
++*/
++void LwpFrame::ApplyWrapType(XFFrameStyle *pFrameStyle)
++{
++ enumXFWrap eWrap = enumXFWrapNone;
++ switch(m_pLayout->GetWrapType())
++ {
++ case LwpPlacableLayout::LAY_WRAP_AROUND: //fall throught
++ case LwpPlacableLayout::LAY_WRAP_IRREG_BIGGEST:
++ {
++ //In SODC, if Optimal wrap type is used and the distance between the frame object
++ //and page margins is less than 2cm, the text is not wraped. While there is no this feature in Word Pro
++ //So the optimal wrap type is translated to left side or right side wrap type according to the distance
++ //between the frame object and page margins
++
++ eWrap = enumXFWrapBest;
++ LwpMiddleLayout* pParent = static_cast<LwpMiddleLayout*>(m_pLayout->GetContainerLayout());
++ if(pParent)
++ {
++ if(IsLeftWider())
++ eWrap = enumXFWrapLeft;
++ else
++ eWrap = enumXFWrapRight;
++ }
++ break;
++ }
++ case LwpPlacableLayout::LAY_NO_WRAP_BESIDE:
++ {
++ eWrap = enumXFWrapNone;
++ break;
++ }
++ case LwpPlacableLayout::LAY_NO_WRAP_AROUND:
++ {
++ eWrap = enumXFWrapRunThrough;
++ if(!m_pLayout->GetBackColor() && !m_pLayout->GetWaterMarkLayout())
++ {
++ //pFrameStyle->SetBackGround(sal_True);
++ XFColor aXFColor(0xffffff); //white color
++ pFrameStyle->SetBackColor(aXFColor);
++ pFrameStyle->SetTransparency(100); //transparency
++ }
++ break;
++ }
++ case LwpPlacableLayout::LAY_WRAP_LEFT: //fall throught
++ case LwpPlacableLayout::LAY_WRAP_IRREG_LEFT:
++ {
++ eWrap = enumXFWrapLeft;
++ break;
++ }
++ case LwpPlacableLayout::LAY_WRAP_RIGHT: //fall throught
++ case LwpPlacableLayout::LAY_WRAP_IRREG_RIGHT:
++ {
++ eWrap = enumXFWrapRight;
++ break;
++ }
++ case LwpPlacableLayout::LAY_WRAP_BOTH: //fall throught
++ case LwpPlacableLayout::LAY_WRAP_IRREG_BOTH:
++ {
++ eWrap = enumXFWrapParallel;
++ break;
++ }
++ default:
++ break;
++ }
++
++ //If it is the type of with para above, wrap type is enumXFWrapNone
++ if(m_pLayout->GetRelativeType()==LwpLayoutRelativityGuts::LAY_INLINE_NEWLINE)
++ {
++ eWrap = enumXFWrapNone;
++ }
++
++ pFrameStyle->SetWrapType(eWrap);
++}
++/**
++* @descr: set frame margins style
++* @param: pFrameStyle - Frame Style object
++*
++*/
++void LwpFrame::ApplyMargins(XFFrameStyle *pFrameStyle)
++{
++ double fLeft = m_pLayout->GetExtMarginsValue(MARGIN_LEFT);
++ double fRight = m_pLayout->GetExtMarginsValue(MARGIN_RIGHT);
++ double fTop = m_pLayout->GetExtMarginsValue(MARGIN_TOP);
++ double fBottom = m_pLayout->GetExtMarginsValue(MARGIN_BOTTOM);
++ pFrameStyle->SetMargins(fLeft,fRight,fTop,fBottom);
++}
++/**
++* @descr: set padding border style
++* @param: pFrameStyle - Frame Style object
++*
++*/
++void LwpFrame::ApplyPadding(XFFrameStyle *pFrameStyle)
++{
++ double fLeft = m_pLayout->GetMarginsValue(MARGIN_LEFT);
++ double fRight = m_pLayout->GetMarginsValue(MARGIN_RIGHT);
++ double fTop = m_pLayout->GetMarginsValue(MARGIN_TOP);
++ double fBottom = m_pLayout->GetMarginsValue(MARGIN_BOTTOM);
++ pFrameStyle->SetPadding(fLeft,fRight,fTop,fBottom);
++}
++/**
++* @descr: set frame border style
++* @param: pFrameStyle - Frame Style object
++*
++*/
++void LwpFrame::ApplyBorders(XFFrameStyle *pFrameStyle)
++{
++ XFBorders* pBordres = m_pLayout->GetXFBorders();
++ if(pBordres)
++ {
++ pFrameStyle->SetBorders(pBordres);
++ }
++}
++/**
++* @descr: set frame colums style
++* @param: pFrameStyle - Frame Style object
++*
++*/
++void LwpFrame::ApplyColumns(XFFrameStyle *pFrameStyle)
++{
++ XFColumns* pColumns = m_pLayout->GetXFColumns();
++ if(pColumns)
++ {
++ pFrameStyle->SetColumns(pColumns);
++ }
++}
++/**
++* @descr: set frame shadow style
++* @param: pFrameStyle - Frame Style object
++*
++*/
++void LwpFrame::ApplyShadow(XFFrameStyle* pFrameStyle)
++{
++ XFShadow* pXFShadow = m_pLayout->GetXFShadow();
++ if(pXFShadow)
++ {
++ pFrameStyle->SetShadow(pXFShadow);
++ }
++}
++/**
++* @descr: set frame back color style
++* @param: pFrameStyle - Frame Style object
++*
++*/
++void LwpFrame::ApplyBackColor(XFFrameStyle* pFrameStyle)
++{
++ LwpColor* pColor = m_pLayout->GetBackColor();
++ if(pColor)
++ {
++ XFColor aXFColor(pColor->To24Color());
++ pFrameStyle->SetBackColor(aXFColor);
++ }
++}
++/**
++* @descr: set frame protect style
++* @param: pFrameStyle - Frame Style object
++*
++*/
++void LwpFrame::ApplyProtect(XFFrameStyle* pFrameStyle)
++{
++ if(m_pLayout->IsProtected())
++ {
++ pFrameStyle->SetProtect(sal_True,sal_True,sal_True);
++ }
++}
++/**
++* @descr: set frame text direction style
++* @param: pFrameStyle - Frame Style object
++*
++*/
++void LwpFrame::ApplyTextDir(XFFrameStyle* pFrameStyle)
++{
++ pFrameStyle->SetTextDir(m_pLayout->GetTextDirection());
++}
++/**
++* @descr: set frame position type style
++* @param: pFrameStyle - Frame Style object
++*
++*/
++void LwpFrame::ApplyPosType(XFFrameStyle* pFrameStyle)
++{
++ enumXFFrameXPos eXPos = enumXFFrameXPosCenter;
++ enumXFFrameXRel eXRel = enumXFFrameXRelPara;
++ enumXFFrameYPos eYPos = enumXFFrameYPosMiddle;
++ enumXFFrameYRel eYRel = enumXFFrameYRelPara;
++ sal_uInt8 nType = m_pLayout->GetRelativeType();
++ switch(nType)
++ {
++ case LwpLayoutRelativityGuts::LAY_PARENT_RELATIVE://fall throught
++ case LwpLayoutRelativityGuts::LAY_CONTENT_RELATIVE:
++ {
++ //anchor to page, frame and cell
++ eXPos = enumXFFrameXPosFromLeft;
++ eXRel = enumXFFrameXRelPage;
++ //set vertical position
++ if(m_pLayout->IsAnchorPage())//in page
++ {
++ LwpVirtualLayout* pContainer = m_pLayout->GetContainerLayout();
++ if(pContainer && (pContainer->IsHeader() || pContainer->IsFooter()))
++ {
++ //Only anchor to para, the frame can display in header and footer of each page
++ eYPos = enumXFFrameYPosFromTop; //from top
++ eYRel = enumXFFrameYRelPara; //from margin
++ }
++ else
++ {
++ eYPos = enumXFFrameYPosFromTop;
++ eYRel = enumXFFrameYRelPage;
++ }
++ }
++ if(m_pLayout->IsAnchorFrame()) //in frame
++ {
++ eYPos = enumXFFrameYPosFromTop;
++ eYRel = enumXFFrameYRelPage;
++ }
++ if(m_pLayout->IsAnchorCell())
++ {
++ //SODC has no this type, simulate this feature
++ eYPos = enumXFFrameYPosFromTop; //from top
++ eYRel = enumXFFrameYRelPara; //from margin
++ }
++ break;
++ }
++ case LwpLayoutRelativityGuts::LAY_PARA_RELATIVE: //same page as text
++ {
++ eXPos = enumXFFrameXPosFromLeft;
++ eXRel = enumXFFrameXRelPage;
++ eYPos = enumXFFrameYPosBelow; //below
++ eYRel = enumXFFrameYRelChar; //from char
++ //set vertical position
++ LwpVirtualLayout* pContainer = m_pLayout->GetContainerLayout();
++ if(pContainer && pContainer->IsPage())//in page
++ {
++ //eYPos = enumXFFrameYPosFromTop;
++ //eYRel = enumXFFrameYRelPage;
++ eYPos = enumXFFrameYPosBelow;
++ eYRel = enumXFFrameYRelChar;
++ }
++ else if(pContainer && pContainer->IsFrame()) //in frame
++ {
++ eYPos = enumXFFrameYPosFromTop;
++ eYRel = enumXFFrameYRelPage;
++ }
++ else
++ {
++ eYPos = enumXFFrameYPosFromTop; //from top
++ eYRel = enumXFFrameYRelPara; //from margin
++ }
++ break;
++ }
++ case LwpLayoutRelativityGuts::LAY_INLINE: //in text
++ {
++ eXPos = enumXFFrameXPosFromLeft; //need not be set
++ eXRel = enumXFFrameXRelParaContent; //need not be set
++ eYPos = enumXFFrameYPosTop; //should be from top
++ eYRel = enumXFFrameYRelBaseLine;
++ sal_Int32 nOffset = m_pLayout->GetBaseLineOffset();
++ if(nOffset>0)
++ {
++ eYPos = enumXFFrameYPosFromTop;
++ }
++ break;
++ }
++ case LwpLayoutRelativityGuts::LAY_INLINE_NEWLINE: //with para above
++ {
++ eXPos = enumXFFrameXPosFromLeft;
++ eXRel = enumXFFrameXRelParaContent;
++ //eYPos = enumXFFrameYPosTop;
++ eYPos = enumXFFrameYPosBottom;
++ eYRel = enumXFFrameYRelParaContent;
++ break;
++ }
++ case LwpLayoutRelativityGuts::LAY_INLINE_VERTICAL: //in text - vertical
++ {
++ eXPos = enumXFFrameXPosFromLeft;
++ eXRel = enumXFFrameXRelPage;
++ eYPos = enumXFFrameYPosFromTop; //should be below position
++ eYRel = enumXFFrameYRelChar;
++ break;
++ }
++ default:
++ break;
++ }
++
++ pFrameStyle->SetXPosType(eXPos,eXRel);
++ pFrameStyle->SetYPosType(eYPos,eYRel);
++}
++/**
++* @descr: set frame watermark style
++* @param: pFrameStyle - Frame Style object
++*
++*/
++void LwpFrame::ApplyWatermark(XFFrameStyle *pFrameStyle)
++{
++ XFBGImage* pBGImage = m_pLayout->GetXFBGImage();
++ if(pBGImage)
++ {
++ pFrameStyle->SetBackImage(pBGImage);
++ //set watermark transparent
++ LwpMiddleLayout* pLay = static_cast<LwpMiddleLayout*>(m_pLayout->GetWaterMarkLayout());
++ LwpBackgroundStuff* pBackgroundStuff = pLay->GetBackgroundStuff();
++ if(pBackgroundStuff && !pBackgroundStuff->IsTransparent())
++ {
++ pFrameStyle->SetTransparency(100);
++ }
++ }
++}
++
++/**
++ * @short Apply pattern fill to frame style
++ * @param pFrameStyle - pointer of XFFrameStyle
++ * @return
++ */
++void LwpFrame::ApplyPatternFill(XFFrameStyle* pFrameStyle)
++{
++ XFBGImage* pXFBGImage = m_pLayout->GetFillPattern();
++ if (pXFBGImage)
++ {
++ pFrameStyle->SetBackImage(pXFBGImage);
++ }
++}
++
++/**
++ * @short Apply background to frame style
++ * @param pFrameStyle - pointer of XFFrameStyle
++ * @return
++ */
++void LwpFrame::ApplyBackGround(XFFrameStyle* pFrameStyle)
++{
++ if (!m_pLayout)
++ {
++ return;
++ }
++
++ if (m_pLayout->IsPatternFill())
++ {
++ ApplyPatternFill(pFrameStyle);
++ }
++ else
++ {
++ ApplyBackColor(pFrameStyle);
++ }
++}
++
++/**
++* @descr: set frame size, anchor type, anchored page number
++* @param: pXFFrame - XFFrame object
++*
++*/
++void LwpFrame::ParseAnchorType(XFFrame *pXFFrame)
++{
++ //set position
++ double fXOffset = 0;
++ double fYOffset = 0;
++ //page number
++ sal_uInt16 nPageNum = 0;
++ //set anchor type
++ enumXFAnchor eAnchor = enumXFAnchorNone;
++
++ LwpLayoutGeometry* pLayoutGeo = m_pLayout->GetGeometry();
++ if(pLayoutGeo)
++ {
++ LwpPoint aPoint = pLayoutGeo->GetOrigin();
++ fXOffset = LwpTools::ConvertFromUnitsToMetric(aPoint.GetX());
++ fYOffset = LwpTools::ConvertFromUnitsToMetric(aPoint.GetY());
++ }
++ //set anchor type
++ eAnchor = enumXFAnchorNone;
++ sal_uInt8 nType = m_pLayout->GetRelativeType();
++ switch(nType)
++ {
++ case LwpLayoutRelativityGuts::LAY_PARENT_RELATIVE://fall throught
++ case LwpLayoutRelativityGuts::LAY_CONTENT_RELATIVE:
++ {
++ //anchor to page, frame and cell
++ if(m_pLayout->IsAnchorPage())//in page
++ {
++ LwpVirtualLayout* pContainer = m_pLayout->GetContainerLayout();
++ if(pContainer && (pContainer->IsHeader() || pContainer->IsFooter()))
++ {
++ eAnchor = enumXFAnchorPara;
++ fYOffset -= pContainer->GetMarginsValue(MARGIN_TOP);
++ }
++ else
++ eAnchor = enumXFAnchorPage;
++ }
++ if(m_pLayout->IsAnchorFrame()) //in frame
++ {
++ eAnchor = enumXFAnchorFrame;
++ }
++ if(m_pLayout->IsAnchorCell()) //in cell
++ {
++ //eAnchor = enumXFAnchorChar;
++ eAnchor = enumXFAnchorPara;
++ LwpMiddleLayout* pContainer = static_cast<LwpMiddleLayout*>(m_pLayout->GetContainerLayout());
++ if(pContainer)
++ {
++ fYOffset -= pContainer->GetMarginsValue(MARGIN_TOP);
++ }
++ }
++ break;
++ }
++ case LwpLayoutRelativityGuts::LAY_PARA_RELATIVE: //same page as text
++ {
++ eAnchor = enumXFAnchorChar;
++ LwpVirtualLayout* pContainer = m_pLayout->GetContainerLayout();
++ if(pContainer && pContainer->IsPage())//in page
++ {
++ //eAnchor = enumXFAnchorPage;
++ eAnchor = enumXFAnchorChar;// to character
++ }
++ else if(pContainer && pContainer->IsFrame()) //in frame
++ {
++ eAnchor = enumXFAnchorFrame;
++ }
++ else if(pContainer && pContainer->IsCell()) //in cell
++ {
++ //eAnchor = enumXFAnchorChar;
++ eAnchor = enumXFAnchorPara;
++ fYOffset -= pContainer->GetMarginsValue(MARGIN_TOP);
++ }
++ else if(pContainer && (pContainer->IsHeader() || pContainer->IsFooter()))//in header or footer
++ {
++ eAnchor = enumXFAnchorPara;
++ fYOffset -= pContainer->GetMarginsValue(MARGIN_TOP);
++ }
++ break;
++ }
++ case LwpLayoutRelativityGuts::LAY_INLINE: //in text
++ {
++ eAnchor = enumXFAnchorAsChar;
++ sal_Int32 nOffset = m_pLayout->GetBaseLineOffset();
++ if(nOffset>0 && pLayoutGeo)
++ {
++ //experiential value
++ fYOffset =-(m_pLayout->GetGeometryHeight()+2*m_pLayout->GetExtMarginsValue(MARGIN_BOTTOM)-LwpTools::ConvertFromUnitsToMetric(nOffset));
++ }
++ break;
++ }
++ case LwpLayoutRelativityGuts::LAY_INLINE_NEWLINE: //with para above
++ {
++ eAnchor = enumXFAnchorPara;
++ break;
++ }
++ case LwpLayoutRelativityGuts::LAY_INLINE_VERTICAL: //in text - vertical
++ {
++ eAnchor = enumXFAnchorChar;
++ //set vertical position
++ double offset = 0;
++
++ //because of the different feature between Word Pro and SODC, I simulate the vertical base offset
++ //between anchor and frame orgin using the font height.
++ //LwpPara* pPara = static_cast<LwpPara*>(m_pLayout->GetPosition()->obj());
++ XFFont* pFont = m_pLayout->GetFont();
++ if(pFont)
++ {
++ offset = (double)(pFont->GetFontSize())*CM_PER_INCH/POINTS_PER_INCH;
++ }
++ fYOffset = offset-fYOffset;
++ break;
++ }
++ default:
++ break;
++ }
++
++ pXFFrame->SetX(fXOffset);
++ pXFFrame->SetY(fYOffset);
++ pXFFrame->SetAnchorPage(nPageNum);
++ pXFFrame->SetAnchorType(eAnchor);
++}
++
++/**
++ * @descr Calculate the distance between the frame object and the page margins.
++ * And determine which side(left or right) is wider
++ */
++sal_Bool LwpFrame::IsLeftWider()
++{
++ //LwpMiddleLayout* pParent = static_cast<LwpMiddleLayout*>(m_pLayout->GetContainerLayout());
++ LwpVirtualLayout* pParent = static_cast<LwpVirtualLayout*>(m_pLayout->GetContainerLayout());
++ if(pParent)
++ {
++ LwpPoint aPoint = m_pLayout->GetOrigin();
++ double fXOffset = LwpTools::ConvertFromUnitsToMetric(aPoint.GetX());
++ double fWidth = m_pLayout->GetWidth();
++ double fWrapLeft = m_pLayout->GetExtMarginsValue(MARGIN_LEFT);
++ double fWrapRight = m_pLayout->GetExtMarginsValue(MARGIN_RIGHT);
++
++ //LwpPoint aParentPoint = pParent->GetOrigin();
++ //double fParentXOffset = LwpTools::ConvertFromUnitsToMetric(aParentPoint.GetX());
++ double fParentWidth = pParent->GetWidth();
++ if(pParent->IsCell())
++ {
++ //Get actual width of this cell layout
++ fParentWidth = static_cast<LwpCellLayout*>(pParent)->GetActualWidth();
++ }
++ double fParentMarginLeft = pParent->GetMarginsValue(MARGIN_LEFT);
++ double fParentMarginRight = pParent->GetMarginsValue(MARGIN_RIGHT);
++
++ double fLeft = fXOffset - fWrapLeft -fParentMarginLeft;
++ double fRight = fParentWidth - fParentMarginRight -(fXOffset + fWidth + fWrapRight);
++ if(fLeft > fRight)
++ return sal_True;
++ }
++ return sal_False;
++}
++
++LwpFrameLink::LwpFrameLink()
++{}
++
++LwpFrameLink::~LwpFrameLink()
++{}
++
++/**
++ * @descr frame link information
++ *
++ */
++void LwpFrameLink::Read(LwpObjectStream* pStrm)
++{
++ m_PreviousLayout.ReadIndexed(pStrm);
++ m_NextLayout.ReadIndexed(pStrm);
++ pStrm->SkipExtra();
++}
++
++LwpFrameLayout::LwpFrameLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpPlacableLayout(objHdr, pStrm), m_pFrame(NULL)
++{
++
++}
++
++LwpFrameLayout::~LwpFrameLayout()
++{
++ if(m_pFrame)
++ {
++ delete m_pFrame;
++ m_pFrame = NULL;
++ }
++}
++
++/**
++ * @descr read frame layout object
++ *
++ */
++void LwpFrameLayout::Read()
++{
++ LwpPlacableLayout::Read();
++ if(LwpFileHeader::m_nFileRevision >= 0x000B)
++ {
++ if(m_pObjStrm->QuickReaduInt16())
++ {
++ m_Link.Read(m_pObjStrm);
++ }
++ }
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++ * @descr create a xfframe and add into content container
++ * @param: pCont - content container that contains the frame.
++ *
++ */
++ void LwpFrameLayout::XFConvert(XFContentContainer* pCont)
++ {
++ if(m_pFrame)
++ {
++ //parse the frame which anchor to paragraph
++ if(IsRelativeAnchored())
++ {
++ XFConvertFrame(pCont);
++ }
++ else
++ {
++ m_pFrame->XFConvert(pCont);
++ }
++
++ }
++ }
++/**
++ * @descr create a xfframe and add into content container, called by XFConvert
++ * @param: pCont - content container that contains the frame.
++ * @param: nPageNo - the page number that the frame anchors
++ *
++ */
++void LwpFrameLayout::XFConvertFrame(XFContentContainer* pCont, sal_Int32 nStart , sal_Int32 nEnd, sal_Bool bAll )
++{
++ if(m_pFrame)
++ {
++ XFFrame* pXFFrame = NULL;
++ if(nEnd < nStart)
++ {
++ pXFFrame = new XFFrame();
++ }
++ else
++ {
++ pXFFrame = new XFFloatFrame(nStart, nEnd, bAll);
++ }
++
++ m_pFrame->Parse(pXFFrame, nStart);
++ //if it is a link frame, parse contents only once
++ if(!HasPreviousLinkLayout())
++ {
++ LwpObject* content = m_Content.obj();
++ if (content)
++ {
++ content->XFConvert(pXFFrame);
++ //set frame size according to ole size
++ ApplyGraphicSize(pXFFrame);
++ }
++ }
++ pCont ->Add(pXFFrame);
++ }
++}
++/**
++ * @descr register frame style
++ *
++ */
++void LwpFrameLayout::RegisterStyle()
++{
++ //if it is for water mark, don't register style
++ if(IsForWaterMark())
++ {
++ return;
++ }
++ //register frame style
++ XFFrameStyle* pFrameStyle = new XFFrameStyle();
++ m_pFrame = new LwpFrame(this);
++ m_pFrame->RegisterStyle(pFrameStyle);
++
++ //register content style
++ LwpObject* content = m_Content.obj();
++ if (content)
++ {
++ content->SetFoundry(m_pFoundry);
++ content->RegisterStyle();
++ }
++
++ //register child frame style
++ RegisterChildStyle();
++
++
++}
++/**
++ * @descr get the name of the frame that current frame links
++ *
++ */
++OUString LwpFrameLayout::GetNextLinkName()
++{
++ OUString aName;
++ LwpObjectID* pObjectID = m_Link.GetNextLayout();
++ if(!pObjectID->IsNull())
++ {
++ LwpLayout* pLayout = static_cast<LwpLayout*>(pObjectID->obj());
++ aName = pLayout->GetName()->str();
++ //for division name confict
++ if(pLayout->GetStyleName().getLength() > 0)
++ aName = pLayout->GetStyleName();
++ }
++ return aName;
++}
++/**
++ * @descr whether current frame is linked by other frame
++ *
++ */
++sal_Bool LwpFrameLayout::HasPreviousLinkLayout()
++{
++ LwpObjectID* pObjectID = m_Link.GetPreviousLayout();
++ if(pObjectID->IsNull())
++ return sal_False;
++ return sal_True;
++}
++/**
++ * @descr whether current frame is for water mark. Problem maybe exsits by this method, must be tracking
++ *
++ */
++ sal_Bool LwpFrameLayout::IsForWaterMark()
++{
++ if(m_nBuoyancy >=LAY_BUOYLAYER)
++ {
++ if(!m_Content.IsNull() && (m_Content.obj()->GetTag()==VO_GRAPHIC) )
++ {
++ return sal_True;
++ }
++ }
++ return sal_False;
++}
++
++/**
++ * @descr Get frame width
++ *
++ */
++double LwpFrameLayout::GetWidth()
++{
++ double fWidth = LwpMiddleLayout::GetWidth();
++ if(IsInlineToMargin() && IsAutoGrowWidth())
++ {
++ //for text field entry when choosing maximize field length
++ fWidth = GetMaxWidth();
++ }
++ return fWidth;
++}
++
++/**
++ * @descr Get frame width when the text field chooses maximize field length
++ *
++ */
++double LwpFrameLayout::GetMaxWidth()
++{
++ double fActualWidth = 0;
++ LwpMiddleLayout* pParent = static_cast<LwpMiddleLayout*>(GetContainerLayout());
++ if(pParent)
++ {
++ LwpPoint aPoint = GetOrigin();
++ double fXOffset = LwpTools::ConvertFromUnitsToMetric(aPoint.GetX());
++ double fWrapRight = GetExtMarginsValue(MARGIN_RIGHT);
++
++ //Get parent layout width
++ double fParentWidth = pParent->GetWidth();
++ if(pParent->IsCell())
++ {
++ //Get actual width of this cell layout
++ fParentWidth = static_cast<LwpCellLayout*>(pParent)->GetActualWidth();
++ }
++
++ double fParentMarginRight = 0;
++ sal_uInt8 nType = GetRelativeType();
++ if(nType == LwpLayoutRelativityGuts::LAY_INLINE
++ || nType == LwpLayoutRelativityGuts::LAY_INLINE_NEWLINE )
++ {
++ fParentMarginRight = pParent->GetMarginsValue(MARGIN_RIGHT);
++ }
++
++ fActualWidth = fParentWidth - fXOffset - fParentMarginRight - fWrapRight;
++ }
++
++ return fActualWidth;
++}
++
++/**
++ * @descr Set frame size according to graphic size
++ *
++ */
++void LwpFrameLayout::ApplyGraphicSize(XFFrame * pXFFrame)
++{
++ LwpObject* content = m_Content.obj();
++ if(content && (content->GetTag() == VO_GRAPHIC
++ || content->GetTag() == VO_OLEOBJECT ))
++ {
++ LwpGraphicOleObject* pGraOle = static_cast<LwpGraphicOleObject*>(content);
++ //Get frame geometry size
++ double fWidth = 0;
++ double fHeight = 0;
++ pGraOle->GetGrafScaledSize(fWidth, fHeight);
++ if( IsFitGraphic())
++ {
++ //graphic scaled sze
++ fWidth += GetMarginsValue(MARGIN_LEFT) + GetMarginsValue(MARGIN_RIGHT);
++ fHeight += GetMarginsValue(MARGIN_TOP) + GetMarginsValue(MARGIN_BOTTOM);
++ }
++ else if(IsAutoGrowDown() || IsAutoGrowUp())
++ {
++ fWidth = GetWidth();
++ fHeight += GetMarginsValue(MARGIN_TOP) + GetMarginsValue(MARGIN_BOTTOM);
++ }
++ else if( IsAutoGrowLeft() || IsAutoGrowRight())
++ {
++ fHeight = GetHeight();
++ fWidth += GetMarginsValue(MARGIN_LEFT) + GetMarginsValue(MARGIN_RIGHT);
++ }
++ else
++ {
++ fWidth = GetWidth();
++ fHeight = GetHeight();
++ }
++ pXFFrame->SetWidth(fWidth);
++ pXFFrame->SetHeight(fHeight);
++ }
++}
++
++LwpGroupLayout::LwpGroupLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpPlacableLayout(objHdr, pStrm),m_pFrame(NULL)
++{
++
++}
++
++LwpGroupLayout::~LwpGroupLayout()
++{
++ if(m_pFrame)
++ {
++ delete m_pFrame;
++ m_pFrame = NULL;
++ }
++}
++/**
++ * @descr read group layout object
++ *
++ */
++void LwpGroupLayout::Read()
++{
++ LwpPlacableLayout::Read();
++ m_pObjStrm->SkipExtra();
++}
++/**
++ * @descr register group frame style
++ *
++ */
++void LwpGroupLayout::RegisterStyle()
++{
++ //register frame style
++ XFFrameStyle* pFrameStyle = new XFFrameStyle();
++ m_pFrame = new LwpFrame(this);
++ m_pFrame->RegisterStyle(pFrameStyle);
++
++ //register child frame style
++ RegisterChildStyle();
++ /*
++ LwpVirtualLayout* pLayout = static_cast<LwpVirtualLayout*>(GetChildHead()->obj());
++ while(pLayout)
++ {
++ pLayout->SetFoundry(m_pFoundry);
++ pLayout->RegisterStyle();
++ pLayout = static_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj());
++ }
++ */
++}
++/**
++ * @descr create a xfframe and add into content container
++ * @param: pCont - content container that contains the frame.
++ *
++ */
++void LwpGroupLayout::XFConvert(XFContentContainer *pCont)
++{
++ if(m_pFrame)
++ {
++ //parse the frame which anchor to paragraph
++ if(IsRelativeAnchored())
++ {
++ XFConvertFrame(pCont);
++ }
++ else
++ {
++ m_pFrame->XFConvert(pCont);
++ }
++
++ }
++}
++/**
++ * @descr create a xfframe and add into content container, called by XFConvert
++ * @param: pCont - content container that contains the frame.
++ * @param: nPageNo - the page number that the frame anchors
++ *
++ */
++void LwpGroupLayout::XFConvertFrame(XFContentContainer* pCont, sal_Int32 nStart , sal_Int32 nEnd, sal_Bool bAll)
++{
++ if(m_pFrame)
++ {
++ XFFrame* pXFFrame = NULL;
++ if(nEnd < nStart)
++ {
++ pXFFrame = new XFFrame();
++ }
++ else
++ {
++ pXFFrame = new XFFloatFrame(nStart, nEnd, bAll);
++ }
++
++ m_pFrame->Parse(pXFFrame, nStart);
++
++ //add child frame into group
++ LwpVirtualLayout* pLayout = static_cast<LwpVirtualLayout*>(GetChildHead()->obj());
++ while(pLayout)
++ {
++ pLayout->XFConvert(pXFFrame);
++ pLayout = static_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj());
++ }
++
++ pCont ->Add(pXFFrame);
++ }
++}
++
++LwpGroupFrame::LwpGroupFrame(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ :LwpContent(objHdr, pStrm)
++{}
++
++LwpGroupFrame::~LwpGroupFrame()
++{}
++
++void LwpGroupFrame::Read()
++{
++ LwpContent::Read();
++ m_pObjStrm->SkipExtra();
++
++}
++ void LwpGroupFrame::RegisterStyle()
++{
++}
++void LwpGroupFrame::XFConvert(XFContentContainer* pCont)
++{
++}
++
++LwpDropcapLayout::LwpDropcapLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpFrameLayout(objHdr, pStrm)
++{
++ m_nChars = 1;
++ m_nLines = 3;
++}
++
++void LwpDropcapLayout::Read()
++{
++ LwpFrameLayout::Read();
++ m_nLines = m_pObjStrm->QuickReaduInt16();
++ m_pObjStrm->SeekRel(1);
++ m_pObjStrm->SkipExtra();
++}
++
++void LwpDropcapLayout::Parse(IXFStream* pOutputStream)
++{
++ LwpStory* pStory = static_cast<LwpStory*>(m_Content.obj(VO_STORY));
++ if (!pStory)
++ return;
++ LwpObject* pPara = pStory->GetFirstPara()->obj(VO_PARA);
++ if(pPara)
++ {
++ pPara->SetFoundry(m_pFoundry);
++ pPara->Parse(pOutputStream);
++ }
++}
++
++void LwpDropcapLayout::XFConvert(XFContentContainer* pCont)
++{
++ LwpStory* pStory = static_cast<LwpStory*>(m_Content.obj(VO_STORY));
++ if (pStory)
++ {
++ pStory->SetFoundry(m_pFoundry);
++ pStory->XFConvert(pCont);
++ }
++}
++
++LwpStory* LwpDropcapLayout::GetContentStory()
++{
++ return static_cast<LwpStory*>(m_Content.obj(VO_STORY));
++}
++
++void LwpDropcapLayout::RegisterStyle(LwpFoundry* pFoundry)
++{
++ LwpStory* pStory = GetContentStory();
++ if (pStory)
++ {
++ pStory->SetDropcapFlag(sal_True);
++ pStory->SetFoundry(pFoundry);
++ LwpPara* pPara = static_cast<LwpPara*>(pStory->GetFirstPara()->obj());
++ while(pPara)
++ {
++ pPara->SetFoundry(pFoundry);
++ pPara->RegisterStyle();
++ pPara = static_cast<LwpPara*>(pPara->GetNext()->obj());
++ }
++ }
++}
++
++/**
++ * @descr do nothing
++ *
++ */
++void LwpDropcapLayout::RegisterStyle()
++{
++}
++
++LwpRubyLayout::LwpRubyLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpFrameLayout(objHdr, pStrm)
++{
++}
++
++void LwpRubyLayout::Read()
++{
++ LwpFrameLayout::Read();
++ m_nPlacement = m_pObjStrm->QuickReaduInt8();
++ m_nAlignment = m_pObjStrm->QuickReaduInt8();;
++ m_nStateFlag = m_pObjStrm->QuickReaduInt16();;
++ m_nXOffset = m_pObjStrm->QuickReadInt32();
++ m_nYOffset = m_pObjStrm->QuickReadInt32();
++ m_objRubyMarker.ReadIndexed(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++
++LwpRubyMarker* LwpRubyLayout::GetMarker()
++{
++ return static_cast<LwpRubyMarker*>(m_objRubyMarker.obj(VO_RUBYMARKER));
++}
++
++LwpStory* LwpRubyLayout::GetContentStory()
++{
++ return static_cast<LwpStory*>(m_Content.obj(VO_STORY));
++}
++
++void LwpRubyLayout::ConvertContentText()
++{
++ LwpStory* pStory = GetContentStory();
++ LwpRubyMarker* pMarker = GetMarker();
++ if (pStory && pMarker)
++ pMarker->SetRubyText(pStory->GetContentText(sal_True));
++}
++
++void LwpRubyLayout::RegisterStyle()
++{
++ LwpRubyMarker* pMarker = GetMarker();
++
++ XFRubyStyle* pRubyStyle = new XFRubyStyle;
++
++ enumXFRubyPosition eType = enumXFRubyLeft;
++ if (m_nAlignment == LEFT)
++ {
++ eType = enumXFRubyLeft;
++ }
++ else if(m_nAlignment == RIGHT)
++ {
++ eType = enumXFRubyRight;
++ }
++ else if(m_nAlignment == CENTER)
++ {
++ eType = enumXFRubyCenter;
++ }
++ pRubyStyle->SetAlignment(eType);
++
++ eType = enumXFRubyTop;
++ if (m_nPlacement == TOP)
++ {
++ eType = enumXFRubyTop;
++ }
++ else if(m_nPlacement == BOTTOM)
++ {
++ eType = enumXFRubyBottom;
++ }
++ pRubyStyle->SetPosition(eType);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ OUString rubyStyle = pXFStyleManager->AddStyle(pRubyStyle)->GetStyleName();
++ pMarker->SetRubyStyleName(rubyStyle);
++
++ LwpStory* pStory = GetContentStory();
++ pStory->SetFoundry(m_pFoundry);
++ OUString textStyle = pStory->RegisterFirstFribStyle();
++ pMarker->SetTextStyleName(textStyle);
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpframelayout.hxx lotuswordpro/source/filter/lwpframelayout.hxx
+--- lotuswordpro.bak/source/filter/lwpframelayout.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpframelayout.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,240 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * the class for VO_FrameLayout
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++Mar 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPFRAMELAYOUT_HXX
++#define _LWPFRAMELAYOUT_HXX
++
++#include "lwplayout.hxx"
++#include "lwpstory.hxx"
++#include "lwpmarker.hxx"
++/**
++ * @brief For register frame style and parse frame
++ *
++ */
++
++class LwpFrame
++{
++public:
++ LwpFrame(LwpPlacableLayout* pLayout);
++ ~LwpFrame();
++ void RegisterStyle(XFFrameStyle* pFrameStyle);
++ void Parse(XFFrame* pXFFrame, sal_Int32 nPageNo = 0);
++ void XFConvert(XFContentContainer* pCont);
++private:
++ void ApplyWrapType(XFFrameStyle* pFrameStyle);
++ void ApplyMargins(XFFrameStyle* pFrameStyle);
++ void ApplyPadding(XFFrameStyle* pFrameStyle);
++ void ApplyBorders(XFFrameStyle* pFrameStyle);
++ void ApplyColumns(XFFrameStyle* pFrameStyle);
++ void ApplyShadow(XFFrameStyle* pFrameStyle);
++ void ApplyBackColor(XFFrameStyle* pFrameStyle);
++ void ApplyProtect(XFFrameStyle* pFrameStyle);
++ void ApplyTextDir(XFFrameStyle* pFrameStyle);
++ void ApplyPosType(XFFrameStyle* pFrameStyle);
++ void ApplyWatermark(XFFrameStyle* pFrameStyle);
++ // add by , 06/01/2005
++ void ApplyPatternFill(XFFrameStyle* pFrameStyle);
++ void ApplyBackGround(XFFrameStyle* pFrameStyle);
++ // end add
++ void ParseAnchorType(XFFrame* pXFFrame);
++ sal_Bool IsLeftWider();
++private:
++ LwpPlacableLayout* m_pLayout;
++ OUString m_StyleName;
++};
++
++/**
++ * @brief Frame link information
++ *
++ */
++class LwpFrameLink
++{
++public:
++ LwpFrameLink();
++ ~LwpFrameLink();
++ void Read(LwpObjectStream* pStrm);
++ LwpObjectID* GetNextLayout(){ return &m_NextLayout;}
++ LwpObjectID* GetPreviousLayout(){ return &m_PreviousLayout;}
++private:
++ LwpObjectID m_PreviousLayout;
++ LwpObjectID m_NextLayout;
++};
++
++/**
++ * @brief VO_FRAMELAYOUT object
++ *
++ */
++class LwpFrameLayout: public LwpPlacableLayout
++{
++public:
++ LwpFrameLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpFrameLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_FRAME_LAYOUT;}
++ virtual void RegisterStyle();
++ virtual void XFConvert(XFContentContainer* pCont);
++ void XFConvertFrame(XFContentContainer* pCont, sal_Int32 nStart = 0, sal_Int32 nEnd = 0, sal_Bool bAll = sal_False);
++ OUString GetNextLinkName();
++ sal_Bool HasPreviousLinkLayout();
++ sal_Bool IsForWaterMark();
++ double GetWidth();
++ void ApplyGraphicSize(XFFrame* pXFFrame);
++protected:
++ void Read();
++private:
++ double GetMaxWidth();
++
++private:
++ LwpFrameLink m_Link;
++ LwpFrame* m_pFrame;
++};
++
++/**
++ * @brief VO_GROUPLAYOUT object , information for frame group layout
++ *
++ */
++class LwpGroupLayout: public LwpPlacableLayout
++{
++public:
++ LwpGroupLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpGroupLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_GROUP_LAYOUT;}
++ virtual void RegisterStyle();
++ virtual void XFConvert(XFContentContainer* pCont);
++ void XFConvertFrame(XFContentContainer* pCont, sal_Int32 nStart = 0, sal_Int32 nEnd = 0, sal_Bool bAll = sal_False);
++protected:
++ void Read();
++private:
++ LwpFrame* m_pFrame;
++
++};
++
++/**
++ * @brief VO_GROUPFRAME object , information for frame group contents
++ *
++ */
++class LwpGroupFrame: public LwpContent
++{
++public:
++ LwpGroupFrame(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpGroupFrame();
++ virtual void RegisterStyle();
++ virtual void XFConvert(XFContentContainer* pCont);
++protected:
++ void Read();
++};
++
++class LwpStory;
++class LwpFoundry;
++class LwpDropcapLayout : public LwpFrameLayout
++{
++public:
++ LwpDropcapLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpDropcapLayout(){};
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_DROPCAP_LAYOUT;}
++ virtual void Parse(IXFStream* pOutputStream);
++ virtual void XFConvert(XFContentContainer* pCont);
++ sal_uInt16 GetLines(){return m_nLines;}
++ void SetChars(sal_uInt32 nChars){ m_nChars += nChars;}
++ sal_uInt32 GetChars() const {return m_nChars;}
++ LwpStory* GetContentStory();
++ void RegisterStyle(LwpFoundry* pFoundry);
++ void RegisterStyle();
++protected:
++ void Read();
++private:
++ sal_uInt16 m_nLines;
++ sal_uInt32 m_nChars;
++};
++
++class LwpRubyLayout : public LwpFrameLayout
++{
++public:
++ LwpRubyLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpRubyLayout(){};
++ LwpRubyMarker* GetMarker();
++ void ConvertContentText();
++ LwpStory* GetContentStory();
++ sal_uInt8 GetPosition(){return m_nPlacement;}
++ sal_uInt8 GetAlignment(){return m_nAlignment;}
++ void RegisterStyle();
++ enum{
++ LEFT = 4,
++ RIGHT = 5,
++ CENTER = 2,
++ TOP = 1,
++ BOTTOM = 3
++ };
++protected:
++ void Read();
++private:
++ sal_uInt8 m_nPlacement;
++ sal_uInt8 m_nAlignment;
++ sal_uInt16 m_nStateFlag;
++ sal_Int32 m_nXOffset;
++ sal_Int32 m_nYOffset;
++ LwpObjectID m_objRubyMarker;
++ sal_Int32 m_nBodyX;
++ sal_Int32 m_nBodyWidth;
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpfribbreaks.cxx lotuswordpro/source/filter/lwpfribbreaks.cxx
+--- lotuswordpro.bak/source/filter/lwpfribbreaks.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfribbreaks.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,165 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++#include "lwpfribbreaks.hxx"
++#include "lwpstory.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xfsectionstyle.hxx"
++#include "lwpsection.hxx"
++#include "xfilter/xfsection.hxx"
++#include "lwpglobalmgr.hxx"
++
++void LwpFribColumnBreak::RegisterBreakStyle(LwpPara * pPara)
++{
++// XFParaStyle* pBaseStyle = static_cast<XFParaStyle*>(pFoundry->GetStyleManager()->GetStyle(styleID));
++ XFParaStyle* pBaseStyle = pPara->GetXFParaStyle();
++ if (pBaseStyle == NULL) return;
++// m_StyleName = pBaseStyle->GetStyleName();
++
++ XFParaStyle* pOverStyle = new XFParaStyle;
++ *pOverStyle = *pBaseStyle;
++ pOverStyle->SetStyleName(A2OUSTR(""));
++
++ //Old code
++ //if (static_cast<LwpStory*>(pPara->GetStoryID()->obj())
++ // ->GetCurrentLayout()->GetNumCols() == 1)
++ //New code
++ LwpStory* pStory = static_cast<LwpStory*>(pPara->GetStoryID()->obj());
++ LwpPageLayout* pCurLayout = pStory ? pStory->GetCurrentLayout() : NULL;
++ if( pCurLayout && (pCurLayout->GetNumCols() == 1) )
++
++ {
++// if (!GetNext() || GetNext()->GetType()==FRIB_TAG_EOP)
++ pOverStyle->SetBreaks(enumXFBreakBefPage);
++// else
++// pOverStyle->SetBreaks(enumXFBreakBefPage);
++ }
++ else
++ {
++ if (!GetNext() || GetNext()->GetType()==FRIB_TAG_EOP)
++ pOverStyle->SetBreaks(enumXFBreakAftColumn);
++ else
++ pOverStyle->SetBreaks(enumXFBreakBefColumn);
++ }
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_StyleName = pXFStyleManager->AddStyle(pOverStyle)->GetStyleName();
++}
++
++LwpFribPageBreak::LwpFribPageBreak( LwpPara* pPara )
++ : LwpFrib(pPara), m_pMasterPage(NULL),m_bLastFrib(sal_False)
++{
++}
++
++LwpFribPageBreak::~LwpFribPageBreak()
++{
++ if(m_pMasterPage)
++ {
++ delete m_pMasterPage;
++ m_pMasterPage = NULL;
++ }
++}
++
++void LwpFribPageBreak::Read(LwpObjectStream * pObjStrm, sal_uInt16 len)
++{
++ m_Layout.ReadIndexed(pObjStrm);
++}
++
++
++void LwpFribPageBreak::RegisterBreakStyle(LwpPara* pPara)
++{
++ XFParaStyle* pBaseStyle = pPara->GetXFParaStyle();
++ if (pBaseStyle == NULL) return;
++
++ LwpPageLayout* pLayout = static_cast<LwpPageLayout*>(m_Layout.obj());
++ if(pLayout)
++ {
++ m_pMasterPage = new LwpMasterPage(pPara, pLayout);
++ m_pMasterPage->RegisterMasterPage(this);
++ return;
++ }
++
++ XFParaStyle* pOverStyle = new XFParaStyle;
++ *pOverStyle = *pBaseStyle;
++ pOverStyle->SetStyleName(A2OUSTR(""));
++ pOverStyle->SetMasterPage(pBaseStyle->GetMasterPage());
++
++ if (!GetNext() || GetNext()->GetType()==FRIB_TAG_EOP)
++ m_bLastFrib = sal_True;
++ else
++ m_bLastFrib = sal_False;
++
++ if (m_bLastFrib == sal_True)
++ pOverStyle->SetBreaks(enumXFBreakAftPage);
++ else
++ pOverStyle->SetBreaks(enumXFBreakBefPage);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_StyleName = pXFStyleManager->AddStyle(pOverStyle)->GetStyleName();
++}
++
++void LwpFribPageBreak::ParseLayout()
++{
++ if(m_pMasterPage)
++ {
++ m_pMasterPage->ParseSection(this);
++ }
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpfribbreaks.hxx lotuswordpro/source/filter/lwpfribbreaks.hxx
+--- lotuswordpro.bak/source/filter/lwpfribbreaks.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfribbreaks.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,104 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++#ifndef _LWPFRIBBREAKS_HXX_
++#define _LWPFRIBBREAKS_HXX_
++
++#include "lwpfrib.hxx"
++#include "xfilter/xfparastyle.hxx"
++#include "lwppara.hxx"
++#include "lwpfribsection.hxx"
++
++class LwpFribPageBreak: public LwpFrib
++{
++public:
++ LwpFribPageBreak( LwpPara* pPara );
++ ~LwpFribPageBreak();
++ void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++ void RegisterBreakStyle(LwpPara* pPara);
++ void ParseLayout();
++ LwpObjectID* GetLayout(){return &m_Layout;}
++ sal_Bool IsLastFrib(){return m_bLastFrib;}
++
++private:
++ LwpObjectID m_Layout;
++ sal_Bool m_bLastFrib;
++
++ LwpMasterPage* m_pMasterPage;
++};
++
++class LwpFribLineBreak: public LwpFrib
++{
++public:
++ LwpFribLineBreak( LwpPara* pPara ) : LwpFrib(pPara){};
++ ~LwpFribLineBreak(){};
++};
++
++class LwpFribColumnBreak: public LwpFrib
++{
++public:
++ LwpFribColumnBreak( LwpPara* pPara ) : LwpFrib(pPara){};
++ ~LwpFribColumnBreak(){};
++ void RegisterBreakStyle(LwpPara* pPara);
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpfrib.cxx lotuswordpro/source/filter/lwpfrib.cxx
+--- lotuswordpro.bak/source/filter/lwpfrib.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfrib.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,463 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++#include "lwpfrib.hxx"
++#include "lwpcharsetmgr.hxx"
++#include "lwpsection.hxx"
++#include "lwphyperlinkmgr.hxx"
++#include "xfilter/xfhyperlink.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xfsection.hxx"
++#include "xfilter/xfsectionstyle.hxx"
++#include "xfilter/xftextspan.hxx"
++#include "xfilter/xftextcontent.hxx"
++#include "lwpfribheader.hxx"
++#include "lwpfribtext.hxx"
++#include "lwpfribtable.hxx"
++#include "lwpfribbreaks.hxx"
++#include "lwpfribframe.hxx"
++#include "lwpfribsection.hxx"
++#include "lwpcharacterstyle.hxx"
++#include "lwpfootnote.hxx"
++#include "lwpnotes.hxx"
++#include "lwpfribmark.hxx"
++#include "lwpchangemgr.hxx"
++#include "lwpdocdata.hxx"
++#include "lwpglobalmgr.hxx"
++
++LwpFrib::LwpFrib(LwpPara* pPara)
++ : m_pPara(pPara), m_pNext(NULL)
++{
++ m_ModFlag = sal_False;
++ m_pModifiers = NULL;
++ m_bRevisionFlag = sal_False;
++}
++
++LwpFrib::~LwpFrib()
++{
++ if(m_pModifiers)
++ delete m_pModifiers;
++}
++
++LwpFrib* LwpFrib::CreateFrib(LwpPara* pPara, LwpObjectStream* pObjStrm, sal_uInt8 fribtag,sal_uInt8 editID)
++{
++ //Read Modifier
++ ModifierInfo* pModInfo = NULL;
++ if(fribtag & FRIB_TAG_MODIFIER)
++ {
++ pModInfo = new ModifierInfo();
++ pModInfo->CodePage = 0;
++ pModInfo->FontID = 0;
++ pModInfo->RevisionFlag = sal_False;
++ pModInfo->HasCharStyle = sal_False;
++ pModInfo->HasLangOverride = sal_False;
++ pModInfo->HasHighLight = sal_False;
++ ReadModifiers( pObjStrm, pModInfo );
++ }
++
++ //Read frib data
++ LwpFrib* newFrib = NULL;
++ sal_uInt16 friblen = pObjStrm->QuickReaduInt16();
++ sal_uInt8 fribtype = fribtag&~FRIB_TAG_TYPEMASK;
++ switch(fribtype)
++ {
++ case FRIB_TAG_INVALID: //fall through
++ case FRIB_TAG_EOP: //fall through
++ default:
++ newFrib = new LwpFrib(pPara);
++ break;
++ case FRIB_TAG_TEXT:
++ {
++ newFrib = new LwpFribText (pPara, fribtag & FRIB_TAG_NOUNICODE);
++ break;
++ }
++ case FRIB_TAG_TABLE:
++ newFrib = new LwpFribTable(pPara);
++ break;
++ case FRIB_TAG_TAB:
++ newFrib = new LwpFribTab(pPara);
++ break;
++ case FRIB_TAG_PAGEBREAK:
++ newFrib = new LwpFribPageBreak(pPara);
++ break;
++ case FRIB_TAG_FRAME:
++ newFrib = new LwpFribFrame(pPara);
++ break;
++ case FRIB_TAG_FOOTNOTE:
++ newFrib = new LwpFribFootnote(pPara);
++ break;
++ case FRIB_TAG_COLBREAK:
++ newFrib = new LwpFribColumnBreak(pPara);
++ break;
++ case FRIB_TAG_LINEBREAK:
++ newFrib = new LwpFribLineBreak(pPara);
++ break;
++ case FRIB_TAG_HARDSPACE:
++ newFrib = new LwpFribHardSpace(pPara);
++ break;
++ case FRIB_TAG_SOFTHYPHEN:
++ newFrib = new LwpFribSoftHyphen(pPara);
++ break;
++ case FRIB_TAG_PARANUMBER:
++ newFrib = new LwpFribParaNumber(pPara);
++ break;
++ case FRIB_TAG_UNICODE: //fall through
++ case FRIB_TAG_UNICODE2: //fall through
++ case FRIB_TAG_UNICODE3: //fall through
++ newFrib = new LwpFribUnicode(pPara);
++ break;
++ case FRIB_TAG_NOTE:
++ newFrib = new LwpFribNote(pPara);
++ break;
++/* case FRIB_TAG_KANJI:
++ #ifdef KANJI
++ newFrib = new CFribHelperKanji;
++ #else
++ newFrib = new CFribHelperUnicode;
++ #endif
++ break;
++ case FRIB_TAG_HKATAKANA:
++ #ifdef KANJI
++ newFrib = new CFribHelperHKatakana;
++ #else
++ newFrib = new CFribHelperUnicode;
++ #endif
++ break;
++ case FRIB_TAG_SEPARATOR:
++ newFrib = new CFribHelperSeparator;
++ break;*/
++ case FRIB_TAG_SECTION:
++ newFrib = new LwpFribSection(pPara);
++ break;
++/* case FRIB_TAG_TOMBSTONE:
++ newFrib = new CFribHelperTombstone;
++ break;
++ case FRIB_TAG_SPECIALTAB:
++ newFrib = new CFribHelperSpecialTab;
++ break;
++ case FRIB_TAG_PAGENUMBER:
++ newFrib = new CFribHelperPageNumber;
++ break;
++*/ case FRIB_TAG_PAGENUMBER:
++ newFrib = new LwpFribPageNumber(pPara);
++ break;
++ case FRIB_TAG_DOCVAR:
++ newFrib = new LwpFribDocVar(pPara);
++ break;
++ case FRIB_TAG_BOOKMARK:
++ newFrib = new LwpFribBookMark(pPara);
++ break;
++/* case FRIB_TAG_DOCVAR:
++ newFrib = new CFribHelperBookmark;
++ break;
++ case FRIB_TAG_DDE:
++ newFrib = new CFribHelperDDE;
++ break;
++*/ case FRIB_TAG_FIELD:
++ newFrib = new LwpFribField(pPara);
++ break;
++ case FRIB_TAG_CHBLOCK:
++ newFrib = new LwpFribCHBlock(pPara);
++ break;
++/* case FRIB_TAG_FLOWBREAK:
++ newFrib = new CFribHelperFlowBreak;
++ break;
++#ifdef RUBY*/
++ case FRIB_TAG_RUBYMARKER:
++ newFrib = new LwpFribRubyMarker(pPara);
++ break;
++ case FRIB_TAG_RUBYFRAME:
++ newFrib = new LwpFribRubyFrame(pPara);
++ break;
++/*#endif
++*/
++ }
++
++ //Do not know why the fribTag judgement is necessary, to be checked with
++ if ( fribtag & FRIB_TAG_MODIFIER )
++ {
++ newFrib->SetModifiers(pModInfo);
++ }
++
++ newFrib->SetType(fribtype);
++ newFrib->SetEditor(editID);
++ newFrib->Read(pObjStrm, friblen);
++ return newFrib;
++}
++
++void LwpFrib::Read(LwpObjectStream* pObjStrm, sal_uInt16 len)
++{
++ pObjStrm->SeekRel(len);
++}
++
++void LwpFrib::SetModifiers(ModifierInfo* pModifiers)
++{
++ if (pModifiers)
++ {
++ m_pModifiers = pModifiers;
++ m_ModFlag = sal_True;
++ if (pModifiers->RevisionFlag)
++ {
++ m_bRevisionFlag = sal_True;
++ m_nRevisionType = pModifiers->RevisionType;
++ }
++ }
++}
++
++void LwpFrib::RegisterStyle(LwpFoundry* pFoundry)
++{
++ if (!m_pModifiers)
++ return;
++ if (!m_pModifiers->FontID && !m_pModifiers->HasCharStyle && !m_pModifiers->HasHighLight)
++ {
++ m_ModFlag = sal_False;
++ return;
++ }
++ //we only read four modifiers, in these modifiers,CodePage and LangOverride are not styles,
++ //so we can only handle fontid and characstyle, if others ,we should not reg style
++ //note by ,1-27
++ XFFont* pFont;
++ XFTextStyle* pStyle = NULL;
++ m_StyleName = A2OUSTR("");
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ if (m_pModifiers->HasCharStyle)
++ {
++ XFTextStyle* pNamedStyle = static_cast<XFTextStyle*>
++ (pFoundry->GetStyleManager()->GetStyle(m_pModifiers->CharStyleID));
++ if (m_pModifiers->FontID)
++ {
++ pStyle = new XFTextStyle();
++ *pStyle = *pNamedStyle;
++ LwpCharacterStyle* pCharStyle = static_cast<LwpCharacterStyle*>(m_pModifiers->CharStyleID.obj());
++
++ pStyle->SetStyleName(A2OUSTR(""));
++ pFont = pFoundry->GetFontManger()->CreateOverrideFont(pCharStyle->GetFinalFontID(),m_pModifiers->FontID);
++ pStyle->SetFont(pFont);
++ m_StyleName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++ }
++ else
++ m_StyleName = pNamedStyle->GetStyleName();
++ }
++ else
++ {
++ if (m_pModifiers->FontID)
++ {
++ pStyle = new XFTextStyle();
++ pFont = pFoundry->GetFontManger()->CreateFont(m_pModifiers->FontID);
++ pStyle->SetFont(pFont);
++ m_StyleName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++ }
++ }
++
++ if (m_pModifiers->HasHighLight)
++ {
++ XFColor aColor = GetHighLightColor();//right yellow
++ if (pStyle)//change the style directly
++ pStyle->GetFont()->SetBackColor(aColor);
++ else //register a new style
++ {
++ pStyle = new XFTextStyle();
++
++ if (m_StyleName.getLength()>0)
++ {
++ XFTextStyle* pOldStyle = pXFStyleManager->FindTextStyle(m_StyleName);
++ *pStyle = *pOldStyle;
++ pStyle->GetFont()->SetBackColor(aColor);
++ }
++ else
++ {
++ pFont = new XFFont;
++ pFont->SetBackColor(aColor);
++ pStyle->SetFont(pFont);
++ }
++ m_StyleName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++ }
++ }
++}
++
++void LwpFrib::ReadModifiers(LwpObjectStream* pObjStrm,ModifierInfo* pModInfo)
++{
++ sal_uInt8 Modifier;
++ sal_uInt8 len;
++// sal_Bool ModifyFlag = sal_False;
++
++ for(;;)
++ {
++ // Get the modifier type
++ pObjStrm->QuickRead(&Modifier, sizeof(Modifier));
++
++ // Stop when we hit the last modifier
++ if (Modifier == FRIB_MTAG_NONE)
++ break;
++// ModifyFlag = sal_True;
++ // Get the modifier length
++ pObjStrm->QuickRead(&len, sizeof(len));
++
++ switch (Modifier)
++ {
++ case FRIB_MTAG_FONT:
++ pObjStrm->QuickRead(&pModInfo->FontID,len);
++ break;
++ case FRIB_MTAG_CHARSTYLE:
++ pModInfo->HasCharStyle = sal_True;
++ pModInfo->CharStyleID.ReadIndexed(pObjStrm);
++ break;
++ case FRIB_MTAG_LANGUAGE:
++ pModInfo->HasLangOverride = sal_True;
++ pModInfo->Language.Read(pObjStrm);
++ break;
++ case FRIB_MTAG_CODEPAGE:
++ pObjStrm->QuickRead(&pModInfo->CodePage,len);
++ break;
++ //add by , 02/22/2005
++ case FRIB_MTAG_ATTRIBUTE:
++ pModInfo->aTxtAttrOverride.Read(pObjStrm);
++ if (pModInfo->aTxtAttrOverride.IsHighLight())
++ pModInfo->HasHighLight = sal_True;
++ break;
++ //end add
++ case FRIB_MTAG_REVISION:
++ pModInfo->RevisionType = pObjStrm->QuickReaduInt8();
++ pModInfo->RevisionFlag = sal_True;
++ break;
++ default:
++ pObjStrm->SeekRel(len);
++ break;
++ }
++ // TODO: read the modifier data
++ // pObjStrm->SeekRel(len);
++
++ }
++
++}
++
++//do nothing
++//void LwpFrib::Parse(IXFStream* pOutputStream)
++//{}
++
++/**
++* @descr: Whether there are other fribs following current frib.
++* @return: Ture if having following fribs, or false.
++*/
++sal_Bool LwpFrib::HasNextFrib()
++{
++ if (!GetNext() || GetNext()->GetType()==FRIB_TAG_EOP)
++ return sal_False;
++ return sal_True;
++}
++
++void LwpFrib::ConvertChars(XFContentContainer* pXFPara,OUString text)
++{
++ if (m_ModFlag)
++ {
++ OUString strStyleName = GetStyleName();
++ XFTextSpan *pSpan = new XFTextSpan(text,strStyleName);
++ pXFPara->Add(pSpan);
++ }
++ else
++ {
++ XFTextContent *pSpan = new XFTextContent();
++ pSpan->SetText(text);
++ pXFPara->Add(pSpan);
++ }
++}
++
++void LwpFrib::ConvertHyperLink(XFContentContainer* pXFPara,LwpHyperlinkMgr* pHyperlink,OUString text)
++{
++ XFHyperlink* pHyper = new XFHyperlink;
++ pHyper->SetHRef(pHyperlink->GetHyperlink());
++ pHyper->SetText(text);
++ pHyper->SetStyleName(GetStyleName());
++ pXFPara->Add(pHyper);
++}
++
++/**
++* @descr: Get the current frib font style
++* @return: XFFont pointer
++*/
++XFFont* LwpFrib::GetFont()
++{
++ XFFont* pFont = NULL;
++ if(m_pModifiers&&m_pModifiers->FontID)
++ {
++ LwpFoundry* pFoundry = m_pPara->GetFoundry();
++ pFont = pFoundry->GetFontManger()->CreateFont(m_pModifiers->FontID);
++ }
++ else
++ {
++ XFParaStyle* pXFParaStyle = m_pPara->GetXFParaStyle();
++ pFont = pXFParaStyle->GetFont();
++ }
++ return pFont;
++}
++
++OUString LwpFrib::GetEditor()
++{
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ return pGlobal->GetEditorName(m_nEditor);
++}
++
++XFColor LwpFrib::GetHighLightColor()
++{
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ return pGlobal->GetHighLightColor(m_nEditor);
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpfribframe.cxx lotuswordpro/source/filter/lwpfribframe.cxx
+--- lotuswordpro.bak/source/filter/lwpfribframe.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfribframe.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,236 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - footnote
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++#include "lwpfribframe.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "lwpglobalmgr.hxx"
++#include "xfilter/xfchange.hxx"
++/**
++ * @short: Read frame frib
++ * @param:
++ * @param:
++ */
++
++void LwpFribFrame::Read(LwpObjectStream* pObjStrm, sal_uInt16 len)
++{
++ m_objLayout.ReadIndexed(pObjStrm);
++}
++
++/**
++* @descr: Get the layout object which the frib points to
++*
++*/
++LwpObject* LwpFribFrame::GetLayout()
++{
++ return m_objLayout.obj();
++}
++
++/**
++* @descr: register frame style
++* @param: pFoundry - current foundry pointer
++*
++*/
++void LwpFribFrame::RegisterStyle(LwpFoundry* pFoundry)
++{
++ if (m_objLayout.obj()->GetTag() == VO_DROPCAPLAYOUT)
++ {
++ static_cast<LwpDropcapLayout*>(m_objLayout.obj())->RegisterStyle(pFoundry);
++ }
++ else
++ {
++ //register frame style, , 04/07/2005
++ LwpPlacableLayout* pLayout = static_cast<LwpPlacableLayout*>(m_objLayout.obj());
++ pLayout->SetFoundry(pFoundry);
++ pLayout->RegisterStyle();
++
++ //register next frib text style
++ sal_uInt8 nType = pLayout->GetRelativeType();
++ if(LwpLayoutRelativityGuts::LAY_INLINE_NEWLINE == nType
++ && HasNextFrib())
++ {
++ XFParaStyle* pOldStyle = m_pPara->GetXFParaStyle();
++ if (pOldStyle->GetMasterPage().getLength() == 0)
++ m_StyleName = pOldStyle->GetStyleName();
++ else
++ {
++ XFParaStyle* pParaStyle = new XFParaStyle;
++ *pParaStyle = *(pOldStyle);
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_StyleName = pXFStyleManager->AddStyle(pParaStyle)->GetStyleName();
++ }
++ }
++ //remember the current paragraph font size which will be used in parsing frame
++ pLayout->SetFont(GetFont());
++ }
++}
++void LwpFribFrame::SetParaDropcap(LwpPara* pPara)
++{
++ if (m_objLayout.obj()->GetTag() == VO_DROPCAPLAYOUT)
++ {
++ pPara->SetParaDropcap(sal_True);
++ pPara->SetDropcapLayout(static_cast<LwpDropcapLayout*>(m_objLayout.obj()));
++ }
++ else
++ pPara->SetParaDropcap(sal_False);
++}
++
++/**
++* @descr: convert frame
++*
++*/
++void LwpFribFrame::XFConvert(XFContentContainer* pCont)
++{
++ XFContentContainer* pXFContentContainer = pCont;
++ LwpVirtualLayout* pLayout = static_cast<LwpVirtualLayout*>(GetLayout());
++ sal_uInt8 nType = pLayout->GetRelativeType();
++ if( LwpLayoutRelativityGuts::LAY_PARA_RELATIVE == nType)
++ {
++ LwpVirtualLayout* pContainerLayout = pLayout->GetContainerLayout();
++ if(pContainerLayout && pContainerLayout->IsFrame())
++ {
++ //same page as text and in frame
++ pXFContentContainer = m_pPara->GetXFContainer();
++ }
++ else if(pContainerLayout && pContainerLayout->IsCell())
++ {
++ //same page as text and in cell, get the first xfpara
++ XFContentContainer* pXFFirtPara = static_cast<XFContentContainer*>(pCont->FindFirstContent(enumXFContentPara));
++ if(pXFFirtPara)
++ pXFContentContainer = pXFFirtPara;
++ }
++ }
++ OUString sChangeID;
++ if(m_bRevisionFlag)
++ {
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ LwpChangeMgr* pChangeMgr = pGlobal->GetLwpChangeMgr();
++ sChangeID = pChangeMgr->GetChangeID(this);
++ if (sChangeID.getLength())
++ {
++ XFChangeStart* pChangeStart = new XFChangeStart;
++ pChangeStart->SetChangeID(sChangeID);
++ pXFContentContainer->Add(pChangeStart);
++ }
++ }
++
++ pLayout->XFConvert(pXFContentContainer);
++
++ if(m_bRevisionFlag)
++ {
++ if (sChangeID.getLength())
++ {
++ XFChangeEnd* pChangeEnd = new XFChangeEnd;
++ pChangeEnd->SetChangeID(sChangeID);
++ pXFContentContainer->Add(pChangeEnd);
++ }
++ }
++
++ if(LwpLayoutRelativityGuts::LAY_INLINE_NEWLINE == nType
++ && HasNextFrib())
++ {
++ XFParagraph* pXFPara = new XFParagraph();
++ pXFPara->SetStyleName(m_StyleName);
++ m_pPara->AddXFContent(pXFPara);
++ m_pPara->GetFribs()->SetXFPara(pXFPara);
++ }
++
++}
++
++/**
++ * @descr: Read Ruby frame
++ *
++ */
++void LwpFribRubyFrame::Read(LwpObjectStream* pObjStrm, sal_uInt16 len)
++{
++ m_objLayout.ReadIndexed(pObjStrm);
++}
++/**
++ * @descr: Register Ruby frame style
++ *
++ */
++void LwpFribRubyFrame::RegisterStyle(LwpFoundry* pFoundry)
++{
++ LwpRubyLayout* pLayout = GetLayout();
++ if (pLayout)
++ {
++ pLayout->SetFoundry(pFoundry);
++ pLayout->RegisterStyle();
++ }
++}
++/**
++ * @descr: convert Ruby frame
++ *
++ */
++void LwpFribRubyFrame::XFConvert(XFContentContainer* pCont)
++{
++ LwpRubyLayout* pLayout = GetLayout();
++ if (pLayout)
++ {
++ pLayout->ConvertContentText();
++ }
++}
++
++LwpRubyLayout* LwpFribRubyFrame::GetLayout()
++{
++ return static_cast<LwpRubyLayout*>(m_objLayout.obj());
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpfribframe.hxx lotuswordpro/source/filter/lwpfribframe.hxx
+--- lotuswordpro.bak/source/filter/lwpfribframe.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfribframe.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,97 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - footnote
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++#ifndef _LWPFRIBFRAME_HXX_
++#define _LWPFRIBFRAME_HXX_
++#include "lwpfrib.hxx"
++#include "lwplayout.hxx"
++#include "lwppara.hxx"
++#include "lwpframelayout.hxx"
++
++class LwpFribFrame : public LwpFrib
++{
++public:
++ LwpFribFrame( LwpPara* pPara) : LwpFrib(pPara){};
++ ~LwpFribFrame(){};
++ void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++ LwpObject* GetLayout();
++ void RegisterStyle(LwpFoundry* pFoundry);
++ void SetParaDropcap(LwpPara* pPara);
++ void XFConvert(XFContentContainer* pCont);
++private:
++ LwpObjectID m_objLayout;
++};
++
++class LwpFribRubyFrame : public LwpFrib
++{
++public:
++ LwpFribRubyFrame( LwpPara* pPara) : LwpFrib(pPara){};
++ ~LwpFribRubyFrame(){};
++ void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++ LwpRubyLayout* GetLayout();
++ void RegisterStyle(LwpFoundry* pFoundry);
++ void XFConvert(XFContentContainer* pCont);
++private:
++ LwpObjectID m_objLayout;
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpfribheader.hxx lotuswordpro/source/filter/lwpfribheader.hxx
+--- lotuswordpro.bak/source/filter/lwpfribheader.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfribheader.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,135 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _LWPFRIBHEADER_HXX
++#define _LWPFRIBHEADER_HXX
++
++#define FRIB_TAG_NOUNICODE 0x40 // Don't xlate text to/from Unicode
++#define FRIB_TAG_MODIFIER 0x80 // This frib has a modifier on it
++#define FRIB_TAG_TYPEMASK (FRIB_TAG_NOUNICODE | FRIB_TAG_MODIFIER)
++
++#define FRIB_TAG_ELVIS 0 // "EOP dammit" tag
++
++#define FRIB_MTAG_NONE 0
++#define FRIB_MTAG_FONT 1
++#define FRIB_MTAG_REVISION 2
++#define FRIB_MTAG_CHARSTYLE 3
++#define FRIB_MTAG_ATTRIBUTE 4
++#define FRIB_MTAG_LANGUAGE 5
++#define FRIB_MTAG_CHARBORDER 6
++#define FRIB_MTAG_AMIKAKE 7
++#define FRIB_MTAG_CODEPAGE 8
++#define FRIB_MTAG_STXLINK 9 // SmarText; do not #ifdef out
++
++#define FT_MAXIMUM 30
++
++#define DOC_BADFILEPARAHINTS 0x00800000UL
++
++/* Registration definitions */
++enum
++{
++ FS_RIGHTSIDE = 0x00,
++ FS_LEFTSIDE = 0x10
++};
++/* Mode definitions */
++enum
++{
++ FS_REGISTERSELF = 0x20,
++ FS_READING = 0x40
++};
++
++enum
++{
++ FRIB_TAG_INVALID, // FT_INVALID
++ FRIB_TAG_EOP, // FT_EOP
++ FRIB_TAG_TEXT, // FT_TEXT
++ FRIB_TAG_TABLE, // FT_TABLE
++ FRIB_TAG_TAB, // FT_TAB
++ FRIB_TAG_PAGEBREAK, // FT_PAGEBREAK
++ FRIB_TAG_FRAME, // FT_FRAME
++ FRIB_TAG_FOOTNOTE, // FT_FOOTNOTE
++ FRIB_TAG_COLBREAK, // FT_COLBREAK
++ FRIB_TAG_LINEBREAK, // FT_LINEBREAK
++ FRIB_TAG_HARDSPACE, // FT_HARDSPACE
++ FRIB_TAG_SOFTHYPHEN, // FT_SOFTHYPHEN
++ FRIB_TAG_PARANUMBER, // FT_PARANUMBER
++ FRIB_TAG_UNICODE, // FT_UNICODE
++#ifdef KANJI
++ FRIB_TAG_KANJI, // FT_KANJI
++ FRIB_TAG_HKATAKANA, // FT_HKATAKANA
++#else
++ FRIB_TAG_UNICODE2, // FT_UNICODE
++ FRIB_TAG_UNICODE3, // FT_UNICODE
++#endif
++ FRIB_TAG_SEPARATOR, // FT_SEPARATOR
++ FRIB_TAG_SECTION, // FT_SECTION
++ FRIB_TAG_TOMBSTONE, // FT_TOMBSTONE
++ FRIB_TAG_SPECIALTAB, // FT_SPECIALTAB
++ FRIB_TAG_PAGENUMBER, // FT_PAGENUMBER
++ FRIB_TAG_NOTE, // FT_NOTE
++ FRIB_TAG_DOCVAR, // FT_DOCVAR
++ FRIB_TAG_BOOKMARK, // FT_BOOKMARK
++ FRIB_TAG_DDE, // FT_DDE
++ FRIB_TAG_FIELD, // FT_FIELD
++ FRIB_TAG_CHBLOCK, // FT_CHBLOCK
++//#ifdef RUBY
++ FRIB_TAG_FLOWBREAK, // FT_FLOWBREAK
++ FRIB_TAG_RUBYMARKER, // FT_RUBYMARKER
++ FRIB_TAG_RUBYFRAME // FT_RUBYFRAME
++//#else
++// FRIB_TAG_FLOWBREAK // FT_FLOWBREAK
++//#endif
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpfrib.hxx lotuswordpro/source/filter/lwpfrib.hxx
+--- lotuswordpro.bak/source/filter/lwpfrib.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfrib.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,139 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++#ifndef _LWPFRIB_HXX_
++#define _LWPFRIB_HXX_
++#include "lwpobjid.hxx"
++#include "lwpobjstrm.hxx"
++#include "lwpbasetype.hxx"
++#include "lwpoverride.hxx"
++#include "lwpfoundry.hxx"
++#include "xfilter/xfcolor.hxx"
++
++struct ModifierInfo
++{
++ sal_uInt32 FontID;
++ LwpObjectID CharStyleID;
++ LwpTextLanguageOverride Language;
++ //add by , 02/22/2005
++ LwpTextAttributeOverride aTxtAttrOverride;
++ //end add
++ sal_uInt16 CodePage;
++ sal_Bool HasCharStyle;
++ sal_Bool HasLangOverride;
++ sal_Bool HasHighLight;
++ sal_uInt8 RevisionType;
++ sal_Bool RevisionFlag;
++};
++
++class LwpPara;
++class LwpHyperlinkMgr;
++class LwpFrib
++{
++public:
++ LwpFrib(LwpPara* pPara);
++ ~LwpFrib();
++ static LwpFrib* CreateFrib(LwpPara* pPara, LwpObjectStream* pObjStrm, sal_uInt8 fribtag, sal_uInt8 editID);
++ virtual void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++// virtual void Parse(IXFStream* pOutputStream);
++ LwpFrib* GetNext(){return m_pNext;}
++ void SetNext(LwpFrib* next){m_pNext = next;}
++ sal_uInt8 GetType() { return m_nFribType;}
++ void SetType(sal_uInt8 type) { m_nFribType = type;}
++ void SetEditor(sal_uInt8 editor) { m_nEditor = editor;}
++ OUString GetEditor();
++ XFColor GetHighLightColor();
++protected:
++ LwpPara* m_pPara;
++ LwpFrib* m_pNext;
++ sal_uInt8 m_nFribType;
++ ModifierInfo* m_pModifiers;
++ rtl::OUString m_StyleName;
++public:
++ sal_Bool m_ModFlag;
++ rtl::OUString GetStyleName(){return m_StyleName;}//add by 1-10
++// void SetStyle(LwpFoundry* pFoundry);
++ sal_Bool IsModified(){return m_ModFlag;};
++ void SetModifiers(ModifierInfo* pModifiers);
++ ModifierInfo* GetModifiers(){return m_pModifiers;};
++ virtual void RegisterStyle(LwpFoundry* pFoundry);
++ sal_Bool HasNextFrib();
++ void ConvertChars(XFContentContainer* pXFPara,OUString text);
++ void ConvertHyperLink(XFContentContainer* pXFPara,LwpHyperlinkMgr* pHyperlink,OUString text);
++ XFFont* GetFont();
++
++ sal_uInt8 GetRevisionType(){return m_nRevisionType;}
++ sal_Bool GetRevisionFlag(){return m_bRevisionFlag;}
++ enum{
++ REV_INSERT =0,
++ REV_DELETE = 1,
++ };
++ LwpPara* GetMyPara(){return m_pPara;}
++private:
++ static void ReadModifiers(LwpObjectStream* pObjStrm,ModifierInfo* pModInfo);
++protected:
++ sal_uInt8 m_nRevisionType;
++ sal_Bool m_bRevisionFlag;
++ sal_uInt8 m_nEditor;
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpfribmark.cxx lotuswordpro/source/filter/lwpfribmark.cxx
+--- lotuswordpro.bak/source/filter/lwpfribmark.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfribmark.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,1462 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ May 2005 Created
++ ************************************************************************/
++
++#include "lwpfribmark.hxx"
++#include "lwptools.hxx"
++#include "lwpglobalmgr.hxx"
++#include "lwpdoc.hxx"
++#include "lwpdivinfo.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xftextspan.hxx"
++#include "xfilter/xfbookmark.hxx"
++#include "xfilter/xfentry.hxx"
++#include "xfilter/xftextcontent.hxx"
++#include "xfilter/xfcrossref.hxx"
++#include "xfilter/xfdocfield.hxx"
++#include "xfilter/xfdatestyle.hxx"
++#include "xfilter/xftimestyle.hxx"
++#include "xfilter/xfdate.hxx"
++#include "xfilter/xfruby.hxx"
++#include "lwpchangemgr.hxx"
++#include "xfilter/xfchange.hxx"
++
++/**
++ * @short: Read hyperlink frib and Click here block
++ * @param:
++ * @param:
++ */
++void LwpFribCHBlock::Read(LwpObjectStream* pObjStrm, sal_uInt16 len)
++{
++ m_objMarker.ReadIndexed(pObjStrm);
++ m_nType = pObjStrm->QuickReaduInt8();
++}
++
++LwpCHBlkMarker* LwpFribCHBlock::GetMarker()
++{
++ return static_cast<LwpCHBlkMarker*>(m_objMarker.obj());
++}
++
++void LwpFribCHBlock::XFConvert(XFContentContainer* pXFPara,LwpStory* pStory)
++{
++ sal_uInt8 type = GetType();
++ if (!pStory)
++ return;
++ LwpCHBlkMarker* pMarker = GetMarker();
++
++ if (!pMarker)
++ return;
++ sal_uInt16 nAction = pMarker->GetAction();
++ if (nAction == LwpCHBlkMarker::CLICKHERE_CHBEHAVIORINTERNETLINK)//hyperlink
++ {
++ LwpHyperlinkMgr* pHyperlink = pStory->GetHyperlinkMgr();
++ if (type == MARKER_START)
++ {
++ if (pHyperlink)
++ {
++ pHyperlink->SetHyperlinkFlag(sal_True);
++ pHyperlink->SetHyperlink(pMarker->GetNamedProperty(A2OUSTR("URL")));
++ }
++ }
++ else if (type == MARKER_END)//or none
++ {
++ pHyperlink->SetHyperlinkFlag(sal_False);
++ }
++ }
++ else//click here block
++ {
++ pMarker->ConvertCHBlock(pXFPara,type);
++ }
++}
++/**
++ * @short: register bookmark frib
++ * @param:
++ * @param:
++ */
++void LwpFribBookMark::RegisterStyle(LwpFoundry* pFoundry)
++{
++ OUString name;
++ LwpBookMark* pBook = pFoundry->GetBookMark(GetMarkerID());
++ if (pBook)
++ name = pBook->GetName();
++
++ OUString sDivision;
++ LwpDocument* pDoc = pFoundry->GetDocument();
++ if (pDoc)
++ {
++ LwpObjectID* pID = pDoc->GetDivInfoID();
++ if (!pID->IsNull())
++ {
++ sDivision = static_cast<LwpDivInfo*>(pID->obj(VO_DIVISIONINFO))->GetDivName();
++ }
++ }
++
++ sal_uInt8 type = GetType();
++
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ LwpBookmarkMgr* pMarkMgr = pGlobal->GetLwpBookmarkMgr();
++ if (type == MARKER_START)
++ {
++ XFBookmarkStart* pMarkStart = new XFBookmarkStart;
++ pMarkStart->SetDivision(sDivision);
++ pMarkStart->SetName(name);
++ pMarkMgr->AddXFBookmarkStart(name,pMarkStart);//add to map
++ m_pStart = pMarkStart;
++ }
++ else if(type == MARKER_END)
++ {
++ XFBookmarkEnd* pMarkEnd = new XFBookmarkEnd;
++ pMarkEnd->SetDivision(sDivision);
++ pMarkEnd->SetName(name);
++ pMarkMgr->AddXFBookmarkEnd(name,pMarkEnd); //add to map
++ m_pEnd = pMarkEnd;
++ }
++}
++
++LwpFribBookMark::LwpFribBookMark(LwpPara* pPara ) : LwpFrib(pPara),m_pStart(NULL),m_pEnd(NULL)
++{
++}
++
++/**
++ * @short: Read bookmark frib
++ * @param:
++ * @param:
++ */
++void LwpFribBookMark::Read(LwpObjectStream* pObjStrm, sal_uInt16 len)
++{
++ m_objMarker.ReadIndexed(pObjStrm);
++ m_nType = pObjStrm->QuickReaduInt8();
++}
++/**
++ * @short: convert bookmark frib
++ * @param:
++ * @param:
++ */
++void LwpFribBookMark::XFConvert(XFContentContainer* pXFPara)
++{
++ sal_uInt8 type = GetType();
++
++ if (type == MARKER_START && m_pStart)
++ {
++ pXFPara->Add(m_pStart);
++ }
++ else if(type == MARKER_END && m_pEnd)
++ {
++ pXFPara->Add(m_pEnd);
++ }
++}
++
++/**
++ * @short: Read index entry frib
++ * @param:
++ * @param:
++ */
++LwpFribField::LwpFribField( LwpPara* pPara ) : LwpFrib(pPara)
++{
++ m_TimeStyle = A2OUSTR("");
++
++ m_nSubType = 0;//datetime/crossref/other
++ m_sFormula = A2OUSTR("");
++
++ m_nCrossRefType = 0;
++ m_nDateTimeType = 0;
++}
++
++void LwpFribField::Read(LwpObjectStream* pObjStrm, sal_uInt16 len)
++{
++ m_objMarker.ReadIndexed(pObjStrm);
++ m_nType = pObjStrm->QuickReaduInt8();
++}
++
++LwpFieldMark* LwpFribField::GetMarker()
++{
++ return static_cast<LwpFieldMark*>(m_objMarker.obj());
++}
++
++void LwpFribField::XFConvert(XFContentContainer* pXFPara)
++{
++ LwpFieldMark* pFieldMark = GetMarker();
++ if (!pFieldMark)
++ return;
++
++ sal_uInt8 type = GetType();
++ sal_uInt16 fieldType = pFieldMark->GetFieldType();
++
++ OUString sChangeID;
++ if(pFieldMark->GetRevisionFlag())
++ {
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ LwpChangeMgr* pChangeMgr = pGlobal->GetLwpChangeMgr();
++ sChangeID = pChangeMgr->GetChangeID(pFieldMark->GetStartFrib());
++ }
++
++ CheckFieldType(pFieldMark);
++ //end marker
++ if (type == MARKER_END)
++ {
++ if (pFieldMark->GetStart() == sal_False)
++ return;
++ if (pFieldMark->IsFormulaInsert())
++ {
++ XFTextContent *pSpan = new XFTextContent();
++ pSpan->SetText(A2OUSTR(">"));
++ pXFPara->Add(pSpan);
++ }
++ if (fieldType == LwpFieldMark::FLD_FIELD)
++ {
++ if (m_nSubType == SUBFIELD_DATETIME)
++ {
++ ConvertDateTimeEnd(pXFPara,pFieldMark);
++ }
++ else if (m_nSubType == SUBFIELD_CROSSREF)
++ {
++ ConvertCrossRefEnd(pXFPara,pFieldMark);
++ }
++ else if (m_nSubType == SUBFIELD_DOCPOWER)
++ {
++ ConvertDocFieldEnd(pXFPara,pFieldMark);
++ }
++ }
++ if(pFieldMark->GetRevisionFlag() && sChangeID.getLength())
++ {
++ XFChangeEnd* pChangeEnd = new XFChangeEnd;
++ pChangeEnd->SetChangeID(sChangeID);
++ pXFPara->Add(pChangeEnd);
++ }
++
++ return;
++ }
++
++ //start marker
++ if(pFieldMark->GetRevisionFlag() && sChangeID.getLength())
++ {
++ XFChangeStart* pChangeStart = new XFChangeStart;
++ pChangeStart->SetChangeID(sChangeID);
++ pXFPara->Add(pChangeStart);
++ }
++
++ if (fieldType == LwpFieldMark::FLD_INDEX)
++ {
++ OUString sKey1,sKey2;
++ pFieldMark->ParseIndex(sKey1,sKey2);
++ if (sKey1.getLength()>0)
++ {
++ XFEntry* pEntry = new XFEntry;
++ pEntry->SetEntryType(enumXFEntryAlphabetical);
++ pEntry->SetKey(sKey1,sKey2);
++ pXFPara->Add(pEntry);
++ }
++ }
++ else if (fieldType == LwpFieldMark::FLD_TOC)
++ {
++ OUString sLevel,sText;
++ pFieldMark->ParseTOC(sLevel,sText);
++ if (sLevel.getLength()>0 && sText.getLength()>0)
++ {
++ XFEntry* pEntry = new XFEntry;
++ pEntry->SetEntryType(enumXFEntryTOC);
++ pEntry->SetStringValue(sText);
++ pEntry->SetOutlineLevel(sLevel.toInt32(10));
++ pXFPara->Add(pEntry);
++ }
++ }
++ else if (fieldType == LwpFieldMark::FLD_FIELD)
++ {
++ sal_uInt8 nDatetype;
++ OUString sFormula;
++ sal_Bool bIsDateTime = pFieldMark->IsDateTimeField(nDatetype,sFormula);
++
++ if (m_nSubType == SUBFIELD_DATETIME)//date time
++ {
++ ConvertDateTimeStart(pXFPara,pFieldMark);
++ }
++ else if (m_nSubType == SUBFIELD_CROSSREF)//cross ref
++ {
++ ConvertCrossRefStart(pXFPara,pFieldMark);
++ }
++ else if (m_nSubType == SUBFIELD_DOCPOWER)
++ {
++ ConvertDocFieldStart(pXFPara,pFieldMark);
++ }
++ }
++
++ if (pFieldMark->IsFormulaInsert())
++ {
++ XFTextContent *pSpan = new XFTextContent();
++ pSpan->SetText(A2OUSTR("<"));
++ pXFPara->Add(pSpan);
++ }
++
++ pFieldMark->SetStart(sal_True);
++}
++
++void LwpFribField::RegisterStyle(LwpFoundry* pFoundry)
++{
++ LwpFrib::RegisterStyle(pFoundry);
++ LwpFieldMark* pFieldMark = GetMarker();
++ if (!pFieldMark)
++ return;
++
++ sal_uInt8 type = GetType();
++ sal_uInt16 fieldType = pFieldMark->GetFieldType();
++
++ if (type == MARKER_START && fieldType == LwpFieldMark::FLD_FIELD)
++ {
++ RegisterTimeField(pFieldMark);
++ }
++
++ if (type == MARKER_START && m_bRevisionFlag)
++ {
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ LwpChangeMgr* pChangeMgr = pGlobal->GetLwpChangeMgr();
++ pChangeMgr->AddChangeFrib(this);
++ pFieldMark->SetStartFrib(this);
++ pFieldMark->SetRevisionFlag(sal_True);
++ }
++}
++
++void LwpFribField::RegisterTimeField(LwpFieldMark* pFieldMark)
++{
++ OUString sFormula = pFieldMark->GetFormula();//now bookmark maybe not all register to bookmarkmgr,
++ if (sFormula == A2OUSTR("TotalEditingTime"))//so check field type now is not correct.
++ RegisterTotalTimeStyle();
++ else
++ {
++ sal_Int32 index;
++ sal_Unicode ch1(0x0020);//space
++ OUString tag;
++ index = sFormula.indexOf(ch1,0);
++ if (index < 0)
++ return;
++
++ tag = sFormula.copy(0,index);
++ if (tag == A2OUSTR("Now()") || tag == A2OUSTR("CreateDate") || tag == A2OUSTR("EditDate"))
++ RegisterDateTimeStyle(sFormula.copy(index+1,sFormula.getLength()-index-1));
++ }
++}
++
++void LwpFribField::RegisterTotalTimeStyle()
++{
++ XFTimeStyle* pTimeStyle = new XFTimeStyle;//use the default format
++ pTimeStyle->SetTruncate(sal_False);
++ pTimeStyle->AddMinute();
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_TimeStyle = pXFStyleManager->AddStyle(pTimeStyle)->GetStyleName();
++}
++
++void LwpFribField::RegisterDateTimeStyle(OUString sFormula)
++{
++ XFDateStyle* pDateStyle = NULL;
++ XFTimeStyle* pTimeStyle = NULL;
++//DATE
++ if (sFormula.getLength()<2)
++ return;
++ if (sFormula[1] == 'F')
++ {
++ if (sFormula == A2OUSTR("%FLSystemShortDate"))
++ {
++ pDateStyle = LwpTools::GetSystemDateStyle(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLSystemLongDate"))
++ {
++ pDateStyle = LwpTools::GetSystemDateStyle(sal_True);
++ }
++ else if (sFormula == A2OUSTR("%FLISODate1") || sFormula == A2OUSTR("%FLYYYY/MM/DD") )
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddYear();
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddMonth();
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddMonthDay();
++ }
++ else if (sFormula == A2OUSTR("%FLISODate2") || sFormula == A2OUSTR("%FLYYYY/MM/DD HH:mm:SS") )
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddYear();
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddMonth();
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddMonthDay();
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddHour();
++ pDateStyle->AddText(A2OUSTR(":"));
++ pDateStyle->AddMinute();
++ pDateStyle->AddText(A2OUSTR(":"));
++ pDateStyle->AddSecond(sal_True,0);
++ }
++ else if (sFormula == A2OUSTR("%FLM/D/YY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_False);
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddYear(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLMonth D, YYYY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%FLWeekday, Month D, YYYY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay();
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%FLMn D, YYYY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_False,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%FLWday, Mn D, YYYY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddMonth(sal_False,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%FLMn D"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_False,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLWeekday, Mn D"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay();
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddMonth(sal_False,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLMn D, YY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_False,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddYear(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLM/D"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_False);
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddMonthDay(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLM/YY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_False);
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddYear(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLMn YY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_False,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddYear(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLWeekday"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay();
++ }
++ else if (sFormula == A2OUSTR("%FLWday"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLMonth"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_True,sal_True);
++ }
++ else if (sFormula == A2OUSTR("%FLMn"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_False,sal_True);
++ }
++ else if (sFormula == A2OUSTR("%FLD"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonthDay(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLM"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLYYYY") )
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%FLYY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddYear(sal_False);
++ }
++ //chinese version begin
++ else if (sFormula == A2OUSTR("%FLYY/M/D"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddYear(sal_False);
++ pDateStyle->AddText(A2OUSTR("-"));
++ pDateStyle->AddMonth(sal_False);
++ pDateStyle->AddText(A2OUSTR("-"));
++ pDateStyle->AddMonthDay(sal_False);
++ }
++ else if(sFormula == A2OUSTR("%FLYYYY Month D"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddYear();
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ }
++ else if(sFormula == A2OUSTR("%FLWeekday, YYYY Month D"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay();
++ pDateStyle->AddText(A2OUSTR(","));
++ pDateStyle->AddYear();
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ }
++ else if(sFormula == A2OUSTR("%FLYYYY Mn D"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddYear();
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_False,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ }
++ else if(sFormula == A2OUSTR("%FLWday, YYYY Mn D"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(","));
++ pDateStyle->AddYear();
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ }
++ //next 2 are the same with english version
++ else if (sFormula == A2OUSTR("%FLYY Mn D"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddYear(sal_False);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_False,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLYY/M"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_False);
++ pDateStyle->AddText(A2OUSTR("-"));
++ pDateStyle->AddMonth(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLYY Mn"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_False);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_False,sal_True);
++ }
++ else if (sFormula == A2OUSTR("%FLeeeeoa") || sFormula == A2OUSTR("%FLffffooaa") || sFormula == A2OUSTR("%FLEEEEOA"))
++ {
++ pDateStyle = new XFDateStyle;
++ // OUString lang = OUString::createFromAscii("zh-CN");
++ // pDateStyle->SetLanguage( lang);
++ rtl::OUString sText;
++ pDateStyle->AddYear();
++ sText = rtl::OUString(0x5e74);
++ pDateStyle->AddText(sText);
++ pDateStyle->AddMonth(sal_False);
++ sText = rtl::OUString(0x6708);
++ pDateStyle->AddText(sText);
++ pDateStyle->AddMonthDay(sal_False);
++ sText = rtl::OUString(0x65e5);
++ pDateStyle->AddText(sText);
++ }
++ else if (sFormula == A2OUSTR("%FLoa") || sFormula == A2OUSTR("%FLooaa") || sFormula == A2OUSTR("%FLOA") )
++ {
++ pDateStyle = new XFDateStyle;
++ OUString sText;
++ pDateStyle->AddMonth(sal_False);
++ sText = rtl::OUString(0x6708);
++ pDateStyle->AddText(sText);
++ pDateStyle->AddMonthDay(sal_False);
++ sText = rtl::OUString(0x65e5);
++ pDateStyle->AddText(sText);
++ }
++ else if (sFormula == A2OUSTR("%FLYYYY/M/D") || sFormula == A2OUSTR("%FLGGGG/od/ad"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddYear();
++ pDateStyle->AddText(A2OUSTR("-"));
++ pDateStyle->AddMonth(sal_False);
++ pDateStyle->AddText(A2OUSTR("-"));
++ pDateStyle->AddMonthDay(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLYY.M.D") )
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddYear(sal_False);
++ pDateStyle->AddText(A2OUSTR("."));
++ pDateStyle->AddMonth(sal_False);
++ pDateStyle->AddText(A2OUSTR("."));
++ pDateStyle->AddMonthDay(sal_False);
++ }
++ //chinese version end
++ //other version begin
++ else if (sFormula == A2OUSTR("%FLWeekday, Month DD, YYYY") )
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay();
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay();
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%FLYYYY/MM/DD") )
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay();
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay();
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%FLD/M/YY") )
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddMonth(sal_False);
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddYear(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLD Month YYYY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%FLDD Month YYYY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonthDay();
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%FLWeekday, D Month YYYY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay();
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%FLWeekday, DD Month YYYY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay();
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddMonthDay();
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%FLD Mn YYYY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_False,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%FLWday, D Mn YYYY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_False,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%FLWday, DD Mn YYYY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddMonthDay();
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_False,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%FLD Mn"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_False,sal_True);
++ }
++ else if (sFormula == A2OUSTR("%FLDD Mn"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonthDay();
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_False,sal_True);
++ }
++ else if (sFormula == A2OUSTR("%FLWeekday, D Mn"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay();
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_False,sal_True);
++ }
++ else if (sFormula == A2OUSTR("%FLWeekday, DD Mn"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay();
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddMonthDay();
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_False,sal_True);
++ }
++ else if (sFormula == A2OUSTR("%FLD Mn YY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_False,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddYear(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLDD Mn YY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonthDay();
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_False,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddYear(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLD/M"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddMonth(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLDD/MM"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonthDay();
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddMonth();
++ }
++ else if(sFormula == A2OUSTR("%FLDD/MM/YY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonthDay();
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddMonth();
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddYear(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLMM/YY"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth();
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddYear(sal_False);
++ }
++ //other version end
++ //TIME
++ else if (sFormula == A2OUSTR("%FLSystemTime"))
++ {
++ pTimeStyle = LwpTools::GetSystemTimeStyle();
++ }
++ else if (sFormula == A2OUSTR("%FLISOTime1") || sFormula == A2OUSTR("%FLH:mm:SS"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddHour();
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddMinute();
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddSecond(sal_True,0);
++ }
++ else if (sFormula == A2OUSTR("%FLH:mm ampm"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddHour(sal_False);
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddMinute();
++ pTimeStyle->AddText(A2OUSTR(" "));
++ pTimeStyle->SetAmPm(sal_True);
++ }
++ else if (sFormula == A2OUSTR("%FLH:mm"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddHour(sal_False);
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddMinute();
++ }
++ else if (sFormula == A2OUSTR("%FLH:mm:SS ampm"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddHour(sal_False);
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddMinute();
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddSecond(sal_True,0);
++ pTimeStyle->AddText(A2OUSTR(" "));
++ pTimeStyle->SetAmPm(sal_True);
++ }
++ else if (sFormula == A2OUSTR("%FLH:mm:SS"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddHour(sal_False);
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddMinute();
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddSecond(sal_True,0);
++ }
++ else if (sFormula == A2OUSTR("%FLH ampm"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddHour(sal_False);
++ pTimeStyle->AddText(A2OUSTR(" "));
++ pTimeStyle->SetAmPm(sal_True);
++ }
++ else if (sFormula == A2OUSTR("%FLH"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddHour(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%FLmm"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddMinute();
++ }
++ else if (sFormula == A2OUSTR("%FLSS"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddSecond(sal_True,0);
++ }
++ else if (sFormula == A2OUSTR("%FLampm"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->SetAmPm(sal_True);
++ }
++ //chinese version begin
++ else if (sFormula == A2OUSTR("%FLjF") || sFormula == A2OUSTR("%FLJFF")
++ || sFormula == A2OUSTR("%FLjjF") || sFormula == A2OUSTR("%FLJJFF ") )
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddHour(sal_False);
++ rtl::OUString sText;
++ sText = rtl::OUString(0x70b9);
++ pTimeStyle->AddText(sText);
++ pTimeStyle->AddMinute(sal_False);
++ sText = rtl::OUString(0x5206);
++ pTimeStyle->AddText(sText);
++ }
++ else if (sFormula == A2OUSTR("%FLjjjF") || sFormula == A2OUSTR("%FLJJJFF") )
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->SetAmPm(sal_True);
++ pTimeStyle->AddHour(sal_False);
++ rtl::OUString sText;
++ sText = rtl::OUString(0x70b9);
++ pTimeStyle->AddText(sText);
++ pTimeStyle->AddMinute(sal_False);
++ sText = rtl::OUString(0x5206);
++ pTimeStyle->AddText(sText);
++ }
++ //chinese version end
++ //other version begin
++ else if (sFormula == A2OUSTR("%FLHH:mm ampm"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddHour();
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddMinute();
++ pTimeStyle->AddText(A2OUSTR(" "));
++ pTimeStyle->SetAmPm(sal_True);
++ }
++ else if (sFormula == A2OUSTR("%FLHH ampm"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddHour();
++ pTimeStyle->AddText(A2OUSTR(" "));
++ pTimeStyle->SetAmPm(sal_True);
++ }
++ else if (sFormula == A2OUSTR("%FLHH:mm:SS ampm"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddHour();
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddMinute();
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddSecond(sal_True,0);
++ pTimeStyle->AddText(A2OUSTR(" "));
++ pTimeStyle->SetAmPm(sal_True);
++ }
++ else if (sFormula == A2OUSTR("%FLHH:mm"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddHour();
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddMinute();
++ }
++ else if (sFormula == A2OUSTR("%FLHH:mm:SS"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddHour();
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddMinute();
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddSecond(sal_True,0);
++ }
++ //other version end
++ }
++ else if(sFormula[1] == 'D')
++ {
++ if (sFormula == A2OUSTR("%Da"))
++ {
++ pDateStyle = LwpTools::GetSystemDateStyle(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%DB") || sFormula == A2OUSTR("%Db"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%Dc") || sFormula == A2OUSTR("%DC"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%Dd") || sFormula == A2OUSTR("%DD"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay();
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR(", "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%DE") || sFormula == A2OUSTR("%De"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%Df") || sFormula == A2OUSTR("%DF"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddWeekDay();
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%Dg"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_False);
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddMonthDay(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%Dh"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_False);
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%Di") || sFormula == A2OUSTR("%DI"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR("."));
++ pDateStyle->AddMonth(sal_True,sal_True);
++ }
++ else if (sFormula == A2OUSTR("%Dj") || sFormula == A2OUSTR("%DJ"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonthDay(sal_False);
++ pDateStyle->AddText(A2OUSTR("."));
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%Dk") || sFormula == A2OUSTR("%DK"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddYear();
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(" "));
++ pDateStyle->AddMonthDay(sal_False);
++ }
++ else if (sFormula == A2OUSTR("%DL") || sFormula == A2OUSTR("%Dl"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonth(sal_True,sal_True);
++ pDateStyle->AddText(A2OUSTR(","));
++ pDateStyle->AddYear();
++ }
++ else if (sFormula == A2OUSTR("%Dm"))
++ {
++ pDateStyle = new XFDateStyle;
++ pDateStyle->AddMonthDay();
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddMonth();
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddYear();
++ }
++ }
++ else if (sFormula[1] == 'T')
++ {
++ if (sFormula == A2OUSTR("%T1"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddHour();
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddMinute();
++ }
++ else if (sFormula == A2OUSTR("%T2") || sFormula == A2OUSTR("%T6")
++ || sFormula == A2OUSTR("%T4") || sFormula == A2OUSTR("%T8") )
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddHour(sal_False);
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddMinute();
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->SetAmPm(sal_True);
++ }
++ else if (sFormula == A2OUSTR("%T3") || sFormula == A2OUSTR("%T7")
++ || sFormula == A2OUSTR("%T5") || sFormula == A2OUSTR("%T9"))
++ {
++ pTimeStyle = new XFTimeStyle;
++ pTimeStyle->AddHour();
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->AddMinute();
++ pTimeStyle->AddText(A2OUSTR(":"));
++ pTimeStyle->SetAmPm(sal_True);
++ }
++ }
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ if (pDateStyle)
++ m_TimeStyle = pXFStyleManager->AddStyle(pDateStyle)->GetStyleName();
++ if (pTimeStyle)
++ m_TimeStyle = pXFStyleManager->AddStyle(pTimeStyle)->GetStyleName();
++}
++
++void LwpFribField::CheckFieldType(LwpFieldMark* pFieldMark)
++{
++ sal_uInt8 nType;
++ OUString sFormula;
++ if (pFieldMark->IsDateTimeField(nType,sFormula))
++ {
++ m_nDateTimeType = nType;
++ m_sFormula = sFormula;
++ m_nSubType = SUBFIELD_DATETIME;
++ }
++ else if (pFieldMark->IsCrossRefField(nType,sFormula))
++ {
++ m_nCrossRefType = nType;
++ m_sFormula = sFormula;
++ m_nSubType = SUBFIELD_CROSSREF;
++ }
++ else if (pFieldMark->IsDocPowerField(nType,sFormula))
++ {
++ m_nDocPowerType = nType;
++ m_nSubType = SUBFIELD_DOCPOWER;
++ }
++ else
++ {
++ m_nSubType = SUBFIELD_INVALID;
++ }
++}
++
++void LwpFribField::ConvertDocFieldStart(XFContentContainer* pXFPara,LwpFieldMark* pFieldMark)
++{
++ XFContent* pContent = NULL;
++ switch(m_nDocPowerType)
++ {
++ case LwpFieldMark::DOC_DESCRIPTION:
++ {
++ pContent = new XFDescriptionStart;
++ break;
++ }
++ case LwpFieldMark::DOC_NUMPAGES:
++ {
++ pContent = new XFPageCountStart;
++ break;
++ }
++ case LwpFieldMark::DOC_NUMWORDS:
++ {
++ pContent = new XFWordCountStart;
++ break;
++ }
++ case LwpFieldMark::DOC_NUMCHARS:
++ {
++ pContent = new XFCharCountStart;
++ break;
++ }
++// case LwpFieldMark::DOC_TOTALTIME:
++// {
++// pContent = new XFTotalEditTimeStart;
++// pContent->SetStyleName(m_TimeStyle);
++// break;
++// }
++ }
++ if (pContent)
++ {
++ if (m_ModFlag)//(m_pModifiers)
++ {
++ XFTextSpanStart* pSpan = new XFTextSpanStart;
++ pSpan->SetStyleName(GetStyleName());
++ pSpan->Add(pContent);
++ pXFPara->Add(pSpan);
++ pFieldMark->SetStyleFlag(sal_True);
++ }
++ else
++ pXFPara->Add(pContent);
++ }
++}
++
++void LwpFribField::ConvertDocFieldEnd(XFContentContainer* pXFPara,LwpFieldMark* pFieldMark)
++{
++ XFContent* pContent = NULL;
++ switch(m_nDocPowerType)
++ {
++ case LwpFieldMark::DOC_DESCRIPTION:
++ {
++ pContent = new XFDescriptionEnd;
++ break;
++ }
++ case LwpFieldMark::DOC_NUMPAGES:
++ {
++ pContent = new XFPageCountEnd;
++ break;
++ }
++ case LwpFieldMark::DOC_NUMWORDS:
++ {
++ pContent = new XFWordCountEnd;
++ break;
++ }
++ case LwpFieldMark::DOC_NUMCHARS:
++ {
++ pContent = new XFCharCountEnd;
++ break;
++ }
++// case LwpFieldMark::DOC_TOTALTIME:
++// {
++// pContent = new XFTotalEditTimeEnd;
++// break;
++// }
++ }
++ if (pContent)
++ {
++ if (pFieldMark->GetStyleFlag())
++ {
++ XFTextSpanEnd* pSpan = new XFTextSpanEnd;
++ pSpan->Add(pContent);
++ pXFPara->Add(pSpan);
++ }
++ else
++ pXFPara->Add(pContent);
++ }
++}
++
++void LwpFribField::ConvertDateTimeStart(XFContentContainer* pXFPara,LwpFieldMark* pFieldMark)
++{
++ XFContent* pContent = NULL;
++ switch(m_nDateTimeType)
++ {
++ case LwpFieldMark::DATETIME_NOW:
++ {
++ pContent = new XFDateStart;
++ pContent->SetStyleName(m_TimeStyle);
++ break;
++ }
++ case LwpFieldMark::DATETIME_CREATE:
++ {
++ pContent = new XFCreateTimeStart;
++ pContent->SetStyleName(m_TimeStyle);
++ break;
++ }
++ case LwpFieldMark::DATETIME_LASTEDIT:
++ {
++ pContent = new XFLastEditTimeStart;
++ pContent->SetStyleName(m_TimeStyle);
++ break;
++ }
++ case LwpFieldMark::DATETIME_TOTALTIME:
++ {
++ pContent = new XFTotalEditTimeStart;
++ pContent->SetStyleName(m_TimeStyle);
++ break;
++ }
++ default:
++ break;
++ }
++ if (pContent)
++ {
++ if (m_ModFlag)//(m_pModifiers)
++ {
++ XFTextSpanStart* pSpan = new XFTextSpanStart;
++ pSpan->SetStyleName(GetStyleName());
++ pSpan->Add(pContent);
++ pXFPara->Add(pSpan);
++ pFieldMark->SetStyleFlag(sal_True);
++ }
++ else
++ pXFPara->Add(pContent);
++ }
++
++}
++
++void LwpFribField::ConvertDateTimeEnd(XFContentContainer* pXFPara,LwpFieldMark* pFieldMark)
++{
++ XFContent* pContent = NULL;
++ switch(m_nDateTimeType)
++ {
++ case LwpFieldMark::DATETIME_NOW:
++ {
++ pContent = new XFDateEnd;
++ break;
++ }
++ case LwpFieldMark::DATETIME_CREATE:
++ {
++ pContent = new XFCreateTimeEnd;
++ break;
++ }
++ case LwpFieldMark::DATETIME_LASTEDIT:
++ {
++ pContent = new XFLastEditTimeEnd;
++ break;
++ }
++ case LwpFieldMark::DATETIME_TOTALTIME:
++ {
++ pContent = new XFTotalEditTimeEnd;
++ break;
++ }
++ }
++ if (pContent)
++ {
++ if (pFieldMark->GetStyleFlag())
++ {
++ XFTextSpanEnd* pSpan = new XFTextSpanEnd;
++ pSpan->Add(pContent);
++ pXFPara->Add(pSpan);
++ }
++ else
++ pXFPara->Add(pContent);
++ }
++}
++
++void LwpFribField::ConvertCrossRefStart(XFContentContainer* pXFPara,LwpFieldMark* pFieldMark)
++{
++ XFCrossRefStart* pRef = new XFCrossRefStart;
++ pRef->SetRefType(m_nCrossRefType);
++ pRef->SetMarkName(m_sFormula);
++// pFieldMark->SetStart(sal_True);//for some disnormal cases
++ if (m_ModFlag)
++ {
++ XFTextSpanStart* pSpan = new XFTextSpanStart;
++ pSpan->SetStyleName(GetStyleName());
++ pSpan->Add(pRef);
++ pXFPara->Add(pSpan);
++ pFieldMark->SetStyleFlag(sal_True);
++ }
++ else
++ pXFPara->Add(pRef);
++}
++
++void LwpFribField::ConvertCrossRefEnd(XFContentContainer* pXFPara,LwpFieldMark* pFieldMark)
++{
++ XFCrossRefEnd* pRef = new XFCrossRefEnd;
++ if (pFieldMark->GetStyleFlag())
++ {
++ XFTextSpanEnd* pSpan = new XFTextSpanEnd;
++ pSpan->Add(pRef);
++ pXFPara->Add(pSpan);
++ }
++ else
++ pXFPara->Add(pRef);
++}
++
++LwpFribRubyMarker::LwpFribRubyMarker( LwpPara* pPara ): LwpFrib(pPara)
++{
++}
++
++LwpRubyMarker* LwpFribRubyMarker::GetMarker()
++{
++ return static_cast<LwpRubyMarker*>(m_objMarker.obj(VO_RUBYMARKER));
++}
++
++void LwpFribRubyMarker::Read(LwpObjectStream* pObjStrm, sal_uInt16 len)
++{
++ m_objMarker.ReadIndexed(pObjStrm);
++ m_nType = pObjStrm->QuickReaduInt8();
++}
++
++void LwpFribRubyMarker::XFConvert(XFContentContainer* pXFPara)
++{
++ sal_uInt8 type = GetType();
++ LwpRubyMarker* pMarker = GetMarker();
++
++ if (type == MARKER_START)
++ {
++ XFRubyStart* pRubyStart = new XFRubyStart;
++ if (pMarker)
++ {
++ pRubyStart->SetStyleName(pMarker->GetRubyStyleName());
++ }
++ pXFPara->Add(pRubyStart);
++ }
++ else if(type == MARKER_END)
++ {
++ XFRubyEnd* pRubyEnd = new XFRubyEnd;
++ if (pMarker)
++ {
++ pRubyEnd->SetText(pMarker->GetRubyText());
++ pRubyEnd->SetStyleName(pMarker->GetTextStyleName());
++ }
++ pXFPara->Add(pRubyEnd);
++ }
++}
++
++void LwpFribRubyMarker::RegisterStyle(LwpFoundry* pFoundry)
++{
++}
++
++
+diff -urNp lotuswordpro.bak/source/filter/lwpfribmark.hxx lotuswordpro/source/filter/lwpfribmark.hxx
+--- lotuswordpro.bak/source/filter/lwpfribmark.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfribmark.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,165 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ May 2005 Created
++ ************************************************************************/
++
++
++#ifndef _LWPFRIBMARKER_HXX_
++#define _LWPFRIBMARKER_HXX_
++
++#include "lwpfrib.hxx"
++#include "lwpstory.hxx"
++#include "lwpmarker.hxx"
++#include "xfilter/xftextspan.hxx"
++#include "xfilter/xfbookmark.hxx"
++
++class LwpFribCHBlock : public LwpFrib
++{
++public:
++ LwpFribCHBlock( LwpPara* pPara ) : LwpFrib(pPara){};
++ ~LwpFribCHBlock(){};
++ void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++ LwpCHBlkMarker* GetMarker();
++ sal_uInt8 GetType(){return m_nType;}
++ enum{MARKER_START=1,MARKER_END,MARKER_NONE};
++ void XFConvert(XFContentContainer* pXFPara,LwpStory* pStory);
++private:
++ sal_uInt8 m_nType;
++ LwpObjectID m_objMarker;
++};
++
++class LwpFribBookMark : public LwpFrib
++{
++public:
++ LwpFribBookMark( LwpPara* pPara );
++ ~LwpFribBookMark(){};
++ void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++ LwpObjectID GetMarkerID(){return m_objMarker;}
++ sal_uInt8 GetType(){return m_nType;}
++ enum{MARKER_START=1,MARKER_END,MARKER_NONE};
++ void XFConvert(XFContentContainer* pXFPara);
++ void RegisterStyle(LwpFoundry* pFoundry);
++private:
++ sal_uInt8 m_nType;
++ LwpObjectID m_objMarker;
++ XFBookmarkStart* m_pStart;
++ XFBookmarkEnd* m_pEnd;
++};
++
++class LwpFribField : public LwpFrib
++{
++public:
++ LwpFribField( LwpPara* pPara );
++ ~LwpFribField(){};
++ void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++ LwpFieldMark* GetMarker();
++ sal_uInt8 GetType(){return m_nType;}
++ enum{MARKER_START=1,MARKER_END,MARKER_NONE};
++ void XFConvert(XFContentContainer* pXFPara);
++ void RegisterStyle(LwpFoundry* pFoundry);
++ enum{
++ SUBFIELD_INVALID = 0,
++ SUBFIELD_DATETIME = 1,
++ SUBFIELD_CROSSREF = 2,
++ SUBFIELD_DOCPOWER = 3,
++ };
++private:
++ sal_uInt8 m_nType;
++ LwpObjectID m_objMarker;
++ OUString m_TimeStyle;
++
++ sal_uInt8 m_nSubType;//datetime/crossref/other
++ OUString m_sFormula;
++
++ sal_uInt8 m_nCrossRefType;
++ sal_uInt8 m_nDateTimeType;
++ sal_uInt8 m_nDocPowerType;
++
++ void RegisterTimeField(LwpFieldMark* pFieldMark);
++ void RegisterDateTimeStyle(OUString sFormula);
++ void RegisterTotalTimeStyle();
++ void CheckFieldType(LwpFieldMark* pFieldMark);
++ void ConvertDocFieldStart(XFContentContainer* pXFPara,LwpFieldMark* pFieldMark);
++ void ConvertDocFieldEnd(XFContentContainer* pXFPara,LwpFieldMark* pFieldMark);
++ void ConvertDateTimeStart(XFContentContainer* pXFPara,LwpFieldMark* pFieldMark);
++ void ConvertDateTimeEnd(XFContentContainer* pXFPara,LwpFieldMark* pFieldMark);
++ void ConvertCrossRefEnd(XFContentContainer* pXFPara,LwpFieldMark* pFieldMark);
++ void ConvertCrossRefStart(XFContentContainer* pXFPara,LwpFieldMark* pFieldMark);
++};
++
++class LwpFribRubyMarker : public LwpFrib
++{
++public:
++ LwpFribRubyMarker( LwpPara* pPara );
++ ~LwpFribRubyMarker(){};
++ void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++ LwpRubyMarker* GetMarker();
++ sal_uInt8 GetType(){return m_nType;}
++ enum{MARKER_START=1,MARKER_END,MARKER_NONE};
++ void XFConvert(XFContentContainer* pXFPara);
++ void RegisterStyle(LwpFoundry* pFoundry);
++private:
++ sal_uInt8 m_nType;
++ LwpObjectID m_objMarker;
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwpfribptr.cxx lotuswordpro/source/filter/lwpfribptr.cxx
+--- lotuswordpro.bak/source/filter/lwpfribptr.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfribptr.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,689 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpfribptr.hxx"
++
++#include "lwpfribheader.hxx"
++#include "lwpfribtext.hxx"
++#include "lwppara.hxx"
++#include "lwpstory.hxx"
++#include "xfilter/xftextspan.hxx"
++#include "xfilter/xftextcontent.hxx"
++#include "xfilter/xftabstop.hxx"
++#include "xfilter/xflinebreak.hxx"
++#include "lwpfribsection.hxx"
++#include "lwpsection.hxx"
++#include "lwpfribbreaks.hxx"
++#include "lwpfribframe.hxx"
++#include "lwpfribtable.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "lwphyperlinkmgr.hxx"
++#include "xfilter/xfhyperlink.hxx"
++#include "lwpfootnote.hxx"
++#include "lwpnotes.hxx"
++#include "lwpfribmark.hxx"
++#include "xfilter/xfchange.hxx"
++#include "lwpchangemgr.hxx"
++#include "lwpglobalmgr.hxx"
++
++
++LwpFribPtr::LwpFribPtr()
++ : m_pFribs(NULL),m_pPara(NULL),m_pXFPara(NULL)
++{}
++
++LwpFribPtr::~LwpFribPtr()
++{
++ LwpFrib* pNextFrib = m_pFribs;
++ LwpFrib* pCurFrib = m_pFribs;
++ while(pCurFrib)
++ {
++ pNextFrib = pCurFrib -> GetNext();
++ delete pCurFrib;
++ pCurFrib = pNextFrib;
++ }
++}
++
++void LwpFribPtr::ReadPara(LwpObjectStream* pObjStrm)
++{
++ sal_uInt8 FribTag=0;
++ sal_uInt8 FribType;
++ sal_uInt8 FribEditor;
++ BOOL ProblemFrib;
++
++ LwpFrib* pCurFrib = m_pFribs = NULL;
++ for(;;)
++ {
++ ProblemFrib = FALSE;
++ // Get the frib type
++ pObjStrm->QuickRead(&FribTag, sizeof(FribTag));
++
++ FribType = FribTag & ~FRIB_TAG_TYPEMASK;
++
++ // Stop when we hit Elvis
++ if (FribType == FRIB_TAG_ELVIS)
++ break;
++
++ // skip the editor ID
++ //pObjStrm->SeekRel(sizeof(sal_uInt8));
++ pObjStrm->QuickRead(&FribEditor, sizeof(FribEditor));
++ if( FribType != FT_MAXIMUM )
++ {
++ LwpFrib* pFrib = LwpFrib::CreateFrib( m_pPara, pObjStrm, FribTag,FribEditor);
++ if(!m_pFribs)
++ {
++ m_pFribs = pFrib;
++ }
++ if(pCurFrib)
++ {
++ pCurFrib->SetNext(pFrib);
++ }
++ else//frist frib in the para,add by 2/1
++ {
++ if (pFrib->GetType() == FRIB_TAG_TEXT)
++ {
++ LwpFribText* pText = static_cast<LwpFribText*>(pFrib);
++ if (pFrib->GetModifiers())
++ m_pPara->SetFirstFrib(pText->GetText(),pText->GetModifiers()->FontID);
++ else
++ m_pPara->SetFirstFrib(pText->GetText(),0);
++ }
++ }
++ pCurFrib = pFrib;
++ }
++ else
++ ProblemFrib = TRUE;
++ }
++}
++
++/*String LwpFribPtr::GetText()
++{
++ LwpFrib* pFrib = m_pFribs;
++ String content;
++ while(pFrib)
++ {
++ if(pFrib->GetType() == FRIB_TAG_TEXT)
++ {
++ content+= static_cast<LwpFribText*>(pFrib)->GetText();
++ }
++ pFrib = pFrib->GetNext();
++ }
++ return (content);
++}*/
++
++#include "lwpdropcapmgr.hxx"
++void LwpFribPtr::XFConvert()
++{
++ LwpFrib* pFrib = m_pFribs;
++ while(pFrib)
++ {
++ sal_uInt8 nFribType = pFrib->GetType();
++ sal_Bool bRevisionFlag = pFrib->GetRevisionFlag();
++ sal_uInt8 nRevisionType;
++ OUString sChangeID;
++ if (bRevisionFlag)
++ {
++ if ( nFribType!= FRIB_TAG_TABLE && nFribType != FRIB_TAG_FIELD
++ && nFribType != FRIB_TAG_FRAME)
++ {
++ nRevisionType = pFrib->GetRevisionType();
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ LwpChangeMgr* pChangeMgr = pGlobal->GetLwpChangeMgr();
++ sChangeID = pChangeMgr->GetChangeID(pFrib);
++ if (sChangeID.getLength())
++ {
++ /// if (nRevisionType == LwpFrib::REV_INSERT)
++ /// {
++ XFChangeStart* pChangeStart = new XFChangeStart;
++ pChangeStart->SetChangeID(sChangeID);
++ m_pXFPara->Add(pChangeStart);
++ /// }
++ /// else if (nRevisionType == LwpFrib::REV_DELETE)
++ /// {
++ /// XFChange* pChange = new XFChange;
++ /// pChange->SetChangeID(sChangeID);
++ /// m_pXFPara->Add(pChange);
++ /// pFrib = pFrib->GetNext();
++ /// continue;
++ /// }
++ }
++ }
++ }
++
++ switch(nFribType)
++ {
++ case FRIB_TAG_TEXT:
++ {
++ LwpFribText* textFrib= static_cast<LwpFribText*>(pFrib);
++ textFrib->XFConvert(m_pXFPara,m_pPara->GetStory());
++ }
++ break;
++ case FRIB_TAG_TAB:
++ {
++ LwpFribTab* tabFrib = static_cast<LwpFribTab*>(pFrib);
++ if (pFrib->m_ModFlag)
++ {
++ XFTextSpan *pSpan = new XFTextSpan();
++ pSpan->SetStyleName(tabFrib->GetStyleName());
++ XFTabStop *pTab = new XFTabStop();
++ pSpan->Add(pTab);
++ m_pXFPara->Add(pSpan);
++ }
++ else
++ {
++ XFTabStop *pTab = new XFTabStop();
++ m_pXFPara->Add(pTab);
++ }
++ }
++ break;
++ case FRIB_TAG_SECTION:
++ {
++ LwpFribSection* pSectionFrib = static_cast<LwpFribSection*>(pFrib);
++ pSectionFrib->ParseSection();
++ }
++ break;
++
++ case FRIB_TAG_PAGEBREAK:
++ {
++ LwpFribPageBreak* pPageBreak = static_cast<LwpFribPageBreak*>(pFrib);
++ LwpPageLayout* pLayout = static_cast<LwpPageLayout*>(pPageBreak->GetLayout()->obj());
++ if(pLayout)
++ {
++ pPageBreak->ParseLayout();
++ }
++ else
++ {
++ if (pPageBreak->IsLastFrib() == sal_True)
++ {
++ m_pXFPara->SetStyleName( pPageBreak->GetStyleName() );
++ }
++ else
++ {
++ //parse pagebreak
++ XFParagraph *pPara = new XFParagraph();
++ pPara->SetStyleName(pFrib->GetStyleName());
++ SetXFPara(pPara);
++ m_pPara->AddXFContent(pPara);
++ }
++ }
++ }
++ break;
++ case FRIB_TAG_COLBREAK:
++ {
++ XFParagraph *pPara = new XFParagraph();
++ pPara->SetStyleName(pFrib->GetStyleName());
++ SetXFPara(pPara);
++ m_pPara->AddXFContent(pPara);
++ }
++ break;
++ case FRIB_TAG_LINEBREAK:
++ {
++ XFLineBreak *pLineBreak = new XFLineBreak();
++ m_pXFPara->Add(pLineBreak);
++ }
++ break;
++ case FRIB_TAG_UNICODE: //fall through
++ case FRIB_TAG_UNICODE2: //fall through
++ case FRIB_TAG_UNICODE3: //fall through
++ {
++ LwpFribUnicode* unicodeFrib= static_cast<LwpFribUnicode*>(pFrib);
++ unicodeFrib->XFConvert(m_pXFPara,m_pPara->GetStory());
++ }
++ break;
++ case FRIB_TAG_HARDSPACE:
++ {
++ rtl::OUString sHardSpace(sal_Unicode(0x00a0));
++ LwpHyperlinkMgr* pHyperlink =
++ m_pPara->GetStory()->GetHyperlinkMgr();
++ if (pHyperlink->GetHyperlinkFlag())
++ pFrib->ConvertHyperLink(m_pXFPara,pHyperlink,sHardSpace);
++ else
++ pFrib->ConvertChars(m_pXFPara,sHardSpace);
++ }
++ break;
++ case FRIB_TAG_SOFTHYPHEN:
++ {
++ rtl::OUString sSoftHyphen(sal_Unicode(0x00ad));
++ pFrib->ConvertChars(m_pXFPara,sSoftHyphen);
++ }
++ break;
++ case FRIB_TAG_FRAME:
++ {
++ LwpFribFrame* frameFrib= static_cast<LwpFribFrame*>(pFrib);
++ LwpObject* pLayout = frameFrib->GetLayout();
++ if (pLayout->GetTag() == VO_DROPCAPLAYOUT)
++ {
++ m_pPara->GetFoundry()->GetDropcapMgr()->SetXFPara(m_pXFPara);
++ //LwpObject* pDropCap = frameFrib->GetLayout();
++ //pDropCap ->XFConvert(m_pXFPara);
++ }
++ //pLayout->XFConvert(m_pXFPara);
++ frameFrib->XFConvert(m_pXFPara);
++ }
++ break;
++ case FRIB_TAG_CHBLOCK:
++ {
++ LwpFribCHBlock* chbFrib = static_cast<LwpFribCHBlock*>(pFrib);
++ chbFrib->XFConvert(m_pXFPara,m_pPara->GetStory());
++ }
++ break;
++ case FRIB_TAG_TABLE:
++ {
++ LwpFribTable* tableFrib = static_cast<LwpFribTable*>(pFrib);
++ //tableFrib->XFConvert(m_pPara->GetXFContainer());
++ tableFrib->XFConvert(m_pXFPara);
++ }
++ break;
++ case FRIB_TAG_BOOKMARK:
++ {
++ LwpFribBookMark* bookmarkFrib = static_cast<LwpFribBookMark*>(pFrib);
++ bookmarkFrib->XFConvert(m_pXFPara);
++ }
++ break;
++ case FRIB_TAG_FOOTNOTE:
++ {
++ LwpFribFootnote* pFootnoteFrib = static_cast<LwpFribFootnote*>(pFrib);
++ pFootnoteFrib->XFConvert(m_pXFPara);
++ break;
++ }
++ case FRIB_TAG_FIELD:
++ {
++ LwpFribField* fieldFrib = static_cast<LwpFribField*>(pFrib);
++ fieldFrib->XFConvert(m_pXFPara);
++ break;
++ }
++ case FRIB_TAG_NOTE:
++ {
++ LwpFribNote* pNoteFrib = static_cast<LwpFribNote*>(pFrib);
++ pNoteFrib->XFConvert(m_pXFPara);
++ break;
++ }
++ case FRIB_TAG_PAGENUMBER:
++ {
++ LwpFribPageNumber* pagenumFrib = static_cast<LwpFribPageNumber*>(pFrib);
++ pagenumFrib->XFConvert(m_pXFPara);
++ break;
++ }
++ case FRIB_TAG_DOCVAR:
++ {
++ LwpFribDocVar* docFrib = static_cast<LwpFribDocVar*>(pFrib);
++ docFrib->XFConvert(m_pXFPara);
++ break;
++ }
++ case FRIB_TAG_RUBYMARKER:
++ {
++ LwpFribRubyMarker* rubyFrib = static_cast<LwpFribRubyMarker*>(pFrib);
++ rubyFrib->XFConvert(m_pXFPara);
++ break;
++ }
++ case FRIB_TAG_RUBYFRAME:
++ {
++ LwpFribRubyFrame* rubyfrmeFrib = static_cast<LwpFribRubyFrame*>(pFrib);
++ rubyfrmeFrib->XFConvert(m_pXFPara);
++ break;
++ }
++ default :
++ break;
++ }
++
++ if (bRevisionFlag )//&& pFrib->GetRevisionType() == LwpFrib::REV_INSERT)
++ {
++ if (nFribType!= FRIB_TAG_TABLE && nFribType != FRIB_TAG_FIELD
++ && nFribType != FRIB_TAG_FRAME)
++ {
++ if (sChangeID.getLength())
++ {
++ XFChangeEnd* pChangeEnd = new XFChangeEnd;
++ pChangeEnd->SetChangeID(sChangeID);
++ m_pXFPara->Add(pChangeEnd);
++ }
++ }
++ }
++ pFrib = pFrib->GetNext();
++ }
++
++}
++
++void LwpFribPtr::FindLayouts()
++{
++ LwpFrib* pFrib = m_pFribs;
++ while(pFrib)
++ {
++ switch(pFrib->GetType())
++ {
++ case FRIB_TAG_SECTION:
++ {
++ LwpFribSection* pSectionFrib = static_cast<LwpFribSection*>(pFrib);
++ LwpSection* pSection = pSectionFrib->GetSection();
++ if(pSection)
++ {
++ LwpPageLayout* pLayout = pSection->GetPageLayout();
++ if(pLayout)
++ {
++ LwpLayout::UseWhenType eSectionType = pLayout->GetUseWhenType();
++ if(eSectionType==LwpLayout::StartWithinColume)
++ {
++ //StartWithinColume type not support now
++ break;
++ }
++ LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj());
++ pStory->AddPageLayout(pSection->GetPageLayout());
++ }
++ }
++
++ break;
++ }
++ case FRIB_TAG_PAGEBREAK:
++ {
++ LwpFribPageBreak* pPageBreak = static_cast<LwpFribPageBreak*>(pFrib);
++ LwpPageLayout* pLayout = static_cast<LwpPageLayout*>(pPageBreak->GetLayout()->obj());
++ if(pLayout)
++ {
++ LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj());
++ pStory->AddPageLayout(pLayout);
++ }
++ break;
++ }
++ default:
++ break;
++ }
++ pFrib = pFrib->GetNext();
++ }
++}
++/**************************************************************************
++ * @descr: Whether has a frib which type is nType
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++LwpFrib* LwpFribPtr::HasFrib(sal_uInt8 nType)
++{
++ LwpFrib* pFrib = m_pFribs;
++ while(pFrib)
++ {
++ if(pFrib->GetType()==nType)
++ {
++ return pFrib;
++ }
++ pFrib = pFrib->GetNext();
++ }
++ return NULL;
++}
++
++void LwpFribPtr::GatherAllText()
++{
++ LwpFrib* pFrib = m_pFribs;
++ while(pFrib)
++ {
++ switch(pFrib->GetType())
++ {
++ case FRIB_TAG_TEXT:
++ {
++ OUString sText = static_cast<LwpFribText*>(pFrib)->GetText();
++ m_pPara->SetAllText(sText);
++ break;
++ }
++ case FRIB_TAG_UNICODE: //fall through
++ case FRIB_TAG_UNICODE2: //fall through
++ case FRIB_TAG_UNICODE3: //fall through :
++ {
++ OUString sText = static_cast<LwpFribText*>(pFrib)->GetText();
++ m_pPara->SetAllText(sText);
++ break;
++ }
++ default :
++ break;
++ }
++ pFrib = pFrib->GetNext();
++ }
++}
++
++void LwpFribPtr::RegisterStyle()
++{
++ LwpFrib* pFrib = m_pFribs;
++ while(pFrib)
++ {
++ switch(pFrib->GetType())
++ {
++ case FRIB_TAG_TEXT:
++ {
++ pFrib->RegisterStyle(m_pPara->GetFoundry());
++ OUString sText = static_cast<LwpFribText*>(pFrib)->GetText();
++ ProcessDropcap(m_pPara->GetStory(), pFrib,sText.getLength());
++ break;
++ }
++ case FRIB_TAG_TAB:
++ pFrib->RegisterStyle(m_pPara->GetFoundry());
++ break;
++ case FRIB_TAG_SECTION:
++ {
++ //section registerstyle here;
++ LwpFribSection* pSectionFrib = static_cast<LwpFribSection*>(pFrib);
++ pSectionFrib->RegisterSectionStyle();
++ //for bullet
++ pSectionFrib->SetSectionName();
++ }
++ break;
++ case FRIB_TAG_PAGEBREAK:
++ {
++ LwpFribPageBreak* breakFrib = static_cast<LwpFribPageBreak*>(pFrib);
++ breakFrib->RegisterBreakStyle(m_pPara);
++ }
++ break;
++ case FRIB_TAG_COLBREAK:
++ {
++ LwpFribColumnBreak* breakFrib = static_cast<LwpFribColumnBreak*>(pFrib);
++ breakFrib->RegisterBreakStyle(m_pPara);
++ }
++ break;
++ case FRIB_TAG_UNICODE: //fall through
++ case FRIB_TAG_UNICODE2: //fall through
++ case FRIB_TAG_UNICODE3: //fall through :
++ {
++ pFrib->RegisterStyle(m_pPara->GetFoundry());
++ OUString sText = static_cast<LwpFribUnicode*>(pFrib)->GetText();
++ ProcessDropcap(m_pPara->GetStory(), pFrib,sText.getLength());
++ break;
++ }
++ case FRIB_TAG_HARDSPACE:
++ pFrib->RegisterStyle(m_pPara->GetFoundry());
++ ProcessDropcap(m_pPara->GetStory(),pFrib,1);
++ break;
++ case FRIB_TAG_SOFTHYPHEN:
++ pFrib->RegisterStyle(m_pPara->GetFoundry());
++ break;
++ case FRIB_TAG_FRAME:
++ {
++ LwpFribFrame* frameFrib = static_cast<LwpFribFrame*>(pFrib);
++ frameFrib->SetParaDropcap(m_pPara);
++ frameFrib->RegisterStyle(m_pPara->GetFoundry());
++ //register framelayout style, ,03/09/2005
++ //frameFrib->GetLayout()->RegisterStyle();
++ }
++ break;
++ case FRIB_TAG_CHBLOCK:
++ break;
++ case FRIB_TAG_TABLE:
++ {
++ LwpFribTable* tableFrib = static_cast<LwpFribTable*>(pFrib);
++ tableFrib->RegisterStyle();
++ }
++ break;
++ case FRIB_TAG_FOOTNOTE:
++ {
++ LwpFribFootnote* pFribFootnote = static_cast<LwpFribFootnote*>(pFrib);
++ pFribFootnote->RegisterStyle();
++ }
++ break;
++ case FRIB_TAG_NOTE:
++ {
++ LwpFribNote* pNoteFrib = static_cast<LwpFribNote*>(pFrib);
++ pNoteFrib->RegisterStyle();
++ break;
++ }
++ case FRIB_TAG_PAGENUMBER:
++ {
++ pFrib->RegisterStyle(m_pPara->GetFoundry());
++ break;
++ }
++ case FRIB_TAG_DOCVAR:
++ {
++ LwpFribDocVar* docFrib = static_cast<LwpFribDocVar*>(pFrib);
++ docFrib->RegisterStyle(m_pPara->GetFoundry());
++ break;
++ }
++ case FRIB_TAG_FIELD:
++ {
++ LwpFribField* fieldFrib = static_cast<LwpFribField*>(pFrib);
++ fieldFrib->RegisterStyle(m_pPara->GetFoundry());
++ break;
++ }
++ case FRIB_TAG_BOOKMARK:
++ {
++ LwpFribBookMark* bookmarkFrib = static_cast<LwpFribBookMark*>(pFrib);
++ bookmarkFrib->RegisterStyle(m_pPara->GetFoundry());
++ break;
++ }
++ case FRIB_TAG_RUBYFRAME:
++ {
++ LwpFribRubyFrame* rubyfrmeFrib = static_cast<LwpFribRubyFrame*>(pFrib);
++ rubyfrmeFrib->RegisterStyle(m_pPara->GetFoundry());
++ break;
++ }
++ default :
++ break;
++ }
++ if (pFrib->GetRevisionFlag() && pFrib->GetType()!= FRIB_TAG_FIELD)
++ {
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ LwpChangeMgr* pChangeMgr = pGlobal->GetLwpChangeMgr();
++ pChangeMgr->AddChangeFrib(pFrib);
++ }
++
++ pFrib = pFrib->GetNext();
++ }
++}
++
++void LwpFribPtr::ProcessDropcap(LwpStory* pStory,LwpFrib* pFrib,sal_uInt32 nLen)
++{
++ if (pStory)
++ {
++ if (pStory->GetDropcapFlag() == sal_True)
++ {
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ XFTextStyle* pFribStyle = pXFStyleManager->FindTextStyle(pFrib->GetStyleName());
++ pFribStyle->GetFont()->SetFontSize(0);
++
++ LwpObject* pObj= pStory->GetLayoutsWithMe()->GetOnlyLayout()->obj();
++ if (pObj)
++ static_cast<LwpDropcapLayout*>(pObj)->SetChars(nLen);
++ }
++ }
++}
++/**
++ * @descr: If the position of pPreLayout is earlier than pNextLayout, return true, or return false, defalut return true
++ *
++*/
++sal_Bool LwpFribPtr::ComparePagePosition(LwpVirtualLayout* pPreLayout, LwpVirtualLayout* pNextLayout)
++{
++ if(!pPreLayout || !pNextLayout)
++ return sal_True;
++
++ LwpFrib* pFrib = m_pFribs;
++ LwpVirtualLayout* pLayout = NULL;
++ while(pFrib)
++ {
++ switch(pFrib->GetType())
++ {
++ case FRIB_TAG_SECTION:
++ {
++ LwpFribSection* pSectionFrib = static_cast<LwpFribSection*>(pFrib);
++ LwpSection* pSection = pSectionFrib->GetSection();
++ if(pSection)
++ {
++ pLayout = pSection->GetPageLayout();
++ }
++
++ break;
++ }
++ case FRIB_TAG_PAGEBREAK:
++ {
++ LwpFribPageBreak* pPageBreak = static_cast<LwpFribPageBreak*>(pFrib);
++ pLayout = static_cast<LwpVirtualLayout*>(pPageBreak->GetLayout()->obj());
++ break;
++ }
++ default:
++ break;
++ }
++
++ if(pLayout)
++ {
++ if(pPreLayout == pLayout)
++ return sal_True;
++ if(pNextLayout == pLayout)
++ return sal_False;
++ }
++ pFrib = pFrib->GetNext();
++ }
++
++ return sal_True;
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpfribptr.hxx lotuswordpro/source/filter/lwpfribptr.hxx
+--- lotuswordpro.bak/source/filter/lwpfribptr.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfribptr.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,100 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPFRIBPTR_HXX_
++#define _LWPFRIBPTR_HXX_
++
++#include "lwpobjstrm.hxx"
++#include "lwpfrib.hxx"
++#include "lwpstory.hxx"
++#include "xfilter/xfparagraph.hxx"
++
++class LwpPara;
++class LwpFribPtr
++{
++public:
++ LwpFribPtr();
++ ~LwpFribPtr();
++ void ReadPara(LwpObjectStream* pObjStrm);
++private:
++// void ReadModifiers(LwpObjectStream* pObjStrm,ModifierInfo* pModInfo);
++ LwpFrib* m_pFribs;
++ XFParagraph* m_pXFPara;//for parse ,add by 1-17 //Current XFPara used for frib parsing
++ LwpPara* m_pPara;//for get foundry, add by 1-17
++ void ProcessDropcap(LwpStory* pStory,LwpFrib* pFrib,sal_uInt32 nLen);
++public:
++// String GetText();
++ void XFConvert();
++ void SetXFPara(XFParagraph* Para){m_pXFPara = Para;};
++ XFParagraph* GetXFPara(){return m_pXFPara;};
++ void SetPara(LwpPara* para){m_pPara=para;};
++ LwpPara* GetPara(){return m_pPara;};
++ void RegisterStyle();
++ void FindLayouts();// for register pagelayout, add by , 02/20/2005
++ LwpFrib* GetFribs(){return m_pFribs;}
++ LwpFrib* HasFrib(sal_uInt8 nType);
++ sal_Bool ComparePagePosition(LwpVirtualLayout* pPreLayout, LwpVirtualLayout* pNextLayout);
++ void GatherAllText();
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpfribsection.cxx lotuswordpro/source/filter/lwpfribsection.cxx
+--- lotuswordpro.bak/source/filter/lwpfribsection.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfribsection.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,470 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * the class for section frib and process section and page layout
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++Jan 2005 Created
++ ************************************************************************/
++#include "lwpfribsection.hxx"
++#include "lwpfribbreaks.hxx"
++#include "lwpstory.hxx"
++#include "lwpsection.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xfsectionstyle.hxx"
++#include "xfilter/xfsection.hxx"
++#include "xfilter/xfindex.hxx"
++#include "lwpfribptr.hxx"
++#include "lwpglobalmgr.hxx"
++
++LwpFribSection::LwpFribSection(LwpPara *pPara)
++ : LwpFrib(pPara),m_pMasterPage(NULL)
++{
++
++}
++
++LwpFribSection::~LwpFribSection()
++{
++ if(m_pMasterPage)
++ {
++ delete m_pMasterPage;
++ m_pMasterPage = NULL;
++ }
++}
++
++/**
++ * @descr: Read section frib information
++ *
++ */
++void LwpFribSection::Read(LwpObjectStream *pObjStrm, sal_uInt16 len)
++{
++ m_Section.ReadIndexed(pObjStrm);
++}
++
++/**
++ * @descr: Get section pointer
++ *
++ */
++LwpSection* LwpFribSection::GetSection()
++{
++ return static_cast<LwpSection*>(m_Section.obj());
++}
++
++/**
++ * @descr: Register section style
++ *
++ */
++void LwpFribSection::RegisterSectionStyle()
++{
++ LwpPageLayout* pLayout = GetPageLayout();
++ if(pLayout)
++ {
++ m_pMasterPage = new LwpMasterPage(m_pPara, pLayout);
++ m_pMasterPage->RegisterMasterPage(this);
++ }
++}
++
++/**
++ * @descr: Register section style
++ *
++ */
++void LwpFribSection::SetSectionName()
++{
++ LwpSection* pSection = GetSection();
++ if(pSection)
++ {
++ LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj());
++ pStory->SetSectionName(pSection->GetSectionName());
++ }
++}
++
++/**
++ * @descr: Get page layout that current section points
++ *
++ */
++LwpPageLayout* LwpFribSection::GetPageLayout()
++{
++ if(GetSection())
++ return GetSection()->GetPageLayout();
++ return NULL;
++}
++
++/**
++ * @descr: XFConvert section
++ *
++ */
++void LwpFribSection::ParseSection()
++{
++ LwpPageLayout* pLayout = GetPageLayout();
++ if(pLayout)
++ {
++ // StartWithinColume not support now
++ LwpLayout::UseWhenType eSectionType = pLayout->GetUseWhenType();
++ if(eSectionType==LwpLayout::StartWithinColume)
++ {
++ return;
++ }
++ if(m_pMasterPage)
++ {
++ m_pMasterPage->ParseSection(this);
++ }
++ }
++ else
++ {
++ LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID()->obj() );
++ if (m_Section.obj()->GetTag() == VO_INDEXSECTION)
++ {
++ sal_Bool bRunin = sal_False;
++ sal_Bool bSeparator = sal_False;
++ //create a new section and add it to container
++ XFIndex* pIndex = new XFIndex;
++ pIndex->SetIndexType(enumXFIndexAlphabetical);
++ /*
++ LwpIndexSection* pIndexSection = static_cast<LwpIndexSection*>(m_Section.obj());
++ if (pIndexSection->IsFormatRunin())
++ bRunin = sal_True;
++ if (pIndexSection->IsFormatSeparator())
++ bSeparator = sal_True;
++ pIndex->SetDefaultAlphaIndex(A2OUSTR(""),bRunin,bSeparator);
++ */
++ SetDefaultAlphaIndex(pIndex);
++
++ pStory->AddXFContent( pIndex );
++ m_pPara->SetXFContainer( pIndex );
++ }
++ else
++ {
++ XFContentContainer* pContent = pStory->GetXFContent();
++ m_pPara->SetXFContainer( pContent );
++ }
++ }
++}
++
++void LwpFribSection::SetDefaultAlphaIndex(XFIndex * pXFIndex)
++{
++ LwpFoundry* pFoundry = m_pPara->GetFoundry();
++ OUString styleName = pFoundry->FindActuralStyleName(A2OUSTR("Separator"));
++
++ LwpIndexSection* pIndexSection = static_cast<LwpIndexSection*>(m_Section.obj());
++ XFIndexTemplate * pTemplateSep = new XFIndexTemplate();
++ if (pIndexSection->IsFormatSeparator())
++ {
++ pXFIndex->SetSeparator(sal_True);
++ pTemplateSep->AddEntry(enumXFIndexTemplateText,A2OUSTR(""));
++ }
++ //pXFIndex->AddTemplate(A2OUSTR("separator"),A2OUSTR("Separator"),pTemplateSep);
++ pXFIndex->AddTemplate(A2OUSTR("separator"),styleName,pTemplateSep);
++
++
++ styleName = pFoundry->FindActuralStyleName(A2OUSTR("Primary"));
++
++ XFIndexTemplate * pTemplate1 = new XFIndexTemplate();
++ pTemplate1->AddEntry(enumXFIndexTemplateText,A2OUSTR(""));
++ pTemplate1->AddEntry(enumXFIndexTemplateTab,A2OUSTR(""));
++ pTemplate1->AddEntry(enumXFIndexTemplatePage,A2OUSTR(""));
++ //pXFIndex->AddTemplate(Int32ToOUString(1),A2OUSTR("Primary"),pTemplate1);
++ pXFIndex->AddTemplate(Int32ToOUString(1),styleName,pTemplate1);
++
++ XFIndexTemplate * pTemplate2 = new XFIndexTemplate();
++ pTemplate2->AddEntry(enumXFIndexTemplateText,A2OUSTR(""));
++ pTemplate2->AddEntry(enumXFIndexTemplateTab,A2OUSTR(""));
++ pTemplate2->AddEntry(enumXFIndexTemplatePage,A2OUSTR(""));
++ XFIndexTemplate * pTemplate3 = new XFIndexTemplate();
++ pTemplate3->AddEntry(enumXFIndexTemplateText,A2OUSTR(""));
++ pTemplate3->AddEntry(enumXFIndexTemplateTab,A2OUSTR(""));
++ pTemplate3->AddEntry(enumXFIndexTemplatePage,A2OUSTR(""));
++
++ if (pIndexSection->IsFormatRunin())
++ {
++ //pXFIndex->AddTemplate(Int32ToOUString(2),A2OUSTR("Primary"),pTemplate2);
++ //pXFIndex->AddTemplate(Int32ToOUString(3),A2OUSTR("Primary"),pTemplate3);
++ pXFIndex->AddTemplate(Int32ToOUString(2),styleName,pTemplate2);
++ pXFIndex->AddTemplate(Int32ToOUString(3),styleName,pTemplate3);
++ }
++ else
++ {
++ //pXFIndex->AddTemplate(Int32ToOUString(2),A2OUSTR("Secondary"),pTemplate2);
++ //pXFIndex->AddTemplate(Int32ToOUString(3),A2OUSTR("Secondary"),pTemplate3);
++ styleName = pFoundry->FindActuralStyleName(A2OUSTR("Secondary"));
++ pXFIndex->AddTemplate(Int32ToOUString(2),styleName,pTemplate2);
++ pXFIndex->AddTemplate(Int32ToOUString(3),styleName,pTemplate3);
++ }
++}
++
++
++LwpMasterPage::LwpMasterPage(LwpPara* pPara, LwpPageLayout* pLayout)
++ :m_pPara(pPara),m_pLayout(pLayout),m_bNewSection(sal_False)
++{
++}
++
++/**
++ * @descr: Register master page style for para style and register section style if necessary
++ *
++ */
++sal_Bool LwpMasterPage::RegisterMasterPage(LwpFrib* pFrib)
++{
++ //if there is no other frib after current firb, register master page in starting para of next page
++ if(IsNextPageType()&&(!pFrib->HasNextFrib()))
++ {
++ LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj());
++ pStory->SetCurrentLayout(m_pLayout);
++ RegisterFillerPageStyle();
++ return sal_False;
++ }
++
++ m_bNewSection = sal_False;
++ //sal_Bool bSectionColumns = sal_False;
++
++ XFParaStyle* pOverStyle = new XFParaStyle;
++ *pOverStyle = *(m_pPara->GetXFParaStyle());
++ pOverStyle->SetStyleName(A2OUSTR(""));
++
++ LwpLayout::UseWhenType eUserType = m_pLayout->GetUseWhenType();
++ switch(eUserType)
++ {
++ case LwpLayout::StartWithinColume://not support now
++ {
++ m_bNewSection = sal_False;
++ break;
++ }
++ case LwpLayout::StartWithinPage:
++ {
++ m_bNewSection = sal_True;
++ //bSectionColumns = sal_True;
++ break;
++ }
++ case LwpLayout::StartOnNextPage: //fall throught
++ case LwpLayout::StartOnOddPage: //fall throught
++ case LwpLayout::StartOnEvenPage:
++ {
++ LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj());
++ pStory->SetCurrentLayout(m_pLayout);
++ //get odd page layout when the current pagelayout is mirror
++ m_pLayout = pStory->GetCurrentLayout();
++ m_bNewSection = IsNeedSection();
++ //bSectionColumns = m_bNewSection;
++ pOverStyle->SetMasterPage( m_pLayout->GetStyleName());
++ RegisterFillerPageStyle();
++ break;
++ }
++ default:
++ break;
++ }
++
++ //register tab style;
++ LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj());
++ pStory->SetTabLayout(m_pLayout);
++ m_pPara->RegisterTabStyle(pOverStyle);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_StyleName = pXFStyleManager->AddStyle(pOverStyle)->GetStyleName();
++ //register section style here
++ if(m_bNewSection)
++ {
++ XFSectionStyle* pSectStyle= new XFSectionStyle();
++ //set margin
++ LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj());
++ if(pStory)
++ {
++ LwpPageLayout* pCurrentLayout = pStory->GetCurrentLayout();
++ double fLeft = m_pLayout->GetMarginsValue(MARGIN_LEFT)- pCurrentLayout->GetMarginsValue(MARGIN_LEFT);
++ double fRight = m_pLayout->GetMarginsValue(MARGIN_RIGHT)- pCurrentLayout->GetMarginsValue(MARGIN_RIGHT);
++ pSectStyle->SetMarginLeft(fLeft);
++ pSectStyle->SetMarginRight(fRight);
++ }
++
++ //if(bSectionColumns)
++ //{
++ //set columns
++ XFColumns* pColumns = m_pLayout->GetXFColumns();
++ if(pColumns)
++ {
++ pSectStyle->SetColumns(pColumns);
++ }
++ //}
++ m_SectionStyleName = pXFStyleManager->AddStyle(pSectStyle)->GetStyleName();
++ }
++ return sal_False;
++}
++
++/**
++ * @descr: Whether it need create a new section
++ *
++ */
++sal_Bool LwpMasterPage::IsNeedSection()
++{
++ sal_Bool bNewSection = sal_False;
++ //get story
++ LwpStory* pStory = static_cast<LwpStory*>(m_pPara->GetStoryID()->obj());
++ //if pagelayout is modified, register the pagelayout
++ if(pStory->IsPMModified())
++ {
++ bNewSection = pStory->IsNeedSection();
++ }
++ return bNewSection;
++}
++
++/**
++ * @descr: Create XFSection if necessary
++ *
++ */
++XFSection* LwpMasterPage::CreateXFSection()
++{
++ if(m_bNewSection)
++ {
++ //new a section
++ XFSection* pXFSection = new XFSection();
++ pXFSection->SetStyleName(m_SectionStyleName);
++ return pXFSection;
++ }
++ return NULL;
++}
++
++/**
++ * @descr: Parse section
++ *
++ */
++void LwpMasterPage::ParseSection(LwpFrib* pFrib)
++{
++ LwpFribPtr* pFribPtr = m_pPara->GetFribs();
++ //XFParagraph * pXFPara = pFribPtr->GetXFPara();
++
++ //parse fillerpage text
++ if(m_pLayout->HasFillerPageText(m_pPara->GetFoundry()))
++ {
++ XFParagraph *pPara = new XFParagraph();
++ pPara->SetStyleName(GetFillerPageStyleName());
++ m_pPara->AddXFContent(pPara);
++ pFribPtr->SetXFPara(pPara);
++
++ m_pLayout->ConvertFillerPageText(m_pPara->GetXFContainer());
++ }
++ //create a new section and add it to container
++ XFContentContainer* pContent = CreateXFSection();
++ if(pContent)
++ {
++ LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID()->obj() );
++ //delete the additional blank para, 06/28/2005
++ XFParagraph* pCurrPara = pFribPtr->GetXFPara();
++ if(!pCurrPara->HasContents())
++ {
++ XFContentContainer* pCurrContainer = m_pPara->GetXFContainer();
++ if(pFrib->HasNextFrib() && (pCurrContainer->GetLastContent() == pCurrPara))
++ {
++ pCurrContainer->RemoveLastContent();
++ }
++ }
++ //end,06/28/2005
++ pStory->AddXFContent( pContent );
++ }
++ else
++ {
++ LwpStory* pStory = static_cast<LwpStory*> ( m_pPara->GetStoryID()->obj() );
++ pContent = pStory->GetXFContent();
++ }
++ if(pContent)
++ {
++ m_pPara->SetXFContainer( pContent );
++ }
++ //out put the contents after the section frib in the same para.
++ if(pFrib->HasNextFrib())
++ {
++ XFParagraph *pNextPara = new XFParagraph();
++ pNextPara->SetStyleName(GetStyleName());
++ m_pPara->AddXFContent(pNextPara);
++ pFribPtr->SetXFPara(pNextPara);
++ }
++
++}
++
++/**
++ * @descr: Register filler page text style
++ *
++ */
++void LwpMasterPage::RegisterFillerPageStyle()
++{
++ LwpLayout::UseWhenType eUserType = m_pLayout->GetUseWhenType();
++ if(eUserType==LwpLayout::StartOnOddPage
++ ||eUserType==LwpLayout::StartOnEvenPage)
++ {
++ if(m_pLayout->HasFillerPageText(m_pPara->GetFoundry()))
++ {
++ XFParaStyle* pPagebreakStyle = new XFParaStyle;
++ *pPagebreakStyle = *(m_pPara->GetXFParaStyle());
++ pPagebreakStyle->SetStyleName(A2OUSTR(""));
++ pPagebreakStyle->SetBreaks(enumXFBreakAftPage);
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_FillerPageStyleName= pXFStyleManager->AddStyle(pPagebreakStyle)->GetStyleName();
++ }
++ }
++}
++
++/**
++ * @descr: Whether the layout is next page type
++ *
++ */
++sal_Bool LwpMasterPage::IsNextPageType()
++{
++ LwpLayout::UseWhenType eUserType = m_pLayout->GetUseWhenType();
++ if(eUserType == LwpLayout::StartOnNextPage
++ || eUserType == LwpLayout::StartOnOddPage
++ || eUserType == LwpLayout::StartOnEvenPage )
++ {
++ return sal_True;
++ }
++ return sal_False;
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpfribsection.hxx lotuswordpro/source/filter/lwpfribsection.hxx
+--- lotuswordpro.bak/source/filter/lwpfribsection.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfribsection.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,131 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * the class for section frib and process section and page layout
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++Jan 2005 Created
++ ************************************************************************/
++#ifndef _LWPFRIBSECTION_HXX_
++#define _LWPFRIBSECTION_HXX_
++#include "lwpfrib.hxx"
++#include "lwppara.hxx"
++
++/**
++ * @brief Process page layout for inserting pagelayout or section
++ *
++ */
++class LwpMasterPage
++{
++public:
++ LwpMasterPage(LwpPara* pPara, LwpPageLayout* pLayout);
++ ~LwpMasterPage(){};
++
++public:
++ //for page layout register and parse
++ sal_Bool RegisterMasterPage(LwpFrib* pFrib);
++ void RegisterFillerPageStyle();
++ void ParseSection(LwpFrib* pFrib);
++ XFSection* CreateXFSection();
++
++ sal_Bool IsNewSection(){return m_bNewSection;}
++ OUString GetSectionStyleName(){return m_SectionStyleName;}
++ OUString GetStyleName(){ return m_StyleName;}
++ OUString GetFillerPageStyleName(){ return m_FillerPageStyleName;}
++ sal_Bool IsNextPageType();
++
++private:
++ sal_Bool IsNeedSection();
++
++private:
++ sal_Bool m_bNewSection;
++ OUString m_FillerPageStyleName;
++ OUString m_SectionStyleName;
++ OUString m_StyleName; //master page style name
++
++ LwpPara* m_pPara;
++ LwpPageLayout* m_pLayout;
++};
++
++/**
++ * @brief FRIB_TAB_SECTION object
++ *
++ */
++class LwpSection;
++class XFIndex;
++class LwpFribSection: public LwpFrib
++{
++public:
++ LwpFribSection(LwpPara* pPara );
++ ~LwpFribSection();
++ void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++ LwpSection * GetSection();
++ void RegisterSectionStyle();
++ //Modified by Helen for XFConvert refactor
++ void ParseSection();
++ //End of modification
++ void SetSectionName();
++
++ LwpPageLayout* GetPageLayout();
++private:
++ void SetDefaultAlphaIndex(XFIndex* pXFIndex);
++
++private:
++ LwpObjectID m_Section;
++ LwpMasterPage* m_pMasterPage;
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpfribtable.cxx lotuswordpro/source/filter/lwpfribtable.cxx
+--- lotuswordpro.bak/source/filter/lwpfribtable.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfribtable.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,173 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "lwpfribtable.hxx"
++#include "lwppara.hxx"
++#include "lwptablelayout.hxx"
++#include "lwpchangemgr.hxx"
++#include "lwpglobalmgr.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xfchange.hxx"
++/**
++ * @short: Read table frib
++ * @param:
++ * @param:
++ */
++
++void LwpFribTable::Read(LwpObjectStream* pObjStrm, sal_uInt16 len)
++{
++ m_objTable.ReadIndexed(pObjStrm);
++}
++
++LwpSuperTableLayout* LwpFribTable::GetSuperTable()
++{
++ return static_cast<LwpSuperTableLayout*>(m_objTable.obj());
++}
++
++void LwpFribTable::RegisterStyle()
++{
++ GetSuperTable()->RegisterStyle();
++ XFParaStyle* pOldStyle = m_pPara->GetXFParaStyle();
++ if(HasNextFrib())
++ {
++ if (pOldStyle->GetMasterPage().getLength() == 0)
++ m_StyleName = pOldStyle->GetStyleName();
++ else
++ {
++ XFParaStyle* pParaStyle = new XFParaStyle;
++ *pParaStyle = *(pOldStyle);
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_StyleName = pXFStyleManager->AddStyle(pParaStyle)->GetStyleName();
++ }
++ }
++}
++
++void LwpFribTable::Parse(IXFStream* pOutputStream)
++{
++ GetSuperTable()->Parse(pOutputStream);
++}
++
++void LwpFribTable::XFConvert(XFContentContainer* pCont)
++{
++ XFContentContainer* pXFContentContainer = pCont;
++ LwpSuperTableLayout* pSuper = GetSuperTable();
++ sal_uInt8 nType = pSuper->GetRelativeType();
++ LwpVirtualLayout* pContainer = pSuper->GetContainerLayout();
++ if (!pContainer)
++ return;
++ if ( LwpLayoutRelativityGuts::LAY_INLINE_NEWLINE == nType
++ && !pContainer->IsCell())
++ {
++ pXFContentContainer = m_pPara->GetXFContainer();
++ //delete the additional blank para, 06/28/2005
++ XFParagraph* pCurrPara = m_pPara->GetFribs()->GetXFPara();
++ if(!pCurrPara->HasContents())
++ {
++ if(pXFContentContainer->GetLastContent() == pCurrPara)
++ {
++ pXFContentContainer->RemoveLastContent();
++ }
++ }
++ //end,06/28/2005
++ }
++ else if( LwpLayoutRelativityGuts::LAY_PARA_RELATIVE == nType)
++ {
++ //same page as text and in frame
++ if(pContainer->IsFrame())
++ {
++ pXFContentContainer = m_pPara->GetXFContainer();
++ }
++ else if(pContainer->IsCell())
++ {
++ //same page as text and in cell, get the first xfpara
++ XFContentContainer* pXFFirtPara = static_cast<XFContentContainer*>(pCont->FindFirstContent(enumXFContentPara));
++ if(pXFFirtPara)
++ pXFContentContainer = pXFFirtPara;
++ }
++ }
++ OUString sChangeID;
++ if(m_bRevisionFlag)
++ {
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ LwpChangeMgr* pChangeMgr = pGlobal->GetLwpChangeMgr();
++ sChangeID = pChangeMgr->GetChangeID(this);
++ if (sChangeID.getLength())
++ {
++ XFChangeStart* pChangeStart = new XFChangeStart;
++ pChangeStart->SetChangeID(sChangeID);
++ pXFContentContainer->Add(pChangeStart);
++ }
++ }
++ pSuper->XFConvert(pXFContentContainer);
++
++ if(m_bRevisionFlag)
++ {
++ if (sChangeID.getLength())
++ {
++ XFChangeEnd* pChangeEnd = new XFChangeEnd;
++ pChangeEnd->SetChangeID(sChangeID);
++ pXFContentContainer->Add(pChangeEnd);
++ }
++ }
++
++ if(LwpLayoutRelativityGuts::LAY_INLINE_NEWLINE == nType
++ && HasNextFrib())
++ {
++ XFParagraph* pXFPara = new XFParagraph();
++ pXFPara->SetStyleName(m_StyleName);
++ m_pPara->AddXFContent(pXFPara);
++ m_pPara->GetFribs()->SetXFPara(pXFPara);
++ }
++
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpfribtable.hxx lotuswordpro/source/filter/lwpfribtable.hxx
+--- lotuswordpro.bak/source/filter/lwpfribtable.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfribtable.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,74 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _LWPFRIBTABLE_HXX_
++#define _LWPFRIBTABLE_HXX_
++
++#include "lwpfrib.hxx"
++
++class LwpSuperTableLayout;
++class LwpFribTable : public LwpFrib
++{
++public:
++ LwpFribTable( LwpPara* pPara ) : LwpFrib(pPara){};
++ ~LwpFribTable(){};
++ void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++ LwpSuperTableLayout* GetSuperTable();
++ void RegisterStyle();
++ void Parse(IXFStream* pOutputStream);
++ virtual void XFConvert(XFContentContainer* pCont);
++private:
++ LwpObjectID m_objTable;
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpfribtext.cxx lotuswordpro/source/filter/lwpfribtext.cxx
+--- lotuswordpro.bak/source/filter/lwpfribtext.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfribtext.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,496 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++#include "lwpglobalmgr.hxx"
++#include "lwpfribtext.hxx"
++#include "lwpcharsetmgr.hxx"
++#include "lwphyperlinkmgr.hxx"
++#include "lwptools.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xftextspan.hxx"
++#include "xfilter/xfbookmark.hxx"
++#include "xfilter/xfentry.hxx"
++#include "xfilter/xftextcontent.hxx"
++#include "xfilter/xfcrossref.hxx"
++#include "xfilter/xfpagenumber.hxx"
++#include "xfilter/xfdocfield.hxx"
++#include "xfilter/xfdatestyle.hxx"
++#include "xfilter/xftimestyle.hxx"
++#include "xfilter/xfdate.hxx"
++#include "xfilter/xfannotation.hxx"
++
++LwpFribText::LwpFribText( LwpPara *pPara, sal_Bool bNoUnicode )
++ : LwpFrib(pPara), m_bNoUnicode(bNoUnicode)
++{};
++
++void LwpFribText::Read(LwpObjectStream* pObjStrm, sal_uInt16 len)
++{
++ if( len>=1 )
++ {
++ rtl_TextEncoding rEncode;
++ if(m_bNoUnicode)
++ {
++ rEncode = RTL_TEXTENCODING_ISO_8859_1;
++ }
++ else
++ {
++ if (m_pModifiers && m_pModifiers->CodePage)
++ rEncode = LwpCharSetMgr::GetInstance()->
++ GetTextCharEncoding(m_pModifiers->CodePage);
++ else
++ rEncode = LwpCharSetMgr::GetInstance()->GetTextCharEncoding();
++ }
++ LwpTools::QuickReadUnicode(pObjStrm, m_Content, len, rEncode);
++ }
++}
++
++void LwpFribText::XFConvert(XFContentContainer* pXFPara,LwpStory* pStory)
++{
++ if (!pStory)
++ return;
++ LwpHyperlinkMgr* pHyperlink = pStory->GetHyperlinkMgr();
++ if (pHyperlink->GetHyperlinkFlag())
++ LwpFrib::ConvertHyperLink(pXFPara,pHyperlink,GetText());
++ else
++ LwpFrib::ConvertChars(pXFPara,GetText());
++}
++
++/**
++ * @short: Reading mothed of paranumber frib.
++ * @param: pObjStrm wordpro object stream.
++ * @param: len length of the frib
++ */
++void LwpFribParaNumber::Read(LwpObjectStream* pObjStrm, sal_uInt16 len)
++{
++ pObjStrm->QuickRead(&m_nStyleID, sizeof(m_nStyleID));
++ pObjStrm->QuickRead(&m_nNumberChar, sizeof(m_nNumberChar));
++ pObjStrm->QuickRead(&m_nLevel, sizeof(m_nLevel));
++ pObjStrm->QuickRead(&m_nStart, sizeof(m_nStart));
++}
++
++/**
++ * @short: default constructor of LwpFribDocVar
++ */
++LwpFribDocVar::LwpFribDocVar(LwpPara* pPara)
++ : LwpFrib(pPara), m_nType(0), m_pName(new LwpAtomHolder)
++{
++}
++/**
++ * @short: destructor of LwpFribDocVar
++ */
++LwpFribDocVar::~LwpFribDocVar()
++{
++ if (m_pName)
++ {
++ delete m_pName;
++ m_pName = NULL;
++ }
++}
++/**
++ * @short: Reading mothed of document variable frib.
++ * @param: pObjStrm wordpro object stream.
++ * @param: len length of the frib
++ */
++void LwpFribDocVar::Read(LwpObjectStream* pObjStrm, sal_uInt16 len)
++{
++ pObjStrm->QuickRead(&m_nType, sizeof(m_nType));
++ m_pName->Read(pObjStrm);
++}
++
++/**
++ * @short: register style for doc field (text style,date style)
++ * @param:
++ * @param:
++ */
++void LwpFribDocVar::RegisterStyle(LwpFoundry* pFoundry)
++{
++ LwpFrib::RegisterStyle(pFoundry);
++
++ switch(m_nType)
++ {
++ case DATECREATED:
++ case DATELASTREVISION:
++ {
++// m_TimeStyle = LwpTools::RegisterDefaultTimeStyle();
++ RegisterDefaultTimeStyle();
++ }
++ break;
++ case TOTALEDITTIME:
++ RegisterTotalTimeStyle();
++ break;
++ default:
++ break;
++ }
++}
++
++/**
++ * @short: register default time style for doc field
++ * @param:
++ * @param:
++ */
++void LwpFribDocVar::RegisterDefaultTimeStyle()
++{
++ XFDateStyle* pDateStyle = new XFDateStyle;//use the default format
++
++ pDateStyle->AddMonth();
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddMonthDay();
++ pDateStyle->AddText(A2OUSTR("/"));
++ pDateStyle->AddYear();
++ pDateStyle->AddText(A2OUSTR(","));
++ pDateStyle->AddHour();
++ pDateStyle->AddText(A2OUSTR(":"));
++ pDateStyle->AddMinute();
++ pDateStyle->AddText(A2OUSTR(":"));
++ pDateStyle->AddSecond(sal_True,0);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_TimeStyle = pXFStyleManager->AddStyle(pDateStyle)->GetStyleName();
++}
++void LwpFribDocVar::RegisterTotalTimeStyle()
++{
++ XFTimeStyle* pTimeStyle = new XFTimeStyle;//use the default format
++ pTimeStyle->SetTruncate(sal_False);
++ pTimeStyle->AddMinute();
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_TimeStyle = pXFStyleManager->AddStyle(pTimeStyle)->GetStyleName();
++}
++
++/**
++ * @short: convert the doc info field
++ * @param:
++ * @param:
++ */
++void LwpFribDocVar::XFConvert(XFContentContainer* pXFPara)
++{
++ XFContent* pContent=NULL;
++ switch(m_nType)
++ {
++ case FILENAME:
++ {
++ pContent = new XFFileName;
++ static_cast<XFFileName*>(pContent)->SetType(A2OUSTR("FileName"));
++ break;
++ }
++ case PATH:
++ {
++ pContent = new XFFileName;
++ static_cast<XFFileName*>(pContent)->SetType(A2OUSTR("Path"));
++ break;
++ }
++ case DESCRIPTION:
++ pContent = new XFDescription;
++ break;
++ case DATECREATED:
++ {
++ pContent = new XFCreateTime;
++ pContent->SetStyleName(m_TimeStyle);
++ break;
++ }
++ case DATELASTREVISION:
++ {
++ pContent = new XFLastEditTime;
++ pContent->SetStyleName(m_TimeStyle);
++ break;
++ }
++ case NUMPAGES:
++ pContent = new XFPageCount;
++ break;
++ case NUMWORDS:
++ pContent = new XFWordCount;
++ break;
++ case NUMCHARS:
++ pContent = new XFCharCount;
++ break;
++ case TOTALEDITTIME:
++ {
++ pContent = new XFTotalEditTime;
++ pContent->SetStyleName(m_TimeStyle);
++ break;
++ }
++ case KEYWORDS:
++ pContent = new XFKeywords;
++ break;
++ case CREATEDBY:
++ pContent = new XFInitialCreator;
++ break;
++ case DOCSIZE:
++ {
++/* pContent = new XFAnnotation;
++ XFTextContent* pSpan = new XFTextContent();
++ pSpan->SetText(A2OUSTR("Document Size is Here"));
++ XFParagraph* pPara = new XFParagraph;
++ pPara->Add(pSpan);
++ static_cast<XFAnnotation*>(pContent)->Add(pPara);
++ break;
++*/
++ OUString text = A2OUSTR("<Document Size>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ case SMARTMASTER:
++ {
++ OUString text = A2OUSTR("<Smart master>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ case DIVISIONNAME:
++ {
++ OUString text = A2OUSTR("<Division name>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ case SECTIONNAME:
++ {
++ OUString text = A2OUSTR("<Section name>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ case VERSIONCREATEBY:
++ {
++ OUString text = A2OUSTR("<Version Creat by>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ case VERSIONCREATEDATE:
++ {
++ OUString text = A2OUSTR("<Version Creat date>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ case VERSIONOTHEREDITORS:
++ {
++ OUString text = A2OUSTR("<Version other Editors>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ case VERSIONNAME:
++ {
++ OUString text = A2OUSTR("<Version Name>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ case VERSIONNUMBER:
++ {
++ OUString text = A2OUSTR("<Version Numbers>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ case ALLVERSIONNAME:
++ {
++ OUString text = A2OUSTR("<All Version Name>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ case VERSIONREMARK:
++ {
++ OUString text = A2OUSTR("<Version Remark>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ case DOCUMENTCATEGORY:
++ {
++ OUString text = A2OUSTR("<Document Category>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ case VERSIONLASTDATE:
++ {
++ OUString text = A2OUSTR("<Version Last Modify Date>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ case VERSIONLASTEDITOR:
++ {
++ OUString text = A2OUSTR("<Version Last Editor>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ case LASTEDIT:
++ {
++ OUString text = A2OUSTR("<Last Editor>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ case OTHEREDITORS:
++ {
++ OUString text = A2OUSTR("<Other Editors>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ case NUMOFREVISION:
++ {
++ OUString text = A2OUSTR("<Number of Revision>");
++ LwpFrib::ConvertChars(pXFPara,text);
++ return;
++ }
++ default:
++ return;
++ }
++ if (m_ModFlag)//(m_pModifiers)
++ {
++ XFTextSpan *pSpan = new XFTextSpan;
++ pSpan->SetStyleName(GetStyleName());
++ pSpan->Add(pContent);
++ pXFPara->Add(pSpan);
++ }
++ else
++ pXFPara->Add(pContent);
++
++}
++/**
++ * @short: Read unicode
++ * @param:
++ * @param:
++ */
++void LwpFribUnicode::Read(LwpObjectStream* pObjStrm, sal_uInt16 len)
++{
++ if(len>1)
++ {
++ rtl_TextEncoding rEncode;
++
++ if (m_pModifiers && m_pModifiers->CodePage)
++ rEncode = LwpCharSetMgr::GetInstance()->
++ GetTextCharEncoding(m_pModifiers->CodePage);
++ else
++ rEncode = LwpCharSetMgr::GetInstance()->GetTextCharEncoding();
++
++ LwpTools::QuickReadUnicode(pObjStrm, m_Content, len, rEncode);
++
++ }
++ else
++ pObjStrm->SeekRel(len);
++}
++
++void LwpFribUnicode::XFConvert(XFContentContainer* pXFPara,LwpStory* pStory)
++{
++ if (!pStory)
++ return;
++ LwpHyperlinkMgr* pHyperlink = pStory->GetHyperlinkMgr();
++ if (pHyperlink->GetHyperlinkFlag())
++ LwpFrib::ConvertHyperLink(pXFPara,pHyperlink,GetText());
++ else
++ LwpFrib::ConvertChars(pXFPara,GetText());
++}
++
++/**
++ * @short: Read page number
++ * @param:
++ * @param:
++ */
++void LwpFribPageNumber::Read(LwpObjectStream* pObjStrm, sal_uInt16 len)
++{
++ m_nNumStyle = pObjStrm->QuickReaduInt16();
++ m_aBefText.Read(pObjStrm);
++ m_aAfterText.Read(pObjStrm);
++ m_nStartNum = pObjStrm->QuickReaduInt16();
++ m_nStartOnPage = pObjStrm->QuickReaduInt16();
++ m_nFlag = pObjStrm->QuickReaduInt16();
++}
++
++void LwpFribPageNumber::XFConvert(XFContentContainer* pXFPara)
++{
++ if (m_nNumStyle == 0x0)
++ return;
++ XFPageNumber* pNum = new XFPageNumber;
++// pNum->SetSelect(A2OUSTR("current"));
++ switch(m_nNumStyle)
++ {
++ case 0x01:
++ pNum->SetNumFmt(A2OUSTR("1"));
++ break;
++ case 0x02:
++ pNum->SetNumFmt(A2OUSTR("A"));
++ break;
++ case 0x03:
++ pNum->SetNumFmt(A2OUSTR("a"));
++ break;
++ case 0x04:
++ pNum->SetNumFmt(A2OUSTR("I"));
++ break;
++ case 0x05:
++ pNum->SetNumFmt(A2OUSTR("i"));
++ break;
++ }
++ OUString styleName = GetStyleName();
++ if (m_aBefText.str().getLength()>0)
++ {
++ OUString textStr = m_aBefText.str();
++ XFTextSpan *pBef = new XFTextSpan(textStr,styleName);
++ pXFPara->Add(pBef);
++ }
++ if (m_ModFlag)//(m_pModifiers)
++ {
++ XFTextSpan *pSpan = new XFTextSpan;
++ pSpan->SetStyleName(styleName);
++ pSpan->Add(pNum);
++ pXFPara->Add(pSpan);
++ }
++ else
++ pXFPara->Add(pNum);
++ if (m_aAfterText.str().getLength()>0)
++ {
++ OUString textStr = m_aAfterText.str();
++ XFTextSpan *pAfter = new XFTextSpan(textStr,styleName);
++ pXFPara->Add(pAfter);
++ }
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpfribtext.hxx lotuswordpro/source/filter/lwpfribtext.hxx
+--- lotuswordpro.bak/source/filter/lwpfribtext.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpfribtext.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,230 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++#ifndef _LWPFRIBTEXT_HXX_
++#define _LWPFRIBTEXT_HXX_
++
++#include "lwpfrib.hxx"
++#include "lwpstory.hxx"
++class LwpFribText : public LwpFrib
++{
++public:
++ LwpFribText( LwpPara* pPara, sal_Bool bNoUnicode=false);
++ ~LwpFribText(){};
++ void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++ void XFConvert(XFContentContainer* pXFPara,LwpStory* pStory);
++private:
++ OUString m_Content;
++ sal_Bool m_bNoUnicode;
++public:
++ OUString GetText(){return m_Content;}
++};
++
++class LwpFribHardSpace : public LwpFrib
++{
++public:
++ LwpFribHardSpace( LwpPara* pPara ) : LwpFrib(pPara){};
++ ~LwpFribHardSpace(){};
++};
++
++class LwpFribSoftHyphen : public LwpFrib
++{
++public:
++ LwpFribSoftHyphen( LwpPara* pPara ) : LwpFrib(pPara){};
++ ~LwpFribSoftHyphen(){};
++};
++
++//add by , 02/03/2005
++class LwpFribParaNumber : public LwpFrib
++{
++public:
++ LwpFribParaNumber( LwpPara* pPara ) : LwpFrib(pPara),
++ m_nStyleID(0), m_nNumberChar(0), m_nLevel(1), m_nStart(0){};
++ void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++
++ inline sal_uInt16 GetStyleID() const;
++
++ inline sal_uInt16 GetNumberChar() const;
++
++ inline sal_uInt16 GetLevel() const;
++
++ inline sal_uInt16 GetStart() const;
++
++private:
++ sal_uInt16 m_nStyleID;
++ sal_uInt16 m_nNumberChar;
++ sal_uInt16 m_nLevel;
++ sal_uInt16 m_nStart;
++};
++inline sal_uInt16 LwpFribParaNumber::GetStyleID() const
++{
++ return m_nStyleID;
++}
++inline sal_uInt16 LwpFribParaNumber::GetNumberChar() const
++{
++ return m_nNumberChar;
++}
++inline sal_uInt16 LwpFribParaNumber::GetLevel() const
++{
++ return m_nLevel;
++}
++inline sal_uInt16 LwpFribParaNumber::GetStart() const
++{
++ return m_nStart;
++}
++
++class LwpFribDocVar : public LwpFrib
++{
++public:
++ LwpFribDocVar( LwpPara* pPara );
++
++ ~LwpFribDocVar();
++
++ void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++
++ void RegisterStyle(LwpFoundry* pFoundry);//add by ,05/5/27
++
++ void XFConvert(XFContentContainer* pXFPara);//add by ,05/5/27
++
++// inline sal_uInt16 GetType() const;
++
++ enum {
++ FILENAME = 0x02,
++ PATH = 0x03,
++ SMARTMASTER = 0x04,
++ DESCRIPTION = 0x05,
++ DATECREATED = 0x06,
++ DATELASTREVISION = 0x07,
++ TOTALEDITTIME = 0x08,
++ NUMPAGES= 0x09,
++ NUMWORDS= 0x0a,
++ NUMCHARS = 0x0b,
++ DOCSIZE = 0x0c,
++ DIVISIONNAME = 0x0d,
++ SECTIONNAME = 0x0e,
++ VERSIONCREATEBY = 0x0f,
++ VERSIONCREATEDATE = 0x10,
++ VERSIONOTHEREDITORS = 0x11,
++ VERSIONNAME = 0x12,
++ VERSIONNUMBER = 0x13,
++ ALLVERSIONNAME = 0x14,
++ VERSIONREMARK = 0x15,
++ DOCUMENTCATEGORY = 0x16,
++ VERSIONLASTDATE = 0x17,
++ VERSIONLASTEDITOR = 0x18,
++ KEYWORDS = 0x19,
++ CREATEDBY = 0x1a,
++ LASTEDIT = 0x1b,
++ OTHEREDITORS = 0x1c,
++ NUMOFREVISION = 0x1d,
++ };
++
++private:
++ sal_uInt16 m_nType;
++ LwpAtomHolder* m_pName;
++ OUString m_TimeStyle;
++ void RegisterDefaultTimeStyle();
++ void RegisterTotalTimeStyle();
++};
++//inline sal_uInt16 LwpFribDocVar::GetType() const
++//{
++// return m_nType;
++//}
++
++class LwpFribTab : public LwpFrib
++{
++public:
++ LwpFribTab( LwpPara* pPara ) : LwpFrib(pPara){};
++ ~LwpFribTab(){};
++};
++
++class LwpFribUnicode: public LwpFrib
++{
++public:
++ LwpFribUnicode( LwpPara* pPara ) : LwpFrib(pPara){};
++ ~LwpFribUnicode(){};
++ void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++ void XFConvert(XFContentContainer* pXFPara,LwpStory* pStory);
++private:
++ OUString m_Content;
++public:
++ OUString GetText(){return m_Content;}
++};
++
++class LwpFribPageNumber : public LwpFrib
++{
++public:
++ LwpFribPageNumber(LwpPara* pPara) : LwpFrib(pPara),
++ m_nNumStyle(0), m_nStartNum(1), m_nStartOnPage(1), m_nFlag(0){};
++ ~LwpFribPageNumber(){};
++ void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++ void XFConvert(XFContentContainer* pXFPara);
++private:
++ sal_uInt16 m_nNumStyle;
++ LwpAtomHolder m_aBefText;
++ LwpAtomHolder m_aAfterText;
++ sal_uInt16 m_nStartNum;
++ sal_uInt16 m_nStartOnPage;
++ sal_uInt16 m_nFlag;
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpglobalmgr.cxx lotuswordpro/source/filter/lwpglobalmgr.cxx
+--- lotuswordpro.bak/source/filter/lwpglobalmgr.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpglobalmgr.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,166 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "lwpglobalmgr.hxx"
++#ifndef _OSL_THREAD_H_
++#include <osl/thread.h>
++#endif
++std::map< sal_uInt32,LwpGlobalMgr* > LwpGlobalMgr::m_ThreadMap;
++LwpGlobalMgr::LwpGlobalMgr(LwpSvStream* pSvStream)
++{
++ if (pSvStream)
++ m_pObjFactory = new LwpObjectFactory(pSvStream);
++ else
++ m_pObjFactory = NULL;
++ m_pBookmarkMgr = new LwpBookmarkMgr;
++ m_pChangeMgr = new LwpChangeMgr;
++ m_pXFFontFactory = new XFFontFactory;
++ m_pXFStyleManager = new XFStyleManager;
++}
++
++LwpGlobalMgr::~LwpGlobalMgr()
++{
++ if (m_pObjFactory)
++ {
++ delete m_pObjFactory;
++ m_pObjFactory = NULL;
++ }
++ if (m_pBookmarkMgr)
++ {
++ delete m_pBookmarkMgr;
++ m_pBookmarkMgr = NULL;
++ }
++ if (m_pChangeMgr)
++ {
++ delete m_pChangeMgr;
++ m_pChangeMgr = NULL;
++ }
++ if (m_pXFFontFactory)
++ {
++ delete m_pXFFontFactory;
++ m_pXFFontFactory = NULL;
++ }
++ if (m_pXFStyleManager)
++ {
++ delete m_pXFStyleManager;
++ m_pXFStyleManager = NULL;
++ }
++ std::map<sal_uInt16,LwpEditorAttr*>::iterator iter;
++ for (iter =m_EditorAttrMap.begin();iter != m_EditorAttrMap.end(); iter++)
++ {
++ delete iter->second;
++ iter->second = NULL;
++ }
++ m_EditorAttrMap.clear();
++}
++
++LwpGlobalMgr* LwpGlobalMgr::GetInstance(LwpSvStream* pSvStream)
++{
++ sal_uInt32 nThreadID = osl_getThreadIdentifier((void*)0);
++ std::map< sal_uInt32,LwpGlobalMgr* >::iterator iter;
++ iter = m_ThreadMap.find(nThreadID);
++ if (iter == m_ThreadMap.end())
++ {
++ LwpGlobalMgr* pInstance = new LwpGlobalMgr(pSvStream);
++ m_ThreadMap[nThreadID] = pInstance;
++ return pInstance;
++ }
++ else
++ return iter->second;
++}
++
++void LwpGlobalMgr::DeleteInstance()
++{
++ sal_uInt32 nThreadID = osl_getThreadIdentifier((void*)0);
++ std::map< sal_uInt32,LwpGlobalMgr* >::iterator iter;
++ iter = m_ThreadMap.find(nThreadID);
++ if (iter != m_ThreadMap.end())
++ {
++ delete iter->second;
++ iter->second = NULL;
++ m_ThreadMap.erase(iter);
++ }
++}
++
++void LwpGlobalMgr::SetEditorAttrMap(sal_uInt16 nID, LwpEditorAttr* pAttr)
++{
++ m_EditorAttrMap[nID] = pAttr;
++}
++
++rtl::OUString LwpGlobalMgr::GetEditorName(sal_uInt8 nID)
++{
++ std::map<sal_uInt16,LwpEditorAttr*>::iterator iter;
++ iter = m_EditorAttrMap.find(nID);
++ if (iter != m_EditorAttrMap.end())
++ return iter->second->cName.str();
++ return A2OUSTR("");
++}
++
++XFColor LwpGlobalMgr::GetHighLightColor(sal_uInt8 nID)
++{
++ std::map<sal_uInt16,LwpEditorAttr*>::iterator iter;
++
++ iter = m_EditorAttrMap.find(nID);
++ if (iter != m_EditorAttrMap.end())
++ {
++ LwpColor aLwpColor = iter->second->cHiLiteColor;
++ XFColor aColor(aLwpColor.GetRed(),aLwpColor.GetGreen(),aLwpColor.GetBlue());
++ return aColor;
++ }
++ else
++ {
++ XFColor aColor(255,255,0);//yellow
++ return aColor;
++ }
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpglobalmgr.hxx lotuswordpro/source/filter/lwpglobalmgr.hxx
+--- lotuswordpro.bak/source/filter/lwpglobalmgr.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpglobalmgr.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,103 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Nov 2005 Created
++ ************************************************************************/
++#ifndef _LWPGLOBALMGR_HXX_
++#define _LWPGLOBALMGR_HXX_
++
++#include <map>
++#include "lwpheader.hxx"
++#include "lwpsvstream.hxx"
++#include "lwpobjfactory.hxx"
++#include "lwpbookmarkmgr.hxx"
++#include "lwpchangemgr.hxx"
++#include "xfilter/xffontfactory.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "lwpdocdata.hxx"
++#include "xfilter/xfcolor.hxx"
++
++class LwpGlobalMgr
++{
++public:
++ ~LwpGlobalMgr();
++ static LwpGlobalMgr* GetInstance(LwpSvStream* pSvStream=NULL);
++ static void DeleteInstance();
++ LwpObjectFactory* GetLwpObjFactory(){return m_pObjFactory;}
++ LwpBookmarkMgr* GetLwpBookmarkMgr(){return m_pBookmarkMgr;}
++ LwpChangeMgr* GetLwpChangeMgr(){return m_pChangeMgr;}
++ XFFontFactory* GetXFFontFactory(){return m_pXFFontFactory;}
++ XFStyleManager* GetXFStyleManager(){return m_pXFStyleManager;}
++ void SetEditorAttrMap(sal_uInt16 nID, LwpEditorAttr* pAttr);
++ OUString GetEditorName(sal_uInt8 nID);
++ XFColor GetHighLightColor(sal_uInt8 nID);
++private:
++ LwpGlobalMgr(LwpSvStream* pSvStream);
++private:
++ static std::map< sal_uInt32,LwpGlobalMgr* > m_ThreadMap;
++ LwpObjectFactory* m_pObjFactory;
++ LwpBookmarkMgr* m_pBookmarkMgr;
++ LwpChangeMgr* m_pChangeMgr;
++ XFFontFactory* m_pXFFontFactory;
++ XFStyleManager* m_pXFStyleManager;
++ std::map< sal_uInt16,LwpEditorAttr* > m_EditorAttrMap;
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpgrfobj.cxx lotuswordpro/source/filter/lwpgrfobj.cxx
+--- lotuswordpro.bak/source/filter/lwpgrfobj.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpgrfobj.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,843 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*****************************************************************************
++* Change History
++* 2005/2 draft code for chart
++****************************************************************************/
++
++/**
++ * @file
++ * For LWP filter architecture prototype
++*/
++#include <stdio.h>
++#include "lwp9reader.hxx"
++#include "lwpgrfobj.hxx"
++#include "lwpsdwfileloader.hxx"
++#include "bento.hxx"
++
++#include "lwpglobalmgr.hxx"
++#include "xfilter/xfframe.hxx"
++#include "xfilter/xfimage.hxx"
++#include "xfilter/xfimagestyle.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xfparagraph.hxx"
++#include "xfilter/xfannotation.hxx"
++
++//For chart
++#include "string.h"
++//#include "lwpchartstreamtools.hxx"
++
++#ifndef _OSL_THREAD_H_
++#include <osl/thread.h>
++#endif
++
++#define EF_NONE 0x0000
++#define EF_FTP 0x0001
++#define EF_ODMA 0x0002
++#define EF_NOS 0x0003
++
++LwpGraphicObject::LwpGraphicObject(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++:LwpGraphicOleObject(objHdr, pStrm),m_bCompressed(0),m_bIsLinked(0),m_nCachedBaseLine(0)
++{
++}
++LwpGraphicObject::~LwpGraphicObject()
++{
++ m_vXFDrawObjects.clear();
++}
++void LwpGraphicObject::Read()
++{
++ LwpGraphicOleObject::Read();
++ sal_uInt16 disksize = m_pObjStrm->QuickReaduInt16();
++ sal_uInt16 strsize = m_pObjStrm->QuickReaduInt16();
++ if (strsize<AFID_MAX_FILE_FORMAT_SIZE)
++ {
++ m_pObjStrm->QuickRead(m_sDataFormat,strsize);
++ m_sDataFormat[strsize] = '\0';
++ }
++/*
++ if (m_sDataFormat!=(unsigned char*)(".lch"))
++ {
++ return;
++ }
++*/
++ sal_uInt32 nServerContextSize = m_pObjStrm->QuickReaduInt32();
++ unsigned char *pServerContext = NULL;
++ if (nServerContextSize > 0)
++ {
++ pServerContext = new unsigned char[nServerContextSize];
++ m_pObjStrm->QuickRead(pServerContext, static_cast<sal_uInt16>(nServerContextSize));
++ // add by , 04/05/2005
++ if (nServerContextSize > 44)
++ {
++ m_aIPData.nBrightness = pServerContext[14];
++ m_aIPData.nContrast = pServerContext[19];
++ m_aIPData.nEdgeEnchancement = pServerContext[24];
++ m_aIPData.nSmoothing = pServerContext[29];
++ m_aIPData.bInvertImage = (sal_Bool)(pServerContext[34] == 0x01);
++ m_aIPData.bAutoContrast = (sal_Bool)(pServerContext[44] == 0x00);
++ }
++ // end add
++ }
++ disksize = m_pObjStrm->QuickReaduInt16();
++ strsize = m_pObjStrm->QuickReaduInt16();
++ if (strsize<AFID_MAX_FILE_FORMAT_SIZE)
++ {
++ m_pObjStrm->QuickRead(m_sServerContextFormat,strsize);
++ m_sServerContextFormat[strsize] = '\0';
++ }
++ if (nServerContextSize == 0)
++ {
++ if (strcmp((char *)m_sServerContextFormat, ".cht") == 0 &&
++ strcmp((char *)m_sDataFormat, ".sdw") == 0)
++ {
++ strcpy((char *)m_sServerContextFormat, ".lch");
++ strcpy((char *)m_sDataFormat, ".lch");
++ }
++ }
++ m_nCachedBaseLine = m_pObjStrm->QuickReadInt32();
++ m_bIsLinked = m_pObjStrm->QuickReadInt16();
++ //OUString pLinkedFilePath;
++ unsigned char * pFilterContext = NULL;
++ sal_uInt32 nFilterContextSize = 0;
++
++ if (m_bIsLinked)
++ {
++ m_LinkedFilePath = m_pObjStrm->QuickReadStringPtr();
++
++ nFilterContextSize = m_pObjStrm->QuickReaduInt32();
++ if (nFilterContextSize > 0)
++ {
++ pFilterContext = new unsigned char[nFilterContextSize];
++ m_pObjStrm->QuickRead(pFilterContext, static_cast<sal_uInt16>(nFilterContextSize));
++ }
++ if (LwpFileHeader::m_nFileRevision >= 0x000b)
++ {
++
++ // read external file object stuff
++ sal_uInt16 type = m_pObjStrm->QuickReaduInt16();
++// if (EF_ODMA == type)
++// ;
++ if ((EF_ODMA != type) && (EF_NONE != type)) // don't know about this
++ {
++ sal_uInt32 size = m_pObjStrm->QuickReaduInt32();
++ m_pObjStrm->SeekRel(static_cast<sal_uInt16>(size));
++ }
++ // else no external file object
++ }
++ }
++
++ if (LwpFileHeader::m_nFileRevision >= 0x000b)
++ {
++ m_bCompressed = m_pObjStrm->QuickReadInt16();
++ m_Cache.LinkedFileSize = m_pObjStrm->QuickReaduInt32();
++ m_Cache.LinkedFileTime = m_pObjStrm->QuickReaduInt32();
++ m_Cache.Width = m_pObjStrm->QuickReadInt32();
++ m_Cache.Height = m_pObjStrm->QuickReadInt32();
++ }
++
++ if(LwpFileHeader::m_nFileRevision >= 0x000c)
++ {
++ m_WatermarkName = m_pObjStrm->QuickReadStringPtr();
++ }
++
++ if (pServerContext != NULL)
++ delete[] pServerContext;
++
++ if (pFilterContext != NULL)
++ delete[] pFilterContext;
++
++}
++
++void LwpGraphicObject::XFConvert (XFContentContainer* pCont)
++{
++ if ((m_sServerContextFormat[1]=='s'&&m_sServerContextFormat[2]=='d'&&m_sServerContextFormat[3]=='w'))
++ {
++/* LwpSvStream* pStream = m_pStrm;
++ //test code
++ OpenStormBento::LtcBenContainer* pBentoContainer;
++ ULONG ulRet = OpenStormBento::BenOpenContainer(pStream, &pBentoContainer);
++ std::vector<SvStream*> vStream;
++ std::vector<SvStream*>::iterator iter;
++ pBentoContainer->CreateGraphicStreams(&vStream);
++ for (iter=vStream.begin();iter!=vStream.end();iter++)
++ {
++ LwpSdwFileLoader fileLoader(*iter,pOutputStream);
++ fileLoader.LoadObjectList();
++ delete *iter;
++ }
++ vStream.clear();*/
++
++ //XFParagraph* pPara = new XFParagraph();
++ std::vector <XFFrame*>::iterator iter;
++ for (iter = m_vXFDrawObjects.begin(); iter != m_vXFDrawObjects.end(); iter++)
++ {
++ //pPara->Add(*iter);
++ pCont->Add(*iter);
++ }
++
++ //pCont->Add(pPara);
++
++ }
++ else if (this->IsGrafFormatValid())
++ {
++ XFImage* pImage = static_cast<XFImage*>(m_vXFDrawObjects.front());
++
++ if (m_bIsLinked)
++ {
++ OUString fileURL = LwpTools::convertToFileUrl(OUStringToOString(m_LinkedFilePath, osl_getThreadTextEncoding()));
++ pImage->SetFileURL(fileURL);
++ }
++ else
++ {
++ sal_uInt8* pGrafData = NULL;
++ sal_uInt32 nDataLen = this->GetRawGrafData(pGrafData);
++
++ if (pGrafData)
++ {
++ pImage->SetImageData(pGrafData, nDataLen);
++
++ // delete used image data
++ delete [] pGrafData;
++ pGrafData = NULL;
++ }
++ }
++
++ pCont->Add(pImage);
++ }
++ else if((m_sServerContextFormat[1]=='t'&&m_sServerContextFormat[2]=='e'&&m_sServerContextFormat[3]=='x'))
++ {
++ XFConvertEquation(pCont);
++ }
++ if (m_sServerContextFormat[1]=='l'&&m_sServerContextFormat[2]=='c'&&m_sServerContextFormat[3]=='h')
++ {
++ LwpSvStream* pDocStream = m_pStrm;
++ //LwpChartStreamTools::ParseChart(pDocStream, GetObjectID(),
++ // GetRectIn100thMM(), GetRectInCM(), pOutputStream);
++ //LwpChartStreamTools::ParseChart(pDocStream, GetObjectID(),
++ // GetRectIn100thMM(), GetRectInCM(), pCont, m_strStyleName);
++ }
++}
++
++/**
++* @short Get the rectangle of a chart in 100thMM
++* @descr
++* @return the rectangle of the chart
++*/
++Rectangle LwpGraphicObject::GetRectIn100thMM()
++{
++#define To100thMM(num) (long)(2540* (double(num)/(72 * 65536L)))
++ INT32 nLeft,nTop,nRight,nBottom;
++ GetRect(nLeft,nTop,nRight,nBottom);
++ return Rectangle( To100thMM(nLeft),To100thMM(nTop),To100thMM(nRight),To100thMM(nBottom) );
++}
++
++/**
++* @short Get the rectangle of a chart in CM
++* @descr
++* @return The rectangle of the chart
++*/
++XFRect LwpGraphicObject::GetRectInCM()
++{
++#define ToCM(num) (2.54*(double(num)/(72 * 65536L)))
++ INT32 nLeft,nTop,nRight,nBottom;
++ GetRect(nLeft,nTop,nRight,nBottom);
++ return XFRect( ToCM(nLeft),ToCM(nTop),ToCM(nRight-nLeft),ToCM(nBottom-nTop) );
++}
++
++/**
++* @short Get the rectangle of a chart
++* @descr
++* @param nLeft
++* @param nTop
++* @param nRight
++* @param nBottom
++*/
++#include "lwpframelayout.hxx"
++void LwpGraphicObject::GetRect(INT32& nLeft, INT32& nTop, INT32& nRight, INT32& nBottom)
++{
++ nLeft = nTop = nRight = nBottom = 0;
++
++ LwpObjectID* pObjID = GetLayoutsWithMe()->GetOnlyLayout();
++ if (pObjID)
++ {
++ LwpFrameLayout* pLayout = (LwpFrameLayout*)pObjID->obj();
++ if (pLayout)
++ {
++ LwpLayoutGeometry* pGeometry =(LwpLayoutGeometry*) pLayout->GetGeometry();
++
++ if (pGeometry)
++ {
++ LwpPoint aOrigin = pGeometry->GetOrigin();
++// 2005.6
++//frame width/height are not width/height of a chart
++// sal_Int32 nWidth = pGeometry->GetWidth();
++// sal_Int32 nHeight = pGeometry->GetHeight();
++ double fWidth =0;
++ double fHeight = 0;
++ GetGrafScaledSize(fWidth, fHeight);
++
++ sal_Int32 nWidth = fWidth * UNITS_PER_INCH /CM_PER_INCH;
++ sal_Int32 nHeight = fHeight * UNITS_PER_INCH /CM_PER_INCH;
++//end
++ nLeft = pLayout->GetMarginsValue(MARGIN_LEFT) * UNITS_PER_INCH /CM_PER_INCH;
++ nTop = pLayout->GetMarginsValue(MARGIN_TOP)* UNITS_PER_INCH /CM_PER_INCH;
++ nRight = nLeft+nWidth;
++ nBottom = nTop+nHeight;
++ }
++ }
++ }
++}
++
++/**
++ * @descr judge if the graphic format is what we can support: bmp, jpg, wmf, gif, tgf(tif). other format will be filtered to
++ * these formats by Word Pro.
++ * @return sal_True if yes sal_False if not.
++ */
++sal_Bool LwpGraphicObject::IsGrafFormatValid()
++{
++ if ((m_sServerContextFormat[1]=='b'&& m_sServerContextFormat[2]=='m' && m_sServerContextFormat[3]=='p')
++ || (m_sServerContextFormat[1]=='j' && m_sServerContextFormat[2]=='p' && m_sServerContextFormat[3]=='g')
++ || (m_sServerContextFormat[1]=='w' && m_sServerContextFormat[2]=='m' && m_sServerContextFormat[3]=='f')
++ || (m_sServerContextFormat[1]=='g' && m_sServerContextFormat[2]=='i' && m_sServerContextFormat[3]=='f')
++ || (m_sServerContextFormat[1]=='t' && m_sServerContextFormat[2]=='g' && m_sServerContextFormat[3]=='f')
++ || (m_sServerContextFormat[1]=='p' && m_sServerContextFormat[2]=='n' && m_sServerContextFormat[3]=='g')
++ || (m_sServerContextFormat[1]=='e' && m_sServerContextFormat[2]=='p' && m_sServerContextFormat[3]=='s'))
++ {
++ return sal_True;
++ }
++ else
++ {
++ return sal_False;
++ }
++}
++
++/**
++ * @descr create drawing object and image object.
++ */
++void LwpGraphicObject::RegisterStyle()
++{
++ if (m_sServerContextFormat[1]=='s'&&m_sServerContextFormat[2]=='d'&&m_sServerContextFormat[3]=='w')
++ {
++ this->CreateDrawObjects();
++ }
++ // test codes for importing pictures
++ else if(this->IsGrafFormatValid())
++ {
++ this->CreateGrafObject();
++ }
++/* if (m_sServerContextFormat[1]=='s'&&m_sServerContextFormat[2]=='d'&&m_sServerContextFormat[3]=='w')
++ {
++ LwpSvStream* pStream = m_pStrm;
++ //test code
++ OpenStormBento::LtcBenContainer* pBentoContainer;
++ ULONG ulRet = OpenStormBento::BenOpenContainer(pStream, &pBentoContainer);
++ std::vector<SvStream*> vStream;
++ std::vector<SvStream*>::iterator iter;
++ pBentoContainer->CreateGraphicStreams(&vStream);
++ for (iter=vStream.begin();iter!=vStream.end();iter++)
++ {
++ LwpSdwFileLoader fileLoader(*iter);
++ fileLoader.RegisterStyle();
++ delete *iter;
++ }
++ vStream.clear();
++
++ }*/
++ if (m_sServerContextFormat[1]=='l'&&m_sServerContextFormat[2]=='c'&&m_sServerContextFormat[3]=='h')
++ {
++ LwpVirtualLayout* pMyLayout = GetLayout(NULL);
++ if(pMyLayout->IsFrame())
++ {
++ XFFrameStyle* pXFFrameStyle = new XFFrameStyle();
++ pXFFrameStyle->SetXPosType(enumXFFrameXPosFromLeft, enumXFFrameXRelFrame);
++ pXFFrameStyle->SetYPosType(enumXFFrameYPosFromTop, enumXFFrameYRelPara);
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_strStyleName = pXFStyleManager->AddStyle(pXFFrameStyle)->GetStyleName();
++ }
++ }
++
++}
++
++// add by , 03/25/2005
++/**
++ * @descr create drawing object.
++ */
++void LwpGraphicObject::CreateDrawObjects()
++{
++ // if small file, use the compressed stream for BENTO
++ LwpSvStream* pStream = m_pStrm->GetCompressedStream() ? m_pStrm->GetCompressedStream(): m_pStrm;
++
++ OpenStormBento::LtcBenContainer* pBentoContainer;
++ ULONG ulRet = OpenStormBento::BenOpenContainer(pStream, &pBentoContainer);
++ SvStream* pDrawObjStream = NULL;
++
++ // get graphic object's bento objet name
++ LwpObjectID* pMyID = this->GetObjectID();
++ std::string aGrfObjName;
++ this->GetBentoNamebyID(pMyID, aGrfObjName);
++
++ // get bento stream by the name
++ pBentoContainer->CreateGraphicStream(pDrawObjStream, aGrfObjName.c_str());
++ if (pDrawObjStream)
++ {
++ LwpSdwFileLoader fileLoader(pDrawObjStream, this);
++ fileLoader.CreateDrawObjects(&m_vXFDrawObjects);
++
++ delete pDrawObjStream;
++ pDrawObjStream = NULL;
++ }
++}
++
++/**
++ * @descr create drawing object.
++ */
++void LwpGraphicObject::GetBentoNamebyID(LwpObjectID* pMyID, std::string& rName)
++{
++ sal_uInt16 nHigh = pMyID->GetHigh();
++ sal_uInt32 nLow = pMyID->GetLow();
++ char pTempStr[32];
++ rName = std::string("Gr");
++ sprintf(pTempStr, "%X,%lX", nHigh, nLow);
++ rName.append(pTempStr);
++}
++
++/**
++ * @descr get the image data read from bento stream according to the VO_GRAPHIC ID.
++ * @param pGrafData the array to store the image data. the pointer need to be deleted outside.
++ * @return the length of the image data.
++ */
++sal_uInt32 LwpGraphicObject::GetRawGrafData(sal_uInt8*& pGrafData)
++{
++ // create graphic object
++ // if small file, use the compressed stream for BENTO
++ LwpSvStream* pStream = m_pStrm->GetCompressedStream() ? m_pStrm->GetCompressedStream(): m_pStrm;
++
++ OpenStormBento::LtcBenContainer* pBentoContainer;
++ ULONG ulRet = OpenStormBento::BenOpenContainer(pStream, &pBentoContainer);
++ SvStream* pGrafStream = NULL;
++
++ // get graphic object's bento objet name
++ LwpObjectID* pMyID = this->GetObjectID();
++ std::string aGrfObjName;
++ this->GetBentoNamebyID(pMyID, aGrfObjName);
++
++ // get bento stream by the name
++ pBentoContainer->CreateGraphicStream(pGrafStream, aGrfObjName.c_str());
++ SvMemoryStream* pMemGrafStream = static_cast<SvMemoryStream*>(pGrafStream);
++
++ if (pMemGrafStream)
++ {
++ // read image data
++ sal_uInt32 nDataLen = pMemGrafStream->GetSize();
++ pGrafData = new sal_uInt8 [nDataLen];
++ pMemGrafStream->Read(pGrafData, nDataLen);
++
++ delete pMemGrafStream;
++ pMemGrafStream = NULL;
++
++ return nDataLen;
++ }
++
++ return 0;
++}
++
++/**
++ * @descr get the image data (only -D dara) read from bento stream according to the VO_GRAPHIC ID.
++ * @param pGrafData the array to store the image data. the pointer need to be deleted outside.
++ * @return the length of the image data.
++ */
++sal_uInt32 LwpGraphicObject::GetGrafData(sal_uInt8*& pGrafData)
++{
++ // create graphic object
++ // if small file, use the compressed stream for BENTO
++ LwpSvStream* pStream = m_pStrm->GetCompressedStream() ? m_pStrm->GetCompressedStream(): m_pStrm;
++
++ OpenStormBento::LtcBenContainer* pBentoContainer;
++ ULONG ulRet = OpenStormBento::BenOpenContainer(pStream, &pBentoContainer);
++
++ SvStream* pGrafStream = NULL;
++
++ // get graphic object's bento objet name
++ LwpObjectID* pMyID = this->GetObjectID();
++ std::string aGrfObjName;
++ this->GetBentoNamebyID(pMyID, aGrfObjName);
++
++ char sDName[64]="";
++ sprintf(sDName, "%s-D", aGrfObjName.c_str());
++
++ // get bento stream by the name
++ pGrafStream = pBentoContainer->FindValueStreamWithPropertyName(sDName);
++
++ SvMemoryStream* pMemGrafStream = static_cast<SvMemoryStream*>(pGrafStream);
++
++ if (pMemGrafStream)
++ {
++ // read image data
++ UINT32 nPos = pGrafStream->Tell();
++ pGrafStream->Seek(STREAM_SEEK_TO_END);
++ sal_uInt32 nDataLen = pGrafStream->Tell();
++ pGrafStream->Seek(nPos);
++
++ pGrafData = new sal_uInt8 [nDataLen];
++ pMemGrafStream->Read(pGrafData, nDataLen);
++
++ delete pMemGrafStream;
++ pMemGrafStream = NULL;
++
++ return nDataLen;
++ }
++
++ return 0;
++}
++
++
++/**
++ * @descr create xf-image object and save it in the container: m_vXFDrawObjects.
++ */
++void LwpGraphicObject::CreateGrafObject()
++{
++
++ XFImage* pImage = new XFImage();
++
++ // set image processing styles
++ XFImageStyle* pImageStyle = new XFImageStyle();
++ if (m_sServerContextFormat[1]!='w' || m_sServerContextFormat[2]!='m' || m_sServerContextFormat[3]!='f')
++ {
++ if (m_aIPData.nBrightness != 50)
++ {
++ sal_Int32 nSODCBrightness = (sal_Int32)m_aIPData.nBrightness*2 - 100;
++ pImageStyle->SetBrightness(nSODCBrightness);
++ }
++ if (m_aIPData.nContrast != 50)
++ {
++ //sal_Int32 nSODCContrast = (sal_Int32)m_aIPData.nContrast*2 - 100;
++ //lwp [0, 100] map to sodc [80, -80]
++ sal_Int32 nSODCContrast = (sal_Int32)(80 - (double)m_aIPData.nContrast*1.6);
++ pImageStyle->SetContrast(nSODCContrast);
++ }
++ }
++
++ // set scale and crop styles
++ LwpAssociatedLayouts* pLayoutWithMe = GetLayoutsWithMe();
++ LwpFrameLayout* pMyFrameLayout =
++ static_cast<LwpFrameLayout*>(pLayoutWithMe->GetOnlyLayout()->obj(VO_FRAMELAYOUT));
++ if (pMyFrameLayout)
++ {
++ LwpLayoutScale* pMyScale = pMyFrameLayout->GetLayoutScale();
++ LwpLayoutGeometry* pFrameGeo = pMyFrameLayout->GetGeometry();
++
++ // original image size
++ double fOrgGrafWidth = (double)m_Cache.Width/TWIPS_PER_CM;
++ double fOrgGrafHeight = (double)m_Cache.Height/TWIPS_PER_CM;
++
++ // get margin values
++ double fLeftMargin = pMyFrameLayout->GetMarginsValue(MARGIN_LEFT);
++ double fRightMargin = pMyFrameLayout->GetMarginsValue(MARGIN_RIGHT);
++ double fTopMargin = pMyFrameLayout->GetMarginsValue(MARGIN_TOP);
++ double fBottomMargin = pMyFrameLayout->GetMarginsValue(MARGIN_BOTTOM);
++
++ if (pMyScale && pFrameGeo)
++ {
++ // frame size
++ double fFrameWidth = LwpTools::ConvertFromUnitsToMetric(pFrameGeo->GetWidth());
++ double fFrameHeight = LwpTools::ConvertFromUnitsToMetric(pFrameGeo->GetHeight());
++
++ // calculate the displayed size of the frame
++ double fDisFrameWidth = fFrameWidth - (fLeftMargin+fRightMargin);
++ double fDisFrameHeight = fFrameHeight - (fTopMargin+fBottomMargin);
++
++ // scaled image size
++ double fSclGrafWidth = fOrgGrafWidth;//LwpTools::ConvertFromUnitsToMetric(pMyScale->GetScaleWidth());
++ double fSclGrafHeight = fOrgGrafHeight;//LwpTools::ConvertFromUnitsToMetric(pMyScale->GetScaleHeight());
++
++ // get scale mode
++ sal_uInt16 nScalemode = pMyScale->GetScaleMode();
++ if (nScalemode & LwpLayoutScale::CUSTOM)
++ {
++ fSclGrafWidth = LwpTools::ConvertFromUnitsToMetric(pMyScale->GetScaleWidth());
++ fSclGrafHeight = LwpTools::ConvertFromUnitsToMetric(pMyScale->GetScaleHeight());
++ }
++ else if (nScalemode & LwpLayoutScale::PERCENTAGE)
++ {
++ double fScalePercentage = (double)pMyScale->GetScalePercentage() / 1000;
++ fSclGrafWidth = fScalePercentage * fOrgGrafWidth;
++ fSclGrafHeight = fScalePercentage * fOrgGrafHeight;
++ }
++ else if (nScalemode & LwpLayoutScale::FIT_IN_FRAME)
++ {
++ if (pMyFrameLayout->IsFitGraphic())
++ {
++ fSclGrafWidth = fOrgGrafWidth;
++ fSclGrafHeight = fOrgGrafHeight;
++ }
++ else if (nScalemode & LwpLayoutScale::MAINTAIN_ASPECT_RATIO)
++ {
++ if (fOrgGrafWidth/fOrgGrafHeight >= fDisFrameWidth/fDisFrameHeight)
++ {
++ fSclGrafWidth = fDisFrameWidth;
++ fSclGrafHeight = (fDisFrameWidth/fOrgGrafWidth) * fOrgGrafHeight;
++ }
++ else
++ {
++ fSclGrafHeight = fDisFrameHeight;
++ fSclGrafWidth = (fDisFrameHeight/fOrgGrafHeight) * fOrgGrafWidth;
++ }
++ }
++ else
++ {
++ fSclGrafWidth = fDisFrameWidth;
++ fSclGrafHeight = fDisFrameHeight;
++ }
++ }
++
++ // scaled ratio
++ double fXRatio = fSclGrafWidth / fOrgGrafWidth;
++ double fYRatio = fSclGrafHeight / fOrgGrafHeight;
++
++ // set image to scaled size.
++ pImage->SetWidth(fSclGrafWidth);
++ pImage->SetHeight(fSclGrafHeight);
++
++ // placement:centered or tiled. tiled style is not supported so it's processed together with centered.
++ if (pMyFrameLayout->GetScaleCenter() || pMyFrameLayout->GetScaleTile())
++ {
++ // set center alignment
++ pImageStyle->SetXPosType(enumXFFrameXPosCenter, enumXFFrameXRelFrame);
++ pImageStyle->SetYPosType(enumXFFrameYPosMiddle, enumXFFrameYRelFrame);
++
++ // need horizontal crop?
++ double fClipWidth = 0;
++ double fClipHeight = 0;
++ sal_Bool sal_bCropped = sal_False;
++ if (fSclGrafWidth > fDisFrameWidth)
++ {
++ fClipWidth = (fSclGrafWidth-fDisFrameWidth ) / 2 / fXRatio;
++ sal_bCropped = sal_True;
++ }
++
++ // need vertical crop?
++ if (fSclGrafHeight > fDisFrameHeight)
++ {
++ fClipHeight = (fSclGrafHeight-fDisFrameHeight ) / 2 / fYRatio;
++ sal_bCropped = sal_True;
++ }
++
++ if (sal_bCropped)
++ {
++ pImageStyle->SetClip(fClipWidth, fClipWidth, fClipHeight, fClipHeight);
++ pImage->SetWidth(fDisFrameWidth);
++ pImage->SetHeight(fDisFrameHeight);
++ }
++ }
++ // placement:automatic
++ else
++ {
++ // set left-top alignment
++// pImageStyle->SetXPosType(enumXFFrameXPosLeft, enumXFFrameXRelFrame);
++// pImageStyle->SetYPosType(enumXFFrameYPosTop, enumXFFrameYRelFrame);
++ pImageStyle->SetYPosType(enumXFFrameYPosFromTop, enumXFFrameYRelFrame);
++ pImageStyle->SetXPosType(enumXFFrameXPosFromLeft, enumXFFrameXRelFrame);
++
++ // get image position offset
++ LwpPoint* pOffset = pMyScale->GetOffset();
++ double fOffsetX = LwpTools::ConvertFromUnitsToMetric(pOffset->GetX());
++ double fOffsetY = LwpTools::ConvertFromUnitsToMetric(pOffset->GetY());
++
++ struct LwpRect
++ {
++ double fLeft;
++ double fRight;
++ double fTop;
++ double fBottom;
++
++ LwpRect()
++ {
++ fLeft = 0.00;
++ fRight = 0.00;
++ fTop = 0.00;
++ fBottom = 0.00;
++ }
++ LwpRect(double fL, double fR, double fT, double fB)
++ {
++ fLeft = fL;
++ fRight = fR;
++ fTop = fT;
++ fBottom = fB;
++ }
++ };
++ LwpRect aFrameRect(-fOffsetX, (fDisFrameWidth-fOffsetX), (-fOffsetY), ((fDisFrameHeight-fOffsetY)));
++ LwpRect aImageRect(0, fSclGrafWidth, 0, fSclGrafHeight);
++ LwpRect aCropRect;
++
++ if (aFrameRect.fRight <= aImageRect.fLeft || aFrameRect.fLeft >= aImageRect.fRight
++ ||aFrameRect.fBottom <= aImageRect.fTop|| aFrameRect.fTop >= aImageRect.fBottom)
++ {
++ // display blank
++ }
++ else// need cropped
++ {
++ // horizontal crop
++ if (aFrameRect.fLeft > aImageRect.fLeft)
++ {
++ aCropRect.fLeft = (aFrameRect.fLeft - aImageRect.fLeft) / fXRatio;
++ }
++
++ if (aFrameRect.fRight < aImageRect.fRight)
++ {
++ aCropRect.fRight = (aImageRect.fRight - aFrameRect.fRight) / fXRatio;
++ }
++
++ // vertical crop
++ if (aFrameRect.fTop > aImageRect.fTop)
++ {
++ aCropRect.fTop = (aFrameRect.fTop - aImageRect.fTop) / fYRatio;
++ }
++ if (aFrameRect.fBottom < aImageRect.fBottom)
++ {
++ aCropRect.fBottom = (aImageRect.fBottom - aFrameRect.fBottom) / fYRatio;
++ }
++
++ pImageStyle->SetClip(aCropRect.fLeft, aCropRect.fRight, aCropRect.fTop, aCropRect.fBottom);
++ double fPicWidth = fSclGrafWidth - (aCropRect.fLeft+aCropRect.fRight)*fXRatio;
++ double fPicHeight = fSclGrafHeight- (aCropRect.fTop+aCropRect.fBottom)*fYRatio;
++ double fX = fOffsetX > 0 ? fOffsetX : 0.00;
++ double fY = fOffsetY > 0 ? fOffsetY : 0.00;
++ pImage->SetPosition((fX+fLeftMargin), (fY+fTopMargin), fPicWidth, fPicHeight);
++ }
++ }
++ }
++ }
++
++ // set style for the image
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ pImage->SetStyleName(pXFStyleManager->AddStyle(pImageStyle)->GetStyleName());
++
++ // set archor to frame
++ pImage->SetAnchorType(enumXFAnchorFrame);
++// pImage->SetAnchorType(enumXFAnchorPara);//enumXFAnchorFrame);
++
++ // set object name
++ LwpAtomHolder* pHolder = this->GetName();
++ if ( pHolder && pHolder->str().getLength() )
++ {
++ pImage->SetName(pHolder->str());
++ }
++
++ // insert image object into array
++ m_vXFDrawObjects.push_back(pImage);
++
++}
++// end add
++
++/**
++ * @descr Reserve the equation text in a note in the context.
++ */
++void LwpGraphicObject::XFConvertEquation(XFContentContainer * pCont)
++{
++ sal_uInt8* pGrafData = NULL;
++ sal_uInt32 nDataLen = this->GetGrafData(pGrafData);
++ if(pGrafData)
++ {
++ //convert equation
++ XFParagraph* pXFPara = new XFParagraph;
++ pXFPara->Add(A2OUSTR("Formula:"));
++ //add notes
++ XFAnnotation* pXFNote = new XFAnnotation;
++ //add equation to comment notes
++ XFParagraph* pXFNotePara = new XFParagraph;
++ //equation header text: Times New Roman,
++ // 18,12,0,0,0,0,0.
++ // .TCIformat{2}
++ //total head length = 45
++ sal_uInt32 nBegin = 45;
++ sal_uInt32 nEnd = nDataLen -1;
++ sal_uInt32 nIndex = 0;
++
++ if(pGrafData[nEnd] == '$' && pGrafData[nEnd-1]!= '\\')
++ {
++ //equation body is contained by '$';
++ nBegin++;
++ nEnd--;
++ }
++
++ if(nEnd >= nBegin)
++ {
++ sal_uInt8* pEquData = new sal_uInt8[nEnd - nBegin + 1];
++ for(nIndex = 0; nIndex < nEnd - nBegin +1 ; nIndex++)
++ {
++ pEquData[nIndex] = pGrafData[nBegin + nIndex];
++ }
++ pXFNotePara->Add(rtl::OUString((sal_Char*)pEquData, (nEnd - nBegin + 1), gsl_getSystemTextEncoding()));
++ delete pEquData;
++ }
++ pXFNote->Add(pXFNotePara);
++
++ pXFPara->Add(pXFNote);
++ pCont->Add(pXFPara);
++
++ delete [] pGrafData;
++ pGrafData = NULL;
++ }
++
++}
++
++void LwpGraphicObject::GetGrafOrgSize(double & rWidth, double & rHeight)
++{
++ // original image size
++ rWidth = (double)m_Cache.Width/TWIPS_PER_CM;
++ rHeight = (double)m_Cache.Height/TWIPS_PER_CM;
++}
++
++
+diff -urNp lotuswordpro.bak/source/filter/lwpgrfobj.hxx lotuswordpro/source/filter/lwpgrfobj.hxx
+--- lotuswordpro.bak/source/filter/lwpgrfobj.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpgrfobj.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,141 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++
++#ifndef LWPGRFOBJECT_HXX_
++#define LWPGRFOBJECT_HXX_
++
++#include "lwpoleobject.hxx"
++#include "lwpheader.hxx"
++#include "xfilter/xfrect.hxx"
++#include <tools/gen.hxx>
++
++struct ImageProcessingData
++{
++ sal_uInt8 nBrightness;
++ sal_uInt8 nContrast;
++ sal_uInt8 nEdgeEnchancement;
++ sal_uInt8 nSmoothing;
++ sal_Bool bAutoContrast;
++ sal_Bool bInvertImage;
++
++ ImageProcessingData()
++ {
++ nBrightness = 50;
++ nContrast = 50;
++ nEdgeEnchancement = 0;
++ nSmoothing = 0;
++ bAutoContrast = sal_False;
++ bInvertImage= sal_False;
++ }
++};
++
++class XFFrame;
++class LwpGraphicObject : public LwpGraphicOleObject
++{
++public:
++ LwpGraphicObject(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpGraphicObject();
++private:
++ unsigned char m_sDataFormat[AFID_MAX_FILE_FORMAT_SIZE];
++ unsigned char m_sServerContextFormat[AFID_MAX_CONTEXT_FORMAT_SIZE];
++ sal_Int32 m_nCachedBaseLine;
++ sal_Int16 m_bIsLinked;
++ AFID_CACHE m_Cache;
++ sal_Int16 m_bCompressed;
++ OUString m_WatermarkName;
++ OUString m_LinkedFilePath;
++
++ ImageProcessingData m_aIPData;
++
++ void GetRect(INT32& nLeft, INT32& nTop, INT32& nRight, INT32& nBottom);
++ XFRect GetRectInCM();
++ Rectangle GetRectIn100thMM();
++ void XFConvertEquation(XFContentContainer* pCont);
++
++ void ParseChart(IXFStream* pOutputStream);
++ sal_Bool IsGrafFormatValid();
++ // add by , 03/25/2005
++ std::vector <XFFrame*> m_vXFDrawObjects;
++ // end add
++
++public:
++ //inline sal_uInt8* GetBuffer(){return m_DataBuffer;}
++ void Read();
++ //Added by for XFConvert refactor, 03/31/2005
++ virtual void XFConvert (XFContentContainer* pCont);
++ //End of Add
++ void RegisterStyle();
++
++ // add by , 03/25/2005
++ void CreateDrawObjects();
++ void CreateGrafObject();
++ void GetBentoNamebyID(LwpObjectID* pMyID, std::string& rName);
++ sal_uInt32 GetRawGrafData(sal_uInt8*& pGrafData);
++ sal_uInt32 GetGrafData(sal_uInt8*& pGrafData);
++ void GetGrafOrgSize(long& rWidth, long& rHeight) { rWidth = m_Cache.Width; rHeight = m_Cache.Height; }
++ void GetGrafOrgSize(double& rWidth, double& rHeight);
++ // end add
++
++ OUString GetWatermarkName(){ return m_WatermarkName;}
++ sal_Int16 IsLinked(){ return m_bIsLinked;}
++ OUString GetLinkedFilePath(){ return m_LinkedFilePath;}
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwpheader.hxx lotuswordpro/source/filter/lwpheader.hxx
+--- lotuswordpro.bak/source/filter/lwpheader.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpheader.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,84 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPHEADERS_HXX
++#define _LWPHEADERS_HXX
++
++#include <math.h>
++#include <vector>
++#include <memory>
++#include <hash_map>
++#include <map>
++#include <assert.h>
++#include <string>
++
++#include <sal/types.h>
++#include <tools/solar.h>
++#include <sal/config.h>
++
++#include <rtl/ustring.hxx>
++#include <tools/string.hxx>
++#include <memory.h>
++
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpholder.cxx lotuswordpro/source/filter/lwpholder.cxx
+--- lotuswordpro.bak/source/filter/lwpholder.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpholder.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,119 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpholder.hxx"
++#include "lwpfilehdr.hxx"
++
++LwpDLVListHeadHolder::LwpDLVListHeadHolder(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpObject(objHdr, pStrm)
++{}
++/**
++ * @descr read LwpDLVListHeadHolder from object stream
++*/
++void LwpDLVListHeadHolder::Read()
++{
++ m_DLVHead.ReadIndexed(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++
++LwpDLVListHeadTailHolder::LwpDLVListHeadTailHolder(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpObject(objHdr, pStrm)
++{}
++/**
++ * @descr read LwpDLVListHeadTailHolder from object stream
++*/
++void LwpDLVListHeadTailHolder::Read()
++{
++ m_HeadTail.Read(m_pObjStrm);
++ //m_pObjStrm->SkipExtra();
++}
++
++LwpObjectHolder::LwpObjectHolder(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ :LwpDLVList(objHdr, pStrm)
++{}
++/**
++ * @descr read LwpObjectHolder from object stream
++*/
++void LwpObjectHolder::Read()
++{
++ LwpDLVList::Read();
++
++ m_Object.ReadIndexed(m_pObjStrm);
++ if( LwpFileHeader::m_nFileRevision < 0x0006 )
++ m_pObjStrm->SkipExtra();
++}
++
++LwpListList::LwpListList(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ :LwpObjectHolder(objHdr, pStrm)
++{}
++/**
++ * @descr read LwpListList from object stream
++*/
++void LwpListList::Read()
++{
++ LwpObjectHolder::Read();
++
++ m_HeadTail.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpholder.hxx lotuswordpro/source/filter/lwpholder.hxx
+--- lotuswordpro.bak/source/filter/lwpholder.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpholder.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,129 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * kinds of holder classes header file
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPDLVLISTHEADHOLDER_HXX_
++#define _LWPDLVLISTHEADHOLDER_HXX_
++
++#include "lwpobj.hxx"
++#include "lwpdlvlist.hxx"
++/**
++ * @brief VO_HEADHOLDER, LwpDLVListHeadHolder,
++ * contains an id to the head of LwpDLVList
++*/
++class LwpDLVListHeadHolder : public LwpObject
++{
++public:
++ LwpDLVListHeadHolder(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ ~LwpDLVListHeadHolder(){};
++ void Read();
++ LwpObjectID* GetHeadID() { return &m_DLVHead;}
++private:
++ LwpObjectID m_DLVHead;
++};
++/**
++ * @brief VO_HEADTAILHOLDER, LwpDLVListHeadTailHolder,
++ * contains a LwpDLVListHeadTail (Head and tail id)
++*/
++class LwpDLVListHeadTailHolder : public LwpObject
++{
++public:
++ LwpDLVListHeadTailHolder(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ ~LwpDLVListHeadTailHolder(){};
++ void Read();
++ LwpObjectID* GetHead(){ return m_HeadTail.GetHead();}
++ LwpObjectID* GetTail(){ return m_HeadTail.GetTail();}
++protected:
++ LwpDLVListHeadTail m_HeadTail;
++};
++/**
++ * @brief LwpObjectHolder, which is LwpDLVList, contains an id to an object
++ * VO_OBJECTHOLDER
++*/
++class LwpObjectHolder : public LwpDLVList
++{
++public:
++ LwpObjectHolder(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ ~LwpObjectHolder(){};
++ void Read();
++ LwpObjectID* GetObject(){return &m_Object;}
++protected:
++ LwpObjectID m_Object;
++};
++
++/**
++ * @brief VO_LISTLIST object in .lwp file
++ *
++ */
++class LwpListList : public LwpObjectHolder
++{
++public:
++ LwpListList(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ ~LwpListList(){};
++ void Read();
++ LwpObjectID* GetHead(){ return m_HeadTail.GetHead();}
++ LwpObjectID* GetTail(){ return m_HeadTail.GetTail();}
++protected:
++ LwpDLVListHeadTail m_HeadTail;
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwphyperlinkmgr.cxx lotuswordpro/source/filter/lwphyperlinkmgr.cxx
+--- lotuswordpro.bak/source/filter/lwphyperlinkmgr.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwphyperlinkmgr.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,82 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++#include "lwphyperlinkmgr.hxx"
++
++LwpHyperlinkMgr::LwpHyperlinkMgr()
++{
++ m_bIsHyperlink = sal_False;
++}
++
++LwpHyperlinkMgr::~LwpHyperlinkMgr()
++{
++}
++
++OUString LwpHyperlinkMgr::GetHyperlink()
++{
++ return m_Hyperlink;
++}
++
++void LwpHyperlinkMgr::SetHyperlink(OUString hyperlink)
++{
++ m_Hyperlink = hyperlink;
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwphyperlinkmgr.hxx lotuswordpro/source/filter/lwphyperlinkmgr.hxx
+--- lotuswordpro.bak/source/filter/lwphyperlinkmgr.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwphyperlinkmgr.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,82 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++#ifndef _LWPHYPERLINKMGR_HXX_
++#define _LWPHYPERLINKMGR_HXX_
++
++#include "lwpfilehdr.hxx"
++
++class LwpHyperlinkMgr
++{
++public:
++ LwpHyperlinkMgr();
++ ~LwpHyperlinkMgr();
++ void SetHyperlinkFlag(sal_Bool bFlag){m_bIsHyperlink = bFlag;}
++ sal_Bool GetHyperlinkFlag(){return m_bIsHyperlink;}
++ void SetHyperlink(OUString hyperlink);
++ OUString GetHyperlink();
++private:
++ OUString m_Hyperlink;
++ sal_Bool m_bIsHyperlink;
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpidxmgr.cxx lotuswordpro/source/filter/lwpidxmgr.cxx
+--- lotuswordpro.bak/source/filter/lwpidxmgr.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpidxmgr.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,354 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**********************************************************************************************************************
++ * @file
++ * index manager implementation
++ * Three record types are related with index information, and two ways are used.
++* 1. VO_ROOTOBJINDEX works with one or more VO_LEAFOBJINDEX records to
++* provide the map of all object ids and their offsets.
++* VO_ROOTOBJINDEX includes k (object id, offset) and timetable which is used to map index to actual low id
++ * 2. VO_ROOTLEAFOBJINDEX is used when the file is so small that the number of objects is less than 256(?)
++ * VO_ROOTLEAFOBJINDEX contains directly the (object id, offset) map and time table.
++/**********************************************************************************************************************/
++/**********************************************************************************************************************
++ * Change History
++ Jan 2005 Created
++/**********************************************************************************************************************/
++
++#include "lwpidxmgr.hxx"
++
++const sal_uInt8 LwpIndexManager::MAXOBJECTIDS = 255;
++
++LwpIndexManager::LwpIndexManager()
++ :m_nKeyCount(0), m_nLeafCount(0)
++{
++
++ m_TempVec.resize( LwpIndexManager::MAXOBJECTIDS );
++
++}
++
++LwpIndexManager::~LwpIndexManager()
++{
++ //Clear m_ObjectKeys
++ std::vector<LwpKey*>::iterator it;
++
++ for( it = m_ObjectKeys.begin(); it != m_ObjectKeys.end(); it++ )
++ {
++ LwpKey* pKey = *it;
++ if( pKey )
++ {
++ delete pKey;
++ pKey = NULL;
++ }
++ }
++ m_ObjectKeys.clear();
++}
++
++/**
++ * @descr Read all index records, VO_ROOTLEAFOBJINDEX, VO_ROOTOBJINDEX, VO_LEAFOBJINDEX
++ */
++void LwpIndexManager::Read(LwpSvStream* pStrm)
++{
++ //Read index obj
++ LwpObjectHeader ObjHdr;
++ ObjHdr.Read(*pStrm);
++ LwpObjectStream* pObjStrm = new LwpObjectStream(pStrm, ObjHdr.IsCompressed(),
++ static_cast<sal_uInt16>(ObjHdr.GetSize()) );
++
++ if( ObjHdr.GetTag() == VO_ROOTLEAFOBJINDEX )
++ {
++ ReadLeafData(pObjStrm);
++ ReadTimeTable(pObjStrm);
++ delete pObjStrm;
++ }
++ else
++ {
++ ReadRootData(pObjStrm);
++ delete pObjStrm;
++
++ for (sal_uInt16 k = 0; k < m_nLeafCount; k++)
++ {
++ //Read leaf
++ pStrm->Seek(m_ChildIndex[k]+LwpSvStream::LWP_STREAM_BASE);
++
++
++ //Old Code
++ //ReadLeafIndex(pStrm);
++ //New Code
++ ReadObjIndex( pStrm );
++
++
++ //Read object in root, these objects are between the leaf objects
++ if(k!=m_nLeafCount-1)
++ {
++ m_ObjectKeys.push_back(m_RootObjs[k]);
++ m_nKeyCount ++;
++ }
++ }
++ m_RootObjs.clear();
++ }
++}
++
++/**
++ * @descr Read data in VO_ROOTOBJINDEX
++ */
++void LwpIndexManager::ReadRootData(LwpObjectStream* pObjStrm)
++{
++
++ sal_uInt16 KeyCount = 0;
++ pObjStrm->QuickRead(&KeyCount, sizeof(KeyCount));
++ m_nLeafCount = KeyCount + 1;
++
++ if(KeyCount)
++ {
++ //read object keys
++ LwpKey* akey = new LwpKey();
++ akey->id.Read(pObjStrm);
++ m_RootObjs.push_back(akey);
++
++
++ //sal_uInt8 k = 0;
++ sal_uInt16 k = 0;
++
++ for (k = 1; k < KeyCount; k++)
++ {
++ akey = new LwpKey();
++ akey->id.ReadCompressed(pObjStrm, m_RootObjs[k-1]->id);
++ m_RootObjs.push_back(akey);
++ }
++
++ for (k = 0; k < KeyCount; k++)
++ {
++ pObjStrm->QuickRead(&(m_RootObjs[k]->offset), sizeof(sal_uInt32));
++ }
++
++ //read leaf index offset
++ for (k = 0; k < m_nLeafCount; k++)
++ {
++ pObjStrm->QuickRead(&(m_ChildIndex[k]), sizeof(sal_uInt32));
++ }
++ }
++
++ ReadTimeTable(pObjStrm);
++
++}
++
++
++//Add new method to handle ObjIndex data
++/**
++ * @descr Read data in VO_OBJINDEX
++ */
++void LwpIndexManager::ReadObjIndexData(LwpObjectStream* pObjStrm)
++{
++ sal_uInt16 KeyCount = 0;
++ sal_uInt16 LeafCount = 0;
++ pObjStrm->QuickRead(&KeyCount, sizeof(KeyCount));
++ LeafCount = KeyCount + 1;
++
++ std::vector<LwpKey*> vObjIndexs;
++
++ if(KeyCount)
++ {
++ LwpKey* akey = new LwpKey();
++ akey->id.Read(pObjStrm);
++ vObjIndexs.push_back(akey);
++
++ sal_uInt16 k = 0;
++
++ for (k = 1; k < KeyCount; k++)
++ {
++ akey = new LwpKey();
++ akey->id.ReadCompressed(pObjStrm, vObjIndexs[k-1]->id);
++ vObjIndexs.push_back(akey);
++ }
++
++ for (k = 0; k < KeyCount; k++)
++ pObjStrm->QuickRead(&(vObjIndexs[k]->offset), sizeof(sal_uInt32));
++
++ for (k = 0; k < LeafCount; k++)
++ pObjStrm->QuickRead(&(m_TempVec[k]), sizeof(sal_uInt32));
++ }
++
++ for( sal_uInt16 j=0; j<LeafCount; j++ )
++ {
++ pObjStrm->GetStream()->Seek( m_TempVec[j]+LwpSvStream::LWP_STREAM_BASE);
++ ReadLeafIndex(pObjStrm->GetStream());
++
++ if(j!=LeafCount-1)
++ {
++ m_ObjectKeys.push_back(vObjIndexs[j]);
++
++ m_nKeyCount ++;
++ }
++ }
++
++ vObjIndexs.clear();
++ m_TempVec.clear();
++}
++
++
++/**
++ * @descr Read VO_OBJINDEX
++ */
++void LwpIndexManager::ReadObjIndex( LwpSvStream *pStrm )
++{
++
++ LwpObjectHeader ObjHdr;
++ ObjHdr.Read(*pStrm);
++ LwpObjectStream* pObjStrm = new LwpObjectStream(pStrm, ObjHdr.IsCompressed(),
++ static_cast<sal_uInt16>(ObjHdr.GetSize()) );
++
++ if( (sal_uInt32)VO_OBJINDEX == ObjHdr.GetTag() )
++ {
++ ReadObjIndexData( pObjStrm );
++ }
++ else if( (sal_uInt32)VO_LEAFOBJINDEX == ObjHdr.GetTag() )
++ {
++ ReadLeafData(pObjStrm);
++ }
++
++ delete pObjStrm;
++}
++
++
++/**
++ * @descr Read VO_LEAFOBJINDEX
++ */
++void LwpIndexManager::ReadLeafIndex( LwpSvStream *pStrm )
++{
++ LwpObjectHeader ObjHdr;
++ ObjHdr.Read(*pStrm);
++ LwpObjectStream* pObjStrm = new LwpObjectStream(pStrm, ObjHdr.IsCompressed(),
++ static_cast<sal_uInt16>(ObjHdr.GetSize()) );
++
++ ReadLeafData(pObjStrm);
++
++ delete pObjStrm;
++}
++/**
++ * @descr Read data in VO_LEAFOBJINDEX
++ */
++void LwpIndexManager::ReadLeafData( LwpObjectStream *pObjStrm )
++{
++ sal_uInt16 KeyCount;
++ pObjStrm->QuickRead(&KeyCount, sizeof(KeyCount));
++
++ if(KeyCount)
++ {
++ LwpKey* akey = new LwpKey();
++ //read object keys: id & offset
++ akey->id.Read(pObjStrm);
++ m_ObjectKeys.push_back(akey);
++
++ for (sal_uInt8 k = 1; k < KeyCount; k++)
++ {
++ akey = new LwpKey();
++ akey->id.ReadCompressed(pObjStrm, m_ObjectKeys[m_nKeyCount+k-1]->id);
++ m_ObjectKeys.push_back(akey);
++ }
++
++ for (sal_uInt8 j = 0; j < KeyCount; j++)
++ {
++ pObjStrm->QuickRead(&(m_ObjectKeys[m_nKeyCount+j]->offset), sizeof(sal_uInt32));
++ }
++ }
++ m_nKeyCount += KeyCount;
++}
++/**
++ * @descr Read time table in VO_ROOTLEAFOBJINDEX and VO_ROOTOBJINDEX
++ */
++void LwpIndexManager::ReadTimeTable(LwpObjectStream *pObjStrm)
++{
++ sal_uInt16 nTimeCount;
++ pObjStrm->QuickRead(&nTimeCount, sizeof(nTimeCount));
++
++ sal_uInt32 atime;
++ for(sal_uInt16 i=0; i<nTimeCount; i++)
++ {
++ pObjStrm->QuickRead( &atime, sizeof(atime) );
++ m_TimeTable.push_back(atime);
++ }
++}
++/**
++ * @descr get object offset per the object id
++ */
++sal_uInt32 LwpIndexManager::GetObjOffset( LwpObjectID objid )
++{
++
++ //sal_uInt16 L, U, M;
++ sal_uInt32 L, U, M;
++
++
++ L = 0;
++ U = m_nKeyCount;
++ while (L != U)
++ {
++ M = (L + U) >> 1;
++
++ if (objid.GetLow() > m_ObjectKeys[M]->id.GetLow())
++ L = M + 1;
++ else if (objid.GetLow() < m_ObjectKeys[M]->id.GetLow())
++ U = M;
++ else if (objid.GetHigh() > m_ObjectKeys[M]->id.GetHigh())
++ L = M + 1;
++ else if (objid.GetHigh() < m_ObjectKeys[M]->id.GetHigh())
++ U = M;
++ else
++ {
++ return(m_ObjectKeys[M]->offset);
++ }
++ }
++ return BAD_OFFSET;
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpidxmgr.hxx lotuswordpro/source/filter/lwpidxmgr.hxx
+--- lotuswordpro.bak/source/filter/lwpidxmgr.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpidxmgr.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,116 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * index manager, to maintain the map between object id and offset
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPINDEXMANAGER_HXX
++#define _LWPINDEXMANAGER_HXX
++
++#include <rtl/ustring.hxx>
++#include "lwpobjhdr.hxx"
++#include "lwpobjstrm.hxx"
++
++/**
++ * @brief key structure used to map id to offset
++*/
++struct LwpKey
++{
++ LwpObjectID id;
++ sal_uInt32 offset;
++};
++/**
++ * @brief LwpIndexManager, to read all index records and maintain the index information
++*/
++class LwpIndexManager
++{
++public:
++ LwpIndexManager();
++ ~LwpIndexManager();
++protected:
++ static const sal_uInt8 MAXOBJECTIDS;
++ std::vector<LwpKey*> m_ObjectKeys; //the <id, offset> ordered vector
++ std::vector<LwpKey*> m_RootObjs; //For those object ids in RootObjIndex
++ std::vector<sal_uInt32> m_TimeTable; //Time table for object low id compression
++
++ //sal_uInt16 m_nKeyCount;
++ sal_uInt32 m_nKeyCount; //the count of all object
++ std::vector<sal_uInt32> m_TempVec; // a temp vector , store the offset of leafindex
++
++ sal_uInt32 m_ChildIndex[256]; //Offset of leaf index
++ sal_uInt16 m_nLeafCount;
++protected:
++ void ReadRootData(LwpObjectStream *pObjStrm ); //Read root index data
++
++
++ //Add new method to handle ObjIndex
++ void ReadObjIndexData(LwpObjectStream* pObjStrm);
++ void ReadObjIndex( LwpSvStream *pStrm ); //Read Obj index
++
++
++ void ReadLeafIndex( LwpSvStream *pStrm ); //Read leaf index obj
++ void ReadLeafData( LwpObjectStream *pStrm ); //Read leaf index obj data
++ void ReadTimeTable( LwpObjectStream *pStrm );
++public:
++ void Read( LwpSvStream *pStrm );
++ sal_uInt32 GetObjOffset( LwpObjectID objid );
++ sal_uInt32 GetObjTime( sal_uInt16 index ) { return m_TimeTable[index-1]; }
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwplayout.cxx lotuswordpro/source/filter/lwplayout.cxx
+--- lotuswordpro.bak/source/filter/lwplayout.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwplayout.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,2215 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ Feb 2005 Process gemotry, margins
++ ************************************************************************/
++
++#include "lwplayout.hxx"
++#include "lwpusewhen.hxx"
++#include "lwptools.hxx"
++#include "xfilter/xfcolumns.hxx"
++#include "lwpstory.hxx"
++#include "lwpparastyle.hxx"
++#include "lwpholder.hxx"
++#include "lwpdoc.hxx"
++#include "lwppagehint.hxx"
++#include "lwpdivinfo.hxx"
++#include "lwpgrfobj.hxx"
++#ifndef _OSL_THREAD_H_
++#include <osl/thread.h>
++#endif
++
++LwpVirtualLayout::LwpVirtualLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpDLNFPVList(objHdr, pStrm)
++{}
++
++void LwpVirtualLayout::Read()
++{
++ LwpDLNFPVList::Read();
++
++ LwpObjectStream* pStrm = m_pObjStrm;
++ pStrm->QuickRead(&m_nAttributes, sizeof(m_nAttributes));
++ pStrm->QuickRead(&m_nAttributes2, sizeof(m_nAttributes2));
++ pStrm->QuickRead(&m_nAttributes3, sizeof(m_nAttributes3));
++ pStrm->QuickRead(&m_nOverrideFlag, sizeof(m_nOverrideFlag));
++ pStrm->QuickRead(&m_nDirection, sizeof(m_nDirection));
++
++ //Note that two bytes is read into m_nEditorID instead of one byte.
++ pStrm->QuickRead(&m_nEditorID, sizeof(m_nEditorID));
++
++ m_NextEnumerated.ReadIndexed(pStrm);
++ m_PreviousEnumerated.ReadIndexed(pStrm);
++
++ pStrm->SkipExtra();
++}
++
++sal_Bool LwpVirtualLayout::MarginsSameAsParent()
++{
++ return m_nAttributes2 & STYLE2_MARGINSSAMEASPARENT ? sal_True : sal_False;
++}
++
++/**
++* @descr: Get column width
++*
++*/
++double LwpVirtualLayout::GetColWidth(sal_uInt16 nIndex)
++{
++ //return GetContentWidth(); //not support now
++ //return LwpTools::ConvertToMetric(5); //test
++ return 0; //test
++}
++
++/**
++* @descr: Get the gap between columns
++*
++*/
++double LwpVirtualLayout::GetColGap(sal_uInt16 nIndex)
++{
++ //return DEFAULTGAPSIZE;
++ //return LwpTools::ConvertToMetric(0.17);//DEFAULTGAPSIZE=0.17
++ return LwpTools::ConvertToMetric(0.17);
++}
++
++/**
++* @descr: Whether it is honoring protection
++*
++*/
++sal_Bool LwpVirtualLayout::HonorProtection()
++{
++ if(!(m_nAttributes2 & STYLE2_HONORPROTECTION))
++ return sal_False;
++
++ LwpVirtualLayout* pParent = static_cast<LwpVirtualLayout*> (GetParent()->obj());
++ if(pParent && !pParent->IsHeader())
++ {
++ return pParent->HonorProtection();
++ }
++
++ if(m_pFoundry)//is null now
++ {
++ LwpDocument* pDoc = m_pFoundry->GetDocument();
++ /*if(pDoc)
++ {
++ return pDoc->HonorProtection();
++ }*/
++ if(pDoc && pDoc->GetRootDocument())
++ return pDoc->GetRootDocument()->HonorProtection();
++ }
++
++ return sal_True;
++}
++
++/**
++* @descr: Whether it is protected
++*
++*/
++sal_Bool LwpVirtualLayout::IsProtected()
++{
++ sal_Bool bProtected = (m_nAttributes & STYLE_PROTECTED)!=0;
++
++ LwpVirtualLayout* pParent = static_cast<LwpVirtualLayout*> (GetParent()->obj());
++ if(pParent && !pParent->IsHeader())
++ {
++ if(pParent->HonorProtection()&&(pParent->HasProtection()||bProtected))
++ {
++ return sal_True;
++ }
++ }
++ else if(m_pFoundry)//is null now
++ {
++ LwpDocument* pDoc = m_pFoundry->GetDocument();
++ if(pDoc)
++ {
++ if (pDoc->HonorProtection() && bProtected)
++ {
++ return sal_True;
++ }
++ }
++ }
++
++ return sal_False;
++}
++
++/**
++* @descr: Whether it has protection
++*
++*/
++sal_Bool LwpVirtualLayout::HasProtection()
++{
++ if(m_nAttributes & STYLE_PROTECTED)
++ return sal_True;
++
++ LwpVirtualLayout* pParent = static_cast<LwpVirtualLayout*> (GetParent()->obj());
++ if(pParent && !pParent->IsHeader())
++ {
++ return pParent->HasProtection();
++ }
++
++ return sal_False;
++}
++
++/**
++* @descr: Whether it is a mirror layout
++*
++*/
++sal_Bool LwpVirtualLayout::IsComplex()
++{
++ return m_nAttributes & STYLE_COMPLEX ? sal_True : sal_False;
++}
++
++/**
++* @descr: Get usewhen pointer
++*
++*/
++LwpUseWhen* LwpVirtualLayout::GetUseWhen()
++{
++ /*
++ If we have a parent, and I'm not a page layout,
++ use my parents information.
++ */
++ if(GetLayoutType()!=LWP_PAGE_LAYOUT)
++ {
++ //get parent
++ LwpVirtualLayout* pParent = static_cast<LwpVirtualLayout*> (GetParent()->obj());
++ if(pParent && !pParent->IsHeader()&& (pParent->GetLayoutType()!=LWP_PAGE_LAYOUT))
++ return pParent->GetUseWhen();
++
++ }
++
++ return VirtualGetUseWhen();
++}
++/**
++ * @descr: Whether this layout is page layout or not
++ * @param:
++ * @return:
++*/
++sal_Bool LwpVirtualLayout::IsPage()
++{
++ return (GetLayoutType() == LWP_PAGE_LAYOUT);
++}
++/**
++ * @descr: Whether this layout is heaer layout or not
++ * @param:
++ * @return:
++*/
++sal_Bool LwpVirtualLayout::IsHeader()
++{
++ return (GetLayoutType() == LWP_HEADER_LAYOUT);
++}
++/**
++ * @descr: Whether this layout is footer layout or not
++ * @param:
++ * @return:
++*/
++sal_Bool LwpVirtualLayout::IsFooter()
++{
++ return (GetLayoutType() == LWP_FOOTER_LAYOUT);
++}
++/**
++ * @descr: Whether this layout is frame layout or not
++ * @param:
++ * @return:
++*/
++sal_Bool LwpVirtualLayout::IsFrame()
++{
++ return (GetLayoutType() == LWP_FRAME_LAYOUT);
++}
++
++/**
++ * @descr: Whether this layout is cell layout or not
++ * @param:
++ * @return:
++*/
++sal_Bool LwpVirtualLayout::IsCell()
++{
++ return (GetLayoutType() == LWP_CELL_LAYOUT
++ || GetLayoutType() == LWP_CONNECTED_CELL_LAYOUT
++ || GetLayoutType() == LWP_HIDDEN_CELL_LAYOUT);
++}
++/**
++ * @descr: Whether this layout is supertable layout or not
++ * @param:
++ * @return:
++*/
++sal_Bool LwpVirtualLayout::IsSuperTable()
++{
++ return (GetLayoutType() == LWP_SUPERTABLE_LAYOUT);
++}
++/**
++ * @descr: Whether this layout is group layout or not
++ * @param:
++ * @return:
++*/
++sal_Bool LwpVirtualLayout::IsGroupHead()
++{
++ return (GetLayoutType() == LWP_GROUP_LAYOUT);
++}
++/**
++ * @descr: get the relative type
++ * @param:
++ * @return:
++*/
++sal_uInt8 LwpVirtualLayout::GetRelativeType()
++{
++ return LwpLayoutRelativityGuts::LAY_PARENT_RELATIVE;
++}
++/**
++ * @descr: whether it is relative anchored layout
++ * @param:
++ * @return:
++*/
++sal_Bool LwpVirtualLayout::IsRelativeAnchored()
++{
++ sal_uInt8 nType;
++
++ nType = GetRelativeType();
++ return (nType == LwpLayoutRelativityGuts::LAY_PARA_RELATIVE) || (nType == LwpLayoutRelativityGuts::LAY_INLINE)
++ || (nType == LwpLayoutRelativityGuts::LAY_INLINE_NEWLINE) || (nType == LwpLayoutRelativityGuts::LAY_INLINE_VERTICAL);
++}
++/**
++ * @descr: whether it is MinimumHeight layout
++ * @param:
++ * @return:
++*/
++sal_Bool LwpVirtualLayout::IsMinimumHeight()
++{
++ return ((m_nAttributes3& STYLE3_MINHEIGHTVALID) != 0);
++}
++
++/**
++* @descr: Get parent layout
++*
++*/
++LwpVirtualLayout* LwpVirtualLayout::GetParentLayout()
++{
++ return static_cast<LwpVirtualLayout*> (GetParent()->obj());
++}
++
++/**
++* @descr: Register child layout style
++*
++*/
++void LwpVirtualLayout::RegisterChildStyle()
++{
++ //Register all children styles
++ LwpVirtualLayout* pLayout = static_cast<LwpVirtualLayout*>(GetChildHead()->obj());
++ while(pLayout)
++ {
++ pLayout->SetFoundry(m_pFoundry);
++ pLayout->RegisterStyle();
++ pLayout = static_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj());
++ }
++}
++
++sal_Bool LwpVirtualLayout::NoContentReference()
++{
++ return (m_nAttributes2 & STYLE2_NOCONTENTREFERENCE) != 0;
++}
++
++sal_Bool LwpVirtualLayout::IsStyleLayout()
++{
++ if (m_nAttributes3 & STYLE3_STYLELAYOUT)
++ return sal_True;
++
++ LwpVirtualLayout* pParent =static_cast<LwpVirtualLayout*>(GetParent()->obj());
++ if (pParent)
++ return pParent->IsStyleLayout();
++ return sal_False;
++}
++
++/**
++* @descr: Find child layout by layout type
++*
++*/
++LwpVirtualLayout* LwpVirtualLayout::FindChildByType(LWP_LAYOUT_TYPE eType)
++{
++ LwpObjectID *pID = GetChildHead();
++
++ while(pID && !pID->IsNull())
++ {
++ LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(pID->obj());
++ if(!pLayout)
++ {
++ break;
++ }
++
++ if (pLayout && pLayout->GetLayoutType() == eType)
++ {
++ return pLayout;
++ }
++ pID = pLayout->GetNext();
++ }
++
++ return NULL;
++}
++
++/**
++* @descr: Whether the size of layout is fit the graphic
++*
++*/
++sal_Bool LwpVirtualLayout::IsFitGraphic()
++{
++ return IsAutoGrowRight() && !IsAutoGrowLeft() && IsAutoGrowDown();
++}
++
++/**
++* @descr: Whether the width of layout is auto grow
++*
++*/
++sal_Bool LwpVirtualLayout::IsAutoGrowWidth()
++{
++ return IsAutoGrowLeft() || IsAutoGrowRight();
++}
++
++/**
++* @descr: Determine whether the layout width is to margin
++*
++*/
++sal_Bool LwpVirtualLayout::IsInlineToMargin()
++{
++ return (m_nAttributes3 & STYLE3_INLINETOMARGIN) != 0;
++}
++
++void LwpAssociatedLayouts::Read(LwpObjectStream* pStrm)
++{
++ m_OnlyLayout.ReadIndexed(pStrm);
++ m_Layouts.Read(pStrm);
++ pStrm->SkipExtra();
++}
++
++/**
++* @descr: Looking for the layout which follows the pStartLayout
++* @param: pStartLayout - the layout which is used for looking for its following layout
++*/
++LwpVirtualLayout* LwpAssociatedLayouts::GetLayout(LwpVirtualLayout *pStartLayout)
++{
++ LwpVirtualLayout* pLayout = NULL;
++
++ if (!pStartLayout && !m_OnlyLayout.IsNull())
++ /* Looking for the first layout and there's only one layout in the list.*/
++ return static_cast<LwpVirtualLayout*>(m_OnlyLayout.obj());
++
++ LwpObjectHolder* pObjHolder =static_cast<LwpObjectHolder*>(m_Layouts.GetHead()->obj());
++ if(pObjHolder)
++ {
++ pLayout = static_cast<LwpVirtualLayout*>(pObjHolder->GetObject()->obj());
++ if(!pStartLayout )
++ return pLayout;
++
++ while(pObjHolder && pStartLayout != pLayout)
++ {
++ pObjHolder = static_cast<LwpObjectHolder*>(pObjHolder->GetNext()->obj());
++ if(pObjHolder)
++ {
++ pLayout = static_cast<LwpVirtualLayout*>(pObjHolder->GetObject()->obj());
++ }
++ }
++
++ if(pObjHolder)
++ {
++ pObjHolder = static_cast<LwpObjectHolder*>(pObjHolder->GetNext()->obj());
++ if(pObjHolder)
++ {
++ pLayout = static_cast<LwpVirtualLayout*>(pObjHolder->GetObject()->obj());
++ return pLayout;
++ }
++ }
++
++ //return pLayout;
++ }
++
++ return NULL;
++}
++
++LwpHeadLayout::LwpHeadLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpVirtualLayout(objHdr, pStrm)
++{}
++
++void LwpHeadLayout::Read()
++{
++ LwpVirtualLayout::Read();
++ //For PermissiveLayout
++ m_pObjStrm->SkipExtra();
++ //For me
++ m_pObjStrm->SkipExtra();
++}
++
++void LwpHeadLayout::RegisterStyle()
++{
++ //Register all children styles
++ LwpVirtualLayout* pLayout = static_cast<LwpVirtualLayout*>(GetChildHead()->obj());
++ while(pLayout)
++ {
++ pLayout->SetFoundry(m_pFoundry);
++ //if the layout is relative to para, the layout will be registered in para
++ if(!pLayout->IsRelativeAnchored())
++ {
++ pLayout->RegisterStyle();
++ }
++ pLayout = static_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj());
++ }
++}
++
++/**
++ * @descr find endnote supertable layout from the child layout list. Suppose that there is only one endnote supertablelayout in one division
++ * @return pointer to endnote supertable layout
++ */
++LwpVirtualLayout* LwpHeadLayout::FindEnSuperTableLayout()
++{
++ LwpVirtualLayout* pLayout = static_cast<LwpVirtualLayout*>(GetChildHead()->obj());
++ while(pLayout)
++ {
++ if(pLayout->GetLayoutType() == LWP_ENDNOTE_SUPERTABLE_LAYOUT)
++ {
++ return pLayout;
++ }
++ pLayout = static_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj());
++ }
++ return NULL;
++}
++
++LwpLayoutStyle::LwpLayoutStyle() :
++m_nStyleDefinition(0), m_nKey(0),
++m_pDescription(new LwpAtomHolder)
++{
++}
++
++LwpLayoutStyle::~LwpLayoutStyle()
++{
++ if (m_pDescription)
++ {
++ delete m_pDescription;
++ }
++}
++
++void LwpLayoutStyle::Read(LwpObjectStream* pStrm)
++{
++ pStrm->QuickRead(&m_nStyleDefinition, sizeof(m_nStyleDefinition));
++ m_pDescription->Read(pStrm);
++ if (pStrm->CheckExtra())
++ {
++ pStrm->QuickRead(&m_nKey, 2);
++ pStrm->SkipExtra();
++ }
++}
++
++LwpLayoutMisc::LwpLayoutMisc() :
++m_nGridDistance(0), m_nGridType(0),
++m_pContentStyle(new LwpAtomHolder)
++{
++}
++
++LwpLayoutMisc::~LwpLayoutMisc()
++{
++ if (m_pContentStyle)
++ {
++ delete m_pContentStyle;
++ }
++}
++
++void LwpLayoutMisc::Read(LwpObjectStream* pStrm)
++{
++ pStrm->QuickRead(&m_nGridType, 2);
++ pStrm->QuickRead(&m_nGridDistance, 4);
++ m_pContentStyle->Read(pStrm);
++ pStrm->SkipExtra();
++}
++
++LwpMiddleLayout::LwpMiddleLayout( LwpObjectHeader &objHdr, LwpSvStream* pStrm )
++ : LwpVirtualLayout(objHdr, pStrm),
++ m_pStyleStuff(new LwpLayoutStyle), m_pMiscStuff(new LwpLayoutMisc)
++{}
++
++LwpMiddleLayout::~LwpMiddleLayout()
++{
++ if (m_pStyleStuff)
++ {
++ delete m_pStyleStuff;
++ }
++ if (m_pMiscStuff)
++ {
++ delete m_pMiscStuff;
++ }
++}
++void LwpMiddleLayout::Read()
++{
++ LwpObjectStream* pStrm = m_pObjStrm;
++
++ LwpVirtualLayout::Read();
++
++ //skip CLiteLayout data;
++ LwpAtomHolder ContentClass;
++ ContentClass.Read(pStrm);
++ pStrm->SkipExtra();
++
++ // before layout hierarchy rework
++ if(LwpFileHeader::m_nFileRevision < 0x000B)
++ return;
++
++ m_Content.ReadIndexed(pStrm);
++
++ // 01/20/2005
++ m_BasedOnStyle.ReadIndexed(pStrm);
++ m_TabPiece.ReadIndexed(pStrm);
++
++ sal_uInt8 nWhatsItGot = 0;
++ pStrm->QuickRead(&nWhatsItGot, 1);
++
++ if (nWhatsItGot & DISK_GOT_STYLE_STUFF)
++ {
++ m_pStyleStuff->Read(pStrm);
++ }
++ if (nWhatsItGot & DISK_GOT_MISC_STUFF)
++ {
++ m_pMiscStuff->Read(pStrm);
++ }
++
++ m_LayGeometry.ReadIndexed(pStrm);
++ m_LayScale.ReadIndexed(pStrm);
++ m_LayMargins.ReadIndexed(pStrm);
++ m_LayBorderStuff.ReadIndexed(pStrm);
++ m_LayBackgroundStuff.ReadIndexed(pStrm);
++
++ if (pStrm->CheckExtra())
++ {
++ m_LayExtBorderStuff.ReadIndexed(pStrm);
++ pStrm->SkipExtra();
++ }
++ //end
++}
++
++#include "lwplaypiece.hxx"
++
++/**
++* @descr: Get the geometry of current layout
++*
++*/
++LwpLayoutGeometry* LwpMiddleLayout::GetGeometry()
++{
++ if( !m_LayGeometry.IsNull() )
++ {
++ return ( static_cast<LwpLayoutGeometry*> (m_LayGeometry.obj()) );
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpMiddleLayout* pLay = static_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->GetGeometry();
++ }
++ return NULL;
++}
++
++/**
++* @descr: Get layout height, measured by "cm"
++*
++*/
++double LwpMiddleLayout::GetGeometryHeight()
++{
++ LwpLayoutGeometry* pGeo = GetGeometry();
++ if(pGeo)
++ {
++ return ( LwpTools::ConvertFromUnitsToMetric( pGeo->GetHeight() ) );
++ }
++ else
++ return -1;
++}
++
++/**
++* @descr: Get layout width, measured by "cm"
++*
++*/
++double LwpMiddleLayout::GetGeometryWidth()
++{
++ LwpLayoutGeometry* pGeo = GetGeometry();
++ if(pGeo)
++ {
++ return ( LwpTools::ConvertFromUnitsToMetric( pGeo->GetWidth() ) );
++ }
++ else
++ return -1;
++}
++
++/**
++* @descr: Whether the margins is same as parent layout
++*
++*/
++BOOL LwpMiddleLayout::MarginsSameAsParent()
++{
++ if(m_nOverrideFlag & OVER_MARGINS)
++ {
++ return LwpVirtualLayout::MarginsSameAsParent();
++ }
++ if(!m_BasedOnStyle.IsNull())
++ {
++ LwpVirtualLayout* play = static_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj());
++ play->MarginsSameAsParent();
++ }
++ return LwpVirtualLayout::MarginsSameAsParent();
++
++}
++
++/**
++* @descr: Get margin
++* @param: nWhichSide - 0: left, 1: right, 2:top, 3: bottom
++*/
++double LwpMiddleLayout::GetMarginsValue(const sal_uInt8 &nWhichSide)
++{
++ double fValue = 0;
++ if((nWhichSide==MARGIN_LEFT)||(nWhichSide==MARGIN_RIGHT))
++ {
++ if ( MarginsSameAsParent() )
++ {
++ LwpVirtualLayout* pParent = static_cast<LwpVirtualLayout*> (GetParent()->obj());
++ if(pParent && !pParent->IsHeader())
++ {
++ fValue = pParent->GetMarginsValue(nWhichSide);
++ return fValue;
++ }
++ }
++ }
++
++ if(m_nOverrideFlag & OVER_MARGINS)
++ {
++ LwpLayoutMargins* pMar1 = static_cast<LwpLayoutMargins*> (m_LayMargins.obj());
++ if(pMar1)
++ {
++ fValue = pMar1->GetMargins()->GetMarginsValue(nWhichSide);
++ return fValue;
++ }
++ }
++ LwpVirtualLayout* pStyle = static_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj());
++ if(pStyle)
++ {
++ fValue = pStyle->GetMarginsValue(nWhichSide);
++ return fValue;
++ }
++ return LwpVirtualLayout::GetMarginsValue(nWhichSide);
++}
++/**
++ * @descr: Get extmargin value
++ * @param: nWhichSide - 0: left, 1: right, 2:top, 3: bottom
++ * @param:
++ * @return:
++*/
++double LwpMiddleLayout::GetExtMarginsValue(const sal_uInt8 &nWhichSide)
++{
++ double fValue = 0;
++ if(m_nOverrideFlag & OVER_MARGINS)
++ {
++ LwpLayoutMargins* pMar1 = static_cast<LwpLayoutMargins*> (m_LayMargins.obj());
++ if(pMar1)
++ {
++ fValue = pMar1->GetExtMargins()->GetMarginsValue(nWhichSide);
++ return fValue;
++ }
++ }
++ LwpVirtualLayout* pStyle = static_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj());
++ if(pStyle)
++ {
++ fValue = pStyle->GetExtMarginsValue(nWhichSide);
++ return fValue;
++ }
++ return LwpVirtualLayout::GetExtMarginsValue(nWhichSide);
++}
++/**
++ * @descr: Get the LwpBorderStuff object according to m_LayBorderStuff id.
++ * @param:
++ * @param:
++ * @return:
++*/
++LwpBorderStuff* LwpMiddleLayout::GetBorderStuff()
++{
++ if(m_nOverrideFlag & OVER_BORDERS)
++ {
++ LwpLayoutBorder* pLayoutBorder = static_cast<LwpLayoutBorder*>(m_LayBorderStuff.obj());
++ return pLayoutBorder->GetBorderStuff();
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpMiddleLayout* pLay = static_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->GetBorderStuff();
++ }
++ return NULL;
++}
++
++/**
++ * @descr: Get LwpBackgroundStuff object according to m_LayBackgroundStuff id;
++ * @param:
++ * @param:
++ * @return:
++*/
++LwpBackgroundStuff* LwpMiddleLayout::GetBackgroundStuff()
++{
++ if(m_nOverrideFlag & OVER_BACKGROUND)
++ {
++ LwpLayoutBackground* pLayoutBackground = static_cast<LwpLayoutBackground*>(m_LayBackgroundStuff.obj());
++ return pLayoutBackground->GetBackgoudStuff();
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpMiddleLayout* pLay = static_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->GetBackgroundStuff();
++ }
++ return NULL;
++}
++/**
++ * @descr: create xfborder.
++ * @param:
++ * @param:
++ * @return:
++*/
++XFBorders* LwpMiddleLayout::GetXFBorders()
++{
++ LwpBorderStuff* pBorderStuff = GetBorderStuff();
++ if(pBorderStuff&&pBorderStuff->GetSide() != 0)
++ {
++ //copy from lwpparastyle.
++ XFBorders *pXFBorders = new XFBorders();
++ // apply 4 borders respectively
++ LwpBorderStuff::BorderType pType[] = { LwpBorderStuff::LEFT, LwpBorderStuff::RIGHT,
++ LwpBorderStuff::TOP, LwpBorderStuff::BOTTOM };
++
++ for (sal_uInt8 nC = 0; nC < 4; nC++)
++ {
++ if (pBorderStuff->HasSide(pType[nC]))
++ {
++ LwpParaStyle::ApplySubBorder(pBorderStuff, pType[nC], pXFBorders);
++ }
++ }
++ return pXFBorders;
++ }
++ return NULL;
++}
++
++/**
++ * @descr: Get text direction settings.
++ * @param:
++ * @param:
++ * @return:
++*/
++enumXFTextDir LwpMiddleLayout::GetTextDirection()
++{
++ enumXFTextDir eTextDir = enumXFTextDirNone;
++ sal_uInt8 nDirection = GetContentOrientation();
++ switch(nDirection)
++ {
++ case TEXT_ORIENT_LRTB:
++ {
++ eTextDir = enumXFTextDirLR_TB;
++ break;
++ }
++ case TEXT_ORIENT_TBRL:
++ {
++ eTextDir = enumXFTextDirTB_RL;
++ break;
++ }
++ case TEXT_ORIENT_RLBT: // not supported now
++ {
++ eTextDir = enumXFTextDirNone;
++ break;
++ }
++ case TEXT_ORIENT_BTLR: // not supported now
++ {
++ eTextDir = enumXFTextDirNone;
++ break;
++ }
++ default:
++ break;
++ }
++ return eTextDir;
++}
++/**
++ * @descr: Get back ground color.
++ * @param:
++ * @param:
++ * @return:
++*/
++LwpColor* LwpMiddleLayout::GetBackColor()
++{
++ LwpBackgroundStuff* pBackgroundStuff = GetBackgroundStuff();
++ if(pBackgroundStuff && !pBackgroundStuff->IsTransparent())
++ {
++ LwpColor* pColor = pBackgroundStuff->GetFillColor();
++ if(pColor->IsValidColor())
++ {
++ return pColor;
++ }
++ }
++ return NULL;
++}
++
++/**
++ * @descr: Add back color settings into xfpagemaster.
++ * @param:
++ * @param:
++ * @return:
++*/
++LwpTabOverride* LwpMiddleLayout::GetTabOverride()
++{
++ if(m_nAttributes & OVER_TABS)
++ {
++ if(!m_TabPiece.IsNull())
++ return (LwpTabOverride*)static_cast<LwpTabPiece*>(m_TabPiece.obj())->GetOverride();
++ return NULL;
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpMiddleLayout* pLay = static_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->GetTabOverride();
++ }
++ return NULL;
++}
++
++/**
++ * @descr: Layscale for graphic & watermark
++ * @param:
++ * @param:
++ * @return:
++*/
++sal_uInt16 LwpMiddleLayout::GetScaleMode(void)
++{
++ if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj())
++ return GetLayoutScale()->GetScaleMode();
++ else if (m_BasedOnStyle.obj())
++ return static_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj())->GetScaleMode();
++ else
++ return (LwpLayoutScale::FIT_IN_FRAME | LwpLayoutScale::MAINTAIN_ASPECT_RATIO);
++}
++
++void LwpMiddleLayout::SetScaleMode(sal_uInt16 nVal)
++{
++ m_nOverrideFlag |= OVER_SCALING;
++// nVal |= LwpLayoutScale::MAINTAIN_ASPECT_RATIO;
++ GetLayoutScale()->SetScaleMode(nVal);
++}
++
++sal_uInt16 LwpMiddleLayout::GetScaleTile(void)
++{
++ if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj())
++ return (GetLayoutScale()->GetPlacement() & LwpLayoutScale::TILED)
++ ? 1 : 0;
++ else if (m_BasedOnStyle.obj())
++ return static_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj())->GetScaleTile();
++ else
++ return 0;
++}
++
++void LwpMiddleLayout::SetScaleTile(sal_uInt16 nVal)
++{
++ m_nOverrideFlag |= OVER_SCALING;
++ if (nVal)
++ GetLayoutScale()->SetPlacement(GetLayoutScale()->GetPlacement() | LwpLayoutScale::TILED);
++ else
++ GetLayoutScale()->SetPlacement(GetLayoutScale()->GetPlacement() & ~LwpLayoutScale::TILED);
++}
++
++sal_uInt16 LwpMiddleLayout::GetScaleCenter(void)
++{
++ if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj())
++ return (GetLayoutScale()->GetPlacement() & LwpLayoutScale::CENTERED)
++ ? 1 : 0;
++ else if (m_BasedOnStyle.obj())
++ return static_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj())->GetScaleCenter();
++ else
++ return 0;
++}
++
++void LwpMiddleLayout::SetScaleCenter(sal_uInt16 nVal)
++{
++ m_nOverrideFlag |= OVER_SCALING;
++ if (nVal)
++ GetLayoutScale()->SetPlacement(GetLayoutScale()->GetPlacement() | LwpLayoutScale::CENTERED);
++ else
++ GetLayoutScale()->SetPlacement(GetLayoutScale()->GetPlacement() & ~LwpLayoutScale::CENTERED);
++}
++
++sal_uInt32 LwpMiddleLayout::GetScalePercentage(void)
++{
++ if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj())
++ return GetLayoutScale()->GetScalePercentage()/10;//m_nScalePercentage 1000 = 100%
++ else if (m_BasedOnStyle.obj())
++ return static_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj())->GetScalePercentage();
++ else
++ return 100;
++}
++
++void LwpMiddleLayout::SetScalePercentage(sal_uInt32 nVal)
++{
++ m_nOverrideFlag |= OVER_SCALING;
++ GetLayoutScale()->SetScalePercentage(nVal*10);
++}
++
++double LwpMiddleLayout::GetScaleWidth(void)
++{
++ if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj())
++ return LwpTools::ConvertFromUnits(GetLayoutScale()->GetScaleWidth());
++ else if (m_BasedOnStyle.obj())
++ return static_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj())->GetScaleWidth();
++ else
++ return 0;
++}
++
++void LwpMiddleLayout::SetScaleWidth(double fVal)
++{
++ m_nOverrideFlag |= OVER_SCALING;
++ GetLayoutScale()->SetScaleWidth(LwpTools::ConvertToUnits(fVal));
++}
++
++double LwpMiddleLayout::GetScaleHeight(void)
++{
++ if ((m_nOverrideFlag & OVER_SCALING) && m_LayScale.obj())
++ return LwpTools::ConvertFromUnits(GetLayoutScale()->GetScaleHeight());
++ else if (m_BasedOnStyle.obj())
++ return static_cast<LwpMiddleLayout*>(m_BasedOnStyle.obj())->GetScaleHeight();
++ else
++ return 0;
++}
++sal_Bool LwpMiddleLayout::CanSizeRight(void)
++{
++ sal_uInt8 RelType = GetRelativeType();
++
++ if (RelType == LwpLayoutRelativityGuts::LAY_INLINE || RelType == LwpLayoutRelativityGuts::LAY_PARA_RELATIVE
++ || RelType == LwpLayoutRelativityGuts::LAY_INLINE_VERTICAL)
++ {
++ return sal_False;
++ }
++ return sal_True;
++}
++sal_Int32 LwpMiddleLayout::GetMinimumWidth()
++{
++ if (((m_nAttributes3 & STYLE3_WIDTHVALID) != 0) && GetGeometry())
++ {
++ return GetGeometry()->GetWidth();
++ }
++ else if (m_nOverrideFlag & OVER_SIZE)
++ {
++ return DetermineWidth();
++ }
++ return 0;
++}
++sal_Int32 LwpMiddleLayout::DetermineWidth()
++{
++ if (IsSizeRightToContent())
++ {
++ assert(sal_False);
++ }
++ else if (IsSizeRightToContainer())
++ {
++ assert(sal_False);
++ }
++ else
++ {
++ m_nAttributes3 |= STYLE3_WIDTHVALID;
++ return GetGeometry()->GetWidth();
++ }
++ return 0;
++}
++sal_Bool LwpMiddleLayout::IsSizeRightToContainer(void)
++{
++ if (!CanSizeRight())
++ return sal_False;
++
++ if (m_nOverrideFlag & OVER_SIZE)
++ {
++ return (m_nDirection & ((LAY_USEDIRECTION|LAY_AUTOSIZE|LAY_TOCONTAINER)
++ << SHIFT_RIGHT))
++ == ((LAY_USEDIRECTION | LAY_TOCONTAINER | LAY_AUTOSIZE) << SHIFT_RIGHT);
++ }
++ else if (m_BasedOnStyle.obj())
++ {
++ LwpMiddleLayout * pLayout = static_cast<LwpMiddleLayout *>(m_BasedOnStyle.obj());
++ return pLayout->IsSizeRightToContainer();
++ }
++ else
++ return sal_False;
++}
++sal_Bool LwpMiddleLayout::IsSizeRightToContent(void)
++{
++ if (!CanSizeRight())
++ return sal_False;
++
++ if (m_nOverrideFlag & OVER_SIZE)
++ {
++ return (m_nDirection & ((LAY_USEDIRECTION|LAY_AUTOSIZE|LAY_TOCONTAINER)
++ << SHIFT_RIGHT))
++ == ((LAY_USEDIRECTION | LAY_AUTOSIZE) << SHIFT_RIGHT);
++ }
++ else if (m_BasedOnStyle.obj())
++ {
++ LwpMiddleLayout * pLayout = static_cast<LwpMiddleLayout *>(m_BasedOnStyle.obj());
++ return pLayout->IsSizeRightToContent();
++ }
++ else
++ return sal_False;
++}
++
++/**
++* @descr: Get layout height
++*
++*/
++double LwpMiddleLayout::GetHeight()
++{
++ return GetGeometryHeight();
++}
++
++/**
++* @descr: Get layout height
++*
++*/
++double LwpMiddleLayout::GetWidth()
++{
++ return GetGeometryWidth();
++}
++/**
++* @descr: Get layout orgin point
++*
++*/
++LwpPoint LwpMiddleLayout::GetOrigin()
++{
++ LwpLayoutGeometry* pGeo = GetGeometry();
++ if(pGeo)
++ {
++ sal_uInt8 nType = GetRelativeType();
++ if(nType == LwpLayoutRelativityGuts::LAY_INLINE
++ || nType == LwpLayoutRelativityGuts::LAY_INLINE_NEWLINE )
++ {
++ return pGeo->GetAbsoluteOrigin();
++ }
++ else
++ return pGeo->GetOrigin();
++
++ }
++
++ return LwpPoint();
++}
++
++void LwpMiddleLayout::SetScaleHeight(double fVal)
++{
++ m_nOverrideFlag |= OVER_SCALING;
++ GetLayoutScale()->SetScaleHeight(LwpTools::ConvertToUnits(fVal));
++}
++
++/**
++* @descr: Whether the fill is pattern fill or not
++* @return: True if yes, false if not.
++*/
++sal_Bool LwpMiddleLayout::IsPatternFill()
++{
++ LwpBackgroundStuff* pBackgroundStuff = GetBackgroundStuff();
++ if (pBackgroundStuff)
++ {
++ return pBackgroundStuff->IsPatternFill();
++ }
++
++ return sal_False;
++}
++
++/**
++* @descr: Get the fill pattern style. Data are saved in a XFBGImage object
++* @return: the fill pattern style.
++*/
++XFBGImage* LwpMiddleLayout::GetFillPattern()
++{
++ LwpBackgroundStuff* pBackgroundStuff = GetBackgroundStuff();
++ if (pBackgroundStuff)
++ {
++ return pBackgroundStuff->GetFillPattern();
++ }
++
++ return NULL;
++
++}
++
++/**
++* @descr: Whether the height and width of layout is auto grow
++*
++*/
++sal_Bool LwpMiddleLayout::IsAutoGrow()
++{
++ if(m_nOverrideFlag & OVER_SIZE)
++ {
++ return m_nDirection &
++ ((LAY_AUTOGROW << SHIFT_UP) | (LAY_AUTOGROW << SHIFT_DOWN) |
++ (LAY_AUTOGROW << SHIFT_RIGHT) | (LAY_AUTOGROW << SHIFT_LEFT))
++ ? sal_True : sal_False;
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpMiddleLayout* pLay = static_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->IsAutoGrow();
++ }
++ return LwpVirtualLayout::IsAutoGrow();
++}
++
++/**
++* @descr: Whether the height of layout is auto grow down
++*
++*/
++sal_Bool LwpMiddleLayout::IsAutoGrowDown()
++{
++ if(m_nOverrideFlag & OVER_SIZE)
++ {
++ return m_nDirection & (LAY_AUTOGROW << SHIFT_DOWN) ? sal_True : sal_False;
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpMiddleLayout* pLay = static_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->IsAutoGrowDown();
++ }
++ return LwpVirtualLayout::IsAutoGrowDown();
++}
++
++/**
++* @descr: Whether the height of layout is auto grow up
++*
++*/
++sal_Bool LwpMiddleLayout::IsAutoGrowUp()
++{
++ if(m_nOverrideFlag & OVER_SIZE)
++ {
++ return m_nDirection & (LAY_AUTOGROW << SHIFT_UP) ? sal_True : sal_False;
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpMiddleLayout* pLay = static_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->IsAutoGrowUp();
++ }
++ return LwpVirtualLayout::IsAutoGrowUp();
++}
++
++/**
++* @descr: Whether the height of layout is auto grow down
++*
++*/
++sal_Bool LwpMiddleLayout::IsAutoGrowLeft()
++{
++ if(m_nOverrideFlag & OVER_SIZE)
++ {
++ return m_nDirection & (LAY_AUTOGROW << SHIFT_LEFT) ? sal_True : sal_False;
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpMiddleLayout* pLay = static_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->IsAutoGrowLeft();
++ }
++ return LwpVirtualLayout::IsAutoGrowLeft();
++}
++
++/**
++* @descr: Whether the height of layout is auto grow down
++*
++*/
++sal_Bool LwpMiddleLayout::IsAutoGrowRight()
++{
++ if(m_nOverrideFlag & OVER_SIZE)
++ {
++ return m_nDirection & (LAY_AUTOGROW << SHIFT_RIGHT) ? sal_True : sal_False;
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpMiddleLayout* pLay = static_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->IsAutoGrowRight();
++ }
++ return LwpVirtualLayout::IsAutoGrowRight();
++}
++
++
++/**
++* @descr: Get contents orientation
++*
++*/
++sal_uInt8 LwpMiddleLayout::GetContentOrientation()
++{
++ //content orientation in Graphic objects and OLE objects not supported now
++ if((m_nOverrideFlag & OVER_ROTATION)&& !m_LayGeometry.IsNull())
++ {
++ LwpLayoutGeometry* pLayGeometry = static_cast<LwpLayoutGeometry*> (m_LayGeometry.obj());
++ return pLayGeometry->GetContentOrientation();
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpMiddleLayout* pLay = static_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->GetContentOrientation();
++ }
++ return LwpVirtualLayout::GetContentOrientation();
++}
++
++/**
++* @descr: Whether it is honoring protection
++*
++*/
++sal_Bool LwpMiddleLayout::HonorProtection()
++{
++ if(m_nOverrideFlag & OVER_MISC)
++ {
++ if(!(m_nAttributes2 & STYLE2_HONORPROTECTION))
++ return sal_False;
++
++ LwpVirtualLayout* pParent = static_cast<LwpVirtualLayout*> (GetParent()->obj());
++ if(pParent && !pParent->IsHeader())
++ {
++ return pParent->HonorProtection();
++ }
++
++ if(m_pFoundry)//is null now
++ {
++ LwpDocument* pDoc = m_pFoundry->GetDocument();
++ if(pDoc)
++ {
++ return pDoc->HonorProtection();
++ }
++ }
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpMiddleLayout* pLay = static_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->HonorProtection();
++ }
++
++ return LwpVirtualLayout::HonorProtection();
++}
++
++/**
++* @descr: Whether it is pretected
++*
++*/
++sal_Bool LwpMiddleLayout::IsProtected()
++{
++ sal_Bool bProtected = sal_False;
++ if(m_nOverrideFlag & OVER_MISC)
++ {
++ bProtected = (m_nAttributes & STYLE_PROTECTED)!=0;
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpMiddleLayout* pLay = static_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() );
++ bProtected = pLay->IsProtected();
++ }
++ else
++ bProtected = LwpVirtualLayout::IsProtected();
++
++ LwpVirtualLayout* pParent = static_cast<LwpVirtualLayout*> (GetParent()->obj());
++ if(pParent && !pParent->IsHeader())
++ {
++ /* If a parent's protected then none of its children can be accessed. */
++ if(pParent->IsProtected())
++ return sal_True;
++
++ if(pParent->HonorProtection())
++ return bProtected;
++
++ /* If our parent isn't honoring protection then we aren't protected. */
++ return sal_False;
++
++ }
++ if(m_pFoundry)//is null now
++ {
++ LwpDocument* pDoc = m_pFoundry->GetDocument();
++ if(pDoc)
++ {
++ if (pDoc->HonorProtection())
++ return bProtected;
++
++ /* If the document isn't honoring protection then we aren't protected.*/
++ return sal_False;
++ }
++ }
++
++ return bProtected;
++}
++
++/**
++* @descr: Get watermark layout
++*
++*/
++LwpVirtualLayout* LwpMiddleLayout::GetWaterMarkLayout()
++{
++ LwpVirtualLayout* pLay = static_cast<LwpVirtualLayout*>(GetChildHead()->obj());
++ while(pLay)
++ {
++ if( pLay->IsForWaterMark())
++ {
++ return pLay;
++ }
++ pLay = static_cast<LwpVirtualLayout*> (pLay->GetNext()->obj());
++ }
++ return NULL;
++}
++
++/**
++* @descr: Create and reture xfbgimage object for watermark
++*
++*/
++XFBGImage* LwpMiddleLayout::GetXFBGImage()
++{
++ LwpMiddleLayout* pLay = static_cast<LwpMiddleLayout*>(GetWaterMarkLayout());
++ if(pLay)
++ {
++ //test BGImage
++ LwpGraphicObject* pGrfObj = static_cast<LwpGraphicObject*>(pLay->GetContent()->obj());
++ if(pGrfObj)
++ {
++ XFBGImage* pXFBGImage = new XFBGImage();
++
++ if(pGrfObj->IsLinked())
++ {
++ //set file link
++ OUString linkedfilepath = pGrfObj->GetLinkedFilePath();
++ OUString fileURL = LwpTools::convertToFileUrl(OUStringToOString(linkedfilepath, osl_getThreadTextEncoding()));
++ pXFBGImage->SetFileLink(fileURL);
++ }
++ else
++ {
++ sal_uInt8* pGrafData = NULL;
++ sal_uInt32 nDataLen = pGrfObj->GetRawGrafData(pGrafData);
++ pXFBGImage->SetImageData(pGrafData, nDataLen);
++ if(pGrafData)
++ {
++ delete pGrafData;
++ pGrafData = NULL;
++ }
++ }
++
++
++ //automatic, top left
++ pXFBGImage->SetPosition(enumXFAlignStart,enumXFAlignTop);
++ if(pLay->GetScaleCenter())
++ {
++ //center
++ pXFBGImage->SetPosition(enumXFAlignCenter,enumXFAlignCenter);
++ }
++ else if(pLay->GetScaleTile())
++ {
++ //tile
++ pXFBGImage->SetRepeate();
++ }
++ //fit type, area type
++ if((pLay->GetScaleMode()& LwpLayoutScale::FIT_IN_FRAME)!=0)
++ {
++ if((pLay->GetScaleMode()& LwpLayoutScale::MAINTAIN_ASPECT_RATIO)==0)
++ {
++ pXFBGImage->SetStretch();
++ }
++ }
++ return pXFBGImage;
++ }
++ }
++ return NULL;
++}
++
++/**
++* @descr: Whether the page uses the printer setting
++*
++*/
++sal_Bool LwpMiddleLayout::GetUsePrinterSettings()
++{
++ if(m_nOverrideFlag & OVER_SIZE)
++ {
++ return (m_nAttributes3 & STYLE3_USEPRINTERSETTINGS) != 0;
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpMiddleLayout* pLay = static_cast<LwpMiddleLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->GetUsePrinterSettings();
++ }
++ return sal_False;
++}
++
++
++//Check whether there are contents in the layout
++sal_Bool LwpMiddleLayout::HasContent()
++{
++ LwpObject* content = m_Content.obj();
++ if(content)
++ return sal_True;
++ return sal_False;
++}
++//End by
++
++LwpLayout::LwpLayout( LwpObjectHeader &objHdr, LwpSvStream* pStrm ) :
++ LwpMiddleLayout(objHdr, pStrm), m_pUseWhen(new LwpUseWhen)
++{}
++
++LwpLayout::~LwpLayout()
++{
++ if (m_pUseWhen)
++ {
++ delete m_pUseWhen;
++ }
++}
++
++void LwpLayout::Read()
++{
++ LwpObjectStream* pStrm = m_pObjStrm;
++
++ LwpMiddleLayout::Read();
++ if (LwpFileHeader::m_nFileRevision < 0x000B)
++ {
++ // read PreRevBLayout...
++ }
++ else
++ {
++ sal_uInt16 nSimple;
++ pStrm->QuickRead(&nSimple, 2);
++
++ if (!nSimple)
++ {
++ m_pUseWhen->Read(pStrm);
++
++ sal_uInt8 nFlag;
++ pStrm->QuickRead(&nFlag, 1);
++ if (nFlag)
++ {
++ m_Positon.ReadIndexed(pStrm);
++ }
++ }
++
++ m_LayColumns.ReadIndexed(pStrm);
++ m_LayGutterStuff.ReadIndexed(pStrm);
++ m_LayJoinStuff.ReadIndexed(pStrm);
++ m_LayShadow.ReadIndexed(pStrm);
++
++ if (pStrm->CheckExtra())
++ {
++ m_LayExtJoinStuff.ReadIndexed(pStrm);
++ pStrm->SkipExtra();
++ }
++ }
++}
++
++/**
++* @descr: Get columns number
++*
++*/
++sal_uInt16 LwpLayout::GetNumCols()
++{
++ if(m_nOverrideFlag & OVER_COLUMNS)
++ {
++ LwpLayoutColumns* pLayColumns = static_cast<LwpLayoutColumns*>(m_LayColumns.obj());
++ if(pLayColumns)
++ {
++ return pLayColumns->GetNumCols();
++ }
++ }
++
++ LwpVirtualLayout* pStyle = static_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj());
++ if(pStyle)
++ {
++ return pStyle->GetNumCols();
++ }
++
++ return LwpVirtualLayout::GetNumCols();
++
++}
++
++/**
++* @descr: Get column width
++* @param: the order of column
++*/
++double LwpLayout::GetColWidth(sal_uInt16 nIndex)
++{
++ if((m_nOverrideFlag & OVER_COLUMNS)||(m_nAttributes2 & STYLE2_LOCALCOLUMNINFO))
++ {
++ LwpLayoutColumns* pLayColumns = static_cast<LwpLayoutColumns*>(m_LayColumns.obj());
++ if(pLayColumns)
++ {
++ return pLayColumns->GetColWidth(nIndex);
++ }
++ }
++
++ LwpVirtualLayout* pStyle = static_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj());
++ if(pStyle)
++ {
++ return pStyle->GetColWidth(nIndex);
++ }
++
++ return LwpVirtualLayout::GetColWidth(nIndex);
++
++}
++
++/**
++* @descr: Get gap between columns
++* @param: the order of column
++*/
++double LwpLayout::GetColGap(sal_uInt16 nIndex)
++{
++ if((m_nOverrideFlag & OVER_COLUMNS)||(m_nAttributes2 & STYLE2_LOCALCOLUMNINFO))
++ {
++ LwpLayoutColumns* pLayColumns = static_cast<LwpLayoutColumns*>(m_LayColumns.obj());
++ if(pLayColumns)
++ {
++ return pLayColumns->GetColGap(nIndex);
++ }
++ }
++
++ LwpVirtualLayout* pStyle = static_cast<LwpVirtualLayout*> (m_BasedOnStyle.obj());
++ if(pStyle)
++ {
++ return pStyle->GetColGap(nIndex);
++ }
++
++ return LwpVirtualLayout::GetColGap(nIndex);
++}
++
++/**
++* @descr: Create and return XFColumns object
++*
++*/
++XFColumns* LwpLayout::GetXFColumns()
++{
++ //if there is only one column, do not need insert columns
++ sal_uInt16 nCols = GetNumCols();
++ if(nCols==1)
++ {
++ return NULL;
++ }
++
++ XFColumns* pColumns = new XFColumns();
++ //set XFColumnSep
++ XFColumnSep* pColumnSep = GetColumnSep();
++ if(pColumnSep)
++ {
++ pColumns->SetSeperator(*pColumnSep);
++ }
++
++ //set column count and column gap
++ pColumns->SetCount(nCols);
++ double fGap = GetColGap(0);
++ pColumns->SetGap(fGap);
++
++ //set xfcolumn
++ for(sal_uInt16 nIndex = 0; nIndex<nCols; nIndex++)
++ {
++ XFColumn* pColumn = new XFColumn();
++ sal_Int32 nWidth = static_cast<sal_Int32>(GetColWidth(nIndex));
++ nWidth=8305/nCols; //relative width
++ pColumn->SetRelWidth(nWidth);
++
++ //the left and right margins is 0;
++ double nGap = GetColGap(nIndex)/2;
++ //nGap=0;
++ pColumn->SetMargins(nGap,nGap);
++ if(nIndex==0)
++ {
++ pColumn->SetMargins(0,nGap);
++ }
++ if(nIndex==(nCols-1))
++ {
++ pColumn->SetMargins(nGap,0);
++ }
++ pColumns->AddColumn(*pColumn);
++ }
++
++ return pColumns;
++}
++
++/**
++* @descr: Create and return XFColumnSep object
++*
++*/
++XFColumnSep* LwpLayout::GetColumnSep()
++{
++
++ //Get LwpLayoutGutters
++ LwpLayoutGutters* pLayoutGutters = static_cast<LwpLayoutGutters*>(m_LayGutterStuff.obj());
++ if(!pLayoutGutters)
++ {
++ return NULL;
++ }
++
++ LwpBorderStuff* pBorderStuff = pLayoutGutters->GetBorderStuff();
++
++ if(pBorderStuff)
++ {
++ LwpBorderStuff::BorderType eType = LwpBorderStuff::LEFT;
++ LwpColor aColor = pBorderStuff->GetSideColor(eType);
++ double fWidth = pBorderStuff->GetSideWidth(eType);
++ //sal_uInt16 nType = pBorderStuff->GetSideType(eType);
++
++ XFColumnSep* pColumnSep = new XFColumnSep();
++ XFColor aXFColor(aColor.To24Color());
++ pColumnSep->SetColor(aXFColor);
++ pColumnSep->SetWidth(fWidth);
++ pColumnSep->SetRelHeight(100);
++ pColumnSep->SetVerticalAlign(enumXFAlignTop);
++
++ return pColumnSep;
++ }
++ return NULL;
++
++}
++
++/**
++* @descr: Get use when type
++*
++*/
++LwpLayout::UseWhenType LwpLayout::GetUseWhenType()
++{
++ UseWhenType eType = StartWithinPage;
++ LwpUseWhen* pUseWhen = GetUseWhen();
++ if(pUseWhen)
++ {
++ if(pUseWhen->IsStartOnThisHF())
++ {
++ eType = StartWithinColume;
++ }
++ else if(pUseWhen->IsStartOnThisPage())
++ {
++ eType = StartWithinPage;
++ }
++ else if(pUseWhen->IsStartOnNextPage())
++ {
++ eType = StartOnNextPage;
++ }
++ else if(pUseWhen->IsStartOnNextOddPage())
++ {
++ eType = StartOnOddPage;
++ }
++ else if(pUseWhen->IsStartOnNextEvenPage())
++ {
++ eType = StartOnEvenPage;
++ }
++
++ }
++ else
++ {
++ eType = StartOnNextPage;
++ }
++ return eType;
++}
++
++/**
++* @descr: Get use page
++*
++*/
++sal_uInt16 LwpLayout::GetUsePage()
++{
++ if(m_nOverrideFlag & OVER_PLACEMENT)
++ {
++ LwpUseWhen* pUseWhen = GetUseWhen();
++ if(pUseWhen)
++ return pUseWhen->GetUsePage();
++ else
++ return NULL;
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpLayout* pLay = static_cast<LwpLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->GetUsePage();
++ }
++ return 0;
++}
++
++/**
++* @descr: Get usewhen pointer
++*
++*/
++LwpUseWhen* LwpLayout::VirtualGetUseWhen()
++{
++ if(m_nOverrideFlag & OVER_PLACEMENT)
++ {
++ return m_pUseWhen;
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpLayout* pLay = static_cast<LwpLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->VirtualGetUseWhen();
++ }
++ return LwpVirtualLayout::VirtualGetUseWhen();
++}
++
++/**
++* @descr: Whether it is use on all pages
++*
++*/
++sal_Bool LwpLayout::IsUseOnAllPages()
++{
++ if(m_nOverrideFlag & OVER_PLACEMENT)
++ {
++ LwpUseWhen* pUseWhen = GetUseWhen();
++ if(pUseWhen)
++ return pUseWhen->IsUseOnAllPages();
++ else
++ return NULL;
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpLayout* pLay = static_cast<LwpLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->IsUseOnAllPages();
++ }
++ return LwpVirtualLayout::IsUseOnAllPages();
++}
++
++/**
++* @descr: Whether it is use on all even pages
++*
++*/
++sal_Bool LwpLayout::IsUseOnAllEvenPages()
++{
++ if(m_nOverrideFlag & OVER_PLACEMENT)
++ {
++ LwpUseWhen* pUseWhen = GetUseWhen();
++ if(pUseWhen)
++ return pUseWhen->IsUseOnAllEvenPages();
++ else
++ return NULL;
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpLayout* pLay = static_cast<LwpLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->IsUseOnAllEvenPages();
++ }
++ return LwpVirtualLayout::IsUseOnAllEvenPages();
++}
++
++/**
++* @descr: Whether it is use on all odd pages
++*
++*/
++sal_Bool LwpLayout::IsUseOnAllOddPages()
++{
++ if(m_nOverrideFlag & OVER_PLACEMENT)
++ {
++ LwpUseWhen* pUseWhen = GetUseWhen();
++ if(pUseWhen)
++ return pUseWhen->IsUseOnAllOddPages();
++ else
++ return NULL;
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpLayout* pLay = static_cast<LwpLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->IsUseOnAllOddPages();
++ }
++ return LwpVirtualLayout::IsUseOnAllOddPages();
++}
++
++/**
++* @descr: Whether it is use on current page
++*
++*/
++sal_Bool LwpLayout::IsUseOnPage()
++{
++ if(m_nOverrideFlag & OVER_PLACEMENT)
++ {
++ LwpUseWhen* pUseWhen = GetUseWhen();
++ if(pUseWhen)
++ return pUseWhen->IsUseOnPage();
++ else
++ return NULL;
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpLayout* pLay = static_cast<LwpLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->IsUseOnPage();
++ }
++ return LwpVirtualLayout::IsUseOnPage();
++}
++
++/**
++ * @descr: Get the LwpShadow object according to m_LayShadow id.
++ * @param:
++ * @param:
++ * @return:
++*/
++LwpShadow* LwpLayout::GetShadow()
++{
++ if(m_nOverrideFlag & OVER_SHADOW)
++ {
++ LwpLayoutShadow* pLayoutShadow = static_cast<LwpLayoutShadow*>(m_LayShadow.obj());
++ return pLayoutShadow->GetShadow();
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpLayout* pLay = static_cast<LwpLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->GetShadow();
++ }
++ return NULL;
++}
++
++/**
++ * @descr: create xfshadow
++ * @param:
++ * @param:
++ * @return:
++*/
++XFShadow* LwpLayout::GetXFShadow()
++{
++ LwpShadow* pShadow = GetShadow();
++ if( pShadow )
++ {
++ LwpColor color = pShadow->GetColor();
++ double offsetX = pShadow->GetOffsetX();
++ double offsetY = pShadow->GetOffsetY();
++
++ if( offsetX && offsetY && color.IsValidColor() )
++ {
++ XFShadow* pXFShadow = new XFShadow();
++ enumXFShadowPos eXFShadowPos = enumXFShadowLeftTop;
++ double fOffset = 0;
++
++ sal_Bool left = sal_False;
++ sal_Bool top = sal_False;
++ if( offsetX < 0 )
++ left = sal_True;
++ if( offsetY < 0 )
++ top = sal_True;
++ if( left )
++ {
++ fOffset = -offsetX;
++ if( top )
++ eXFShadowPos = enumXFShadowLeftTop;
++ else
++ eXFShadowPos = enumXFShadowLeftBottom;
++ }
++ else
++ {
++ fOffset = offsetX;
++ if( top )
++ eXFShadowPos = enumXFShadowRightTop;
++ else
++ eXFShadowPos = enumXFShadowRightBottom;
++ }
++
++ pXFShadow->SetPosition(eXFShadowPos);
++ pXFShadow->SetOffset(fOffset);
++ pXFShadow->SetColor(XFColor(color.To24Color()));
++
++ return pXFShadow;
++ }
++ }
++ return NULL;
++}
++
++/**
++ * @descr get the layout that containers the current frame layout
++ *
++ */
++LwpVirtualLayout* LwpLayout::GetContainerLayout()
++{
++ if(IsRelativeAnchored())
++ {
++ //get position
++ LwpPara* pPara = static_cast<LwpPara*>(GetPosition()->obj());
++ if(pPara)
++ {
++ LwpStory* pStory = pPara->GetStory();
++ return pStory->GetTabLayout();
++ }
++ }
++ return GetParentLayout();
++}
++
++LwpPlacableLayout::LwpPlacableLayout( LwpObjectHeader &objHdr, LwpSvStream* pStrm )
++ : LwpLayout(objHdr, pStrm),m_pFont(NULL)
++{}
++
++LwpPlacableLayout::~LwpPlacableLayout()
++{}
++
++void LwpPlacableLayout::Read()
++{
++ LwpObjectStream* pStrm = m_pObjStrm;
++ LwpLayout::Read();
++ if(LwpFileHeader::m_nFileRevision < 0x000B)
++ {
++ assert(false);
++ }
++ else
++ {
++ sal_uInt16 simple;
++ pStrm->QuickRead(&simple, sizeof(simple));
++ if(!simple)
++ {
++ pStrm->QuickRead(&m_nWrapType, sizeof(m_nWrapType));
++ pStrm->QuickRead(&m_nBuoyancy, sizeof(m_nBuoyancy));
++ pStrm->QuickRead(&m_nBaseLineOffset, sizeof(m_nBaseLineOffset));
++ m_Script.Read( pStrm);
++ }
++ else
++ {
++ m_nWrapType = LAY_WRAP_AROUND;
++ m_nBuoyancy = LAY_BUOYNEUTRAL;
++ m_nBaseLineOffset = 0;
++ }
++ m_LayRelativity.ReadIndexed( pStrm);
++ if(pStrm->CheckExtra())
++ {
++ sal_uInt16 count;
++ pStrm->QuickRead(&count, sizeof(count));
++ if(count)
++ {
++ // temporily added by to avoid assertion
++ while (count)
++ {
++ LwpPoint aPoint;
++ aPoint.Read(pStrm);
++ count--;
++ }
++ // end added by
++ }
++ pStrm->SkipExtra();
++ }
++ }
++}
++/**
++ * @descr: get wrap type
++ * @param:
++ * @param:
++ * @return:
++*/
++sal_uInt8 LwpPlacableLayout::GetWrapType()
++{
++ if(m_nOverrideFlag & OVER_PLACEMENT)
++ {
++ return m_nWrapType;
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpPlacableLayout* pLay = static_cast<LwpPlacableLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->GetWrapType();
++ }
++ return LAY_WRAP_AROUND;
++}
++/**
++ * @descr: get LayoutRelativity
++ * @param:
++ * @param:
++ * @return:
++*/
++LwpLayoutRelativity* LwpPlacableLayout::GetRelativityPiece()
++{
++ if(!m_LayRelativity.IsNull())
++ {
++ if(m_nOverrideFlag & OVER_PLACEMENT)
++ {
++ return static_cast<LwpLayoutRelativity*>(m_LayRelativity.obj());
++ }
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpPlacableLayout* pLay = static_cast<LwpPlacableLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->GetRelativityPiece();
++ }
++ return NULL;
++}
++/**
++* @descr: Get relative type
++*
++*/
++sal_uInt8 LwpPlacableLayout::GetRelativeType()
++{
++ LwpLayoutRelativity* pLayRel = GetRelativityPiece();
++ if(pLayRel)
++ {
++ return pLayRel->GetRelGuts()->GetRelativeType();
++ }
++ return LwpVirtualLayout::GetRelativeType();
++}
++/**
++* @descr: Get relative from where type
++*
++*/
++sal_uInt8 LwpPlacableLayout::GetRelativeFromWhere()
++{
++ LwpLayoutRelativity* pLayRel = GetRelativityPiece();
++ if(pLayRel)
++ {
++ return pLayRel->GetRelGuts()->GetRelativeFromWhere();
++ }
++ return 0;
++}
++/**
++* @descr: Get relative distance
++*
++*/
++LwpPoint LwpPlacableLayout::GetRelativeDistance()
++{
++ LwpPoint aPoint;
++ LwpLayoutRelativity* pLayRel = GetRelativityPiece();
++ if(pLayRel)
++ {
++ aPoint = pLayRel->GetRelGuts()->GetRelativeDistance();
++ }
++ return aPoint;
++}
++/**
++* @descr: Get tether type
++*
++*/
++sal_uInt8 LwpPlacableLayout::GetTetherType()
++{
++ LwpLayoutRelativity* pLayRel = GetRelativityPiece();
++ if(pLayRel)
++ {
++ return pLayRel->GetRelGuts()->GetTetherType();
++ }
++ return 0;
++}
++/**
++* @descr: Get tether where type
++*
++*/
++sal_uInt8 LwpPlacableLayout::GetTetherWhere()
++{
++ LwpLayoutRelativity* pLayRel = GetRelativityPiece();
++ if(pLayRel)
++ {
++ return pLayRel->GetRelGuts()->GetTetherWhere();
++ }
++ return 0;
++}
++/**
++* @descr: Get offset from the baseline
++*
++*/
++sal_Int32 LwpPlacableLayout::GetBaseLineOffset()
++{
++ /* The baseline is only valid if this is flow-with-text */
++ if(GetRelativeType()!=LwpLayoutRelativityGuts::LAY_INLINE)
++ {
++ return 0;
++ }
++
++ // First, ask our content if it has a baseline, ignore now
++ /*
++ if (Content && Content->GetBaseLineOffset(&Baseline))
++ return Baseline;
++ */
++
++ if(m_nOverrideFlag & OVER_PLACEMENT)
++ {
++ return m_nBaseLineOffset;
++ }
++ else if( !m_BasedOnStyle.IsNull() )
++ {
++ LwpPlacableLayout* pLay = static_cast<LwpPlacableLayout*> ( m_BasedOnStyle.obj() );
++ return pLay->GetBaseLineOffset();
++ }
++ return 0;
++
++
++}
++/**
++* @descr: whether the parent layout is page layout
++*
++*/
++sal_Bool LwpPlacableLayout::IsAnchorPage()
++{
++ if(IsRelativeAnchored())
++ return sal_False;
++
++ LwpVirtualLayout* pLayout = GetParentLayout();
++ if(pLayout && (pLayout->IsPage() || pLayout->IsHeader() || pLayout->IsFooter()))
++ //if(pLayout && pLayout->IsPage())
++ {
++ return sal_True;
++ }
++ return sal_False;
++}
++/**
++* @descr: whether the parent layout is frame layout
++*
++*/
++sal_Bool LwpPlacableLayout::IsAnchorFrame()
++{
++ if(IsRelativeAnchored())
++ return sal_False;
++
++ LwpVirtualLayout* pLayout = GetParentLayout();
++ if(pLayout && (pLayout->IsFrame()||pLayout->IsGroupHead()))
++ {
++ return sal_True;
++ }
++ return sal_False;
++}
++/**
++* @descr: whether the parent layout is cell layout
++*
++*/
++sal_Bool LwpPlacableLayout::IsAnchorCell()
++{
++ if(IsRelativeAnchored())
++ return sal_False;
++
++ LwpVirtualLayout* pLayout = GetParentLayout();
++ if(pLayout && pLayout->IsCell())
++ {
++ return sal_True;
++ }
++ return sal_False;
++}
++
++/**
++* @descr: Get font style for setting position of frame
++*
++*/
++XFFont* LwpPlacableLayout::GetFont()
++{
++ return m_pFont;
++}
++/**
++* @descr: Set font style for setting position of frame
++*
++*/
++void LwpPlacableLayout::SetFont(XFFont * pFont)
++{
++ m_pFont = pFont;
++}
+diff -urNp lotuswordpro.bak/source/filter/lwplayoutdef.hxx lotuswordpro/source/filter/lwplayoutdef.hxx
+--- lotuswordpro.bak/source/filter/lwplayoutdef.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwplayoutdef.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,170 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _LWPLAYOUTDEF_HXX
++#define _LWPLAYOUTDEF_HXX
++
++#define STYLE_AUTOLINK 0x01UL /* content span's to next container */
++#define STYLE_SELECTABLE 0x02UL /* selectable container */
++#define STYLE_SHARED 0x04UL /* is this a global layout style */
++#define STYLE_PAINTMARGINSINCOLOR 0x8UL /* does this layout paint margins */
++#define STYLE_PROTECTED 0x10UL /* is this layout protected */
++#define STYLE_LOCAL 0x20UL /* is local layout */
++#define STYLE_NOERRORCHECK 0x40UL /* is error checking enabled */
++#define STYLE_HEADING 0x80UL /* heading */
++#define STYLE_MUTE 0x100UL /* gray modify menu */
++#define STYLE_SCRIPTING 0x200UL /* scripting enabled */
++#define STYLE_CONTENTREPLACEABLE 0x400UL /* contents can be replaced */
++#define STYLE_PRINTABLE 0x800UL /* contents can be printed */
++#define STYLE_COLUMNBALANCE 0x1000UL
++#define STYLE_LANDSCAPE 0x2000UL
++#define STYLE_COLLAPSIBLE 0x4000UL
++#define STYLE_COLLAPSED 0x8000UL
++#define STYLE_NOTCOPYABLE 0x10000UL
++#define STYLE_PARENTSELECTABLE 0x20000UL
++#define STYLE_CONNECTED 0x40000UL
++#define STYLE_OVERRIDE 0x80000UL /* is layout an override */
++#define STYLE_SELECTED 0x100000UL
++#define STYLE_CENTEREDHORIZONTALLY 0x200000UL
++#define STYLE_CREATIONREVISION 0x400000UL
++#define STYLE_DELETIONREVISION 0x800000UL
++#define STYLE_PAGEBREAK 0x1000000UL
++#define STYLE_MODIFIED 0x2000000UL
++#define STYLE_INDIRECT 0x4000000UL /* double click required */
++#define STYLE_COMPLEX 0x8000000UL
++#define STYLE_CENTEREDVERTICALLY 0x10000000UL
++#define STYLE_BOTTOMALIGNED 0x20000000UL
++#define STYLE_NOTGROUPABLE 0x40000000UL
++#define STYLE_ABSOLUTE 0x80000000UL
++// Don't assign these flags from one layout to another
++#define STYLE_DONTASSIGN (STYLE_SHARED)
++
++#define STYLE2_VSCROLLABLE 0x1UL
++#define STYLE2_HSCROLLABLE 0x2UL
++#define STYLE2_SCROLLABLE 0x3UL
++#define STYLE2_MIRROR 0x4UL
++#define STYLE2_PRIVATE 0x8UL
++#define STYLE2_PUBLIC 0x00UL
++#define STYLE2_PRIVATE2 0x10UL
++#define STYLE2_PROTECTED 0x20UL
++#define STYLE2_ACCESSRIGHTS 0x30UL
++#define STYLE2_HONORPROTECTION 0x40UL
++#define STYLE2_CHILDSPANNABLE 0x80UL
++#define STYLE2_DEACTIVATED 0x200UL
++#define STYLE2_NOCONTENTREFERENCE 0x400UL
++#define STYLE2_ADOPTED 0x800UL
++#define STYLE2_NOTUSERDELETEABLE 0x1000UL
++#define STYLE2_EXPANDRIGHT 0x2000UL
++#define STYLE2_EXPANDLEFT 0x4000UL
++#define STYLE2_EXPANDUP 0x8000UL
++#define STYLE2_EXPANDDOWN 0x10000UL
++#define STYLE2_NOTDIRTYABLE 0x20000UL
++#define STYLE2_NONHIERARCHICAL 0x40000UL // Now not used
++#define STYLE2_NOTSIZABLE 0x80000UL
++#define STYLE2_MARGINSSAMEASPARENT 0x100000UL
++#define STYLE2_DISPLAYANCHORPOINTS 0x200000UL
++#define STYLE2_DISPLAYTETHERPOINTS 0x400000UL
++#define STYLE2_SNAPTO 0x800000UL
++#define STYLE2_NOINTERSECTSIBLINGS 0x1000000UL
++#define STYLE2_LOCALCOLUMNINFO 0x2000000UL
++#define STYLE2_INOVERRIDE 0x4000000UL
++#define STYLE2_FROMSTYLE 0x8000000UL
++#define STYLE2_CONTENTFROMSTYLE 0x10000000UL
++#define STYLE2_TEMPORARY 0x20000000UL
++#define STYLE2_JUSTIFIABLE 0x40000000UL
++// Don't assign these flags from one layout to another
++#define STYLE2_DONTASSIGN (STYLE2_DEACTIVATED | \
++ STYLE2_NOCONTENTREFERENCE)
++
++#define STYLE3_ORIGINVALID 0x0001UL
++#define STYLE3_WIDTHVALID 0x0002UL
++#define STYLE3_MINHEIGHTVALID 0x0004UL
++#define STYLE3_STYLELAYOUT 0x0008UL
++#define STYLE3_LINELOCATION1 0x0010UL
++#define STYLE3_LINELOCATION2 0x0020UL
++#define STYLE3_OPENED 0x0040UL
++#define STYLE3_ORIENTSWITHPARENT 0x0080UL
++#define STYLE3_FROZEN 0x0100UL
++#define STYLE3_VALUE_VALID 0x0200UL // moved from CLayout
++#define STYLE3_USEPRINTERSETTINGS 0x0400UL // moved from CLayout
++#define STYLE3_ISAMIPROTABLE 0x0800UL // wrap tables around frames
++ // like Ami Pro
++#define STYLE3_INLINETOMARGIN 0x1000UL // for Croom
++
++#define OVER_PLACEMENT 0x01UL
++#define OVER_SIZE 0x02UL
++#define OVER_MARGINS 0x04UL
++#define OVER_BORDERS 0x08UL
++#define OVER_BACKGROUND 0x10UL
++#define OVER_SHADOW 0x20UL
++#define OVER_JOIN 0x40UL
++#define OVER_COLUMNS 0x80UL
++#define OVER_ROTATION 0x100UL
++#define OVER_SCALING 0x200UL
++#define OVER_NUMERICS 0x400UL
++#define OVER_TABS 0x800UL
++#define OVER_SCRIPT 0x1000UL
++#define OVER_LEADERS 0x2000UL
++#define OVER_ORIENTATION 0x4000UL
++#define OVER_MISC 0x8000UL
++#define OVER_INTERNAL 0x10000UL // User can't access these props.
++
++// the first 4 orientations are left-handed
++// and are simply rotated forms of each other
++#define TEXT_ORIENT_LRTB 0 // left to right, top to bottom
++#define TEXT_ORIENT_TBRL 1 // top to bottom, right to left
++#define TEXT_ORIENT_RLBT 2 // right to left, bottom to top
++#define TEXT_ORIENT_BTLR 3 // bottom to top, left to right
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwplayout.hxx lotuswordpro/source/filter/lwplayout.hxx
+--- lotuswordpro.bak/source/filter/lwplayout.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwplayout.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,458 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPLAYOUT_HXX
++#define _LWPLAYOUT_HXX
++
++#include "lwpheader.hxx"
++#include "lwpobj.hxx"
++#include "lwpobjhdr.hxx"
++#include "lwpobjstrm.hxx"
++#include "lwpobjid.hxx"
++#include "lwpdlvlist.hxx"
++#include "lwpfilehdr.hxx"
++
++#include "lwplayoutdef.hxx"
++#include "xfilter/xfdefs.hxx"
++#include "xfilter/xfpagemaster.hxx"
++#include "xfilter/xfcolumns.hxx"
++#include "xfilter/xfborders.hxx"
++#include "xfilter/xfframestyle.hxx"
++#include "xfilter/xfframe.hxx"
++#include "xfilter/xfbgimage.hxx"
++#include "lwpusewhen.hxx"
++
++#define ANCHOR_HEIGHT 0x120000
++#define FIRST_LAYOUTPAGENO 0x0001
++#define LAST_LAYOUTPAGENO 0xffff
++
++#define LAY_BUOYFLOAT 0x01
++#define LAY_BUOYNEUTRAL 0x02
++#define LAY_BUOYSINK 0x03
++#define LAY_BUOYLAYER 0x80
++
++class LwpPara;
++class LwpVirtualLayout : public LwpDLNFPVList
++{
++public:
++ LwpVirtualLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpVirtualLayout(){};
++ virtual sal_Bool MarginsSameAsParent();
++ inline virtual sal_uInt16 GetNumCols(){return 1;}
++ virtual double GetColWidth(sal_uInt16 nIndex);
++ virtual double GetColGap(sal_uInt16 nIndex);
++ virtual double GetMarginsValue(const sal_uInt8& nWhichSide){return 0;}
++ virtual double GetExtMarginsValue(const sal_uInt8& nWhichSide){return 0;}
++ virtual sal_Bool IsAutoGrow(){ return sal_False;}
++ virtual sal_Bool IsAutoGrowUp(){ return sal_False;}
++ virtual sal_Bool IsAutoGrowDown(){ return sal_False;}
++ virtual sal_Bool IsAutoGrowLeft(){ return sal_False;};
++ virtual sal_Bool IsAutoGrowRight(){ return sal_False;};
++ virtual sal_Bool IsFitGraphic();
++ virtual sal_Bool IsAutoGrowWidth();
++ virtual sal_Bool IsInlineToMargin();
++ virtual sal_uInt8 GetContentOrientation(){ return TEXT_ORIENT_LRTB;}
++ virtual sal_Bool HonorProtection();
++ virtual sal_Bool IsProtected();
++ virtual sal_Bool HasProtection();
++ virtual OUString GetStyleName(){ return m_StyleName;}
++ virtual sal_Bool IsComplex();
++ virtual sal_Bool IsAnchorPage(){ return sal_False;}
++ virtual sal_Bool IsAnchorFrame(){ return sal_False;}
++ virtual sal_Bool IsAnchorCell(){ return sal_False;}
++ virtual sal_Bool IsPage();
++ virtual sal_Bool IsHeader();
++ virtual sal_Bool IsFooter();
++ virtual sal_Bool IsFrame();
++ virtual sal_Bool IsCell();
++ virtual sal_Bool IsSuperTable();
++ virtual sal_Bool IsGroupHead();
++ virtual sal_uInt8 GetRelativeType();
++ virtual sal_Bool IsRelativeAnchored();
++ virtual LwpUseWhen* GetUseWhen();
++ virtual LwpUseWhen* VirtualGetUseWhen(){ return NULL;}
++ virtual sal_Bool IsUseOnAllPages(){ return sal_False;}
++ virtual sal_Bool IsUseOnAllEvenPages(){ return sal_False;}
++ virtual sal_Bool IsUseOnAllOddPages(){ return sal_False;}
++ virtual sal_Bool IsUseOnPage(){ return sal_False;}
++ virtual sal_Int32 GetPageNumber(sal_uInt16 nLayoutNumber = 0){ return -1;}
++ virtual sal_Bool IsMinimumHeight();
++ virtual sal_Bool IsForWaterMark(){ return sal_False;}
++ virtual LwpPara* GetLastParaOfPreviousStory() { return NULL; }
++ virtual LwpVirtualLayout* GetParentLayout();
++ virtual LwpVirtualLayout* GetContainerLayout(){ return NULL;}
++ virtual void RegisterChildStyle();
++ virtual sal_Bool NoContentReference();
++ virtual sal_Bool IsStyleLayout();
++ virtual enumXFAlignType GetVerticalAlignmentType()
++ {
++ if (m_nAttributes & STYLE_CENTEREDVERTICALLY)
++ {
++ return enumXFAlignMiddle;
++ }
++ else if (m_nAttributes & STYLE_BOTTOMALIGNED)
++ {
++ return enumXFAlignBottom;
++ }
++ return enumXFAlignTop;
++ };
++ virtual void SetStyleName(const OUString & str){ m_StyleName = str;};
++ virtual double GetWidth(){return -1;};
++
++ //Check whether there are contents in the layout
++ virtual sal_Bool HasContent(){return sal_False;}
++ //End by
++protected:
++ void Read();
++protected:
++ sal_uInt32 m_nAttributes;
++ sal_uInt32 m_nAttributes2;
++ sal_uInt32 m_nAttributes3;
++ sal_uInt32 m_nOverrideFlag;
++ sal_uInt16 m_nDirection;
++ sal_uInt16 m_nEditorID;
++ LwpObjectID m_NextEnumerated;
++ LwpObjectID m_PreviousEnumerated;
++ OUString m_StyleName;
++ enum LWP_LAYOUT_TYPE
++ {
++ LWP_VIRTUAL_LAYOUT,
++ LWP_HEAD_LAYOUT,
++ LWP_PAGE_LAYOUT,
++ LWP_HEADER_LAYOUT,
++ LWP_FOOTER_LAYOUT,
++ LWP_FRAME_LAYOUT,
++ LWP_SUPERTABLE_LAYOUT,
++ LWP_TABLE_LAYOUT,
++ LWP_ROW_LAYOUT,
++ LWP_COLUMN_LAYOUT,
++ LWP_CELL_LAYOUT,
++ LWP_CONNECTED_CELL_LAYOUT,
++ LWP_HIDDEN_CELL_LAYOUT,
++ LWP_TABLE_HEADING_LAYOUT,
++ LWP_ROW_HEADING_LAYOUT,
++ LWP_DROPCAP_LAYOUT,
++ LWP_GROUP_LAYOUT,
++ LWP_TOC_SUPERTABLE_LAYOUT,
++ LWP_FOOTNOTE_LAYOUT,
++ LWP_FOOTNOTE_ROW_LAYOUT,
++ LWP_FOOTNOTE_CELL_LAYOUT,
++ LWP_ENDNOTE_LAYOUT,
++ LWP_ENDNOTE_SUPERTABLE_LAYOUT,
++ LWP_FOOTNOTE_SUPERTABLE_LAYOUT,
++ LWP_NOTE_LAYOUT,
++ LWP_NOTEHEADER_LAYOUT,
++ LWP_NOTETEXT_LAYOUT,
++ LWP_VIEWPORT_LAYOUT
++ };
++ enum LayoutDirection
++ {
++ LAY_USEDIRECTION = 0x01,
++ LAY_AUTOGROW = 0x02,
++ LAY_AUTOSIZE = 0x04,
++ LAY_TOCONTAINER = 0x08,
++ LAY_DIRALLBITS = 0x0f
++ };
++ enum {SHIFT_UP = 0, SHIFT_DOWN = 4, SHIFT_LEFT = 8, SHIFT_RIGHT =12};
++public:
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_VIRTUAL_LAYOUT;}
++ virtual LwpVirtualLayout* FindChildByType(LWP_LAYOUT_TYPE eType);
++};
++
++class LwpAssociatedLayouts
++{
++public:
++ LwpAssociatedLayouts(){};
++ //LwpAssociatedLayouts(LwpObjectStream* pStrm){Read(pStrm);};
++public:
++ void Read(LwpObjectStream* pStrm);
++ LwpObjectID* GetOnlyLayout(){return &m_OnlyLayout;}
++ LwpDLVListHeadTail* GetLayouts(){return &m_Layouts;}
++ LwpVirtualLayout* GetLayout(LwpVirtualLayout* pStartLayout);
++protected:
++ LwpObjectID m_OnlyLayout; //LwpVirtualLayout
++ LwpDLVListHeadTail m_Layouts;
++};
++
++class LwpHeadLayout : public LwpVirtualLayout
++{
++public:
++ LwpHeadLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpHeadLayout(){};
++ void RegisterStyle();
++ LwpVirtualLayout* FindEnSuperTableLayout();
++protected:
++ void Read();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_HEAD_LAYOUT;}
++};
++
++//add by , 01/20/2005
++class LwpLayoutStyle
++{
++public:
++ LwpLayoutStyle();
++ virtual ~LwpLayoutStyle();
++ void Read(LwpObjectStream* pStrm);
++private:
++ sal_uInt32 m_nStyleDefinition;
++ LwpAtomHolder* m_pDescription;
++ sal_uInt16 m_nKey;
++};
++
++class LwpLayoutMisc
++{
++public:
++ LwpLayoutMisc();
++ virtual ~LwpLayoutMisc();
++ void Read(LwpObjectStream* pStrm);
++private:
++ sal_Int32 m_nGridDistance;
++ sal_uInt16 m_nGridType;
++ LwpAtomHolder* m_pContentStyle;
++};
++//end add
++
++#include "lwplaypiece.hxx"
++
++class LwpMiddleLayout : public LwpVirtualLayout
++{
++public:
++ LwpMiddleLayout( LwpObjectHeader &objHdr, LwpSvStream* pStrm );
++ virtual ~LwpMiddleLayout();
++ virtual BOOL MarginsSameAsParent();
++ virtual double GetMarginsValue(const sal_uInt8& nWhichSide);
++ virtual double GetExtMarginsValue(const sal_uInt8& nWhichSide);
++ LwpLayoutGeometry* GetGeometry();
++ double GetGeometryHeight();
++ double GetGeometryWidth();
++ LwpBorderStuff* GetBorderStuff();
++ LwpBackgroundStuff* GetBackgroundStuff();
++ enumXFTextDir GetTextDirection();
++ XFBorders* GetXFBorders();
++ LwpColor* GetBackColor();
++ virtual sal_Bool IsAutoGrow();
++ virtual sal_Bool IsAutoGrowUp();
++ virtual sal_Bool IsAutoGrowDown();
++ virtual sal_Bool IsAutoGrowLeft();
++ virtual sal_Bool IsAutoGrowRight();
++ virtual sal_uInt8 GetContentOrientation();
++ virtual sal_Bool HonorProtection();
++ virtual sal_Bool IsProtected();
++ virtual LwpVirtualLayout* GetWaterMarkLayout();
++ XFBGImage* GetXFBGImage();
++ virtual sal_Bool GetUsePrinterSettings();
++
++ LwpLayoutScale* GetLayoutScale(){return static_cast<LwpLayoutScale*>(m_LayScale.obj());}
++ sal_uInt16 GetScaleMode(void);
++ void SetScaleMode(sal_uInt16 nVal);
++ sal_uInt16 GetScaleTile(void);
++ void SetScaleTile(sal_uInt16 nVal);
++ sal_uInt16 GetScaleCenter(void);
++ void SetScaleCenter(sal_uInt16 nVal);
++ sal_uInt32 GetScalePercentage(void);
++ void SetScalePercentage(sal_uInt32 nVal);
++ double GetScaleWidth(void);
++ void SetScaleWidth(double fVal);
++ double GetScaleHeight(void);
++ void SetScaleHeight(double fVal);
++
++ sal_Bool CanSizeRight(void);
++ virtual double GetWidth();
++ virtual sal_Int32 GetMinimumWidth();
++ sal_Bool IsSizeRightToContent(void);
++ sal_Bool IsSizeRightToContainer(void);
++ sal_Int32 DetermineWidth();
++ virtual double GetHeight();
++ virtual LwpPoint GetOrigin();
++
++ // added by , 06/01/2004
++ sal_Bool IsPatternFill();
++ XFBGImage* GetFillPattern();
++ // end add
++
++
++ //Check whether there are contents in the layout
++ virtual sal_Bool HasContent();
++ //End by
++
++protected:
++ void Read();
++protected:
++ enum
++ {
++ DISK_GOT_STYLE_STUFF = 0x01,
++ DISK_GOT_MISC_STUFF = 0x02
++ };
++
++ LwpObjectID m_Content;
++ LwpObjectID m_BasedOnStyle;
++
++ // 01/20/2005
++ LwpObjectID m_TabPiece;
++ LwpLayoutStyle* m_pStyleStuff;
++ LwpLayoutMisc* m_pMiscStuff;
++ LwpObjectID m_LayGeometry;
++ LwpObjectID m_LayScale;
++ LwpObjectID m_LayMargins;
++ LwpObjectID m_LayBorderStuff;
++ LwpObjectID m_LayBackgroundStuff;
++ LwpObjectID m_LayExtBorderStuff;
++ //end
++public:
++ LwpObjectID* GetContent(){return &m_Content;}
++ LwpTabOverride* GetTabOverride();
++};
++
++class LwpLayout : public LwpMiddleLayout
++{
++public:
++ LwpLayout( LwpObjectHeader &objHdr, LwpSvStream* pStrm );
++ virtual ~LwpLayout();
++ XFColumns* GetXFColumns();
++ XFColumnSep* GetColumnSep();
++ LwpShadow* GetShadow();
++ XFShadow* GetXFShadow();
++protected:
++ void Read();
++protected:
++ // 01/20/2005
++ LwpUseWhen* m_pUseWhen;
++ LwpObjectID m_Positon;
++ LwpObjectID m_LayColumns;
++ LwpObjectID m_LayGutterStuff;
++ LwpObjectID m_LayJoinStuff;
++ LwpObjectID m_LayShadow;
++ LwpObjectID m_LayExtJoinStuff;
++ //end
++
++public:
++ LwpUseWhen* VirtualGetUseWhen();
++ virtual sal_uInt16 GetNumCols();
++ virtual double GetColWidth(sal_uInt16 nIndex);
++ virtual double GetColGap(sal_uInt16 nIndex);
++ virtual sal_uInt16 GetUsePage();
++public:
++ enum UseWhenType
++ {
++ StartWithinColume,
++ StartWithinPage,
++ StartOnNextPage,
++ StartOnOddPage,
++ StartOnEvenPage
++ };
++public:
++ virtual UseWhenType GetUseWhenType();
++ virtual sal_Bool IsUseOnAllPages();
++ virtual sal_Bool IsUseOnAllEvenPages();
++ virtual sal_Bool IsUseOnAllOddPages();
++ virtual sal_Bool IsUseOnPage();
++ LwpObjectID* GetPosition(){ return &m_Positon;}
++ virtual LwpVirtualLayout* GetContainerLayout();
++};
++
++class XFFont;
++class LwpPlacableLayout : public LwpLayout
++{
++public:
++ LwpPlacableLayout( LwpObjectHeader &objHdr, LwpSvStream* pStrm );
++ virtual ~LwpPlacableLayout();
++ virtual sal_uInt8 GetWrapType();
++ virtual LwpLayoutRelativity* GetRelativityPiece();
++ virtual sal_uInt8 GetRelativeType();
++ sal_uInt8 GetRelativeFromWhere();
++ LwpPoint GetRelativeDistance();
++ sal_uInt8 GetTetherType();
++ sal_uInt8 GetTetherWhere();
++ virtual sal_Int32 GetBaseLineOffset();
++ virtual sal_Bool IsAnchorPage();
++ virtual sal_Bool IsAnchorFrame();
++ virtual sal_Bool IsAnchorCell();
++ virtual void XFConvertFrame(XFContentContainer* pCont, sal_Int32 nStart = 0, sal_Int32 nEnd = 0, sal_Bool bAll = sal_False){}
++ XFFont* GetFont();
++ void SetFont(XFFont* pFont);
++ enum WrapType
++ {
++ LAY_WRAP_AROUND = 1,
++ LAY_NO_WRAP_BESIDE,
++ LAY_NO_WRAP_AROUND,
++ LAY_WRAP_LEFT,
++ LAY_WRAP_RIGHT,
++ //OLD_LAY_WRAP_RIGHT,
++ LAY_WRAP_BOTH,
++ LAY_WRAP_IRREG_BOTH,
++ LAY_WRAP_IRREG_LEFT,
++ LAY_WRAP_IRREG_RIGHT,
++ LAY_WRAP_IRREG_BIGGEST
++ };
++protected:
++ void Read();
++protected:
++ sal_uInt8 m_nWrapType;
++ sal_uInt8 m_nBuoyancy;
++ sal_Int32 m_nBaseLineOffset;
++ LwpAtomHolder m_Script;
++ LwpObjectID m_LayRelativity;
++ sal_uInt16 m_nPageNumber;//for frame anchored to page
++ XFFont* m_pFont;//for frame position
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwplaypiece.cxx lotuswordpro/source/filter/lwplaypiece.cxx
+--- lotuswordpro.bak/source/filter/lwplaypiece.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwplaypiece.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,465 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 28 2005 Created
++ ************************************************************************/
++
++#include "lwplaypiece.hxx"
++
++#include "lwpfilehdr.hxx"
++LwpRotor::LwpRotor()
++{}
++
++LwpRotor::~LwpRotor()
++{}
++
++void LwpRotor:: Read(LwpObjectStream *pStrm)
++{
++ m_nRotation = pStrm->QuickReadInt16();
++}
++
++LwpLayoutGeometry::LwpLayoutGeometry(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpVirtualPiece(objHdr, pStrm)
++{}
++
++LwpLayoutGeometry::~LwpLayoutGeometry()
++{}
++
++void LwpLayoutGeometry::Read()
++{
++ LwpVirtualPiece::Read();
++
++ if(LwpFileHeader::m_nFileRevision >= 0x000B)
++ {
++ m_nWidth = m_pObjStrm->QuickReadInt32();
++ m_nHeight = m_pObjStrm->QuickReadInt32();
++ m_Origin.Read(m_pObjStrm);
++ m_AbsoluteOrigin.Read(m_pObjStrm);
++ m_ContainerRotor.Read(m_pObjStrm);
++ m_ContentOrientation = m_pObjStrm->QuickReaduInt8();
++ m_pObjStrm->SkipExtra();
++ }
++}
++void LwpLayoutGeometry::Parse(IXFStream* pOutputStream)
++{}
++
++LwpLayoutScale::LwpLayoutScale(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpVirtualPiece(objHdr, pStrm)
++{}
++
++LwpLayoutScale::~LwpLayoutScale()
++{}
++
++void LwpLayoutScale::Read()
++{
++ LwpVirtualPiece::Read();
++
++ if(LwpFileHeader::m_nFileRevision >= 0x000B)
++ {
++ m_nScaleMode = m_pObjStrm->QuickReaduInt16();
++ m_nScalePercentage = m_pObjStrm->QuickReaduInt32();
++ m_nScaleWidth = m_pObjStrm->QuickReadInt32();
++ m_nScaleHeight = m_pObjStrm->QuickReadInt32();
++ m_nContentRotation = m_pObjStrm->QuickReaduInt16();
++ m_Offset.Read(m_pObjStrm);
++
++ m_nPlacement = m_pObjStrm->QuickReaduInt16();
++ m_pObjStrm->SkipExtra();
++ }
++}
++
++void LwpLayoutScale::Parse(IXFStream* pOutputStream)
++{}
++
++LwpLayoutMargins::LwpLayoutMargins(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpVirtualPiece(objHdr, pStrm)
++{}
++
++LwpLayoutMargins::~LwpLayoutMargins()
++{}
++
++void LwpLayoutMargins::Read()
++{
++ LwpVirtualPiece::Read();
++
++ if( LwpFileHeader::m_nFileRevision >= 0x000B )
++ {
++ m_Margins.Read(m_pObjStrm);
++ m_ExtMargins.Read(m_pObjStrm);
++ m_ExtraMargins.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++ }
++}
++
++void LwpLayoutMargins::Parse(IXFStream* pOutputStream)
++{}
++
++LwpLayoutBorder::LwpLayoutBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpVirtualPiece(objHdr, pStrm)
++{}
++
++LwpLayoutBorder::~LwpLayoutBorder()
++{}
++
++void LwpLayoutBorder::Read()
++{
++ LwpVirtualPiece::Read();
++
++ if( LwpFileHeader::m_nFileRevision >= 0x000B )
++ {
++ m_BorderStuff.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++ }
++}
++
++void LwpLayoutBorder::Parse(IXFStream* pOutputStream)
++{}
++
++LwpLayoutBackground::LwpLayoutBackground(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpVirtualPiece(objHdr, pStrm)
++{}
++
++LwpLayoutBackground::~LwpLayoutBackground()
++{}
++
++void LwpLayoutBackground::Read()
++{
++ LwpVirtualPiece::Read();
++
++ if( LwpFileHeader::m_nFileRevision >= 0x000B )
++ {
++ m_BackgroundStuff.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++ }
++}
++
++void LwpLayoutBackground::Parse(IXFStream* pOutputStream)
++{}
++
++LwpExternalBorder::LwpExternalBorder()
++{}
++
++LwpExternalBorder::~LwpExternalBorder()
++{}
++
++void LwpExternalBorder:: Read(LwpObjectStream *pStrm)
++{
++ if( LwpFileHeader::m_nFileRevision >= 0x000F )
++ {
++ //enum {BORDER,JOIN};
++ m_LeftName.Read(pStrm);
++ m_TopName.Read(pStrm);
++ m_RightName.Read(pStrm);
++ m_BottomName.Read(pStrm);
++ // TODO: Do not know what it is for
++ /*cLeftName = CStyleMgr::GetUniqueMetaFileName(cLeftName,BORDER);
++ cRightName = CStyleMgr::GetUniqueMetaFileName(cRightName,BORDER);
++ cTopName = CStyleMgr::GetUniqueMetaFileName(cTopName,BORDER);
++ cBottomName = CStyleMgr::GetUniqueMetaFileName(cBottomName,BORDER);*/
++ pStrm->SkipExtra();
++ }
++}
++
++LwpLayoutExternalBorder::LwpLayoutExternalBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpVirtualPiece(objHdr, pStrm)
++{}
++
++LwpLayoutExternalBorder::~LwpLayoutExternalBorder()
++{}
++
++void LwpLayoutExternalBorder::Read()
++{
++ LwpVirtualPiece::Read();
++
++ if( LwpFileHeader::m_nFileRevision >= 0x000B )
++ {
++ m_ExtranalBorder.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++ }
++}
++
++void LwpLayoutExternalBorder::Parse(IXFStream* pOutputStream)
++{}
++
++LwpColumnInfo::LwpColumnInfo()
++{}
++
++LwpColumnInfo::~LwpColumnInfo()
++{}
++
++void LwpColumnInfo:: Read(LwpObjectStream *pStrm)
++{
++ m_nWidth = pStrm->QuickReadInt32();
++ m_nGap = pStrm->QuickReadInt32();
++}
++
++LwpLayoutColumns::LwpLayoutColumns(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpVirtualPiece(objHdr, pStrm),m_pColumns(NULL)
++{}
++
++LwpLayoutColumns::~LwpLayoutColumns()
++{
++ if(m_pColumns)
++ {
++ delete[] m_pColumns;
++ m_pColumns = NULL;
++ }
++
++}
++
++void LwpLayoutColumns::Read()
++{
++ LwpVirtualPiece::Read();
++
++ if( LwpFileHeader::m_nFileRevision >= 0x000B )
++ {
++ m_nNumCols = m_pObjStrm->QuickReaduInt16();
++ m_pColumns = new LwpColumnInfo[m_nNumCols];
++ for(int i=0; i<m_nNumCols; i++)
++ {
++ m_pColumns[i].Read(m_pObjStrm);
++ }
++ m_pObjStrm->SkipExtra();
++ }
++}
++
++double LwpLayoutColumns::GetColWidth(sal_uInt16 nIndex)
++{
++ if(nIndex >= m_nNumCols)
++ {
++ return 0;
++ }
++ return m_pColumns[nIndex].GetWidth();
++}
++
++double LwpLayoutColumns::GetColGap(sal_uInt16 nIndex)
++{
++ if(nIndex >= m_nNumCols)
++ {
++ return 0;
++ }
++ return m_pColumns[nIndex].GetGap();
++}
++
++void LwpLayoutColumns::Parse(IXFStream* pOutputStream)
++{}
++
++LwpLayoutGutters::LwpLayoutGutters(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpVirtualPiece(objHdr, pStrm)
++{}
++
++LwpLayoutGutters::~LwpLayoutGutters()
++{}
++
++void LwpLayoutGutters::Read()
++{
++ LwpVirtualPiece::Read();
++
++ if( LwpFileHeader::m_nFileRevision >= 0x000B )
++ {
++ m_BorderBuffer.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++ }
++}
++
++
++void LwpLayoutGutters::Parse(IXFStream* pOutputStream)
++{}
++
++LwpJoinStuff::LwpJoinStuff()
++{}
++
++LwpJoinStuff::~LwpJoinStuff()
++{}
++
++#include "lwpstyledef.hxx"
++void LwpJoinStuff:: Read(LwpObjectStream *pStrm)
++{
++ m_nWidth = pStrm->QuickReadInt32();
++ m_nHeight = pStrm->QuickReadInt32();
++ m_nPercentage = pStrm->QuickReaduInt16();
++ m_nID = pStrm->QuickReaduInt16();
++ m_nCorners = pStrm->QuickReaduInt16();
++ m_nScaling = pStrm->QuickReaduInt16();
++ m_Color.Read(pStrm);
++ pStrm->SkipExtra();
++
++ // Bug fix: if reading in from something older than Release 9
++ // then check for the external ID and change it to solid.
++ if (LwpFileHeader::m_nFileRevision < 0x0010)
++ {
++ if (m_nID & EXTERNAL_ID)
++ m_nID = MITRE;
++ }
++}
++
++LwpLayoutJoins::LwpLayoutJoins(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpVirtualPiece(objHdr, pStrm)
++{}
++
++LwpLayoutJoins::~LwpLayoutJoins()
++{}
++
++void LwpLayoutJoins::Read()
++{
++ LwpVirtualPiece::Read();
++
++ if( LwpFileHeader::m_nFileRevision >= 0x000B )
++ {
++ m_JoinStuff.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++ }
++}
++
++void LwpLayoutJoins::Parse(IXFStream* pOutputStream)
++{}
++
++LwpLayoutShadow::LwpLayoutShadow(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpVirtualPiece(objHdr, pStrm)
++{}
++
++LwpLayoutShadow::~LwpLayoutShadow()
++{}
++
++void LwpLayoutShadow::Read()
++{
++ LwpVirtualPiece::Read();
++
++ if( LwpFileHeader::m_nFileRevision >= 0x000B )
++ {
++ m_Shadow.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++ }
++}
++
++void LwpLayoutShadow::Parse(IXFStream* pOutputStream)
++{}
++/**************************************************************************
++ * @descr: Constructor
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++LwpLayoutRelativityGuts::LwpLayoutRelativityGuts()
++{
++ m_nRelType = LAY_PARENT_RELATIVE;
++ m_nRelFromWhere = LAY_UPPERLEFT;
++ m_RelDistance.SetX(0);
++ m_RelDistance.SetY(0);
++ m_nTether = LAY_UPPERLEFT;
++ m_nTetherWhere = LAY_BORDER;
++ m_nFlags = 0;
++}
++/**************************************************************************
++ * @descr: Read LayoutRelativityGuts' infomation.
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++void LwpLayoutRelativityGuts::Read(LwpObjectStream *pStrm)
++{
++ m_nRelType = pStrm->QuickReaduInt8();
++ m_nRelFromWhere = pStrm->QuickReaduInt8();
++ m_RelDistance.Read(pStrm);
++ m_nTether = pStrm->QuickReaduInt8();
++ m_nTetherWhere = pStrm->QuickReaduInt8();
++ if(LwpFileHeader::m_nFileRevision >= 0x000B)
++ {
++ m_nFlags = pStrm->QuickReaduInt8();
++ }
++ else
++ {
++ m_nFlags = 0;
++ }
++}
++/**************************************************************************
++ * @descr: Constructor
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++LwpLayoutRelativity::LwpLayoutRelativity(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ : LwpVirtualPiece(objHdr, pStrm)
++{
++}
++/**************************************************************************
++ * @descr: destructor
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++LwpLayoutRelativity::~LwpLayoutRelativity()
++{
++}
++
++void LwpLayoutRelativity::Read()
++{
++ LwpVirtualPiece::Read();
++ if(LwpFileHeader::m_nFileRevision >= 0x000B)
++ {
++ m_RelGuts.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++ }
++}
++
++void LwpLayoutRelativity::Parse(IXFStream *pOutputStream)
++{
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwplaypiece.hxx lotuswordpro/source/filter/lwplaypiece.hxx
+--- lotuswordpro.bak/source/filter/lwplaypiece.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwplaypiece.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,392 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 28 2005 Created
++ ************************************************************************/
++#ifndef _LWPLAYOUTPIECE_HXX
++#define _LWPLAYOUTPIECE_HXX
++
++#include "lwppiece.hxx"
++#include "lwpbasetype.hxx"
++
++class LwpRotor
++{
++public:
++ LwpRotor();
++ ~LwpRotor();
++ void Read(LwpObjectStream *pStrm);
++private:
++ sal_Int16 m_nRotation; //angle
++ sal_uInt16 m_nSin;
++ sal_uInt16 m_nCos;
++};
++
++class LwpLayoutGeometry : public LwpVirtualPiece
++{
++public:
++ LwpLayoutGeometry(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ virtual ~LwpLayoutGeometry();
++ virtual void Parse(IXFStream* pOutputStream);
++ sal_Int32 GetWidth() { return m_nWidth; }
++ sal_Int32 GetHeight() { return m_nHeight; }
++ LwpPoint GetOrigin() { return m_Origin; }
++ LwpPoint GetAbsoluteOrigin() { return m_AbsoluteOrigin; }
++ sal_uInt8 GetContentOrientation(){ return m_ContentOrientation;}
++
++protected:
++ virtual void Read();
++protected:
++ sal_Int32 m_nWidth;
++ sal_Int32 m_nHeight;
++ LwpPoint m_Origin;
++ LwpPoint m_AbsoluteOrigin;
++ LwpRotor m_ContainerRotor;
++ sal_uInt8 m_ContentOrientation;
++};
++
++class LwpLayoutScale : public LwpVirtualPiece
++{
++public:
++ enum {ORIGINAL_SIZE = 1, FIT_IN_FRAME = 2, PERCENTAGE = 4,
++ CUSTOM = 8, MAINTAIN_ASPECT_RATIO = 16};
++
++ enum {CENTERED = 1, TILED = 2};
++ LwpLayoutScale(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ virtual ~LwpLayoutScale();
++ virtual void Parse(IXFStream* pOutputStream);
++ sal_uInt16 GetScaleMode(){return m_nScaleMode;}
++ void SetScaleMode(sal_uInt16 nVal){m_nScaleMode = nVal;}
++ sal_uInt32 GetScalePercentage(){return m_nScalePercentage;}
++ void SetScalePercentage(sal_uInt32 nVal){m_nScalePercentage = nVal;}
++ sal_Int32 GetScaleWidth(){return m_nScaleWidth;}
++ void SetScaleWidth(sal_Int32 nVal){m_nScaleWidth = nVal;}
++ sal_Int32 GetScaleHeight(){return m_nScaleHeight;}
++ void SetScaleHeight(sal_Int32 nVal){m_nScaleHeight = nVal;}
++ sal_uInt16 GetContentRotation(){return m_nContentRotation;}
++ void SetContentRotation(sal_uInt16 nVal){m_nContentRotation = nVal;}
++ sal_uInt16 GetPlacement(){return m_nPlacement;}
++ void SetPlacement(sal_uInt16 nVal){m_nPlacement = nVal;}
++ // add by , 04/05/2005
++ inline LwpPoint* GetOffset() {return &m_Offset;};
++ // end add
++protected:
++ virtual void Read();
++protected:
++ sal_uInt16 m_nScaleMode;
++ sal_uInt32 m_nScalePercentage;
++ sal_Int32 m_nScaleWidth;
++ sal_Int32 m_nScaleHeight;
++ sal_uInt16 m_nContentRotation;
++ LwpPoint m_Offset;
++ sal_uInt16 m_nPlacement;
++};
++
++#include "lwpmargins.hxx"
++
++class LwpLayoutMargins : public LwpVirtualPiece
++{
++public:
++ LwpLayoutMargins(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ virtual ~LwpLayoutMargins();
++ virtual void Parse(IXFStream* pOutputStream);
++ LwpMargins* GetMargins() { return &m_Margins; }
++ LwpMargins* GetExtMargins(){ return &m_ExtMargins;}
++protected:
++ virtual void Read();
++protected:
++ LwpMargins m_Margins;
++ LwpMargins m_ExtMargins;
++ LwpMargins m_ExtraMargins;
++};
++
++#include "lwpborderstuff.hxx"
++class LwpLayoutBorder : public LwpVirtualPiece
++{
++public:
++ LwpLayoutBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ virtual ~LwpLayoutBorder();
++ virtual void Parse(IXFStream* pOutputStream);
++ LwpBorderStuff* GetBorderStuff(){ return &m_BorderStuff;}
++protected:
++ virtual void Read();
++protected:
++ LwpBorderStuff m_BorderStuff;
++};
++
++class LwpLayoutBackground : public LwpVirtualPiece
++{
++public:
++ LwpLayoutBackground(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ virtual ~LwpLayoutBackground();
++ virtual void Parse(IXFStream* pOutputStream);
++ LwpBackgroundStuff* GetBackgoudStuff(){return &m_BackgroundStuff;}
++protected:
++ virtual void Read();
++protected:
++ LwpBackgroundStuff m_BackgroundStuff;
++};
++
++class LwpExternalBorder
++{
++public:
++ LwpExternalBorder();
++ ~LwpExternalBorder();
++ void Read(LwpObjectStream *pStrm);
++private:
++ LwpAtomHolder m_LeftName;
++ LwpAtomHolder m_TopName;
++ LwpAtomHolder m_RightName;
++ LwpAtomHolder m_BottomName;
++};
++
++//It seems that this class is used for designer border. Only read now.
++class LwpLayoutExternalBorder : public LwpVirtualPiece
++{
++public:
++ LwpLayoutExternalBorder(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ virtual ~LwpLayoutExternalBorder();
++ virtual void Parse(IXFStream* pOutputStream);
++protected:
++ virtual void Read();
++protected:
++ LwpExternalBorder m_ExtranalBorder;
++};
++
++class LwpColumnInfo
++{
++public:
++ LwpColumnInfo();
++ ~LwpColumnInfo();
++ void Read(LwpObjectStream *pStrm);
++ inline double GetWidth(){return LwpTools::ConvertFromUnitsToMetric(m_nWidth);}
++ inline void SetWidth(sal_Int32 w){m_nWidth = w;}
++ inline double GetGap(){return LwpTools::ConvertFromUnitsToMetric(m_nGap);}
++ inline void SetGap(sal_Int32 g){m_nGap = g;}
++private:
++ sal_Int32 m_nWidth;
++ sal_Int32 m_nGap;
++};
++
++class LwpLayoutColumns : public LwpVirtualPiece
++{
++public:
++ LwpLayoutColumns(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ virtual ~LwpLayoutColumns();
++ virtual void Parse(IXFStream* pOutputStream);
++ inline sal_uInt16 GetNumCols(){return m_nNumCols;};
++ double GetColWidth(sal_uInt16 nIndex);
++ double GetColGap(sal_uInt16 nIndex);
++protected:
++ virtual void Read();
++protected:
++ sal_uInt16 m_nNumCols;
++ LwpColumnInfo* m_pColumns;
++};
++
++class LwpLayoutGutters : public LwpVirtualPiece
++{
++public:
++ LwpLayoutGutters(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ virtual ~LwpLayoutGutters();
++ virtual void Parse(IXFStream* pOutputStream);
++ inline virtual LwpBorderStuff* GetBorderStuff(){return &m_BorderBuffer;}
++protected:
++ virtual void Read();
++protected:
++ LwpBorderStuff m_BorderBuffer;
++};
++
++class LwpJoinStuff
++{
++public:
++ LwpJoinStuff();
++ ~LwpJoinStuff();
++ void Read(LwpObjectStream *pStrm);
++private:
++ sal_uInt16 m_nPercentage;
++ sal_uInt16 m_nCorners;
++ sal_Int32 m_nWidth;
++ sal_Int32 m_nHeight;
++
++ enum JoinType
++ {
++ MITRE = 1,
++ NEGATE = 2,
++ ROUNDED = 3,
++ RECTANGLE = 4,
++ SPECIAL = 5,
++ DIAGONAL = 6,
++ NEGATE_NO_CROSS = 7,
++ DOG_EAR_PAGE = 8,
++ DESKTOP = 9,
++ BOX_HIGHLIGHT = 10,
++//#ifdef BORDER_BMP
++ STAR = 11,
++ ROPE = 12,
++ DECO1 = 13,
++ DECO2 = 14,
++ RAIN = 15,
++ PIN = 16,
++ ROSE = 17,
++ SUNF = 18,
++ DECO3 = 19,
++//#endif //BORDER_BMP
++ WARNING = 20,
++ BUBBLE = 21,
++ GIRDER = 22,
++ SMILE = 23,
++ ARROW = 24,
++ MAXJOIN = 24
++ };
++
++ sal_uInt16 m_nID;//JoinType
++ sal_uInt16 m_nScaling;
++ LwpColor m_Color;
++};
++
++class LwpLayoutJoins : public LwpVirtualPiece
++{
++public:
++ LwpLayoutJoins(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ virtual ~LwpLayoutJoins();
++ virtual void Parse(IXFStream* pOutputStream);
++protected:
++ virtual void Read();
++protected:
++ LwpJoinStuff m_JoinStuff;
++};
++
++#include "lwpshadow.hxx"
++
++class LwpLayoutShadow : public LwpVirtualPiece
++{
++public:
++ LwpLayoutShadow(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ virtual ~LwpLayoutShadow();
++ virtual void Parse(IXFStream* pOutputStream);
++ LwpShadow* GetShadow(){return &m_Shadow;}
++protected:
++ virtual void Read();
++protected:
++ LwpShadow m_Shadow;
++};
++
++/*class LwpLayoutRelativityGuts*/
++class LwpLayoutRelativityGuts
++{
++public:
++ LwpLayoutRelativityGuts();
++ void Read(LwpObjectStream *pStrm);
++ sal_uInt8 GetRelativeType(){ return m_nRelType;}
++ sal_uInt8 GetRelativeFromWhere(){ return m_nRelFromWhere;}
++ LwpPoint GetRelativeDistance(){ return m_RelDistance;}
++ sal_uInt8 GetTetherType(){ return m_nTether;}
++ sal_uInt8 GetTetherWhere(){ return m_nTetherWhere;}
++public:
++ enum RelativeType
++ {
++ LAY_PARENT_RELATIVE = 1,
++ LAY_PARA_RELATIVE,
++ LAY_INLINE,
++ LAY_INLINE_NEWLINE,
++ LAY_CONTENT_RELATIVE,
++ LAY_INLINE_VERTICAL
++ };
++ enum WhereType
++ {
++ LAY_UPPERLEFT = 1,
++ LAY_MIDDLETOP,
++ LAY_UPPERRIGHT,
++ LAY_MIDDLELEFT,
++ LAY_MIDDLERIGHT,
++ LAY_LOWERLEFT,
++ LAY_MIDDLEBOTTOM,
++ LAY_LOWERRIGHT,
++ LAY_MIDDLE
++ };
++ enum TetherWhereType
++ {
++ LAY_INTERNAL = 1,
++ LAY_EXTERNAL,
++ LAY_BORDER
++ };
++private:
++ sal_uInt8 m_nRelType;
++ sal_uInt8 m_nRelFromWhere;
++ LwpPoint m_RelDistance;
++ sal_uInt8 m_nTether;
++ sal_uInt8 m_nTetherWhere;
++ sal_uInt8 m_nFlags;
++};
++
++class LwpLayoutRelativity: public LwpVirtualPiece
++{
++public:
++ LwpLayoutRelativity(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ virtual ~LwpLayoutRelativity();
++ virtual void Parse(IXFStream* pOutputStream);
++ LwpLayoutRelativityGuts* GetRelGuts(){return &m_RelGuts;}
++protected:
++ virtual void Read();
++protected:
++ LwpLayoutRelativityGuts m_RelGuts;
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwplnopts.cxx lotuswordpro/source/filter/lwplnopts.cxx
+--- lotuswordpro.bak/source/filter/lwplnopts.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwplnopts.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,98 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "lwpglobalmgr.hxx"
++#include "lwplnopts.hxx"
++
++LwpLineNumberOptions::LwpLineNumberOptions(LwpObjectStream* pStrm)
++{
++ Read(pStrm);
++}
++/**
++ * @descr Read LwpLineNumberOptions from object stream
++ */
++void LwpLineNumberOptions::Read(LwpObjectStream *pStrm)
++{
++ pStrm->QuickRead(&m_nType, sizeof(m_nType));
++ pStrm->QuickRead(&m_nFlags, sizeof(m_nFlags));
++ pStrm->QuickRead(&m_nSeparator, sizeof(m_nSeparator));
++ pStrm->QuickRead(&m_nSpacing, sizeof(m_nSpacing));
++ pStrm->QuickRead(&m_nDistance, sizeof(m_nDistance));
++ pStrm->SkipExtra();
++}
++/**
++ * @descr set XFLineNumberConfig
++ */
++void LwpLineNumberOptions::RegisterStyle()
++{
++ if (m_nType == NUMBER_NONE)
++ return;
++ XFLineNumberConfig* pLineNumber = new XFLineNumberConfig;
++ pLineNumber->SetNumberPosition(enumXFLineNumberLeft);
++ pLineNumber->SetNumberOffset(LwpTools::ConvertFromUnitsToMetric(m_nDistance));
++ pLineNumber->SetNumberIncrement(m_nSeparator);
++ if (m_nFlags & LN_RESETEACHPAGE)
++ pLineNumber->SetRestartOnPage(sal_True);
++ else
++ pLineNumber->SetRestartOnPage(sal_False);
++ if (m_nFlags & LN_COUNTBLANKLINES)
++ pLineNumber->SetCountEmptyLines(sal_True);
++ else
++ pLineNumber->SetCountEmptyLines(sal_False);
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ pXFStyleManager->SetLineNumberConfig(pLineNumber);
++}
++
++
+diff -urNp lotuswordpro.bak/source/filter/lwplnopts.hxx lotuswordpro/source/filter/lwplnopts.hxx
+--- lotuswordpro.bak/source/filter/lwplnopts.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwplnopts.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,98 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPLINENUMBEROPTIONS_HXX
++#define _LWPLINENUMBEROPTIONS_HXX
++
++#include "lwpobjstrm.hxx"
++#include "lwptools.hxx"
++#include "xfilter/xflinenumberconfig.hxx"
++#include "xfilter/xfstylemanager.hxx"
++/**
++ * @brief line number options
++*/
++class LwpLineNumberOptions
++{
++public:
++ LwpLineNumberOptions(LwpObjectStream* pStrm);
++ ~LwpLineNumberOptions(){};
++protected:
++ sal_uInt16 m_nType;
++ sal_uInt16 m_nFlags;
++ sal_uInt16 m_nSeparator;
++ sal_uInt32 m_nSpacing;
++ sal_uInt32 m_nDistance;
++public:
++ enum
++ {
++ NUMBER_NONE, NUMBER_LINES, NUMBER_TEXTLINESONLY
++ };
++ enum
++ {
++ LN_RESETEACHPAGE = 0x01,
++ LN_COUNTBLANKLINES = 0x02
++ };
++ void Read(LwpObjectStream *pStrm);
++ void RegisterStyle();
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpmargins.hxx lotuswordpro/source/filter/lwpmargins.hxx
+--- lotuswordpro.bak/source/filter/lwpmargins.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpmargins.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,117 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++//
++#ifndef _LWPMARGINS_HXX
++#define _LWPMARGINS_HXX
++
++#include "lwpobjstrm.hxx"
++#include "lwptools.hxx"
++
++const sal_uInt8 MARGIN_LEFT = 0;
++const sal_uInt8 MARGIN_RIGHT = 1;
++const sal_uInt8 MARGIN_TOP = 2;
++const sal_uInt8 MARGIN_BOTTOM = 3;
++
++class LwpMargins
++{
++public:
++ LwpMargins():m_nLeft(0),m_nTop(0),m_nRight(0),m_nBottom(0){}
++public:
++ void Read(LwpObjectStream *pStrm)
++ {
++ pStrm->QuickRead(&m_nLeft, 4);
++ pStrm->QuickRead(&m_nTop, 4);
++ pStrm->QuickRead(&m_nRight, 4);
++ pStrm->QuickRead(&m_nBottom, 4);
++ pStrm->SkipExtra();
++ }
++ //add by , 01/26/2004
++ inline void operator = (const LwpMargins& rOther);
++ inline double GetMarginsValue(const sal_uInt8& nWhichSide);
++ //end add
++private:
++ sal_Int32 m_nLeft;
++ sal_Int32 m_nTop;
++ sal_Int32 m_nRight;
++ sal_Int32 m_nBottom;
++};
++
++inline void LwpMargins::operator = (const LwpMargins& rOther)
++{
++ m_nLeft = rOther.m_nLeft;
++ m_nTop = rOther.m_nTop;
++ m_nRight = rOther.m_nRight;
++ m_nBottom = rOther.m_nBottom;
++}
++
++inline double LwpMargins::GetMarginsValue(const sal_uInt8& nWhichSide)
++{
++ switch (nWhichSide)
++ {
++ case MARGIN_LEFT://left
++ return LwpTools::ConvertFromUnitsToMetric(m_nLeft);
++ break;
++ case MARGIN_RIGHT://right
++ return LwpTools::ConvertFromUnitsToMetric(m_nRight);
++ break;
++ case MARGIN_TOP://top
++ return LwpTools::ConvertFromUnitsToMetric(m_nTop);
++ break;
++ case MARGIN_BOTTOM://bottom
++ return LwpTools::ConvertFromUnitsToMetric(m_nBottom);
++ break;
++ }
++}
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpmarker.cxx lotuswordpro/source/filter/lwpmarker.cxx
+--- lotuswordpro.bak/source/filter/lwpmarker.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpmarker.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,573 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++#include "lwpfoundry.hxx"
++#include "lwpfilehdr.hxx"
++#include "lwpstory.hxx"
++#include "lwpmarker.hxx"
++#include "lwpproplist.hxx"
++#include "lwpglobalmgr.hxx"
++#include "xfilter/xfplaceholder.hxx"
++#include "xfilter/xfinputlist.hxx"
++
++LwpMarker::LwpMarker(LwpObjectHeader &objHdr, LwpSvStream *pStrm):LwpDLNFPVList(objHdr,pStrm)
++{
++}
++
++void LwpMarker::Read()
++{
++ LwpDLNFPVList::Read();
++ m_objContent.ReadIndexed(m_pObjStrm);
++ m_objLayout.ReadIndexed(m_pObjStrm);
++ m_objMarkerList.ReadIndexed(m_pObjStrm);
++ m_nNeedUpdate = m_pObjStrm->QuickReaduInt16();
++ m_nFlag = m_pObjStrm->QuickReaduInt16();
++ m_nPageNumber = m_pObjStrm->QuickReaduInt16();
++
++ m_pObjStrm->SkipExtra();
++}
++
++OUString LwpMarker::GetNamedProperty(OUString name)
++{
++ LwpPropList* pProp = GetPropList();
++ if (pProp)
++ return pProp->GetNamedProperty(name);
++ else
++ return OUString(A2OUSTR(""));
++}
++
++LwpStoryMarker::LwpStoryMarker(LwpObjectHeader &objHdr, LwpSvStream *pStrm):LwpMarker(objHdr,pStrm)
++{
++}
++
++void LwpStoryMarker::Read()
++{
++ LwpMarker::Read();
++ m_nFlag = m_pObjStrm->QuickReaduInt16();
++ m_Range.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++
++void LwpFribRange::Read(LwpObjectStream* pObjStrm)
++{
++ m_StartPara.ReadIndexed(pObjStrm);
++ m_EndPara.ReadIndexed(pObjStrm);
++}
++
++LwpCHBlkMarker::LwpCHBlkMarker(LwpObjectHeader &objHdr, LwpSvStream *pStrm):LwpStoryMarker(objHdr,pStrm)
++{
++}
++
++void LwpCHBlkMarker::Read()
++{
++ LwpStoryMarker::Read();
++ m_objPromptStory.ReadIndexed(m_pObjStrm);
++ m_Help.Read(m_pObjStrm);
++ m_nAction = m_pObjStrm->QuickReaduInt16();
++ m_nTab = m_pObjStrm->QuickReaduInt32();
++ m_nFlag = m_pObjStrm->QuickReaduInt16();
++ if(m_pObjStrm->CheckExtra())
++ {
++ m_Mirror.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++ }
++}
++
++OUString LwpCHBlkMarker::GetPromptText()
++{
++ LwpStory* pStory = NULL;
++ if (m_objPromptStory.obj())
++ pStory = static_cast<LwpStory*>(m_objPromptStory.obj());
++ if (pStory)
++ return pStory->GetContentText();
++ return A2OUSTR("");
++}
++
++void LwpCHBlkMarker::ConvertCHBlock(XFContentContainer* pXFPara, sal_uInt8 nType)
++{
++ sal_uInt16 nAction = GetAction();
++
++ switch(nAction)
++ {
++ case CLICKHERE_CHBEHAVIORTEXT:
++ case CLICKHERE_CHBEHAVIORTABLE:
++ case CLICKHERE_CHBEHAVIORPICTURE:
++ case CLICKHERE_CHBEHAVIOROLEOBJECT:
++ ProcessPlaceHolder(pXFPara,nAction,nType);
++ break;
++ case CLICKHERE_CHBEHAVIORCHART:
++ case CLICKHERE_CHBEHAVIORDRAWING:
++ case CLICKHERE_CHBEHAVIORGLOSSARY:
++ case CLICKHERE_CHBEHAVIOREQUATION:
++ case CLICKHERE_CHBEHAVIORSYMBOL:
++ case CLICKHERE_CHBEHAVIORPAGENUM:
++ case CLICKHERE_CHBEHAVIORDOCFIELD:
++ case CLICKHERE_CHBEHAVIORDATETIME:
++ ProcessOtherCHB(pXFPara,nType);
++ break;
++// ProcessPageNumber(pXFPara,nType);
++// break;
++ case CLICKHERE_CHBEHAVIORSTRINGLIST:
++ ProcessKeylist(pXFPara,nType);
++ break;
++ default:
++ break;
++ }
++}
++
++void LwpCHBlkMarker::ProcessPlaceHolder(XFContentContainer* pXFPara,sal_uInt16 nAction,
++ sal_uInt8 nType)
++{
++ sal_Bool bFillFlag = IsHasFilled();
++ sal_Bool bHelpFlag = IsBubbleHelp();
++
++ if ( bFillFlag )
++ return;
++ if (nType == MARKER_START)
++ {
++ XFHolderStart* pHolder= new XFHolderStart;
++ switch(nAction)
++ {
++ case CLICKHERE_CHBEHAVIORTEXT:
++ pHolder->SetType(A2OUSTR("text"));
++ break;
++ case CLICKHERE_CHBEHAVIORTABLE:
++ pHolder->SetType(A2OUSTR("table"));
++ break;
++ case CLICKHERE_CHBEHAVIORPICTURE:
++ pHolder->SetType(A2OUSTR("image"));
++ break;
++ case CLICKHERE_CHBEHAVIOROLEOBJECT:
++ pHolder->SetType(A2OUSTR("object"));
++ break;
++ default:
++ break;
++ }
++
++ if (bHelpFlag)
++ pHolder->SetDesc(m_Help.str());
++ pHolder->SetPrompt(GetPromptText());
++ pXFPara->Add(pHolder);
++ }
++ else if (nType == MARKER_END)
++ {
++ XFHolderEnd* pHolder = new XFHolderEnd;
++ pXFPara->Add(pHolder);
++ }
++}
++
++void LwpCHBlkMarker::ProcessOtherCHB(XFContentContainer* pXFPara,sal_uInt8 nType)
++{
++ sal_Bool bFillFlag = IsHasFilled();
++ sal_Bool bHelpFlag = IsBubbleHelp();
++
++ if ( bFillFlag )
++ return;
++ if (nType == MARKER_START)
++ {
++ XFHolderStart* pHolder= new XFHolderStart;
++ pHolder->SetType(A2OUSTR("text"));
++ if (bHelpFlag)
++ pHolder->SetDesc(m_Help.str());
++ pHolder->SetPrompt(GetPromptText());
++ pXFPara->Add(pHolder);
++ }
++ else if (nType == MARKER_END)
++ {
++ XFHolderEnd* pHolder = new XFHolderEnd;
++ pXFPara->Add(pHolder);
++ }
++
++}
++
++void LwpCHBlkMarker::ProcessPageNumber(XFContentContainer* pXFPara,sal_uInt8 nType)
++{
++ sal_Bool bFillFlag = IsHasFilled();
++ sal_Bool bHelpFlag = IsBubbleHelp();
++
++ if ( bFillFlag )
++ return;
++ if (nType == MARKER_START)
++ {
++ XFHolderStart* pHolder= new XFHolderStart;
++ pHolder->SetType(A2OUSTR("text"));
++ if (bHelpFlag)
++ pHolder->SetDesc(m_Help.str());
++ pHolder->SetPrompt(GetPromptText());
++ pXFPara->Add(pHolder);
++ }
++ else if (nType == MARKER_END)
++ {
++ XFHolderEnd* pHolder = new XFHolderEnd;
++ pXFPara->Add(pHolder);
++ }
++
++}
++
++//note: there will be a blank to mark the list
++//all input content of key list processed as normal text
++void LwpCHBlkMarker::ProcessKeylist(XFContentContainer* pXFPara,sal_uInt8 nType)
++{
++ sal_Bool bFillFlag = IsHasFilled();
++
++ if ( bFillFlag )
++ {
++ if (nType == MARKER_START)
++ {
++ EnumAllKeywords();//traverse the proplist to find all keywords
++ XFInputList* pList = new XFInputList;
++ pList->SetName(LwpDLNFPVList::m_Name.str());
++ pList->SetLabels(m_Keylist);
++ pXFPara->Add(pList);
++ }
++ else if (nType == MARKER_END)//skip
++ {
++ }
++ }
++ else
++ {
++ if (nType == MARKER_START)
++ {
++ EnumAllKeywords();
++ XFInputList* pList = new XFInputList;
++ pList->SetName(LwpDLNFPVList::m_Name.str());
++ pList->SetLabels(m_Keylist);
++ pXFPara->Add(pList);
++
++ XFHolderStart* pHolder= new XFHolderStart;
++ pHolder->SetType(A2OUSTR("text"));
++ pHolder->SetPrompt(GetPromptText());
++ pXFPara->Add(pHolder);
++ }
++ else if (nType == MARKER_END)
++ {
++ XFHolderEnd* pHolder = new XFHolderEnd;
++ pXFPara->Add(pHolder);
++ }
++ }
++}
++
++sal_Bool LwpCHBlkMarker::IsHasFilled()
++{
++ if (CHB_PROMPT & m_nFlag)
++ return sal_False;
++ return sal_True;
++}
++
++sal_Bool LwpCHBlkMarker::IsBubbleHelp()
++{
++ return (CHB_HELP & m_nFlag);
++}
++
++void LwpCHBlkMarker::EnumAllKeywords()
++{
++ OUString name1(A2OUSTR(""));
++ OUString value1(A2OUSTR(""));
++ OUString name2(A2OUSTR("start"));
++ LwpPropList* pProp = GetPropList();
++ if (!pProp)
++ return;
++ while(name2.getLength()>0)
++ {
++ name2 = pProp->EnumNamedProperty(name1,value1);
++ if ( name1.match(A2OUSTR("LIST"),0) )
++ {
++ m_Keylist.push_back(value1);
++ }
++ name1 = name2;
++ }
++}
++
++
++LwpBookMark::LwpBookMark(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ : LwpDLNFVList(objHdr,pStrm)
++{
++}
++
++void LwpBookMark::Read()
++{
++ LwpDLNFVList::Read();
++ m_objMarker.ReadIndexed(m_pObjStrm);
++ if (LwpFileHeader::m_nFileRevision < 0x0008)
++ {
++ if (m_pObjStrm->QuickReadBool())
++ m_nFlag |= BKMK_NOTESFX;
++ }
++ else
++ m_nFlag = m_pObjStrm->QuickReaduInt16();
++ m_pObjStrm->SkipExtra();
++}
++
++sal_Bool LwpBookMark::IsRightMarker(LwpObjectID objMarker)
++{
++ if (objMarker == m_objMarker)
++ return sal_True;
++ return sal_False;
++}
++
++OUString LwpBookMark::GetName()
++{
++ if (LwpDLNFVList::GetName())
++ return LwpDLNFVList::GetName()->str();
++ else
++ return OUString(A2OUSTR(""));
++}
++
++sal_Bool LwpBookMark::IsRightName(OUString sName)
++{
++ return sName.equals(GetName());
++}
++
++LwpFieldMark::LwpFieldMark(LwpObjectHeader &objHdr, LwpSvStream *pStrm):LwpStoryMarker(objHdr,pStrm),
++ m_bHasStyle(sal_False),m_bHasStart(sal_False),m_bRevisionFlag(sal_False),m_pFrib(NULL)
++{
++}
++
++void LwpFieldMark::Read()
++{
++ LwpStoryMarker::Read();
++ m_Formula.Read(m_pObjStrm);
++ m_objFormulaStory.ReadIndexed(m_pObjStrm);
++ if (LwpFileHeader::m_nFileRevision < 0x000B)
++ return;
++ m_objResultContent.ReadIndexed(m_pObjStrm);
++ m_nFlag = m_pObjStrm->QuickReaduInt16();
++ m_nFieldType = m_pObjStrm->QuickReaduInt16();
++ m_pObjStrm->SkipExtra();
++}
++
++void LwpFieldMark::ParseIndex(OUString& sKey1,OUString& sKey2)
++{
++ OUString sFormula = m_Formula.str();
++ sal_Int32 index[4];
++ sal_Unicode ch(0x0022);//"
++ index[0] = sFormula.indexOf(ch,0);
++ index[1] = sFormula.indexOf(ch,index[0]+1);
++
++ index[2] = sFormula.indexOf(ch,index[1]+1);
++ index[3] = sFormula.indexOf(ch,index[2]+1);
++ if (index[0]>=0 && index[1]>=0)
++ sKey1 = sFormula.copy(index[0]+1,index[1]-index[0]-1);
++ else
++ sKey1 = A2OUSTR("");
++ if (index[2]>=0 && index[3]>=0)
++ sKey2 = sFormula.copy(index[2]+1,index[3]-index[2]-1);
++ else
++ sKey2 = A2OUSTR("");
++}
++
++void LwpFieldMark::ParseTOC(OUString& sLevel,OUString& sText)
++{
++ OUString sFormula = m_Formula.str();
++ sal_Int32 index[4];
++ sal_Unicode ch1(0x0020);//space
++ sal_Unicode ch2(0x0022);//"
++
++ index[0] = sFormula.indexOf(ch1,0);
++ index[1] = sFormula.indexOf(ch1,index[0]+1);
++
++ index[2] = sFormula.indexOf(ch2,index[1]+1);
++ index[3] = sFormula.indexOf(ch2,index[2]+1);
++ if (index[0]>=0 && index[1]>=0)
++ sLevel = sFormula.copy(index[0]+1,index[1]-index[0]-1);
++ else
++ sLevel = A2OUSTR("");
++ if (index[2]>=0 && index[3]>=0)
++ sText = sFormula.copy(index[2]+1,index[3]-index[2]-1);
++ else
++ sText = A2OUSTR("");
++}
++
++sal_Bool LwpFieldMark::IsFormulaInsert()
++{
++ if (m_nFlag & FF_FORMULAINSERTED)
++ return sal_True;
++ return sal_False;
++}
++
++sal_Bool LwpFieldMark::IsDateTimeField(sal_uInt8& type,OUString& formula)
++{
++ OUString sFormula = m_Formula.str();
++ sal_Int32 index;
++ sal_Unicode ch1(0x0020);//space
++ OUString tag;
++
++ index = sFormula.indexOf(ch1,0);
++ if (index < 0)
++ {
++ if (sFormula == A2OUSTR("TotalEditingTime"))
++ {
++ type = DATETIME_TOTALTIME;
++ return sal_True;
++ }
++ return sal_False;
++ }
++
++ tag = sFormula.copy(0,index);
++ if (tag == A2OUSTR("Now()"))
++ {
++ type = DATETIME_NOW;
++ formula = sFormula.copy(index+1,sFormula.getLength()-index-1);
++ return sal_True;
++ }
++ else if (tag == A2OUSTR("CreateDate"))
++ {
++ type = DATETIME_CREATE;
++ formula = sFormula.copy(index+1,sFormula.getLength()-index-1);
++ return sal_True;
++ }
++ else if (tag == A2OUSTR("EditDate"))
++ {
++ type = DATETIME_LASTEDIT;
++ formula = sFormula.copy(index+1,sFormula.getLength()-index-1);
++ return sal_True;
++ }
++ else if (tag == A2OUSTR("YesterdaysDate") || tag == A2OUSTR("TomorrowsDate")
++ || tag == A2OUSTR("TodaysDate"))
++ {
++ type = DATETIME_SKIP;
++ return sal_True;
++ }
++ else
++ return sal_False;
++}
++
++sal_Bool LwpFieldMark::IsCrossRefField(sal_uInt8& nType, OUString& sMarkName)
++{
++ OUString sFormula = m_Formula.str();
++ sal_Int32 index;
++ sal_Unicode ch1(0x0020);//space
++ OUString tag;
++
++ index = sFormula.indexOf(ch1,0);
++ if (index < 0)
++ {
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ LwpBookmarkMgr* pMarkMgr = pGlobal->GetLwpBookmarkMgr();
++ if (pMarkMgr->FindBookmark(sFormula))
++ {
++ sMarkName = sFormula;
++ nType = CROSSREF_TEXT;
++ return sal_True;
++ }
++ else
++ return sal_False;
++ }
++
++ tag = sFormula.copy(0,index);
++ if (tag == A2OUSTR("PageRef"))
++ {
++ sMarkName = sFormula.copy(index+1,sFormula.getLength()-index-1);
++ nType = CROSSREF_PAGE;
++ return sal_True;
++ }
++ else if (tag == A2OUSTR("ParaRef"))
++ {
++ sMarkName = sFormula.copy(index+1,sFormula.getLength()-index-1);
++ nType = CROSSREF_PARANUMBER;
++ return sal_True;
++ }
++ else
++ return sal_False;
++}
++
++sal_Bool LwpFieldMark::IsDocPowerField(sal_uInt8& nType,OUString& sFormula)
++{
++ sFormula = m_Formula.str();
++
++ if (sFormula == A2OUSTR("Description"))
++ {
++ nType = DOC_DESCRIPTION;
++ return sal_True;
++ }
++ else if (sFormula == A2OUSTR("NumPages"))
++ {
++ nType = DOC_NUMPAGES;
++ return sal_True;
++ }
++ else if (sFormula == A2OUSTR("NumChars"))
++ {
++ nType = DOC_NUMCHARS;
++ return sal_True;
++ }
++ else if (sFormula == A2OUSTR("NumWords"))
++ {
++ nType = DOC_NUMWORDS;
++ return sal_True;
++ }
++ else
++ {
++ return sal_False;
++ }
++}
++
++LwpRubyMarker::LwpRubyMarker(LwpObjectHeader &objHdr, LwpSvStream *pStrm):LwpStoryMarker(objHdr,pStrm)
++{
++}
++
++void LwpRubyMarker::Read()
++{
++ LwpStoryMarker::Read();
++ m_objLayout.ReadIndexed(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpmarker.hxx lotuswordpro/source/filter/lwpmarker.hxx
+--- lotuswordpro.bak/source/filter/lwpmarker.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpmarker.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,281 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++
++
++#ifndef _LWPMARKER_HXX_
++#define _LWPMARKER_HXX_
++
++#include "lwpobj.hxx"
++#include "lwpobjid.hxx"
++#include "lwpdlvlist.hxx"
++#include "lwpfrib.hxx"
++#include "xfilter/xftextspan.hxx"
++
++class LwpMarker : public LwpDLNFPVList
++{
++public:
++ LwpMarker(LwpObjectHeader &objHdr, LwpSvStream *pStrm);
++ ~LwpMarker(){};
++ void Read();
++ OUString GetNamedProperty(OUString name);
++protected:
++ enum{
++ MARKER_START=1,
++ MARKER_END=2
++ };
++private:
++ sal_uInt16 m_nFlag;
++ sal_uInt16 m_nPageNumber;
++ sal_uInt16 m_nNeedUpdate;
++ LwpObjectID m_objLayout;
++ LwpObjectID m_objMarkerList;
++ LwpObjectID m_objContent;
++
++};
++
++class LwpFribRange
++{
++public:
++ LwpFribRange(){};
++ ~LwpFribRange(){};
++ void Read(LwpObjectStream* pObjStrm);
++private:
++ LwpObjectID m_StartPara;
++ LwpObjectID m_EndPara;
++};
++
++class LwpStoryMarker : public LwpMarker
++{
++public:
++ LwpStoryMarker(LwpObjectHeader &objHdr, LwpSvStream *pStrm);
++ ~LwpStoryMarker(){};
++ void Read();
++private:
++ LwpFribRange m_Range;
++ sal_uInt16 m_nFlag;
++};
++
++class LwpCHBlkMarker : public LwpStoryMarker
++{
++public:
++ LwpCHBlkMarker(LwpObjectHeader &objHdr, LwpSvStream *pStrm);
++ ~LwpCHBlkMarker(){};
++ void Read();
++ sal_uInt16 GetAction(){return m_nAction;}
++ void ConvertCHBlock(XFContentContainer* pXFPara,sal_uInt8 nType);
++ enum{
++ CLICKHERE_CHBEHAVIORTEXT=1,
++ CLICKHERE_CHBEHAVIORTABLE=2,
++ CLICKHERE_CHBEHAVIORPICTURE=3,
++ CLICKHERE_CHBEHAVIOROLEOBJECT=4,
++ CLICKHERE_CHBEHAVIORCHART=5,
++ CLICKHERE_CHBEHAVIORDRAWING=6,
++ CLICKHERE_CHBEHAVIORFILE=7,
++ CLICKHERE_CHBEHAVIORGLOSSARY=8,
++ CLICKHERE_CHBEHAVIOREQUATION=9,
++ CLICKHERE_CHBEHAVIORINTERNETLINK=10,
++ CLICKHERE_CHBEHAVIORSTRINGLIST=11,
++ CLICKHERE_CHBEHAVIORDATETIME=12,
++ CLICKHERE_CHBEHAVIORSYMBOL=13,
++ CLICKHERE_CHBEHAVIORDOCFIELD=14,
++ CLICKHERE_CHBEHAVIORPAGENUM=15
++ };
++private:
++ void ProcessPlaceHolder(XFContentContainer* pXFPara,sal_uInt16 nAction,sal_uInt8 nType);
++ void ProcessOtherCHB(XFContentContainer* pXFPara,sal_uInt8 nType);
++ void ProcessPageNumber(XFContentContainer* pXFPara,sal_uInt8 nType);
++ void ProcessKeylist(XFContentContainer* pXFPara,sal_uInt8 nType);
++ sal_Bool IsHasFilled();
++ sal_Bool IsBubbleHelp();
++ OUString GetPromptText();
++ void EnumAllKeywords();
++private:
++ enum{
++ CHB_PROMPT = 0x01,
++ CHB_EDIT = 0x02,
++ CHB_HELP = 0x04,
++ CHB_TAB = 0x08,
++ CHB_HIDDEN = 0x10,
++ CHB_ALLOWVALUESNOTINLIST = 0x20,
++ CHB_ALLOWMULTIVALUES = 0x40,
++ CHB_RETURN = 0x80,
++ CHB_NOEARS = 0x100,
++ CHB_MAGNETIC = 0x200,
++ CHB_PERSISTENT = (CHB_PROMPT+CHB_HELP+CHB_TAB+CHB_HIDDEN
++ +CHB_ALLOWVALUESNOTINLIST+CHB_ALLOWMULTIVALUES
++ +CHB_RETURN+CHB_NOEARS+CHB_MAGNETIC)
++ };
++ LwpObjectID m_objPromptStory;
++ sal_uInt32 m_nTab;
++ sal_uInt16 m_nFlag;
++ sal_uInt16 m_nAction;
++ LwpAtomHolder m_Help;
++ LwpAtomHolder m_Mirror;
++ std::vector<OUString> m_Keylist;
++};
++
++class LwpBookMark : public LwpDLNFVList
++{
++public:
++ LwpBookMark(LwpObjectHeader &objHdr, LwpSvStream *pStrm);
++ ~LwpBookMark(){};
++protected:
++ void Read();
++public:
++ sal_Bool IsRightMarker(LwpObjectID objMarker);
++ OUString GetName();
++ sal_Bool IsRightName(OUString sName);
++private:
++ enum { BKMK_NOTESFX = 0x0001,
++ BKMK_OLDNOTESFX = 0x0002
++ };
++ LwpObjectID m_objMarker;
++ sal_Bool m_bHint;
++ sal_uInt16 m_nFlag;
++};
++
++class LwpFieldMark : public LwpStoryMarker
++{
++public:
++ LwpFieldMark(LwpObjectHeader &objHdr, LwpSvStream *pStrm);
++ ~LwpFieldMark(){};
++ void Read();
++ void ParseIndex(OUString& sKey1,OUString& sKey2);
++ void ParseTOC(OUString& sLevel,OUString& sText);
++// sal_uInt8 ParseCrossRef(OUString& sMarkName);
++ sal_uInt16 GetFieldType(){return m_nFieldType;}
++ sal_Bool IsFormulaInsert();
++ sal_Bool IsDateTimeField(sal_uInt8& type,OUString& formula);
++ sal_Bool IsCrossRefField(sal_uInt8& nType, OUString& sMarkName);
++ sal_Bool IsDocPowerField(sal_uInt8& nType,OUString& sFormula);
++ OUString GetFormula(){return m_Formula.str();}
++ void SetStyleFlag(sal_Bool bFalg){m_bHasStyle = bFalg;}
++ sal_Bool GetStyleFlag(){return m_bHasStyle;}
++ sal_Bool GetStart(){return m_bHasStart;}
++ void SetStart(sal_Bool bFlag){m_bHasStart = bFlag;}
++ LwpFrib* GetStartFrib(){return m_pFrib;}
++ void SetStartFrib(LwpFrib* pFrib){m_pFrib = pFrib;}
++ sal_Bool GetRevisionFlag(){return m_bRevisionFlag;}
++ void SetRevisionFlag(sal_Bool bFlag){m_bRevisionFlag = bFlag;}
++
++ enum{
++ FLD_FIELD = 0x0003,
++ FLD_INDEX = 0x0008,
++ FLD_TOC = 0x000B
++ };
++ enum{
++ FF_FORMULAINSERTED = 0X0008,
++ };
++ enum{
++ CROSSREF_INVALID = 0,
++ CROSSREF_TEXT = 1,
++ CROSSREF_PAGE = 2,
++ CROSSREF_PARANUMBER = 3
++ };
++ enum{
++ DATETIME_SKIP = 0,
++ DATETIME_NOW = 1,
++ DATETIME_CREATE = 2,
++ DATETIME_LASTEDIT = 3,
++ DATETIME_TOTALTIME = 4
++ };
++ enum{
++ DOC_DESCRIPTION = 1,
++ DOC_NUMPAGES = 2,
++ DOC_NUMWORDS = 3,
++ DOC_NUMCHARS = 4,
++ };
++private:
++ LwpObjectID m_objFormulaStory;
++ LwpObjectID m_objResultContent;
++ sal_uInt8* m_nExtra;
++ sal_uInt16 m_nFlag;
++ sal_uInt16 m_nFieldType;
++ LwpAtomHolder m_Formula;
++
++ sal_Bool m_bHasStyle;
++ sal_Bool m_bHasStart;
++
++ LwpFrib* m_pFrib;
++ sal_Bool m_bRevisionFlag;
++};
++
++class LwpRubyMarker : public LwpStoryMarker
++{
++public:
++ LwpRubyMarker(LwpObjectHeader &objHdr, LwpSvStream *pStrm);
++ ~LwpRubyMarker(){};
++ void Read();
++ OUString GetRubyText(){return m_strRubyText;}
++ void SetRubyText(OUString sText){m_strRubyText = sText;}
++ OUString GetTextStyleName(){return m_TextStye;}
++ void SetTextStyleName(OUString sName){m_TextStye = sName;}
++ OUString GetRubyStyleName(){return m_RubyStyle;}
++ void SetRubyStyleName(OUString sName){m_RubyStyle = sName;}
++private:
++ LwpObjectID m_objLayout;
++ OUString m_strRubyText;
++ OUString m_RubyStyle;
++ OUString m_TextStye;
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpnotes.cxx lotuswordpro/source/filter/lwpnotes.cxx
+--- lotuswordpro.bak/source/filter/lwpnotes.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpnotes.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,329 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - notes
++ */
++/*************************************************************************
++ * Change History
++ May 2005 Created
++ ************************************************************************/
++#include "lwpnotes.hxx"
++#include "lwppara.hxx"
++#include "xfilter/xfannotation.hxx"
++#include "xfilter/xftextspan.hxx"
++#include "localtime.hxx"
++#include "lwptools.hxx"
++
++ LwpFribNote::LwpFribNote(LwpPara* pPara ):LwpFrib(pPara)
++{
++}
++
++/**
++ * @descr read frib information
++ */
++void LwpFribNote::Read(LwpObjectStream *pObjStrm, sal_uInt16 len)
++{
++ m_Layout.ReadIndexed(pObjStrm);
++}
++
++/**
++ * @descr Register style
++ */
++void LwpFribNote::RegisterStyle()
++{
++ LwpObject* pLayout = m_Layout.obj();
++ if(pLayout)
++ {
++ //register font style
++ LwpFrib::RegisterStyle(m_pPara->GetFoundry());
++ //register foonote style
++ pLayout->SetFoundry(m_pPara->GetFoundry());
++ pLayout->RegisterStyle();
++ }
++}
++
++/**
++ * @descr convert note
++ */
++void LwpFribNote::XFConvert(XFContentContainer* pCont)
++{
++ LwpNoteLayout* pLayout =static_cast<LwpNoteLayout*>(m_Layout.obj());
++ if(pLayout)
++ {
++ XFAnnotation* pXFNote = new XFAnnotation;
++ pXFNote->SetAuthor(pLayout->GetAuthor());
++ LtTm aTm;
++ long nTime = pLayout->GetTime();
++ if(LtgLocalTime(nTime, aTm))
++ {
++ pXFNote->SetDate(LwpTools::DateTimeToOUString(aTm));
++ }
++
++ pLayout->XFConvert(pXFNote);
++ if(m_pModifiers)
++ {
++ XFTextSpan *pSpan = new XFTextSpan();
++ pSpan->SetStyleName(GetStyleName());
++ pSpan->Add(pXFNote);
++ pCont->Add(pSpan);
++ }
++ else
++ {
++ pCont->Add(pXFNote);
++ }
++ }
++
++}
++
++
++LwpNoteLayout::LwpNoteLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpFrameLayout(objHdr, pStrm)
++{
++
++}
++
++LwpNoteLayout::~LwpNoteLayout()
++{
++
++}
++
++/**
++ * @descr read note layout object
++ *
++ */
++void LwpNoteLayout::Read()
++{
++ LwpFrameLayout::Read();
++
++ m_pObjStrm->QuickRead(&m_nTime, sizeof(m_nTime));
++ m_UserName.Read(m_pObjStrm);
++
++ LwpAtomHolder aUserInitials;
++ aUserInitials.Read(m_pObjStrm);
++
++ LwpColor aColor;
++ aColor.Read(m_pObjStrm);
++
++ // vacant note sequence
++ m_pObjStrm->QuickReadInt32();
++
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++ * @descr Register style
++ */
++void LwpNoteLayout::RegisterStyle()
++{
++ LwpVirtualLayout* pTextLayout = GetTextLayout();
++ if(pTextLayout)
++ {
++ pTextLayout->SetFoundry(GetFoundry());
++ pTextLayout->RegisterStyle();
++ }
++}
++
++/**
++ * @descr convert note
++ */
++void LwpNoteLayout::XFConvert(XFContentContainer * pCont)
++{
++ LwpVirtualLayout* pTextLayout = GetTextLayout();
++ if(pTextLayout)
++ {
++ pTextLayout->XFConvert(pCont);
++ }
++}
++
++/**
++ * @descr Get layout that contains note text.
++ */
++LwpVirtualLayout* LwpNoteLayout::GetTextLayout()
++{
++ LwpVirtualLayout* pLayout = FindChildByType(LWP_VIEWPORT_LAYOUT);
++ if(pLayout)
++ {
++ return pLayout->FindChildByType(LWP_NOTETEXT_LAYOUT);
++ }
++
++ return NULL;
++}
++/**
++ * @descr Get author.
++ */
++OUString LwpNoteLayout::GetAuthor()
++{
++ if(m_UserName.HasValue())
++ {
++ if(m_UserName.str() != A2OUSTR(" "))
++ {
++ return m_UserName.str();
++ }
++ }
++ //if username is null or writerspace, get username from noteheaderlayout
++ LwpNoteHeaderLayout* pTextLayout = static_cast<LwpNoteHeaderLayout*>(FindChildByType(LWP_NOTEHEADER_LAYOUT));
++ if(pTextLayout)
++ {
++ LwpStory* pStory = static_cast<LwpStory*>(pTextLayout->GetContent()->obj());
++ if(pStory)
++ {
++ LwpPara* pFirst = static_cast<LwpPara*>(pStory->GetFirstPara()->obj());
++ if(pFirst)
++ return pFirst->GetContentText(sal_True);
++ }
++ }
++
++ return m_UserName.str();
++}
++
++LwpNoteHeaderLayout::LwpNoteHeaderLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpFrameLayout(objHdr, pStrm)
++{
++}
++
++LwpNoteHeaderLayout::~LwpNoteHeaderLayout()
++{
++}
++
++/**
++ * @descr read note layout object
++ *
++ */
++void LwpNoteHeaderLayout::Read()
++{
++ LwpFrameLayout::Read();
++ m_pObjStrm->SkipExtra();
++}
++
++void LwpNoteHeaderLayout::RegisterStyle()
++{
++}
++
++void LwpNoteHeaderLayout::XFConvert(XFContentContainer * pCont)
++{
++}
++
++LwpNoteTextLayout::LwpNoteTextLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpFrameLayout(objHdr, pStrm)
++{
++}
++
++LwpNoteTextLayout::~LwpNoteTextLayout()
++{
++}
++
++/**
++ * @descr read note layout object
++ *
++ */
++void LwpNoteTextLayout::Read()
++{
++ LwpFrameLayout::Read();
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++ * @descr Register style, SODC doesn't support text style in note
++ */
++void LwpNoteTextLayout::RegisterStyle()
++{
++ LwpObject* pContent = m_Content.obj();
++ if(pContent)
++ {
++ pContent->SetFoundry(GetFoundry());
++ pContent->RegisterStyle();
++ }
++}
++
++void LwpNoteTextLayout::XFConvert(XFContentContainer * pCont)
++{
++ LwpObject* pContent = m_Content.obj();
++ if(pContent)
++ {
++ pContent->XFConvert(pCont);
++ }
++}
++
++
++LwpViewportLayout::LwpViewportLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpPlacableLayout(objHdr, pStrm)
++{
++}
++
++LwpViewportLayout::~LwpViewportLayout()
++{
++}
++
++/**
++ * @descr read note layout object
++ *
++ */
++void LwpViewportLayout::Read()
++{
++ LwpPlacableLayout::Read();
++ m_pObjStrm->SkipExtra();
++}
++
++void LwpViewportLayout::RegisterStyle()
++{
++}
++
++void LwpViewportLayout::XFConvert(XFContentContainer * pCont)
++{
++}
++
++
++
+diff -urNp lotuswordpro.bak/source/filter/lwpnotes.hxx lotuswordpro/source/filter/lwpnotes.hxx
+--- lotuswordpro.bak/source/filter/lwpnotes.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpnotes.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,161 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - notes
++ */
++/*************************************************************************
++ * Change History
++ May 2005 Created
++ ************************************************************************/
++#ifndef _LWPNOTES_HXX_
++#define _LWPNOTES_HXX_
++
++#include "lwpfrib.hxx"
++#include "lwpframelayout.hxx"
++
++/**
++ * @brief TAG_NOTE_FRIB object
++ *
++ */
++class LwpFribNote: public LwpFrib
++{
++public:
++ LwpFribNote(LwpPara* pPara );
++ ~LwpFribNote(){};
++ void Read(LwpObjectStream* pObjStrm, sal_uInt16 len);
++ void RegisterStyle();
++ void XFConvert(XFContentContainer* pCont);
++private:
++ LwpObjectID m_Layout;
++};
++
++/**
++ * @brief VO_NOTELAYOUT object
++ *
++ */
++class LwpNoteLayout: public LwpFrameLayout
++{
++public:
++ LwpNoteLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpNoteLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_NOTE_LAYOUT;}
++ virtual void RegisterStyle();
++ virtual void XFConvert(XFContentContainer* pCont);
++ sal_uInt32 GetTime(){ return m_nTime;};
++ OUString GetAuthor();
++
++protected:
++ void Read();
++ LwpVirtualLayout* GetTextLayout();
++
++private:
++ sal_uInt32 m_nTime;
++ LwpAtomHolder m_UserName;
++};
++
++
++/**
++ * @brief VO_NOTEHEADERLAYOUT object
++ *
++ */
++class LwpNoteHeaderLayout: public LwpFrameLayout
++{
++public:
++ LwpNoteHeaderLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpNoteHeaderLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_NOTEHEADER_LAYOUT;}
++ virtual void RegisterStyle();
++ virtual void XFConvert(XFContentContainer* pCont);
++
++protected:
++ void Read();
++};
++
++/**
++ * @brief VO_NOTETEXTLAYOUT object
++ *
++ */
++class LwpNoteTextLayout: public LwpFrameLayout
++{
++public:
++ LwpNoteTextLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpNoteTextLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_NOTETEXT_LAYOUT;}
++ virtual void RegisterStyle();
++ virtual void XFConvert(XFContentContainer* pCont);
++
++protected:
++ void Read();
++};
++
++/**
++ * @brief VO_VPLAYOUT object
++ *
++ */
++class LwpViewportLayout: public LwpPlacableLayout
++{
++public:
++ LwpViewportLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpViewportLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_VIEWPORT_LAYOUT;}
++ virtual void RegisterStyle();
++ virtual void XFConvert(XFContentContainer* pCont);
++
++protected:
++ void Read();
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpnumberingoverride.cxx lotuswordpro/source/filter/lwpnumberingoverride.cxx
+--- lotuswordpro.bak/source/filter/lwpnumberingoverride.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpnumberingoverride.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,180 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++* @file
++* Numbering override of Wordpro.
++************************************************************************/
++/*************************************************************************
++* Change History
++* 2005-01-12 Create and implement.
++************************************************************************/
++
++#include "lwpnumberingoverride.hxx"
++#include "lwpobjstrm.hxx"
++
++LwpNumberingOverride::LwpNumberingOverride()
++{
++ m_nLevel = 0;
++ m_nPosition = 0;
++}
++
++void LwpNumberingOverride::Read(LwpObjectStream *pStrm)
++{
++ if (pStrm->QuickReadBool())
++ {
++ ReadCommon(pStrm);
++
++ pStrm->QuickRead(&m_nLevel, sizeof(m_nLevel));
++ pStrm->QuickRead(&m_nPosition, sizeof(m_nPosition));
++ }
++
++ pStrm->SkipExtra();
++}
++//add by , 02/03/2005
++void LwpNumberingOverride::Override(LwpNumberingOverride* pOther)
++{
++ if (m_nApply & NO_LEVEL)
++ {
++ if (IsLevelOverridden())
++ {
++ pOther->OverrideLevel(m_nLevel);
++ }
++ else
++ {
++ pOther->RevertLevel();
++ }
++ }
++
++ if (m_nApply & NO_POSITION)
++ {
++ if (IsPositionOverridden())
++ {
++ pOther->OverridePosition(m_nPosition);
++ }
++ else
++ {
++ pOther->RevertPosition();
++ }
++ }
++
++ if (m_nApply & HEADING)
++ {
++ if (IsHeadingOverridden())
++ {
++ pOther->OverrideHeading(IsHeading());
++ }
++ else
++ {
++ pOther->RevertHeading();
++ }
++ }
++
++ if (m_nApply & SMARTLEVEL)
++ {
++ if (IsSmartLevelOverridden())
++ {
++ pOther->OverrideSmartLevel(IsSmartLevel());
++ }
++ else
++ {
++ pOther->RevertSmartLevel();
++ }
++ }
++}
++
++void LwpNumberingOverride::operator=(const LwpOverride& rOther)
++{
++ LwpOverride::operator=(rOther);
++
++ const LwpNumberingOverride* pOther =
++ static_cast<LwpNumberingOverride*>((LwpOverride*)&rOther);
++
++ m_nLevel = pOther->m_nLevel;
++ m_nPosition = pOther->m_nPosition;
++}
++
++void LwpNumberingOverride::OverrideLevel(sal_uInt16 nNewLv)
++{
++ m_nLevel = nNewLv;
++ LwpOverride::Override(NO_LEVEL, STATE_ON);
++}
++void LwpNumberingOverride::OverridePosition(sal_uInt16 nNewPos)
++{
++ m_nPosition = nNewPos;
++ LwpOverride::Override(NO_POSITION, STATE_ON);
++}
++void LwpNumberingOverride::OverrideHeading(sal_Bool bVal)
++{
++ if (bVal)
++ {
++ LwpOverride::Override(HEADING, STATE_ON);
++ }
++ else
++ {
++ LwpOverride::Override(HEADING, STATE_OFF);
++ }
++}
++void LwpNumberingOverride::OverrideSmartLevel(sal_Bool bVal)
++{
++ if (bVal)
++ {
++ LwpOverride::Override(SMARTLEVEL, STATE_ON);
++ }
++ else
++ {
++ LwpOverride::Override(SMARTLEVEL, STATE_OFF);
++ }
++}
++//end add
+diff -urNp lotuswordpro.bak/source/filter/lwpnumberingoverride.hxx lotuswordpro/source/filter/lwpnumberingoverride.hxx
+--- lotuswordpro.bak/source/filter/lwpnumberingoverride.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpnumberingoverride.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,170 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++* @file
++* Numbering override of Wordpro.
++************************************************************************/
++/*************************************************************************
++* Change History
++* 2005-01-12 Create and implement.
++************************************************************************/
++
++#ifndef _LWPNUMBERINGOVERRIDE_HXX
++#define _LWPNUMBERINGOVERRIDE_HXX
++
++#include "lwpoverride.hxx"
++
++class LwpObjectStream;
++class LwpNumberingOverride : public LwpOverride
++{
++public:
++ LwpNumberingOverride();
++ virtual ~LwpNumberingOverride(){}
++
++ enum
++ {
++ NO_LEVEL = 0x0001,
++ NO_POSITION = 0x0002,
++ HEADING = 0x0004,
++ SMARTLEVEL = 0x0008
++ };
++public:
++ virtual void Read(LwpObjectStream *pStrm);
++
++ //add by , 02/03/2005
++ void Override(LwpNumberingOverride* pOther);
++ void operator=(const LwpOverride& rOther);
++
++ inline sal_uInt16 GetLevel() const;
++ inline sal_uInt16 GetPosition() const;
++
++ inline sal_Bool IsLevelOverridden();
++ inline sal_Bool IsPositionOverridden();
++ inline sal_Bool IsHeadingOverridden();
++ inline sal_Bool IsSmartLevelOverridden();
++ inline sal_Bool IsHeading();
++ inline sal_Bool IsSmartLevel();
++
++ void OverrideLevel(sal_uInt16 nNewLv);
++ void OverridePosition(sal_uInt16 nNewPos);
++ void OverrideHeading(sal_Bool bVal);
++ void OverrideSmartLevel(sal_Bool bVal);
++
++ inline void RevertLevel();
++ inline void RevertPosition();
++ inline void RevertHeading();
++ inline void RevertSmartLevel();
++ //end add
++private:
++ sal_uInt16 m_nLevel;
++ sal_uInt16 m_nPosition;
++};
++
++inline sal_uInt16 LwpNumberingOverride::GetLevel() const
++{
++ return m_nLevel;
++}
++
++inline sal_uInt16 LwpNumberingOverride::GetPosition() const
++{
++ return m_nPosition;
++}
++
++//add by , 02/03/2005
++inline sal_Bool LwpNumberingOverride::IsLevelOverridden()
++{
++ return (sal_Bool)((m_nOverride & NO_LEVEL) != 0);
++}
++inline sal_Bool LwpNumberingOverride::IsPositionOverridden()
++{
++ return (sal_Bool)((m_nOverride & NO_POSITION) != 0);
++}
++inline sal_Bool LwpNumberingOverride::IsHeadingOverridden()
++{
++ return (sal_Bool)((m_nOverride & HEADING) != 0);
++}
++inline sal_Bool LwpNumberingOverride::IsSmartLevelOverridden()
++{
++ return (sal_Bool)((m_nOverride & SMARTLEVEL) != 0);
++}
++inline sal_Bool LwpNumberingOverride::IsHeading()
++{
++ return (m_nValues & HEADING) != 0;
++}
++inline sal_Bool LwpNumberingOverride::IsSmartLevel()
++{
++ return (m_nValues & SMARTLEVEL) != 0;
++}
++
++inline void LwpNumberingOverride::RevertLevel()
++{
++ LwpOverride::Override(NO_LEVEL, STATE_STYLE);
++}
++inline void LwpNumberingOverride::RevertPosition()
++{
++ LwpOverride::Override(NO_POSITION, STATE_STYLE);
++}
++inline void LwpNumberingOverride::RevertHeading()
++{
++ LwpOverride::Override(HEADING, STATE_STYLE);
++}
++inline void LwpNumberingOverride::RevertSmartLevel()
++{
++ LwpOverride::Override(SMARTLEVEL, STATE_STYLE);
++}
++
++//end add
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpnumericfmt.cxx lotuswordpro/source/filter/lwpnumericfmt.cxx
+--- lotuswordpro.bak/source/filter/lwpnumericfmt.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpnumericfmt.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,566 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - table cell numerics format
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++
++#include "lwpnumericfmt.hxx"
++
++///////////////////////////////////////////////////////////////////
++LwpCurrencyPool LwpNumericFormat::m_aCurrencyInfo;
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return
++*/
++String LwpCurrencyPool::GetCurrencySymbol(sal_uInt16 nFormat)
++{
++ return m_aCurrencyInfo[nFormat].sSymbol;
++}
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++sal_Bool LwpCurrencyPool::IsSymbolPost(sal_uInt16 nFormat)
++{
++ return m_aCurrencyInfo[nFormat].bPost;;
++}
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++sal_Bool LwpCurrencyPool::IsShowSpace(sal_uInt16 nFormat)
++{
++ return m_aCurrencyInfo[nFormat].bShowSpace;
++}
++//////////////////////////////////////////////////////////////////////
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return
++*/
++XFStyle* LwpLayoutNumerics::Convert()
++{
++ return cNumerics.Convert();
++}
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++void LwpLayoutNumerics::Read()
++{
++ LwpVirtualPiece::Read();
++
++ if(LwpFileHeader::m_nFileRevision >= 0x000b)
++ {
++ cNumerics.Read();
++ m_pObjStrm->SkipExtra();
++ }
++}
++///////////////////////////////////////////////////////////////////
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++void LwpNumericFormatSubset::QuickRead(LwpObjectStream* pStrm)
++{
++ cColor.Read(pStrm);
++ cPrefix.Read(pStrm);
++ cSuffix.Read(pStrm);
++ cSubFlags = pStrm->QuickReaduInt16();
++
++ pStrm->SkipExtra();
++}
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return.
++*/
++LwpColor LwpNumericFormatSubset::GetColor()
++{
++ if (cSubFlags&0x04)
++ {
++ return cColor;
++ }
++ else
++ {
++ return LwpColor();
++ }
++}
++LwpNumericFormatSubset::LwpNumericFormatSubset():cSubFlags(0)
++{
++}
++LwpNumericFormatSubset::~LwpNumericFormatSubset()
++{
++}
++
++///////////////////////////////////////////////////////////////////////////////////
++LwpNumericFormat::LwpNumericFormat(LwpObjectStream * pStrm):cDecimalPlaces(0),cFormat(FMT_DEFAULT)
++{
++ assert(pStrm);
++ m_pObjStrm = pStrm;
++}
++/**
++* Read number format from wordpro file
++* @date 03/26/2005
++* @param
++* @param
++* @return
++*/
++void LwpNumericFormat::Read()
++{
++ LwpObjectStream* pStrm = m_pObjStrm;
++
++ if(LwpFileHeader::m_nFileRevision >= 0x000b)
++ {
++ cFlags = pStrm->QuickReaduInt16();
++ cDecimalPlaces = pStrm->QuickReaduInt16();
++ cFormat = pStrm->QuickReaduInt16();
++
++ cAnyNumber.QuickRead(pStrm);
++ cZero.QuickRead(pStrm);
++ cNegative.QuickRead(pStrm);
++
++ pStrm->SkipExtra();
++ }
++}
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++sal_Bool
++LwpNumericFormat::IsCurrencyFormat(USHORT Format)
++{
++ switch (Format)
++ {
++ case FMT_ARGENTINEANPESO:
++ case FMT_AUSTRALIANDOLLAR:
++ case FMT_AUSTRIANSCHILLING:
++ case FMT_BELGIANFRANC:
++ case FMT_BRAZILIANCRUZEIRO:
++ case FMT_BRITISHPOUND:
++ case FMT_CANADIANDOLLAR:
++ case FMT_CHINESEYUAN:
++ case FMT_CZECHKORUNA:
++ case FMT_DANISHKRONE:
++ case FMT_ECU:
++ case FMT_FINNISHMARKKA:
++ case FMT_FRENCHFRANC:
++ case FMT_GREEKDRACHMA:
++ case FMT_HONGKONGDOLLAR:
++ case FMT_HUNGARIANFORINT:
++ case FMT_INDIANRUPEE:
++ case FMT_INDONESIANRUPIAH:
++ case FMT_IRISHPUNT:
++ case FMT_LUXEMBOURGFRANC:
++ case FMT_MALAYSIANRINGGIT:
++ case FMT_MEXICANPESO:
++ case FMT_NETHERLANDSGUILDER:
++ case FMT_NEWZEALANDDOLLAR:
++ case FMT_NORWEGIANKRONE:
++ case FMT_POLISHZLOTY:
++ case FMT_PORTUGUESEESCUDO:
++ case FMT_ROMANIANLEI:
++ case FMT_RUSSIANRUBLE:
++ case FMT_SINGAPOREDOLLAR:
++ case FMT_SLOVAKIANKORUNA:
++ case FMT_SLOVENIANTHOLAR:
++ case FMT_SOUTHAFRICANRAND:
++ case FMT_SOUTHKOREANWON:
++ case FMT_SWEDISHKRONA:
++ case FMT_SWISSFRANC:
++ case FMT_TAIWANDOLLAR:
++ case FMT_THAIBAHT:
++ case FMT_USDOLLAR:
++ case FMT_OTHERCURRENCY:
++ case FMT_GERMANMARK:
++ case FMT_ITALIANLIRA:
++ case FMT_JAPANESEYEN:
++ case FMT_SPANISHPESETA:
++ case FMT_EURO:
++ return sal_True;
++
++ default:
++ return sal_False;
++ }
++}
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return.
++*/
++USHORT
++LwpNumericFormat::GetDecimalPlaces(void)
++{
++ if (IsDecimalPlacesOverridden())
++ return cDecimalPlaces;
++ return GetDefaultDecimalPlaces(cFormat);
++}
++/**
++* Make the currency string.
++* @date 03/26/2005
++* @param
++* @param
++* @return
++*/
++void LwpNumericFormat::GetCurrencyStr(LwpNumericFormatSubset aNumber, String& aPrefix, String& aSuffix, sal_Bool bNegtive)
++{
++ aPrefix = aNumber.GetPrefix();
++ aSuffix = aNumber.GetSuffix();
++
++ //Make the default prefix and suffix
++ String aSymbol = m_aCurrencyInfo.GetCurrencySymbol(cFormat);
++ sal_Bool bPost = m_aCurrencyInfo.IsSymbolPost(cFormat);
++ sal_Bool bShowSpace = m_aCurrencyInfo.IsShowSpace(cFormat);
++ if ( aNumber.IsDefaultPrefix())
++ {
++ if (bNegtive)
++ {
++ aPrefix = String::CreateFromAscii("(");
++ }
++ if (!bPost)
++ {
++ aPrefix += aSymbol;
++ if (bShowSpace)
++ {
++ aPrefix +=String::CreateFromAscii(" ");
++ }
++ }
++ }
++ if ( aNumber.IsDefaultSuffix())
++ {
++ if (bPost)
++ {
++ aSuffix = aSymbol;
++ if (bShowSpace)
++ {
++ aSuffix.Insert(String::CreateFromAscii(" "),0);
++ }
++
++ }
++
++ if (bNegtive)
++ {
++ aSuffix += String::CreateFromAscii(")");
++ }
++ }
++}
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return
++*/
++void LwpNumericFormat::SetNumberType(XFNumberStyle* pStyle)
++{
++ switch(cFormat)
++ {
++ case FMT_PERCENT:
++ {
++ pStyle->SetNumberType(enumXFNumberPercent);
++ }
++ break;
++
++ case FMT_COMMA:
++ {
++ pStyle->SetNumberType(enumXFNumberNumber);
++ pStyle->SetGroup();
++ }
++ break;
++ case FMT_SCIENTIFIC:
++ {
++ pStyle->SetNumberType(enumXFNumberScientific);
++ }
++ break;
++ case FMT_FIXED:
++ case FMT_GENERAL:
++ {
++ pStyle->SetNumberType(enumXFNumberNumber);
++ }
++ break;
++ default://including text type, which is not a style of number format in SODC
++ {
++ pStyle->SetNumberType(enumXFText);
++ }
++ break;
++ }
++}
++/**
++* Make the xml content of number format
++* @date 03/26/2005
++* @param
++* @param
++* @return XFStyle*
++*/
++XFStyle* LwpNumericFormat::Convert()
++{
++ XFNumberStyle* pStyle = new XFNumberStyle;
++ String aPrefix, aSuffix,aNegPrefix,aNegSuffix;
++ LwpColor aColor, aNegativeColor;
++
++ if (IsCurrencyFormat(cFormat))
++ {
++ pStyle->SetNumberType(enuMXFNumberCurrency);
++ pStyle->SetGroup();
++ GetCurrencyStr(cAnyNumber, aPrefix, aSuffix);
++ GetCurrencyStr(cNegative, aNegPrefix, aNegSuffix,sal_True);
++ }
++ else
++ {
++ SetNumberType(pStyle);
++ {//Anynumber
++ aPrefix = cAnyNumber.GetPrefix();
++ //Set suffix
++ aSuffix = cAnyNumber.GetSuffix();
++ //Set color
++ aColor = cAnyNumber.GetColor();
++ }
++
++ if (!IsNegativeOverridden())
++ {
++ aNegPrefix = aPrefix;
++ aNegSuffix = aSuffix;
++ aNegativeColor = aColor;
++ }
++ else
++ {//negative
++ aNegPrefix = cNegative.GetPrefix();
++ aNegSuffix = cNegative.GetSuffix();
++ aNegativeColor = cNegative.GetColor();
++ }
++ if (FMT_COMMA==cFormat)
++ {
++ if (cNegative.IsDefaultPrefix() && aNegPrefix.Len() == 0)
++ {
++ aNegPrefix = String::CreateFromAscii("(");
++ }
++ if (cNegative.IsDefaultSuffix() && aNegSuffix.Len() == 0)
++ {
++ aNegSuffix = String::CreateFromAscii(")");
++ }
++ }
++
++ }
++
++ pStyle->SetDecimalDigits(GetDecimalPlaces());
++
++ aPrefix = reencode(aPrefix);
++ aSuffix = reencode(aSuffix);
++ aNegPrefix = reencode(aNegPrefix);
++ aNegSuffix = reencode(aNegSuffix);
++
++ {//Anynumber
++ //Set prefix
++ pStyle->SetPrefix(aPrefix);
++ //Set suffix
++ pStyle->SetSurfix(aSuffix);
++ pStyle->SetColor( XFColor( (sal_uInt8)aColor.GetRed(),
++ (sal_uInt8)aColor.GetGreen(),
++ (sal_uInt8)aColor.GetBlue()) );
++ }
++ {//Negtive
++ pStyle->SetNegativeStyle( aNegPrefix, aNegSuffix, XFColor((sal_uInt8)aNegativeColor.GetRed(),
++ (sal_uInt8)aNegativeColor.GetGreen(),
++ (sal_uInt8)aNegativeColor.GetBlue()) );
++ }
++
++ return pStyle;
++}
++/**
++*
++* @descrption for SODC_2754
++* @date 04/04/2006
++* @param
++* @param
++* @return fix wrong encoding of POUND symbol
++*/
++OUString LwpNumericFormat::reencode(OUString sCode)
++{
++ const sal_Unicode * pString = sCode.getStr();
++ sal_uInt16 nLen = sCode.getLength();
++ sal_Bool bFound = sal_False;
++ sal_uInt16 i;
++ sal_Unicode *pBuff = new sal_Unicode[sCode.getLength()];
++
++ for (i=0; i< sCode.getLength() - 1; i++)
++ {
++ if ( (pString[i] == 0x00a1) && (pString[i+1] == 0x00ea))
++ {
++ bFound = sal_True;
++ break;
++ }
++ pBuff[i] = pString[i];
++ }
++ if (bFound)
++ {
++ pBuff[i] = 0xffe1;
++ for (sal_uInt32 j=i+1; j < sCode.getLength() - 1; j++)
++ {
++ pBuff[j] = pString[j+1];
++ }
++ OUString sRet(pBuff, nLen - 1);
++ delete [] pBuff;
++ return sRet;
++ }
++
++ delete [] pBuff;
++ return sCode;
++}
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return
++*/
++USHORT
++LwpNumericFormat::GetDefaultDecimalPlaces(USHORT Format)
++{
++ switch (Format)
++ {
++ case FMT_ARGENTINEANPESO:
++ case FMT_AUSTRALIANDOLLAR:
++ case FMT_AUSTRIANSCHILLING:
++ case FMT_BELGIANFRANC:
++ case FMT_BRAZILIANCRUZEIRO:
++ case FMT_BRITISHPOUND:
++ case FMT_CANADIANDOLLAR:
++ case FMT_CHINESEYUAN:
++ case FMT_CZECHKORUNA:
++ case FMT_DANISHKRONE:
++ case FMT_ECU:
++ case FMT_FINNISHMARKKA:
++ case FMT_FRENCHFRANC:
++ case FMT_GERMANMARK:
++ case FMT_HONGKONGDOLLAR:
++ case FMT_HUNGARIANFORINT:
++ case FMT_INDIANRUPEE:
++ case FMT_INDONESIANRUPIAH:
++ case FMT_IRISHPUNT:
++ case FMT_LUXEMBOURGFRANC:
++ case FMT_MALAYSIANRINGGIT:
++ case FMT_MEXICANPESO:
++ case FMT_NETHERLANDSGUILDER:
++ case FMT_NEWZEALANDDOLLAR:
++ case FMT_NORWEGIANKRONE:
++ case FMT_POLISHZLOTY:
++ case FMT_PORTUGUESEESCUDO:
++ case FMT_ROMANIANLEI:
++ case FMT_RUSSIANRUBLE:
++ case FMT_SINGAPOREDOLLAR:
++ case FMT_SLOVAKIANKORUNA:
++ case FMT_SLOVENIANTHOLAR:
++ case FMT_SOUTHAFRICANRAND:
++ case FMT_SOUTHKOREANWON:
++ case FMT_SWEDISHKRONA:
++ case FMT_SWISSFRANC:
++ case FMT_TAIWANDOLLAR:
++ case FMT_THAIBAHT:
++ case FMT_USDOLLAR:
++ case FMT_OTHERCURRENCY:
++ case FMT_EURO:
++ return 2;
++
++ case FMT_GREEKDRACHMA:
++ case FMT_ITALIANLIRA:
++ case FMT_JAPANESEYEN:
++ case FMT_SPANISHPESETA:
++ return 0;
++
++ case FMT_DEFAULT:
++ case FMT_GENERAL:
++ case FMT_FIXED:
++ case FMT_COMMA:
++ case FMT_PERCENT:
++ case FMT_SCIENTIFIC:
++ default:
++ return 2;
++ }
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpnumericfmt.hxx lotuswordpro/source/filter/lwpnumericfmt.hxx
+--- lotuswordpro.bak/source/filter/lwpnumericfmt.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpnumericfmt.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,313 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - table object
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++#ifndef _LWPNUMBERICFMT_HXX
++#define _LWPNUMBERICFMT_HXX
++
++#include "lwpatomholder.hxx"
++#include "lwptblcell.hxx"
++#include "lwpcolor.hxx"
++
++//For converting to xml
++#include "xfilter/xfnumberstyle.hxx"
++
++class LwpObjectStream;
++
++class LwpNumericFormatSubset
++{
++public:
++ LwpNumericFormatSubset();
++ ~LwpNumericFormatSubset();
++ void QuickRead(LwpObjectStream* pStrm);
++ String GetPrefix(){ return cPrefix.str();}
++ String GetSuffix(){ return cSuffix.str();}
++ sal_Bool IsBlack(){ return (cColor.GetBlue()==0 && cColor.GetGreen()==0 && cColor.GetRed()==0);}
++ sal_Bool IsDefaultPrefix(){ return !(cSubFlags&SF_OVER_PREFIX); }
++ sal_Bool IsDefaultSuffix(){ return !(cSubFlags&SF_OVER_SUFFIX); }
++ LwpColor GetColor();
++protected:
++ LwpColor cColor;
++ LwpAtomHolder cPrefix;
++ LwpAtomHolder cSuffix;
++ sal_uInt16 cSubFlags;
++ enum // for cSubFlags
++ {
++ SF_OVER_PREFIX = 0x0001,
++ SF_OVER_SUFFIX = 0x0002,
++ SF_OVER_COLOR = 0x0004
++ };
++};
++
++struct LwpCurrencyInfo
++{
++ String sSymbol;
++ sal_Bool bPost;
++ sal_Bool bShowSpace;
++ LwpCurrencyInfo(String sSym)
++ {
++ sSymbol = sSym;
++ bPost = sal_False;
++ bShowSpace = sal_False;
++ }
++ LwpCurrencyInfo()
++ {
++ bPost = sal_False;
++ bShowSpace = sal_False;
++ }
++ LwpCurrencyInfo(String sSym,sal_Bool bPost, sal_Bool bShowSpace)
++ {
++ this->sSymbol = sSym;
++ this->bPost = bPost;
++ this->bShowSpace = bShowSpace;
++ }
++};
++
++enum
++{
++ /* These are types of formats. They are mutually exclusive.
++ */
++ FMT_NONE = 0,
++ FMT_ARGENTINEANPESO = 1,
++ FMT_AUSTRALIANDOLLAR = 2,
++ FMT_AUSTRIANSCHILLING = 3,
++ FMT_BELGIANFRANC = 4,
++ FMT_BRAZILIANCRUZEIRO = 5,
++ FMT_BRITISHPOUND = 6,
++ FMT_CANADIANDOLLAR = 7,
++ FMT_CHINESEYUAN = 8,
++ FMT_CZECHKORUNA = 9,
++ FMT_DANISHKRONE = 10,
++ FMT_ECU = 11,
++ FMT_FINNISHMARKKA = 12,
++ FMT_FRENCHFRANC = 13,
++ FMT_GERMANMARK = 14,
++ FMT_GREEKDRACHMA = 15,
++ FMT_HONGKONGDOLLAR = 16,
++ FMT_HUNGARIANFORINT = 17,
++ FMT_INDIANRUPEE = 18,
++ FMT_INDONESIANRUPIAH = 19,
++ FMT_IRISHPUNT = 20,
++ FMT_ITALIANLIRA = 21,
++ FMT_JAPANESEYEN = 22,
++ FMT_LUXEMBOURGFRANC = 23,
++ FMT_MALAYSIANRINGGIT = 24,
++ FMT_MEXICANPESO = 25,
++ FMT_NETHERLANDSGUILDER = 26,
++ FMT_NEWZEALANDDOLLAR = 27,
++ FMT_NORWEGIANKRONE = 28,
++ FMT_POLISHZLOTY = 29,
++ FMT_PORTUGUESEESCUDO = 30,
++ FMT_ROMANIANLEI = 31,
++ FMT_RUSSIANRUBLE = 32,
++ FMT_SINGAPOREDOLLAR = 33,
++ FMT_SLOVAKIANKORUNA = 34,
++ FMT_SLOVENIANTHOLAR = 35,
++ FMT_SOUTHAFRICANRAND = 36,
++ FMT_SOUTHKOREANWON = 37,
++ FMT_SPANISHPESETA = 38,
++ FMT_SWEDISHKRONA = 39,
++ FMT_SWISSFRANC = 40,
++ FMT_TAIWANDOLLAR = 41,
++ FMT_THAIBAHT = 42,
++ FMT_USDOLLAR = 43,
++ FMT_OTHERCURRENCY = 44,
++ FMT_DEFAULT = 45,
++ FMT_GENERAL = 46,
++ FMT_FIXED = 47,
++ FMT_COMMA = 48,
++ FMT_PERCENT = 49,
++ FMT_SCIENTIFIC = 50,
++ FMT_LABEL = 51,
++ FMT_EURO = 52
++};
++
++class LwpCurrencyPool
++{
++public:
++ LwpCurrencyPool(){InitCurrencySymbol();}
++ String GetCurrencySymbol(sal_uInt16 nFormat);
++ sal_Bool IsShowSpace(sal_uInt16 nFormat);
++ sal_Bool IsSymbolPost(sal_uInt16 nFormat);
++private:
++ std::map<sal_uInt16,LwpCurrencyInfo> m_aCurrencyInfo;
++ void InitCurrencySymbol()
++ {
++ USHORT nC=FMT_ARGENTINEANPESO;
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("A")); //FMT_ARGENTINEANPESO = 1,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("A$")); //FMT_AUSTRALIANDOLLAR = 2,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("oS"),sal_True, sal_True);//FMT_AUSTRIANSCHILLING = 3,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("BF"),sal_True, sal_True);//FMT_BELGIANFRANC = 4,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("R$"),sal_False, sal_True);//FMT_BRAZILIANCRUZEIRO = 5,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String("ï",RTL_TEXTENCODING_UTF8)); //FMT_BRITISHPOUND = 6,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("C$")); //FMT_CANADIANDOLLAR = 7,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String("PRCï",RTL_TEXTENCODING_UTF8),sal_False,sal_True); //FMT_CHINESEYUAN = 8,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("Kc"),sal_True, sal_True);//FMT_CZECHKORUNA = 9,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("Dkr"),sal_False, sal_True);//FMT_DANISHKRONE = 10,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("ECU"),sal_True, sal_True);//FMT_ECU = 11,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("mk"),sal_True, sal_True);//FMT_FINNISHMARKKA = 12,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("F"),sal_True, sal_True);//FMT_FRENCHFRANC = 13,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("DM"),sal_True, sal_True);//FMT_GERMANMARK = 14,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("Dr"),sal_True, sal_True);//FMT_GREEKDRACHMA = 15,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("HK$")); //FMT_HONGKONGDOLLAR = 16,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("Ft"),sal_True, sal_True);//FMT_HUNGARIANFORINT = 17,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("Rs"),sal_False, sal_True);//FMT_INDIANRUPEE = 18,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("Rp"),sal_False, sal_True);//FMT_INDONESIANRUPIAH = 19,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String("IRï",RTL_TEXTENCODING_UTF8)); //FMT_IRISHPUNT = 20,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("L."),sal_False, sal_True);//FMT_ITALIANLIRA = 21,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String("ï",RTL_TEXTENCODING_UTF8)); //FMT_JAPANESEYEN = 22,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("LF"),sal_True, sal_True);//FMT_LUXEMBOURGFRANC = 23,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("Rm"),sal_False, sal_True);//FMT_MALAYSIANRINGGIT = 24,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("Mex$")); //FMT_MEXICANPESO = 25,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("F"),sal_False, sal_True);//FMT_NETHERLANDSGUILDER = 26,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("NZ$")); //FMT_NEWZEALANDDOLLAR = 27,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("Nkr"),sal_False, sal_True);//FMT_NORWEGIANKRONE = 28,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("Zl"),sal_True, sal_True);//FMT_POLISHZLOTY = 29,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("Esc."),sal_True, sal_True);//FMT_PORTUGUESEESCUDO = 30,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("Leu"),sal_True, sal_True);//FMT_ROMANIANLEI = 31,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("R"),sal_True, sal_True);//FMT_RUSSIANRUBLE = 32,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("S$")); //FMT_SINGAPOREDOLLAR = 33,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("Sk"),sal_True, sal_True);//FMT_SLOVAKIANKORUNA = 34,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("SIT"),sal_False, sal_True);//FMT_SLOVENIANTHOLAR = 35,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("R")); //FMT_SOUTHAFRICANRAND = 36,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("W")); //FMT_SOUTHKOREANWON = 37,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("Pts"),sal_True, sal_True);//FMT_SPANISHPESETA = 38,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("Skr"),sal_True, sal_True);//FMT_SWEDISHKRONA = 39,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("SFr"),sal_False, sal_True);//FMT_SWISSFRANC = 40,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("NT$")); //FMT_TAIWANDOLLAR = 41,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("Bt"),sal_True, sal_True);//FMT_THAIBAHT = 42,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("$")); //FMT_USDOLLAR = 43,
++ m_aCurrencyInfo[nC++]=LwpCurrencyInfo(String::CreateFromAscii("OTH"),sal_False, sal_True);//FMT_OTHERCURRENCY = 44,
++
++ m_aCurrencyInfo[FMT_EURO]=LwpCurrencyInfo(String("â",RTL_TEXTENCODING_UTF8)); //FMT_EURO = 52
++ }
++};
++
++class LwpNumericFormat
++{
++public:
++ LwpNumericFormat(LwpObjectStream * pStrm);
++ ~LwpNumericFormat(){};
++ void Read();
++ static sal_Bool IsCurrencyFormat(USHORT Format);
++ USHORT GetDecimalPlaces(void);
++ sal_Bool IsDecimalPlacesOverridden(void);
++ sal_Bool IsNegativeOverridden(void);
++ sal_Bool IsZeroOverridden(void);
++ XFStyle* Convert();
++private:
++ LwpObjectStream * m_pObjStrm;
++
++ sal_uInt16 cFlags;
++ enum // for cFlags
++ {
++ NF_OVER_ZERO = 0x0001,
++ NF_OVER_NEGATIVE = 0x0002,
++ NF_OVER_DECIMAL_PLACES = 0x0004
++ };
++
++ sal_uInt16 cFormat;
++
++ LwpNumericFormatSubset cAnyNumber;
++ LwpNumericFormatSubset cZero;
++ LwpNumericFormatSubset cNegative;
++
++ sal_uInt16 cDecimalPlaces;
++
++ static USHORT GetDefaultDecimalPlaces(USHORT Format);
++ static LwpCurrencyPool m_aCurrencyInfo;
++
++ void GetCurrencyStr(LwpNumericFormatSubset aNumber, String& aPrefix, String& aSuffix, sal_Bool bNegtive=sal_False);
++ void SetNumberType(XFNumberStyle* pStyle);
++ OUString reencode(OUString sCode);
++};
++
++inline sal_Bool
++LwpNumericFormat::IsDecimalPlacesOverridden(void)
++{
++ return (cFlags & NF_OVER_DECIMAL_PLACES) != 0;
++}
++inline sal_Bool
++LwpNumericFormat::IsNegativeOverridden(void)
++{
++ return (cFlags & NF_OVER_NEGATIVE) != 0;
++}
++inline sal_Bool
++LwpNumericFormat::IsZeroOverridden(void)
++{
++ return (cFlags & NF_OVER_ZERO) != 0;
++}
++
++#include "lwppiece.hxx"
++class LwpLayoutNumerics : public LwpVirtualPiece
++{
++public:
++ LwpLayoutNumerics(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ :LwpVirtualPiece(objHdr, pStrm),cNumerics(m_pObjStrm){};
++ ~LwpLayoutNumerics(){};
++ XFStyle* Convert();
++ virtual void Read();
++protected:
++ LwpNumericFormat cNumerics;
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwpobj.cxx lotuswordpro/source/filter/lwpobj.cxx
+--- lotuswordpro.bak/source/filter/lwpobj.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpobj.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,121 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpobj.hxx"
++
++/**
++ * @descr private contor to ensure only object constructed from stream
++ */
++LwpObject::LwpObject()
++ : m_pObjStrm(NULL), m_pFoundry(NULL), m_pStrm(NULL)
++{}
++/**
++ * @descr construct lwpobject from stream
++ */
++LwpObject::LwpObject(LwpObjectHeader objHdr, LwpSvStream* pStrm)
++ : m_ObjHdr(objHdr), m_pStrm(pStrm), m_pObjStrm(NULL), m_pFoundry(NULL)
++{
++ m_pObjStrm = new LwpObjectStream(pStrm, m_ObjHdr.IsCompressed(),
++ static_cast<sal_uInt16>(m_ObjHdr.GetSize()) );
++}
++/**
++ * @descr dtor()
++*/
++LwpObject::~LwpObject()
++{
++ if(m_pObjStrm)
++ delete m_pObjStrm;
++
++}
++/**
++ * @descr QuickRead template
++ */
++void LwpObject::QuickRead()
++{
++ Read();
++ m_pObjStrm->ReadComplete();
++ if(m_pObjStrm)
++ {
++ delete m_pObjStrm;
++ m_pObjStrm = NULL;
++ }
++}
++/**
++ * @descr default read function
++ */
++void LwpObject::Read()
++{}
++/**
++ * @descr default parse function
++ */
++void LwpObject::Parse(IXFStream* pOutputStream)
++{}
++/**
++ * @descr default register style function
++ */
++void LwpObject::RegisterStyle()
++{}
++
++/**
++ * @descr default XFConvert function
++ * pCont is the XFContentContainer for the object conversion
++ */
++void LwpObject::XFConvert(XFContentContainer* pCont)
++{}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpobjfactory.cxx lotuswordpro/source/filter/lwpobjfactory.cxx
+--- lotuswordpro.bak/source/filter/lwpobjfactory.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpobjfactory.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,781 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpobjfactory.hxx"
++
++#ifndef _LWPDEFS_HXX
++#include "lwpdefs.hxx"
++#endif
++
++#include "lwpdoc.hxx"
++#include "lwpdefobj.hxx"
++#include "lwptemp.hxx"
++#include "lwpstory.hxx"
++#include "lwplayout.hxx"
++#include "lwppara.hxx"
++#include "lwpparastyle.hxx"
++#include "lwpcharacterstyle.hxx"
++#include "lwppiece.hxx"
++#include "lwptabrack.hxx"
++#include "lwpsilverbullet.hxx"
++#include "lwpdivinfo.hxx"
++#include "lwpholder.hxx"
++#include "lwpdivopts.hxx"
++#include "lwplaypiece.hxx"
++#include "lwpsection.hxx"
++#include "lwppagehint.hxx"
++#include "lwpoleobject.hxx"
++#include "lwpgrfobj.hxx"
++#include "lwptable.hxx"
++#include "lwptblcell.hxx"
++#include "lwpmarker.hxx"
++#include "lwpproplist.hxx"
++#include <new>
++#include "lwpframelayout.hxx"
++#include "lwptablelayout.hxx"
++#include "lwppagelayout.hxx"
++#include "lwptblformula.hxx"
++#include "lwpvpointer.hxx"
++#include "lwpfootnote.hxx"
++#include "lwpnumericfmt.hxx"
++#include "lwpfnlayout.hxx"
++#include "lwptoc.hxx"
++#include "lwpdocdata.hxx"
++#include "lwpnotes.hxx"
++#include "lwpverdocument.hxx"
++
++//LwpObjectFactory* LwpObjectFactory::m_pMgr = NULL;
++
++LwpObjectFactory::LwpObjectFactory(LwpSvStream* pSvStream)
++ : m_pSvStream(pSvStream), m_nNumObjs(0)
++{
++ m_ObjList.clear();
++}
++
++LwpObjectFactory::~LwpObjectFactory()
++{
++// m_pMgr = NULL;
++ if(!m_ObjList.empty())
++ ClearObjectMap();
++}
++
++/**
++ * @descr create the single object factory
++*/
++/*
++LwpObjectFactory* LwpObjectFactory::Instance(LwpSvStream* pStream)
++{
++ if(m_pMgr == NULL)
++ {
++ if(pStream)
++ {
++ m_pMgr = new LwpObjectFactory(pStream);
++ }
++ }
++ return(m_pMgr);
++}*/
++/**
++ * @descr clear object map and delete all objects
++*/
++void LwpObjectFactory::ClearObjectMap()
++{
++ LwpObjMap::iterator it = m_ObjList.begin();
++ while( it!=m_ObjList.end() )
++ {
++ delete (*it).second;
++ (*it).second = NULL;
++ it++;
++ }
++ m_ObjList.clear();
++}
++/**
++ * @descr read the index manager
++*/
++void LwpObjectFactory::ReadIndex(LwpSvStream* pStrm)
++{
++ m_IndexMgr.Read(pStrm);
++}
++
++/**
++ * @descr create all kinds of objects except lwp7
++*/
++LwpObject* LwpObjectFactory::CreateObject(sal_uInt32 type, LwpObjectHeader &objHdr)
++{
++ LwpObject* newObj = NULL;
++ m_nNumObjs++;
++ assert(type<300);
++ switch(type)
++ {
++ case VO_DOCUMENT:
++ {
++ newObj = new LwpDocument(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_DOCSOCK:
++ {
++ newObj = new LwpDocSock(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_DIVISIONINFO:
++ {
++ newObj = new LwpDivInfo(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_DIVOPTS:
++ {
++ newObj = new LwpDivisionOptions(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_HEADCONTENT:
++ {
++ newObj = new LwpHeadContent(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_HEADLAYOUT:
++ {
++ newObj = new LwpHeadLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_PAGELAYOUT:
++ {
++ newObj = new LwpPageLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_STORY:
++ {
++ newObj = new LwpStory(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_PARA:
++ {
++ newObj = new LwpPara(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_HEADERLAYOUT:
++ {
++ newObj = new LwpHeaderLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_FOOTERLAYOUT:
++ {
++ newObj = new LwpFooterLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_FRAMELAYOUT:
++ {
++ newObj = new LwpFrameLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_LAYOUTGEOMETRY:
++ {
++ newObj = new LwpLayoutGeometry(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_LAYOUTSCALE:
++ {
++ newObj = new LwpLayoutScale(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_LAYOUTMARGINS:
++ {
++ newObj = new LwpLayoutMargins(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_LAYOUTBORDERSTUFF:
++ {
++ newObj = new LwpLayoutBorder(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_LAYOUTBACKGROUNDSTUFF:
++ {
++ newObj = new LwpLayoutBackground(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_LAYOUTEXTERNALBORDERSTUFF:
++ {
++ newObj = new LwpLayoutExternalBorder(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_LAYOUTCOLUMNS:
++ {
++ newObj = new LwpLayoutColumns(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_LAYOUTGUTTERSTUFF:
++ {
++ newObj = new LwpLayoutGutters(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_LAYOUTJOINSTUFF:
++ {
++ newObj = new LwpLayoutJoins(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_LAYOUTSHADOW:
++ {
++ newObj = new LwpLayoutShadow(objHdr, m_pSvStream);
++ break;
++ }
++ // 01/12/2005
++ case VO_PARASTYLE:
++ {
++ newObj = new LwpParaStyle(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_CHARACTERSTYLE:
++ {
++ newObj = new LwpCharacterStyle(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_SILVERBULLET:
++ {
++ newObj = new LwpSilverBullet(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_ALIGNMENTPIECE:
++ {
++ newObj = new LwpAlignmentPiece(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_INDENTPIECE:
++ {
++ newObj = new LwpIndentPiece(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_SPACINGPIECE:
++ {
++ newObj = new LwpSpacingPiece(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_CHARBORDERPIECE:
++ {
++ newObj = new LwpCharacterBorderPiece(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_AMIKAKEPIECE:
++ {
++ newObj = new LwpAmikakePiece(objHdr, m_pSvStream);
++ break;
++ }
++ // end
++
++ case VO_HEADHOLDER:
++ {
++ newObj = new LwpDLVListHeadHolder(objHdr, m_pSvStream);
++ break;
++ }
++
++ // start
++ case VO_PARABORDERPIECE:
++ {
++ newObj = new LwpParaBorderPiece(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_BREAKSPIECE:
++ {
++ newObj = new LwpBreaksPiece(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_NUMBERINGPIECE:
++ {
++ newObj = new LwpNumberingPiece(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_TABRACK:
++ {
++ newObj = new LwpTabRack(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_TABPIECE:
++ {
++ newObj = new LwpTabPiece(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_PARABACKGROUNDPIECE: //perhaps wrong.
++ {
++ newObj = new LwpBackgroundPiece(objHdr, m_pSvStream);
++ break;
++ }
++ // end.
++ case VO_SECTION:
++ {
++ newObj = new LwpSection(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_INDEXSECTION:
++ {
++ newObj = new LwpIndexSection(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_HEADTAILHOLDER:
++ {
++ newObj = new LwpDLVListHeadTailHolder(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_PAGEHINT:
++ {
++ newObj = new LwpPageHint(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_OLEOBJECT:
++ {
++ newObj = new LwpOleObject(objHdr, m_pSvStream);
++ break;
++ }
++ //
++ case VO_GRAPHIC:
++ {
++ newObj = new LwpGraphicObject(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_DOCDATA:
++ {
++ newObj = new LwpDocData(objHdr, m_pSvStream);
++ break;
++ }
++ //
++ case VO_DROPCAPLAYOUT:
++ {
++ newObj = new LwpDropcapLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_LAYOUTRELATIVITY:
++ {
++ newObj = new LwpLayoutRelativity(objHdr, m_pSvStream);
++ break;
++ }
++ // for table
++ case VO_TABLE:
++ {
++ newObj = new LwpTable(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_TABLELAYOUT:
++ {
++ newObj = new LwpTableLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_SUPERTABLE:
++ {
++ newObj = new LwpSuperTable(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_SUPERTABLELAYOUT:
++ {
++ newObj = new LwpSuperTableLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_CELLLAYOUT:
++ {
++ newObj = new LwpCellLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_ROWLAYOUT:
++ {
++ newObj = new LwpRowLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_LAYOUTNUMERICS:
++ {
++ newObj = new LwpLayoutNumerics(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_NUMERICVALUE:
++ {
++ newObj = new LwpNumericValue(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_FORMULAINFO:
++ {
++ newObj = new LwpFormulaInfo(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_COLUMNLAYOUT:
++ {
++ newObj = new LwpColumnLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_ROWLIST:
++ {
++ newObj = new LwpRowList(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_CELLLIST:
++ {
++ newObj = new LwpCellList(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_TABLERANGE:
++ {
++ newObj = new LwpTableRange(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_CELLRANGE:
++ {
++ newObj = new LwpCellRange(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_FOLDER:
++ {
++ newObj = new LwpFolder(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_DEPENDENT:
++ {
++ newObj = new LwpDependent(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_CONNECTEDCELLLAYOUT:
++ {
++ newObj = new LwpConnectedCellLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_HIDDENCELLLAYOUT:
++ {
++ newObj = new LwpHiddenCellLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_TABLEHEADINGLAYOUT:
++ {
++ newObj = new LwpTableHeadingLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_ROWHEADINGLAYOUT:
++ {
++ newObj = new LwpRowHeadingLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_TABLEHEADING:
++ {
++ newObj = new LwpTableHeading(objHdr, m_pSvStream);
++ break;
++ }
++ /* some member variables can't be read until now
++ case VO_TABLEHINT:
++ {
++ newObj = new LwpTableHint(objHdr, m_pSvStream);
++ break;
++ }
++ */
++ // end table
++ //add by
++ case VO_CHBLKMARKER:
++ {
++ newObj = new LwpCHBlkMarker(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_PROPLIST:
++ {
++ newObj = new LwpPropListElement(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_BOOKMARK:
++ {
++ newObj = new LwpBookMark(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_FIELDMARKER:
++ {
++ newObj = new LwpFieldMark(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_OBJECTHOLDER:
++ {
++ newObj = new LwpObjectHolder(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_POBJECTHOLDER:
++ {
++ newObj = new LwpObjectHolder(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_VERGTR: //fall through
++ case VO_VERQTR:
++ {
++ newObj = new LwpVersionedPointer(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_FOOTNOTE:
++ {
++ newObj = new LwpFootnote(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_FOOTNOTETABLE:
++ {
++ newObj = new LwpFootnoteTable(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_FOOTNOTEOPTS:
++ {
++ newObj = new LwpFootnoteOptions(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_FOOTNOTELAYOUT:
++ {
++ newObj = new LwpFootnoteLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_FNROWLAYOUT:
++ {
++ newObj = new LwpFnRowLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_FNCELLLAYOUT:
++ {
++ newObj = new LwpFnCellLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_ENDNOTELAYOUT:
++ {
++ newObj = new LwpEndnoteLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_ENSUPERTABLELAYOUT:
++ {
++ newObj = new LwpEnSuperTableLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_FNSUPERTABLELAYOUT:
++ {
++ newObj = new LwpFnSuperTableLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_CONTONLAYOUT:
++ {
++ newObj = new LwpContOnLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_CONTFROMLAYOUT:
++ {
++ newObj = new LwpContFromLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_GROUPLAYOUT:
++ {
++ newObj = new LwpGroupLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_GROUPFRAME:
++ {
++ newObj = new LwpGroupFrame(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_TOCSUPERTABLELAYOUT:
++ {
++ newObj = new LwpTocSuperLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_LISTLIST:
++ {
++ newObj = new LwpListList(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_TOCLEVELDATA:
++ {
++ newObj = new LwpTocLevelData(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_NOTELAYOUT:
++ {
++ newObj = new LwpNoteLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_NOTEHEADERLAYOUT:
++ {
++ newObj = new LwpNoteHeaderLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_NOTETEXTLAYOUT:
++ {
++ newObj = new LwpNoteTextLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_VPLAYOUT:
++ {
++ newObj = new LwpViewportLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_PCOLBLOCK:
++ {
++ newObj = new LwpParallelColumnsBlock(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_SUPERPARALLELCOLUMNLAYOUT:
++ {
++ newObj = new LwpSuperParallelColumnLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_PCOLLAYOUT:
++ {
++ newObj = new LwpParallelColumnsLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_PARALLELCOLUMNS:
++ {
++ newObj = new LwpParallelColumns(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_RUBYMARKER:
++ {
++ newObj = new LwpRubyMarker(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_RUBYLAYOUT:
++ {
++ newObj = new LwpRubyLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_GLOSSARY:
++ {
++ newObj = new LwpGlossary(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_SUPERGLOSSARYLAYOUT:
++ {
++ newObj = new LwpSuperGlossaryLayout(objHdr, m_pSvStream);
++ break;
++ }
++ case VO_VERDOCUMENT:
++ {
++ newObj = new LwpVerDocument(objHdr, m_pSvStream);
++ break;
++ }
++ default:
++ {
++ //Unknown object type
++ assert(false);
++ newObj = NULL;
++ //newObj = new LwpDefaultObject(objHdr, m_pSvStream);
++ break;
++ }
++ }
++ if(newObj)
++ {
++ newObj->QuickRead();
++ m_ObjList.insert(LwpObjMap::value_type(*objHdr.GetID(), newObj));
++ }
++
++ return(newObj);
++}
++/**
++ * @descr query object by object id
++ * object is created if not in the factory
++*/
++LwpObject* LwpObjectFactory::QueryObject(const LwpObjectID &objID)
++{
++ LwpObject* obj = FindObject( objID );
++ if(!obj)
++ {
++ //Read the object from file
++ sal_uInt32 nStreamOffset = m_IndexMgr.GetObjOffset(objID);
++ if(nStreamOffset == BAD_OFFSET) //does not find the offset in index manager
++ {
++ return NULL;
++ }
++ m_pSvStream->Seek( nStreamOffset + LwpSvStream::LWP_STREAM_BASE );
++ LwpObjectHeader objHdr;
++ objHdr.Read(*m_pSvStream);
++ obj = CreateObject(objHdr.GetTag(), objHdr);
++ }
++ return obj;
++}
++#if 0
++#ifdef WIN32
++void LwpObjectFactory::SetOleObjInfo(SvStorageRef& objStor)
++{
++ m_objStor = objStor;
++ m_objStor->FillInfoList(&m_infoList); //Fill all objects into a list from then storage.
++}
++
++void LwpObjectFactory::GetOleObjInfo(SvStorageRef & objStor, SvStorageInfoList ** ppInfoList)
++{
++ objStor = m_objStor;
++ *ppInfoList = &m_infoList;
++}
++#endif
++#endif
++
++/**
++ * @descr find object in the factory per the object id
++*/
++LwpObject* LwpObjectFactory::FindObject(const LwpObjectID &objID)
++{
++ LwpObjMap::const_iterator it = m_ObjList.find(objID);
++ if (it != m_ObjList.end()) {
++ return((*it).second);
++ }
++ else
++ {
++ return NULL;
++ }
++}
++/**
++ * @descr release object in the factory per the object id
++*/
++void LwpObjectFactory::ReleaseObject(const LwpObjectID &objID)
++{
++ LwpObject* obj = FindObject( objID );
++ m_ObjList.erase(objID);
++ if( obj )
++ delete obj;
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpobjfactory.hxx lotuswordpro/source/filter/lwpobjfactory.hxx
+--- lotuswordpro.bak/source/filter/lwpobjfactory.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpobjfactory.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,140 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef LWPOBJFACTORY_HXX_
++#define LWPOBJFACTORY_HXX_
++
++#include "lwpheader.hxx"
++#include "lwpobjid.hxx"
++#include "lwpobj.hxx"
++#include "lwpobjhdr.hxx"
++#include "lwpidxmgr.hxx"
++#if 0
++#ifdef WIN32
++#include <so3/svstor.hxx>
++#include <so3/outplace.hxx>
++#include <so3/ipobj.hxx>
++#include <so3/factory.hxx>
++#include <svx/svdoole2.hxx>
++#include <svx/svdpage.hxx>
++#include <sfx2/objsh.hxx>
++#include <sot/storinfo.hxx>
++#endif //WIN32
++#endif
++/**
++ * @brief object factory used for lwp object creation and maintenance
++*/
++class LwpObjectFactory
++{
++public:
++ LwpObjectFactory(LwpSvStream* pSvStream);
++public:
++// static LwpObjectFactory* Instance(LwpSvStream* pSvStream=NULL);
++ ~LwpObjectFactory();
++
++//For object Factory and object manager
++private:
++// static LwpObjectFactory *m_pMgr;
++ sal_uInt32 m_nNumObjs;
++ LwpSvStream* m_pSvStream;
++ struct hashFunc
++ {
++ size_t operator()( const LwpObjectID& rName ) const
++ {
++ return rName.HashCode();
++ }
++ };
++ struct eqFunc
++ {
++ bool operator()( const LwpObjectID& rKey1, const LwpObjectID& rKey2 ) const
++ {
++ return(rKey1==rKey2);
++ }
++ };
++ typedef std::hash_map<LwpObjectID, LwpObject *, hashFunc, eqFunc> LwpObjMap;
++ LwpObjMap m_ObjList;
++ LwpIndexManager m_IndexMgr;
++ void ClearObjectMap();
++
++protected:
++ LwpObject* FindObject(const LwpObjectID &objID);
++public:
++ LwpObject* CreateObject(sal_uInt32 type, LwpObjectHeader &objHdr);
++ LwpObject* QueryObject(const LwpObjectID &objID);
++ void ReleaseObject(const LwpObjectID &objID);
++ void ReadIndex(LwpSvStream* pStrm);
++ LwpIndexManager* GetIndexManager(){return &m_IndexMgr;}
++#if 0
++// for OLE objects in current wordpro file
++#ifdef WIN32
++private:
++ SvStorageRef m_objStor;
++ SvStorageInfoList m_infoList;
++public:
++ void SetOleObjInfo(SvStorageRef & objStor);
++ void GetOleObjInfo(SvStorageRef & objStor, SvStorageInfoList ** ppInfoList);
++#endif
++#endif
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpobjhdr.cxx lotuswordpro/source/filter/lwpobjhdr.cxx
+--- lotuswordpro.bak/source/filter/lwpobjhdr.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpobjhdr.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,198 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpobjhdr.hxx"
++#include "lwpdefs.hxx"
++#include "lwpfilehdr.hxx"
++
++LwpObjectHeader::LwpObjectHeader()
++ : m_nTag(0), m_ID(), m_nSize(0), m_bCompressed(sal_False)
++ // m_nHeaderSize(0), m_nVersionID(0), m_nRefCount(0), m_nFlagBits(0),
++ //m_nNextVersionOffset(0), m_nNextVersionID(0),
++{};
++/**
++ * @descr read header from stream
++ */
++void LwpObjectHeader::Read(LwpSvStream &rStrm)
++{
++
++ sal_uInt8 nFlagBits = 0;
++ sal_uInt32 nVersionID = 0;
++ sal_uInt32 nRefCount = 0;
++ sal_uInt32 nNextVersionOffset = 0;
++ sal_uInt32 nNextVersionID = 0;
++ sal_uInt32 nHeaderSize = 0;
++
++ if ( LwpFileHeader::m_nFileRevision < 0x000B)
++ {
++ rStrm.Read(&m_nTag, sizeof(m_nTag));
++ m_ID.Read(&rStrm);
++ rStrm.Read(&nVersionID, sizeof(nVersionID));
++ rStrm.Read(&nRefCount, sizeof(nRefCount));
++ rStrm.Read(&nNextVersionOffset, sizeof(nNextVersionOffset));
++
++ nHeaderSize = sizeof(m_nTag) + m_ID.DiskSize()
++ + sizeof(nVersionID)
++ + sizeof(nRefCount)
++ + sizeof(nNextVersionOffset)
++ + sizeof(m_nSize);
++
++ if ((m_nTag == TAG_AMI) || ( LwpFileHeader::m_nFileRevision < 0x0006))
++ {
++ rStrm.Read(&nNextVersionID, sizeof(nNextVersionID));
++ nHeaderSize += sizeof(nNextVersionID);
++ }
++ rStrm.Read(&m_nSize, sizeof(m_nSize));
++ }
++ else
++ {
++ sal_uInt16 VOType = 0;
++ rStrm.Read(&VOType, sizeof(VOType));
++ rStrm.Read(&nFlagBits, sizeof(nFlagBits));
++
++ m_nTag = static_cast<sal_uInt32>(VOType);
++ m_ID.ReadIndexed(&rStrm);
++ nHeaderSize = sizeof(VOType) + sizeof(nFlagBits) + m_ID.DiskSizeIndexed();
++
++ sal_uInt8 tmpByte;
++ sal_uInt16 tmpShort;
++ switch (nFlagBits & VERSION_BITS)
++ {
++ case ONE_BYTE_VERSION:
++ rStrm.Read(&tmpByte, sizeof(tmpByte));
++ nVersionID = static_cast<sal_uInt32>( tmpByte );
++ nHeaderSize++;
++ break;
++
++ case TWO_BYTE_VERSION:
++ rStrm.Read(&tmpShort, sizeof(tmpShort));
++ nVersionID = static_cast<sal_uInt32>( tmpShort );
++ nHeaderSize += 2;
++ break;
++
++ case FOUR_BYTE_VERSION:
++ rStrm.Read(&nVersionID, sizeof(nVersionID));
++ nHeaderSize += 4;
++ break;
++ case DEFAULT_VERSION: //fall through
++ default:
++ nVersionID = 2;
++ break; // nothing
++ }
++
++ switch (nFlagBits & REFCOUNT_BITS)
++ {
++ case ONE_BYTE_REFCOUNT:
++ rStrm.Read(&tmpByte, sizeof(tmpByte));
++ nRefCount = static_cast<sal_uInt32>( tmpByte );
++ nHeaderSize++;
++ break;
++
++ case TWO_BYTE_REFCOUNT:
++ rStrm.Read(&tmpShort, sizeof(tmpShort));
++ nRefCount = static_cast<sal_uInt32>( tmpShort );
++ nHeaderSize += 2;
++ break;
++
++ case FOUR_BYTE_REFCOUNT: //through
++ default:
++ rStrm.Read(&nRefCount, sizeof(nRefCount));
++ nHeaderSize += 4;
++ break;
++ }
++
++ if (nFlagBits & HAS_PREVOFFSET)
++ {
++ rStrm.Read(&nNextVersionOffset, sizeof(nNextVersionOffset));
++ nHeaderSize += 4;
++ }
++ else
++ nNextVersionOffset = BAD_OFFSET;
++
++ switch (nFlagBits & SIZE_BITS)
++ {
++ case ONE_BYTE_SIZE:
++ rStrm.Read(&tmpByte, sizeof(tmpByte));
++ m_nSize = static_cast<sal_uInt32>( tmpByte );
++ nHeaderSize++;
++ break;
++
++ case TWO_BYTE_SIZE:
++ rStrm.Read(&tmpShort, sizeof(tmpShort));
++ m_nSize = static_cast<sal_uInt32>(tmpShort);
++ nHeaderSize += 2;
++ break;
++
++ case FOUR_BYTE_SIZE: //go through
++ default:
++ rStrm.Read(&m_nSize, sizeof(m_nSize));
++ nHeaderSize += 4;
++ break;
++ }
++
++ if (nFlagBits & DATA_COMPRESSED)
++ {
++ m_bCompressed = sal_True;
++ }
++ }
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpobjhdr.hxx lotuswordpro/source/filter/lwpobjhdr.hxx
+--- lotuswordpro.bak/source/filter/lwpobjhdr.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpobjhdr.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,137 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++
++#ifndef _LWPOBJECTHEADER_HXX
++#define _LWPOBJECTHEADER_HXX
++
++#include "lwpobjid.hxx"
++#include "lwpobjtags.hxx"
++/**
++ * @brief Base class of all Lwp VO objects
++*/
++class LwpObjectHeader
++{
++public:
++ LwpObjectHeader();
++private:
++ sal_uInt32 m_nTag;
++ LwpObjectID m_ID;
++ sal_uInt32 m_nSize; //Data size
++ sal_Bool m_bCompressed;
++
++ //localize the following memebers to save memory
++ //sal_uInt8 m_nFlagBits;
++ //sal_uInt32 m_nVersionID;
++ //sal_uInt32 m_nRefCount;
++ //sal_uInt32 m_nNextVersionOffset;
++ //sal_uInt32 m_nNextVersionID;
++ //sal_uInt32 m_nHeaderSize;
++
++ enum
++ {
++ VERSION_BITS = 0x03,
++ DEFAULT_VERSION = 0x00,
++ ONE_BYTE_VERSION = 0x01,
++ TWO_BYTE_VERSION = 0x02,
++ FOUR_BYTE_VERSION = 0x03,
++
++ REFCOUNT_BITS = 0x0C,
++ ONE_BYTE_REFCOUNT = 0x04,
++ TWO_BYTE_REFCOUNT = 0x08,
++ FOUR_BYTE_REFCOUNT = 0x0C,
++
++ SIZE_BITS = 0x30,
++ ONE_BYTE_SIZE = 0x10,
++ TWO_BYTE_SIZE = 0x20,
++ FOUR_BYTE_SIZE = 0x30,
++
++ HAS_PREVOFFSET = 0x40,
++ DATA_COMPRESSED = 0x80
++ };
++
++public:
++ void Read(LwpSvStream &pStrm);
++ inline sal_uInt32 GetTag();
++ inline sal_uInt32 GetSize();
++ inline LwpObjectID* GetID();
++ inline sal_Bool IsCompressed();
++};
++
++inline sal_uInt32 LwpObjectHeader::GetTag()
++{
++ return m_nTag;
++}
++inline sal_uInt32 LwpObjectHeader::GetSize()
++{
++ return m_nSize;
++}
++inline LwpObjectID* LwpObjectHeader::GetID()
++{
++ return &m_ID;
++}
++inline sal_Bool LwpObjectHeader::IsCompressed()
++{
++ return m_bCompressed;
++}
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpobj.hxx lotuswordpro/source/filter/lwpobj.hxx
+--- lotuswordpro.bak/source/filter/lwpobj.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpobj.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,105 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++ /**
++ * @file
++ * Base class of all Lwp VO objects
++ */
++
++#ifndef _LWPOBJ_HXX_
++#define _LWPOBJ_HXX_
++
++#include "lwpheader.hxx"
++
++#include "lwpobjhdr.hxx"
++#include "lwpobjstrm.hxx"
++#include "lwpunoheader.hxx"
++#include "xfilter/ixfstream.hxx"
++#include "xfilter/xfcontentcontainer.hxx"
++
++class LwpFoundry;
++/**
++ * @brief Base class of all Lwp VO objects
++*/
++class LwpObject
++{
++private:
++ LwpObject();//Don't permit to create an object without header
++public:
++ LwpObject(LwpObjectHeader objHdr, LwpSvStream* pStrm);
++ virtual ~LwpObject();
++protected:
++ LwpObjectHeader m_ObjHdr;
++ LwpObjectStream* m_pObjStrm;
++ LwpFoundry* m_pFoundry;
++ LwpSvStream* m_pStrm;
++protected:
++ virtual void Read();
++public:
++ void QuickRead();
++ virtual void RegisterStyle();
++ virtual void Parse(IXFStream* pOutputStream);
++ virtual void XFConvert(XFContentContainer* pCont);
++
++ LwpFoundry* GetFoundry(){return m_pFoundry;}
++ void SetFoundry(LwpFoundry* pFoundry){m_pFoundry = pFoundry;}
++ LwpObjectID* GetObjectID(){ return m_ObjHdr.GetID();}
++ sal_uInt32 GetTag() { return m_ObjHdr.GetTag();}
++ LwpSvStream* GetStream() { return m_pStrm; }
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpobjid.cxx lotuswordpro/source/filter/lwpobjid.cxx
+--- lotuswordpro.bak/source/filter/lwpobjid.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpobjid.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,256 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++
++#ifndef _LWPOBJECTID_HXX
++#include "lwpobjid.hxx"
++#endif
++
++#include "lwpfilehdr.hxx"
++#include "lwpobjfactory.hxx"
++#include "lwpglobalmgr.hxx"
++
++LwpObjectID::LwpObjectID(sal_uInt32 low, sal_uInt16 high)
++ :m_nLow(low), m_nHigh(high), m_bIsCompressed(sal_False), m_nIndex(0)
++{
++}
++/**
++ * @descr Read object id with format: low(4bytes)+high(2bytes) from stream
++ * for LWP7 record
++*/
++sal_uInt32 LwpObjectID::Read(LwpSvStream *pStrm)
++{
++ pStrm->Read(&m_nLow, sizeof(m_nLow));
++ pStrm->Read(&m_nHigh, sizeof(m_nHigh));
++ return DiskSize();
++}
++/**
++ * @descr Read object id with format: low(4bytes)+high(2bytes) from object stream
++*/
++sal_uInt32 LwpObjectID::Read(LwpObjectStream *pObj)
++{
++ pObj->QuickRead(&m_nLow, sizeof(m_nLow));
++ pObj->QuickRead(&m_nHigh, sizeof(m_nHigh));
++ return DiskSize();
++}
++/**
++ * @descr Read object id with indexed format from stream
++ * if index>0, lowid is get from time table per the index
++* else index+lowid+highid
++*/
++sal_uInt32 LwpObjectID::ReadIndexed(LwpSvStream *pStrm)
++{
++//note the m_nLow store the index instead of time from the timetable as in LWP
++ m_bIsCompressed = sal_False;
++ if( LwpFileHeader::m_nFileRevision < 0x000B)
++ {
++ return Read(pStrm);
++ }
++
++ pStrm->Read(&m_nIndex, sizeof(m_nIndex));
++
++ if (m_nIndex)
++ {
++ m_bIsCompressed = sal_True;
++ //m_nLow = index; //note the m_nLow stores the index instead of the actual time id
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ LwpObjectFactory* pFactory = pGlobal->GetLwpObjFactory();
++ LwpIndexManager* pIdxMgr = pFactory->GetIndexManager();
++ m_nLow = pIdxMgr->GetObjTime( (sal_uInt16)m_nIndex);
++ }
++ else
++ {
++ pStrm->Read(&m_nLow, sizeof(m_nLow));
++ }
++ pStrm->Read(&m_nHigh, sizeof(m_nHigh));
++ return DiskSizeIndexed();
++}
++
++/**
++ * @descr Read object id with indexed format from object stream
++ * if index>0, lowid is get from time table per the index
++* else index+lowid+highid
++*/
++sal_uInt32 LwpObjectID::ReadIndexed(LwpObjectStream *pStrm)
++{
++ m_bIsCompressed = sal_False;
++ if(LwpFileHeader::m_nFileRevision < 0x000B)
++ {
++ return Read(pStrm);
++ }
++
++ pStrm->QuickRead(&m_nIndex, sizeof(m_nIndex));
++ if (m_nIndex)
++ {
++ m_bIsCompressed = sal_True;
++ //m_nLow = index; //note the m_nLow stores the index instead of the actual time id
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ LwpObjectFactory* pFactory = pGlobal->GetLwpObjFactory();
++ LwpIndexManager* pIdxMgr = pFactory->GetIndexManager();
++ m_nLow = pIdxMgr->GetObjTime( (sal_uInt16)m_nIndex);
++ }
++ else
++ {
++ pStrm->QuickRead(&m_nLow, sizeof(m_nLow));
++ }
++ pStrm->QuickRead(&m_nHigh, sizeof(m_nHigh));
++ return DiskSizeIndexed();
++}
++/**
++ * @descr Read object id with compressed format from stream
++ * if diff == 255: 255+lowid+highid
++ * else lowid equals to the lowid of previous low id
++ * and high id = the high id of previous id + diff +1
++*/
++sal_uInt32 LwpObjectID::ReadCompressed( LwpSvStream* pStrm, LwpObjectID &prev )
++{
++ sal_uInt32 len=0;
++ sal_uInt8 diff;
++
++ len = pStrm->Read( &diff, sizeof(diff));
++ if (diff == 255)
++ {
++ len += Read(pStrm);
++ }
++ else
++ {
++ m_nLow = prev.GetLow();
++ m_nHigh = prev.GetHigh() + diff +1;
++ }
++ return len;
++}
++/**
++ * @descr Read object id with compressed format from object stream
++ * if diff == 255: 255+lowid+highid
++ * else lowid equals to the lowid of previous low id
++ * and high id = the high id of previous id + diff +1
++*/
++sal_uInt32 LwpObjectID::ReadCompressed( LwpObjectStream* pObj, LwpObjectID &prev )
++{
++
++ sal_uInt32 len=0;
++ sal_uInt8 diff;
++
++ len += pObj->QuickRead( &diff, sizeof(diff));
++
++ if (diff == 255)
++ {
++ len += Read(pObj);
++ }
++ else
++ {
++ m_nLow = prev.GetLow();
++ m_nHigh = prev.GetHigh() + diff +1;
++ }
++ return len;
++}
++/**
++ * @descr return the size of indexed object id
++*/
++sal_uInt32 LwpObjectID::DiskSizeIndexed() const
++{
++ return sizeof(sal_uInt8)
++ + (((0 < m_nIndex) && (m_nIndex <= 255)) ? 0 : sizeof(m_nLow))
++ + sizeof(m_nHigh);
++}
++/**
++ * @descr return the size of object id with format: low(4bytes)+high(2bytes)
++*/
++sal_uInt32 LwpObjectID::DiskSize() const
++{
++ return sizeof(m_nLow) + sizeof(m_nHigh);
++}
++/**
++ * @descr get object from object factory per the object id
++*/
++LwpObject* LwpObjectID::obj(VO_TYPE tag) const
++{
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ LwpObjectFactory* pObjMgr = pGlobal->GetLwpObjFactory();
++ if(IsNull())
++ {
++ return NULL;
++ }
++ LwpObject* pObj = pObjMgr->QueryObject(*this);
++ if( tag!=VO_INVALID && (pObj) )
++ {
++ if(tag!=pObj->GetTag())
++ {
++ pObj=NULL;
++ }
++ }
++ return(pObj);
++}
++/**
++ * @descr returns a buffer that contains the highid + lowid
++ */
++sal_Char* LwpObjectID::GetBuffer(sal_Char *buf)
++{
++ buf[0] = m_nHigh && 0xFF00;
++ buf[1] = m_nHigh && 0x00FF;
++ buf[2] = m_nLow && 0xFF000000;
++ buf[3] = m_nLow && 0x00FF0000;
++ buf[4] = m_nLow && 0x0000FF00;
++ buf[5] = m_nLow && 0x000000FF;
++ return buf;
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpobjid.hxx lotuswordpro/source/filter/lwpobjid.hxx
+--- lotuswordpro.bak/source/filter/lwpobjid.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpobjid.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,159 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPOBJECTID_HXX
++#define _LWPOBJECTID_HXX
++
++#include "lwpheader.hxx"
++#include "lwpobjstrm.hxx"
++#include "lwpdefs.hxx"
++
++class LwpObject;
++
++/**
++ * @brief object id class
++*/
++class LwpObjectID
++{
++public:
++ LwpObjectID(sal_uInt32 low=0, sal_uInt16 high=0);
++private:
++ sal_uInt32 m_nLow;
++ sal_uInt16 m_nHigh;
++ sal_uInt8 m_nIndex;
++ sal_Bool m_bIsCompressed;
++public:
++ sal_uInt32 Read( LwpSvStream *pStrm );
++ sal_uInt32 Read( LwpObjectStream *pStrm );
++ sal_uInt32 ReadIndexed( LwpSvStream* pStrm );
++ sal_uInt32 ReadIndexed( LwpObjectStream *pStrm );
++ sal_uInt32 ReadCompressed( LwpSvStream* pStrm, LwpObjectID &prev );
++ sal_uInt32 ReadCompressed( LwpObjectStream* pObj, LwpObjectID& prev );
++
++ sal_uInt32 DiskSize() const;
++ sal_uInt32 DiskSizeIndexed() const;
++ BOOL IsNull() const;
++ sal_Bool IsCompressed();
++
++ sal_uInt32 GetLow() const ;
++ sal_uInt16 GetHigh() const ;
++ void SetLow(sal_uInt32 nl);
++ void SetHigh(sal_uInt16 nh);
++
++ BOOL operator == (const LwpObjectID &Other) const;
++ BOOL operator != (const LwpObjectID &Other) const;
++ sal_Char* GetBuffer(sal_Char* buf);
++ LwpObject* obj(VO_TYPE tag=VO_INVALID) const;
++ size_t HashCode() const;
++};
++
++inline BOOL LwpObjectID::IsNull() const
++{
++ return (m_nLow == 0) && (m_nHigh == 0);
++}
++
++inline BOOL LwpObjectID::operator == (const LwpObjectID &Other) const
++{
++ return (m_nHigh == Other.m_nHigh) && (m_nLow == Other.m_nLow);
++}
++
++inline BOOL LwpObjectID::operator != (const LwpObjectID &Other) const
++{
++ return (m_nHigh != Other.m_nHigh) || (m_nLow != Other.m_nLow);
++}
++
++inline sal_Bool LwpObjectID::IsCompressed()
++{
++ return m_bIsCompressed;
++}
++inline sal_uInt32 LwpObjectID::GetLow() const
++{
++ return m_nLow;
++}
++inline sal_uInt16 LwpObjectID::GetHigh() const
++{
++ return m_nHigh;
++}
++inline void LwpObjectID::SetLow(sal_uInt32 nl)
++{
++ m_nLow=nl;
++}
++inline void LwpObjectID::SetHigh(sal_uInt16 nh)
++{
++ m_nHigh = nh;
++}
++inline size_t LwpObjectID::HashCode() const
++{
++ rtl::OUString str;
++ if(m_nIndex)
++ {
++ str = rtl::OUString(m_nIndex) + rtl::OUString(m_nHigh);
++ }
++ else
++ {
++ str = rtl::OUString(m_nLow) + rtl::OUString(m_nHigh);
++ }
++ return str.hashCode();
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpobjstrm.cxx lotuswordpro/source/filter/lwpobjstrm.cxx
+--- lotuswordpro.bak/source/filter/lwpobjstrm.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpobjstrm.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,371 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpobjstrm.hxx"
++#include "lwptools.hxx"
++
++/**
++ * @descr ctor() from LwpSvStream
++ */
++LwpObjectStream::LwpObjectStream(LwpSvStream *pStrm, BOOL isCompressed, sal_uInt16 size)
++ :m_pContentBuf(NULL), m_nBufSize(size), m_nReadPos(0),
++ m_pStrm(pStrm), m_bCompressed(isCompressed)
++{
++ assert(size<IO_BUFFERSIZE);
++ ReadStream();
++}
++/**
++ * @descr read object data from stream
++ */
++void LwpObjectStream::ReadStream()
++{
++ if(m_nBufSize == 0)
++ {
++ m_pContentBuf = NULL;
++ }
++ else
++ {
++ Read2Buffer();
++ }
++}
++/**
++ * @descr read object data from stream to buffer
++ */
++void LwpObjectStream::Read2Buffer()
++{
++ if( m_pContentBuf )
++ {
++ ReleaseBuffer();
++ }
++
++ m_nReadPos = 0;
++
++ if( m_bCompressed )
++ {
++ sal_uInt8* pCompressBuffer = new sal_uInt8[m_nBufSize];
++ m_pStrm->Read(pCompressBuffer, m_nBufSize);
++
++ sal_uInt8 pTempDst[IO_BUFFERSIZE];
++ m_nBufSize = DecompressBuffer(pTempDst, pCompressBuffer, m_nBufSize);
++ assert( m_nBufSize < IO_BUFFERSIZE);
++ delete [] pCompressBuffer;
++ pCompressBuffer = NULL;
++
++ m_pContentBuf = AllocBuffer(m_nBufSize);
++ memcpy(m_pContentBuf, pTempDst, m_nBufSize);
++ //delete [] pTempDst;
++
++ }
++ else
++ {
++ m_pContentBuf = AllocBuffer(m_nBufSize);
++ m_pStrm->Read(m_pContentBuf, m_nBufSize);
++ }
++}
++/**
++ * @descr alloc size of buffer
++ */
++sal_uInt8* LwpObjectStream::AllocBuffer(sal_uInt16 size)
++{
++ if(size<=100)
++ {
++ return(m_SmallBuffer);
++ }
++ else
++ {
++ return (new sal_uInt8[size]);
++ }
++}
++/**
++ * @descr signal complete to release object buffer
++ */
++void LwpObjectStream::ReadComplete()
++{
++ ReleaseBuffer();
++}
++
++LwpObjectStream::~LwpObjectStream()
++{
++ ReleaseBuffer();
++}
++/**
++ * @descr release object buffer
++ */
++void LwpObjectStream::ReleaseBuffer()
++{
++
++ if(m_nBufSize>100)
++ {
++ if(m_pContentBuf)
++ {
++ delete [] m_pContentBuf;
++ m_pContentBuf = NULL;
++ }
++ }
++}
++/**
++ * @descr read len bytes from object stream to buffer
++ */
++sal_uInt16 LwpObjectStream::QuickRead(void* buf, sal_uInt16 len)
++{
++ if( len > m_nBufSize - m_nReadPos )
++ {
++ assert(false);
++ len = m_nBufSize - m_nReadPos;
++ }
++ if( m_pContentBuf && len)
++ {
++ memcpy(buf, m_pContentBuf+m_nReadPos, len);
++ m_nReadPos += len;
++ }
++ return len;
++}
++/**
++ * @descr SeekRel pos in object stream/buffer
++ */
++void LwpObjectStream::SeekRel(sal_uInt16 pos)
++{
++ if( pos > m_nBufSize - m_nReadPos)
++ pos = m_nBufSize - m_nReadPos;
++ m_nReadPos +=pos;
++}
++/**
++ * @descr Seek to pos in object buffer/buffer
++ */
++BOOL LwpObjectStream::Seek( sal_uInt16 pos)
++{
++ if(pos>=0 && pos<m_nBufSize)
++ {
++ m_nReadPos = pos;
++ return TRUE;
++ }
++ return FALSE;
++}
++
++/**
++ * @descr Quick read sal_Bool
++ */
++sal_Bool LwpObjectStream::QuickReadBool()
++{
++ sal_uInt16 nValue;
++ QuickRead(&nValue, 2);
++ return (sal_Bool)(nValue != 0);
++}
++/**
++ * @descr Quick read sal_uInt32
++ */
++sal_uInt32 LwpObjectStream::QuickReaduInt32()
++{
++ sal_uInt32 nValue;
++ QuickRead(&nValue, sizeof(nValue));
++ return nValue;
++}
++/**
++ * @descr Quick read sal_uInt32
++ */
++sal_uInt16 LwpObjectStream::QuickReaduInt16()
++{
++ sal_uInt16 nValue;
++ QuickRead(&nValue, sizeof(nValue));
++ return nValue;
++}
++/**
++ * @descr Quick read sal_Int32
++ */
++sal_Int32 LwpObjectStream::QuickReadInt32()
++{
++ sal_Int32 nValue;
++ QuickRead(&nValue, sizeof(nValue));
++ return nValue;
++}
++/**
++ * @descr Quick read sal_Int16
++ */
++sal_Int16 LwpObjectStream::QuickReadInt16()
++{
++ sal_Int16 nValue;
++ QuickRead(&nValue, sizeof(nValue));
++ return nValue;
++}
++/**
++ * @descr Quick read sal_Int8
++ */
++sal_Int8 LwpObjectStream::QuickReadInt8()
++{
++ sal_Int8 nValue;
++ QuickRead(&nValue, sizeof(nValue));
++ return nValue;
++}
++/**
++ * @descr Quick read sal_uInt8
++ */
++sal_uInt8 LwpObjectStream::QuickReaduInt8()
++{
++ sal_uInt8 nValue;
++ QuickRead(&nValue, sizeof(nValue));
++ return nValue;
++}
++/**
++ * @descr skip extra bytes
++ */
++void LwpObjectStream::SkipExtra()
++{
++ sal_uInt16 extra;
++
++ QuickRead(&extra, sizeof(extra));
++ while (extra != 0)
++ {
++ assert(false);
++ QuickRead(&extra, sizeof(extra));
++ }
++}
++/**
++ * @descr check if extra bytes
++ */
++sal_uInt16 LwpObjectStream::CheckExtra()
++{
++ sal_uInt16 extra;
++ QuickRead(&extra, sizeof(extra));
++ return extra;
++}
++/**
++ * @descr decompress data buffer from pSrc to pDst
++ * Refer to the CAmiPro40File::DecompressObject(~) in LWP
++ */
++sal_uInt16 LwpObjectStream::DecompressBuffer(sal_uInt8* pDst, sal_uInt8* pSrc, sal_uInt16 Size)
++{
++ sal_uInt16 Cnt;
++ sal_uInt32 DstSize = 0;
++
++ while (Size)
++ {
++ switch (*pSrc & 0xC0)
++ {
++ case 0x00:
++ // 1 - 64 bytes of 0
++ // Code 00zzzzzz
++ // where zzzzzz is the count - 1 of compressed 0 bytes
++
++ Cnt = (*pSrc++ & 0x3F) + 1;
++ memset(pDst, 0, Cnt);
++ pDst += Cnt;
++ DstSize += Cnt;
++ Size--;
++ break;
++
++ case 0x40:
++ // 1 - 8 zeros followed by 1 - 8 non-zero
++ // Code 01zzznnn binary
++ // where zzz is the count - 1 of compressed zero bytes
++ // and nnn is the count - 1 of following non-zero bytes
++
++ Cnt = ((*pSrc & 0x38) >> 3) + 1;
++ memset(pDst, 0, Cnt);
++ pDst += Cnt;
++ DstSize += Cnt;
++ Cnt = (*pSrc++ & 0x07) + 1;
++ memcpy(pDst, pSrc, Cnt);
++ pDst += Cnt;
++ DstSize += Cnt;
++ pSrc += Cnt;
++ Size -= Cnt + 1;
++ break;
++
++ case 0x80:
++ // 1 0 followed by 1 - 64 bytes of non-zero
++ // Code 0x80 (or 0x40 if 8 or less non-zero)
++ // Code 10nnnnnn binary
++ // where nnnnnn is the count - 1 of following non-zero bytes
++
++ *pDst++ = 0;
++ DstSize++;
++ // fall thru into next case!
++
++ case 0xC0:
++ // 1 - 64 bytes of non-zero
++ // Code = 11nnnnnn binary
++ // nnnnnn is the count less 1 of following non-zero bytes
++
++ Cnt = (*pSrc++ & 0x3F) + 1;
++ memcpy(pDst, pSrc, Cnt);
++ pDst += Cnt;
++ DstSize += Cnt;
++ pSrc += Cnt;
++ Size -= Cnt + 1;
++ break;
++ }
++ assert(DstSize < IO_BUFFERSIZE);
++ }
++ return(static_cast<sal_uInt16>(DstSize));
++}
++/**
++ * @descr quick read string with 1252
++ */
++OUString LwpObjectStream::QuickReadStringPtr(void)
++{
++ sal_uInt16 len, diskSize;
++
++ diskSize = QuickReaduInt16();
++ len = QuickReaduInt16();
++
++ OUString str;
++ rtl_TextEncoding rEncode = RTL_TEXTENCODING_MS_1252;
++ LwpTools::QuickReadUnicode(this, str, diskSize-sizeof(diskSize), rEncode);
++ return str;
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpobjstrm.hxx lotuswordpro/source/filter/lwpobjstrm.hxx
+--- lotuswordpro.bak/source/filter/lwpobjstrm.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpobjstrm.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,127 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * object stream header file
++ * stream for one LwpObject body data
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPOBJECTSTREAM_HXX
++#define _LWPOBJECTSTREAM_HXX
++
++#include "lwpheader.hxx"
++#include "lwpsvstream.hxx"
++/**
++ * @brief stream class for LwpObject body data
++ * provide stream like interface to read object data
++*/
++class LwpObjectStream
++{
++public:
++ LwpObjectStream(LwpSvStream *pStrm, BOOL isCompressed, sal_uInt16 size);
++ ~LwpObjectStream();
++private:
++ sal_uInt8* m_pContentBuf; //The content buffer of the object
++ sal_uInt8 m_SmallBuffer[100]; //To avoid frequent new
++ enum
++ {
++ IO_BUFFERSIZE = 0xFF00 //Refer to LWP, not sure if it is enough
++ };
++ sal_uInt16 m_nBufSize; //The total size of m_pContentBuf
++ sal_uInt16 m_nReadPos; //The position of the quick read
++ LwpSvStream* m_pStrm;
++ BOOL m_bCompressed;
++public:
++ sal_uInt16 QuickRead(void* buf, sal_uInt16 len);
++ sal_uInt16 GetPos() { return m_nReadPos; }
++ void SeekRel(sal_uInt16 pos);
++ BOOL Seek( sal_uInt16 pos);
++ void SkipExtra();
++ sal_uInt16 CheckExtra();
++
++ //01/14/2005
++ sal_Bool QuickReadBool();
++ sal_uInt32 QuickReaduInt32();
++ sal_uInt16 QuickReaduInt16();
++ sal_uInt8 QuickReaduInt8();
++ sal_Int32 QuickReadInt32();
++ sal_Int16 QuickReadInt16();
++ sal_Int8 QuickReadInt8();
++ //end
++
++ OUString QuickReadStringPtr(void);
++ //void QuickReadString(unsigned char *pString, sal_uInt16 len);
++ void QuickReadStringWithMax(unsigned char * pString, sal_uInt16 MaxLen);
++
++public:
++ void ReadComplete();
++ LwpSvStream *GetStream();
++private:
++ void ReadStream();
++ void Read2Buffer();
++ sal_uInt8* AllocBuffer(sal_uInt16 size);
++ sal_uInt16 DecompressBuffer(sal_uInt8* pDst, sal_uInt8* pSrc, sal_uInt16 Size);
++ void ReleaseBuffer();
++};
++
++inline LwpSvStream *LwpObjectStream::GetStream()
++{
++ return m_pStrm;
++}
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpobjtags.hxx lotuswordpro/source/filter/lwpobjtags.hxx
+--- lotuswordpro.bak/source/filter/lwpobjtags.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpobjtags.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,241 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _LWPOBJTAGS_HXX_
++#define _LWPOBJTAGS_HXX_
++
++// file header object
++#define TAG_AMI 0x3750574CUL // "LWP7"
++
++// layout sub-objects
++#define TAG_ENDSUBOBJ 0x646E4553UL // "SEnd"
++#define TAG_LAY_GEOMETRY 0x6F65474CUL // "LGeo"
++#define TAG_LAY_OFFSET 0x66664F4CUL // "LOff"
++#define TAG_LAY_SCALE 0x6C63534CUL // "LScl"
++#define TAG_LAY_MARGINS 0x72614D4CUL // "LMar"
++#define TAG_LAY_RELATIVITY 0x6C65524CUL // "LRel"
++#define TAG_LAY_COLUMNS 0x6C6F434CUL // "LCol"
++#define TAG_LAY_BORDER 0x726F424CUL // "LBor"
++#define TAG_LAY_GUTTER 0x7475474CUL // "LGut"
++#define TAG_LAY_JOIN 0x696F4A4CUL // "LJoi"
++#define TAG_LAY_BACKGROUND 0x6B63424CUL // "LBck"
++#define TAG_LAY_SHADOW 0x7764534CUL // "LSdw"
++#define TAG_LAY_LEADERDOTS 0x72644C4CUL // "LLdr"
++#define TAG_LAY_NUMERICS 0x6D754E4CUL // "LNum"
++#define TAG_LAY_HIERARCHY 0x6569484CUL // "LHie"
++
++// Paragraph properties
++#define TAG_PARA_SHOW 0x65644850UL // "PHde"
++#define TAG_PARA_HIDE 0x77685350UL // "PShw"
++#define TAG_PARA_ALIGN 0x6e6c4150UL // "PAln"
++#define TAG_PARA_INDENT 0x74644950UL // "PIdt"
++#define TAG_PARA_SPACING 0x63705350UL // "PSpc"
++#define TAG_PARA_BORDER 0x64724250UL // "PBrd"
++#define TAG_PARA_BACKGROUND 0x6b614250UL // "PBak"
++#define TAG_PARA_BREAKS 0x6b724250UL // "PBrk"
++#define TAG_PARA_BULLET 0x746c4250UL // "PBlt"
++#define TAG_PARA_NUMBERING 0x6d754e50UL // "PNum"
++#define TAG_PARA_TAB 0x62615450UL // "PTab"
++#define TAG_PARA_KINSOKU 0x6e694b50UL // "PKin"
++#define TAG_PARA_PROPLIST 0x70725050UL // "PPrp"
++
++#define TAG_SLVLIST 0x734C4C53UL // "SLLs"
++#define TAG_DLFVLIST 0x4C464C44UL // "DLFL"
++#define TAG_DLVLISTHEAD 0x64484C44UL // "DLHd"
++#define TAG_DLNFVLIST 0x464E4C44UL // "DLNF"
++#define TAG_DLVLIST 0x734C4C44UL // "DLLs"
++
++#define TAG_DOCUMENT 0x20636F44UL // "Doc "
++#define TAG_VERDOCUMENT 0x636F4456UL // "VDoc"
++#define TAG_DOCDATA 0x44636F44UL // "DocD"
++#define TAG_OBJINDEX 0x78644E4FUL // "ONdx"
++#define TAG_DIVISIONINFO 0x49766944UL // "DivI"
++#define TAG_CONTENT 0x746E6F43UL // "Cont"
++#define TAG_HEADCONTENT 0x746E4348UL // "HCnt"
++#define TAG_STORY 0x79727453UL // "Stry"
++#define TAG_TABLE 0x6C626154UL // "Tabl"
++#define TAG_SUPERTABLE 0x62547553UL // "SuTb"
++#define TAG_GLOSSARY 0x736F6C47UL // "Glos"
++#define TAG_PARALLELCOLUMNS 0x6C6F4350UL // "PCol"
++#define TAG_PARALLELCOLUMNSLAYOUT 0x794C4350UL // "PCLy"
++#define TAG_PARALLELCOLUMNSBLOCK 0x6C424350UL // "PCBl"
++#define TAG_PARALLELCOLUMNSCONNECTEDBLOCK 0x42434350UL // "PCCB"
++#define TAG_FOOTNOTETABLE 0x62546E46UL // "FnTb"
++#define TAG_PARAGRAPH 0x61726150UL // "Para"
++#define TAG_BOOKMARK 0x6B4D6B42UL // "BkMk"
++#define TAG_DDELINK 0x4C656444UL // "DdeL"
++#define TAG_VIRTUALLAYOUT 0x79614C56UL // "VLay"
++#define TAG_LITELAYOUT 0x79614C4CUL // "LLay"
++#define TAG_LAYOUT 0x2079614CUL // "Lay "
++#define TAG_PERMISSIVELAYOUT 0x79614C50UL // "PLay"
++#define TAG_HEADLAYOUT 0x79614C48UL // "HLay"
++#define TAG_FRAMELAYOUT 0x6D617246UL // "Fram"
++#define TAG_DROPCAPLAYOUT 0x70614344UL // "DCap"
++#define TAG_NOTELAYOUT 0x794C744EUL // "NtLy"
++#define TAG_NOTETEXTLAYOUT 0x6C54744EUL // "NtTl"
++#define TAG_NOTEHEADERLAYOUT 0x6C48744EUL // "NtHl"
++#define TAG_PAGELAYOUT 0x65676150UL // "Page"
++#define TAG_HEADERLAYOUT 0x4C726448UL // "HdrL"
++#define TAG_FOOTERLAYOUT 0x4C727446UL // "FtrL"
++#define TAG_ROWLAYOUT 0x4C776F52UL // "RowL"
++#define TAG_COLUMNLAYOUT 0x4C6C6F43UL // "ColL"
++#define TAG_FNROWLAYOUT 0x4C526E46UL // "FnRL"
++#define TAG_CELLLAYOUT 0x4C6C6543UL // "CelL"
++#define TAG_VIEWPORTLAYOUT 0x794C7056UL // "VpLy"
++#define TAG_CONNECTEDCELLLAYOUT 0x4C436E43UL // "CnCL"
++#define TAG_HIDDENCELLLAYOUT 0x4C436E48UL // "HnCL"
++#define TAG_TABLEHEADINGLAYOUT 0x4C486254UL // "TbHL"
++#define TAG_ROWHEADINGLAYOUT 0x4C486F52UL // "RoHL"
++#define TAG_FNCELLLAYOUT 0x4C436E46UL // "FnCL"
++#define TAG_FOOTNOTELAYOUT 0x794C6E46UL // "FnLy"
++#define TAG_TABLELAYOUT 0x794C6254UL // "TbLy"
++#define TAG_SUPERTABLELAYOUT 0x4C625453UL // "STbL"
++#define TAG_FNSUPERTABLELAYOUT 0x4C545346UL // "FSTL"
++#define TAG_ENSUPERTABLELAYOUT 0x4C545345UL // "ESTL"
++#define TAG_SUPERPARALLELCOLUMNLAYOUT 0x4C435053UL // "SPCL"
++#define TAG_SUPERGLOSSARYLAYOUT 0x534C4753UL // "SGLS"
++#define TAG_CONTONLAYOUT 0x4C6E4F43UL // "COnL"
++#define TAG_CONTFROMLAYOUT 0x4C724643UL // "CFrL"
++#define TAG_CHARSTYLE 0x79745343UL // "CSty"
++#define TAG_PARASTYLE 0x79745350UL // "PSty"
++#define TAG_TABRACK 0x20626154UL // "Tab "
++#define TAG_GROUPLAYOUT 0x4c707247UL // "GrpL"
++#define TAG_GROUPFRAME 0x46707247UL // "GrpF"
++#define TAG_SILVERBULLET 0x6c754253UL // "SBul"
++#define TAG_TABLEHEADING 0x486c6254UL // "TblH"
++#define TAG_LINEHINT 0x746e484cUL // "LHnt"
++#define TAG_TABLEHINT 0x746e4854UL // "THnt"
++#define TAG_PAGEHINT 0x746e4850UL // "PHnt"
++#define TAG_NUMBERHINT 0x746e484EUL // "NHnt"
++#define TAG_FOOTNOTESEEN 0x65655346UL // "FSee"
++#define TAG_OBJECTHOLDER 0x646c6F48UL // "Hold"
++#define TAG_LISTLIST 0x744c744cUL // "LtLt"
++#define TAG_FOOTNOTELISTLIST 0x744c7446UL // "FtLt"
++#define TAG_ENDNOTELAYOUT 0x794C6E45UL // "EnLy"
++#define TAG_FOOTNOTE 0x746F4E46UL // "FNot"
++#define TAG_CELLNUMBERHINT 0x74486e43UL // "CnHt"
++#define TAG_MARKER 0x6b72614DUL // "Mark"
++#define TAG_STORYMARKER 0x6b724d53UL // "SMrk"
++#define TAG_TABLEMARKER 0x6b724d54UL // "TMrk"
++#define TAG_FIELDMARKER 0x4c724d54UL // "FMrk"
++#define TAG_NUMERICVALUE 0x6c61564eUL // "NVal"
++#define TAG_TEXTVALUE 0x6c615654UL // "TVal"
++#define TAG_REFERENCEVALUE 0x6c615652UL // "RVal"
++#define TAG_CELLLIST 0x64734c43UL // "CLst"
++#define TAG_DEPENDENT 0x74647044UL // "Dpdt"
++#define TAG_FORMULAINFO 0x616c7246UL // "Frla"
++#define TAG_TABLERANGE 0x676e5254UL // "TRng"
++#define TAG_CELLRANGE 0x676e5243UL // "CRng"
++#define TAG_FOLDER 0x726c6446UL // "Fldr"
++#define TAG_ROWLIST 0x74734c52UL // "RLst"
++#define TAG_SECTION 0x74636553UL // "Sect"
++#define TAG_INDEXSECTION 0x63657349UL // "Isec"
++#define TAG_GRAPHIC 0x68707247UL // "Grph"
++#define TAG_DIRTBAG 0x74726944UL // "Dirt"
++#define TAG_NAMEDOUTLINESEQ 0x71534f4eUL // "NOSq"
++#define TAG_OUTLINESEQITEM 0x7449534fUL // "OSIt"
++#define TAG_TOCSUPERTABLELAYOUT 0x6C747354UL // "Tstl"
++#define TAG_DOCSOCKET 0x786F5344UL // "DSox"
++#define TAG_USER_VERSION 0x72655655UL // "UVer"
++#define TAG_NOTE 0x65746F4EUL // "Note"
++#define TAG_MARKERLIST 0x74734c4dUL // "MLst"
++#define TAG_BOOKMARKMARKERLIST 0x744c4d42UL // "BMLt"
++#define TAG_DDEMARKMARKERLIST 0x744c4d44UL // "DMLt"
++#define TAG_FIELDMARKERLIST 0x744c6c46UL // "FlLt"
++#define TAG_CHBLKMARKER 0x6b4d4843UL // "CHMk"
++#define TAG_CHBMARKERLIST 0x424d4c43UL // "CMLt"
++#define TAG_PPTRHOLDER 0x72745070UL // "pPtr"
++#define TAG_QPTRHOLDER 0x72745071UL // "qPtr"
++#define TAG_GPTRHOLDER 0x72745067UL // "gPtr"
++#define TAG_PROPLIST 0x706f7250UL // "Prop"
++#define TAG_HEADHOLDER 0x646C4848UL // "HHld"
++#define TAG_HEADTAILHOLDER 0x72485448UL // "HTHr"
++#define TAG_OLEOBJECT 0x4F656C4FUL // "OleO"
++#define TAG_ENUMOBJHD 0x64484F45UL // "EOHd"
++#define TAG_TOCLEVELDATA 0x4C6f6354UL // "TocL"
++#define TAG_VERPTR 0x72745056UL // "VPtr"
++#define TAG_VERQTR 0x72745156UL // "VQtr"
++#define TAG_VERDOCINFO 0x6E494456UL // "VDIn"
++#define TAG_TOMBSTONE 0x20504952UL // "RIP "
++#define TAG_NOTIFY 0x7966744EUL // "Ntfy"
++#define TAG_LONGHOLDER 0x676E6F4CUL // "Long"
++
++#ifdef SMARTEXT
++#define TAG_STXINFO 0x6e495f53UL // "S_In"
++#define TAG_STXMANAGER 0x674d5f53UL // "S_Mg"
++#define TAG_STXLINK 0x6b4c5f53UL // "S_Lk"
++#define TAG_STXLINKMARKERLIST 0x4c4d5f53UL // "S_ML"
++#endif // SMARTEXT
++
++#define TAG_DIVOPTS 0x74704f44UL // "DOpt"
++#define TAG_FOOTNOTEOPTS 0x704f4e46UL // "FNOp"
++
++#ifdef RUBY
++#define TAG_RUBYLAYOUT 0x794C6252UL // "RbLy"
++#define TAG_RUBYMARKER 0x6b724d52UL // "RMrk"
++#define TAG_RUBYMARKERLIST 0x744c6252UL // "RbLt"
++#endif
++
++#define TAG_ALIGNMENTPIECE 0x63506c41UL // "AlPc"
++#define TAG_INDENTPIECE 0x63506e49UL // "InPc"
++#define TAG_PARABORDERPIECE 0x63504250UL // "PBPc"
++#define TAG_PARABACKGROUNDPIECE 0x63505250UL // "PRPc"
++#define TAG_SPACINGPIECE 0x63507053UL // "SpPc"
++#define TAG_BREAKSPIECE 0x63507242UL // "BrPc"
++#define TAG_NUMBERINGPIECE 0x6350724eUL // "NrPc"
++#define TAG_CHARBORDERPIECE 0x63504243UL // "CBPc"
++#define TAG_AMIKAKEPIECE 0x63504b41UL // "AKPc"
++#define TAG_TABPIECE 0x63506254UL // "TbPc"
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpoleobject.cxx lotuswordpro/source/filter/lwpoleobject.cxx
+--- lotuswordpro.bak/source/filter/lwpoleobject.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpoleobject.cxx 2008-10-22 11:47:28.000000000 +0800
+@@ -0,0 +1,752 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - OLE object
++ */
++/*************************************************************************
++ * Change History
++ Feb 2005 Created
++ ************************************************************************/
++#include <stdio.h>
++#include <tools/stream.hxx>
++#include "lwpglobalmgr.hxx"
++#include "lwpoleobject.hxx"
++#include "lwpobjfactory.hxx"
++#include "lwpidxmgr.hxx"
++#include "lwp9reader.hxx"
++#include "xfilter/xfoleobj.hxx"
++#include "xfilter/xfparagraph.hxx"
++#include "lwpframelayout.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "bento.hxx"
++
++/**
++ * @descr: construction function
++ * @param: objHdr - object header, read before entering this function
++ * @param: pStrm - file stream
++ * @return: None
++ * @date: 2/22/2005
++ */
++LwpGraphicOleObject::LwpGraphicOleObject(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpContent(objHdr, pStrm)
++{}
++/**
++ * @descr: Read GraphicOleObject part
++ * @param: None
++ * @return: None
++ * @date: 2/22/2005
++ */
++void LwpGraphicOleObject::Read()
++{
++ LwpContent::Read();
++
++ if (LwpFileHeader::m_nFileRevision >= 0x000b)
++ {
++ // I'm not sure about the read method
++ m_pNextObj.ReadIndexed(m_pObjStrm);
++ m_pPrevObj.ReadIndexed(m_pObjStrm);
++ }
++ m_pObjStrm->SkipExtra();
++
++}
++
++void LwpGraphicOleObject::GetGrafOrgSize(double & rWidth, double & rHeight)
++{
++ rWidth = 0;
++ rHeight = 0;
++}
++
++void LwpGraphicOleObject::GetGrafScaledSize(double & fWidth, double & fHeight)
++{
++ GetGrafOrgSize(fWidth, fHeight);
++ // scaled image size
++ double fSclGrafWidth = fWidth;//LwpTools::ConvertFromUnitsToMetric(pMyScale->GetScaleWidth());
++ double fSclGrafHeight = fHeight;//LwpTools::ConvertFromUnitsToMetric(pMyScale->GetScaleHeight());
++
++
++ LwpVirtualLayout* pLayout = GetLayout(NULL);
++ if (pLayout && pLayout->IsFrame())
++ {
++ LwpFrameLayout* pMyFrameLayout = static_cast<LwpFrameLayout*>(pLayout);
++ LwpLayoutScale* pMyScale = pMyFrameLayout->GetLayoutScale();
++ LwpLayoutGeometry* pFrameGeo = pMyFrameLayout->GetGeometry();
++
++ // original image size
++ //double fOrgGrafWidth = (double)m_Cache.Width/TWIPS_PER_CM;
++ //double fOrgGrafHeight = (double)m_Cache.Height/TWIPS_PER_CM;
++
++ // get margin values
++ double fLeftMargin = pMyFrameLayout->GetMarginsValue(MARGIN_LEFT);
++ double fRightMargin = pMyFrameLayout->GetMarginsValue(MARGIN_RIGHT);
++ double fTopMargin = pMyFrameLayout->GetMarginsValue(MARGIN_TOP);
++ double fBottomMargin = pMyFrameLayout->GetMarginsValue(MARGIN_BOTTOM);
++
++ if (pMyScale && pFrameGeo)
++ {
++ // frame size
++ double fFrameWidth = LwpTools::ConvertFromUnitsToMetric(pFrameGeo->GetWidth());
++ double fFrameHeight = LwpTools::ConvertFromUnitsToMetric(pFrameGeo->GetHeight());
++
++ // calculate the displayed size of the frame
++ double fDisFrameWidth = fFrameWidth - (fLeftMargin+fRightMargin);
++ double fDisFrameHeight = fFrameHeight - (fTopMargin+fBottomMargin);
++
++ // get scale mode
++ sal_uInt16 nScalemode = pMyScale->GetScaleMode();
++ if (nScalemode & LwpLayoutScale::CUSTOM)
++ {
++ fSclGrafWidth = LwpTools::ConvertFromUnitsToMetric(pMyScale->GetScaleWidth());
++ fSclGrafHeight = LwpTools::ConvertFromUnitsToMetric(pMyScale->GetScaleHeight());
++ }
++ else if (nScalemode & LwpLayoutScale::PERCENTAGE)
++ {
++ double fScalePercentage = (double)pMyScale->GetScalePercentage() / 1000;
++ fSclGrafWidth = fScalePercentage * fWidth;
++ fSclGrafHeight = fScalePercentage * fHeight;
++ }
++ else if (nScalemode & LwpLayoutScale::FIT_IN_FRAME)
++ {
++ if (pMyFrameLayout->IsFitGraphic())
++ {
++ fSclGrafWidth = fWidth;
++ fSclGrafHeight = fHeight;
++ }
++ else if (nScalemode & LwpLayoutScale::MAINTAIN_ASPECT_RATIO)
++ {
++ if (fWidth/fHeight >= fDisFrameWidth/fDisFrameHeight)
++ {
++ fSclGrafWidth = fDisFrameWidth;
++ fSclGrafHeight = (fDisFrameWidth/fWidth) * fHeight;
++ }
++ else
++ {
++ fSclGrafHeight = fDisFrameHeight;
++ fSclGrafWidth = (fDisFrameHeight/fHeight) * fWidth;
++ }
++ }
++ else
++ {
++ fSclGrafWidth = fDisFrameWidth;
++ fSclGrafHeight = fDisFrameHeight;
++ }
++ }
++ }
++ }
++ fWidth = fSclGrafWidth ;
++ fHeight = fSclGrafHeight ;
++
++}
++
++/**
++ * @descr: construction function
++ * @param: objHdr - object header, read before entering this function
++ * @param: pStrm - file stream
++ * @return: None
++ * @date: 2/22/2005
++ */
++LwpOleObject::LwpOleObject(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpGraphicOleObject(objHdr, pStrm),m_SizeRect(0,0,5,5)
++{
++}
++/**
++ * @descr: Read VO_OLEOBJECT record
++ * @param: None
++ * @return: None
++ * @date: 2/22/2005
++ */
++void LwpOleObject::Read()
++{
++ LwpGraphicOleObject::Read();
++
++ cPersistentFlags = m_pObjStrm->QuickReaduInt16();
++
++ sal_uInt16 nNonVersionedPersistentFlags = 0;
++ sal_uInt32 nFormat = 0;
++ sal_uInt16 nNumberOfPages = 0;
++ // qCMarker read
++ LwpObjectID ID;
++
++ if (LwpFileHeader::m_nFileRevision >= 0x0004)
++ {
++ nNonVersionedPersistentFlags = m_pObjStrm->QuickReaduInt16();
++
++ OUString sFormat = m_pObjStrm->QuickReadStringPtr();
++
++ if (LwpFileHeader::m_nFileRevision < 0x000B)
++ {
++ // null pointers have a VO_INVALID type
++ //if (VO_INVALID == m_pObjStrm->QuickReaduInt16())
++ // return;
++
++ ID.Read(m_pObjStrm);
++ //return m_pObjStrm->Locate(ID);
++ }
++ else
++ {
++ ID.ReadIndexed(m_pObjStrm);
++ //if (ID.IsNull())
++ // return;
++
++ //return m_pObjStrm->Locate(ID);
++ }
++ }
++
++ if (m_pObjStrm->CheckExtra())
++ {
++ nNumberOfPages = m_pObjStrm->QuickReaduInt16();
++ m_pObjStrm->SkipExtra();
++ }
++
++}
++/**
++ * @descr: Construct ole-storage name by ObjectID
++ * @param: pObjName - input&output string of object name, spaces allocated outside and at least length should be MAX_STREAMORSTORAGENAME
++ * @return: None
++ * @date: 2/22/2005
++ */
++void LwpOleObject::GetChildStorageName(char *pObjName)
++{
++ /*LwpObjectFactory * pObjMgr = LwpObjectFactory::Instance();
++ LwpIndexManager * pIdxMgr = pObjMgr->GetIndexManager();
++ sal_uInt32 nLowID = pIdxMgr->GetObjTime(static_cast<sal_uInt16>(GetObjectID()->GetLow()));*/
++
++ char sName[MAX_STREAMORSTORAGENAME];
++ //LwpObjectID ID(nLowID, GetObjectID()->GetHigh());
++ sprintf( sName, "%s%lX,%lX", "Ole",
++ GetObjectID()->GetHigh(), GetObjectID()->GetLow());
++
++ strcpy( pObjName, sName);
++ return;
++}
++/**
++ * @descr: Parse VO_OLEOBJECT and dump to XML stream only on WIN32 platform
++ * @param: pOutputStream - stream to dump OLE object
++ * @param: pFrameLayout - framlayout object used to dump OLE object
++ * @return: None
++ * @date: 2/22/2005
++ */
++void LwpOleObject::Parse(IXFStream* pOutputStream)
++{
++#if 0
++#ifdef WIN32
++
++ //
++ // Construct OLE object storage name
++ //
++ char sObjectName[MAX_STREAMORSTORAGENAME];
++ GetChildStorageName(sObjectName);
++ String aObjName= String::CreateFromAscii(sObjectName);
++
++ //
++ // Get OLE objects information
++ //
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ LwpObjectFactory* pObjMgr = pGlobal->GetLwpObjFactory();
++ SvStorageRef objStor;
++ SvStorageInfoList * pInfoList;
++ pObjMgr->GetOleObjInfo(objStor, &pInfoList);
++
++ if(pInfoList == NULL)
++ {
++ assert(sal_False);
++ return;
++ }
++
++ //
++ // Get ole object buffer
++ //
++ BYTE * pBuf = NULL;
++ sal_uInt32 nSize = 0;
++ for (sal_uInt32 j=0; j<pInfoList->Count(); j++)
++ {
++
++ SvStorageInfo& rInfo = pInfoList->GetObject(j);
++ String aName = rInfo.GetName();
++
++ if(aName == aObjName)
++ {
++ SvStorageRef childStor;
++ childStor = objStor->OpenStorage(rInfo.GetName());
++ SvStorage * aEleStor;
++ aEleStor = objStor->OpenOLEStorage( rInfo.GetName() );
++ SvInPlaceObjectRef xInplaceObj( ((SvFactory*)SvInPlaceObject::ClassFactory())->CreateAndLoad( childStor ) );
++ SvOutPlaceObjectRef xOutplaceObj(xInplaceObj);
++ aEleStor->SetVersion( SOFFICE_FILEFORMAT_60 );
++ SvStream *pStream=xOutplaceObj->GetOLEObjectStream(aEleStor);
++
++ //Get Ole original size
++ m_SizeRect = xOutplaceObj->GetVisSize(xOutplaceObj->GetViewAspect());
++
++ nSize = pStream->Seek( STREAM_SEEK_TO_END );
++ pBuf = new BYTE[nSize];
++ if (pBuf == NULL)
++ {
++ assert(sal_False);
++ return;
++ }
++ pStream->Seek(0);
++ pStream->Read(pBuf, nSize);
++
++ delete pStream;
++ break;
++ }
++ }
++
++ //
++ // dump the buffer by XFilter
++ //
++ if(pBuf != NULL)
++ {
++ // set ole buffer
++ XFOleObject *pOleObj = new XFOleObject();
++ pOleObj->SetOleData(pBuf, nSize);
++
++ // set frame attributes
++ pOleObj->SetAnchorType(enumXFAnchorPara);
++ double fWidth = 0;
++ double fHeight = 0;
++ GetGrafScaledSize( fWidth, fHeight);
++ if(fWidth < 0.001 || fHeight < 0.001)
++ {
++ fWidth = 5.0;
++ fHeight = 5.0;
++ }
++ pOleObj->SetWidth(fWidth);
++ pOleObj->SetHeight(fHeight);
++ /*
++ pOleObj->SetName(A2OUSTR("TestOle"));
++ pOleObj->SetX(5);
++ pOleObj->SetY(5);
++ pOleObj->SetWidth(5);
++ pOleObj->SetHeight(5);
++ */
++
++ // To XML
++ XFParagraph *pPara = new XFParagraph();
++ pPara->Add(pOleObj);
++ pPara->ToXml(pOutputStream);
++
++ delete pPara; // pOleObj will be deleted inside
++
++#if 0
++ // dump to file
++ String aTempDir( SvtPathOptions().GetTempPath() );
++ sal_Int32 nLength = aTempDir.Len();
++ if ( aTempDir.GetChar(nLength-1 ) !=UChar32( '/' ) )
++ aTempDir += String::CreateFromAscii("/");
++
++ aTempDir += aObjName;
++ SvFileStream aStream(aTempDir, STREAM_WRITE);
++ aStream.Write(pBuf, nSize);
++ aStream.Close();
++#endif
++ delete []pBuf;
++
++ // dump attributes to
++ }
++
++ return;
++#endif
++#endif
++}
++
++void LwpOleObject::XFConvert(XFContentContainer * pCont)
++{
++#if 0
++ //Add by 10/24/2005
++ //Get ole object stream with the object name;
++
++ // modified by
++ // if small file, use the compressed stream for BENTO
++ LwpSvStream* pStream = m_pStrm->GetCompressedStream() ? m_pStrm->GetCompressedStream(): m_pStrm;
++ // end modified by
++
++ OpenStormBento::LtcBenContainer* pBentoContainer;
++ ULONG ulRet = OpenStormBento::BenOpenContainer(pStream, &pBentoContainer);
++
++ char sObjectName[MAX_STREAMORSTORAGENAME];
++ GetChildStorageName(sObjectName);
++ std::string aObjName(sObjectName);
++ SotStorageStreamRef xOleObjStm = pBentoContainer->ConvertAswStorageToOLE2Stream(aObjName.c_str());
++
++ //Get stream size and data
++ if(!xOleObjStm.Is() || xOleObjStm->GetError())
++ return;
++
++
++ BYTE * pBuf = NULL;
++ sal_uInt32 nSize = 0;
++
++ SvStorageRef xOleObjStor = new SvStorage( *xOleObjStm );
++ //SvStorageRef xOleObjStor = pBentoContainer->CreateOLEStorageWithObjectName(aObjName.c_str());
++ if( !xOleObjStor.Is())
++ return ;
++
++ SvInPlaceObjectRef xInplaceObj( ((SvFactory*)SvInPlaceObject::ClassFactory())->CreateAndLoad( xOleObjStor ) );
++
++
++ //when the OLE object is converted into native object.
++// SvOutPlaceObjectRef xOutplaceObj(xInplaceObj);
++// xOutplaceObj->SetVersion( SOFFICE_FILEFORMAT_60 );
++// SvStream *pOleStream=xOutplaceObj->GetOLEObjectStream(xOleObjStor);
++ //Get Ole original size
++ m_SizeRect = GetOLEObjectSize(xOleObjStor);
++ //End by
++
++ nSize = xOleObjStm->Seek( STREAM_SEEK_TO_END );
++ pBuf = new BYTE[nSize];
++ if (pBuf == NULL)
++ {
++ assert(sal_False);
++ return;
++ }
++ xOleObjStm->Seek(0);
++ xOleObjStm->Read(pBuf, nSize);
++
++ //delete pOleStream;
++
++
++ //End by
++
++ //
++ // dump the buffer by XFilter
++ //
++ if(pBuf != NULL)
++ {
++ // set ole buffer
++ XFOleObject *pOleObj = new XFOleObject();
++ pOleObj->SetOleData(pBuf, nSize);
++
++ // set frame attributes
++ pOleObj->SetAnchorType(enumXFAnchorFrame);
++ pOleObj->SetStyleName( m_strStyleName);
++ LwpFrameLayout* pMyFrameLayout = static_cast<LwpFrameLayout*>(GetLayout(NULL));
++ if(pMyFrameLayout)
++ {
++ pOleObj->SetX(pMyFrameLayout->GetMarginsValue(MARGIN_LEFT));
++ pOleObj->SetY(pMyFrameLayout->GetMarginsValue(MARGIN_TOP));
++ }
++
++ double fWidth = 0;
++ double fHeight = 0;
++ GetGrafScaledSize( fWidth, fHeight);
++ if(fWidth < 0.001 || fHeight < 0.001)
++ {
++ fWidth = 5.0;
++ fHeight = 5.0;
++ }
++
++
++ pOleObj->SetWidth(fWidth);
++ pOleObj->SetHeight(fHeight);
++
++
++ //delete pPara; // pOleObj will be deleted inside
++ pCont->Add(pOleObj);
++
++#if 0
++ // dump to file
++ String aTempDir( SvtPathOptions().GetTempPath() );
++ sal_Int32 nLength = aTempDir.Len();
++ if ( aTempDir.GetChar(nLength-1 ) !=UChar32( '/' ) )
++ aTempDir += String::CreateFromAscii("/");
++
++ aTempDir += aObjName;
++ SvFileStream aStream(aTempDir, STREAM_WRITE);
++ aStream.Write(pBuf, nSize);
++ aStream.Close();
++#endif
++ delete []pBuf;
++
++ // dump attributes to
++ }
++#endif
++ return;
++}
++
++void LwpOleObject::GetGrafOrgSize(double & rWidth, double & rHeight)
++{
++ rWidth = (double)m_SizeRect.GetWidth()/1000;//cm unit
++ rHeight = (double)m_SizeRect.GetHeight()/1000;//cm unit
++}
++
++void LwpOleObject::RegisterStyle()
++{
++#if 0
++#ifdef WIN32
++ LwpVirtualLayout* pMyLayout = GetLayout(NULL);
++ if(pMyLayout->IsFrame())
++ {
++ XFFrameStyle* pXFFrameStyle = new XFFrameStyle();
++ pXFFrameStyle->SetXPosType(enumXFFrameXPosFromLeft, enumXFFrameXRelFrame);
++ pXFFrameStyle->SetYPosType(enumXFFrameYPosFromTop, enumXFFrameYRelPara);
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_strStyleName = pXFStyleManager->AddStyle(pXFFrameStyle)->GetStyleName();
++ }
++#endif
++#endif
++}
++
++
++#include <sot/exchange.hxx>
++#include <sot/storinfo.hxx>
++#include <svtools/wmf.hxx>
++/**
++* @descr: For SODC_2667, To get the OLE object size by reading OLE object picture information.
++*/
++Rectangle LwpOleObject::GetOLEObjectSize( SotStorage * pStor ) const
++{
++ Rectangle aSize(0,0,0,0);
++ String aStreamName;
++ if( pStor->IsContained( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\002OlePres000" ) ) ) )
++ aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\002OlePres000" ) );
++ else if( pStor->IsContained( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole10Native" ) ) ) )
++ aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\1Ole10Native" ) );
++
++ if( aStreamName.Len() == 0 )
++ return aSize;
++
++
++ for( USHORT i = 1; i < 10; i++ )
++ {
++ SotStorageStreamRef xStm = pStor->OpenSotStream( aStreamName,
++ STREAM_READ | STREAM_NOCREATE );
++ if( xStm->GetError() )
++ break;
++
++ xStm->SetBufferSize( 8192 );
++ LwpOlePres * pEle = new LwpOlePres( 0 );
++ if( pEle->Read( *xStm ) && !xStm->GetError() )
++ {
++ if( pEle->GetFormat() == FORMAT_GDIMETAFILE || pEle->GetFormat() == FORMAT_BITMAP )
++ {
++ aSize = Rectangle( Point(), pEle->GetSize());
++ delete pEle;
++ break;
++ }
++ }
++ delete pEle;
++ pEle = NULL;
++ aStreamName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\002OlePres00" ) );
++ aStreamName += String( i );
++ };
++
++ return aSize;
++}
++/**
++* @descr: Read OLE object picture information
++*/
++BOOL LwpOlePres::Read( SvStream & rStm )
++{
++#if 0
++ ULONG nBeginPos = rStm.Tell();
++ INT32 n;
++ rStm >> n;
++ if( n != -1 )
++ {
++ pBmp = new Bitmap;
++ rStm >> *pBmp;
++ if( rStm.GetError() == SVSTREAM_OK )
++ {
++ nFormat = FORMAT_BITMAP;
++ aSize = pBmp->GetPrefSize();
++ MapMode aMMSrc;
++ if( !aSize.Width() || !aSize.Height() )
++ {
++ // letzte Chance
++ aSize = pBmp->GetSizePixel();
++ aMMSrc = MAP_PIXEL;
++ }
++ else
++ aMMSrc = pBmp->GetPrefMapMode();
++ MapMode aMMDst( MAP_100TH_MM );
++ aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
++ return TRUE;
++ }
++ else
++ {
++ delete pBmp;
++ pBmp = NULL;
++
++ pMtf = new GDIMetaFile();
++ rStm.ResetError();
++ rStm >> *pMtf;
++ if( rStm.GetError() == SVSTREAM_OK )
++ {
++ nFormat = FORMAT_GDIMETAFILE;
++ aSize = pMtf->GetPrefSize();
++ MapMode aMMSrc = pMtf->GetPrefMapMode();
++ MapMode aMMDst( MAP_100TH_MM );
++ aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst );
++ return TRUE;
++ }
++ else
++ {
++ delete pMtf;
++ pMtf = NULL;
++ }
++ }
++
++ }
++
++ rStm.ResetError();
++ rStm.Seek( nBeginPos );
++ nFormat = ReadClipboardFormat( rStm );
++ // JobSetup, bzw. TargetDevice ueberlesen
++ // Information aufnehmen, um sie beim Schreiben nicht zu verlieren
++ nJobLen = 0;
++ rStm >> nJobLen;
++ if( nJobLen >= 4 )
++ {
++ nJobLen -= 4;
++ if( nJobLen )
++ {
++ pJob = new BYTE[ nJobLen ];
++ rStm.Read( pJob, nJobLen );
++ }
++ }
++ else
++ {
++ rStm.SetError( SVSTREAM_GENERALERROR );
++ return FALSE;
++ }
++ UINT32 nAsp;
++ rStm >> nAsp;
++ USHORT nSvAsp = USHORT( nAsp );
++ SetAspect( nSvAsp );
++ rStm.SeekRel( 4 ); //L-Index ueberlesen
++ rStm >> nAdvFlags;
++ rStm.SeekRel( 4 ); //Compression
++ UINT32 nWidth = 0;
++ UINT32 nHeight = 0;
++ UINT32 nSize = 0;
++ rStm >> nWidth >> nHeight >> nSize;
++ aSize.Width() = nWidth;
++ aSize.Height() = nHeight;
++
++ if( nFormat == FORMAT_GDIMETAFILE )
++ {
++ pMtf = new GDIMetaFile();
++ ReadWindowMetafile( rStm, *pMtf );
++ }
++ else if( nFormat == FORMAT_BITMAP )
++ {
++ pBmp = new Bitmap();
++ rStm >> *pBmp;
++ }
++ else
++ {
++ void * p = new BYTE[ nSize ];
++ rStm.Read( p, nSize );
++ delete p;
++ return FALSE;
++ }
++#endif
++ return TRUE;
++}
++
++/**
++* @descr: Write OLE object picture information.
++*/
++void LwpOlePres::Write( SvStream & rStm )
++{
++ WriteClipboardFormat( rStm, FORMAT_GDIMETAFILE );
++ rStm << (INT32)(nJobLen +4); // immer leeres TargetDevice
++ if( nJobLen )
++ rStm.Write( pJob, nJobLen );
++ rStm << (UINT32)nAspect;
++ rStm << (INT32)-1; //L-Index immer -1
++ rStm << (INT32)nAdvFlags;
++ rStm << (INT32)0; //Compression
++ rStm << (INT32)aSize.Width();
++ rStm << (INT32)aSize.Height();
++ ULONG nPos = rStm.Tell();
++ rStm << (INT32)0;
++
++ if( GetFormat() == FORMAT_GDIMETAFILE && pMtf )
++ {
++ // Immer auf 1/100 mm, bis Mtf-Loesung gefunden
++ // Annahme (keine Skalierung, keine Org-Verschiebung)
++ DBG_ASSERT( pMtf->GetPrefMapMode().GetScaleX() == Fraction( 1, 1 ),
++ "X-Skalierung im Mtf" )
++ DBG_ASSERT( pMtf->GetPrefMapMode().GetScaleY() == Fraction( 1, 1 ),
++ "Y-Skalierung im Mtf" )
++ DBG_ASSERT( pMtf->GetPrefMapMode().GetOrigin() == Point(),
++ "Origin-Verschiebung im Mtf" )
++ MapUnit nMU = pMtf->GetPrefMapMode().GetMapUnit();
++ if( MAP_100TH_MM != nMU )
++ {
++ Size aPrefS( pMtf->GetPrefSize() );
++ Size aS( aPrefS );
++ aS = OutputDevice::LogicToLogic( aS, nMU, MAP_100TH_MM );
++
++ pMtf->Scale( Fraction( aS.Width(), aPrefS.Width() ),
++ Fraction( aS.Height(), aPrefS.Height() ) );
++ pMtf->SetPrefMapMode( MAP_100TH_MM );
++ pMtf->SetPrefSize( aS );
++ }
++ WriteWindowMetafileBits( rStm, *pMtf );
++ }
++ else
++ {
++ DBG_ERROR( "unknown format" )
++ }
++ ULONG nEndPos = rStm.Tell();
++ rStm.Seek( nPos );
++ rStm << (UINT32)(nEndPos - nPos - 4);
++ rStm.Seek( nEndPos );
++}
++//End by
+diff -urNp lotuswordpro.bak/source/filter/lwpoleobject.hxx lotuswordpro/source/filter/lwpoleobject.hxx
+--- lotuswordpro.bak/source/filter/lwpoleobject.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpoleobject.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,195 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - OLE object
++ */
++/*************************************************************************
++ * Change History
++ Feb 2005 Created
++ ************************************************************************/
++#ifndef _LWPOLEOBJECT_HXX_
++#define _LWPOLEOBJECT_HXX_
++
++#include "lwpobj.hxx"
++#include "lwpobjhdr.hxx"
++#include "lwpobjid.hxx"
++#include "lwpstory.hxx"
++#include "tools/gen.hxx"
++/*
++#include <so3/svstor.hxx>
++#include <so3/outplace.hxx>
++#include <so3/ipobj.hxx>
++#include <so3/factory.hxx>
++*/
++#include <svx/svdoole2.hxx>
++#include <svx/svdpage.hxx>
++#include <sfx2/objsh.hxx>
++#include <sot/storinfo.hxx>
++
++
++typedef struct tagAFID_CACHE
++{
++ unsigned long LinkedFileSize; /* 0 if not linked */
++ unsigned long LinkedFileTime; /* 0 if not linked */
++ long Width; /* -1 if not present */
++ long Height; /* -1 if not present */
++} AFID_CACHE, * PAFID_CACHE;
++
++/* Maximum string sizes - includes space for null terminator */
++#define AFID_MAX_FILE_FORMAT_SIZE 80
++#define AFID_MAX_CONTEXT_FORMAT_SIZE 80
++
++// OLE defined maximum
++#define MAX_STREAMORSTORAGENAME 32
++/**
++ * @descr
++ * super class of LwpOleObject and LwpGraphicObject
++ */
++class LwpGraphicOleObject : public LwpContent
++{
++public:
++ LwpGraphicOleObject(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ virtual void Read();
++ virtual void GetGrafScaledSize(double& fWidth, double& fHeight);
++ virtual void GetGrafOrgSize(double& rWidth, double& rHeight);
++protected:
++ LwpObjectID m_pPrevObj;
++ LwpObjectID m_pNextObj;
++
++ rtl::OUString m_strStyleName;
++};
++
++class LwpFrameLayout;
++/**
++ * @descr
++ * class to read and parse VO_OLEOBJECT object
++ */
++class LwpOleObject : public LwpGraphicOleObject
++{
++public:
++ LwpOleObject(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ ~LwpOleObject(){};
++ virtual void Read();
++ virtual void Parse(IXFStream* pOutputStream);
++ virtual void XFConvert(XFContentContainer * pCont);
++ virtual void RegisterStyle();
++ void GetGrafOrgSize(double& rWidth, double& rHeight) ;
++private:
++ void GetChildStorageName(char *pObjName);
++ Rectangle GetOLEObjectSize( SotStorage * pStor ) const;
++
++ sal_uInt16 cPersistentFlags;
++
++ Rectangle m_SizeRect;
++};
++
++/**
++* Added by for SODC_2667,03/20/2006
++* Read the OLE Object stream and get the info of the OLE picture
++*/
++#include <tools/stream.hxx>
++#include <vcl/gdimtf.hxx>
++#include <vcl/bitmap.hxx>
++#include <vcl/outdev.hxx>
++class LwpOlePres
++{
++ ULONG nFormat;
++ USHORT nAspect;
++ Bitmap * pBmp;
++ GDIMetaFile * pMtf;
++
++ UINT32 nAdvFlags;
++ INT32 nJobLen;
++ void * pJob;
++ Size aSize; // Groesse in 100TH_MM
++public:
++ LwpOlePres( ULONG nF )
++ : nFormat( nF )
++ , nAdvFlags( 0x2 ) // in Dokument gefunden
++ , nJobLen( 0 )
++ , pJob( NULL )
++ , pBmp( NULL )
++ , pMtf( NULL )
++ {}
++ ~LwpOlePres()
++ {
++ delete pJob;
++ delete pBmp;
++ delete pMtf;
++ }
++ void SetMtf( const GDIMetaFile & rMtf )
++ {
++ if( pMtf )
++ delete pMtf;
++ pMtf = new GDIMetaFile( rMtf );
++ }
++ Bitmap *GetBitmap() const { return pBmp; }
++ GDIMetaFile *GetMetaFile() const { return pMtf; }
++ ULONG GetFormat() const { return nFormat; }
++ void SetAspect( USHORT nAsp ) { nAspect = nAsp; }
++ ULONG GetAdviseFlags() const { return nAdvFlags; }
++ void SetAdviseFlags( ULONG nAdv ) { nAdvFlags = nAdv; }
++ void SetSize( const Size & rSize ) { aSize = rSize; }
++ Size GetSize() const { return aSize; } //Add by , 10/26/2005
++ /// return FALSE => unknown format
++ BOOL Read( SvStream & rStm );
++ void Write( SvStream & rStm );
++};
++//End by
++
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwpoverride.cxx lotuswordpro/source/filter/lwpoverride.cxx
+--- lotuswordpro.bak/source/filter/lwpoverride.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpoverride.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,555 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpoverride.hxx"
++#include "lwpfilehdr.hxx"
++#include "lwpatomholder.hxx"
++#include "lwpborderstuff.hxx"
++#include "lwpmargins.hxx"
++#include "lwpbackgroundstuff.hxx"
++
++/*class LwpOverride*/
++void LwpOverride::ReadCommon(LwpObjectStream* pStrm)
++{
++ pStrm->QuickRead(&m_nValues, 2);
++ pStrm->QuickRead(&m_nOverride, 2);
++ pStrm->QuickRead(&m_nApply, 2);
++ pStrm->SkipExtra();
++}
++
++void LwpOverride::Clear()
++{
++ m_nValues = 0;
++ m_nOverride = 0;
++ m_nApply = 0;
++}
++
++void LwpOverride::operator=(const LwpOverride& rOther)
++{
++ m_nValues = rOther.m_nValues;
++ m_nOverride = rOther.m_nOverride;
++ m_nApply = rOther.m_nApply;
++}
++
++void LwpOverride::Override(sal_uInt16 nBits, STATE eState)
++{
++ if (eState == STATE_STYLE)
++ {
++ m_nValues &= ~nBits;
++ m_nOverride &= ~nBits;
++ }
++ else
++ {
++ m_nOverride |= nBits;
++ if (eState == STATE_ON)
++ {
++ m_nValues |= nBits;
++ }
++ else /* State == STATE_OFF */
++ {
++ m_nValues &= ~nBits;
++ }
++ }
++ m_nApply |= nBits;
++}
++
++/*class LwpTextLanguageOverride*/
++void LwpTextLanguageOverride::Read(LwpObjectStream* pStrm)
++{
++ if (pStrm->QuickReadBool())
++ {
++ ReadCommon(pStrm);
++ pStrm->QuickRead(&m_nLanguage, 2);
++ }
++
++ pStrm->SkipExtra();
++
++}
++
++/*class LwpTextAttributeOverride*/
++void LwpTextAttributeOverride::Read(LwpObjectStream* pStrm)
++{
++ if (pStrm->QuickReadBool())
++ {
++ ReadCommon(pStrm);
++ pStrm->QuickRead(&m_nHideLevels, 2);
++
++ if (LwpFileHeader::m_nFileRevision > 0x000A)
++ {
++ pStrm->QuickRead(&m_nBaseLineOffset, 4);
++ }
++ }
++
++ pStrm->SkipExtra();
++}
++
++sal_Bool LwpTextAttributeOverride::IsHighLight()
++{
++ return (m_nValues & TAO_HIGHLIGHT);
++}
++
++/*class LwpKinsokuOptsOverride*/
++void LwpKinsokuOptsOverride::Read(LwpObjectStream* pStrm)
++{
++ if (pStrm->QuickReadBool())
++ {
++ ReadCommon(pStrm);
++ pStrm->QuickRead(&m_nLevels, 2);
++ }
++
++ pStrm->SkipExtra();
++}
++
++/*class LwpBulletOverride*/
++void LwpBulletOverride::Read(LwpObjectStream * pStrm)
++{
++ if (pStrm->QuickReadBool())
++ {
++ m_bIsNull= sal_False;
++ ReadCommon(pStrm);
++ m_SilverBullet.ReadIndexed(pStrm);
++ }
++ else
++ m_bIsNull = sal_True;
++
++ pStrm->SkipExtra();
++}
++void LwpBulletOverride::OverrideSkip(sal_Bool bOver)
++{
++ if (bOver)
++ {
++ LwpOverride::Override(BO_SKIP, STATE_ON);
++ }
++ else
++ {
++ LwpOverride::Override(BO_SKIP, STATE_OFF);
++ }
++}
++
++void LwpBulletOverride::OverrideRightAligned(sal_Bool bOver)
++{
++ if(bOver)
++ {
++ LwpOverride::Override(BO_RIGHTALIGN,STATE_ON);
++ }
++ else
++ {
++ LwpOverride::Override(BO_RIGHTALIGN,STATE_OFF);
++ }
++}
++
++void LwpBulletOverride::operator=(const LwpOverride& rOther)
++{
++ LwpOverride::operator=(rOther);
++ const LwpBulletOverride* pBullet = static_cast<LwpBulletOverride*>((LwpOverride*)&rOther);
++
++ m_SilverBullet = pBullet->m_SilverBullet;
++
++}
++
++void LwpBulletOverride::OverrideSilverBullet(LwpObjectID aID)
++{
++ if (!aID.IsNull())
++ {
++ m_SilverBullet = aID;
++ }
++
++ LwpOverride::Override(BO_SILVERBULLET,STATE_ON);
++}
++
++void LwpBulletOverride::Override(LwpBulletOverride* pOther)
++{
++ if (m_nApply & BO_SILVERBULLET)
++ {
++ if (IsSilverBulletOverridden())
++ {
++ pOther->OverrideSilverBullet(m_SilverBullet);
++ }
++ else
++ {
++ pOther->RevertSilverBullet();
++ }
++ }
++
++ if (m_nApply & BO_SKIP)
++ {
++ if (IsSkipOverridden())
++ {
++ pOther->OverrideSkip(IsSkip());
++ }
++ else
++ {
++ pOther->RevertSkip();
++ }
++ }
++
++ if (m_nApply & BO_RIGHTALIGN)
++ {
++ if (IsRightAlignedOverridden())
++ {
++ pOther->OverrideRightAligned(IsRightAligned());
++ }
++ else
++ {
++ pOther->RevertRightAligned();
++ }
++ }
++
++}
++
++/*class LwpAlignmentOverride*/
++void LwpAlignmentOverride::Read(LwpObjectStream * pStrm)
++{
++ if (pStrm->QuickReadBool())
++ {
++ ReadCommon(pStrm);
++ pStrm->QuickRead(&m_nAlignType, 1);
++ pStrm->QuickRead(&m_nPosition, 4);
++ pStrm->QuickRead(&m_nAlignChar, 2);
++ }
++
++ pStrm->SkipExtra();
++}
++
++/*class LwpSpacingCommonOverride*/
++void LwpSpacingCommonOverride::Read(LwpObjectStream* pStrm)
++{
++ if (pStrm->QuickReadBool())
++ {
++ ReadCommon(pStrm);
++ pStrm->QuickRead(&m_nSpacingType, 2);
++ pStrm->QuickRead(&m_nAmount, 4);
++ pStrm->QuickRead(&m_nMultiple, 4);
++ }
++
++ pStrm->SkipExtra();
++}
++
++/*class LwpSpacingOverride*/
++LwpSpacingOverride::LwpSpacingOverride() :
++m_pSpacing(new LwpSpacingCommonOverride),
++m_pAboveLineSpacing(new LwpSpacingCommonOverride),
++m_pParaSpacingAbove(new LwpSpacingCommonOverride),
++m_pParaSpacingBelow(new LwpSpacingCommonOverride)
++{
++}
++
++LwpSpacingOverride& LwpSpacingOverride::operator=(LwpSpacingOverride& other)
++{
++ LwpOverride::operator=(other);
++ *m_pSpacing = *other.m_pSpacing;
++ *m_pAboveLineSpacing = *other.m_pAboveLineSpacing;
++ *m_pParaSpacingAbove = *other.m_pParaSpacingAbove;
++ *m_pParaSpacingAbove = *other.m_pParaSpacingAbove;
++ return *this;
++}
++
++LwpSpacingOverride::~LwpSpacingOverride()
++{
++ if (m_pSpacing)
++ {
++ delete m_pSpacing;
++ }
++ if (m_pAboveLineSpacing)
++ {
++ delete m_pAboveLineSpacing;
++ }
++ if (m_pParaSpacingAbove)
++ {
++ delete m_pParaSpacingAbove;
++ }
++ if (m_pParaSpacingBelow)
++ {
++ delete m_pParaSpacingBelow;
++ }
++}
++
++void LwpSpacingOverride::Read(LwpObjectStream* pStrm)
++{
++ if (pStrm->QuickReadBool())
++ {
++ ReadCommon(pStrm);
++ m_pSpacing->Read(pStrm);
++ if (LwpFileHeader::m_nFileRevision >= 0x000d)
++ {
++ m_pAboveLineSpacing->Read(pStrm);
++ }
++ m_pParaSpacingAbove->Read(pStrm);
++ m_pParaSpacingBelow->Read(pStrm);
++ }
++
++ pStrm->SkipExtra();
++}
++
++/*class LwpIndentOverride*/
++void LwpIndentOverride::Read(LwpObjectStream* pStrm)
++{
++ if (pStrm->QuickReadBool())
++ {
++ ReadCommon(pStrm);
++
++ pStrm->QuickRead(&m_nAll, 4);
++ pStrm->QuickRead(&m_nFirst, 4);
++ pStrm->QuickRead(&m_nRest, 4);
++ pStrm->QuickRead(&m_nRight, 4);
++ }
++
++ pStrm->SkipExtra();
++}
++
++
++/*class LwpAmikakeOverride*/
++LwpAmikakeOverride::LwpAmikakeOverride() :
++m_pBackgroundStuff(new LwpBackgroundStuff), m_nType(AMIKAKE_NONE)
++{
++}
++
++LwpAmikakeOverride::~LwpAmikakeOverride()
++{
++ if (m_pBackgroundStuff)
++ {
++ delete m_pBackgroundStuff;
++ }
++}
++
++void LwpAmikakeOverride::Read(LwpObjectStream* pStrm)
++{
++ if (pStrm->QuickReadBool())
++ {
++ ReadCommon(pStrm);
++ m_pBackgroundStuff->Read(pStrm);
++ }
++ else
++ {
++ Clear();
++ }
++
++ if (pStrm->CheckExtra())
++ {
++ pStrm->QuickRead(&m_nType, 2);
++ pStrm->SkipExtra();
++ }
++ else
++ {
++ m_nType = AMIKAKE_NONE;
++ }
++}
++
++void LwpAlignmentOverride::Override(LwpAlignmentOverride* other)//add by 1-24
++{
++ if (m_nOverride & AO_TYPE)
++ {
++ other->OverrideAlignment(m_nAlignType);
++ }
++/* if (m_nOverride & AO_POSITION)
++ {
++ Other->OverridePosition(GetPosition());
++ }
++ if (m_nOverride & AO_CHAR)
++ {
++ Other->OverrideAlignChar(GetAlignChar());
++ }
++*/
++}
++
++void LwpAlignmentOverride::OverrideAlignment(AlignType val)//add by 1-24
++{
++ m_nAlignType = val;
++ m_nOverride |= AO_TYPE;
++}
++
++LwpIndentOverride& LwpIndentOverride::operator=(LwpIndentOverride& other)
++{
++ LwpOverride::operator=(other);
++ m_nAll = other.m_nAll;
++ m_nFirst = other.m_nFirst;
++ m_nRest = other.m_nRest;
++ m_nRight = other.m_nRight;
++ return *this;
++}
++
++void LwpIndentOverride::Override(LwpIndentOverride* other)
++{
++ if(m_nOverride & IO_ALL)
++ other->OverrideIndentAll(m_nAll);
++ if(m_nOverride & IO_FIRST)
++ other->OverrideIndentFirst(m_nFirst);
++ if(m_nOverride & IO_RIGHT)
++ other->OverrideIndentRight(m_nRight);
++ if(m_nOverride & IO_REST)
++ other->OverrideIndentRest(m_nRest);
++ if(m_nOverride & IO_USE_RELATIVE)
++ other->OverrideUseRelative(IsUseRelative());
++ if (m_nOverride & IO_REL_FLAGS)
++ other->OverrideRelative(GetRelative());
++}
++
++sal_uInt16 LwpIndentOverride::GetRelative()
++{
++ if ((m_nOverride & IO_REL_FLAGS) == IO_REL_FIRST)
++ return RELATIVE_FIRST;
++ else if ((m_nOverride & IO_REL_FLAGS) == IO_REL_ALL)
++ return RELATIVE_ALL;
++ return RELATIVE_REST;
++}
++
++sal_Bool LwpIndentOverride::IsUseRelative()
++{
++ return (m_nValues & IO_USE_RELATIVE) != 0;
++}
++
++void LwpIndentOverride::OverrideIndentAll(sal_Int32 val)
++{
++ m_nAll = val;
++ m_nOverride |= IO_ALL;
++}
++
++void LwpIndentOverride::OverrideIndentFirst(sal_Int32 val)
++{
++ m_nFirst = val;
++ m_nOverride |= IO_FIRST;
++}
++
++void LwpIndentOverride::OverrideIndentRight(sal_Int32 val)
++{
++ m_nRight = val;
++ m_nOverride |= IO_RIGHT;
++}
++
++void LwpIndentOverride::OverrideIndentRest(sal_Int32 val)
++{
++ m_nRest = val;
++// m_nAll = val;
++// m_nFirst = 0-val;
++ m_nOverride |= IO_REST;
++}
++
++void LwpIndentOverride::OverrideUseRelative(sal_Bool use)
++{
++ if (use)
++ {
++ m_nOverride |= IO_USE_RELATIVE;
++ m_nValues |= IO_USE_RELATIVE;
++ }
++ else
++ {
++ m_nOverride &= ~IO_USE_RELATIVE;
++ m_nValues &= ~IO_USE_RELATIVE;
++ }
++}
++
++void LwpIndentOverride::OverrideRelative(sal_uInt16 relative)
++{
++ sal_uInt16 Flag;
++
++ if (relative == RELATIVE_FIRST)
++ Flag = IO_REL_FIRST;
++ else if (relative == RELATIVE_ALL)
++ Flag = IO_REL_ALL;
++ else
++ Flag = IO_REL_REST;
++
++ m_nOverride &= ~IO_REL_FLAGS;
++ m_nOverride |= Flag;
++}
++
++void LwpSpacingOverride::Override(LwpSpacingOverride* other)
++{
++// if (IsAlwaysOverridden())
++// other->SetAlways(IsAlways());//To be done
++ if (other)
++ {
++ m_pSpacing->Override(other->GetSpacing());
++ m_pAboveLineSpacing->Override(other->GetAboveLineSpacing());
++ m_pParaSpacingAbove->Override(other->GetAboveSpacing());
++ m_pParaSpacingBelow->Override(other->GetBelowSpacing());
++ }
++}
++
++void LwpSpacingCommonOverride::Override(LwpSpacingCommonOverride* other)
++{
++ if (m_nOverride & SPO_TYPE)
++ other->OverrideType(m_nSpacingType);
++ if (m_nOverride & SPO_AMOUNT)
++ other->OverrideAmount(m_nAmount);
++ if (m_nOverride & SPO_MULTIPLE)
++ other->OverrideMultiple(m_nMultiple);
++}
++
++void LwpSpacingCommonOverride::OverrideType(SpacingType val)
++{
++ m_nSpacingType = val;
++ m_nOverride |= SPO_TYPE;
++}
++
++void LwpSpacingCommonOverride::OverrideAmount(sal_Int32 val)
++{
++ m_nAmount = val;
++ m_nOverride |= SPO_AMOUNT;
++}
++
++void LwpSpacingCommonOverride::OverrideMultiple(sal_Int32 val)
++{
++ m_nMultiple = val;
++ m_nOverride |= SPO_MULTIPLE;
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpoverride.hxx lotuswordpro/source/filter/lwpoverride.hxx
+--- lotuswordpro.bak/source/filter/lwpoverride.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpoverride.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,438 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPOVERRIDE_HXX
++#define _LWPOVERRIDE_HXX
++
++#include "lwpobjid.hxx"
++#include "lwptools.hxx"
++
++class LwpObjectStream;
++
++enum STATE
++{
++ STATE_OFF = 0,
++ STATE_ON = 1,
++ STATE_STYLE = 2
++};
++
++class LwpOverride
++{
++public:
++ LwpOverride() : m_nValues(0), m_nOverride(0), m_nApply(0) {};
++
++ virtual ~LwpOverride(){}
++
++ virtual void Read(LwpObjectStream* pStrm) = 0;
++
++ virtual void operator=(const LwpOverride& rOther);
++
++ void ReadCommon(LwpObjectStream* pStrm);
++
++ void Clear();
++
++ void Override(sal_uInt16 nBits, STATE eState);
++
++protected:
++ sal_uInt16 m_nValues;
++ sal_uInt16 m_nOverride;
++ sal_uInt16 m_nApply;
++};
++
++/////////////////////////////////////////////////////////////////
++class LwpTextLanguageOverride : public LwpOverride
++{
++public:
++ LwpTextLanguageOverride() : m_nLanguage(0) {};
++
++ void Read(LwpObjectStream* pStrm);
++
++private:
++ sal_uInt16 m_nLanguage;
++};
++
++/////////////////////////////////////////////////////////////////
++class LwpTextAttributeOverride : public LwpOverride
++{
++public:
++ LwpTextAttributeOverride() : m_nHideLevels(0), m_nBaseLineOffset(0) {};
++
++ void Read(LwpObjectStream* pStrm);
++
++ inline sal_uInt16 GetHideLevels() const;
++
++ sal_Bool IsHighLight();
++
++private:
++ enum{
++ TAO_HIGHLIGHT = 0x08,
++ };
++ sal_uInt16 m_nHideLevels;
++ sal_uInt32 m_nBaseLineOffset;
++};
++
++inline sal_uInt16 LwpTextAttributeOverride::GetHideLevels() const
++{
++ return m_nHideLevels;
++}
++/////////////////////////////////////////////////////////////////
++class LwpKinsokuOptsOverride : public LwpOverride
++{
++public:
++ LwpKinsokuOptsOverride() : m_nLevels(0) {};
++
++ void Read(LwpObjectStream* pStrm);
++
++private:
++ sal_uInt16 m_nLevels;
++};
++
++/////////////////////////////////////////////////////////////////
++class LwpBulletOverride : public LwpOverride
++{
++public:
++ LwpBulletOverride() {m_bIsNull = sal_True;}
++
++ void Read(LwpObjectStream* pStrm);
++
++ inline LwpObjectID GetSilverBullet() const;
++
++ void operator=(const LwpOverride& rOther);
++
++ void Override(LwpBulletOverride* pOther);
++
++ inline sal_Bool IsSilverBulletOverridden();
++ inline sal_Bool IsSkipOverridden();
++ inline sal_Bool IsRightAlignedOverridden();
++ inline sal_Bool IsSkip();
++ inline sal_Bool IsRightAligned();
++ inline sal_Bool IsEditable();
++
++
++ void OverrideSilverBullet(LwpObjectID aID);
++ void OverrideSkip(sal_Bool bOver);
++ void OverrideRightAligned(sal_Bool bOver);
++
++ inline void RevertSilverBullet();
++ inline void RevertSkip();
++ inline void RevertRightAligned();
++
++ sal_Bool IsInValid(){return m_bIsNull;}
++private:
++ enum
++ {
++ BO_SILVERBULLET = 0x01,
++ // 0x02 is free
++ BO_RIGHTALIGN = 0x04,
++ BO_EDITABLE = 0x08,
++ BO_SKIP = 0x10
++ };
++
++ LwpObjectID m_SilverBullet;
++ sal_Bool m_bIsNull;
++};
++inline LwpObjectID LwpBulletOverride::GetSilverBullet() const
++{
++ return m_SilverBullet;
++}
++
++inline sal_Bool LwpBulletOverride::IsSilverBulletOverridden()
++{
++ return (sal_Bool)((m_nOverride & BO_SILVERBULLET) != 0);
++}
++
++inline sal_Bool LwpBulletOverride::IsSkipOverridden()
++{
++ return (sal_Bool)((m_nOverride & BO_SKIP) != 0);
++}
++
++inline sal_Bool LwpBulletOverride::IsRightAlignedOverridden()
++{
++ return (sal_Bool)((m_nOverride & BO_RIGHTALIGN) != 0);
++}
++
++inline sal_Bool LwpBulletOverride::IsSkip()
++{
++ return (sal_Bool)((m_nValues & BO_SKIP) != 0);
++}
++
++inline sal_Bool LwpBulletOverride::IsEditable()
++{
++ return (sal_Bool)((m_nValues & BO_EDITABLE) != 0);
++}
++
++inline sal_Bool LwpBulletOverride::IsRightAligned()
++{
++ return (sal_Bool)((m_nValues & BO_RIGHTALIGN) != 0);
++}
++
++inline void LwpBulletOverride::RevertSilverBullet()
++{
++ LwpOverride::Override(BO_SILVERBULLET, STATE_STYLE);
++}
++
++inline void LwpBulletOverride::RevertSkip()
++{
++ LwpOverride::Override(BO_SKIP, STATE_STYLE);
++}
++
++inline void LwpBulletOverride::RevertRightAligned()
++{
++ LwpOverride::Override(BO_RIGHTALIGN, STATE_STYLE);
++}
++
++/////////////////////////////////////////////////////////////////
++class LwpAlignmentOverride : public LwpOverride
++{
++public:
++ LwpAlignmentOverride() : m_nAlignType(ALIGN_LEFT), m_nPosition(0), m_nAlignChar(0){};
++
++ void Read(LwpObjectStream* pStrm);
++
++ enum AlignType
++ {
++ ALIGN_LEFT = 0,
++ ALIGN_RIGHT = 1,
++ ALIGN_CENTER = 2,
++ ALIGN_JUSTIFY = 3,
++ ALIGN_JUSTIFYALL = 4,
++ ALIGN_NUMERICLEFT = 5,
++ ALIGN_NUMERICRIGHT = 6,
++ ALIGN_SQUEEZE = 7
++ };
++
++ AlignType GetAlignType(){ return m_nAlignType; }
++ void Override(LwpAlignmentOverride* other);//add by 1-24
++ void OverrideAlignment(AlignType val);//add by 1-24
++private:
++ enum
++ {
++ AO_TYPE = 0x01,
++ AO_POSITION = 0x02,
++ AO_CHAR = 0x04
++ };
++
++ AlignType m_nAlignType;
++ sal_uInt32 m_nPosition;
++ sal_uInt16 m_nAlignChar;
++};
++
++/////////////////////////////////////////////////////////////////
++class LwpSpacingCommonOverride : public LwpOverride
++{
++public:
++ LwpSpacingCommonOverride() : m_nSpacingType(SPACING_NONE), m_nAmount(0), m_nMultiple(65536){};
++
++ void Read(LwpObjectStream* pStrm);
++
++ enum SpacingType
++ {
++ SPACING_DYNAMIC = 0,
++ SPACING_LEADING = 1,
++ SPACING_CUSTOM = 2,
++ SPACING_NONE = 3
++ };
++
++ SpacingType GetType() const {return m_nSpacingType;};
++ sal_Int32 GetAmount() const {return m_nAmount;};
++ sal_Int32 GetMultiple() const {return m_nMultiple;};
++
++ void Override(LwpSpacingCommonOverride* other);
++ void OverrideType(SpacingType val);
++ void OverrideAmount(sal_Int32 val);
++ void OverrideMultiple(sal_Int32 val);
++
++protected:
++ enum
++ {
++ SPO_TYPE = 0x01,
++ SPO_AMOUNT = 0x02,
++ SPO_MULTIPLE= 0x04
++ };
++ SpacingType m_nSpacingType;//sal_uInt16
++ sal_Int32 m_nAmount;
++ sal_Int32 m_nMultiple;
++
++};
++
++/////////////////////////////////////////////////////////////////
++class LwpSpacingOverride : public LwpOverride
++{
++public:
++ LwpSpacingOverride();
++ LwpSpacingOverride& operator=(LwpSpacingOverride& other);
++ virtual ~LwpSpacingOverride();
++
++ void Read(LwpObjectStream* pStrm);
++
++ void Override(LwpSpacingOverride* other);
++
++ LwpSpacingCommonOverride* GetSpacing(){return m_pSpacing;};
++ LwpSpacingCommonOverride* GetAboveLineSpacing(){return m_pAboveLineSpacing;};
++ LwpSpacingCommonOverride* GetAboveSpacing(){return m_pParaSpacingAbove;};
++ LwpSpacingCommonOverride* GetBelowSpacing(){return m_pParaSpacingBelow;};
++private:
++ LwpSpacingCommonOverride* m_pSpacing;
++ LwpSpacingCommonOverride* m_pAboveLineSpacing;
++ LwpSpacingCommonOverride* m_pParaSpacingAbove;
++ LwpSpacingCommonOverride* m_pParaSpacingBelow;
++};
++
++/////////////////////////////////////////////////////////////////
++class LwpIndentOverride : public LwpOverride
++{
++public:
++ LwpIndentOverride() : m_nAll(0), m_nFirst(0), m_nRest(0), m_nRight(0) {};
++ LwpIndentOverride& operator=(LwpIndentOverride& other);
++ void Read(LwpObjectStream* pStrm);
++
++ enum
++ {
++ RELATIVE_FIRST, RELATIVE_REST, RELATIVE_ALL
++ };
++
++ inline double GetFirst() const;
++ inline double GetLeft() const;
++ inline double GetRight() const;
++
++ sal_uInt16 GetRelative();
++ sal_Bool IsUseRelative();
++ void Override(LwpIndentOverride* other);
++ void OverrideIndentAll(sal_Int32 val);
++ void OverrideIndentFirst(sal_Int32 val);
++ void OverrideIndentRight(sal_Int32 val);
++ void OverrideIndentRest(sal_Int32 val);
++ void OverrideUseRelative(sal_Bool use);
++ void OverrideRelative(sal_uInt16 relative);
++ sal_Int32 GetMAll() const {return m_nAll;}
++ sal_Int32 GetMFirst() const {return m_nFirst;}
++ sal_Int32 GetMRest() const {return m_nRest;}
++ sal_Int32 GetMRight() const {return m_nRight;}
++ void SetMAll(sal_Int32 val){m_nAll=val;}
++ void SetMFirst(sal_Int32 val){m_nFirst=val;}
++ void SetMRest(sal_Int32 val){m_nRest=val;}
++ void SetMRight(sal_Int32 val){m_nRight=val;}
++private:
++ enum
++ {
++ IO_ALL = 0x0001,
++ IO_FIRST = 0x0002,
++ IO_REST = 0x0004,
++ IO_RIGHT = 0x0008,
++ IO_HANGING = 0x0010,
++ IO_EQUAL = 0x0020,
++ IO_BODY = 0x0040,
++ IO_REL_ALL = 0x0080,
++ IO_REL_FIRST = 0x0100,
++ IO_REL_REST = 0x0200,
++ IO_REL_FLAGS = (IO_REL_ALL | IO_REL_FIRST | IO_REL_REST),
++#ifdef JAPANESE_ENABLED // 96/4/8 ueda for indentation by char width
++ IO_USE_RELATIVE = 0x0400,
++ IO_CHARUNIT = 0x0800
++#else
++ IO_USE_RELATIVE = 0x0400
++#endif
++ };
++
++ sal_Int32 m_nAll;
++ sal_Int32 m_nFirst;
++ sal_Int32 m_nRest;
++ sal_Int32 m_nRight;
++};
++inline double LwpIndentOverride::GetFirst() const
++{
++ return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nFirst-m_nRest));
++}
++inline double LwpIndentOverride::GetLeft() const
++{
++ return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nAll+m_nRest));
++}
++inline double LwpIndentOverride::GetRight() const
++{
++ return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nRight));
++}
++
++/////////////////////////////////////////////////////////////////
++class LwpBackgroundStuff;
++class LwpAmikakeOverride : public LwpOverride
++{
++public:
++ LwpAmikakeOverride();
++
++ virtual ~LwpAmikakeOverride();
++
++ void Read(LwpObjectStream* pStrm);
++ enum
++ {
++ AMIKAKE_NONE = 0,
++ AMIKAKE_BACKGROUND = 1,
++ AMIKAKE_CHARACTER = 2
++ };
++
++private:
++ LwpBackgroundStuff* m_pBackgroundStuff;
++ sal_uInt16 m_nType;
++
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwppagehint.cxx lotuswordpro/source/filter/lwppagehint.cxx
+--- lotuswordpro.bak/source/filter/lwppagehint.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwppagehint.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,119 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Feb 2005 Created
++ ************************************************************************/
++
++#include "lwppagehint.hxx"
++
++
++void LwpSLVListHead::Read(LwpObjectStream* pObjStrm)
++{
++ m_ListHead.ReadIndexed(pObjStrm);
++ pObjStrm->SkipExtra();
++}
++
++void LwpContentHintHead::Read(LwpObjectStream* pObjStrm)
++{
++ m_ListHead.Read(pObjStrm);
++ pObjStrm->SkipExtra();
++}
++
++void LwpFootnoteSeenHead::Read(LwpObjectStream* pObjStrm)
++{
++ m_ListHead.Read(pObjStrm);
++ pObjStrm->SkipExtra();
++}
++
++LwpPageHint::LwpPageHint(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ :LwpDLVList(objHdr,pStrm)
++{
++}
++
++void LwpPageHint::Read()
++{
++ LwpDLVList::Read();
++
++ m_PageLayout.ReadIndexed(m_pObjStrm);
++ //m_ContentHints.ReadIndexed(m_pObjStrm);
++ m_ContentHints.Read(m_pObjStrm);
++ m_pObjStrm->QuickRead(&m_nLastFootnoteSeen,sizeof(m_nLastFootnoteSeen));
++ m_pObjStrm->QuickRead(&m_nLastFootnoteProcessed,sizeof(m_nLastFootnoteProcessed));
++ m_pObjStrm->QuickRead(&m_nFlags,sizeof(m_nFlags));
++ m_pObjStrm->QuickRead(&m_nPageNumber,sizeof(m_nPageNumber));
++ m_pObjStrm->QuickRead(&m_nNumberStyle,sizeof(m_nNumberStyle));
++ m_BeforeText.Read(m_pObjStrm);
++ m_AfterText.Read(m_pObjStrm);
++ m_pObjStrm->QuickRead(&m_nNumberFlags,sizeof(m_nNumberFlags));
++ m_pObjStrm->QuickRead(&m_nRenderedPageNumber,sizeof(m_nRenderedPageNumber));
++ m_CurrentSection.ReadIndexed(m_pObjStrm);
++ m_pObjStrm->QuickRead(&m_nCurrentSectionPage,sizeof(m_nCurrentSectionPage));
++ //m_FootnoteSeen.ReadIndexed(m_pObjStrm);
++ m_FootnoteSeen.Read(m_pObjStrm);
++ m_pObjStrm->QuickRead(&m_nLayoutPageNumber,sizeof(m_nLayoutPageNumber));
++
++ m_pObjStrm->SkipExtra();
++}
++
++void LwpPageHint::Parse(IXFStream *pOutputStream)
++{
++}
++
++
+diff -urNp lotuswordpro.bak/source/filter/lwppagehint.hxx lotuswordpro/source/filter/lwppagehint.hxx
+--- lotuswordpro.bak/source/filter/lwppagehint.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwppagehint.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,129 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Feb 2005 Created
++ ************************************************************************/
++#ifndef _LWPPAGEHINT_HXX
++#define _LWPPAGEHINT_HXX
++
++#include "lwpobj.hxx"
++#include "lwpobjid.hxx"
++#include "lwpatomholder.hxx"
++#include "lwpdlvlist.hxx"
++
++class LwpSLVListHead
++{
++public:
++ LwpSLVListHead(){};
++ void Read(LwpObjectStream* pObjStrm);
++private:
++ LwpObjectID m_ListHead;
++};
++
++class LwpContentHintHead
++{
++public:
++ LwpContentHintHead(){};
++ void Read(LwpObjectStream* pObjStrm);
++private:
++ LwpSLVListHead m_ListHead;
++};
++
++class LwpFootnoteSeenHead
++{
++public:
++ LwpFootnoteSeenHead(){};
++ void Read(LwpObjectStream* pObjStrm);
++private:
++ LwpSLVListHead m_ListHead;
++};
++
++class LwpPageHint : public LwpDLVList
++{
++public:
++ LwpPageHint(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpPageHint(){};
++ void Read();
++ void Parse(IXFStream* pOutputStream);
++ sal_uInt16 GetPageNumber(){return m_nPageNumber;}
++ LwpObjectID* GetCurrentSectionID(){return &m_CurrentSection;}
++ sal_uInt16 GetCurrentSectionPage(){return m_nCurrentSectionPage;}
++ LwpObjectID* GetPageLayoutID(){ return &m_PageLayout;}
++ sal_uInt16 GetLayoutPageNumber(){ return m_nLayoutPageNumber;}
++private:
++
++ LwpObjectID m_PageLayout;
++ LwpContentHintHead m_ContentHints;
++ sal_uInt16 m_nLastFootnoteSeen;
++ sal_uInt16 m_nLastFootnoteProcessed;
++ sal_uInt16 m_nFlags;
++ sal_uInt16 m_nPageNumber;
++ sal_uInt16 m_nNumberStyle;
++ LwpAtomHolder m_BeforeText;
++ LwpAtomHolder m_AfterText;
++ sal_uInt8 m_nNumberFlags;
++ sal_uInt16 m_nRenderedPageNumber;
++ LwpObjectID m_CurrentSection;
++ sal_uInt16 m_nCurrentSectionPage;
++ LwpFootnoteSeenHead m_FootnoteSeen;
++ sal_uInt16 m_nLayoutPageNumber;
++};
++
++#endif //
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwppagelayout.cxx lotuswordpro/source/filter/lwppagelayout.cxx
+--- lotuswordpro.bak/source/filter/lwppagelayout.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwppagelayout.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,1061 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++Mar 2005 Created
++ ************************************************************************/
++#include "lwppagelayout.hxx"
++#include "lwplaypiece.hxx"
++#include "lwpfootnote.hxx"
++#include "lwpdoc.hxx"
++#include "lwpholder.hxx"
++#include "lwppagehint.hxx"
++#include "lwpdivinfo.hxx"
++#include "lwpstory.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xfmasterpage.hxx"
++#include "xfilter/xfcontentcontainer.hxx"
++#include "xfilter/xfheader.hxx"
++#include "xfilter/xfheaderstyle.hxx"
++#include "xfilter/xffooterstyle.hxx"
++#include "xfilter/xffooter.hxx"
++#include <sfx2/printer.hxx>
++#include "lwpchangemgr.hxx"
++#include "lwpglobalmgr.hxx"
++
++LwpPageLayout::LwpPageLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpLayout(objHdr, pStrm), m_pPrinterBinName(new LwpAtomHolder),
++ m_pPaperName(new LwpAtomHolder),m_pXFPageMaster(NULL)
++{
++}
++
++LwpPageLayout::~LwpPageLayout()
++{
++ if (m_pPrinterBinName)
++ {
++ delete m_pPrinterBinName;
++ }
++ if (m_pPaperName)
++ {
++ delete m_pPaperName;
++ }
++}
++void LwpPageLayout::Read()
++{
++ LwpLayout::Read();
++
++ if (LwpFileHeader::m_nFileRevision < 0x000B)
++ {
++ // read PreRevBLayout...
++ }
++
++ m_pObjStrm->QuickRead(&m_nPrinterBin, sizeof(m_nPrinterBin));
++ m_pPrinterBinName->Read(m_pObjStrm);
++
++ if (LwpFileHeader::m_nFileRevision >= 0x000B)
++ {
++ m_pObjStrm->QuickRead(&m_nBdroffset, sizeof(m_nBdroffset));
++ }
++
++ if (m_pObjStrm->CheckExtra())
++ {
++ m_pPaperName->Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++ }
++
++}
++
++void LwpPageLayout::Parse(IXFStream* pOutputStream)
++{
++ //Only parse this layout
++ LwpObject* pStory = m_Content.obj();
++ if(pStory)
++ {
++ pStory->SetFoundry(m_pFoundry);
++ pStory->Parse(pOutputStream); //Do not parse the next story
++ }
++}
++
++/**
++* @descr: set page margins
++*
++*/
++void LwpPageLayout::ParseMargins(XFPageMaster* pm1)
++{
++ double fLeft = GetMarginsValue(MARGIN_LEFT);
++ double fRight = GetMarginsValue(MARGIN_RIGHT);
++ double fTop = GetMarginsValue(MARGIN_TOP);
++ double fBottom = GetMarginsValue(MARGIN_BOTTOM);
++
++ pm1->SetMargins( fLeft, fRight, fTop, fBottom );
++
++}
++
++/**
++* @descr: set page height and width
++*
++*/
++void LwpPageLayout::ParseGeometry(XFPageMaster* pm1)
++{
++ /*
++ LwpLayoutGeometry* pLayoutGeo = GetGeometry();
++ if(pLayoutGeo)
++ {
++ pm1->SetPageHeight( GetGeometryHeight() );
++ pm1->SetPageWidth( GetGeometryWidth() );
++ }
++ */
++ double fWidth =0;
++ double fHeight = 0;
++ GetWidthAndHeight(fWidth, fHeight);
++ pm1->SetPageWidth( fWidth );
++ pm1->SetPageHeight( fHeight );
++}
++
++/**
++* @descr: set page watermark
++*
++*/
++void LwpPageLayout::ParseWaterMark(XFPageMaster *pm1)
++{
++ XFBGImage* pXFBGImage = GetXFBGImage();
++ if(pXFBGImage)
++ {
++ pm1->SetBackImage(pXFBGImage);
++ }
++}
++
++/**
++* @descr: set page columns
++*
++*/
++void LwpPageLayout::ParseColumns(XFPageMaster * pm1)
++{
++ XFColumns* pColumns = GetXFColumns();
++ if(pColumns)
++ {
++ pm1->SetColumns(pColumns);
++ }
++}
++
++/**
++* @descr: set page borders
++*
++*/
++void LwpPageLayout::ParseBorders(XFPageMaster *pm1)
++{
++ XFBorders* pBordres = GetXFBorders();
++ if(pBordres)
++ {
++ pm1->SetBorders(pBordres);
++ }
++}
++
++
++/**
++* @descr: set page shadow
++*
++*/
++void LwpPageLayout::ParseShadow(XFPageMaster *pm1)
++{
++ XFShadow* pXFShadow = GetXFShadow();
++ if(pXFShadow)
++ {
++ pm1->SetShadow(pXFShadow);
++ }
++}
++
++/**
++* @descr: set page back pattern
++*
++*/
++void LwpPageLayout::ParsePatternFill(XFPageMaster* pm1)
++{
++ XFBGImage* pXFBGImage = this->GetFillPattern();
++ if (pXFBGImage)
++ {
++ pm1->SetBackImage(pXFBGImage);
++ }
++}
++/**
++* @descr: set page background
++*
++*/
++void LwpPageLayout::ParseBackGround(XFPageMaster* pm1)
++{
++ if (this->IsPatternFill())
++ {
++ ParsePatternFill(pm1);
++ }
++ else
++ {
++ ParseBackColor(pm1);
++ }
++}
++
++/**
++* @descr: set page back color
++*
++*/
++void LwpPageLayout::ParseBackColor(XFPageMaster* pm1)
++{
++ LwpColor* pColor = GetBackColor();
++ if(pColor)
++ {
++ pm1->SetBackColor(XFColor(pColor->To24Color()));
++ }
++}
++
++/**
++* @descr: set page footnote separator information
++*
++*/
++void LwpPageLayout::ParseFootNoteSeparator(XFPageMaster * pm1)
++{
++ //Get the footnoteoptions for the root document
++ LwpDocument* pDocument = m_pFoundry->GetDocument();
++ if(pDocument)
++ {
++ LwpFootnoteOptions* pFootnoteOpts = static_cast<LwpFootnoteOptions*>(pDocument->GetValidFootnoteOpts()->obj());
++ if(pFootnoteOpts)
++ {
++ LwpFootnoteSeparatorOptions* pFootnoteSep = pFootnoteOpts->GetFootnoteSeparator();
++ //set length
++ sal_uInt32 nLengthPercent = 100;
++ double fWidth = 0;
++ if(pFootnoteSep->HasSeparator())
++ {
++ fWidth = pFootnoteSep->GetTopBorderWidth();
++ }
++ if(pFootnoteSep->HasCustomLength())
++ {
++ nLengthPercent = static_cast<sal_uInt32>(100*LwpTools::ConvertFromUnitsToMetric(pFootnoteSep->GetLength())/GetMarginWidth());
++ if(nLengthPercent > 100)
++ nLengthPercent = 100;
++ }
++ double fAbove = LwpTools::ConvertFromUnitsToMetric(pFootnoteSep->GetAbove());
++ double fBelow = LwpTools::ConvertFromUnitsToMetric(pFootnoteSep->GetBelow());
++ LwpColor aColor = pFootnoteSep->GetTopBorderColor();
++ enumXFAlignType eAlignType = enumXFAlignStart;
++ if(pFootnoteSep->GetIndent() > 0)
++ {
++ //SODC don't support indent
++ sal_uInt32 nIndentPercent = static_cast<sal_uInt32>(100*LwpTools::ConvertFromUnitsToMetric(pFootnoteSep->GetIndent())/GetMarginWidth());
++ if(nIndentPercent + nLengthPercent >= 100)
++ eAlignType = enumXFAlignEnd;
++ }
++ if(aColor.IsValidColor())
++ {
++ XFColor aXFColor(aColor.To24Color());
++ pm1->SetFootNoteSeparator(eAlignType,fWidth, nLengthPercent, fAbove, fBelow, aXFColor);
++ }
++ }
++ }
++}
++
++/**
++* @descr: Register master page and page master style
++*
++*/
++void LwpPageLayout::RegisterStyle()
++{
++ XFPageMaster* pm1 = new XFPageMaster();
++ m_pXFPageMaster = pm1;
++
++ ParseGeometry( pm1 );
++ //Does not process LayoutScale, for watermark is not supported in SODC.
++ ParseWaterMark( pm1);
++ ParseMargins( pm1);
++ ParseColumns(pm1);
++ ParseBorders(pm1);
++ ParseShadow(pm1);
++// ParseBackColor(pm1);
++ ParseBackGround(pm1);
++ ParseFootNoteSeparator(pm1);
++ pm1->SetTextDir(GetTextDirection());
++
++ LwpUseWhen* pUseWhen = GetUseWhen();
++ if(IsComplex() ||( pUseWhen && pUseWhen->IsUseOnAllOddPages()))
++ {
++ pm1->SetPageUsage(enumXFPageUsageMirror);
++ }
++
++ //Add the page master to stylemanager
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ OUString pmname = pXFStyleManager->AddStyle(pm1)->GetStyleName();
++
++ //Add master page
++ XFMasterPage* mp1 = new XFMasterPage();
++ mp1->SetStyleName(GetName()->str());
++ mp1->SetPageMaster(pmname);
++ m_StyleName = pXFStyleManager->AddStyle(mp1)->GetStyleName();
++
++ //Set footer style
++ LwpFooterLayout* pLayoutFooter = GetFooterLayout();
++ if(pLayoutFooter)
++ {
++ pLayoutFooter->SetFoundry(m_pFoundry);
++ pLayoutFooter->RegisterStyle(pm1);
++ pLayoutFooter->RegisterStyle(mp1);
++ }
++
++ //Set header style
++ LwpHeaderLayout* pLayoutHeader = GetHeaderLayout();
++ if(pLayoutHeader)
++ {
++ pLayoutHeader->SetFoundry(m_pFoundry);
++ pLayoutHeader->RegisterStyle(pm1);
++ pLayoutHeader->RegisterStyle(mp1);
++ }
++ //register child layout style for mirror page and frame
++ RegisterChildStyle();
++}
++
++/**
++* @descr: Register master page for endnote which name is "endnote"
++* @return: Return the master page name.
++*/
++OUString LwpPageLayout::RegisterEndnoteStyle()
++{
++ XFPageMaster* pm1 = new XFPageMaster();
++ m_pXFPageMaster = pm1;
++
++ ParseGeometry( pm1 );
++ ParseWaterMark( pm1);
++ ParseMargins( pm1);
++ ParseColumns(pm1);
++ ParseBorders(pm1);
++ ParseShadow(pm1);
++// ParseBackColor(pm1);
++ ParseBackGround(pm1);
++ //ParseFootNoteSeparator(pm1);
++ pm1->SetTextDir(GetTextDirection());
++
++ LwpUseWhen* pUseWhen = GetUseWhen();
++ if(IsComplex() ||( pUseWhen && pUseWhen->IsUseOnAllOddPages()))
++ {
++ pm1->SetPageUsage(enumXFPageUsageMirror);
++ }
++
++ //Add the page master to stylemanager
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ OUString pmname = pXFStyleManager->AddStyle(pm1)->GetStyleName();
++
++ //Add master page
++ XFMasterPage* mp1 = new XFMasterPage();
++ mp1->SetStyleName(A2OUSTR("Endnote"));
++ mp1->SetPageMaster(pmname);
++
++ //Set footer style
++ LwpFooterLayout* pLayoutFooter = GetFooterLayout();
++ if(pLayoutFooter)
++ {
++ pLayoutFooter->SetFoundry(m_pFoundry);
++ pLayoutFooter->RegisterStyle(pm1);
++ pLayoutFooter->RegisterStyle(mp1);
++ }
++
++ //Set header style
++ LwpHeaderLayout* pLayoutHeader = GetHeaderLayout();
++ if(pLayoutHeader)
++ {
++ pLayoutHeader->SetFoundry(m_pFoundry);
++ pLayoutHeader->RegisterStyle(pm1);
++ pLayoutHeader->RegisterStyle(mp1);
++ }
++
++ return pXFStyleManager->AddStyle(mp1)->GetStyleName();
++}
++/**
++* @descr: Whether current page layout has columns
++*
++*/
++sal_Bool LwpPageLayout::HasColumns()
++{
++ return GetNumCols() > 1 ? sal_True : sal_False;
++}
++
++/**
++* @descr: Whether has filler page text in current page layout
++*
++*/
++sal_Bool LwpPageLayout::HasFillerPageText(LwpFoundry* pFoundry)
++{
++ if(!pFoundry) return sal_False;
++
++ sal_Bool bFillerPage = sal_False;
++ LwpLayout::UseWhenType eWhenType = GetUseWhenType();
++ if(eWhenType==LwpLayout::StartOnOddPage||eWhenType==LwpLayout::StartOnEvenPage)
++ {
++ //get pagenumber
++ sal_uInt16 nPageNumber = 0;
++
++ //get the page number that current page layout inserted
++ nPageNumber = GetPageNumber(FIRST_LAYOUTPAGENO)-1;
++
++ if(nPageNumber>0)
++ {
++ if((eWhenType==LwpLayout::StartOnOddPage)&&(LwpTools::IsOddNumber(nPageNumber)))
++ {
++ bFillerPage = sal_True;
++ }
++ else if((eWhenType==LwpLayout::StartOnEvenPage)&&(LwpTools::IsEvenNumber(nPageNumber)))
++ {
++ bFillerPage = sal_True;
++ }
++ else
++ {
++ bFillerPage = sal_False;
++ }
++ }
++ }
++
++ return bFillerPage;
++}
++
++/**
++* @descr: Parse filler page text
++*
++*/
++void LwpPageLayout::ConvertFillerPageText(XFContentContainer* pCont)
++{
++ if(HasFillerPageText(m_pFoundry))
++ {
++ //get filerpage story from division info
++ LwpDocument* pDoc = m_pFoundry->GetDocument();
++ LwpDivInfo* pDivInfo = static_cast<LwpDivInfo*>(pDoc->GetDivInfoID()->obj());
++ LwpStory* pStory = static_cast<LwpStory*>(pDivInfo->GetFillerPageTextID()->obj());
++
++ //parse fillerpage story
++ if(pStory)
++ {
++ pStory->XFConvert(pCont);
++ }
++ }
++}
++/**
++* @descr: Clear columns style in page layout
++*
++*/
++void LwpPageLayout::ResetXFColumns()
++{
++ if(m_pXFPageMaster)
++ {
++ m_pXFPageMaster->SetColumns(NULL);
++ }
++}
++
++LwpHeaderLayout* LwpPageLayout::GetHeaderLayout()
++{
++ LwpVirtualLayout* pLay = static_cast<LwpVirtualLayout*>(GetChildHead()->obj());
++ while(pLay)
++ {
++ if( pLay->GetLayoutType() == LWP_HEADER_LAYOUT )
++ return ( static_cast<LwpHeaderLayout*> (pLay) );
++ pLay = static_cast<LwpVirtualLayout*> (pLay->GetNext()->obj());
++ }
++ return NULL;
++}
++
++LwpFooterLayout* LwpPageLayout::GetFooterLayout()
++{
++ LwpVirtualLayout* pLay = static_cast<LwpVirtualLayout*>(GetChildHead()->obj());
++ while(pLay)
++ {
++ if( pLay->GetLayoutType() == LWP_FOOTER_LAYOUT )
++ return ( static_cast<LwpFooterLayout*> (pLay) );
++ pLay = static_cast<LwpVirtualLayout*> (pLay->GetNext()->obj());
++ }
++ return NULL;
++}
++
++/**
++* @descr: Get the odd layout if current page layout is mirror page
++*
++*/
++LwpPageLayout* LwpPageLayout::GetOddChildLayout()
++{
++ if(IsComplex())
++ {
++ LwpVirtualLayout* pLay = static_cast<LwpVirtualLayout*>(GetChildHead()->obj());
++ while(pLay)
++ {
++ if( pLay->GetLayoutType() == LWP_PAGE_LAYOUT )
++ {
++ LwpPageLayout* pPageLayout = static_cast<LwpPageLayout*> (pLay);
++ LwpUseWhen* pUseWhen = pPageLayout->GetUseWhen();
++ if(pUseWhen && pUseWhen->IsUseOnAllOddPages())
++ {
++ return pPageLayout;
++ }
++ }
++ pLay = static_cast<LwpVirtualLayout*> (pLay->GetNext()->obj());
++ }
++ }
++ return NULL;
++}
++
++/**
++* @descr: Get margin width of page
++*
++*/
++double LwpPageLayout::GetMarginWidth()
++{
++ double fPagewidth = GetGeometryWidth();
++ double fLeftMargin = GetMarginsValue(MARGIN_LEFT);
++ double fRightMargin = GetMarginsValue(MARGIN_RIGHT);
++
++ return fPagewidth - (fLeftMargin + fRightMargin);
++}
++
++/**
++ * @descr: Get the pagenumber
++ * @param: if nLayoutNumber =FIRST_LAYOUTPAGENO, return the first page number that current page layout covers
++ =LAST_LAYOUTPAGENO, return the last page number that current page layout covers
++ else, return the specified page number that current page layout covers
++ * @param:
++ * @return: if reture value >=0, success to find the page number, or fail.
++*/
++sal_Int32 LwpPageLayout::GetPageNumber(sal_uInt16 nLayoutNumber)
++{
++ sal_Int16 nPageNumber = -1;
++ LwpFoundry* pFoundry = this->GetFoundry();
++ LwpDocument* pDoc = pFoundry->GetDocument();
++ LwpDLVListHeadTailHolder* pHeadTail = static_cast<LwpDLVListHeadTailHolder*>(pDoc->GetPageHintsID()->obj());
++ if(!pHeadTail) return nPageNumber;
++
++ //get first pagehint
++ LwpPageHint* pPageHint =static_cast<LwpPageHint*>(pHeadTail->GetHead()->obj());
++ while(pPageHint)
++ {
++ if(*(this->GetObjectID()) == *(pPageHint->GetPageLayoutID()))
++ {
++ sal_uInt16 nNumber = pPageHint->GetPageNumber();
++ if(nLayoutNumber==FIRST_LAYOUTPAGENO && pPageHint->GetLayoutPageNumber()==1)
++ {
++ //get the first page number
++ nPageNumber = nNumber;
++ break;
++ }
++ else if( nLayoutNumber ==LAST_LAYOUTPAGENO && nNumber >nPageNumber )
++ {
++ //get the last page number
++ nPageNumber = nNumber;
++ if(pPageHint->GetNext()->IsNull())
++ {
++ //if is last page number of entire document, reture directly
++ return nPageNumber + pDoc->GetNumberOfPagesBefore();
++ }
++ }
++ else if(nLayoutNumber > 0 && pPageHint->GetLayoutPageNumber() == nLayoutNumber)
++ {
++ //get specified page number
++ nPageNumber = nNumber;
++ break;
++ }
++
++ }
++ pPageHint = static_cast<LwpPageHint*>(pPageHint->GetNext()->obj());
++ }
++ if(nPageNumber>=0)
++ {
++ return nPageNumber + 1 + pDoc->GetNumberOfPagesBefore();
++ }
++ return -1;
++}
++
++/**
++* @descr: Get page width and height
++*
++*/
++void LwpPageLayout::GetWidthAndHeight(double& fWidth, double& fHeight)
++{
++ //use customized size
++ LwpLayoutGeometry* pLayoutGeo = GetGeometry();
++ if(pLayoutGeo)
++ {
++ fWidth = GetGeometryWidth();
++ fHeight = GetGeometryHeight();
++ }
++
++ if(GetUsePrinterSettings())
++ {
++ //replaced by printer paper size
++ Printer aPrinter;
++ sal_Bool bScreen = aPrinter.IsDisplayPrinter();
++ if (!bScreen)//Printer available
++ {
++ Size aPaperSize = aPrinter.GetPaperSize();
++ aPaperSize = aPrinter.PixelToLogic( aPaperSize, MapMode( MAP_10TH_MM ) );
++ fWidth = static_cast<double>(aPaperSize.Width())/100; //cm unit
++ fHeight = static_cast<double>(aPaperSize.Height())/100;
++ }
++ }
++
++ //Follow the former design of Lotus WordPro filter, some default will be given:
++ //Page Width: 8.5 Inch -> 21.59 cm
++ //Page Height: 11 Inch -> 27.94 cm
++ if (fWidth < 4.39)
++ fWidth = 21.59;
++ if (fHeight < 4.49)
++ fHeight = 27.94;
++ //End of modification, by ZF
++}
++
++/**
++* @descr: Get page width
++*
++*/
++double LwpPageLayout::GetWidth()
++{
++ double fWidth =0, fHeight = 0;
++ GetWidthAndHeight(fWidth, fHeight);
++ return fWidth;
++}
++
++/**
++* @descr: Get page height
++*
++*/
++double LwpPageLayout::GetHeight()
++{
++ double fWidth =0, fHeight = 0;
++ GetWidthAndHeight(fWidth, fHeight);
++ return fHeight;
++}
++/**
++* @descr: Compare the position of layout. If the poistion of this layout is earlier than other layout,return ture, or return false
++*
++*/
++sal_Bool LwpPageLayout::operator<(LwpPageLayout& Other)
++{
++ LwpPara* pThisPara = GetPagePosition();
++ LwpPara* pOtherPara = Other.GetPagePosition();
++ if(pThisPara && pOtherPara)
++ {
++ if(pThisPara == pOtherPara)
++ {
++ //If the two layouts in the same para, compare which layout is earlied according to frib order
++ return pThisPara->ComparePagePosition(this, &Other);
++ }
++ else
++ {
++ return *pThisPara < *pOtherPara;
++ }
++ }
++
++ if(!pThisPara)
++ return sal_True;
++
++ return sal_False;
++}
++
++/**
++* @descr: Get the position of pagelayout
++*
++*/
++LwpPara* LwpPageLayout::GetPagePosition()
++{
++ LwpPara* pPara = static_cast<LwpPara*>(GetPosition()->obj());
++ if(pPara)
++ return pPara;
++ //Get the position from its related section
++ LwpSection* pSection = NULL;
++ LwpFoundry* pFoundry = GetFoundry();
++ if(pFoundry)
++ {
++ while(pSection = pFoundry->EnumSections(pSection))
++ {
++ if(pSection->GetPageLayout() == this)
++ return static_cast<LwpPara*>(pSection->GetPosition()->obj());
++ }
++ }
++
++ return NULL;
++}
++LwpHeaderLayout::LwpHeaderLayout( LwpObjectHeader &objHdr, LwpSvStream* pStrm )
++ : LwpPlacableLayout(objHdr, pStrm)
++{
++}
++
++LwpHeaderLayout::~LwpHeaderLayout()
++{
++}
++
++void LwpHeaderLayout::Read()
++{
++ LwpPlacableLayout::Read();
++
++ if(LwpFileHeader::m_nFileRevision >= 0x000E)
++ {
++ m_pObjStrm->QuickRead(&m_nBorderOffset, sizeof(m_nBorderOffset));
++ }
++ else
++ m_nBorderOffset = 0;
++ m_pObjStrm->SkipExtra();
++}
++
++
++void LwpHeaderLayout::RegisterStyle(XFPageMaster* pm1)
++{
++ XFHeaderStyle* pHeaderStyle = new XFHeaderStyle();
++
++ //Modify page top margin
++ //page top maring: from top of header to the top edge
++ double top = GetMarginsValue(MARGIN_TOP);
++ pm1->SetMargins(-1, -1, top, -1);
++
++ ParseMargins(pHeaderStyle);
++ ParseBorder(pHeaderStyle);
++ ParseShadow(pHeaderStyle);
++// ParseBackColor(pHeaderStyle);
++ ParseBackGround(pHeaderStyle);
++
++ ParseWaterMark(pHeaderStyle);
++ //End by
++
++ pm1->SetHeaderStyle(pHeaderStyle);
++}
++
++void LwpHeaderLayout::ParseMargins(XFHeaderStyle* ph1)
++{
++ //Set height: from top of header to top of body, including the spacing between header and body
++ double height = GetGeometryHeight()- GetMarginsValue(MARGIN_TOP);
++ if( IsAutoGrowDown() )
++ {
++ ph1->SetMinHeight(height);
++ }
++ else
++ {
++ ph1->SetHeight(height);
++ }
++
++ //Set left,right,bottom margins
++ LwpMiddleLayout* parent = static_cast<LwpMiddleLayout*> (GetParent()->obj());
++ //left margin in SODC: the space from the left edge of body to the left edge of header
++ double left = GetMarginsValue(MARGIN_LEFT) - parent->GetMarginsValue(MARGIN_LEFT);
++ if(left<=0) //The left margin in SODC can not be minus value
++ {
++ left = -1;
++ }
++ //left margin in SODC: the space from the right edge of header to the right edge of body
++ double right = GetMarginsValue(MARGIN_RIGHT) - parent->GetMarginsValue(MARGIN_RIGHT);
++ if(right<=0)//The right margin in SODC can not be minus value
++ {
++ right = -1;
++ }
++ ph1->SetMargins( left, right, GetMarginsValue(MARGIN_BOTTOM));
++
++ //Word Pro has no dynamic spacing, should be set to false
++ ph1->SetDynamicSpace(sal_False);
++}
++
++void LwpHeaderLayout::ParseBorder(XFHeaderStyle* pHeaderStyle)
++{
++ XFBorders* pBordres = GetXFBorders();
++ if(pBordres)
++ {
++ pHeaderStyle->SetBorders(pBordres);
++ }
++}
++
++void LwpHeaderLayout::ParseShadow(XFHeaderStyle* pHeaderStyle)
++{
++ XFShadow* pXFShadow = GetXFShadow();
++ if(pXFShadow)
++ {
++ pHeaderStyle->SetShadow(pXFShadow);
++ }
++}
++
++/**
++* @descr: set header back pattern
++*
++*/
++void LwpHeaderLayout::ParsePatternFill(XFHeaderStyle* pHeaderStyle)
++{
++ XFBGImage* pXFBGImage = this->GetFillPattern();
++ if (pXFBGImage)
++ {
++ pHeaderStyle->SetBackImage(pXFBGImage);
++ }
++}
++/**
++* @descr: set header background
++*
++*/
++void LwpHeaderLayout::ParseBackGround(XFHeaderStyle* pHeaderStyle)
++{
++ if (this->IsPatternFill())
++ {
++ ParsePatternFill(pHeaderStyle);
++ }
++ else
++ {
++ ParseBackColor(pHeaderStyle);
++ }
++}
++
++void LwpHeaderLayout::ParseBackColor(XFHeaderStyle* pHeaderStyle)
++{
++ LwpColor* pColor = GetBackColor();
++ if(pColor)
++ {
++ pHeaderStyle->SetBackColor(XFColor(pColor->To24Color()));
++ }
++}
++
++
++void LwpHeaderLayout::ParseWaterMark(XFHeaderStyle * pHeaderStyle)
++{
++ XFBGImage* pXFBGImage = GetXFBGImage();
++ if(pXFBGImage)
++ {
++ pHeaderStyle->SetBackImage(pXFBGImage);
++ }
++}
++//End by
++
++void LwpHeaderLayout::RegisterStyle(XFMasterPage* mp1)
++{
++ XFHeader* pHeader = new XFHeader();
++ LwpObject* pStory = m_Content.obj();
++ if(pStory)
++ {
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ LwpChangeMgr* pChangeMgr = pGlobal->GetLwpChangeMgr();
++ pChangeMgr->SetHeadFootFribMap(sal_True);
++
++ //Call the RegisterStyle first to register the styles in header paras, and then XFConvert()
++ pStory->SetFoundry(m_pFoundry);
++ pStory->RegisterStyle();
++ //, 06/27/2005
++ //register child layout style for framelayout,
++ RegisterChildStyle();
++ //End
++ pChangeMgr->SetHeadFootChange(pHeader);
++ pStory->XFConvert(pHeader);
++
++ pChangeMgr->SetHeadFootFribMap(sal_False);
++ }
++ mp1->SetHeader(pHeader);
++}
++
++LwpFooterLayout::LwpFooterLayout( LwpObjectHeader &objHdr, LwpSvStream* pStrm )
++ : LwpPlacableLayout( objHdr, pStrm )
++{
++}
++
++LwpFooterLayout::~LwpFooterLayout()
++{
++}
++
++void LwpFooterLayout::Read()
++{
++ LwpPlacableLayout::Read();
++
++ if(LwpFileHeader::m_nFileRevision >= 0x000E)
++ {
++ m_pObjStrm->QuickRead(&m_nBorderOffset, sizeof(m_nBorderOffset));
++ }
++ else
++ m_nBorderOffset = 0;
++ m_pObjStrm->SkipExtra();
++}
++
++void LwpFooterLayout::RegisterStyle(XFPageMaster* pm1)
++{
++ XFFooterStyle* pFooterStyle = new XFFooterStyle();
++
++ //Modify page bottom margin
++ //page bottom maring: from bottom of footer to the bottom edge
++ double bottom = GetMarginsValue(MARGIN_BOTTOM);
++ pm1->SetMargins(-1, -1, -1, bottom);
++
++ ParseMargins(pFooterStyle);
++ ParseBorder(pFooterStyle);
++ ParseShadow(pFooterStyle);
++ ParseBackGround(pFooterStyle);
++// ParseBackColor(pFooterStyle);
++
++ ParseWaterMark(pFooterStyle);
++ //End by
++
++ pm1->SetFooterStyle(pFooterStyle);
++}
++
++void LwpFooterLayout::ParseMargins(XFFooterStyle* pFooterStyle)
++{
++
++ //Set height: from top of header to top of body, including the spacing between header and body
++ double height = GetGeometryHeight() - GetMarginsValue(MARGIN_BOTTOM);
++ if( IsAutoGrowUp() )
++ {
++ pFooterStyle->SetMinHeight(height);
++ }
++ else
++ {
++ pFooterStyle->SetHeight(height);
++ }
++
++ //Set left,right,top margins
++ LwpMiddleLayout* parent = static_cast<LwpMiddleLayout*> (GetParent()->obj());
++ double left = GetMarginsValue(MARGIN_LEFT) - parent->GetMarginsValue(MARGIN_LEFT);
++ if(left<=0) //The left margin in SODC can not be minus value
++ {
++ left = -1;
++ }
++ double right = GetMarginsValue(MARGIN_RIGHT) - parent->GetMarginsValue(MARGIN_RIGHT);
++ if(right<=0)//The left margin in SODC can not be minus value
++ {
++ right = -1;
++ }
++ pFooterStyle->SetMargins( left, right, GetMarginsValue(MARGIN_TOP));
++
++ //Word Pro has no dynamic spacing, should be set to false
++ pFooterStyle->SetDynamicSpace(sal_False);
++}
++
++void LwpFooterLayout::ParseBorder(XFFooterStyle* pFooterStyle)
++{
++ XFBorders* pBordres = GetXFBorders();
++ if(pBordres)
++ {
++ pFooterStyle->SetBorders(pBordres);
++ }
++}
++
++void LwpFooterLayout::ParseShadow(XFFooterStyle* pFooterStyle)
++{
++ XFShadow* pXFShadow = GetXFShadow();
++ if(pXFShadow)
++ {
++ pFooterStyle->SetShadow(pXFShadow);
++ }
++}
++/**
++* @descr: set footer back pattern
++*
++*/
++void LwpFooterLayout::ParsePatternFill(XFFooterStyle* pFooterStyle)
++{
++ XFBGImage* pXFBGImage = this->GetFillPattern();
++ if (pXFBGImage)
++ {
++ pFooterStyle->SetBackImage(pXFBGImage);
++ }
++}
++/**
++* @descr: set footer background
++*
++*/
++void LwpFooterLayout::ParseBackGround(XFFooterStyle* pFooterStyle)
++{
++ if (this->IsPatternFill())
++ {
++ ParsePatternFill(pFooterStyle);
++ }
++ else
++ {
++ ParseBackColor(pFooterStyle);
++ }
++}
++
++void LwpFooterLayout::ParseBackColor(XFFooterStyle* pFooterStyle)
++{
++ LwpColor* pColor = GetBackColor();
++ if(pColor)
++ {
++ pFooterStyle->SetBackColor(XFColor(pColor->To24Color()));
++ }
++}
++
++void LwpFooterLayout::RegisterStyle(XFMasterPage* mp1)
++{
++ XFFooter* pFooter = new XFFooter();
++ LwpObject* pStory = m_Content.obj(VO_STORY);
++ //Call the RegisterStyle first to register the styles in footer paras, and then XFConvert()
++ if(pStory)
++ {
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ LwpChangeMgr* pChangeMgr = pGlobal->GetLwpChangeMgr();
++ pChangeMgr->SetHeadFootFribMap(sal_True);
++
++ pStory->SetFoundry(m_pFoundry);
++ pStory->RegisterStyle();
++ //, 06/27/2005
++ //register child layout style for framelayout,
++ RegisterChildStyle();
++ //End
++
++ pChangeMgr->SetHeadFootChange(pFooter);//add by ,7/6
++
++ pStory->XFConvert(pFooter);
++
++ pChangeMgr->SetHeadFootFribMap(sal_False);
++ }
++ mp1->SetFooter(pFooter);
++}
++
++
++void LwpFooterLayout::ParseWaterMark(XFFooterStyle * pFooterStyle)
++{
++ XFBGImage* pXFBGImage = GetXFBGImage();
++ if(pXFBGImage)
++ {
++ pFooterStyle->SetBackImage(pXFBGImage);
++ }
++}
++//End by
+diff -urNp lotuswordpro.bak/source/filter/lwppagelayout.hxx lotuswordpro/source/filter/lwppagelayout.hxx
+--- lotuswordpro.bak/source/filter/lwppagelayout.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwppagelayout.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,169 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++Mar 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPPAGELAYOUT_HXX
++#define _LWPPAGELAYOUT_HXX
++
++#include "lwplayout.hxx"
++
++class LwpHeaderLayout;
++class LwpFooterLayout;
++
++class LwpPageLayout: public LwpLayout
++{
++public:
++ LwpPageLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpPageLayout();
++ virtual void RegisterStyle();
++ OUString RegisterEndnoteStyle();
++ virtual void Parse(IXFStream* pOutputStream);
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_PAGE_LAYOUT;}
++protected:
++ void Read();
++ LwpHeaderLayout* GetHeaderLayout();
++ LwpFooterLayout* GetFooterLayout();
++ //void RegisterChildStyle();
++ void ParseGeometry(XFPageMaster* pm1);
++ void ParseMargins(XFPageMaster* pm1);
++ void ParseBorders(XFPageMaster* pm1);
++ // add by , 06/03/2005
++ void ParsePatternFill(XFPageMaster* pm1);
++ void ParseBackGround(XFPageMaster* pm1);
++ // end add
++ void ParseBackColor(XFPageMaster* pm1);
++ void ParseWaterMark(XFPageMaster* pm1);
++ void ParseColumns(XFPageMaster* pm1);
++ void ParseShadow(XFPageMaster* pm1);
++ void ParseFootNoteSeparator(XFPageMaster* pm1);
++ double GetMarginWidth();
++ void GetWidthAndHeight(double& fWidth, double& fHeight);
++ double GetWidth();
++ double GetHeight();
++protected:
++ LwpAtomHolder* m_pPrinterBinName;
++ sal_uInt16 m_nPrinterBin;
++ sal_Int32 m_nBdroffset;
++ LwpAtomHolder* m_pPaperName;
++ XFPageMaster* m_pXFPageMaster;
++public:
++ sal_Bool HasColumns();
++ sal_Bool HasFillerPageText(LwpFoundry* pFoundry);
++ void ConvertFillerPageText(XFContentContainer* pCont);
++ void ResetXFColumns();
++ LwpPageLayout* GetOddChildLayout();
++ virtual sal_Int32 GetPageNumber(sal_uInt16 nLayoutNumber = 0);
++ sal_Bool operator <(LwpPageLayout& Other);
++ LwpPara* GetPagePosition();
++};
++
++#include "xfilter/xfmasterpage.hxx"
++
++class LwpHeaderLayout: public LwpPlacableLayout
++{
++public:
++ LwpHeaderLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpHeaderLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_HEADER_LAYOUT;}
++ void RegisterStyle( XFPageMaster* pm1 );
++ void RegisterStyle( XFMasterPage* mp1 );
++protected:
++ void Read();
++ void ParseMargins( XFHeaderStyle* ph1 );
++ void ParseBorder( XFHeaderStyle* ph1 );
++ void ParseShadow( XFHeaderStyle* ph1 );
++ // add by , 06/03/2005
++ void ParsePatternFill(XFHeaderStyle* ph1);
++ void ParseBackGround(XFHeaderStyle* ph1);
++ // end add
++ void ParseBackColor(XFHeaderStyle* ph1);
++
++ void ParseWaterMark(XFHeaderStyle* ph1);
++ //End by
++private:
++ sal_Int32 m_nBorderOffset;
++};
++
++class LwpFooterLayout: public LwpPlacableLayout
++{
++public:
++ LwpFooterLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpFooterLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_FOOTER_LAYOUT;}
++ void RegisterStyle(XFPageMaster* pm1);
++ void RegisterStyle(XFMasterPage* mp1);
++protected:
++ void Read();
++ void ParseMargins( XFFooterStyle* pFooterStyle );
++ void ParseBorder( XFFooterStyle* pFooterStyle );
++ void ParseShadow( XFFooterStyle* pFooterStyle );
++ // add by , 06/03/2005
++ void ParsePatternFill(XFFooterStyle* pFooterStyle);
++ void ParseBackGround(XFFooterStyle* pFooterStyle);
++ // end add
++
++ void ParseBackColor(XFFooterStyle* pFooterStyle);
++
++ void ParseWaterMark(XFFooterStyle* pFooterStyle);
++ //End by
++
++private:
++ sal_Int32 m_nBorderOffset;
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwppara1.cxx lotuswordpro/source/filter/lwppara1.cxx
+--- lotuswordpro.bak/source/filter/lwppara1.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwppara1.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,730 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwppara.hxx"
++#include "lwpglobalmgr.hxx"
++#include "lwpfilehdr.hxx"
++#include "lwpparaproperty.hxx"
++#include "lwptools.hxx"
++#include "lwpparastyle.hxx"
++#include "xfilter/xffont.hxx"
++#include "xfilter/xftextstyle.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xfparagraph.hxx"
++#include "xfilter/xftextcontent.hxx"
++#include "xfilter/xftextspan.hxx"
++#include "xfilter/xfmargins.hxx"
++#include "xfilter/xftabstop.hxx"
++#include "xfilter/xflinebreak.hxx"
++#include "xfilter/xfsection.hxx"
++#include "xfilter/xfsectionstyle.hxx"
++#include "xfilter/xfcolor.hxx"
++#include "xfilter/xfhyperlink.hxx"
++#include "lwpcharsetmgr.hxx"
++#include "lwpsection.hxx"
++#include "lwplayout.hxx"
++#include "lwpusewhen.hxx"
++
++#include "lwpbulletstylemgr.hxx"
++#include "lwpstory.hxx"
++#include "lwpsilverbullet.hxx"
++#include "xfilter/xflist.hxx"
++#include "xfilter/xfframe.hxx"
++
++#include "lwpdivinfo.hxx"
++#include "lwpdoc.hxx"
++#include "lwpholder.hxx"
++#include "lwppagehint.hxx"
++
++#include "lwpdropcapmgr.hxx"
++#include "lwptable.hxx"
++#include "lwpcelllayout.hxx"
++/**
++ * @short get text of paragraph
++ */
++OUString LwpPara::GetContentText(sal_Bool bAllText)
++{
++// rFont = m_FontID;
++ if (bAllText)
++ {
++ m_Fribs.SetPara(this);
++ m_Fribs.GatherAllText();
++ return m_AllText;
++ }
++ else
++ return m_Content;
++}
++
++/**
++ * @short set text of paragraph
++ */
++void LwpPara::SetAllText(OUString sText)
++{
++ m_AllText+=sText;
++}
++
++/**
++ * @short set first frib content
++ */
++void LwpPara::SetFirstFrib(rtl::OUString Content,sal_uInt32 FontID)
++{
++ m_FontID= FontID;
++ m_Content=Content;
++}
++/**
++ * @short get paragraph xfstyle
++ */
++XFParaStyle* LwpPara::GetXFParaStyle()
++{
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ return pXFStyleManager->FindParaStyle(m_StyleName);
++}
++/**
++ * @short get drop cap info
++ */
++#include "lwpframelayout.hxx"
++void LwpPara::GatherDropcapInfo()
++{
++ SetDropcapLines(m_pDropcapLayout->GetLines());
++ SetDropcapChars(m_pDropcapLayout->GetChars());
++}
++/**
++ * @short get parent paragraph
++ */
++LwpPara* LwpPara::GetParent()
++{
++ LwpPara* pPara;
++ sal_uInt16 otherlevel;
++ sal_uInt16 level = GetLevel();
++
++ if (level != 1)
++ {
++ pPara = static_cast<LwpPara*>(GetPrevious()->obj());
++ while (pPara)
++ {
++ otherlevel = pPara->GetLevel();
++ if ((otherlevel < level) || (otherlevel && (level == 0)))
++ return pPara;
++ pPara = static_cast<LwpPara*>(pPara->GetPrevious()->obj());
++ }
++ }
++ return NULL;
++}
++
++/**
++ * @short: Offer prefix, paranumber and suffix according to position.
++ * @param: nPosition index of wanted paranumbering in the style-list.
++ * @param: pParaNumbering a pointer to the structure which contains prefix, paranumber and
++ * suffix.
++ */
++void LwpPara::GetParaNumber(sal_uInt16 nPosition, ParaNumbering* pParaNumbering)
++{
++ if (nPosition > 9)
++ {
++ return;
++ }
++ sal_uInt16 nCurrentPos = 0;
++
++ LwpFrib* pPreFrib = NULL;
++ LwpFrib* pFrib = m_Fribs.GetFribs();
++ if (!pFrib)
++ {
++ return;
++ }
++
++ while (pFrib)
++ {
++ sal_uInt8 nFribType = pFrib->GetType();
++ if (nFribType == FRIB_TAG_PARANUMBER)
++ {
++ nCurrentPos++;
++ ModifierInfo* pModInfo = pFrib->GetModifiers();
++ if (pModInfo)
++ {
++ sal_uInt16 nHideLevels = pModInfo->aTxtAttrOverride.GetHideLevels();
++ if (nCurrentPos == nPosition)
++ {
++ //get prefix text frib
++ if (pPreFrib)
++ {
++ if ((pPreFrib->GetType() == FRIB_TAG_TEXT) &&
++ (pPreFrib->GetModifiers()->aTxtAttrOverride.GetHideLevels() == nHideLevels))
++ {
++ pParaNumbering->pPrefix = static_cast<LwpFribText*>(pPreFrib);
++ }
++ }
++
++ //get para numbering
++ pParaNumbering->pParaNumber = static_cast<LwpFribParaNumber*>(pFrib);
++ pParaNumbering->nNumLevel = nHideLevels;
++
++ //get suffix text frib
++ if (pFrib = pFrib->GetNext())
++ {
++// if((pFrib->GetType() == FRIB_TAG_TEXT) &&
++// (pFrib->GetModifiers()->aTxtAttrOverride.GetHideLevels() == nHideLevels))
++ if( pFrib->GetType() == FRIB_TAG_TEXT )
++ {
++ if ((pFrib->GetNext()->GetType() == FRIB_TAG_TEXT ) ||
++ (pFrib->GetModifiers()->aTxtAttrOverride.GetHideLevels() == nHideLevels))
++ {
++ pParaNumbering->pSuffix = static_cast<LwpFribText*>(pFrib);
++ }
++ }
++ }
++
++ break;
++ }
++ }
++ else
++ {
++ if (nCurrentPos == nPosition)
++ {
++ //get prefix text frib
++ if (pPreFrib)
++ {
++ if (pPreFrib->GetType() == FRIB_TAG_TEXT)
++ {
++ pParaNumbering->pPrefix = static_cast<LwpFribText*>(pPreFrib);
++ }
++ }
++
++ //get para numbering
++ pParaNumbering->pParaNumber = static_cast<LwpFribParaNumber*>(pFrib);
++
++ //get suffix text frib
++ if (pFrib = pFrib->GetNext())
++ {
++ if (pFrib->GetType() == FRIB_TAG_TEXT)
++ {
++ pParaNumbering->pSuffix = static_cast<LwpFribText*>(pFrib);
++ }
++ }
++
++ }
++ }
++ }
++ pPreFrib = pFrib;
++ if (pFrib)
++ {
++ pFrib = pFrib->GetNext();
++ }
++ }
++}
++/**
++ * @short override alignment
++ */
++//override style, add by 1-24
++void LwpPara::OverrideAlignment(LwpAlignmentOverride* base,LwpAlignmentOverride* over,XFParaStyle* pOverStyle)
++{
++ if (base)//the latter two parameter never be null
++ {
++ over->Override(base);
++ LwpParaStyle::ApplyAlignment(pOverStyle,base);
++ }
++ else
++ LwpParaStyle::ApplyAlignment(pOverStyle,over);
++}
++/**
++ * @short override indent attribute
++ */
++void LwpPara::OverrideIndent(LwpIndentOverride* base,LwpIndentOverride* over,XFParaStyle* pOverStyle)
++{
++ if (base)//the latter two parameter never be null
++ {
++ over->Override(base);
++ LwpParaStyle::ApplyIndent(this,pOverStyle,base);
++ }
++ else
++ {
++ LwpParaStyle::ApplyIndent(this,pOverStyle,over);
++ }
++}
++/**
++ * @short override spacing
++ */
++void LwpPara::OverrideSpacing(LwpSpacingOverride* base,LwpSpacingOverride* over,XFParaStyle* pOverStyle)
++{
++ if (base)//the latter two parameter never be null
++ {
++ over->Override(base);
++ LwpParaStyle::ApplySpacing(this,pOverStyle,base);
++ }
++ else
++ LwpParaStyle::ApplySpacing(this,pOverStyle,over);
++}
++
++//add by , 01/25/2005
++/**
++ * @short: Get parastyle object according to the objID.
++ * @return: pointer to the parastyle.
++ */
++LwpParaStyle* LwpPara::GetParaStyle()
++{
++ return static_cast<LwpParaStyle*>(m_ParaStyle.obj(VO_PARASTYLE));
++}
++
++/**
++ * @short: Override paraborder style.
++ * @param: pProps pointer to the LwpParaProperty and we can get local breaks through it.
++ * @param: pOverStyle pointer to XFParaStyle which contains the parastyle for XFilter.
++ */
++void LwpPara::OverrideParaBorder(LwpParaProperty* pProps, XFParaStyle* pOverStyle)
++{
++ // get paraborder in parastyle
++ LwpParaStyle* pParaStyle = this->GetParaStyle();
++ if (!pParaStyle)
++ {
++ return;
++ }
++
++ LwpOverride* pBorder = pParaStyle->GetParaBorder();
++ LwpParaBorderOverride aFinalBorder;
++ if (pBorder)
++ {
++ aFinalBorder = *pBorder;
++ }
++
++ // get local border
++ pBorder = static_cast<LwpParaBorderProperty*>(pProps)->GetLocalParaBorder();
++ if (pBorder)
++ {
++ LwpParaBorderOverride aLocalBorder;
++ aLocalBorder = *pBorder;
++ aLocalBorder.Override(&aFinalBorder);
++ }
++
++ pParaStyle->ApplyParaBorder(pOverStyle, &aFinalBorder);
++}
++/**
++ * @short: Override parabreaks style.
++ * @param: pProps pointer to the LwpParaProperty and we can get local breaks through it.
++ * @param: pOverStyle pointer to XFParaStyle which contains the parastyle for XFilter.
++ */
++void LwpPara::OverrideParaBreaks(LwpParaProperty* pProps, XFParaStyle* pOverStyle)
++{
++ // get breaks in parastyle
++ LwpParaStyle* pParaStyle = this->GetParaStyle();
++ if (!pParaStyle)
++ {
++ return;
++ }
++
++ LwpOverride* pBreaks = pParaStyle->GetBreaks();
++ LwpBreaksOverride* pFinalBreaks = new LwpBreaksOverride();
++ if (pBreaks)
++ {
++ *pFinalBreaks = *pBreaks;
++ }
++
++ // get local breaks
++ pBreaks = static_cast<LwpParaBreaksProperty*>(pProps)->GetLocalParaBreaks();
++ if (pBreaks)
++ {
++ LwpBreaksOverride aLocalBreaks;
++ aLocalBreaks = *pBreaks;
++ aLocalBreaks.Override(pFinalBreaks);
++ }
++
++ // save the breaks
++ m_pBreaks = pFinalBreaks;
++
++//add by 1/31
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ if (m_pBreaks->IsKeepWithNext())
++ {
++ pOverStyle->SetBreaks(enumXFBreakKeepWithNext);
++ }
++ if (m_pBreaks->IsPageBreakBefore())
++ {
++ XFParaStyle* pStyle = new XFParaStyle();
++ pStyle->SetBreaks(enumXFBreakAftPage);
++ m_BefPageBreakName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++ }
++ if (m_pBreaks->IsPageBreakAfter())
++ {
++ XFParaStyle* pStyle = new XFParaStyle();
++ pStyle->SetBreaks(enumXFBreakAftPage);
++ m_AftPageBreakName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++ }
++ if (m_pBreaks->IsColumnBreakBefore())
++ {
++ XFParaStyle* pStyle = new XFParaStyle();
++ pStyle->SetBreaks(enumXFBreakAftColumn);//tmp after, should change when layout read,note by 1/31
++ m_BefColumnBreakName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++ }
++ if (m_pBreaks->IsColumnBreakAfter())
++ {
++ XFParaStyle* pStyle = new XFParaStyle();
++ pStyle->SetBreaks(enumXFBreakAftColumn);
++ m_AftColumnBreakName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++ }
++//add end
++
++// pParaStyle->ApplyBreaks(pOverStyle, &aFinalBreaks);
++}
++
++/**
++ * @short: Override bullet styles.
++ * @param: pProps pointer to the LwpParaProperty and we can get local bullet through it.
++ */
++void LwpPara::OverrideParaBullet(LwpParaProperty* pProps)
++{
++ // get bulletoverride in parastyle
++ LwpParaStyle* pParaStyle = this->GetParaStyle();
++ if (!pParaStyle)
++ {
++ return;
++ }
++
++ if (pProps)
++ {
++ m_pBullOver = new LwpBulletOverride();
++ // get local bulletoverride
++ LwpBulletOverride* pLocalBullet = static_cast<LwpParaBulletProperty*>(pProps)->GetLocalParaBullet();
++ if (!pLocalBullet)
++ {
++ return;
++ }
++
++ LwpObjectID aSilverBulletID = pLocalBullet->GetSilverBullet();
++ if (aSilverBulletID.IsNull())
++ {
++ return;
++ }
++ else
++ {
++ m_bHasBullet = sal_True;
++
++ LwpOverride* pBullet= pParaStyle->GetBulletOverride();
++ LwpBulletOverride aFinalBullet;
++ if (pBullet)
++ {
++ aFinalBullet = *pBullet;
++ }
++
++ LwpBulletOverride aLocalBullet;
++ aLocalBullet = *pLocalBullet;
++ aLocalBullet.Override(&aFinalBullet);
++
++ *m_pBullOver = aFinalBullet;
++ aSilverBulletID = aFinalBullet.GetSilverBullet();
++ if (!aSilverBulletID.IsNull())
++ {
++ m_pSilverBullet = static_cast<LwpSilverBullet*>(aSilverBulletID.obj(VO_SILVERBULLET));
++ m_pSilverBullet->SetFoundry(m_pFoundry);
++ }
++
++ m_aSilverBulletID = aSilverBulletID;
++ }
++ }
++ else
++ {
++// m_pBullOver = pParaStyle->GetBulletOverride();
++ LwpBulletOverride* pBullOver = pParaStyle->GetBulletOverride();
++ if (pBullOver)
++ {
++ m_aSilverBulletID = pBullOver->GetSilverBullet();
++ if (!m_aSilverBulletID.IsNull())
++ {
++ m_bHasBullet = sal_True;
++
++ m_pSilverBullet = static_cast<LwpSilverBullet*>(m_aSilverBulletID.obj(VO_SILVERBULLET));
++ m_pSilverBullet->SetFoundry(m_pFoundry);
++ }
++
++ m_pBullOver = new LwpBulletOverride();
++ *m_pBullOver = *pBullOver;
++ }
++ }
++}
++/**
++ * @short: Override paranumbering properties.
++ * @param: pProps pointer to the LwpParaProperty and we can get local paranumbering through it.
++ */
++void LwpPara::OverrideParaNumbering(LwpParaProperty* pProps)
++{
++ // get numbering override in parastyle
++ LwpParaStyle* pParaStyle = this->GetParaStyle();
++ if (!pParaStyle)
++ {
++ return;
++ }
++
++ LwpNumberingOverride* pParaNumbering = pParaStyle->GetNumberingOverride();
++ LwpNumberingOverride aOver;
++ //Override with the local numbering, if any
++ if (pProps)
++ {
++ LwpNumberingOverride* pPropNumbering = static_cast<LwpParaNumberingProperty*>(pProps)->GetLocalNumbering();
++ if (pPropNumbering)
++ {
++ aOver = *pPropNumbering;
++ }
++ }
++ else
++ {
++ if (pParaNumbering)
++ {
++ aOver = *pParaNumbering;
++ }
++ }
++
++ if (m_nFlags & VALID_LEVEL)
++ {
++ aOver.OverrideLevel(m_nLevel);
++ }
++
++ m_aParaNumbering = aOver;
++
++}
++
++/**************************************************************************
++ * @short:
++ * @descr:
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++void LwpPara::OverrideTab(LwpTabOverride *base, LwpTabOverride *over, XFParaStyle *pOverStyle)
++{
++ if (base)
++ {
++ over->Override(base);
++ LwpParaStyle::ApplyTab(pOverStyle,base);
++ }
++ else
++ LwpParaStyle::ApplyTab(pOverStyle,over);
++}
++
++void LwpPara::FindLayouts()
++{
++ m_Fribs.SetPara(this);
++ m_Fribs.FindLayouts();
++ LwpPara* pNextPara = static_cast<LwpPara*>(GetNext()->obj());
++ if(pNextPara)
++ {
++ pNextPara->FindLayouts();
++ }
++}
++
++/**************************************************************************
++ * @descr: Get property according to the property type
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++LwpParaProperty* LwpPara::GetProperty(sal_uInt32 nPropType)
++{
++ LwpParaProperty* pProps = m_pProps;
++ while(pProps)
++ {
++ if(pProps->GetType() == nPropType)
++ {
++ return pProps;
++ }
++ pProps = pProps->GetNext();
++
++ }
++ return NULL;
++}
++
++/**************************************************************************
++ * @descr: Get local tab rack
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++LwpTabOverride* LwpPara::GetLocalTabOverride()
++{
++ LwpParaProperty* pProp = GetProperty(PP_LOCAL_TABRACK);
++ if(pProp)
++ {
++ return static_cast<LwpParaTabRackProperty*>(pProp)->GetTab();
++ }
++ return NULL;
++}
++
++/**
++* @descr: Determined which para is earlier in position
++*
++*/
++sal_Bool LwpPara::operator< (LwpPara& Other)
++{
++ return m_nOrdinal < Other.GetOrdinal();
++}
++
++/**
++* @descr: If the two layouts in the same para, compare which layout is earlied according to frib order
++*
++*/
++sal_Bool LwpPara::ComparePagePosition(LwpVirtualLayout * pPreLayout, LwpVirtualLayout * pNextLayout)
++{
++ m_Fribs.SetPara(this);
++ return m_Fribs.ComparePagePosition(pPreLayout, pNextLayout);
++}
++/*
++sal_Bool LwpPara::IsNeedTabForTOC()
++{
++ LwpStory* pStory = GetStory();
++ if(pStory)
++ {
++ if(GetNext()->IsNull())
++ {
++ LwpVirtualLayout* pLayout = pStory->GetLayout(NULL);
++ if(pLayout && pLayout->IsCell())
++ {
++ LwpCellLayout * pCell = static_cast<LwpCellLayout *>(pStory->GetLayout(NULL));
++ if (pCell->GetLeaderChar() == 0)
++ {
++ return sal_False;
++ }
++ return sal_True;
++ }
++ }
++ }
++ return sal_False;
++}
++
++void LwpPara::AddTabStyleForTOC( )
++{
++ if(IsNeedTabForTOC())
++ {
++ XFParaStyle* pParaStyle = new XFParaStyle;
++ *pParaStyle = *GetXFParaStyle();
++ pParaStyle->ClearTabStyles();
++ //Add Tab Style;
++ enumXFTab eType = enumXFTabRight;
++
++ LwpCellLayout * pCell = static_cast<LwpCellLayout *>(GetStory()->GetLayout(NULL));
++ double dLen = pCell->GetActualWidth(); /// todo: get from table
++ sal_Unicode cLeader = static_cast<sal_Unicode>(pCell->GetLeaderChar());
++ pParaStyle->AddTabStyle(eType, dLen, cLeader );
++ m_StyleName = XFStyleManager::AddStyle(pParaStyle)->GetStyleName();
++
++ // Get font info of default text style and set into tab style
++ XFParaStyle* pBaseStyle = static_cast<XFParaStyle*>(m_pFoundry->GetStyleManager()->GetStyle(*m_pFoundry->GetDefaultTextStyle()));
++ XFTextStyle*pTextStyle = new XFTextStyle;
++ pTextStyle->SetFont(pBaseStyle->GetFont()); // who delete this font?????
++ m_TabStyleName = XFStyleManager::AddStyle(pTextStyle)->GetStyleName();
++ }
++}
++
++void LwpPara::AddTabStopForTOC()
++{
++ if(IsNeedTabForTOC())
++ {
++ XFParagraph* pXFPara = GetFribs()->GetXFPara();
++ pXFPara->SetStyleName(m_StyleName);
++
++ XFParaStyle* pParaStyle = static_cast<XFParaStyle*>(XFStyleManager::FindStyle(m_StyleName));
++ if(pParaStyle)
++ {
++ XFTextSpan *pSpan = new XFTextSpan;
++ XFTabStop *pTab = new XFTabStop;
++ pSpan->Add(pTab);
++ pSpan->SetStyleName(m_TabStyleName);
++ enumXFAlignType eType = pParaStyle->GetAlighType();
++
++ if(eType == enumXFAlignStart || eType == enumXFAlignJustify || eType == enumXFAlignNone)
++ {
++ pXFPara->Add(pSpan);
++ }
++ else if(eType == enumXFAlignEnd)
++ {
++ pXFPara->InsertAtBegin(pSpan);
++ }
++ else
++ {
++ delete pSpan; // pTabl will be delete inside XFTextSpan
++ }
++
++ }
++
++ }
++}
++*/
++/**
++ * @short check paragraph alignment
++ */
++sal_Bool LwpPara::IsNumberRight()
++{
++ LwpObject* pObj = m_ParaStyle.obj();
++ if (pObj)
++ {
++ LwpParaStyle* pStyle = static_cast<LwpParaStyle*>(pObj);
++ return pStyle->IsNumberRight();
++ }
++ else
++ return sal_False;
++}
++/**
++ * @short check paragraph in cell or not
++ */
++sal_Bool LwpPara::IsInCell()
++{
++ LwpVirtualLayout* pLayout = GetStory()->GetLayout(NULL);
++ if(pLayout && pLayout->IsCell())
++ return sal_True;
++ return sal_False;
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpparaborderoverride.cxx lotuswordpro/source/filter/lwpparaborderoverride.cxx
+--- lotuswordpro.bak/source/filter/lwpparaborderoverride.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpparaborderoverride.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,394 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++* @file
++* Border override of Wordpro.
++************************************************************************/
++/*************************************************************************
++* Change History
++* 2005-01-11 create and implement.
++************************************************************************/
++#include "lwpparaborderoverride.hxx"
++#include "lwpborderstuff.hxx"
++#include "lwpshadow.hxx"
++#include "lwpmargins.hxx"
++
++LwpParaBorderOverride::LwpParaBorderOverride()
++{
++ m_pBorderStuff = new LwpBorderStuff();
++ m_pBetweenStuff = new LwpBorderStuff();
++ m_pShadow = new LwpShadow();
++ m_pMargins = new LwpMargins();
++
++ m_eAboveType = PB_NONE;
++ m_eBelowType = PB_NONE;
++ m_eRightType = PB_NONE;
++ m_eBetweenType = PB_NONE;
++
++ m_nAboveWidth = 0;
++ m_nBelowWidth = 0;
++ m_nBetweenWidth = 0;
++ m_nRightWidth = 0;
++
++ m_nBetweenMargin = 0;
++}
++
++LwpParaBorderOverride::~LwpParaBorderOverride()
++{
++ if( m_pBorderStuff )
++ delete m_pBorderStuff;
++ if( m_pBetweenStuff )
++ delete m_pBetweenStuff;
++ if( m_pShadow )
++ delete m_pShadow;
++ if( m_pMargins )
++ delete m_pMargins;
++}
++
++void LwpParaBorderOverride::Read(LwpObjectStream *pStrm)
++{
++ if (pStrm->QuickReadBool())
++ {
++ ReadCommon(pStrm);
++ //start here:
++ m_pBorderStuff->Read(pStrm);
++ m_pShadow->Read(pStrm);
++ m_pMargins->Read(pStrm);
++
++ pStrm->QuickRead(&m_eAboveType,2);
++ pStrm->QuickRead(&m_eBelowType,2);
++ pStrm->QuickRead(&m_eRightType,2);
++
++ if( pStrm->CheckExtra() )
++ {
++ m_pBetweenStuff->Read(pStrm);
++
++ pStrm->QuickRead(&m_eBetweenType,2);
++ pStrm->QuickRead(&m_nBetweenWidth,4 );
++ pStrm->QuickRead(&m_nBetweenMargin,4 );
++
++ if( pStrm->CheckExtra() )
++ {
++ pStrm->QuickRead( &m_eRightType, 2);
++ pStrm->QuickRead( &m_nRightWidth, 4);
++ }
++ }
++ }
++
++ pStrm->SkipExtra();
++}
++
++// 01/26/2005
++void LwpParaBorderOverride::operator=(const LwpOverride& rOther)
++{
++ LwpOverride::operator=(rOther);
++ const LwpParaBorderOverride* pParaBorder = static_cast<LwpParaBorderOverride*>((LwpOverride*)&rOther);
++
++ if (pParaBorder->m_pBorderStuff)
++ {
++ *m_pBorderStuff = *(pParaBorder->m_pBorderStuff);
++ }
++ if (pParaBorder->m_pBetweenStuff)
++ {
++ *m_pBetweenStuff = *(pParaBorder->m_pBetweenStuff);
++ }
++ if (pParaBorder->m_pShadow)
++ {
++ *m_pShadow = *(pParaBorder->m_pShadow);
++ }
++ if (pParaBorder->m_pMargins)
++ {
++ *m_pMargins = *(pParaBorder->m_pMargins);
++ }
++
++ m_eAboveType = pParaBorder->m_eAboveType;
++ m_eBelowType = pParaBorder->m_eBelowType;
++ m_eRightType = pParaBorder->m_eRightType;
++ m_eBetweenType = pParaBorder->m_eBelowType;
++
++ m_nAboveWidth = pParaBorder->m_nAboveWidth;
++ m_nBelowWidth = pParaBorder->m_nBelowWidth;
++ m_nBetweenWidth = pParaBorder->m_nBetweenWidth;
++ m_nRightWidth = pParaBorder->m_nRightWidth;
++
++ m_nBetweenMargin = pParaBorder->m_nBetweenMargin;
++}
++
++void LwpParaBorderOverride::Override(LwpParaBorderOverride* pOther)
++{
++ if (m_nApply & PBO_STUFF)
++ {
++ if (IsBorderStuffOverridden())
++ {
++ pOther->OverrideBorderStuff(m_pBorderStuff);
++ }
++ else
++ {
++ pOther->RevertBorderStuff();
++ }
++ }
++
++ if (m_nApply & PBO_BETWEENSTUFF)
++ {
++ if (IsBetweenStuffOverridden())
++ {
++ pOther->OverrideBetweenStuff(m_pBetweenStuff);
++ }
++ else
++ {
++ pOther->RevertBetweenStuff();
++ }
++ }
++
++ if (m_nApply & PBO_SHADOW)
++ {
++ if (IsShadowOverridden())
++ {
++ pOther->OverrideShadow(m_pShadow);
++ }
++ else
++ {
++ pOther->RevertShadow();
++ }
++ }
++
++ if (m_nApply & PBO_MARGINS)
++ {
++ if (IsMarginsOverridden())
++ {
++ pOther->OverrideMargins(m_pMargins);
++ }
++ else
++ {
++ pOther->RevertMargins();
++ }
++ }
++
++ if (m_nApply & PBO_ABOVETYPE)
++ {
++ if (IsAboveTypeOverridden())
++ {
++ pOther->OverrideAboveType(m_eAboveType);
++ }
++ else
++ {
++ pOther->RevertAboveType();
++ }
++ }
++
++ if (m_nApply & PBO_BELOWTYPE)
++ {
++ if (IsBelowTypeOverridden())
++ {
++ pOther->OverrideBelowType(m_eBelowType);
++ }
++ else
++ {
++ pOther->RevertBelowType();
++ }
++ }
++
++ if (m_nApply & PBO_RIGHTTYPE)
++ {
++ if (IsRightTypeOverridden())
++ {
++ pOther->OverrideRightType(m_eRightType);
++ }
++ else
++ {
++ pOther->RevertRightType();
++ }
++ }
++
++ if (m_nApply & PBO_BETWEENTYPE)
++ {
++ if (IsBetweenTypeOverridden())
++ {
++ pOther->OverrideBetweenType(m_eBetweenType);
++ }
++ else
++ {
++ pOther->RevertBetweenType();
++ }
++ }
++
++ if (m_nApply & PBO_ABOVE)
++ {
++ if (IsAboveWidthOverridden())
++ {
++ pOther->OverrideAboveWidth(m_nAboveWidth);
++ }
++ else
++ {
++ pOther->RevertAboveWidth();
++ }
++ }
++
++ if (m_nApply & PBO_BELOW)
++ {
++ if (IsBelowWidthOverridden())
++ {
++ pOther->OverrideBelowWidth(m_nBelowWidth);
++ }
++ else
++ {
++ pOther->RevertBelowWidth();
++ }
++ }
++
++ if (m_nApply & PBO_BETWEEN)
++ {
++ if (IsBetweenWidthOverridden())
++ {
++ pOther->OverrideBetweenWidth(m_nBetweenWidth);
++ }
++ else
++ {
++ pOther->RevertBetweenWidth();
++ }
++ }
++
++ if (m_nApply & PBO_BETWEENMARGIN)
++ {
++ if (IsBetweenMarginOverridden())
++ {
++ pOther->OverrideBetweenMargin(m_nBetweenMargin);
++ }
++ else
++ {
++ pOther->RevertBetweenMargin();
++ }
++ }
++
++ if (m_nApply & PBO_RIGHT)
++ {
++ if (IsRightWidthOverridden())
++ {
++ pOther->OverrideRightWidth(m_nRightWidth);
++ }
++ else
++ {
++ pOther->RevertRightWidth();
++ }
++ }
++}
++
++void LwpParaBorderOverride::OverrideBorderStuff(LwpBorderStuff* pBorderStuff)
++{
++ *m_pBorderStuff = *pBorderStuff;
++ LwpOverride::Override(PBO_STUFF, STATE_ON);
++}
++void LwpParaBorderOverride::OverrideBetweenStuff(LwpBorderStuff* pBorderStuff)
++{
++ *m_pBetweenStuff = *pBorderStuff;
++ LwpOverride::Override(PBO_BETWEENSTUFF, STATE_ON);
++}
++void LwpParaBorderOverride::OverrideShadow(LwpShadow* pShadow)
++{
++ *m_pShadow = *pShadow;
++ LwpOverride::Override(PBO_SHADOW, STATE_ON);
++}
++void LwpParaBorderOverride::OverrideMargins(LwpMargins* pMargins)
++{
++ *m_pMargins = *pMargins;
++ LwpOverride::Override(PBO_MARGINS, STATE_ON);
++}
++void LwpParaBorderOverride::OverrideAboveType(BorderWidthType eNewType)
++{
++ m_eAboveType = eNewType;
++ LwpOverride::Override(PBO_ABOVETYPE, STATE_ON);
++}
++void LwpParaBorderOverride::OverrideBelowType(BorderWidthType eNewType)
++{
++ m_eBelowType = eNewType;
++ LwpOverride::Override(PBO_BELOWTYPE, STATE_ON);
++}
++void LwpParaBorderOverride::OverrideRightType(BorderWidthType eNewType)
++{
++ m_eRightType = eNewType;
++ LwpOverride::Override(PBO_RIGHTTYPE, STATE_ON);
++}
++void LwpParaBorderOverride::OverrideBetweenType(BorderWidthType eNewType)
++{
++ m_eBetweenType = eNewType;
++ LwpOverride::Override(PBO_BETWEENTYPE, STATE_ON);
++}
++void LwpParaBorderOverride::OverrideAboveWidth(sal_uInt32 nNewWidth)
++{
++ m_nAboveWidth = nNewWidth;
++ LwpOverride::Override(PBO_ABOVE, STATE_ON);
++}
++void LwpParaBorderOverride::OverrideBelowWidth(sal_uInt32 nNewWidth)
++{
++ m_nBelowWidth = nNewWidth;
++ LwpOverride::Override(PBO_BELOW, STATE_ON);
++}
++void LwpParaBorderOverride::OverrideBetweenWidth(sal_uInt32 nNewWidth)
++{
++ m_nBetweenWidth = nNewWidth;
++ LwpOverride::Override(PBO_BETWEEN, STATE_ON);
++}
++void LwpParaBorderOverride::OverrideRightWidth(sal_uInt32 nNewWidth)
++{
++ m_nRightWidth = nNewWidth;
++ LwpOverride::Override(PBO_RIGHT, STATE_ON);
++}
++void LwpParaBorderOverride::OverrideBetweenMargin(sal_uInt32 nNewMargin)
++{
++ m_nBetweenMargin = nNewMargin;
++ LwpOverride::Override(PBO_BETWEENMARGIN, STATE_ON);
++}
++
++//end
+diff -urNp lotuswordpro.bak/source/filter/lwpparaborderoverride.hxx lotuswordpro/source/filter/lwpparaborderoverride.hxx
+--- lotuswordpro.bak/source/filter/lwpparaborderoverride.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpparaborderoverride.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,285 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++* @file
++* Border override of Wordpro.
++************************************************************************/
++/*************************************************************************
++* Change History
++* 2005-01-11 Create and implement.
++************************************************************************/
++#ifndef _LWPPARABORDEROVERRIDE_HXX
++#define _LWPPARABORDEROVERRIDE_HXX
++
++#include "lwpoverride.hxx"
++
++class LwpBorderStuff;
++class LwpShadow;
++class LwpMargins;
++
++class LwpParaBorderOverride : public LwpOverride
++{
++public:
++ LwpParaBorderOverride();
++ virtual ~LwpParaBorderOverride();
++
++ enum BorderWidthType
++ {
++ PB_NONE = 0, /* No border */
++ PB_TEXTWIDTH = 1, /* Border is width of text */
++ PB_MARGINWIDTH = 2, /* Border extends to margins */
++ PB_CUSTOMWIDTH = 3 /* Border width is specified explicitly */
++ };
++public:
++ virtual void Read(LwpObjectStream *pStrm);
++
++ LwpShadow* GetShadow(){ return m_pShadow; }
++ LwpBorderStuff* GetBorderStuff(){ return m_pBorderStuff; }
++ LwpMargins* GetMargins() { return m_pMargins; };
++
++ //add by , 01/25/2005
++ virtual void operator=(const LwpOverride& rOther);
++
++ void Override(LwpParaBorderOverride* pOther);
++
++ inline sal_Bool IsBorderStuffOverridden();
++ inline sal_Bool IsBetweenStuffOverridden();
++ inline sal_Bool IsShadowOverridden();
++ inline sal_Bool IsMarginsOverridden();
++ inline sal_Bool IsAboveTypeOverridden();
++ inline sal_Bool IsBelowTypeOverridden();
++ inline sal_Bool IsRightTypeOverridden();
++ inline sal_Bool IsBetweenTypeOverridden();
++ inline sal_Bool IsAboveWidthOverridden();
++ inline sal_Bool IsBelowWidthOverridden();
++ inline sal_Bool IsBetweenWidthOverridden();
++ inline sal_Bool IsRightWidthOverridden();
++ inline sal_Bool IsBetweenMarginOverridden();
++
++ void OverrideBorderStuff(LwpBorderStuff* pBorderStuff);
++ void OverrideBetweenStuff(LwpBorderStuff* pBorderStuff);
++ void OverrideShadow(LwpShadow* pShadow);
++ void OverrideMargins(LwpMargins* pMargins);
++ void OverrideAboveType(BorderWidthType eNewType);
++ void OverrideBelowType(BorderWidthType eNewType);
++ void OverrideRightType(BorderWidthType eNewType);
++ void OverrideBetweenType(BorderWidthType eNewType);
++ void OverrideAboveWidth(sal_uInt32 nNewWidth);
++ void OverrideBelowWidth(sal_uInt32 nNewWidth);
++ void OverrideBetweenWidth(sal_uInt32 nNewWidth);
++ void OverrideRightWidth(sal_uInt32 nNewWidth);
++ void OverrideBetweenMargin(sal_uInt32 nNewMargin);
++
++ inline void RevertBorderStuff();
++ inline void RevertBetweenStuff();
++ inline void RevertShadow();
++ inline void RevertMargins();
++ inline void RevertAboveType();
++ inline void RevertBelowType();
++ inline void RevertRightType();
++ inline void RevertBetweenType();
++ inline void RevertAboveWidth();
++ inline void RevertBelowWidth();
++ inline void RevertBetweenWidth();
++ inline void RevertRightWidth();
++ inline void RevertBetweenMargin();
++
++ //end add
++ friend class LwpParaBorderPiece;
++protected:
++ enum
++ {
++ PBO_STUFF = 0x0001,
++ PBO_SHADOW = 0x0002,
++ PBO_MARGINS = 0x0004,
++ PBO_ABOVETYPE = 0x0008,
++ PBO_BELOWTYPE = 0x0010,
++ PBO_RIGHTTYPE = 0x0020,
++ PBO_ABOVE = 0x0040,
++ PBO_BELOW = 0x0080,
++ PBO_BETWEENSTUFF = 0x0100,
++ PBO_BETWEENTYPE = 0x0200,
++ PBO_BETWEEN = 0x0400,
++ PBO_BETWEENMARGIN = 0x0800,
++ PBO_RIGHT = 0x1000
++ };
++
++private:
++ LwpBorderStuff *m_pBorderStuff;
++ LwpBorderStuff *m_pBetweenStuff;
++ LwpShadow *m_pShadow;
++ LwpMargins *m_pMargins;
++
++ BorderWidthType m_eAboveType;
++ BorderWidthType m_eBelowType;
++ BorderWidthType m_eRightType;
++ BorderWidthType m_eBetweenType;
++
++ sal_uInt32 m_nAboveWidth;
++ sal_uInt32 m_nBelowWidth;
++ sal_uInt32 m_nBetweenWidth;
++ sal_uInt32 m_nRightWidth;
++
++ sal_uInt32 m_nBetweenMargin;
++};
++
++inline sal_Bool LwpParaBorderOverride::IsBorderStuffOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_STUFF) != 0);
++}
++inline sal_Bool LwpParaBorderOverride::IsBetweenStuffOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_BETWEENSTUFF) != 0);
++}
++inline sal_Bool LwpParaBorderOverride::IsShadowOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_SHADOW) != 0);
++}
++inline sal_Bool LwpParaBorderOverride::IsMarginsOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_MARGINS) != 0);
++}
++inline sal_Bool LwpParaBorderOverride::IsAboveTypeOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_ABOVETYPE) != 0);
++}
++inline sal_Bool LwpParaBorderOverride::IsBelowTypeOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_BELOWTYPE) != 0);
++}
++inline sal_Bool LwpParaBorderOverride::IsRightTypeOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_RIGHTTYPE) != 0);
++}
++inline sal_Bool LwpParaBorderOverride::IsBetweenTypeOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_BETWEENTYPE) != 0);
++}
++inline sal_Bool LwpParaBorderOverride::IsAboveWidthOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_ABOVE) != 0);
++}
++inline sal_Bool LwpParaBorderOverride::IsBelowWidthOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_BELOW) != 0);
++}
++inline sal_Bool LwpParaBorderOverride::IsBetweenWidthOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_BETWEEN) != 0);
++}
++inline sal_Bool LwpParaBorderOverride::IsRightWidthOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_RIGHT) != 0);
++}
++inline sal_Bool LwpParaBorderOverride::IsBetweenMarginOverridden()
++{
++ return (sal_Bool)((m_nOverride & PBO_BETWEENMARGIN) != 0);
++}
++
++inline void LwpParaBorderOverride::RevertBorderStuff()
++{
++ LwpOverride::Override(PBO_STUFF, STATE_STYLE);
++}
++inline void LwpParaBorderOverride::RevertBetweenStuff()
++{
++ LwpOverride::Override(PBO_BETWEENSTUFF, STATE_STYLE);
++}
++inline void LwpParaBorderOverride::RevertShadow()
++{
++ LwpOverride::Override(PBO_SHADOW, STATE_STYLE);
++}
++inline void LwpParaBorderOverride::RevertMargins()
++{
++ LwpOverride::Override(PBO_MARGINS, STATE_STYLE);
++}
++inline void LwpParaBorderOverride::RevertAboveType()
++{
++ LwpOverride::Override(PBO_ABOVETYPE, STATE_STYLE);
++}
++inline void LwpParaBorderOverride::RevertBelowType()
++{
++ LwpOverride::Override(PBO_BELOWTYPE, STATE_STYLE);
++}
++inline void LwpParaBorderOverride::RevertRightType()
++{
++ LwpOverride::Override(PBO_RIGHTTYPE, STATE_STYLE);
++}
++inline void LwpParaBorderOverride::RevertBetweenType()
++{
++ LwpOverride::Override(PBO_BETWEENTYPE, STATE_STYLE);
++}
++inline void LwpParaBorderOverride::RevertAboveWidth()
++{
++ LwpOverride::Override(PBO_ABOVE, STATE_STYLE);
++}
++inline void LwpParaBorderOverride::RevertBelowWidth()
++{
++ LwpOverride::Override(PBO_BELOW, STATE_STYLE);
++}
++inline void LwpParaBorderOverride::RevertBetweenWidth()
++{
++ LwpOverride::Override(PBO_BETWEEN, STATE_STYLE);
++}
++inline void LwpParaBorderOverride::RevertRightWidth()
++{
++ LwpOverride::Override(PBO_RIGHT, STATE_STYLE);
++}
++inline void LwpParaBorderOverride::RevertBetweenMargin()
++{
++ LwpOverride::Override(PBO_BETWEENMARGIN, STATE_STYLE);
++}
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwppara.cxx lotuswordpro/source/filter/lwppara.cxx
+--- lotuswordpro.bak/source/filter/lwppara.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwppara.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,1047 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwppara.hxx"
++#include "lwpglobalmgr.hxx"
++#include "lwpfilehdr.hxx"
++#include "lwpparaproperty.hxx"
++#include "lwptools.hxx"
++#include "lwpparastyle.hxx"
++#include "xfilter/xffont.hxx"
++#include "xfilter/xftextstyle.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xfparagraph.hxx"
++#include "xfilter/xftextcontent.hxx"
++#include "xfilter/xftextspan.hxx"
++#include "xfilter/xfmargins.hxx"
++#include "xfilter/xftabstop.hxx"
++#include "xfilter/xflinebreak.hxx"
++#include "xfilter/xfsection.hxx"
++#include "xfilter/xfsectionstyle.hxx"
++#include "xfilter/xfcolor.hxx"
++#include "xfilter/xfhyperlink.hxx"
++#include "xfilter/xfliststyle.hxx"
++#include "lwpcharsetmgr.hxx"
++#include "lwpsection.hxx"
++#include "lwplayout.hxx"
++#include "lwpusewhen.hxx"
++#include "lwpbulletstylemgr.hxx"
++#include "lwpstory.hxx"
++#include "lwpsilverbullet.hxx"
++#include "xfilter/xflist.hxx"
++#include "xfilter/xfframe.hxx"
++
++#include "lwpdivinfo.hxx"
++#include "lwpdoc.hxx"
++#include "lwpholder.hxx"
++#include "lwppagehint.hxx"
++
++#include "lwpdropcapmgr.hxx"
++#include "lwptable.hxx"
++LwpPara::LwpPara(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpDLVList(objHdr, pStrm), m_pBreaks(NULL), m_pIndentOverride(NULL), m_bHasBullet(sal_False), m_bBullContinue(sal_False),
++ /*m_pParaNumbering(NULL),*/ m_pSilverBullet(NULL), m_pBullOver(NULL),m_bHasDropcap(sal_False),m_nLines(0),m_nChars(0),
++ m_BelowSpacing(0),m_pDropcapLayout(NULL), m_pXFContainer(NULL)
++{
++ m_pProps = NULL;
++ m_SectionStyleName = A2OUSTR("");
++ m_AllText = A2OUSTR("");
++}
++
++LwpPara::~LwpPara()
++{
++
++ if (m_pBreaks)
++ {
++ delete m_pBreaks;
++ m_pBreaks = NULL;
++ }
++/* if (m_pParaNumbering)
++ {
++ delete m_pParaNumbering;
++ m_pParaNumbering = NULL;
++ }*/
++
++ if (m_pBullOver)
++ {
++ delete m_pBullOver;
++ m_pBullOver = NULL;
++ }
++ if(m_pIndentOverride)
++ {
++ delete m_pIndentOverride;
++ }
++
++ LwpParaProperty* pNextProp;
++ while(m_pProps)
++ {
++ pNextProp = m_pProps->GetNext();
++ delete m_pProps;
++ m_pProps = pNextProp;
++ }
++}
++
++void LwpPara::Read()
++{
++ LwpDLVList::Read();
++
++ sal_Bool Simple;
++ sal_Bool Notify = sal_False;
++// m_Fribs.SetPara(this);
++// LwpParaPropListProperty *PropList = NULL;
++ if(LwpFileHeader::m_nFileRevision<0x0006)
++ Simple = sal_False;
++ else if(LwpFileHeader::m_nFileRevision<0x000B)
++ m_pObjStrm->QuickRead(&Simple, sizeof(Simple));
++ else
++ {
++ sal_uInt8 Flag;
++ m_pObjStrm->QuickRead(&Flag, sizeof(Flag));
++
++ const int DISK_SIMPLE = 1;
++ const int DISK_NOTIFY = 2;
++
++ Simple = (Flag & DISK_SIMPLE) ? sal_True : sal_False;
++ Notify = (Flag & DISK_NOTIFY) ? sal_True : sal_False;
++ }
++
++ if(!Simple)
++ {
++ m_pObjStrm->QuickRead(&m_nOrdinal, sizeof(m_nOrdinal));
++ if(LwpFileHeader::m_nFileRevision<0x000B)
++ {
++ // TODO: to process
++ assert(false);
++ /*pCForked3NotifyList Notify = new CForked3NotifyList(this);
++ Notify->GetExtraList()->QuickRead(pFile);
++ Notify->QuickRead(pFile);
++ if(Notify->GetExtraList()->IsEmpty() &&
++ Notify->IsEmpty())
++ delete Notify;
++ else
++ cNotifyList = Notify;*/
++ }
++ else
++ {
++ if (Notify)
++ {
++ LwpForked3NotifyList* pNotifyList = new LwpForked3NotifyList();
++ pNotifyList->GetExtraList()->Read(m_pObjStrm);
++ pNotifyList->Read(m_pObjStrm);
++ delete pNotifyList;
++ }
++ }
++ }
++ else
++ m_nOrdinal = 0x0001;
++
++ m_pObjStrm->QuickRead(&m_nFlags, sizeof(m_nFlags));
++ m_ParaStyle.ReadIndexed(m_pObjStrm);
++
++ if(!Simple)
++ {
++ m_Hint.Read(m_pObjStrm);
++ if (IsBadHintsInFile())
++ {
++ // This hint is no good, so throw it away -- SDC 9/28/95
++ m_Hint.Reset();
++ }
++ }
++
++ m_Story.ReadIndexed(m_pObjStrm);
++ if(!Simple)
++ {
++ if(LwpFileHeader::m_nFileRevision<0x000B)
++ {
++ // TODO: to process
++ assert(false);
++ /*PropList = new CParaPropListProperty(this);
++ PropList->GetList()->QuickRead(pFile);
++ if(PropList->GetList()->IsEmpty())
++ {
++ delete PropList;
++ PropList = LNULL;
++ }*/
++ }
++ m_pObjStrm->QuickRead(&m_nLevel, sizeof(m_nLevel));
++
++ // test
++ if (m_nLevel > 9)
++ {
++ m_nLevel = 9;
++ }
++ // test ends
++ }
++ else
++ m_nLevel = 0x0001;
++
++ m_Fribs.SetPara(this);//add by 2/1, for silver bullet
++ m_Fribs.ReadPara(m_pObjStrm);
++
++ m_pProps = LwpParaProperty::ReadPropertyList(m_pObjStrm,this);
++}
++
++void LwpPara::Parse(IXFStream* pOutputStream)
++{
++ m_pXFContainer = new XFContentContainer;
++ XFConvert(m_pXFContainer);
++ m_pXFContainer->ToXml(pOutputStream);
++ m_pXFContainer->Reset();
++ delete m_pXFContainer;
++ m_pXFContainer = NULL;
++}
++
++void LwpPara::XFConvert(XFContentContainer* pCont)
++{
++ m_pXFContainer = pCont;
++
++ if (static_cast<LwpStory*>(m_Story.obj())->GetDropcapFlag() == sal_True)
++ {
++ ParseDropcapContent();
++ /*LwpObject* pNextPara = GetNext()->obj();
++ if(pNextPara)
++ pNextPara->XFConvert(pCont);*/
++ return;
++ }
++
++ //Add the break before para
++ if (m_pBreaks && m_nOrdinal!=0)
++ AddBreakBefore(pCont);
++
++ //Create an XFPara for this VO_PARA
++ XFParagraph *pPara = new XFParagraph;
++ pPara->SetStyleName(m_StyleName);
++
++ if(m_SectionStyleName.getLength()>0)
++ {
++ XFSection* pSection = CreateXFSection();
++ LwpStory* pStory = static_cast<LwpStory*> ( m_Story.obj() );
++ pStory->AddXFContent(pSection);
++ //pSection->Add(pPara);
++ m_pXFContainer = pSection;
++ }
++
++ if (m_bHasBullet && m_pSilverBullet)
++ {
++ XFContentContainer* pListItem = AddBulletList(m_pXFContainer);
++ if (pListItem)
++ {
++ pListItem->Add(pPara);
++ }
++ }
++ else
++ {
++ LwpBulletStyleMgr* pBulletStyleMgr = this->GetBulletStyleMgr();
++ if (pBulletStyleMgr)
++ {
++ pBulletStyleMgr->SetCurrentSilverBullet(LwpObjectID());
++ pBulletStyleMgr->SetContinueFlag(sal_False);
++ }
++ m_pXFContainer->Add(pPara);
++ }
++
++ m_Fribs.SetXFPara(pPara);
++ m_Fribs.XFConvert();
++
++ if (m_pBreaks)
++ AddBreakAfter(m_pXFContainer);
++
++ // maybe useful for futer version
++ // deleted by
++ // AddTabStopForTOC();
++
++ //Caller is responsible for calling the next para object
++ /*LwpObject* pNextPara = GetNext()->obj();
++ if(pNextPara)
++ pNextPara->XFConvert( m_pXFContainer );*/
++}
++
++sal_Bool LwpPara::RegisterMasterPage(XFParaStyle* pBaseStyle)
++{
++ sal_Bool bSuccess = sal_False;
++ //get story
++ LwpStory* pStory = static_cast<LwpStory*>(m_Story.obj());
++ //if pagelayout is modified, register the pagelayout
++ if(pStory->IsPMModified())
++ {
++ sal_Bool bNewSection = sal_False;
++ bNewSection = pStory->IsNeedSection();
++ LwpPageLayout* pLayout = pStory->GetCurrentLayout();
++ if(bNewSection)
++ {
++ RegisterNewSectionStyle(pLayout);
++ }
++
++ bSuccess = sal_True;
++ //register master page style
++ XFParaStyle* pOverStyle = new XFParaStyle();
++ *pOverStyle = *pBaseStyle;
++ pOverStyle->SetStyleName( A2OUSTR(""));
++ pOverStyle->SetMasterPage(pLayout->GetStyleName());
++ if (m_ParentStyleName.getLength())
++ pOverStyle->SetParentStyleName(m_ParentStyleName); //Add by 2005/12/12
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_StyleName = pXFStyleManager->AddStyle(pOverStyle)->GetStyleName();
++ }
++ return bSuccess;
++}
++/**
++ * @short register paragraph style
++ */
++void LwpPara::RegisterStyle()
++{ //1 reg autostyle
++// m_Fribs.SetPara(this);
++// m_Fribs.RegisterStyle();
++
++ //2 reg para style
++ if (!m_pFoundry)
++ return;
++ XFParaStyle* pBaseStyle = static_cast<XFParaStyle*>(m_pFoundry->GetStyleManager()->GetStyle(m_ParaStyle));
++ if (pBaseStyle == NULL) return;
++ m_StyleName = pBaseStyle->GetStyleName();//such intf to be added
++ m_ParentStyleName = m_StyleName;//Add by ,2005/12/12
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++
++ if (GetParaStyle()->GetIndent())
++ {
++ m_pIndentOverride = new LwpIndentOverride;
++ *m_pIndentOverride = *(GetParaStyle()->GetIndent()); //add by 2-6,for indent hierachy
++ }
++// else
++// m_pIndentOverride = NULL;
++
++ XFParaStyle* pOverStyle = NULL;
++ sal_Bool noSpacing = sal_True;
++ sal_Bool noIndent = sal_True;
++ LwpParaProperty* pBulletProps = NULL, *pNumberingProps = NULL;
++
++ if (m_pProps != NULL)
++ {
++ pOverStyle = new XFParaStyle;
++ *pOverStyle = *pBaseStyle;
++ pOverStyle->SetStyleName(A2OUSTR(""));
++ LwpParaProperty* pProps = m_pProps;
++ sal_uInt32 PropType;
++ LwpParaStyle* pParaStyle = static_cast<LwpParaStyle*>(m_ParaStyle.obj());
++ while(pProps)
++ {
++ PropType = pProps->GetType();
++ switch(PropType)
++ {
++ case PP_LOCAL_ALIGN:
++ {
++ LwpAlignmentOverride aAlign;
++ if (!pParaStyle->GetAlignment())
++ OverrideAlignment(NULL,static_cast<LwpParaAlignProperty*>(pProps)->GetAlignment(),pOverStyle);
++ else
++ {
++ aAlign = *(pParaStyle->GetAlignment());
++ OverrideAlignment(&aAlign,static_cast<LwpParaAlignProperty*>(pProps)->GetAlignment(),pOverStyle);
++ }
++ }
++ break;
++ case PP_LOCAL_INDENT:
++ {
++ noIndent = sal_False;
++ if (!pParaStyle->GetIndent())
++ OverrideIndent(NULL,static_cast<LwpParaIndentProperty*>(pProps)->GetIndent(),pOverStyle);
++
++ else
++ {
++ OverrideIndent(m_pIndentOverride,static_cast<LwpParaIndentProperty*>(pProps)->GetIndent(),pOverStyle);
++ }
++ }
++ break;
++ case PP_LOCAL_SPACING:
++ {
++ LwpSpacingOverride aSpacing;
++ noSpacing = sal_False;
++ if (!pParaStyle->GetSpacing())
++ OverrideSpacing(NULL,static_cast<LwpParaSpacingProperty*>(pProps)->GetSpacing(),pOverStyle);
++ else
++ {
++ aSpacing = *(pParaStyle->GetSpacing());
++ OverrideSpacing(&aSpacing,static_cast<LwpParaSpacingProperty*>(pProps)->GetSpacing(),pOverStyle);
++ }
++ }
++ break;
++ // 01/25/2005
++ case PP_LOCAL_BORDER:
++ {
++ OverrideParaBorder(pProps, pOverStyle);
++ break;
++ }
++ case PP_LOCAL_BREAKS:
++ {
++ OverrideParaBreaks(pProps, pOverStyle);
++ break;
++ }
++ case PP_LOCAL_BULLET:
++ {
++ pBulletProps = pProps;
++// OverrideParaBullet(pProps);
++ break;
++ }
++ case PP_LOCAL_NUMBERING:
++ {
++ pNumberingProps = pProps;
++// OverrideParaNumbering(pProps);
++ break;
++ }
++ //end
++ case PP_LOCAL_TABRACK:
++ {
++ //, 01/28/05
++ /*LwpTabOverride* pTabOverride=pParaStyle->GetTabOverride();
++ if(!pTabOverride)
++ {
++ OverrideTab(NULL,static_cast<LwpParaTabRackProperty*>(pProps)->GetTab(),pOverStyle);
++ }
++ else
++ {
++ OverrideTab(pTabOverride,static_cast<LwpParaTabRackProperty*>(pProps)->GetTab(),pOverStyle);
++ }*/
++ break;
++ }
++ case PP_LOCAL_BACKGROUND:
++ {
++/* LwpBackgroundOverride aBackground;
++ if (!pParaStyle->GetBackground())
++ OverrideBackground(NULL,static_cast<LwpParaBackGroundProperty*>(pProps)->GetBackground(),pOverStyle);
++ else
++ {
++ aBackground = *(pParaStyle->GetaBackground());
++ OverrideBackground(&aBackground,static_cast<LwpParaBackGroundProperty*>(pProps)->GetBackground(),pOverStyle);
++ }
++*/
++ // modified by , 06/03/2005
++ LwpBackgroundOverride* pBGOver = static_cast<LwpParaBackGroundProperty*>(pProps)->GetBackground();
++ if (pBGOver)
++ {
++ LwpBackgroundStuff* pBGStuff = pBGOver->GetBGStuff();
++ if (pBGStuff && !pBGStuff->IsTransparent() )
++ {
++ if (pBGStuff->IsPatternFill())
++ {
++ XFBGImage* pXFBGImage = pBGStuff->GetFillPattern();
++ pOverStyle->SetBackImage(pXFBGImage);
++ }
++ else
++ {
++ LwpColor* pColor = pBGStuff->GetFillColor();
++ if (pColor && pColor->IsValidColor())
++ {
++ XFColor aXFColor( pColor->To24Color());
++ pOverStyle->SetBackColor( aXFColor );
++ }
++ }
++ }
++ }
++ // end modified
++ break;
++ }
++ default:
++ break;
++ }
++ pProps = pProps->GetNext();
++ }
++
++ if (noIndent && m_pIndentOverride)
++ {
++ if (m_pIndentOverride->IsUseRelative() && GetParent())
++ {
++ OverrideIndent(NULL,m_pIndentOverride,pOverStyle);
++ }
++ }
++ if (m_ParentStyleName.getLength())
++ pOverStyle->SetParentStyleName(m_ParentStyleName); //Add by 2005/12/12
++ m_StyleName = pXFStyleManager->AddStyle(pOverStyle)->GetStyleName();
++
++ }
++ else //use named style
++ {
++ if (m_pIndentOverride)
++ {
++ if (m_pIndentOverride->IsUseRelative() && GetParent())
++ {
++ pOverStyle = new XFParaStyle;
++ *pOverStyle = *pBaseStyle;
++ OverrideIndent(NULL,m_pIndentOverride,pOverStyle);
++ if (m_ParentStyleName.getLength())
++ pOverStyle->SetParentStyleName(m_ParentStyleName); //Add by 2005/12/12
++ m_StyleName = pXFStyleManager->AddStyle(pOverStyle)->GetStyleName();
++ }
++ }
++ }
++
++ if (IsInCell())
++ {
++ XFParaStyle* pOldStyle = pXFStyleManager->FindParaStyle(m_StyleName);
++ if (pOldStyle->GetNumberRight())
++ {
++ pOverStyle = new XFParaStyle;
++ *pOverStyle = *pOldStyle;
++ pOverStyle->SetAlignType(enumXFAlignStart);
++ if (m_ParentStyleName.getLength())
++ pOverStyle->SetParentStyleName(m_ParentStyleName); //Add by 2005/12/12
++ m_StyleName = pXFStyleManager->AddStyle(pOverStyle)->GetStyleName();
++ }
++ }
++
++ // override bullet and numbering
++ OverrideParaBullet(pBulletProps);
++ OverrideParaNumbering(pNumberingProps);
++
++ //add by
++ //register bullet style
++ LwpBulletStyleMgr* pBulletStyleMgr = this->GetBulletStyleMgr();
++ if (pBulletStyleMgr)
++ {
++ // if has bullet or numbering
++ if (m_bHasBullet)
++ {
++ //if it's normal bullet
++ if (m_pSilverBullet)
++ {
++ if (m_pSilverBullet->HasName())
++ {
++ m_aBulletStyleName = m_pSilverBullet->GetBulletStyleName();
++ }
++ else if (!m_pBullOver->IsEditable())
++ {
++ m_aBulletStyleName = pBulletStyleMgr->RegisterBulletStyle(this, m_pBullOver, m_pIndentOverride);
++ }
++
++ // test codes
++ if (m_pSilverBullet->IsBulletOrdered())
++ {
++ rtl::OUString aPreBullStyleName;
++ LwpNumberingOverride* pNumbering = this->GetParaNumbering();
++ sal_uInt16 nPosition = pNumbering->GetPosition();
++ sal_Bool bLesser = m_pSilverBullet->IsLesserLevel(nPosition);
++ sal_Bool bResetSection = m_pSilverBullet->IsNewSection(nPosition);
++ sal_Bool bHeading;
++ LwpPara* pPara = this;
++ LwpPara* pPrePara = NULL;
++ LwpSilverBullet* pParaSilverBullet = NULL;
++ sal_uInt16 nNum = 0, nOffset = 0, nLevel = 0, nFoundLevel = 0xffff, nFoundBound = 0;
++
++ nFoundBound = nLevel = pNumbering->GetLevel();
++ if (nPosition == pNumbering->GetPosition())
++ {
++ nFoundBound++;
++ }
++ bHeading = pNumbering->IsHeading();
++
++ while(sal_True)
++ {
++ /*// When we hit the hint paragraph, we can stop and check the hint.
++ if (qNumberHint && (qPara == qNumberHint->GetPara()) &&
++ qNumberHint->Lookup(qSilverBullet, Level, Position, &Offset))
++ {
++ Num += Offset;
++ break;
++ }*/
++
++ pParaSilverBullet = pPara->GetSilverBullet();
++ pNumbering = pPara->GetParaNumbering();
++
++ if (*(pPara->GetObjectID()) != *(this->GetObjectID()))
++ {
++ if (!pParaSilverBullet)
++ {
++ break;
++ }
++
++ /* If lesser, stop when we hit an outline style whose level is
++ * higher than our current level.
++ */
++ // restart based on Outline level?
++ if (pNumbering && bLesser && (bHeading ? pNumbering->IsHeading() : sal_True))
++ {
++ if (nFoundLevel != 0xffff)
++ {
++ if (pNumbering->GetLevel() < nFoundLevel)
++ {
++ break;
++ }
++ if ((pNumbering->GetLevel() == nFoundLevel)
++ && (*(pParaSilverBullet->GetObjectID()) != *(m_pSilverBullet->GetObjectID())
++ || pNumbering->GetPosition() != nPosition))
++ {
++ break;
++ }
++ }
++ else
++ {
++ if (pNumbering && pNumbering->GetLevel() < nFoundBound && pParaSilverBullet
++ && (*(pParaSilverBullet->GetObjectID()) != *(m_pSilverBullet->GetObjectID())
++ || pNumbering->GetPosition() != nPosition))
++ {
++ nFoundBound = pNumbering->GetLevel();
++ }
++ }
++ }
++
++ /*if (qSpecificStyle
++ && qSpecificStyle == qPara->GetParaStyle(LTRUE))
++ break;
++
++ // See if we crossed a section boundary
++ if (ResetSection)
++ {
++ CurrPos.SetPara(qPara);
++ if (CurrPos <= SectionPos)
++ break;
++ }*/
++ }
++
++ // Don't bump the number if this bullet is skipped
++ if (m_pBullOver->IsSkip())
++ ;
++ else if ( pParaSilverBullet
++ && *(pParaSilverBullet->GetObjectID()) == *(m_pSilverBullet->GetObjectID())
++ && pNumbering && nPosition == pNumbering->GetPosition())
++ {
++ if (bLesser)
++ {
++ if (nFoundLevel != 0xffff)
++ {
++ if (nFoundLevel == pNumbering->GetLevel())
++ {
++ aPreBullStyleName = pPara->GetBulletStyleName();
++ nNum++;
++ }
++ }
++ else if (pNumbering->GetLevel() <= nLevel)
++ {
++ if (pNumbering->GetLevel() >= nFoundBound)
++ {
++ break;
++ }
++ nFoundLevel = pNumbering->GetLevel();
++ aPreBullStyleName = pPara->GetBulletStyleName();
++ nNum++;
++ }
++ }
++ else
++ {
++ aPreBullStyleName = pPara->GetBulletStyleName();
++ nNum++;
++ }
++ }
++
++ if (pPara && pPara->GetPrevious())
++ pPrePara = static_cast<LwpPara*>(pPara->GetPrevious()->obj(VO_PARA));
++ else
++ pPrePara=NULL;
++
++ if (!pPrePara)
++ {
++ LwpStory* pStory = pPara->GetStory();
++ pPrePara = pStory->GetLastParaOfPreviousStory();
++
++ if (!pPrePara)
++ {
++ break;
++ }
++ }
++ pPara = pPrePara;
++ }
++ nNum = nNum ? nNum : 1;
++
++ if (nNum > 1)
++ {
++ m_aBulletStyleName = aPreBullStyleName;
++ m_bBullContinue = sal_True;
++ }
++ else
++ {
++ m_bBullContinue = sal_False;
++ if (this->IsInCell())
++ {
++ XFListStyle* pOldStyle = static_cast<XFListStyle*>(pXFStyleManager->FindStyle(m_aBulletStyleName));
++ if (pOldStyle)
++ {
++ XFListStyle* pNewStyle = new XFListStyle(*pOldStyle);
++ m_aBulletStyleName = pXFStyleManager->AddStyle(pNewStyle)->GetStyleName();
++ }
++ }
++ }
++
++ LwpStory* pMyStory = this->GetStory();
++ if (pMyStory)
++ {
++ if (pMyStory->IsBullStyleUsedBefore(m_aBulletStyleName, m_aParaNumbering.GetPosition()))
++ {
++ //m_bBullContinue = sal_True;
++ }
++ else
++ {
++ pMyStory->AddBullStyleName2List(m_aBulletStyleName, m_aParaNumbering.GetPosition());
++ }
++ }
++
++ }
++ // end of test codes
++ }
++ }
++ }
++ //end add
++
++ if (noSpacing && GetPrevious())
++ {
++ LwpPara* pPrePara = static_cast<LwpPara*>(GetPrevious()->obj());
++ if (pPrePara && pPrePara->GetBelowSpacing()!=0)
++ {
++ pOverStyle = new XFParaStyle;
++ *pOverStyle = *GetXFParaStyle();
++ XFMargins* pMargin = &pOverStyle->GetMargins();
++ pMargin->SetTop(pMargin->GetTop()+pPrePara->GetBelowSpacing());
++ if (m_ParentStyleName.getLength())
++ pOverStyle->SetParentStyleName(m_ParentStyleName); //Add by 2005/12/12
++ m_StyleName = pXFStyleManager->AddStyle(pOverStyle)->GetStyleName();
++ }
++ }
++
++ //register tab style
++ if(m_Fribs.HasFrib(FRIB_TAG_TAB))
++ {
++ XFParaStyle* pParaStyle = new XFParaStyle;
++ *pParaStyle = *GetXFParaStyle();
++ //pOverStyle->SetStyleName(A2OUSTR(""));
++ this->RegisterTabStyle(pParaStyle);
++ if (m_ParentStyleName.getLength())
++ pParaStyle->SetParentStyleName(m_ParentStyleName); //Add by 2005/12/12
++ m_StyleName = pXFStyleManager->AddStyle(pParaStyle)->GetStyleName();
++ }
++
++ //register master page;
++ RegisterMasterPage(GetXFParaStyle());
++
++ // reg auto style,lay here for pagebreak need overrided para style
++ m_Fribs.SetPara(this);
++ m_Fribs.RegisterStyle();
++
++ if (m_bHasDropcap == sal_True)
++ {
++ GatherDropcapInfo();
++ XFParaStyle* pStyle = new XFParaStyle;
++ *pStyle = *GetXFParaStyle();
++ pStyle->SetDropCap(m_nChars-1,m_nLines);
++ if (m_ParentStyleName.getLength())
++ pStyle->SetParentStyleName(m_ParentStyleName); //Add by 2005/12/12
++ m_StyleName = pXFStyleManager->AddStyle(pStyle)->GetStyleName();
++ }
++ // maybe useful for futer version
++ // deleted because Leader of Table is not supported in this version
++ //AddTabStyleForTOC();
++}
++
++void LwpPara::RegisterNewSectionStyle(LwpPageLayout *pLayout)
++{
++ if( !pLayout )
++ return;
++
++ XFSectionStyle* pSectStyle= new XFSectionStyle();
++ XFColumns* pColumns = pLayout->GetXFColumns();
++ if(pColumns)
++ {
++ pSectStyle->SetColumns(pColumns);
++ }
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_SectionStyleName = pXFStyleManager->AddStyle(pSectStyle)->GetStyleName();
++}
++
++XFSection* LwpPara::CreateXFSection()
++{
++ XFSection* pXFSection = new XFSection();
++ pXFSection->SetStyleName(m_SectionStyleName);
++ m_SectionStyleName = A2OUSTR("");
++ return pXFSection;
++}
++
++/**************************************************************************
++ * @descr: register tab style
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++void LwpPara::RegisterTabStyle(XFParaStyle* pXFParaStyle)
++{
++ LwpTabOverride aFinaOverride;
++ LwpTabOverride* pBase = NULL;
++ //get the tabrack from the current layout
++ LwpStory* pStory = static_cast<LwpStory*>(m_Story.obj());
++ LwpMiddleLayout* pLayout = pStory->GetTabLayout();
++ if(pLayout)
++ {
++ pBase = pLayout->GetTabOverride();
++ if(pBase)
++ {
++ pBase->Override(&aFinaOverride);
++ }
++ }
++
++ //get the tabrack from the base parastyle
++ LwpParaStyle* pParaStyle = GetParaStyle();
++ pBase = pParaStyle->GetTabOverride();
++ if(pBase)
++ {
++ pBase->Override(&aFinaOverride);
++ }
++ //get the tabrack from the local property
++ pBase = GetLocalTabOverride();
++ if(pBase)
++ {
++ pBase->Override(&aFinaOverride);
++ }
++
++ LwpParaStyle::ApplyTab(pXFParaStyle, &aFinaOverride);
++}
++/**
++ * @short parse dropcap text
++ */
++void LwpPara::ParseDropcapContent()
++{
++ if (!GetFoundry())
++ return;
++ XFParagraph* pDropcap = GetFoundry()->GetDropcapMgr()->GetXFPara();
++ if (pDropcap)
++ {
++ m_Fribs.SetXFPara(pDropcap);
++ m_Fribs.XFConvert();
++ }
++}
++/**
++ * @short add paragraph break attribute
++ */
++void LwpPara::AddBreakBefore(XFContentContainer* pCont)
++{
++ if (!m_pBreaks)
++ return;
++ if (m_pBreaks->IsPageBreakBefore())
++ {
++ XFParagraph *pPara = new XFParagraph();
++ pPara->SetStyleName(m_BefPageBreakName);
++ pCont->Add(pPara);
++ }
++ else if (m_pBreaks->IsColumnBreakBefore())
++ {
++ XFParagraph *pPara = new XFParagraph();
++ pPara->SetStyleName(m_BefColumnBreakName);
++ pCont->Add(pPara);
++ }
++}
++
++void LwpPara::AddBreakAfter(XFContentContainer* pCont)
++{
++ if (!m_pBreaks)
++ return;
++ if (m_pBreaks->IsPageBreakAfter())
++ {
++ XFParagraph *pPara = new XFParagraph();
++ pPara->SetStyleName(m_AftPageBreakName);
++ pCont->Add(pPara);
++ }
++ else if (m_pBreaks->IsColumnBreakAfter())
++ {
++ XFParagraph *pPara = new XFParagraph();
++ pPara->SetStyleName(m_AftColumnBreakName);
++ pCont->Add(pPara);
++ }
++}
++
++LwpVirtualLayout* LwpPara::GetLayoutWithMyStory()
++{
++ LwpStory* pMyStory = NULL;
++ if (!m_Story.IsNull())
++ {
++ pMyStory = static_cast<LwpStory*>(m_Story.obj(VO_STORY));
++ if (!pMyStory)
++ {
++ return NULL;
++ }
++
++ return pMyStory->GetLayout(NULL);
++ }
++
++ return NULL;
++}
++
++LwpBulletStyleMgr* LwpPara::GetBulletStyleMgr()
++{
++ if (m_pFoundry)
++ {
++ return m_pFoundry->GetBulletStyleMgr();
++ }
++
++ return NULL;
++}
++
++XFContentContainer* LwpPara::AddBulletList(XFContentContainer* pCont)
++{
++ LwpBulletStyleMgr* pBulletStyleMgr = this->GetBulletStyleMgr();
++ if (!pBulletStyleMgr)
++ {
++ assert(false);
++ return NULL;
++ }
++
++ sal_uInt16 nLevel = m_nLevel;
++ sal_Bool bOrdered = sal_False;
++ LwpStory* pMyStory = this->GetStory();
++
++ pBulletStyleMgr->SetContinueFlag(m_bBullContinue);
++#if 0
++ if (m_pSilverBullet->IsBulletOrdered())
++ {
++ LwpObjectID aSilverBulletID = pBulletStyleMgr->GetCurrentSilverBullet();
++ if (aSilverBulletID.IsNull())
++ {
++ pBulletStyleMgr->SetContinueFlag(sal_False);
++ }
++ else if (pMyStory && pMyStory->IsBullStyleUsedBefore(m_aBulletStyleName, this->m_aParaNumbering.GetPosition()))
++ {
++ pBulletStyleMgr->SetContinueFlag(sal_True);
++ }
++/* else if (aSilverBulletID == *(m_pSilverBullet->GetObjectID()))
++ {
++ LwpNumberingOverride* pNumOver = pBulletStyleMgr->GetCurrentNumOver();
++ if (!pNumOver)
++ {
++ pBulletStyleMgr->SetContinueFlag(sal_False);
++ }
++ else if (m_aParaNumbering.GetPosition() == pNumOver->GetPosition())
++ {
++ pBulletStyleMgr->SetContinueFlag(sal_True);
++ }
++ }
++ else
++ {
++ pBulletStyleMgr->SetContinueFlag(sal_False);
++ }
++*/
++ pBulletStyleMgr->SetCurrentNumOver(m_aParaNumbering);
++ pBulletStyleMgr->SetCurrentSilverBullet(*(m_pSilverBullet->GetObjectID()));
++ }
++#endif
++
++ if (m_pSilverBullet->IsBulletOrdered())
++ {
++ bOrdered = sal_True;
++ }
++ if (m_pSilverBullet->HasName())
++ {
++// nLevel = m_pParaNumbering->GetPosition();
++ nLevel = m_aParaNumbering.GetPosition();
++ m_nLevel = nLevel;//add by ,for get para level
++// m_aBulletStyleName = m_pSilverBullet->GetBulletStyleName();
++ }
++
++ return ( pBulletStyleMgr->AddBulletList(pCont, bOrdered, m_aBulletStyleName,
++ nLevel, m_pBullOver->IsSkip()) );
++}
++
++LwpNumberingOverride* LwpPara::GetParaNumbering()
++{
++ return &m_aParaNumbering;
++#if 0
++ LwpNumberingOverride* pNumbering = NULL;
++ LwpParaStyle* pStyle = this->GetParaStyle();
++ if (pStyle)
++ {
++ pNumbering = pStyle->GetNumberingOverride();
++ }
++
++ if (pNumbering)
++ {
++/* if (m_pParaNumbering)
++ {
++ m_pParaNumbering->Override(pNumbering);
++ }*/
++ m_aParaNumbering.Override(pNumbering);
++ return pNumbering;
++ }
++ else
++ {
++// return m_pParaNumbering;
++ return &m_aParaNumbering;
++ }
++#endif
++}
++
++void LwpForked3NotifyList::Read(LwpObjectStream* pObjStrm)
++{
++ m_PersistentList.Read(pObjStrm);
++}
++
++void LwpNotifyListPersistent::Read(LwpObjectStream* pObjStrm)
++{
++ m_Head.ReadIndexed(pObjStrm);
++ pObjStrm->SkipExtra();
++}
++
++void LwpPara::Release()
++{}
++
+diff -urNp lotuswordpro.bak/source/filter/lwppara.hxx lotuswordpro/source/filter/lwppara.hxx
+--- lotuswordpro.bak/source/filter/lwppara.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwppara.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,423 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * LwpPara: Word Pro object for paragraph
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++
++#ifndef _LWPPARAGRAPH_HXX_
++#define _LWPPARAGRAPH_HXX_
++#include "lwpfribheader.hxx"
++#include "lwpobj.hxx"
++#include "lwpobjstrm.hxx"
++
++#include <vector>
++#include "lwpheader.hxx"
++#include "lwpdlvlist.hxx"
++#include "lwpbasetype.hxx"
++#include "lwpoverride.hxx"
++#include "lwpfoundry.hxx"
++#include "lwplayout.hxx"
++#include "lwpfrib.hxx"
++#include "lwpfribptr.hxx"
++#include "lwpfribtext.hxx"
++#include "xfilter/xfparagraph.hxx"
++#include "xfilter/xfdefs.hxx"
++#include "xfilter/xfparastyle.hxx"
++#include "xfilter/xfsection.hxx"
++
++class LwpParaProperty;
++class LwpPara;
++class LwpBreaksOverride;
++class LwpBulletStyleMgr;
++class LwpNotifyListPersistent
++{
++public:
++ LwpNotifyListPersistent(){};
++ void Read(LwpObjectStream* pObjStrm);
++protected:
++ LwpObjectID m_Head;
++};
++
++class LwpForked3NotifyList
++{
++public:
++ LwpForked3NotifyList(){};
++protected:
++ LwpNotifyListPersistent m_ExtraList;
++ LwpNotifyListPersistent m_PersistentList;
++public:
++ LwpNotifyListPersistent* GetExtraList(){return &m_ExtraList;}
++ void Read(LwpObjectStream* pObjStrm);
++};
++
++class LwpParaStyle;
++class LwpTabOverride;
++class LwpNumberingOverride;
++class LwpSilverBullet;
++class LwpPageLayout;
++
++struct ParaNumbering
++{
++ LwpFribText* pPrefix;
++ LwpFribParaNumber* pParaNumber;
++ LwpFribText* pSuffix;
++
++ sal_uInt16 nPrefixLevel;//hidelevels of prefix text frib
++ sal_uInt16 nNumLevel;//hidelevels of paranumber frib
++ sal_uInt16 nSuffixLevel;//hidelevels of suffix text frib
++
++ ParaNumbering()
++ {
++ clear();
++ }
++
++ void clear()
++ {
++ pPrefix = NULL;
++ pParaNumber = NULL;
++ pSuffix = NULL;
++ nPrefixLevel = 0;
++ nNumLevel = 0;
++ nSuffixLevel = 0;
++ }
++};
++
++class LwpDropcapLayout;
++class LwpCellLayout;
++class LwpPara : public LwpDLVList
++{
++public:
++ LwpPara(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ ~LwpPara();
++public:
++ void Read();
++ void RegisterStyle();
++ void Parse(IXFStream* pOutputStream);
++ void XFConvert(XFContentContainer* pCont);
++ void Release();
++
++ LwpPara* GetParent();
++ LwpObjectID* GetStoryID();
++ LwpStory* GetStory();
++ LwpBreaksOverride* GetBreaks();
++
++ LwpParaStyle* GetParaStyle();
++ XFParaStyle* GetXFParaStyle();
++ LwpIndentOverride* GetIndent();
++ LwpTabOverride* GetLocalTabOverride();
++ LwpNumberingOverride* GetParaNumbering();
++
++ inline LwpSilverBullet* GetSilverBullet();
++ inline LwpObjectID GetSilverBulletID();
++ rtl::OUString GetBulletChar() const;
++ sal_uInt32 GetBulletFontID() const;
++ sal_uInt16 GetLevel() const;
++ sal_Bool GetBulletFlag() const;
++
++ void GetParaNumber(sal_uInt16 nPosition, ParaNumbering* pParaNumbering);
++ LwpFribPtr* GetFribs();
++ double GetBelowSpacing();
++ LwpParaProperty* GetProperty(sal_uInt32 nPropType);
++ void GatherDropcapInfo();
++ rtl::OUString GetBulletStyleName() const;
++ void SetBelowSpacing(double value);
++ void SetBulletStyleName(const rtl::OUString& rNewName);
++ void SetBulletFlag(sal_Bool bFlag);
++ void SetIndent(LwpIndentOverride* pIndentOverride);
++ void SetFirstFrib(rtl::OUString Content,sal_uInt32 FontID);
++ OUString GetContentText(sal_Bool bAllText = sal_False);
++
++ void SetParaDropcap(sal_Bool bFlag);
++ void SetDropcapLines(sal_uInt16 number);
++ void SetDropcapChars(sal_uInt32 chars);
++ void SetDropcapLayout(LwpDropcapLayout* pLayout);
++ sal_Bool IsHasDropcap();
++
++ XFContentContainer* GetXFContainer();
++ void AddXFContent(XFContent* pCont);
++ void SetXFContainer(XFContentContainer* pCont);
++ void FindLayouts();// for register pagelayout, add by , 02/20/2005
++ void RegisterTabStyle(XFParaStyle* pXFParaStyle);
++
++ // add by 04/13/2005
++ LwpVirtualLayout* GetLayoutWithMyStory();
++ LwpBulletStyleMgr* GetBulletStyleMgr();
++ sal_uInt32 GetOrdinal(){ return m_nOrdinal;};
++ sal_Bool operator <(LwpPara& Other);
++ sal_Bool ComparePagePosition(LwpVirtualLayout* pPreLayout, LwpVirtualLayout* pNextLayout);
++// rtl::OUString RegisterBulletStyle();
++ // end add
++
++ sal_Bool IsNumberRight();
++ sal_Bool IsInCell();
++
++ void SetAllText(OUString sText);
++ OUString GetStyleName(){return m_StyleName;}
++
++protected:
++ sal_uInt32 m_nOrdinal; // Ordinal number of this paragraph
++ LwpObjectID m_ParaStyle; // handle of paragraph style
++ LwpPoint m_Hint; // Paragraph hint - width & height
++ LwpObjectID m_Story; // Story the paragraph is part of
++
++ sal_uInt16 m_nFlags;
++ sal_uInt16 m_nLevel;
++ LwpFribPtr m_Fribs;
++ LwpParaProperty* m_pProps;
++ //LwpForked3NotifyList* m_NotifyList; //not saved
++
++ rtl::OUString m_StyleName;
++ rtl::OUString m_ParentStyleName;//Add by ,to support toc,2005/12/13
++ LwpBreaksOverride* m_pBreaks;
++ rtl::OUString m_AftPageBreakName;
++ rtl::OUString m_BefPageBreakName;
++ rtl::OUString m_AftColumnBreakName;
++
++ rtl::OUString m_BefColumnBreakName;
++ LwpIndentOverride* m_pIndentOverride;
++ rtl::OUString m_Content;//for silver bullet,get text of first frib, add by 2/1
++ sal_uInt32 m_FontID;//for silver bullet, add by 2/1
++ rtl::OUString m_AllText;//get all text in this paragraph
++
++ //add by
++ sal_Bool m_bHasBullet;
++ LwpObjectID m_aSilverBulletID;
++ LwpSilverBullet* m_pSilverBullet;
++ LwpBulletOverride* m_pBullOver;
++// LwpNumberingOverride* m_pParaNumbering;
++ LwpNumberingOverride m_aParaNumbering;
++ rtl::OUString m_aBulletStyleName;
++ sal_Bool m_bBullContinue;
++ //end add
++
++ OUString m_SectionStyleName;
++ sal_Bool m_bHasDropcap;
++ sal_uInt16 m_nLines;
++ sal_uInt32 m_nChars;
++ LwpDropcapLayout* m_pDropcapLayout;
++ double m_BelowSpacing;
++
++ XFContentContainer* m_pXFContainer; //Current container for VO_PARA
++
++ rtl::OUString m_TabStyleName;
++ enum
++ {
++ /* bit definitions for the paragraph object flags */
++ DEMAND_LOAD = 0x0001, // need to demand load this para
++ DATA_DIRTY = 0x0002, // paragraph data is dirty
++ SPELLSTARTOVER = 0x0004, // need to recheck paragraph
++ SPELLDIRTY = 0x0008, // has misspelled word in para
++ SPELLCHECKING = 0x0010, // started checking paragraph
++ READING = 0x0020, // We're loading this para from disk
++ DISKCHANGED = 0x0040, // Read size different from write size
++ USEFLOWBREAKS = 0x0080, // Use line breaks provided by filter
++ VALID_LEVEL = 0x0100, // cLevel is valid
++ NOUSECOUNT = 0x0200, // Don't change the style's use count
++ CHANGED = 0x0400, // This para has been edited
++ SPREADBULLET = 0x0800, // Para's bullet is in edit-on-page mode
++ NEWBULLET = 0x1000, // Bullets should have new font behavior
++
++ // Don't write these flags out to disk
++ NOWRITEFLAGS = (READING | DISKCHANGED | CHANGED),
++
++ MAX_INDENT_LEVELS = 10
++ };
++private:
++ void OverrideAlignment(LwpAlignmentOverride* base,LwpAlignmentOverride* over,XFParaStyle* pOverStyle);//add by 1-24
++ void OverrideIndent(LwpIndentOverride* base,LwpIndentOverride* over,XFParaStyle* pOverStyle);
++ void OverrideSpacing(LwpSpacingOverride* base,LwpSpacingOverride* over,XFParaStyle* pOverStyle);
++ void OverrideParaBorder(LwpParaProperty* pProps, XFParaStyle* pOverStyle);
++ void OverrideParaBreaks(LwpParaProperty* pProps, XFParaStyle* pOverStyle);
++
++ void OverrideParaBullet(LwpParaProperty* pProps);
++ void OverrideParaNumbering(LwpParaProperty* pProps);
++ void OverrideTab(LwpTabOverride* base,LwpTabOverride* over,XFParaStyle* pOverStyle);
++ BOOL IsBadHintsInFile();
++
++ //void OutPutSectionTail(IXFStream* pOutputStream);
++ //void OutPutBulletTail(LwpBulletStyleMgr* pBulletStyleMgr,IXFStream* pOutputStream);
++
++ sal_Bool RegisterMasterPage(XFParaStyle* pBaseStyle);
++ void RegisterNewSectionStyle(LwpPageLayout* pLayout);
++
++ void ParseDropcapContent();
++ XFContentContainer* AddBulletList(XFContentContainer* pCont);
++ void AddBreakAfter(XFContentContainer* pCont);
++ void AddBreakBefore(XFContentContainer* pCont);
++ XFSection* CreateXFSection();
++
++ /*
++ sal_Bool IsNeedTabForTOC();
++ void AddTabStyleForTOC();
++ void AddTabStopForTOC();
++ maybe useful for futer version */
++};
++
++inline LwpSilverBullet* LwpPara::GetSilverBullet()
++{
++ return m_pSilverBullet;
++}
++inline LwpObjectID LwpPara::GetSilverBulletID()
++{
++ return m_aSilverBulletID;
++}
++inline rtl::OUString LwpPara::GetBulletChar() const
++{
++ return m_Content;
++}
++inline sal_uInt32 LwpPara::GetBulletFontID() const
++{
++ return m_FontID;
++}
++inline sal_uInt16 LwpPara::GetLevel() const
++{
++ return m_nLevel;
++}
++inline void LwpPara::SetBulletStyleName(const rtl::OUString& rNewName)
++{
++ m_aBulletStyleName = rNewName;
++}
++inline void LwpPara::SetBulletFlag(sal_Bool bFlag)
++{
++ m_bHasBullet = bFlag;
++}
++inline sal_Bool LwpPara::GetBulletFlag() const
++{
++ return m_bHasBullet;
++}
++inline LwpFribPtr* LwpPara::GetFribs()
++{
++ return &m_Fribs;
++}
++inline LwpBreaksOverride* LwpPara::GetBreaks()
++{
++ return m_pBreaks;
++}
++inline XFContentContainer* LwpPara::GetXFContainer()
++{
++ return m_pXFContainer;
++}
++inline rtl::OUString LwpPara::GetBulletStyleName() const
++{
++ return m_aBulletStyleName;
++}
++inline void LwpPara::AddXFContent(XFContent* pCont)
++{
++ m_pXFContainer->Add(pCont);
++}
++inline void LwpPara::SetXFContainer(XFContentContainer* pCont)
++{
++ m_pXFContainer = pCont;
++}
++inline LwpIndentOverride* LwpPara::GetIndent()
++{
++ return m_pIndentOverride;
++}
++inline void LwpPara::SetIndent(LwpIndentOverride* pIndentOverride)
++{
++ if (m_pIndentOverride)
++ delete m_pIndentOverride;
++ m_pIndentOverride = pIndentOverride;
++}
++inline LwpObjectID* LwpPara::GetStoryID()
++{
++ return &m_Story;
++}
++inline LwpStory* LwpPara::GetStory()
++{
++ if (m_Story.obj())
++ return static_cast<LwpStory*>(m_Story.obj());
++ return NULL;
++}
++
++inline sal_Bool LwpPara::IsHasDropcap()
++{
++ return m_bHasDropcap;
++}
++inline void LwpPara::SetParaDropcap(sal_Bool bFlag)
++{
++ m_bHasDropcap = bFlag;
++}
++inline void LwpPara::SetDropcapLines(sal_uInt16 number)
++{
++ m_nLines = number;
++}
++inline void LwpPara::SetDropcapChars(sal_uInt32 chars)
++{
++ m_nChars = chars;
++}
++inline void LwpPara::SetDropcapLayout(LwpDropcapLayout* pLayout)
++{
++ m_pDropcapLayout = pLayout;
++}
++inline BOOL LwpPara::IsBadHintsInFile()
++{
++ return (BOOL) ((m_nFlags & DOC_BADFILEPARAHINTS) != 0);
++}
++inline double LwpPara::GetBelowSpacing()
++{
++ return m_BelowSpacing;
++}
++inline void LwpPara::SetBelowSpacing(double value)
++{
++ m_BelowSpacing = value;
++}
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpparaproperty.cxx lotuswordpro/source/filter/lwpparaproperty.cxx
+--- lotuswordpro.bak/source/filter/lwpparaproperty.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpparaproperty.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,298 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++#include "lwpparaproperty.hxx"
++#include "lwpobjtags.hxx"
++#include "lwppara.hxx"
++
++LwpParaProperty* LwpParaProperty::ReadPropertyList(LwpObjectStream* pFile,LwpObject* Whole)
++{
++ sal_uInt32 tag;
++ LwpParaProperty* Prop= NULL;
++ LwpParaProperty* NewProp= NULL;
++ sal_uInt16 Len;
++
++ for(;;)
++ {
++ pFile->QuickRead(&tag,sizeof(sal_uInt32));
++ // Keep reading properties until we hit the end tag
++ if (tag == TAG_ENDSUBOBJ)
++ break;
++
++ // Get the length of this property
++ pFile->QuickRead(&Len,sizeof(sal_uInt16));
++
++ // Create whatever kind of tag we just found
++ switch (tag)
++ {
++ case TAG_PARA_ALIGN:
++ NewProp = new LwpParaAlignProperty(pFile);
++ break;
++
++ case TAG_PARA_INDENT:
++ NewProp = new LwpParaIndentProperty(pFile);
++ break;
++
++ case TAG_PARA_SPACING:
++ NewProp = new LwpParaSpacingProperty(pFile);
++ break;
++
++ case TAG_PARA_BORDER:
++ NewProp = new LwpParaBorderProperty(pFile);
++ break;
++
++ case TAG_PARA_BACKGROUND:
++ NewProp = new LwpParaBackGroundProperty(pFile);
++ break;
++
++ case TAG_PARA_BREAKS:
++ NewProp = new LwpParaBreaksProperty(pFile);
++ break;
++
++ case TAG_PARA_BULLET:
++ NewProp = new LwpParaBulletProperty(pFile);
++ static_cast<LwpPara*>(Whole)->SetBulletFlag(sal_True);
++ break;
++
++ case TAG_PARA_NUMBERING:
++ NewProp = new LwpParaNumberingProperty(pFile);
++ break;
++
++ case TAG_PARA_TAB:
++ NewProp = new LwpParaTabRackProperty(pFile);
++ break;
++/*
++#ifdef KINSOKU
++ case TAG_PARA_KINSOKU:
++ NewProp = new CParaKinsokuProperty(pFile);
++ break;
++#endif
++
++ case TAG_PARA_PROPLIST:
++ NewProp = new CParaPropListProperty(pFile,Whole);
++ break;
++
++ case TAG_PARA_SHOW:
++ case TAG_PARA_HIDE:
++ // Ignore these properties
++*/ default:
++ pFile->SeekRel(Len);
++ NewProp = NULL;
++ break;
++ }
++ // Stick it at the beginning of the list
++ if (NewProp)
++ {
++ NewProp->insert(Prop, NULL);
++ Prop = NewProp;
++ }
++ }
++ return Prop;
++}
++
++LwpParaAlignProperty::LwpParaAlignProperty(LwpObjectStream* pFile)
++{
++// pFile->SeekRel(3);
++ LwpObjectID align;
++ align.ReadIndexed(pFile);
++ m_pAlignment =static_cast<LwpAlignmentOverride*>
++ (static_cast<LwpAlignmentPiece*>(align.obj(VO_ALIGNMENTPIECE))->GetOverride());
++/* if(pFile->GetFileRevision() < 0x000b)
++ {
++ CAlignmentPieceGuts guts;
++ CAlignmentPiece::QuickReadGuts(pFile, &guts);
++ cAlignment = GetPieceManager()->GetAlignmentPiece(&guts);
++ }
++ else
++ {
++ LwpFoundry* OldFoundry = pFile->GetFoundry();
++ pFile->SetFoundry(GetPieceManager()->GetFoundry());
++ cAlignment.QuickRead(pFile);
++ pFile->SetFoundry(OldFoundry);
++ } */
++}
++
++LwpParaAlignProperty::~LwpParaAlignProperty(void)
++{
++}
++
++sal_uInt32 LwpParaAlignProperty::GetType(void)
++{
++ return PP_LOCAL_ALIGN;
++}
++
++LwpParaIndentProperty::LwpParaIndentProperty(LwpObjectStream* pFile)
++{
++// LwpObjectID indent;
++ m_aIndentID.ReadIndexed(pFile);
++ m_pIndent = static_cast<LwpIndentOverride*>
++ (static_cast<LwpIndentPiece*>(m_aIndentID.obj(VO_INDENTPIECE))->GetOverride());
++}
++
++LwpParaIndentProperty::~LwpParaIndentProperty(void)
++{
++}
++
++sal_uInt32 LwpParaIndentProperty::GetType(void)
++{
++ return PP_LOCAL_INDENT;
++}
++
++LwpParaSpacingProperty::LwpParaSpacingProperty(LwpObjectStream* pFile)
++{
++ LwpObjectID spacing;
++ spacing.ReadIndexed(pFile);
++ m_pSpacing = static_cast<LwpSpacingOverride*>
++ (static_cast<LwpSpacingPiece*>(spacing.obj(VO_SPACINGPIECE))->GetOverride());
++}
++
++LwpParaSpacingProperty::~LwpParaSpacingProperty(void)
++{
++}
++
++sal_uInt32 LwpParaSpacingProperty::GetType(void)
++{
++ return PP_LOCAL_SPACING;
++}
++
++// 01/25/2004////////////////////////////////////////////////////////
++LwpParaBorderProperty::LwpParaBorderProperty(LwpObjectStream* pStrm) :
++m_pParaBorderOverride(NULL)
++{
++ LwpObjectID aParaBorder;
++ aParaBorder.ReadIndexed(pStrm);
++
++ if (!aParaBorder.IsNull())
++ {
++ m_pParaBorderOverride = static_cast<LwpParaBorderOverride*>
++ (static_cast<LwpParaBorderPiece*>(aParaBorder.obj())->GetOverride());
++ }
++}
++
++LwpParaBreaksProperty::LwpParaBreaksProperty(LwpObjectStream* pStrm) :
++m_pBreaks(NULL)
++{
++ LwpObjectID aBreaks;
++ aBreaks.ReadIndexed(pStrm);
++
++ if (!aBreaks.IsNull())
++ {
++ m_pBreaks = static_cast<LwpBreaksOverride*>
++ (static_cast<LwpBreaksPiece*>(aBreaks.obj())->GetOverride());
++ }
++}
++
++LwpParaBulletProperty::LwpParaBulletProperty(LwpObjectStream* pStrm) :
++m_pBullet(new LwpBulletOverride)
++{
++ m_pBullet->Read(pStrm);
++}
++
++LwpParaBulletProperty::~LwpParaBulletProperty()
++{
++ if (m_pBullet)
++ {
++ delete m_pBullet;
++ }
++}
++
++LwpParaNumberingProperty::LwpParaNumberingProperty(LwpObjectStream * pStrm)
++{
++ LwpObjectID aNumberingPiece;
++ aNumberingPiece.ReadIndexed(pStrm);
++ if (aNumberingPiece.IsNull())
++ {
++ return;
++ }
++
++ m_pNumberingOverride = static_cast<LwpNumberingOverride*>
++ (static_cast<LwpNumberingPiece*>(aNumberingPiece.obj(VO_NUMBERINGPIECE))->GetOverride());
++
++}
++//end//////////////////////////////////////////////////////////////////////
++
++LwpParaTabRackProperty::LwpParaTabRackProperty(LwpObjectStream* pFile)
++{
++ LwpObjectID aTabRack;
++ aTabRack.ReadIndexed(pFile);
++ m_pTabOverride =static_cast<LwpTabOverride*>(static_cast<LwpTabPiece*>(aTabRack.obj())->GetOverride());
++}
++
++LwpParaTabRackProperty::~LwpParaTabRackProperty()
++{
++}
++
++LwpParaBackGroundProperty::LwpParaBackGroundProperty(LwpObjectStream* pFile)
++{
++ LwpObjectID background;
++ background.ReadIndexed(pFile);
++ m_pBackground = static_cast<LwpBackgroundOverride*>(
++ static_cast<LwpBackgroundPiece*>(background.obj())->GetOverride());
++}
++
++LwpParaBackGroundProperty::~LwpParaBackGroundProperty()
++{
++}
++
++
++
++
+diff -urNp lotuswordpro.bak/source/filter/lwpparaproperty.hxx lotuswordpro/source/filter/lwpparaproperty.hxx
+--- lotuswordpro.bak/source/filter/lwpparaproperty.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpparaproperty.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,319 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++#ifndef _LWPPARAPROPERTY_HXX_
++#define _LWPPARAPROPERTY_HXX_
++
++#include "lwpobj.hxx"
++#include "lwpobjstrm.hxx"
++#include "lwpdllist.hxx"
++
++#include "lwpoverride.hxx"
++#include "lwppiece.hxx"
++
++/* paragraph property ID's */
++#define PP_OUTLINE_SHOW 0x53484f4cUL /* "SHOW" */
++#define PP_OUTLINE_HIDE 0x48494445UL /* "HIDE" */
++#define PP_LOCAL_ALIGN 0x414c494eUL /* "ALIN" */
++#define PP_LOCAL_INDENT 0x494e444eUL /* "INDN" */
++#define PP_LOCAL_SPACING 0x5350434eUL /* "SPCN" */
++#define PP_LOCAL_TABRACK 0x54414253UL /* "TABS" */
++#define PP_LOCAL_BREAKS 0x42524b53UL /* "BRKS" */
++#define PP_LOCAL_BULLET 0x42554c4cUL /* "BULL" */
++#define PP_LOCAL_BORDER 0x424f5244UL /* "BORD" */
++#define PP_LOCAL_BACKGROUND 0x4241434bUL /* "BACK" */
++#define PP_LOCAL_NUMBERING 0x4e4d4252UL /* "NMBR" */
++#define PP_LOCAL_KINSOKU 0x4b494e53UL /* "KINS" */
++#define PP_PROPLIST 0x50524f50UL /* "PROP" */
++
++class LwpParaProperty : public LwpDLList
++{
++public:
++ LwpParaProperty(){};
++ virtual ~LwpParaProperty(void){};
++ virtual sal_uInt32 GetType(void) = 0;
++ inline LwpParaProperty* GetNext(void);
++ inline LwpParaProperty* GetPrevious(void);
++
++ static LwpParaProperty* ReadPropertyList(LwpObjectStream* pFile,LwpObject* Whole);
++
++};
++
++inline LwpParaProperty* LwpParaProperty::GetNext(void)
++{
++ return static_cast<LwpParaProperty*>(LwpDLList::GetNext());
++}
++
++inline LwpParaProperty* LwpParaProperty::GetPrevious(void)
++{
++ return static_cast<LwpParaProperty*>(LwpDLList::GetPrevious());
++}
++
++//align/indent/spacing
++//TO DO:border/backgroud etc
++
++
++class LwpParaAlignProperty : public LwpParaProperty
++{
++public:
++// LwpParaAlignProperty(LwpParaAlignProperty* pOther);
++ LwpParaAlignProperty(LwpObjectStream* pFile);
++ virtual ~LwpParaAlignProperty(void);
++ LwpAlignmentOverride* GetAlignment(void);
++ sal_uInt32 GetType(void);
++
++private:
++// LwpAlignmentPiece m_Alignment;
++ LwpAlignmentOverride* m_pAlignment;
++};
++
++inline LwpAlignmentOverride* LwpParaAlignProperty::GetAlignment(void)
++{
++// return static_cast<LwpAlignmentOverride*>(m_Alignment.m_pOverride);
++ return m_pAlignment; //add by 1-24
++}
++
++class LwpParaIndentProperty : public LwpParaProperty
++{
++public:
++ LwpParaIndentProperty(LwpObjectStream* pFile);
++ virtual ~LwpParaIndentProperty(void);
++ LwpIndentOverride* GetIndent(void);
++ sal_uInt32 GetType(void);
++ //add by , 03/22/2005
++ inline LwpObjectID GetIndentID();
++ //end add
++
++private:
++ //add by , 03/22/2005
++ LwpObjectID m_aIndentID;
++ //end add
++ LwpIndentOverride* m_pIndent;
++};
++inline LwpObjectID LwpParaIndentProperty::GetIndentID()
++{
++ return m_aIndentID;
++}
++inline LwpIndentOverride* LwpParaIndentProperty::GetIndent(void)
++{
++ return m_pIndent;
++}
++
++class LwpParaSpacingProperty : public LwpParaProperty
++{
++public:
++ LwpParaSpacingProperty(LwpObjectStream* pFile);
++ virtual ~LwpParaSpacingProperty(void);
++ LwpSpacingOverride* GetSpacing(void);
++ sal_uInt32 GetType(void);
++private:
++ LwpSpacingOverride* m_pSpacing;
++
++};
++
++inline LwpSpacingOverride* LwpParaSpacingProperty::GetSpacing(void)
++{
++ return m_pSpacing;
++}
++
++//add by , 01/25/2005////////////////////////////////////////////
++class LwpParaBorderOverride;
++class LwpParaBorderProperty : public LwpParaProperty
++{
++public:
++ LwpParaBorderProperty(LwpObjectStream* pStrm);
++
++ inline sal_uInt32 GetType();
++
++ inline LwpParaBorderOverride* GetLocalParaBorder();
++
++private:
++ LwpParaBorderOverride* m_pParaBorderOverride;
++};
++
++inline LwpParaBorderOverride* LwpParaBorderProperty::GetLocalParaBorder()
++{
++ return m_pParaBorderOverride;
++}
++
++inline sal_uInt32 LwpParaBorderProperty::GetType()
++{
++ return PP_LOCAL_BORDER;
++}
++
++class LwpParaBreaksProperty : public LwpParaProperty
++{
++public:
++ LwpParaBreaksProperty(LwpObjectStream* pStrm);
++
++ inline sal_uInt32 GetType();
++
++ inline LwpBreaksOverride* GetLocalParaBreaks();
++
++private:
++ LwpBreaksOverride* m_pBreaks;
++
++};
++
++inline sal_uInt32 LwpParaBreaksProperty::GetType()
++{
++ return PP_LOCAL_BREAKS;
++}
++inline LwpBreaksOverride* LwpParaBreaksProperty::GetLocalParaBreaks()
++{
++ return m_pBreaks;
++}
++
++
++class LwpParaBulletProperty : public LwpParaProperty
++{
++public:
++ LwpParaBulletProperty(LwpObjectStream* pStrm);
++
++ virtual ~LwpParaBulletProperty();
++
++ inline sal_uInt32 GetType();
++
++ inline LwpBulletOverride* GetLocalParaBullet();
++
++private:
++ LwpBulletOverride* m_pBullet;
++};
++
++inline sal_uInt32 LwpParaBulletProperty::GetType()
++{
++ return PP_LOCAL_BULLET;
++}
++inline LwpBulletOverride* LwpParaBulletProperty::GetLocalParaBullet()
++{
++ return m_pBullet;
++}
++
++
++class LwpParaNumberingProperty : public LwpParaProperty
++{
++public:
++ LwpParaNumberingProperty(LwpObjectStream* pStrm);
++
++ inline sal_uInt32 GetType();
++
++ inline LwpNumberingOverride* GetLocalNumbering() const;
++private:
++ LwpNumberingOverride* m_pNumberingOverride;
++};
++inline sal_uInt32 LwpParaNumberingProperty::GetType()
++{
++ return PP_LOCAL_NUMBERING;
++}
++inline LwpNumberingOverride* LwpParaNumberingProperty::GetLocalNumbering() const
++{
++ return m_pNumberingOverride;
++}
++//end add/////////////////////////////////////////////////////////////
++
++
++class LwpParaTabRackProperty : public LwpParaProperty
++{
++public:
++ LwpParaTabRackProperty(LwpObjectStream* pStrm);
++ ~LwpParaTabRackProperty(void);
++ inline sal_uInt32 GetType();
++
++ inline LwpTabOverride* GetTab(); //should add by , note by 1/28
++
++private:
++ LwpTabOverride* m_pTabOverride;
++};
++
++inline LwpTabOverride* LwpParaTabRackProperty::GetTab()
++{
++ return m_pTabOverride;
++}
++
++inline sal_uInt32 LwpParaTabRackProperty::GetType(void)
++{
++ return PP_LOCAL_TABRACK;
++}
++
++
++class LwpParaBackGroundProperty : public LwpParaProperty
++{
++public:
++ LwpParaBackGroundProperty(LwpObjectStream* pFile);
++ virtual ~LwpParaBackGroundProperty(void);
++ LwpBackgroundOverride* GetBackground(void);
++ sal_uInt32 GetType(void);
++private:
++ LwpBackgroundOverride* m_pBackground;
++};
++
++inline LwpBackgroundOverride* LwpParaBackGroundProperty::GetBackground(void)
++{
++ return m_pBackground;
++}
++
++inline sal_uInt32 LwpParaBackGroundProperty::GetType()
++{
++ return PP_LOCAL_BACKGROUND;
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpparastyle.cxx lotuswordpro/source/filter/lwpparastyle.cxx
+--- lotuswordpro.bak/source/filter/lwpparastyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpparastyle.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,795 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++
++#include "lwpparastyle.hxx"
++#include "lwpfilehdr.hxx"
++#include "lwpoverride.hxx"
++#include "lwpparaborderoverride.hxx"
++#include "lwpbreaksoverride.hxx"
++#include "lwpnumberingoverride.hxx"
++#include "lwptaboverride.hxx"
++#include "lwpbackgroundoverride.hxx"
++#include "xfilter/xfdefs.hxx"
++#include "xfilter/xfparastyle.hxx"
++#include "xfilter/xfborders.hxx"
++#include "lwpfont.hxx"
++#include "lwpfoundry.hxx"
++#include "lwppiece.hxx"
++#include "lwpshadow.hxx"
++#include "lwpborderstuff.hxx"
++#include "lwpmargins.hxx"
++#include "lwptabrack.hxx"
++
++#include "lwpsilverbullet.hxx"
++
++
++LwpParaStyle::LwpParaStyle(LwpObjectHeader& objHdr, LwpSvStream* pStrm) :
++LwpTextStyle(objHdr, pStrm), m_pKinsokuOptsOverride(new LwpKinsokuOptsOverride),
++m_pBulletOverride(new LwpBulletOverride)
++{
++}
++
++LwpParaStyle::~LwpParaStyle()
++{
++ if (m_pKinsokuOptsOverride)
++ {
++ delete m_pKinsokuOptsOverride;
++ }
++
++ if (m_pBulletOverride)
++ {
++ delete m_pBulletOverride;
++ }
++}
++
++void LwpParaStyle::Read()
++{
++ LwpTextStyle::Read();
++
++ if (LwpFileHeader::m_nFileRevision < 0x000B)
++ {
++ // read many overrides
++ LwpAlignmentOverride aAlignOverride;
++ aAlignOverride.Read(m_pObjStrm);
++
++ LwpSpacingOverride aSpacingOverride;
++ aSpacingOverride.Read(m_pObjStrm);
++
++ LwpIndentOverride aIndentOverride;
++ aIndentOverride.Read(m_pObjStrm);
++
++ LwpParaBorderOverride aPBOverride;
++ aPBOverride.Read(m_pObjStrm);
++
++ LwpBreaksOverride aBreaksOverride;
++ aBreaksOverride.Read(m_pObjStrm);
++
++ LwpNumberingOverride aNumberingOverride;
++ aNumberingOverride.Read(m_pObjStrm);
++
++ LwpTabOverride aTabOverride;
++ aTabOverride.Read(m_pObjStrm);
++
++ }
++ else
++ {
++ m_AlignmentStyle.ReadIndexed(m_pObjStrm);
++ m_SpacingStyle.ReadIndexed(m_pObjStrm);
++ m_IndentStyle.ReadIndexed(m_pObjStrm);
++ m_BorderStyle.ReadIndexed(m_pObjStrm);
++ m_BreaksStyle.ReadIndexed(m_pObjStrm);
++ m_NumberingStyle.ReadIndexed(m_pObjStrm);
++ m_TabStyle.ReadIndexed(m_pObjStrm);
++
++ m_pKinsokuOptsOverride->Read(m_pObjStrm);
++ m_pBulletOverride->Read(m_pObjStrm);
++
++ if (m_pObjStrm->CheckExtra())
++ {
++ m_BackgroundStyle.ReadIndexed(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++ }
++
++
++ }
++}
++
++void LwpParaStyle::Apply(XFParaStyle *pParaStyle)
++{
++ assert(pParaStyle);
++ LwpVirtualPiece *pPiece = NULL;
++ //alignment:
++ pPiece = (LwpVirtualPiece*)m_AlignmentStyle.obj();
++ if( pPiece )
++ {
++ LwpAlignmentOverride *pAlign = (LwpAlignmentOverride*)pPiece->GetOverride();
++ if( pAlign )
++ ApplyAlignment(pParaStyle,pAlign);
++ }
++
++ //don't known top and bottom indent now.
++ pPiece = (LwpVirtualPiece*)m_IndentStyle.obj();
++ if( pPiece )
++ {
++ LwpIndentOverride *pIndent = (LwpIndentOverride*)pPiece->GetOverride();
++ if( pIndent )
++ {
++ if (!m_pBulletOverride->IsInValid())//Add by ,for remove bullet indent in named bullet style
++ {
++ LwpIndentOverride* pNewIndent = new LwpIndentOverride;
++ *pNewIndent = *pIndent;
++ pNewIndent->SetMFirst(0);
++ pNewIndent->SetMRest(0);
++ ApplyIndent(NULL,pParaStyle,pNewIndent);
++ delete pNewIndent;
++ }
++ else
++ ApplyIndent(NULL,pParaStyle,pIndent);
++ }
++ }
++ //shadow & borders.
++ pPiece = (LwpVirtualPiece*)m_BorderStyle.obj();
++ if( pPiece )
++ {
++ LwpParaBorderOverride *pBorder = (LwpParaBorderOverride*)pPiece->GetOverride();
++ if( pBorder )
++ {
++ this->ApplyParaBorder(pParaStyle, pBorder);
++ }
++ }
++
++ pPiece = (LwpVirtualPiece*)m_SpacingStyle.obj();
++ if (pPiece)
++ {
++ LwpSpacingOverride *pSpacing = (LwpSpacingOverride*)pPiece->GetOverride();
++ if( pSpacing)
++ ApplySpacing(NULL,pParaStyle,pSpacing);
++ }
++
++ //paragraph background.
++ pPiece = (LwpVirtualPiece*)m_BackgroundStyle.obj();
++ if( pPiece )
++ {
++ LwpBackgroundOverride *pBack = (LwpBackgroundOverride*)pPiece->GetOverride();
++ if( pBack )
++ {
++ LwpColor color = pBack->GetBackColor();
++ XFColor aXFColor( color.To24Color() );
++ pParaStyle->SetBackColor( aXFColor );
++ }
++ }
++
++ // 01/28/2005
++ //add tab style
++ pPiece = (LwpVirtualPiece*)m_TabStyle.obj();
++ if( pPiece )
++ {
++ LwpTabOverride *pTab=(LwpTabOverride*)pPiece->GetOverride();
++ if(pTab)
++ {
++ ApplyTab(pParaStyle,pTab);
++ }
++ }
++ //add by 2005/02/16
++ pPiece = (LwpVirtualPiece*)m_BreaksStyle.obj();
++ if( pPiece )
++ {
++ LwpBreaksOverride *pBreak=(LwpBreaksOverride*)pPiece->GetOverride();
++ if(pBreak)
++ {
++ ApplyBreaks(pParaStyle,pBreak);
++ }
++ }
++ //add end
++}
++
++void LwpParaStyle::ApplySubBorder(LwpBorderStuff* pBorderStuff, LwpBorderStuff::BorderType eType, XFBorders* pXFBorders)
++{
++ enumXFBorder eXFBorderSide = enumXFBorderNone;
++ switch (eType)
++ {
++ case LwpBorderStuff::LEFT:
++ eXFBorderSide = enumXFBorderLeft;
++ break;
++ case LwpBorderStuff::RIGHT:
++ eXFBorderSide = enumXFBorderRight;
++ break;
++ case LwpBorderStuff::TOP:
++ eXFBorderSide = enumXFBorderTop;
++ break;
++ case LwpBorderStuff::BOTTOM:
++ eXFBorderSide = enumXFBorderBottom;
++ break;
++ }
++
++ LwpColor aColor = pBorderStuff->GetSideColor(eType);
++ float fWidth = pBorderStuff->GetSideWidth(eType);
++ sal_uInt16 nType = pBorderStuff->GetSideType(eType);
++
++ switch (nType)
++ {
++ default://fall through!
++ case 0x14: //single fall through!
++ case 0x17: //treble
++ pXFBorders->SetWidth(eXFBorderSide, fWidth);
++ break;
++ case 0x15: //double , fall through!
++ case 0x16: //thick double
++ pXFBorders->SetDoubleLine(eXFBorderSide, sal_True, sal_False);
++ pXFBorders->SetWidthOutter(eXFBorderSide, static_cast<float>(fWidth*0.333));
++ pXFBorders->SetWidthSpace(eXFBorderSide, static_cast<float>(fWidth*0.334));
++ pXFBorders->SetWidthInner(eXFBorderSide, static_cast<float>(fWidth*0.333));
++// pXFBorders->SetWidth(eXFBorderSide, fWidth);
++ break;
++ case 0x18: //thick-thin
++ pXFBorders->SetDoubleLine(eXFBorderSide, sal_True, sal_False);
++ pXFBorders->SetWidthOutter(eXFBorderSide, static_cast<float>(fWidth*0.5));
++ pXFBorders->SetWidthInner(eXFBorderSide, static_cast<float>(fWidth*0.25));
++ pXFBorders->SetWidthSpace(eXFBorderSide, static_cast<float>(fWidth*0.25));
++ break;
++ case 0x19: //thin-thick
++ pXFBorders->SetDoubleLine(eXFBorderSide, sal_True, sal_False);
++ pXFBorders->SetWidthInner(eXFBorderSide, static_cast<float>(fWidth*0.7));
++ pXFBorders->SetWidthOutter(eXFBorderSide, static_cast<float>(fWidth*0.15));
++ pXFBorders->SetWidthSpace(eXFBorderSide, static_cast<float>(fWidth*0.15));
++ break;
++ }
++
++ if (aColor.IsValidColor())
++ {
++ XFColor aXFColor(aColor.To24Color());
++ pXFBorders->SetColor(eXFBorderSide, aXFColor );
++ }
++}
++
++void LwpParaStyle::ApplyParaBorder(XFParaStyle* pParaStyle, LwpParaBorderOverride* pBorder)
++{
++ //convert LwpShadow:
++ LwpShadow *pShadow = pBorder->GetShadow();
++ if( pShadow )
++ {
++ LwpColor color = pShadow->GetColor();
++ float offsetX = pShadow->GetOffsetX();
++ float offsetY = pShadow->GetOffsetY();
++
++ if( offsetX && offsetY && color.IsValidColor() )
++ {
++ XFColor aXFColor(color.To24Color());
++ sal_Bool left = sal_False;
++ sal_Bool top = sal_False;
++ if( offsetX < 0 )
++ left = sal_True;
++ if( offsetY < 0 )
++ top = sal_True;
++ if( left )
++ {
++ if( top )
++ pParaStyle->SetShadow(enumXFShadowLeftTop,-offsetX,aXFColor);
++ else
++ pParaStyle->SetShadow(enumXFShadowLeftBottom,-offsetX,aXFColor);
++ }
++ else
++ {
++ if( top )
++ pParaStyle->SetShadow(enumXFShadowRightTop,offsetX,aXFColor);
++ else
++ pParaStyle->SetShadow(enumXFShadowRightBottom,offsetX,aXFColor);
++ }
++ }
++ }
++
++ //convert to XFBorders obejct:
++ LwpBorderStuff *pBorderStuff = pBorder->GetBorderStuff();
++ if( pBorderStuff && pBorderStuff->GetSide() != 0 )
++ {
++ XFBorders *pXFBorders = new XFBorders();
++ pParaStyle->SetBorders(pXFBorders);
++
++ LwpMargins* pMargins = pBorder->GetMargins();
++
++ // apply 4 borders respectively
++ LwpBorderStuff::BorderType pType[] = { LwpBorderStuff::LEFT, LwpBorderStuff::RIGHT,
++ LwpBorderStuff::TOP, LwpBorderStuff::BOTTOM };
++ float pMarginValue[4];
++
++ for (sal_uInt8 nC = 0; nC < 4; nC++)
++ {
++ if (pBorderStuff->HasSide(pType[nC]))
++ {
++ this->ApplySubBorder(pBorderStuff, pType[nC], pXFBorders);
++
++ //get border spacing to text content
++ if (pMargins)
++ {
++ pMarginValue[nC] = static_cast<float>(pMargins->GetMarginsValue(nC));
++ }
++ }
++
++ }
++
++ //apply border spacing to text content
++ pParaStyle->SetPadding(pMarginValue[0], pMarginValue[1], pMarginValue[2], pMarginValue[3]);
++
++ }
++}
++
++void LwpParaStyle::ApplyBreaks(XFParaStyle* pParaStyle, LwpBreaksOverride* pBreaks)
++{
++ if (pBreaks->IsKeepWithNext())
++ {
++ pParaStyle->SetBreaks(enumXFBreakKeepWithNext);
++ }
++ if (pBreaks->IsPageBreakBefore())
++ {
++ pParaStyle->SetBreaks(enumXFBreakBefPage);
++ }
++ if (pBreaks->IsPageBreakAfter())
++ {
++ pParaStyle->SetBreaks(enumXFBreakAftPage);
++ }
++ if (pBreaks->IsColumnBreakBefore())
++ {
++ pParaStyle->SetBreaks(enumXFBreakBefColumn);
++ }
++ if (pBreaks->IsColumnBreakAfter())
++ {
++ pParaStyle->SetBreaks(enumXFBreakAftColumn);
++ }
++}
++
++void LwpParaStyle::ApplyAlignment(XFParaStyle* pParaStyle, LwpAlignmentOverride* pAlign)
++{
++ enumXFAlignType alignType = enumXFAlignStart;
++ LwpAlignmentOverride::AlignType type;
++
++ type = pAlign->GetAlignType();
++ pParaStyle->SetNumberRight(sal_False);//to identify its align attribute
++ switch(type)
++ {
++ case LwpAlignmentOverride::ALIGN_LEFT:
++ alignType = enumXFAlignStart;
++ break;
++ case LwpAlignmentOverride::ALIGN_RIGHT:
++ alignType = enumXFAlignEnd;
++ break;
++ case LwpAlignmentOverride::ALIGN_CENTER:
++ alignType = enumXFAlignCenter;
++ break;
++ case LwpAlignmentOverride::ALIGN_NUMERICLEFT://if non-number in table,ALIGN_NUMERICLEFT/RIGHT are useless
++ alignType = enumXFAlignStart; //note by 1/28
++ break;
++ case LwpAlignmentOverride::ALIGN_JUSTIFY:
++ case LwpAlignmentOverride::ALIGN_JUSTIFYALL:
++ alignType = enumXFAlignJustify;
++ break;
++ case LwpAlignmentOverride::ALIGN_NUMERICRIGHT:
++ pParaStyle->SetNumberRight(sal_True);//to identify its align attribute
++ alignType = enumXFAlignEnd;
++ break;
++ }
++ pParaStyle->SetAlignType(alignType);
++}
++
++void LwpParaStyle::ApplyIndent(LwpPara* pPara, XFParaStyle* pParaStyle, LwpIndentOverride* pIndent)
++{
++ LwpPara* pParentPara;
++ if (pPara)
++ pParentPara = pPara->GetParent();
++ else
++ pParentPara = NULL;
++
++ LwpIndentOverride* pTotalIndent = new LwpIndentOverride;
++ if (pIndent->IsUseRelative() && pParentPara)
++ {
++ LwpIndentOverride* pParentIndent = pParentPara->GetIndent();
++ if (!pParentIndent)
++ return;
++ *pTotalIndent = *pIndent;
++
++ //add by ,for bullet only
++ if (pPara)
++ {
++ if (pPara->GetBulletFlag())
++ {
++ pTotalIndent->SetMAll(pParentIndent->GetMAll() + pTotalIndent->GetMAll());
++ pTotalIndent->SetMRight(pParentIndent->GetMRight()+ pTotalIndent->GetMRight());
++ pParaStyle->SetMargins(LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(
++ pTotalIndent->GetMAll())), pTotalIndent->GetRight());
++ pPara->SetIndent(pTotalIndent);
++ return;
++ }
++ }
++ //end add
++ sal_uInt16 relative = pParentIndent->GetRelative();
++
++ sal_Int32 Amount = pParentIndent->GetMAll();
++
++ if (relative == LwpIndentOverride::RELATIVE_FIRST)
++ Amount += pParentIndent->GetMFirst();
++ else if (relative == LwpIndentOverride::RELATIVE_REST)
++ Amount += pParentIndent->GetMRest();
++ pTotalIndent->SetMAll(Amount + pTotalIndent->GetMAll());
++ pTotalIndent->SetMRight(pParentIndent->GetMRight()+ pTotalIndent->GetMRight());
++
++ pParaStyle->SetIndent(pTotalIndent->GetFirst());
++ pParaStyle->SetMargins(pTotalIndent->GetLeft(), pTotalIndent->GetRight());
++ pPara->SetIndent(pTotalIndent);
++
++ }
++ else
++ {
++ *pTotalIndent = *pIndent;
++ //add by
++ if (pPara)
++ {
++ if (pPara->GetBulletFlag())
++ {
++// pParaStyle->SetIndent(LwpTools::ConvertFromUnits(pIndent->GetMAll()));
++ pParaStyle->SetMargins(LwpTools::ConvertToMetric(
++ LwpTools::ConvertFromUnits(pIndent->GetMAll())), pIndent->GetRight());
++ pPara->SetIndent(pTotalIndent);
++ return;
++ }
++ }
++ //end add
++
++ pParaStyle->SetIndent(pIndent->GetFirst());
++ pParaStyle->SetMargins(pIndent->GetLeft(), pIndent->GetRight());
++ if (pPara)
++ {
++ pPara->SetIndent(pTotalIndent);
++ }
++ }
++}
++
++void LwpParaStyle::ApplySpacing(LwpPara* pPara, XFParaStyle* pParaStyle, LwpSpacingOverride* pSpacing)
++{
++ LwpSpacingCommonOverride* spacing = pSpacing->GetSpacing();
++ LwpSpacingCommonOverride* aboveline = pSpacing->GetAboveLineSpacing();
++ LwpSpacingCommonOverride* abovepara = pSpacing->GetAboveSpacing();
++ LwpSpacingCommonOverride* belowpara = pSpacing->GetBelowSpacing();
++
++ LwpSpacingCommonOverride::SpacingType type = spacing->GetType();
++ sal_Int32 amount = spacing->GetAmount();
++ sal_Int32 multiple = spacing->GetMultiple();
++ enumLHType xftype;
++ double height;
++
++ switch(type)
++ {
++ case LwpSpacingCommonOverride::SPACING_DYNAMIC:
++ {
++ xftype = enumLHPercent;
++ height = double(multiple)/65536L*100;
++ pParaStyle->SetLineHeight(xftype,height);
++ }
++ break;
++ case LwpSpacingCommonOverride::SPACING_LEADING:
++ {
++ xftype = enumLHSpace;
++ height = LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(amount));
++ pParaStyle->SetLineHeight(xftype,height);
++ }
++ break;
++ case LwpSpacingCommonOverride::SPACING_CUSTOM:
++ {
++ xftype = enumLHHeight;
++ height = LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(sal_Int32(float(multiple)/65536L*amount)));
++ pParaStyle->SetLineHeight(xftype,height);
++ }
++ break;
++ case LwpSpacingCommonOverride::SPACING_NONE:
++ break;
++ }
++
++//TO DO: Above Line need to be processed!!!!!!! what it means?????? 1-26
++
++ type = abovepara->GetType();
++ amount = abovepara->GetAmount();
++ multiple = abovepara->GetMultiple();
++ double above_val =-1;
++ switch(type)
++ {
++ case LwpSpacingCommonOverride::SPACING_DYNAMIC:
++// above_val = LINE_HEIGHT*float(multiple)/65536L*100; //TO DO: 1-26
++ break;
++ case LwpSpacingCommonOverride::SPACING_LEADING:
++ break;
++ case LwpSpacingCommonOverride::SPACING_CUSTOM:
++ above_val = LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(sal_Int32(float(multiple)/65536L*amount)));
++ break;
++ case LwpSpacingCommonOverride::SPACING_NONE:
++ break;
++ }
++
++ type = belowpara->GetType();
++ amount = belowpara->GetAmount();
++ multiple = belowpara->GetMultiple();
++ double below_val=-1;
++ switch(type)
++ {
++ case LwpSpacingCommonOverride::SPACING_DYNAMIC:
++// below_val = LINE_HEIGHT*float(multiple)/65536L*100;//TO DO: 1-26
++ break;
++ case LwpSpacingCommonOverride::SPACING_LEADING:
++ break;
++ case LwpSpacingCommonOverride::SPACING_CUSTOM:
++ below_val = LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(sal_Int32(float(multiple)/65536L*amount)));
++ break;
++ case LwpSpacingCommonOverride::SPACING_NONE:
++ break;
++ }
++
++ if (pPara)
++ {
++ if (below_val != -1)
++ pPara->SetBelowSpacing(below_val);
++ LwpPara* pPrePara = static_cast<LwpPara*>(pPara->GetPrevious()->obj());
++ if (pPrePara && above_val != -1)
++ {
++ above_val += pPrePara->GetBelowSpacing();
++
++ }
++
++ }
++ pParaStyle->SetMargins(-1,-1,above_val,below_val);
++}
++/**************************************************************************
++ * @short:
++ * @descr:
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++void LwpParaStyle::ApplyTab(XFParaStyle *pParaStyle, LwpTabOverride *pTab)
++{
++ LwpObjectID* pTabRackID = pTab->GetTabRackID();
++ if(pTabRackID->IsNull())
++ {
++ //assert(false);
++ return;
++ }
++
++ LwpTabRack* pTabRack = static_cast<LwpTabRack*>(pTabRackID->obj());
++ if(!pTabRack)
++ {
++ //assert(false);
++ return;
++ }
++
++ pParaStyle->ClearTabStyles();
++ //Get margin left value
++ double dMarginLeft = pParaStyle->GetMargins().GetLeft();
++
++ sal_uInt16 nNumTabs = pTabRack->GetNumTabs();
++ for(sal_uInt16 nIndex=0; nIndex<nNumTabs; nIndex++)
++ {
++ //get tab type
++ LwpTab* pTab = pTabRack->Lookup(nIndex);
++ if(!pTab)
++ return;
++
++ enumXFTab eType;
++ LwpTab::TabType type = pTab->GetTabType();
++ switch(type)
++ {
++ case LwpTab::TT_LEFT:
++ eType = enumXFTabLeft;
++ break;
++ case LwpTab::TT_CENTER:
++ eType = enumXFTabCenter;
++ break;
++ case LwpTab::TT_RIGHT:
++ eType = enumXFTabRight;
++ break;
++ case LwpTab::TT_NUMERIC:
++ eType = enumXFTabChar;
++ break;
++ }
++
++ //get position
++ sal_uInt32 nPos = pTab->GetPosition();
++ //different feature between SODC and lwp, the tab length must minus the margin left of para.
++ double fLen = LwpTools::ConvertFromUnitsToMetric(nPos) - dMarginLeft;
++
++ //get leader type
++ sal_Unicode cLeader;
++ LwpTab::LeaderType leader= pTab->GetLeaderType();
++ switch(leader)
++ {
++ case LwpTab::TL_NONE:
++ cLeader = 0x20; //space
++ break;
++ case LwpTab::TL_HYPHEN: //'-'
++ cLeader = 0xAD;
++ break;
++ case LwpTab::TL_DOT: //'.'
++ cLeader = 0x2E;
++ break;
++ case LwpTab::TL_LINE: //'_'
++ cLeader = 0x5F;
++ break;
++ }
++
++ sal_Unicode cAlignChar = static_cast<sal_Unicode>(pTab->GetAlignChar());
++
++ pParaStyle->AddTabStyle(eType,fLen,cLeader,cAlignChar);
++ }
++
++}
++
++
++void LwpParaStyle::RegisterStyle()
++{
++ XFParaStyle* pStyle = new XFParaStyle();
++
++ //Set name
++ OUString styleName = GetName()->str();
++ pStyle->SetStyleName(styleName);
++
++ //Create font
++ LwpFontManager* pFontMgr = m_pFoundry->GetFontManger();
++ XFFont* pFont = pFontMgr->CreateFont(m_nFinalFontID);
++ pStyle->SetFont(pFont);
++
++ //Set other paragraph properties...
++
++ Apply(pStyle);
++ //Add style
++ LwpStyleManager* pStyleMgr = m_pFoundry->GetStyleManager();
++ pStyleMgr->AddStyle(*GetObjectID(), pStyle);
++
++/* // add list style for bullet
++ if (!m_pBulletOverride)
++ {
++ return;
++ }
++ LwpSilverBullet* pSilverBullet = static_cast<LwpSilverBullet*>(m_pBulletOverride->GetSilverBullet().obj());
++ if (!pSilverBullet)
++ {
++ return;
++ }
++
++ pSilverBullet->SetFoundry(m_pFoundry);
++ pSilverBullet->RegisterStyle();*/
++}
++
++LwpAlignmentOverride* LwpParaStyle::GetAlignment()
++{
++ if (m_AlignmentStyle.obj()!= NULL)
++ return static_cast<LwpAlignmentOverride*>(static_cast<LwpAlignmentPiece*>(m_AlignmentStyle.obj())->GetOverride());
++ else
++ return NULL;
++}
++
++LwpIndentOverride* LwpParaStyle::GetIndent()
++{
++ if (m_IndentStyle.obj() != NULL)
++ return static_cast<LwpIndentOverride*>(static_cast<LwpIndentPiece*>(m_IndentStyle.obj())->GetOverride());
++ else
++ return NULL;
++}
++
++LwpSpacingOverride* LwpParaStyle::GetSpacing()
++{
++ if (m_SpacingStyle.obj() != NULL)
++ return static_cast<LwpSpacingOverride*>(static_cast<LwpSpacingPiece*>(m_SpacingStyle.obj())->GetOverride());
++ else
++ return NULL;
++}
++
++LwpParaBorderOverride* LwpParaStyle::GetParaBorder() const
++{
++ if(m_BorderStyle.IsNull()) return NULL;
++ return static_cast<LwpParaBorderOverride*>
++ (static_cast<LwpParaBorderPiece*>(m_BorderStyle.obj(VO_PARABORDERPIECE))->GetOverride());
++}
++
++LwpBreaksOverride* LwpParaStyle::GetBreaks() const
++{
++ if(m_BreaksStyle.IsNull()) return NULL;
++ return static_cast<LwpBreaksOverride*>
++ (static_cast<LwpBreaksPiece*>(m_BreaksStyle.obj(VO_BREAKSPIECE))->GetOverride());
++}
++
++LwpBulletOverride* LwpParaStyle::GetBulletOverride() const
++{
++ return m_pBulletOverride;
++}
++
++LwpNumberingOverride* LwpParaStyle::GetNumberingOverride() const
++{
++ if(m_NumberingStyle.IsNull()) return NULL;
++ return static_cast<LwpNumberingOverride*>
++ (static_cast<LwpNumberingPiece*>(m_NumberingStyle.obj(VO_NUMBERINGPIECE))->GetOverride());
++}
++
++
++/**************************************************************************
++ * @short:
++ * @descr:
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++LwpTabOverride* LwpParaStyle::GetTabOverride() const
++{
++ if(m_TabStyle.obj() != NULL)
++ return (LwpTabOverride*)static_cast<LwpTabPiece*>(m_TabStyle.obj())->GetOverride();
++ else
++ return NULL;
++}
++
++sal_Bool LwpParaStyle::IsNumberRight()
++{
++ LwpAlignmentOverride* pAlign = GetAlignment();
++ if (pAlign)
++ {
++ LwpAlignmentOverride::AlignType type;
++ type = pAlign->GetAlignType();
++ if (type == LwpAlignmentOverride::ALIGN_NUMERICRIGHT)
++ return sal_True;
++ }
++ return sal_False;
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpparastyle.hxx lotuswordpro/source/filter/lwpparastyle.hxx
+--- lotuswordpro.bak/source/filter/lwpparastyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpparastyle.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,130 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPPARASTYLE_HXX
++#define _LWPPARASTYLE_HXX
++
++#include "lwpcharacterstyle.hxx"
++#include "lwppiece.hxx"
++#include "lwpborderstuff.hxx"
++#include "lwppara.hxx"
++
++class LwpKinsokuOptsOverride;
++class LwpBulletOverride;
++class XFParaStyle;
++class XFBorders;
++
++class LwpParaStyle : public LwpTextStyle
++{
++public:
++ LwpParaStyle(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++
++ virtual ~LwpParaStyle();
++
++ void Read();
++
++ virtual void Apply(XFParaStyle *pStrm);
++ // 01/26/2005
++ void ApplyParaBorder(XFParaStyle* pParaStyle, LwpParaBorderOverride* pBorder);
++ void ApplyBreaks(XFParaStyle* pParaStyle, LwpBreaksOverride* pBreaks);
++ //end
++ static void ApplyAlignment(XFParaStyle* pParaStyle, LwpAlignmentOverride* pAlign);
++ static void ApplyIndent(LwpPara* pPara, XFParaStyle* pParaStyle, LwpIndentOverride* pIndent);
++ static void ApplySpacing(LwpPara* pPara, XFParaStyle* pParaStyle, LwpSpacingOverride* pSpacing);
++
++ // 2005/01/28
++ static void ApplyTab(XFParaStyle* pParaStyle, LwpTabOverride* pTab);
++
++ void RegisterStyle();
++
++ LwpAlignmentOverride* GetAlignment();//add by 1-24
++ LwpIndentOverride* GetIndent();
++ LwpSpacingOverride* GetSpacing();
++ LwpParaBorderOverride* GetParaBorder() const;
++ LwpBreaksOverride* GetBreaks() const;
++ LwpTabOverride* GetTabOverride() const;
++ LwpBulletOverride* GetBulletOverride() const;
++ LwpNumberingOverride* GetNumberingOverride() const;
++
++ sal_Bool IsNumberRight();
++public:
++ //add by , 01/27/2004
++ static void ApplySubBorder(LwpBorderStuff* pBorderStuff, LwpBorderStuff::BorderType eType, XFBorders* pXFBorders);
++ //end
++
++private:
++ //style IDs
++ LwpObjectID m_AlignmentStyle;
++ LwpObjectID m_SpacingStyle;
++ LwpObjectID m_IndentStyle;
++ LwpObjectID m_BorderStyle;
++ LwpObjectID m_BreaksStyle;
++ LwpObjectID m_NumberingStyle;
++ LwpObjectID m_TabStyle;
++ LwpObjectID m_BackgroundStyle;
++
++ LwpKinsokuOptsOverride* m_pKinsokuOptsOverride;
++ LwpBulletOverride* m_pBulletOverride;
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwppiece.hxx lotuswordpro/source/filter/lwppiece.hxx
+--- lotuswordpro.bak/source/filter/lwppiece.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwppiece.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,202 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPPIECE_HXX
++#define _LWPPIECE_HXX
++
++#include "lwpobj.hxx"
++#include "lwpoverride.hxx"
++#include "lwpobjstrm.hxx"
++#include "lwpdlvlist.hxx"
++#include "lwpbreaksoverride.hxx"
++#include "lwpparaborderoverride.hxx"
++#include "lwpnumberingoverride.hxx"
++#include "lwpcharborderoverride.hxx"
++#include "lwpbackgroundoverride.hxx"
++#include "lwptaboverride.hxx"
++
++class LwpOverride;
++class LwpDLVList;
++
++class LwpVirtualPiece : public LwpDLVList
++{
++public:
++ LwpVirtualPiece(LwpObjectHeader& objHdr, LwpSvStream* pStrm):LwpDLVList(objHdr, pStrm)
++ {
++ m_pOverride = NULL;
++ }
++
++ virtual ~LwpVirtualPiece()
++ {
++ if( m_pOverride )
++ delete m_pOverride;
++ }
++
++ virtual void Read()
++ {
++ LwpDLVList::Read();
++ if( m_pOverride )
++ m_pOverride->Read(m_pObjStrm);
++ }
++
++ LwpOverride* GetOverride()
++ {
++ return m_pOverride;
++ }
++protected:
++ LwpOverride *m_pOverride;
++};
++
++
++class LwpParaBorderPiece : public LwpVirtualPiece
++{
++public:
++ LwpParaBorderPiece(LwpObjectHeader& objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
++ {
++ m_pOverride = new LwpParaBorderOverride();
++ }
++};
++
++class LwpBreaksPiece : public LwpVirtualPiece
++{
++public:
++ LwpBreaksPiece(LwpObjectHeader& objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
++ {
++ m_pOverride = new LwpBreaksOverride();
++ }
++};
++
++class LwpNumberingPiece : public LwpVirtualPiece
++{
++public:
++ LwpNumberingPiece(LwpObjectHeader& objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
++ {
++ m_pOverride = new LwpNumberingOverride();
++ }
++};
++
++class LwpTabPiece : public LwpVirtualPiece
++{
++public:
++ LwpTabPiece(LwpObjectHeader& objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
++ {
++ m_pOverride = new LwpTabOverride();
++ }
++};
++
++
++class LwpBackgroundPiece : public LwpVirtualPiece
++{
++public:
++ LwpBackgroundPiece(LwpObjectHeader& objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
++ {
++ m_pOverride = new LwpBackgroundOverride();
++ }
++};
++
++class LwpAlignmentPiece : public LwpVirtualPiece
++{
++public:
++ LwpAlignmentPiece(LwpObjectHeader& objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
++ {
++ m_pOverride = new LwpAlignmentOverride();
++ }
++};
++
++class LwpIndentPiece : public LwpVirtualPiece
++{
++public:
++ LwpIndentPiece(LwpObjectHeader& objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
++ {
++ m_pOverride = new LwpIndentOverride();
++ }
++};
++
++class LwpSpacingPiece : public LwpVirtualPiece
++{
++public:
++ LwpSpacingPiece(LwpObjectHeader& objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
++ {
++ m_pOverride = new LwpSpacingOverride();
++ }
++};
++
++class LwpAmikakePiece : public LwpVirtualPiece
++{
++public:
++ LwpAmikakePiece(LwpObjectHeader& objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
++ {
++ m_pOverride = new LwpAmikakeOverride();
++ }
++};
++
++class LwpCharacterBorderPiece : public LwpVirtualPiece
++{
++public:
++ LwpCharacterBorderPiece(LwpObjectHeader& objHdr, LwpSvStream* pStrm):LwpVirtualPiece(objHdr, pStrm)
++ {
++ m_pOverride = new LwpCharacterBorderOverride();
++ }
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpproplist.cxx lotuswordpro/source/filter/lwpproplist.cxx
+--- lotuswordpro.bak/source/filter/lwpproplist.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpproplist.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,151 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++
++#include "lwpproplist.hxx"
++
++LwpPropListElement::LwpPropListElement(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++:LwpDLVList(objHdr,pStrm)
++{
++}
++
++LwpPropListElement* LwpPropListElement::GetNext()
++{
++ return static_cast<LwpPropListElement*>(LwpDLVList::GetNext()->obj());
++}
++
++void LwpPropListElement::Read()
++{
++ LwpDLVList::Read();
++ m_Name.Read(m_pObjStrm);
++ m_Value.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++
++sal_Bool LwpPropListElement::IsNamed(OUString name)
++{
++ return name.equals(m_Name.str());
++}
++
++OUString LwpPropList::GetNamedProperty(OUString name)
++{
++ LwpPropListElement* pProp = FindPropByName(name);
++ if (pProp)
++ {
++ return pProp->GetValue().str();
++ }
++ return OUString(A2OUSTR(""));
++}
++
++LwpPropListElement* LwpPropList::FindPropByName(OUString name)
++{
++ LwpPropListElement* pElement = GetFirst();
++
++ while(pElement)
++ {
++ if (pElement->IsNamed(name))
++ return pElement;
++ pElement = pElement->GetNext();
++ }
++ return NULL;
++}
++
++void LwpPropList::Read(LwpObjectStream* pObjStrm)
++{
++ LwpDLVListHead::Read(pObjStrm);
++}
++
++LwpPropListElement* LwpPropList::GetFirst()
++{
++ return static_cast<LwpPropListElement*>(LwpDLVListHead::GetFirst()->obj());
++}
++
++OUString LwpPropList::EnumNamedProperty(OUString& name,OUString& value)
++{
++ LwpPropListElement* pElement;
++ if (name.getLength()==0)
++ {
++ pElement = GetFirst();
++ if (pElement)
++ {
++ value = pElement->GetValue().str();
++ name = pElement->GetName().str();
++ pElement = pElement->GetNext();
++ return pElement->GetName().str();
++ }
++ else
++ return A2OUSTR("");
++
++ }
++ else
++ {
++ pElement = FindPropByName(name);
++ if (pElement)
++ {
++ value = pElement->GetValue().str();
++ pElement = pElement->GetNext();
++ if(pElement)
++ return pElement->GetName().str();
++ }
++ return A2OUSTR("");
++ }
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpproplist.hxx lotuswordpro/source/filter/lwpproplist.hxx
+--- lotuswordpro.bak/source/filter/lwpproplist.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpproplist.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,99 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPPROPLIST_HXX_
++#define _LWPPROPLIST_HXX_
++
++#include "lwpobj.hxx"
++#include "lwpdlvlist.hxx"
++#include "lwpatomholder.hxx"
++
++class LwpPropListElement : public LwpDLVList
++{
++public:
++ LwpPropListElement(LwpObjectHeader &objHdr, LwpSvStream *pStrm);
++ ~LwpPropListElement(){};
++ void Read();
++ sal_Bool IsNamed(OUString name);
++ LwpPropListElement* GetNext();
++ LwpAtomHolder GetValue(){return m_Value;}
++ LwpAtomHolder GetName(){return m_Name;}
++private:
++ LwpAtomHolder m_Name;
++ LwpAtomHolder m_Value;
++};
++
++class LwpPropList : public LwpDLVListHead
++{
++public:
++ LwpPropList(){};
++ ~LwpPropList(){};
++ void Read(LwpObjectStream* pObjStrm);
++ LwpPropListElement* GetFirst();
++ OUString GetNamedProperty(OUString name);
++ OUString EnumNamedProperty(OUString& name,OUString& value);
++private:
++ LwpPropListElement* FindPropByName(OUString name);
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpprtinfo.cxx lotuswordpro/source/filter/lwpprtinfo.cxx
+--- lotuswordpro.bak/source/filter/lwpprtinfo.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpprtinfo.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,105 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "lwpprtinfo.hxx"
++
++LwpPrinterInfo::LwpPrinterInfo(LwpObjectStream* pStrm)
++{
++ Read(pStrm);
++}
++/**
++ * @descr read printer info in VO_DOCUMENT
++ */
++void LwpPrinterInfo::Read(LwpObjectStream* pStrm)
++{
++ //Just skip now
++ Skip(pStrm);
++}
++/**
++ * @descr skip printer info in VO_DOCUMENT
++ */
++void LwpPrinterInfo::Skip(LwpObjectStream *pStrm)
++{
++ sal_uInt16 platform;
++ pStrm->QuickRead(&platform, sizeof(platform));
++
++ //Skip the size and the buffer
++ sal_uInt32 size;
++ pStrm->QuickRead(&size, sizeof(size));
++ pStrm->SeekRel(static_cast<sal_uInt16>(size));
++
++ //Skip others printer infor
++ pStrm->SeekRel(6*sizeof(sal_uInt16)+sizeof(sal_uInt32)+sizeof(sal_uInt16));
++
++ //Skip the next five LwpAtomHolder
++ {
++ LwpAtomHolder toSkip;
++ toSkip.Skip(pStrm);
++ toSkip.Skip(pStrm);
++ toSkip.Skip(pStrm);
++ toSkip.Skip(pStrm);
++ toSkip.Skip(pStrm);
++ }
++
++ sal_uInt16 count;
++ pStrm->QuickRead(&count, sizeof(count));
++ //Skip each selected division
++ LwpAtomHolder toSkip;
++ while(count--)
++ {
++ toSkip.Skip(pStrm);
++ pStrm->SkipExtra();
++ }
++ pStrm->SkipExtra();
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpprtinfo.hxx lotuswordpro/source/filter/lwpprtinfo.hxx
+--- lotuswordpro.bak/source/filter/lwpprtinfo.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpprtinfo.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,93 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPPRINTERINFO_HXX
++#define _LWPPRINTERINFO_HXX
++
++#include "lwpatomholder.hxx"
++#include "lwpobjstrm.hxx"
++/**
++ * @brief printer info used in VO_DOCUMENT
++ * not parsed yet
++*/
++class LwpPrinterInfo
++{
++public:
++ LwpPrinterInfo(LwpObjectStream* pStrm);
++ ~LwpPrinterInfo(){};
++private:
++ LwpAtomHolder m_OutputFile;
++ LwpAtomHolder cSelectedDivisions;
++
++ LwpAtomHolder m_Output;
++ LwpAtomHolder m_Name;
++ LwpAtomHolder m_Driver;
++ LwpAtomHolder m_Queue;
++ LwpAtomHolder m_SelectedPages;
++
++public:
++ void Read(LwpObjectStream* pStrm);
++ void Skip(LwpObjectStream *pStrm);
++};
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwppttntbl.hxx lotuswordpro/source/filter/lwppttntbl.hxx
+--- lotuswordpro.bak/source/filter/lwppttntbl.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwppttntbl.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,145 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++* Change History
++* 2005-06-01 created
++************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype
++ * WordPro Pattern Table
++ */
++
++#ifndef _LTPATTERNTABLE_HXX
++#define _LTPATTERNTABLE_HXX
++
++static sal_uInt8 s_pLwpPatternTab[][8] = { //Id Name
++ { 0xDF, 0xAF, 0x77, 0x77, 0x77, 0x77, 0xFA, 0xFD },//0 Transparent
++ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },//1 SolidForeground
++ { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },//2 SolidBackground
++ { 0x7F, 0xFF, 0xF7, 0xFF, 0x7F, 0xFF, 0xF7, 0xFF },//3 BACK_10PCTDOTS(31 GrayScale4thLightest)
++ { 0x77, 0xFF, 0xDD, 0xFF, 0x77, 0xFF, 0xDD, 0xFF },//4 BACK_30PCTDOTS(30 GrayScale5thLightest)
++ { 0x6F, 0xFF, 0xB5, 0xFF, 0xB5, 0xFF, 0xDA, 0xFF },//5 BACK_50PCTDOTS
++ { 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD },//6
++ { 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22 },//7
++ { 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88 },//8
++ { 0x22, 0x00, 0x88, 0x00, 0x22, 0x00, 0x88, 0x00 },//9
++ { 0x80, 0x00, 0x08, 0x00, 0x80, 0x00, 0x08, 0x00 },//10
++ { 0x80, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00 },//11
++ { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },//12
++ { 0xB1, 0x30, 0x03, 0x1B, 0xD8, 0xC0, 0x0C, 0x8D },//13
++ { 0x80, 0x10, 0x02, 0x20, 0x01, 0x08, 0x40, 0x04 },//14
++ { 0x33, 0x99, 0xCC, 0x66, 0x33, 0x99, 0xCC, 0x66 },//15
++ { 0x77, 0xBB, 0xDD, 0xEE, 0x77, 0xBB, 0xDD, 0xEE },//16
++ { 0x6F, 0xB7, 0xDB, 0xED, 0xF6, 0x7B, 0xBD, 0xDE },//17
++ { 0x5F, 0xAF, 0xD7, 0xEB, 0xF5, 0xFA, 0x7D, 0xBE },//18
++ { 0xEA, 0x75, 0xBA, 0x5D, 0xAE, 0x57, 0xAB, 0xD5 },//19
++ { 0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE },//20
++ { 0xCC, 0x99, 0x33, 0x66, 0xCC, 0x99, 0x33, 0x66 },//21
++ { 0xEE, 0xDD, 0xBB, 0x77, 0xEE, 0xDD, 0xBB, 0x77 },//22
++ { 0xDE, 0xBD, 0x7B, 0xF6, 0xED, 0xDB, 0xB7, 0x6F },//23
++ { 0xFA, 0xF5, 0xEB, 0xD7, 0xAF, 0x5F, 0xBE, 0x7D },//24
++ { 0x57, 0xAE, 0x5D, 0xBA, 0x75, 0xEA, 0xD5, 0xAB },//25
++ { 0xFE, 0xFD, 0xFB, 0xF7, 0xEF, 0xDF, 0xBF, 0x7F },//26
++ { 0x44, 0xAA, 0x11, 0xAA, 0x44, 0xAA, 0x11, 0xAA },//27
++ { 0xBB, 0x55, 0xEE, 0x55, 0xBB, 0x55, 0xEE, 0x55 },//28
++ { 0x7E, 0xBD, 0xDB, 0xE7, 0xE7, 0xDB, 0xBD, 0x7E },//29
++ { 0xF9, 0xF6, 0x6F, 0x9F, 0x9F, 0x6F, 0xF6, 0xF9 },//30
++ { 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF },//31
++ { 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00 },//32
++ { 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF },//33
++ { 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },//34
++ { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 },//35
++ { 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99 },//36
++ { 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB },//37
++ { 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE },//38
++ { 0xFF, 0x55, 0xFF, 0x55, 0xFF, 0x55, 0xFF, 0x55 },//39
++ { 0xBB, 0xBB, 0x00, 0xBB, 0xBB, 0xBB, 0x00, 0xBB },//40
++ { 0x00, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD },//41
++ { 0x22, 0x00, 0x20, 0x00, 0xAA, 0x00, 0x20, 0x00 },//42
++ { 0x40, 0xA0, 0x00, 0x00, 0x04, 0x0A, 0x00, 0x00 },//43
++ { 0x01, 0x80, 0x00, 0x08, 0x10, 0x20, 0x00, 0x02 },//44
++ { 0xED, 0xED, 0x0C, 0xC0, 0xDE, 0xDE, 0xC0, 0x0C },//45
++ { 0xC1, 0xE2, 0x77, 0x2E, 0x1C, 0x3A, 0x77, 0xA3 },//46
++ { 0x00, 0xF7, 0xF7, 0xF7, 0x00, 0x7F, 0x7F, 0x7F },//47
++ { 0x7C, 0xBB, 0xC7, 0xEF, 0xDF, 0xBF, 0x7F, 0xFE },//48
++ { 0xFF, 0x33, 0xFF, 0xCC, 0xFF, 0x33, 0xFF, 0xCC },//49
++ { 0xCC, 0xCC, 0x33, 0x33, 0x33, 0x33, 0xCC, 0xCC },//50
++ { 0xF0, 0xF0, 0x0F, 0x0F, 0xF0, 0xF0, 0x0F, 0x0F },//51
++ { 0xC3, 0xC3, 0xC3, 0xC3, 0x3C, 0x3C, 0x3C, 0x3C },//52
++ { 0x33, 0x33, 0xCC, 0xCC, 0x33, 0x33, 0xCC, 0xCC },//53
++ { 0x08, 0x08, 0x14, 0x22, 0xC9, 0x22, 0x14, 0x08 },//54
++ { 0x0A, 0x04, 0x04, 0x55, 0xA0, 0x40, 0x40, 0x55 },//55
++ { 0x01, 0x01, 0x03, 0x84, 0x48, 0x30, 0x0C, 0x02 },//56
++ { 0x28, 0xC7, 0x01, 0x01, 0x82, 0x7C, 0x10, 0x10 },//57
++ { 0x40, 0x80, 0x01, 0x02, 0x04, 0x8A, 0x55, 0xFF },//58
++ { 0xC7, 0xC7, 0xBB, 0x4C, 0x7C, 0x7C, 0xBB, 0xC4 },//59
++ { 0x8A, 0x05, 0x02, 0x00, 0x02, 0x05, 0x8A, 0x55 },//60
++ { 0x28, 0x44, 0x82, 0x11, 0x00, 0x55, 0x00, 0x11 },//61
++ { 0x81, 0x41, 0x60, 0x70, 0x78, 0x70, 0x60, 0x41 },//62
++ { 0xEE, 0x57, 0xAB, 0x55, 0xEE, 0x5D, 0xBA, 0x75 },//63
++
++//
++ { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },//2 SolidBackground
++ { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },//2 SolidBackground
++ { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },//2 SolidBackground
++ { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },//2 SolidBackground
++ { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },//2 SolidBackground
++ { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },//2 SolidBackground
++ { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },//2 SolidBackground
++ { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },//2 SolidBackground
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpresource.hxx lotuswordpro/source/filter/lwpresource.hxx
+--- lotuswordpro.bak/source/filter/lwpresource.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpresource.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,68 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _RESOURCE_HXX
++#define _RESOURCE_HXX
++
++#define IMPLEMENTATION_NAME "com.ibm.ILWPImportFilter"
++
++const char STR_WORDPRO[] = "Wordpro";
++const char STR_IMPLEMENTATION_NAME[] = IMPLEMENTATION_NAME;
++const char STR_SERVICE_NAME[] = "com.sun.star.document.ImportFilter";
++const char STR_WRITER_IMPORTER_NAME[] = "com.sun.star.comp.Writer.XMLImporter";
++
++#endif
++
++
++
+diff -urNp lotuswordpro.bak/source/filter/lwprowlayout.cxx lotuswordpro/source/filter/lwprowlayout.cxx
+--- lotuswordpro.bak/source/filter/lwprowlayout.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwprowlayout.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,492 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - row layouts
++ */
++/*************************************************************************
++ * Change History
++ April 2005 Created
++ ************************************************************************/
++#include "lwprowlayout.hxx"
++#include "lwptable.hxx"
++#include "lwpglobalmgr.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xfrow.hxx"
++#include "xfilter/xfrowstyle.hxx"
++#include "xfilter/xftablestyle.hxx"
++#include "xfilter/xftable.hxx"
++#include "xfilter/xfcell.hxx"
++#include "xfilter/xfcellstyle.hxx"
++
++LwpRowLayout::LwpRowLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpVirtualLayout(objHdr, pStrm)
++{
++ m_ConnCellList.clear();
++}
++
++LwpRowLayout::~LwpRowLayout()
++{}
++
++/**
++ * @short register row style
++ * @param
++ * @param
++ * @param
++ * @return
++ */
++void LwpRowLayout::SetRowMap(void)
++{
++ LwpObjectID *pCellID= GetChildHead();
++ LwpCellLayout * pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj());
++
++ while(pCellLayout)
++ {
++ pCellLayout->SetCellMap();
++
++ pCellID = pCellLayout->GetNext();
++ pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj());
++ }
++}
++/**
++ * @short register row style
++ * @param
++ * @param
++ * @param
++ * @return
++ */
++void LwpRowLayout::RegisterStyle()
++{
++ // register row style
++ XFRowStyle *pRowStyle = new XFRowStyle();
++
++ if (m_nDirection & 0x0030)
++ {
++ pRowStyle->SetMinRowHeight((float)LwpTools::ConvertFromUnitsToMetric(cheight));
++ }
++ else
++ {
++ pRowStyle->SetRowHeight((float)LwpTools::ConvertFromUnitsToMetric(cheight));
++ }
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_StyleName = pXFStyleManager->AddStyle(pRowStyle)->GetStyleName();
++
++ LwpTableLayout* pTableLayout = GetParentTableLayout();
++ LwpTable * pTable = NULL;
++ if (pTableLayout)
++ {
++ pTable = pTableLayout->GetTable();
++ }
++ // register cells' style
++ LwpObjectID *pCellID= GetChildHead();
++ LwpCellLayout * pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj());
++
++ while(pCellLayout)
++ {
++ pCellLayout->SetFoundry(m_pFoundry);
++ pCellLayout->RegisterStyle();
++ pCellID = pCellLayout->GetNext();
++ pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj());
++ }
++
++}
++/**
++ * @short register row style
++ * @param
++ * @param
++ * @param
++ * @return
++ */
++void LwpRowLayout::Read()
++{
++ #define MAXUNIT (0x7fffffffL) // Highest positive UNIT value
++ LwpObjectStream* pStrm = m_pObjStrm;
++
++ LwpVirtualLayout::Read();
++
++ //skip CLiteLayout data;
++ LwpAtomHolder ContentClass;
++ ContentClass.Read(pStrm);
++ pStrm->SkipExtra();
++
++ // Row layout content
++ crowid = pStrm->QuickReaduInt16();
++ cheight = pStrm->QuickReadInt32();
++ cLeaderDotCount = (sal_uInt8)pStrm->QuickReaduInt16(); // was written as lushort.
++ cLeaderDotY = MAXUNIT; // Sentinel meaning "not calculated yet"
++ cRowFlags = (sal_uInt8)pStrm->QuickReaduInt16(); // was written as lushort.
++
++ pStrm->SkipExtra();
++}
++
++/**
++ * @short Parse rows with connect cell
++ * @param pXFTable - pointer to created XFTable
++ */
++void LwpRowLayout::ConvertRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uInt8 nEndCol)
++{
++ XFRow* pXFRow = new XFRow;
++
++ LwpTableLayout* pTableLayout = GetParentTableLayout();
++ LwpTable* pTable = pTableLayout->GetTable();
++
++ //calculate the connected cell position
++ sal_Int32 nMarkConnCell;
++ nMarkConnCell = FindMarkConnCell(nStartCol,nEndCol);
++
++ //if there is no connected cell
++ if (nMarkConnCell == -1)
++ {
++ ConvertCommonRow(pXFTable,nStartCol,nEndCol);
++ return;
++ }
++
++ //register connect row style
++ sal_uInt16 nRowMark = crowid + GetCurMaxSpannedRows(nStartCol,nEndCol);
++ RegisterCurRowStyle(pXFRow,nRowMark);
++
++ sal_Bool bIsRight = sal_False;
++ sal_Bool bIsTop = sal_False;
++
++ //if there is connected cell
++ for (sal_uInt8 i=nStartCol; i<nEndCol; )
++ {
++ XFCell* pXFCell;
++ sal_uInt8 nColMark;
++
++ if (nMarkConnCell == -1)
++ nColMark = nEndCol;
++ else
++ nColMark = m_ConnCellList[nMarkConnCell]->GetColID();
++
++ if (nColMark > i)//create subtable
++ {
++ pXFCell = new XFCell;
++ pXFCell->SetColumnSpaned(nColMark-i);
++ XFTable* pSubTable = new XFTable;
++ pTableLayout->ConvertTable(pSubTable,crowid,nRowMark,i,nColMark);
++ pXFCell->Add(pSubTable);
++ i = nColMark;
++ }
++ else
++ {
++ sal_uInt8 nColID = m_ConnCellList[nMarkConnCell]->GetColID()
++ +m_ConnCellList[nMarkConnCell]->GetNumcols()-1;
++ pXFCell = m_ConnCellList[nMarkConnCell]->ConvertCell(
++ *pTable->GetObjectID(),
++ crowid+m_ConnCellList[nMarkConnCell]->GetNumrows()-1,
++ m_ConnCellList[nMarkConnCell]->GetColID());
++
++ //set all cell in this merge cell to cellsmap
++ for (sal_uInt16 nRowLoop = crowid;nRowLoop<nRowMark ;nRowLoop++)
++ for (sal_uInt8 nColLoop = i;nColLoop<nColID+1;nColLoop++)
++ pTableLayout->SetCellsMap(nRowLoop,nColLoop,pXFCell);
++
++ i += m_ConnCellList[nMarkConnCell]->GetNumcols();
++ nMarkConnCell = FindNextMarkConnCell(static_cast<sal_uInt16>(nMarkConnCell),nEndCol);
++ }
++
++ if (pXFCell)
++ pXFRow->AddCell(pXFCell);
++ }
++ pXFTable->AddRow(pXFRow);
++}
++
++/**
++ * @short register row style in SODC table
++ * @param pXFRow - pointer of row
++ * @param nRowMark - spanned row number
++ */
++void LwpRowLayout::RegisterCurRowStyle(XFRow* pXFRow,sal_uInt16 nRowMark)
++{
++ XFRowStyle* pRowStyle;
++ XFRowStyle* pNewStyle = new XFRowStyle;
++ double fHeight;
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ pRowStyle = static_cast<XFRowStyle*>(pXFStyleManager->FindStyle(m_StyleName));
++ if (!pRowStyle)
++ return;
++ fHeight = pRowStyle->GetRowHeight();
++
++ *pNewStyle = *pRowStyle;
++ std::map<sal_uInt16,LwpRowLayout*>::iterator iter;
++ LwpTableLayout* pTableLayout = GetParentTableLayout();
++ if (!pTableLayout)
++ return;
++ std::map<sal_uInt16,LwpRowLayout*> RowsMap = pTableLayout->GetRowsMap();
++
++ for (sal_uInt16 i=crowid+1; i<nRowMark;i++)
++ {
++ iter = RowsMap.find(i);
++ if (iter == RowsMap.end())
++ {
++ pRowStyle = static_cast<XFRowStyle*>(
++ pXFStyleManager->FindStyle(pTableLayout->GetDefaultRowStyleName()));
++ fHeight += pRowStyle->GetRowHeight();
++ }
++ else
++ {
++ pRowStyle = static_cast<XFRowStyle*>(
++ pXFStyleManager->FindStyle(iter->second->GetStyleName()));
++ fHeight+=pRowStyle->GetRowHeight();
++ }
++ }
++
++ if (m_nDirection & 0x0030)
++ {
++ pNewStyle->SetMinRowHeight((float)fHeight);
++ }
++ else
++ {
++ pNewStyle->SetRowHeight((float)fHeight);
++ }
++
++ pXFRow->SetStyleName(pXFStyleManager->AddStyle(pNewStyle)->GetStyleName());
++}
++
++/**
++ * @short find max merge cell in a given column range
++ * @param nStartCol - start column ID
++ * @param nEndCol - end column ID
++ */
++sal_Int32 LwpRowLayout::FindMarkConnCell(sal_uInt8 nStartCol,sal_uInt8 nEndCol)
++{
++ if (m_ConnCellList.size() == 0)
++ return -1;
++
++ sal_uInt16 nSpannRows = 1;
++ sal_Int32 nMarkConnCell = -1;
++
++ for (sal_uInt16 i=0;i<m_ConnCellList.size();i++)
++ {
++ if (m_ConnCellList[i]->GetColID()>=nEndCol)
++ break;
++ if (m_ConnCellList[i]->GetColID()>=nStartCol)
++ {
++ if (m_ConnCellList[i]->GetNumrows()>nSpannRows)
++ {
++ nSpannRows = m_ConnCellList[i]->GetNumrows();
++ nMarkConnCell = i;
++ }
++ }
++ }
++ return nMarkConnCell;
++}
++
++/**
++ * @short find next merge cell with the same spanned row number with current merge cell
++ * @param nStartCol - start column ID
++ * @param nEndCol - end column ID
++ */
++sal_Int32 LwpRowLayout::FindNextMarkConnCell(sal_uInt16 nMarkConnCell,sal_uInt8 nEndCol)
++{
++ sal_uInt16 nMaxRows = m_ConnCellList[nMarkConnCell]->GetNumrows();
++
++ for (sal_uInt16 i=nMarkConnCell+1;i<m_ConnCellList.size();i++)
++ {
++ if (m_ConnCellList[i]->GetColID()>=nEndCol)
++ break;
++ if (m_ConnCellList[i]->GetNumrows() == nMaxRows)
++ {
++ return i;
++ }
++ }
++ return -1;
++}
++/**
++ * @short get max spanned row numbers in a given column range
++ * @param nStartCol - start column ID
++ * @param nEndCol - end column ID
++ */
++sal_uInt16 LwpRowLayout::GetCurMaxSpannedRows(sal_uInt8 nStartCol,sal_uInt8 nEndCol)
++{
++ sal_Int32 nMarkConnCell = FindMarkConnCell(nStartCol,nEndCol);
++ if (nMarkConnCell == -1)
++ return 1;
++ else
++ return m_ConnCellList[nMarkConnCell]->GetNumrows();
++}
++/**
++ * @short convert row with rowlayout,but no merge cells
++ * @param pXFTable - pointer of table
++ * @param nStartCol - start column ID
++ * @param nEndCol - end column ID
++ */
++void LwpRowLayout::ConvertCommonRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uInt8 nEndCol)
++{
++ XFRow* pRow = new XFRow;
++ pRow->SetStyleName(m_StyleName);
++
++ XFCell * pCell;
++ LwpTableLayout* pTableLayout = GetParentTableLayout();
++ LwpTable* pTable = pTableLayout->GetTable();
++ sal_Bool bIsRight = sal_False;
++ sal_Bool bIsTop = sal_False;
++ sal_uInt8 nCellStartCol,nCellEndCol;
++
++ for (sal_uInt8 i = nStartCol; i < nEndCol ; i++)
++ {
++ // add row to table
++ LwpObjectID *pCellID= GetChildHead();
++ LwpCellLayout * pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj());
++ nCellStartCol = i;//mark the begin position of cell
++ nCellEndCol = i;//mark the end position of cell
++ while(pCellLayout)
++ {
++ if (pCellLayout->GetColID() == i)
++ {
++ if (pCellLayout->GetLayoutType() == LWP_CONNECTED_CELL_LAYOUT)
++ {
++ LwpConnectedCellLayout* pConnCell = static_cast<LwpConnectedCellLayout*>(pCellLayout);
++ nCellEndCol = i+pConnCell->GetNumcols()-1;
++ i = nCellEndCol;
++ }
++ pCell = pCellLayout->ConvertCell(*pTable->GetObjectID(),crowid,i);
++ break;
++ }
++ pCellID = pCellLayout->GetNext();
++ pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj());
++ }
++ if (!pCellLayout)
++ {
++ // if table has default cell layout, use it to ConvertCell
++ // otherwise use blank cell
++ LwpCellLayout * pDefaultCell = pTableLayout->GetDefaultCellLayout();
++ if (pDefaultCell)
++ {
++ pCell = pDefaultCell->ConvertCell(
++ *pTable->GetObjectID(),crowid, i);
++ }
++ else
++ {
++ pCell = new XFCell;
++ }
++ }
++ pRow->AddCell(pCell);
++
++ for (sal_uInt8 j=nCellStartCol;j<=nCellEndCol;j++)
++ pTableLayout->SetCellsMap(crowid,j,pCell);//set to cellsmap
++ }
++
++ pXFTable->AddRow(pRow);
++}
++/**
++ * @short collect merge cell info when register row styles
++ */
++void LwpRowLayout::CollectMergeInfo()
++{
++ LwpObjectID *pCellID= GetChildHead();
++ LwpCellLayout * pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj());
++
++ while(pCellLayout)
++ {
++ if (pCellLayout->GetLayoutType() == LWP_CONNECTED_CELL_LAYOUT)
++ {
++ LwpConnectedCellLayout* pConnCell = static_cast<LwpConnectedCellLayout*>(pCellLayout);
++ m_ConnCellList.push_back(pConnCell);
++ }
++ pCellID = pCellLayout->GetNext();
++ pCellLayout = static_cast<LwpCellLayout *>(pCellID->obj());
++ }
++}
++/**
++ * @short split merge cells in this row
++ * @param nEffectRows - max spanned number of prevoius row
++ */
++void LwpRowLayout::SetCellSplit(sal_uInt16 nEffectRows)
++{
++ LwpConnectedCellLayout* pConnCell;
++ for (sal_uInt32 i=0; i<m_ConnCellList.size(); i++)
++ {
++ pConnCell = m_ConnCellList[i];
++ sal_uInt16 nRowSpan = pConnCell->GetRowID()+pConnCell->GetNumrows();
++ if ( nRowSpan > nEffectRows )
++ {
++ pConnCell->SetNumrows(nEffectRows - pConnCell->GetRowID());
++ }
++ }
++}
++/**
++ * @short check if the row has merge cell
++ */
++sal_Bool LwpRowLayout::GetMergeCellFlag()
++{
++ if (m_ConnCellList.size() == 0)
++ return sal_False;
++ else
++ return sal_True;
++}
++
++
++LwpRowHeadingLayout::LwpRowHeadingLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpRowLayout(objHdr, pStrm)
++{}
++
++LwpRowHeadingLayout::~LwpRowHeadingLayout()
++{}
++void LwpRowHeadingLayout::Read()
++{
++ LwpRowLayout::Read();
++
++ cRowLayout.ReadIndexed(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++
++LwpRowLayout * LwpRowHeadingLayout::GetRowLayout()
++{
++ LwpRowLayout * pRow = static_cast<LwpRowLayout *>(cRowLayout.obj());
++ return pRow;
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwprowlayout.hxx lotuswordpro/source/filter/lwprowlayout.hxx
+--- lotuswordpro.bak/source/filter/lwprowlayout.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwprowlayout.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,134 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - row layouts
++ */
++/*************************************************************************
++ * Change History
++ April 2005 Created
++ ************************************************************************/
++#ifndef _LWPROWLAYOUT_HXX
++#define _LWPROWLAYOUT_HXX
++
++#include "lwplayout.hxx"
++#include "lwptablelayout.hxx"
++#include "lwpcelllayout.hxx"
++
++class XFCell;
++class XFRow;
++class XFTable;
++class LwpTableLayout;
++class XFRowStyle;
++/**
++ * @brief
++ * VO_ROWLAYOUT obj
++ */
++class LwpRowLayout : public LwpVirtualLayout
++{
++public:
++ LwpRowLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpRowLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_ROW_LAYOUT;};
++ sal_uInt16 GetRowID() { return crowid;};
++ virtual void RegisterStyle();
++ inline LwpTableLayout * GetParentTableLayout(){return static_cast<LwpTableLayout *>(GetParent()->obj());};
++ void SetRowMap(void);
++protected:
++ void Read();
++ sal_uInt16 crowid;
++ sal_Int32 cheight; // Minimum height if height is automatic.
++ sal_uInt8 cLeaderDotCount; // dfb - # of cells with leader dots
++ sal_Int32 cLeaderDotY;
++ sal_uInt8 cRowFlags;
++ enum // for cRowFlags
++ {
++ RF_HAS_BORDER = 0x01,
++ RF_VALID_HAS_BORDER = 0x02,
++ RF_LEADER_COUNT_VALID = 0x4
++ };
++private:
++ std::vector<LwpConnectedCellLayout*> m_ConnCellList;
++ sal_Int32 FindMarkConnCell(sal_uInt8 nStartCol,sal_uInt8 nEndCol);
++ sal_Int32 FindNextMarkConnCell(sal_uInt16 nMarkConnCell,sal_uInt8 nEndCol);
++
++public:
++ void ConvertRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uInt8 nEndCol);
++ void ConvertCommonRow(XFTable* pXFTable,sal_uInt8 nStartCol,sal_uInt8 nEndCol);
++ void CollectMergeInfo();
++ void SetCellSplit(sal_uInt16 nEffectRows);
++ sal_Bool GetMergeCellFlag();
++ sal_uInt16 GetCurMaxSpannedRows(sal_uInt8 nStartCol,sal_uInt8 nEndCol);
++ void RegisterCurRowStyle(XFRow* pXFRow,sal_uInt16 nRowMark);
++};
++
++
++/**
++ * @brief
++ * VO_ROWHEADINGLAYOUT obj
++ */
++class LwpRowHeadingLayout : public LwpRowLayout
++{
++public:
++ LwpRowHeadingLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpRowHeadingLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_ROW_HEADING_LAYOUT;}
++ LwpRowLayout * GetRowLayout();
++protected:
++ void Read();
++ LwpObjectID cRowLayout;
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpsdwdrawheader.hxx lotuswordpro/source/filter/lwpsdwdrawheader.hxx
+--- lotuswordpro.bak/source/filter/lwpsdwdrawheader.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpsdwdrawheader.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,297 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*****************************************************************************
++ * Change History
++ * Mar 2005 Created
++ ****************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype
++ * The file declares structures and enums used by Lwp-Drawing-Module
++ */
++
++#ifndef _LWPSDWRAWHEADER_HXX
++#define _LWPSDWRAWHEADER_HXX
++
++#include "lwpheader.hxx"
++#include "lwptools.hxx"
++
++const sal_uInt8 DRAW_FACESIZE = 32;
++const double THRESHOLD = 0.0001;
++
++enum DrawObjectType
++{
++ OT_UNDEFINED,
++ OT_SELECT = 0,
++ OT_HAND = 1,
++ OT_LINE = 2,
++ OT_PERPLINE = 3,
++ OT_POLYLINE = 4,
++ OT_POLYGON = 5,
++ OT_RECT = 6,
++ OT_SQUARE = 7,
++ OT_RNDRECT = 8,
++ OT_RNDSQUARE = 9,
++ OT_OVAL = 10,
++ OT_CIRCLE = 11,
++ OT_ARC = 12,
++ OT_TEXT = 13,
++ OT_GROUP = 14,
++ OT_CHART = 15,
++ OT_METAFILE = 16,
++ OT_METAFILEIMG = 17,
++ OT_BITMAP = 18,
++ OT_TEXTART = 19,
++ OT_BIGBITMAP = 20
++};
++
++enum DrawFillType
++{
++ FT_TRANSPARENT = 0,
++ FT_VLTGRAY = 1,
++ FT_LTGRAY = 2,
++ FT_GRAY = 3,
++ FT_DKGRAY = 4,
++ FT_SOLID = 5,
++ FT_HORZHATCH = 6,
++ FT_VERTHATCH = 7,
++ FT_FDIAGHATCH = 8,
++ FT_BDIAGHATCH = 9,
++ FT_CROSSHATCH = 10,
++ FT_DIAGCROSSHATCH = 11,
++ FT_PATTERN = 12
++};
++
++enum DrawLineStyle
++{
++ LS_SOLID = 0,
++ LS_DASH = 1,
++ LS_DOT = 2,
++ LS_DASHDOT = 3,
++ LS_DASHDOTDOT = 4,
++ LS_NULL = 5,
++ LS_INSIDEFRAME = 6
++};
++
++// Text Attributes as stored in Draw files V1.2 and earlier
++enum DrawTextAttribute
++{
++ TA_BOLD = 0x0001, /* bolded font */
++ TA_ITALIC = 0x0002, /* italic font */
++ TA_UNDERLINE = 0x0004, /* underlined font */
++ TA_WORDUNDERLINE = 0x0008, /* broken underline */
++ TA_ALLCAPS = 0x0010, /* capitalized font */
++ TA_SMALLCAPS = 0x0020, /* all small capital letters */
++ TA_DOUBLEUNDER = 0x0040, /* double underline */
++ TA_STRIKETHRU = 0x0080, /* strikethru */
++ TA_SUPERSCRIPT = 0x0100, /* superscript */
++ TA_SUBSCRIPT = 0x0200 /* subscript */
++};
++
++enum DrawArrowHead
++{
++ AH_ARROW_NONE = 0,
++ AH_ARROW_FULLARROW = 1,
++ AH_ARROW_HALFARROW = 2,
++ AH_ARROW_LINEARROW = 3,
++ AH_ARROW_INVFULLARROW = 4,
++ AH_ARROW_INVHALFARROW = 5,
++ AH_ARROW_INVLINEARROW = 6,
++ AH_ARROW_TEE = 7,
++ AH_ARROW_SQUARE = 8,
++ AH_ARROW_CIRCLE = 9
++};
++
++struct SdwPoint
++{
++ sal_Int16 x;
++ sal_Int16 y;
++};
++
++struct SdwColor
++{
++ sal_uInt8 nR;
++ sal_uInt8 nG;
++ sal_uInt8 nB;
++ sal_uInt8 unused;
++};
++
++struct SdwClosedObjStyleRec
++{
++ sal_uInt8 nLineWidth;
++ sal_uInt8 nLineStyle;
++ SdwColor aPenColor;
++ SdwColor aForeColor;
++ SdwColor aBackColor;
++ sal_uInt16 nFillType;
++ sal_uInt8 pFillPattern[8];
++};
++
++struct SdwDrawObjHeader
++{
++// sal_uInt8 nType
++// sal_uInt8 nFlags;
++ sal_uInt16 nRecLen;
++ sal_Int16 nLeft;
++ sal_Int16 nTop;
++ sal_Int16 nRight;
++ sal_Int16 nBottom;
++// sal_uInt16 nextObj;
++// sal_uInt16 prevObj;
++};
++
++struct SdwLineRecord
++{
++ sal_Int16 nStartX;
++ sal_Int16 nStartY;
++ sal_Int16 nEndX;
++ sal_Int16 nEndY;
++ sal_uInt8 nLineWidth;
++ sal_uInt8 nLineEnd;
++ sal_uInt8 nLineStyle;
++ SdwColor aPenColor;
++};
++
++struct SdwPolyLineRecord
++{
++ sal_uInt8 nLineWidth;
++ sal_uInt8 nLineEnd;
++ sal_uInt8 nLineStyle;
++ SdwColor aPenColor;
++ sal_uInt16 nNumPoints;
++};
++
++struct SdwArcRecord
++{
++ sal_uInt8 nLineWidth;
++ sal_uInt8 nLineEnd;
++ sal_uInt8 nLineStyle;
++ SdwColor aPenColor;
++};
++
++struct SdwTextBoxRecord
++{
++ sal_Int16 nTextWidth;
++ sal_Int16 nTextHeight;
++ sal_Int16 nTextSize;
++ SdwColor aTextColor;
++ sal_uInt8 tmpTextFaceName[DRAW_FACESIZE];
++ sal_uInt16 nTextAttrs;
++ sal_uInt16 nTextCharacterSet;
++ sal_Int16 nTextRotation;
++ sal_Int16 nTextExtraSpacing;
++ sal_uInt8* pTextString;
++};
++
++struct SdwFMPATH
++{
++ sal_uInt16 n;
++ SdwPoint* pPts;
++};
++
++struct SdwTextArt : public SdwTextBoxRecord
++{
++ sal_uInt8 nIndex;
++ sal_Int16 nRotation;
++ sal_uInt16 nTextLen;
++ SdwFMPATH aPath[2];
++};
++
++struct SdwBmpRecord
++{
++ sal_uInt16 nTranslation;
++ sal_uInt16 nRotation;
++ sal_uInt32 nFileSize;
++};
++
++struct BmpInfoHeader
++{
++ sal_uInt32 nHeaderLen;
++ sal_uInt16 nWidth;
++ sal_uInt16 nHeight;
++ sal_uInt16 nPlanes;
++ sal_uInt16 nBitCount;
++};
++
++struct BmpInfoHeader2
++{
++ sal_uInt32 nHeaderLen;
++ sal_uInt32 nWidth;
++ sal_uInt32 nHeight;
++ sal_uInt16 nPlanes;
++ sal_uInt16 nBitCount;
++};
++
++struct DrawingOffsetAndScale
++{
++ double fOffsetX;
++ double fOffsetY;
++ double fScaleX;
++ double fScaleY;
++ double fLeftMargin;
++ double fTopMargin;
++
++ DrawingOffsetAndScale()
++ {
++ fOffsetX = 0.00;
++ fOffsetY = 0.00;
++ fScaleX = 1.00;
++ fScaleY = 1.00;
++ fLeftMargin = 0.00;
++ fTopMargin = 0.00;
++ }
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpsdwfileloader.cxx lotuswordpro/source/filter/lwpsdwfileloader.cxx
+--- lotuswordpro.bak/source/filter/lwpsdwfileloader.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpsdwfileloader.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,148 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*****************************************************************************
++ * Change History
++ * Mar 2005 revised for new processing procedure.
++ * Jan 2005 created
++ ****************************************************************************/
++#include "lwpsdwfileloader.hxx"
++#include "lwpsdwgrouploaderv0102.hxx"
++
++#include "xfilter/xfframe.hxx"
++
++LwpSdwFileLoader::LwpSdwFileLoader(SvStream* pStream, LwpGraphicObject* pGraphicObj,
++ IXFStream* pOutputStream)
++:m_pStream(pStream), m_pGraphicObj(pGraphicObj), m_pOutputStream(pOutputStream)
++{
++ pStream->Seek(0);
++}
++
++LwpSdwFileLoader::~LwpSdwFileLoader(void)
++{
++}
++/*
++void LwpSdwFileLoader::LoadObjectList(void)
++{
++ unsigned char BinSignature[2];
++ m_pStream->Read(BinSignature,2);
++
++ if (BinSignature[0] == 'S' && BinSignature[1] == 'M')
++ {
++ unsigned short nVersion;
++ m_pStream->Read(&nVersion,2);
++
++ m_pStream->Seek(0);
++ if (nVersion<0x0102)
++ {
++ assert(false);
++ }
++ if (nVersion>=0x0102)
++ {
++ LwpSdwGroupLoaderV0102 sdwGroupLoader(m_pStream, m_pGraphicObj, m_pOutputStream);
++ sdwGroupLoader.LoadDrawGroupObject();
++ }
++ }
++}
++void LwpSdwFileLoader::RegisterStyle()
++{
++ unsigned char BinSignature[2];
++ m_pStream->Read(BinSignature,2);
++
++ if (BinSignature[0] == 'S' && BinSignature[1] == 'M')
++ {
++ unsigned short nVersion;
++ m_pStream->Read(&nVersion,2);
++
++ m_pStream->Seek(0);
++ if (nVersion<0x0102)
++ {
++ assert(false);
++ }
++ if (nVersion>=0x0102)
++ {
++ LwpSdwGroupLoaderV0102 sdwGroupLoader(m_pStream, m_pGraphicObj, m_pOutputStream);
++ sdwGroupLoader.RegisterGroupStyle();
++ }
++ }
++}
++*/
++// add by ,03/25/2005
++/**
++ * @descr entry of lwp-drawing objects.
++ * @param pDrawObjVector a container which will contains the created drawing object of XF-Model.
++ */
++void LwpSdwFileLoader::CreateDrawObjects(vector <XFFrame*>* pDrawObjVector)
++{
++ unsigned char BinSignature[2];
++ m_pStream->Read(BinSignature,2);
++
++ if (BinSignature[0] == 'S' && BinSignature[1] == 'M')
++ {
++ unsigned short nVersion;
++ m_pStream->Read(&nVersion,2);
++
++ m_pStream->Seek(0);
++ if (nVersion<0x0102)
++ {
++ assert(false);
++ }
++ if (nVersion>=0x0102)
++ {
++ LwpSdwGroupLoaderV0102 sdwGroupLoader(m_pStream, m_pGraphicObj, m_pOutputStream);
++ sdwGroupLoader.BeginDrawObjects(pDrawObjVector);
++ }
++ }
++}
++// end add
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpsdwfileloader.hxx lotuswordpro/source/filter/lwpsdwfileloader.hxx
+--- lotuswordpro.bak/source/filter/lwpsdwfileloader.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpsdwfileloader.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,87 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*****************************************************************************
++ * Change History
++ * Mar 2005 revised for new processing procedure.
++ * Jan 2005 created
++ ****************************************************************************/
++#include <assert.h>
++#include <tools/stream.hxx>
++#include "lwpheader.hxx"
++#include "xfilter/ixfstream.hxx"
++#include <vector>
++using namespace std;
++
++class XFFrame;
++class LwpGraphicObject;
++class LwpSdwFileLoader
++{
++private:
++ SvStream* m_pStream;
++ IXFStream* m_pOutputStream;
++ LwpGraphicObject* m_pGraphicObj;
++public:
++ LwpSdwFileLoader(SvStream* pStream, LwpGraphicObject* pGraphicObj,
++ IXFStream* pOutputStream=NULL);
++ ~LwpSdwFileLoader(void);
++public:
++// void LoadObjectList(void);
++// void RegisterStyle(void);
++
++ // add by ,03/25/2005
++ void CreateDrawObjects(vector <XFFrame*>* pDrawObjVector);
++ // end add
++};
++
+diff -urNp lotuswordpro.bak/source/filter/lwpsdwgrouploaderv0102.cxx lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx
+--- lotuswordpro.bak/source/filter/lwpsdwgrouploaderv0102.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,410 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*****************************************************************************
++ * Change History
++ * Mar 2005 revised for new processing procedure.
++ * Jan 2005 created
++ ****************************************************************************/
++#include "lwpsdwgrouploaderv0102.hxx"
++#include "lwpdrawobj.hxx"
++#include "lwptools.hxx"
++#include "lwpcharsetmgr.hxx"
++#include "lwpgrfobj.hxx"
++#include "lwpframelayout.hxx"
++
++#include "xfilter/xfcolor.hxx"
++#include "xfilter/xfdrawline.hxx"
++#include "xfilter/xfdrawpath.hxx"
++#include "xfilter/xfdrawpolyline.hxx"
++#include "xfilter/xfdrawrect.hxx"
++#include "xfilter/xfdrawellipse.hxx"
++#include "xfilter/xfdrawpolygon.hxx"
++#include "xfilter/xfdrawgroup.hxx"
++#include "xfilter/xfdrawcircle.hxx"
++#include "xfilter/xfdrawstyle.hxx"
++#include "xfilter/xfdrawlinestyle.hxx"
++#include "xfilter/xfparagraph.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xfdrawgroup.hxx"
++
++LwpSdwGroupLoaderV0102::LwpSdwGroupLoaderV0102(SvStream* pStream, LwpGraphicObject* pGraphicObj,
++ IXFStream* pOutputStream)
++:m_pStream(pStream), m_pGraphicObj(pGraphicObj), m_pOutputStream(pOutputStream)
++{
++}
++LwpSdwGroupLoaderV0102::~LwpSdwGroupLoaderV0102(void)
++{
++}
++
++// add by , 03/25/2005
++/**
++ * @descr entry of lwp-drawing objects. the functin begins to parse the sdw-drawing bento stream and create
++ * the corresponding drawing objects.
++ * @param pDrawObjVector a container which will contains the created drawing object of XF-Model.
++ */
++void LwpSdwGroupLoaderV0102::BeginDrawObjects(std::vector <XFFrame*>* pDrawObjVector)
++{
++ // save the container
++ m_pDrawObjVector = pDrawObjVector;
++
++ //flag
++ unsigned char BinSignature[2];
++ m_pStream->Read(BinSignature,2);
++ if (BinSignature[0] != 'S' || BinSignature[1] != 'M')
++ {
++ assert(false);
++ return;
++ }
++ //version
++ unsigned short nVersion;
++ m_pStream->Read(&nVersion,2);
++ if (nVersion<0x0102)
++ {
++ assert(false);
++ return;
++ }
++ // topObj, botObj
++ m_pStream->SeekRel(4);
++ //record count
++ unsigned short nRecCount;
++ m_pStream->Read(&nRecCount,2);
++ // selCount
++ m_pStream->SeekRel(2);
++ //boundrect
++ unsigned short left,top,right,bottom;
++ m_pStream->Read(&left,2);
++ m_pStream->Read(&top,2);
++ m_pStream->Read(&right,2);
++ m_pStream->Read(&bottom,2);
++ // fileSize
++ m_pStream->SeekRel(2);
++
++ //for calculating transformation params.
++ LwpFrameLayout* pMyFrameLayout = static_cast<LwpFrameLayout*>(m_pGraphicObj->GetLayout(NULL));
++ if (pMyFrameLayout)
++ {
++ LwpLayoutScale* pMyScale = pMyFrameLayout->GetLayoutScale();
++ LwpLayoutGeometry* pFrameGeo = pMyFrameLayout->GetGeometry();
++ if (pMyScale && pFrameGeo)
++ {
++ // original drawing size
++ long nWidth = 0, nHeight = 0;
++ m_pGraphicObj->GetGrafOrgSize(nWidth, nHeight);
++ double fGrafOrgWidth = (double)nWidth/TWIPS_PER_CM;
++ double fGrafOrgHeight = (double)nHeight/TWIPS_PER_CM;
++
++ // get margin values
++ double fLeftMargin = pMyFrameLayout->GetMarginsValue(MARGIN_LEFT);
++// double fRightMargin = pMyFrameLayout->GetMarginsValue(MARGIN_RIGHT);
++ double fTopMargin = pMyFrameLayout->GetMarginsValue(MARGIN_TOP);
++// double fBottomMargin = pMyFrameLayout->GetMarginsValue(MARGIN_BOTTOM);
++
++ // frame size
++ double fFrameWidth = LwpTools::ConvertFromUnitsToMetric(pFrameGeo->GetWidth());
++ double fFrameHeight = LwpTools::ConvertFromUnitsToMetric(pFrameGeo->GetHeight());
++
++ // get frame offset
++ LwpPoint* pOffset = pMyScale->GetOffset();
++ double fOffsetX = LwpTools::ConvertFromUnitsToMetric(pOffset->GetX());
++ double fOffsetY = LwpTools::ConvertFromUnitsToMetric(pOffset->GetY());
++
++ // get scale mode
++ sal_uInt16 nScalemode = pMyScale->GetScaleMode();
++
++ if (nScalemode & LwpLayoutScale::CUSTOM)
++ {
++ m_aTransformData.fScaleX =
++ LwpTools::ConvertFromUnitsToMetric(pMyScale->GetScaleWidth()) / fGrafOrgWidth;
++ m_aTransformData.fScaleY =
++ LwpTools::ConvertFromUnitsToMetric(pMyScale->GetScaleHeight()) / fGrafOrgHeight;
++ }
++ else if (nScalemode & LwpLayoutScale::PERCENTAGE)
++ {
++ double fScalePercentage = (double)pMyScale->GetScalePercentage() / 1000;
++ m_aTransformData.fScaleX = fScalePercentage;
++ m_aTransformData.fScaleY = fScalePercentage;
++ }
++ else if (nScalemode & LwpLayoutScale::FIT_IN_FRAME)
++ {
++ double fWidth0 = (double)right / TWIPS_PER_CM;
++ double fHeight0 = (double)bottom / TWIPS_PER_CM;
++
++ double fWidth1 = LwpTools::ConvertFromUnitsToMetric(pMyScale->GetScaleWidth());
++ double fHeight1 = LwpTools::ConvertFromUnitsToMetric(pMyScale->GetScaleHeight());
++
++ double fScaleX = fWidth1 / fWidth0;
++ double fScaleY = fHeight1 / fHeight0;
++
++ if (nScalemode & LwpLayoutScale::MAINTAIN_ASPECT_RATIO)
++ {
++ m_aTransformData.fScaleX = std::min(fScaleX, fScaleY);
++ m_aTransformData.fScaleY = m_aTransformData.fScaleX;
++ }
++ else
++ {
++ m_aTransformData.fScaleX = fWidth1 / fWidth0;
++ m_aTransformData.fScaleY = fHeight1 / fHeight0;
++ }
++ }
++
++ // placement: centered
++ if (pMyFrameLayout->GetScaleCenter())
++ {
++ Rectangle aBoundRect(left*m_aTransformData.fScaleX + fLeftMargin,
++ top*m_aTransformData.fScaleY + fTopMargin,
++ right * m_aTransformData.fScaleX,
++ bottom * m_aTransformData.fScaleY);
++ Point aCenter = aBoundRect.Center();
++
++ double fNewCenterX = (double(left)/TWIPS_PER_CM + fFrameWidth/*-fOffsetX*/) / 2;
++ double fNewCenterY = (double(top)/TWIPS_PER_CM + fFrameHeight/*-fOffsetY*/) / 2;
++
++ m_aTransformData.fOffsetX = fNewCenterX - (double)aCenter.X()/TWIPS_PER_CM;
++ m_aTransformData.fOffsetY = fNewCenterY -(double)aCenter.Y()/TWIPS_PER_CM;
++ }
++ else
++ {
++ m_aTransformData.fOffsetX = fOffsetX;
++ m_aTransformData.fOffsetY = fOffsetY;
++ }
++
++ m_aTransformData.fOffsetX += fLeftMargin;
++ m_aTransformData.fOffsetY += fTopMargin;
++ m_aTransformData.fLeftMargin = fLeftMargin;
++ m_aTransformData.fTopMargin = fTopMargin;
++ }
++ }
++
++ //load draw object
++ for (unsigned short i = 0; i < nRecCount; i++)
++ {
++ XFFrame* pXFDrawObj = this->CreateDrawObject();
++
++ if (pXFDrawObj)
++ {
++ pDrawObjVector->push_back(pXFDrawObj);
++ }
++ }
++}
++
++/**
++ * @descr when we encounter a group object the function will be called to create a XF-drawgroup object
++ * the corresponding drawing objects.
++ * @param pDrawObjVector a container which will contains the created drawing object of XF-Model.
++ */
++XFDrawGroup* LwpSdwGroupLoaderV0102::CreateDrawGroupObject(void)
++{
++ //flag
++ unsigned char BinSignature[2];
++ m_pStream->Read(BinSignature,2);
++ if (BinSignature[0] != 'S' || BinSignature[1] != 'M')
++ {
++ assert(false);
++ return NULL;
++ }
++ //version
++ unsigned short nVersion;
++ m_pStream->Read(&nVersion,2);
++ if (nVersion<0x0102)
++ {
++ assert(false);
++ return NULL;
++ }
++ // topObj, botObj
++ m_pStream->SeekRel(4);
++ //record count
++ unsigned short nRecCount;
++ m_pStream->Read(&nRecCount,2);
++ // selCount
++ m_pStream->SeekRel(2);
++ //boundrect
++ unsigned short left,top,right,bottom;
++ m_pStream->Read(&left,2);
++ m_pStream->Read(&top,2);
++ m_pStream->Read(&right,2);
++ m_pStream->Read(&bottom,2);
++ // fileSize
++ m_pStream->SeekRel(2);
++
++ XFDrawGroup* pXFDrawGroup = new XFDrawGroup();
++
++ //load draw object
++ for (unsigned short i = 0; i < nRecCount; i++)
++ {
++ XFFrame* pXFDrawObj = this->CreateDrawObject();
++
++ if (pXFDrawObj)
++ {
++ if (pXFDrawObj->GetFrameType() == enumXFFrameImage)
++ {
++ m_pDrawObjVector->push_back(pXFDrawObj);
++ }
++ else
++ {
++ pXFDrawGroup->Add(pXFDrawObj);
++ }
++ }
++ }
++
++ return pXFDrawGroup;
++}
++
++/**
++ * @descr Create the XF-drawing objects according to the object type read from bento stream.
++ * @return the created XF-drawing objects.
++ */
++XFFrame* LwpSdwGroupLoaderV0102::CreateDrawObject(void)
++{
++ //record type
++ unsigned char recType;
++ m_pStream->Read(&recType,1);
++
++ LwpDrawObj* pDrawObj = NULL;
++ XFFrame* pRetObjct = NULL;
++
++ switch(recType)
++ {
++ case OT_PERPLINE://fall-through
++ case OT_LINE:
++ {
++ pDrawObj = new LwpDrawLine(m_pStream, &m_aTransformData);
++ break;
++ }
++ case OT_POLYLINE:
++ {
++ pDrawObj = new LwpDrawPolyLine(m_pStream, &m_aTransformData);
++ break;
++ }
++ case OT_POLYGON:
++ {
++ pDrawObj = new LwpDrawPolygon(m_pStream, &m_aTransformData);
++ pDrawObj->SetObjectType(OT_POLYGON);
++ break;
++ }
++ case OT_SQUARE://fall-through
++ case OT_RECT:
++ {
++ pDrawObj = new LwpDrawRectangle(m_pStream, &m_aTransformData);
++ break;
++ }
++ case OT_RNDSQUARE://fall-through
++ case OT_RNDRECT:
++ {
++ pDrawObj = new LwpDrawRectangle(m_pStream, &m_aTransformData);
++ pDrawObj->SetObjectType(OT_RNDRECT);
++ break;
++ }
++ case OT_CIRCLE://fall-through
++ case OT_OVAL:
++ {
++ pDrawObj = new LwpDrawEllipse(m_pStream, &m_aTransformData);
++ break;
++ }
++ case OT_ARC:
++ {
++ pDrawObj = new LwpDrawArc(m_pStream, &m_aTransformData);
++ break;
++ }
++ case OT_TEXT:
++ {
++ pDrawObj = new LwpDrawTextBox(m_pStream);
++ break;
++ }
++ case OT_TEXTART:
++ {
++ pDrawObj = new LwpDrawTextArt(m_pStream, &m_aTransformData);
++ pDrawObj->SetObjectType(OT_TEXTART);
++ break;
++ }
++ case OT_GROUP:
++ {
++ m_pStream->SeekRel(2);
++ // read out the object header
++ pDrawObj = new LwpDrawGroup(m_pStream);
++
++ pRetObjct = this->CreateDrawGroupObject();
++
++ // set anchor type
++ pRetObjct->SetAnchorType(enumXFAnchorFrame);
++ break;
++ }
++ case OT_CHART://fall-through
++ case OT_METAFILE://fall-through
++ case OT_METAFILEIMG:
++ {
++ LwpDrawMetafile aMeta(m_pStream);
++ break;
++ }
++ case OT_BITMAP:
++ pDrawObj = new LwpDrawBitmap(m_pStream);
++ pDrawObj->SetObjectType(OT_BITMAP);
++ break;
++ }
++
++ // we don't need create the corresponding XF-object of a group object.
++ if (pDrawObj && recType != OT_GROUP)
++ {
++ pRetObjct = pDrawObj->CreateXFDrawObject();
++ }
++
++ if (pDrawObj)
++ {
++ delete pDrawObj;
++ pDrawObj = NULL;
++ }
++
++ return pRetObjct;
++}
++// end add
+diff -urNp lotuswordpro.bak/source/filter/lwpsdwgrouploaderv0102.hxx lotuswordpro/source/filter/lwpsdwgrouploaderv0102.hxx
+--- lotuswordpro.bak/source/filter/lwpsdwgrouploaderv0102.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpsdwgrouploaderv0102.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,95 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*****************************************************************************
++ * Change History
++ * Mar 2005 revised for new processing procedure.
++ * Jan 2005 created
++ ****************************************************************************/
++#include <tools/stream.hxx>
++#include "lwpheader.hxx"
++#include "assert.h"
++#include "xfilter/ixfstream.hxx"
++#include "lwpsdwdrawheader.hxx"
++
++class XFFrame;
++class XFDrawGroup;
++class LwpGraphicObject;
++class LwpSdwGroupLoaderV0102
++{
++private:
++ SvStream* m_pStream;
++ IXFStream* m_pOutputStream;
++ LwpGraphicObject* m_pGraphicObj;
++ std::vector <XFFrame*>* m_pDrawObjVector;
++
++ DrawingOffsetAndScale m_aTransformData;
++
++public:
++ LwpSdwGroupLoaderV0102(SvStream* pStream, LwpGraphicObject* pGraphicObj,
++ IXFStream* pOutputStream);
++ ~LwpSdwGroupLoaderV0102(void);
++public:
++// void LoadDrawGroupObject(void);
++// void LoadDrawObject(void);
++// void RegisterGroupStyle(void);
++// void RegisterStyle(void);
++
++ // add by ,03/25/2005
++ void BeginDrawObjects(std::vector <XFFrame*>* pDrawObjVector);
++ XFDrawGroup* CreateDrawGroupObject(void);
++ XFFrame* CreateDrawObject(void);
++ // end add
++};
++
+diff -urNp lotuswordpro.bak/source/filter/lwpsdwrect.cxx lotuswordpro/source/filter/lwpsdwrect.cxx
+--- lotuswordpro.bak/source/filter/lwpsdwrect.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpsdwrect.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,231 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*****************************************************************************
++ * Change History
++ * Mar 2005 Revised for lwpfilter
++ ****************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype
++ * Implementation file of SdwRectangle.
++ */
++#include "lwpsdwrect.hxx"
++
++/**************************************************************************
++ * @date: 11/19/2004
++ * @short: Default constructor
++**************************************************************************/
++SdwRectangle::SdwRectangle() : m_bRotated(sal_False)
++{
++ for (UINT16 i = 0; i < 4; i++)
++ {
++ m_nRectCorner[0] = Point(0, 0);
++ }
++}
++/**************************************************************************
++ * @date: 11/19/2004
++ * @short: Constructor
++ * @param: aPt0~aPt3 four corner points of a rectangle.
++**************************************************************************/
++SdwRectangle::SdwRectangle(const Point& rPt0, const Point& rPt1,
++ const Point& rPt2, const Point& rPt3) : m_bRotated(sal_True)
++{
++ m_nRectCorner[0] = rPt0;
++ m_nRectCorner[1] = rPt1;
++ m_nRectCorner[2] = rPt2;
++ m_nRectCorner[3] = rPt3;
++
++ if (rPt0.Y() == rPt1.Y() && rPt0.Y() < rPt3.Y())
++ {
++ m_bRotated = sal_False;
++ }
++}
++
++/**************************************************************************
++ * @date: 12/15/2004
++ * @short: Copy constructor
++**************************************************************************/
++SdwRectangle::SdwRectangle(const SdwRectangle& rOther)
++{
++ m_nRectCorner[0] = rOther.m_nRectCorner[0];
++ m_nRectCorner[1] = rOther.m_nRectCorner[1];
++ m_nRectCorner[2] = rOther.m_nRectCorner[2];
++ m_nRectCorner[3] = rOther.m_nRectCorner[3];
++
++ m_bRotated = rOther.IsRectRotated();
++}
++/**************************************************************************
++ * @date: 11/19/2004
++ * @short: Destructor
++**************************************************************************/
++SdwRectangle::~SdwRectangle()
++{
++}
++/**************************************************************************
++ * @date: 11/19/2004
++ * @short: Get the flag whether if the rectangle has been rotated.
++ * @return: m_bRotated rotation flag.
++**************************************************************************/
++sal_Bool SdwRectangle::IsRectRotated() const
++{
++ return m_bRotated;
++}
++/**************************************************************************
++ * @date: 11/19/2004
++ * @short: Calculate and return center point of the rectangle.
++ * @return: center point
++**************************************************************************/
++Point SdwRectangle::GetRectCenter() const
++{
++ long nX = (long)((double)(m_nRectCorner[0].X() + m_nRectCorner[2].X())/2 + 0.5);
++ long nY = (long)((double)(m_nRectCorner[0].Y() + m_nRectCorner[2].Y())/2 + 0.5);
++
++ return Point(nX, nY);
++}
++/**************************************************************************
++ * @date: 11/19/2004
++ * @short: Calculate width of the rectangle.
++ * @return: rectangle width.
++**************************************************************************/
++long SdwRectangle::GetWidth() const
++{
++ long nX0 = m_nRectCorner[0].X();
++ long nY0 = m_nRectCorner[0].Y();
++ long nX1 = m_nRectCorner[1].X();
++ long nY1 = m_nRectCorner[1].Y();
++
++ return (long)CalcDistBetween2Points(nX0, nY0, nX1, nY1);
++}
++/**************************************************************************
++ * @date: 11/19/2004
++ * @short: Calculate height of the rectangle.
++ * @return: rectangle height.
++**************************************************************************/
++long SdwRectangle::GetHeight() const
++{
++ long nX1 = m_nRectCorner[1].X();
++ long nY1 = m_nRectCorner[1].Y();
++ long nX2 = m_nRectCorner[2].X();
++ long nY2 = m_nRectCorner[2].Y();
++
++ return (long)CalcDistBetween2Points(nX1, nY1, nX2, nY2);
++}
++/**************************************************************************
++ * @date: 11/19/2004
++ * @short: Calculate coordinate of the original rectangle.
++ * @return: a prz rectangle
++**************************************************************************/
++Rectangle SdwRectangle::GetOriginalRect() const
++{
++ if (m_bRotated)
++ {
++ long nHeight = GetHeight();
++ long nWidth = GetWidth();
++ Point aCenter = GetRectCenter();
++
++ Point aLT(aCenter.X()-(long)((double)nWidth/2+0.5),
++ aCenter.Y()-(long)((double)nHeight/2+0.5));
++ Point aRT(aLT.X()+nWidth, aLT.Y());
++ Point aLB(aLT.X(), aLT.Y()-nHeight);
++ Point aRB(aLT.X()+nWidth, aLT.Y()+nHeight);
++
++ return Rectangle(aLT, aRB);
++ }
++ else
++ {
++ return Rectangle(m_nRectCorner[3], m_nRectCorner[1]);
++ }
++}
++/**************************************************************************
++ * @date: 11/19/2004
++ * @short: Calculate rotation angle of the rectangle.
++ * @return: rotation angle.
++**************************************************************************/
++double SdwRectangle::GetRotationAngle() const
++{
++ if (!m_bRotated)
++ {
++ return 0.00;
++ }
++
++ double fX1 = (double)(m_nRectCorner[1].X());
++ double fY1 = (double)(m_nRectCorner[1].Y());
++ double fX2 = (double)(m_nRectCorner[2].X());
++ double fY2 = (double)(m_nRectCorner[2].Y());
++ double fMidX = (fX1 + fX2) / 2;
++ double fMidY = (fY1 + fY2) / 2;
++
++ Point aCenter = GetRectCenter();
++ double fCenterX = (double)aCenter.X();
++ double fCenterY = (double)aCenter.Y();
++
++ double fAngle = atan2((fMidY - fCenterY), (fMidX - fCenterX));
++
++ return -fAngle;
++}
++
++double SdwRectangle::CalcDistBetween2Points(long nX1, long nY1, long nX2, long nY2)
++{
++ return sqrt((double)((nX1-nX2)*(nX1-nX2) + (nY1-nY2)*(nY1-nY2)));
++}
++
++Rectangle SdwRectangle::GetOriginalRect(const Point& rCenter, long nHalfWidth, long nHalfHeight)
++{
++ Point aLT(rCenter.X()-nHalfWidth, rCenter.Y()-nHalfHeight);
++ Point aRB(rCenter.X()+nHalfWidth, rCenter.Y()+nHalfHeight);
++
++ return Rectangle(aLT, aRB);
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpsdwrect.hxx lotuswordpro/source/filter/lwpsdwrect.hxx
+--- lotuswordpro.bak/source/filter/lwpsdwrect.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpsdwrect.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,128 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*****************************************************************************
++ * Change History
++ * Mar 2005 Revised for lwpfilter
++ ****************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype
++ * Implementation file of SdwRectangle.
++ */
++#ifndef _SDWRECTANGLE_HXX
++#define _SDWRECTANGLE_HXX
++
++#include "lwpheader.hxx"
++#include <tools/gen.hxx>
++
++/**
++ * @brief
++ * SdwRectangle: Not like rectangle in SODC, rectagles in Word Pro are
++ * defined by 4 points. So they can be any posture in the two-dimensional
++ * coordinate system. The class is used to describ such rectangles.
++ * The foure corner points must be save in menber variable:m_nRectCorner
++ * one after another. We assume the input order(the same order in .lwp files)
++ * is as below:
++ *
++ * y ^ m_nRectCorner[3] m_nRectCorner[2]
++ * | |--------------------|
++ * | | |
++ * | | |
++ * | |--------------------|
++ * | m_nRectCorner[0] m_nRectCorner[1]
++ * |
++ * |------------------------------------------------------->
++ * (0,0) x
++ *
++ */
++class SdwRectangle
++{
++private:
++ sal_Bool m_bRotated;
++
++public:
++ Point m_nRectCorner[4];
++
++public:
++
++ SdwRectangle();
++
++ SdwRectangle(const Point& rPt0, const Point& rPt1,
++ const Point& rPt2, const Point& rPt3);
++
++ SdwRectangle(const SdwRectangle& rOther);
++
++ ~SdwRectangle();
++
++public:
++ sal_Bool IsRectRotated() const;
++
++ Point GetRectCenter() const ;
++
++ long GetWidth() const;
++
++ long GetHeight() const;
++
++ Rectangle GetOriginalRect() const;
++
++ double GetRotationAngle() const;
++
++ static double CalcDistBetween2Points(long nX1, long nY1, long nX2, long nY2);
++
++ static Rectangle GetOriginalRect(const Point& rCenter, long nHalfWidth, long nHalfHeight);
++
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpsection.cxx lotuswordpro/source/filter/lwpsection.cxx
+--- lotuswordpro.bak/source/filter/lwpsection.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpsection.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,156 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpcolor.hxx"
++#include "lwpatomholder.hxx"
++#include "lwplayout.hxx"
++#include "lwpdlvlist.hxx"
++#include "lwpobj.hxx"
++#include "lwpsection.hxx"
++#include "xfilter/xfsection.hxx"
++
++LwpOrderedObject::LwpOrderedObject(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpDLNFVList(objHdr, pStrm)
++{}
++
++/**
++ * @descr: read object information
++ *
++ */
++void LwpOrderedObject::Read()
++{
++ LwpDLNFVList::Read();
++
++ m_ListList.ReadIndexed(m_pObjStrm);
++ m_Para.ReadIndexed(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++
++LwpSection::LwpSection(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ : LwpOrderedObject(objHdr, pStrm)
++{}
++
++LwpSection::~LwpSection()
++{
++
++}
++
++/**
++ * @descr: read object information
++ *
++ */
++void LwpSection::Read()
++{
++ LwpOrderedObject::Read();
++ m_pObjStrm->QuickRead(&m_Flags, sizeof(m_Flags));
++ m_PageLayout.ReadIndexed(m_pObjStrm);
++ m_Color.Read(m_pObjStrm);
++ m_AtomHolder.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++ * @descr: do nothing
++ *
++ */
++void LwpSection::Parse(IXFStream *pOutputStream)
++{
++
++}
++
++LwpIndexSection::LwpIndexSection(LwpObjectHeader &objHdr, LwpSvStream *pStrm)
++ : LwpSection(objHdr, pStrm)
++{}
++
++LwpIndexSection::~LwpIndexSection()
++{
++}
++
++/**
++ * @descr: read object information
++ *
++ */
++void LwpIndexSection::Read()
++{
++ LwpSection::Read();
++ m_TextMarker.Read(m_pObjStrm);
++ m_ParentName.Read(m_pObjStrm);
++ m_DivisionName.Read(m_pObjStrm);
++ m_SectionName.Read(m_pObjStrm);
++ m_pObjStrm->QuickRead(&m_nForm, sizeof(m_nForm));
++ m_pObjStrm->QuickRead(&m_nFlags, sizeof(m_nFlags));
++ m_pObjStrm->SkipExtra();
++}
++
++sal_Bool LwpIndexSection::IsFormatRunin()
++{
++ return (m_nFlags & RUN_IN);
++
++}
++
++sal_Bool LwpIndexSection::IsFormatSeparator()
++{
++ return (m_nFlags & SEPARATORS);
++
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpsection.hxx lotuswordpro/source/filter/lwpsection.hxx
+--- lotuswordpro.bak/source/filter/lwpsection.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpsection.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,172 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPSECTION_HXX
++#define _LWPSECTION_HXX
++#include "lwppagelayout.hxx"
++
++/**
++ * @brief COrderedObject class in .lwp file
++ *
++ */
++class LwpDLNFVList;
++class LwpOrderedObject : public LwpDLNFVList
++{
++public:
++ LwpOrderedObject(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpOrderedObject(){};
++ void Read();
++ LwpObjectID* GetPosition(){ return &m_Para;};
++ LwpObjectID* GetListList(){ return &m_ListList;};
++protected:
++ LwpObjectID m_ListList;//lwplistlist object,
++ LwpObjectID m_Para;
++};
++
++/**
++ * @brief VO_SECTION object in .lwp file
++ *
++ */
++class LwpColor;
++class LwpAtomHolder;
++class LwpSection : public LwpOrderedObject
++{
++public:
++ LwpSection(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpSection();
++ inline sal_uInt16 GetFlags();
++ inline LwpPageLayout* GetPageLayout();
++ inline LwpColor* GetColor();
++ inline LwpAtomHolder* GetAtomHolder();
++ void Parse(IXFStream* pOutputStream);
++ OUString GetSectionName(){return m_AtomHolder.str();}
++
++protected:
++ void Read();
++private:
++ sal_uInt16 m_Flags;
++ LwpObjectID m_PageLayout;
++ LwpColor m_Color;
++ LwpAtomHolder m_AtomHolder;
++
++};
++
++/**
++ * @descr Get flage value
++ *
++ */
++inline sal_uInt16 LwpSection::GetFlags()
++{
++ return m_Flags;
++}
++
++/**
++ * @descr Get page layout pointer
++ *
++ */
++inline LwpPageLayout* LwpSection::GetPageLayout()
++{
++ return static_cast<LwpPageLayout*>(m_PageLayout.obj());
++}
++
++/**
++ * @descr get section tab color
++ *
++ */
++inline LwpColor* LwpSection::GetColor()
++{
++ return &m_Color;
++}
++
++/**
++ * @descr get section atom holder pointer
++ *
++ */
++inline LwpAtomHolder* LwpSection::GetAtomHolder()
++{
++ return &m_AtomHolder;
++}
++
++
++class LwpIndexSection : public LwpSection
++{
++public:
++ LwpIndexSection(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpIndexSection();
++ sal_Bool IsFormatRunin();
++ sal_Bool IsFormatSeparator();
++protected:
++ void Read();
++private:
++ enum{
++ SEPARATORS = 0x01,
++ RUN_IN = 0X02,
++ };
++ LwpAtomHolder m_TextMarker;
++ LwpAtomHolder m_ParentName;
++ LwpAtomHolder m_DivisionName;
++ LwpAtomHolder m_SectionName;
++ sal_uInt16 m_nForm;
++ sal_uInt16 m_nFlags;
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpshadow.hxx lotuswordpro/source/filter/lwpshadow.hxx
+--- lotuswordpro.bak/source/filter/lwpshadow.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpshadow.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,121 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-13 Created
++ ************************************************************************/
++#ifndef _LWPSHADOW_HXX
++#define _LWPSHADOW_HXX
++
++#include "lwpcolor.hxx"
++#include "lwptools.hxx"
++
++class LwpShadow
++{
++public:
++ LwpShadow():m_nDirX(0),m_nDirY(0){}
++public:
++ void Read(LwpObjectStream *pStrm)
++ {
++ m_aColor.Read(pStrm);
++ pStrm->QuickRead(&m_nDirX, sizeof(m_nDirX));
++ pStrm->QuickRead(&m_nDirY, sizeof(m_nDirY));
++ pStrm->SkipExtra();
++ }
++
++ double GetOffsetX();
++
++ double GetOffsetY();
++
++ LwpColor GetColor();
++
++ //add by , 01/26/2005
++ inline void operator = (const LwpShadow& rOther);
++ //end add
++
++private:
++ LwpColor m_aColor;
++ sal_Int32 m_nDirX;
++ sal_Int32 m_nDirY;
++};
++
++inline double LwpShadow::GetOffsetX()
++{
++ // return 0.102;
++ return LwpTools::ConvertFromUnitsToMetric(m_nDirX);
++}
++
++inline double LwpShadow::GetOffsetY()
++{
++ return LwpTools::ConvertFromUnitsToMetric(m_nDirY);
++}
++
++inline LwpColor LwpShadow::GetColor()
++{
++ return m_aColor;
++}
++
++inline void LwpShadow::operator = (const LwpShadow& rOther)
++{
++ m_aColor = rOther.m_aColor;
++ m_nDirX = rOther.m_nDirX;
++ m_nDirY = rOther.m_nDirY;
++}
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwpsilverbullet.cxx lotuswordpro/source/filter/lwpsilverbullet.cxx
+--- lotuswordpro.bak/source/filter/lwpsilverbullet.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpsilverbullet.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,486 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++#include "lwpglobalmgr.hxx"
++#include "lwpsilverbullet.hxx"
++#include "lwpdoc.hxx"
++#include "lwpdivinfo.hxx"
++#include "lwpfoundry.hxx"
++#include "lwpstory.hxx"
++#include "lwppara.hxx"
++#include "xfilter/xfliststyle.hxx"
++#include "xfilter/xfstylemanager.hxx"
++
++LwpSilverBullet::LwpSilverBullet(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpDLNFVList(objHdr, pStrm), m_pAtomHolder(new LwpAtomHolder), m_pBulletPara(NULL)
++{
++}
++
++LwpSilverBullet::~LwpSilverBullet()
++{
++ if (m_pAtomHolder)
++ {
++ delete m_pAtomHolder;
++ }
++}
++
++void LwpSilverBullet::Read()
++{
++ LwpDLNFVList::Read();
++
++ m_pObjStrm->QuickRead(&m_nFlags, 2);
++ m_aStory.ReadIndexed(m_pObjStrm);
++
++ sal_uInt16 nNumPos;
++ m_pObjStrm->QuickRead(&nNumPos, 2);
++
++ for (sal_uInt8 nC = 0; nC < nNumPos; nC++)
++ {
++ m_pObjStrm->QuickRead(&m_pResetPositionFlags[nC], 1);
++ }
++
++ m_pObjStrm->QuickRead(&m_nUseCount, 4);
++
++ m_pAtomHolder->Read(m_pObjStrm);
++}
++
++/**
++ * @short: Register bullet or numbering style-list and store the returned
++ * name from XFStyleManager.
++ * @descr:
++ */
++void LwpSilverBullet::RegisterStyle()
++{
++ XFListStyle* pListStyle = new XFListStyle();
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++
++ this->GetBulletPara();
++
++ if (this->IsBulletOrdered() && this->HasName())
++ {
++ ParaNumbering aParaNumbering;
++ XFNumFmt aFmt;
++
++ //todo: find the flag in the file
++ sal_Bool bCumulative = sal_False;
++
++ //get the numbeing format of level-1
++ m_pBulletPara->GetParaNumber(1, &aParaNumbering);
++ if (aParaNumbering.pPrefix)
++ {
++ aFmt.SetPrefix(aParaNumbering.pPrefix->GetText());
++ }
++
++
++ for (sal_uInt8 nPos = 1; nPos < 10; nPos++)
++ {
++ //get numbering format according to the position.
++ m_pBulletPara->GetParaNumber(nPos, &aParaNumbering);
++ LwpFribParaNumber* pParaNumber = aParaNumbering.pParaNumber;
++ if (pParaNumber)
++ {
++ if (pParaNumber->GetStyleID() != NUMCHAR_other)
++ {
++ m_pHideLevels[nPos] = aParaNumbering.nNumLevel;
++ sal_uInt16 nDisplayLevel = this->GetDisplayLevel(nPos);
++ bCumulative = (sal_Bool)(nDisplayLevel > 1);
++ rtl::OUString aPrefix = this->GetAdditionalName(nPos);
++
++ XFNumFmt aFmt;
++ if (!bCumulative && aParaNumbering.pPrefix)
++ {
++ aFmt.SetPrefix(aPrefix + aParaNumbering.pPrefix->GetText());
++ }
++
++ aFmt.SetFormat(this->GetNumCharByStyleID(pParaNumber));
++
++ if (aParaNumbering.pSuffix)
++ {
++ aFmt.SetSuffix(aParaNumbering.pSuffix->GetText());
++ }
++
++ //set numbering format into the style-list.
++ pListStyle->SetListNumber(nPos, aFmt, pParaNumber->GetStart()+1);
++
++ if (bCumulative && nPos > 1)
++ {
++ pListStyle->SetDisplayLevel(nPos, nDisplayLevel);
++ }
++
++ }
++ else
++ {
++ rtl::OUString aPrefix, aSuffix;
++ if (aParaNumbering.pPrefix)
++ {
++ aPrefix = aParaNumbering.pPrefix->GetText();
++ }
++ if (aParaNumbering.pSuffix)
++ {
++ aSuffix = aParaNumbering.pSuffix->GetText();
++ }
++
++ pListStyle->SetListBullet(nPos, this->GetNumCharByStyleID(pParaNumber).toChar(),
++ rtl::OUString::createFromAscii("Times New Roman"), aPrefix, aSuffix);
++ }
++
++ pListStyle->SetListPosition(nPos, 0.0, 0.635, 0.0);
++ aParaNumbering.clear();
++ }
++ }
++ }
++ else
++ {
++ //register bullet style-list
++/* for (sal_uInt8 nC = 1; nC < 11; nC++)
++ {
++ pListStyle->SetListBullet(nC, this->GetBulletChar(), this->GetBulletFontName(),
++ this->GetPrefix(), this->GetSuffix());
++ pListStyle->SetListPosition(nC, 0.0, 0.635, 0.0);
++ }*/
++
++ }
++
++ //add style-list to style manager.
++ m_strStyleName = pXFStyleManager->AddStyle(pListStyle)->GetStyleName();
++}
++
++/**
++ * @short: Get the font name of the bullet.
++ * @descr:
++ * @return: Font name of the bullet.
++ */
++rtl::OUString LwpSilverBullet::GetBulletFontName()
++{
++ //foundry has been set?
++ if (!m_pFoundry)
++ {
++ return rtl::OUString::createFromAscii("");
++ }
++
++ LwpFontManager* pFontMgr = m_pFoundry->GetFontManger();
++ if (!pFontMgr)
++ {
++ return rtl::OUString::createFromAscii("");
++ }
++
++ sal_uInt32 nBulletFontID = m_pBulletPara->GetBulletFontID();
++ sal_uInt16 nFinalFont = static_cast<sal_uInt16>((nBulletFontID >> 16) & 0xFFFF);
++
++ //final fontid is valid?
++ if (nFinalFont > 255 || nFinalFont == 0)
++ {
++ return rtl::OUString::createFromAscii("");
++ }
++
++ //get font name from font manager.
++ rtl::OUString aFontName = pFontMgr->GetNameByID(nBulletFontID);
++
++ return aFontName;
++}
++/**
++ * @short: Get bullet character of the bullet vo_para.
++ * @descr:
++ * @return: An UChar32 bulle character.
++ */
++UChar32 LwpSilverBullet::GetBulletChar()
++{
++ rtl::OUString aBulletChar = m_pBulletPara->GetBulletChar();
++
++ return aBulletChar.toChar();
++}
++
++rtl::OUString LwpSilverBullet::GetPrefix()
++{
++ return rtl::OUString::createFromAscii("");
++}
++
++rtl::OUString LwpSilverBullet::GetSuffix()
++{
++ return rtl::OUString::createFromAscii("");
++}
++/**
++ * @short: Get the LwpPara object through story id.
++ */
++LwpPara* LwpSilverBullet::GetBulletPara()
++{
++ if (!m_pBulletPara)
++ {
++ LwpStory* pStory = static_cast<LwpStory*>(m_aStory.obj(VO_STORY));
++ if (!pStory)
++ {
++ return NULL;
++ }
++
++ m_pBulletPara = static_cast<LwpPara*>(pStory->GetFirstPara()->obj(VO_PARA));
++ }
++
++ return m_pBulletPara;
++}
++
++/**
++ * @short: Get numbering character of the bullet vo_para.
++ * @descr:
++ * @param: pParaNumber a pionter to the structure LwpFribParaNumber which
++ * includes numbering prefix, format and suffix.
++ * @return: An OUString object which store the numbering character.
++ */
++rtl::OUString LwpSilverBullet::GetNumCharByStyleID(LwpFribParaNumber* pParaNumber)
++{
++ if (!pParaNumber)
++ {
++ assert(false);
++ return rtl::OUString::createFromAscii("");
++ }
++
++ rtl::OUString strNumChar = rtl::OUString::createFromAscii("1");
++ sal_uInt16 nStyleID = pParaNumber->GetStyleID();
++ UChar32 uC = 0x0000;
++
++ switch (nStyleID)
++ {
++ case NUMCHAR_1:
++ case NUMCHAR_01:
++ case NUMCHAR_Chinese4:
++ strNumChar = rtl::OUString::createFromAscii("1");
++ break;
++ case NUMCHAR_A :
++ strNumChar = rtl::OUString::createFromAscii("A");
++ break;
++ case NUMCHAR_a:
++ strNumChar = rtl::OUString::createFromAscii("a");
++ break;
++ case NUMCHAR_I:
++ strNumChar = rtl::OUString::createFromAscii("I");
++ break;
++ case NUMCHAR_i:
++ strNumChar = rtl::OUString::createFromAscii("i");
++ break;
++ case NUMCHAR_other:
++ uC = static_cast<UChar32>(pParaNumber->GetNumberChar());
++ strNumChar = rtl::OUString(uC);
++ break;
++ case NUMCHAR_Chinese1:
++ {
++ sal_Unicode sBuf[13] = {0x58f9,0x002c,0x0020,0x8d30,0x002c,0x0020,0x53c1,0x002c,0x0020,0x002e,0x002e,0x002e,0x0};
++ strNumChar = rtl::OUString(sBuf);
++ }
++ break;
++ case NUMCHAR_Chinese2:
++ {
++ sal_Unicode sBuf[13] = {0x4e00,0x002c,0x0020,0x4e8c,0x002c,0x0020,0x4e09,0x002c,0x0020,0x002e,0x002e,0x002e,0x0};
++ strNumChar = rtl::OUString(sBuf);
++ }
++ break;
++ case NUMCHAR_Chinese3:
++ {
++ sal_Unicode sBuf[13] = {0x7532,0x002c,0x0020,0x4e59,0x002c,0x0020,0x4e19,0x002c,0x0020,0x002e,0x002e,0x002e,0x0};
++ strNumChar = rtl::OUString(sBuf);
++ }
++ break;
++ case NUMCHAR_none:
++ strNumChar = rtl::OUString::createFromAscii("");
++ break;
++ default:
++ break;
++ }//mod end
++ return strNumChar;
++}
++
++/**
++ * @short: To judge the silverbullet list is ordered or not.
++ * @descr:
++ * @return: sal_True if list is ordered, sal_False if list is unordered.
++ */
++sal_Bool LwpSilverBullet::IsBulletOrdered()
++{
++ return (sal_Bool)(m_pBulletPara->GetFribs()->HasFrib(FRIB_TAG_PARANUMBER) != NULL);
++}
++
++/**
++ * @short: Calculate the displaylevel according to the position and hidelevels.
++ * @descr:
++ * @param: nPos position of the numbering.
++ * @return: displaylevel of the position passed in.
++ */
++sal_uInt16 LwpSilverBullet::GetDisplayLevel(sal_uInt8 nPos)
++{
++ if (nPos > 1)
++ {
++ sal_uInt16 nHideBit = (1 << nPos);
++ for (sal_uInt8 nC = nPos-1; nC > 0; nC--)
++ {
++ sal_uInt16 nAttrMask = ~m_pHideLevels[nC];
++ if (!(nAttrMask & nHideBit))
++ {
++ return static_cast<sal_uInt16>(nPos - nC);
++ }
++ }
++ }
++
++ return static_cast<sal_uInt16>(nPos);
++}
++
++/**
++ * @descr: Get the additional information, "Division name" or "Section Name" from document
++ * variable frib according to numbering position. Whether we should add a
++ * Division/Section name or not is determined by the hidelevels of the frib.
++ * @param: nPos position of the numbering.
++ * @return: Division or Section name.
++ */
++rtl::OUString LwpSilverBullet::GetAdditionalName(sal_uInt8 nPos)
++{
++ rtl::OUString aRet = rtl::OUString::createFromAscii("");
++ sal_uInt16 nHideBit = (1 << nPos);
++ sal_Bool bDivisionName = sal_False;
++ sal_Bool bSectionName = sal_False;
++
++ LwpFrib* pParaFrib = m_pBulletPara->GetFribs()->GetFribs();
++ if (!pParaFrib)
++ {
++ return rtl::OUString::createFromAscii("");
++ }
++
++ while (pParaFrib)
++ {
++ if (pParaFrib->GetType() == FRIB_TAG_DOCVAR)
++ {
++ ModifierInfo* pMoInfo = pParaFrib->GetModifiers();
++ if (!pMoInfo)
++ {
++ return rtl::OUString::createFromAscii("");
++ }
++ sal_uInt16 nHideLevels = pMoInfo->aTxtAttrOverride.GetHideLevels();
++ sal_uInt16 nType = static_cast<LwpFribDocVar*>(pParaFrib)->GetType();
++
++ if (~nHideLevels & nHideBit)
++ {
++ if (nType == 0x000D)
++ {
++ bDivisionName = sal_True;
++ }
++ else if (nType == 0x000E)
++ {
++ bSectionName= sal_True;
++ }
++ }
++ }
++ pParaFrib = pParaFrib->GetNext();
++ }
++
++ if (bDivisionName)
++ {
++ aRet += this->GetDivisionName();
++ }
++ if (bSectionName)
++ {
++ aRet += this->GetSectionName();
++ }
++
++ return aRet;
++}
++
++rtl::OUString LwpSilverBullet::GetDivisionName()
++{
++ if (!m_pFoundry)
++ {
++ return rtl::OUString::createFromAscii("");
++ }
++
++ rtl::OUString aRet = rtl::OUString::createFromAscii("");
++
++ LwpDocument* pDoc = m_pFoundry->GetDocument();
++ if (pDoc)
++ {
++ LwpObjectID* pID = pDoc->GetDivInfoID();
++ if (!pID->IsNull())
++ {
++ aRet = static_cast<LwpDivInfo*>(pID->obj(VO_DIVISIONINFO))->GetDivName();
++ }
++ }
++
++ return aRet;
++}
++
++rtl::OUString LwpSilverBullet::GetSectionName()
++{
++ LwpStory* pStory = static_cast<LwpStory*>(m_aStory.obj(VO_STORY));
++ if (!pStory)
++ {
++ return rtl::OUString::createFromAscii("");
++ }
++
++ return pStory->GetSectionName();
++}
++
++sal_Bool LwpSilverBullet::HasName()
++{
++ LwpAtomHolder* pName = this->GetName();
++ if (pName)
++ {
++ return (sal_Bool)(pName->str().getLength() != 0);
++ }
++ else
++ {
++ return sal_False;
++ }
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpsilverbullet.hxx lotuswordpro/source/filter/lwpsilverbullet.hxx
+--- lotuswordpro.bak/source/filter/lwpsilverbullet.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpsilverbullet.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,189 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPSILVERBULLET_HXX
++#define _LWPSILVERBULLET_HXX
++
++#include "lwpheader.hxx"
++#include "lwpobj.hxx"
++#include "lwpdlvlist.hxx"
++#include "lwpobjid.hxx"
++#include "lwpatomholder.hxx"
++//Added by yanjun for SS merge: 2007-12-21
++#include "unicode/utypes.h"
++//End
++const sal_uInt16 MAXNUMBERPOSITIONS = 10; //max number of positions
++const sal_uInt16 NUMCHAR_none = 0x00; //none of numberchar
++const sal_uInt16 NUMCHAR_1 = 0x01; //index for numberchar "1"
++const sal_uInt16 NUMCHAR_A = 0x02; //index for numberchar "A"
++const sal_uInt16 NUMCHAR_a = 0x03; //index for numberchar "a"
++const sal_uInt16 NUMCHAR_I = 0x04; //index for numberchar "I"
++const sal_uInt16 NUMCHAR_i = 0x05; //index for numberchar "i"
++const sal_uInt16 NUMCHAR_other= 0x06; //index for numberchar "other"
++const sal_uInt16 NUMCHAR_01 = 0x0B; //index for numberchar "01"
++
++const sal_uInt16 NUMCHAR_Chinese1 = 0x09; //index for numberchar "Ò"
++const sal_uInt16 NUMCHAR_Chinese2 = 0x08; //index for numberchar "Ò"
++const sal_uInt16 NUMCHAR_Chinese3= 0x0A; //index for numberchar "¼×
++const sal_uInt16 NUMCHAR_Chinese4 = 0x13; //index for numberchar "01" in chinese version
++//add end
++
++class LwpStory;
++class LwpAtomHolder;
++class LwpPara;
++class LwpFribParaNumber;
++
++class LwpSilverBullet : public LwpDLNFVList
++{
++public:
++ LwpSilverBullet(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++
++ virtual ~LwpSilverBullet();
++
++ virtual void RegisterStyle();
++
++ void Read();
++
++ sal_Bool IsBulletOrdered();
++
++ rtl::OUString GetBulletFontName();
++
++ inline rtl::OUString GetBulletStyleName() const;
++
++ UChar32 GetBulletChar();
++
++ rtl::OUString GetPrefix();
++
++ rtl::OUString GetSuffix();
++
++ inline rtl::OUString GetNumberingName();
++
++ inline LwpPara* GetNumberingPara();
++
++ sal_Bool HasName();
++
++ static rtl::OUString GetNumCharByStyleID(LwpFribParaNumber* pParaNumber);
++
++ inline sal_Bool IsPosCumulative(sal_uInt16 nHideLevels);
++ inline sal_Bool IsLesserLevel(sal_uInt16 nPos);
++ inline sal_Bool IsNewSection(sal_uInt16 nPos);
++
++ LwpPara* GetBulletPara();
++
++ sal_uInt16 GetDisplayLevel(sal_uInt8 nPos);
++
++ rtl::OUString GetAdditionalName(sal_uInt8 nPos);
++
++ rtl::OUString GetDivisionName();
++
++ rtl::OUString GetSectionName();
++
++private:
++ sal_uInt16 m_nFlags;
++ LwpObjectID m_aStory;
++ sal_uInt8 m_pResetPositionFlags[MAXNUMBERPOSITIONS];
++ sal_uInt32 m_nUseCount;
++ LwpAtomHolder* m_pAtomHolder;
++
++ LwpPara* m_pBulletPara;
++ rtl::OUString m_strStyleName;
++ sal_uInt16 m_pHideLevels[10];
++
++private:
++ enum // For m_pResetPositionFlags
++ {
++ LESSERLEVEL = 0x01,
++ LESSERSPECIFIC = 0x02,
++ NEWDIVISION = 0x04,
++ NEWSECTION = 0x08,
++ CUMULATIVE = 0x10
++ };
++};
++inline rtl::OUString LwpSilverBullet::GetBulletStyleName() const
++{
++ return m_strStyleName;
++}
++
++inline rtl::OUString LwpSilverBullet::GetNumberingName()
++{
++ return GetName()->str();
++}
++inline LwpPara* LwpSilverBullet::GetNumberingPara()
++{
++ return m_pBulletPara;
++}
++inline sal_Bool LwpSilverBullet::IsPosCumulative(sal_uInt16 nHideLevels)
++{
++ sal_uInt16 AttrMask = ~nHideLevels;
++ return (sal_Bool)((AttrMask & (AttrMask - 1)) != 0);
++}
++inline sal_Bool LwpSilverBullet::IsLesserLevel(sal_uInt16 nPos)
++{
++ return (sal_Bool)((m_pResetPositionFlags[nPos] & LESSERLEVEL) != 0);
++}
++inline sal_Bool LwpSilverBullet::IsNewSection(sal_uInt16 nPos)
++{
++ return (sal_Bool)((m_pResetPositionFlags[nPos] & NEWSECTION) != 0);
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpslvlist.hxx lotuswordpro/source/filter/lwpslvlist.hxx
+--- lotuswordpro.bak/source/filter/lwpslvlist.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpslvlist.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,89 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * single list.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-12 create and implement.
++ ************************************************************************/
++
++#ifndef _LWPSLVLIST_HXX
++#define _LWPSLVLIST_HXX
++
++#include "lwpobjstrm.hxx"
++#include "lwpfilehdr.hxx"
++#include "lwpobjid.hxx"
++
++class LwpSLVList
++{
++public:
++ LwpSLVList(){}
++ LwpSLVList(LwpObjectStream* pStrm){Read(pStrm);};
++public:
++ void Read(LwpObjectStream* pStrm)
++ {
++ m_NextID.ReadIndexed(pStrm);
++ if( LwpFileHeader::m_nFileRevision < 0x0006 )
++ pStrm->SkipExtra();
++ }
++ LwpObjectID* GetNext(){return &m_NextID;}
++public:
++private:
++ LwpObjectID m_NextID;
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/lwpsortopt.cxx lotuswordpro/source/filter/lwpsortopt.cxx
+--- lotuswordpro.bak/source/filter/lwpsortopt.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpsortopt.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,106 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpsortopt.hxx"
++
++void LwpSortKey::Read(LwpObjectStream *pStrm)
++{
++ pStrm->QuickRead(&m_nField, sizeof(m_nField));
++ pStrm->QuickRead(&m_nFlag, sizeof(m_nFlag));
++ pStrm->QuickRead(&m_nWord, sizeof(m_nWord));
++ pStrm->SkipExtra();
++}
++LwpSortOption::LwpSortOption(LwpObjectStream* pStrm)
++{
++ Read(pStrm);
++}
++/**
++ * @descr Read sort option in VO_DOCUMNET from object stream
++ **/
++void LwpSortOption::Read(LwpObjectStream *pStrm)
++{
++ pStrm->QuickRead(&m_nCount, sizeof(m_nCount));
++ pStrm->QuickRead(&m_nFlags, sizeof(m_nFlags));
++ pStrm->QuickRead(&m_nText, sizeof(m_nText));
++ for(sal_uInt8 i=0; i<3; i++)
++ {
++ m_Keys[i].Read(pStrm);
++ }
++ pStrm->SkipExtra();
++}
++/**
++ * @descr skip the sort option
++ **/
++void LwpSortOption::Skip(LwpObjectStream *pStrm)
++{
++ pStrm->SeekRel(DiskSize());
++}
++/**
++ * @descr return the disk size
++ **/
++sal_uInt16 LwpSortOption::DiskSize()
++{
++ sal_uInt16 keysize = 4 * sizeof(sal_uInt16);
++ return (3* keysize + (2 * sizeof(sal_uInt16)) + sizeof(sal_uInt8) + sizeof(sal_uInt16));
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpsortopt.hxx lotuswordpro/source/filter/lwpsortopt.hxx
+--- lotuswordpro.bak/source/filter/lwpsortopt.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpsortopt.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,102 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPSORTOPTION_HXX
++#define _LWPSORTOPTION_HXX
++
++#include "lwpheader.hxx"
++#include "lwpobjstrm.hxx"
++
++/**
++ * @brief sort key class for LwpSortOption
++*/
++class LwpSortKey
++{
++private:
++ sal_uInt16 m_nField;
++ sal_uInt16 m_nFlag;
++ sal_uInt16 m_nWord;
++public:
++ void Read(LwpObjectStream *pStrm);
++};
++/**
++ * @brief sort options in VO_DOCUMENT
++ * only for read, not parsed now
++*/
++class LwpSortOption
++{
++public:
++ LwpSortOption(){};
++ LwpSortOption(LwpObjectStream* pStrm);
++ ~LwpSortOption(){};
++public:
++ void Read(LwpObjectStream *pStrm);
++ void Skip(LwpObjectStream *pStrm);
++ sal_uInt16 DiskSize();
++private:
++ LwpSortKey m_Keys[3];
++ sal_uInt16 m_nCount;
++ sal_uInt16 m_nFlags;
++ sal_uInt8 m_nText;
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpstory.cxx lotuswordpro/source/filter/lwpstory.cxx
+--- lotuswordpro.bak/source/filter/lwpstory.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpstory.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,550 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * LwpStory:
++ 1. Word Pro object for paragraph list;
++ 2. the content of layout object
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++#include "lwpglobalmgr.hxx"
++#include "lwpstory.hxx"
++#include "xfilter/xfstylemanager.hxx"
++
++LwpStory::LwpStory(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpContent(objHdr, pStrm),m_bPMModified(sal_False),m_pCurrentLayout(NULL),
++ m_pTabLayout(NULL),m_bDropcap(sal_False), m_pHyperlinkMgr(new LwpHyperlinkMgr)
++{}
++
++LwpStory::~LwpStory()
++{
++ if (m_pHyperlinkMgr)
++ delete m_pHyperlinkMgr;
++}
++void LwpStory::Read()
++{
++ LwpContent::Read();
++ m_ParaList.Read(m_pObjStrm);
++ m_FirstParaStyle.ReadIndexed(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++
++#include "lwppara.hxx"
++#include "lwpobjfactory.hxx"
++/**************************************************************************
++ * @descr: Convert all the contents in current story
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++void LwpStory::XFConvert(XFContentContainer* pCont)
++{
++ //process frame which anchor frame
++ XFConvertFrameInFrame(pCont);
++ //process para list
++ XFContentContainer* pParaCont = pCont;
++ LwpPara* pPara = static_cast<LwpPara*> ( GetFirstPara()->obj() );
++ while(pPara)
++ {
++ pPara->SetFoundry(m_pFoundry);
++ pPara->XFConvert(pParaCont);
++
++ //Get the xfcontainer for the next para
++ pParaCont = pPara->GetXFContainer();
++ pPara = static_cast<LwpPara*> ( pPara->GetNext()->obj() );
++ }
++
++ //process frame which anchor is to cell after converter all the para
++ XFConvertFrameInCell(pCont);
++ XFConvertFrameInHeaderFooter(pCont);
++
++ //Release Lwp Objects
++ LwpPara* pCur = static_cast<LwpPara*> (GetFirstPara()->obj());
++ LwpPara* pNext;
++ while(pCur)
++ {
++ pCur->Release();
++ pNext = static_cast<LwpPara*> ( pCur->GetNext()->obj() );
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ LwpObjectFactory* pObjMgr = pGlobal->GetLwpObjFactory();
++ pObjMgr->ReleaseObject(*pCur->GetObjectID());
++ pCur = pNext;
++ }
++}
++
++void LwpStory::RegisterStyle()
++{
++ LwpPara* pPara = static_cast<LwpPara*>( GetFirstPara()->obj() );
++ while(pPara)
++ {
++ pPara->SetFoundry(m_pFoundry);
++ pPara->RegisterStyle();
++ pPara = static_cast<LwpPara*>(pPara->GetNext()->obj());
++ }
++}
++
++void LwpStory::Parse(IXFStream* pOutputStream)
++{
++ m_pXFContainer = new XFContentContainer;
++ XFConvert(m_pXFContainer);
++ m_pXFContainer->ToXml(pOutputStream);
++ delete m_pXFContainer;
++ m_pXFContainer = NULL;
++
++ //It seems that, currently, we do not need to process the child story
++ /*LwpObject* pChildStory = GetFirstStory()->obj();
++ if(pChildStory)
++ {
++ pChildStory->SetFoundry(m_pFoundry);
++ pChildStory->Parse(pOutputStream);
++ }*/
++
++ //Don't process the next story
++/* LwpObject* pNextStory = GetNextStory()->obj();
++ if(pNextStory)
++ {
++ pNextStory->SetFoundry(m_pFoundry);
++ pNextStory->Parse(pOutputStream);
++ }*/
++
++}
++
++#include "lwppagelayout.hxx"
++/**************************************************************************
++ * @descr: Set current page layout. If pPageLayout is a mirro page layout,
++ use odd child page layout as current page layout.
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++void LwpStory::SetCurrentLayout(LwpPageLayout *pPageLayout)
++{
++ LwpPageLayout* pLayout = pPageLayout->GetOddChildLayout();
++ if(pLayout)
++ {
++ m_pCurrentLayout = pLayout;
++ m_pTabLayout = pLayout;
++ }
++ else
++ {
++ m_pCurrentLayout = pPageLayout;
++ m_pTabLayout = pPageLayout;
++ }
++ m_bPMModified = sal_True;
++}
++
++void LwpStory::AddPageLayout(LwpPageLayout * pObject)
++{
++ m_LayoutList.push_back(pObject);
++}
++/**************************************************************************
++ * @descr: Get the next page layout relative to m_pCurrentLayout
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++LwpPageLayout* LwpStory::GetNextPageLayout()
++{
++ std::vector<LwpPageLayout*>::iterator it;
++ for( it = m_LayoutList.begin(); it != m_LayoutList.end(); it++ )
++ {
++ if(m_pCurrentLayout == *it)
++ {
++ if((it+1) !=m_LayoutList.end())
++ {
++ return *(it+1);
++ }
++ }
++ }
++ return NULL;
++}
++/**************************************************************************
++ * @descr: Sort the pagelayout according to their position
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++void LwpStory::SortPageLayout()
++{
++ //Get all the pagelayout and store in list
++ std::vector<LwpPageLayout*> aLayoutList;
++ LwpVirtualLayout* pLayout = GetLayout(NULL);
++ while(pLayout)
++ {
++ if(pLayout->IsPage())
++ {
++ LwpLayout::UseWhenType eSectionType = static_cast<LwpPageLayout*>(pLayout)->GetUseWhenType();
++ //for mirror page, the child is pagelayout
++ LwpVirtualLayout* pParent = pLayout->GetParentLayout();
++ if(eSectionType != LwpLayout::StartWithinColume && !pParent->IsPage())
++ {
++ aLayoutList.push_back(static_cast<LwpPageLayout*>(pLayout));
++ }
++ }
++ pLayout = GetLayout(pLayout);
++ }
++ // sort the pagelayout according to their position
++ LwpPageLayout* pTemp = NULL;
++ std::vector<LwpPageLayout*>::iterator aIt;
++ std::vector<LwpPageLayout*>::iterator bIt;
++ for( aIt = aLayoutList.begin(); aIt != aLayoutList.end() -1; aIt++)
++ {
++ for( bIt = aIt +1; bIt != aLayoutList.end(); bIt ++)
++ {
++ if(**aIt < **bIt)
++ {
++ continue;
++ }
++ else
++ {
++ pTemp = *aIt;
++ *aIt = *bIt;
++ *bIt = pTemp;
++ }
++ }
++ }
++
++ //put all the sorted layouts into list
++ m_LayoutList.clear();
++
++ for( aIt = aLayoutList.begin(); aIt != aLayoutList.end(); aIt++)
++ {
++ m_LayoutList.push_back(*aIt);
++ }
++}
++
++/**************************************************************************
++ * @descr: whether need create a new section and reset column in current page layout
++ * @param:
++ * @param:
++ * @return: sal_True if need create a new section
++**************************************************************************/
++sal_Bool LwpStory::IsNeedSection()
++{
++ sal_Bool bColumns = sal_False;
++ sal_Bool bNewSection = sal_False;
++ if(m_pCurrentLayout)
++ {
++ if(m_pCurrentLayout->HasColumns())
++ {
++ //get the following pagelayout and its type
++ bColumns = sal_True;
++ LwpPageLayout* pNextLayout = GetNextPageLayout();
++ if(pNextLayout)
++ {
++ //get layout type
++ LwpLayout::UseWhenType eWhenType = pNextLayout->GetUseWhenType();
++ switch(eWhenType)
++ {
++ case LwpLayout::StartWithinColume://not support now
++ case LwpLayout::StartWithinPage:
++ {
++ bColumns =sal_False;
++ bNewSection = sal_True;
++ break;
++ }
++ case LwpLayout::StartOnNextPage:
++ case LwpLayout::StartOnOddPage://not support now
++ case LwpLayout::StartOnEvenPage://not support now
++ {
++ bColumns =sal_True;
++ bNewSection = sal_False;
++ break;
++ }
++ default:
++ break;
++ }
++ }
++
++ //if bColumns is ture, the page layout doesn't need columns, set the xfcolumns to NULL in page master
++ if(!bColumns)
++ {
++ m_pCurrentLayout->ResetXFColumns();
++ }
++ }
++ SetPMModified(sal_False);
++ }
++ return bNewSection;
++}
++/**************************************************************************
++ * @descr: process frame which anchor type is to page, frame or cell
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++void LwpStory::XFConvertFrame(XFContentContainer* pCont)
++{
++ LwpVirtualLayout* pLayout = GetLayout(NULL);
++ while(pLayout)
++ {
++ LwpVirtualLayout* pFrameLayout = static_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj());
++ while(pFrameLayout)
++ {
++ if((pFrameLayout->IsAnchorPage()&&(pFrameLayout->IsFrame()||pFrameLayout->IsSuperTable()||pFrameLayout->IsGroupHead()))
++ ||(pFrameLayout->IsAnchorFrame()))
++ {
++ pFrameLayout->XFConvert(pCont);
++ }
++ pFrameLayout = static_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj());
++ }
++ pLayout = GetLayout(pLayout);
++ }
++}
++/**************************************************************************
++ * @descr: process frame which anchor type is to cell
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++void LwpStory::XFConvertFrameInCell(XFContentContainer* pCont)
++{
++ LwpVirtualLayout* pLayout = GetLayout(NULL);
++ while(pLayout)
++ {
++ LwpVirtualLayout* pFrameLayout = static_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj());
++ while(pFrameLayout)
++ {
++
++ //if(pFrameLayout->IsAnchorCell())
++ if(pFrameLayout->IsAnchorCell() && pFrameLayout->HasContent())
++ {
++ //get the first xfpara
++ XFContentContainer* pXFFirtPara = static_cast<XFContentContainer*>(pCont->FindFirstContent(enumXFContentPara));
++ if(pXFFirtPara)
++ pFrameLayout->XFConvert(pXFFirtPara);
++ }
++ pFrameLayout = static_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj());
++ }
++ pLayout = GetLayout(pLayout);
++ }
++}
++
++/**************************************************************************
++ * @descr: process frame which anchor type is to page
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++void LwpStory::XFConvertFrameInPage(XFContentContainer* pCont)
++{
++ LwpVirtualLayout* pLayout = GetLayout(NULL);
++ while(pLayout)
++ {
++ LwpVirtualLayout* pFrameLayout = static_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj());
++ while(pFrameLayout)
++ {
++ if((pFrameLayout->IsAnchorPage()
++ &&(pFrameLayout->IsFrame()
++ ||pFrameLayout->IsSuperTable()
++ ||pFrameLayout->IsGroupHead())))
++ {
++ pFrameLayout->XFConvert(pCont);
++ }
++ pFrameLayout = static_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj());
++ }
++ pLayout = GetLayout(pLayout);
++ }
++}
++/**************************************************************************
++ * @descr: process frame which anchor type is to frame
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++void LwpStory::XFConvertFrameInFrame(XFContentContainer* pCont)
++{
++ LwpVirtualLayout* pLayout = GetLayout(NULL);
++ while(pLayout)
++ {
++ LwpVirtualLayout* pFrameLayout = static_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj());
++ while(pFrameLayout)
++ {
++ if(pFrameLayout->IsAnchorFrame())
++ {
++ pFrameLayout->XFConvert(pCont);
++ }
++ pFrameLayout = static_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj());
++ }
++ pLayout = GetLayout(pLayout);
++ }
++}
++/**************************************************************************
++ * @descr: process frame which anchor type is to page and the frame is contained by header or footer
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++void LwpStory::XFConvertFrameInHeaderFooter(XFContentContainer* pCont)
++{
++ LwpVirtualLayout* pLayout = GetLayout(NULL);
++ while(pLayout)
++ {
++ LwpVirtualLayout* pFrameLayout = static_cast<LwpVirtualLayout*>(pLayout->GetChildHead()->obj());
++ while(pFrameLayout)
++ {
++ if(pFrameLayout->IsAnchorPage() && (pLayout->IsHeader() || pLayout->IsFooter()))
++ {
++ //The frame must be included by <text:p>
++ XFContentContainer* pXFFirtPara = static_cast<XFContentContainer*>(pCont->FindFirstContent(enumXFContentPara));
++ if(pXFFirtPara)
++ pFrameLayout->XFConvert(pXFFirtPara);
++ }
++ pFrameLayout = static_cast<LwpVirtualLayout*>(pFrameLayout->GetNext()->obj());
++ }
++ pLayout = GetLayout(pLayout);
++ }
++}
++
++void LwpStory::AddXFContent(XFContent* pContent)
++{
++ if(m_pXFContainer)
++ m_pXFContainer->Add(pContent);
++}
++
++XFContentContainer* LwpStory::GetXFContent()
++{
++ if(m_pXFContainer)
++ return m_pXFContainer;
++ else
++ return NULL;
++}
++
++LwpPara* LwpStory::GetLastParaOfPreviousStory()
++{
++ LwpVirtualLayout* pVLayout = this->GetLayout(NULL);
++ if (pVLayout)
++ {
++ return pVLayout->GetLastParaOfPreviousStory();
++ }
++
++ return NULL;
++}
++/**************************************************************************
++ * @descr: get text from story
++ * @param:
++ * @param:
++ * @return:
++**************************************************************************/
++OUString LwpStory::GetContentText(sal_Bool bAllText)
++{
++ if (bAllText)//convert all text fribs
++ {
++ OUString sText = A2OUSTR("");
++ //process para list
++ LwpPara* pPara = static_cast<LwpPara*>(GetFirstPara()->obj());
++ while (pPara)
++ {
++ pPara->SetFoundry(m_pFoundry);
++ sText += pPara->GetContentText(sal_True);
++ pPara = static_cast<LwpPara*>(pPara->GetNext()->obj());
++ }
++ return sText;
++ }
++ else //only the first text frib
++ {
++ LwpObject* pObj = GetFirstPara()->obj();
++ if(pObj)
++ {
++ LwpPara* pPara = static_cast<LwpPara*>(pObj);
++ if (pPara->GetNext()->obj() != NULL)
++ return A2OUSTR("");
++ pPara->SetFoundry(m_pFoundry);
++ return pPara->GetContentText();
++ }
++ return A2OUSTR("");
++ }
++
++}
++OUString LwpStory::RegisterFirstFribStyle()
++{
++ LwpPara* pPara = static_cast<LwpPara*>(GetFirstPara()->obj());
++ pPara->SetFoundry(m_pFoundry);
++ LwpFribPtr* pFribs = pPara->GetFribs();
++ if (pFribs)
++ {
++ LwpFrib* pFirstFrib = pFribs->GetFribs();
++ pFirstFrib->RegisterStyle(m_pFoundry);
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ XFTextStyle* pBaseStyle = pXFStyleManager->FindTextStyle(pFirstFrib->GetStyleName());
++ if (pBaseStyle == NULL)
++ return A2OUSTR("");
++ XFTextStyle* pStyle = new XFTextStyle;
++ *pStyle = *pBaseStyle;
++ OUString sName = A2OUSTR("Ruby") + pFirstFrib->GetStyleName();
++ pStyle->SetStyleName(sName);
++ pXFStyleManager->AddStyle(pStyle);
++ return sName;
++ }
++ return A2OUSTR("");
++}
++
++sal_Bool LwpStory::IsBullStyleUsedBefore(const rtl::OUString& rStyleName, const sal_uInt8& nPos)
++{
++ std::vector <NamePosPair>::reverse_iterator rIter;
++ for (rIter = m_vBulletStyleNameList.rbegin(); rIter != m_vBulletStyleNameList.rend(); rIter++)
++ {
++ rtl::OUString aName = (*rIter).first;
++ sal_uInt8 nPosition = (*rIter).second;
++ if ((*rIter).first == rStyleName && (*rIter).second == nPos)
++ {
++ return sal_True;
++ }
++ }
++ return sal_False;
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpstory.hxx lotuswordpro/source/filter/lwpstory.hxx
+--- lotuswordpro.bak/source/filter/lwpstory.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpstory.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,202 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * LwpStory:
++ 1. Word Pro object for paragraph list;
++ 2. the content of layout object
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPSTORY_HXX
++#define _LWPSTORY_HXX
++#include "lwpcontent.hxx"
++
++class LwpPageLayout;
++class LwpStory: public LwpContent
++{
++public:
++ LwpStory(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpStory();
++private:
++ //File format members:
++ LwpDLVListHeadTail m_ParaList;
++ LwpObjectID m_FirstParaStyle;
++
++ // for bullet , 05/23/2005
++ typedef std::pair<rtl::OUString, sal_uInt8> NamePosPair;
++ std::vector <NamePosPair> m_vBulletStyleNameList;
++
++ // , 02/16/2005
++ sal_Bool m_bPMModified;
++ LwpPageLayout* m_pCurrentLayout; //for register page layout style
++ std::vector<LwpPageLayout*> m_LayoutList;
++ LwpLayout* m_pTabLayout; //for register tab style
++
++ sal_Bool m_bDropcap;
++ LwpHyperlinkMgr* m_pHyperlinkMgr;
++ OUString m_CurrSectionName;
++
++ XFContentContainer* m_pXFContainer;
++
++protected:
++ void Read();
++ void XFConvertFrame(XFContentContainer* pCont);
++ void XFConvertFrameInCell(XFContentContainer* pCont);
++ void XFConvertFrameInFrame(XFContentContainer* pCont);
++ void XFConvertFrameInHeaderFooter(XFContentContainer* pCont);
++
++public:
++ void RegisterStyle();
++ void Parse(IXFStream* pOutputStream);
++ virtual void XFConvert(XFContentContainer* pCont);
++ void XFConvertFrameInPage(XFContentContainer* pCont);
++ inline LwpDLVListHeadTail* GetParaList();
++ inline LwpObjectID* GetFirstPara();
++ inline LwpObjectID* GetLastPara();
++ XFContentContainer* GetXFContent();
++ void AddXFContent(XFContent* pContent);
++
++ inline sal_Bool GetDropcapFlag();
++ inline LwpPageLayout* GetCurrentLayout();
++ inline LwpMiddleLayout* GetTabLayout();//for register tab style
++ inline OUString GetSectionName();
++ inline LwpHyperlinkMgr* GetHyperlinkMgr();
++
++ inline sal_Bool IsPMModified();
++ inline void SetPMModified(sal_Bool bPMModified);
++ inline void SetDropcapFlag(sal_Bool bFlag);
++ inline void SetTabLayout(LwpLayout* pLayout);
++ inline void SetSectionName(OUString StyleName);
++
++ void SetCurrentLayout(LwpPageLayout* pPageLayout);
++ void AddPageLayout(LwpPageLayout* pObject);
++ LwpPageLayout* GetNextPageLayout();
++ sal_Bool IsNeedSection();
++ void SortPageLayout();
++
++ LwpPara* GetLastParaOfPreviousStory();
++
++ OUString GetContentText(sal_Bool bAllText = sal_False);//add by ,for CHB,05/5/25
++ inline void AddBullStyleName2List(const rtl::OUString& rStyleName, const sal_uInt8& nPos);
++ sal_Bool IsBullStyleUsedBefore(const rtl::OUString& rStyleName, const sal_uInt8& nPos);
++
++ OUString RegisterFirstFribStyle();
++};
++
++LwpDLVListHeadTail* LwpStory::GetParaList()
++{
++ return &m_ParaList;
++}
++LwpObjectID* LwpStory::GetFirstPara()
++{
++ return m_ParaList.GetHead();
++}
++LwpObjectID* LwpStory::GetLastPara()
++{
++ return m_ParaList.GetTail();
++}
++sal_Bool LwpStory::GetDropcapFlag()
++{
++ return m_bDropcap;
++}
++LwpMiddleLayout* LwpStory::GetTabLayout()
++{
++ if(m_pTabLayout)
++ return m_pTabLayout;
++ return static_cast<LwpMiddleLayout*>(GetLayout(NULL));
++}
++void LwpStory::SetPMModified(sal_Bool bPMModified)
++{
++ m_bPMModified = bPMModified;
++}
++void LwpStory::SetDropcapFlag(sal_Bool bFlag)
++{
++ m_bDropcap = bFlag;
++}
++void LwpStory::SetTabLayout(LwpLayout* pLayout)
++{
++ m_pTabLayout = pLayout;
++}
++void LwpStory::SetSectionName(OUString StyleName)
++{
++ m_CurrSectionName = StyleName;
++}
++OUString LwpStory::GetSectionName()
++{
++ return m_CurrSectionName;
++}
++sal_Bool LwpStory::IsPMModified()
++{
++ return m_bPMModified;
++}
++LwpPageLayout* LwpStory::GetCurrentLayout()
++{
++ return m_pCurrentLayout;
++}
++LwpHyperlinkMgr* LwpStory::GetHyperlinkMgr()
++{
++ return m_pHyperlinkMgr;
++}
++inline void LwpStory::AddBullStyleName2List(const rtl::OUString& rStyleName, const sal_uInt8& nPos)
++{
++ m_vBulletStyleNameList.push_back(std::make_pair(rStyleName, nPos));
++}
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwpstyledef.hxx lotuswordpro/source/filter/lwpstyledef.hxx
+--- lotuswordpro.bak/source/filter/lwpstyledef.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpstyledef.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,257 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++
++#ifndef _LWPSTYLEDEF_H_
++#define _LWPSTYLEDEF_H_
++
++#define INVALID_ATTR_ID 0
++#define EXTERNAL_ID 0x8000
++#define EXTERNAL_MASK 0x7FFF
++#define MAX_DESIGNERBORDERS 18
++
++#define BORDER_SOLID 1
++#define BORDER_SDASH 2
++#define BORDER_LDASH 3
++#define BORDER_WAVY 4
++#define BORDER_THKWAVY 5
++#define BORDER_LSDASH 6
++#define BORDER_LSSDASH 7
++#define BORDER_DOT 8
++#define BORDER_CIRCLE 9
++#define BORDER_DBLWAVY 10
++#define BORDER_DBLTHKWAVY 11
++#define BORDER_STAR 12
++#define BORDER_ROPE 13
++#define BORDER_DECO1 14
++#define BORDER_DECO2 15
++#define BORDER_RAIN 16
++#define BORDER_PIN 17
++#define BORDER_ROSE 18
++#define BORDER_SUNF 19
++#define BORDER_DECO3 20
++#define BORDER_WARNING 21
++// SPACE 22
++#define BORDER_GIRDER 23
++
++// User defined bitmap borders (200 - 400)
++//========================================
++
++// scalable lines
++#define BGRP_SOLID 20
++#define BGRP_DOUBLE_ONE 21
++#define BGRP_DOUBLE_TWO 22
++#define BGRP_121 23
++#define BGRP_31 24
++#define BGRP_13 25
++#define BGRP_WAVY 26
++#define BGRP_DBLWAVY 27
++#define BGRP_THICK_WAVY 28
++#define BGRP_THICK_DBLWAVY 29
++#define BGRP_SDASH 30
++#define BGRP_LDASH 31
++#define BGRP_LDASH_SDASH 32
++#define BGRP_LDASH_SDASH_SDASH 33
++#define BGRP_BUTTONUP 34
++#define BGRP_BUTTONDOWN 35
++#define BGRP_13SPACE 36
++#define BGRP_31SPACE 37
++#define BGRP_DIAGONAL 38
++#define BGRP_TARO 39
++#define BGRP_DOT 40
++#define BGRP_CIRCLE 41
++#define BGRP_STAR 42
++#define BGRP_ROPE 43
++#define BGRP_DECO1 44
++#define BGRP_DECO2 45
++#define BGRP_RAIN 46
++#define BGRP_PIN 47
++#define BGRP_ROSE 48
++#define BGRP_SUNF 49
++#define BGRP_DECO3 50
++#define BGRP_WARNING 51
++//SPACE 52
++#define BGRP_GIRDER 53
++
++#define UNIT_4_96 ((UNIT)196608L) //INCHES(4/96)
++#define UNIT_13_96 ((UNIT)638976L) //INCHES(13/96)
++#define UNIT_14_96 ((UNIT)688128L) //INCHES(14/96)
++#define UNIT_15_96 ((UNIT)737280L) //INCHES(15/96)
++#define UNIT_17_96 ((UNIT)835584L) //INCHES(17/96)
++#define UNIT_18_96 ((UNIT)884736L) //INCHES(18/96)
++#define UNIT_19_96 ((UNIT)933888L) //INCHES(19/96)
++#define UNIT_20_96 ((UNIT)983040L) //INCHES(20/96)
++#define UNIT_21_96 ((UNIT)1032192L) //INCHES(21/96)
++#define UNIT_22_96 ((UNIT)1081344L) //INCHES(22/96)
++#define UNIT_25_96 ((UNIT)1228800L) //INCHES(25/96)
++#define UNIT_28_96 ((UNIT)1376256L) //INCHES(28/96)
++#define UNIT_34_96 ((UNIT)1671108L) //INCHES(34/96)
++#define UNIT_42_96 ((UNIT)2064384L) //INCHES(42/96)
++#define UNIT_44_96 ((UNIT)2162688L) //INCHES(44/96)
++#define UNIT_48_96 ((UNIT)2359296L) //INCHES(48/96)
++#define UNIT_56_96 ((UNIT)2752512L) //INCHES(56/96)
++#define UNIT_64_96 ((UNIT)3145728L) //INCHES(64/96)
++
++#define ROPE_AMPLITUDE UNIT_18_96
++#define ROPE_PERIOD UNIT_20_96
++#define DECO1_AMPLITUDE UNIT_17_96
++#define DECO1_PERIOD UNIT_4_96
++#define DECO2_AMPLITUDE UNIT_18_96
++#define DECO2_PERIOD UNIT_64_96
++#define RAIN_AMPLITUDE UNIT_22_96
++#define RAIN_PERIOD UNIT_28_96
++#define PIN_AMPLITUDE UNIT_15_96
++#define PIN_PERIOD UNIT_4_96
++#define ROSE_AMPLITUDE UNIT_34_96
++#define ROSE_PERIOD UNIT_64_96
++#define SUNF_AMPLITUDE UNIT_25_96
++#define SUNF_PERIOD UNIT_48_96
++#define DECO3_AMPLITUDE UNIT_14_96
++#define DECO3_PERIOD UNIT_20_96
++
++#define ROPE_JOIN_W UNIT_18_96
++#define ROPE_JOIN_H UNIT_18_96
++#define DECO1_JOIN_W UNIT_56_96
++#define DECO1_JOIN_H UNIT_44_96
++#define DECO2_JOIN_W UNIT_64_96
++#define DECO2_JOIN_H UNIT_64_96
++#define RAIN_JOIN_W UNIT_48_96
++#define RAIN_JOIN_H UNIT_48_96
++#define PIN_JOIN_W UNIT_42_96
++#define PIN_JOIN_H UNIT_42_96
++#define ROSE_JOIN_W UNIT_48_96
++#define ROSE_JOIN_H UNIT_48_96
++#define SUNF_JOIN_W UNIT_48_96
++#define SUNF_JOIN_H UNIT_48_96
++#define DECO3_JOIN_W UNIT_56_96
++#define DECO3_JOIN_H UNIT_56_96
++
++// User defined bitmap border groups 200 - 400
++//============================================
++
++/* background patterns */
++#define BACK_TRANSPARENT 0
++#define BACK_FILL 1
++#define BACK_PATTERN 2
++#define BACK_10PCTDOTS 3
++#define BACK_30PCTDOTS 4
++#define BACK_50PCTDOTS 5
++#define BACK_75PCTDOTS 6
++#define BACK_90PCTDOTS 7
++#define BACK_90PCTINVDOTS 8
++#define BACK_75PCTINVDOTS 9
++#define BACK_50PCTINVDOTS 10
++#define BACK_30PCTINVDOTS 11
++#define BACK_10PCTINVDOTS 12
++#define BACK_MARBLES 13
++#define BACK_STARRYNIGHT 14
++#define BACK_DIAGTHICK 15
++#define BACK_DIAGTHIN 16
++#define BACK_DIAGDOUBLE 17
++#define BACK_DIAGDOUBLENARROW 18
++#define BACK_DIAGTRIPLE 19
++#define BACK_DIAGSINGLEWIDE 20
++#define BACK_DIAGTHICKINV 21
++#define BACK_DIAGTHININV 22
++#define BACK_DIAGDOUBLEINV 23
++#define BACK_DIAGDOUBLENARROWINV 24
++#define BACK_DIAGTRIPLEINV 25
++#define BACK_DIAGSINGLEWIDEINV 26
++#define BACK_CHAINLINKSMALLINV 27
++#define BACK_CHAINLINKSMALL 28
++#define BACK_CHAINLINKMEDIUM 29
++#define BACK_CHAINLINKLARGE 30
++#define BACK_HORZSTRIPE1 31
++#define BACK_HORZSTRIPE2 32
++#define BACK_HORZSTRIPE3 33
++#define BACK_HORZSTRIPE4 34
++#define BACK_VERTSTRIPE1 35
++#define BACK_VERTSTRIPE2 36
++#define BACK_VERTSTRIPE3 37
++#define BACK_VERTSTRIPE4 38
++#define BACK_GRIDSMALL 39
++#define BACK_GRIDMEDIUM 40
++#define BACK_GRIDLARGE 41
++#define BACK_BOXDOT 42
++#define BACK_GOLFGREEN 43
++#define BACK_DITZ 44
++#define BACK_HORZWEAVE 45
++#define BACK_APPLEPIE 46
++#define BACK_BRICK 47
++#define BACK_DIAGBRICK 48
++#define BACK_CHECKER1 49
++#define BACK_CHECKER2 50
++#define BACK_CHECKER3 51
++#define BACK_CHECKER4 52
++#define BACK_CHECKER5 53
++#define BACK_SNOWFLAKE 54
++#define BACK_MARGARITA 55
++#define BACK_SIDEHARP 56
++#define BACK_SCALES 57
++#define BACK_TAYLOR 58
++#define BACK_BUBBLES 59
++#define BACK_ARGYLE 60
++#define BACK_INDIAN1 61
++#define BACK_INDIAN3 62
++#define BACK_PEACHPIE 63
++#define BACK_GRADIENT1 64
++#define BACK_GRADIENT2 65
++#define BACK_GRADIENT3 66
++#define BACK_GRADIENT4 67
++#define BACK_GRADIENT5 68
++#define BACK_GRADIENT6 69
++#define BACK_GRADIENT7 70
++#define BACK_GRADIENT8 71
++
++#endif //STYLEDEF_H_
+diff -urNp lotuswordpro.bak/source/filter/lwpsvstream.cxx lotuswordpro/source/filter/lwpsvstream.cxx
+--- lotuswordpro.bak/source/filter/lwpsvstream.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpsvstream.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,99 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "lwpsvstream.hxx"
++#include <memory>
++
++const sal_uInt32 LwpSvStream::LWP_STREAM_BASE = 0x0010;
++
++LwpSvStream::LwpSvStream(SvStream* pStream, LwpSvStream * pCompressed)
++ : m_pStream(pStream), m_pCompressedStream(pCompressed)
++{
++}
++
++/**
++ * @descr read nBytesToRead bytes to buf
++*/
++sal_Int32 LwpSvStream::Read(void* buf, sal_Int32 nBytesToRead)
++{
++ return m_pStream->Read(buf,nBytesToRead);
++}
++/**
++ * @descr SeekRel in stream
++*/
++sal_Int64 LwpSvStream::SeekRel(sal_Int64 pos)
++{
++ return m_pStream->SeekRel(pos);
++}
++/**
++ * @descr Get the current position in stream
++*/
++sal_Int64 LwpSvStream::Tell()
++{
++ return m_pStream->Tell();
++}
++/**
++ * @descr Seek to pos
++*/
++sal_Int64 LwpSvStream::Seek(sal_Int64 pos)
++{
++ return m_pStream->Seek(pos);
++}
++/**
++ * @descr Return the stream data length
++*/
++//sal_Int64 LwpSvStream::GetLength()
++//{
++// return m_pStream->get
++//}
+diff -urNp lotuswordpro.bak/source/filter/lwpsvstream.hxx lotuswordpro/source/filter/lwpsvstream.hxx
+--- lotuswordpro.bak/source/filter/lwpsvstream.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpsvstream.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,99 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _SVSTREAM_HXX
++#define _SVSTREAM_HXX
++
++#include "lwpheader.hxx"
++#include "lwpunoheader.hxx"
++#include <tools/stream.hxx>
++
++/**
++ * @brief encapsulate XInputStream to provide SvStream like interfaces
++*/
++class LwpSvStream
++{
++public:
++ LwpSvStream(SvStream* pStream, LwpSvStream * pCompressed = NULL);
++ sal_Int32 Read( void* bytes, sal_Int32 nBytesToRead );
++ sal_Int64 SeekRel( sal_Int64 pos );
++ sal_Int64 Tell();
++ sal_Int64 Seek( sal_Int64 pos );
++// sal_Int64 GetLength();
++ static const sal_uInt32 LWP_STREAM_BASE;
++
++ // added by for small file feature
++ LwpSvStream * GetCompressedStream()
++ {
++ return m_pCompressedStream;
++ };
++ SvStream * GetStream()
++ {
++ return m_pStream;
++ }
++ // end of added by
++
++private:
++ // when the file opened is small file, m_pStream is the decompressed stream
++ // when not, m_pStream contains the normal stream
++ SvStream* m_pStream;
++
++ // added by for small file feature
++ // when the file opened is small file, this stream is
++ // for saving the compressed stream which is to be used for Chart/OLE as BENTO container
++ LwpSvStream * m_pCompressedStream;
++ // end of added by
++
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwptable.cxx lotuswordpro/source/filter/lwptable.cxx
+--- lotuswordpro.bak/source/filter/lwptable.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwptable.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,276 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - table object
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++
++ #include "lwptable.hxx"
++
++ LwpSuperTable::LwpSuperTable(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpContent(objHdr, pStrm)
++{}
++
++LwpSuperTable::~LwpSuperTable()
++{}
++
++void LwpSuperTable::Read()
++{
++ LwpContent::Read();
++ m_pObjStrm->SkipExtra();
++
++}
++ void LwpSuperTable::Parse(IXFStream* pOutputStream)
++{
++}
++
++//Added by for XFConvert refactor, 03/31/2005
++void LwpSuperTable::XFConvert(XFContentContainer* pCont)
++{}
++//End of Add
++/*****************************************************************************/
++ LwpTable::LwpTable(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpContent(objHdr, pStrm)
++{}
++
++LwpTable::~LwpTable()
++{}
++
++void LwpTable::Read()
++{
++ LwpContent::Read();
++ //m_RowCache.Read(m_pObjStrm);
++ //m_ColumnCache.Read(m_pObjStrm);
++
++ //m_CPNotifyList.Read(m_pObjStrm);
++ //m_CPTempVersionedNotifyList.Read(m_pObjStrm);
++
++ m_nRow = m_pObjStrm->QuickReaduInt16();
++ m_nColumn = m_pObjStrm->QuickReaduInt16();
++
++ m_nHeight = m_pObjStrm->QuickReadInt32();
++ m_nWidth = m_pObjStrm->QuickReadInt32();
++
++ m_nDefaultAutoGrowRowHeight = m_pObjStrm->QuickReadInt32();
++
++ m_nAttributes = m_pObjStrm->QuickReaduInt16();
++
++ m_Layout.ReadIndexed(m_pObjStrm);
++
++ m_DefaultCellStyle.ReadIndexed(m_pObjStrm);
++ if (LwpFileHeader::m_nFileRevision >= 0x0007)
++ m_CPNotifyList.Read(m_pObjStrm);
++
++ m_pObjStrm->SkipExtra();
++}
++
++sal_Bool LwpTable::IsNumberDown()
++{
++ if (m_nAttributes & NUMBER_DOWN)
++ return sal_True;
++ return sal_False;
++}
++
++ void LwpTable::Parse(IXFStream* pOutputStream)
++{
++}
++
++ LwpSuperTableLayout* LwpTable::GetSuperTableLayout()
++{
++ LwpTableLayout* pLayout = static_cast<LwpTableLayout*>(m_Layout.obj());
++ if(pLayout)
++ return static_cast<LwpSuperTableLayout*>(pLayout->GetParent()->obj());
++
++ return NULL;
++}
++
++ /*****************************************************************************/
++ LwpTableHeading::LwpTableHeading(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpTable(objHdr, pStrm)
++{}
++
++LwpTableHeading::~LwpTableHeading()
++{}
++
++void LwpTableHeading::Read()
++{
++ m_pObjStrm->SkipExtra();
++}
++ void LwpTableHeading::Parse(IXFStream* pOutputStream)
++{
++}
++
++ /*****************************************************************************/
++ LwpTableHint::LwpTableHint(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpObject(objHdr, pStrm)
++{}
++
++LwpTableHint::~LwpTableHint()
++{}
++
++void LwpTableHint::Read()
++{
++ cListNext.ReadIndexed(m_pObjStrm);
++ if (LwpFileHeader::m_nFileRevision < 0x0006)
++ m_pObjStrm->SkipExtra();
++
++ // not implemented yet
++ //lbool Problem;
++ // ?Problem = cStart.QuickReadNonEmbedded(m_pObjStrm);
++
++ cLayout.ReadIndexed(m_pObjStrm);
++ cContent.ReadIndexed(m_pObjStrm);
++ cFlags = m_pObjStrm->QuickReaduInt8();
++ cParent.ReadIndexed(m_pObjStrm);
++ //cNumberHint.QuickRead (m_pObjStrm);
++ cLineNumber = m_pObjStrm->QuickReaduInt32();
++ cPageHint.ReadIndexed (m_pObjStrm);
++
++ m_pObjStrm->SkipExtra ();
++
++ //CContentHint(pFile, pLoader);
++
++ cRow = m_pObjStrm->QuickReaduInt16();
++ cCellHint.Read (m_pObjStrm);
++ cRowContinued = (sal_Bool)m_pObjStrm->QuickReaduInt16();
++
++ cTable.ReadIndexed(m_pObjStrm);
++ //if (!cTable.PointerTest())
++ // cTable = NullObjPtr;
++
++ //cCellNumberHint.QuickRead (m_pObjStrm);
++ LwpObjectID cList;
++ cList.ReadIndexed(m_pObjStrm);
++
++ m_pObjStrm->SkipExtra();
++}
++ void LwpTableHint::Parse(IXFStream* pOutputStream)
++{
++}
++
++ /*****************************************************************************/
++LwpParallelColumns::LwpParallelColumns(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpTable(objHdr, pStrm)
++{
++}
++
++LwpParallelColumns::~LwpParallelColumns()
++{
++}
++
++void LwpParallelColumns::Read()
++{
++ LwpTable::Read();
++ cDefaultLeftColumnStyle.ReadIndexed(m_pObjStrm);
++ cDefaultRightColumnStyle.ReadIndexed(m_pObjStrm);
++
++ m_pObjStrm->SkipExtra();
++}
++ /*****************************************************************************/
++LwpGlossary::LwpGlossary(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpParallelColumns(objHdr, pStrm)
++{
++}
++
++LwpGlossary::~LwpGlossary()
++{
++}
++sal_uInt16 LwpGlossary::GetNumIndexRows(void)
++{
++ if (GetRow() > 0 && GetRow() <= MAX_NUM_ROWS)
++ return GetRow() - 1; // Minus one row for repeated heading.
++ return 0;
++}
++
++void LwpGlossary::Read()
++{
++ LwpParallelColumns::Read();
++
++ sal_uInt16 FiledEntries = m_pObjStrm->QuickReaduInt16();
++ sal_uInt16 NumIndexRows = GetNumIndexRows();
++
++ sal_uInt16 * cpIndex = NULL;
++ if (FiledEntries < NumIndexRows)
++ {
++ /* We'll have to do sequential (slow) searches. */
++ m_pObjStrm->SeekRel( FiledEntries * sizeof(sal_uInt16));
++ }
++ else
++ {
++ if (NumIndexRows)
++ {
++ sal_uInt16 EntriesRead, EntryCount;
++ sal_uInt16 *pRowID;
++
++ cpIndex = new sal_uInt16[NumIndexRows];
++
++ if (cpIndex)
++ {
++ pRowID = cpIndex;
++
++ EntriesRead = (FiledEntries > NumIndexRows)? NumIndexRows:FiledEntries;
++
++ for (EntryCount = 1; EntryCount <= EntriesRead; EntryCount++)
++ *pRowID++ = m_pObjStrm->QuickReaduInt16();
++
++ if (FiledEntries > EntriesRead)
++ m_pObjStrm->SeekRel((FiledEntries - EntriesRead)* sizeof(sal_uInt16));
++ }
++ }
++ else
++ m_pObjStrm->SeekRel(FiledEntries * sizeof(sal_uInt16));
++ }
++
++ m_pObjStrm->SkipExtra();
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwptable.hxx lotuswordpro/source/filter/lwptable.hxx
+--- lotuswordpro.bak/source/filter/lwptable.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwptable.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,236 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - table object
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++#ifndef _LWPTABLE_HXX_
++#define _LWPTABLE_HXX_
++
++#include "lwpobj.hxx"
++#include "lwpobjhdr.hxx"
++#include "lwpobjid.hxx"
++#include "lwpstory.hxx"
++#include "lwppara.hxx"
++#include "lwppagehint.hxx"
++#include "lwptools.hxx"
++#include "lwptablelayout.hxx"
++
++class LwpTableLayout;
++/**
++ * @brief
++ * VO_SUPERTABLE object
++ */
++class LwpSuperTable: public LwpContent
++{
++public:
++ LwpSuperTable(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpSuperTable();
++
++ virtual void Parse(IXFStream* pOutputStream);
++ //Added by for XFConvert refactor, 03/31/2005
++ virtual void XFConvert(XFContentContainer* pCont);
++ //End of Add
++protected:
++ void Read();
++};
++/**
++ * @brief
++ * for VO_TABLE object reading
++ */
++class LwpForkedNotifyList
++{
++public:
++ LwpForkedNotifyList(){};
++ ~LwpForkedNotifyList() {};
++ void Read(LwpObjectStream* pObjStrm)
++ {
++ m_PersistentList.Read(pObjStrm);
++ };
++
++protected:
++ LwpNotifyListPersistent m_PersistentList;
++};
++/**
++ * @brief
++ * VO_TABLE object
++ */
++class LwpTable: public LwpContent
++{
++public:
++ LwpTable(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpTable();
++
++ virtual void Parse(IXFStream* pOutputStream);
++ double GetWidth() {return LwpTools::ConvertFromUnitsToMetric(m_nWidth);};
++ double GetHeight() {return LwpTools::ConvertFromUnitsToMetric(m_nHeight);};
++ LwpObjectID * GetDefaultCellStyle() {return &m_DefaultCellStyle;};
++ sal_uInt16 GetRow() {return m_nRow;};
++ sal_uInt16 GetColumn() {return m_nColumn;};
++ LwpTableLayout * GetTableLayout(){return static_cast<LwpTableLayout *>(GetLayout(NULL));};
++ sal_Bool IsNumberDown();
++ virtual sal_Bool IsTable(){ return sal_True;};
++ LwpSuperTableLayout* GetSuperTableLayout();
++protected:
++ LwpDLVListHeadTail m_RowCache;
++ LwpDLVListHeadTail m_ColumnCache;
++ LwpNotifyListPersistent m_CPTempVersionedNotifyList;
++ LwpForkedNotifyList m_CPNotifyList;
++
++ sal_uInt16 m_nRow, m_nColumn;
++ sal_Int32 m_nHeight;
++ sal_Int32 m_nWidth;
++ sal_Int32 m_nDefaultAutoGrowRowHeight;
++ sal_uInt16 m_nAttributes;
++ enum lTableAttributes
++ {
++ NUMBER_DOWN = 0x01,
++ SIZING_VIA_MOUSE_ENABLED = 0x02,
++ NUMBER_RESET = 0x04
++ };
++
++ LwpObjectID m_Layout;
++ LwpObjectID m_DefaultCellStyle; // gCVirtualLayout
++ void Read();
++};
++
++/**
++ * @brief
++ *
++ */
++class LwpTableHint : public LwpObject
++{
++public:
++ LwpTableHint(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpTableHint();
++
++ virtual void Parse(IXFStream* pOutputStream);
++protected:
++ void Read();
++ sal_uInt16 cRow;
++ LwpContentHintHead cCellHint;
++ sal_Bool cRowContinued;
++ LwpObjectID cTable;
++ //CCellNumberHintHead cCellNumberHint;
++
++ LwpObjectID cListNext;
++
++ LwpFribPtr cStart;
++ LwpObjectID cLayout; // if the layout is complex then we
++ // store the parent not the left or
++ // right
++ LwpObjectID cContent;
++ sal_uInt8 cFlags;
++ LwpObjectID cParent;
++ //CNumberHintHead cNumberHint;
++ sal_uInt32 cLineNumber;
++ LwpObjectID cPageHint; // the page hint we belong to
++
++ // cFlags
++ enum
++ {
++ HF_INVALID = 0x01, // hint should not be used to start flowing
++ HF_LASTPAGE = 0x02, // content ends with this hint
++ HF_REGISTERED = 0x04, // the hint has been registered with a
++ // paragraph
++ HF_DIDBULLET = 0x08, // We flowed bullet text right before
++ // the end of this stream
++ HF_PROBLEMPARA = 0x10 // This hint's paragraph changed from disk
++ };
++
++
++};
++/**
++ * @brief
++ * VO_TABLEHEADING object
++ */
++class LwpTableHeading : public LwpTable
++{
++public:
++ LwpTableHeading(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpTableHeading();
++
++ virtual void Parse(IXFStream* pOutputStream);
++protected:
++ void Read();
++
++};
++class LwpParallelColumns : public LwpTable
++{
++public:
++ LwpParallelColumns(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpParallelColumns();
++protected:
++ void Read();
++ LwpObjectID cDefaultLeftColumnStyle;
++ LwpObjectID cDefaultRightColumnStyle;
++};
++#define MAX_NUM_ROWS 8192
++class LwpGlossary : public LwpParallelColumns
++{
++public:
++ LwpGlossary(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpGlossary();
++protected:
++ void Read();
++ sal_uInt16 GetNumIndexRows(void);
++};
++
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwptablelayout.cxx lotuswordpro/source/filter/lwptablelayout.cxx
+--- lotuswordpro.bak/source/filter/lwptablelayout.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwptablelayout.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,1543 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - table layouts
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++#include "lwpglobalmgr.hxx"
++#include "lwptablelayout.hxx"
++#include "lwpfoundry.hxx"
++#include "lwpobjfactory.hxx"
++#include "lwpholder.hxx"
++#include "lwptable.hxx"
++#include "lwptblcell.hxx"
++#include "lwpnumericfmt.hxx"
++#include "lwpdlvlist.hxx"
++#include "lwppara.hxx"
++
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xftablestyle.hxx"
++#include "xfilter/xftable.hxx"
++#include "xfilter/xfrow.hxx"
++#include "xfilter/xfrowstyle.hxx"
++#include "xfilter/xfcell.hxx"
++#include "xfilter/xfcellstyle.hxx"
++#include "xfilter/xfcolstyle.hxx"
++#include "xfilter/xfframestyle.hxx"
++#include "xfilter/xfframe.hxx"
++#include "xfilter/xffloatframe.hxx"
++#include "lwpframelayout.hxx"
++#include "xfilter/xfparastyle.hxx"
++
++LwpSuperTableLayout::LwpSuperTableLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpPlacableLayout(objHdr, pStrm)
++{
++ m_pFrame = new LwpFrame(this);
++}
++
++LwpSuperTableLayout::~LwpSuperTableLayout()
++{
++ if(m_pFrame)
++ {
++ delete m_pFrame;
++ }
++}
++/**
++ * @short Read super table layout record
++ */
++void LwpSuperTableLayout::Read()
++{
++ LwpPlacableLayout::Read();
++ m_pObjStrm->SkipExtra();
++
++}
++/**
++ * @short Get child table layout
++ * @return pointer to table layout
++ */
++LwpTableLayout* LwpSuperTableLayout::GetTableLayout()
++{
++ LwpObjectID *pID = GetChildTail();
++
++ while(pID && !pID->IsNull())
++ {
++ LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(pID->obj());
++ if (!pLayout)
++ {
++ break;
++ }
++ if (pLayout->GetLayoutType() == LWP_TABLE_LAYOUT)
++ {
++ return static_cast<LwpTableLayout *>(pLayout);
++ }
++ pID = pLayout->GetPrevious();
++ }
++
++ return NULL;
++}
++/**
++ * @short Get effective heading table layout, the one just before table layout is the only one which is effective
++ * @return LwpTableHeadingLayout* - pointer to table heading layout
++ */
++LwpTableHeadingLayout* LwpSuperTableLayout::GetTableHeadingLayout()
++{
++ LwpObjectID *pID = GetChildTail();
++
++ while(pID && !pID->IsNull())
++ {
++ LwpVirtualLayout * pLayout = static_cast<LwpVirtualLayout *>(pID->obj());
++ if (!pLayout)
++ {
++ break;
++ }
++
++ if (pLayout->GetLayoutType() == LWP_TABLE_HEADING_LAYOUT)
++ {
++ return static_cast<LwpTableHeadingLayout *>(pLayout);
++ }
++ pID = pLayout->GetPrevious();
++ }
++
++ return NULL;
++}
++/**
++ * @short Register super table layout style
++ */
++void LwpSuperTableLayout::RegisterStyle()
++{
++ // if this layout is style of real table entry
++ LwpTableLayout* pTableLayout = GetTableLayout();
++ if (pTableLayout != NULL)
++ {
++ pTableLayout->SetFoundry(m_pFoundry);
++ pTableLayout->RegisterStyle();
++ }
++}
++/**
++ * @short Judge whether table size is according to content, borrowed from Word Pro code
++ * @param
++ * @return sal_Bool
++ */
++sal_Bool LwpSuperTableLayout::IsSizeRightToContent()
++{
++ /* Only "with paragraph above" tables can size right to content. */
++ if (GetRelativeType() == LwpLayoutRelativityGuts::LAY_INLINE_NEWLINE)
++ return LwpPlacableLayout::IsSizeRightToContent();
++
++ return sal_False;
++}
++/**
++ * @short Judge whether table is justifiable, borrowed from Word Pro code
++ * @param
++ * @return sal_Bool
++ */
++sal_Bool LwpSuperTableLayout::IsJustifiable()
++{
++ return (GetRelativeType() != LwpLayoutRelativityGuts::LAY_INLINE_NEWLINE || IsSizeRightToContent());
++}
++/**
++ * @short Get width of frame outside table
++ * @param pTableStyle - pointer of XFTableStyle
++ * @return double - table width
++ */
++double LwpSuperTableLayout::GetWidth()
++{
++ double dWidth = GetTableWidth();
++ double dLeft = GetMarginsValue(MARGIN_LEFT);
++ double dRight = GetMarginsValue(MARGIN_RIGHT);
++
++ return (dWidth + dLeft + dRight);
++}
++/**
++ * @short Get width of table
++ * @param pTableStyle - pointer of XFTableStyle
++ * @return double - table width
++ */
++double LwpSuperTableLayout::GetTableWidth()
++{
++ sal_Int32 nWidth = 0;
++ if(!IsJustifiable() || ((nWidth = LwpMiddleLayout::GetMinimumWidth()) <= 0))
++ {
++ LwpTableLayout* pTableLayout = GetTableLayout();
++ if(!pTableLayout)
++ {
++ assert(sal_False);
++ return 0;
++ }
++ LwpTable *pTable = pTableLayout->GetTable();
++ if(!pTable)
++ {
++ assert(sal_False);
++ return 0;
++ }
++ double dDefaultWidth = pTable->GetWidth();
++ sal_uInt16 nCol = pTable->GetColumn();
++
++ double dWidth = 0;
++
++ for(sal_uInt16 i =0; i< nCol; i++)
++ {
++ LwpObjectID *pColumnID = pTableLayout->GetColumnLayoutHead();
++ LwpColumnLayout * pColumnLayout = static_cast<LwpColumnLayout *>(pColumnID->obj());
++ double dColumnWidth = dDefaultWidth;
++ while (pColumnLayout)
++ {
++ if(pColumnLayout->GetColumnID() == i)
++ {
++ dColumnWidth = pColumnLayout->GetWidth();
++ break;
++ }
++ pColumnID = pColumnLayout->GetNext();
++ pColumnLayout = static_cast<LwpColumnLayout *>(pColumnID->obj());
++ }
++ dWidth += dColumnWidth;
++ }
++
++ return dWidth;
++ }
++
++ double dLeft = GetMarginsValue(MARGIN_LEFT);
++ double dRight = GetMarginsValue(MARGIN_RIGHT);
++ return LwpTools::ConvertFromUnitsToMetric(nWidth)-dLeft-dRight;
++
++}
++/**
++ * @short Apply shadow to table
++ * @param pTableStyle - pointer of XFTableStyle
++ * @return
++ */
++void LwpSuperTableLayout::ApplyShadow(XFTableStyle *pTableStyle)
++{
++ // use shadow property of supertable
++ XFShadow* pXFShadow = GetXFShadow();
++ if(pXFShadow)
++ {
++ pTableStyle->SetShadow(pXFShadow->GetPosition(), pXFShadow->GetOffset(), pXFShadow->GetColor());
++ }
++}
++/**
++ * @short Apply pattern fill to table style
++ * @param pTableStyle - pointer of XFTableStyle
++ * @return
++ */
++void LwpSuperTableLayout::ApplyPatternFill(XFTableStyle* pTableStyle)
++{
++ XFBGImage* pXFBGImage = this->GetFillPattern();
++ if (pXFBGImage)
++ {
++ pTableStyle->SetBackImage(pXFBGImage);
++ }
++}
++
++/**
++ * @short Apply background to table style
++ * @param pTableStyle - pointer of XFTableStyle
++ * @return
++ */
++void LwpSuperTableLayout::ApplyBackGround(XFTableStyle* pTableStyle)
++{
++ if (this->IsPatternFill())
++ {
++ ApplyPatternFill(pTableStyle);
++ }
++ else
++ {
++ ApplyBackColor(pTableStyle);
++ }
++}
++/**
++ * @short Apply back color to table
++ * @param pTableStyle - pointer of XFTableStyle
++ * @return
++ */
++void LwpSuperTableLayout::ApplyBackColor(XFTableStyle *pTableStyle)
++{
++ LwpColor* pColor = GetBackColor();
++ if(pColor && pColor->IsValidColor())
++ {
++ XFColor aColor(pColor->To24Color());
++ pTableStyle->SetBackColor(aColor);
++ }
++}
++/**
++ * @short Apply watermark to table
++ * @param pTableStyle - pointer of XFTableStyle
++ * @return
++ */
++void LwpSuperTableLayout::ApplyWatermark(XFTableStyle *pTableStyle)
++{
++ XFBGImage* pBGImage = GetXFBGImage();
++ if(pBGImage)
++ {
++ pTableStyle->SetBackImage(pBGImage);
++ }
++}
++/**
++ * @short Apply alignment to table
++ * @param pTableStyle - pointer of XFTableStyle
++ * @return
++ */
++void LwpSuperTableLayout::ApplyAlignment(XFTableStyle * pTableStyle)
++{
++ LwpPoint aPoint;
++ if (GetGeometry())
++ aPoint = GetGeometry()->GetOrigin();
++ //LwpPoint aPoint = GetOrigin();
++ double dXOffset = LwpTools::ConvertFromUnitsToMetric(aPoint.GetX());
++
++ // add left padding to alignment distance
++ double dLeft = GetMarginsValue(MARGIN_LEFT);
++
++ pTableStyle->SetAlign(enumXFAlignStart, dXOffset+ dLeft);
++}
++/**
++ * @short Add table to container
++ * @param pCont - pointer of container
++ * @return pCont
++ */
++void LwpSuperTableLayout::XFConvert(XFContentContainer* pCont)
++{
++ if ( LwpLayoutRelativityGuts::LAY_INLINE_NEWLINE == GetRelativeType()
++ && !GetContainerLayout()->IsCell())
++ {
++ LwpTableLayout * pTableLayout = GetTableLayout();
++ if (pTableLayout)
++ {
++ pTableLayout->XFConvert(pCont);
++ }
++ }
++ else if(IsRelativeAnchored())
++ {
++ //anchor to paragraph except "with paragraph above"
++ XFConvertFrame(pCont);
++ }
++ else if(m_pFrame)
++ {
++ //anchor to page, frame, cell
++ m_pFrame->XFConvert(pCont);
++ }
++}
++/**
++ * @short convert frame which anchor to page
++ * @param
++ * @return
++ */
++void LwpSuperTableLayout::XFConvertFrame(XFContentContainer* pCont, sal_Int32 nStart , sal_Int32 nEnd , sal_Bool bAll)
++{
++ if(m_pFrame)
++ {
++ XFFrame* pXFFrame = NULL;
++ if(nEnd < nStart)
++ {
++ pXFFrame = new XFFrame();
++ }
++ else
++ {
++ pXFFrame = new XFFloatFrame(nStart, nEnd, bAll);
++ }
++
++ m_pFrame->Parse(pXFFrame, static_cast<sal_uInt16>(nStart));
++ //parse table, and add table to frame
++ LwpTableLayout * pTableLayout = GetTableLayout();
++ if (pTableLayout)
++ {
++ pTableLayout->XFConvert(pXFFrame);
++ }
++ //add frame to the container
++ pCont ->Add(pXFFrame);
++ }
++
++}
++/**
++ * @short parse frame
++ * @param
++ * @return
++ */
++void LwpSuperTableLayout::ParseFrame(XFFrame * pXFFrame)
++{
++ if(m_pFrame)
++ {
++ m_pFrame->Parse(pXFFrame);
++ }
++}
++/**
++ * @short register frame style
++ * @param
++ * @return
++ */
++void LwpSuperTableLayout::RegisterFrameStyle()
++{
++ XFFrameStyle* pFrameStyle = new XFFrameStyle();
++ m_pFrame->RegisterStyle(pFrameStyle);
++}
++
++LwpTableLayout::LwpTableLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpLayout(objHdr, pStrm),m_pXFTable(NULL), m_nRows(0), m_nCols(0)
++{
++ m_CellsMap.clear();
++ m_pColumns = NULL;
++}
++
++LwpTableLayout::~LwpTableLayout()
++{
++ m_CellsMap.clear();
++
++ if (m_pColumns)
++ {
++ delete [] m_pColumns;
++ m_pColumns = NULL;
++ }
++}
++/**
++ * @short Get neighbour cell by specifying ROW+COL
++ * @param nRow
++ * @param nCol
++ * @return LwpCellLayout *
++ */
++LwpCellLayout * LwpTableLayout::GetCellByRowCol(sal_uInt16 nRow, sal_uInt16 nCol)
++{
++ if (nRow >= m_nRows || nCol >= m_nCols)
++ return NULL;
++
++ return m_WordProCellsMap[nRow*m_nCols + nCol];
++}
++/**
++ * @short traverse all table cells
++ * @param
++ * @param
++ * @param
++ */
++void LwpTableLayout::TraverseTable()
++{
++ sal_uInt32 iLoop, jLoop;
++ sal_uInt32 nCount = m_nRows*m_nCols;
++
++ // new cell map nRow*nCOl and initialize
++ for(iLoop = 0;iLoop<nCount; iLoop++)
++ {
++ m_WordProCellsMap.push_back(GetDefaultCellLayout());
++ }
++
++ // set value
++ LwpObjectID *pRowID = GetChildHead();
++ LwpRowLayout * pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj());
++ while (pRowLayout)
++ {
++ pRowLayout->SetRowMap();
++
++ // for 's analysis job
++ m_RowsMap[pRowLayout->GetRowID()] = pRowLayout;
++ pRowLayout->CollectMergeInfo();
++ // end for 's analysis
++
++ pRowID = pRowLayout->GetNext();
++ pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj());
++ }
++}
++
++/**
++ * @short search the cell map
++ * @param nRow - row id (0 based)
++ * @param nRow - row id (0 based)
++ * @return LwpObjectID * - pointer to cell story object ID
++ */
++LwpObjectID * LwpTableLayout::SearchCellStoryMap(sal_uInt16 nRow, sal_uInt16 nCol)
++{
++ if (nRow >= m_nRows || nCol >= m_nCols )
++ {
++ return NULL;
++ }
++
++ LwpCellLayout * pCell = GetCellByRowCol(nRow, nCol);
++ if (pCell)
++ {
++ // maybe connected cell layout
++ // maybe default cell layout
++ if (nRow != pCell->GetRowID() || nCol != pCell->GetColID())
++ {
++ return NULL;
++ }
++ return pCell->GetContent();
++ }
++
++ return NULL;
++}
++
++/**
++ * @short Get parent super table layout of table layout
++ * @return LwpSuperTableLayout * - pointer of parent super table layout
++ */
++LwpSuperTableLayout * LwpTableLayout::GetSuperTableLayout()
++{
++ return static_cast<LwpSuperTableLayout *>(GetParent()->obj());
++}
++/**
++ * @short Get table pointer
++ * @return LwpTable * - content table pointer
++ */
++LwpTable * LwpTableLayout::GetTable()
++{
++ LwpTable *pTable = static_cast<LwpTable *>(m_Content.obj());
++ return pTable;
++}
++/**
++ * @short Get column style name by column ID
++ * @param sal_uInt16 -- col id(0 based)
++ * @return OUString - name of column style
++ */
++OUString LwpTableLayout::GetColumnWidth(sal_uInt16 nCol)
++{
++ if (nCol >= m_nCols)
++ {
++ assert(sal_False);
++ return m_DefaultColumnStyleName;
++ }
++
++ LwpColumnLayout * pCol = m_pColumns[nCol];
++ if (pCol)
++ {
++ return pCol->GetStyleName();
++ }
++
++ return m_DefaultColumnStyleName;
++}
++/**
++ * @short analyze all columns to get whole table width and width of all columns
++ * @short and register all column styles
++ * @param none
++ */
++void LwpTableLayout::RegisterColumns()
++{
++ LwpTable * pTable = GetTable();
++ LwpSuperTableLayout * pSuper = GetSuperTableLayout();
++
++ sal_uInt16 nCols = m_nCols;
++
++ m_pColumns = new LwpColumnLayout *[nCols];
++ sal_Bool * pWidthCalculated = new sal_Bool[nCols];
++ for(sal_uInt16 i=0;i<nCols; i++)
++ {
++ pWidthCalculated[i] = sal_False;
++ m_pColumns[i] = NULL;
++ }
++
++ double dDefaultColumn = pTable->GetWidth();
++ sal_uInt16 nJustifiableColumn = nCols;
++
++ double dTableWidth = pSuper->GetTableWidth();
++
++ // Get total width of justifiable columns
++ // NOTICE: all default columns are regarded as justifiable columns
++ LwpObjectID *pColumnID = GetColumnLayoutHead();
++ LwpColumnLayout * pColumnLayout = static_cast<LwpColumnLayout *>(pColumnID->obj());
++ while (pColumnLayout)
++ {
++ m_pColumns[pColumnLayout->GetColumnID()] = pColumnLayout;
++ if (!pColumnLayout->IsJustifiable())
++ {
++ pWidthCalculated[pColumnLayout->GetColumnID()] = sal_True;
++ dTableWidth -= pColumnLayout->GetWidth();
++ nJustifiableColumn --;
++ }
++
++ pColumnID = pColumnLayout->GetNext();
++ pColumnLayout = static_cast<LwpColumnLayout *>(pColumnID->obj());
++ }
++
++ // if all columns are not justifiable, the rightmost column will be changed to justifiable
++ if(nJustifiableColumn == 0)
++ {
++ nJustifiableColumn ++;
++ if (m_pColumns[nCols - 1])
++ {
++ pWidthCalculated[nCols-1] = sal_False;
++ dTableWidth += m_pColumns[nCols-1]->GetWidth();
++ }
++ else
++ {
++ // this can't happen
++ dTableWidth = dDefaultColumn;
++ assert(sal_False);
++ }
++ }
++
++ // justifiable columns will share the remain width averagely
++ dDefaultColumn = dTableWidth/nJustifiableColumn;
++
++ // register defualt column style
++ XFColStyle *pColStyle = new XFColStyle();
++ pColStyle->SetWidth(static_cast<float>(dDefaultColumn));
++
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_DefaultColumnStyleName = pXFStyleManager->AddStyle(pColStyle)->GetStyleName();
++
++ // register existed column style
++ sal_uInt16 i=0;
++ for( i=0;i<nCols; i++)
++ {
++ if(m_pColumns[i])
++ {
++ m_pColumns[i]->SetFoundry(m_pFoundry);
++ if(!pWidthCalculated[i])
++ {
++ // justifiable ----register style with calculated value
++ m_pColumns[i]->SetStyleName(m_DefaultColumnStyleName);
++ }
++ else
++ {
++ // not justifiable ---- register style with original value
++ m_pColumns[i]->RegisterStyle(m_pColumns[i]->GetWidth());
++ }
++ }
++ }
++ delete [] pWidthCalculated;
++}
++/**
++ * @short register all row styles
++ * @param none
++ */
++void LwpTableLayout::RegisterRows()
++{
++ LwpTable * pTable = GetTable();
++ if (pTable == NULL)
++ {
++ assert(sal_False);
++ return;
++ }
++
++ // register default row style
++ XFRowStyle * pRowStyle = new XFRowStyle();
++ if (m_nDirection & 0x0030)
++ {
++ pRowStyle->SetMinRowHeight((float)pTable->GetHeight());
++ }
++ else
++ {
++ pRowStyle->SetRowHeight((float)pTable->GetHeight());
++ }
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_DefaultRowStyleName = pXFStyleManager->AddStyle(pRowStyle)->GetStyleName();
++
++ // register style of rows
++ LwpObjectID * pRowID = GetChildHead();
++ LwpRowLayout * pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj());
++ while (pRowLayout)
++ {
++ pRowLayout->SetFoundry(m_pFoundry);
++ pRowLayout->RegisterStyle();
++
++ pRowID = pRowLayout->GetNext();
++ pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj());
++ }
++}
++/**
++ * @short register table style, if needed, including frame style
++ * @param none
++ */
++void LwpTableLayout::RegisterStyle()
++{
++ // get super table layout
++ LwpSuperTableLayout * pSuper = GetSuperTableLayout();
++ if(!pSuper)
++ {
++ assert(sal_False);
++ return;
++ }
++
++ // get table
++ LwpTable * pTable = GetTable();
++ if (pTable == NULL)
++ {
++ assert(sal_False);
++ return;
++ }
++
++ // get row/column number of this table
++ m_nRows = pTable->GetRow();
++ m_nCols = pTable->GetColumn();
++
++ // get default cell layout of current table
++ LwpObjectID * pID= pTable->GetDefaultCellStyle();
++ if (pID)
++ {
++ m_pDefaultCellLayout = static_cast<LwpCellLayout *>(pID->obj());
++ }
++
++ // register columns styles
++ RegisterColumns();
++
++ // register style of whole table
++ XFTableStyle * pTableStyle = new XFTableStyle();
++
++ sal_uInt8 nType = pSuper->GetRelativeType();
++ // If the table is not "with paragraph above" placement, create an frame style
++ // by supertable layout
++ if ( LwpLayoutRelativityGuts::LAY_INLINE_NEWLINE == nType
++ && !pSuper->GetContainerLayout()->IsCell())
++ {
++ //with para above
++// pSuper->ApplyBackColor(pTableStyle);
++ pSuper->ApplyBackGround(pTableStyle);
++ pSuper->ApplyWatermark(pTableStyle);
++ pSuper->ApplyShadow(pTableStyle);
++ pSuper->ApplyAlignment(pTableStyle);
++ pTableStyle->SetWidth(pSuper->GetTableWidth());
++ }
++ else
++ {
++ pSuper->RegisterFrameStyle();
++ pTableStyle->SetAlign(enumXFAlignCenter);
++ pTableStyle->SetWidth(pSuper->GetTableWidth());
++ }
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_StyleName = pXFStyleManager->AddStyle(pTableStyle)->GetStyleName();
++
++ //convert to OO table now and register row stle
++ // traverse
++ TraverseTable();
++
++ SplitConflictCells();
++
++ // Register rows layouts, it must be after SplitConflictCells
++ RegisterRows();
++
++ // Parse table
++ Parse();
++
++
++ //Comment:The old code doesn't check if the LwpFoundry pointer is NULL,
++ // So the NULL pointer cause sodc frozee. Add code to check the
++ // the pointer.
++ //New Code
++ if( GetFoundry() && GetTable() )
++
++ PutCellVals( GetFoundry(),*GetTable()->GetObjectID() );
++}
++/**
++ * @short read table layout
++ * @param none
++ */
++void LwpTableLayout::Parse()
++{
++ // get super table layout
++ LwpSuperTableLayout * pSuper = GetSuperTableLayout();
++ if(!pSuper)
++ {
++ assert(sal_False);
++ return;
++ }
++
++ // set name of object
++ m_pXFTable = new XFTable;
++ m_pXFTable->SetTableName(pSuper->GetName()->str());
++ // set table style
++ m_pXFTable->SetStyleName(m_StyleName);
++
++ sal_uInt16 nRow = m_nRows;
++ sal_uInt8 nCol = (sal_uInt8)m_nCols;
++
++ //process header rows
++ LwpTableHeadingLayout* pTableHeading;
++ pTableHeading = pSuper->GetTableHeadingLayout();
++ sal_uInt16 nStartHeadRow;
++ sal_uInt16 nEndHeadRow;
++ sal_uInt16 nContentRow;
++ if (pTableHeading)
++ {
++ pTableHeading->GetStartEndRow(nStartHeadRow,nEndHeadRow);
++ if (nStartHeadRow != 0)
++ ConvertTable(m_pXFTable,0,nRow,0,nCol);
++ else
++ {
++ nContentRow = ConvertHeadingRow(m_pXFTable,nStartHeadRow,nEndHeadRow+1);
++ ConvertTable(m_pXFTable,nContentRow,nRow,0,nCol);
++ }
++ }
++ else
++ ConvertTable(m_pXFTable,0,nRow,0,nCol);
++}
++
++/**
++ * @short read table layout
++ * @param none
++ */
++void LwpTableLayout::Read()
++{
++ LwpLayout::Read();
++
++ // before layout hierarchy rework!
++ if(LwpFileHeader::m_nFileRevision < 0x000b)
++ {
++ assert(sal_False);
++ }
++ m_ColumnLayout.ReadIndexed(m_pObjStrm);
++
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++ * @short Convert table
++ * @param
++ * @return pCont - container which will contain table
++ */
++void LwpTableLayout::XFConvert(XFContentContainer* pCont)
++{
++
++ pCont->Add(m_pXFTable);
++}
++/**
++ * @short convert heading row
++ * @param pXFTable - pointer of table
++ * @param nStartRow - start heading row ID
++ * @param nEndRow - end heading row ID
++ */
++sal_uInt16 LwpTableLayout::ConvertHeadingRow(
++ XFTable* pXFTable,sal_uInt16 nStartHeadRow,sal_uInt16 nEndHeadRow)
++{
++ sal_uInt16 nContentRow;
++ sal_uInt8 nCol = static_cast<sal_uInt8>(GetTable()->GetColumn());
++ sal_uInt8 nFirstColSpann = 1;
++ XFTable* pTmpTable = new XFTable;
++ XFRow* pXFRow;
++
++ ConvertTable(pTmpTable,nStartHeadRow,nEndHeadRow,0,nCol);
++
++ sal_uInt16 nRowNum = static_cast<sal_uInt16>(pTmpTable->GetRowCount());
++ sal_uInt8* CellMark = new sal_uInt8[nRowNum];
++ sal_Bool bFindFlag = sal_False;
++
++ if (nRowNum == 1)
++ {
++ pXFRow = pTmpTable->GetRow(1);
++ pXFTable->AddHeaderRow(pXFRow);
++ pTmpTable->RemoveRow(1);
++ nContentRow = nEndHeadRow;
++ }
++ else
++ {
++ bFindFlag = FindSplitColMark(pTmpTable,CellMark,nFirstColSpann);
++
++ if (bFindFlag)//split to 2 cells
++ {
++ SplitRowToCells(pTmpTable,pXFTable,nFirstColSpann,CellMark);
++ nContentRow = nEndHeadRow;
++ }
++ else//can not split,the first row will be the heading row,the rest will be content row
++ {
++ pXFRow = pTmpTable->GetRow(1);
++ pXFTable->AddHeaderRow(pXFRow);
++ pTmpTable->RemoveRow(1);
++ nContentRow = m_RowsMap[0]->GetCurMaxSpannedRows(0,nCol);
++ }
++ }
++ delete pTmpTable;
++ delete [] CellMark;
++ return nContentRow;
++}
++
++void LwpTableLayout::SplitRowToCells(XFTable* pTmpTable,XFTable* pXFTable,
++ sal_uInt8 nFirstColSpann,sal_uInt8* pCellMark)
++{
++ sal_uInt16 i;
++ sal_uInt8 j;
++ sal_uInt16 nRowNum = static_cast<sal_uInt16>(pTmpTable->GetRowCount());
++ sal_uInt8 nCol = static_cast<sal_uInt8>(GetTable()->GetColumn());
++
++ XFRow* pXFRow = new XFRow;
++
++ //register style for heading row
++ double fHeight = 0;
++ OUString styleName;
++ XFRowStyle* pRowStyle = new XFRowStyle;
++ styleName = pTmpTable->GetRow(1)->GetStyleName();
++
++ // get settings of the row and assign them to new row style
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ XFRowStyle *pTempRowStyle = static_cast<XFRowStyle*>(pXFStyleManager->FindStyle(styleName));
++ if (pTempRowStyle)
++ *pRowStyle = *pTempRowStyle;
++
++ for (i=1;i<=nRowNum;i++)
++ {
++ styleName = pTmpTable->GetRow(i)->GetStyleName();
++ fHeight+=static_cast<XFRowStyle*>(pXFStyleManager->FindStyle(styleName))->GetRowHeight();
++ }
++ if (m_nDirection & 0x0030)
++ {
++ pRowStyle->SetMinRowHeight((float)fHeight);
++ }
++ else
++ {
++ pRowStyle->SetRowHeight((float)fHeight);
++ }
++ pXFRow->SetStyleName(pXFStyleManager->AddStyle(pRowStyle)->GetStyleName());
++
++ //construct headong row
++ XFCell* pXFCell1 = new XFCell;
++ XFCell* pXFCell2 = new XFCell;
++ XFTable* pSubTable1 = new XFTable;
++ XFTable* pSubTable2 = new XFTable;
++ XFRow* pNewRow;
++ XFRow* pOldRow;
++ XFCell* pNewCell;
++
++ for (i=1;i<=nRowNum;i++)
++ {
++ pOldRow = pTmpTable->GetRow(i);
++ pNewRow = new XFRow;
++ pNewRow->SetStyleName(pOldRow->GetStyleName());
++ for (j=1;j<=pCellMark[i];j++)
++ {
++ pNewCell = pOldRow->GetCell(j);
++ pNewRow->AddCell(pNewCell);
++ }
++ pSubTable1->AddRow(pNewRow);
++ }
++ ConvertColumn(pSubTable1,0,nFirstColSpann);//add column info
++
++ pXFCell1->Add(pSubTable1);
++ pXFCell1->SetColumnSpaned(nFirstColSpann);
++ pXFRow->AddCell(pXFCell1);
++
++ for (i=1;i<=nRowNum;i++)
++ {
++ pOldRow = pTmpTable->GetRow(i);
++ pNewRow = new XFRow;
++ pNewRow->SetStyleName(pOldRow->GetStyleName());
++ for(j=pCellMark[i]+1;j<=pOldRow->GetCellCount();j++)
++ {
++ pNewCell = pOldRow->GetCell(j);
++ pNewRow->AddCell(pNewCell);
++ }
++ pSubTable2->AddRow(pNewRow);
++
++ }
++ ConvertColumn(pSubTable2,nFirstColSpann,nCol);//add column info
++ pXFCell2->Add(pSubTable2);
++ pXFCell2->SetColumnSpaned(nCol-nFirstColSpann);
++ pXFRow->AddCell(pXFCell2);
++
++ pXFTable->AddHeaderRow(pXFRow);
++
++ //remove tmp table
++ for (i=1;i<=nRowNum;i++)
++ {
++ pOldRow = pTmpTable->GetRow(i);
++ for(j=1;j<=pOldRow->GetCellCount();j++)
++ pOldRow->RemoveCell(j);
++ pTmpTable->RemoveRow(i);
++ }
++}
++
++/**
++ * @short find if the heading rows can be split to 2 cells
++ * @param pXFTable - pointer of tmp XFtable
++ * @param CellMark - pointer of cell mark array
++ */
++sal_Bool LwpTableLayout::FindSplitColMark(XFTable* pXFTable,sal_uInt8* pCellMark,
++ sal_uInt8& nMaxColSpan)
++{
++ sal_uInt16 nRowNum = static_cast<sal_uInt16>(pXFTable->GetRowCount());
++ sal_uInt8 nColNum = static_cast<sal_uInt8>(pXFTable->GetColumnCount());
++ sal_uInt8 nCellMark=0;
++ sal_uInt8 nCount;
++ sal_uInt8 nColSpan;
++ sal_Bool bFindFlag = sal_False;
++ XFRow* pTmpRow;
++
++ for(sal_uInt8 i=1;i<=nColNum;i++)
++ {
++ sal_uInt16 nRowLoop;
++ sal_uInt8 nCellLoop;
++
++ //find current max column span
++ nMaxColSpan = 1;
++ for (nRowLoop=1;nRowLoop<=nRowNum;nRowLoop++)
++ {
++ nColSpan = 0;
++ for(nCellLoop=1; nCellLoop<i+1; nCellLoop++)
++ {
++ pTmpRow = pXFTable->GetRow(nRowLoop);
++ XFCell* pCell = pTmpRow->GetCell(nCellLoop);
++ if (pCell)
++ nColSpan += static_cast<sal_uInt8>(pCell->GetColSpaned());
++ else
++ return sal_False;
++ }
++ if (nColSpan > nMaxColSpan)
++ nMaxColSpan = nColSpan;
++ pCellMark[nRowLoop] = 0;//reset all cell mark to zero
++ }
++
++ //find if other row has the same colum
++ for (nRowLoop=1;nRowLoop<=nRowNum;nRowLoop++)
++ {
++ pTmpRow = pXFTable->GetRow(nRowLoop);
++ nCount = 0;
++ nCellMark = 0;
++ for (nCellLoop=1; nCellLoop<=pTmpRow->GetCellCount(); nCellLoop++)
++ {
++ if (nCount>nMaxColSpan)
++ break;
++ nCount+= static_cast<sal_uInt8>(pTmpRow->GetCell(nCellLoop)->GetColSpaned());
++ if (nCount == nMaxColSpan)
++ {
++ nCellMark = nCellLoop;
++ break;
++ }
++ }
++ if (nCellMark == 0)
++ break;
++ else
++ pCellMark[nRowLoop] = nCellMark;
++ }
++ for(nRowLoop=1;nRowLoop<=nRowNum;nRowLoop++)//check if all ==0,break
++ {
++ if (pCellMark[nRowLoop] == 0)
++ break;
++ }
++ if (nRowLoop == nRowNum+1)
++ {
++ bFindFlag = sal_True;
++ return bFindFlag;
++ }
++
++ }
++ return bFindFlag;
++}
++
++/**
++ * @short convert word pro table to SODC table
++ * @param pXFTable - pointer of table
++ * @param nStartRow - start row ID
++ * @param nEndRow - end row ID
++ * @param nStartCol - start column ID
++ * @param nEndCol - end column ID
++ */
++void LwpTableLayout::ConvertTable(XFTable* pXFTable,sal_uInt16 nStartRow,
++ sal_uInt16 nEndRow,sal_uInt8 nStartCol,sal_uInt8 nEndCol)
++{
++ //out put column info TO BE CHANGED,note by ,2005/4/4
++ ConvertColumn(pXFTable,nStartCol,nEndCol);
++ //note end
++
++ std::map<sal_uInt16,LwpRowLayout*>::iterator iter;
++
++ for (sal_uInt16 i=nStartRow; i<nEndRow;)
++ {
++ iter = m_RowsMap.find(i);
++ if (iter == m_RowsMap.end())
++ {
++ ConvertDefaultRow(pXFTable,nStartCol,nEndCol,i);
++ i++;
++ }
++ else
++ {
++ LwpRowLayout* pRow = iter->second;
++ if (pRow->GetCurMaxSpannedRows(nStartCol,nEndCol) == 1)
++ {
++ pRow->ConvertCommonRow(pXFTable,nStartCol,nEndCol);
++ i++;
++ }
++ else
++ {
++ pRow->ConvertRow(pXFTable,nStartCol,nEndCol);
++ i += pRow->GetCurMaxSpannedRows(nStartCol,nEndCol);
++ }
++ }
++ }
++}
++
++/**
++ * @short apply numeric value and formula to cell
++ * @param pFoundry - pointer of foundry
++ * @param aTableID - table ID
++ */
++void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID)
++{
++
++ //Comment:The old code doesn't check if the LwpFoundry pointer is NULL,
++ // So the NULL pointer cause sodc frozee. Add code to check the
++ // the pointer.
++ //New Code
++ if( !pFoundry ) return;
++
++
++ try{
++
++ LwpDLVListHeadHolder* pHolder = (LwpDLVListHeadHolder*)pFoundry->GetNumberManager()->GetTableRangeID().obj();
++
++ LwpTableRange* pTableRange = (LwpTableRange*)pHolder->GetHeadID()->obj();
++
++ //Look up the table
++ while (NULL!=pTableRange)
++ {
++ LwpObjectID aID = pTableRange->GetTableID();
++ if (aID == aTableID)
++ {
++ break;
++ }
++ pTableRange = pTableRange->GetNext();
++ }
++
++ if (pTableRange)
++ {
++ LwpCellRange* pRange = (LwpCellRange*)pTableRange->GetCellRangeID().obj();
++ LwpFolder* pFolder = (LwpFolder*)pRange->GetFolderID().obj();
++ LwpObjectID aRowListID = pFolder->GetChildHeadID();
++ LwpRowList* pRowList = (LwpRowList*)aRowListID.obj();
++
++ //loop the rowlist
++ while( NULL!=pRowList)
++ {
++ sal_uInt16 nRowID = pRowList->GetRowID();
++ {
++ LwpCellList* pCellList = (LwpCellList*)pRowList->GetChildHeadID().obj();
++ //loop the celllist
++ while( NULL!=pCellList)
++ {
++ {//put cell
++ sal_uInt16 nColID = pCellList->GetColumnID();
++
++ XFCell* pCell = GetCellsMap(nRowID,static_cast<sal_uInt8>(nColID));
++ if (pCell)
++ {
++ pCellList->Convert(pCell, this);
++
++ //process paragraph
++ PostProcessParagraph(pCell, nRowID, nColID);
++ }
++ else
++ {
++ //Hidden cell would not be in cellsmap
++ assert(false);
++ }
++ }
++ pCellList = (LwpCellList*)pCellList->GetNextID().obj();
++ }
++ }
++ pRowList =(LwpRowList*)pRowList->GetNextID().obj();
++ }
++ }
++
++ }catch (...) {
++ assert(false);
++ }
++}
++
++/**
++ * @short 1. set number right alignment to right if number 2. remove tab added before if number
++ * @param pCell - cell which to be process
++ * @param nRowID - row number in Word Pro file
++ * @param nColID - column number in Word Pro file
++ */
++void LwpTableLayout::PostProcessParagraph(XFCell *pCell, sal_uInt16 nRowID, sal_uInt16 nColID)
++{
++ // if number right, set alignment to right
++ LwpCellLayout * pCellLayout = GetCellByRowCol(nRowID, nColID);
++ if(pCellLayout)
++ {
++ XFParagraph * pXFPara = NULL;
++ //mod by ,fix bug 2759,2006/3/22
++ pXFPara = static_cast<XFParagraph*>(pCell->FindFirstContent(enumXFContentPara));
++ if (!pXFPara)
++ return;
++ //mod end
++ XFColor aColor;
++ XFColor aNullColor = XFColor();
++
++ if ( pXFPara)
++ {
++ OUString sNumfmt = pCellLayout->GetNumfmtName();
++ sal_Bool bColorMod = sal_False;
++ XFNumberStyle* pNumStyle = NULL;
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ if (sNumfmt.getLength())
++ {
++ pNumStyle = (XFNumberStyle*)pXFStyleManager->FindStyle( sNumfmt);
++ aColor = pNumStyle->GetColor();
++ if ( pNumStyle && aColor != aNullColor )
++ bColorMod = sal_True;//end
++ }
++
++ XFParaStyle * pStyle = pXFStyleManager->FindParaStyle(pXFPara->GetStyleName());
++ if (pStyle->GetNumberRight() || bColorMod)
++ {
++ XFParaStyle* pOverStyle = new XFParaStyle;
++ *pOverStyle = *pStyle;
++
++ if (pStyle->GetNumberRight())
++ pOverStyle->SetAlignType(enumXFAlignEnd);
++
++ if (bColorMod)
++ {
++ XFFont* pFont = pOverStyle->GetFont();
++ aColor = pFont->GetColor();
++ if ( aColor == aNullColor )
++ {
++ XFFont* pNewFont = new XFFont;
++ aColor = pNumStyle->GetColor();
++ pNewFont->SetColor(aColor);
++ pOverStyle->SetFont(pNewFont);
++ }
++ }
++
++ pOverStyle->SetStyleName(A2OUSTR(""));
++ OUString StyleName = pXFStyleManager->AddStyle(pOverStyle)->GetStyleName();
++
++ pXFPara->SetStyleName(StyleName);
++ }
++ }
++ }
++}
++
++/**
++ * @short Parse all cols of table
++ * @param pXFTable - pointer to created XFTable
++ */
++void LwpTableLayout::ConvertColumn(XFTable *pXFTable,sal_uInt8 nStartCol,sal_uInt8 nEndCol)
++{
++ LwpTable * pTable = GetTable();
++ if (!pTable)
++ {
++ assert(sal_False);
++ return;
++ }
++
++ for (sal_uInt16 iLoop = 0; iLoop < nEndCol-nStartCol ; iLoop ++)
++ {
++ // add row to table
++ LwpObjectID *pColID = GetColumnLayoutHead();
++ LwpColumnLayout * pColumnLayout = static_cast<LwpColumnLayout *>(pColID->obj());
++ while (pColumnLayout)
++ {
++ if (pColumnLayout->GetColumnID() == (iLoop+nStartCol))
++ {
++ pXFTable->SetColumnStyle(iLoop+1, pColumnLayout->GetStyleName());
++ break;
++ }
++ pColID = pColumnLayout->GetNext();
++ pColumnLayout = static_cast<LwpColumnLayout *>(pColID->obj());
++ }
++ if (!pColumnLayout)
++ {
++ pXFTable->SetColumnStyle(iLoop+1, m_DefaultColumnStyleName);
++ }
++ }
++}
++/**
++ * @short split conflict merged cells
++ */
++void LwpTableLayout::SplitConflictCells()
++{
++ LwpTable * pTable = GetTable();
++ if (!pTable)
++ return;
++ sal_uInt16 nCol = pTable->GetColumn();
++ sal_uInt16 nRow = pTable->GetRow();
++
++ sal_uInt16 nEffectRows;
++ std::map<sal_uInt16,LwpRowLayout*>::iterator iter1;
++ std::map<sal_uInt16,LwpRowLayout*>::iterator iter2;
++ LwpRowLayout* pRowLayout;
++ LwpRowLayout* pEffectRow;
++
++ for (sal_uInt16 i=0; i<nRow; )
++ {
++ iter1 = m_RowsMap.find(i);
++ if (iter1 == m_RowsMap.end())//default rows
++ {
++ i++;
++ continue;
++ }
++ pRowLayout= iter1->second;
++ if (pRowLayout->GetMergeCellFlag() == sal_False)
++ {
++ i++;
++ continue;
++ }
++ else
++ {
++ nEffectRows = i + pRowLayout->GetCurMaxSpannedRows(0,(sal_uInt8)nCol);
++
++ for (sal_uInt16 j = i+1; j<nEffectRows; j++)
++ {
++ iter2 = m_RowsMap.find(j);
++ if (iter2 == m_RowsMap.end())
++ continue;
++ pEffectRow = iter2->second;
++ if (pEffectRow->GetMergeCellFlag() == sal_False)
++ continue;
++ else
++ pEffectRow->SetCellSplit(nEffectRows);
++ }
++ i = nEffectRows;
++ }
++ }//end for
++
++}
++/**
++ * @short add default row which are missing in the file
++ * @param pXFTable - pointer to new created table
++ * @param nStartCol - starting column
++ * @param nEndCol - end column
++ * @return pXFTable
++ */
++void LwpTableLayout::ConvertDefaultRow(XFTable* pXFTable,sal_uInt8 nStartCol,
++ sal_uInt8 nEndCol,sal_uInt16 nRowID)
++{
++ // current row doesn't exist in the file
++ XFRow * pRow = new XFRow();
++ pRow->SetStyleName(m_DefaultRowStyleName);
++ sal_Bool bIsTop = sal_False;
++ sal_Bool bIsRight = sal_False;
++
++ for (sal_uInt16 j =0;j < nEndCol-nStartCol; j++)
++ {
++ // if table has default cell layout, use it to ConvertCell
++ // otherwise use blank cell
++ XFCell * pCell = NULL;
++ if (m_pDefaultCellLayout)
++ {
++ pCell = m_pDefaultCellLayout->ConvertCell(
++ *GetTable()->GetObjectID(),nRowID,j+nStartCol);
++ }
++ else
++ {
++ pCell = new XFCell();
++ }
++ pRow->AddCell(pCell);
++ }
++
++ pXFTable->AddRow(pRow);
++}
++/**
++ * @short set cell map info
++ * @param pXFCell - pointer to xfcell
++ * @param nRow - row id
++ * @param nCol - column id
++ */
++void LwpTableLayout::SetCellsMap(sal_uInt16 nRow,sal_uInt8 nCol,XFCell* pXFCell)
++{
++ std::pair<std::pair<sal_uInt16,sal_uInt8>,XFCell*> cell;
++ std::pair<sal_uInt16,sal_uInt8> pos;
++ pos.first = nRow;
++ pos.second = nCol;
++ cell.first = pos;
++ cell.second = pXFCell;
++ m_CellsMap.insert(cell);
++}
++
++/**
++ * @short get cell map info
++ * @param nRow - row id
++ * @param nCol - column id
++ * @return pXFCell
++ */
++XFCell* LwpTableLayout::GetCellsMap(sal_uInt16 nRow,sal_uInt8 nCol)
++{
++ std::pair<sal_uInt16,sal_uInt8> pos;
++ pos.first = nRow;
++ pos.second = nCol;
++ std::map<std::pair<sal_uInt16,sal_uInt8>,XFCell*>::iterator iter;
++ iter = m_CellsMap.find(pos);
++ if (iter == m_CellsMap.end())
++ return NULL;
++ return iter->second;
++}
++/**
++ * @descr Get row layout by row id
++ * @param nRow - row id
++ */
++ LwpRowLayout* LwpTableLayout::GetRowLayout(sal_uInt16 nRow)
++{
++ LwpObjectID *pRowID = GetChildHead();
++ LwpRowLayout * pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj());
++ while (pRowLayout)
++ {
++ if(pRowLayout->GetRowID() == nRow)
++ return pRowLayout;
++
++ pRowID = pRowLayout->GetNext();
++ pRowLayout = static_cast<LwpRowLayout *>(pRowID->obj());
++ }
++ return NULL;
++}
++
++
++//add end by
++LwpColumnLayout::LwpColumnLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpVirtualLayout(objHdr, pStrm)
++{}
++
++LwpColumnLayout::~LwpColumnLayout()
++{}
++void LwpColumnLayout::Read()
++{
++ LwpObjectStream* pStrm = m_pObjStrm;
++
++ LwpVirtualLayout::Read();
++
++ sal_uInt16 colid;
++
++ colid = pStrm->QuickReaduInt16(); // forced to lushort
++ ccolid = (sal_uInt8)colid; // Phillip
++ cwidth = pStrm->QuickReadInt32();
++
++ pStrm->SkipExtra();
++}
++
++void LwpColumnLayout::RegisterStyle(double dCalculatedWidth)
++{
++ XFColStyle * pColStyle = new XFColStyle();
++ pColStyle->SetWidth(static_cast<float>(dCalculatedWidth));
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_StyleName = pXFStyleManager->AddStyle(pColStyle)->GetStyleName();
++}
++
++LwpTableHeadingLayout::LwpTableHeadingLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpTableLayout(objHdr, pStrm)
++{}
++
++LwpTableHeadingLayout::~LwpTableHeadingLayout()
++{}
++/**
++ * @short read table heading layout
++ * @param
++ * @return
++ */
++void LwpTableHeadingLayout::Read()
++{
++ LwpTableLayout::Read();
++
++ cStartRow = m_pObjStrm->QuickReaduInt16();
++ cEndRow = m_pObjStrm->QuickReaduInt16();
++
++ m_pObjStrm->SkipExtra();
++
++}
++/**
++ * @short get start and end row number of table heading
++ * @param
++ * @return *pStartRow - starting row number
++ * @return *pEndRow - end row number
++ */
++void LwpTableHeadingLayout::GetStartEndRow(sal_uInt16& nStartRow, sal_uInt16& nEndRow)
++{
++ nStartRow = cStartRow;
++ nEndRow = cEndRow;
++}
++/**
++ * @short get first row heading layout of table heading
++ * @param
++ * @return LwpRowHeadingLayout * - pointer to first row heading layout of table heading
++ */
++LwpRowHeadingLayout * LwpTableHeadingLayout::GetFirstRowHeadingLayout()
++{
++ LwpObjectID *pID = GetChildHead();
++ if(pID && !pID->IsNull())
++ {
++ LwpRowHeadingLayout * pHeadingRow = static_cast<LwpRowHeadingLayout *>(pID->obj());
++ return pHeadingRow;
++ }
++ return NULL;
++}
++
++LwpSuperParallelColumnLayout::LwpSuperParallelColumnLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpSuperTableLayout(objHdr, pStrm)
++{
++}
++LwpSuperParallelColumnLayout::~LwpSuperParallelColumnLayout()
++{}
++
++void LwpSuperParallelColumnLayout::Read()
++{
++ LwpSuperTableLayout::Read();
++ m_pObjStrm->SkipExtra();
++
++}
++
++LwpSuperGlossaryLayout::LwpSuperGlossaryLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpSuperTableLayout(objHdr, pStrm)
++{
++}
++
++LwpSuperGlossaryLayout::~LwpSuperGlossaryLayout()
++{
++}
++
++void LwpSuperGlossaryLayout::Read()
++{
++ LwpSuperTableLayout::Read();
++ m_pObjStrm->SkipExtra();
++}
++
++
++LwpParallelColumnsLayout::LwpParallelColumnsLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpTableLayout(objHdr, pStrm)
++{
++}
++
++LwpParallelColumnsLayout::~LwpParallelColumnsLayout()
++{
++}
++
++void LwpParallelColumnsLayout::Read()
++{
++ LwpTableLayout::Read();
++ m_pObjStrm->SkipExtra();
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwptablelayout.hxx lotuswordpro/source/filter/lwptablelayout.hxx
+--- lotuswordpro.bak/source/filter/lwptablelayout.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwptablelayout.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,270 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - table layouts
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++#ifndef _LWPTABLELAYOUT_HXX
++#define _LWPTABLELAYOUT_HXX
++#include <vector>
++#include <map>
++#include "lwplayout.hxx"
++
++class XFTableStyle;
++class XFTable;
++class XFCell;
++class LwpTable;
++class LwpFrame;
++class LwpSuperTableLayout;
++class LwpRowLayout;
++class LwpCellLayout;
++class LwpTableHeadingLayout;
++class LwpRowHeadingLayout;
++class LwpConnectedCellLayout;
++class LwpColumnLayout;
++
++/**
++ * @brief
++ * VO_TABLELAYOUT object and functions for registering styles and coverting tables
++ */
++class LwpTableLayout: public LwpLayout
++{
++public:
++ LwpTableLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpTableLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_TABLE_LAYOUT;}
++ LwpObjectID * GetColumnLayoutHead(){return &m_ColumnLayout;};
++ void RegisterStyle();
++ LwpTable * GetTable();
++ LwpCellLayout * GetDefaultCellLayout(){return m_pDefaultCellLayout;};
++ LwpSuperTableLayout * GetSuperTableLayout();
++ LwpObjectID * SearchCellStoryMap(sal_uInt16 nRow, sal_uInt16 nCol);
++ LwpCellLayout * GetCellByRowCol(sal_uInt16 nRow, sal_uInt16 nCol);
++ OUString GetColumnWidth(sal_uInt16 nCol);
++ void SetWordProCellMap(sal_uInt16 nRow, sal_uInt16 nCol, LwpCellLayout * pCell)
++ {
++ if (nRow >= m_nRows || nCol >= m_nCols)
++ return;
++ m_WordProCellsMap[nRow * m_nCols + nCol] = pCell;
++ };
++protected:
++ void Read();
++ void TraverseTable();
++ void RegisterColumns();
++ void RegisterRows();
++ void Parse();
++ void PostProcessParagraph(XFCell *pCell, sal_uInt16 nRowID, sal_uInt16 nColID);
++
++ sal_uInt16 m_nRows;
++ sal_uInt16 m_nCols;
++
++private:
++ //CColumnLayoutHead cColumnLayout;
++ LwpObjectID m_ColumnLayout;
++ OUString m_FrameStyleName;
++ LwpCellLayout * m_pDefaultCellLayout;
++ OUString m_DefaultColumnStyleName;
++ OUString m_DefaultRowStyleName;
++
++ // wordpro cell map
++ std::vector<LwpCellLayout *> m_WordProCellsMap;
++ // column vector
++ LwpColumnLayout ** m_pColumns;
++
++//add by ,2005/4/1
++public:
++ void XFConvert(XFContentContainer* pCont);
++ void ConvertTable(XFTable* pXFTable,sal_uInt16 nStartRow,
++ sal_uInt16 nEndRow,sal_uInt8 nStartCol,sal_uInt8 nEndCol);
++ OUString GetDefaultRowStyleName(){return m_DefaultRowStyleName;}
++ void SetCellsMap(sal_uInt16 nRow,sal_uInt8 nCol,XFCell* pXFCell);
++ XFCell* GetCellsMap(sal_uInt16 nRow,sal_uInt8 nCol);
++ std::map<sal_uInt16,LwpRowLayout*> GetRowsMap(){return m_RowsMap;}
++ LwpRowLayout* GetRowLayout(sal_uInt16 nRow);
++private:
++ void ConvertDefaultRow(XFTable* pXFTable,sal_uInt8 nStartCol,
++ sal_uInt8 nEndCol,sal_uInt16 nRowID);
++ void ConvertColumn(XFTable *pXFTable,sal_uInt8 nStartCol,sal_uInt8 nEndCol);
++ sal_uInt16 ConvertHeadingRow(XFTable* pXFTable,sal_uInt16 nStartHeadRow,sal_uInt16 nEndHeadRow);
++ sal_Bool FindSplitColMark(XFTable* pXFTable,sal_uInt8* pCellMark,sal_uInt8& nMaxColSpan);
++ void SplitRowToCells(XFTable* pTmpTable,XFTable* pXFTable,
++ sal_uInt8 nFirstColSpann,sal_uInt8* pCellMark);
++
++ std::map<sal_uInt16,LwpRowLayout*> m_RowsMap;
++ void SplitConflictCells();
++ XFTable* m_pXFTable;
++ std::map<std::pair<sal_uInt16,sal_uInt8>,XFCell*> m_CellsMap;
++
++ void PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID);
++};
++/**
++ * @brief
++ * VO_SUPERTABLELAYOUT object
++ */
++class LwpSuperTableLayout: public LwpPlacableLayout
++{
++public:
++ LwpSuperTableLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpSuperTableLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_SUPERTABLE_LAYOUT;}
++ void RegisterStyle();
++ // for table style
++ // add by , 06/03/2005
++ void ApplyPatternFill(XFTableStyle* pTableStyle);
++ void ApplyBackGround(XFTableStyle* pTableStyle);
++ // end add
++
++ void ApplyBackColor(XFTableStyle *pTableStyle);
++ void ApplyShadow(XFTableStyle *pTableStyle);
++ double GetWidth();
++ double GetTableWidth();
++ void ApplyWatermark(XFTableStyle *pTableStyle);
++ void ApplyAlignment(XFTableStyle * pTableStyle);
++ void XFConvert(XFContentContainer* pCont);
++ // for frame style
++ virtual void XFConvertFrame(XFContentContainer* pCont, sal_Int32 nStart = 0, sal_Int32 nEnd = 0, sal_Bool bAll = sal_False);
++ void ParseFrame(XFFrame* pXFFrame);
++ void RegisterFrameStyle();
++ LwpTableHeadingLayout* GetTableHeadingLayout();
++protected:
++ void Read();
++ LwpTableLayout* GetTableLayout();
++ sal_Bool IsSizeRightToContent();
++ sal_Bool IsJustifiable();
++ LwpFrame* m_pFrame;
++
++private:
++};
++/**
++ * @brief
++ * VO_COLUMNLAYOUT object
++ */
++class LwpColumnLayout : public LwpVirtualLayout
++{
++public:
++ LwpColumnLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpColumnLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_COLUMN_LAYOUT;}
++ sal_uInt32 GetColumnID(){return ccolid;};
++ double GetWidth(){return LwpTools::ConvertFromUnitsToMetric(cwidth);};
++ void RegisterStyle(double dCalculatedWidth);
++ sal_Bool IsJustifiable(){return (( m_nAttributes2 & STYLE2_JUSTIFIABLE) != 0);};
++protected:
++ void Read();
++ sal_uInt8 ccolid;
++ sal_Int32 cwidth;
++
++};
++/**
++ * @brief
++ * VO_TABLEHEADINGLAYOUT object
++ */
++class LwpTableHeadingLayout : public LwpTableLayout
++{
++public:
++ LwpTableHeadingLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpTableHeadingLayout();
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_TABLE_HEADING_LAYOUT;}
++ void GetStartEndRow(sal_uInt16& nStartRow, sal_uInt16& nEndRow);
++ LwpRowHeadingLayout * GetFirstRowHeadingLayout();
++protected:
++ void Read();
++ sal_uInt16 cStartRow;
++ sal_uInt16 cEndRow;
++};
++/**
++ * @brief
++ * VO_SUPERPARALLELCOLUMNLAYOUT object
++ */
++class LwpSuperParallelColumnLayout : public LwpSuperTableLayout
++{
++public:
++ LwpSuperParallelColumnLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpSuperParallelColumnLayout();
++protected:
++ void Read();
++};
++
++/**
++ * @brief
++ * VO_PCOLLAYOUT object
++ */
++class LwpParallelColumnsLayout : public LwpTableLayout
++{
++public:
++ LwpParallelColumnsLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpParallelColumnsLayout();
++protected:
++ void Read();
++};
++
++class LwpSuperGlossaryLayout : public LwpSuperTableLayout
++{
++public:
++ LwpSuperGlossaryLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpSuperGlossaryLayout();
++protected:
++ void Read();
++};
++
++#include "lwpcelllayout.hxx"
++#include "lwprowlayout.hxx"
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwptaboverride.hxx lotuswordpro/source/filter/lwptaboverride.hxx
+--- lotuswordpro.bak/source/filter/lwptaboverride.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwptaboverride.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,129 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Tab override for VO_PARASTYLE.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-12 create and implement.
++ ************************************************************************/
++
++#ifndef _LWPTABOVERRIDE_HXX
++#define _LWPTABOVERRIDE_HXX
++
++#include "lwpoverride.hxx"
++#include "lwpobjid.hxx"
++
++class LwpTabOverride : public LwpOverride
++{
++public:
++ LwpTabOverride()
++ {
++ }
++
++ virtual ~LwpTabOverride()
++ {
++ }
++
++ virtual void Read(LwpObjectStream *pStrm)
++ {
++ if (pStrm->QuickReadBool())
++ {
++ ReadCommon(pStrm);
++ m_aTabRackID.ReadIndexed(pStrm);
++ }
++
++ pStrm->SkipExtra();
++ }
++
++ inline LwpObjectID* GetTabRackID();
++ inline sal_Bool IsTabRackOverridden();
++ inline void Override(LwpTabOverride* pOther);
++ inline void OverrideTabRack(LwpObjectID* pTabRackID);
++private:
++ LwpObjectID m_aTabRackID;
++ enum
++ {
++ TO_TABRACK = 0x01
++ };
++};
++
++inline LwpObjectID* LwpTabOverride::GetTabRackID()
++{
++ return &m_aTabRackID;
++}
++
++inline void LwpTabOverride::Override(LwpTabOverride* pOther)
++{
++ if (m_nApply & TO_TABRACK)
++ {
++ if (IsTabRackOverridden())
++ //m_aTabRackID = *(pOther->GetTabRackID());
++ pOther->OverrideTabRack(GetTabRackID());
++ }
++}
++
++inline sal_Bool LwpTabOverride::IsTabRackOverridden()
++{
++ return (m_nOverride & TO_TABRACK) != 0;
++}
++
++inline void LwpTabOverride::OverrideTabRack(LwpObjectID* pTabRackID)
++{
++ m_aTabRackID = *pTabRackID;
++}
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwptabrack.cxx lotuswordpro/source/filter/lwptabrack.cxx
+--- lotuswordpro.bak/source/filter/lwptabrack.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwptabrack.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,134 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Tabrack for LwpTabPiece object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-12 create this file.
++ ************************************************************************/
++#include "lwptabrack.hxx"
++#include "lwpobjstrm.hxx"
++#include "lwpslvlist.hxx"
++
++LwpTab::LwpTab()
++{
++ m_nX = 0;
++ m_nAlignChar = 0; //be careful,not quite sure it's 8-bit,perhaps 16-bit.
++ m_nType = 0;
++ m_nLeader = 0;
++ m_nRelativeType = 0;
++}
++
++void LwpTab::Read(LwpObjectStream *pStrm)
++{
++ pStrm->QuickRead(&m_nX, sizeof(m_nX));
++ pStrm->QuickRead(&m_nType, sizeof(m_nType));
++ pStrm->QuickRead(&m_nLeader, sizeof(m_nLeader));
++ pStrm->QuickRead(&m_nRelativeType, sizeof(m_nRelativeType));
++ pStrm->QuickRead(&m_nAlignChar, sizeof(m_nAlignChar));
++}
++
++
++LwpTabRack::LwpTabRack(LwpObjectHeader objHdr, LwpSvStream* pStrm):LwpObject(objHdr,pStrm)
++{
++ m_nNumTabs = 0;
++}
++
++void LwpTabRack::Read()
++{
++// LwpObjectID m_NextID;
++ m_NextID.ReadIndexed(m_pObjStrm);
++
++ m_pObjStrm->QuickRead(&m_nNumTabs, sizeof(m_nNumTabs));
++ for( int i=0; i<m_nNumTabs; i++ )
++ {
++ m_aTabs[i].Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++ }
++ m_pObjStrm->SkipExtra();
++}
++
++LwpTab* LwpTabRack::Lookup(sal_uInt16 nIndex)
++{
++ /* Is the tab in this tabrack? */
++ if(nIndex<m_nNumTabs)
++ {
++ return &m_aTabs[nIndex];
++ }
++ //return NULL;
++ /* It's not in this tabrack, so get it out of our next. */
++ if (!GetNext())
++ return NULL; /* ouch */
++
++ return GetNext()->Lookup(nIndex - m_nNumTabs);
++}
++
++LwpTabRack* LwpTabRack::GetNext()
++{
++ LwpTabRack* pTabRack = static_cast<LwpTabRack*>(m_NextID.obj());
++ return pTabRack;
++}
++
++sal_uInt16 LwpTabRack::GetNumTabs()
++{
++ sal_uInt16 nNum=0;
++ if(GetNext())
++ {
++ nNum = GetNext()->GetNumTabs();
++ }
++ return m_nNumTabs+nNum;
++}
+diff -urNp lotuswordpro.bak/source/filter/lwptabrack.hxx lotuswordpro/source/filter/lwptabrack.hxx
+--- lotuswordpro.bak/source/filter/lwptabrack.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwptabrack.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,162 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Tabrack for LwpTabPiece object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-12 create this file.
++ ************************************************************************/
++
++#ifndef _LWPTABRACK_HXX
++#define _LWPTABRACK_HXX
++
++#include "lwpobj.hxx"
++
++class LwpObjectStream;
++class LwpTab;
++class LwpTabRack;
++
++class LwpTab
++{
++public:
++ LwpTab(void);
++
++ enum TabType
++ {
++ TT_LEFT = 1,
++ TT_CENTER,
++ TT_RIGHT,
++ TT_NUMERIC
++ };
++
++ enum LeaderType
++ {
++ TL_NONE = 0,
++ TL_HYPHEN,
++ TL_DOT,
++ TL_LINE
++ };
++
++ enum RelativeType
++ {
++ TR_LEFT = 1,
++ TR_RIGHT,
++ TR_CENTER
++ };
++public:
++ void Read(LwpObjectStream *pStrm);
++ // 2005/01/28
++ inline sal_uInt32 GetPosition();
++ inline TabType GetTabType();
++ inline LeaderType GetLeaderType();
++ inline RelativeType GetRelativeType();
++ inline sal_uInt16 GetAlignChar();
++
++protected:
++ sal_uInt32 m_nX;
++ sal_uInt8 m_nType;
++ sal_uInt8 m_nLeader;
++ sal_uInt8 m_nRelativeType;
++ sal_uInt16 m_nAlignChar; //be careful
++};
++
++// 2005/01/28
++inline sal_uInt32 LwpTab::GetPosition()
++{
++ return m_nX;
++}
++
++inline LwpTab::TabType LwpTab::GetTabType()
++{
++ return (LwpTab::TabType)m_nType;
++}
++
++inline LwpTab::LeaderType LwpTab::GetLeaderType()
++{
++ return (LwpTab::LeaderType)m_nLeader;
++}
++inline LwpTab::RelativeType LwpTab::GetRelativeType()
++{
++ return (LwpTab::RelativeType)m_nRelativeType;
++}
++
++inline sal_uInt16 LwpTab::GetAlignChar()
++{
++ return m_nAlignChar;
++}
++
++class LwpTabRack : public LwpObject
++{
++public:
++ LwpTabRack(LwpObjectHeader objHdr, LwpSvStream* pStrm);
++ virtual ~LwpTabRack(){}
++public:
++ void Read();
++ // 2005/01/28
++ sal_uInt16 GetNumTabs();
++ LwpTab* Lookup(sal_uInt16 nIndex);
++ LwpTabRack* GetNext();
++private:
++ enum{
++ MaxTabs = 15
++ };
++ sal_uInt16 m_nNumTabs;
++ LwpTab m_aTabs[MaxTabs];
++ LwpObjectID m_NextID;
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwptblcell.cxx lotuswordpro/source/filter/lwptblcell.cxx
+--- lotuswordpro.bak/source/filter/lwptblcell.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwptblcell.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,253 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - table cell numerics format
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++
++#include "lwpoverride.hxx"
++#include "lwpobjid.hxx"
++#include "lwptblcell.hxx"
++#include "lwppara.hxx"
++
++//////////////////////////////////////////////////////////////////
++ LwpCellList::LwpCellList(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpDLVList(objHdr, pStrm)
++{}
++
++LwpCellList::~LwpCellList()
++{}
++
++void LwpCellList::Read()
++{
++ // CDLFVList read construction
++ LwpDLVList::Read();
++
++ LwpDLVListHeadTail cChild;
++ cChild.Read(m_pObjStrm);
++
++ cParent.ReadIndexed(m_pObjStrm);
++
++ if (LwpFileHeader::m_nFileRevision < 0x0006)
++ m_pObjStrm->SkipExtra();
++
++ cValue.ReadIndexed(m_pObjStrm);
++
++ LwpObjectID cDependent;
++ cDependent.ReadIndexed(m_pObjStrm);
++
++ cColumn = (sal_uInt8) m_pObjStrm->QuickReaduInt16(); // written as a sal_uInt16
++// sal_uInt8 cCellFlags = (sal_uInt8) m_pObjStrm->QuickReaduInt16(); // written as a sal_uInt16
++ m_pObjStrm->SeekRel(2);//CellFlags
++ m_pObjStrm->SkipExtra();
++
++}
++ void LwpCellList::Parse(IXFStream* pOutputStream)
++{
++}
++void LwpCellList::Convert(XFCell * pCell, LwpTableLayout* pCellsMap)
++{
++ LwpObjectID aValueID = GetValueID();
++ LwpNumericValue* pValue = (LwpNumericValue*)aValueID.obj();
++ if (pValue)
++ {
++ pCell->SetValue( pValue->GetValue() );
++ }
++}
++
++//////////////////////////////////////////////////////////////////
++ LwpNumericValue::LwpNumericValue(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpObject(objHdr, pStrm)
++{}
++
++LwpNumericValue::~LwpNumericValue()
++{}
++
++void LwpNumericValue::Read()
++{
++ m_pObjStrm->QuickRead(&cNumber, sizeof(cNumber));
++ m_pObjStrm->SkipExtra();
++
++}
++ void LwpNumericValue::Parse(IXFStream* pOutputStream)
++{
++}
++//////////////////////////////////////////////////////////////////
++ LwpRowList::LwpRowList(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpDLVList(objHdr, pStrm)
++{}
++
++LwpRowList::~LwpRowList()
++{}
++
++void LwpRowList::Read()
++{
++ // CDLFVList read construction
++ LwpDLVList::Read();
++
++ cChild.Read(m_pObjStrm);
++ cParent.ReadIndexed(m_pObjStrm);
++
++ if (LwpFileHeader::m_nFileRevision < 0x0006)
++ m_pObjStrm->SkipExtra();
++
++ cRowID = m_pObjStrm->QuickReaduInt16();
++
++ m_pObjStrm->SkipExtra();
++}
++ void LwpRowList::Parse(IXFStream* pOutputStream)
++{
++}
++
++//////////////////////////////////////////////////////////////////
++ LwpTableRange::LwpTableRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ :LwpDLVList(objHdr, pStrm)
++{}
++
++LwpTableRange::~LwpTableRange()
++{}
++
++void LwpTableRange::Read()
++{
++ LwpDLVList::Read();
++
++ cqTable.ReadIndexed(m_pObjStrm);
++ cpCellRange.ReadIndexed(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++ void LwpTableRange::Parse(IXFStream* pOutputStream)
++{
++}
++//////////////////////////////////////////////////////////////////
++ LwpCellRange::LwpCellRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpObject(objHdr, pStrm)
++{}
++
++LwpCellRange::~LwpCellRange()
++{}
++
++void LwpCellRange::Read()
++{
++ cpFolder.ReadIndexed(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++ void LwpCellRange::Parse(IXFStream* pOutputStream)
++{
++}
++//////////////////////////////////////////////////////////////////
++
++ LwpFolder::LwpFolder(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpDLVList(objHdr, pStrm)
++{}
++
++LwpFolder::~LwpFolder()
++{}
++
++void LwpFolder::Read()
++{
++ // CDLFVList read construction
++ LwpDLVList::Read();
++
++ cChild.Read(m_pObjStrm);
++ cParent.ReadIndexed(m_pObjStrm);
++
++ if (LwpFileHeader::m_nFileRevision < 0x0006)
++ m_pObjStrm->SkipExtra();
++
++ cqTable.ReadIndexed(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++}
++ void LwpFolder::Parse(IXFStream* pOutputStream)
++{
++}
++//////////////////////////////////////////////////////////////////
++
++ LwpDependent::LwpDependent(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpDLVList(objHdr, pStrm)
++{}
++
++LwpDependent::~LwpDependent()
++{}
++
++void LwpDependent::Read()
++{
++ LwpDLVList::Read();
++
++ cFormulaInfo.ReadIndexed(m_pObjStrm);
++ cReferenceOffset = m_pObjStrm->QuickReaduInt16();
++ cFlags = (sal_uInt8)m_pObjStrm->QuickReaduInt16(); // Written as lushort.
++
++ m_pObjStrm->SkipExtra();
++}
++ void LwpDependent::Parse(IXFStream* pOutputStream)
++{
++}
++//////////////////////////////////////////////////////////////////
++
++void LwpRowSpecifier::QuickRead(LwpObjectStream *pStrm)
++{
++ cRow = pStrm->QuickReaduInt16();
++ cQualifier.QuickRead(pStrm);
++}
++void LwpColumnSpecifier::QuickRead(LwpObjectStream *pStrm)
++{
++ cColumn = (sal_uInt8)pStrm->QuickReaduInt16();
++ cQualifier.QuickRead(pStrm);
++}
++
++void LwpRowColumnQualifier::QuickRead(LwpObjectStream *pStrm)
++{
++ // written as lushort for future flags
++ cFlags = (sal_uInt8)pStrm->QuickReaduInt16();
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwptblcell.hxx lotuswordpro/source/filter/lwptblcell.hxx
+--- lotuswordpro.bak/source/filter/lwptblcell.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwptblcell.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,495 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - table object
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++#ifndef _LWPLAYOUTNUMERICSOVERRIDE_HXX_
++#define _LWPLAYOUTNUMERICSOVERRIDE_HXX_
++
++#include "lwpobj.hxx"
++#include "lwpatomholder.hxx"
++#include "lwpstory.hxx"
++
++#include "xfilter/xfcell.hxx"
++
++// temporily added for compile
++class LwpObject;
++
++class LwpContent;
++class LwpTableLayout;
++/**
++ * @brief
++ * VO_CELLLIST object
++ */
++class LwpCellList : public LwpDLVList
++{
++public:
++ LwpCellList(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpCellList();
++
++ virtual void Parse(IXFStream* pOutputStream);
++ LwpObjectID GetNextID(){return *GetNext();}
++ sal_uInt8 GetColumnID(){return cColumn;}
++ virtual sal_Bool IsFormula(){return sal_False;}
++ LwpObjectID GetValueID(){return cValue;}
++
++ virtual void Convert(XFCell * pCell, LwpTableLayout* pCellsMap=NULL);
++protected:
++ sal_uInt8 cColumn;
++ LwpObjectID cParent;
++
++ void Read();
++ LwpObjectID cValue;
++};
++/**
++ * @brief
++ * VO_ROWLIST object
++ */
++class LwpRowList : public LwpDLVList
++{
++public:
++ LwpRowList(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpRowList();
++
++ void Parse(IXFStream* pOutputStream);
++ LwpObjectID GetChildHeadID(){return *cChild.GetHead();}
++ LwpObjectID GetNextID(){return *GetNext();}
++ sal_uInt16 GetRowID(){return cRowID;}
++protected:
++ LwpDLVListHeadTail cChild;
++ LwpObjectID cParent;
++ sal_uInt16 cRowID;
++ void Read();
++};
++/**
++ * @brief
++ * VO_NUMERICVALUE object
++ */
++class LwpNumericValue : public LwpObject
++{
++public:
++ LwpNumericValue(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpNumericValue();
++
++ double GetValue(){return cNumber;}
++ void Parse(IXFStream* pOutputStream);
++protected:
++ double cNumber;
++ //LwpContent m_TheContent;
++ void Read();
++};
++
++////////////////////////////////////////////////////////////////////////
++/**
++ * @brief
++ * VO_TABLERANGE object
++ */
++class LwpTableRange: public LwpDLVList
++{
++public:
++ LwpTableRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpTableRange();
++
++ void Parse(IXFStream* pOutputStream);
++ LwpObjectID GetCellRangeID(){return cpCellRange;}
++ LwpObjectID GetTableID(){ return cqTable;}
++ LwpTableRange* GetNext() { return (LwpTableRange*)(LwpDLVList::GetNext()->obj());}
++protected:
++ LwpObjectID cqTable;
++ LwpObjectID cpCellRange;
++ void Read();
++};
++/**
++ * @brief
++ * VO_CELLRANGE object
++ */
++class LwpCellRange: public LwpObject
++{
++public:
++ LwpCellRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpCellRange();
++
++ void Parse(IXFStream* pOutputStream);
++ LwpObjectID GetFolderID(){return cpFolder;}
++protected:
++ LwpObjectID cpFolder;
++ void Read();
++};
++/**
++ * @brief
++ * VO_FOLDER object
++ */
++class LwpFolder: public LwpDLVList
++{
++public:
++ LwpFolder(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpFolder();
++
++ void Parse(IXFStream* pOutputStream);
++ LwpObjectID GetChildHeadID(){ return *cChild.GetHead();}
++protected:
++ LwpDLVListHeadTail cChild;
++ LwpObjectID cParent;
++ LwpObjectID cqTable;
++ void Read();
++};
++/**
++ * @brief
++ * VO_DEPENDENT object
++ */
++class LwpDependent: public LwpDLVList
++{
++public:
++ LwpDependent(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpDependent();
++
++ void Parse(IXFStream* pOutputStream);
++protected:
++ void Read();
++ LwpObjectID cFormulaInfo;
++ sal_uInt16 cReferenceOffset; // Used to fix dependent formula when we're
++ // dropped, sorted.
++ // Flags:
++ enum
++ {
++ START_CELL = 0x01,
++ END_CELL = 0x02,
++ REGISTERED = 0x04
++ };
++ sal_uInt8 cFlags; // Used to fix dependent formula when we're
++ // dropped, sorted.
++};
++
++
++///////////////////////////////////////////////////////////////
++/**
++ * @brief
++ * row or column id
++ */
++class LwpRowColumnQualifier
++{
++public:
++ LwpRowColumnQualifier(void);
++ ~LwpRowColumnQualifier(){}
++
++ inline void SetAbsolute(void);
++ inline void ClearAbsolute(void);
++ sal_Bool IsAbsolute(void);
++
++ inline void SetAfter(void);
++ inline void ClearAfter(void);
++ sal_Bool IsAfter(void);
++
++ void SetBad(sal_Bool Bad);
++ sal_Bool IsBad(void);
++
++ void QuickRead(LwpObjectStream *pStrm);
++
++private:
++ enum // cFlags bit definitions
++ {
++ REF_ABSOLUTE = 0x01,
++ REF_AFTER = 0x02,
++ REF_BAD = 0x04
++ };
++ sal_uInt8 cFlags;
++};
++
++inline void
++LwpRowColumnQualifier::SetAbsolute(void)
++{
++ cFlags |= REF_ABSOLUTE;
++}
++
++inline void
++LwpRowColumnQualifier::ClearAbsolute(void)
++{
++ cFlags &= ~REF_ABSOLUTE;
++}
++
++inline void
++LwpRowColumnQualifier::SetAfter(void)
++{
++ cFlags |= REF_AFTER;
++}
++
++inline void
++LwpRowColumnQualifier::ClearAfter(void)
++{
++ cFlags &= ~REF_AFTER;
++}
++
++inline
++LwpRowColumnQualifier::LwpRowColumnQualifier()
++{
++ cFlags = 0;
++}
++
++inline sal_Bool
++LwpRowColumnQualifier::IsAfter()
++{
++ return cFlags & REF_AFTER ? sal_True : sal_False;
++}
++
++inline sal_Bool
++LwpRowColumnQualifier::IsBad()
++{
++ return cFlags & REF_BAD ? sal_True : sal_False;
++}
++
++inline sal_Bool
++LwpRowColumnQualifier::IsAbsolute()
++{
++ return cFlags & REF_ABSOLUTE ? sal_True : sal_False;
++}
++/**
++ * @brief
++ * row id
++ */
++class LwpRowSpecifier
++{
++public:
++ LwpRowSpecifier(void){}
++ ~LwpRowSpecifier(){}
++
++ void QuickRead(LwpObjectStream *pStrm);
++ String ToString(USHORT nFormulaRow);
++
++ USHORT RowID(USHORT FormulaRow);
++ USHORT &Row(void);
++
++ void SetAbsolute(void);
++ void ClearAbsolute(void);
++ sal_Bool IsAbsolute(void);
++
++ void SetAfter(void);
++ void ClearAfter(void);
++ sal_Bool IsAfter(void);
++
++ void SetBad(sal_Bool Bad);
++ sal_Bool IsBad(void);
++ void SetRowDelta(USHORT ReferenceRowID, USHORT FormulaRowID);
++
++private:
++ sal_uInt16 cRow;
++ LwpRowColumnQualifier cQualifier;
++};
++
++inline USHORT
++LwpRowSpecifier::RowID(USHORT FormulaRow)
++{
++ if (cQualifier.IsBad())
++ {
++ return 0xffff;
++ }
++ if (cQualifier.IsAbsolute())
++ return cRow;
++
++ if (cQualifier.IsAfter())
++ return FormulaRow + cRow;
++ return FormulaRow - cRow;
++}
++
++inline USHORT &
++LwpRowSpecifier::Row()
++{
++ return cRow;
++}
++
++inline void
++LwpRowSpecifier::SetAbsolute(void)
++{
++ cQualifier.SetAbsolute();
++}
++
++inline void
++LwpRowSpecifier::ClearAbsolute(void)
++{
++ cQualifier.ClearAbsolute();
++}
++
++inline sal_Bool
++LwpRowSpecifier::IsAbsolute()
++{
++ return cQualifier.IsAbsolute();
++}
++
++inline void
++LwpRowSpecifier::SetAfter(void)
++{
++ cQualifier.SetAfter();
++}
++
++inline void
++LwpRowSpecifier::ClearAfter(void)
++{
++ cQualifier.ClearAfter();
++}
++
++inline sal_Bool
++LwpRowSpecifier::IsAfter()
++{
++ return cQualifier.IsAfter();
++}
++
++inline void
++LwpRowSpecifier::SetBad(sal_Bool Bad)
++{
++ cQualifier.SetBad(Bad);
++}
++
++inline sal_Bool
++LwpRowSpecifier::IsBad()
++{
++ return cQualifier.IsBad();
++}
++/**
++ * @brief
++ * column id
++ */
++class LwpColumnSpecifier
++{
++public:
++ LwpColumnSpecifier(void){};
++ ~LwpColumnSpecifier(){};
++
++ void QuickRead(LwpObjectStream *pStrm);
++ sal_uInt8 Column(){return cColumn;}
++ String ToString(sal_uInt8 nFormulaCol);
++
++ sal_uInt8 ColumnID(sal_uInt8 FormulaColumn);
++ void SetAbsolute(void);
++ void ClearAbsolute(void);
++ sal_Bool IsAbsolute(void);
++ void SetAfter(void);
++ void ClearAfter(void);
++ sal_Bool IsAfter(void);
++ void SetBad(sal_Bool Bad);
++ sal_Bool IsBad(void);
++ void SetColumnDelta(sal_uInt8 ReferenceColumnID, sal_uInt8 FormulaColumnID);
++
++private:
++ sal_uInt8 cColumn;
++ LwpRowColumnQualifier cQualifier;
++};
++
++inline sal_uInt8
++LwpColumnSpecifier::ColumnID(sal_uInt8 FormulaColumn)
++{
++ if (cQualifier.IsBad())
++ {
++ return 0xff;
++ }
++ if (cQualifier.IsAbsolute())
++ return cColumn;
++ if (cQualifier.IsAfter())
++ return FormulaColumn + cColumn;
++ return FormulaColumn - cColumn;
++}
++
++inline void
++LwpColumnSpecifier::SetAbsolute(void)
++{
++ cQualifier.SetAbsolute();
++}
++
++inline void
++LwpColumnSpecifier::ClearAbsolute(void)
++{
++ cQualifier.ClearAbsolute();
++}
++
++inline sal_Bool
++LwpColumnSpecifier::IsAbsolute()
++{
++ return cQualifier.IsAbsolute();
++}
++
++inline void
++LwpColumnSpecifier::SetAfter(void)
++{
++ cQualifier.SetAfter();
++}
++
++inline void
++LwpColumnSpecifier::ClearAfter(void)
++{
++ cQualifier.ClearAfter();
++}
++
++inline sal_Bool
++LwpColumnSpecifier::IsAfter()
++{
++ return cQualifier.IsAfter();
++}
++
++inline void
++LwpColumnSpecifier::SetBad(sal_Bool Bad)
++{
++ cQualifier.SetBad(Bad);
++}
++
++inline sal_Bool
++LwpColumnSpecifier::IsBad()
++{
++ return cQualifier.IsBad();
++}
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwptblformula.cxx lotuswordpro/source/filter/lwptblformula.cxx
+--- lotuswordpro.bak/source/filter/lwptblformula.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwptblformula.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,804 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - table cell numerics format
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++
++#include "lwpoverride.hxx"
++#include "lwptblcell.hxx"
++#include "lwppara.hxx"
++#include "lwptblformula.hxx"
++
++#include "lwptablelayout.hxx"
++
++//////////////////////////////////////////////////////////////////
++ LwpFormulaInfo::LwpFormulaInfo(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++:LwpCellList(objHdr, pStrm),m_nFormulaRow(0),m_bSupported(sal_True)
++{}
++
++LwpFormulaInfo::~LwpFormulaInfo()
++{
++ try{
++ while(m_aStack.size()>0)
++ {
++ LwpFormulaArg* pArg=m_aStack.back();
++ m_aStack.pop_back();
++ delete pArg; pArg=NULL;
++ }
++ }catch (...)
++ {
++ assert(false);
++ }
++}
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++sal_Bool LwpFormulaInfo::ReadConst()
++{
++ double Constant;
++ m_pObjStrm->QuickRead(&Constant, sizeof(Constant));
++
++ m_aStack.push_back( new LwpFormulaConst(Constant) );
++
++ return sal_True;
++}
++/**
++* Need more effort for unicode.
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++sal_Bool LwpFormulaInfo::ReadText()
++{
++ USHORT nDiskSize,nStrLen;
++ nDiskSize = m_pObjStrm->QuickReadInt16();
++ nStrLen = m_pObjStrm->QuickReadInt16();
++
++ auto_ptr<char> pBuf(new char[nStrLen+1]);
++ m_pObjStrm->QuickRead( pBuf.get(), nStrLen );
++ *(pBuf.get()+nStrLen)='\0';
++ String aText;
++ aText += String::CreateFromAscii("\"");
++ aText.Append(String(pBuf.get(),nStrLen,gsl_getSystemTextEncoding()));
++ aText += String::CreateFromAscii("\"");
++
++ m_aStack.push_back(new LwpFormulaText(aText));
++ return sal_True;
++}
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++sal_Bool LwpFormulaInfo::ReadCellID()
++{
++ LwpRowSpecifier RowSpecifier;
++ LwpColumnSpecifier ColumnSpecifier;
++ sal_Bool readSucceeded = true;
++
++ RowSpecifier.QuickRead(m_pObjStrm);
++ ColumnSpecifier.QuickRead(m_pObjStrm);
++
++ m_aStack.push_back( new LwpFormulaCellAddr(ColumnSpecifier.ColumnID(cColumn),
++ RowSpecifier.RowID(m_nFormulaRow)) );
++ return readSucceeded;
++}
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++sal_Bool LwpFormulaInfo::ReadCellRange()
++{
++ sal_Bool readSucceeded = sal_True;
++ if (!ReadCellID( )) // start
++ readSucceeded = false;
++ LwpFormulaCellAddr* pStartCellAddr = (LwpFormulaCellAddr*)m_aStack.back();
++ m_aStack.pop_back();
++
++ if (!ReadCellID()) // end
++ readSucceeded = false;
++ LwpFormulaCellAddr* pEndCellAddr = (LwpFormulaCellAddr*)m_aStack.back();
++ m_aStack.pop_back();
++
++ m_aStack.push_back( new LwpFormulaCellRangeAddr(pStartCellAddr->GetCol(),
++ pStartCellAddr->GetRow(),
++ pEndCellAddr->GetCol(),
++ pEndCellAddr->GetRow()) );
++ delete pStartCellAddr;
++ delete pEndCellAddr;
++
++ return readSucceeded;
++}
++
++/**
++* Read expression from wordpro file
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++sal_Bool LwpFormulaInfo::ReadExpression()
++{
++ sal_uInt16 TokenType, DiskLength;
++ sal_Bool readSucceeded = sal_True;
++
++ /* Read the compiled expression length */
++// Len = m_pObjStrm->QuickReaduInt16();
++ m_pObjStrm->SeekRel(2);
++
++ while ((TokenType = m_pObjStrm->QuickReaduInt16()) != TK_END)
++ {
++ // Get the disk length of this token
++ DiskLength = m_pObjStrm->QuickReaduInt16();
++
++ switch (TokenType)
++ {
++ case TK_CONSTANT:
++ {
++ ReadConst();
++ break;
++ }
++
++ case TK_CELLID:
++ if (!ReadCellID())
++ readSucceeded = FALSE;
++ break;
++
++ case TK_CELLRANGE:
++ readSucceeded = ReadCellRange();
++ break;
++
++ case TK_SUM:
++ case TK_IF:
++ case TK_COUNT:
++ case TK_MINIMUM:
++ case TK_MAXIMUM:
++ case TK_AVERAGE:
++ {
++ LwpFormulaFunc* pFunc = new LwpFormulaFunc(TokenType);
++ if (!ReadArguments(*pFunc))
++ readSucceeded = FALSE;
++ m_aStack.push_back(pFunc);
++ }
++ break;
++
++ case TK_ADD://7
++ case TK_SUBTRACT:
++ case TK_MULTIPLY:
++ case TK_DIVIDE:
++ case TK_LESS:
++ case TK_LESS_OR_EQUAL:
++ case TK_GREATER:
++ case TK_GREATER_OR_EQUAL:
++ case TK_EQUAL:
++ case TK_NOT_EQUAL:
++ case TK_AND:
++ case TK_OR:
++ case TK_NOT:
++ m_pObjStrm->SeekRel(DiskLength); // extensible for future
++
++ {//binary operator
++ LwpFormulaOp* pOp = new LwpFormulaOp(TokenType);
++ pOp->AddArg(m_aStack.back()); m_aStack.pop_back();
++ pOp->AddArg(m_aStack.back()); m_aStack.pop_back();
++ m_aStack.push_back(pOp);
++ }
++ break;
++ case TK_UNARY_MINUS:
++ {
++ LwpFormulaUnaryOp* pOp = new LwpFormulaUnaryOp(TokenType);
++ pOp->AddArg(m_aStack.back()); m_aStack.pop_back();
++ m_aStack.push_back(pOp);
++ }
++ break;
++ default:
++ // We don't know what to do with this token, so eat it.
++ m_pObjStrm->SeekRel(DiskLength);
++ readSucceeded = FALSE;
++ break;
++ }
++ MarkUnsupported(TokenType);
++ }
++ return readSucceeded;
++}
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return
++*/
++void LwpFormulaInfo::MarkUnsupported(sal_uInt16 TokenType)
++{
++ switch(TokenType)
++ {
++ case TK_IF:
++ case TK_COUNT:
++ case TK_NOT:
++ {
++ m_bSupported = sal_False;//Not supported formulas
++ }
++ break;
++ default:
++ break;
++ }
++}
++/**
++* Read arguments of functions from wordpro file
++* @date 03/26/2005
++* @param LwpFormulaFunc& aFunc, functions object
++* @return sal_Bool.
++*/
++sal_Bool LwpFormulaInfo::ReadArguments(LwpFormulaFunc& aFunc)
++{
++ sal_uInt16 NumberOfArguments = m_pObjStrm->QuickReaduInt16();
++ sal_uInt16 ArgumentDiskLength, Count;
++ sal_uInt8 ArgumentType;
++ sal_Bool bArgument = sal_False;
++ sal_Bool readSucceeded = sal_True;
++
++ for (Count = 0; Count < NumberOfArguments; Count++)
++ {
++ ArgumentType = (sal_uInt8) m_pObjStrm->QuickReaduInt16(); // written as lushort
++ ArgumentDiskLength = m_pObjStrm->QuickReaduInt16();
++ bArgument = sal_True;
++
++ switch(ArgumentType)
++ {
++ case TK_CELLID:
++ ReadCellID();
++ break;
++
++ case TK_CELLRANGE:
++ ReadCellRange();
++ break;
++
++ case TK_CONSTANT:
++ ReadConst();
++ break;
++
++ case TK_TEXT:
++ ReadText();
++ break;
++
++ case TK_EXPRESSION:
++ ReadExpression();
++ break;
++
++ default:
++ bArgument = sal_False;
++ m_pObjStrm->SeekRel(ArgumentDiskLength);
++ readSucceeded = sal_False;
++ break;
++ }
++
++ if (bArgument)
++ {
++ aFunc.AddArg( m_aStack.back() );
++ m_aStack.pop_back();
++ }
++ }
++ return readSucceeded;
++}
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return
++*/
++void LwpFormulaInfo::Read()
++{
++ LwpCellList::Read();
++ {
++ LwpRowList* pRowList =(LwpRowList*)cParent.obj();
++ if (pRowList)
++ {
++ m_nFormulaRow = pRowList->GetRowID();
++ }
++ else
++ {
++ assert(false);
++ }
++ }
++// sal_uInt8 cFlags = (sal_uInt8) m_pObjStrm->QuickReaduInt16(); // written as a sal_uInt16
++ m_pObjStrm->SeekRel(2);//flags, size in file: sal_uInt16
++
++ LwpNotifyListPersistent cNotifyList;
++ cNotifyList.Read(m_pObjStrm);
++
++ ReadExpression();
++
++ m_pObjStrm->SkipExtra();
++}
++
++/**
++* Make the formula string.
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++String LwpFormulaInfo::Convert(LwpTableLayout* pCellsMap)
++{
++ String aFormula;
++ if (m_bSupported)
++ {
++ if(1==m_aStack.size())
++ {
++ LwpFormulaArg* pFormula = m_aStack.back();
++ aFormula = pFormula->ToString(pCellsMap);
++ }
++ else
++ {
++ assert(false);
++ }
++ }
++ return aFormula;
++}
++
++/**
++* Fill the XFCell content
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++void LwpFormulaInfo::Convert(XFCell * pCell,LwpTableLayout* pCellsMap)
++{
++ String aFormula;
++ aFormula = Convert(pCellsMap);
++ if (aFormula.Len())
++ {
++ pCell->SetFormula(aFormula);
++ }
++ LwpCellList::Convert(pCell);
++}
++
++//////////////////////////////////////////////////////////////////
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++LwpFormulaConst::LwpFormulaConst(double dVal)
++{
++ m_dVal = dVal;
++}
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++String LwpFormulaConst::ToString(LwpTableLayout* pCellsMap)
++{
++ return String::CreateFromDouble(m_dVal);
++}
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return
++*/
++LwpFormulaText::LwpFormulaText( String aText)
++{
++ m_aText = aText;
++}
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return
++*/
++LwpFormulaCellAddr::LwpFormulaCellAddr(sal_Int16 aCol, sal_Int16 aRow)
++{
++ m_aCol = aCol;
++ m_aRow = aRow;
++}
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return String
++*/
++String LwpFormulaCellAddr::ToString(LwpTableLayout* pCellsMap)
++{
++// String aCellAddr;
++// aCellAddr.AppendAscii("<");//<
++// aCellAddr+=m_aCol;
++// aCellAddr+=m_aRow;
++// aCellAddr.AppendAscii(">");//>
++
++ String aCellAddr;
++ aCellAddr.AppendAscii("<");//<
++
++ aCellAddr += LwpFormulaTools::GetCellAddr(m_aRow,m_aCol,pCellsMap);
++
++ aCellAddr.AppendAscii(">");//>
++ return aCellAddr;
++}
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return
++*/
++LwpFormulaCellRangeAddr::LwpFormulaCellRangeAddr(sal_Int16 aStartCol,
++ sal_Int16 aStartRow,
++ sal_Int16 aEndCol,
++ sal_Int16 aEndRow)
++{
++ m_aStartCol = aStartCol;
++ m_aStartRow = aStartRow;
++ m_aEndCol = aEndCol;
++ m_aEndRow = aEndRow;
++}
++
++/**
++* Convert the cell range into a string
++* @date 03/26/2005
++* @param
++* @param
++* @return String.
++*/
++String LwpFormulaCellRangeAddr::ToString(LwpTableLayout* pCellsMap)
++{
++// String aCellAddr;
++// aCellAddr.AppendAscii("<");//<
++// aCellAddr+=m_aStartCol;
++// aCellAddr+=m_aStartRow;
++// aCellAddr.AppendAscii(":");
++// aCellAddr+=m_aEndCol;
++// aCellAddr+=m_aEndRow;
++// aCellAddr.AppendAscii(">");//>
++
++ String aCellAddr;
++ aCellAddr.AppendAscii("<");//<
++
++ aCellAddr += LwpFormulaTools::GetCellAddr(m_aStartRow,m_aStartCol,pCellsMap);
++ aCellAddr.AppendAscii(":");
++ aCellAddr += LwpFormulaTools::GetCellAddr(m_aEndRow,m_aEndCol,pCellsMap);
++
++ aCellAddr.AppendAscii(">");//>
++
++ return aCellAddr;
++}
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return
++*/
++LwpFormulaFunc::LwpFormulaFunc(sal_uInt16 nTokenType)
++{
++ m_nTokenType = nTokenType;
++}
++
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return
++*/
++LwpFormulaFunc::~LwpFormulaFunc()
++{
++ try
++ {
++ while(m_aArgs.size()>0)
++ {
++ LwpFormulaArg* pArg = m_aArgs.back();
++ m_aArgs.pop_back();
++ delete pArg;pArg=NULL;
++ }
++ }catch (...) {
++ assert(false);
++ }
++
++}
++/**
++*
++* @date 03/26/2005
++* @param
++* @param
++* @return
++*/
++void LwpFormulaFunc::AddArg(LwpFormulaArg* pArg)
++{
++ m_aArgs.push_back(pArg);
++}
++/**
++* Convert the functions to a string, which is a argument of other formula
++* @date 03/26/2005
++* @param
++* @param
++* @return String.
++*/
++String LwpFormulaFunc::ToArgString(LwpTableLayout* pCellsMap)
++{
++ String aFormula;
++ aFormula.AppendAscii("(");
++ aFormula+=ToString(pCellsMap);
++ aFormula.AppendAscii(")");
++ return aFormula;
++}
++/**
++* Convert the function to a formula string.
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++String LwpFormulaFunc::ToString(LwpTableLayout* pCellsMap)
++{
++ String aFormula;
++
++ String aFuncName = LwpFormulaTools::GetName(m_nTokenType);
++ aFormula += aFuncName;
++ aFormula.AppendAscii(" ");//Append a blank space
++
++ //Append args
++ vector<LwpFormulaArg*>::iterator aItr;
++ for (aItr=m_aArgs.begin();aItr!=m_aArgs.end();aItr++)
++ {
++ aFormula.Append( (*aItr)->ToArgString(pCellsMap) );
++ aFormula.AppendAscii("|");//separator
++ }
++
++ //erase the last "|"
++ if (m_aArgs.size()>0)
++ {
++ aFormula.Erase(aFormula.Len()-1,1);
++ }
++ else
++ {
++ assert(false);
++ }
++
++ return aFormula;
++}
++
++/**
++* Convert the formula in operators to a string : e.g. 1+2+3
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++String LwpFormulaOp::ToString(LwpTableLayout* pCellsMap)
++{
++ String aFormula;
++ if (2==m_aArgs.size())
++ {
++ vector<LwpFormulaArg*>::iterator aItr = m_aArgs.end();
++ aItr--;
++ aFormula.Append( (*aItr)->ToArgString(pCellsMap) );
++
++ aFormula.AppendAscii(" ");
++
++ String aFuncName = LwpFormulaTools::GetName(m_nTokenType);
++ aFormula.Append(aFuncName);
++
++ aFormula.AppendAscii(" ");
++
++ aItr--;
++ aFormula.Append( (*aItr)->ToArgString(pCellsMap) );
++ }
++ else
++ {
++ assert(false);
++ }
++ return aFormula;
++}
++
++/**
++* convert the formula in unary operators into string : e.g. -2
++* @date 03/26/2005
++* @param
++* @param
++* @return sal_Bool.
++*/
++String LwpFormulaUnaryOp::ToString(LwpTableLayout* pCellsMap)
++{
++ String aFormula;
++ if (1==m_aArgs.size())
++ {
++ String aFuncName = LwpFormulaTools::GetName(m_nTokenType);
++ aFormula.Append(aFuncName);
++
++ vector<LwpFormulaArg*>::iterator aItr = m_aArgs.begin();
++ aFormula.Append( (*aItr)->ToArgString(pCellsMap) );
++ }
++ else
++ {
++ assert(false);
++ }
++ return aFormula;
++}
++/**
++* Get token name
++* @date 03/26/2005
++* @param
++* @param
++* @return String.
++*/
++String LwpFormulaTools::GetName(sal_uInt16 nTokenType)
++{
++ String aName;
++ switch(nTokenType)
++ {
++ case TK_SUM:
++ aName = String::CreateFromAscii("SUM");
++ break;
++ case TK_IF:
++ aName = String::CreateFromAscii("IF");//Not supported by SODC
++ break;
++ case TK_COUNT:
++ aName = String::CreateFromAscii("COUNT");//Not supported by SODC
++ break;
++ case TK_MINIMUM:
++ aName = String::CreateFromAscii("MIN");
++ break;
++ case TK_MAXIMUM:
++ aName = String::CreateFromAscii("MAX");
++ break;
++ case TK_AVERAGE:
++ aName = String::CreateFromAscii("MEAN");
++ break;
++ case TK_ADD:
++ aName = String::CreateFromAscii("+");
++ break;
++ case TK_SUBTRACT:
++ aName = String::CreateFromAscii("-");
++ break;
++ case TK_MULTIPLY:
++ aName = String::CreateFromAscii("*");
++ break;
++ case TK_DIVIDE:
++ aName = String::CreateFromAscii("/");
++ break;
++ case TK_UNARY_MINUS:
++ aName = String::CreateFromAscii("-");
++ break;
++ case TK_LESS:
++ aName = String::CreateFromAscii("L");
++ break;
++ case TK_LESS_OR_EQUAL:
++ aName = String::CreateFromAscii("LEQ");
++ break;
++ case TK_GREATER:
++ aName = String::CreateFromAscii("G");
++ break;
++ case TK_GREATER_OR_EQUAL:
++ aName = String::CreateFromAscii("GEQ");
++ break;
++ case TK_EQUAL:
++ aName = String::CreateFromAscii("EQ");
++ break;
++ case TK_NOT_EQUAL:
++ aName = String::CreateFromAscii("NEQ");
++ break;
++ case TK_NOT:
++ aName = String::CreateFromAscii("NOT");
++ break;
++ case TK_AND:
++ aName = String::CreateFromAscii("AND");
++ break;
++ case TK_OR:
++ aName = String::CreateFromAscii("OR");
++ break;
++ default:
++ assert(false);
++ break;
++ }
++ return aName;
++}
++
++/**
++* Get cell address in String
++* @date 03/26/2005
++* @param
++* @param
++* @return String.
++*/
++String LwpFormulaTools::GetCellAddr(sal_Int16 nRow, sal_Int16 nCol, LwpTableLayout* pCellsMap)
++{
++ String aCellAddr;
++ XFCell* pCell = pCellsMap->GetCellsMap(nRow,(sal_uInt8)nCol);
++ if (pCell)
++ {
++ aCellAddr = pCell->GetCellName();
++ }
++ else
++ {
++ assert( -1==nRow || -1==(sal_Int8)nCol);
++ }
++ return aCellAddr;
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwptblformula.hxx lotuswordpro/source/filter/lwptblformula.hxx
+--- lotuswordpro.bak/source/filter/lwptblformula.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwptblformula.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,224 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - table object
++ */
++/*************************************************************************
++ * Change History
++ Mar 2005 Created
++ ************************************************************************/
++#ifndef _LWPTBLFORMULA_HXX_
++#define _LWPTBLFORMULA_HXX_
++
++using namespace std;
++
++/* These token types are written to the file. Don't change their
++values unless you filter them.
++*/
++enum lTokenType
++{
++ TK_BAD = 0,
++ TK_OPERAND = 1,
++ TK_END = 2,
++ TK_RIGHTPAREN = 3,
++ TK_FUNCTION = 4,
++ TK_LEFTPAREN = 5,
++ TK_UNARY_MINUS = 6,
++ TK_ADD = 7,
++ TK_SUBTRACT = 8,
++ TK_MULTIPLY = 9,
++ TK_DIVIDE = 10,
++ TK_EQUAL = 11,
++ TK_LESS = 12,
++ TK_GREATER = 13,
++ TK_NOT_EQUAL = 14,
++ TK_GREATER_OR_EQUAL = 15,
++ TK_LESS_OR_EQUAL = 16,
++ TK_NOT = 17,
++ TK_AND = 18,
++ TK_OR = 19,
++ TK_CELLID = 20,
++ TK_CONSTANT = 21,
++ TK_TEXT = 22,
++ TK_SUM = 23,
++ TK_IF = 24,
++ TK_AVERAGE = 25,
++ TK_MAXIMUM = 26,
++ TK_MINIMUM = 27,
++ TK_COUNT = 28,
++ TK_CELLRANGE = 29,
++ TK_EXPRESSION = 30,
++ TK_OPEN_FUNCTION = 31,
++ TK_LIST_SEPARATOR = 32
++};
++class LwpTableLayout;
++class LwpFormulaArg
++{
++public:
++ virtual String ToString(LwpTableLayout* pCellsMap)=0;
++ virtual String ToArgString(LwpTableLayout* pCellsMap){ return ToString(pCellsMap);}
++};
++
++class LwpFormulaTools
++{
++public:
++ static String GetName(sal_uInt16 nTokenType);
++ static String GetCellAddr(sal_Int16 nRow, sal_Int16 nCol, LwpTableLayout* pCellsMap);
++};
++
++class LwpFormulaConst:public LwpFormulaArg
++{
++public:
++ LwpFormulaConst( double dVal);
++ virtual String ToString(LwpTableLayout* pCellsMap);
++private:
++ double m_dVal;
++};
++
++class LwpFormulaText:public LwpFormulaArg
++{
++public:
++ LwpFormulaText( String aText);
++ virtual String ToString(LwpTableLayout* pCellsMap){return m_aText;}
++private:
++ String m_aText;
++};
++
++class LwpFormulaCellAddr:public LwpFormulaArg
++{
++public:
++ LwpFormulaCellAddr(sal_Int16 aCol, sal_Int16 aRow);
++
++ sal_Int16 GetCol(){return m_aCol;}
++ sal_Int16 GetRow(){return m_aRow;}
++
++ virtual String ToString(LwpTableLayout* pCellsMap);
++private:
++ sal_Int16 m_aCol;
++ sal_Int16 m_aRow;
++};
++
++class LwpFormulaCellRangeAddr:public LwpFormulaArg
++{
++public:
++ LwpFormulaCellRangeAddr(sal_Int16 aStartCol, sal_Int16 aStartRow, sal_Int16 aEndCol, sal_Int16 aEndRow);
++
++ virtual String ToString(LwpTableLayout* pCellsMap);
++private:
++ sal_Int16 m_aStartCol;
++ sal_Int16 m_aStartRow;
++ sal_Int16 m_aEndCol;
++ sal_Int16 m_aEndRow;
++};
++
++class LwpFormulaFunc :public LwpFormulaArg
++{
++public:
++ LwpFormulaFunc(sal_uInt16 nTokenType);
++ virtual ~LwpFormulaFunc();
++
++ void AddArg(LwpFormulaArg* pArg);
++
++ virtual String ToString(LwpTableLayout* pCellsMap);
++ String ToArgString(LwpTableLayout* pCellsMap);
++
++protected:
++ vector<LwpFormulaArg*> m_aArgs;
++ sal_uInt16 m_nTokenType;
++};
++
++class LwpFormulaOp : public LwpFormulaFunc
++{
++public:
++ LwpFormulaOp(sal_uInt16 nTokenType):LwpFormulaFunc(nTokenType){;}
++ String ToString(LwpTableLayout* pCellsMap);
++};
++
++class LwpFormulaUnaryOp : public LwpFormulaFunc
++{
++public:
++ LwpFormulaUnaryOp(sal_uInt16 nTokenType):LwpFormulaFunc(nTokenType){;}
++ String ToString(LwpTableLayout* pCellsMap);
++};
++
++
++class LwpFormulaInfo : public LwpCellList
++{
++public:
++ LwpFormulaInfo(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpFormulaInfo();
++ sal_Bool IsFormula(){return sal_True;}
++ void SetRow(USHORT nRow){ m_nFormulaRow = nRow;}
++ String Convert(LwpTableLayout* pCellsMap);
++ void Convert(XFCell * pCell, LwpTableLayout* pCellsMap);
++protected:
++ void Read();
++ sal_Bool ReadCellID();
++ sal_Bool ReadText();
++ sal_Bool ReadCellRange();
++ sal_Bool ReadExpression();
++ sal_Bool ReadArguments(LwpFormulaFunc& aFunc);
++ sal_Bool m_bSupported;
++private:
++ vector<LwpFormulaArg*> m_aStack;
++ sal_Bool ReadConst();
++ void MarkUnsupported(sal_uInt16 TokenType);
++
++ USHORT m_nFormulaRow;
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwptemp.hxx lotuswordpro/source/filter/lwptemp.hxx
+--- lotuswordpro.bak/source/filter/lwptemp.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwptemp.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,80 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _LWPTEMPOBJ_HXX_
++#define _LWPTEMPOBJ_HXX_
++
++
++class LwpTempObject
++{
++// friend class LwpObjectFactory;
++public:
++ LwpTempObject(){};
++ ~LwpTempObject(){};
++
++/*protected:
++ LwpObjectHeader m_ObjHdr;
++ LwpObjectStream* m_pObjStrm;
++ LwpObjectStream m_TempObjStrm;
++ SvStream* m_pTempStrm;
++
++protected:
++ void QuickRead();
++ virtual void Read();
++public:
++ LwpObjectID* GetObjectID(){ return m_ObjHdr.GetID();}*/
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/lwptoc.cxx lotuswordpro/source/filter/lwptoc.cxx
+--- lotuswordpro.bak/source/filter/lwptoc.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwptoc.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,456 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**
++ * @file
++ * For LWP filter architecture prototype - TOC related object
++ */
++/*************************************************************************
++ * Change History
++ April 2005 Created
++ April 2005 Modified
++ April 2005 Modified - add LwpTocLevelData class
++ ************************************************************************/
++#include "lwptoc.hxx"
++#include "lwpfoundry.hxx"
++#include "lwpdoc.hxx"
++#include "lwpframelayout.hxx"
++#include "lwpglobalmgr.hxx"
++
++#include "xfilter/xffont.hxx"
++#include "xfilter/xftextstyle.hxx"
++#include "xfilter/xfstylemanager.hxx"
++#include "xfilter/xfparagraph.hxx"
++#include "xfilter/xfparastyle.hxx"
++#include "xfilter/xfindex.hxx"
++#include "xfilter/xffloatframe.hxx"
++#include "xfilter/xfframestyle.hxx"
++#include "xfilter/xfframe.hxx"
++#include "xfilter/xftable.hxx"
++
++LwpTocSuperLayout::LwpTocSuperLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
++ : LwpSuperTableLayout(objHdr, pStrm)
++{}
++
++LwpTocSuperLayout::~LwpTocSuperLayout()
++{}
++/**
++ * @short Read TOCSUPERTABLELAYOUT object
++ * @return none
++ */
++void LwpTocSuperLayout::Read()
++{
++ LwpSuperTableLayout::Read();
++ m_TextMarker.Read(m_pObjStrm);
++ m_ParentName.Read(m_pObjStrm);
++ m_DivisionName.Read(m_pObjStrm);
++ m_SectionName.Read(m_pObjStrm);
++ m_nFrom = m_pObjStrm->QuickReaduInt16();
++
++ m_SearchItems.Read(m_pObjStrm);
++
++ sal_uInt16 i;
++ sal_uInt16 count = m_pObjStrm->QuickReaduInt16();
++ for (i = 0; (i < MAX_LEVELS) && (count > 0); i++, count--)
++ m_DestName[i].Read(m_pObjStrm);
++
++ count = m_pObjStrm->QuickReaduInt16();
++ for (i = 0; (i < MAX_LEVELS) && (count > 0); i++, count--)
++ m_DestPGName[i].Read(m_pObjStrm);
++
++ count = m_pObjStrm->QuickReaduInt16();
++ for (i = 0; i < count; i++)
++ m_nFlags[i] = m_pObjStrm->QuickReaduInt32();
++
++ m_pObjStrm->SkipExtra();
++}
++/**
++ * @short Register style of TOC
++ * @return none
++ */
++void LwpTocSuperLayout::RegisterStyle()
++{
++ LwpSuperTableLayout::RegisterStyle();
++
++ // Get font info of default text style and set into tab style
++ XFParaStyle* pBaseStyle = static_cast<XFParaStyle*>(m_pFoundry->GetStyleManager()->GetStyle(*m_pFoundry->GetDefaultTextStyle()));
++ XFTextStyle*pTextStyle = new XFTextStyle;
++ pTextStyle->SetFont(pBaseStyle->GetFont()); // who delete this font?????
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_TabStyleName = pXFStyleManager->AddStyle(pTextStyle)->GetStyleName();
++
++}
++/**
++ * @short Convert TOC
++ * @param pCont - container
++ * @return none
++ */
++void LwpTocSuperLayout::XFConvert(XFContentContainer* pCont)
++{
++ XFIndex* pToc = new XFIndex();
++
++ pToc->SetProtected(sal_False);
++ pToc->SetIndexType(enumXFIndexTOC);
++
++ // add TOC template
++ for (sal_uInt16 i = 1; i<= MAX_LEVELS; i++)
++ {
++ LwpTocLevelData * pLevel = GetSearchLevelPtr(i);
++ XFIndexTemplate * pTemplate = new XFIndexTemplate();
++
++ if(!pLevel)
++ {
++ // add an blank template so that SODC won't add default style to this level
++ pToc->AddTemplate(Int32ToOUString(i), String::CreateFromAscii(""), pTemplate);
++ continue;
++ }
++
++ sal_Bool bInserted = sal_False;
++ do
++ {
++ // One level has 1 template
++ if (!bInserted)
++ {
++ pTemplate->SetLevel(Int32ToOUString(i));
++ if(pLevel->GetUseLeadingText())
++ {
++ pTemplate->AddEntry(enumXFIndexTemplateChapter, pLevel->GetSearchStyle());
++ }
++ if(pLevel->GetUseText())
++ {
++ pTemplate->AddEntry(enumXFIndexTemplateText, pLevel->GetSearchStyle());
++ }
++ if(GetUsePageNumber(i))
++ {
++ sal_uInt16 nLeaderType = GetSeparatorType(i);
++ if (GetRightAlignPageNumber(i))
++ {
++ char cSep = ' ';
++ switch(nLeaderType)
++ {
++ default: // go through
++ case NONE: // no leaders
++ cSep = ' ';
++ break;
++ case LEADERDOTS:
++ cSep = '.';
++ break;
++ case LEADERDASHES:
++ cSep = '-';
++ break;
++ case LEADERUNDERLINE:
++ cSep = '_';
++ break;
++ }
++
++ pTemplate->AddTabEntry(enumXFTabRight, 0, cSep, 'd', m_TabStyleName);
++ }
++ else
++ {
++ char sSep[8];
++ switch(nLeaderType)
++ {
++ default: // go through
++ case NONE: // no leaders
++ strcpy(sSep, " ");
++ break;
++ case SEPARATORCOMMA:
++ strcpy(sSep, ", ");
++ break;
++ case SEPARATORDOTS:
++ strcpy(sSep, "...");
++ break;
++ }
++ pTemplate->AddTextEntry(A2OUSTR(sSep), m_TabStyleName);
++ }
++ //"TOC Page Number Text Style" style always exists in Word Pro file
++ pTemplate->AddEntry(enumXFIndexTemplatePage, A2OUSTR("TOC Page Number Text Style"));
++ }
++
++ pToc->AddTemplate(Int16ToOUString(i), m_pFoundry->FindActuralStyleName(pLevel->GetSearchStyle()), pTemplate);
++ bInserted = sal_True;
++ }
++
++ // 1 style in WordPro may be mapped to several styles in SODC
++ LwpDocument * pDocument = m_pFoundry->GetDocument()->GetRootDocument();
++ AddSourceStyle(pToc, pLevel, pDocument->GetFoundry());
++
++ // one level may have several corresponding Styles
++ pLevel = GetNextSearchLevelPtr(i, pLevel); // find next LwpTocLevelData which is same index
++ }while (pLevel != NULL);
++ }
++
++ m_pCont = pCont;
++ // add TOC content
++ LwpSuperTableLayout::XFConvert(pToc);
++
++ // if current TOC is located in a cell, we must add a frame between upper level container and TOC
++ if ( !GetContainerLayout()->IsCell() )
++ {
++ pCont->Add(pToc);
++ }
++}
++
++/**
++ * @short convert frame which anchor to page
++ * @param pCont -
++ * @return
++ */
++void LwpTocSuperLayout::XFConvertFrame(XFContentContainer* pCont, sal_Int32 nStart , sal_Int32 nEnd , sal_Bool bAll)
++{
++ if(m_pFrame)
++ {
++ XFFrame* pXFFrame = NULL;
++ if(nEnd < nStart)
++ {
++ pXFFrame = new XFFrame();
++ }
++ else
++ {
++ pXFFrame = new XFFloatFrame(nStart, nEnd, bAll);
++ }
++
++ m_pFrame->Parse(pXFFrame, static_cast<sal_uInt16>(nStart));
++
++ //parse table, and add table to frame or TOC
++ LwpTableLayout * pTableLayout = GetTableLayout();
++ if (pTableLayout)
++ {
++ XFContentContainer * pTableContainer = pXFFrame;
++ // if *this is a TOCSuperTableLayout and it's located in a cell
++ // add the frame to upper level and add TOCSuperTableLayout into the frame
++ if ( GetContainerLayout()->IsCell() )
++ {
++ pTableContainer = pCont; // TOC contain table directly
++ pXFFrame->Add(pCont);
++ m_pCont->Add(pXFFrame);
++ }
++ else
++ {
++ //add frame to the container
++ pCont ->Add(pXFFrame);
++ }
++ pTableLayout->XFConvert(pTableContainer);
++ }
++ }
++
++}
++
++/**
++ * @short Add source style into TOC
++ * @param pToc - TOC pointer
++ * @param pLevel - TOC level data
++ * @param pFoundry - foundry pointer
++ * @return sal_Bool
++ */
++void LwpTocSuperLayout::AddSourceStyle(XFIndex* pToc, LwpTocLevelData * pLevel, LwpFoundry * pFoundry)
++{
++ if (!pLevel)
++ {
++ return;
++ }
++
++ OUString sLwpStyleName = pLevel->GetSearchStyle();
++
++ if (pFoundry)
++ {
++ LwpDocument * pDoc = pFoundry->GetDocument();
++ if (pDoc && pDoc->IsChildDoc())
++ {
++ OUString sSodcStyleName = pFoundry->FindActuralStyleName(sLwpStyleName);
++ pToc->AddTocSource(pLevel->GetLevel(), sSodcStyleName);
++ }
++ else
++ {
++ pDoc = pDoc->GetFirstDivision();
++ while (pDoc)
++ {
++ AddSourceStyle(pToc, pLevel, pDoc->GetFoundry() );
++ pDoc = pDoc->GetNextDivision();
++ }
++ }
++ }
++}
++
++/**
++ * @short Get whether page number is right alignment
++ * @param index - TOC level
++ * @return sal_Bool
++ */
++sal_Bool LwpTocSuperLayout::GetRightAlignPageNumber(sal_uInt16 index)
++{
++ if (index < MAX_LEVELS)
++ return (m_nFlags[index] & TS_RIGHTALIGN) ? sal_True : sal_False;
++ return sal_False;
++}
++/**
++ * @short Get whether page number is used in TOC entries
++ * @param index - TOC level
++ * @return sal_Bool
++ */
++sal_Bool LwpTocSuperLayout::GetUsePageNumber(sal_uInt16 index)
++{
++ if (index < MAX_LEVELS)
++ return (m_nFlags[index] & TS_PAGENUMBER) ? sal_True : sal_False;
++ return sal_False;
++}
++/**
++ * @short Get what is used for separater
++ * @param index - TOC level
++ * @return sal_uInt16 - separator type
++ */
++sal_uInt16 LwpTocSuperLayout::GetSeparatorType(sal_uInt16 index)
++{
++ sal_uInt16 Flag = (sal_uInt16)m_nFlags[index];
++
++ if (Flag & TS_LEADERDOTS)
++ return LEADERDOTS;
++ else if (Flag & TS_LEADERDASHES)
++ return LEADERDASHES;
++ else if (Flag & TS_LEADERUNDERLINE)
++ return LEADERUNDERLINE;
++ else if (Flag & TS_SEPARATORCOMMA)
++ return SEPARATORCOMMA;
++ else if (Flag & TS_SEPARATORDOTS)
++ return SEPARATORDOTS;
++ else
++ return NONE;
++}
++
++/**
++ * @short Get TOCLEVELDATA obj
++ * @param index - TOC level
++ * @return LwpTocLevelData * - pointer to TOCLEVELDATA obj
++ */
++LwpTocLevelData * LwpTocSuperLayout::GetSearchLevelPtr(sal_uInt16 index)
++{
++ LwpObjectID * pID = m_SearchItems.GetHead(); // not necessary to check pID NULL or not
++ LwpTocLevelData * pObj = static_cast<LwpTocLevelData *>(pID->obj());
++
++ while(pObj)
++ {
++ if(pObj->GetLevel()== index)
++ {
++ return pObj;
++ }
++
++ pID = pObj->GetNext(); // not necessary to check pID NULL or not
++ pObj = static_cast<LwpTocLevelData *>(pID->obj());
++ }
++
++ return NULL;
++}
++/**
++ * @short Get next TOCLEVELDATA obj from current position
++ * @param index - TOC level
++ * @param pCurData - current LwpTocLevelData
++ * @return LwpTocLevelData * - pointer to TOCLEVELDATA obj
++ */
++LwpTocLevelData * LwpTocSuperLayout::GetNextSearchLevelPtr(sal_uInt16 index, LwpTocLevelData * pCurData)
++{
++ LwpObjectID * pID = pCurData->GetNext();
++ LwpTocLevelData * pObj = static_cast<LwpTocLevelData *>(pID->obj());
++
++ while(pObj)
++ {
++ if(pObj->GetLevel()== index)
++ {
++ return pObj;
++ }
++
++ pID = pObj->GetNext(); // not necessary to check pID NULL or not
++ pObj = static_cast<LwpTocLevelData *>(pID->obj());
++ }
++
++ return NULL;
++}
++
++LwpTocLevelData::LwpTocLevelData(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpDLVList(objHdr, pStrm)
++{
++ m_nFlags = 0;
++ m_nLevel = 0;
++}
++LwpTocLevelData::~LwpTocLevelData()
++{
++}
++/**
++ * @short Register style
++ * @param
++ * @return
++ */
++void LwpTocLevelData::RegisterStyle()
++{
++}
++/**
++ * @short Convert
++ * @param pCont - container
++ * @return none
++ */
++void LwpTocLevelData::XFConvert(XFContentContainer* pCont)
++{
++}
++/**
++ * @short Read TOCLEVELDATA obj
++ * @param
++ * @return
++ */
++void LwpTocLevelData::Read()
++{
++ LwpDLVList::Read();
++ m_nFlags = m_pObjStrm->QuickReaduInt16();
++ m_nLevel = m_pObjStrm->QuickReaduInt16();
++ m_SearchName.Read(m_pObjStrm);
++
++ m_pObjStrm->SkipExtra();
++}
+diff -urNp lotuswordpro.bak/source/filter/lwptoc.hxx lotuswordpro/source/filter/lwptoc.hxx
+--- lotuswordpro.bak/source/filter/lwptoc.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwptoc.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,170 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++April 2005 Created
++ April 2005 Modified - add LwpTocLevelData class
++ ************************************************************************/
++
++#ifndef _LWPTOCSUPERTABLELAYOUT_HXX
++#define _LWPTOCSUPERTABLELAYOUT_HXX
++#include "lwptablelayout.hxx"
++class XFIndex;
++class LwpDocument;
++class LwpFoundry;
++class LwpTocLevelData;
++class XFIndex;
++class XFIndexTemplate;
++/**
++ * @brief
++ * VO_TOCSUPERTABLELAYOUT object
++ */
++class LwpTocSuperLayout : public LwpSuperTableLayout
++{
++public:
++ LwpTocSuperLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ virtual ~LwpTocSuperLayout();
++ void RegisterStyle();
++ virtual void XFConvert(XFContentContainer* pCont);
++ virtual LWP_LAYOUT_TYPE GetLayoutType () { return LWP_TOC_SUPERTABLE_LAYOUT;}
++ virtual void XFConvertFrame(XFContentContainer* pCont, sal_Int32 nStart = 0, sal_Int32 nEnd = 0, sal_Bool bAll = sal_False);
++protected:
++ void Read();
++ sal_Bool GetRightAlignPageNumber(sal_uInt16 index);
++ sal_Bool GetUsePageNumber(sal_uInt16 index);
++ sal_uInt16 GetSeparatorType(sal_uInt16 index);
++ LwpTocLevelData * GetSearchLevelPtr(sal_uInt16 index);
++ LwpTocLevelData * GetNextSearchLevelPtr(sal_uInt16 index, LwpTocLevelData * pCurData);
++ void AddSourceStyle(XFIndex* pToc, LwpTocLevelData * pLevel, LwpFoundry * pFoundry);
++private:
++ enum {MAX_LEVELS = 9};
++ enum
++ {
++ TS_NOLEADERS = 0x01,
++ TS_LEADERDOTS = 0x02,
++ TS_LEADERDASHES = 0x04,
++ TS_LEADERUNDERLINE = 0x08,
++ TS_SEPARATORCOMMA = 0x10,
++ TS_SEPARATORDOTS = 0x20,
++ TS_PAGENUMBER = 0x40,
++ TS_RIGHTALIGN = 0x80
++ };
++
++ enum
++ {
++ NONE = 0,
++ LEADERDOTS = 1,
++ LEADERDASHES = 2,
++ LEADERUNDERLINE = 3,
++ SEPARATORCOMMA = 4,
++ SEPARATORDOTS = 5
++ };
++
++ //m_nFrom
++ enum
++ {
++ SELECTEDTEXT = 1,
++ ENTIREDOCUMENT = 2,
++ CURRENTLEVELDIVISION = 3,
++ CURRENTDIVISION = 4,
++ CURRENTSECTION = 5
++ };
++
++ LwpAtomHolder m_TextMarker; /* for selected text */
++ LwpAtomHolder m_ParentName; /* for currentleveldivision */
++ LwpAtomHolder m_DivisionName; /* for currentdivision¤tsection */
++ LwpAtomHolder m_SectionName; /* for currentsection */
++ sal_uInt16 m_nFrom;
++ LwpDLVListHeadTail m_SearchItems;
++ LwpAtomHolder m_DestName[MAX_LEVELS];
++ LwpAtomHolder m_DestPGName[MAX_LEVELS];
++ sal_uInt32 m_nFlags[MAX_LEVELS];
++
++ std::vector<std::pair<OUString,OUString> > m_TOCList;
++
++ rtl::OUString m_TabStyleName;
++
++ XFContentContainer* m_pCont;
++};
++/**
++ * @brief
++ * VO_TOCLEVELDATA object
++ */
++class LwpTocLevelData : public LwpDLVList
++{
++public:
++ enum
++ {
++ USETEXT = 0x01,
++ USENUMBER = 0x02
++ };
++ LwpTocLevelData(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
++ ~LwpTocLevelData();
++ void RegisterStyle();
++ virtual void XFConvert(XFContentContainer* pCont);
++ inline sal_uInt16 GetLevel(void){return m_nLevel;};
++ inline sal_Bool GetUseText(void){ return (m_nFlags & USETEXT) ? sal_True : sal_False;};
++ inline OUString GetSearchStyle(void){return m_SearchName.str();};
++ inline sal_Bool GetUseLeadingText(void){ return (m_nFlags & USENUMBER) ? sal_True : sal_False;}
++private:
++ sal_uInt16 m_nFlags;
++ sal_uInt16 m_nLevel;
++ LwpAtomHolder m_SearchName;
++
++protected:
++ void Read();
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwptools.cxx lotuswordpro/source/filter/lwptools.cxx
+--- lotuswordpro.bak/source/filter/lwptools.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwptools.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,921 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwptools.hxx"
++#include <rtl/ustrbuf.hxx>
++#include <osl/process.h>
++#include <osl/thread.h>
++#include <osl/file.hxx>
++#include <vcl/svapp.hxx>
++#include <vcl/settings.hxx>
++#include <unicode/datefmt.h>
++#include <unicode/udat.h>
++
++#ifdef SAL_UNX
++#define SEPARATOR '/'
++#else
++#define SEPARATOR '\\'
++#endif
++
++using namespace icu;
++using namespace ::rtl;
++using namespace ::osl;
++
++/**
++ * @descr read lwp unicode string from stream to OUString per aEncoding
++*/
++sal_uInt16 LwpTools::QuickReadUnicode(LwpObjectStream* pObjStrm,
++ OUString& str, sal_uInt16 strlen, rtl_TextEncoding aEncoding)
++ //strlen: length of bytes
++{
++
++ sal_uInt16 readLen = 0;
++ OUStringBuffer strBuf(128);
++ sal_uInt16 len = 0;
++
++ if( !IsUnicodePacked(pObjStrm, strlen) )
++ {
++ sal_Char buf[1024];
++
++ while(strlen)
++ {
++ strlen>1023?len=1023 :len=strlen;
++ len = pObjStrm->QuickRead(buf, len);
++ buf[len] = '\0';
++ strBuf.append( OUString(buf, len, aEncoding) );
++ strlen -= len;
++ readLen += len;
++ if(!len) break;
++ }
++ str = strBuf.makeStringAndClear();
++ return readLen;
++ }
++ else
++ {
++ sal_Char buf[1024];
++ sal_Unicode unibuf[1024];
++ sal_uInt8 readbyte;
++ sal_uInt16 readword;
++
++ BOOL flag = sal_False; //switch if unicode part reached
++ sal_uInt16 sublen = 0;
++
++ while(readLen<strlen)
++ {
++ if(!flag) //Not unicode string
++ {
++ len = pObjStrm->QuickRead(&readbyte, sizeof(readbyte));
++ if(!len) break;
++ readLen+=len;
++
++ if(readbyte == 0x00)
++ {
++ flag = sal_True;
++ if(sublen>0) //add it to the strBuf
++ {
++ strBuf.append( OUString(buf, sublen, aEncoding) ); //try the aEncoding
++ sublen = 0;
++ }
++ }
++ else
++ {
++ buf[sublen++] = readbyte;
++ }
++ if(sublen>=1023 || readLen==strlen) //add it to the strBuf
++ {
++ strBuf.append( OUString(buf, sublen, aEncoding) ); //try the aEncoding
++ sublen = 0;
++ }
++ }
++ else //unicode string
++ {
++ len = pObjStrm->QuickRead(&readword, sizeof(readword));
++ if(!len) break;
++ readLen+=len;
++
++ if(readword == 0x0000)
++ {
++ flag = sal_False;
++ if(sublen)
++ {
++ unibuf[sublen] = sal_Unicode('\0');
++ strBuf.append( OUString(unibuf) );
++ sublen = 0;
++ }
++ }
++ else
++ {
++ unibuf[sublen++] = readword;
++ }
++ if(sublen>=1023 || readLen==strlen)
++ {
++ unibuf[sublen] = sal_Unicode('\0');
++ strBuf.append( OUString(unibuf) );
++ sublen = 0;
++ }
++ }
++ }
++// if(sublen)
++// {
++// unibuf[sublen] = sal_Unicode('\0');
++// strBuf.append( OUString(unibuf) );
++// sublen = 0;
++// }
++ str = strBuf.makeStringAndClear();
++ return readLen;
++ }
++}
++
++/**
++ * @descr Judge if the data (len) in object stream is lwp unicode packed
++*/
++BOOL LwpTools::IsUnicodePacked(LwpObjectStream* pObjStrm, sal_uInt16 len)
++{
++ sal_uInt8 byte;
++ sal_uInt16 oldpos = pObjStrm->GetPos();
++
++ for (sal_uInt16 i = 0; i < len; i++)
++ {
++ pObjStrm->QuickRead(&byte, sizeof(byte));
++ if (byte == 0x00)
++ {
++ pObjStrm->Seek(oldpos);
++ return sal_True;
++ }
++ }
++ pObjStrm->Seek(oldpos);
++ return sal_False;
++}
++
++sal_Bool LwpTools::isFileUrl(const OString &fileName)
++{
++ if (fileName.indexOf("file://") == 0 )
++ return sal_True;
++ return sal_False;
++}
++
++OUString LwpTools::convertToFileUrl(const OString &fileName)
++{
++ if ( isFileUrl(fileName) )
++ {
++ return OStringToOUString(fileName, osl_getThreadTextEncoding());
++ }
++
++ OUString uUrlFileName;
++ OUString uFileName(fileName.getStr(), fileName.getLength(), osl_getThreadTextEncoding());
++ if ( fileName.indexOf('.') == 0 || fileName.indexOf(SEPARATOR) < 0 )
++ {
++ OUString uWorkingDir;
++ OSL_VERIFY( osl_getProcessWorkingDir(&uWorkingDir.pData) == osl_Process_E_None );
++ OSL_VERIFY( FileBase::getAbsoluteFileURL(uWorkingDir, uFileName, uUrlFileName) == FileBase::E_None );
++ } else
++ {
++ OSL_VERIFY( FileBase::getFileURLFromSystemPath(uFileName, uUrlFileName) == FileBase::E_None );
++ }
++
++ return uUrlFileName;
++}
++
++OUString LwpTools::DateTimeToOUString(LtTm & dt)
++{
++ rtl::OUStringBuffer buf;
++ buf.append(dt.tm_year);
++ buf.append( A2OUSTR("-") );
++ buf.append(dt.tm_mon);
++ buf.append( A2OUSTR("-") );
++ buf.append(dt.tm_mday);
++ buf.append( A2OUSTR("T") );
++ buf.append(dt.tm_hour);
++ buf.append( A2OUSTR(":") );
++ buf.append(dt.tm_min);
++ buf.append( A2OUSTR(":") );
++ buf.append(dt.tm_sec);
++
++ return buf.makeStringAndClear();
++}
++
++/**
++ * @descr get the system date format
++*/
++XFDateStyle* LwpTools::GetSystemDateStyle(sal_Bool bLongFormat)
++{
++ icu::DateFormat::EStyle style;
++ if (bLongFormat)
++ style = icu::DateFormat::FULL;//system full date format
++ else
++ style = icu::DateFormat::SHORT;//system short date format
++/* ::com::sun::star::lang::Locale aLocale=Application::GetSettings().GetLocale();
++ rtl::OUString strLang = aLocale.Language;
++ rtl::OUString strCountry = aLocale.Country;
++ strLang = strLang + A2OUSTR("_");
++ rtl::OUString strLocale = strLang + strCountry;
++
++ int32_t nLength = 0;
++ int32_t nLengthNeed;
++ UErrorCode status = U_ZERO_ERROR;
++ UChar* pattern = NULL;
++
++ UDateFormat* fmt= udat_open(UDAT_FULL, UDAT_FULL,
++ (char*)(OUStringToOString(strLocale,RTL_TEXTENCODING_MS_1252).getStr()), NULL, 0, NULL, 0, &status);
++
++ nLengthNeed = udat_toPattern(fmt,true,NULL,nLength,&status);
++ if (status == U_BUFFER_OVERFLOW_ERROR)
++ {
++ status = U_ZERO_ERROR;
++ nLength = nLengthNeed +1;
++ pattern = (UChar*)malloc(sizeof(UChar)*nLength);
++ udat_toPattern(fmt,true,pattern,nLength,&status);
++ }
++*/
++ //1 get locale for system
++ ::com::sun::star::lang::Locale aLocale=Application::GetSettings().GetLocale();
++ rtl::OUString strLang = aLocale.Language;
++ rtl::OUString strCountry = aLocale.Country;
++ icu::Locale bLocale((char*)(OUStringToOString(strLang,RTL_TEXTENCODING_MS_1252).getStr()),
++ (char*)(OUStringToOString(strCountry,RTL_TEXTENCODING_MS_1252).getStr()));
++ //2 get icu format pattern by locale
++ icu::DateFormat* fmt = icu::DateFormat::createDateInstance(style,bLocale);
++
++ int32_t nLength = 0;
++ int32_t nLengthNeed;
++ UErrorCode status = U_ZERO_ERROR;
++ UChar* pattern = NULL;
++
++ nLengthNeed = udat_toPattern((void *const *)fmt,sal_False,NULL,nLength,&status);
++ if (status == U_BUFFER_OVERFLOW_ERROR)
++ {
++ status = U_ZERO_ERROR;
++ nLength = nLengthNeed +1;
++ pattern = (UChar*)malloc(sizeof(UChar)*nLength);
++ udat_toPattern((void *const *)fmt,sal_False,pattern,nLength,&status);
++ }
++ if (pattern == NULL)
++ return NULL;
++ // 3 parse pattern string,per icu date/time format syntax, there are 20 letters reserved
++ // as patter letter,each represent a element in date/time and its repeat numbers represent
++ // different format: for exampel: M produces '1',MM produces '01', MMM produces 'Jan', MMMM produces 'Januaray'
++ // letter other than these letters is regard as text in the format, for example ','in 'Jan,2005'
++ // we parse pattern string letter by letter and get the time format.
++ UChar cSymbol;
++ UChar cTmp;
++ XFDateStyle* pDateStyle = new XFDateStyle;
++
++ for (int32_t i=0;i<nLengthNeed;)
++ {
++ cSymbol = pattern[i];
++ int32_t j;
++ switch(cSymbol)
++ {
++ case 'G':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ pDateStyle->AddEra();
++ break;
++ }
++ case 'y':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ if (j <= 2)
++ pDateStyle->AddYear(sal_False);
++ else
++ pDateStyle->AddYear();
++ break;
++ }
++ case 'M':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ if (j==1)
++ pDateStyle->AddMonth(sal_False,sal_False);
++ else if (j==2)
++ pDateStyle->AddMonth(sal_True,sal_False);
++ else if (j==3)
++ pDateStyle->AddMonth(sal_False,sal_True);
++ else
++ pDateStyle->AddMonth(sal_True,sal_True);
++ break;
++ }
++ case 'd':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ if (j==1)
++ pDateStyle->AddMonthDay(sal_False);
++ else
++ pDateStyle->AddMonthDay();
++ break;
++ }
++ case 'h':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ if (j==1)
++ pDateStyle->AddHour(sal_False);
++ else
++ pDateStyle->AddHour();
++ break;
++ }
++ case 'H':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ if (j==1)
++ pDateStyle->AddHour(sal_False);
++ else
++ pDateStyle->AddHour();
++ break;
++ }
++ case 'm':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ if (j==1)
++ pDateStyle->AddMinute(sal_False);
++ else
++ pDateStyle->AddMinute();
++ break;
++ }
++ case 's':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ if (j==1)
++ pDateStyle->AddSecond(sal_False,0);
++ else
++ pDateStyle->AddSecond(sal_True,0);
++ break;
++ }
++ case 'S':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ /*if (j==1)
++ pDateStyle->AddSecond(sal_False);
++ else
++ pDateStyle->AddSecond();*/
++ break;
++ }
++ case 'E':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ if (j<=2)
++ pDateStyle->AddWeekDay(sal_False);
++ else
++ pDateStyle->AddWeekDay();
++ break;
++ }
++ case 'D':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ /*if (j==1)
++ pDateStyle->AddWeekDay(sal_False);
++ else
++ pDateStyle->AddWeekDay();*/
++ break;
++ }
++ case 'F':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ /*if (j==1)
++ pDateStyle->AddWeekDay(sal_False);
++ else
++ pDateStyle->AddWeekDay();*/
++ break;
++ }
++ case 'w':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ /*if (j==1)
++ pDateStyle->AddWeekDay(sal_False);
++ else
++ pDateStyle->AddWeekDay();*/
++ break;
++ }
++ case 'W':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ /*if (j==1)
++ pDateStyle->AddWeekDay(sal_False);
++ else
++ pDateStyle->AddWeekDay();*/
++ break;
++ }
++ case 'a':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ pDateStyle->AddAmPm(sal_True);
++ break;
++ }
++ case 'k':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ break;
++ }
++ case 'K':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ if (j==1)
++ pDateStyle->AddHour(sal_False);
++ else
++ pDateStyle->AddHour();
++ break;
++ }
++ case 'Z':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ break;
++ }
++ case '\''://'
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ break;
++ }
++ case '"':
++ {
++ pDateStyle->AddText(OUString(A2OUSTR("'")));
++ break;
++ }
++ default:
++ {
++ if ((cSymbol>='A' && cSymbol<='Z') || (cSymbol>='a' && cSymbol<='z') )
++ return NULL;
++ else//TEXT
++ {
++ //UChar buffer[1024];
++ sal_Unicode buffer[1024];
++ buffer[0] = cSymbol;
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if ((cTmp>='A' && cTmp<='Z') || (cTmp>='a' && cTmp<='z') ||
++ cTmp=='\'' || cTmp=='"' )
++ {
++ i=i+j;
++ buffer[j]= '\0';
++ break;
++ }
++ else
++ buffer[j] = cTmp;
++ }
++
++ pDateStyle->AddText(OUString(buffer));//keep for all parsed
++ }
++ break;
++ }
++ }
++ }
++// udat_close(fmt);
++ return pDateStyle;
++}
++/**
++ * @descr get the system time format
++*/
++XFTimeStyle* LwpTools::GetSystemTimeStyle()
++{
++/* ::com::sun::star::lang::Locale aLocale=Application::GetSettings().GetLocale();
++ rtl::OUString strLang = aLocale.Language;
++ rtl::OUString strCountry = aLocale.Country;
++ strLang = strLang + A2OUSTR("_");
++ rtl::OUString strLocale = strLang + strCountry;
++
++ int32_t nLength = 0;
++ int32_t nLengthNeed;
++ UErrorCode status = U_ZERO_ERROR;
++ UChar* pattern = NULL;
++
++ UDateFormat* fmt= udat_open(UDAT_FULL, UDAT_FULL,
++ (char*)(OUStringToOString(strLocale,RTL_TEXTENCODING_MS_1252).getStr()), NULL, 0, NULL, 0, &status);
++
++ nLengthNeed = udat_toPattern(fmt,true,NULL,nLength,&status);
++ if (status == U_BUFFER_OVERFLOW_ERROR)
++ {
++ status = U_ZERO_ERROR;
++ nLength = nLengthNeed +1;
++ pattern = (UChar*)malloc(sizeof(UChar)*nLength);
++ udat_toPattern(fmt,true,pattern,nLength,&status);
++ }
++*/
++ //1 get locale for system
++ ::com::sun::star::lang::Locale aLocale=Application::GetSettings().GetLocale();
++ rtl::OUString strLang = aLocale.Language;
++ rtl::OUString strCountry = aLocale.Country;
++ icu::Locale bLocale((char*)(OUStringToOString(strLang,RTL_TEXTENCODING_MS_1252).getStr()),
++ (char*)(OUStringToOString(strCountry,RTL_TEXTENCODING_MS_1252).getStr()));
++
++ icu::DateFormat* fmt = icu::DateFormat::createTimeInstance(icu::DateFormat::DEFAULT,bLocale);
++ //2 get icu format pattern by locale
++ int32_t nLength = 0;
++ int32_t nLengthNeed;
++ UErrorCode status = U_ZERO_ERROR;
++ UChar* pattern = NULL;
++ nLengthNeed = udat_toPattern((void *const *)fmt,false,NULL,nLength,&status);
++ if (status == U_BUFFER_OVERFLOW_ERROR)
++ {
++ status = U_ZERO_ERROR;
++ nLength = nLengthNeed +1;
++ pattern = (UChar*)malloc(sizeof(UChar)*nLength);
++ udat_toPattern((void *const *)fmt,false,pattern,nLength,&status);
++ }
++
++ if (pattern == NULL)
++ return NULL;
++ // 3 parse pattern string,per icu date/time format syntax, there are 20 letters reserved
++ // as patter letter,each represent a element in date/time and its repeat numbers represent
++ // different format: for exampel: M produces '1',MM produces '01', MMM produces 'Jan', MMMM produces 'Januaray'
++ // letter other than these letters is regard as text in the format, for example ','in 'Jan,2005'
++ // we parse pattern string letter by letter and get the time format.
++ // for time format ,for there is not date info,we can only parse the letter representing time.
++ UChar cSymbol;
++ UChar cTmp;
++ XFTimeStyle* pTimeStyle = new XFTimeStyle;
++
++ for (int32_t i=0;i<nLengthNeed;)
++ {
++ cSymbol = pattern[i];
++ int32_t j;
++ switch(cSymbol)
++ {
++ case 'h':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ if (j==1)
++ pTimeStyle->AddHour(sal_False);
++ else
++ pTimeStyle->AddHour();
++ break;
++ }
++ case 'H':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ if (j==1)
++ pTimeStyle->AddHour(sal_False);
++ else
++ pTimeStyle->AddHour();
++ break;
++ }
++ case 'm':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ if (j==1)
++ pTimeStyle->AddMinute(sal_False);
++ else
++ pTimeStyle->AddMinute();
++ break;
++ }
++ case 's':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ if (j==1)
++ pTimeStyle->AddSecond(sal_False,0);
++ else
++ pTimeStyle->AddSecond(sal_True,0);
++ break;
++ }
++ case 'S':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ /*if (j==1)
++ pDateStyle->AddSecond(sal_False);
++ else
++ pDateStyle->AddSecond();*/
++ break;
++ }
++ case 'a':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ pTimeStyle->SetAmPm(sal_True);
++ break;
++ }
++ case 'k':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ break;
++ }
++ case 'K':
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ if (j==1)
++ pTimeStyle->AddHour(sal_False);
++ else
++ pTimeStyle->AddHour();
++ break;
++ }
++ case '\''://'
++ {
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if (cTmp != cSymbol)
++ {
++ i=i+j;
++ break;
++ }
++ }
++ break;
++ }
++ case '"':
++ {
++ pTimeStyle->AddText(OUString(A2OUSTR("'")));
++ break;
++ }
++ default:
++ {
++ if ((cSymbol>='A' && cSymbol<='Z') || (cSymbol>='a' && cSymbol<='z') )
++ return NULL;
++ else//TEXT
++ {
++ sal_Unicode buffer[1024];
++ buffer[0] = cSymbol;
++ //strBuffer.append(cSymbol);
++ for (j=1;;j++)
++ {
++ cTmp = pattern[i+j];
++ if ((cTmp>='A' && cTmp<='Z') || (cTmp>='a' && cTmp<='z') ||
++ cTmp=='\'' || cTmp=='"' )
++ {
++ i=i+j;
++ buffer[j]= '\0';
++ break;
++ }
++ else
++ buffer[j] = cTmp;
++ }
++ pTimeStyle->AddText(OUString(buffer));//keep for all parsed
++ }
++ break;
++ }
++ }
++ }
++// udat_close(fmt);
++ return pTimeStyle;
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwptools.hxx lotuswordpro/source/filter/lwptools.hxx
+--- lotuswordpro.bak/source/filter/lwptools.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwptools.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,149 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * to provide basic utilities for word pro filter
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPTOOLS_HXX
++#define _LWPTOOLS_HXX
++
++#include "lwpheader.hxx"
++#include "lwpobjstrm.hxx"
++#include "localtime.hxx"
++#include "xfilter/xfdatestyle.hxx"
++#include "xfilter/xftimestyle.hxx"
++#include <rtl/textenc.h>
++
++// 01/19/2005
++const sal_uInt32 UNITS_PER_INCH = 65536L * 72L;
++const double CM_PER_INCH = 2.54;
++const double INCHT_PER_CM = (1.0 / CM_PER_INCH);
++//end
++
++const double POINTS_PER_INCH = 72.27;
++const double TWIPS_PER_POINT = 20.0;
++const double TWIPS_PER_INCH = (TWIPS_PER_POINT * POINTS_PER_INCH);
++const double TWIPS_PER_CM = (TWIPS_PER_INCH/CM_PER_INCH);
++/**
++ * @brief tool class (unicode, conversion) for lwp filter.
++*/
++class LwpTools
++{
++
++public:
++ static sal_uInt16 QuickReadUnicode( LwpObjectStream* pObjStrm,
++ OUString& str, sal_uInt16 strlen, rtl_TextEncoding aEncoding );
++ static BOOL IsUnicodePacked(LwpObjectStream* pObjStrm, sal_uInt16 len);
++
++ // 01/19/2005
++ inline static double ConvertFromUnits(const sal_Int32& nUnits);
++ inline static double ConvertToMetric(const double& fInch);
++ inline static double ConvertFromMetric(const double& fCM);
++ inline static double ConvertFromUnitsToMetric(const sal_Int32& nUnits);
++ //end
++
++ //add by , 03/11/2005
++ inline static sal_Int32 ConvertToUnits(const double& fInch);
++ //add end
++
++ //, 02/23/2005
++ inline static sal_Bool IsOddNumber(sal_uInt16& nNumber);
++ inline static sal_Bool IsEvenNumber(sal_uInt16& nNumber);
++
++ static sal_Bool isFileUrl(const OString& fileName);
++ static OUString convertToFileUrl(const OString& fileName);
++ static rtl::OUString DateTimeToOUString(LtTm& dt);
++
++ //add by ,2005/6/1
++ static XFDateStyle* GetSystemDateStyle(sal_Bool bLongFormat);
++ static XFTimeStyle* GetSystemTimeStyle();
++};
++
++inline double LwpTools::ConvertFromUnits(const sal_Int32& nUnits)
++{
++ return (double)nUnits/UNITS_PER_INCH;
++}
++inline double LwpTools::ConvertToMetric(const double& fInch)
++{
++ return fInch*CM_PER_INCH;
++}
++inline double LwpTools::ConvertFromMetric(const double& fCM)
++{
++ return fCM/CM_PER_INCH;
++}
++inline double LwpTools::ConvertFromUnitsToMetric(const sal_Int32& nUnits)
++{
++ double fInch = ConvertFromUnits(nUnits);
++ return ConvertToMetric(fInch);
++}
++inline sal_Int32 LwpTools::ConvertToUnits(const double& fInch)
++{
++ return (sal_Int32)fInch*UNITS_PER_INCH;
++}
++inline sal_Bool LwpTools::IsOddNumber(sal_uInt16& nNumber)
++{
++ return nNumber%2? sal_True : sal_False;
++}
++inline sal_Bool LwpTools::IsEvenNumber(sal_uInt16& nNumber)
++{
++ return nNumber%2? sal_False : sal_True;
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpuidoc.cxx lotuswordpro/source/filter/lwpuidoc.cxx
+--- lotuswordpro.bak/source/filter/lwpuidoc.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpuidoc.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,140 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpuidoc.hxx"
++
++LwpUIDocument::LwpUIDocument()
++ : m_nFlags(DOC_LOCKED)
++{}
++
++
++LwpUIDocument::LwpUIDocument(LwpObjectStream *pStrm)
++ : m_nFlags(DOC_LOCKED)
++{
++ Read(pStrm);
++}
++
++LwpUIDocument::~LwpUIDocument()
++{};
++
++void LwpUIDocument::Read(LwpObjectStream *pStrm)
++{
++ m_NamedProps.Read(pStrm);
++ m_ARMacroOpts.Read(pStrm);
++ m_MergedOpts.Read(pStrm);
++ m_SheetFullPath.ReadPathAtom(pStrm);
++
++ sal_uInt16 saved_flags;
++ pStrm->QuickRead(&saved_flags, sizeof(saved_flags));
++ m_nFlags |= saved_flags;
++
++ if(pStrm->CheckExtra())
++ {
++ m_InitialSaveAsType.Read(pStrm);
++ pStrm->SkipExtra();
++ }
++}
++/**
++ * @descr Read macro options from object stream
++ **/
++void LwpNamedProperties::Read(LwpObjectStream *pStrm)
++{
++ sal_uInt16 numEntries;
++ pStrm->QuickRead(&numEntries, sizeof(numEntries));
++
++ for (sal_uInt16 k = 0 ; k < numEntries; k++)
++ {
++ assert(false);
++ // TODO: Read each NamedProperties
++ }
++ pStrm->SkipExtra();
++}
++/**
++ * @descr Read macro options from object stream
++ **/
++void LwpAutoRunMacroOptions::Read(LwpObjectStream *pStrm)
++{
++ m_OpenName.ReadPathAtom(pStrm);
++ m_CloseName.ReadPathAtom(pStrm);
++ m_NewName.ReadPathAtom(pStrm);
++ pStrm->QuickRead(&m_OptionFlag, sizeof(m_OptionFlag));
++ pStrm->SkipExtra();
++}
++/**
++ * @descr Read merge options from object stream
++ **/
++void LwpMergeOptions::Read(LwpObjectStream *pStrm)
++{
++ m_RecordFile.ReadPathAtom(pStrm);
++ m_DescriptionFile.ReadPathAtom(pStrm);
++ m_Filter.Read(pStrm);
++ pStrm->QuickRead(&m_nType, sizeof(m_nType));
++
++ //Does not process m_nType here. Assume m_nType is 0.
++ // TODO: Read the CMergeDataFile
++ assert(m_nType==0);
++
++ pStrm->QuickRead(&m_nLastActionFlag, sizeof(m_nLastActionFlag));
++ pStrm->SkipExtra();
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpuidoc.hxx lotuswordpro/source/filter/lwpuidoc.hxx
+--- lotuswordpro.bak/source/filter/lwpuidoc.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpuidoc.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,154 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * all classes for LwpUIDocument
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++#ifndef _LWPUIDOCUMENT_HXX
++#define _LWPUIDOCUMENT_HXX
++
++#include "lwpheader.hxx"
++#include "lwpdefs.hxx"
++
++class LwpNamedProperties;
++class LwpAutoRunMacroOptions;
++class LwpMergeOptions;
++
++#include "lwpobjstrm.hxx"
++#include "lwpatomholder.hxx"
++/**
++ * @brief Properties in UIDocument structure
++ * not parsed yet
++*/
++class LwpNamedProperties
++{
++public:
++ LwpNamedProperties(){};
++ ~LwpNamedProperties(){};
++public:
++ void Read(LwpObjectStream *pStrm);
++};
++/**
++ * @brief macro options contained in UIDocument structure
++ * not parsed yet
++*/
++class LwpAutoRunMacroOptions
++{
++public:
++ LwpAutoRunMacroOptions(){};
++ ~LwpAutoRunMacroOptions(){};
++private:
++ LwpAtomHolder m_OpenName;
++ LwpAtomHolder m_CloseName;
++ LwpAtomHolder m_NewName;
++ sal_uInt16 m_OptionFlag;
++public:
++ void Read(LwpObjectStream *pStrm);
++};
++/**
++ * @brief Merget options contained in UIDocument structure
++ * not parsed yet
++*/
++class LwpMergeOptions
++{
++public:
++ LwpMergeOptions(){};
++ ~LwpMergeOptions(){};
++private:
++ LwpAtomHolder m_RecordFile;
++ LwpAtomHolder m_DescriptionFile;
++ LwpAtomHolder m_Filter;
++ sal_uInt16 m_nType;
++ sal_uInt16 m_nLastActionFlag; // flag remembers last merge action
++public:
++ void Read(LwpObjectStream *pStrm);
++};
++/**
++ * @brief UIDocument structure contained in VO_DOCUMENT
++ * not parsed yet
++*/
++class LwpUIDocument
++{
++public:
++ LwpUIDocument();
++ LwpUIDocument(LwpObjectStream *pStrm);
++ ~LwpUIDocument();
++private:
++ LwpNamedProperties m_NamedProps;
++ LwpAutoRunMacroOptions m_ARMacroOpts;
++ LwpMergeOptions m_MergedOpts;
++ LwpAtomHolder m_SheetFullPath; // full path for style sheet
++ sal_uInt16 m_nFlags;
++ LwpAtomHolder m_InitialSaveAsType;
++ enum
++ {
++ DOC_READONLY = 0x01,
++ DOC_BLOCKSETS = 0x02,
++ DOC_LOCKED = 0x04,
++ DOC_ENVELOPE = 0x08,
++ DOC_EXTERNALFILE = 0x10,
++ DOC_SANITYCHECK = 0x20,
++ DOC_ANNOTATEONLY = 0x40,
++ DOC_CANCELED = 0x80
++ };
++public:
++ void Read(LwpObjectStream *pStrm);
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpunoheader.hxx lotuswordpro/source/filter/lwpunoheader.hxx
+--- lotuswordpro.bak/source/filter/lwpunoheader.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpunoheader.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,85 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include <cppuhelper/implbase1.hxx>
++#include <cppuhelper/implbase3.hxx>
++#include <cppuhelper/factory.hxx>
++#include <com/sun/star/document/XFilter.hpp>
++#include <com/sun/star/document/XImporter.hpp>
++#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
++#include <com/sun/star/lang/XServiceInfo.hpp>
++#include <com/sun/star/io/XInputStream.hpp>
++#include <com/sun/star/io/XSeekable.hpp>
++
++#include "xfilter/xfglobal.hxx"
++
++using namespace ::rtl;
++using namespace ::cppu;
++using namespace ::com::sun::star::lang;
++using namespace ::com::sun::star::io;
++using namespace ::com::sun::star::registry;
++using namespace ::com::sun::star::document;
++using namespace ::com::sun::star::beans;
++using namespace ::com::sun::star::xml::sax;
++using namespace ::com::sun::star::uno;
++
+diff -urNp lotuswordpro.bak/source/filter/lwpusewhen.hxx lotuswordpro/source/filter/lwpusewhen.hxx
+--- lotuswordpro.bak/source/filter/lwpusewhen.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpusewhen.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,176 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPUSEWHEN_HXX
++#define _LWPUSEWHEN_HXX
++
++#include "lwpheader.hxx"
++
++#define STYLE_USEONALLPAGES 0x0001U /* repeat on all pages */
++#define STYLE_USEONALLEVENPAGES 0x0002U /* repeat on all even pages */
++#define STYLE_USEONALLODDPAGES 0x0004U /* repeat on all odd pages */
++#define STYLE_USEONTHISPAGE 0x0008U /* use this guy on this page */
++#define STYLE_USEEXCEPTTHISPAGE 0x0010U /* use guy except on this page */
++#define STYLE_USESTARTINGONPAGE 0x0020U /* use starting on page n */
++#define STYLE_USEONMASK (STYLE_USEONALLPAGES | \
++ STYLE_USEONALLEVENPAGES | \
++ STYLE_USEONALLODDPAGES | \
++ STYLE_USEONTHISPAGE | \
++ STYLE_USEEXCEPTTHISPAGE | \
++ STYLE_USESTARTINGONPAGE)
++
++#define STYLE_STARTONNEXTPAGE 0x0000U // This is the default
++#define STYLE_STARTONTHISPAGE 0x0040U
++#define STYLE_STARTONNEXTODD 0x0080U
++#define STYLE_STARTONNEXTEVEN 0x0100U
++#define STYLE_STARTONTHISHF 0x0200U
++#define STYLE_STARTONMASK (STYLE_STARTONTHISPAGE | \
++ STYLE_STARTONNEXTODD | \
++ STYLE_STARTONNEXTEVEN | \
++ STYLE_STARTONTHISHF)
++class LwpUseWhen
++{
++public:
++ LwpUseWhen() : m_nFlags(0), m_nUsePage(0) {}
++
++ inline void Read(LwpObjectStream* pStrm);
++
++ inline sal_Bool IsUseOnAllPages();
++
++ inline sal_Bool IsUseOnAllEvenPages();
++
++ inline sal_Bool IsUseOnAllOddPages();
++
++ inline sal_Bool IsUseOnPage();
++
++ inline sal_Bool IsStartOnThisPage();
++
++ inline sal_Bool IsStartOnNextPage();
++
++ inline sal_Bool IsStartOnNextEvenPage();
++
++ inline sal_Bool IsStartOnNextOddPage();
++
++ inline sal_Bool IsStartOnThisHF();
++
++ inline sal_uInt16 GetUsePage();
++private:
++ sal_uInt16 m_nFlags;
++ sal_uInt16 m_nUsePage;
++};
++
++inline void LwpUseWhen::Read(LwpObjectStream* pStrm)
++{
++ pStrm->QuickRead(&m_nFlags, 2);
++ pStrm->QuickRead(&m_nUsePage, 2);
++ pStrm->SkipExtra();
++}
++inline sal_Bool LwpUseWhen::IsUseOnAllPages()
++{
++ return (sal_Bool)((m_nFlags & STYLE_USEONALLPAGES) != 0);
++}
++inline sal_Bool LwpUseWhen::IsUseOnAllEvenPages()
++{
++ return (sal_Bool)((m_nFlags & STYLE_USEONALLEVENPAGES) != 0);
++}
++inline sal_Bool LwpUseWhen::IsUseOnAllOddPages()
++{
++ return (sal_Bool)((m_nFlags & STYLE_USEONALLODDPAGES) != 0);
++}
++
++inline sal_Bool LwpUseWhen::IsUseOnPage()
++{
++ return (sal_Bool)((m_nFlags & STYLE_USEONTHISPAGE) != 0);
++}
++
++inline sal_Bool LwpUseWhen::IsStartOnThisPage()
++{
++ return (sal_Bool)((m_nFlags & STYLE_STARTONTHISPAGE) != 0);
++}
++
++inline sal_Bool LwpUseWhen::IsStartOnNextPage()
++{
++ return (sal_Bool)((m_nFlags & STYLE_STARTONMASK) == 0);
++}
++
++inline sal_Bool LwpUseWhen::IsStartOnNextOddPage()
++{
++ return (sal_Bool)((m_nFlags & STYLE_STARTONNEXTODD) != 0);
++}
++
++inline sal_Bool LwpUseWhen::IsStartOnNextEvenPage()
++{
++ return (sal_Bool)((m_nFlags & STYLE_STARTONNEXTEVEN) != 0);
++}
++
++inline sal_Bool LwpUseWhen::IsStartOnThisHF()
++{
++ return (sal_Bool)((m_nFlags & STYLE_STARTONTHISHF) != 0);
++}
++
++inline sal_uInt16 LwpUseWhen::GetUsePage()
++{
++ return m_nUsePage;
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpusrdicts.cxx lotuswordpro/source/filter/lwpusrdicts.cxx
+--- lotuswordpro.bak/source/filter/lwpusrdicts.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpusrdicts.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,86 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#include "lwpusrdicts.hxx"
++#include "lwpatomholder.hxx"
++LwpUserDictFiles::LwpUserDictFiles(LwpObjectStream *pStrm)
++{
++ Read(pStrm);
++}
++/**
++ * @descr Read UserDictFiles in VO_DOCUMENT
++ * words are skipped, not parsed yet
++ **/
++void LwpUserDictFiles::Read(LwpObjectStream *pStrm)
++{
++ sal_uInt16 cnt;
++ pStrm->QuickRead(&cnt, sizeof(cnt));
++ LwpAtomHolder word;
++ while(cnt--)
++ {
++ word.Read(pStrm);
++ pStrm->SkipExtra();
++ }
++ pStrm->SkipExtra();
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpusrdicts.hxx lotuswordpro/source/filter/lwpusrdicts.hxx
+--- lotuswordpro.bak/source/filter/lwpusrdicts.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpusrdicts.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,80 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jan 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPUSERDICTFILES_HXX
++#define _LWPUSERDICTFILES_HXX
++
++#include "lwpheader.hxx"
++#include "lwpobjstrm.hxx"
++/**
++ * @brief User defined words used in VO_DOCUMENT
++*/
++class LwpUserDictFiles
++{
++public:
++ LwpUserDictFiles(){};
++ LwpUserDictFiles(LwpObjectStream *pStrm);
++ ~LwpUserDictFiles(){};
++ void Read(LwpObjectStream *pStrm);
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/lwpverdocument.cxx lotuswordpro/source/filter/lwpverdocument.cxx
+--- lotuswordpro.bak/source/filter/lwpverdocument.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpverdocument.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,109 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Versioned Pointer object, used for VO_VEGTR and VO_QTR
++ * Does not find the difference between CVersionedQointer and
++ * CVersionedGointer, so use one class
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++Jun 2005 Created
++ ************************************************************************/
++#include "lwpglobalmgr.hxx"
++#include "lwpverdocument.hxx"
++#include "lwplnopts.hxx"
++#include "lwpproplist.hxx"
++#include "xfilter/xfparastyle.hxx"
++#include "lwptools.hxx"
++
++LwpVerDocument::LwpVerDocument(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpObject(objHdr, pStrm)
++{}
++
++void LwpVerDocument::Read()
++{
++ m_nTabSpacing = m_pObjStrm->QuickReaduInt32();
++
++ if (m_pObjStrm->CheckExtra())
++ {
++ LwpLineNumberOptions aLineNumberOptions(m_pObjStrm);
++
++ if (m_pObjStrm->CheckExtra())
++ {
++ LwpPropList aPropList;
++ aPropList.Read(m_pObjStrm);
++ m_pObjStrm->SkipExtra();
++ }
++ }
++}
++
++void LwpVerDocument::RegisterStyle()
++{
++ XFDefaultParaStyle* pDefault = new XFDefaultParaStyle;
++ double len =(double) m_nTabSpacing/UNITS_PER_INCH*CM_PER_INCH;
++ if(len < 0.001)
++ {
++ len = 1.27; //0.5 inch
++ }
++ pDefault->SetTabDistance(len);
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ pXFStyleManager->AddStyle(pDefault);
++}
++
++sal_uInt32 LwpVerDocument::GetTabSpacing()
++{
++ return m_nTabSpacing;
++}
+diff -urNp lotuswordpro.bak/source/filter/lwpverdocument.hxx lotuswordpro/source/filter/lwpverdocument.hxx
+--- lotuswordpro.bak/source/filter/lwpverdocument.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpverdocument.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,86 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Versioned Pointer object, used for VO_VEGTR and VO_QTR
++ * Does not find the difference between CVersionedQointer and
++ * CVersionedGointer, so use one class
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++Jun 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPVERDOCUMENT_HXX_
++#define _LWPVERDOCUMENT_HXX_
++
++#include "lwpobj.hxx"
++
++/*VO_VERDOCUMENT*/
++
++class LwpVerDocument : public LwpObject
++{
++public:
++ LwpVerDocument(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ ~LwpVerDocument(){};
++ void Read();
++ virtual void RegisterStyle();
++ sal_uInt32 GetTabSpacing();
++private:
++ sal_uInt32 m_nTabSpacing;
++};
++#endif
++
++
+diff -urNp lotuswordpro.bak/source/filter/lwpvpointer.cxx lotuswordpro/source/filter/lwpvpointer.cxx
+--- lotuswordpro.bak/source/filter/lwpvpointer.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpvpointer.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,80 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "lwpvpointer.hxx"
++#include "lwpfilehdr.hxx"
++
++LwpVersionedPointer::LwpVersionedPointer(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
++ : LwpObject(objHdr, pStrm)
++{}
++
++void LwpVersionedPointer::Read()
++{
++ m_PointerID.ReadIndexed(m_pObjStrm);
++ if( LwpFileHeader::m_nFileRevision < 0x0006 )
++ m_pObjStrm->SkipExtra();
++}
++void LwpVersionedPointer::Parse(IXFStream* pOutputStream)
++{}
++
++void LwpVersionedPointer::RegisterStyle()
++{
++ LwpObject* pObj = m_PointerID.obj();
++ if( pObj )
++ {
++ pObj->SetFoundry(m_pFoundry);
++ pObj->RegisterStyle();
++ }
++}
++
+diff -urNp lotuswordpro.bak/source/filter/lwpvpointer.hxx lotuswordpro/source/filter/lwpvpointer.hxx
+--- lotuswordpro.bak/source/filter/lwpvpointer.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/lwpvpointer.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,82 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Versioned Pointer object, used for VO_VEGTR and VO_QTR
++ * Does not find the difference between CVersionedQointer and
++ * CVersionedGointer, so use one class
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++March 2005 Created
++ ************************************************************************/
++
++#ifndef _LWPVERSIONEDPOINTER_HXX_
++#define _LWPVERSIONEDPOINTER_HXX_
++
++#include "lwpobj.hxx"
++class LwpVersionedPointer : public LwpObject
++{
++public:
++ LwpVersionedPointer(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
++ ~LwpVersionedPointer(){};
++ void Read();
++ void RegisterStyle();
++ void Parse(IXFStream* pOutputStream);
++ LwpObjectID* GetPointer(){return &m_PointerID;};
++protected:
++ LwpObjectID m_PointerID;
++};
++#endif
+diff -urNp lotuswordpro.bak/source/filter/schxmlwrapper.cxx lotuswordpro/source/filter/schxmlwrapper.cxx
+--- lotuswordpro.bak/source/filter/schxmlwrapper.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/schxmlwrapper.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,489 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++
++#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HXX_
++#include <com/sun/star/beans/PropertyAttribute.hpp>
++#endif
++#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATORSUPPLIER_HPP_
++#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
++#endif
++#ifndef _COM_SUN_STAR_DOCUMENT_XIMPORTER_HPP_
++#include <com/sun/star/document/XImporter.hpp>
++#endif
++#ifndef _COM_SUN_STAR_DOCUMENT_XFILTER_HPP_
++#include <com/sun/star/document/XFilter.hpp>
++#endif
++#ifndef _COM_SUN_STAR_DOCUMENT_XExporter_HPP_
++#include <com/sun/star/document/XExporter.hpp>
++#endif
++
++#ifndef _SFXDOCFILE_HXX
++#include <sfx2/docfile.hxx>
++#endif
++#ifndef _SFXECODE_HXX
++#include <svtools/sfxecode.hxx>
++#endif
++
++#include "schxmlwrapper.hxx"
++
++#ifndef _UTL_STREAM_WRAPPER_HXX_
++#include <unotools/streamwrap.hxx>
++#endif
++#ifndef _XMLGRHLP_HXX
++#include <svx/xmlgrhlp.hxx>
++#endif
++#ifndef _TOOLS_DEBUG_HXX
++#include <tools/debug.hxx>
++#endif
++#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
++#include <comphelper/processfactory.hxx>
++#endif
++
++#ifndef _COMPHELPER_GENERICPROPERTYSET_HXX_
++#include <comphelper/genericpropertyset.hxx>
++#endif
++#ifndef _COMPHELPER_PROPERTSETINFO_HXX_
++#include <comphelper/propertysetinfo.hxx>
++#endif
++
++#ifndef INCLUDED_SVTOOLS_SAVEOPT_HXX
++#include <svtools/saveopt.hxx>
++#endif
++
++#ifndef _COM_SUN_STAR_XML_SAX_XERRORHANDLER_HPP_
++#include <com/sun/star/xml/sax/XErrorHandler.hpp>
++#endif
++#ifndef _COM_SUN_STAR_XML_SAX_XENTITYRESOLVER_HPP_
++#include <com/sun/star/xml/sax/XEntityResolver.hpp>
++#endif
++#ifndef _COM_SUN_STAR_XML_SAX_INPUTSOURCE_HPP_
++#include <com/sun/star/xml/sax/InputSource.hpp>
++#endif
++#ifndef _COM_SUN_STAR_XML_SAX_XDTDHANDLER_HPP_
++#include <com/sun/star/xml/sax/XDTDHandler.hpp>
++#endif
++#ifndef _COM_SUN_STAR_XML_SAX_XPARSER_HPP_
++#include <com/sun/star/xml/sax/XParser.hpp>
++#endif
++#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HPP_
++#include <com/sun/star/io/XActiveDataSource.hpp>
++#endif
++#ifndef _COM_SUN_STAR_IO_XACTIVEDATACONTROL_HPP_
++#include <com/sun/star/io/XActiveDataControl.hpp>
++#endif
++#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
++#include <com/sun/star/lang/XMultiServiceFactory.hpp>
++#endif
++#ifndef _COM_SUN_STAR_XML_SAX_SAXPARSEEXCEPTION_HPP_
++#include <com/sun/star/xml/sax/SAXParseException.hpp>
++#endif
++#ifndef _COM_SUN_STAR_PACKAGES_ZIP_ZIPIOEXCEPTION_HPP_
++#include <com/sun/star/packages/zip/ZipIOException.hpp>
++#endif
++
++#define XML_STRING(i, x) sal_Char __READONLY_DATA i[sizeof(x)] = x
++#define MAP_LEN(x) x, sizeof(x) - 1
++
++XML_STRING( sXML_metaStreamName, "meta.xml");
++XML_STRING( sXML_styleStreamName, "styles.xml" );
++XML_STRING( sXML_contentStreamName, "content.xml" );
++XML_STRING( sXML_oldContentStreamName, "Content.xml" );
++
++XML_STRING( sXML_export_chart_meta_service, "com.sun.star.comp.Chart.XMLMetaExporter" );
++XML_STRING( sXML_export_chart_styles_service, "com.sun.star.comp.Chart.XMLStylesExporter" );
++XML_STRING( sXML_export_chart_content_service, "com.sun.star.comp.Chart.XMLContentExporter" );
++XML_STRING( sXML_export_chart_old_content_service, "com.sun.star.office.sax.exporter.Chart" );
++
++XML_STRING( sXML_export_chart_allinone_service, "com.sun.star.comp.Chart.XMLExporter" );
++
++
++
++XML_STRING( sXML_import_chart_meta_service, "com.sun.star.comp.Chart.XMLMetaImporter" );
++XML_STRING( sXML_import_chart_styles_service, "com.sun.star.comp.Chart.XMLStylesImporter" );
++XML_STRING( sXML_import_chart_content_service, "com.sun.star.comp.Chart.XMLContentImporter" );
++XML_STRING( sXML_import_chart_old_content_service, "com.sun.star.office.sax.importer.Chart" );
++
++using namespace ::com::sun::star;
++using namespace ::rtl;
++using namespace comphelper;
++
++SchXMLWrapper::SchXMLWrapper( uno::Reference< frame::XModel >& xModel,
++ SvStorage& rStorage,
++ sal_Bool bShowProgress ) :
++ mxModel( xModel ),
++ mrStorage( rStorage ),
++ mbShowProgress( bShowProgress )
++{}
++
++
++sal_Int32 SchXMLWrapper::ImportStream(
++ const ::rtl::OUString& rsStreamName,
++ const ::rtl::OUString& rsServiceName,
++ uno::Reference< xml::sax::XParser >& xParser,
++ uno::Reference< lang::XMultiServiceFactory >& xServiceFactory,
++ uno::Reference< document::XGraphicObjectResolver >& xGraphObjResolver )
++{
++ xml::sax::InputSource aParserInput;
++ SvStorageStreamRef rInpStream;
++ uno::Reference< io::XActiveDataSource > xSource;
++ sal_Bool bEncrypted = sal_False;
++
++ try
++ {
++ String sStreamName( rsStreamName );
++ if( ! mrStorage.IsStream( String( rsStreamName )))
++ return sal_False;
++
++ rInpStream = mrStorage.OpenStream( sStreamName, STREAM_READ | STREAM_NOCREATE );
++ if( ! rInpStream.Is())
++ return sal_False;
++
++ uno::Any aAny;
++ bEncrypted = rInpStream->GetProperty( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Encrypted" )), aAny )
++ && aAny.getValueType() == ::getBooleanCppuType()
++ && *(sal_Bool *)aAny.getValue();
++
++ aParserInput.aInputStream = rInpStream->GetXInputStream();
++
++ if( aParserInput.aInputStream.is() )
++ {
++ sal_Int32 nArgs = 0;
++ if( mxStatusIndicator.is())
++ nArgs++;
++ if( xGraphObjResolver.is())
++ nArgs++;
++
++ uno::Sequence< uno::Any > aArgs( nArgs );
++
++ nArgs = 0;
++ if( mxStatusIndicator.is())
++ aArgs[ nArgs++ ] <<= mxStatusIndicator;
++
++ if( xGraphObjResolver.is())
++ aArgs[ nArgs++ ] <<= xGraphObjResolver;
++
++ uno::Reference< xml::sax::XDocumentHandler > xDocHandler(
++ xServiceFactory->createInstanceWithArguments( rsServiceName, aArgs ),
++ uno::UNO_QUERY );
++
++ if( xDocHandler.is() )
++ {
++ uno::Reference< document::XImporter > xImporter( xDocHandler, uno::UNO_QUERY );
++ uno::Reference< lang::XComponent > xComponent( mxModel, uno::UNO_QUERY );
++
++ if( xImporter.is() )
++ {
++ xImporter->setTargetDocument( xComponent );
++ xParser->setDocumentHandler( xDocHandler );
++
++ xParser->parseStream( aParserInput );
++ }
++ }
++ }
++ }
++ catch( xml::sax::SAXParseException&)
++ {
++ if( bEncrypted )
++ return ERRCODE_SFX_WRONGPASSWORD;
++ return ERRCODE_SFX_GENERAL;
++ }
++ catch( xml::sax::SAXException&)
++ {
++ if( bEncrypted )
++ return ERRCODE_SFX_WRONGPASSWORD;
++ return ERRCODE_SFX_GENERAL;
++ }
++ catch( io::IOException&)
++ {
++ return ERRCODE_SFX_GENERAL;
++ }
++ catch( packages::zip::ZipIOException& )
++ {
++ return ERRCODE_IO_BROKENPACKAGE;
++ }
++ catch( uno::Exception&)
++ {
++ return ERRCODE_SFX_GENERAL;
++ }
++
++ return 0;
++}
++
++sal_Int32 SchXMLWrapper::Import()
++{
++ sal_Int32 nWarning = 0;
++
++ if( !mxModel.is() )
++ {
++ DBG_ERROR("Got NO Model in XMLImport");
++ return sal_False;
++ }
++
++ uno::Reference<lang::XServiceInfo> xServiceInfo( mxModel, uno::UNO_QUERY );
++
++ if( !xServiceInfo.is() || !xServiceInfo->supportsService( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart.ChartDocument" ) ) ) )
++ {
++ DBG_ERROR( "Model is no ChartDocument in XMLImport" );
++ return sal_False;
++ }
++
++ uno::Reference< lang::XMultiServiceFactory> xServiceFactory( ::comphelper::getProcessServiceFactory() );
++
++ if( !xServiceFactory.is() )
++ {
++ DBG_ERROR( "XMLReader::Read: got no service manager" );
++ return sal_False;
++ }
++
++ // get the sax parser component
++ uno::Reference< xml::sax::XParser > xXMLParser(
++ xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )),
++ uno::UNO_QUERY );
++
++ if( ! xXMLParser.is() )
++ {
++ DBG_ERROR( "com.sun.star.xml.sax.Parser service missing" );
++ return sal_False;
++ }
++
++ // create graphics resolver component
++ SvXMLGraphicHelper* pGraphicHelper = SvXMLGraphicHelper::Create( mrStorage, GRAPHICHELPER_MODE_READ );
++ uno::Reference< document::XGraphicObjectResolver > xGraphObjResolver = pGraphicHelper;
++
++ // import meta information
++ ImportStream(
++ ::rtl::OUString::createFromAscii( sXML_metaStreamName ),
++ ::rtl::OUString::createFromAscii( sXML_import_chart_meta_service ),
++ xXMLParser, xServiceFactory, xGraphObjResolver );
++
++ // import styles
++ ImportStream(
++ ::rtl::OUString::createFromAscii( sXML_styleStreamName ),
++ ::rtl::OUString::createFromAscii( sXML_import_chart_styles_service ),
++ xXMLParser, xServiceFactory, xGraphObjResolver );
++
++ // import content
++ nWarning = ImportStream(
++ ::rtl::OUString::createFromAscii( sXML_contentStreamName ),
++ ::rtl::OUString::createFromAscii( sXML_import_chart_content_service ),
++ xXMLParser, xServiceFactory, xGraphObjResolver );
++
++ // import of "content.xml" didn't work - try old "Content.xml" stream
++ if( nWarning != 0 )
++ {
++ nWarning = ImportStream(
++ ::rtl::OUString::createFromAscii( sXML_oldContentStreamName ),
++ ::rtl::OUString::createFromAscii( sXML_import_chart_old_content_service ),
++ xXMLParser, xServiceFactory, xGraphObjResolver );
++ }
++
++ // graphics resolver has to be destroyed this way!
++ SvXMLGraphicHelper::Destroy( pGraphicHelper );
++
++ return nWarning;
++}
++
++// -----------------------------------------------------------------------------
++
++sal_Bool SchXMLWrapper::ExportStream(
++ const ::rtl::OUString& rsStreamName,
++ const ::rtl::OUString& rsServiceName,
++ uno::Reference< io::XActiveDataSource >& xDataSource,
++ uno::Reference< lang::XMultiServiceFactory>& xServiceFactory,
++ uno::Sequence< uno::Any >& aArgs )
++{
++ sal_Bool bRet = sal_False;
++
++ try
++ {
++ // create output stream
++ SvStorageStreamRef rOutputStream( mrStorage.OpenStream(
++ String( rsStreamName ), STREAM_WRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC ));
++
++ rtl::OUString sMIMEType( RTL_CONSTASCII_USTRINGPARAM( "text/xml" ) );
++ uno::Any aAny;
++ aAny <<= sMIMEType;
++ rOutputStream->SetProperty( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" )), aAny );
++
++ // "Encrypted" means "Encryptable". Has to be set for all but the meta stream (which doesn't exist in charts)
++ aAny <<= (sal_Bool)(sal_True);
++ rOutputStream->SetProperty( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Encrypted" )), aAny );
++
++ rOutputStream->SetBufferSize( 0x4000 ); // 16*1024
++
++ if( xDataSource.is())
++ xDataSource->setOutputStream( new ::utl::OOutputStreamWrapper( *rOutputStream ));
++
++ uno::Reference< document::XFilter > xFilter(
++ xServiceFactory->createInstanceWithArguments( rsServiceName, aArgs ),
++ uno::UNO_QUERY );
++
++ if( xFilter.is())
++ {
++ uno::Reference< document::XExporter > xExporter( xFilter, uno::UNO_QUERY );
++ if( xExporter.is())
++ {
++ uno::Reference< lang::XComponent > xModelComponent( mxModel, uno::UNO_QUERY );
++ xExporter->setSourceDocument( xModelComponent );
++ }
++
++ // empty Descriptior (formerly FileName was given)
++ uno::Sequence< beans::PropertyValue > aEmptyDescriptor( 0 );
++ bRet = xFilter->filter( aEmptyDescriptor );
++
++ if( bRet && rOutputStream.Is())
++ rOutputStream->Commit();
++ }
++ }
++ catch( uno::Exception )
++ {
++ }
++
++ return bRet;
++}
++
++sal_Bool SchXMLWrapper::Export()
++{
++ sal_Bool bRet = sal_False;
++
++ try
++ {
++ if( !mxModel.is() )
++ {
++ DBG_ERROR("Got NO Model in XMLExport");
++ return sal_False;
++ }
++
++ uno::Reference< lang::XServiceInfo > xServiceInfo( mxModel, uno::UNO_QUERY );
++
++ if( ! xServiceInfo.is() || !xServiceInfo->supportsService(
++ OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart.ChartDocument" ) ) ) )
++ {
++ DBG_ERROR( "Model is no ChartDocument in XMLExport" );
++ return sal_False;
++ }
++
++ uno::Reference< lang::XMultiServiceFactory> xServiceFactory( ::comphelper::getProcessServiceFactory() );
++
++ if( !xServiceFactory.is() )
++ {
++ DBG_ERROR( "got no service manager" );
++ return sal_False;
++ }
++
++ uno::Reference< uno::XInterface > xWriter( xServiceFactory->createInstance(
++ OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Writer" ) ) ) );
++
++ if( !xWriter.is() )
++ {
++ DBG_ERROR( "com.sun.star.xml.sax.Writer service missing" );
++ return sal_False;
++ }
++ uno::Reference<xml::sax::XDocumentHandler > xHandler( xWriter, uno::UNO_QUERY );
++ uno::Sequence< beans::PropertyValue > aEmptyDescriptor( 0 );
++
++
++ /** property map for export info set */
++ PropertyMapEntry aExportInfoMap[] =
++ {
++ { MAP_LEN( "UsePrettyPrinting"),0, &::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0},
++ { NULL, 0, 0, NULL, 0, 0 }
++ };
++
++ uno::Reference< beans::XPropertySet > xInfoSet( GenericPropertySet_CreateInstance( new PropertySetInfo( aExportInfoMap ) ) );
++
++ SvtSaveOptions aSaveOpt;
++ OUString sUsePrettyPrinting(RTL_CONSTASCII_USTRINGPARAM("UsePrettyPrinting"));
++ sal_Bool bUsePrettyPrinting( aSaveOpt.IsPrettyPrinting() );
++ xInfoSet->setPropertyValue( sUsePrettyPrinting, uno::makeAny( bUsePrettyPrinting ) );
++
++
++ SvXMLGraphicHelper* pGraphicHelper = SvXMLGraphicHelper::Create( mrStorage, GRAPHICHELPER_MODE_WRITE, sal_False );
++ uno::Reference< document::XGraphicObjectResolver > xGraphObjResolver( pGraphicHelper );
++ uno::Reference< io::XActiveDataSource > xDataSource( xWriter, uno::UNO_QUERY );
++
++ sal_Int32 nArgs = 2;
++ if( mxStatusIndicator.is())
++ nArgs++;
++ if( xGraphObjResolver.is())
++ nArgs++;
++
++ uno::Sequence< uno::Any > aArgs( nArgs );
++
++ nArgs = 0;
++ aArgs[ nArgs++ ] <<= xHandler;
++ aArgs[ nArgs++ ] <<= xInfoSet;
++
++ if( mxStatusIndicator.is())
++ aArgs[ nArgs++ ] <<= mxStatusIndicator;
++ if( xGraphObjResolver.is())
++ aArgs[ nArgs++ ] <<= xGraphObjResolver;
++
++ //export to one stream
++ bRet = ExportStream(
++ ::rtl::OUString::createFromAscii( sXML_contentStreamName ),
++ ::rtl::OUString::createFromAscii( sXML_export_chart_allinone_service ),
++ xDataSource, xServiceFactory, aArgs );
++
++ // graphics resolver has to be destroyed this way!
++ SvXMLGraphicHelper::Destroy( pGraphicHelper );
++ }
++ catch( uno::Exception)
++ {
++ }
++
++ return bRet;
++}
++
+diff -urNp lotuswordpro.bak/source/filter/schxmlwrapper.hxx lotuswordpro/source/filter/schxmlwrapper.hxx
+--- lotuswordpro.bak/source/filter/schxmlwrapper.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/schxmlwrapper.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,118 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++
++#ifndef _SCH_XMLWRP_HXX_
++#define _SCH_XMLWRP_HXX_
++
++#ifndef _SVSTOR_HXX
++#include <so3/svstor.hxx>
++#endif
++
++namespace com { namespace sun { namespace star {
++ namespace xml {
++ namespace sax {
++ class XParser;
++ }
++ }
++ namespace document {
++ class XGraphicObjectResolver;
++ }
++ namespace frame {
++ class XModel;
++ }
++ namespace task {
++ class XStatusIndicator;
++ }
++ namespace lang {
++ class XMultiServiceFactory;
++ }
++ namespace io {
++ class XActiveDataSource;
++ }
++}}}
++
++class SchXMLWrapper
++{
++ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
++ ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > mxStatusIndicator;
++ SvStorage& mrStorage;
++
++ sal_Bool mbIsDraw : 1;
++ sal_Bool mbShowProgress : 1;
++
++ sal_Int32 ImportStream(
++ const ::rtl::OUString& rsStreamName,
++ const ::rtl::OUString& rsServiceName,
++ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XParser >& xParser,
++ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& xServiceFactory,
++ ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver >& xGraphObjResolver );
++
++ sal_Bool ExportStream(
++ const ::rtl::OUString& rsStreamName,
++ const ::rtl::OUString& rsServiceName,
++ ::com::sun::star::uno::Reference< ::com::sun::star::io::XActiveDataSource >& xDataSource,
++ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& xServiceFactory,
++ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArgs );
++
++public:
++ SchXMLWrapper( ::com::sun::star::uno::Reference< com::sun::star::frame::XModel >& xModel,
++ SvStorage& rStorage,
++ sal_Bool bShowProgress = TRUE );
++
++ sal_Int32 Import();
++ sal_Bool Export();
++};
++
++#endif // _SCH_XMLWRP_HXX_
+diff -urNp lotuswordpro.bak/source/filter/tocread.cxx lotuswordpro/source/filter/tocread.cxx
+--- lotuswordpro.bak/source/filter/tocread.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/tocread.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,516 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "first.hxx"
++#include "assert.h"
++namespace OpenStormBento
++{
++
++BenError
++CBenTOCReader::ReadLabelAndTOC()
++{
++ BenError Err;
++
++ unsigned long TOCOffset;
++ if ((Err = ReadLabel(&TOCOffset, &cTOCSize)) != BenErr_OK)
++ return Err;
++
++ if ((Err = cpContainer->SeekToPosition(TOCOffset)) != BenErr_OK)
++ return Err;
++
++ cpTOC = new BenByte[cTOCSize];
++ if ((Err = cpContainer->ReadKnownSize(cpTOC, cTOCSize)) != BenErr_OK)
++ return Err;
++
++ if ((Err = ReadTOC()) != BenErr_OK)
++ return Err;
++
++ return BenErr_OK;
++}
++
++BenError
++CBenTOCReader::ReadLabel(unsigned long * pTOCOffset, unsigned long * pTOCSize)
++{
++ // If seek fails, then probably because stream is smaller than
++ // BEN_LABEL_SIZE and thus can't be Bento container
++ BenError Err;
++ if ((Err = cpContainer->SeekFromEnd(-BEN_LABEL_SIZE)) != BenErr_OK)
++ return BenErr_NotBentoContainer;
++
++ BenByte Label[BEN_LABEL_SIZE];
++ if ((Err = cpContainer->ReadKnownSize(Label, BEN_LABEL_SIZE)) != BenErr_OK)
++ return Err;
++
++ if (memcmp(Label, gsBenMagicBytes, BEN_MAGIC_BYTES_SIZE) != 0)
++ if ((Err = SearchForLabel(Label)) != BenErr_OK)
++ return Err;
++
++ BenByte * pCurrLabel = Label + BEN_MAGIC_BYTES_SIZE;
++
++ BenWord Flags = UtGetIntelWord(pCurrLabel); pCurrLabel += 2; // Flags
++ // Newer files are 0x0101--indicates if big or little endian. Older
++ // files are 0x0 for flags
++ assert(Flags == 0x0101 || Flags == 0x0);
++
++ cBlockSize = UtGetIntelWord(pCurrLabel) * 1024; pCurrLabel += 2;
++
++ // Check major version
++ if (UtGetIntelWord(pCurrLabel) != BEN_CURR_MAJOR_VERSION)
++ return BenErr_UnknownBentoFormatVersion;
++ pCurrLabel += 2;
++
++ UtGetIntelWord(pCurrLabel); pCurrLabel += 2; // Minor version
++
++ *pTOCOffset = UtGetIntelDWord(pCurrLabel); pCurrLabel += 4;
++ *pTOCSize = UtGetIntelDWord(pCurrLabel);
++
++ assert(pCurrLabel + 4 == Label + BEN_LABEL_SIZE);
++
++ return BenErr_OK;
++}
++
++#define LABEL_READ_BUFFER_SIZE 500
++#define MAX_SEARCH_AMOUNT 1024 * 1024
++
++BenError
++CBenTOCReader::SearchForLabel(BenByte * pLabel)
++{
++ BenError Err;
++
++ unsigned long Length;
++ if ((Err = cpContainer->GetSize(&Length)) != BenErr_OK)
++ return Err;
++
++ // Always ready to check for MagicBytes from
++ // CurrOffset - BEN_MAGIC_BYTES_SIZE to CurrOffset - 1
++ unsigned long CurrOffset = Length - BEN_LABEL_SIZE + BEN_MAGIC_BYTES_SIZE -
++ 1;
++
++ char Buffer[LABEL_READ_BUFFER_SIZE];
++
++ unsigned long BufferStartOffset = Length; // Init to big value
++
++ while (CurrOffset >= BEN_MAGIC_BYTES_SIZE)
++ {
++ // Don't search backwards more than 1 meg
++ if (Length - CurrOffset > MAX_SEARCH_AMOUNT)
++ break;
++
++ unsigned long UsedBufferSize;
++
++ // If before beginning of buffer
++ if (CurrOffset - BEN_MAGIC_BYTES_SIZE < BufferStartOffset)
++ {
++ if (CurrOffset < LABEL_READ_BUFFER_SIZE)
++ UsedBufferSize = CurrOffset;
++ else UsedBufferSize = LABEL_READ_BUFFER_SIZE;
++
++ if ((Err = cpContainer->SeekToPosition(CurrOffset - UsedBufferSize))
++ != BenErr_OK)
++ return Err;
++
++ if ((Err = cpContainer->ReadKnownSize(Buffer, UsedBufferSize)) !=
++ BenErr_OK)
++ return Err;
++
++ BufferStartOffset = CurrOffset - UsedBufferSize;
++ }
++
++ if (memcmp(Buffer + (CurrOffset - BEN_MAGIC_BYTES_SIZE -
++ BufferStartOffset), gsBenMagicBytes, BEN_MAGIC_BYTES_SIZE) == 0)
++ {
++ if ((Err = cpContainer->SeekToPosition(CurrOffset -
++ BEN_MAGIC_BYTES_SIZE)) != BenErr_OK)
++ return Err;
++
++ return cpContainer->ReadKnownSize(pLabel, BEN_LABEL_SIZE);
++ }
++
++ --CurrOffset;
++ }
++
++ return BenErr_NotBentoContainer; // Didn't find magic bytes
++}
++
++BenError
++CBenTOCReader::ReadTOC()
++{
++ BenError Err;
++ BenByte LookAhead = GetCode();
++ BenGeneration Generation = 0;
++
++ // Read in all objects
++ while (LookAhead == BEN_NEW_OBJECT)
++ {
++ BenObjectID ObjectID;
++ if ((Err = GetDWord(&ObjectID)) != BenErr_OK)
++ return Err;
++ pCBenObject pObject = NULL;
++
++ // Read in all properties for object
++ do
++ {
++ BenObjectID PropertyID;
++
++ if ((Err = GetDWord(&PropertyID)) != BenErr_OK)
++ return Err;
++ pCBenProperty pProperty = NULL;
++
++ // Read in all values for property
++ do
++ {
++ BenObjectID ReferencedListID = 0;
++
++ BenObjectID TypeID;
++ if ((Err = GetDWord(&TypeID)) != BenErr_OK)
++ return Err;
++ LookAhead = GetCode();
++
++ if (LookAhead == BEN_EXPLICIT_GEN)
++ {
++ if ((Err = GetDWord(&Generation)) != BenErr_OK)
++ return Err;
++ LookAhead = GetCode();
++ }
++
++ if (LookAhead == BEN_REFERENCE_LIST_ID)
++ {
++ // Eat it, unless BENUTIL_SUPPORT turned on
++ if ((Err = GetDWord(&ReferencedListID)) != BenErr_OK)
++ return Err;
++ LookAhead = GetCode();
++ }
++
++ if (PropertyID == BEN_PROPID_GLOBAL_PROPERTY_NAME ||
++ PropertyID == BEN_PROPID_GLOBAL_TYPE_NAME)
++ {
++ // Read property or type name
++
++ if (pObject != NULL || TypeID != BEN_TYPEID_7_BIT_ASCII ||
++ LookAhead != BEN_OFFSET4_LEN4)
++ return BenErr_NamedObjectError;
++
++ BenContainerPos Pos;
++ unsigned long Length;
++
++ if ((Err = GetDWord(&Pos)) != BenErr_OK)
++ return Err;
++ if ((Err = GetDWord(&Length)) != BenErr_OK)
++ return Err;
++ LookAhead = GetCode();
++
++ if ((Err = cpContainer->SeekToPosition(Pos)) != BenErr_OK)
++ return Err;
++
++ #define STACK_BUFFER_SIZE 256
++ char sStackBuffer[STACK_BUFFER_SIZE];
++ char * sAllocBuffer;
++ char * sBuffer;
++ if (Length > STACK_BUFFER_SIZE)
++ {
++ sBuffer = new char[Length];
++ sAllocBuffer = sBuffer;
++ }
++ else
++ {
++ sBuffer = sStackBuffer;
++ sAllocBuffer = NULL;
++ }
++
++ if ((Err = cpContainer->ReadKnownSize(sBuffer, Length)) !=
++ BenErr_OK)
++ {
++ delete[] sAllocBuffer;
++ return Err;
++ }
++
++ pCBenNamedObjectListElmt pPrevNamedObjectListElmt;
++ if (FindNamedObject(cpContainer->GetNamedObjects(),
++ sBuffer, &pPrevNamedObjectListElmt) != NULL)
++ {
++ delete[] sAllocBuffer;
++ return BenErr_DuplicateName;
++ }
++
++ pCBenObject pPrevObject = (pCBenObject) cpContainer->
++ GetObjects()->GetLast();
++
++ if (PropertyID == BEN_PROPID_GLOBAL_PROPERTY_NAME)
++ pObject = new CBenPropertyName(cpContainer, ObjectID,
++ pPrevObject, sBuffer, pPrevNamedObjectListElmt);
++ else pObject = new CBenTypeName(cpContainer, ObjectID,
++ pPrevObject, sBuffer, pPrevNamedObjectListElmt);
++
++ delete[] sAllocBuffer;
++ }
++ // If BENUTIL_SUPPORT turned on, read in references object
++ // like regular object
++#ifndef BENUTIL_SUPPORT
++ else if (PropertyID == BEN_PROPID_OBJ_REFERENCES)
++ {
++ // Don't need to read in references object--we assume
++ // that all references use object ID as key
++ if ((Err = ReadSegments(NULL, &LookAhead)) != BenErr_OK)
++ return Err;
++ }
++#endif
++ else if (ObjectID == BEN_OBJID_TOC)
++ {
++ if (PropertyID == BEN_PROPID_TOC_SEED)
++ {
++ if (TypeID != BEN_TYPEID_TOC_TYPE ||
++ LookAhead != BEN_IMMEDIATE4)
++ return BenErr_TOCSeedError;
++
++ BenDWord Data;
++ if ((Err = GetDWord(&Data)) != BenErr_OK)
++ return Err;
++ LookAhead = GetCode();
++
++ cpContainer->SetNextAvailObjectID(Data);
++ }
++ else
++ {
++ // Ignore the other BEN_OBJID_TOC properties
++ if ((Err = ReadSegments(NULL, &LookAhead)) != BenErr_OK)
++ return Err;
++ }
++ }
++ else
++ {
++ if (pProperty != NULL)
++ return BenErr_PropertyWithMoreThanOneValue;
++
++ if (pObject == NULL)
++ pObject = new CBenObject(cpContainer, ObjectID,
++ (pCBenObject) cpContainer->GetObjects()->GetLast());
++
++ pProperty = new CBenProperty(pObject, PropertyID, TypeID,
++ (pCBenProperty) pObject->GetProperties()->GetLast());
++
++#ifdef BENUTIL_SUPPORT
++ pProperty->UseValue()->
++ SetReferencedListObjectID(ReferencedListID);
++#endif
++
++ if ((Err = ReadSegments(pProperty->UseValue(),
++ &LookAhead)) != BenErr_OK)
++ return Err;
++ }
++ } while (LookAhead == BEN_NEW_TYPE);
++ } while (LookAhead == BEN_NEW_PROPERTY);
++ }
++
++ if (LookAhead == BEN_READ_PAST_END_OF_TOC)
++ return BenErr_OK;
++ else return BenErr_InvalidTOC;
++}
++
++BenError
++CBenTOCReader::ReadSegments(pCBenValue pValue, BenByte * pLookAhead)
++{
++ BenError Err;
++
++ while (*pLookAhead >= BEN_SEGMENT_CODE_START &&
++ *pLookAhead <= BEN_SEGMENT_CODE_END)
++ {
++ if ((Err = ReadSegment(pValue, pLookAhead)) !=
++ BenErr_OK)
++ return Err;
++ }
++
++ return BenErr_OK;
++}
++
++BenError
++CBenTOCReader::ReadSegment(pCBenValue pValue, BenByte * pLookAhead)
++{
++ BenError Err;
++
++ UtBool Immediate = UT_FALSE;
++ UtBool EightByteOffset = UT_FALSE;
++ unsigned long Offset, Length;
++
++ switch (*pLookAhead)
++ {
++ case BEN_CONT_OFFSET4_LEN4:
++ case BEN_OFFSET4_LEN4:
++ if ((Err = GetDWord(&Offset)) != BenErr_OK)
++ return Err;
++ if ((Err = GetDWord(&Length)) != BenErr_OK)
++ return Err;
++ break;
++
++ case BEN_IMMEDIATE0:
++ Length = 0; Immediate = UT_TRUE;
++ break;
++
++ case BEN_IMMEDIATE1:
++ Length = 1; Immediate = UT_TRUE;
++ break;
++
++ case BEN_IMMEDIATE2:
++ Length = 2; Immediate = UT_TRUE;
++ break;
++
++ case BEN_IMMEDIATE3:
++ Length = 3; Immediate = UT_TRUE;
++ break;
++
++ case BEN_CONT_IMMEDIATE4:
++ case BEN_IMMEDIATE4:
++ Length = 4; Immediate = UT_TRUE;
++ break;
++
++ case BEN_CONT_OFFSET8_LEN4:
++ case BEN_OFFSET8_LEN4:
++ EightByteOffset = UT_TRUE;
++ break;
++
++ default:
++ return BenErr_OK;
++ }
++
++ BenByte ImmData[4];
++ if (Immediate && Length != 0)
++ if ((Err = GetData(ImmData, 4)) != BenErr_OK)
++ return Err;
++
++ *pLookAhead = GetCode();
++
++ if (EightByteOffset)
++ return BenErr_64BitOffsetNotSupported;
++
++ if (pValue != NULL)
++ {
++ if (! Immediate)
++ new CBenValueSegment(pValue, Offset, Length);
++ else if (Length != 0)
++ {
++ assert(Length <= 4);
++ new CBenValueSegment(pValue, ImmData, (unsigned short) Length);
++ }
++ }
++
++ return BenErr_OK;
++}
++
++UtBool
++CBenTOCReader::CanGetData(unsigned long Amt)
++{
++ return cCurr + Amt <= cTOCSize;
++}
++
++BenError
++CBenTOCReader::GetByte(BenByte * pByte)
++{
++ if (! CanGetData(1))
++ return BenErr_ReadPastEndOfTOC;
++
++ *pByte = UtGetIntelByte(cpTOC + cCurr);
++ ++cCurr;
++ return BenErr_OK;
++}
++
++BenError
++CBenTOCReader::GetWord(BenWord * pWord)
++{
++ if (! CanGetData(2))
++ return BenErr_ReadPastEndOfTOC;
++
++ *pWord = UtGetIntelWord(cpTOC + cCurr);
++ cCurr += 2;
++ return BenErr_OK;
++}
++
++BenError
++CBenTOCReader::GetDWord(BenDWord * pDWord)
++{
++ if (! CanGetData(4))
++ return BenErr_ReadPastEndOfTOC;
++
++ *pDWord = UtGetIntelDWord(cpTOC + cCurr);
++ cCurr += 4;
++ return BenErr_OK;
++}
++
++BenByte
++CBenTOCReader::GetCode()
++{
++ BenByte Code;
++ do
++ {
++ if (GetByte(&Code) != BenErr_OK)
++ return BEN_READ_PAST_END_OF_TOC;
++
++ if (Code == BEN_END_OF_BUFFER)
++ // Advance to next block
++ cCurr = cBlockSize * ((cCurr + (cBlockSize - 1)) /
++ cBlockSize);
++ }
++ while (Code == BEN_NOOP || Code == BEN_END_OF_BUFFER);
++ return Code;
++}
++
++BenError
++CBenTOCReader::GetData(BenDataPtr pBuffer, unsigned long Amt)
++{
++ if (! CanGetData(Amt))
++ return BenErr_ReadPastEndOfTOC;
++
++ UtHugeMemcpy(pBuffer, cpTOC + cCurr, Amt);
++ cCurr += Amt;
++ return BenErr_OK;
++}
++}//end OpenStormBento namespace
+diff -urNp lotuswordpro.bak/source/filter/tocread.hxx lotuswordpro/source/filter/tocread.hxx
+--- lotuswordpro.bak/source/filter/tocread.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/tocread.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,89 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef TOCREAD_H
++#define TOCREAD_H
++namespace OpenStormBento
++{
++
++class CBenTOCReader
++{
++public: // Methods
++ CBenTOCReader(pLtcBenContainer pContainer)
++ { cpContainer = pContainer; cpTOC = NULL; cCurr = 0; }
++ ~CBenTOCReader() { delete cpTOC; }
++ BenError ReadLabelAndTOC();
++
++private: // Methods
++ BenError ReadLabel(unsigned long * pTOCOffset, unsigned long * pTOCSize);
++ BenError SearchForLabel(BenByte * pLabel);
++ BenError ReadTOC();
++ BenError ReadSegments(pCBenValue pValue, BenByte * pLookAhead);
++ BenError ReadSegment(pCBenValue pValue, BenByte * pLookAhead);
++ UtBool CanGetData(unsigned long Amt);
++ BenError GetByte(BenByte * pByte);
++ BenError GetWord(BenWord * pWord);
++ BenError GetDWord(BenDWord * pDWord);
++ BenByte GetCode();
++ BenError GetData(BenDataPtr pBuffer, unsigned long Amt);
++
++private: // Data
++ pLtcBenContainer cpContainer;
++ BenByteDataPtr cpTOC;
++ unsigned long cBlockSize;
++ unsigned long cCurr;
++ unsigned long cTOCSize;
++};
++}//end namespace OpenStormBento
++#endif
+diff -urNp lotuswordpro.bak/source/filter/utbenvs.cxx lotuswordpro/source/filter/utbenvs.cxx
+--- lotuswordpro.bak/source/filter/utbenvs.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/utbenvs.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,288 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "first.hxx"
++#include <assert.h>
++namespace OpenStormBento
++{
++/*
++ * useless in SODC
++void LtcUtBenValueStream::GetAmountLeft(ULONG * pAmtLeft)
++{
++ if (cCurrentPosition >= m_ulValueLength)
++ {
++ *pAmtLeft = 0;
++ }
++ else
++ {
++ *pAmtLeft = m_ulValueLength - cCurrentPosition;
++ }
++}
++*/
++/**
++* Value stream read function
++* @date 07/05/2004
++* @param data pointer of bytes read
++* @param number of bytes to be read
++* @return number of bytes read
++*/
++ULONG LtcUtBenValueStream::GetData( void* pData, ULONG nSize )
++{
++ //unsigned long AmtLeft;
++ ULONG AmtRead;
++ //GetAmountLeft(&AmtLeft);
++
++ //unsigned long AmtShouldRead = UtMin(nSize, AmtLeft);
++ BenError Err = cpValue->ReadValueData(pData, cCurrentPosition, nSize,
++ &AmtRead);
++ cCurrentPosition += AmtRead;
++
++ return AmtRead;
++}
++ /**
++* Value stream write function, not suppoted now
++* @date 07/05/2004
++* @param pointer of saved buffer
++* @param size of buffer to be written
++* @return number of bytes written into value stream
++*/
++ULONG LtcUtBenValueStream::PutData( const void* pData, ULONG nSize )
++{
++ /* Because we only support IMPORT filter, PutData implementation is ignored
++ It won't bring negative influence to read-only stream object */
++ assert(false);
++ return nSize;
++}
++/**
++* Seek function of value stream
++* @date 07/05/2004
++* @param position in value stream
++* @return current position in value stream
++*/
++ ULONG LtcUtBenValueStream::SeekPos( ULONG nPos )
++{
++ if (nPos <= m_ulValueLength)
++ cCurrentPosition = nPos;
++ else
++ cCurrentPosition = m_ulValueLength;
++ return cCurrentPosition;
++}
++/**
++* Set buffer size function
++* @date 07/05/2004
++* @param size of buffer
++* @return
++*/
++ void LtcUtBenValueStream::SetSize( ULONG nSize )
++{
++ pLtcBenContainer pContainer = cpValue->GetContainer();
++ //pContainer->GetStream()->SetStreamSize(nSize);
++
++ return;
++}
++/**
++* Flush data funciton, not supported now
++* @date 07/05/2004
++* @param
++* @return
++*/
++void LtcUtBenValueStream::FlushData()
++{
++ /* Because we only support IMPORT filter, FlushData implementation is ignored
++ It won't bring negative influence to read-only stream object
++ pLtcBenContainer pContainer = cpValue->GetContainer();
++ pContainer->GetStream()->Flush();*/
++ assert(false);
++ return;
++}
++/**
++* Construction
++* @date 07/05/2004
++* @param pointer to CBenValue object
++* @return
++*/
++LtcUtBenValueStream::LtcUtBenValueStream(pCBenValue pValue)
++{
++ // Calculate the length of the whole value stream
++ cCurrentPosition = 0;
++ m_ulValueLength = pValue->GetValueSize();
++ cpValue = pValue;
++}
++
++LtcUtBenValueStream::~LtcUtBenValueStream()
++{
++}
++#if 0 // Deleted by 2004-06-16
++UtError
++CUtBenValueStream::Open(UtBool /* OpenNew */, UtStrmOpenFlags /* Flags */)
++{
++ cCurrentPosition = 0;
++ return UtErr_OK;
++}
++
++UtError
++CUtBenValueStream::Close()
++{
++ return UtErr_OK;
++}
++
++UtError
++CUtBenValueStream::Seek(long Offset, UtSeekMode Mode)
++{
++ unsigned long NewPos;
++
++ if (Mode == UtSeek_FromStart)
++ NewPos = (unsigned long) Offset;
++ else if (Mode == UtSeek_FromCurr)
++ {
++ if (Offset < 0 && cCurrentPosition < (unsigned long) -Offset)
++ return UtErr_SeekError;
++ NewPos = cCurrentPosition + Offset;
++ }
++ else if (Mode == UtSeek_FromEnd)
++ {
++ unsigned long ValueSize = cpValue->GetValueSize();
++ if (Offset < 0 && ValueSize < (unsigned long) -Offset)
++ return UtErr_SeekError;
++ NewPos = ValueSize + Offset;
++ }
++ else
++ {
++ UT_ASSERT(! "Illegal seek");
++ return UtErr_SeekError;
++ }
++
++ cCurrentPosition = NewPos;
++ return UtErr_OK;
++}
++
++UtError
++CUtBenValueStream::GetPosition(unsigned long * pPosition)
++{
++ *pPosition = cCurrentPosition;
++ return UtErr_OK;
++}
++
++UtError
++CUtBenValueStream::GetSize(unsigned long * pSize)
++{
++ *pSize = cpValue->GetValueSize();
++ return UtErr_OK;
++}
++
++UtError
++CUtBenValueStream::Read(UtStrmDataPtr pBuffer, unsigned long MaxSize,
++ unsigned long * pAmtRead)
++{
++ unsigned long AmtLeft;
++ GetAmountLeft(&AmtLeft);
++
++ unsigned long AmtShouldRead = UtMin(MaxSize, AmtLeft);
++
++ BenError Err = cpValue->ReadValueData(pBuffer, cCurrentPosition, MaxSize,
++ pAmtRead);
++ cCurrentPosition += *pAmtRead;
++
++ return BenToUtError(Err);
++}
++
++UtError
++CUtBenValueStream::Write(UtConstStrmDataPtr pBuffer, unsigned long Size,
++ unsigned long * pAmtWritten)
++{
++ BenError Err;
++
++ *pAmtWritten = 0;
++
++ // IStream::Write semantics are that when write zero bytes, doesn't fill
++ // in gap
++ if (Size == 0)
++ return UtErr_OK;
++
++ // See if anybody exercies code below
++ //UT_ASSERT(cCurrentPosition <= (long) cpValue->GetValueSize());
++
++ // Fill out "gap" in data, if there is one, with nulls
++ while (cCurrentPosition > cpValue->GetValueSize())
++ if ((Err = cpValue->WriteValueData("", cpValue->GetValueSize(), 1,
++ NULL)) != BenErr_OK)
++ return BenToUtError(Err);
++
++ unsigned long AmtWritten;
++ Err = cpValue->WriteValueData(pBuffer, cCurrentPosition, Size,
++ &AmtWritten);
++
++ //UT_ASSERT(Size == AmtWritten);
++
++ cCurrentPosition += AmtWritten;
++
++ *pAmtWritten = AmtWritten;
++
++ return BenToUtError(Err);
++}
++
++UtError
++CUtBenValueStream::TruncateSize(unsigned long Size)
++{
++ return BenToUtError(cpValue->TruncateValueSize(Size));
++}
++
++UtError
++CUtBenValueStream::Flush()
++{
++ return UtErr_OK;
++
++}
++#endif
++} // end namespace OpenStormBento
+diff -urNp lotuswordpro.bak/source/filter/ut.hxx lotuswordpro/source/filter/ut.hxx
+--- lotuswordpro.bak/source/filter/ut.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/ut.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,101 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef UT_HXX
++#define UT_HXX
++# include <sal/types.h>
++
++namespace OpenStormBento
++{
++
++#define UtMin(x,y) ((x) < (y) ? (x) : (y))
++#define UtMax(x,y) ((x) > (y) ? (x) : (y))
++
++#define UtHugeMemcpy memcpy
++
++#define UtErr_OK 0
++#define UtErr_Fail 1
++
++#define UT_TRUE sal_True
++#define UT_FALSE sal_False
++
++#define UtByte sal_uInt8
++#define UtDWord sal_uInt32
++#define UtWord sal_uInt16
++#define UtBool sal_Int32
++
++#define UtDefClassP(Name) class Name; typedef Name * p##Name; \
++ typedef const Name * pConst##Name
++
++inline UtWord UtGetIntelWord(UtByte * pData)
++{ return * (UtWord *) pData; }
++
++inline UtDWord UtGetIntelDWord(UtByte * pData)
++{ return * (UtDWord *) pData; }
++
++inline void UtPutIntelWord(UtByte * pData, UtWord Val)
++{ * (UtWord *) pData = Val; }
++
++inline void UtPutIntelDWord(UtByte * pData, UtDWord Val)
++{ * (UtDWord *) pData = Val; }
++
++inline UtByte UtGetIntelByte(UtByte * pData)
++{ return * pData; }
++
++inline void UtPutIntelByte(UtByte * pData, UtByte Val)
++
++{ * pData = Val; }
++
++}
++#endif
+diff -urNp lotuswordpro.bak/source/filter/utlist.cxx lotuswordpro/source/filter/utlist.cxx
+--- lotuswordpro.bak/source/filter/utlist.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/utlist.cxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,250 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "first.hxx"
++
++namespace OpenStormBento
++{
++
++CUtListElmt::CUtListElmt(pCUtList pList)
++{
++ if (pList == NULL)
++ cpNext = NULL;
++ else InsertAfter(pList->GetLast());
++}
++
++CUtListElmt::~CUtListElmt()
++{
++ if (OnList())
++ {
++ cpPrev->cpNext = cpNext;
++ cpNext->cpPrev = cpPrev;
++ }
++}
++
++
++
++
++CUtList::~CUtList()
++{
++ pCUtListElmt pTerminating = GetTerminating();
++ for (pCUtListElmt pCurr = GetFirst(); pCurr != pTerminating; )
++ {
++ pCUtListElmt pNext = pCurr->GetNext();
++ pCurr->MakeNotOnList();
++ pCurr = pNext;
++ }
++ pTerminating->SetPrev(pTerminating);
++ pTerminating->SetNext(pTerminating);
++}
++
++int
++CUtList::GetCount()
++{
++ int Count = 0;
++
++ pCUtListElmt pTerminating = GetTerminating();
++ for (pCUtListElmt pCurr = GetFirst(); pCurr != pTerminating;
++ pCurr = pCurr->GetNext())
++ {
++ Count++;
++ }
++ return Count;
++}
++
++pCUtListElmt
++CUtList::GetIndex(int Index)
++{
++ int Count = 0;
++
++ pCUtListElmt pTerminating = GetTerminating();
++ for (pCUtListElmt pCurr = GetFirst(); pCurr != pTerminating;
++ pCurr = pCurr->GetNext())
++ {
++ if (Count == Index)
++ return pCurr;
++ Count++;
++ }
++ return NULL;
++}
++
++int
++CUtList::GetIndex(pCUtListElmt pNode)
++{
++ int Count = 0;
++
++ pCUtListElmt pTerminating = GetTerminating();
++ for (pCUtListElmt pCurr = GetFirst(); pCurr != pTerminating;
++ pCurr = pCurr->GetNext())
++ {
++ if (pNode == pCurr)
++ break;
++ Count++;
++ }
++ return Count;
++}
++
++// If pCurr is last item in list, returns first item in list (terminating
++// item is skipped when circle around)
++pCUtListElmt
++CUtList::CircularGetNext(pConstCUtListElmt pCurr)
++{
++ pCUtListElmt pNext = pCurr->GetNext();
++ if (pNext == GetTerminating())
++ pNext = GetFirst();
++ return pNext;
++}
++
++pCUtListElmt
++CUtList::CircularGetPrev(pConstCUtListElmt pCurr)
++{
++ pCUtListElmt pPrev = pCurr->GetPrev();
++ if (pPrev == GetTerminating())
++ pPrev = GetLast();
++ return pPrev;
++}
++
++// If pCurr is NULL, returns first item in list. Otherwise, returns item
++// in list after pCurr or NULL if no more items in list. Terminating item
++// is never returned
++pCUtListElmt
++CUtList::GetNextOrNULL(pCUtListElmt pCurr)
++{
++ pCUtListElmt pNext;
++
++ if (pCurr == NULL)
++ pNext = GetFirst();
++ else pNext = pCurr->GetNext();
++ if (pNext == GetTerminating())
++ pNext = NULL;
++ return pNext;
++}
++
++// If pCurr is NULL, returns last item in list. Otherwise, returns item
++// in list before pCurr or NULL if no more items in list. Terminating item
++// is never returned
++pCUtListElmt
++CUtList::GetPrevOrNULL(pCUtListElmt pCurr)
++{
++ pCUtListElmt pPrev;
++
++ if (pCurr == NULL)
++ pPrev = GetLast();
++ else pPrev = pCurr->GetPrev();
++ if (pPrev == GetTerminating())
++ pPrev = NULL;
++ return pPrev;
++}
++#if 0 // Deleted by 2004-06-16
++
++// Does an insertion sort on list. If list is already sorted, takes O(n)
++// time. Assumes elements are of type CUtComparableListElmt
++void
++CUtList::Sort(LCID LangID)
++{
++ pCUtListElmt pSortedTo = GetFirst();
++
++ // Before each iteration, list is sorted up to, but not including,
++ // pSortedTo. On each iteration, we look backwards through sorted portion
++ // of list searching for spot that pSortedTo should go and move it to that
++ // location
++ while (pSortedTo != GetTerminating())
++ {
++ pCUtListElmt pNextSortedTo = pSortedTo->GetNext();
++
++ UtBool FoundSpot = UT_FALSE;
++ for (pCUtListElmt pCurr = pSortedTo->GetPrev();
++ pCurr != GetTerminating();
++ pCurr = pCurr->GetPrev())
++ {
++ if (((pCUtComparableListElmt) pSortedTo)->
++ Compare((pCUtComparableListElmt) pCurr, LangID) >= 0)
++ {
++ pSortedTo->Remove();
++ pSortedTo->InsertAfter(pCurr);
++ FoundSpot = UT_TRUE;
++ break;
++ }
++ }
++
++ if (! FoundSpot)
++ {
++ pSortedTo->Remove();
++ pSortedTo->InsertAfter(GetTerminating()); // Add at beginning
++ }
++
++ pSortedTo = pNextSortedTo;
++ }
++}
++#endif
++void
++CUtList::Destroy()
++{
++ pCUtListElmt pTerminating = GetTerminating();
++ for (pCUtListElmt pCurr = GetFirst(); pCurr != pTerminating; )
++ {
++ pCUtListElmt pNext = pCurr->GetNext();
++ delete pCurr;
++ pCurr = pNext;
++ }
++}
++
++
++
++
++CUtOwningList::~CUtOwningList()
++{
++ Destroy();
++}
++}//end namespace OpenStormBento
+diff -urNp lotuswordpro.bak/source/filter/utlist.hxx lotuswordpro/source/filter/utlist.hxx
+--- lotuswordpro.bak/source/filter/utlist.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/utlist.hxx 2008-10-22 11:42:29.000000000 +0800
+@@ -0,0 +1,157 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef UTLIST_H
++#define UTLIST_H
++
++#include "ut.hxx"
++
++namespace OpenStormBento
++{
++
++
++UtDefClassP(CUtListElmt);
++UtDefClassP(CUtList);
++UtDefClassP(CUtComparableListElmt);
++
++class CUtListElmt
++{
++public: // Methods
++ CUtListElmt() { cpNext = NULL; }
++ CUtListElmt(pCUtListElmt pPrev) { InsertAfter(pPrev); }
++ CUtListElmt(pCUtList pList);
++ virtual ~CUtListElmt();
++ void Remove()
++ {
++ cpPrev->cpNext = cpNext;
++ cpNext->cpPrev = cpPrev;
++ cpNext = NULL;
++ }
++ UtBool OnList() { return cpNext != NULL; }
++ void MakeNotOnList() { cpNext = NULL; } // Same as Remove but doesn't
++ // patch up list
++ pCUtListElmt GetNext() const { return cpNext; }
++ void SetNext(pCUtListElmt pNext) { cpNext = pNext; }
++ pCUtListElmt GetPrev() const { return cpPrev; }
++ void SetPrev(pCUtListElmt pPrev) { cpPrev = pPrev; }
++ void InsertAfter(pCUtListElmt pPrev)
++ {
++ cpNext = pPrev->cpNext;
++ cpPrev = pPrev;
++ cpNext->cpPrev = this;
++ pPrev->cpNext = this;
++ }
++
++private: // Data
++ pCUtListElmt cpNext;
++ pCUtListElmt cpPrev;
++};
++
++
++
++
++class CUtComparableListElmt : public CUtListElmt
++{
++public: // Methods
++ CUtComparableListElmt() { ; }
++ CUtComparableListElmt(pCUtComparableListElmt pPrev) :
++ CUtListElmt(pPrev) { ; }
++ CUtComparableListElmt(pCUtList pList) : CUtListElmt(pList) { ; }
++
++public: // Pure virtual methods
++#if 0 // Deleted by 2004-06-16
++ virtual int Compare(pCUtComparableListElmt pOther, LCID LangID = 0) = 0;
++#endif
++};
++
++
++
++
++class CUtList
++{
++public: // Methods
++ CUtList() { cDummyElmt.SetNext(&cDummyElmt);
++ cDummyElmt.SetPrev(&cDummyElmt); }
++ virtual ~CUtList();
++ pCUtListElmt GetFirst() { return cDummyElmt.GetNext(); }
++ pCUtListElmt GetLast() { return cDummyElmt.GetPrev(); }
++ pCUtListElmt GetTerminating() { return &cDummyElmt; }
++ pCUtListElmt CircularGetNext(pConstCUtListElmt pCurr);
++ pCUtListElmt CircularGetPrev(pConstCUtListElmt pCurr);
++ pCUtListElmt GetNextOrNULL(pCUtListElmt pCurr);
++ pCUtListElmt GetPrevOrNULL(pCUtListElmt pCurr);
++ UtBool IsEmpty() { return GetFirst() == GetTerminating(); };
++ UtBool ContainsAtLeastTwoItems() { return GetFirst() != GetLast(); };
++#if 0 // Deleted by 2004-06-16
++void Sort(LCID LangID = 0); // Assumes elements are of type CUtComparableListElmt
++#endif
++ int GetCount(void);
++ void Destroy(void);
++ pCUtListElmt GetIndex(int Index);
++ int GetIndex(pCUtListElmt pNode);
++
++private: // Data
++ CUtListElmt cDummyElmt;
++};
++
++
++
++
++class CUtOwningList : public CUtList
++{
++public: // Methods
++ ~CUtOwningList();
++};
++}//end namespace OpenStormBento
++#endif
Added: trunk/patches/lwp/cws-ooo11lotusfilter-lwp-xfilter.diff
==============================================================================
--- (empty file)
+++ trunk/patches/lwp/cws-ooo11lotusfilter-lwp-xfilter.diff Wed Oct 22 06:44:05 2008
@@ -0,0 +1,32460 @@
+diff -urNp lotuswordpro.bak/source/filter/xfilter/ixfattrlist.hxx lotuswordpro/source/filter/xfilter/ixfattrlist.hxx
+--- lotuswordpro.bak/source/filter/xfilter/ixfattrlist.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/ixfattrlist.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,90 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Interface for the attibute list of a xml element.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef _IXFATTRLIST_HXX
++#define _IXFATTRLIST_HXX
++
++#include <rtl/ustring.hxx>
++
++/**
++ * @brief
++ * Attribute list interface for sax writer.
++ * Implemente this interface for different sax writer. For OOo,i use the XDocumentHandler stream;
++ * for ouputting the local file system,It's just a vector container.
++ */
++class IXFAttrList
++{
++public:
++ virtual ~IXFAttrList(){}
++ /**
++ * @descr: Add a attribute to the attribute list.
++ */
++ virtual void AddAttribute(const rtl::OUString& name, const rtl::OUString& value) = 0;
++
++ /**
++ * @descr: Clear all the attributes in the attribute list.
++ */
++ virtual void Clear() = 0;
++};
++
++#endif //_IXFATTRLIST_HXX
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/ixfcontent.hxx lotuswordpro/source/filter/xfilter/ixfcontent.hxx
+--- lotuswordpro.bak/source/filter/xfilter/ixfcontent.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/ixfcontent.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,102 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Interface for the all content object,ie. text,paragraph,picture,and so on.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ * 2005-04-08 add clone function.
++ ************************************************************************/
++#ifndef _IXFCONTENT_HXX
++#define _IXFCONTENT_HXX
++
++#include "xfglobal.hxx"
++
++class IXFStyle;
++
++/**
++ * @brief Base interface for all content object.Implementation classes include text span,paragraph,
++ Drawing obejcts, image, ole and so on.
++ */
++class IXFContent : public IXFObject
++{
++public:
++ virtual ~IXFContent(){}
++ /**
++ * @descr Fetch the content type,not quite useful.
++ */
++ virtual enumXFContent GetContentType() = 0;
++
++ /**
++ * @descr Set style to apply. You can get the style name by use XFStyleManager::AddStyle(pStyle),
++ * or just set a fixed style name.
++ */
++ virtual void SetStyleName(rtl::OUString style) = 0;
++
++ /**
++ * @descr return the style name.
++ */
++ virtual rtl::OUString GetStyleName() = 0;
++
++ /**
++ * @descr Deep copy.
++ */
++ virtual IXFContent* Clone() = 0;
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/ixfobject.hxx lotuswordpro/source/filter/xfilter/ixfobject.hxx
+--- lotuswordpro.bak/source/filter/xfilter/ixfobject.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/ixfobject.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,91 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Interfer face for all object that will responsible for xml element output
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef IXFOBJECT_INC
++#define IXFOBJECT_INC
++
++class IXFStream;
++/*************************************************************************
++ * @descr
++ * This is the root interface for all object which will ouput something to
++ * the Sax Stream.
++ * I'll add reference management code later.
++ ************************************************************************/
++class IXFObject
++{
++public:
++ /**
++ * Virtual destructure function for all class,This makes the XFilter module
++ * a single-root framework.
++ */
++ virtual ~IXFObject(){}
++
++ /**
++ * The funciton to serial the object to the sax stream.
++ * The objects that must implements ToXml is divided into two types:
++ * 1. IXFStyle objects that has something to do with styles.
++ * 2. IXFContent objects that contents text or picture.
++ */
++ virtual void ToXml(IXFStream *pSaxStream) = 0;
++};
++
++#endif //IXFOBJECT_INC
+diff -urNp lotuswordpro.bak/source/filter/xfilter/ixfproperty.hxx lotuswordpro/source/filter/xfilter/ixfproperty.hxx
+--- lotuswordpro.bak/source/filter/xfilter/ixfproperty.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/ixfproperty.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,76 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Property for styles. ie. Margins,shadow,columns and so on.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-19 create this file.
++ ************************************************************************/
++#ifndef _IXFPROPERTY_HXX
++#define _IXFPROPERTY_HXX
++
++#include "ixfobject.hxx"
++
++class IXFStream;
++
++class IXFProperty : public IXFObject
++{
++public:
++
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/ixfstream.hxx lotuswordpro/source/filter/xfilter/ixfstream.hxx
+--- lotuswordpro.bak/source/filter/xfilter/ixfstream.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/ixfstream.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,114 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Sax stream to export xml to SODC.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef _IXFSTREAM_INC
++#define _IXFSTREAM_INC
++
++
++#include <rtl/ustring.hxx>
++
++class IXFAttrList;
++
++/**
++ * @brief
++ * Stream wrapper for sax writer.
++ */
++class IXFStream
++{
++public:
++ virtual ~IXFStream(){}
++ /**
++ * @descr Called when start write.Usually you can output document type info and xml encoding info.
++ */
++ virtual void StartDocument() = 0;
++
++ /**
++ * @descr called when end output.
++ */
++ virtual void EndDocument() = 0;
++
++ /**
++ * @descr Wrap XDocumentHandler::startElement()
++ * @param oustr element tag name.
++ */
++ virtual void StartElement(const rtl::OUString& oustr) = 0;
++
++ /**
++ * @descr Wrap XDocumentHandler::endElement()
++ * @param oustr element tag name.
++ */
++ virtual void EndElement(const rtl::OUString& oustr) = 0;
++
++ /**
++ * @descr output text node.
++ * @param oustr text content.
++ */
++ virtual void Characters(const rtl::OUString& oustr) = 0;
++
++ /**
++ * @descr return the Attribute list interface.
++ * @return attribute list.
++ */
++ virtual IXFAttrList* GetAttrList() = 0;
++};
++
++#endif //_IXFSTREAM_INC
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/ixfstyle.hxx lotuswordpro/source/filter/xfilter/ixfstyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/ixfstyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/ixfstyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,114 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Interfer for all style object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++
++#ifndef _IXFSTYLE_HXX
++#define _IXFSTYLE_HXX
++
++#include "xfglobal.hxx"
++/**
++ * @descr
++ * Interface for all style object.
++ */
++class IXFStyle : public IXFObject
++{
++public:
++ virtual ~IXFStyle(){}
++ /**
++ * @descr: return the style name.
++ */
++ virtual rtl::OUString GetStyleName() = 0;
++
++ /**
++ * @descr: set the name of the style.
++ */
++ virtual void SetStyleName(const rtl::OUString& styleName) = 0;
++
++ /**
++ * @descr return the parent style name.
++ */
++ virtual rtl::OUString GetParentStyleName() = 0;
++ /**
++ * @descr: Parant paragraph style.
++ */
++ virtual void SetParentStyleName(const rtl::OUString& parent) = 0;
++ /**
++ * @descr: return the style family. You can reference to enumXFStyle.
++ */
++ virtual enumXFStyle GetStyleFamily() = 0;
++
++ /**
++ * @descr: Set the style family,not quite useful.
++ */
++ virtual void SetStyleFamily(enumXFStyle family) = 0;
++
++ /**
++ * @descr: Compare wheather two style object are the same.Used only by XFStyleManager.
++ * @param: pStyle the style to be compared.
++ * @return: return sal_True if equals,else sal_False.
++ */
++ virtual sal_Bool Equal(IXFStyle *pStyle) = 0;
++
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/makefile.mk lotuswordpro/source/filter/xfilter/makefile.mk
+--- lotuswordpro.bak/source/filter/xfilter/makefile.mk 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/makefile.mk 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,148 @@
++#*************************************************************************
++#
++# The Contents of this file are made available subject to the terms of
++# either of the following licenses
++#
++# - GNU Lesser General Public License Version 2.1
++# - Sun Industry Standards Source License Version 1.1
++#
++# Sun Microsystems Inc., October, 2000
++#
++# GNU Lesser General Public License Version 2.1
++# =============================================
++# Copyright 2000 by Sun Microsystems, Inc.
++# 901 San Antonio Road, Palo Alto, CA 94303, USA
++#
++# 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
++#
++#
++# Sun Industry Standards Source License Version 1.1
++# =================================================
++# The contents of this file are subject to the Sun Industry Standards
++# Source License Version 1.1 (the "License"); You may not use this file
++# except in compliance with the License. You may obtain a copy of the
++# License at http://www.openoffice.org/license.html.
++#
++# Software provided under this License is provided on an "AS IS" basis,
++# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++# See the License for the specific provisions governing your rights and
++# obligations concerning the Software.
++#
++# The Initial Developer of the Original Code is: IBM Corporation
++#
++# Copyright: 2008 by IBM Corporation
++#
++# All Rights Reserved.
++#
++# Contributor(s): _______________________________________
++#
++#
++#
++#*************************************************************************
++
++PRJ=..$/..$/..
++
++PRJNAME=lwpfilter
++TARGET=xfilter
++
++
++#ENABLE_EXCEPTIONS=TRUE
++
++# --- Settings -----------------------------------------------------
++
++.INCLUDE : settings.mk
++
++
++SLOFILES= \
++ $(SLO)$/xfsaxattrlist.obj \
++ $(SLO)$/xfsaxstream.obj \
++ $(SLO)$/xffilestream.obj \
++ $(SLO)$/xffileattrlist.obj \
++ $(SLO)$/xfstylemanager.obj \
++ $(SLO)$/xfstyle.obj \
++ $(SLO)$/xftextstyle.obj \
++ $(SLO)$/xffont.obj \
++ $(SLO)$/xffontdecl.obj \
++ $(SLO)$/xfstylecont.obj \
++ $(SLO)$/xfcontentcontainer.obj \
++ $(SLO)$/xfutil.obj \
++ $(SLO)$/xfparastyle.obj \
++ $(SLO)$/xffontfactory.obj \
++ $(SLO)$/xftextcontent.obj \
++ $(SLO)$/xfparagraph.obj \
++ $(SLO)$/xftextspan.obj \
++ $(SLO)$/xfofficemeta.obj \
++ $(SLO)$/xfglobal.obj \
++ $(SLO)$/xflist.obj \
++ $(SLO)$/xftextheading.obj \
++ $(SLO)$/xfpagemaster.obj \
++ $(SLO)$/xfmasterpage.obj \
++ $(SLO)$/xfheaderstyle.obj \
++ $(SLO)$/xfsectionstyle.obj \
++ $(SLO)$/xfsection.obj \
++ $(SLO)$/xfliststyle.obj \
++ $(SLO)$/xfborders.obj \
++ $(SLO)$/xfshadow.obj \
++ $(SLO)$/xfcolor.obj \
++ $(SLO)$/xfcolumns.obj \
++ $(SLO)$/xfmargins.obj \
++ $(SLO)$/xfdatestyle.obj \
++ $(SLO)$/xftimestyle.obj \
++ $(SLO)$/xftime.obj \
++ $(SLO)$/xfdate.obj \
++ $(SLO)$/xfframe.obj \
++ $(SLO)$/xfframestyle.obj \
++ $(SLO)$/xftable.obj \
++ $(SLO)$/xfrow.obj \
++ $(SLO)$/xfcell.obj \
++ $(SLO)$/xfcolstyle.obj \
++ $(SLO)$/xfcellstyle.obj \
++ $(SLO)$/xfrowstyle.obj \
++ $(SLO)$/xftablestyle.obj \
++ $(SLO)$/xftabstyle.obj \
++ $(SLO)$/xfoutlinestyle.obj \
++ $(SLO)$/xfindex.obj \
++ $(SLO)$/xfbookmarkref.obj \
++ $(SLO)$/xfdrawobj.obj \
++ $(SLO)$/xfdrawline.obj \
++ $(SLO)$/xfdrawrect.obj \
++ $(SLO)$/xfdrawcircle.obj \
++ $(SLO)$/xfdrawellipse.obj \
++ $(SLO)$/xfdrawpolyline.obj \
++ $(SLO)$/xfdrawpolygon.obj \
++ $(SLO)$/xfdrawpath.obj \
++ $(SLO)$/xfdrawstyle.obj \
++ $(SLO)$/xfdrawlinestyle.obj \
++ $(SLO)$/xfdrawareastyle.obj \
++ $(SLO)$/xfimage.obj \
++ $(SLO)$/xfimagestyle.obj \
++ $(SLO)$/xfbase64.obj \
++ $(SLO)$/xfoleobj.obj \
++ $(SLO)$/xfbgimage.obj \
++ $(SLO)$/xfconfigmanager.obj \
++ $(SLO)$/xfnumberstyle.obj \
++ $(SLO)$/xffloatframe.obj \
++ $(SLO)$/xfentry.obj \
++ $(SLO)$/xfcrossref.obj \
++ $(SLO)$/xfdocfield.obj \
++ $(SLO)$/xfchange.obj \
++ $(SLO)$/xftextboxstyle.obj
++
++
++# --- Targets ------------------------------------------------------
++
++.INCLUDE : target.mk
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfannotation.hxx lotuswordpro/source/filter/xfilter/xfannotation.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfannotation.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfannotation.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,119 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Annotation object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-31 create this file.
++ ************************************************************************/
++#ifndef _XFANNOTATION_HXX
++#define _XFANNOTATION_HXX
++
++#include "xfglobal.hxx"
++#include "xfcontent.hxx"
++#include "xfcontentcontainer.hxx"
++
++class XFAnnotation : public XFContentContainer
++{
++public:
++ void SetDate(rtl::OUString date);
++
++ void SetAuthor(rtl::OUString author);
++
++ //void Add(IXFContent *pContent);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ rtl::OUString m_strDate;
++ rtl::OUString m_strAuthor;
++ //XFContentContainer m_aContents;
++};
++
++inline void XFAnnotation::SetDate(rtl::OUString date)
++{
++ m_strDate = date;
++}
++
++inline void XFAnnotation::SetAuthor(rtl::OUString author)
++{
++ m_strAuthor = author;
++}
++/*
++inline void XFAnnotation::Add(IXFContent *pContent)
++{
++ m_aContents.Add(pContent);
++}
++*/
++inline void XFAnnotation::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ if( m_strDate.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("office:create-date"), m_strDate );
++ if( m_strAuthor.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("office:author"), m_strAuthor);
++ pStrm->StartElement( A2OUSTR("office:annotation") );
++
++ //m_aContents.ToXml(pStrm);
++ XFContentContainer::ToXml(pStrm);
++
++ pStrm->EndElement( A2OUSTR("office:annotation") );
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfarrowstyle.hxx lotuswordpro/source/filter/xfilter/xfarrowstyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfarrowstyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfarrowstyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,130 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Line Arrow.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-04-06 create this file.
++ ************************************************************************/
++#ifndef _XFARROWSTYLE_HXX
++#define _XFARROWSTYLE_HXX
++
++#include "xfstyle.hxx"
++
++class XFArrowStyle : public XFStyle
++{
++public:
++ XFArrowStyle();
++
++public:
++ void SetArrowName(rtl::OUString name);
++
++ void SetViewbox(rtl::OUString viewBox);
++
++ void SetSVGPath(rtl::OUString path);
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ rtl::OUString m_strName;
++ rtl::OUString m_strViewBox;
++ rtl::OUString m_strPath;
++};
++
++inline XFArrowStyle::XFArrowStyle()
++{
++}
++
++inline void XFArrowStyle::SetArrowName(rtl::OUString name)
++{
++ m_strName = name;
++}
++
++inline void XFArrowStyle::SetViewbox(rtl::OUString viewBox)
++{
++ m_strViewBox = viewBox;
++}
++
++inline void XFArrowStyle::SetSVGPath(rtl::OUString path)
++{
++ m_strPath = path;
++}
++
++inline enumXFStyle XFArrowStyle::GetStyleFamily()
++{
++ return enumXFStyleArrow;
++}
++
++inline void XFArrowStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ if( m_strName.getLength()>0 )
++ pAttrList->AddAttribute( A2OUSTR("draw:name"), m_strName );
++ else
++ pAttrList->AddAttribute( A2OUSTR("draw:name"), GetStyleName() );
++
++ pAttrList->AddAttribute( A2OUSTR("svg:viewBox"), m_strViewBox );
++ pAttrList->AddAttribute( A2OUSTR("svg:d"), m_strPath );
++ pStrm->StartElement(A2OUSTR("draw:marker"));
++ pStrm->EndElement(A2OUSTR("draw:marker"));
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfbase64.cxx lotuswordpro/source/filter/xfilter/xfbase64.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfbase64.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfbase64.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,136 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Base64 tool.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-02 create this file.
++ * 2005-02-28 make Encode_(...) to be inline for speed.
++ ************************************************************************/
++#include "xfbase64.hxx"
++
++const sal_Char aBase64EncodeTable[] =
++{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
++'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
++'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
++'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
++'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' };
++
++/**
++ * @descr Encode 3 byte to 4 byte.
++ * Please refer to RFC to get the base64 algorithm.
++ */
++inline void Encode_(sal_uInt8 *src, sal_Char* dest)
++{
++ sal_Int32 nBinaer = (((sal_uInt8)src[ 0]) << 16) +
++ (((sal_uInt8)src[1]) << 8) +
++ ((sal_uInt8)src[2]);
++
++ sal_uInt8 nIndex = ((nBinaer & 0xFC0000) >> 18);
++ dest[0] = aBase64EncodeTable [nIndex];
++
++ nIndex = (nBinaer & 0x3F000) >> 12;
++ dest[1] =aBase64EncodeTable [nIndex];
++
++ nIndex = (nBinaer & 0xFC0) >> 6;
++ dest[2] = aBase64EncodeTable [nIndex];
++
++ nIndex = (nBinaer & 0x3F);
++ dest[3] = aBase64EncodeTable [nIndex];
++}
++
++/**
++ * @descr Base64 encode.
++ */
++rtl::OUString XFBase64::Encode(sal_uInt8 *buf, sal_Int32 len)
++{
++ sal_Char *buffer;
++ sal_Int32 nNeeded;
++ sal_Int32 cycles = len/3;
++ sal_Int32 remain = len%3;
++
++ if( remain == 0 )
++ nNeeded = cycles*4;
++ else
++ nNeeded = (cycles+1)*4;
++ buffer = new sal_Char[nNeeded+1];
++
++ rtl_zeroMemory(buffer,nNeeded+1);
++
++ for( sal_Int32 i=0; i<cycles; i++ )
++ Encode_(buf+i*3,buffer+i*4);
++
++ sal_uInt8 last[3];
++ if( remain == 1 )
++ {
++ last[0] = buf[len-1];
++ last[1] = last[2] = 0;
++ Encode_(last,buffer+nNeeded+1-5);
++ }
++ else if( remain == 2 )
++ {
++ last[0] = buf[len-2];
++ last[1] = buf[len-1];
++ last[2] = 0;
++ Encode_(last,buffer+nNeeded+1-5);
++ }
++
++ rtl::OUString str = rtl::OUString::createFromAscii(buffer);
++ delete[] buffer;
++
++ return str;
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfbase64.hxx lotuswordpro/source/filter/xfilter/xfbase64.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfbase64.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfbase64.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,84 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Base64 tool.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-02 create this file.
++ ************************************************************************/
++#ifndef _XFBASE64_HXX
++#define _XFBASE64_HXX
++
++#include "xfglobal.hxx"
++
++/**
++ * @brief
++ * Base64 algorithm implemetation.
++ * I only implements encode funtion now,i'll add decode if needed later.
++ * http://www.faqs.org/rfcs/rfc3548.html.
++ */
++
++class XFBase64
++{
++public:
++ /**
++ * @descr Encode binary buffer to base64 encoding.
++ */
++ static rtl::OUString Encode(sal_uInt8 *buf, sal_Int32 len);
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfbgimage.cxx lotuswordpro/source/filter/xfilter/xfbgimage.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfbgimage.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfbgimage.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,165 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Background image.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-03-01 created.
++ ************************************************************************/
++#include "xfbgimage.hxx"
++#include "xfbase64.hxx"
++
++XFBGImage::XFBGImage()
++{
++ m_bUserFileLink = sal_False;
++ m_bRepeate = sal_False;
++ m_bStretch = sal_False;
++ m_bPosition = sal_True;
++ m_eHoriAlign = enumXFAlignCenter;
++ m_eVertAlign = enumXFAlignCenter;
++}
++
++void XFBGImage::SetImageData(sal_uInt8 *buf, int len)
++{
++ m_strData = XFBase64::Encode(buf,len);
++ m_bUserFileLink = sal_False;
++}
++
++sal_Bool XFBGImage::Equal(IXFStyle *pStyle)
++{
++ return sal_False;
++}
++
++void XFBGImage::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ if( m_bUserFileLink )
++ {
++ pAttrList->AddAttribute( A2OUSTR("xlink:href"), m_strFileName);
++ }
++
++ pAttrList->AddAttribute( A2OUSTR("xlink:type"), A2OUSTR("simple") );
++ pAttrList->AddAttribute( A2OUSTR("xlink:actuate"), A2OUSTR("onLoad"));
++
++ if( m_bPosition )
++ {
++ rtl::OUString str = GetAlignName(m_eVertAlign) + A2OUSTR(" ");
++ if( m_eHoriAlign == enumXFAlignStart )
++ str += A2OUSTR("left");
++ else if( m_eHoriAlign == enumXFAlignCenter )
++ str += A2OUSTR("center");
++ else if( m_eHoriAlign == enumXFAlignEnd )
++ str += A2OUSTR("right");
++
++ pAttrList->AddAttribute( A2OUSTR("style:position"), str );
++ pAttrList->AddAttribute( A2OUSTR("style:repeat"), A2OUSTR("no-repeat") );
++ }
++ else if( m_bRepeate )
++ pAttrList->AddAttribute( A2OUSTR("style:repeat"), A2OUSTR("repeat") );
++ else if( m_bStretch )
++ pAttrList->AddAttribute( A2OUSTR("style:repeat"), A2OUSTR("stretch") );
++
++ pStrm->StartElement( A2OUSTR("style:background-image") );
++
++ if( !m_bUserFileLink )
++ {
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("office:binary-data") );
++ pStrm->Characters(m_strData);
++ pStrm->EndElement( A2OUSTR("office:binary-data") );
++ }
++
++ pStrm->EndElement( A2OUSTR("style:background-image") );
++}
++
++bool operator==(XFBGImage& img1, XFBGImage& img2)
++{
++ if( img1.m_bUserFileLink != img2.m_bUserFileLink )
++ return false;
++ if( img1.m_bUserFileLink )
++ {
++ if( img1.m_strFileName != img2.m_strFileName )
++ return false;
++ }
++ else
++ {
++ //I'll not compare the content of the two buffer,it's time comsuming.
++ return sal_False;
++ }
++ if( img1.m_bPosition != img2.m_bPosition )
++ return false;
++ if( img1.m_bRepeate != img2.m_bRepeate )
++ return false;
++ if( img1.m_bStretch != img2.m_bStretch )
++ return false;
++ if( img1.m_bPosition )
++ {
++ if( (img1.m_eHoriAlign != img2.m_eHoriAlign) || (img1.m_eVertAlign != img2.m_eVertAlign) )
++ return false;
++ }
++ return true;
++}
++
++bool operator!=(XFBGImage& img1, XFBGImage& img2)
++{
++ return !(img1==img2);
++}
++
++
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfbgimage.hxx lotuswordpro/source/filter/xfilter/xfbgimage.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfbgimage.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfbgimage.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,155 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Background image.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-03-01 created.
++ ************************************************************************/
++#ifndef _XFBGIMAGE_HXX
++#define _XFBGIMAGE_HXX
++
++#include "xfstyle.hxx"
++
++/**
++ * @brief
++ * Background image object.
++ */
++class XFBGImage : public XFStyle
++{
++public:
++ XFBGImage();
++
++public:
++ /**
++ * @descr Use file link as image source.
++ */
++ void SetFileLink(rtl::OUString fileName);
++
++ /**
++ * @descr Use base64 stream as image source.
++ */
++ void SetImageData(sal_uInt8 *buf, int len);
++
++ /**
++ * @descr Set the iamge position type.
++ */
++ void SetPosition(enumXFAlignType horiAlign = enumXFAlignCenter, enumXFAlignType vertAlign = enumXFAlignCenter);
++
++ /**
++ * @descr Set background image repeat style.
++ */
++ void SetRepeate();
++
++ /**
++ * @descr Set whether the image should be streatched to fill the owner object.
++ */
++ void SetStretch();
++
++ /**
++ * @descr decide whether there has been a style that is the same as this object.
++ * If it use base64 stream, i'll simply return sal_False because it's too slow to compare two base64 stream.
++ */
++ virtual sal_Bool Equal(IXFStyle *pStyle);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++ friend bool operator==(XFBGImage& img1, XFBGImage& img2);
++ friend bool operator!=(XFBGImage& img1, XFBGImage& img2);
++private:
++ rtl::OUString m_strFileName;
++ rtl::OUString m_strData;
++ sal_Bool m_bUserFileLink;
++ sal_Bool m_bRepeate;
++ sal_Bool m_bStretch;
++ sal_Bool m_bPosition;
++ enumXFAlignType m_eHoriAlign;
++ enumXFAlignType m_eVertAlign;
++};
++
++inline void XFBGImage::SetFileLink(rtl::OUString fileName)
++{
++ m_strFileName = fileName;
++ m_bUserFileLink = sal_True;
++}
++
++inline void XFBGImage::SetPosition(enumXFAlignType horiAlign, enumXFAlignType vertAlign)
++{
++ m_bPosition = sal_True;
++ m_eHoriAlign = horiAlign;
++ m_eVertAlign = vertAlign;
++
++ m_bStretch = sal_False;
++ m_bRepeate = sal_False;
++}
++
++inline void XFBGImage::SetRepeate()
++{
++ m_bRepeate = sal_True;
++ m_bStretch = sal_False;
++ m_bPosition = sal_False;
++}
++
++inline void XFBGImage::SetStretch()
++{
++ m_bStretch = sal_True;
++ m_bRepeate = sal_False;
++ m_bPosition = sal_False;
++}
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfbookmark.hxx lotuswordpro/source/filter/xfilter/xfbookmark.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfbookmark.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfbookmark.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,130 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Bookmark ref.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-02-03 create this file.
++ ************************************************************************/
++#ifndef _XFBOOKMARK_HXX
++#define _XFBOOKMARK_HXX
++
++#include "xfcontent.hxx"
++
++/**
++ * @brief
++ * Bookmark object.
++ */
++class XFBookmark : public XFContent
++{
++public:
++ XFBookmark(sal_Bool isStart)
++ {
++ m_bStart = isStart;
++ }
++
++ rtl::OUString GetDivision(){return m_strDivision;}
++ void SetDivision(rtl::OUString sDivName){m_strDivision = sDivName;}
++ rtl::OUString GetName(){return m_strName;}
++
++public:
++ /**
++ * @descr Set bookmark name, which will be used in bookmark-ref or formula.
++ */
++ void SetName(rtl::OUString name)
++ {
++ m_strName = name;
++ }
++
++ virtual void ToXml(IXFStream *pStrm)
++ {
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute( A2OUSTR("text:name"), m_strName );
++ if( m_bStart )
++ {
++ pStrm->StartElement( A2OUSTR("text:bookmark-start") );
++ pStrm->EndElement( A2OUSTR("text:bookmark-start") );
++ }
++ else
++ {
++ pStrm->StartElement( A2OUSTR("text:bookmark-end") );
++ pStrm->EndElement( A2OUSTR("text:bookmark-end") );
++ }
++ }
++
++private:
++ sal_Bool m_bStart;
++ rtl::OUString m_strName;
++ rtl::OUString m_strDivision;
++};
++
++class XFBookmarkStart : public XFBookmark
++{
++public:
++ XFBookmarkStart():XFBookmark(sal_True){}
++};
++
++class XFBookmarkEnd : public XFBookmark
++{
++public:
++ XFBookmarkEnd():XFBookmark(sal_False){}
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfbookmarkref.cxx lotuswordpro/source/filter/xfilter/xfbookmarkref.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfbookmarkref.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfbookmarkref.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,107 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Bookmark reference.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-02-03 create this file.
++ ************************************************************************/
++#include "xfbookmarkref.hxx"
++
++XFBookmarkRef::XFBookmarkRef()
++{
++ m_eRefType = enumXFBookmarkNone;
++}
++
++void XFBookmarkRef::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ assert(m_strBookmark.getLength() > 0 );
++ if( m_eRefType == enumXFBookmarkNone )
++ return;
++ else if( m_eRefType == enumXFBookmarkPage )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:reference-format"), A2OUSTR("page") );
++ pAttrList->AddAttribute( A2OUSTR("text:ref-name"), m_strBookmark );
++ }
++ else if( m_eRefType == enumXFBookmarkChapter )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:reference-format"), A2OUSTR("chapter") );
++ pAttrList->AddAttribute( A2OUSTR("text:ref-name"), m_strBookmark );
++ }
++ else if( m_eRefType == enumXFBookmarkPage )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:reference-format"), A2OUSTR("text") );
++ pAttrList->AddAttribute( A2OUSTR("text:ref-name"), m_strBookmark );
++
++ }
++ else if( m_eRefType == enumXFBookmarkDir )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:reference-format"), A2OUSTR("direction") );
++ pAttrList->AddAttribute( A2OUSTR("text:ref-name"), m_strBookmark );
++ }
++ else if( m_eRefType == enumXFBookmarkDef )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:ref-name"), m_strBookmark );
++ }
++ pStrm->StartElement( A2OUSTR("text:bookmark-ref") );
++ if( m_strText.getLength() )
++ pStrm->Characters(m_strBookmark);
++ pStrm->EndElement( A2OUSTR("text:bookmark-ref") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfbookmarkref.hxx lotuswordpro/source/filter/xfilter/xfbookmarkref.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfbookmarkref.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfbookmarkref.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,103 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Bookmark ref.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-02-03 create this file.
++ ************************************************************************/
++#ifndef _XFBOOKMARKREF_HXX
++#define _XFBOOKMARKREF_HXX
++
++#include "xfcontent.hxx"
++
++class XFBookmarkRef : public XFContent
++{
++public:
++ XFBookmarkRef();
++
++public:
++ void SetRefType(enumXFBookmarkRef type);
++
++ void SetBookmark(rtl::OUString name);
++
++ void SetText(rtl::OUString text);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ enumXFBookmarkRef m_eRefType;
++ rtl::OUString m_strBookmark;
++ rtl::OUString m_strText;
++};
++
++inline void XFBookmarkRef::SetRefType(enumXFBookmarkRef ref)
++{
++ m_eRefType = ref;
++}
++
++inline void XFBookmarkRef::SetBookmark(rtl::OUString name)
++{
++ m_strBookmark = name;
++}
++
++inline void XFBookmarkRef::SetText(rtl::OUString text)
++{
++ m_strText = text;
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfborders.cxx lotuswordpro/source/filter/xfilter/xfborders.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfborders.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfborders.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,361 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Border object,now only used by paragraph object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-14 create this file.
++ * 2005-01-17 change for the XFColor object.
++ ************************************************************************/
++#include "xfborders.hxx"
++
++XFBorder::XFBorder()
++{
++ m_fOffset = 0;
++ m_bDouble = sal_False;
++ m_bSameWidth = sal_False;
++ m_fWidthInner = 0;
++ m_fWidthSpace = 0;
++ m_fWidthOutter = 0;
++}
++
++void XFBorder::SetColor(XFColor& color)
++{
++ m_aColor = color;
++}
++
++void XFBorder::SetWidth(double width)
++{
++ if( !m_bDouble )
++ {
++ m_fWidthInner = width;
++ m_bSameWidth = sal_True;
++ }
++ else if( m_bDouble && m_bSameWidth )
++ {
++ m_fWidthInner = width;
++ m_fWidthOutter = width;
++ m_fWidthSpace = width;
++ }
++}
++
++void XFBorder::SetDoubleLine(sal_Bool dual,sal_Bool bSameWidth)
++{
++ m_bDouble = dual;
++ m_bSameWidth = bSameWidth;
++}
++
++void XFBorder::SetWidthInner(double inner)
++{
++ assert(m_bDouble);
++ m_fWidthInner = inner;
++}
++
++void XFBorder::SetWidthSpace(double space)
++{
++ assert(m_bDouble);
++ m_fWidthSpace = space;
++}
++
++void XFBorder::SetWidthOutter(double outer)
++{
++ assert(m_bDouble);
++ m_fWidthOutter = outer;
++}
++
++rtl::OUString XFBorder::GetLineWidth()
++{
++ rtl::OUString str;
++
++ if( m_bDouble )
++ {
++ str = FloatToOUString(m_fWidthInner);
++ str += A2OUSTR("cm ") + DoubleToOUString(m_fWidthSpace);
++ str += A2OUSTR("cm ") + DoubleToOUString(m_fWidthOutter) + A2OUSTR("cm");
++ }
++ return str;
++}
++
++rtl::OUString XFBorder::ToString()
++{
++ rtl::OUString str;
++
++ if( m_bDouble )
++ {
++ double width = m_fWidthInner + m_fWidthSpace + m_fWidthOutter;
++ if( width<FLOAT_MIN )
++ {
++ return str;
++ }
++
++ str = DoubleToOUString(width) + A2OUSTR("cm");
++ str += A2OUSTR(" double ") + m_aColor.ToString();
++ }
++ else
++ {
++ double width = m_fWidthInner;
++ if( width<FLOAT_MIN )
++ {
++ return str;
++ }
++ str = DoubleToOUString(width) + A2OUSTR("cm");
++ str += A2OUSTR(" solid ") + m_aColor.ToString();
++ }
++ return str;
++}
++
++bool operator==(XFBorder& b1, XFBorder& b2)
++{
++ if( b1.m_fOffset != b2.m_fOffset )
++ return false;
++ if( b1.m_bDouble != b2.m_bDouble )
++ return false;
++ if( !b1.m_bDouble )
++ {
++ if( b1.m_fWidthInner != b2.m_fWidthInner )
++ return false;
++ }
++ else
++ {
++ if( b1.m_bSameWidth != b2.m_bSameWidth )
++ return true;
++ if( b1.m_fWidthInner != b2.m_fWidthInner ||
++ b1.m_fWidthSpace != b2.m_fWidthSpace ||
++ b1.m_fWidthOutter != b2.m_fWidthOutter
++ )
++ return false;
++ }
++ if( b1.m_aColor != b2.m_aColor )
++ return sal_False;
++ return true;
++}
++
++bool operator!=(XFBorder& b1, XFBorder& b2)
++{
++ return !(b1 == b2);
++}
++
++//
++//XFBorders:
++//
++void XFBorders::SetColor(enumXFBorder side, XFColor& color)
++{
++ switch(side)
++ {
++ case enumXFBorderLeft:
++ m_aBorderLeft.SetColor(color);
++ break;
++ case enumXFBorderRight:
++ m_aBorderRight.SetColor(color);
++ break;
++ case enumXFBorderTop:
++ m_aBorderTop.SetColor(color);
++ break;
++ case enumXFBorderBottom:
++ m_aBorderBottom.SetColor(color);
++ break;
++ }
++}
++
++void XFBorders::SetWidth(enumXFBorder side, double width)
++{
++ switch(side)
++ {
++ case enumXFBorderLeft:
++ m_aBorderLeft.SetWidth(width);
++ break;
++ case enumXFBorderRight:
++ m_aBorderRight.SetWidth(width);
++ break;
++ case enumXFBorderTop:
++ m_aBorderTop.SetWidth(width);
++ break;
++ case enumXFBorderBottom:
++ m_aBorderBottom.SetWidth(width);
++ break;
++ }
++}
++
++void XFBorders::SetDoubleLine(enumXFBorder side, sal_Bool dual,sal_Bool bSameWidth)
++{
++ switch(side)
++ {
++ case enumXFBorderLeft:
++ m_aBorderLeft.SetDoubleLine(dual,bSameWidth);
++ break;
++ case enumXFBorderRight:
++ m_aBorderRight.SetDoubleLine(dual,bSameWidth);
++ break;
++ case enumXFBorderTop:
++ m_aBorderTop.SetDoubleLine(dual,bSameWidth);
++ break;
++ case enumXFBorderBottom:
++ m_aBorderBottom.SetDoubleLine(dual,bSameWidth);
++ break;
++ }
++}
++
++void XFBorders::SetWidthInner(enumXFBorder side, double inner)
++{
++ switch(side)
++ {
++ case enumXFBorderLeft:
++ m_aBorderLeft.SetWidthInner(inner);
++ break;
++ case enumXFBorderRight:
++ m_aBorderRight.SetWidthInner(inner);
++ break;
++ case enumXFBorderTop:
++ m_aBorderTop.SetWidthInner(inner);
++ break;
++ case enumXFBorderBottom:
++ m_aBorderBottom.SetWidthInner(inner);
++ break;
++ }
++}
++
++void XFBorders::SetWidthSpace(enumXFBorder side, double space)
++{
++ switch(side)
++ {
++ case enumXFBorderLeft:
++ m_aBorderLeft.SetWidthSpace(space);
++ break;
++ case enumXFBorderRight:
++ m_aBorderRight.SetWidthSpace(space);
++ break;
++ case enumXFBorderTop:
++ m_aBorderTop.SetWidthSpace(space);
++ break;
++ case enumXFBorderBottom:
++ m_aBorderBottom.SetWidthSpace(space);
++ break;
++ }
++}
++
++void XFBorders::SetWidthOutter(enumXFBorder side, double outer)
++{
++ switch(side)
++ {
++ case enumXFBorderLeft:
++ m_aBorderLeft.SetWidthOutter(outer);
++ break;
++ case enumXFBorderRight:
++ m_aBorderRight.SetWidthOutter(outer);
++ break;
++ case enumXFBorderTop:
++ m_aBorderTop.SetWidthOutter(outer);
++ break;
++ case enumXFBorderBottom:
++ m_aBorderBottom.SetWidthOutter(outer);
++ break;
++ }
++}
++
++bool operator ==(XFBorders& b1, XFBorders& b2)
++{
++ if( b1.m_aBorderLeft != b2.m_aBorderLeft )
++ return false;
++ if( b1.m_aBorderRight != b2.m_aBorderRight )
++ return false;
++ if( b1.m_aBorderTop != b2.m_aBorderTop )
++ return false;
++ if( b1.m_aBorderBottom != b2.m_aBorderBottom )
++ return false;
++ return true;
++}
++
++bool operator!=(XFBorders& b1, XFBorders& b2)
++{
++ return !(b1 == b2);
++}
++
++void XFBorders::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ if( m_aBorderLeft.GetLineWidth().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("style:border-line-width-left"), m_aBorderLeft.GetLineWidth() );
++ if( m_aBorderRight.GetLineWidth().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("style:border-line-width-right"), m_aBorderRight.GetLineWidth() );
++ if( m_aBorderTop.GetLineWidth().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("style:border-line-width-top"), m_aBorderTop.GetLineWidth() );
++ if( m_aBorderBottom.GetLineWidth().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("style:border-line-width-bottom"), m_aBorderBottom.GetLineWidth() );
++
++ if( m_aBorderLeft.ToString().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("fo:border-left"), m_aBorderLeft.ToString() );
++ else
++ pAttrList->AddAttribute( A2OUSTR("fo:border-left"), A2OUSTR("none") );
++
++ if( m_aBorderRight.ToString().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("fo:border-right"), m_aBorderRight.ToString() );
++ else
++ pAttrList->AddAttribute( A2OUSTR("fo:border-right"), A2OUSTR("none") );
++
++ if( m_aBorderTop.ToString().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("fo:border-top"), m_aBorderTop.ToString() );
++ else
++ pAttrList->AddAttribute( A2OUSTR("fo:border-top"), A2OUSTR("none") );
++
++ if( m_aBorderBottom.ToString().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("fo:border-bottom"), m_aBorderBottom.ToString() );
++ else
++ pAttrList->AddAttribute( A2OUSTR("fo:border-bottom"), A2OUSTR("none") );
++
++}
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfborders.hxx lotuswordpro/source/filter/xfilter/xfborders.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfborders.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfborders.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,195 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Border object,now only used by paragraph object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-14 create this file.
++ * 2005-01-17 changed for the XFColor object.
++ ************************************************************************/
++#ifndef _XFBORDERS_HXX
++#define _XFBORDERS_HXX
++
++#include "xfglobal.hxx"
++#include "xfcolor.hxx"
++
++/**
++ * @brief
++ * Single border obejct for all objects with borders.
++ */
++class XFBorder
++{
++public:
++ XFBorder();
++
++public:
++ /**
++ * @descr Set border color.
++ */
++ void SetColor(XFColor& color);
++
++ /**
++ * @descr Set border width in cm.
++ */
++ void SetWidth(double width);
++
++ /**
++ * @descr Set whether the border has double line.
++ */
++ void SetDoubleLine(sal_Bool dual,sal_Bool bSameWidth);
++
++ /**
++ * @descr Set inner line width for border with double line.
++ */
++ void SetWidthInner(double inner);
++
++ /**
++ * @descr Set space between double lines fo border.
++ */
++ void SetWidthSpace(double space);
++
++ /**
++ * @descr Set outter line width for border with double line.
++ */
++ void SetWidthOutter(double outer);
++
++private:
++ /**
++ * @descr Forst line width to OOo border width format.
++ */
++ rtl::OUString GetLineWidth();
++
++ rtl::OUString ToString();
++
++ friend bool operator==(XFBorder& b1, XFBorder& b2);
++ friend bool operator!=(XFBorder& b1, XFBorder& b2);
++ friend class XFBorders;
++
++private:
++ double m_fOffset;
++ XFColor m_aColor;
++ sal_Bool m_bDouble;
++ sal_Bool m_bSameWidth;
++ double m_fWidthInner;
++ double m_fWidthSpace;
++ double m_fWidthOutter;
++};
++
++/**
++ * @brief
++ * Borders for object with borders.
++ * Borders may include (right,left,top,bottom) borders.
++ */
++class XFBorders
++{
++public:
++ XFBorders(){}
++
++public:
++ /**
++ * @descr Set color of border side.
++ */
++ void SetColor(enumXFBorder side, XFColor& color);
++
++ /**
++ * @descr Set width or border side.
++ */
++ void SetWidth(enumXFBorder side, double width);
++
++ /**
++ * @descr Set border side as doubel line.
++ * @param bSameWidth whether two borders are same width.
++ */
++ void SetDoubleLine(enumXFBorder side, sal_Bool dual,sal_Bool bSameWidth);
++
++ /**
++ * @descr Set inner border with of border side.
++ */
++ void SetWidthInner(enumXFBorder side, double inner);
++
++ /**
++ * @descr Set space between two borders fo border side.
++ */
++ void SetWidthSpace(enumXFBorder side, double space);
++
++ /**
++ * @descr Set outter border width of border side.
++ */
++ void SetWidthOutter(enumXFBorder side, double outer);
++
++ XFBorder * GetLeft() {return &m_aBorderLeft;};
++
++ XFBorder * GetRight() {return &m_aBorderRight;};
++
++ XFBorder * GetTop() {return &m_aBorderTop;};
++
++ XFBorder * GetBottom() {return &m_aBorderBottom;};
++
++ void ToXml(IXFStream *pStrm);
++
++ friend bool operator==(XFBorders& b1, XFBorders& b2);
++ friend bool operator!=(XFBorders& b1, XFBorders& b2);
++
++private:
++ XFBorder m_aBorderLeft;
++ XFBorder m_aBorderRight;
++ XFBorder m_aBorderTop;
++ XFBorder m_aBorderBottom;
++};
++
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfbreaks.hxx lotuswordpro/source/filter/xfilter/xfbreaks.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfbreaks.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfbreaks.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,146 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Breaks of paragraph.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-27 create this file.
++ ************************************************************************/
++#ifndef _XFBREAKS_HXX
++#define _XFBREAKS_HXX
++
++#include "xfglobal.hxx"
++#include "ixfproperty.hxx"
++
++/**
++ * @descr Page|Column break object.
++ */
++class XFBreaks : public IXFProperty
++{
++public:
++ XFBreaks();
++
++ XFBreaks(enumXFBreaks breaks);
++
++public:
++ /**
++ * @descr Set break type, pls refer to enumXFBreaks.
++ */
++ void SetBreakType(enumXFBreaks breaks);
++
++ /**
++ * @descr Output breaks object.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++
++ friend bool operator==(XFBreaks& b1, XFBreaks& b2);
++ friend bool operator!=(XFBreaks& b1, XFBreaks& b2);
++
++private:
++ enumXFBreaks m_eBreaks;
++};
++
++inline XFBreaks::XFBreaks()
++{
++ m_eBreaks = enumXFBreakAuto;
++}
++
++inline XFBreaks::XFBreaks(enumXFBreaks breaks):m_eBreaks(breaks)
++{
++}
++
++inline void XFBreaks::SetBreakType(enumXFBreaks breaks)
++{
++ m_eBreaks = breaks;
++}
++
++inline void XFBreaks::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ switch(m_eBreaks)
++ {
++ case enumXFBreakAuto:
++ break;
++ case enumXFBreakBefPage:
++ pAttrList->AddAttribute( A2OUSTR("fo:break-before"), A2OUSTR("page") );
++ break;
++ case enumXFBreakBefColumn:
++ pAttrList->AddAttribute( A2OUSTR("fo:break-before"), A2OUSTR("column") );
++ break;
++ case enumXFBreakAftPage:
++ pAttrList->AddAttribute( A2OUSTR("fo:break-after"), A2OUSTR("page") );
++ break;
++ case enumXFBreakAftColumn:
++ pAttrList->AddAttribute( A2OUSTR("fo:break-after"), A2OUSTR("column") );
++ break;
++ case enumXFBreakKeepWithNext:
++ pAttrList->AddAttribute( A2OUSTR("fo:keep-with-next"), A2OUSTR("true") );
++ break;
++ }
++}
++
++inline bool operator==(XFBreaks& b1, XFBreaks& b2)
++{
++ return b1.m_eBreaks == b2.m_eBreaks;
++}
++
++inline bool operator!=(XFBreaks& b1, XFBreaks& b2)
++{
++ return !(b1==b2);
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcell.cxx lotuswordpro/source/filter/xfilter/xfcell.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfcell.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfcell.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,304 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Table cell.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-21 create this file.
++ ************************************************************************/
++#include "xfcell.hxx"
++#include "xfparagraph.hxx"
++#include "xftable.hxx"
++#include "xfrow.hxx"
++
++XFCell::XFCell()
++{
++ m_pSubTable = NULL;
++ m_nCol = 0;
++ m_nColSpaned = 1;
++ m_nRepeated = 0;
++ m_eValueType = enumXFValueTypeNone;
++ m_bProtect = sal_False;
++}
++
++XFCell::XFCell(const XFCell& other)
++{
++ if( other.m_pSubTable )
++ m_pSubTable = new XFTable(*other.m_pSubTable);
++ else
++ m_pSubTable = NULL;
++ m_pOwnerRow = NULL;
++ m_nCol = other.m_nCol;
++ m_nColSpaned = other.m_nColSpaned;
++ m_nRepeated = other.m_nRepeated;
++ m_eValueType = other.m_eValueType;
++ m_bProtect = other.m_bProtect;
++ m_strValue = other.m_strValue;
++ m_strDisplay = other.m_strDisplay;
++ m_strFormula = other.m_strFormula;
++}
++
++XFCell& XFCell::operator=(const XFCell& other)
++{
++ if( m_pSubTable )
++ delete m_pSubTable;
++
++ if( other.m_pSubTable )
++ m_pSubTable = new XFTable(*other.m_pSubTable);
++ else
++ m_pSubTable = NULL;
++ m_pOwnerRow = NULL;
++ m_nCol = other.m_nCol;
++ m_nColSpaned = other.m_nColSpaned;
++ m_nRepeated = other.m_nRepeated;
++ m_eValueType = other.m_eValueType;
++ m_bProtect = other.m_bProtect;
++ m_strValue = other.m_strValue;
++ m_strDisplay = other.m_strDisplay;
++ m_strFormula = other.m_strFormula;
++
++ return *this;
++}
++
++XFCell::~XFCell()
++{
++ if( m_pSubTable )
++ delete m_pSubTable;
++}
++
++void XFCell::Add(IXFContent *pContent)
++{
++ if( m_eValueType != enumXFValueTypeNone )
++ {
++ Reset();
++ m_eValueType = enumXFValueTypeNone;
++ }
++ if( m_pSubTable )
++ {
++ assert(false);
++ return;
++ }
++ if( pContent->GetContentType() == enumXFContentTable )
++ {
++ XFTable *pTable = static_cast<XFTable*>(pContent);
++ if( !pTable )
++ return;
++ //the sub table will fill all the cell, there can't be other contents.
++ pTable->SetOwnerCell(this);
++ m_pSubTable = pTable;
++ }
++ else if( pContent->GetContentType() == enumXFContentText )
++ {
++ XFParagraph *pPara = new XFParagraph();
++ pPara->Add(pContent);
++ XFContentContainer::Add(pPara);
++ }
++ else if( pContent->GetContentType() == enumXFContentFrame )
++ {
++ XFParagraph *pPara = new XFParagraph();
++ pPara->Add(pContent);
++ XFContentContainer::Add(pPara);
++ }
++ else
++ {
++ XFContentContainer::Add(pContent);
++ }
++}
++
++
++void XFCell::SetValue(double value)
++{
++ SetValue(DoubleToOUString(value,18));
++}
++
++void XFCell::SetValue(rtl::OUString value)
++{
++ m_eValueType = enumXFValueTypeFloat;
++ m_strValue = value;
++
++ //Reset();
++ //XFParagraph *pPara = new XFParagraph();
++ //pPara->Add(m_strValue);
++ //XFContentContainer::Add(pPara);
++}
++
++void XFCell::SetString(rtl::OUString str)
++{
++ m_eValueType = enumXFValueTypeString;
++ m_strValue = str;
++
++ Reset();
++ XFParagraph *pPara = new XFParagraph();
++ pPara->Add(m_strValue);
++ XFContentContainer::Add(pPara);
++}
++
++void XFCell::SetPercent(double percent)
++{
++ SetPercent(DoubleToOUString(percent));
++}
++
++void XFCell::SetPercent(rtl::OUString percent)
++{
++ m_eValueType = enumXFValueTypePercentage;
++ m_strValue = percent;
++
++ Reset();
++ XFParagraph *pPara = new XFParagraph();
++ pPara->Add(m_strValue);
++ XFContentContainer::Add(pPara);
++}
++
++void XFCell::SetDate(rtl::OUString date)
++{
++ m_eValueType = enumXFValueTypeDate;
++ m_strValue = date;
++
++ Reset();
++ XFParagraph *pPara = new XFParagraph();
++ pPara->Add(m_strValue);
++ XFContentContainer::Add(pPara);
++}
++
++void XFCell::SetTime(rtl::OUString time)
++{
++ m_eValueType = enumXFValueTypeTime;
++ m_strValue = time;
++
++ Reset();
++ XFParagraph *pPara = new XFParagraph();
++ pPara->Add(m_strValue);
++ XFContentContainer::Add(pPara);
++}
++
++void XFCell::SetCurrency(rtl::OUString currency)
++{
++ m_eValueType = enumXFValueTypeCurrency;
++ m_strValue = currency;
++
++ Reset();
++ XFParagraph *pPara = new XFParagraph();
++ pPara->Add(m_strValue);
++ XFContentContainer::Add(pPara);
++}
++
++void XFCell::SetDisplay(rtl::OUString display)
++{
++ m_strDisplay = display;
++
++ Reset();
++ XFParagraph *pPara = new XFParagraph();
++ pPara->Add(m_strDisplay);
++ XFContentContainer::Add(pPara);
++}
++
++rtl::OUString XFCell::GetCellName()
++{
++ rtl::OUString name;
++ XFRow *pRow = m_pOwnerRow;
++ XFTable *pTable = pRow->GetOwnerTable();
++
++ if( !pRow || !pTable )
++ return A2OUSTR("");
++ if( pTable->IsSubTable() )
++ {
++ name = pTable->GetTableName() + A2OUSTR(".") + Int32ToOUString(m_nCol) + A2OUSTR(".") + Int32ToOUString(pRow->GetRow());
++ }
++ else
++ {
++ name = GetTableColName(m_nCol) + Int32ToOUString(pRow->GetRow());
++ }
++ return name;
++}
++
++void XFCell::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ if( GetStyleName().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("table:style-name"), GetStyleName() );
++ if( m_nColSpaned>1 )
++ pAttrList->AddAttribute( A2OUSTR("table:number-columns-spanned"), Int32ToOUString(m_nColSpaned) );
++ if( m_nRepeated )
++ pAttrList->AddAttribute( A2OUSTR("table:number-columns-repeated"), Int32ToOUString(m_nRepeated) );
++ if( m_eValueType != enumXFValueTypeNone )
++ {
++ pAttrList->AddAttribute( A2OUSTR("table:value-type"), GetValueType(m_eValueType) );
++ pAttrList->AddAttribute( A2OUSTR("table:value"), m_strValue );
++ }
++ if( m_strFormula.getLength() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("table:formula"), m_strFormula );
++
++ if( m_bProtect )
++ pAttrList->AddAttribute( A2OUSTR("table:protected"), A2OUSTR("true") );
++
++ //for test only.
++// pAttrList->AddAttribute( A2OUSTR("table:cell-name"), GetCellName() );
++
++ pStrm->StartElement( A2OUSTR("table:table-cell") );
++
++ if( m_pSubTable )
++ m_pSubTable->ToXml(pStrm);
++ else
++ {
++ XFContentContainer::ToXml(pStrm);
++ }
++
++ pStrm->EndElement( A2OUSTR("table:table-cell") );
++}
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcell.hxx lotuswordpro/source/filter/xfilter/xfcell.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfcell.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfcell.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,261 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Table cell.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-21 create this file.
++ ************************************************************************/
++#ifndef _XFCell_HXX
++#define _XFCell_HXX
++
++#include "xfcontent.hxx"
++#include "xfcontentcontainer.hxx"
++#include <vector>
++
++class XFTable;
++class XFRow;
++
++/**
++ * @descr Table cell object.
++ */
++class XFCell : public XFContentContainer
++{
++public:
++ XFCell();
++
++ XFCell(const XFCell& other);
++
++ XFCell& operator=(const XFCell& other);
++
++ virtual ~XFCell();
++
++public:
++ /**
++ * @descr Add content for table cell.
++ */
++ void Add(IXFContent *pContent);
++
++ /**
++ * @descr If cell spans more the one column, then set column span.
++ */
++ void SetColumnSpaned(sal_Int32 num);
++
++ /**
++ * @descr Set whether the following cells use the same style and content.
++ */
++ void SetRepeated(sal_Int32 num);
++
++ /**
++ * @descr Set cell number value.
++ */
++ void SetValue(double value);
++
++ /**
++ * @descr Set cell number value.
++ */
++ void SetValue(rtl::OUString value);
++
++ /**
++ * @descr Set cell string value.
++ */
++ void SetString(rtl::OUString str);
++
++ /**
++ * @descr Set cell as a percent value with value percent.
++ */
++ void SetPercent(double percent);
++
++ /**
++ * @descr Set cell as a percent value with value percent.
++ */
++ void SetPercent(rtl::OUString percent);
++
++ /**
++ * @descr Set cell as a date value.
++ */
++ void SetDate(rtl::OUString date);
++
++ /**
++ * @descr Set cell as a time value.
++ */
++ void SetTime(rtl::OUString time);
++
++ /**
++ * @descr Set cell as a currency value.
++ */
++ void SetCurrency(rtl::OUString currency);
++
++ /**
++ * @descr Set cell display string.
++ */
++ void SetDisplay(rtl::OUString display);
++
++ /**
++ * @descr Set cell formula.
++ */
++ void SetFormula(rtl::OUString formula);
++
++ /**
++ * @descr Set cell protected.
++ */
++ void SetProtect(sal_Bool protect=sal_True);
++
++ /**
++ * @descr Set cell column id.
++ */
++ void SetCol(sal_Int32 col);
++
++ /**
++ * @descr Set cell owner row.
++ */
++ void SetOwnerRow(XFRow *pRow);
++
++ /**
++ * @descr Return cell name. It's a tool function for formula.
++ */
++ rtl::OUString GetCellName();
++
++ /**
++ * @descr Return cell column id.
++ */
++ sal_Int32 GetCol();
++
++ /**
++ * @descr return cell'owner row.
++ */
++ XFRow* GetOwnerRow();
++
++ /**
++ * @descr If cell has a sub-table, return it, else return NULL.
++ */
++ XFTable* GetSubTable();
++
++ /**
++ * @descr return cell column span property.
++ */
++ sal_Int32 GetColSpaned();
++
++ /**
++ * @descr Output cell as xml element.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ XFRow *m_pOwnerRow;
++ XFTable *m_pSubTable;
++ sal_Int32 m_nCol;
++ sal_Int32 m_nColSpaned;
++ sal_Int32 m_nRepeated;
++ enumXFValueType m_eValueType;
++ rtl::OUString m_strValue;
++ rtl::OUString m_strDisplay;
++ rtl::OUString m_strFormula;
++ sal_Bool m_bProtect;
++};
++
++inline void XFCell::SetColumnSpaned(sal_Int32 num)
++{
++ m_nColSpaned = num;
++}
++
++inline void XFCell::SetRepeated(sal_Int32 repeated)
++{
++ m_nRepeated = repeated;
++}
++
++inline void XFCell::SetFormula(rtl::OUString formula)
++{
++ m_strFormula = formula;
++}
++
++inline void XFCell::SetProtect(sal_Bool protect/* =sal_True */)
++{
++ m_bProtect = protect;
++}
++
++inline void XFCell::SetCol(sal_Int32 col)
++{
++ m_nCol = col;
++}
++
++inline void XFCell::SetOwnerRow(XFRow *pRow)
++{
++ m_pOwnerRow = pRow;
++}
++
++inline sal_Int32 XFCell::GetCol()
++{
++ return m_nCol;
++}
++
++inline XFRow* XFCell::GetOwnerRow()
++{
++ return m_pOwnerRow;
++}
++
++inline XFTable* XFCell::GetSubTable()
++{
++ return m_pSubTable;
++}
++
++inline sal_Int32 XFCell::GetColSpaned()
++{
++ return m_nColSpaned;
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcellstyle.cxx lotuswordpro/source/filter/xfilter/xfcellstyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfcellstyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfcellstyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,308 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Table cell style. Number format, string value, and so on...
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-28 create this file.
++ ************************************************************************/
++#include "xfcellstyle.hxx"
++#include "xfborders.hxx"
++#include "xffont.hxx"
++#include "xfbgimage.hxx"
++
++
++XFCellStyle::XFCellStyle()
++{
++ m_eHoriAlign = enumXFAlignNone;
++ m_eVertAlign = enumXFAlignNone;
++ m_fTextIndent = 0;
++ m_pBorders = NULL;
++ m_pFont = NULL;
++ m_pBackImage = NULL;
++ m_bWrapText = sal_False;
++}
++
++XFCellStyle::~XFCellStyle()
++{
++ if( m_pBorders )
++ delete m_pBorders;
++}
++
++
++void XFCellStyle::SetParentStyle(rtl::OUString parent)
++{
++ m_strParentStyleName = parent;
++}
++
++void XFCellStyle::SetFont(XFFont *pFont)
++{
++ m_pFont = pFont;
++}
++
++void XFCellStyle::SetIndent(double indent )
++{
++ m_fTextIndent = indent;
++}
++
++void XFCellStyle::SetMargins(double left, double right, double top, double bottom)
++{
++ if( left != -1 )
++ m_aMargin.SetLeft(left);
++ if( right != -1 )
++ m_aMargin.SetRight(right);
++ if( top != -1 )
++ m_aMargin.SetTop(top);
++ if( bottom != -1 )
++ m_aMargin.SetBottom( bottom );
++}
++
++void XFCellStyle::SetPadding(double left, double right,double top, double bottom)
++{
++ if( left != -1 )
++ m_aPadding.SetLeft(left);
++ if( right != -1 )
++ m_aPadding.SetRight(right);
++ if( top != -1 )
++ m_aPadding.SetTop(top);
++ if( bottom != -1 )
++ m_aPadding.SetBottom( bottom );
++}
++
++void XFCellStyle::SetShadow(enumXFShadowPos pos, double offset, XFColor& color)
++{
++ m_aShadow.SetPosition(pos);
++ m_aShadow.SetOffset(offset);
++ m_aShadow.SetColor(color);
++}
++
++void XFCellStyle::SetBackColor(XFColor& color)
++{
++ m_aBackColor = color;
++}
++
++void XFCellStyle::SetBackImage(XFBGImage *pImage)
++{
++ if( m_pBackImage )
++ delete m_pBackImage;
++ m_pBackImage = pImage;
++}
++
++void XFCellStyle::SetBorders(XFBorders *pBorders)
++{
++ if( m_pBorders )
++ delete m_pBorders;
++ m_pBorders = pBorders;
++}
++
++enumXFStyle XFCellStyle::GetStyleFamily()
++{
++ return enumXFStyleTableCell;
++}
++
++/**
++ *Affirm whether two XFCellStyle objects are equal.
++ */
++sal_Bool XFCellStyle::Equal(IXFStyle *pStyle)
++{
++ if( this == pStyle )
++ return sal_True;
++ if( !pStyle || pStyle->GetStyleFamily() != enumXFStyleTableCell )
++ return sal_False;
++
++ XFCellStyle *pOther = static_cast<XFCellStyle*>(pStyle);
++ if( !pOther )
++ return sal_False;
++
++ if( m_strDataStyle != pOther->m_strDataStyle )
++ return sal_False;
++
++ if( m_strParentStyleName != pOther->m_strParentStyleName )
++ return sal_False;
++ if( m_fTextIndent != pOther->m_fTextIndent )
++ return sal_False;
++
++ //align:
++ if( m_eHoriAlign != pOther->m_eHoriAlign )
++ return sal_False;
++ if( m_eVertAlign != pOther->m_eVertAlign )
++ return sal_False;
++
++ if( m_aBackColor != pOther->m_aBackColor )
++ return sal_False;
++ //shadow:
++ if( m_aShadow != pOther->m_aShadow )
++ return sal_False;
++ //margin:
++ if( m_aMargin != pOther->m_aMargin )
++ return sal_False;
++ //padding:
++ if( m_aPadding != pOther->m_aPadding )
++ return sal_False;
++
++ //wrap:
++ if( m_bWrapText != pOther->m_bWrapText )
++ return sal_False;
++
++ //font:
++ if( m_pFont )
++ {
++ if( !pOther->m_pFont )
++ return sal_False;
++ if(*m_pFont != *pOther->m_pFont )
++ return sal_False;
++ }
++ else if( pOther->m_pFont )
++ return sal_False;
++
++ //border:
++ if( m_pBorders )
++ {
++ if( !pOther->m_pBorders )
++ return sal_False;
++ if( *m_pBorders != *pOther->m_pBorders )
++ return sal_False;
++ }
++ else if( pOther->m_pBorders )
++ return sal_False;
++
++ //if there is backimage
++ if( m_pBackImage )
++ {
++ if( !pOther->m_pBackImage )
++ return sal_False;
++ if( !m_pBackImage->Equal(pOther) )
++ return sal_False;
++ }
++ else
++ {
++ if( pOther->m_pBackImage )
++ return sal_False;
++ }
++
++ return sal_True;
++}
++
++void XFCellStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ rtl::OUString style = GetStyleName();
++
++ pAttrList->Clear();
++ if( style.getLength() )
++ pAttrList->AddAttribute(A2OUSTR("style:name"),GetStyleName());
++ if( GetParentStyleName().getLength() > 0 )
++ pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
++
++ pAttrList->AddAttribute(A2OUSTR("style:family"), A2OUSTR("table-cell"));
++ if( m_strParentStyleName.getLength() > 0 )
++ pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),m_strParentStyleName);
++ if( m_strDataStyle.getLength()>0 )
++ pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), m_strDataStyle );
++
++ pStrm->StartElement(A2OUSTR("style:style"));
++
++ //Paragraph properties:
++ pAttrList->Clear();
++
++ //text indent:
++ if( m_fTextIndent>FLOAT_MIN )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:text-indent"), DoubleToOUString(m_fTextIndent) + A2OUSTR("cm") );
++ }
++ //padding:
++ m_aPadding.ToXml(pStrm);
++ //margin:
++ m_aMargin.ToXml(pStrm);
++
++ //text horizontal align:
++ if( m_eHoriAlign != enumXFAlignNone )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:text-align"), GetAlignName(m_eHoriAlign) );
++ }
++ //text vertical align
++ if( m_eVertAlign != enumXFAlignNone )
++ pAttrList->AddAttribute( A2OUSTR("fo:vertical-align"), GetAlignName(m_eVertAlign) );
++
++ //wrap text:
++ if( m_bWrapText )
++ pAttrList->AddAttribute( A2OUSTR("fo:wrap-option"), A2OUSTR("wrap") );
++
++ //shadow:
++ m_aShadow.ToXml(pStrm);
++ //borders:
++ if( m_pBorders )
++ m_pBorders->ToXml(pStrm);
++
++ //background color:
++ if( m_aBackColor.IsValid() && !m_pBackImage )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
++ }
++ //Font properties:
++ if( m_pFont )
++ m_pFont->ToXml(pStrm);
++
++ pStrm->StartElement(A2OUSTR("style:properties"));
++
++ if( m_pBackImage )
++ m_pBackImage->ToXml(pStrm);
++
++ pStrm->EndElement(A2OUSTR("style:properties"));
++
++ pStrm->EndElement(A2OUSTR("style:style"));
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcellstyle.hxx lotuswordpro/source/filter/xfilter/xfcellstyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfcellstyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfcellstyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,204 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Table cell style. Number format, string value, and so on...
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-28 create this file.
++ ************************************************************************/
++#ifndef _XFCELLSTYLE_HXX
++#define _XFCELLSTYLE_HXX
++
++#include "xfstyle.hxx"
++#include "xfcolor.hxx"
++#include "xfmargins.hxx"
++#include "xfpadding.hxx"
++#include "xfshadow.hxx"
++
++class XFBorders;
++class XFFont;
++class XFBorders;
++class XFMargins;
++class XFBGImage;
++
++/**
++ * @descr Style obejct for cell.
++ */
++class XFCellStyle : public XFStyle
++{
++public:
++ XFCellStyle();
++
++ virtual ~XFCellStyle();
++
++public:
++ /**
++ * @descr Set cell data format style name.
++ */
++ void SetDataStyle(rtl::OUString style);
++
++ /**
++ * @descr: Parant paragraph style.
++ */
++ void SetParentStyle(rtl::OUString parent);
++
++ /**
++ * @descr: set the paragraph defaut font.
++ * @param: font font obejct to be setted.Font object are deleted by font-factory,so
++ * dont't delete it in the destructure function of para style.
++ */
++ void SetFont(XFFont *font);
++
++ /**
++ * @descr: Set the indent of the paragraph.This is the indent for
++ the first line.
++ * @param: indent value of the first-line indent.
++ */
++ void SetIndent(double indent );
++
++ /**
++ * @descr: Set the pading of the paragraph.This is the distance
++ between the border and the top of the text.
++ * @param: indent value of the padding.
++ */
++ void SetPadding(double left, double right = -1, double top = -1, double bottom = -1);
++
++ /**
++ * @descr: Set the Margins of the paragraph.
++ * @param: -1: don't change.
++ other: set value.
++ */
++ void SetMargins(double left, double right=-1,double top=-1, double bottom=-1);
++
++ /**
++ * @descr: Set alignment property of the cell.
++ * @param: eAlign alignment type,left,right,center or justify.
++ */
++ void SetAlignType(enumXFAlignType hori=enumXFAlignNone, enumXFAlignType vert = enumXFAlignBottom);
++
++ /**
++ * @descr: Set the shadow of the paragraph.there is 4 postions, you
++ can find it in the definition of enumShadowPos.
++ * @param: pos
++ * @param: offset the distance between the paragraph border and the shadow.
++ * @param: color color to fill the shadow.
++ */
++ void SetShadow(enumXFShadowPos pos, double offset, XFColor& color);
++
++ /**
++ * @descr: The borders is complex,so you have to create one before use.
++ Very few paragraphs will readly have borders property,this way
++ we can save much memory.
++ * @param: pBorders borders of the paragraph,please reference the XFBorders.
++ */
++ void SetBorders(XFBorders *pBorders);
++
++ /**
++ * @descr: Set background color of the cell.
++ * @param: color value of the back color.
++ */
++ void SetBackColor(XFColor& color);
++
++ /**
++ * descr: set cell background image.
++ */
++ void SetBackImage(XFBGImage *pImage);
++
++ /**
++ * @descr Set cell value to warp if it's content is too long to be placed in an single cell.
++ */
++ void SetWrapText(sal_Bool wrap);
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual sal_Bool Equal(IXFStyle *pStyle);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ rtl::OUString m_strDataStyle;
++ rtl::OUString m_strParentStyleName;
++ enumXFAlignType m_eHoriAlign;
++ enumXFAlignType m_eVertAlign;
++
++ double m_fTextIndent;
++ XFColor m_aBackColor;
++ XFBGImage *m_pBackImage;
++ XFMargins m_aMargin;
++ XFPadding m_aPadding;
++ XFFont *m_pFont;
++ XFShadow m_aShadow;
++ XFBorders *m_pBorders;
++ sal_Bool m_bWrapText;
++};
++
++inline void XFCellStyle::SetAlignType(enumXFAlignType hori, enumXFAlignType vert)
++{
++ m_eHoriAlign = hori;
++ m_eVertAlign = vert;
++}
++
++inline void XFCellStyle::SetDataStyle(rtl::OUString style)
++{
++ m_strDataStyle = style;
++}
++
++inline void XFCellStyle::SetWrapText(sal_Bool wrap)
++{
++ m_bWrapText = wrap;
++}
++#endif
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfchange.cxx lotuswordpro/source/filter/xfilter/xfchange.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfchange.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfchange.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,166 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jun 2005 Created
++ ************************************************************************/
++#include "xfchange.hxx"
++
++void XFChangeList::ToXml(IXFStream *pStrm)
++{
++ if (XFContentContainer::GetCount() == 0)
++ return;
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++//Add by ,for disable change tracking,2005/11/21
++ pAttrList->AddAttribute( A2OUSTR("text:track-changes"),A2OUSTR("false"));
++//Add end
++ pStrm->StartElement( A2OUSTR("text:tracked-changes") );
++ XFContentContainer::ToXml(pStrm);
++ pStrm->EndElement(A2OUSTR("text:tracked-changes"));
++}
++
++void XFChangeRegion::ToXml(IXFStream *pStrm)
++{
++}
++
++void XFChangeInsert::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ if(m_sID.getLength() == 0)
++ return;
++ pAttrList->AddAttribute( A2OUSTR("text:id"),m_sID);
++
++ pStrm->StartElement( A2OUSTR("text:changed-region") );
++ pStrm->StartElement( A2OUSTR("text:insertion") );
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("office:chg-author"),m_sEditor);
++ pAttrList->AddAttribute( A2OUSTR("office:chg-date-time"),A2OUSTR("0000-00-00T00:00:00"));
++ pStrm->StartElement( A2OUSTR("office:change-info") );
++ pStrm->EndElement( A2OUSTR("office:change-info") );
++ pStrm->EndElement( A2OUSTR("text:insertion") );
++ pStrm->EndElement( A2OUSTR("text:changed-region") );
++}
++
++void XFChangeDelete::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ if(m_sID.getLength() == 0)
++ return;
++ pAttrList->AddAttribute( A2OUSTR("text:id"),m_sID);
++
++ pStrm->StartElement( A2OUSTR("text:changed-region") );
++ pStrm->StartElement( A2OUSTR("text:deletion") );
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("office:chg-author"),m_sEditor);
++ pAttrList->AddAttribute( A2OUSTR("office:chg-date-time"),A2OUSTR("0000-00-00T00:00:00"));
++ pStrm->StartElement( A2OUSTR("office:change-info") );
++ pStrm->EndElement( A2OUSTR("office:change-info") );
++
++/// XFContentContainer::ToXml(pStrm);//delete , note by ,2005/7/1
++
++ pStrm->EndElement( A2OUSTR("text:deletion") );
++ pStrm->EndElement( A2OUSTR("text:changed-region") );
++}
++
++void XFChange::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ if(m_sID.getLength() == 0)
++ return;
++ pAttrList->AddAttribute( A2OUSTR("text:change-id"),m_sID);
++
++ pStrm->StartElement( A2OUSTR("text:change") );
++ pStrm->EndElement( A2OUSTR("text:change") );
++}
++
++void XFChangeStart::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ if(m_sID.getLength() == 0)
++ return;
++ pAttrList->AddAttribute( A2OUSTR("text:change-id"),m_sID);
++
++ pStrm->StartElement( A2OUSTR("text:change-start") );
++ pStrm->EndElement( A2OUSTR("text:change-start") );
++}
++
++void XFChangeEnd::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ if(m_sID.getLength() == 0)
++ return;
++ pAttrList->AddAttribute( A2OUSTR("text:change-id"),m_sID);
++
++ pStrm->StartElement( A2OUSTR("text:change-end") );
++ pStrm->EndElement( A2OUSTR("text:change-end") );
++}
++
++
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfchange.hxx lotuswordpro/source/filter/xfilter/xfchange.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfchange.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfchange.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,146 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ Jun 2005 Created
++ ************************************************************************/
++#ifndef _XFCHANGE_HXX_
++#define _XFCHANGE_HXX_
++
++#include "xfglobal.hxx"
++#include "ixfstream.hxx"
++#include "xfcontent.hxx"
++#include "xfcontentcontainer.hxx"
++#include <rtl/ustring.hxx>
++
++class XFChangeList : public XFContentContainer
++{
++public:
++ XFChangeList(){};
++ ~XFChangeList(){};
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++class XFChangeRegion : public XFContentContainer
++{
++public:
++ XFChangeRegion(){};
++ ~XFChangeRegion(){};
++ virtual void ToXml(IXFStream *pStrm);
++ void SetChangeID(rtl::OUString sID){m_sID=sID;}
++ rtl::OUString GetChangeID(){return m_sID;}
++ void SetEditor(rtl::OUString sEditor){m_sEditor=sEditor;}
++protected:
++ rtl::OUString m_sID;
++ rtl::OUString m_sEditor;
++};
++
++class XFChangeInsert : public XFChangeRegion
++{
++public:
++ XFChangeInsert(){};
++ ~XFChangeInsert(){};
++ void ToXml(IXFStream *pStrm);
++};
++
++class XFChangeDelete : public XFChangeRegion
++{
++public:
++ XFChangeDelete(){};
++ ~XFChangeDelete(){};
++ void ToXml(IXFStream *pStrm);
++};
++
++class XFChange : public XFContent
++{
++public:
++ XFChange(){};
++ ~XFChange(){};
++ void ToXml(IXFStream *pStrm);
++ void SetChangeID(rtl::OUString sID){m_sID=sID;}
++ rtl::OUString GetChangeID(){return m_sID;}
++private:
++ rtl::OUString m_sID;
++};
++
++class XFChangeStart : public XFContent
++{
++public:
++ XFChangeStart(){};
++ ~XFChangeStart(){};
++ void ToXml(IXFStream *pStrm);
++ void SetChangeID(rtl::OUString sID){m_sID=sID;}
++ rtl::OUString GetChangeID(){return m_sID;}
++private:
++ rtl::OUString m_sID;
++};
++
++class XFChangeEnd : public XFContent
++{
++public:
++ XFChangeEnd(){};
++ ~XFChangeEnd(){};
++ void ToXml(IXFStream *pStrm);
++ void SetChangeID(rtl::OUString sID){m_sID=sID;}
++ rtl::OUString GetChangeID(){return m_sID;}
++private:
++ rtl::OUString m_sID;
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfchartstreamtools.cxx lotuswordpro/source/filter/xfilter/xfchartstreamtools.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfchartstreamtools.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfchartstreamtools.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,117 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*****************************************************************************
++* Change History
++* <<Date>> <<Name of editor>> <<Description>>
++2005/2 draft code for implementation of chart stream helpers
++****************************************************************************/
++
++/**
++ * @file
++ * For LWP filter architecture prototype
++*/
++
++#include "xfchartstreamtools.hxx"
++#include "xfdrawchart.hxx"
++#include "xfparagraph.hxx"
++
++#include <com/sun/star/xml/sax/SAXParseException.hpp>
++#include <com/sun/star/lang/XMultiServiceFactory.hpp>
++
++/**
++* @short Parse the xml stream
++* @param rInpStream the xml stream
++* @param aHandler xml handler
++*/
++void XFChartStreamTools::ParseStream(SvStorageStreamRef rInpStream, Reference<XDocumentHandler> aHandler)
++{
++ //Create parser
++ uno::Reference< xml::sax::XParser > xParser;
++ {
++ uno::Reference< lang::XMultiServiceFactory>
++ xServiceFactory( ::comphelper::getProcessServiceFactory() );
++ if( !xServiceFactory.is() )
++ {
++ assert(false);
++ return;
++ }
++ xParser = uno::Reference< xml::sax::XParser > (
++ xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )),
++ uno::UNO_QUERY );
++
++ if( ! xParser.is() )
++ {
++ assert(false);
++ return;
++ }
++ }
++
++ xParser->setDocumentHandler( aHandler );
++ xml::sax::InputSource aParserInput;
++ aParserInput.aInputStream = rInpStream->GetXInputStream();
++ xParser->parseStream( aParserInput );
++}
++
++/**
++* @short Parse the xml stream, content.xml & styles.xml for chart
++* @param rStyleStream styles xml stream
++* @param rCntStream the content xml stream
++* @param pOutputStream the output stream
++*/
++void XFChartStreamTools::ParseStream(SvStorageStreamRef rCntStream,IXFStream* pOutputStream)
++{
++ Reference<XDocumentHandler> pHandler( new XFChartXMLHandler(pOutputStream) );
++ ParseStream(rCntStream,pHandler);
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfchartstreamtools.hxx lotuswordpro/source/filter/xfilter/xfchartstreamtools.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfchartstreamtools.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfchartstreamtools.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,112 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*****************************************************************************
++* Change History
++* <<Date>> <<Name of editor>> <<Description>>
++2005/2 draft code for chart stream helpers
++****************************************************************************/
++
++/**
++ * @file
++ * For LWP filter architecture prototype
++*/
++
++#ifndef LWPCHARTSTREAMTOOLS_HXX_
++#define LWPCHARTSTREAMTOOLS_HXX_
++
++#include <tools/stream.hxx>
++#include <tools/gen.hxx>
++
++//For sax parser
++#ifndef _COM_SUN_STAR_XML_SAX_INPUTSOURCE_HPP_
++#include <com/sun/star/xml/sax/InputSource.hpp>
++#endif
++
++#ifndef _COM_SUN_STAR_XML_SAX_XDTDHANDLER_HPP_
++#include <com/sun/star/xml/sax/XDTDHandler.hpp>
++#endif
++
++#ifndef _COM_SUN_STAR_XML_SAX_XPARSER_HPP_
++#include <com/sun/star/xml/sax/XParser.hpp>
++#endif
++
++#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
++#include <comphelper/processfactory.hxx>
++#endif
++
++using namespace ::com::sun::star;
++using namespace ::rtl;
++using namespace comphelper;
++
++#include "xfchartxmlhandler.hxx"
++#include "xfrect.hxx"
++class IXFContent;
++
++/**
++* @brief
++* tools class for chart stream process
++*/
++
++class XFChartStreamTools
++{
++public:
++ static void ParseStream(SvStorageStreamRef rInpStream, Reference<XDocumentHandler> aHandler);
++
++ static void ParseStream( SvStorageStreamRef rCntStream,
++ IXFStream* pOutputStream);
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfchartxmlhandler.cxx lotuswordpro/source/filter/xfilter/xfchartxmlhandler.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfchartxmlhandler.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfchartxmlhandler.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,125 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*****************************************************************************
++* Change History
++* <<Date>> <<Name of editor>> <<Description>>
++ 2005/2 draft code for Implementation of chart xml hander
++****************************************************************************/
++/**
++* @file
++* For LWP filter architecture prototype
++*/
++
++#include "xfchartxmlhandler.hxx"
++
++Any SAL_CALL XFChartXMLHandler::queryInterface( const Type & rType ) throw( RuntimeException )
++{
++ Any a = ::cppu::queryInterface( rType ,SAL_STATIC_CAST( XDocumentHandler*, this ));
++ if ( a.hasValue() )
++ return a;
++ else
++ return OWeakObject::queryInterface( rType );
++}
++
++/**
++* @short constructor of chart xml handler
++* @descr
++* @param pOutputStream the output stream
++*/
++XFChartXMLHandler::XFChartXMLHandler(IXFStream* pOutputStream)
++{
++ m_pOutputStream = pOutputStream;
++}
++
++/**
++* @short handle the start element
++* @descr ignore some elements here
++* @param aName element name
++* @param xAttribs the attribute list
++*/
++void SAL_CALL XFChartXMLHandler::startElement( const ::rtl::OUString& aName, const Reference< XAttributeList >& xAttribs )
++throw (SAXException, RuntimeException)
++{
++ IXFAttrList* pList = m_pOutputStream->GetAttrList();
++ pList->Clear();
++ {
++ INT16 nLen = xAttribs->getLength();
++ for( INT16 nC=0;nC<nLen;nC++)
++ {
++ OUString aName = xAttribs->getNameByIndex(nC);
++ OUString aVal = xAttribs->getValueByIndex(nC);
++ pList->AddAttribute(aName, aVal);
++ }
++ }
++
++ m_pOutputStream->StartElement(aName);
++}
++
++/**
++* @short handle the end element
++* @descr ignore some elements here
++* @param aName element name
++*/
++void SAL_CALL XFChartXMLHandler::endElement( const ::rtl::OUString& aName )
++throw (SAXException, RuntimeException)
++{
++ m_pOutputStream->EndElement(aName);
++}
++
++void SAL_CALL XFChartXMLHandler::characters( const ::rtl::OUString& aChars )
++throw (SAXException, RuntimeException)
++{
++ m_pOutputStream->Characters(aChars);
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfchartxmlhandler.hxx lotuswordpro/source/filter/xfilter/xfchartxmlhandler.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfchartxmlhandler.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfchartxmlhandler.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,129 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*****************************************************************************
++* Change History
++* <<Date>> <<Name of editor>> <<Description>>
++* 2005/2 draft code for XML handler of chart xml.
++****************************************************************************/
++
++/*************************************************************************
++ * @file
++ * For LWP filter architecture prototype
++ ************************************************************************/
++
++#ifndef XFCHARTXMLHANDLER_HXX_
++#define XFCHARTXMLHANDLER_HXX_
++
++#include <cppuhelper/weak.hxx>
++#include <com/sun/star/xml/sax/XAttributeList.hpp>
++#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
++#include <com/sun/star/xml/sax/SAXParseException.hpp>
++#include <com/sun/star/uno/RuntimeException.hpp>
++
++#include <so3/svstor.hxx>
++#include "ixfstream.hxx"
++#include "ixfattrlist.hxx"
++#include <rtl/ustring.hxx>
++using namespace rtl;
++using namespace ::com::sun::star::xml::sax;
++using namespace ::com::sun::star::uno;
++
++/**
++* @brief
++* Chart xml handler
++*/
++
++class XFChartXMLHandler: public XDocumentHandler,public ::cppu::OWeakObject
++{
++public:
++ XFChartXMLHandler(IXFStream* pOutputStream);
++
++ // XInterface
++ virtual void SAL_CALL acquire() throw()
++ { OWeakObject::acquire(); }
++ virtual void SAL_CALL release() throw()
++ { OWeakObject::release(); }
++ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
++ const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
++
++ virtual void SAL_CALL startDocument( )
++ throw (SAXException, RuntimeException) {}
++
++ virtual void SAL_CALL endDocument( )
++ throw (SAXException, RuntimeException) {}
++
++ virtual void SAL_CALL startElement( const ::rtl::OUString& aName, const Reference< XAttributeList >& xAttribs )
++ throw (SAXException, RuntimeException);
++
++ virtual void SAL_CALL endElement( const ::rtl::OUString& aName )
++ throw (SAXException, RuntimeException);
++
++ virtual void SAL_CALL characters( const ::rtl::OUString& aChars )
++ throw (SAXException, RuntimeException);
++
++ virtual void SAL_CALL ignorableWhitespace( const ::rtl::OUString& aWhitespaces )
++ throw (SAXException, RuntimeException){}
++
++ virtual void SAL_CALL processingInstruction( const ::rtl::OUString& aTarget, const ::rtl::OUString& aData )
++ throw (SAXException, RuntimeException){}
++
++ virtual void SAL_CALL setDocumentLocator( const Reference< XLocator >& xLocator )
++ throw (SAXException, RuntimeException){}
++protected:
++ IXFStream* m_pOutputStream;
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcolor.cxx lotuswordpro/source/filter/xfilter/xfcolor.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfcolor.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfcolor.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,92 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Color object to serial to xml filter.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-17 create this file.
++ ************************************************************************/
++#include <stdio.h>
++#include "xfcolor.hxx"
++
++rtl::OUString XFColor::ToString() const
++{
++ char buf[8];
++
++ rtl_zeroMemory(buf,8);
++ sprintf(buf,"#%2x%2x%2x",m_nRed, m_nGreen, m_nBlue);
++ for( int i=1; i<7;i++ )
++ {
++ if( buf[i] == ' ' )
++ buf[i] = '0';
++ }
++ return rtl::OUString::createFromAscii(buf);
++}
++
++bool operator==(XFColor& c1, XFColor& c2)
++{
++ return (
++ (c1.m_nRed==c2.m_nRed)&&
++ (c1.m_nGreen==c2.m_nGreen)&&
++ (c1.m_nBlue==c2.m_nBlue)
++ );
++}
++
++bool operator!=(XFColor& c1, XFColor& c2)
++{
++ return !(c1==c2);
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcolor.hxx lotuswordpro/source/filter/xfilter/xfcolor.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfcolor.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfcolor.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,133 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Color object to serial to xml filter.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-17 create this file.
++ ************************************************************************/
++#ifndef _XFCOLOR_HXX
++#define _XFCOLOR_HXX
++
++#include "xfglobal.hxx"
++
++/**
++ * @brief
++ * Color object.
++ */
++class XFColor
++{
++public:
++ XFColor():m_nRed((sal_Int8)0),m_nGreen((sal_Int8)0),m_nBlue((sal_Int8)0)
++ {
++ m_bValid = sal_False;
++ }
++ XFColor(sal_Int32 red, sal_Int32 green, sal_Int32 blue)
++ :m_nRed((sal_Int8)red),m_nGreen((sal_Int8)green),m_nBlue((sal_Int8)blue)
++ {
++ m_bValid = sal_True;
++ }
++ XFColor(sal_uInt32 color)
++ {
++ unsigned int c = color&0x00ffffff;
++ unsigned int temp = c;
++ m_nRed = temp&0x000000ff;
++
++ temp = c;
++ m_nGreen = (temp&0x0000ff00)>>8;
++
++ temp = c;
++ m_nBlue = (temp&0x00ff0000)>>16;
++
++ m_bValid = sal_True;
++ }
++
++ /**
++ * @descr return red part of the color.
++ */
++ sal_uInt8 GetRed() const{ return m_nRed; }
++
++ /**
++ * @descr return green part of the color.
++ */
++ sal_uInt8 GetGreen() const{ return m_nGreen; }
++
++ /**
++ * @descr return blue part of the color.
++ */
++ sal_uInt8 GetBlue() const{ return m_nBlue; }
++
++ /**
++ * @descr helper function to assert whether a color is valid.
++ */
++ sal_Bool IsValid() const{ return m_bValid;};
++
++ rtl::OUString ToString ()const;
++
++ friend bool operator==(XFColor& c1, XFColor& c2);
++ friend bool operator!=(XFColor& c1, XFColor& c2);
++private:
++ sal_uInt8 m_nRed;
++ sal_uInt8 m_nGreen;
++ sal_uInt8 m_nBlue;
++ sal_Bool m_bValid;
++};
++
++#endif
++
++
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcolstyle.cxx lotuswordpro/source/filter/xfilter/xfcolstyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfcolstyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfcolstyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,95 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Column style object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-03-17 create this file.
++ ************************************************************************/
++#include "xfcolstyle.hxx"
++
++XFColStyle::XFColStyle()
++{
++ m_fWidth = 0;
++}
++
++XFColStyle::~XFColStyle()
++{
++}
++
++enumXFStyle XFColStyle::GetStyleFamily()
++{
++ return enumXFStyleTableCol;
++}
++
++void XFColStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
++ pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("table-column") );
++ pStrm->StartElement( A2OUSTR("style:style") );
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("style:column-width"), DoubleToOUString(m_fWidth) + A2OUSTR("cm") );
++ pStrm->StartElement( A2OUSTR("style:properties") );
++ pStrm->EndElement( A2OUSTR("style:properties") );
++
++ pStrm->EndElement( A2OUSTR("style:style") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcolstyle.hxx lotuswordpro/source/filter/xfilter/xfcolstyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfcolstyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfcolstyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,112 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Column style object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-03-17 create this file.
++ ************************************************************************/
++#ifndef _XFCOLSTYLE_HXX
++#define _XFCOLSTYLE_HXX
++
++#include "xfstyle.hxx"
++
++/**
++ * @brief
++ * Column style, it has only one property-the column width.
++ */
++class XFColStyle : public XFStyle
++{
++public:
++ XFColStyle();
++
++ virtual ~XFColStyle();
++
++public:
++ /**
++ * @descr Set column width.
++ */
++ void SetWidth(double width);
++
++ /**
++ * @descr return column width.
++ */
++ double GetWidth();
++
++ virtual enumXFStyle GetStyleFamily();
++
++ /**
++ * @descr output column style as an xml node.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ double m_fWidth;
++};
++
++inline void XFColStyle::SetWidth(double width)
++{
++ m_fWidth = width;
++}
++
++inline double XFColStyle::GetWidth()
++{
++ return m_fWidth;
++}
++
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcolumns.cxx lotuswordpro/source/filter/xfilter/xfcolumns.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfcolumns.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfcolumns.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,213 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Columns styles for section, or paragraph.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-17 create this file.
++ ************************************************************************/
++
++#include "xfcolumns.hxx"
++
++void XFColumn::SetRelWidth(sal_Int32 width)
++{
++ m_nRelWidth = width;
++}
++
++sal_Int32 XFColumn::GetRelWidth()
++{
++ return m_nRelWidth;
++}
++
++void XFColumn::SetMargins(double left, double right)
++{
++ m_fMarginLeft = left;
++ m_fMarginRight = right;
++}
++
++double XFColumn::GetMarginLeft()
++{
++ return m_fMarginLeft;
++}
++double XFColumn::GetMarginRight()
++{
++ return m_fMarginRight;
++}
++
++void XFColumn::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute( A2OUSTR("style:rel-width"), Int32ToOUString(m_nRelWidth) + A2OUSTR("*") );
++ pAttrList->AddAttribute( A2OUSTR("fo:margin-left"), DoubleToOUString(m_fMarginLeft) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("fo:margin-right"), DoubleToOUString(m_fMarginRight) + A2OUSTR("cm") );
++
++ pStrm->StartElement( A2OUSTR("style:column") );
++ pStrm->EndElement( A2OUSTR("style:column") );
++}
++
++void XFColumnSep::SetRelHeight(sal_Int32 height)
++{
++ assert(height>=0&&height<=100);
++ m_nRelHeight = height;
++}
++void XFColumnSep::SetWidth(double width)
++{
++ m_fWidth = width;
++}
++void XFColumnSep::SetColor(XFColor& color)
++{
++ m_aColor = color;
++}
++void XFColumnSep::SetVerticalAlign(enumXFAlignType align)
++{
++ m_eVertAlign = align;
++}
++
++void XFColumnSep::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("style:width"), DoubleToOUString(m_fWidth) + A2OUSTR("cm") );
++ if( m_aColor.IsValid() )
++ pAttrList->AddAttribute( A2OUSTR("style:color"), m_aColor.ToString() );
++ pAttrList->AddAttribute( A2OUSTR("style:height"), Int32ToOUString(m_nRelHeight) + A2OUSTR("%") );
++ //text align:
++ if( m_eVertAlign == enumXFAlignTop )
++ {
++ pAttrList->AddAttribute(A2OUSTR("style:vertical-align"),A2OUSTR("top"));
++ }
++ else if( m_eVertAlign == enumXFAlignMiddle )
++ {
++ pAttrList->AddAttribute(A2OUSTR("style:vertical-align"),A2OUSTR("middle"));
++ }
++ else if( m_eVertAlign == enumXFAlignBottom )
++ {
++ pAttrList->AddAttribute(A2OUSTR("style:vertical-align"),A2OUSTR("bottom"));
++ }
++
++ pStrm->StartElement( A2OUSTR("style:column-sep") );
++ pStrm->EndElement( A2OUSTR("style:column-sep") );
++}
++
++void XFColumns::SetSeperator(sal_Int32 height, double width, XFColor color,enumXFAlignType align)
++{
++ m_aSeperator.SetRelHeight(height);
++ m_aSeperator.SetWidth(0.1);
++ m_aSeperator.SetColor(color);
++ m_aSeperator.SetVerticalAlign(align);
++ m_nFlag |= XFCOLUMNS_FLAG_SEPERATOR;
++}
++
++void XFColumns::SetSeperator(XFColumnSep& aSeperator)
++{
++ m_aSeperator = aSeperator;
++ m_nFlag |= XFCOLUMNS_FLAG_SEPERATOR;
++}
++
++void XFColumns::AddColumn(XFColumn& column)
++{
++ m_aColumns.push_back(column);
++}
++
++sal_Int32 XFColumns::GetCount()
++{
++ return m_aColumns.size();;
++}
++
++void XFColumns::SetGap(double fGap)
++{
++ m_fGap = fGap;
++ m_nFlag |= XFCOLUMNS_FLAG_GAP;
++}
++
++void XFColumns::SetCount(sal_uInt16 nCount)
++{
++ m_nCount = nCount;
++}
++
++void XFColumns::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ //pAttrList->AddAttribute( A2OUSTR("fo:column-count"), Int32ToOUString(GetCount()) );
++ pAttrList->AddAttribute( A2OUSTR("fo:column-count"), Int32ToOUString(m_nCount));
++ if( m_nFlag&XFCOLUMNS_FLAG_GAP )
++ {
++ pAttrList->AddAttribute( A2OUSTR("fo:column-gap"), DoubleToOUString(m_fGap)+A2OUSTR("cm") );
++ }
++
++ pStrm->StartElement( A2OUSTR("style:columns") );
++
++ if( m_nFlag&XFCOLUMNS_FLAG_SEPERATOR ) //column-sep:
++ {
++ m_aSeperator.ToXml(pStrm);
++ }
++
++ if(!(m_nFlag&XFCOLUMNS_FLAG_GAP) )
++ {
++ std::vector<XFColumn>::iterator it;
++ for( it = m_aColumns.begin(); it != m_aColumns.end(); it++ )
++ {
++ (*it).ToXml(pStrm);
++ }
++ }
++ pStrm->EndElement( A2OUSTR("style:columns") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcolumns.hxx lotuswordpro/source/filter/xfilter/xfcolumns.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfcolumns.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfcolumns.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,180 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Columns styles for section, or paragraph.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-17 create this file.
++ ************************************************************************/
++#ifndef _XFCOLUMNS_HXX
++#define _XFCOLUMNS_HXX
++
++#include "xfglobal.hxx"
++#include "xfcolor.hxx"
++#include <vector>
++
++#define XFCOLUMNS_FLAG_SEPERATOR 0X00000001
++#define XFCOLUMNS_FLAG_GAP 0X00000010
++
++/**
++ * @descr Columns object for page or section.
++ */
++class XFColumn : public IXFObject
++{
++public:
++ XFColumn()
++ {
++ m_nRelWidth = 0;
++ m_fMarginLeft = 0;
++ m_fMarginRight = 0;
++ }
++
++public:
++ /**
++ * @descr Set column relative width.
++ */
++ void SetRelWidth(sal_Int32 width);
++
++ /**
++ * @descr return column relative width.
++ */
++ sal_Int32 GetRelWidth();
++
++ /**
++ * @descr Set column margin left and margin right.
++ */
++ void SetMargins(double left, double right);
++
++ /**
++ * @descr return column left margin.
++ */
++ double GetMarginLeft();
++
++ /**
++ * @descr return column right margin.
++ */
++ double GetMarginRight();
++
++ /**
++ * @descr output column style as an xml node.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++
++ friend bool operator==(XFColumn& c1, XFColumn& c2);
++ friend bool operator!=(XFColumn& c1, XFColumn& c2);
++ friend class XFColumns;
++
++private:
++ sal_Int32 m_nRelWidth;
++ double m_fMarginLeft;
++ double m_fMarginRight;
++};
++
++class XFColumnSep : public IXFObject
++{
++public:
++ XFColumnSep()
++ {
++ m_nRelHeight = 100;
++ m_fWidth = 0;
++ m_eVertAlign = enumXFAlignMiddle;
++ }
++public:
++ void SetRelHeight(sal_Int32 height);
++ void SetWidth(double width);
++ void SetColor(XFColor& color);
++ void SetVerticalAlign(enumXFAlignType align);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++ friend bool operator==(XFColumnSep& sep1, XFColumnSep& sep2);
++ friend bool operator!=(XFColumnSep& sep1, XFColumnSep& sep2);
++ friend class XFColumns;
++private:
++ sal_Int32 m_nRelHeight;
++ double m_fWidth;
++ XFColor m_aColor;
++ enumXFAlignType m_eVertAlign;
++};
++
++class XFColumns
++{
++public:
++ XFColumns()
++ {
++ m_nFlag = 0;
++ m_fGap = 0;
++ }
++public:
++ void SetSeperator(sal_Int32 height, double width, XFColor color = XFColor(0,0,0),enumXFAlignType align = enumXFAlignMiddle);
++ void SetSeperator(XFColumnSep& aSeperator);
++ void SetGap(double fGap);
++ void SetCount(sal_uInt16 nCount);
++ void AddColumn(XFColumn& column);
++ sal_Int32 GetCount();
++
++ void ToXml(IXFStream *pStrm);
++private:
++ sal_Int32 m_nFlag;
++ sal_uInt16 m_nCount;
++ double m_fGap;
++ std::vector<XFColumn> m_aColumns;
++ XFColumnSep m_aSeperator;
++
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfconditionformat.hxx lotuswordpro/source/filter/xfilter/xfconditionformat.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfconditionformat.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfconditionformat.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,70 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _XFCONDITIONFORMAT_HXX
++#define _XFCONDITIONFORMAT_HXX
++
++class XFConditionFormat
++{
++public:
++ XFConditionFormat();
++
++public:
++ void SetCondition();
++
++private:
++
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfconfigmanager.cxx lotuswordpro/source/filter/xfilter/xfconfigmanager.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfconfigmanager.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfconfigmanager.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,108 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Manager for all config object,include line number config.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-03-23 create this file.
++ ************************************************************************/
++#include "xfconfigmanager.hxx"
++
++XFConfigManager::XFConfigManager()
++{
++ m_pLineNumberConfig = NULL;
++ m_pFootnoteConfig = NULL;
++ m_pEndnoteConfig = NULL;
++}
++
++void XFConfigManager::SetLineNumberConfig(XFLineNumberConfig *pLNConfig)
++{
++ if( m_pLineNumberConfig )
++ delete m_pLineNumberConfig;
++ m_pLineNumberConfig = pLNConfig;
++}
++
++void XFConfigManager::SetFootnoteConfig(XFFootnoteConfig *pFNConfig)
++{
++ if( m_pFootnoteConfig )
++ delete m_pFootnoteConfig;
++ m_pFootnoteConfig = pFNConfig;
++}
++
++void XFConfigManager::SetEndnoteConfig(XFEndnoteConfig *pENConfig)
++{
++ if( m_pEndnoteConfig )
++ delete m_pEndnoteConfig;
++ m_pEndnoteConfig = pENConfig;
++}
++
++void XFConfigManager::ToXml(IXFStream *pStrm)
++{
++ if( m_pLineNumberConfig )
++ AddStyle(m_pLineNumberConfig);
++ if( m_pFootnoteConfig )
++ AddStyle(m_pFootnoteConfig);
++ if( m_pEndnoteConfig )
++ AddStyle(m_pEndnoteConfig);
++
++ XFStyleContainer::ToXml(pStrm);
++ XFStyleContainer::Reset();
++ m_pLineNumberConfig = NULL;
++ m_pFootnoteConfig = NULL;
++ m_pEndnoteConfig = NULL;
++}
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfconfigmanager.hxx lotuswordpro/source/filter/xfilter/xfconfigmanager.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfconfigmanager.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfconfigmanager.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,110 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Manager for all config object,include line number config.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-03-23 create this file.
++ ************************************************************************/
++#ifndef _XFCONFIGMANAGER_HXX
++#define _XFCONFIGMANAGER_HXX
++
++#include "xfstylecont.hxx"
++#include "xflinenumberconfig.hxx"
++#include "xffootnoteconfig.hxx"
++#include "xfendnoteconfig.hxx"
++#include "xfdefs.hxx"
++
++/**
++ * @brief
++ * Config infomation for OOo document, ie, line count config, endnote and footnote config.
++ * This object should only exist one instance.
++ * Don't make this obejct an singleton because it's managed by XFStyleManager.
++ */
++class XFConfigManager : public XFStyleContainer
++{
++public:
++ XFConfigManager();
++
++public:
++ /**
++ * @descr Set line number config.
++ */
++ void SetLineNumberConfig(XFLineNumberConfig *pLNConfig);
++
++ /**
++ * @descr Set footnote config.
++ */
++ void SetFootnoteConfig(XFFootnoteConfig *pFNConfig);
++
++ /**
++ * @descr Set endnote config.
++ */
++ void SetEndnoteConfig(XFEndnoteConfig *pFNConfig);
++
++ /**
++ * @descr Output config information.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ XFLineNumberConfig *m_pLineNumberConfig;
++ XFFootnoteConfig *m_pFootnoteConfig;
++ XFEndnoteConfig *m_pEndnoteConfig;
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcontentcontainer.cxx lotuswordpro/source/filter/xfilter/xfcontentcontainer.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfcontentcontainer.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfcontentcontainer.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,218 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Container for content.It will destroy all children when destroy.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-27 create this file.
++ * 2005-04-08 add copy constructure.
++ ************************************************************************/
++#include "xfcontentcontainer.hxx"
++#include "xftextcontent.hxx"
++
++XFContentContainer::XFContentContainer()
++{
++}
++
++XFContentContainer::XFContentContainer(const XFContentContainer& other)
++{
++ std::vector<IXFContent*>::const_iterator it;
++
++ for( it = other.m_aContents.begin(); it != other.m_aContents.end(); it++ )
++ {
++ IXFContent *pContent = *it;
++ if( pContent )
++ {
++ IXFContent *pClone = pContent->Clone();
++ if( pClone )
++ Add(pClone);
++ }
++ }
++}
++
++XFContentContainer& XFContentContainer::operator=(const XFContentContainer& other)
++{
++ std::vector<IXFContent*>::const_iterator it;
++
++ for( it = other.m_aContents.begin(); it != other.m_aContents.end(); it++ )
++ {
++ IXFContent *pContent = *it;
++ if( pContent )
++ {
++ IXFContent *pClone = pContent->Clone();
++ if( pClone )
++ Add(pClone);
++ }
++ }
++ return *this;
++}
++
++XFContentContainer::~XFContentContainer()
++{
++ std::vector<IXFContent*>::iterator it;
++
++ for( it = m_aContents.begin(); it != m_aContents.end(); it++ )
++ {
++ IXFContent *pContent = *it;
++ if( pContent )
++ delete pContent;
++ }
++}
++
++void XFContentContainer::Add(IXFContent *pContent)
++{
++ m_aContents.push_back(pContent);
++}
++
++void XFContentContainer::InsertAtBegin(IXFContent * pContent)
++{
++ m_aContents.insert(m_aContents.begin(), pContent);
++}
++void XFContentContainer::RemoveAt(sal_uInt32 nPos)
++{
++ m_aContents.erase(m_aContents.begin()+nPos);
++}
++void XFContentContainer::Add(const rtl::OUString& text)
++{
++ XFTextContent *pTC = new XFTextContent();
++ pTC->SetText(text);
++ Add(pTC);
++}
++
++int XFContentContainer::GetCount() const
++{
++ return m_aContents.size();
++}
++
++void XFContentContainer::Reset()
++{
++ std::vector<IXFContent*>::iterator it;
++
++ for( it = m_aContents.begin(); it != m_aContents.end(); it++ )
++ {
++ IXFContent *pContent = *it;
++ if( pContent )
++ delete pContent;
++ }
++ m_aContents.clear();
++}
++
++
++IXFContent* XFContentContainer::FindFirstContent(enumXFContent type)
++{
++ IXFContent *pRet = NULL;
++ IXFContent *pContent = NULL;
++
++ for( int i=0; i<GetCount(); i++ )
++ {
++ pContent = GetContent(i);
++ if( !pContent )
++ continue;
++
++ enumXFContent eType = pContent->GetContentType();
++ if( eType == type )
++ return pContent;
++ else
++ {
++ XFContentContainer *pChildCont = static_cast<XFContentContainer*>(pContent);
++ if( pChildCont )
++ {
++ pRet = pChildCont->FindFirstContent(type);
++ if( pRet )
++ return pRet;
++ }
++ }
++ }
++ return pRet;
++}
++
++enumXFContent XFContentContainer::GetContentType()
++{
++ return enumXFContentContainer;
++}
++
++void XFContentContainer::ToXml(IXFStream *pStrm)
++{
++ std::vector<IXFContent*>::iterator it;
++
++ for( it = m_aContents.begin(); it != m_aContents.end(); it++ )
++ {
++ IXFContent *pContent = *it;
++ if( pContent )
++ pContent->ToXml(pStrm);
++ }
++}
++
++IXFContent* XFContentContainer::GetLastContent()
++{
++ sal_uInt32 index = m_aContents.size()-1;
++ if(index >0)
++ {
++ return m_aContents[index];
++ }
++
++ return NULL;
++}
++
++void XFContentContainer::RemoveLastContent()
++{
++ sal_uInt32 index = m_aContents.size()-1;
++ if(index >0)
++ {
++ m_aContents.erase(m_aContents.begin() + index);
++ }
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcontentcontainer.hxx lotuswordpro/source/filter/xfilter/xfcontentcontainer.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfcontentcontainer.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfcontentcontainer.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,143 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Container for content.It will destroy all children when destroy.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-27 create this file.
++ * 2005-04-20 change add to virtual.
++ ************************************************************************/
++#ifndef _XFCONTENTCONTAINER_HXX
++#define _XFCONTENTCONTAINER_HXX
++
++#include "xfcontent.hxx"
++#include <vector>
++
++/**
++ * @brief
++ * A container for content.
++ * The contents will be deleted when delete container.
++ */
++class XFContentContainer : public XFContent
++{
++public:
++ XFContentContainer();
++
++ XFContentContainer(const XFContentContainer& other);
++
++ XFContentContainer& operator=(const XFContentContainer& other);
++
++ /**
++ * @descr Destructure, all contents will be deleted too.
++ */
++ virtual ~XFContentContainer();
++
++public:
++ /**
++ * @descr Add conent.
++ */
++ virtual void Add(IXFContent *pContent);
++
++ virtual void InsertAtBegin(IXFContent *pContent);
++ virtual void RemoveAt(sal_uInt32 nPos);
++ virtual IXFContent* GetLastContent();
++ virtual void RemoveLastContent();
++ /**
++ * @descr convience function for add text content.
++ */
++ virtual void Add(const rtl::OUString& text);
++
++ /**
++ * @descr return the number of contents in the container.
++ */
++ int GetCount() const;
++
++ /**
++ * @descr get content by index.
++ */
++ IXFContent* GetContent(sal_uInt32 index) const;
++
++ /**
++ * @descr clear all contents in the container.
++ */
++ void Reset();
++
++ /**
++ * @descr helper function, find first content by type.
++ */
++ IXFContent* FindFirstContent(enumXFContent type);
++
++ /**
++ * @descr return the content type.
++ */
++ virtual enumXFContent GetContentType();
++ /**
++ * @descr Output to OOo model or local file.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ std::vector<IXFContent*> m_aContents;
++};
++
++inline IXFContent* XFContentContainer::GetContent(sal_uInt32 index) const
++{
++ if( index<0 || index>m_aContents.size()-1 )
++ return NULL;
++ return m_aContents[index];
++}
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcontent.hxx lotuswordpro/source/filter/xfilter/xfcontent.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfcontent.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfcontent.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,100 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Base class for the all content object,ie. text,paragraph,picture,and so on.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef _XFCONTENT_HXX
++#define _XFCONTENT_HXX
++
++#include "ixfcontent.hxx"
++
++/**
++ * @descr
++ * Base class for all content object.
++ * There is only two properties:style name and content type in this class.
++ */
++class XFContent : public IXFContent
++{
++public:
++ /**
++ * @short: return the content type.
++ */
++ virtual enumXFContent GetContentType(){ return enumXFContentUnknown; }
++
++ /**
++ * @short: All content except XFTextContent can have a style.
++ */
++ virtual void SetStyleName(rtl::OUString style){m_strStyleName = style;}
++
++ /**
++ * @short: return the style name.
++ */
++ virtual rtl::OUString GetStyleName(){return m_strStyleName;}
++
++ /**
++ */
++ virtual IXFContent* Clone(){return NULL;}
++
++protected:
++ rtl::OUString m_strStyleName;
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcrossref.cxx lotuswordpro/source/filter/xfilter/xfcrossref.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfcrossref.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfcrossref.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,105 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * index entry object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-05-17 create this file.
++ ************************************************************************/
++#include "xfcrossref.hxx"
++
++XFCrossRefStart::XFCrossRefStart()
++{
++}
++
++XFCrossRefStart::~XFCrossRefStart()
++{
++}
++
++void XFCrossRefStart::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ if( m_nType == CROSSREF_TEXT)
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:reference-format"),A2OUSTR("text") );
++ }
++ else if( m_nType == CROSSREF_PAGE )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:reference-format"), A2OUSTR("page") );
++ }
++ else if( m_nType == CROSSREF_PARANUMBER )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:reference-format"), A2OUSTR("chapter") );
++ }
++ pAttrList->AddAttribute( A2OUSTR("text:ref-name"), m_strMarkName);
++ pStrm->StartElement( A2OUSTR("text:bookmark-ref") );
++}
++
++XFCrossRefEnd::XFCrossRefEnd()
++{
++}
++
++XFCrossRefEnd::~XFCrossRefEnd()
++{
++}
++
++void XFCrossRefEnd::ToXml(IXFStream *pStrm)
++{
++ pStrm->EndElement( A2OUSTR("text:bookmark-ref") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfcrossref.hxx lotuswordpro/source/filter/xfilter/xfcrossref.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfcrossref.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfcrossref.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,109 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * cross reference object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-05-17 create this file.
++ ************************************************************************/
++#ifndef _XFCROSSREF_HXX
++#define _XFCROSSREF_HXX
++
++#include "xfcontent.hxx"
++
++/**
++ * @brief
++ * Index entry obejct.
++ */
++class XFCrossRefStart : public XFContent
++{
++public:
++ XFCrossRefStart();
++ ~XFCrossRefStart();
++ void SetRefType(sal_uInt8 nType);
++ void SetMarkName(rtl::OUString sName);
++ void ToXml(IXFStream *pStrm);
++private:
++ enum{
++ CROSSREF_INVALID = 0,
++ CROSSREF_TEXT = 1,
++ CROSSREF_PAGE = 2,
++ CROSSREF_PARANUMBER = 3
++ };
++ sal_uInt8 m_nType;
++ rtl::OUString m_strMarkName;
++};
++
++inline void XFCrossRefStart::SetRefType(sal_uInt8 nType)
++{
++ m_nType = nType;
++}
++
++inline void XFCrossRefStart::SetMarkName(rtl::OUString sName)
++{
++ m_strMarkName = sName;
++}
++
++class XFCrossRefEnd : public XFContent
++{
++public:
++ XFCrossRefEnd();
++ ~XFCrossRefEnd();
++ void ToXml(IXFStream *pStrm);
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdate.cxx lotuswordpro/source/filter/xfilter/xfdate.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdate.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdate.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,118 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Date field with date style.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-21 create this file.
++ ************************************************************************/
++#include "xfdate.hxx"
++
++XFDate::XFDate()
++{
++ m_bFixed = 0;
++ rtl_zeroMemory(&m_aDateTime,sizeof(m_aDateTime));
++ m_bValued = sal_False;
++}
++
++XFDate::~XFDate()
++{
++
++}
++
++void XFDate::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ if( GetStyleName().getLength() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), GetStyleName() );
++ if (m_bValued)
++ pAttrList->AddAttribute( A2OUSTR("text:date-value"), m_strDate );
++
++ if( m_bFixed )
++ pAttrList->AddAttribute( A2OUSTR("text:fixed"), A2OUSTR("true") );
++
++ pStrm->StartElement( A2OUSTR("text:date") );
++ if (m_strText.getLength()>0)
++ pStrm->Characters(m_strText);
++ pStrm->EndElement( A2OUSTR("text:date") );
++}
++
++void XFDateStart::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ if( GetStyleName().getLength() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), GetStyleName() );
++/* if (m_bValued)
++ pAttrList->AddAttribute( A2OUSTR("text:date-value"), DateTimeToOUString(m_aDateTime) );
++ if( m_bFixed )
++ pAttrList->AddAttribute( A2OUSTR("text:fixed"), A2OUSTR("true") );
++
++ pStrm->StartElement( A2OUSTR("text:date") );
++ if (m_strText.getLength()>0)
++ pStrm->Characters(m_strText);
++*/
++ pStrm->StartElement( A2OUSTR("text:date") );
++}
++
++void XFDateEnd::ToXml(IXFStream *pStrm)
++{
++ pStrm->EndElement( A2OUSTR("text:date") );
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdate.hxx lotuswordpro/source/filter/xfilter/xfdate.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdate.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdate.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,135 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Date field with date style.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-21 create this file.
++ ************************************************************************/
++#ifndef _XFDATE_HXX
++#define _XFDATE_HXX
++
++#include "xfglobal.hxx"
++#include "xfcontent.hxx"
++
++/**
++ * @descr Date obejct.
++ */
++class XFDate : public XFContent
++{
++public:
++ XFDate();
++
++ virtual ~XFDate();
++
++public:
++ void SetDate(XFDateTime& dt);
++
++ void SetDate(const rtl::OUString& date);
++
++ void SetText(rtl::OUString& text);
++
++ void SetFixed(sal_Bool fixed = sal_True);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ sal_Bool m_bFixed;
++ rtl::OUString m_strText;
++ XFDateTime m_aDateTime;
++ rtl::OUString m_strDate;
++ sal_Bool m_bValued;
++};
++
++inline void XFDate::SetDate(XFDateTime& dt)
++{
++ m_aDateTime = dt;
++ m_strDate = DateTimeToOUString(m_aDateTime);
++ m_bValued = sal_True;
++}
++
++inline void XFDate::SetDate(const rtl::OUString& date)
++{
++ m_strDate = date;
++ m_bValued = sal_True;
++}
++
++inline void XFDate::SetText(rtl::OUString& text)
++{
++ m_strText = text;
++}
++
++inline void XFDate::SetFixed(sal_Bool fixed)
++{
++ m_bFixed = fixed;
++}
++
++class XFDateStart : public XFDate
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++class XFDateEnd : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdatestyle.cxx lotuswordpro/source/filter/xfilter/xfdatestyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdatestyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdatestyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,192 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Date style. The date format for date field.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-20 create this file.
++ ************************************************************************/
++#include "xfdatestyle.hxx"
++
++XFDatePart::XFDatePart()
++{
++ m_bTexture = sal_False;
++}
++
++void XFDatePart::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ switch(m_ePart)
++ {
++ case enumXFDateUnknown:
++ break;
++ case enumXFDateYear:
++ pAttrList->Clear();
++ if( m_bLongFmt )
++ pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
++ pStrm->StartElement( A2OUSTR("number:year") );
++ pStrm->EndElement( A2OUSTR("number:year") );
++ break;
++ case enumXFDateMonth:
++ pAttrList->Clear();
++ if( m_bTexture )
++ pAttrList->AddAttribute( A2OUSTR("number:textual"), A2OUSTR("true") );
++ if( m_bLongFmt )
++ pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
++ pStrm->StartElement( A2OUSTR("number:month") );
++ pStrm->EndElement( A2OUSTR("number:month") );
++ break;
++ case enumXFDateMonthDay:
++ pAttrList->Clear();
++ if( m_bLongFmt )
++ pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
++ pStrm->StartElement( A2OUSTR("number:day") );
++ pStrm->EndElement( A2OUSTR("number:day") );
++ break;
++ case enumXFDateWeekDay:
++ pAttrList->Clear();
++ if( m_bLongFmt )
++ pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
++ pStrm->StartElement( A2OUSTR("number:day-of-week") );
++ pStrm->EndElement( A2OUSTR("number:day-of-week") );
++ break;
++ case enumXFDateYearWeek:
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("number:week-of-year") );
++ pStrm->EndElement( A2OUSTR("number:week-of-year") );
++ break;
++ case enumXFDateEra:
++ pAttrList->Clear();
++ if( m_bLongFmt )
++ pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
++ pStrm->StartElement( A2OUSTR("number:era") );
++ pStrm->EndElement( A2OUSTR("number:era") );
++ break;
++ case enumXFDateQuarter:
++ pAttrList->Clear();
++ if( m_bLongFmt )
++ pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
++ pStrm->StartElement( A2OUSTR("number:quarter") );
++ pStrm->EndElement( A2OUSTR("number:quarter") );
++ break;
++ case enumXFDateHour:
++ pAttrList->Clear();
++ if( m_bLongFmt )
++ pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
++ pStrm->StartElement( A2OUSTR("number:hours") );
++ pStrm->EndElement( A2OUSTR("number:hours") );
++ break;
++ case enumXFDateMinute:
++ pAttrList->Clear();
++ if( m_bLongFmt )
++ pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
++ pStrm->StartElement( A2OUSTR("number:minutes") );
++ pStrm->EndElement( A2OUSTR("number:minutes") );
++ break;
++ case enumXFDateSecond:
++ pAttrList->Clear();
++ if( m_bLongFmt )
++ pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
++ if( m_nDecimalPos )
++ pAttrList->AddAttribute( A2OUSTR("number:decimal-places"), Int32ToOUString(m_nDecimalPos) );
++ pStrm->StartElement( A2OUSTR("number:seconds") );
++ pStrm->EndElement( A2OUSTR("number:seconds") );
++ break;
++ case enumXFDateAmPm:
++ pStrm->StartElement( A2OUSTR("number:am-pm") );
++ pStrm->EndElement( A2OUSTR("number:am-pm") );
++ break;
++ case enumXFDateText:
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("number:text") );
++ pStrm->Characters( m_strText );
++ pStrm->EndElement( A2OUSTR("number:text") );
++ break;
++ }
++}
++
++XFDateStyle::XFDateStyle()
++{
++ m_bFixed = sal_False;
++ m_bAutoOrder = sal_False;
++}
++
++XFDateStyle::~XFDateStyle()
++{
++}
++
++enumXFStyle XFDateStyle::GetStyleFamily()
++{
++ return enumXFStyleDate;
++}
++
++void XFDateStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
++ pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("data-style") );
++
++ pStrm->StartElement( A2OUSTR("number:date-style") );
++
++ m_aParts.ToXml(pStrm);
++
++ pStrm->EndElement( A2OUSTR("number:date-style") );
++}
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdatestyle.hxx lotuswordpro/source/filter/xfilter/xfdatestyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdatestyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdatestyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,260 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Date style. The date format for date field.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-20 create this file.
++ ************************************************************************/
++#ifndef _XFDATESTYLE_HXX
++#define _XFDATESTYLE_HXX
++
++#include "xfglobal.hxx"
++#include "xfstyle.hxx"
++#include "ixfproperty.hxx"
++#include "xftimestyle.hxx"
++#include "xfstylecont.hxx"
++#include <vector>
++
++class XFDatePart : public XFTimePart
++{
++public:
++ XFDatePart();
++public:
++ void SetTexture(sal_Bool bTexture);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ sal_Bool m_bTexture;
++};
++
++class XFDateStyle : public XFStyle
++{
++public:
++ XFDateStyle();
++
++ virtual ~XFDateStyle();
++
++public:
++
++ void SetFixed(sal_Bool fixed);
++
++ void SetLanguage(rtl::OUString lang);
++
++ void SetCountry(rtl::OUString country);
++
++ void SetAutoOrder(sal_Bool bAutoOrder);
++
++ void AddYear( sal_Bool bLongFmt = sal_True );
++
++ void AddMonth( sal_Bool bLongFmt = sal_True, sal_Bool bTexture = sal_False );
++
++ void AddMonthDay( sal_Bool bLongFmt = sal_True );
++
++ void AddWeekDay( sal_Bool bLongFmt = sal_True );
++
++ void AddYearWeek();
++
++ void AddEra(sal_Bool bLongFmt = sal_False);
++
++ void AddQuarter(sal_Bool bLongFmt = sal_False);
++
++ void AddHour( sal_Bool bLongFmt = sal_True );
++
++ void AddMinute( sal_Bool bLongFmt = sal_True );
++
++ void AddSecond( sal_Bool bLongFmt = sal_True, sal_Int16 nDecimalPos = 2);
++
++ void AddAmPm(sal_Bool bAmPm);
++
++ void AddText( rtl::OUString part );
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ sal_Bool m_bFixed;
++ sal_Bool m_bAutoOrder;
++ rtl::OUString m_strLanguage;
++ rtl::OUString m_strCountry;
++ XFStyleContainer m_aParts;
++};
++
++inline void XFDatePart::SetTexture(sal_Bool bTexture)
++{
++ m_bTexture = bTexture;
++}
++
++inline void XFDateStyle::SetFixed(sal_Bool fixed)
++{
++ m_bFixed = fixed;
++}
++
++inline void XFDateStyle::SetLanguage(rtl::OUString lang)
++{
++ m_strLanguage = lang;
++}
++
++inline void XFDateStyle::SetCountry(rtl::OUString country)
++{
++ m_strCountry = country;
++}
++
++inline void XFDateStyle::SetAutoOrder(sal_Bool bAutoOrder)
++{
++ m_bAutoOrder = bAutoOrder;
++}
++
++inline void XFDateStyle::AddYear( sal_Bool bLongFmt )
++{
++ XFDatePart *part = new XFDatePart();
++ part->SetPartType(enumXFDateYear);
++ part->SetLongFmt(bLongFmt);
++ m_aParts.AddStyle(part);
++}
++
++inline void XFDateStyle::AddMonth( sal_Bool bLongFmt, sal_Bool bTexture )
++{
++ XFDatePart *part = new XFDatePart();
++ part->SetPartType(enumXFDateMonth);
++ part->SetLongFmt(bLongFmt);
++ part->SetTexture(bTexture);
++ m_aParts.AddStyle(part);
++}
++
++inline void XFDateStyle::AddMonthDay( sal_Bool bLongFmt )
++{
++ XFDatePart *part = new XFDatePart();
++ part->SetPartType(enumXFDateMonthDay);
++ part->SetLongFmt(bLongFmt);
++ m_aParts.AddStyle(part);
++}
++
++inline void XFDateStyle::AddWeekDay( sal_Bool bLongFmt )
++{
++ XFDatePart *part = new XFDatePart();
++ part->SetPartType(enumXFDateWeekDay);
++ part->SetLongFmt(bLongFmt);
++ m_aParts.AddStyle(part);
++}
++
++inline void XFDateStyle::AddYearWeek()
++{
++ XFDatePart *part = new XFDatePart();
++ part->SetPartType(enumXFDateYearWeek);
++ m_aParts.AddStyle(part);
++}
++
++inline void XFDateStyle::AddEra(sal_Bool bLongFmt)
++{
++ XFDatePart *part = new XFDatePart();
++ part->SetPartType(enumXFDateEra);
++ part->SetLongFmt(bLongFmt);
++ m_aParts.AddStyle(part);
++}
++
++inline void XFDateStyle::AddQuarter(sal_Bool bLongFmt)
++{
++ XFDatePart *part = new XFDatePart();
++ part->SetPartType(enumXFDateQuarter);
++ part->SetLongFmt(bLongFmt);
++ m_aParts.AddStyle(part);
++}
++
++inline void XFDateStyle::AddText( rtl::OUString text )
++{
++ XFDatePart *part = new XFDatePart();
++ part->SetPartType(enumXFDateText);
++ part->SetText(text);
++ m_aParts.AddStyle(part);
++}
++
++inline void XFDateStyle::AddHour( sal_Bool bLongFmt )
++{
++ XFDatePart *part = new XFDatePart();
++ part->SetPartType(enumXFDateHour);
++ part->SetLongFmt(bLongFmt);
++ m_aParts.AddStyle(part);
++}
++
++inline void XFDateStyle::AddMinute( sal_Bool bLongFmt )
++{
++ XFDatePart *part = new XFDatePart();
++ part->SetPartType(enumXFDateMinute);
++ part->SetLongFmt(bLongFmt);
++ m_aParts.AddStyle(part);
++}
++
++inline void XFDateStyle::AddSecond( sal_Bool bLongFmt, sal_Int16 pos)
++{
++ XFDatePart *part = new XFDatePart();
++ part->SetPartType(enumXFDateSecond);
++ part->SetLongFmt(bLongFmt);
++ part->SetDecimalPos(pos);
++ m_aParts.AddStyle(part);
++}
++
++inline void XFDateStyle::AddAmPm(sal_Bool bAmPm)
++{
++ XFDatePart *part = new XFDatePart();
++ part->SetPartType(enumXFDateAmPm);
++ m_aParts.AddStyle(part);
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdefs.hxx lotuswordpro/source/filter/xfilter/xfdefs.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdefs.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdefs.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,514 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * enum const defines.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-21 create this file.
++ ************************************************************************/
++#ifndef _XFDEFS_HXX
++#define _XFDEFS_HXX
++
++#include "sal/types.h"
++
++enum enumXFContent
++{
++ enumXFContentUnknown,
++ enumXFContentText,
++ enumXFContentSpan,
++ enumXFContentPara,
++ enumXFContentHeading,
++ enumXFContentTable,
++ enumXFContentTableCell,
++ enumXFContentTableRow,
++ enumXFContentTableCol,
++ enumXFContentGraphics,
++ enumXFContentFrame,
++ enumXFContentContainer,
++};
++
++enum enumXFStyle
++{
++ enumXFStyleUnknown,
++ enumXFStyleText,
++ enumXFStylePara,
++ enumXFStyleList,
++ enumXFStyleSection,
++ enumXFStyleGraphics,
++ enumXFStylePageMaster,
++ enumXFStyleMasterPage,
++ enumXFStyleDate,
++ enumXFStyleTime,
++ enumXFStylePercent,
++ enumXFStyleNumber,
++ enumXFStyleCurrency,
++ enumXFStyleTable,
++ enumXFStyleTableCell,
++ enumXFStyleTableRow,
++ enumXFStyleTableCol,
++ enumXFStyleOutline,
++ enumXFStyleStrokeDash,
++ enumXFStyleArea,
++ enumXFStyleArrow,
++ enumXFStyleRuby,
++ enumXFStyleDefaultPara,
++};
++
++enum enumXFFrameType
++{
++ enumXFFrameUnknown,
++ enumXFFrameDrawing,
++ enumXFFrameImage,
++ enumXFFrameTextbox,
++};
++
++enum enumXFUnderline
++{
++ enumXFUnderlineNone = 0,
++ enumXFUnderlineSingle,
++ enumXFUnderlineDouble,
++ enumXFUnderlineDotted,
++ enumXFUnderlineDash,
++ enumXFUnderlineLongDash,
++ enumXFUnderlineDotDash,
++ enumXFUnderlineDotDotDash,
++ enumXFUnderlineWave,
++ enumXFUnderlineBold,
++ enumXFUnderlineBoldDotted,
++ enumXFUnderlineBoldDash,
++ enumXFUnderlineBoldLongDash,
++ enumXFUnderlineBoldDotDash,
++ enumXFUnderlineBoldDotDotDash,
++ enumXFUnderlineBoldWave,
++ enumXFUnderlineDoubleWave,
++ enumXFUnderlineSmallWave
++};
++
++enum enumXFRelief
++{
++ enumXFReliefNone = 0,
++ enumXFReliefEngraved,
++ enumXFReliefEmbossed,
++};
++
++enum enumXFCrossout
++{
++ enumXFCrossoutNone = 0,
++ enumXFCrossoutSignel,
++ enumXFCrossoutDouble,
++ enumXFCrossoutThick,
++ enumXFCrossoutSlash,
++ enumXFCrossoutX
++};
++
++enum enumXFTransform
++{
++ enumXFTransformNone = 0,
++ enumXFTransformUpper,
++ enumXFTransformLower,
++ enumXFTransformCapitalize,
++ enumXFTransformSmallCaps
++};
++
++enum enumXFEmphasize
++{
++ enumXFEmphasizeNone = 0,
++ enumXFEmphasizeDot,
++ enumXFEmphasizeCircle,
++ enumXFEmphasizeDisc,
++ enumXFEmphasizeAccent
++};
++
++
++enum enumXFAlignType
++{
++ enumXFAlignNone = 0,
++ enumXFAlignStart,
++ enumXFAlignCenter,
++ enumXFAlignEnd,
++ enumXFAlignJustify,
++ enumXFAlignTop,
++ enumXFAlignMiddle,
++ enumXFAlignBottom,
++ enumXFALignMargins,
++};
++
++enum enumXFShadowPos
++{
++ enumXFShadowNone,
++ enumXFShadowRightBottom,
++ enumXFShadowRightTop,
++ enumXFShadowLeftBottom,
++ enumXFShadowLeftTop
++};
++
++enum enumXFBorder
++{
++ enumXFBorderNone,
++ enumXFBorderLeft,
++ enumXFBorderRight,
++ enumXFBorderTop,
++ enumXFBorderBottom,
++};
++
++/**************************************************************************
++ * @descr
++ * Line height type.
++ * enumLHHeight: height of the line,in "cm".
++ * enumLHLeast: the height may be adjusted,but has a min value.
++ * enumLHPercent: the height is a centain times of the normal height.
++ * enumLHSpace: space between lines.
++ *************************************************************************/
++enum enumLHType
++{
++ enumLHNone,
++ enumLHHeight,
++ enumLHLeast,
++ enumLHPercent,
++ enumLHSpace,
++};
++
++enum enumXFBreaks
++{
++ enumXFBreakAuto,
++ enumXFBreakBefPage,
++ enumXFBreakBefColumn,
++ enumXFBreakAftPage,
++ enumXFBreakAftColumn,
++ enumXFBreakKeepWithNext,
++};
++
++enum enumXFTab
++{
++ enumXFTabNone,
++ enumXFTabLeft,
++ enumXFTabCenter,
++ enumXFTabRight,
++ enumXFTabChar,
++};
++
++enum enumXFDatePart
++{
++ enumXFDateUnknown,
++ enumXFDateYear,
++ enumXFDateMonth,
++ enumXFDateMonthDay,
++ enumXFDateWeekDay,
++ enumXFDateYearWeek,
++ enumXFDateEra,
++ enumXFDateQuarter,
++ enumXFDateHour,
++ enumXFDateMinute,
++ enumXFDateSecond,
++ enumXFDateAmPm,
++ enumXFDateText
++};
++
++enum enumXFAnchor
++{
++ enumXFAnchorNone,
++ enumXFAnchorPara,
++ enumXFAnchorPage,
++ enumXFAnchorChar,
++ enumXFAnchorAsChar,
++ enumXFAnchorFrame
++};
++
++enum enumXFWrap
++{
++ enumXFWrapNone,
++ enumXFWrapLeft,
++ enumXFWrapRight,
++ enumXFWrapParallel,
++ enumXFWrapRunThrough,
++ enumXFWrapBest,
++ enumXFWrapBackground
++};
++
++enum enumXFTextDir
++{
++ enumXFTextDirNone,
++ enumXFTextDirLR,
++ enumXFTextDirLR_TB,
++ enumXFTextDirPage,
++ enumXFTextDirRL,
++ enumXFTextDirRL_TB,
++ enumXFTextDirTB,
++ enumXFTextDirTB_LR,
++ enumXFTextDirTB_RL
++};
++
++enum enumXFFrameXRel
++{
++ enumXFFrameXRelPage,
++ enumXFFrameXRelPageContent,
++ enumXFFrameXRelPageEndMargin,
++ enumXFFrameXRelPageStartMargin,
++ enumXFFrameXRelPara,
++ enumXFFrameXRelParaContent,
++ enumXFFrameXRelParaEndMargin,
++ enumXFFrameXRelParaStartMargin,
++ enumXFFrameXRelChar,
++ enumXFFrameXRelFrame,
++ enumXFFrameXRelFrameContent,
++ enumXFFrameXRelFrameEndMargin,
++ enumXFFrameXRelFrameStartMargin
++};
++
++enum enumXFFrameXPos
++{
++ enumXFFrameXPosLeft,
++ enumXFFrameXPosRight,
++ enumXFFrameXPosCenter,
++ enumXFFrameXPosFromLeft
++};
++
++enum enumXFFrameYRel
++{
++ enumXFFrameYRelBaseLine,
++ enumXFFrameYRelChar,
++ enumXFFrameYRelFrame,
++ enumXFFrameYRelFrameContent,
++ enumXFFrameYRelLine,
++ enumXFFrameYRelPage,
++ enumXFFrameYRelPageContent,
++ enumXFFrameYRelPara,
++ enumXFFrameYRelParaContent,
++ enumXFFrameYRelText
++};
++
++enum enumXFFrameYPos
++{
++ enumXFFrameYPosTop,
++ enumXFFrameYPosMiddle,
++ enumXFFrameYPosBottom,
++ enumXFFrameYPosFromTop,
++ enumXFFrameYPosBelow,
++};
++
++enum enumXFTableColVisible
++{
++ enumXFTableColVisibleYes,
++ enumXFTableColVisibleCollapse,
++ enumXFTableColVisibleFilter,
++};
++
++enum enumXFBookmarkRef
++{
++ enumXFBookmarkNone,
++ enumXFBookmarkPage,
++ enumXFBookmarkChapter,
++ enumXFBookmarkDir,
++ enumXFBookmarkDef
++};
++
++enum enumXFDrawKind
++{
++ enumXFDrawKindFull,
++ enumXFDrawKindSection,
++ enumXFDrawKindCut,
++ enumXFDrawKindArc
++};
++
++enum enumXFLineStyle
++{
++ enumXFLineNone,
++ enumXFLineSolid,
++ enumXFLineDot,
++ enumXFLineDash,
++ enumXFLineDotDash,
++ enumXFLineDashDot
++};
++
++enum enumXFAreaStyle
++{
++ enumXFAreaNone,
++ enumXFAreaSolid,
++ enumXFAreaGradient,
++ enumXFAreaBitmap,
++ enumXFAreaHatch
++};
++
++enum enumXFAreaLineStyle
++{
++ enumXFAreaLineSingle,
++ enumXFAreaLineCrossed,
++ enumXFAreaLineTriple
++};
++
++enum enumXFColorMode
++{
++ enumXFColorStandard,
++ enumXFColorGreyscale,
++ enumXFColorMono,
++ enumXFColorWatermark
++};
++
++enum enumXFPageUsage
++{
++ enumXFPageUsageNone,
++ enumXFPageUsageAll,
++ enumXFPageUsageLeft,
++ enumXFPageUsageRight,
++ enumXFPageUsageMirror
++};
++
++enum enumXFValueType
++{
++ enumXFValueTypeNone,
++ enumXFValueTypeBoolean,
++ enumXFValueTypeCurrency,
++ enumXFValueTypeDate,
++ enumXFValueTypeFloat,
++ enumXFValueTypePercentage,
++ enumXFValueTypeString,
++ enumXFValueTypeTime,
++};
++
++enum enumXFNumberType
++{
++ enumXFNumberNumber,
++ enumXFNumberPercent,
++ enuMXFNumberCurrency,
++ enumXFNumberScientific,
++ enumXFText,
++};
++
++enum enumXFLineNumberPos
++{
++ enumXFLineNumberLeft,
++ enumXFLineNumberRight,
++ enumXFLineNumberInner,
++ enumXFLineNumberOutter,
++};
++
++enum enumXFEntry
++{
++ enumXFEntryTOC,
++ enumXFEntryAlphabetical,
++ enumXFEntryUserIndex,
++};
++
++enum enumXFIndex
++{
++ enumXFIndexTOC,
++ enumXFIndexAlphabetical,
++ enumXFIndexUserIndex,
++ enumXFIndexObject,
++ enumXFIndexIllustration,
++ enumXFIndexTableIndex,
++};
++
++enum enumXFIndexTemplate
++{
++ enumXFIndexTemplateUnknown,
++ enumXFIndexTemplateChapter,
++ enumXFIndexTemplateText,
++ enumXFIndexTemplateTab,
++ enumXFIndexTemplatePage,
++ enumXFIndexTemplateLinkStart,
++ enumXFIndexTemplateLinkEnd,
++ enumXFIndexTemplateSpan,
++ enumXFIndexTemplateBibliography,
++};
++
++struct XFDateTime
++{
++ sal_Int32 nYear;
++ sal_Int32 nMonth;
++ sal_Int32 nDay;
++ sal_Int32 nHour;
++ sal_Int32 nMinute;
++ sal_Int32 nSecond;
++ sal_Int32 nMillSecond;
++};
++
++enum enumXFRubyPosition
++{
++ enumXFRubyLeft = 4,
++ enumXFRubyRight = 5,
++ enumXFRubyCenter = 2,
++ enumXFRubyTop = 1,
++ enumXFRubyBottom = 3,
++};
++enum enumXFFWStyle
++{
++ enumXFFWOff,
++ enumXFFWRotate,
++ enumXFFWUpright,
++ enumXFFWSlantX,//slant-x
++ enumXFFWSlantY//slant-y
++};
++
++enum enumXFFWAdjust
++{
++ enumXFFWAdjustAutosize,//autosize
++ enumXFFWAdjustLeft,
++ enumXFFWAdjustCenter,//center
++ enumXFFWAdustRight//right
++};
++
++enum enumXFFWShadow
++{
++ enumXFFWShadowNone,
++ enumXFFWShadowNormal,
++ enumXFFWShadowVertical,
++ enumXFFWShadowSlant
++};
++
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdocfield.cxx lotuswordpro/source/filter/xfilter/xfdocfield.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdocfield.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdocfield.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,234 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * doc field.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-05-27 create this file.
++ ************************************************************************/
++#include "xfdocfield.hxx"
++
++void XFFileName::SetType(rtl::OUString sType)
++{
++ m_strType = sType;
++}
++
++void XFFileName::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ if (m_strType.equals(A2OUSTR("FileName")))
++ pAttrList->AddAttribute( A2OUSTR("text:display"), A2OUSTR("name-and-extension") );
++ else if (m_strType.equals(A2OUSTR("Path")))
++ pAttrList->AddAttribute( A2OUSTR("text:display"), A2OUSTR("path") );
++ pStrm->StartElement( A2OUSTR("text:file-name") );
++ pStrm->EndElement( A2OUSTR("text:file-name") );
++}
++
++void XFWordCount::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("text:word-count") );
++ pStrm->EndElement( A2OUSTR("text:word-count") );
++}
++
++void XFCharCount::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("text:character-count") );
++ pStrm->EndElement( A2OUSTR("text:character-count") );
++}
++
++void XFDescription::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("text:description") );
++ pStrm->EndElement( A2OUSTR("text:description") );
++}
++
++void XFPageCountStart::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("text:page-count") );
++}
++void XFPageCountEnd::ToXml(IXFStream *pStrm)
++{
++ pStrm->EndElement( A2OUSTR("text:page-count") );
++}
++
++void XFWordCountStart::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("text:word-count") );
++}
++
++void XFCharCountStart::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("text:character-count") );
++}
++
++void XFDescriptionStart::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("text:description") );
++}
++
++void XFWordCountEnd::ToXml(IXFStream *pStrm)
++{
++ pStrm->EndElement( A2OUSTR("text:word-count") );
++}
++
++void XFCharCountEnd::ToXml(IXFStream *pStrm)
++{
++ pStrm->EndElement( A2OUSTR("text:character-count") );
++}
++
++void XFDescriptionEnd::ToXml(IXFStream *pStrm)
++{
++ pStrm->EndElement( A2OUSTR("text:description") );
++}
++
++void XFKeywords::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("text:keywords") );
++ pStrm->EndElement( A2OUSTR("text:keywords") );
++}
++
++void XFTotalEditTime::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ if (m_strStyleName.getLength()>0)
++ pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), m_strStyleName );
++ pStrm->StartElement( A2OUSTR("text:editing-duration" ) );
++ pStrm->EndElement( A2OUSTR("text:editing-duration") );
++}
++void XFTotalEditTimeStart::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ if (m_strStyleName.getLength()>0)
++ pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), m_strStyleName );
++ pStrm->StartElement( A2OUSTR("text:editing-duration" ) );
++}
++void XFTotalEditTimeEnd::ToXml(IXFStream *pStrm)
++{
++ pStrm->EndElement( A2OUSTR("text:editing-duration") );
++}
++void XFCreateTime::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ if (m_strStyleName.getLength()>0)
++ pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), m_strStyleName );
++ pStrm->StartElement( A2OUSTR("text:creation-time") );
++ pStrm->EndElement( A2OUSTR("text:creation-time") );
++}
++void XFLastEditTime::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ if (m_strStyleName.getLength()>0)
++ pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), m_strStyleName );
++ pStrm->StartElement( A2OUSTR("text:modification-time") );
++ pStrm->EndElement( A2OUSTR("text:modification-time") );
++}
++
++void XFCreateTimeStart::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ if (m_strStyleName.getLength()>0)
++ pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), m_strStyleName );
++ pStrm->StartElement( A2OUSTR("text:creation-time") );
++}
++
++void XFLastEditTimeStart::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ if (m_strStyleName.getLength()>0)
++ pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), m_strStyleName );
++ pStrm->StartElement( A2OUSTR("text:modification-time") );
++}
++void XFCreateTimeEnd::ToXml(IXFStream *pStrm)
++{
++ pStrm->EndElement( A2OUSTR("text:creation-time") );
++}
++
++void XFLastEditTimeEnd::ToXml(IXFStream *pStrm)
++{
++ pStrm->EndElement( A2OUSTR("text:modification-time") );
++}
++
++void XFInitialCreator::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("text:initial-creator") );
++ pStrm->EndElement( A2OUSTR("text:initial-creator") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdocfield.hxx lotuswordpro/source/filter/xfilter/xfdocfield.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdocfield.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdocfield.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,200 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * doc field.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-05-27 create this file.
++ ************************************************************************/
++#ifndef _XFDOCFIELD_HXX
++#define _XFDOCFIELD_HXX
++
++#include "xfcontent.hxx"
++#include "xfpagecount.hxx"
++
++class XFFileName : public XFContent
++{
++public:
++ void SetType(rtl::OUString sType);
++ virtual void ToXml(IXFStream *pStrm);
++private:
++ rtl::OUString m_strType;
++};
++class XFWordCount : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++class XFWordCountStart : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++class XFWordCountEnd : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++class XFPageCountStart : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++class XFPageCountEnd : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++class XFCharCount : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++class XFCharCountStart : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++class XFCharCountEnd : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++class XFDescription : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++class XFDescriptionStart : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++class XFDescriptionEnd : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++class XFKeywords : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++class XFTotalEditTime : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++class XFTotalEditTimeEnd : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++class XFTotalEditTimeStart : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++class XFCreateTime : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++class XFCreateTimeStart : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++class XFCreateTimeEnd : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++class XFLastEditTime : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++class XFLastEditTimeStart : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++class XFLastEditTimeEnd : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++class XFInitialCreator : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawareastyle.cxx lotuswordpro/source/filter/xfilter/xfdrawareastyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawareastyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawareastyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,99 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Area style of Drawing object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-02-21 create this file.
++ ************************************************************************/
++#include "xfdrawareastyle.hxx"
++
++XFDrawAreaStyle::XFDrawAreaStyle()
++{
++ m_eAreaStyle = enumXFAreaSolid;
++ m_eLineStyle = enumXFAreaLineSingle;
++ m_nAngle = 0;
++ m_fSpace = 0.18;
++}
++
++enumXFStyle XFDrawAreaStyle::GetStyleFamily()
++{
++ return enumXFStyleArea;
++}
++
++void XFDrawAreaStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute( A2OUSTR("draw:name"), GetStyleName() );
++
++ if( m_eLineStyle == enumXFAreaLineSingle )
++ pAttrList->AddAttribute( A2OUSTR("draw:style"), A2OUSTR("single") );
++ else if( m_eLineStyle == enumXFAreaLineCrossed )
++ pAttrList->AddAttribute( A2OUSTR("draw:style"), A2OUSTR("double") );
++ else if( m_eLineStyle == enumXFAreaLineTriple )
++ pAttrList->AddAttribute( A2OUSTR("draw:style"), A2OUSTR("triple") );
++
++ pAttrList->AddAttribute( A2OUSTR("draw:color"), m_aLineColor.ToString() );
++ pAttrList->AddAttribute( A2OUSTR("draw:rotation"), Int32ToOUString(m_nAngle*10) );
++ pAttrList->AddAttribute( A2OUSTR("draw:distance"), DoubleToOUString(m_fSpace)+A2OUSTR("cm") );
++
++ pStrm->StartElement( A2OUSTR("draw:hatch") );
++ pStrm->EndElement( A2OUSTR("draw:hatch") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawareastyle.hxx lotuswordpro/source/filter/xfilter/xfdrawareastyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawareastyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawareastyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,145 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Area style of Drawing object.
++ * Only support fill color and fill pattern now.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-02-21 create this file.
++ ************************************************************************/
++#ifndef _XFDRAWAREASTYLE_HXX
++#define _XFDRAWAREASTYLE_HXX
++
++#include "xfstyle.hxx"
++#include "xfcolor.hxx"
++
++class XFDrawAreaStyle : public XFStyle
++{
++public:
++ XFDrawAreaStyle();
++
++public:
++ void SetAreaStyle(enumXFAreaStyle style);
++
++ void SetLineStyle(enumXFAreaLineStyle style);
++
++ void SetBackColor(XFColor& color);
++
++ void SetLineColor(XFColor& color);
++
++ void SetLineAngle(sal_Int32 angle);
++
++ void SetLineSpace(double space);
++
++ enumXFAreaStyle GetAreaStyle();
++
++ XFColor GetBackColor();
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ enumXFAreaStyle m_eAreaStyle;
++ enumXFAreaLineStyle m_eLineStyle;
++ XFColor m_aBackColor;
++ XFColor m_aLineColor;
++ sal_Int32 m_nAngle;
++ double m_fSpace;
++};
++
++inline void XFDrawAreaStyle::SetAreaStyle(enumXFAreaStyle style)
++{
++ m_eAreaStyle = style;
++}
++
++inline void XFDrawAreaStyle::SetLineStyle(enumXFAreaLineStyle style)
++{
++ m_eLineStyle = style;
++}
++
++inline void XFDrawAreaStyle::SetBackColor(XFColor& color)
++{
++ m_aBackColor = color;
++}
++
++inline void XFDrawAreaStyle::SetLineColor(XFColor& color)
++{
++ m_aLineColor = color;
++}
++
++inline void XFDrawAreaStyle::SetLineAngle(sal_Int32 angle)
++{
++ m_nAngle = angle;
++}
++
++inline void XFDrawAreaStyle::SetLineSpace(double space)
++{
++ m_fSpace = space;
++}
++
++inline enumXFAreaStyle XFDrawAreaStyle::GetAreaStyle()
++{
++ return m_eAreaStyle;
++}
++
++inline XFColor XFDrawAreaStyle::GetBackColor()
++{
++ return m_aBackColor;
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawchart.cxx lotuswordpro/source/filter/xfilter/xfdrawchart.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawchart.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawchart.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,96 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * chart object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-25 draft code for draw chart in XML.
++ ************************************************************************/
++
++#include "xfdrawchart.hxx"
++
++#include "xfchartstreamtools.hxx"
++
++XFDrawChart::XFDrawChart()
++{
++ m_strName=XFGlobal::GenObjName();
++}
++
++void XFDrawChart::Add(IXFContent* pXFChartStream)
++{
++ m_pXFChartStream = pXFChartStream;
++}
++
++void XFDrawChart::ToXml(IXFStream *pStrm)
++{
++ XFDrawObject::ToXml(pStrm);
++
++ pStrm->StartElement( A2OUSTR("draw:object") );
++ ContentToXml(pStrm);
++ m_pXFChartStream->ToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("draw:object") );
++}
++
++void XFChartStream::SetChartStream(SvStorageStreamRef rCntStream)
++{
++ m_rCntStream = rCntStream;
++}
++
++void XFChartStream::ToXml(IXFStream *pSaxStream)
++{
++ XFChartStreamTools::ParseStream(m_rCntStream,pSaxStream);
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawchart.hxx lotuswordpro/source/filter/xfilter/xfdrawchart.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawchart.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawchart.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,98 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Chart object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-25 create this file,draft code for chart xml.
++ ************************************************************************/
++#ifndef _XFDRAWECLIPSE_HXX
++#define _XFDRAWECLIPSE_HXX
++
++#include "xfdrawobj.hxx"
++#include <so3/svstor.hxx>
++/**
++* @brief
++* draw chart object in XML
++*/
++class XFDrawChart : public XFDrawObject
++{
++public:
++ XFDrawChart();
++
++public:
++ virtual void ToXml(IXFStream *pStrm);
++ virtual void Add(IXFContent* pXFChartStream);
++
++private:
++ IXFContent* m_pXFChartStream;
++
++};
++/**
++* @brief
++* draw chart stream in XML
++*/
++class XFChartStream:public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pSaxStream);
++ void SetChartStream(SvStorageStreamRef rCntStream);
++protected:
++ SvStorageStreamRef m_rCntStream;
++};
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawcircle.cxx lotuswordpro/source/filter/xfilter/xfdrawcircle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawcircle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawcircle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,134 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Circle object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-17 create this file.
++ ************************************************************************/
++#include "xfdrawcircle.hxx"
++#include <math.h>
++#include <cstdlib>
++
++XFDrawCircle::XFDrawCircle()
++{
++ m_fRadius = 0;
++ m_fStartAngle = 0;
++ m_fEndAngle = 360;
++ m_eDrawKind = enumXFDrawKindFull;
++ m_bUseAngle = sal_False;
++}
++
++XFDrawCircle::XFDrawCircle(XFPoint pt, double radius)
++{
++ m_aCenterPoint = pt;
++ m_fRadius = radius;
++ m_fStartAngle = 0;
++ m_fEndAngle = 360;
++ m_eDrawKind = enumXFDrawKindFull;
++ m_bUseAngle = sal_False;
++}
++
++void XFDrawCircle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ if( m_bUseAngle )
++ {
++ double x1 = m_aCenterPoint.GetX() + m_fRadius*cos(m_fStartAngle*2*PI/360);
++ double x2 = m_aCenterPoint.GetX() + m_fRadius*cos(m_fEndAngle*2*PI/360);
++ double y1 = m_aCenterPoint.GetY() + m_fRadius*sin(m_fStartAngle*2*PI/360);
++ double y2 = m_aCenterPoint.GetY() + m_fRadius*sin(m_fEndAngle*2*PI/360);
++ double width;
++ double height;
++
++ double x11 = MIN3(m_aCenterPoint.GetX()-m_fRadius,x1,x2);
++ double x12 = MAX3(m_aCenterPoint.GetX()+m_fRadius,x1,x2);
++ double y11 = MIN3(m_aCenterPoint.GetY()-m_fRadius,y1,y2);
++ double y12 = MAX3(m_aCenterPoint.GetY()+m_fRadius,y1,y2);
++ width = x12-x11;
++ height = y12-y11;
++
++ if (width > FLOAT_MIN || height > FLOAT_MIN)
++ {
++ SetPosition(x11,y11,width,height);
++ }
++
++ //
++ pAttrList->AddAttribute( A2OUSTR("draw:kind"), GetDrawKind(m_eDrawKind) );
++ pAttrList->AddAttribute( A2OUSTR("draw:start-angle"), DoubleToOUString(m_fStartAngle) );
++ pAttrList->AddAttribute( A2OUSTR("draw:end-angle"), DoubleToOUString(m_fEndAngle) );
++ }
++ else
++ {
++ double x = m_aCenterPoint.GetX() - m_fRadius;
++ double y = m_aCenterPoint.GetY() - m_fRadius;
++ double width = m_fRadius*2;
++ double height = m_fRadius*2;
++ if (width > FLOAT_MIN || height > FLOAT_MIN)
++ {
++ SetPosition(x,y,width,height);
++ }
++ }
++
++ XFDrawObject::ToXml(pStrm);
++
++ pStrm->StartElement( A2OUSTR("draw:circle") );
++ ContentToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("draw:circle") );
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawcircle.hxx lotuswordpro/source/filter/xfilter/xfdrawcircle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawcircle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawcircle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,143 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Circle object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-17 create this file.
++ ************************************************************************/
++#ifndef _XFDRAWCIRCLE_HXX
++#define _XFDRAWCIRCLE_HXX
++
++#include "xfdrawobj.hxx"
++
++/**
++ * @brief
++ * Circle object.
++ */
++class XFDrawCircle : public XFDrawObject
++{
++public:
++ XFDrawCircle();
++
++ XFDrawCircle(XFPoint pt, double radius);
++
++public:
++ /**
++ * @descr Set the center point for the circle.
++ */
++ void SetCenterPoint(double x, double y);
++
++ /**
++ * @descr Set the center point for the circle
++ */
++ void SetCenterPoint(XFPoint pt);
++
++ /**
++ * @descr
++ */
++ void SetRadius(double radius);
++
++ void SetAngle(double start, double end);
++
++ void SetDrawKind(enumXFDrawKind kind);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ XFPoint m_aCenterPoint;
++ double m_fRadius;
++ double m_fStartAngle;
++ double m_fEndAngle;
++ enumXFDrawKind m_eDrawKind;
++ sal_Bool m_bUseAngle;
++};
++
++inline void XFDrawCircle::SetCenterPoint(double x, double y)
++{
++ m_aCenterPoint = XFPoint(x,y);
++}
++
++inline void XFDrawCircle::SetCenterPoint(XFPoint pt)
++{
++ m_aCenterPoint = pt;
++}
++
++inline void XFDrawCircle::SetRadius(double radius)
++{
++ m_fRadius = radius;
++}
++
++inline void XFDrawCircle::SetAngle(double start, double end)
++{
++ assert(start>=0&&start<=360);
++ assert(end>=0&&end<=360);
++ m_fStartAngle = start;
++ m_fEndAngle = end;
++
++ m_bUseAngle = sal_True;
++ m_eDrawKind = enumXFDrawKindCut;
++}
++
++inline void XFDrawCircle::SetDrawKind(enumXFDrawKind kind)
++{
++ m_eDrawKind = kind;
++}
++
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawellipse.cxx lotuswordpro/source/filter/xfilter/xfdrawellipse.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawellipse.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawellipse.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,118 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Eclipse object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-18 create this file.
++ ************************************************************************/
++#include "xfdrawellipse.hxx"
++#include <cmath>
++
++XFDrawEllipse::XFDrawEllipse()
++{
++ m_fRadiusX = 0;
++ m_fRadiusY = 0;
++ m_fStartAngle = 0;
++ m_fEndAngle = 360;
++ m_eDrawKind = enumXFDrawKindFull;
++ m_bUseAngle = sal_False;
++}
++
++void XFDrawEllipse::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ //not support yet.
++ if( m_bUseAngle )
++ {
++ double x1 = m_aCenterPoint.GetX() + m_fRadiusX*cos(m_fStartAngle*2*PI/360);
++ double x2 = m_aCenterPoint.GetX() + m_fRadiusX*cos(m_fEndAngle*2*PI/360);
++ double y1 = m_aCenterPoint.GetY() + m_fRadiusY*sin(m_fStartAngle*2*PI/360);
++ double y2 = m_aCenterPoint.GetY() + m_fRadiusY*sin(m_fEndAngle*2*PI/360);
++ double width;
++ double height;
++
++ double x11 = MIN3(m_aCenterPoint.GetX()-m_fRadiusX,x1,x2);
++ double x12 = MAX3(m_aCenterPoint.GetX()+m_fRadiusX,x1,x2);
++ double y11 = MIN3(m_aCenterPoint.GetY()-m_fRadiusY,y1,y2);
++ double y12 = MAX3(m_aCenterPoint.GetY()+m_fRadiusY,y1,y2);
++ width = x12-x11;
++ height = y12-y11;
++ SetPosition(x11,y11,width,height);
++
++ //
++ pAttrList->AddAttribute( A2OUSTR("draw:kind"), GetDrawKind(m_eDrawKind) );
++ pAttrList->AddAttribute( A2OUSTR("draw:start-angle"), DoubleToOUString(m_fStartAngle) );
++ pAttrList->AddAttribute( A2OUSTR("draw:end-angle"), DoubleToOUString(m_fEndAngle) );
++ }
++ else
++ {
++ double x = m_aCenterPoint.GetX() - m_fRadiusX;
++ double y = m_aCenterPoint.GetY() - m_fRadiusY;
++ double width = m_fRadiusX*2;
++ double height = m_fRadiusY*2;
++ SetPosition(x,y,width,height);
++ }
++
++ XFDrawObject::ToXml(pStrm);
++
++ pStrm->StartElement( A2OUSTR("draw:ellipse") );
++ ContentToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("draw:ellipse") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawellipse.hxx lotuswordpro/source/filter/xfilter/xfdrawellipse.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawellipse.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawellipse.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,157 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Eclipse object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-18 create this file.
++ ************************************************************************/
++#ifndef _XFDRAWELLIPSE_HXX
++#define _XFDRAWELLIPSE_HXX
++
++#include "xfdrawobj.hxx"
++
++/**
++ * @brief
++ * Ellipse obejct for drawing layer.
++ * You can set Ellipse position by setting it's center point and radius or calling XFDrawEllipse::SetPosition function.
++ * If you using the first method,i'll calc the real position.
++ *
++ * You can draw part of an ellipse by using SetAngle(), for example, use SetaAngle(0,180) to draw half a ellipse.
++ * When draw part of an ellipse, you can use SetDrawKind() to decide which kind of object to draw, an arch, a section,
++ * or a cut.
++ */
++class XFDrawEllipse : public XFDrawObject
++{
++public:
++ XFDrawEllipse();
++
++public:
++ /**
++ * @descr Set ellipse center point.
++ */
++ void SetCenterPoint(double x, double y);
++
++ /**
++ * @descr Set ellipse center point.
++ */
++ void SetCenterPoint(XFPoint pt);
++
++ /**
++ * @descr Set ellipse radius.
++ */
++ void SetRadius(double radiusX, double radiusY);
++
++ /**
++ * @descr If only draw part of the ellipse, set the start angle and end angle.
++ */
++ void SetAngle(double start, double end);
++
++ /**
++ * @descr Set ellipse draw type,please refer to enumXFDrawKind.
++ */
++ void SetDrawKind(enumXFDrawKind kind);
++
++ /**
++ * @descr Output ellipse obejct.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ XFPoint m_aCenterPoint;
++ double m_fRadiusX;
++ double m_fRadiusY;
++ double m_fStartAngle;
++ double m_fEndAngle;
++ enumXFDrawKind m_eDrawKind;
++ sal_Bool m_bUseAngle;
++};
++
++inline void XFDrawEllipse::SetCenterPoint(double x, double y)
++{
++ m_aCenterPoint = XFPoint(x,y);
++}
++
++inline void XFDrawEllipse::SetCenterPoint(XFPoint pt)
++{
++ m_aCenterPoint = pt;
++}
++
++inline void XFDrawEllipse::SetRadius(double radiusX, double radiusY)
++{
++ m_fRadiusX = radiusX;
++ m_fRadiusY = radiusY;
++}
++
++inline void XFDrawEllipse::SetAngle(double start, double end)
++{
++ assert(start>=0&&start<=360);
++ assert(end>=0&&end<=360);
++
++ m_fStartAngle = start;
++ m_fEndAngle = end;
++ m_bUseAngle = sal_True;
++ m_eDrawKind = enumXFDrawKindCut;
++}
++
++inline void XFDrawEllipse::SetDrawKind(enumXFDrawKind kind)
++{
++ m_eDrawKind = kind;
++}
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawgroup.hxx lotuswordpro/source/filter/xfilter/xfdrawgroup.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawgroup.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawgroup.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,115 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Group of drawing objects.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-21 create this file.
++ ************************************************************************/
++#ifndef _XFDRAWGROUP_HXX
++#define _XFDRAWGROUP_HXX
++
++#include "xfdrawobj.hxx"
++#include "xfframe.hxx"
++#include "xfcontentcontainer.hxx"
++
++/**
++ * @brief
++ * Group obejct for drawing.
++ */
++class XFDrawGroup : public XFDrawObject
++{
++public:
++ XFDrawGroup(){}
++
++public:
++ /**
++ * @descr Add a drawing object to the group.
++ */
++ void Add(XFFrame *pFrame);
++
++ /**
++ * @descr Output group obejct and all it's children.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ XFContentContainer m_aChildren;
++};
++
++inline void XFDrawGroup::Add(XFFrame *pFrame)
++{
++ if( pFrame )
++ m_aChildren.Add(pFrame);
++}
++
++inline void XFDrawGroup::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ XFDrawObject::ToXml(pStrm);
++
++ pStrm->StartElement( A2OUSTR("draw:g") );
++
++ m_aChildren.ToXml(pStrm);
++
++ pStrm->EndElement( A2OUSTR("draw:g") );
++
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawline.cxx lotuswordpro/source/filter/xfilter/xfdrawline.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawline.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawline.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,123 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Line object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-17 create this file.
++ ************************************************************************/
++#include "xfdrawline.hxx"
++
++XFDrawLine::XFDrawLine()
++{
++}
++
++void XFDrawLine::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ if( GetStyleName().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("draw:style-name"), GetStyleName() );
++
++ assert(m_strName.getLength()>0); //name should not be null.
++ if( m_strName.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("draw:name"), m_strName );
++ //anchor type:
++ switch( m_eAnchor )
++ {
++ case enumXFAnchorPara:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("paragraph") );
++ break;
++ case enumXFAnchorPage:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("page") );
++ break;
++ case enumXFAnchorChar:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("char") );
++ break;
++ case enumXFAnchorAsChar:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("as-char") );
++ break;
++ case enumXFAnchorFrame:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("frame") );
++ break;
++ }
++ pAttrList->AddAttribute( A2OUSTR("draw:z-index"), Int32ToOUString(m_nZIndex) );
++
++ pAttrList->AddAttribute( A2OUSTR("svg:x1"), DoubleToOUString(m_aPoint1.GetX()) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("svg:y1"), DoubleToOUString(m_aPoint1.GetY()) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("svg:x2"), DoubleToOUString(m_aPoint2.GetX()) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("svg:y2"), DoubleToOUString(m_aPoint2.GetY()) + A2OUSTR("cm") );
++
++ //transform
++ rtl::OUString strTransform;
++ if( m_nFlag&XFDRAWOBJECT_FLAG_ROTATE )
++ strTransform = A2OUSTR("rotate (") + DoubleToOUString(m_fRotate) + A2OUSTR(") ");
++ if( m_nFlag&XFDRAWOBJECT_FLAG_TRANLATE )
++ strTransform += A2OUSTR("translate (") + DoubleToOUString(m_aRotatePoint.GetX()) + A2OUSTR("cm ") + DoubleToOUString(m_aRotatePoint.GetY()) + A2OUSTR("cm) ");
++ if( m_nFlag&XFDRAWOBJECT_FLAG_SKEWX )
++ strTransform += A2OUSTR("skewX (") + DoubleToOUString(m_fSkewX) + A2OUSTR(" ");
++ if( m_nFlag&XFDRAWOBJECT_FLAG_SKEWY )
++ strTransform += A2OUSTR("skewY (") + DoubleToOUString(m_fSkewY) + A2OUSTR(" ");
++ strTransform = strTransform.trim();
++
++ if( strTransform.getLength() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("draw:transform"), strTransform );
++
++ pStrm->StartElement( A2OUSTR("draw:line") );
++ ContentToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("draw:line") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawline.hxx lotuswordpro/source/filter/xfilter/xfdrawline.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawline.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawline.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,112 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Line object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-17 create this file.
++ ************************************************************************/
++#ifndef _XFDRAWLINE_HXX
++#define _XFDRAWLINE_HXX
++
++#include "xfdrawobj.hxx"
++#include "xfpoint.hxx"
++
++/**
++ * @brief
++ * Line obejct of drawing layer.
++ */
++class XFDrawLine : public XFDrawObject
++{
++public:
++ XFDrawLine();
++
++public:
++ /**
++ * @descr Set line start point.
++ */
++ void SetStartPoint(double x, double y);
++
++ /**
++ * @descr Set line end point.
++ */
++ void SetEndPoint(double x, double y);
++
++ /**
++ * @descr Output line object.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ XFPoint m_aPoint1;
++ XFPoint m_aPoint2;
++};
++
++inline void XFDrawLine::SetStartPoint(double x, double y)
++{
++ m_aPoint1.SetX(x);
++ m_aPoint1.SetY(y);
++}
++
++inline void XFDrawLine::SetEndPoint(double x, double y)
++{
++ m_aPoint2.SetX(x);
++ m_aPoint2.SetY(y);
++}
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawlinestyle.cxx lotuswordpro/source/filter/xfilter/xfdrawlinestyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawlinestyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawlinestyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,123 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Line style of Drawing object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-02-21 create this file.
++ ************************************************************************/
++#include "xfdrawlinestyle.hxx"
++
++XFDrawLineStyle::XFDrawLineStyle()
++{
++ m_eLineStyle = enumXFLineSolid;
++
++ m_fWidth = 0;
++ m_nTransparency = 0;
++ m_nNumber1 = 1;
++ m_nNumber2 = 1;
++ m_fSpace = 0;
++ m_fLength1 = 0;
++ m_fLength2 = 0;
++}
++
++enumXFStyle XFDrawLineStyle::GetStyleFamily()
++{
++ return enumXFStyleStrokeDash;
++}
++
++void XFDrawLineStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("draw:name"), GetStyleName());
++ //simple place here:
++ pAttrList->AddAttribute( A2OUSTR("draw:style"), A2OUSTR("rect"));
++
++ if( m_eLineStyle == enumXFLineDot )
++ {
++
++ }
++ else if( m_eLineStyle == enumXFLineDash )
++ {
++ pAttrList->AddAttribute( A2OUSTR("draw:dots1"), Int32ToOUString(m_nNumber1));
++ pAttrList->AddAttribute( A2OUSTR(" draw:dots1-length"), DoubleToOUString(m_fLength1) + A2OUSTR("cm"));
++
++ pAttrList->AddAttribute( A2OUSTR("draw:dots2"), Int32ToOUString(m_nNumber2));
++ pAttrList->AddAttribute( A2OUSTR(" draw:dots2-length"), DoubleToOUString(m_fLength2) + A2OUSTR("cm"));
++ }
++ else if( m_eLineStyle == enumXFLineDotDash )
++ {
++ pAttrList->AddAttribute( A2OUSTR("draw:dots1"), Int32ToOUString(m_nNumber1));
++
++ pAttrList->AddAttribute( A2OUSTR("draw:dots2"), Int32ToOUString(m_nNumber2));
++ pAttrList->AddAttribute( A2OUSTR(" draw:dots2-length"), DoubleToOUString(m_fLength2) + A2OUSTR("cm"));
++ }
++ else if( m_eLineStyle == enumXFLineDashDot )
++ {
++ pAttrList->AddAttribute( A2OUSTR("draw:dots1"), Int32ToOUString(m_nNumber1));
++ pAttrList->AddAttribute( A2OUSTR(" draw:dots1-length"), DoubleToOUString(m_fLength1) + A2OUSTR("cm"));
++
++ pAttrList->AddAttribute( A2OUSTR("draw:dots2"), Int32ToOUString(m_nNumber2));
++ }
++
++ pAttrList->AddAttribute( A2OUSTR("draw:distance"), DoubleToOUString(m_fSpace) + A2OUSTR("cm") );
++
++ pStrm->StartElement( A2OUSTR("draw:stroke-dash") );
++ pStrm->EndElement( A2OUSTR("draw:stroke-dash") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawlinestyle.hxx lotuswordpro/source/filter/xfilter/xfdrawlinestyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawlinestyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawlinestyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,217 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Line style of Drawing object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-02-21 create this file.
++ ************************************************************************/
++#ifndef _XFDRAWLINESTYLE_HXX
++#define _XFDRAWLINESTYLE_HXX
++
++#include "xfstyle.hxx"
++#include "xfcolor.hxx"
++
++/**
++ * @brief
++ * Border line style for drawing obejct.
++ */
++class XFDrawLineStyle : public XFStyle
++{
++public:
++ XFDrawLineStyle();
++
++public:
++ /**
++ * @descr Set line width.
++ */
++ void SetWidth(double width);
++
++ /**
++ * @descr Set line color.
++ */
++ void SetColor(const XFColor& color);
++
++ /**
++ * @descr Set line transparency.
++ */
++ void SetTransparency(sal_Int32 transparency);
++
++ /**
++ * @descr Set line type, solid,dash,dot?
++ */
++ void SetLineStyle(enumXFLineStyle style);
++
++ /**
++ * @descr Set first dot number of dash line.
++ */
++ void SetDot1Number(sal_Int32 number);
++
++ /**
++ * @descr Set second dot number of dash line.
++ */
++ void SetDot2Number(sal_Int32 number);
++
++ /**
++ * @descr Set first dot length.
++ */
++ void SetDot1Length(double length);
++
++ /**
++ * @descr Set second dot length.
++ */
++ void SetDot2Length(double length);
++
++ /**
++ * @descr Set space between dash dot.
++ */
++ void SetSpace(double space);
++
++ /**
++ * @descr decide whether it's a solid line.
++ */
++ sal_Bool IsSolid();
++
++ double GetWidth();
++
++ XFColor GetColor();
++
++ sal_Int32 GetTransparency();
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ enumXFLineStyle m_eLineStyle;
++ XFColor m_aColor;
++ double m_fWidth;
++ sal_Int32 m_nTransparency;
++ sal_Int32 m_nNumber1;
++ sal_Int32 m_nNumber2;
++ double m_fSpace;
++ double m_fLength1;
++ double m_fLength2;
++};
++
++inline void XFDrawLineStyle::SetWidth(double width)
++{
++ m_fWidth = width;
++}
++
++inline void XFDrawLineStyle::SetColor(const XFColor& color)
++{
++ m_aColor = color;
++}
++
++inline void XFDrawLineStyle::SetTransparency(sal_Int32 transparency)
++{
++ m_nTransparency = transparency;
++}
++
++inline void XFDrawLineStyle::SetLineStyle(enumXFLineStyle style)
++{
++ m_eLineStyle = style;
++}
++
++inline void XFDrawLineStyle::SetDot1Number(sal_Int32 number)
++{
++ m_nNumber1 = number;
++}
++
++inline void XFDrawLineStyle::SetDot2Number(sal_Int32 number)
++{
++ m_nNumber2 = number;
++}
++
++inline void XFDrawLineStyle::SetDot1Length(double length)
++{
++ m_fLength1 = length;
++}
++
++inline void XFDrawLineStyle::SetDot2Length(double length)
++{
++ m_fLength2 = length;
++}
++
++inline void XFDrawLineStyle::SetSpace(double space)
++{
++ m_fSpace = space;
++}
++
++inline sal_Bool XFDrawLineStyle::IsSolid()
++{
++ return (m_eLineStyle==enumXFLineSolid);
++}
++
++inline double XFDrawLineStyle::GetWidth()
++{
++ return m_fWidth;
++}
++
++inline XFColor XFDrawLineStyle::GetColor()
++{
++ return m_aColor;
++}
++
++inline sal_Int32 XFDrawLineStyle::GetTransparency()
++{
++ return m_nTransparency;
++}
++
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawobj.cxx lotuswordpro/source/filter/xfilter/xfdrawobj.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawobj.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawobj.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,134 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Interfer for all Drawing object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-17 create this file.
++ * 2005-4-1 revise for rotate.
++ ************************************************************************/
++#include "xfdrawobj.hxx"
++
++XFDrawObject::XFDrawObject()
++{
++ m_fRotate = 0;
++ m_fScaleX = 0;
++ m_fScaleY = 0;
++ m_fSkewX = 0;
++ m_fSkewY = 0;
++ m_nFlag = 0;
++ m_eType = enumXFFrameDrawing;
++}
++
++void XFDrawObject::ContentToXml(IXFStream *pStrm)
++{
++ XFContentContainer::ToXml(pStrm);
++}
++
++void XFDrawObject::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ if( GetStyleName().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("draw:style-name"), GetStyleName() );
++
++ assert(m_strName.getLength()>0); //name should not be null.
++ if( m_strName.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("draw:name"), m_strName );
++ //anchor type:
++ switch( m_eAnchor )
++ {
++ case enumXFAnchorPara:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("paragraph") );
++ break;
++ case enumXFAnchorPage:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("page") );
++ break;
++ case enumXFAnchorChar:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("char") );
++ break;
++ case enumXFAnchorAsChar:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("as-char") );
++ break;
++ case enumXFAnchorFrame:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("frame") );
++ break;
++ }
++ pAttrList->AddAttribute( A2OUSTR("draw:z-index"), Int32ToOUString(m_nZIndex) );
++
++ pAttrList->AddAttribute( A2OUSTR("svg:x"), DoubleToOUString(m_aRect.GetX()) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("svg:y"), DoubleToOUString(m_aRect.GetY()) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("svg:width"), DoubleToOUString(m_aRect.GetWidth()) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("svg:height"), DoubleToOUString(m_aRect.GetHeight()) + A2OUSTR("cm") );
++
++ //transform
++ rtl::OUString strTransform;
++ if( m_nFlag&XFDRAWOBJECT_FLAG_ROTATE )
++ strTransform = A2OUSTR("rotate (") + DoubleToOUString(m_fRotate) + A2OUSTR(") ");
++ if( m_nFlag&XFDRAWOBJECT_FLAG_TRANLATE )
++ strTransform += A2OUSTR("translate (") + DoubleToOUString(m_aRotatePoint.GetX()) + A2OUSTR("cm ") + DoubleToOUString(m_aRotatePoint.GetY()) + A2OUSTR("cm) ");
++ if( m_nFlag&XFDRAWOBJECT_FLAG_SCALE )
++ strTransform += A2OUSTR("scale (") + DoubleToOUString(m_fScaleX) + A2OUSTR("cm ") + DoubleToOUString(m_fScaleY) + A2OUSTR("cm) ");
++ if( m_nFlag&XFDRAWOBJECT_FLAG_SKEWX )
++ strTransform += A2OUSTR("skewX (") + DoubleToOUString(m_fSkewX) + A2OUSTR(" ");
++ if( m_nFlag&XFDRAWOBJECT_FLAG_SKEWY )
++ strTransform += A2OUSTR("skewY (") + DoubleToOUString(m_fSkewY) + A2OUSTR(" ");
++ strTransform = strTransform.trim();
++
++ if( strTransform.getLength() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("draw:transform"), strTransform );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawobj.hxx lotuswordpro/source/filter/xfilter/xfdrawobj.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawobj.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawobj.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,179 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Interfer for all Drawing object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-17 create this file.
++ ************************************************************************/
++#ifndef _XFDRAWOBJ_HXX
++#define _XFDRAWOBJ_HXX
++
++#include "xfframe.hxx"
++#include "xfrect.hxx"
++
++#define XFDRAWOBJECT_FLAG_ROTATE 0X00000001
++#define XFDRAWOBJECT_FLAG_TRANLATE 0X00000002
++#define XFDRAWOBJECT_FLAG_SKEWX 0X00000004
++#define XFDRAWOBJECT_FLAG_SKEWY 0X00000008
++#define XFDRAWOBJECT_FLAG_SCALE 0X00000010
++
++/**
++ * @brief
++ * Base class for all drawing object(ellipse,rect,circle,...).
++ * I can set Postions,anchor,rotate,text style name here.
++ *
++ * Drawing obejcts can be rotated,scaled and skewed, drawing objects must have positions setted,
++ * you can use SetPosition(...).
++ */
++class XFDrawObject : public XFFrame
++{
++public:
++ XFDrawObject();
++
++public:
++ /**
++ * @descr Set style name for drawing text.
++ */
++ void SetTextStyleName(rtl::OUString style);
++
++ /**
++ * @descr Set drawing obejct rotate.
++ */
++ void SetRotate(double degree, XFPoint aRotatePoint=XFPoint(0,0));
++
++ /**
++ * @descr Set drawing object scale.
++ */
++ void SetScale(double cx, double cy);
++
++ /**
++ * @descr Set drawing object skew.
++ */
++ void SetSkewX(double cx);
++
++ /**
++ * @descr Set drawing obejct y skew.
++ */
++ void SetSkewY(double cy);
++
++ void ContentToXml(IXFStream *pStrm);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++protected:
++ XFContentContainer m_aContents;
++ rtl::OUString m_strTextStyle;
++ double m_fRotate;
++ XFPoint m_aRotatePoint;
++ double m_fScaleX;
++ double m_fScaleY;
++ double m_fSkewX;
++ double m_fSkewY;
++
++ unsigned int m_nFlag;
++};
++
++inline void XFDrawObject::SetTextStyleName(rtl::OUString style)
++{
++ m_strTextStyle = style;
++}
++/*
++inline void XFDrawObject::SetPosition(double x, double y, double width, double height)
++{
++ SetX(x);
++ SetY(y);
++ SetWidth(width);
++ SetHeight(height);
++}
++
++inline void XFDrawObject::SetPosition(XFRect rect)
++{
++ SetX(rect.GetX());
++ SetY(rect.GetY());
++ SetWidth(rect.GetWidth());
++ SetHeight(rect.GetHeight());
++}
++*/
++inline void XFDrawObject::SetRotate(double degree, XFPoint aRotatePoint)
++{
++ m_nFlag |= XFDRAWOBJECT_FLAG_ROTATE;
++ m_fRotate = degree*2*PI/360;
++ m_aRotatePoint = aRotatePoint;
++}
++
++inline void XFDrawObject::SetScale(double cx, double cy)
++{
++ m_nFlag |= XFDRAWOBJECT_FLAG_SCALE;
++ m_fScaleX = cx;
++ m_fScaleY = cy;
++}
++
++inline void XFDrawObject::SetSkewX(double cx)
++{
++ m_nFlag |= XFDRAWOBJECT_FLAG_SKEWX;
++ m_fSkewX = cx*2*PI/360;
++}
++
++inline void XFDrawObject::SetSkewY(double cy)
++{
++ m_nFlag |= XFDRAWOBJECT_FLAG_SKEWY;
++ m_fSkewY = cy*2*PI/360;
++}
++
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawpath.cxx lotuswordpro/source/filter/xfilter/xfdrawpath.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawpath.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawpath.cxx 2008-10-22 12:57:19.000000000 +0800
+@@ -0,0 +1,222 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Draw path object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-18 create this file.
++ ************************************************************************/
++#include "xfdrawpath.hxx"
++
++XFSvgPathEntry::XFSvgPathEntry()
++{
++}
++
++XFSvgPathEntry::XFSvgPathEntry(rtl::OUString cmd)
++{
++ m_strCommand = cmd;
++}
++
++rtl::OUString XFSvgPathEntry::ToString()
++{
++ assert(m_strCommand.getLength()>0);
++ rtl::OUString str = m_strCommand;
++ std::vector<XFPoint>::iterator it;
++
++ for( it = m_aPoints.begin(); it != m_aPoints.end(); it++ )
++ {
++ XFPoint aPt= *it;
++ str += DoubleToOUString(aPt.GetX()*1000) + A2OUSTR(" ") + DoubleToOUString(aPt.GetY()*1000) + A2OUSTR(" ");
++ }
++ return str.trim();
++}
++
++XFDrawPath::XFDrawPath()
++{
++}
++
++void XFDrawPath::MoveTo(XFPoint pt, sal_Bool absPosition)
++{
++ XFSvgPathEntry entry;
++
++ if( absPosition )
++ entry.SetCommand(A2OUSTR("M"));
++ else
++ entry.SetCommand(A2OUSTR("m"));
++ entry.AddPoint(pt);
++ m_aPaths.push_back(entry);
++}
++
++void XFDrawPath::LineTo(XFPoint pt, sal_Bool absPosition)
++{
++ XFSvgPathEntry entry;
++
++ if( absPosition )
++ entry.SetCommand(A2OUSTR("L"));
++ else
++ entry.SetCommand(A2OUSTR("l"));
++ entry.AddPoint(pt);
++ m_aPaths.push_back(entry);
++}
++
++void XFDrawPath::CurveTo(XFPoint dest, XFPoint ctrl1, XFPoint ctrl2, sal_Bool absPosition)
++{
++ XFSvgPathEntry entry;
++
++ if( absPosition )
++ entry.SetCommand(A2OUSTR("C"));
++ else
++ entry.SetCommand(A2OUSTR("c"));
++ entry.AddPoint(ctrl1);
++ entry.AddPoint(ctrl2);
++ entry.AddPoint(dest);
++
++ m_aPaths.push_back(entry);
++}
++
++void XFDrawPath::SmoothCurveTo(XFPoint dest, XFPoint ctrl, sal_Bool absPosition)
++{
++ XFSvgPathEntry entry;
++
++ if( absPosition )
++ entry.SetCommand(A2OUSTR("C"));
++ else
++ entry.SetCommand(A2OUSTR("c"));
++ entry.AddPoint(ctrl);
++ entry.AddPoint(dest);
++
++ m_aPaths.push_back(entry);
++}
++
++void XFDrawPath::ClosePath(sal_Bool absPosition)
++{
++ XFSvgPathEntry entry;
++
++ if( absPosition )
++ entry.SetCommand(A2OUSTR("Z"));
++ else
++ entry.SetCommand(A2OUSTR("z"));
++
++ m_aPaths.push_back(entry);
++}
++
++void XFDrawPath::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ //view-box:
++ XFRect rect = m_aRect;
++
++ rtl::OUString strViewBox = A2OUSTR("0 0 ");
++ strViewBox += DoubleToOUString(rect.GetWidth()*1000) + A2OUSTR(" ");
++ strViewBox += DoubleToOUString(rect.GetHeight()*1000);
++ pAttrList->AddAttribute( A2OUSTR("svg:viewBox"), strViewBox);
++
++ //points
++ rtl::OUString strPath;
++ std::vector<XFSvgPathEntry>::iterator it;
++ for( it = m_aPaths.begin(); it != m_aPaths.end(); it++ )
++ {
++ XFSvgPathEntry aSvg = *it;
++ strPath += aSvg.ToString();
++ }
++ strPath = strPath.trim();
++ pAttrList->AddAttribute( A2OUSTR("svg:d"), strPath);
++
++ SetPosition(rect);
++ XFDrawObject::ToXml(pStrm);
++
++ pStrm->StartElement( A2OUSTR("draw:path") );
++ ContentToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("draw:path") );
++}
++
++
++XFRect XFDrawPath::CalcViewBox()
++{
++ double x1 = 65536;
++ double y1 = 65536;
++ double x2 = -1; //not quite safe.()
++ double y2 = -1;
++ XFSvgPathEntry aPath;
++ XFPoint aPoint;
++ std::vector<XFSvgPathEntry>::iterator itPath = m_aPaths.begin();
++ std::vector<XFPoint> points;
++ std::vector<XFPoint>::iterator itPoint;
++ do{
++ aPath = *itPath;
++ points = aPath.m_aPoints;
++
++ for( itPoint = points.begin(); itPoint != points.end(); itPoint++ )
++ {
++ aPoint = *itPoint;
++ if( x1>aPoint.GetX() )
++ x1 = aPoint.GetX();
++ if( x2<aPoint.GetX() )
++ x2 = aPoint.GetX();
++
++ if( y1>aPoint.GetY() )
++ y1 = aPoint.GetY();
++ if( y2<aPoint.GetY() )
++ y2 = aPoint.GetY();
++ }
++ itPath++;
++ }while(itPath!=m_aPaths.end());
++
++ return XFRect(x1,y1,x2-x1,y2-y1);
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawpath.hxx lotuswordpro/source/filter/xfilter/xfdrawpath.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawpath.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawpath.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,154 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Draw path object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-18 create this file.
++ ************************************************************************/
++#ifndef _XFDRAWPATH_HXX
++#define _XFDRAWPATH_HXX
++
++#include "xfdrawobj.hxx"
++#include <vector>
++
++/**
++ * @brief
++ * SVG path segment wrapper.
++ */
++class XFSvgPathEntry
++{
++public:
++ XFSvgPathEntry();
++
++ XFSvgPathEntry(rtl::OUString cmd);
++
++public:
++ /**
++ * @descr Set svg path command,L for line,M for move,...
++ */
++ void SetCommand(rtl::OUString cmd);
++
++ /**
++ * @descr Set svg path point.
++ */
++ void AddPoint(XFPoint pt);
++
++ rtl::OUString ToString();
++
++ friend class XFDrawPath;
++private:
++ rtl::OUString m_strCommand;
++ std::vector<XFPoint> m_aPoints;
++};
++
++/**
++ * @brief
++ * For svg path wrapper.
++ */
++class XFDrawPath : public XFDrawObject
++{
++public:
++ XFDrawPath();
++
++public:
++ /**
++ * @descr Move command.
++ */
++ void MoveTo(XFPoint pt, sal_Bool absPosition = sal_True);
++
++ /**
++ * @descr Line command.
++ */
++ void LineTo(XFPoint pt, sal_Bool absPosition = sal_True);
++
++ /**
++ * @descr Curve command.
++ */
++ void CurveTo(XFPoint dest, XFPoint ctrl1, XFPoint ctrl2, sal_Bool absPosition = sal_True);
++
++ /**
++ * @descr Smooth curve command.
++ */
++ void SmoothCurveTo(XFPoint dest, XFPoint ctrl, sal_Bool absPosition = sal_True);
++
++ /**
++ * @descr Close path command.
++ */
++ void ClosePath(sal_Bool absPosition = sal_True);
++
++ XFRect CalcViewBox();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ std::vector<XFSvgPathEntry> m_aPaths;
++};
++
++inline void XFSvgPathEntry::SetCommand(rtl::OUString cmd)
++{
++ m_strCommand = cmd;
++}
++
++inline void XFSvgPathEntry::AddPoint(XFPoint pt)
++{
++ m_aPoints.push_back(pt);
++}
++
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawpolygon.cxx lotuswordpro/source/filter/xfilter/xfdrawpolygon.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawpolygon.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawpolygon.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,101 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Polylon object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-18 create this file.
++ ************************************************************************/
++#include "xfdrawpolygon.hxx"
++
++XFDrawPolygon::XFDrawPolygon()
++{
++}
++
++void XFDrawPolygon::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ std::vector<XFPoint>::iterator it;
++
++ pAttrList->Clear();
++ //view-box:
++ XFRect rect = CalcViewBox();
++ rtl::OUString strViewBox = A2OUSTR("0 0 ");
++ strViewBox += DoubleToOUString(rect.GetWidth()*1000) + A2OUSTR(" ");
++ strViewBox += DoubleToOUString(rect.GetHeight()*1000);
++ pAttrList->AddAttribute( A2OUSTR("svg:viewBox"), strViewBox);
++
++ //points
++ rtl::OUString strPoints;
++ for( it = m_aPoints.begin(); it != m_aPoints.end(); it++ )
++ {
++ XFPoint pt = *it;
++ double x = (pt.GetX()-rect.GetX())*1000;
++ double y = (pt.GetY()-rect.GetY())*1000;
++ strPoints += DoubleToOUString(x) + A2OUSTR(" ") + DoubleToOUString(y) + A2OUSTR(" ");
++ }
++ strPoints = strPoints.trim();
++ pAttrList->AddAttribute( A2OUSTR("draw:points"), strPoints);
++
++ //
++ SetPosition(rect.GetX(),rect.GetY(),rect.GetWidth(),rect.GetHeight());
++ XFDrawObject::ToXml(pStrm);
++
++ pStrm->StartElement( A2OUSTR("draw:polygon") );
++ ContentToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("draw:polygon") );
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawpolygon.hxx lotuswordpro/source/filter/xfilter/xfdrawpolygon.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawpolygon.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawpolygon.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,82 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Polygon object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-18 create this file.
++ ************************************************************************/
++#ifndef _XFPOLYGON_HXX
++#define _XFPOLYGON_HXX
++
++#include "xfdrawpolyline.hxx"
++#include <vector>
++
++/**
++ * @brief
++ * Polygon object.
++ */
++class XFDrawPolygon : public XFDrawPolyline
++{
++public:
++ XFDrawPolygon();
++
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawpolyline.cxx lotuswordpro/source/filter/xfilter/xfdrawpolyline.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawpolyline.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawpolyline.cxx 2008-10-22 12:05:47.000000000 +0800
+@@ -0,0 +1,133 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Polyline.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-18 create this file.
++ ************************************************************************/
++#include "xfdrawpolyline.hxx"
++
++XFDrawPolyline::XFDrawPolyline()
++{
++}
++
++void XFDrawPolyline::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ std::vector<XFPoint>::iterator it;
++
++ pAttrList->Clear();
++ //view-box:
++ XFRect rect = CalcViewBox();
++ rtl::OUString strViewBox = A2OUSTR("0 0 ");
++ strViewBox += DoubleToOUString(rect.GetWidth()*1000) + A2OUSTR(" ");
++ strViewBox += DoubleToOUString(rect.GetHeight()*1000);
++ pAttrList->AddAttribute( A2OUSTR("svg:viewBox"), strViewBox);
++
++ //points
++ rtl::OUString strPoints;
++ for( it = m_aPoints.begin(); it != m_aPoints.end(); it++ )
++ {
++ XFPoint pt = *it;
++ double x = (pt.GetX()-rect.GetX())*1000;
++ double y = (pt.GetY()-rect.GetY())*1000;
++ strPoints += DoubleToOUString(x) + A2OUSTR(",") + DoubleToOUString(y) + A2OUSTR(" ");
++ }
++ strPoints = strPoints.trim();
++ pAttrList->AddAttribute( A2OUSTR("draw:points"), strPoints);
++
++ //
++ SetPosition(rect.GetX(),rect.GetY(),rect.GetWidth(),rect.GetHeight());
++ XFDrawObject::ToXml(pStrm);
++
++ pStrm->StartElement( A2OUSTR("draw:polyline") );
++ ContentToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("draw:polyline") );
++}
++
++XFRect XFDrawPolyline::CalcViewBox()
++{
++ double x1 = 0;
++ double y1 = 0;
++ double x2 = 0;
++ double y2 = 0;
++ XFPoint aPoint;
++ std::vector<XFPoint>::iterator it = m_aPoints.begin();
++
++ assert(m_aPoints.size()>0);
++
++ aPoint = *it;
++ x1 = aPoint.GetX();
++ x2 = aPoint.GetX();
++ y1 = aPoint.GetY();
++ y2 = aPoint.GetY();
++ for( ; it != m_aPoints.end(); it++ )
++ {
++ aPoint = *it;
++ if( x1>aPoint.GetX() )
++ x1 = aPoint.GetX();
++ if( x2<aPoint.GetX() )
++ x2 = aPoint.GetX();
++
++ if( y1>aPoint.GetY() )
++ y1 = aPoint.GetY();
++ if( y2<aPoint.GetY() )
++ y2 = aPoint.GetY();
++ }
++ return XFRect(x1,y1,x2-x1,y2-y1);
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawpolyline.hxx lotuswordpro/source/filter/xfilter/xfdrawpolyline.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawpolyline.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawpolyline.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,99 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Polyline.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-18 create this file.
++ ************************************************************************/
++#ifndef _XFPOLYLINE_HXX
++#define _XFPOLYLINE_HXX
++
++#include "xfdrawobj.hxx"
++#include <vector>
++
++class XFDrawPolyline : public XFDrawObject
++{
++public:
++ XFDrawPolyline();
++
++public:
++ void AddPoint(double x, double y);
++
++ void AddPoint(XFPoint pt);
++
++ XFRect CalcViewBox();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++protected:
++ std::vector<XFPoint> m_aPoints;
++};
++
++inline void XFDrawPolyline::AddPoint(double x, double y)
++{
++ assert(x>=0&&y>=0);
++ m_aPoints.push_back( XFPoint(x,y) );
++}
++
++inline void XFDrawPolyline::AddPoint(XFPoint pt)
++{
++ assert(pt.GetX()>=0&&pt.GetY()>=0);
++ m_aPoints.push_back(pt);
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawrect.cxx lotuswordpro/source/filter/xfilter/xfdrawrect.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawrect.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawrect.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,83 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Rect object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-17 create this file.
++ ************************************************************************/
++#include "xfdrawrect.hxx"
++
++XFDrawRect::XFDrawRect()
++{
++ m_fCornerRadius = 0;
++}
++
++void XFDrawRect::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++
++ if( 0 != m_fCornerRadius )
++ pAttrList->AddAttribute( A2OUSTR("draw:corner-radius"), DoubleToOUString(m_fCornerRadius) + A2OUSTR("cm") );
++ XFDrawObject::ToXml(pStrm);
++
++ pStrm->StartElement( A2OUSTR("draw:rect") );
++ ContentToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("draw:rect") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawrect.hxx lotuswordpro/source/filter/xfilter/xfdrawrect.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawrect.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawrect.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,116 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Rect object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-17 create this file.
++ ************************************************************************/
++#ifndef _XFDRAWRECT_HXX
++#define _XFDRAWRECT_HXX
++
++#include "xfdrawobj.hxx"
++
++class XFDrawRect : public XFDrawObject
++{
++public:
++ XFDrawRect();
++
++public:
++ void SetStartPoint(XFPoint pt);
++
++ void SetSize(double width, double height);
++
++ void SetWidth(double width);
++
++ void SetHeight(double height);
++
++ void SetCornerRadius(double fCornerRadius);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ double m_fCornerRadius;
++};
++
++inline void XFDrawRect::SetStartPoint(XFPoint pt)
++{
++ m_aRect.SetStartPoint(pt);
++}
++
++inline void XFDrawRect::SetSize(double width, double height)
++{
++ m_aRect.SetSize(width,height);
++}
++
++inline void XFDrawRect::SetWidth(double width)
++{
++ m_aRect.SetWidth(width);
++}
++
++inline void XFDrawRect::SetHeight(double height)
++{
++ m_aRect.SetHeight(height);
++}
++
++inline void XFDrawRect::SetCornerRadius(double fCornerRadius)
++{
++ m_fCornerRadius = fCornerRadius;
++}
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawstyle.cxx lotuswordpro/source/filter/xfilter/xfdrawstyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawstyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawstyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,349 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Style for all draw object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-21 create this file.
++ ************************************************************************/
++#include "xfdrawstyle.hxx"
++#include "xfdrawlinestyle.hxx"
++#include "xfdrawareastyle.hxx"
++#include "xfstylemanager.hxx"
++#include "xffontworkstyle.hxx"
++#include "../lwpglobalmgr.hxx"
++XFDrawStyle::XFDrawStyle()
++{
++ m_eWrap = enumXFWrapNone;
++ m_nWrapLines = 0; //not limited.
++
++ m_pLineStyle = NULL;
++ m_pAreaStyle = NULL;
++
++ m_pFontWorkStyle = NULL;
++
++ m_fArrowStartSize = 0.3;
++ m_fArrowEndSize = 0.3;
++ m_bArrowStartCenter = sal_False;
++ m_bArrowStartCenter = sal_False;
++}
++
++XFDrawStyle::~XFDrawStyle()
++{
++ //don't delete m_pLineStyle, it was managed by XFStyleManager.
++ if (m_pFontWorkStyle)
++ {
++ delete m_pFontWorkStyle;
++ m_pFontWorkStyle = NULL;
++ }
++}
++
++void XFDrawStyle::SetLineStyle(double width, XFColor color, sal_Int32 transparency)
++{
++ if( !m_pLineStyle )
++ {
++ m_pLineStyle = new XFDrawLineStyle();
++ m_pLineStyle->SetStyleName( XFGlobal::GenStrokeDashName());
++ }
++ m_pLineStyle->SetWidth(width);
++ m_pLineStyle->SetColor(color);
++ m_pLineStyle->SetTransparency(transparency);
++}
++
++void XFDrawStyle::SetLineDashStyle(enumXFLineStyle style, int num1, int num2, double len1, double len2, double space )
++{
++ if( !m_pLineStyle )
++ {
++ m_pLineStyle = new XFDrawLineStyle();
++ m_pLineStyle->SetStyleName( XFGlobal::GenStrokeDashName());
++ }
++ m_pLineStyle->SetLineStyle(style);
++ m_pLineStyle->SetDot1Number(num1);
++ m_pLineStyle->SetDot1Length(len1);
++ m_pLineStyle->SetDot2Number(num2);
++ m_pLineStyle->SetDot2Length(len2);
++ m_pLineStyle->SetSpace(space);
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ pXFStyleManager->AddStyle(m_pLineStyle);
++}
++
++void XFDrawStyle::SetFontWorkStyle(sal_Int8 nForm, enumXFFWStyle eStyle, enumXFFWAdjust eAdjust)
++{
++ if (!m_pFontWorkStyle)
++ {
++ m_pFontWorkStyle = new XFFontWorkStyle();
++ }
++
++ m_pFontWorkStyle->SetButtonForm(nForm);
++ m_pFontWorkStyle->SetFWStyleType(eStyle);
++ m_pFontWorkStyle->SetFWAdjustType(eAdjust);
++}
++
++void XFDrawStyle::SetAreaColor(XFColor& color)
++{
++ if( !m_pAreaStyle )
++ {
++ m_pAreaStyle = new XFDrawAreaStyle();
++ m_pAreaStyle->SetStyleName( XFGlobal::GenAreaName());
++ }
++ m_pAreaStyle->SetBackColor(color);
++}
++
++void XFDrawStyle::SetAreaLineStyle(enumXFAreaLineStyle style, sal_Int32 angle, double space, XFColor lineColor)
++{
++ if( !m_pAreaStyle )
++ {
++ m_pAreaStyle = new XFDrawAreaStyle();
++ m_pAreaStyle->SetStyleName( XFGlobal::GenAreaName());
++ }
++ m_pAreaStyle->SetAreaStyle(enumXFAreaHatch);
++
++ m_pAreaStyle->SetLineStyle(style);
++ m_pAreaStyle->SetLineAngle(angle);
++ m_pAreaStyle->SetLineSpace(space);
++ m_pAreaStyle->SetLineColor(lineColor);
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ pXFStyleManager->AddStyle(m_pAreaStyle);
++}
++
++enumXFStyle XFDrawStyle::GetStyleFamily()
++{
++ return enumXFStyleGraphics;
++}
++
++/**************************************************************************
++ *************************************************************************/
++void XFDrawStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
++ pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("graphics") );
++ pStrm->StartElement( A2OUSTR("style:style") );
++
++ pAttrList->Clear();
++
++ if( m_eWrap == enumXFWrapBackground )
++ {
++ pAttrList->AddAttribute( A2OUSTR("style:run-through"), A2OUSTR("background") );
++ }
++ else
++ {
++ pAttrList->AddAttribute( A2OUSTR("style:run-through"), A2OUSTR("foreground") );
++
++ if( m_eWrap == enumXFWrapNone )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("none") );
++ else if( m_eWrap == enumXFWrapLeft )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("left") );
++ else if( m_eWrap == enumXFWrapRight )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("right") );
++ else if( m_eWrap == enumXFWrapParallel )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("parallel") );
++ else if( m_eWrap == enumXFWrapRunThrough )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("run-through") );
++ else if( m_eWrap == enumXFWrapBest )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("dynamic") );
++ }
++
++ //line style:
++ if( m_pLineStyle )
++ {
++ //1. if is a dash style, register the stroke-dash style first.
++ if( !m_pLineStyle->IsSolid() )
++ {
++// pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("draw:stroke"), A2OUSTR("dash") );
++ pAttrList->AddAttribute( A2OUSTR("draw:stroke-dash"), m_pLineStyle->GetStyleName() );
++ }
++ else
++ {
++ pAttrList->AddAttribute( A2OUSTR("draw:stroke"), A2OUSTR("solid") );
++ }
++
++ if( m_pLineStyle->GetWidth() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("svg:stroke-width"), DoubleToOUString(m_pLineStyle->GetWidth()) + A2OUSTR("cm") );
++
++ XFColor color = m_pLineStyle->GetColor();
++ if( color.IsValid() )
++ pAttrList->AddAttribute( A2OUSTR("svg:stroke-color"), color.ToString() );
++
++ if( m_pLineStyle->GetTransparency()>0 )
++ pAttrList->AddAttribute( A2OUSTR("svg:stroke-opacity"), Int32ToOUString(m_pLineStyle->GetTransparency()) + A2OUSTR("%") );
++ }
++ else
++ pAttrList->AddAttribute( A2OUSTR("draw:stroke"), A2OUSTR("none") );
++ //area style:
++ if( m_pAreaStyle )
++ {
++ if( enumXFAreaSolid == m_pAreaStyle->GetAreaStyle() )
++ {
++ pAttrList->AddAttribute( A2OUSTR("draw:fill"), A2OUSTR("solid") );
++ XFColor color = m_pAreaStyle->GetBackColor();
++ if( color.IsValid() )
++ pAttrList->AddAttribute( A2OUSTR("draw:fill-color"), color.ToString() );
++ }
++ else if( enumXFAreaHatch == m_pAreaStyle->GetAreaStyle() )
++ {
++ pAttrList->AddAttribute( A2OUSTR("draw:fill"), A2OUSTR("hatch") );
++ pAttrList->AddAttribute( A2OUSTR("draw:fill-hatch-name"), m_pAreaStyle->GetStyleName() );
++ XFColor color = m_pAreaStyle->GetBackColor();
++ if( color.IsValid() )
++ {
++ pAttrList->AddAttribute( A2OUSTR("draw:fill-hatch-solid"), A2OUSTR("true") );
++ pAttrList->AddAttribute( A2OUSTR("draw:fill-color"), color.ToString() );
++ }
++ }
++ }
++ else
++ pAttrList->AddAttribute( A2OUSTR("draw:fill"), A2OUSTR("none") );
++
++ if( m_strArrowStart.getLength()>0 )
++ {
++ pAttrList->AddAttribute( A2OUSTR("draw:marker-start"), m_strArrowStart );
++ pAttrList->AddAttribute( A2OUSTR("draw:marker-start-width"), DoubleToOUString(m_fArrowStartSize)+A2OUSTR("cm") );
++ if( m_bArrowStartCenter )
++ pAttrList->AddAttribute( A2OUSTR("draw:draw:marker-start-center"), A2OUSTR("true") );
++ }
++ if( m_strArrowEnd.getLength()>0 )
++ {
++ pAttrList->AddAttribute( A2OUSTR("draw:marker-end"), m_strArrowEnd );
++ pAttrList->AddAttribute( A2OUSTR("draw:marker-end-width"), DoubleToOUString(m_fArrowEndSize)+A2OUSTR("cm") );
++ if( m_bArrowEndCenter )
++ pAttrList->AddAttribute( A2OUSTR("draw:draw:marker-end-center"), A2OUSTR("true") );
++ }
++ if (m_pFontWorkStyle)
++ {
++ // style
++ rtl::OUString aStr = A2OUSTR("");
++ switch (m_pFontWorkStyle->GetStyleType())
++ {
++ default: // fall through!
++ case enumXFFWOff:
++ break;
++ case enumXFFWRotate:
++ aStr = A2OUSTR("rotate");
++ break;
++ case enumXFFWUpright:
++ aStr = A2OUSTR("upright");
++ break;
++ case enumXFFWSlantX:
++ aStr = A2OUSTR("slant-x");
++ break;
++ case enumXFFWSlantY:
++ aStr = A2OUSTR("slant-y");
++ break;
++ }
++ if (aStr.getLength() > 0)
++ {
++ pAttrList->AddAttribute(A2OUSTR("draw:fontwork-style"), aStr);
++ }
++
++ //adjust
++ aStr = A2OUSTR("");
++ switch (m_pFontWorkStyle->GetAdjustType())
++ {
++ default: // fall througth
++ case enumXFFWAdjustAutosize:
++ aStr = A2OUSTR("autosize");
++ break;
++ case enumXFFWAdjustLeft:
++ aStr = A2OUSTR("left");
++ break;
++ case enumXFFWAdjustCenter:
++ aStr = A2OUSTR("center");
++ break;
++ case enumXFFWAdustRight:
++ aStr = A2OUSTR("right");
++ break;
++ }
++ if (aStr.getLength() > 0)
++ {
++ pAttrList->AddAttribute(A2OUSTR("draw:fontwork-adjust"), aStr);
++ }
++
++ //form
++ aStr = A2OUSTR("");
++ switch (m_pFontWorkStyle->GetButtonForm())
++ {
++ default: // fall through!
++ case -1:
++ break;
++ case 4:
++ aStr = A2OUSTR("top-arc");
++ break;
++ case 5:
++ aStr = A2OUSTR("bottom-arc");
++ break;
++ }
++ if (aStr.getLength() > 0)
++ {
++ pAttrList->AddAttribute(A2OUSTR("draw:fontwork-form"), aStr);
++ }
++
++ // distance
++ //pAttrList->AddAttribute(A2OUSTR("draw:fontwork-distance"),
++ // DoubleToOUString(m_pFontWorkStyle->GetFWDistance())+A2OUSTR("cm"));
++ }
++
++ pStrm->StartElement( A2OUSTR("style:properties") );
++
++ pStrm->EndElement( A2OUSTR("style:properties") );
++
++ pStrm->EndElement( A2OUSTR("style:style") );
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdrawstyle.hxx lotuswordpro/source/filter/xfilter/xfdrawstyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdrawstyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdrawstyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,167 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Style for all draw object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-21 create this file.
++ ************************************************************************/
++#ifndef _XFDRAWSTYLE_HXX
++#define _XFDRAWSTYLE_HXX
++
++#include "xfstyle.hxx"
++#include "xfcolor.hxx"
++#include <cassert>
++
++class XFDrawLineStyle;
++class XFDrawAreaStyle;
++class XFFontWorkStyle;
++
++/**
++ * @brief
++ * Style for all drawing object, which can includes line style, area style, wrap style.
++ * Line style includes line type, line width and line color.
++ * Area style can be divided into 5 kinds, color fill, hatch, bitmap, gradient.I only support
++ * color fill and hatch now.
++ */
++class XFDrawStyle : public XFStyle
++{
++public:
++ XFDrawStyle();
++
++ virtual ~XFDrawStyle();
++
++public:
++ /**
++ * @descr Set drawing wrap type.
++ */
++ void SetWrapType(enumXFWrap wrap, sal_Int32 nParagraphs = 0);
++
++ /**
++ * @descr Set drawing object border line.
++ */
++ void SetLineStyle(double width, XFColor color = XFColor(0,0,0), sal_Int32 transparency = 0);
++
++ /**
++ * @descr Set drawing obejct dash border style.
++ */
++ void SetLineDashStyle(enumXFLineStyle style, int num1, int num2, double len1, double len2, double space );
++
++ /**
++ * @descr Set drawing object area fill color.
++ */
++ void SetAreaColor(XFColor& color);
++
++ /**
++ * @descr Set drawing obejct area grid style.
++ */
++ void SetAreaLineStyle(enumXFAreaLineStyle style, sal_Int32 angle = 0, double space = 0.102, XFColor lineColor = XFColor(0,0,0));
++
++ /**
++ * @descr Set drawing object arrow start style,only lines can have arrows.
++ */
++ void SetArrowStart(rtl::OUString start, double size=0.3, sal_Bool center = sal_False);
++
++ /**
++ * @descr Set drawing obejct arrow end style,only lines can have arrows.
++ */
++ void SetArrowEnd(rtl::OUString end, double size=0.3, sal_Bool center = sal_False);
++
++ void SetFontWorkStyle(sal_Int8 nForm, enumXFFWStyle eStyle, enumXFFWAdjust eAdjust);
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ XFFontWorkStyle* m_pFontWorkStyle;
++ enumXFWrap m_eWrap;
++ sal_Int32 m_nWrapLines;
++ XFDrawLineStyle *m_pLineStyle;
++ XFDrawAreaStyle *m_pAreaStyle;
++ rtl::OUString m_strArrowStart;
++ rtl::OUString m_strArrowEnd;
++ double m_fArrowStartSize;
++ double m_fArrowEndSize;
++ sal_Bool m_bArrowStartCenter;
++ sal_Bool m_bArrowEndCenter;
++};
++
++inline void XFDrawStyle::SetWrapType(enumXFWrap wrap, sal_Int32 nParagraphs)
++{
++ m_eWrap = wrap;
++ m_nWrapLines = nParagraphs;
++}
++
++
++inline void XFDrawStyle::SetArrowStart(rtl::OUString start, double size, sal_Bool center)
++{
++ assert(size>0);
++ m_strArrowStart = start;
++ m_fArrowStartSize = size;
++ m_bArrowStartCenter = center;
++}
++
++inline void XFDrawStyle::SetArrowEnd(rtl::OUString end, double size, sal_Bool center)
++{
++ assert(size>0);
++ m_strArrowEnd = end;
++ m_fArrowEndSize = size;
++ m_bArrowEndCenter = center;
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfdropcap.hxx lotuswordpro/source/filter/xfilter/xfdropcap.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfdropcap.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfdropcap.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,152 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Drop cap of a paragraph.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-28 create this file.
++ ************************************************************************/
++#ifndef _XFDROPCAP_HXX
++#define _XFDROPCAP_HXX
++
++#include "xfglobal.hxx"
++#include "ixfproperty.hxx"
++
++class XFDropcap : public IXFProperty
++{
++public:
++ XFDropcap()
++ {
++ Reset();
++ }
++
++public:
++ void SetCharCount(sal_Int32 count);
++
++ void SetLines(sal_Int32 lines);
++
++ void SetDistance(double distance);
++
++ void Reset();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++ friend bool operator==(XFDropcap& dc1, XFDropcap& dc2);
++ friend bool operator!=(XFDropcap& dc1, XFDropcap& dc2);
++ friend class XFParaStyle;
++private:
++ sal_Int32 m_nCharCount;
++ sal_Int32 m_nLines;
++ double m_fDistance;
++ rtl::OUString m_strStyleName;
++};
++
++inline void XFDropcap::SetCharCount(sal_Int32 count)
++{
++ m_nCharCount = count;
++}
++
++inline void XFDropcap::SetLines(sal_Int32 lines)
++{
++ m_nLines = lines;
++}
++
++inline void XFDropcap::SetDistance(double distance)
++{
++ m_fDistance = distance;
++}
++
++inline void XFDropcap::Reset()
++{
++ m_nCharCount = 0;
++ m_nLines = 0;
++ m_fDistance = 0;
++ m_strStyleName = A2OUSTR("");
++}
++
++inline void XFDropcap::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ if( m_nCharCount < 1 || m_nLines < 2 )
++ return;
++ pAttrList->AddAttribute(A2OUSTR("style:length"), Int32ToOUString(m_nCharCount) );
++ pAttrList->AddAttribute(A2OUSTR("style:lines"), Int32ToOUString(m_nLines) );
++ pAttrList->AddAttribute(A2OUSTR("style:distance"), DoubleToOUString(m_fDistance) + A2OUSTR("cm") );
++ if( m_strStyleName.getLength() )
++ pAttrList->AddAttribute(A2OUSTR("style:style-name"), m_strStyleName );
++ pStrm->StartElement( A2OUSTR("style:drop-cap") );
++ pStrm->EndElement( A2OUSTR("style:drop-cap") );
++}
++
++inline bool operator==(XFDropcap& dc1, XFDropcap& dc2)
++{
++ return (
++ (dc1.m_nCharCount == dc2.m_nCharCount)&&
++ (dc1.m_nLines == dc2.m_nLines)&&
++ (dc1.m_fDistance == dc2.m_fDistance)&&
++ (dc1.m_strStyleName == dc2.m_strStyleName)
++ );
++}
++
++inline bool operator!=(XFDropcap& dc1, XFDropcap& dc2)
++{
++ return !(dc1==dc2);
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfendnoteconfig.hxx lotuswordpro/source/filter/xfilter/xfendnoteconfig.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfendnoteconfig.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfendnoteconfig.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,82 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Endnote config.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-03-29 create this file.
++ ************************************************************************/
++#ifndef _XFENDNOTECONFIG_HXX
++#define _XFENDNOTECONFIG_HXX
++
++#include "xfendnoteconfig.hxx"
++
++class XFEndnoteConfig : public XFFootnoteConfig
++{
++public:
++ XFEndnoteConfig() : XFFootnoteConfig()
++ {
++ m_bIsFootnote = sal_False;
++ m_bInsertInPage = sal_False;
++ m_strDefaultStyle = A2OUSTR("Endnote");
++ m_strMasterPage = A2OUSTR("Endnote");
++ m_strCitationStyle = A2OUSTR("Endnote Symbol");
++ m_strBodyStyle = A2OUSTR("Endnote anchor");
++ }
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfendnote.hxx lotuswordpro/source/filter/xfilter/xfendnote.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfendnote.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfendnote.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,128 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * End note object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-1-31 create this file.
++ ************************************************************************/
++#ifndef _XFENDNOTE_HXX
++#define _XFENDNOTE_HXX
++
++#include "xfglobal.hxx"
++#include "xfcontent.hxx"
++#include "xfcontentcontainer.hxx"
++
++/**
++ * @brief
++ * End note obejct.
++ */
++class XFEndNote : public XFContentContainer
++{
++public:
++ XFEndNote();
++
++public:
++ void SetLabel(sal_Unicode label);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ rtl::OUString m_strID;
++ rtl::OUString m_strLabel;
++ XFContentContainer m_aContents;
++};
++
++inline XFEndNote::XFEndNote()
++{
++ m_strID = XFGlobal::GenNoteName();
++}
++
++inline void XFEndNote::SetLabel(sal_Unicode label)
++{
++ sal_Unicode chs[2];
++ chs[0] = label;
++ chs[1] = 0;
++
++ m_strLabel = rtl::OUString(chs);
++}
++
++inline void XFEndNote::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute( A2OUSTR("text:id"), m_strID );
++ pStrm->StartElement( A2OUSTR("text:endnote") );
++
++ pAttrList->Clear();
++ if( m_strLabel.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("text:label"), m_strLabel );
++ pStrm->StartElement( A2OUSTR("text:endnote-citation") );
++ if( m_strLabel.getLength())
++ pStrm->Characters(m_strLabel);
++ pStrm->EndElement( A2OUSTR("text:endnote-citation") );
++
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("text:endnote-body") );
++ XFContentContainer::ToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("text:endnote-body") );
++
++ pStrm->EndElement( A2OUSTR("text:endnote") );
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfentry.cxx lotuswordpro/source/filter/xfilter/xfentry.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfentry.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfentry.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,108 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * index entry object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-04-26 create this file.
++ ************************************************************************/
++#include "xfentry.hxx"
++
++XFEntry::XFEntry()
++{
++ m_eType = enumXFEntryTOC;
++ m_bMainEntry = sal_False;
++ m_nOutlineLevel = 1;
++}
++
++void XFEntry::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute( A2OUSTR("text:string-value"), m_strValue );
++
++ if( m_eType == enumXFEntryTOC )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:outline-level"), Int32ToOUString(m_nOutlineLevel) );
++ pStrm->StartElement( A2OUSTR("text:toc-mark") );
++// pStrm->Characters(m_strDisplay);
++ pStrm->EndElement( A2OUSTR("text:toc-mark") );
++ }
++ else if( m_eType == enumXFEntryAlphabetical )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:key1"), m_strKey1 );
++ if( m_strKey2.getLength()>0 )
++ pAttrList->AddAttribute( A2OUSTR("text:key2"), m_strKey2 );
++
++ if( m_bMainEntry )
++ pAttrList->AddAttribute( A2OUSTR("text:main-etry"), A2OUSTR("true") );
++
++ pStrm->StartElement( A2OUSTR("text:alphabetical-index-mark") );
++// pStrm->Characters(m_strDisplay);
++ pStrm->EndElement( A2OUSTR("text:alphabetical-index-mark") );
++ }
++ else if( m_eType == enumXFEntryUserIndex )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:outline-level"), Int32ToOUString(m_nOutlineLevel) );
++ pAttrList->AddAttribute( A2OUSTR("text:index-name"), m_strName );
++
++ pStrm->StartElement( A2OUSTR("text:user-index-mark") );
++// pStrm->Characters(m_strDisplay);
++ pStrm->EndElement( A2OUSTR("text:user-index-mark") );
++ }
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfentry.hxx lotuswordpro/source/filter/xfilter/xfentry.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfentry.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfentry.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,162 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * index entry object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-04-26 create this file.
++ ************************************************************************/
++#ifndef _XFENTRY_HXX
++#define _XFENTRY_HXX
++
++#include "xfcontent.hxx"
++
++/**
++ * @brief
++ * Index entry obejct.
++ */
++class XFEntry : public XFContent
++{
++public:
++ XFEntry();
++
++public:
++ /**
++ * @descr Set entry type.
++ */
++ void SetEntryType(enumXFEntry type);
++
++ /**
++ * @descr Set entry string value.
++ */
++ void SetStringValue(const rtl::OUString& value);
++
++ /**
++ * @descr Set display string.
++ */
++ void SetStringDisplay(const rtl::OUString& display);
++
++ /**
++ * @descr Set entry name.
++ */
++ void SetEntryName(const rtl::OUString& name);
++
++ /**
++ * @descr Set entry key. The keys is available only for enumXFEntryAlphabetical.
++ */
++ void SetKey(const rtl::OUString& key1, const rtl::OUString& key2=A2OUSTR(""));
++
++ /**
++ * @descr Set whether it's a main entry. This is available only for enumXFEntryAlphabetical.
++ */
++ void SetMainEntry(sal_Bool main);
++
++ /**
++ * @descr Set outline level. This is available for enumXFEntryTOC and enumXFEntryUserIndex.
++ */
++ void SetOutlineLevel(sal_Int32 level);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ enumXFEntry m_eType;
++ rtl::OUString m_strValue;
++ rtl::OUString m_strDisplay;
++ rtl::OUString m_strKey1;
++ rtl::OUString m_strKey2;
++ rtl::OUString m_strName;
++ sal_Bool m_bMainEntry;
++ sal_Int32 m_nOutlineLevel;
++};
++
++inline void XFEntry::SetEntryType(enumXFEntry type)
++{
++ m_eType = type;
++}
++
++inline void XFEntry::SetStringValue(const rtl::OUString& value)
++{
++ m_strValue = value;
++}
++
++inline void XFEntry::SetStringDisplay(const rtl::OUString& display)
++{
++ m_strDisplay = display;
++}
++
++inline void XFEntry::SetEntryName(const rtl::OUString& name)
++{
++ m_strName = name;
++}
++
++inline void XFEntry::SetKey(const rtl::OUString& key1, const rtl::OUString& key2/* =A2OUSTR */)
++{
++ m_strKey1 = key1;
++ m_strKey2 = key2;
++}
++
++inline void XFEntry::SetMainEntry(sal_Bool main)
++{
++ m_bMainEntry = main;
++}
++
++inline void XFEntry::SetOutlineLevel(sal_Int32 level)
++{
++ m_nOutlineLevel = level;
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffileattrlist.cxx lotuswordpro/source/filter/xfilter/xffileattrlist.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xffileattrlist.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffileattrlist.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,82 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Attribute list for sax element,this is a help class to write xml to
++ * local file.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#include "xffileattrlist.hxx"
++
++XFFileAttrList::XFFileAttrList()
++{
++}
++
++XFFileAttrList::~XFFileAttrList()
++{
++}
++
++void XFFileAttrList::AddAttribute(const rtl::OUString& name, const rtl::OUString& value)
++{
++ m_aAttrList.push_back( std::pair<rtl::OUString,rtl::OUString>(name,value) );
++}
++
++void XFFileAttrList::Clear()
++{
++ m_aAttrList.clear();
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffileattrlist.hxx lotuswordpro/source/filter/xfilter/xffileattrlist.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xffileattrlist.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffileattrlist.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,89 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Wrapper the sax interface for xml output.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++
++#ifndef _XFFILEATTRLIST_HXX
++#define _XFFILEATTRLIST_HXX
++
++#include "ixfattrlist.hxx"
++#include "rtl/ustring.hxx"
++#include <vector>
++#include <utility>
++
++class XFFileAttrList : public IXFAttrList
++{
++public:
++
++ XFFileAttrList();
++ virtual ~XFFileAttrList();
++ //Interface ISaxAttributeList:
++
++ virtual void AddAttribute(const rtl::OUString& name, const rtl::OUString& value);
++ virtual void Clear();
++
++ friend class XFFileStream;
++private:
++ std::vector<std::pair<rtl::OUString,rtl::OUString> > m_aAttrList;
++
++};
++
++#endif //XFFILEATTRLIST
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffilestream.cxx lotuswordpro/source/filter/xfilter/xffilestream.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xffilestream.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffilestream.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,208 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Interface for the all content object,ie. text,paragraph,picture,and so on.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#include "xffilestream.hxx"
++#include "xffileattrlist.hxx"
++#include "ixfattrlist.hxx"
++
++void WriteStartTag(std::ofstream& ofs, const char *pStr, int len);
++void WriteEndTag(std::ofstream& ofs, const char *pStr, int len);
++void WriteString(std::ofstream& ofs, const char *pStr, int len);
++void WriteXmlString(std::ofstream& ofs, const char *pStr, int len);
++void WriteOUString(std::ofstream& ofs, const rtl::OUString& oustr);
++
++XFFileStream::XFFileStream(std::string strFileName):m_aFile(strFileName.c_str())
++{
++ m_pAttrList = new XFFileAttrList();
++}
++
++XFFileStream::~XFFileStream()
++{
++ if( m_pAttrList )
++ delete m_pAttrList;
++}
++
++void XFFileStream::StartDocument()
++{
++ std::string strXmlDecl = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
++ WriteString(m_aFile, strXmlDecl.c_str(),strXmlDecl.length());
++}
++
++void XFFileStream::EndDocument()
++{
++ m_aFile.close();
++}
++
++
++void XFFileStream::StartElement(const rtl::OUString& oustr)
++{
++ WriteString(m_aFile, "\n<",2);
++ WriteOUString(m_aFile, oustr);
++
++ //write attributes:
++ std::vector<std::pair<rtl::OUString,rtl::OUString> >::iterator it;
++ for( it = m_pAttrList->m_aAttrList.begin(); it != m_pAttrList->m_aAttrList.end(); it++ )
++ {
++ std::pair<rtl::OUString,rtl::OUString> pair = *it;
++ rtl::OUString name = pair.first;
++ rtl::OUString value = pair.second;
++
++ WriteString(m_aFile," ",1);
++ WriteOUString(m_aFile, name);
++ WriteString(m_aFile, "=\"",2);
++ WriteOUString(m_aFile, value);
++ WriteString(m_aFile, "\"",1);
++
++ }
++
++ WriteString(m_aFile, ">",1);
++ m_pAttrList->Clear();
++}
++
++void XFFileStream::EndElement(const rtl::OUString& oustr)
++{
++ rtl::OString ostr;
++
++ ostr = rtl::OUStringToOString(oustr,RTL_TEXTENCODING_UTF8);
++ WriteEndTag(m_aFile, ostr.getStr(), ostr.getLength());
++}
++
++void XFFileStream::Characters(const rtl::OUString& oustr)
++{
++ WriteOUString(m_aFile, oustr);
++}
++
++IXFAttrList* XFFileStream::GetAttrList()
++{
++ return m_pAttrList;
++}
++
++//------------------------------------------------------------------------------
++
++void WriteStartTag(std::ofstream& ofs, const char *pStr, int len)
++{
++ ofs.write("\n<",2);
++ ofs.write(pStr,len);
++}
++
++void WriteEndTag(std::ofstream& ofs, const char *pStr, int len)
++{
++ ofs.write("</",2);
++ ofs.write(pStr,len);
++ ofs.write(">\n",2);
++}
++
++void WriteString(std::ofstream& ofs, const char *pStr, int len)
++{
++ ofs.write(pStr,len);
++}
++
++/**
++ * @descr: Replace some reserved characters of xml character into xml entity.Please refer to w3c xml spec.
++ */
++void WriteXmlString(std::ofstream& ofs, const char *pStr, int len)
++{
++ std::string str;
++
++ for( int i=0; i<len; i++ )
++ {
++ switch(pStr[i])
++ {
++ case '&':
++ str += "&";
++ break;
++ case '<':
++ str += "<";
++ break;
++ case '>':
++ str += ">";
++ break;
++ case '\'':
++ str += "'";
++ break;
++ case '\"':
++ str += """;
++ break;
++ case 13:
++ str += "
";
++ break;
++ case 10:
++ str += "
";
++ break;
++ case 9:
++ str += "	";
++ break;
++ default:
++ str += pStr[i];
++ }
++ }
++ ofs.write(str.c_str(),str.length());
++}
++
++void WriteOUString(std::ofstream& ofs, const rtl::OUString& oustr)
++{
++ rtl::OString ostr;
++
++ ostr = rtl::OUStringToOString(oustr,RTL_TEXTENCODING_UTF8);
++
++ WriteXmlString(ofs, ostr.getStr(),ostr.getLength());
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffilestream.hxx lotuswordpro/source/filter/xfilter/xffilestream.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xffilestream.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffilestream.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,92 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Wrapper for sax stream to write to local file.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef _XFFILESTREAM_HXX
++#define _XFFILESTREAM_HXX
++
++#include "ixfstream.hxx"
++#include <fstream>
++#include <rtl/ustring.hxx>
++
++class XFFileAttrList;
++
++class XFFileStream : public IXFStream
++{
++public:
++ XFFileStream(std::string strFileName);
++ virtual ~XFFileStream();
++
++ //interface IXFSaxStream
++ virtual void StartDocument();
++ virtual void EndDocument();
++ virtual void StartElement(const rtl::OUString& oustr);
++ virtual void EndElement(const rtl::OUString& oustr);
++ virtual void Characters(const rtl::OUString& oustr);
++ virtual IXFAttrList* GetAttrList();
++
++private:
++ std::ofstream m_aFile;
++ XFFileAttrList *m_pAttrList;
++};
++
++#endif //XFFILESTREAM_INC
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffloatframe.cxx lotuswordpro/source/filter/xfilter/xffloatframe.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xffloatframe.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffloatframe.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,91 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Float frame whose anchor is page.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-21 create this file.
++ ************************************************************************/
++#include "xffloatframe.hxx"
++
++XFFloatFrame::XFFloatFrame(sal_Int32 page)
++{
++ m_nStart = page;
++ m_nEnd = page;
++}
++
++XFFloatFrame::XFFloatFrame(sal_Int32 start, sal_Int32 end, sal_Bool all)
++{
++ m_nStart = start;
++ m_nEnd = end;
++ m_bAll = all;
++ SetAnchorType(enumXFAnchorPage);
++}
++
++void XFFloatFrame::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ for( int i=m_nStart; i<=m_nEnd; i++ )
++ {
++ XFFrame::SetAnchorPage(i);
++ XFFrame::ToXml(pStrm);
++ if( !m_bAll )
++ i++;
++ }
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffloatframe.hxx lotuswordpro/source/filter/xfilter/xffloatframe.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xffloatframe.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffloatframe.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,94 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Float frame whose anchor is page.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-21 create this file.
++ ************************************************************************/
++#ifndef _XFFLOATFRAME_HXX
++#define _XFFLOATFRAME_HXX
++
++#include "xfframe.hxx"
++#include <vector>
++
++/**
++ * @brief
++ * Floating frame on any page.
++ * You can specify it to be on all pages, on odd pages, or on even pages.
++ */
++class XFFloatFrame : public XFFrame
++{
++public:
++ XFFloatFrame(sal_Int32 page);
++
++ /**
++ * @descr output range: [start,end], not [start,end).
++ */
++ XFFloatFrame(sal_Int32 start, sal_Int32 end, sal_Bool all=sal_False);
++
++public:
++ void ToXml(IXFStream *pStrm);
++
++private:
++ sal_Int32 m_nStart;
++ sal_Int32 m_nEnd;
++ sal_Bool m_bAll;
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffont.cxx lotuswordpro/source/filter/xfilter/xffont.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xffont.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffont.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,415 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Font object to serial to xml filter.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ * 2005-01-14 add scale,position,emphasize support.
++ * 2005-01-24 move some tool function to xfutil.hxx
++ ************************************************************************/
++#include "xffont.hxx"
++
++XFFont::XFFont()
++{
++ m_nFontSize = 0;
++ m_nFontSizeAsia = 0;
++ m_nFontSizeComplex = 0;
++ m_bItalic = sal_False;
++ m_bItalicAsia = sal_False;
++ m_bItalicComplex = sal_False;
++ m_bBold = sal_False;
++ m_bBoldAsia = sal_False;
++ m_bBoldComplex = sal_False;
++ m_eUnderline = enumXFUnderlineNone;
++ m_eCrossout = enumXFCrossoutNone;
++ m_eRelief = enumXFReliefNone;
++ m_eTransform = enumXFTransformNone;
++ m_eEmphasize = enumXFEmphasizeNone;
++ m_bEmphasizeTop = sal_True;
++ m_bOutline = sal_False;
++ m_bShadow = sal_False;
++ m_bBlink = sal_False;
++ m_nPosition = 33;
++ m_nScale = 58;
++ m_fCharSpace = 0;
++ m_nWidthScale = 100;
++ m_bWordByWord = sal_False;
++ m_nFlag = 0;
++}
++/*
++ The Following variable are to be compared:
++ rtl::OUString m_strFontName;
++ rtl::OUString m_strFontNameAsia;
++ rtl::OUString m_strFontNameComplex;
++ sal_Int16 m_nFontSize;
++ sal_Int16 m_nFontSizeAsia;
++ sal_Int16 m_nFontSizeComplex;
++ sal_Bool m_bItalic;
++ sal_Bool m_bItalicAsia;
++ sal_Bool m_bItalicComplex;
++ sal_Bool m_bBold;
++ sal_Bool m_bBoldAsia;
++ sal_Bool m_bBoldComplex;
++ sal_Int16 m_nUnderline;
++ sal_uInt32 m_nUnderlineColor;
++
++ sal_uInt32 m_nFlag;
++*/
++bool operator==(XFFont& f1, XFFont& f2)
++{
++ //The most possible entry be first:
++ if( f1.m_nFlag != f2.m_nFlag )
++ return false;
++
++ if( f1.m_strFontName != f2.m_strFontName ||
++ f1.m_strFontNameAsia != f2.m_strFontNameAsia ||
++ f1.m_strFontNameComplex != f2.m_strFontNameComplex
++ )
++ return false;
++
++ if( f1.m_nFontSize != f2.m_nFontSize ||
++ f1.m_nFontSizeAsia != f2.m_nFontSizeAsia ||
++ f1.m_nFontSizeComplex != f2.m_nFontSizeComplex
++ )
++ return false;
++
++ if( f1.m_bItalic != f2.m_bItalic ||
++ f1.m_bItalicAsia != f2.m_bItalicAsia ||
++ f1.m_bItalicComplex != f2.m_bItalicComplex
++ )
++ return false;
++
++ if( f1.m_bBold != f2.m_bBold ||
++ f1.m_bBoldAsia != f2.m_bBoldAsia ||
++ f1.m_bBoldComplex != f2.m_bBoldComplex
++ )
++ return false;
++
++ if( f1.m_nFlag&XFFONT_FLAG_UNDERLINE )
++ {
++ if( f1.m_eUnderline != f2.m_eUnderline )
++ return false;
++ }
++
++ if( f1.m_nFlag&XFFONT_FLAG_UNDERLINECOLOR )
++ {
++ if( f1.m_aUnderlineColor != f2.m_aUnderlineColor )
++ return false;
++ }
++
++ if( f1.m_nFlag&XFFONT_FLAG_CROSSOUT )
++ {
++ if( f1.m_eCrossout != f2.m_eCrossout )
++ return false;
++ }
++
++ if( f1.m_nFlag&XFFONT_FLAG_RELIEF )
++ {
++ if( f1.m_eRelief != f2.m_eRelief )
++ return false;
++ }
++
++ if( f1.m_nFlag&XFFONT_FLAG_TRANSFORM )
++ {
++ if( f1.m_eTransform != f2.m_eTransform )
++ return false;
++ }
++
++ if( f1.m_nFlag&XFFONT_FLAG_EMPHASIZE )
++ {
++ if( f1.m_eEmphasize != f2.m_eEmphasize )
++ return false;
++ if( f1.m_bEmphasizeTop != f2.m_bEmphasizeTop )
++ return false;
++ }
++
++ if( f1.m_bWordByWord != f2.m_bWordByWord )
++ return false;
++
++ if( f1.m_nFlag&XFFONT_FLAG_OUTLINE )
++ {
++ if( f1.m_bOutline != f2.m_bOutline )
++ return false;
++ }
++
++ if( f1.m_nFlag&XFFONT_FLAG_SHADOW )
++ {
++ if( f1.m_bShadow != f2.m_bShadow )
++ return false;
++ }
++
++ if( f1.m_nFlag&XFFONT_FLAG_BLINK )
++ {
++ if( f1.m_bBlink != f2.m_bBlink )
++ return false;
++ }
++
++ if( f1.m_nFlag&XFFONT_FLAG_POSITION )
++ {
++ if( f1.m_nPosition != f2.m_nPosition )
++ return false;
++ }
++
++ if( f1.m_nFlag&XFFONT_FLAG_SCALE )
++ {
++ if( f1.m_nScale != f2.m_nScale )
++ return false;
++ }
++
++ if( f1.m_nFlag&XFFONT_FLAG_CHARSPACE )
++ {
++ if( f1.m_fCharSpace != f2.m_fCharSpace )
++ return false;
++ }
++
++ if( f1.m_nFlag&XFFONT_FLAG_WIDTHSCALE )
++ {
++ if( f1.m_nWidthScale != f2.m_nWidthScale )
++ return false;
++ }
++
++ if( f1.m_nFlag&XFFONT_FLAG_COLOR )
++ {
++ if( f1.m_aColor != f2.m_aColor )
++ return false;
++ }
++
++ if( f1.m_nFlag&XFFONT_FLAG_BGCOLOR )
++ {
++ if( f1.m_aBackColor != f2.m_aBackColor )
++ return false;
++ }
++
++ return true;
++}
++
++bool operator!=(XFFont& f1, XFFont& f2)
++{
++ return !(f1==f2);
++}
++
++
++void XFFont::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ if( m_nFlag & XFFONT_FLAG_NAME )
++ {
++ pAttrList->AddAttribute(A2OUSTR("style:font-name"),m_strFontName );
++ }
++
++ if( m_nFlag & XFFONT_FLAG_NAME_ASIA )
++ {
++ pAttrList->AddAttribute(A2OUSTR("style:font-name-asian"),m_strFontNameAsia );
++ }
++
++ if( m_nFlag & XFFONT_FLAG_NAME_COMPLEX )
++ {
++ pAttrList->AddAttribute(A2OUSTR("style:font-name-complex"), m_strFontNameComplex);
++ }
++
++ //font size:
++ if( (m_nFlag & XFFONT_FLAG_SIZE) && m_nFontSize != 0 )
++ {
++ rtl::OUString strSize = Int32ToOUString(m_nFontSize);
++ strSize += A2OUSTR("pt");
++ pAttrList->AddAttribute(A2OUSTR("fo:font-size"),strSize);
++ }
++ if( (m_nFlag & XFFONT_FLAG_SIZE_ASIA) && m_nFontSizeAsia )
++ {
++ rtl::OUString strSize = Int32ToOUString(m_nFontSizeAsia);
++ strSize += A2OUSTR("pt");
++ pAttrList->AddAttribute(A2OUSTR("style:font-size-asian"),strSize);
++ }
++ if( (m_nFlag & XFFONT_FLAG_SIZE_COMPLEX) && m_nFontSizeComplex )
++ {
++ rtl::OUString strSize = Int32ToOUString(m_nFontSizeComplex);
++ strSize += A2OUSTR("pt");
++ pAttrList->AddAttribute(A2OUSTR("style:font-size-complex"),strSize);
++ }
++
++ //italic flag:
++ if( ( m_nFlag & XFFONT_FLAG_ITALIC) && m_bItalic )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:font-style"), A2OUSTR("italic"));
++ }
++ if( (m_nFlag & XFFONT_FLAG_ITALIC_ASIA) && m_bItalicAsia )
++ {
++ pAttrList->AddAttribute(A2OUSTR("style:font-style-asian"), A2OUSTR("italic"));
++ }
++ if( (m_nFlag & XFFONT_FLAG_ITALIC_COMPLEX) && m_bItalicComplex )
++ {
++ pAttrList->AddAttribute(A2OUSTR("style:font-style-complex"), A2OUSTR("italic"));
++ }
++
++ //Bold flag:
++ if( (m_nFlag & XFFONT_FLAG_BOLD) && m_bBold )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:font-weight"), A2OUSTR("bold"));
++ }
++ if( (m_nFlag & XFFONT_FLAG_BOLD_ASIA) && m_bBoldAsia )
++ {
++ pAttrList->AddAttribute(A2OUSTR("style:font-weight-asian"), A2OUSTR("bold"));
++ }
++ if( (m_nFlag & XFFONT_FLAG_BOLD_ASIA) && m_bBoldComplex )
++ {
++ pAttrList->AddAttribute(A2OUSTR("style:font-weight-complex"), A2OUSTR("bold"));
++ }
++ //underline:
++ if( (m_nFlag & XFFONT_FLAG_UNDERLINE) && m_eUnderline )
++ {
++ pAttrList->AddAttribute(A2OUSTR("style:text-underline"), GetUnderlineName(m_eUnderline) );
++ if( (m_nFlag & XFFONT_FLAG_UNDERLINECOLOR) )
++ {
++ pAttrList->AddAttribute( A2OUSTR("style:text-underline-color"), m_aUnderlineColor.ToString() );
++ }
++ else
++ pAttrList->AddAttribute( A2OUSTR("style:text-underline-color"), A2OUSTR("font-color") );
++ }
++
++ //enumCrossoutType m_eCrossout;
++ if( (m_nFlag & XFFONT_FLAG_CROSSOUT) && m_eCrossout )
++ {
++ pAttrList->AddAttribute(A2OUSTR("style:text-crossing-out"), GetCrossoutName(m_eCrossout) );
++ }
++
++ if( m_nFlag & XFFONT_FLAG_UNDERLINE || m_nFlag & XFFONT_FLAG_CROSSOUT )
++ {
++ if( m_bWordByWord )
++ pAttrList->AddAttribute(A2OUSTR("fo:score-spaces"), A2OUSTR("false") );
++ else
++ pAttrList->AddAttribute(A2OUSTR("fo:score-spaces"), A2OUSTR("true") );
++ }
++
++ if( (m_nFlag & XFFONT_FLAG_RELIEF) && m_eRelief )
++ {
++ pAttrList->AddAttribute(A2OUSTR("style:font-relief"), GetReliefName(m_eRelief) );
++ }
++
++ if( (m_nFlag & XFFONT_FLAG_TRANSFORM) && m_eTransform )
++ {
++ //enumTransformSmallCap is different:
++ if( m_eTransform == enumXFTransformSmallCaps )
++ pAttrList->AddAttribute(A2OUSTR("fo:font-variant"), GetTransformName(m_eTransform) );
++ else
++ pAttrList->AddAttribute(A2OUSTR("fo:text-transform"), GetTransformName(m_eTransform) );
++ }
++
++ if( (m_nFlag & XFFONT_FLAG_EMPHASIZE) && m_eEmphasize )
++ {
++ rtl::OUString empha = GetEmphasizeName(m_eEmphasize);
++ empha += A2OUSTR(" ");
++ if( m_bEmphasizeTop )
++ empha += A2OUSTR("above");
++ pAttrList->AddAttribute(A2OUSTR("style:text-emphasize"), empha );
++ }
++
++ if( (m_nFlag & XFFONT_FLAG_OUTLINE) && m_bOutline )
++ {
++ pAttrList->AddAttribute(A2OUSTR("style:text-outline"), A2OUSTR("true") );
++ }
++
++ if( (m_nFlag & XFFONT_FLAG_SHADOW) && m_bShadow )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:text-shadow"), A2OUSTR("1pt 1pt") );
++ }
++
++ if( (m_nFlag & XFFONT_FLAG_BLINK) && m_bBlink )
++ {
++ pAttrList->AddAttribute(A2OUSTR("style:text-blinking"), A2OUSTR("true") );
++ }
++
++
++ //position & sacle:
++ if( ((m_nFlag & XFFONT_FLAG_SCALE) && m_nScale>0 ) ||
++ ((m_nFlag & XFFONT_FLAG_POSITION) && m_nPosition != 0)
++ )
++ {
++ rtl::OUString tmp;
++ tmp = Int32ToOUString(m_nPosition) + A2OUSTR("% ");
++ tmp += Int32ToOUString(m_nScale) + A2OUSTR("%");
++ pAttrList->AddAttribute(A2OUSTR("style:text-position"), tmp );
++ }
++
++ //char space:
++ if( (m_nFlag & XFFONT_FLAG_CHARSPACE) && m_fCharSpace != 0 )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:letter-spacing"), DoubleToOUString(m_fCharSpace)+A2OUSTR("cm") );
++ }
++
++ if( (m_nFlag&XFFONT_FLAG_WIDTHSCALE) && m_nWidthScale != 100 )
++ {
++ pAttrList->AddAttribute(A2OUSTR("style:text-scale"), DoubleToOUString(m_nWidthScale)+A2OUSTR("%") );
++ }
++
++ //Color:
++ if( (m_nFlag & XFFONT_FLAG_COLOR) )
++ {
++ pAttrList->AddAttribute( A2OUSTR("fo:color"), m_aColor.ToString() );
++ }
++
++ if( (m_nFlag & XFFONT_FLAG_BGCOLOR) )
++ {
++ if (m_bTransparent)
++ pAttrList->AddAttribute( A2OUSTR("style:text-background-color"), A2OUSTR("transparent"));
++ else
++ pAttrList->AddAttribute( A2OUSTR("style:text-background-color"), m_aBackColor.ToString() );
++ }
++}
++
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffontdecl.cxx lotuswordpro/source/filter/xfilter/xffontdecl.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xffontdecl.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffontdecl.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,104 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Font decl of all used fonts.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-21 create this file.
++ ************************************************************************/
++#include "xffontdecl.hxx"
++
++XFFontDecl::XFFontDecl()
++{
++}
++
++XFFontDecl::XFFontDecl(rtl::OUString name, rtl::OUString family, sal_Bool fixed)
++{
++ m_strFontName = name;
++ m_strFontFamily = family;
++ m_bPitchFixed = fixed;
++}
++
++rtl::OUString XFFontDecl::GetFontName()
++{
++ return m_strFontName;
++}
++
++void XFFontDecl::SetFontName(rtl::OUString name)
++{
++ m_strFontName = name;
++}
++
++rtl::OUString XFFontDecl::GetFontFamily()
++{
++ return m_strFontFamily;
++}
++
++void XFFontDecl::SetFontFamily(rtl::OUString family)
++{
++ m_strFontFamily = family;
++}
++
++sal_Bool XFFontDecl::GetFontPitchFixed()
++{
++ return m_bPitchFixed;
++}
++
++void XFFontDecl::SetFontPitchFixed(sal_Bool fixed)
++{
++ m_bPitchFixed = fixed;
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffontdecl.hxx lotuswordpro/source/filter/xfilter/xffontdecl.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xffontdecl.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffontdecl.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,112 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Font declaration for OOo xml file.This is needed for every font that was
++ * used.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-24 create this file.
++ ************************************************************************/
++#ifndef _XFFONTDECL_HXX
++#define _XFFONTDECL_HXX
++
++#include "xfglobal.hxx"
++
++/**
++ * @brief
++ * Font declaration in OOo xml file.
++ * Each font used should be declared.
++ */
++class XFFontDecl
++{
++public:
++ XFFontDecl();
++
++ XFFontDecl(rtl::OUString name, rtl::OUString family, sal_Bool fixed = false);
++
++public:
++ /**
++ * @descr Get font name.
++ */
++ rtl::OUString GetFontName();
++
++ /**
++ * @descr Set font name.
++ */
++ void SetFontName(rtl::OUString name);
++
++ /**
++ * @descr Get font family.
++ */
++ rtl::OUString GetFontFamily();
++
++ /**
++ * @descr Set font famuly.
++ */
++ void SetFontFamily(rtl::OUString family);
++
++ sal_Bool GetFontPitchFixed();
++
++ void SetFontPitchFixed(sal_Bool fixed);
++
++private:
++ rtl::OUString m_strFontName;
++ rtl::OUString m_strFontFamily;
++ sal_Bool m_bPitchFixed;
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffontfactory.cxx lotuswordpro/source/filter/xfilter/xffontfactory.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xffontfactory.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffontfactory.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,102 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Implement for font factory which will manage all font.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#include "xffontfactory.hxx"
++
++XFFontFactory::XFFontFactory()
++{
++}
++
++XFFontFactory::~XFFontFactory()
++{
++ Reset();
++}
++
++void XFFontFactory::Reset()
++{
++ std::vector<XFFont*>::iterator it;
++ for( it = s_aFonts.begin(); it != s_aFonts.end(); it++ )
++ {
++ XFFont *pFont = (*it);
++ if( !pFont )
++ continue;
++ delete pFont;
++ }
++ s_aFonts.clear();
++}
++
++void XFFontFactory::AddFont(XFFont *pFont)
++{
++ s_aFonts.push_back( pFont );
++}
++
++XFFont* XFFontFactory::FindSameFont(XFFont *pFont)
++{
++ std::vector<XFFont*>::iterator it;
++ for( it = s_aFonts.begin(); it != s_aFonts.end(); it++ )
++ {
++ if( *pFont == **it )
++ return *it;
++ }
++
++ return NULL;
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffontfactory.hxx lotuswordpro/source/filter/xfilter/xffontfactory.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xffontfactory.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffontfactory.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,110 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Factory object for XFFont.It also manages all font life cycle.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef _XFFONTFACTORY_HXX
++#define _XFFONTFACTORY_HXX
++
++#include "xfglobal.hxx"
++#include "xffont.hxx"
++#include <vector>
++
++/**
++ * @brief
++ * Font factory.
++ * Because font object are so used so offten, so make a factory to manager them.
++ * The fonts with same properties will only exist one instance.
++ */
++class XFFontFactory
++{
++public:
++ XFFontFactory();
++ ~XFFontFactory();
++ XFFontFactory(const XFFontFactory& other){}
++
++ XFFontFactory operator=(XFFontFactory& other){}
++
++public:
++ /**
++ * @descr Clear all fonts, this is called when load a file.
++ */
++ void Reset();
++
++private:
++ /**
++ * @descr Add a font. if there exist a font with same properties with pFont, them the font obejct
++ * will not be added.
++ */
++ void AddFont(XFFont *pFont);
++
++ /**
++ * @descr Find whether same font obejct exists.
++ */
++ XFFont* FindSameFont(XFFont *pFont);
++
++ friend class XFStyleContainer;
++
++private:
++ std::vector<XFFont*> s_aFonts;
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffont.hxx lotuswordpro/source/filter/xfilter/xffont.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xffont.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffont.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,509 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Font object to serial to xml filter.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef _XFFONT_HXX
++#define _XFFONT_HXX
++
++#include "xfglobal.hxx"
++#include "xfcolor.hxx"
++
++#define XFFONT_FLAG_NAME 0X00000001
++#define XFFONT_FLAG_NAME_ASIA 0X00000002
++#define XFFONT_FLAG_NAME_COMPLEX 0X00000004
++
++#define XFFONT_FLAG_SIZE 0X00000008
++#define XFFONT_FLAG_SIZE_ASIA 0X00000010
++#define XFFONT_FLAG_SIZE_COMPLEX 0X00000020
++
++#define XFFONT_FLAG_ITALIC 0X00000040
++#define XFFONT_FLAG_ITALIC_ASIA 0X00000080
++#define XFFONT_FLAG_ITALIC_COMPLEX 0X00000100
++
++#define XFFONT_FLAG_BOLD 0X00000200
++#define XFFONT_FLAG_BOLD_ASIA 0X00000400
++#define XFFONT_FLAG_BOLD_COMPLEX 0X00000800
++
++#define XFFONT_FLAG_UNDERLINE 0X00001000
++#define XFFONT_FLAG_UNDERLINECOLOR 0X00002000
++
++#define XFFONT_FLAG_POSITION 0X00004000
++#define XFFONT_FLAG_SCALE 0X00008000
++#define XFFONT_FLAG_CHARSPACE 0x00010000
++
++#define XFFONT_FLAG_COLOR 0x00020000
++#define XFFONT_FLAG_BGCOLOR 0x00040000
++
++#define XFFONT_FLAG_CROSSOUT 0x00080000
++#define XFFONT_FLAG_RELIEF 0x00100000
++#define XFFONT_FLAG_TRANSFORM 0x00200000
++#define XFFONT_FLAG_EMPHASIZE 0x00400000
++#define XFFONT_FLAG_OUTLINE 0x00800000
++#define XFFONT_FLAG_SHADOW 0x01000000
++#define XFFONT_FLAG_BLINK 0x02000000
++#define XFFONT_FLAG_WIDTHSCALE 0x04000000
++
++/**
++ * @descr
++ * The font struct of openoffice xml filter.
++ * There should be some basic members,ie:
++
++ * font name
++ * font family
++ * font size
++ * font italic
++ * font bold
++ * font underline
++ * font underline color
++ */
++class XFFont
++{
++public:
++ XFFont();
++
++public:
++ /**
++ * @descr Set font name.
++ */
++ void SetFontName(rtl::OUString name);
++
++ /**
++ * @descr Set font name for asia locale.
++ */
++ void SetFontNameAsia(rtl::OUString name);
++
++ /**
++ * @descr Set font name for BIDI locale.
++ */
++ void SetFontNameComplex(rtl::OUString name);
++
++ /**
++ * @descr Set font size.
++ */
++ void SetFontSize(sal_Int16 size);
++
++ /**
++ * @descr Set font size for asia locale.
++ */
++ void SetFontSizeAsia(sal_Int16 size);
++
++ /**
++ * @descr Set font size for BIDI locale.
++ */
++ void SetFontSizeComplex(sal_Int16 size);
++
++ /**
++ * @descr Set whether font is italic.
++ */
++ void SetItalic(sal_Bool italic = true);
++
++ /**
++ * @descr Set whether font is italic for asia locale.
++ */
++ void SetItalicAsia(sal_Bool italic);
++
++ /**
++ * @descr Set whether font is italic for BIDI locale.
++ */
++ void SetItalicComplex(sal_Bool italic);
++
++ /**
++ * @descr Set font bold.
++ */
++ void SetBold(sal_Bool bold = true);
++
++ /**
++ * @descr Set font bold for asia locale.
++ */
++ void SetBoldAsia(sal_Bool bold);
++
++ /**
++ * @descr Set font bold for complex locale.
++ */
++ void SetBoldComplex(sal_Bool bold);
++
++ /**
++ * @descr Set underline style.
++ */
++ void SetUnderline(enumXFUnderline underline,sal_Bool wordByWord=sal_False);
++
++ /**
++ * @descr Set underline color.
++ */
++ void SetUnderlineColor(XFColor color=XFColor(128,128,0));
++
++ /**
++ * @descr Set crossout.
++ */
++ void SetCrossout(enumXFCrossout cross,sal_Bool wordByWord=sal_False);
++
++ /**
++ * @descr Set font relief.
++ */
++ void SetRelief(enumXFRelief relief);
++
++ /**
++ * @descr Set font transform type,pls refer to enumXFTransform.
++ */
++ void SetTransform(enumXFTransform transform);
++
++ /**
++ * @descr Set font emphasize effect.
++ */
++ void SetEmphasize(enumXFEmphasize emphasize, sal_Bool top = sal_True);
++
++ /**
++ * @descr Set outline effect.
++ */
++ void SetOutline(sal_Bool outline);
++
++ /**
++ * @descr Set font shadow.
++ */
++ void SetShadow(sal_Bool shadow);
++
++ /**
++ * @descr Set font blink effect.
++ */
++ void SetBlink(sal_Bool blink);
++
++ /**
++ * @descr Set upper script or lower script.
++ */
++ void SetPosition(sal_Bool bUpperScript = sal_True, sal_Int16 pos = 33, sal_Int16 scale = 58);
++
++ /**
++ * @descr Set space between chars in percent.
++ */
++ void SetCharSpace(sal_Int16 space);
++
++ /**
++ * @descr Set char width scale in percent.
++ */
++ void SetWidthScale(sal_Int16 widthScale);
++
++ /**
++ * @descr Set font color.
++ */
++ void SetColor(XFColor& color);
++
++ /**
++ * @descr Set font background color.
++ */
++ void SetBackColor(XFColor& color);
++ void SetBackColorTransparent();
++
++ //getter:
++ enumXFTransform GetTransform();
++
++ sal_Int16 GetFontSize();
++ XFColor GetColor();
++
++ sal_uInt32 GetFlag(){ return m_nFlag; }
++
++ void ToXml(IXFStream *pStrm);
++
++ friend bool operator==(XFFont& f1, XFFont& f2);
++ friend bool operator!=(XFFont& f1, XFFont& f2);
++ friend class XFFontFactory;
++private:
++ rtl::OUString m_strFontName;
++ rtl::OUString m_strFontNameAsia;
++ rtl::OUString m_strFontNameComplex;
++ sal_Int16 m_nFontSize;
++ sal_Int16 m_nFontSizeAsia;
++ sal_Int16 m_nFontSizeComplex;
++ sal_Bool m_bItalic;
++ sal_Bool m_bItalicAsia;
++ sal_Bool m_bItalicComplex;
++ sal_Bool m_bBold;
++ sal_Bool m_bBoldAsia;
++ sal_Bool m_bBoldComplex;
++ XFColor m_aUnderlineColor;
++
++ enumXFUnderline m_eUnderline;
++ enumXFCrossout m_eCrossout;
++ enumXFRelief m_eRelief;
++ enumXFTransform m_eTransform;
++ enumXFEmphasize m_eEmphasize;
++ sal_Bool m_bWordByWord;
++ sal_Bool m_bEmphasizeTop;
++ sal_Bool m_bOutline;
++ sal_Bool m_bShadow;
++ sal_Bool m_bBlink;
++ sal_Int16 m_nPosition;
++ sal_Int16 m_nScale;
++ double m_fCharSpace;
++ sal_Int16 m_nWidthScale;
++ XFColor m_aColor;
++ XFColor m_aBackColor;
++ //The flag defines which variable will be funtional.
++ sal_uInt32 m_nFlag;
++ sal_Bool m_bTransparent;
++};
++
++
++inline void XFFont::SetFontName(rtl::OUString name)
++{
++ m_strFontName = name;
++ m_nFlag |= XFFONT_FLAG_NAME;
++
++ SetFontNameAsia(name);
++ SetFontNameComplex(name);
++}
++
++inline void XFFont::SetFontNameAsia(rtl::OUString name)
++{
++ m_strFontNameAsia = name;
++ m_nFlag |= XFFONT_FLAG_NAME_ASIA;
++}
++
++inline void XFFont::SetFontNameComplex(rtl::OUString name)
++{
++ m_strFontNameComplex = name;
++ m_nFlag |= XFFONT_FLAG_NAME_COMPLEX;
++}
++
++//
++inline void XFFont::SetFontSize(sal_Int16 size)
++{
++ m_nFontSize = size;
++ m_nFlag |= XFFONT_FLAG_SIZE;
++
++ SetFontSizeAsia(size);
++ SetFontSizeComplex(size);
++}
++
++inline void XFFont::SetFontSizeAsia(sal_Int16 size)
++{
++ m_nFontSizeAsia = size;
++ m_nFlag |= XFFONT_FLAG_SIZE_ASIA;
++}
++
++inline void XFFont::SetFontSizeComplex(sal_Int16 size)
++{
++ m_nFontSizeComplex = size;
++ m_nFlag |= XFFONT_FLAG_SIZE_COMPLEX;
++}
++
++//---------Italic:
++inline void XFFont::SetItalic(sal_Bool italic)
++{
++ m_bItalic = italic;
++ m_nFlag |= XFFONT_FLAG_ITALIC;
++
++ SetItalicAsia(italic);
++ SetItalicComplex(italic);
++}
++
++inline void XFFont::SetItalicAsia(sal_Bool italic)
++{
++ m_bItalicAsia = italic;
++ m_nFlag |= XFFONT_FLAG_ITALIC_ASIA;
++}
++
++inline void XFFont::SetItalicComplex(sal_Bool italic)
++{
++ m_bItalicComplex = italic;
++ m_nFlag |= XFFONT_FLAG_ITALIC_COMPLEX;
++}
++
++//--------Bold
++inline void XFFont::SetBold(sal_Bool bold)
++{
++ m_bBold = bold;
++ m_nFlag |= XFFONT_FLAG_BOLD;
++ SetBoldAsia(bold);
++ SetBoldComplex(bold);
++}
++
++inline void XFFont::SetBoldAsia(sal_Bool bold)
++{
++ m_bBoldAsia = bold;
++ m_nFlag |= XFFONT_FLAG_BOLD_ASIA;
++}
++
++inline void XFFont::SetBoldComplex(sal_Bool bold)
++{
++ m_bBoldComplex = bold;
++ m_nFlag |= XFFONT_FLAG_BOLD_COMPLEX;
++}
++
++//--------Underline:
++inline void XFFont::SetUnderline(enumXFUnderline underline, sal_Bool wordByWord)
++{
++ m_eUnderline = underline;
++ m_bWordByWord = wordByWord;
++ m_nFlag |= XFFONT_FLAG_UNDERLINE;
++}
++
++inline void XFFont::SetUnderlineColor(XFColor color)
++{
++ m_aUnderlineColor = color;
++ m_nFlag |= XFFONT_FLAG_UNDERLINECOLOR;
++}
++
++inline void XFFont::SetCrossout(enumXFCrossout cross, sal_Bool wordByWord)
++{
++ m_eCrossout = cross;
++ m_bWordByWord = wordByWord;
++ m_nFlag |= XFFONT_FLAG_CROSSOUT;
++}
++inline void XFFont::SetRelief(enumXFRelief relief)
++{
++ m_eRelief = relief;
++ m_nFlag |= XFFONT_FLAG_RELIEF;
++}
++inline void XFFont::SetTransform(enumXFTransform transform)
++{
++ m_eTransform = transform;
++ m_nFlag |= XFFONT_FLAG_TRANSFORM;
++}
++
++inline void XFFont::SetEmphasize(enumXFEmphasize emphasize, sal_Bool top)
++{
++ m_eEmphasize = emphasize;
++ m_bEmphasizeTop = top;
++ m_nFlag |= XFFONT_FLAG_EMPHASIZE;
++}
++inline void XFFont::SetOutline(sal_Bool outline)
++{
++ m_bOutline = outline;
++ m_nFlag |= XFFONT_FLAG_OUTLINE;
++}
++inline void XFFont::SetShadow(sal_Bool shadow)
++{
++ m_bShadow = shadow;
++ m_nFlag |= XFFONT_FLAG_SHADOW;
++}
++inline void XFFont::SetBlink(sal_Bool blink)
++{
++ m_bBlink = blink;
++ m_nFlag |= XFFONT_FLAG_BLINK;
++}
++
++inline void XFFont::SetPosition(sal_Bool bUpperScript, sal_Int16 pos, sal_Int16 scale)
++{
++ assert(pos>=0&&pos<=100);
++ assert(scale>0&&scale<=100);
++ m_nFlag |= XFFONT_FLAG_POSITION;
++ m_nPosition = pos;
++ m_nScale = scale;
++ if( bUpperScript )
++ {
++ if( m_nPosition <0 )
++ m_nPosition = -m_nPosition;
++ }
++ else
++ {
++ if( m_nPosition >0 )
++ m_nPosition = -m_nPosition;
++ }
++}
++
++inline void XFFont::SetCharSpace(sal_Int16 space)
++{
++ m_nFlag |= XFFONT_FLAG_CHARSPACE;
++ m_fCharSpace = space;
++}
++
++inline void XFFont::SetWidthScale(sal_Int16 widthScale)
++{
++ m_nFlag |= XFFONT_FLAG_WIDTHSCALE;
++ m_nWidthScale = widthScale;
++}
++
++inline void XFFont::SetColor(XFColor& color)
++{
++ m_nFlag |= XFFONT_FLAG_COLOR;
++ m_aColor = color;
++}
++
++inline void XFFont::SetBackColor(XFColor& color)
++{
++ m_bTransparent = sal_False;
++ m_nFlag |= XFFONT_FLAG_BGCOLOR;
++ m_aBackColor = color;
++}
++
++inline void XFFont::SetBackColorTransparent()
++{
++ m_bTransparent = sal_True;
++ m_nFlag |= XFFONT_FLAG_BGCOLOR;
++}
++
++inline enumXFTransform XFFont::GetTransform()
++{
++ return m_eTransform;
++}
++
++inline sal_Int16 XFFont::GetFontSize()
++{
++ return m_nFontSize;
++}
++
++inline XFColor XFFont::GetColor()
++{
++ return m_aColor;
++}
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffontworkstyle.hxx lotuswordpro/source/filter/xfilter/xffontworkstyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xffontworkstyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffontworkstyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,156 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Style of Fontwork object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-06-20 create this file.
++ ************************************************************************/
++ #ifndef _XFFONTWORKSTYLE_HXX
++ #define _XFFONTWORKSTYLE_HXX
++
++#include "xfstyle.hxx"
++
++class XFFontWorkStyle
++{
++public:
++ XFFontWorkStyle() :
++ m_nButtonForm(-1),
++ m_bHideForm(sal_True),
++ m_fDistance(-0.10),
++ m_eStyleType(enumXFFWOff),
++ m_eAdjustType(enumXFFWAdjustAutosize),
++ m_eShadowType(enumXFFWShadowNone)
++ {};
++
++ ~XFFontWorkStyle(){}
++
++ inline void SetButtonForm(sal_Int8 nIndex);
++ inline void SetHideForm(sal_Bool bHide);
++ inline void SetFWDistance(double fDist);
++ inline void SetFWStyleType(enumXFFWStyle eStyle);
++ inline void SetFWAdjustType(enumXFFWAdjust eAdjust);
++ inline void SetFWShadowType(enumXFFWShadow eShadow);
++
++ inline sal_Int8 GetButtonForm() const;
++ inline double GetFWDistance() const;
++ inline enumXFFWStyle GetStyleType() const;
++ inline enumXFFWAdjust GetAdjustType() const;
++ inline enumXFFWShadow GetShadowType() const;
++
++private:
++ sal_Int8 m_nButtonForm;
++ sal_Bool m_bHideForm;
++ double m_fDistance;
++ enumXFFWStyle m_eStyleType;
++ enumXFFWAdjust m_eAdjustType;
++ enumXFFWShadow m_eShadowType;
++};
++
++inline void XFFontWorkStyle::SetButtonForm(sal_Int8 nIndex)
++{
++ m_nButtonForm = nIndex;
++}
++
++inline void XFFontWorkStyle::SetHideForm(sal_Bool bHide)
++{
++ m_bHideForm = bHide;
++}
++
++inline void XFFontWorkStyle::SetFWDistance(double fDist)
++{
++ m_fDistance = fDist;
++}
++
++inline void XFFontWorkStyle::SetFWStyleType(enumXFFWStyle eStyle)
++{
++ m_eStyleType = eStyle;
++}
++
++inline void XFFontWorkStyle::SetFWAdjustType(enumXFFWAdjust eAdjust)
++{
++ m_eAdjustType = eAdjust;
++}
++
++inline void XFFontWorkStyle::SetFWShadowType(enumXFFWShadow eShadow)
++{
++ m_eShadowType = eShadow;
++}
++
++inline sal_Int8 XFFontWorkStyle::GetButtonForm() const
++{
++ return m_nButtonForm;
++}
++inline double XFFontWorkStyle::GetFWDistance() const
++{
++ return m_fDistance;
++}
++
++inline enumXFFWStyle XFFontWorkStyle::GetStyleType() const
++{
++ return m_eStyleType;
++}
++inline enumXFFWAdjust XFFontWorkStyle::GetAdjustType() const
++{
++ return m_eAdjustType;
++}
++inline enumXFFWShadow XFFontWorkStyle::GetShadowType() const
++{
++ return m_eShadowType;
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffooter.hxx lotuswordpro/source/filter/xfilter/xffooter.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xffooter.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffooter.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,90 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Footer object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-19 create this file.
++ * 2005-04-05 make it derive from XFContentContainer.
++ ************************************************************************/
++#ifndef _XFFOOTER_HXX
++#define _XFFOOTER_HXX
++
++#include "xfcontentcontainer.hxx"
++#include <vector>
++
++/**
++ * @descr Foot obejct. It's just a container.
++ */
++class XFFooter : public XFContentContainer
++{
++public:
++ XFFooter()
++ {
++ }
++ virtual void ToXml(IXFStream *pStrm)
++ {
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("style:footer") );
++ XFContentContainer::ToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("style:footer") );
++ }
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffooterstyle.hxx lotuswordpro/source/filter/xfilter/xffooterstyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xffooterstyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffooterstyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,126 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Footer style,exist in page-master object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-19 create this file.
++ * 2005-04-05 change to inherit from xfheaderstyle.
++ ************************************************************************/
++#ifndef _XFFOOTERSTYLE_HXX
++#define _XFFOOTERSTYLE_HXX
++
++#include "xfheaderstyle.hxx"
++#include "xfmargins.hxx"
++
++class XFFooterStyle : public XFHeaderStyle
++{
++public:
++ XFFooterStyle() : XFHeaderStyle(sal_True)
++ {
++ }
++
++ void SetMargins(double left = -1, double right = -1, double top = -1)
++ {
++ if( left != -1 )
++ m_aMargin.SetLeft(left);
++ if( right != -1 )
++ m_aMargin.SetRight(right);
++ if( top != -1 )
++ m_aMargin.SetTop(top);
++ }
++/*
++ void SetHeight(float height)
++ {
++ m_fHeight = height;
++ }
++
++ void SetDynamicSpace(sal_Bool dynamic)
++ {
++ m_bDynamicSpace = dynamic;
++ }
++ virtual void ToXml(IXFStream *pStrm)
++ {
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pStrm->StartElement( A2OUSTR("style:footer-style") );
++
++ if(m_fHeight!=-1)
++ {
++ pAttrList->AddAttribute( A2OUSTR("svg:height"), FloatToOUString(m_fHeight) + A2OUSTR("cm") );
++ }
++
++ m_aMargin.ToXml(pStrm);
++ if( m_bDynamicSpace )
++ pAttrList->AddAttribute( A2OUSTR("style:dynamic-spacing"), A2OUSTR("true") );
++ else
++ pAttrList->AddAttribute( A2OUSTR("style:dynamic-spacing"), A2OUSTR("false") );
++ pStrm->StartElement( A2OUSTR("style:properties") );
++ pStrm->EndElement( A2OUSTR("style:properties") );
++
++ pStrm->EndElement( A2OUSTR("style:footer-style") );
++ }
++
++private:
++ XFMargins m_aMargin;
++ sal_Bool m_bDynamicSpace;
++ float m_fHeight;
++ */
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffootnoteconfig.hxx lotuswordpro/source/filter/xfilter/xffootnoteconfig.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xffootnoteconfig.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffootnoteconfig.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,269 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Footnote config.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-03-29 create this file.
++ ************************************************************************/
++#ifndef _XFFOOTNOTECONFIG_HXX
++#define _XFFOOTNOTECONFIG_HXX
++
++#include "xfstyle.hxx"
++
++class XFFootnoteConfig : public XFStyle
++{
++public:
++ XFFootnoteConfig();
++
++public:
++ void SetBodyStyle(rtl::OUString style);
++
++ void SetCitationStyle(rtl::OUString style);
++
++ void SetDefaultStyle(rtl::OUString style);
++
++ void SetMasterPage(rtl::OUString masterPage);
++
++ void SetNumberFormat(rtl::OUString numberFormat);
++
++ void SetStartValue(sal_Int32 value=0);
++
++ void SetRestartOnPage();
++
++ void SetRestartOnChapter();
++
++ void SetInsertInPage(sal_Bool page=sal_True);
++
++ void SetNumPrefix(rtl::OUString numprefix);
++
++ void SetNumSuffix(rtl::OUString numsuffix);
++
++ void SetMessageOn(rtl::OUString message);
++
++ void SetMessageFrom(rtl::OUString message);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++protected:
++ rtl::OUString m_strBodyStyle;
++ rtl::OUString m_strCitationStyle;
++ rtl::OUString m_strDefaultStyle;
++ rtl::OUString m_strMasterPage;
++ rtl::OUString m_strNumFmt;
++ rtl::OUString m_strNumPrefix;
++ rtl::OUString m_strNumSuffix;
++ rtl::OUString m_strMessageFrom;
++ rtl::OUString m_strMessageOn;
++ sal_Int32 m_nStartValue;
++ sal_Int32 m_nRestartType;
++ sal_Bool m_bInsertInPage;
++ sal_Bool m_bIsFootnote;
++};
++
++inline XFFootnoteConfig::XFFootnoteConfig()
++{
++ m_nStartValue = 0;
++ m_nRestartType = -1;
++ m_strNumFmt = A2OUSTR("1");
++ m_bInsertInPage = sal_True;
++ m_strDefaultStyle = A2OUSTR("Footnote");
++ m_strMasterPage = A2OUSTR("Footnote");
++ m_strCitationStyle = A2OUSTR("Footnote Symbol");
++ m_strBodyStyle = A2OUSTR("Footnote anchor");
++ m_bIsFootnote = sal_True;
++}
++
++inline void XFFootnoteConfig::SetBodyStyle(rtl::OUString style)
++{
++ m_strBodyStyle = style;
++}
++
++inline void XFFootnoteConfig::SetCitationStyle(rtl::OUString style)
++{
++ m_strCitationStyle = style;
++}
++
++inline void XFFootnoteConfig::SetDefaultStyle(rtl::OUString style)
++{
++ m_strDefaultStyle = style;
++}
++
++inline void XFFootnoteConfig::SetMasterPage(rtl::OUString masterPage)
++{
++ m_strMasterPage = masterPage;
++}
++
++inline void XFFootnoteConfig::SetNumberFormat(rtl::OUString numberFormat)
++{
++ m_strNumFmt = numberFormat;
++}
++
++inline void XFFootnoteConfig::SetStartValue(sal_Int32 value)
++{
++ if( value<0 )
++ return;
++ m_nStartValue = value;
++}
++
++inline void XFFootnoteConfig::SetRestartOnPage()
++{
++ m_nRestartType = 0;
++}
++
++inline void XFFootnoteConfig::SetRestartOnChapter()
++{
++ m_nRestartType = 1;
++}
++
++inline void XFFootnoteConfig::SetInsertInPage(sal_Bool page)
++{
++ m_bInsertInPage = page;
++}
++
++inline void XFFootnoteConfig::SetNumPrefix(rtl::OUString numprefix)
++{
++ m_strNumPrefix = numprefix;
++}
++
++inline void XFFootnoteConfig::SetNumSuffix(rtl::OUString numsuffix)
++{
++ m_strNumSuffix = numsuffix;
++}
++
++inline void XFFootnoteConfig::SetMessageOn(rtl::OUString message)
++{
++ m_strMessageOn = message;
++}
++
++inline void XFFootnoteConfig::SetMessageFrom(rtl::OUString message)
++{
++ m_strMessageFrom = message;
++}
++
++inline void XFFootnoteConfig::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ if( m_strCitationStyle.getLength()>0 )
++ pAttrList->AddAttribute( A2OUSTR("text:citation-style-name"), m_strCitationStyle);
++
++ if( m_strBodyStyle.getLength()>0 )
++ pAttrList->AddAttribute( A2OUSTR("text:citation-body-style-name"), m_strBodyStyle);
++
++ if( m_strNumPrefix.getLength()>0 )
++ pAttrList->AddAttribute( A2OUSTR("style:num-prefix"), m_strNumPrefix);
++
++ if( m_strNumSuffix.getLength()>0 )
++ pAttrList->AddAttribute( A2OUSTR("style:num-suffix"), m_strNumSuffix);
++
++ if( m_strNumFmt.getLength()>0 )
++ pAttrList->AddAttribute( A2OUSTR("style:num-format"), m_strNumFmt);
++
++ if( m_strDefaultStyle.getLength()>0 )
++ pAttrList->AddAttribute( A2OUSTR("text:default-style-name"), m_strDefaultStyle);
++
++ if( m_strMasterPage.getLength()>0 )
++ pAttrList->AddAttribute( A2OUSTR("text:master-page-name"), m_strMasterPage);
++
++
++ pAttrList->AddAttribute( A2OUSTR("text:start-value"), Int32ToOUString(m_nStartValue) );
++
++ if( m_bIsFootnote )
++ {
++ if( m_nRestartType == -1 )
++ pAttrList->AddAttribute( A2OUSTR("text:start-numbering-at"), A2OUSTR("document") );
++ else if( m_nRestartType == 0 )
++ pAttrList->AddAttribute( A2OUSTR("text:start-numbering-at"), A2OUSTR("page") );
++ else if( m_nRestartType == 1 )
++ pAttrList->AddAttribute( A2OUSTR("text:start-numbering-at"), A2OUSTR("chapter") );
++
++ if( m_bInsertInPage )
++ pAttrList->AddAttribute( A2OUSTR("text:footnotes-position"), A2OUSTR("page") );
++ else
++ pAttrList->AddAttribute( A2OUSTR("text:footnotes-position"), A2OUSTR("document") );
++ }
++
++ if(m_bIsFootnote)
++ {
++ pStrm->StartElement( A2OUSTR("text:footnotes-configuration") );
++ if( m_strMessageOn.getLength()>0 )
++ {
++ pStrm->StartElement( A2OUSTR("text:footnote-continuation-notice-forward") );
++ pStrm->Characters(m_strMessageOn);
++ pStrm->EndElement( A2OUSTR("text:footnote-continuation-notice-forward") );
++ }
++
++ if( m_strMessageFrom.getLength()>0 )
++ {
++ pStrm->StartElement( A2OUSTR("text:footnote-continuation-notice-backward") );
++ pStrm->Characters(m_strMessageFrom);
++ pStrm->EndElement( A2OUSTR("text:footnote-continuation-notice-backward") );
++ }
++
++ pStrm->EndElement( A2OUSTR("text:footnotes-configuration") );
++ }
++ else
++ {
++ pStrm->StartElement( A2OUSTR("text:endnotes-configuration") );
++ pStrm->EndElement( A2OUSTR("text:endnotes-configuration") );
++ }
++
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xffootnote.hxx lotuswordpro/source/filter/xfilter/xffootnote.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xffootnote.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xffootnote.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,128 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Foot note object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-1-31 create this file.
++ ************************************************************************/
++#ifndef _XFFOOTNOTE_HXX
++#define _XFFOOTNOTE_HXX
++
++#include "xfglobal.hxx"
++#include "xfcontent.hxx"
++#include "xfcontentcontainer.hxx"
++
++/**
++ * @brief
++ * Foot note object.
++ * Foot note has a lable, which is used in page content, and footnote contents in the footnote section.
++ */
++class XFFootNote : public XFContentContainer
++{
++public:
++ XFFootNote();
++
++public:
++ void SetLabel(sal_Unicode label);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ rtl::OUString m_strID;
++ rtl::OUString m_strLabel;
++};
++
++inline XFFootNote::XFFootNote()
++{
++ m_strID = XFGlobal::GenNoteName();
++}
++
++inline void XFFootNote::SetLabel(sal_Unicode label)
++{
++ sal_Unicode chs[2];
++ chs[0] = label;
++ chs[1] = 0;
++
++ m_strLabel = rtl::OUString(chs);
++}
++
++inline void XFFootNote::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute( A2OUSTR("text:id"), m_strID );
++ pStrm->StartElement( A2OUSTR("text:footnote") );
++
++ pAttrList->Clear();
++ if( m_strLabel.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("text:label"), m_strLabel );
++ pStrm->StartElement( A2OUSTR("text:footnote-citation") );
++ if( m_strLabel.getLength() )
++ pStrm->Characters(m_strLabel);
++ pStrm->EndElement( A2OUSTR("text:footnote-citation") );
++
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("text:footnote-body") );
++ XFContentContainer::ToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("text:footnote-body") );
++
++ pStrm->EndElement( A2OUSTR("text:footnote") );
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfframe.cxx lotuswordpro/source/filter/xfilter/xfframe.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfframe.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfframe.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,208 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Frame whose anchor is not page.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-21 create this file.
++ ************************************************************************/
++#include "xfframe.hxx"
++#include "xfparagraph.hxx"
++#define ZINDEX_MAX 0x7fffffff
++#define ZINDEX_MIN 0
++XFFrame::XFFrame()
++{
++ m_isTextBox = sal_False;
++ m_eAnchor = enumXFAnchorPara;
++ m_nAnchorPage = 0;
++ m_nZIndex = ZINDEX_MIN;
++ //give it a default name:
++ m_strName = XFGlobal::GenFrameName();
++ m_fMinHeight = 0;
++ m_fMaxHeight = 0;
++ m_nFlag = 0;
++ m_eType = enumXFFrameTextbox;
++}
++XFFrame::XFFrame(sal_Bool isTextBox):m_isTextBox(isTextBox)
++{
++ m_eAnchor = enumXFAnchorPara;
++ m_nAnchorPage = 0;
++ m_nZIndex = ZINDEX_MIN;
++ //give it a default name:
++ m_strName = XFGlobal::GenFrameName();
++ m_fMinHeight = 0;
++ m_fMaxHeight = 0;
++ m_nFlag = 0;
++ m_eType = enumXFFrameTextbox;
++}
++
++XFFrame::~XFFrame()
++{
++}
++
++void XFFrame::Add(IXFContent *pContent)
++{
++ XFContentContainer::Add(pContent);
++ if( pContent->GetContentType() == enumXFContentFrame )
++ {
++ XFFrame *pFrame = (XFFrame*)pContent;
++ if( pFrame )
++ {
++ pFrame->SetZIndex(pFrame->m_nZIndex + 1);
++ }
++ }
++
++}
++
++void XFFrame::SetZIndex(sal_Int32 zIndex)
++{
++ if( zIndex == m_nZIndex )
++ return;
++ m_nZIndex = zIndex;
++ AdjustZIndex();
++}
++
++enumXFFrameType XFFrame::GetFrameType()
++{
++ return m_eType;
++}
++
++enumXFContent XFFrame::GetContentType()
++{
++ return enumXFContentFrame;
++}
++
++void XFFrame::ToXml(IXFStream *pStrm)
++{
++ StartFrame(pStrm);
++
++ XFContentContainer::ToXml(pStrm);
++
++ EndFrame(pStrm);
++}
++
++void XFFrame::StartFrame(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ if( GetStyleName().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("draw:style-name"), GetStyleName() );
++
++ assert(m_strName.getLength()>0); //name should not be null.
++ if( m_strName.getLength()&&m_isTextBox == sal_False)
++ pAttrList->AddAttribute( A2OUSTR("draw:name"), m_strName );
++ //anchor type:
++ switch( m_eAnchor )
++ {
++ case enumXFAnchorPara:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("paragraph") );
++ break;
++ case enumXFAnchorPage:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("page") );
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-page-number"), Int32ToOUString(m_nAnchorPage) );
++ break;
++ case enumXFAnchorChar:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("char") );
++ break;
++ case enumXFAnchorAsChar:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("as-char") );
++ break;
++ case enumXFAnchorFrame:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("frame") );
++ break;
++ }
++ pAttrList->AddAttribute( A2OUSTR("svg:x"), DoubleToOUString(m_aRect.GetX()) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("svg:y"), DoubleToOUString(m_aRect.GetY()) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("svg:width"), DoubleToOUString(m_aRect.GetWidth()) + A2OUSTR("cm") );
++ if( m_nFlag& XFFRAME_FLAG_MINHEIGHT )
++ {
++ pAttrList->AddAttribute( A2OUSTR("fo:min-height"), DoubleToOUString(m_fMinHeight) + A2OUSTR("cm") );
++ if( m_nFlag&XFFRAME_FLAG_MAXHEIGHT )
++ pAttrList->AddAttribute( A2OUSTR("fo:max-height"), DoubleToOUString(m_fMaxHeight) + A2OUSTR("cm") );
++ }
++ else
++ pAttrList->AddAttribute( A2OUSTR("svg:height"), DoubleToOUString(m_aRect.GetHeight()) + A2OUSTR("cm") );
++
++ pAttrList->AddAttribute( A2OUSTR("draw:z-index"), Int32ToOUString(m_nZIndex) );
++
++ if( m_strNextLink.getLength() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("draw:chain-next-name"), m_strNextLink );
++
++ pStrm->StartElement( A2OUSTR("draw:text-box") );
++}
++
++void XFFrame::EndFrame(IXFStream *pStrm)
++{
++ pStrm->EndElement( A2OUSTR("draw:text-box") );
++}
++
++void XFFrame::AdjustZIndex()
++{
++ for( int i=0; i<GetCount(); i++ )
++ {
++ IXFContent *pContent = GetContent(i);
++ if( pContent )
++ {
++ if( pContent->GetContentType() == enumXFContentFrame )
++ {
++ XFFrame *pFrame = (XFFrame*)pContent;
++ pFrame->m_nZIndex = m_nZIndex + 1;
++ pFrame->AdjustZIndex();
++ }
++ }
++ }
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfframe.hxx lotuswordpro/source/filter/xfilter/xfframe.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfframe.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfframe.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,265 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Frame object for OOo.This is the basic object for all Shape Layer.
++ * You can reference to the XFFrame object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-10 create and implements.
++ ************************************************************************/
++#ifndef _XFFRAME_HXX
++#define _XFFRAME_HXX
++
++#include "xfglobal.hxx"
++#include "xfcontent.hxx"
++#include "xfrect.hxx"
++#include "xfcontentcontainer.hxx"
++
++#define XFFRAME_FLAG_HEIGHT 0x00000001
++#define XFFRAME_FLAG_MINHEIGHT 0x00000002
++#define XFFRAME_FLAG_MAXHEIGHT 0x00000004
++/**
++ * @brief
++ * Base class for all frame object,include drawing,image,text-box.
++ *
++ * Use SetX(),SetY(),SetWidth(),SetHeight() to set postion for the frame.
++ * Only if you set anchor type to enumXFAnchorPage, the SetAnchorPage functions.
++ */
++class XFFrame : public XFContentContainer
++{
++public:
++ XFFrame();
++ XFFrame(sal_Bool isTextBox);
++
++ virtual ~XFFrame();
++
++public:
++ /**
++ * @descr override the add function to adjust z-index.
++ */
++ virtual void Add(IXFContent *pContent);
++
++ /**
++ * @descr: Set the anchor type for the frame object.
++ */
++ void SetAnchorType(enumXFAnchor type);
++
++ /**
++ * @descr: if it's page anchor,set the page number.
++ */
++ void SetAnchorPage(sal_Int32 page);
++
++ /**
++ * @descr Set frame name.
++ */
++ void SetName(rtl::OUString name);
++
++ /**
++ * @descr Set z-index of the frame.
++ */
++ void SetZIndex(sal_Int32 zIndex);
++ /**
++ * @descr Set frame position X.
++ */
++ void SetX(double x);
++
++ /**
++ * @descr Set frame position Y.
++ */
++ void SetY(double y);
++
++ /**
++ * @descr Set frame wieth.
++ */
++ void SetWidth(double width);
++
++ /**
++ * @descr Set frame height. Be careful SetHeight and SetMinHeight will override each other.
++ */
++ void SetHeight(double height);
++
++ /**
++ * @descr Set frame min-height. Be careful SetHeight and SetMinHeight will override each other.
++ */
++ void SetMinHeight(double minHeight);
++
++ /**
++ * @descr Set frame max-height.
++ */
++ void SetMaxHeight(double minHeight);
++
++ /**
++ * @descr Set frame position.
++ */
++ void SetPosition(double x, double y, double width, double height);
++
++ /**
++ * @descr Set frame position.
++ */
++ void SetPosition(const XFRect& rect);
++
++ /**
++ * @descr: Link the text content of the two frame.
++ */
++ void SetNextLink(rtl::OUString next);
++
++ /**
++ * @descr Get the frame type. image, drawing or text-box.
++ */
++ virtual enumXFFrameType GetFrameType();
++
++ /**
++ * @descr Get content type, enumXFContentFrame.
++ */
++ virtual enumXFContent GetContentType();
++
++ /**
++ * @descr serialize.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ void StartFrame(IXFStream *pStrm);
++
++ void EndFrame(IXFStream *pStrm);
++
++ void AdjustZIndex();
++
++protected:
++ enumXFAnchor m_eAnchor;
++ sal_Int32 m_nAnchorPage;
++ rtl::OUString m_strName;
++ sal_uInt32 m_nZIndex;
++ XFRect m_aRect;
++ double m_fMinHeight;
++ double m_fMaxHeight;
++ rtl::OUString m_strNextLink;
++ enumXFFrameType m_eType;
++ sal_uInt32 m_nFlag;
++ sal_Bool m_isTextBox;
++};
++
++inline void XFFrame::SetAnchorType(enumXFAnchor anchor)
++{
++ m_eAnchor = anchor;
++}
++
++inline void XFFrame::SetName(rtl::OUString name)
++{
++ m_strName = name;
++}
++
++inline void XFFrame::SetX(double x)
++{
++ m_aRect.SetX(x);
++}
++
++inline void XFFrame::SetY(double y)
++{
++ m_aRect.SetY(y);
++}
++
++inline void XFFrame::SetWidth(double width)
++{
++ m_aRect.SetWidth(width);
++}
++
++inline void XFFrame::SetHeight(double height)
++{
++ m_aRect.SetHeight(height);
++ m_nFlag |= XFFRAME_FLAG_HEIGHT;
++ m_nFlag &= XFFRAME_FLAG_HEIGHT;
++}
++
++inline void XFFrame::SetMinHeight(double minHeight)
++{
++ m_fMinHeight = minHeight;
++ m_nFlag |= XFFRAME_FLAG_MINHEIGHT;
++ m_nFlag &= XFFRAME_FLAG_MINHEIGHT;
++}
++
++inline void XFFrame::SetMaxHeight(double maxHeight)
++{
++ m_fMaxHeight = maxHeight;
++ m_nFlag |= XFFRAME_FLAG_MAXHEIGHT;
++ m_nFlag &= XFFRAME_FLAG_MAXHEIGHT;
++}
++
++inline void XFFrame::SetPosition(double x, double y, double width, double height)
++{
++ m_aRect.SetStartPoint(XFPoint(x,y));
++ m_aRect.SetSize(width,height);
++ m_nFlag |= XFFRAME_FLAG_HEIGHT;
++}
++
++inline void XFFrame::SetPosition(const XFRect& rect)
++{
++ m_aRect = rect;
++}
++
++inline void XFFrame::SetNextLink(rtl::OUString next)
++{
++ m_strNextLink = next;
++}
++
++inline void XFFrame::SetAnchorPage(sal_Int32 page)
++{
++ m_nAnchorPage = page;
++}
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfframestyle.cxx lotuswordpro/source/filter/xfilter/xfframestyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfframestyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfframestyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,238 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Frame style include position,size,rotation and so on.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-17 create this file.
++ ************************************************************************/
++#include "xfframestyle.hxx"
++#include "xfcolumns.hxx"
++#include "xfborders.hxx"
++#include "xfshadow.hxx"
++#include "xfbgimage.hxx"
++
++XFFrameStyle::XFFrameStyle()
++{
++ m_eWrap = enumXFWrapNone;
++ m_nWrapLines = 0; //not limited.
++ m_pBorders = NULL;
++ m_pColumns = NULL;
++ m_pShadow = NULL;
++ m_pBGImage = NULL;
++
++ m_bProtectContent = sal_False;
++ m_bProtectSize = sal_False;
++ m_bProtectPos = sal_False;
++ m_bEditable = sal_False;
++ m_bPrintable = sal_True;
++ m_bBackground = sal_False;
++ m_nTransparency = 0;
++
++ m_eTextDir = enumXFTextDirNone;
++ m_eXPos = enumXFFrameXPosCenter;
++ m_eXRel = enumXFFrameXRelParaContent;
++ m_eYPos = enumXFFrameYPosTop;
++ m_eYRel = enumXFFrameYRelPage;
++}
++
++XFFrameStyle::~XFFrameStyle()
++{
++ if( m_pBorders )
++ delete m_pBorders;
++ if( m_pColumns )
++ delete m_pColumns;
++ if( m_pShadow )
++ delete m_pShadow;
++ if( m_pBGImage )
++ delete m_pBGImage;
++}
++
++void XFFrameStyle::SetBorders(XFBorders *pBorders)
++{
++ if( m_pBorders )
++ delete m_pBorders;
++ m_pBorders = pBorders;
++}
++
++void XFFrameStyle::SetColumns(XFColumns *pColumns)
++{
++ if( m_pColumns )
++ delete m_pColumns;
++ m_pColumns = pColumns;
++}
++
++void XFFrameStyle::SetShadow(XFShadow *pShadow)
++{
++ if( m_pShadow )
++ delete m_pShadow;
++ m_pShadow = pShadow;
++}
++
++void XFFrameStyle::SetBackImage(XFBGImage *image)
++{
++ if( m_pBGImage )
++ delete m_pBGImage;
++ m_pBGImage = image;
++}
++
++enumXFStyle XFFrameStyle::GetStyleFamily()
++{
++ return enumXFStyleGraphics;
++}
++
++void XFFrameStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
++ if( GetParentStyleName().getLength() > 0 )
++ pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
++ pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("graphics") );
++ //parent style name ignore now.
++ pStrm->StartElement( A2OUSTR("style:style") );
++
++ m_aMargins.ToXml(pStrm);
++
++ pAttrList->Clear();
++
++ /*if( m_eWrap == enumXFWrapBackground )
++ {
++ pAttrList->AddAttribute( A2OUSTR("style:run-through"), A2OUSTR("background") );
++ }
++ else
++ {*/
++ if( m_bBackground)
++ pAttrList->AddAttribute( A2OUSTR("style:run-through"), A2OUSTR("background") );
++ else
++ pAttrList->AddAttribute( A2OUSTR("style:run-through"), A2OUSTR("foreground") );
++
++ if( m_eWrap == enumXFWrapNone )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("none") );
++ else if( m_eWrap == enumXFWrapLeft )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("left") );
++ else if( m_eWrap == enumXFWrapRight )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("right") );
++ else if( m_eWrap == enumXFWrapParallel )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("parallel") );
++ else if( m_eWrap == enumXFWrapRunThrough )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("run-through") );
++ else if( m_eWrap == enumXFWrapBest )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("dynamic") );
++ //}
++ //background
++ if( m_aBackColor.IsValid() )
++ {
++ pAttrList->AddAttribute( A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
++ pAttrList->AddAttribute( A2OUSTR("style:background-transparency"), Int16ToOUString(m_nTransparency) + A2OUSTR("%"));
++ }
++
++ //pad
++ m_aPad.ToXml(pStrm);
++ //margin:
++ m_aMargins.ToXml(pStrm);
++ //border
++ if( m_pBorders )
++ m_pBorders->ToXml(pStrm);
++ else
++ pAttrList->AddAttribute( A2OUSTR("fo:border"), A2OUSTR("none") );
++ //shadow
++ if( m_pShadow )
++ m_pShadow->ToXml(pStrm);
++ //print
++ if( m_bPrintable )
++ pAttrList->AddAttribute( A2OUSTR("style:print-content"), A2OUSTR("true") );
++ //text directory
++ if( m_eTextDir != enumXFTextDirNone )
++ pAttrList->AddAttribute( A2OUSTR("style:writing-mode"), GetTextDirName(m_eTextDir) );
++ //protect:
++ if( m_bProtectContent || m_bProtectSize || m_bProtectPos )
++ {
++ rtl::OUString protect;
++ if( m_bProtectContent )
++ protect += A2OUSTR("content");
++ if( m_bProtectSize )
++ {
++ if( protect.getLength()>0 )
++ protect += A2OUSTR(" ");
++ protect += A2OUSTR("size");
++ }
++ if( m_bProtectPos )
++ {
++ if( protect.getLength()>0 )
++ protect += A2OUSTR(" ");
++ protect += A2OUSTR("position");
++ }
++ pAttrList->AddAttribute( A2OUSTR("style:protect"), protect );
++ }
++ //vertical pos and horizon pos:
++ pAttrList->AddAttribute( A2OUSTR("style:vertical-pos"), GetFrameYPos(m_eYPos) );
++ pAttrList->AddAttribute( A2OUSTR("style:vertical-rel"), GetFrameYRel(m_eYRel) );
++ pAttrList->AddAttribute( A2OUSTR("style:horizontal-pos"), GetFrameXPos(m_eXPos) );
++ pAttrList->AddAttribute( A2OUSTR("style:horizontal-rel"), GetFrameXRel(m_eXRel) );
++
++ //
++ pStrm->StartElement( A2OUSTR("style:properties") );
++ if( m_pColumns )
++ m_pColumns->ToXml(pStrm);
++ if( m_pBGImage )
++ m_pBGImage->ToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("style:properties") );
++
++ pStrm->EndElement( A2OUSTR("style:style") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfframestyle.hxx lotuswordpro/source/filter/xfilter/xfframestyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfframestyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfframestyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,254 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Frame object style for OOo.
++ * You can reference to the XFFrame object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-10 create and implements.
++ ************************************************************************/
++#ifndef _XFFRAMESTYLE_HXX
++#define _XFFRAMESTYLE_HXX
++
++#include "xfglobal.hxx"
++#include "xfstyle.hxx"
++#include "xfmargins.hxx"
++#include "xfcolor.hxx"
++#include "xfpadding.hxx"
++
++class XFBorders;
++class XFColumns;
++class XFShadow;
++class XFBGImage;
++
++/**
++ * @brief
++ * Style for all frame obejcts.
++ */
++class XFFrameStyle : public XFStyle
++{
++public:
++ XFFrameStyle();
++
++ virtual ~XFFrameStyle();
++
++public:
++ void SetWrapType(enumXFWrap wrap, sal_Int32 nParagraphs = 0);
++
++ /**
++ * @descr: space between frame and paragraph text.
++ */
++ void SetMargins(double left, double right=-1,double top=-1, double bottom=-1);
++
++ /**
++ * @descr: space between frame and text inside frame.
++ */
++ void SetPadding(double left, double right=-1,double top=-1, double bottom=-1);
++
++ /**
++ * @descr: set the border property of the frame.
++ */
++ void SetBorders(XFBorders *pBorders);
++
++ /**
++ * @descr: set the column property of the frame.
++ */
++ void SetColumns(XFColumns *pColumns);
++
++ /**
++ * @descr: set the shadow object the frame.
++ */
++ void SetShadow(XFShadow *pShadow);
++
++ /**
++ * @descr: set the background image of the frame.
++ */
++ void SetBackImage(XFBGImage *iamge);
++
++ /**
++ * @descr: set the background color of the frame.
++ */
++ void SetBackColor(XFColor& color);
++
++ /**
++ * @descr Set whether frame is protected. There are three properties that can be protected, content,size and position.
++ */
++ void SetProtect(sal_Bool content, sal_Bool size, sal_Bool pos);
++
++ /**
++ * @descr Set text dir.
++ */
++ void SetTextDir(enumXFTextDir dir);
++
++ /**
++ * @descr Set horizontal position type.
++ */
++ void SetXPosType(enumXFFrameXPos pos, enumXFFrameXRel rel);
++
++ /**
++ * @descr Set vertical position type.
++ */
++ void SetYPosType(enumXFFrameYPos pos, enumXFFrameYRel rel);
++
++ /**
++ * @descr Set frame background.
++ */
++ void SetBackGround(sal_Bool bBackground);
++
++ void SetTransparency(sal_Int16 nTransparency);
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++protected:
++ enumXFWrap m_eWrap;
++ sal_Int32 m_nWrapLines;
++ XFPadding m_aPad;
++ XFMargins m_aMargins;
++ XFBorders *m_pBorders;
++ XFColumns *m_pColumns;
++ XFShadow *m_pShadow;
++ XFBGImage *m_pBGImage;
++ XFColor m_aBackColor;
++ sal_Bool m_bProtectContent;
++ sal_Bool m_bProtectSize;
++ sal_Bool m_bProtectPos;
++ sal_Bool m_bEditable;
++ sal_Bool m_bPrintable;
++ sal_Bool m_bBackground;
++ sal_Int16 m_nTransparency;
++
++ enumXFTextDir m_eTextDir;
++ enumXFFrameXPos m_eXPos;
++ enumXFFrameXRel m_eXRel;
++ enumXFFrameYPos m_eYPos;
++ enumXFFrameYRel m_eYRel;
++};
++
++inline void XFFrameStyle::SetWrapType(enumXFWrap wrap, sal_Int32 nParagraphs)
++{
++ m_eWrap = wrap;
++}
++
++inline void XFFrameStyle::SetMargins(double left, double right,double top, double bottom)
++{
++ if( left != -1 )
++ m_aMargins.SetLeft(left);
++ if( right != -1 )
++ m_aMargins.SetRight(right);
++ if( top != -1 )
++ m_aMargins.SetTop(top);
++ if( bottom != -1 )
++ m_aMargins.SetBottom( bottom );
++}
++
++inline void XFFrameStyle::SetPadding(double left, double right,double top, double bottom)
++{
++ if( left != -1 )
++ m_aPad.SetLeft(left);
++ if( right != -1 )
++ m_aPad.SetRight(right);
++ if( top != -1 )
++ m_aPad.SetTop(top);
++ if( bottom != -1 )
++ m_aPad.SetBottom( bottom );
++}
++
++inline void XFFrameStyle::SetBackColor(XFColor& color)
++{
++ m_aBackColor = color;
++}
++
++inline void XFFrameStyle::SetTextDir(enumXFTextDir dir)
++{
++ m_eTextDir = dir;
++}
++
++inline void XFFrameStyle::SetProtect(sal_Bool content, sal_Bool size, sal_Bool pos)
++{
++ m_bProtectContent = content;
++ m_bProtectSize = size;
++ m_bProtectPos = pos;
++}
++
++inline void XFFrameStyle::SetXPosType(enumXFFrameXPos pos, enumXFFrameXRel rel)
++{
++ m_eXPos = pos;
++ m_eXRel = rel;
++}
++
++inline void XFFrameStyle::SetYPosType(enumXFFrameYPos pos, enumXFFrameYRel rel)
++{
++ m_eYPos = pos;
++ m_eYRel = rel;
++}
++
++inline void XFFrameStyle::SetBackGround(sal_Bool bBackground)
++{
++ m_bBackground = bBackground;
++}
++
++inline void XFFrameStyle::SetTransparency(sal_Int16 nTransparency)
++{
++ m_nTransparency = nTransparency;
++}
++
++#endif
++
++
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfframetable.hxx lotuswordpro/source/filter/xfilter/xfframetable.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfframetable.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfframetable.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,91 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Table object exist in a frame.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-04-4 create and implements.
++ ************************************************************************/
++#ifndef _XFFRAMETABLE_HXX
++#define _XFFRAMETABLE_HXX
++
++#include "xftable.hxx"
++#include "xfframe.hxx"
++
++class XFFrameTable : public XFTable
++{
++public:
++ void SetFrameStyle(rtl::OUString style);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ rtl::OUString m_strFrameStyle;
++};
++
++inline void XFFrameTable::ToXml(IXFStream *pStrm)
++{
++ XFFrame *pFrame = new XFFrame();
++ pFrame->SetStyleName(m_strFrameStyle);
++ pFrame->Add(this);
++ pFrame->ToXml(pStrm);
++
++ delete pFrame;
++}
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfglobal.cxx lotuswordpro/source/filter/xfilter/xfglobal.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfglobal.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfglobal.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,146 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Global functions or include files that are needed.
++ * It's all for the full filter.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#include "xfglobal.hxx"
++#include "xffontfactory.hxx"
++#include "xfstylemanager.hxx"
++
++int XFGlobal::s_nFrameID = 1;
++int XFGlobal::s_nGraphID = 1;
++int XFGlobal::s_nSectionID = 1;
++int XFGlobal::s_nTableID = 1;
++int XFGlobal::s_nNoteID = 1;
++int XFGlobal::s_nStrokeDashID = 1;
++int XFGlobal::s_nAreaID = 1;
++
++//For chart object, /2005/2
++int XFGlobal::s_nObjID = 1;
++
++int XFGlobal::s_nImageID = 1;
++
++rtl::OUString XFGlobal::GenSectionName()
++{
++ //give it a initial name:
++ return A2OUSTR("sect") + Int32ToOUString(s_nSectionID++);
++}
++
++rtl::OUString XFGlobal::GenFrameName()
++{
++ //give it a initial name:
++ return A2OUSTR("frame") + Int32ToOUString(s_nFrameID++);
++}
++
++rtl::OUString XFGlobal::GenGraphName()
++{
++ return A2OUSTR("gr") + Int32ToOUString(s_nGraphID++);
++}
++
++//For chart object, /2005/2
++rtl::OUString XFGlobal::GenObjName()
++{
++ return A2OUSTR("Object") + Int32ToOUString(s_nObjID++);
++}
++
++rtl::OUString XFGlobal::GenTableName()
++{
++ return A2OUSTR("table") + Int32ToOUString(s_nFrameID++);
++}
++
++rtl::OUString XFGlobal::GenNoteName()
++{
++ return A2OUSTR("ftn") + Int32ToOUString(s_nNoteID++);
++}
++
++rtl::OUString XFGlobal::GenStrokeDashName()
++{
++ return A2OUSTR("stroke dash ") + Int32ToOUString(s_nStrokeDashID++);
++}
++
++rtl::OUString XFGlobal::GenAreaName()
++{
++ return A2OUSTR("draw area") + Int32ToOUString(s_nAreaID++);
++}
++
++rtl::OUString XFGlobal::GenImageName()
++{
++ return A2OUSTR("Graphic") + Int32ToOUString(s_nImageID++);
++}
++
++void XFGlobal::Reset()
++{
++ s_nSectionID = 1;
++ s_nFrameID = 1;
++ s_nTableID = 1;
++ s_nNoteID = 1;
++ s_nStrokeDashID = 1;
++ s_nAreaID = 1;
++ s_nObjID = 1;
++}
++
++void XFGlobalReset()
++{
++// XFFontFactory::Reset();
++// XFStyleManager::Reset();
++ XFGlobal::Reset();
++}
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfglobal.hxx lotuswordpro/source/filter/xfilter/xfglobal.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfglobal.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfglobal.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,178 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Global functions or include files that are needed.
++ * It's all for the full filter.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef _GLOBAL_HXX
++#define _GLOBAL_HXX
++
++#include <cassert>
++
++#ifndef _SAL_TYPES_H
++#include "sal/types.h"
++#endif
++
++#ifndef _RTL_USTRING_HXX_
++#include <rtl/ustring.hxx>
++#endif
++
++#ifndef _IXFOBJECT_HXX
++#include "ixfobject.hxx"
++#endif
++
++#ifndef _IXFSTREAM_HXX
++#include "ixfstream.hxx"
++#endif
++
++#ifndef _IXFATTRLIST_HXX
++#include "ixfattrlist.hxx"
++#endif
++
++#ifndef _XFUTIL_HXX
++#include "xfutil.hxx"
++#endif
++
++#ifndef _XFDEFS_HXX
++#include "xfdefs.hxx"
++#endif
++
++#define PI 3.1415926
++#define FLOAT_MIN 0.001
++#define MAX2(a,b) (((a) > (b)) ? (a) : (b))
++#define MAX3(a,b,c) MAX2(a,MAX2(b,c))
++#define MIN2(a,b) (((a) < (b)) ? (a) : (b))
++#define MIN3(a,b,c) MIN2(a,MIN2(b,c))
++#define FABS(f) (f>0?f:-f)
++
++void XFGlobalReset();
++
++/**
++ * @brief
++ * Global object, it manages all global variables for the full filter.
++ * Before loading a file, we'll need to reset all global variables.
++ * XFGlobal::Reset can do this for you.
++ */
++class XFGlobal
++{
++public:
++ /**
++ * @descr Generate a name for the section.
++ */
++ static rtl::OUString GenSectionName();
++
++ /**
++ * @descr Gen a name for the frame.
++ */
++ static rtl::OUString GenFrameName();
++
++ /**
++ * @descr Generate a name for graphics.
++ */
++ static rtl::OUString GenGraphName();
++
++ /**
++ * @descr Generate a name for a table.
++ */
++ static rtl::OUString GenTableName();
++
++ /**
++ * @descr Generate a name for a note.
++ */
++ static rtl::OUString GenNoteName();
++
++ /**
++ * @descr Generate a name for the stroke style.
++ */
++ static rtl::OUString GenStrokeDashName();
++
++ /**
++ * @descr Generate a name for the area fill style.
++ */
++ static rtl::OUString GenAreaName();
++
++ /**
++ * @descr Generate a name for a ole obejct.
++ */
++ static rtl::OUString GenObjName();
++
++ /**
++ * @descr Generate a name for an image object
++ */
++ static rtl::OUString GenImageName();
++
++ /**
++ * @descr Reset all global variables.
++ */
++ static void Reset();
++
++public:
++ static int s_nSectionID;
++ static int s_nFrameID;
++ static int s_nGraphID;
++ static int s_nTableID;
++ static int s_nNoteID;
++ static int s_nStrokeDashID;
++ static int s_nAreaID;
++ static int s_nObjID;
++ static int s_nImageID;
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfheader.hxx lotuswordpro/source/filter/xfilter/xfheader.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfheader.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfheader.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,90 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Header object. Sub object of master page.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-19 create this file.
++ ************************************************************************/
++#ifndef _XFHEADER_HXX
++#define _XFHEADER_HXX
++
++#include "xfcontentcontainer.hxx"
++#include "xfparagraph.hxx"
++#include <vector>
++
++class XFHeader : public XFContentContainer
++{
++public:
++ XFHeader()
++ {
++ }
++public:
++ virtual void ToXml(IXFStream *pStrm)
++ {
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pStrm->StartElement( A2OUSTR("style:header") );
++ XFContentContainer::ToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("style:header") );
++ }
++private:
++ XFContentContainer m_aContents;
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfheaderstyle.cxx lotuswordpro/source/filter/xfilter/xfheaderstyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfheaderstyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfheaderstyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,192 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Header style,exist in page-master object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-21 create this file.
++ ************************************************************************/
++#include "xfheaderstyle.hxx"
++#include "xfbgimage.hxx"
++
++XFHeaderStyle::XFHeaderStyle(sal_Bool isFooter)
++{
++ m_bIsFooter = isFooter;
++ m_bDynamicSpace = sal_True;
++ m_fHeight = -1;
++ m_fMinHeight = -1;
++ m_pBorders = NULL;
++ m_pShadow = NULL;
++ m_pBGImage = NULL;
++}
++
++XFHeaderStyle::~XFHeaderStyle()
++{
++ if( m_pBorders )
++ delete m_pBorders;
++ if( m_pBGImage )
++ delete m_pBGImage;
++ if( m_pShadow )
++ delete m_pShadow;
++}
++
++void XFHeaderStyle::SetMargins(double left, double right, double bottom)
++{
++ if( left != -1 )
++ m_aMargin.SetLeft(left);
++ if( right != -1 )
++ m_aMargin.SetRight(right);
++ if( bottom != -1 )
++ m_aMargin.SetBottom(bottom);
++}
++void XFHeaderStyle::SetDynamicSpace(sal_Bool dynamic)
++{
++ m_bDynamicSpace = dynamic;
++}
++
++void XFHeaderStyle::SetHeight(double height)
++{
++ m_fHeight = height;
++}
++
++void XFHeaderStyle::SetMinHeight(double minHeight)
++{
++ m_fMinHeight = minHeight;
++}
++
++void XFHeaderStyle::SetPadding(double left, double right, double top, double bottom)
++{
++ if( left != -1 )
++ m_aPadding.SetLeft(left);
++ if( right != -1 )
++ m_aPadding.SetRight(right);
++ if( top != -1 )
++ m_aPadding.SetTop(top);
++ if( bottom != -1 )
++ m_aPadding.SetBottom(bottom);
++}
++
++void XFHeaderStyle::SetShadow(XFShadow *pShadow)
++{
++ if( m_pShadow && (pShadow != m_pShadow) )
++ delete m_pShadow;
++ m_pShadow = pShadow;
++}
++
++void XFHeaderStyle::SetBorders(XFBorders *pBorders)
++{
++ if( m_pBorders )
++ delete m_pBorders;
++ m_pBorders = pBorders;
++}
++
++void XFHeaderStyle::SetBackImage(XFBGImage *image)
++{
++ if( m_pBGImage )
++ delete m_pBGImage;
++ m_pBGImage = image;
++}
++
++void XFHeaderStyle::SetBackColor(XFColor color)
++{
++ m_aBackColor = color;
++}
++
++void XFHeaderStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ if( m_bIsFooter )
++ pStrm->StartElement( A2OUSTR("style:footer-style") );
++ else
++ pStrm->StartElement( A2OUSTR("style:header-style") );
++
++ //height
++ if( m_fMinHeight>0 )
++ pAttrList->AddAttribute( A2OUSTR("fo:min-height"), DoubleToOUString(m_fMinHeight) + A2OUSTR("cm") );
++ else if( m_fHeight>0 )
++ pAttrList->AddAttribute( A2OUSTR("svg:height"), DoubleToOUString(m_fHeight) + A2OUSTR("cm") );
++
++ m_aMargin.ToXml(pStrm);
++ if(m_pShadow)
++ m_pShadow->ToXml(pStrm);
++ m_aPadding.ToXml(pStrm);
++ if( m_pBorders )
++ m_pBorders->ToXml(pStrm);
++
++ if( m_aBackColor.IsValid() )
++ pAttrList->AddAttribute( A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
++
++ if( m_bDynamicSpace )
++ pAttrList->AddAttribute( A2OUSTR("style:dynamic-spacing"), A2OUSTR("true") );
++ else
++ pAttrList->AddAttribute( A2OUSTR("style:dynamic-spacing"), A2OUSTR("false") );
++
++ pStrm->StartElement( A2OUSTR("style:properties") );
++
++ // background image
++ if( m_pBGImage )
++ m_pBGImage->ToXml(pStrm);
++
++ pStrm->EndElement( A2OUSTR("style:properties") );
++
++ if( m_bIsFooter )
++ pStrm->EndElement( A2OUSTR("style:footer-style") );
++ else
++ pStrm->EndElement( A2OUSTR("style:header-style") );
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfheaderstyle.hxx lotuswordpro/source/filter/xfilter/xfheaderstyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfheaderstyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfheaderstyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,142 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Header style,exist in page-master object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-19 create this file.
++ ************************************************************************/
++#ifndef _XFHEADERSTYLE_HXX
++#define _XFHEADERSTYLE_HXX
++
++#include "xfstyle.hxx"
++#include "xfmargins.hxx"
++#include "xfborders.hxx"
++#include "xfpadding.hxx"
++#include "xfshadow.hxx"
++
++/**
++ * @brief
++ * Header style object.
++ */
++class XFBGImage;
++class XFHeaderStyle : public XFStyle
++{
++public:
++ explicit XFHeaderStyle(sal_Bool isFooter=sal_False);
++
++ virtual ~XFHeaderStyle();
++
++public:
++ /**
++ * @descr Set margins for header style.
++ */
++ void SetMargins(double left = -1, double right = -1, double bottom = -1);
++
++ void SetDynamicSpace(sal_Bool dynamic);
++
++ /**
++ * @descr Set header fixed height.
++ */
++ void SetHeight(double height);
++
++ /**
++ * @descr Set header min height.
++ */
++ void SetMinHeight(double minHeight);
++
++ /**
++ * @descr Set padding for header. Padding is the space between header borde and header content.
++ */
++ void SetPadding(double left=-1, double right=-1, double top=-1, double bottom=-1);
++
++ /**
++ * @descr Set header shadow.
++ */
++ void SetShadow(XFShadow *pShadow);
++
++ /**
++ * @descr Set header borders.
++ */
++ void SetBorders(XFBorders *pBorders);
++
++ void SetBackImage(XFBGImage *image);
++
++ /**
++ * @descr Set header background color.
++ */
++ void SetBackColor(XFColor color);
++
++ /**
++ * @descr Output header style obejct.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++
++protected:
++ sal_Bool m_bIsFooter;
++ sal_Bool m_bDynamicSpace;
++ double m_fHeight;
++ double m_fMinHeight;
++ XFMargins m_aMargin;
++ XFShadow* m_pShadow;
++ XFPadding m_aPadding;
++ XFBorders *m_pBorders;
++ XFBGImage *m_pBGImage;
++ XFColor m_aBackColor;
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfhyperlink.hxx lotuswordpro/source/filter/xfilter/xfhyperlink.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfhyperlink.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfhyperlink.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,140 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Hyperlink object for OOo xml filter.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-1-31 create this file.
++ ************************************************************************/
++#ifndef _XFHYPERLINK_HXX
++#define _XFHYPERLINK_HXX
++
++class XFHyperlink : public XFContent
++{
++public:
++ XFHyperlink();
++
++public:
++ void SetHRef(rtl::OUString href);
++
++ void SetText(rtl::OUString text);
++
++ void SetName(rtl::OUString name);
++
++ void SetTargetFrame(rtl::OUString frame=A2OUSTR("_self"));
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ rtl::OUString m_strHRef;
++ rtl::OUString m_strName;
++ rtl::OUString m_strFrame;
++ rtl::OUString m_strText;
++};
++
++inline XFHyperlink::XFHyperlink()
++{
++ m_strFrame = A2OUSTR("_self");
++}
++
++inline void XFHyperlink::SetHRef(rtl::OUString href)
++{
++ m_strHRef = href;
++}
++
++inline void XFHyperlink::SetName(rtl::OUString name)
++{
++ m_strName = name;
++}
++
++inline void XFHyperlink::SetTargetFrame(rtl::OUString frame)
++{
++ m_strFrame = frame;
++}
++
++inline void XFHyperlink::SetText(rtl::OUString text)
++{
++ m_strText = text;
++}
++
++inline void XFHyperlink::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute( A2OUSTR("xlink:type"), A2OUSTR("simple") );
++ pAttrList->AddAttribute( A2OUSTR("xlink:href"), m_strHRef );
++ if( m_strName.getLength() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("office:name"), m_strName );
++ pAttrList->AddAttribute( A2OUSTR("office:target-frame-name"), m_strFrame );
++ pAttrList->AddAttribute( A2OUSTR("xlink:show"), A2OUSTR("replace") );
++ pStrm->StartElement( A2OUSTR("text:a") );
++
++ pAttrList->Clear();
++ if( GetStyleName().getLength()>0 )
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
++ pStrm->StartElement( A2OUSTR("text:span") );
++ if( m_strText.getLength() )
++ pStrm->Characters(m_strText);
++ else
++ pStrm->Characters(m_strHRef);
++ pStrm->EndElement( A2OUSTR("text:span") );
++
++ pStrm->EndElement( A2OUSTR("text:a") );
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfimage.cxx lotuswordpro/source/filter/xfilter/xfimage.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfimage.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfimage.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,145 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Image object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ 2005-02-22 create and implemente.
++ ************************************************************************/
++#include "xfimage.hxx"
++#include "xfbase64.hxx"
++
++XFImage::XFImage()
++{
++ m_eType = enumXFFrameImage;
++ m_strName = XFGlobal::GenImageName();
++}
++
++void XFImage::SetFileURL(rtl::OUString url)
++{
++ m_strImageFile = url;
++ m_bUseLink = sal_True;
++}
++
++void XFImage::SetImageData(sal_uInt8 *buf, int len)
++{
++ m_strData = XFBase64::Encode(buf, len);
++ m_bUseLink = sal_False;
++}
++
++/*
++ <text:p text:style-name="Standard">
++ <draw:image draw:style-name="fr1" draw:name="Graphic1"
++ text:anchor-type="paragraph" svg:width="4.981cm" svg:height="4.77cm"
++ draw:z-index="0" xlink:href="file:///d:/bee.wmf" xlink:type="simple"
++ xlink:show="embed" xlink:actuate="onLoad"/>
++ </text:p>
++ */
++void XFImage::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ if( GetStyleName().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("draw:style-name"), GetStyleName() );
++
++ assert(m_strName.getLength()>0); //name should not be null.
++ if( m_strName.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("draw:name"), m_strName );
++ //anchor type:
++ switch( m_eAnchor )
++ {
++ case enumXFAnchorPara:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("paragraph") );
++ break;
++ case enumXFAnchorPage:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("page") );
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-page-number"), Int32ToOUString(m_nAnchorPage) );
++ break;
++ case enumXFAnchorChar:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("char") );
++ break;
++ case enumXFAnchorAsChar:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("as-char") );
++ break;
++ case enumXFAnchorFrame:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("frame") );
++ break;
++ }
++ pAttrList->AddAttribute( A2OUSTR("svg:x"), DoubleToOUString(m_aRect.GetX()) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("svg:y"), DoubleToOUString(m_aRect.GetY()) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("svg:width"), DoubleToOUString(m_aRect.GetWidth()) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("svg:height"), DoubleToOUString(m_aRect.GetHeight()) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("draw:z-index"), Int32ToOUString(m_nZIndex) );
++
++ if( m_bUseLink )
++ {
++ pAttrList->AddAttribute( A2OUSTR("xlink:href"), m_strImageFile );
++ pAttrList->AddAttribute( A2OUSTR("xlink:type"), A2OUSTR("simple") );
++ pAttrList->AddAttribute( A2OUSTR("xlink:show"), A2OUSTR("embed") );
++ pAttrList->AddAttribute( A2OUSTR("xlink:actuate"), A2OUSTR("onLoad") );
++ }
++
++ pStrm->StartElement( A2OUSTR("draw:image") );
++ if( !m_bUseLink )
++ {
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("office:binary-data") );
++ pStrm->Characters(m_strData);
++ pStrm->EndElement( A2OUSTR("office:binary-data") );
++ }
++ pStrm->EndElement( A2OUSTR("draw:image") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfimage.hxx lotuswordpro/source/filter/xfilter/xfimage.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfimage.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfimage.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,100 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Image object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ 2005-02-22 create and implemente.
++ ************************************************************************/
++#ifndef _XFIMAGE_HXX
++#define _XFIMAGE_HXX
++
++#include "xfframe.hxx"
++
++/**
++ * @brief
++ * Image obejct.
++ * There are two way to import an image, file link or base64 stream.
++ */
++class XFImage : public XFFrame
++{
++public:
++ XFImage();
++
++public:
++ /**
++ * @descr Use file link source.a
++ */
++ void SetFileURL(rtl::OUString url);
++
++ /**
++ * @descr Use base64 stream.
++ */
++ void SetImageData(sal_uInt8 *buf, int len);
++
++ /**
++ * @descr Output image.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ rtl::OUString m_strImageFile;
++ rtl::OUString m_strData;
++ sal_Bool m_bUseLink;
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfimagestyle.cxx lotuswordpro/source/filter/xfilter/xfimagestyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfimagestyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfimagestyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,212 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Image style object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ 2005-02-22 create and implemente.
++ ************************************************************************/
++#include "xfimagestyle.hxx"
++#include "xfborders.hxx"
++#include "xfshadow.hxx"
++
++XFImageStyle::XFImageStyle()
++{
++ m_nBrightness = 0;
++ m_nContrast = 0;
++ m_nGamma = 0;
++ m_nTransparent = 0;
++ m_nAdjustRed = 0;
++ m_nAdjustGreen = 0;
++ m_nAdjustBlue = 0;
++ m_fClipLeft = 0;
++ m_fClipRight = 0;
++ m_fClipTop = 0;
++ m_fClipBottom = 0;
++ m_bHoriFlip = sal_False;
++ m_bVertFlip = sal_False;
++ m_eColorMode = enumXFColorStandard;
++}
++
++void XFImageStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
++ if( GetParentStyleName().getLength() > 0 )
++ pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
++ pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("graphics") );
++ //parent style name ignore now.
++ pStrm->StartElement( A2OUSTR("style:style") );
++
++ m_aMargins.ToXml(pStrm);
++
++ pAttrList->Clear();
++
++ if( m_eWrap == enumXFWrapBackground )
++ {
++ pAttrList->AddAttribute( A2OUSTR("style:run-through"), A2OUSTR("background") );
++ }
++ else
++ {
++ pAttrList->AddAttribute( A2OUSTR("style:run-through"), A2OUSTR("foreground") );
++
++ if( m_eWrap == enumXFWrapNone )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("none") );
++ else if( m_eWrap == enumXFWrapLeft )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("left") );
++ else if( m_eWrap == enumXFWrapRight )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("right") );
++ else if( m_eWrap == enumXFWrapParallel )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("parallel") );
++ else if( m_eWrap == enumXFWrapRunThrough )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("run-through") );
++ else if( m_eWrap == enumXFWrapBest )
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("dynamic") );
++ }
++ //background
++ if( m_aBackColor.IsValid() )
++ pAttrList->AddAttribute( A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
++ //pad
++ m_aPad.ToXml(pStrm);
++ //margin:
++ m_aMargins.ToXml(pStrm);
++ //flip
++ if( m_bHoriFlip || m_bVertFlip )
++ {
++ if( m_bHoriFlip && m_bVertFlip )
++ pAttrList->AddAttribute( A2OUSTR("style:mirror"), A2OUSTR("horizontal-on-right-pages vertical") );
++ else if( m_bHoriFlip && !m_bVertFlip )
++ pAttrList->AddAttribute( A2OUSTR("style:mirror"), A2OUSTR("horizontal-on-right-pages") );
++ else if( !m_bHoriFlip && m_bVertFlip )
++ pAttrList->AddAttribute( A2OUSTR("style:mirror"), A2OUSTR("vertical") );
++ }
++ //color adjust
++ if( m_nAdjustRed )
++ pAttrList->AddAttribute( A2OUSTR("draw:red"), Int32ToOUString(m_nAdjustRed) + A2OUSTR("%") );
++ if( m_nAdjustGreen )
++ pAttrList->AddAttribute( A2OUSTR("draw:green"), Int32ToOUString(m_nAdjustGreen) + A2OUSTR("%") );
++ if( m_nAdjustBlue )
++ pAttrList->AddAttribute( A2OUSTR("draw:blue"), Int32ToOUString(m_nAdjustBlue) + A2OUSTR("%") );
++
++ if( m_nGamma )
++ pAttrList->AddAttribute( A2OUSTR("draw:gamma"), Int32ToOUString(m_nGamma) );
++ if( m_nBrightness )
++ pAttrList->AddAttribute( A2OUSTR("draw:luminance"), Int32ToOUString(m_nBrightness) + A2OUSTR("%") );
++ if( m_nContrast )
++ pAttrList->AddAttribute( A2OUSTR("draw:contrast"), Int32ToOUString(m_nContrast) + A2OUSTR("%") );
++
++ if( m_nTransparent )
++ pAttrList->AddAttribute( A2OUSTR("draw:transparency"), Int32ToOUString(m_nTransparent) + A2OUSTR("%") );
++
++ pAttrList->AddAttribute(A2OUSTR("draw:color-mode"), GetColorMode(m_eColorMode));
++ //border
++ if( m_pBorders )
++ m_pBorders->ToXml(pStrm);
++ //shadow
++ if( m_pShadow )
++ m_pShadow->ToXml(pStrm);
++
++ if( m_bPrintable )
++ pAttrList->AddAttribute( A2OUSTR("style:print-content"), A2OUSTR("true") );
++ //protect:
++ if( m_bProtectContent || m_bProtectSize || m_bProtectPos )
++ {
++ rtl::OUString protect;
++ if( m_bProtectContent )
++ protect += A2OUSTR("content");
++ if( m_bProtectSize )
++ {
++ if( protect.getLength()>0 )
++ protect += A2OUSTR(" ");
++ protect += A2OUSTR("size");
++ }
++ if( m_bProtectPos )
++ {
++ if( protect.getLength()>0 )
++ protect += A2OUSTR(" ");
++ protect += A2OUSTR("position");
++ }
++ pAttrList->AddAttribute( A2OUSTR("style:protect"), protect );
++ }
++ //vertical pos and horizon pos:
++ pAttrList->AddAttribute( A2OUSTR("style:vertical-pos"), GetFrameYPos(m_eYPos) );
++ pAttrList->AddAttribute( A2OUSTR("style:vertical-rel"), GetFrameYRel(m_eYRel) );
++ pAttrList->AddAttribute( A2OUSTR("style:horizontal-pos"), GetFrameXPos(m_eXPos) );
++ pAttrList->AddAttribute( A2OUSTR("style:horizontal-rel"), GetFrameXRel(m_eXRel) );
++
++ //clip:
++ if( FABS(m_fClipLeft)>FLOAT_MIN || FABS(m_fClipRight)>FLOAT_MIN || FABS(m_fClipTop)>FLOAT_MIN || FABS(m_fClipBottom)>FLOAT_MIN )
++ {
++ rtl::OUString clip = A2OUSTR("rect(");
++ clip += DoubleToOUString(m_fClipTop) + A2OUSTR("cm ");
++ clip += DoubleToOUString(m_fClipRight) + A2OUSTR("cm ");
++ clip += DoubleToOUString(m_fClipBottom) + A2OUSTR("cm ");
++ clip += DoubleToOUString(m_fClipLeft) + A2OUSTR("cm");
++ clip += A2OUSTR(")");
++ pAttrList->AddAttribute(A2OUSTR("fo:clip"),clip);
++ }
++
++ //
++ pStrm->StartElement( A2OUSTR("style:properties") );
++ pStrm->EndElement( A2OUSTR("style:properties") );
++
++ pStrm->EndElement( A2OUSTR("style:style") );
++
++}
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfimagestyle.hxx lotuswordpro/source/filter/xfilter/xfimagestyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfimagestyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfimagestyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,164 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Image style object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ 2005-02-22 create this file.
++ 2005-02-25 make it inherit from XFFrameStyle.
++ ************************************************************************/
++#ifndef _XFIMAGESTYLE_HXX
++#define _XFIMAGESTYLE_HXX
++
++#include "xfframestyle.hxx"
++#include "xfrect.hxx"
++
++class XFImageStyle : public XFFrameStyle
++{
++public:
++ XFImageStyle();
++
++public:
++ void SetBrightness(sal_Int32 brightness);
++
++ void SetContrast(sal_Int32 contrast);
++
++ void SetGamma(sal_Int32 gamma);
++
++ void SetTransparent(sal_Int32 transparent);
++
++ void SetAdjustRed(sal_Int32 red);
++
++ void SetAdjustGreen(sal_Int32 green);
++
++ void SetAdjustBlue(sal_Int32 blue);
++
++ void SetClip(double left, double right, double top, double bottom);
++
++ void SetFlip(sal_Bool hori, sal_Bool vert);
++
++ void SetColorMode(enumXFColorMode mode);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ sal_Int32 m_nBrightness;
++ sal_Int32 m_nContrast;
++ sal_Int32 m_nGamma;
++ sal_Int32 m_nTransparent;
++ sal_Int32 m_nAdjustRed;
++ sal_Int32 m_nAdjustGreen;
++ sal_Int32 m_nAdjustBlue;
++ double m_fClipLeft;
++ double m_fClipRight;
++ double m_fClipTop;
++ double m_fClipBottom;
++ sal_Bool m_bHoriFlip;
++ sal_Bool m_bVertFlip;
++ enumXFColorMode m_eColorMode;
++};
++
++inline void XFImageStyle::SetBrightness(sal_Int32 brightness)
++{
++ m_nBrightness = brightness;
++}
++
++inline void XFImageStyle::SetContrast(sal_Int32 contrast)
++{
++ m_nContrast = contrast;
++}
++
++inline void XFImageStyle::SetGamma(sal_Int32 gamma)
++{
++ m_nGamma = gamma;
++}
++
++inline void XFImageStyle::SetTransparent(sal_Int32 transparent)
++{
++ m_nTransparent = transparent;
++}
++
++inline void XFImageStyle::SetAdjustRed(sal_Int32 red)
++{
++ m_nAdjustRed = red;
++}
++
++inline void XFImageStyle::SetAdjustGreen(sal_Int32 green)
++{
++ m_nAdjustGreen = green;
++}
++
++inline void XFImageStyle::SetAdjustBlue(sal_Int32 blue)
++{
++ m_nAdjustBlue = blue;
++}
++
++inline void XFImageStyle::SetClip(double left, double right, double top, double bottom)
++{
++ m_fClipLeft = left;
++ m_fClipRight = right;
++ m_fClipTop = top;
++ m_fClipBottom = bottom;
++}
++
++inline void XFImageStyle::SetFlip(sal_Bool hori, sal_Bool vert)
++{
++ m_bHoriFlip = hori;
++ m_bVertFlip = vert;
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfindex.cxx lotuswordpro/source/filter/xfilter/xfindex.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfindex.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfindex.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,450 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Represente index source,index body and index index entry.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ 2005-02-02 create and implemente.
++ ************************************************************************/
++#include "xfindex.hxx"
++#include "xfparagraph.hxx"
++
++XFIndex::XFIndex()
++{
++ m_pTitle = NULL;
++ m_eType = enumXFIndexTOC;
++ m_bProtect = sal_True;
++ m_bSeparator = sal_False;
++ m_nMaxLevel = 0;
++
++ for(sal_uInt16 i=1;i<MAX_TOC_LEVEL+1;i++)
++ {
++ m_aTOCSource[i].clear();
++ }
++}
++
++XFIndex::~XFIndex()
++{
++ if( m_pTitle )
++ delete m_pTitle;
++
++ for(sal_uInt16 i=1;i<MAX_TOC_LEVEL+1;i++)
++ {
++ m_aTOCSource[i].clear();
++ }
++
++ while(m_aTemplates.size()>0)
++ {
++ XFIndexTemplate * pTemplate = m_aTemplates.back();
++ m_aTemplates.pop_back();
++ delete pTemplate;pTemplate=NULL;
++ }
++}
++
++void XFIndex::SetSectionStyle(rtl::OUString strSectStyleName)
++{
++ SetStyleName(strSectStyleName);
++}
++
++void XFIndex::SetTitle(rtl::OUString title, rtl::OUString strParaStyle)
++{
++ m_strTitle = title;
++
++ m_pTitle = new XFParagraph();
++ m_pTitle->SetStyleName(strParaStyle);
++ m_pTitle->Add(m_strTitle);
++}
++
++void XFIndex::AddTemplate(sal_uInt32 level,
++ rtl::OUString style,
++ enumXFIndexTemplate type1,
++ enumXFIndexTemplate type2,
++ enumXFIndexTemplate type3,
++ enumXFIndexTemplate type4 )
++{
++ if( level<1 )
++ return;
++
++ if (level > m_nMaxLevel)
++ m_nMaxLevel = level;
++
++ XFIndexTemplate * templ = new XFIndexTemplate();
++
++ templ->AddEntry(type1);
++ templ->AddEntry(type2);
++ templ->AddEntry(type3);
++ templ->AddEntry(type4);
++ templ->SetLevel( rtl::OUString::valueOf( ( sal_Int64 ) level ) );
++
++ m_aTemplates.push_back( templ );
++}
++
++void XFIndex::AddTemplate(rtl::OUString level, rtl::OUString style, XFIndexTemplate* templ)
++{
++// if( level<1 || !templ )
++// return;
++
++// if (level > m_nMaxLevel)
++// m_nMaxLevel = level;
++
++ templ->SetLevel( level );
++ if(m_eType != enumXFIndexTOC) // TOC's styles are applied to template entries separately
++ {
++ templ->SetStyleName( style );
++ }
++ m_aTemplates.push_back( templ );
++}
++
++void XFIndex::AddEntry(rtl::OUString entry, rtl::OUString strParaStyle)
++{
++ XFParagraph *pPara = new XFParagraph();
++ pPara->SetStyleName(strParaStyle);
++ pPara->Add(entry);
++ pPara->Add(new XFTabStop());
++ XFContentContainer::Add(pPara);
++}
++
++sal_Int32 XFIndex::GetEntryCount()
++{
++ return GetCount();
++}
++
++void XFIndex::SetProtected(sal_Bool protect)
++{
++ m_bProtect = protect;
++}
++
++void XFIndex::SetSeparator(sal_Bool sep)
++{
++ m_bSeparator = sep;
++}
++
++void XFIndex::AddTocSource(sal_uInt16 nLevel, const rtl::OUString sStyleName)
++{
++ if (nLevel > MAX_TOC_LEVEL)
++ {
++ return;
++ }
++
++ m_aTOCSource[nLevel].push_back(sStyleName);
++}
++
++void XFIndex::SetDefaultAlphaIndex(rtl::OUString strDivision,sal_Bool bRunin, sal_Bool bSeparator)
++{
++ XFIndexTemplate * pTemplateSep = new XFIndexTemplate();
++ if (bSeparator)
++ {
++ SetSeparator(sal_True);
++ pTemplateSep->AddEntry(enumXFIndexTemplateText,A2OUSTR(""));
++ }
++ AddTemplate(A2OUSTR("separator"),A2OUSTR("Separator"),pTemplateSep);
++
++ XFIndexTemplate * pTemplate1 = new XFIndexTemplate();
++ pTemplate1->AddEntry(enumXFIndexTemplateText,A2OUSTR(""));
++ pTemplate1->AddEntry(enumXFIndexTemplateTab,A2OUSTR(""));
++ pTemplate1->AddEntry(enumXFIndexTemplatePage,A2OUSTR(""));
++ AddTemplate(Int32ToOUString(1),A2OUSTR("Primary"),pTemplate1);
++
++ XFIndexTemplate * pTemplate2 = new XFIndexTemplate();
++ pTemplate2->AddEntry(enumXFIndexTemplateText,A2OUSTR(""));
++ pTemplate2->AddEntry(enumXFIndexTemplateTab,A2OUSTR(""));
++ pTemplate2->AddEntry(enumXFIndexTemplatePage,A2OUSTR(""));
++ XFIndexTemplate * pTemplate3 = new XFIndexTemplate();
++ pTemplate3->AddEntry(enumXFIndexTemplateText,A2OUSTR(""));
++ pTemplate3->AddEntry(enumXFIndexTemplateTab,A2OUSTR(""));
++ pTemplate3->AddEntry(enumXFIndexTemplatePage,A2OUSTR(""));
++
++ if (bRunin)
++ {
++ AddTemplate(Int32ToOUString(2),A2OUSTR("Primary"),pTemplate2);
++ AddTemplate(Int32ToOUString(3),A2OUSTR("Primary"),pTemplate3);
++ }
++ else
++ {
++ AddTemplate(Int32ToOUString(2),A2OUSTR("Secondary"),pTemplate2);
++ AddTemplate(Int32ToOUString(3),A2OUSTR("Secondary"),pTemplate3);
++ }
++}
++
++void XFIndex::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ rtl::OUString strIndexName;
++ rtl::OUString strTplName;
++ rtl::OUString strSourceName;
++
++ if(m_eType == enumXFIndexTOC )
++ {
++ strIndexName = A2OUSTR("text:table-of-content");
++ strSourceName = A2OUSTR("text:table-of-content-source");
++ strTplName = A2OUSTR("text:table-of-content-entry-template");
++ }
++ else if( m_eType == enumXFIndexAlphabetical )
++ {
++ strIndexName = A2OUSTR("text:alphabetical-index");
++ strSourceName = A2OUSTR("text:alphabetical-index-source");
++ strTplName = A2OUSTR("text:alphabetical-index-entry-template");
++ }
++ else if( m_eType == enumXFIndexUserIndex )
++ {
++ strIndexName = A2OUSTR("text:user-index");
++ strSourceName = A2OUSTR("text:text:user-index-source");
++ strTplName = A2OUSTR("text:user-index-entry-template");
++ }
++ else if( m_eType == enumXFIndexObject )
++ {
++ strIndexName = A2OUSTR("text:object-index");
++ strSourceName = A2OUSTR("text:object-index-source");
++ strTplName = A2OUSTR("text:object-index-entry-template");
++ }
++ else if( m_eType == enumXFIndexIllustration )
++ {
++ strIndexName = A2OUSTR("text:illustration-index");
++ strSourceName = A2OUSTR("text:illustration-index-source");
++ strTplName = A2OUSTR("text:illustration-index-entry-template");
++ }
++ else if( m_eType == enumXFIndexTableIndex )
++ {
++ strIndexName = A2OUSTR("text:table-index");
++ strSourceName = A2OUSTR("text:table-index-source");
++ strTplName = A2OUSTR("text:table-index-entry-template");
++ }
++
++ if( GetStyleName().getLength() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
++ if( m_bProtect )
++ pAttrList->AddAttribute( A2OUSTR("text:protected"), A2OUSTR("true") );
++ else
++ pAttrList->AddAttribute( A2OUSTR("text:protected"), A2OUSTR("false") );
++
++ pAttrList->AddAttribute( A2OUSTR("text:name"), m_strTitle );
++ pStrm->StartElement( strIndexName );
++
++ //text:table-of-content-source:
++ pAttrList->Clear();
++
++ if(m_eType == enumXFIndexTOC )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:outline-level"), Int32ToOUString(10));
++ pAttrList->AddAttribute( A2OUSTR("text:use-index-source-styles"), A2OUSTR("true"));
++ pAttrList->AddAttribute( A2OUSTR("text:use-index-marks"), A2OUSTR("true"));
++ pAttrList->AddAttribute( A2OUSTR("text:use-outline-level"), A2OUSTR("false"));
++ }
++ if (m_bSeparator)
++ pAttrList->AddAttribute( A2OUSTR("text:alphabetical-separators"), A2OUSTR("true") );
++
++ pStrm->StartElement( strSourceName );
++ //title template:
++ pAttrList->Clear();
++
++ pStrm->StartElement( A2OUSTR("text:index-title-template") );
++ pStrm->Characters( m_strTitle );
++ pStrm->EndElement( A2OUSTR("text:index-title-template") );
++
++ //entry templates:
++ std::vector<XFIndexTemplate *>::iterator it;
++ for (it = m_aTemplates.begin(); it != m_aTemplates.end(); it++)
++ {
++ (*it)->SetTagName( strTplName);
++ (*it)->ToXml(pStrm);
++ }
++
++ // by
++ if(m_eType == enumXFIndexTOC )
++ {
++ for(sal_uInt16 i=1; i <= MAX_TOC_LEVEL; i++)
++ {
++ if (m_aTOCSource[i].size() == 0)
++ {
++ // unnecessary to output this level
++ continue;
++ }
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("text:outline-level"), Int32ToOUString(i));
++ pStrm->StartElement( A2OUSTR("text:index-source-styles") );
++
++ std::vector<rtl::OUString>::iterator it;
++ for (it = m_aTOCSource[i].begin(); it != m_aTOCSource[i].end(); it++)
++ {
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), *it);
++ pStrm->StartElement( A2OUSTR("text:index-source-style") );
++ pStrm->EndElement( A2OUSTR("text:index-source-style") );
++ }
++ pStrm->EndElement( A2OUSTR("text:index-source-styles") );
++ }
++ }
++
++ pStrm->EndElement( strSourceName );
++
++ //index-body:
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("text:index-body") );
++ //index-title:
++ if(m_strTitle.getLength())
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:name"), m_strTitle + A2OUSTR("_Head") );
++ pStrm->StartElement( A2OUSTR("text:index-title") );
++ if( m_pTitle )
++ m_pTitle->ToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("text:index-title") );
++ }
++
++ XFContentContainer::ToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("text:index-body") );
++
++ pStrm->EndElement( strIndexName );
++}
++
++
++void XFIndexTemplate::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute( A2OUSTR("text:outline-level"), m_nLevel );
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), m_strStyle );
++ if( m_strTagName.getLength() == 0 )
++ m_strTagName = A2OUSTR("text:table-of-content-entry-template");
++ pStrm->StartElement( m_strTagName );
++
++ for( size_t i=0; i<m_aEntries.size(); i++ )
++ {
++ pAttrList->Clear();
++
++ switch( m_aEntries[i].first )
++ {
++ case enumXFIndexTemplateChapter:
++ if(m_aEntries[i].second.getLength() > 0)
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), m_aEntries[i].second );
++
++ pStrm->StartElement( A2OUSTR("text:index-entry-chapter-number") );
++ pStrm->EndElement( A2OUSTR("text:index-entry-chapter-number") );
++ break;
++ case enumXFIndexTemplateText:
++ if(m_aEntries[i].second.getLength() > 0)
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), m_aEntries[i].second );
++
++ pStrm->StartElement( A2OUSTR("text:index-entry-text") );
++ pStrm->EndElement( A2OUSTR("text:index-entry-text") );
++ break;
++ case enumXFIndexTemplateTab:
++ if( m_eTabType != enumXFTabRight )
++ pAttrList->AddAttribute( A2OUSTR("style:position"), DoubleToOUString(m_fTabLength) + A2OUSTR("cm") );
++
++ if(m_aEntries[i].second.getLength() > 0)
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), m_aEntries[i].second );
++
++ switch(m_eTabType)
++ {
++ case enumXFTabLeft:
++ pAttrList->AddAttribute( A2OUSTR("style:type"), A2OUSTR("left") );
++ break;
++ case enumXFTabCenter:
++ pAttrList->AddAttribute( A2OUSTR("style:type"), A2OUSTR("center") );
++ break;
++ case enumXFTabRight:
++ pAttrList->AddAttribute( A2OUSTR("style:type"), A2OUSTR("right") );
++ break;
++ case enumXFTabChar:
++ pAttrList->AddAttribute( A2OUSTR("style:type"), A2OUSTR("char") );
++ break;
++ }
++ //delimiter:
++ if( m_eTabType == enumXFTabChar )
++ pAttrList->AddAttribute( A2OUSTR("style:char"), m_strTabDelimiter );
++ //leader char:
++ if( m_strTabLeader.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("style:leader-char"), m_strTabLeader );
++
++ pStrm->StartElement( A2OUSTR("text:index-entry-tab-stop") );
++ pStrm->EndElement( A2OUSTR("text:index-entry-tab-stop") );
++ break;
++ case enumXFIndexTemplatePage:
++ if(m_aEntries[i].second.getLength() > 0)
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), m_aEntries[i].second );
++
++ pStrm->StartElement( A2OUSTR("text:index-entry-page-number") );
++ pStrm->EndElement( A2OUSTR("text:index-entry-page-number") );
++ break;
++ case enumXFIndexTemplateLinkStart:
++ pStrm->StartElement( A2OUSTR("text:index-entry-link-start") );
++ pStrm->EndElement( A2OUSTR("text:index-entry-link-start") );
++ break;
++ case enumXFIndexTemplateLinkEnd:
++ pStrm->StartElement( A2OUSTR("text:index-entry-link-end") );
++ pStrm->EndElement( A2OUSTR("text:index-entry-link-end") );
++ break;
++ case enumXFIndexTemplateSpan:
++ pAttrList->Clear();
++ pAttrList->AddAttribute(A2OUSTR("text:style-name"), GetStyleName());
++ pStrm->StartElement( A2OUSTR("text:index-entry-span") );
++ pStrm->Characters(m_aTextEntries[i]);
++ pStrm->EndElement( A2OUSTR("text:index-entry-span") );
++ break;
++ case enumXFIndexTemplateBibliography:
++ pStrm->StartElement( A2OUSTR("text:index-entry-bibliography") );
++ pStrm->EndElement( A2OUSTR("text:index-entry-bibliography") );
++ break;
++ }
++ }
++
++ pStrm->EndElement( m_strTagName );
++}
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfindex.hxx lotuswordpro/source/filter/xfilter/xfindex.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfindex.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfindex.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,282 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Represente index source,index body and index index entry.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ 2005-02-02 create and implemente.
++ ************************************************************************/
++#ifndef _XFINDEX_HXX
++#define _XFINDEX_HXX
++#include <map>
++#include <vector>
++
++#include "xfcontent.hxx"
++#include "ixfproperty.hxx"
++#include "xfcontentcontainer.hxx"
++#include "xftabstop.hxx"
++
++class XFIndex;
++class XFIndexEntry;
++class XFIndexTemplate;
++class XFParagraph;
++
++/**
++ * @brief
++ * Index template.
++ * When index update, the template is used to decide the index body.
++ */
++class XFIndexTemplate : public XFContent
++{
++public:
++ XFIndexTemplate();
++
++public:
++ /**
++ * @descr Set template level.
++ */
++ void SetLevel(rtl::OUString level);
++ /**
++ * @descr Set style.
++ */
++ void SetStyleName(rtl::OUString style);
++ /**
++ * @descr Add a entry in the template.
++ */
++ void AddEntry(enumXFIndexTemplate entry, rtl::OUString styleName = A2OUSTR(""));
++
++ /**
++ * @descr Add a tab entry in the template.
++ */
++ void AddTabEntry(enumXFTab type, double len, sal_Unicode leader = '*', sal_Unicode delimiter='.', rtl::OUString styleName = A2OUSTR(""));
++
++ /**
++ * @descr Add a entry in the template.
++ */
++ void AddTextEntry(rtl::OUString sSpan, rtl::OUString styleName = A2OUSTR(""));
++
++ /**
++ * @descr clear all index template parts.
++ */
++ void Clear();
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ /**
++ * @descr Helper function.
++ */
++ void SetTagName(rtl::OUString tag);
++
++ friend class XFIndex;
++private:
++ rtl::OUString m_nLevel;
++ rtl::OUString m_strStyle;
++ enumXFTab m_eTabType;
++ double m_fTabLength;
++ rtl::OUString m_strTabDelimiter;
++ rtl::OUString m_strTabLeader;
++ rtl::OUString m_strTagName;
++ typedef std::pair<enumXFIndexTemplate, rtl::OUString> TOCTEMPLATE_ENTRY_TYPE;
++ std::vector<TOCTEMPLATE_ENTRY_TYPE> m_aEntries; // template entry + text style
++ std::map<sal_uInt16, rtl::OUString> m_aTextEntries;
++
++ rtl::OUString m_strChapterTextStyle;
++};
++
++/**
++ * @brief
++ * Index, include index template, index body.
++ */
++class XFIndex : public XFContentContainer
++{
++public:
++ XFIndex();
++
++ virtual ~XFIndex();
++
++public:
++ /**
++ * @descr Set index type.
++ */
++ void SetIndexType(enumXFIndex type);
++
++ /**
++ * @descr Set index section style. Perhaps you should create a section style first.
++ */
++ void SetSectionStyle(rtl::OUString strSectStyleName);
++
++ /**
++ * @descr Set index title.
++ */
++ void SetTitle(rtl::OUString title, rtl::OUString strParaStyle);
++
++ /**
++ * @descr Set index entry template.
++ * @param level [1-10].
++ */
++ void AddTemplate(sal_uInt32 level,
++ rtl::OUString style,
++ enumXFIndexTemplate type1 = enumXFIndexTemplateChapter,
++ enumXFIndexTemplate type2 = enumXFIndexTemplateText,
++ enumXFIndexTemplate type3 = enumXFIndexTemplateTab,
++ enumXFIndexTemplate type4 = enumXFIndexTemplatePage);
++
++ /**
++ * @descr Add index templaet entry.
++ */
++ void AddTemplate(rtl::OUString level, rtl::OUString style, XFIndexTemplate* templ);
++
++ /**
++ * @descr Add index entry.
++ */
++ void AddEntry(rtl::OUString entry, rtl::OUString strParaStyle);
++
++ /**
++ * @descr return entry count.
++ */
++ sal_Int32 GetEntryCount();
++
++ /**
++ * @descr Set if protected index to prevent handly-revise.
++ */
++ void SetProtected(sal_Bool protect);
++
++ /**
++ * @descr Set separator.
++ */
++ void SetSeparator(sal_Bool sep);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++ void AddTocSource(sal_uInt16 nLevel, const rtl::OUString sStyleName);
++
++ /**
++ * @descr Set default value for index.
++ */
++ void SetDefaultAlphaIndex(rtl::OUString strDivision,sal_Bool bRunin, sal_Bool bSeparator);
++
++private:
++ enumXFIndex m_eType;
++ rtl::OUString m_strTitle;
++ rtl::OUString m_strSectStyle;
++ bool m_bProtect;
++ bool m_bSeparator;
++ XFParagraph *m_pTitle;
++
++ std::vector<XFIndexTemplate *> m_aTemplates; // template entry + style
++
++ #define MAX_TOC_LEVEL 10
++ std::vector<rtl::OUString> m_aTOCSource[MAX_TOC_LEVEL+1];
++
++ sal_uInt32 m_nMaxLevel;
++};
++
++inline XFIndexTemplate::XFIndexTemplate()
++{
++ m_nLevel = Int32ToOUString(0);
++}
++
++inline void XFIndexTemplate::SetLevel(rtl::OUString level)
++{
++ m_nLevel = level;
++}
++inline void XFIndexTemplate::SetStyleName(rtl::OUString style)
++{
++ m_strStyle = style;
++}
++
++inline void XFIndexTemplate::SetTagName(rtl::OUString tag)
++{
++ m_strTagName = tag;
++}
++
++inline void XFIndexTemplate::AddEntry(enumXFIndexTemplate entry, rtl::OUString styleName)
++{
++ std::pair<enumXFIndexTemplate, rtl::OUString> pair(entry, styleName);
++ m_aEntries.push_back(pair);
++}
++
++inline void XFIndexTemplate::AddTabEntry(enumXFTab type, double len, sal_Unicode leader, sal_Unicode delimiter, rtl::OUString styleName)
++{
++ m_eTabType = type;
++ m_strTabLeader = rtl::OUString( leader );
++ m_strTabDelimiter = rtl::OUString( delimiter );
++ m_fTabLength = len;
++
++ AddEntry(enumXFIndexTemplateTab, styleName);
++}
++
++inline void XFIndexTemplate::AddTextEntry(rtl::OUString sText, rtl::OUString styleName)
++{
++ sal_uInt16 nLen = m_aEntries.size();
++ AddEntry(enumXFIndexTemplateSpan, styleName);
++
++ m_aTextEntries[nLen] = sText;
++}
++
++
++inline void XFIndexTemplate::Clear()
++{
++ m_aEntries.clear();
++}
++
++inline void XFIndex::SetIndexType(enumXFIndex type)
++{
++ m_eType = type;
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfinputlist.hxx lotuswordpro/source/filter/xfilter/xfinputlist.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfinputlist.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfinputlist.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,115 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * input list field.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-05-27 create this file.
++ ************************************************************************/
++#ifndef _XFINPUTLIST_HXX
++#define _XFINPUTLIST_HXX
++
++#include "xfcontent.hxx"
++
++/**
++ * @brief
++ * input list field.
++ */
++class XFInputList : public XFContent
++{
++public:
++ void SetName(rtl::OUString sName);
++ void SetLabels(std::vector<rtl::OUString> list);
++ virtual void ToXml(IXFStream *pStrm);
++private:
++ rtl::OUString m_strName;
++ std::vector<rtl::OUString> m_list;
++};
++
++inline void XFInputList::SetName(rtl::OUString sName)
++{
++ m_strName = sName;
++}
++
++inline void XFInputList::SetLabels(std::vector<rtl::OUString> list)
++{
++ m_list=list;
++}
++
++inline void XFInputList::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute( A2OUSTR("text:name"), m_strName );
++ pStrm->StartElement( A2OUSTR("text:drop-down") );
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("text:value"), A2OUSTR(" ") );
++ pStrm->StartElement( A2OUSTR("text:label") );
++ pStrm->EndElement( A2OUSTR("text:label") );
++ for(sal_uInt32 i=0; i< m_list.size();i++)
++ {
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("text:value"), m_list[i] );
++ pStrm->StartElement( A2OUSTR("text:label") );
++ pStrm->EndElement( A2OUSTR("text:label") );
++ }
++ pStrm->EndElement( A2OUSTR("text:drop-down") );
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xflinebreak.hxx lotuswordpro/source/filter/xfilter/xflinebreak.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xflinebreak.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xflinebreak.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,84 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**************************************************************************
++ * @file
++ * Line break object,<text:line-break/>
++ *************************************************************************/
++/**************************************************************************
++ * Change History
++ * 2004-01-11 create this file.
++ *************************************************************************/
++#ifndef _XFLINEBREAK_HXX
++#define _XFLINEBREAK_HXX
++
++#include "xfglobal.hxx"
++#include "xfcontent.hxx"
++
++class XFLineBreak : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++inline void XFLineBreak::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("text:line-break") );
++ pStrm->EndElement( A2OUSTR("text:line-break") );
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xflineheight.hxx lotuswordpro/source/filter/xfilter/xflineheight.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xflineheight.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xflineheight.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,176 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Line height for paragraph.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef _XFLINEHEIGHT_HXX
++#define _XFLINEHEIGHT_HXX
++
++class XFLineHeight
++{
++public:
++ XFLineHeight()
++ {
++ Reset();
++ }
++public:
++ void SetHeight(double value);
++
++ void SetLeastHeight(double value);
++
++ void SetPercent(sal_Int32 value);
++
++ void SetSpace(double value);
++
++ void Reset();
++
++ void ToXml(IXFStream *pStrm);
++
++ enumLHType GetType();
++
++ friend bool operator==(XFLineHeight& indent1, XFLineHeight& indent2);
++ friend bool operator!=(XFLineHeight& indent1, XFLineHeight& indent2);
++private:
++ union{
++ sal_Int32 m_nValue;
++ double m_fValue;
++ }m_Value;
++ enumLHType m_eType;
++};
++
++inline void XFLineHeight::SetHeight(double value)
++{
++ m_Value.m_fValue = value;
++ m_eType = enumLHHeight;
++}
++
++inline void XFLineHeight::SetLeastHeight(double value)
++{
++ m_Value.m_fValue = value;
++ m_eType = enumLHLeast;
++}
++
++inline void XFLineHeight::SetPercent(sal_Int32 value)
++{
++ m_Value.m_nValue = value;
++ m_eType = enumLHPercent;
++}
++inline void XFLineHeight::SetSpace(double value)
++{
++ m_Value.m_fValue = value;
++ m_eType = enumLHSpace;
++}
++inline void XFLineHeight::Reset()
++{
++ m_eType = enumLHNone;
++ rtl_zeroMemory(&m_Value,sizeof(m_Value));
++}
++
++inline enumLHType XFLineHeight::GetType()
++{
++ return m_eType;
++}
++
++inline void XFLineHeight::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ switch(m_eType)
++ {
++ case enumLHNone:
++ return;
++ case enumLHHeight:
++ pAttrList->AddAttribute( A2OUSTR("fo:line-height"),DoubleToOUString(m_Value.m_fValue) + A2OUSTR("cm") );
++ break;
++ case enumLHLeast:
++ pAttrList->AddAttribute( A2OUSTR("style:line-height-at-least"),DoubleToOUString(m_Value.m_fValue) + A2OUSTR("cm") );
++ break;
++ case enumLHPercent:
++ pAttrList->AddAttribute( A2OUSTR("fo:line-height"), DoubleToOUString(m_Value.m_nValue) + A2OUSTR("%") );
++ break;
++ case enumLHSpace:
++ pAttrList->AddAttribute( A2OUSTR("style:line-spacing"), DoubleToOUString(m_Value.m_fValue) + A2OUSTR("cm") );
++ break;
++ }
++}
++
++inline bool operator==(XFLineHeight& lh1, XFLineHeight& lh2)
++{
++ if( lh1.m_eType != lh2.m_eType )
++ return false;
++ if( lh1.m_eType == enumLHPercent )
++ {
++ if( lh1.m_Value.m_nValue != lh2.m_Value.m_nValue )
++ return false;
++ }
++ else
++ {
++ if( lh1.m_Value.m_fValue != lh2.m_Value.m_fValue )
++ return false;
++ }
++ return true;
++}
++
++inline bool operator!=(XFLineHeight& lh1, XFLineHeight& lh2)
++{
++ return !(lh1==lh2);
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xflinenumberconfig.hxx lotuswordpro/source/filter/xfilter/xflinenumberconfig.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xflinenumberconfig.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xflinenumberconfig.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,211 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Line numbering config for the full document.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-03-23 create this file.
++ ************************************************************************/
++#ifndef _XFLINENUMBERCONFIG_HXX
++#define _XFLINENUMBERCONFIG_HXX
++
++#include "xfstyle.hxx"
++
++class XFLineNumberConfig : public XFStyle
++{
++public:
++ XFLineNumberConfig();
++
++public:
++ void SetNumberOffset(double offset);
++
++ void SetNumberPosition(enumXFLineNumberPos pos);
++
++ void SetNumberIncrement(sal_Int32 increment);
++
++ void SetSeperator(sal_Int32 increment, rtl::OUString seperator);
++
++ void SetNumberFormat(rtl::OUString numfmt = A2OUSTR("1"));
++
++ void SetTextStyle(rtl::OUString style);
++
++ void SetRestartOnPage(sal_Bool restart = sal_True);
++
++ void SetCountEmptyLines(sal_Bool empty = sal_True);
++
++ void SetCountFrameLines(sal_Bool frame = sal_True);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ enumXFLineNumberPos m_ePosition;
++ double m_fOffset;
++ sal_Int32 m_nIncrement;
++ sal_Int32 m_nSepIncrement;
++ rtl::OUString m_strSeparator;
++ rtl::OUString m_strNumFmt;
++ rtl::OUString m_strTextStyle;
++ sal_Bool m_bRestartOnPage;
++ sal_Bool m_bCountEmptyLines;
++ sal_Bool m_bCountFrameLines;
++};
++
++inline XFLineNumberConfig::XFLineNumberConfig()
++{
++ m_fOffset = 0;
++ m_nIncrement = 5;
++ m_nSepIncrement = 3;
++ m_bRestartOnPage = sal_False;
++ m_bCountEmptyLines = sal_True;
++ m_bCountFrameLines = sal_False;
++}
++
++inline void XFLineNumberConfig::SetNumberOffset(double offset)
++{
++ m_fOffset = offset;
++}
++
++inline void XFLineNumberConfig::SetNumberPosition(enumXFLineNumberPos position)
++{
++ m_ePosition = position;
++}
++
++inline void XFLineNumberConfig::SetNumberIncrement(sal_Int32 increment)
++{
++ m_nIncrement = increment;
++}
++
++inline void XFLineNumberConfig::SetSeperator(sal_Int32 increment, rtl::OUString seperator)
++{
++ m_nSepIncrement = increment;
++ m_strSeparator = seperator;
++}
++
++inline void XFLineNumberConfig::SetNumberFormat(rtl::OUString numfmt)
++{
++ m_strNumFmt = numfmt;
++}
++
++inline void XFLineNumberConfig::SetTextStyle(rtl::OUString style)
++{
++ m_strTextStyle = style;
++}
++
++inline void XFLineNumberConfig::SetRestartOnPage(sal_Bool restart)
++{
++ m_bRestartOnPage = restart;
++}
++
++inline void XFLineNumberConfig::SetCountEmptyLines(sal_Bool empty)
++{
++ m_bCountEmptyLines = empty;
++}
++
++inline void XFLineNumberConfig::SetCountFrameLines(sal_Bool frame)
++{
++ m_bCountFrameLines = frame;
++}
++
++inline void XFLineNumberConfig::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ if( m_strTextStyle.getLength() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), m_strTextStyle );
++ pAttrList->AddAttribute( A2OUSTR("text:offset"), DoubleToOUString(m_fOffset) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("style:num-format"), m_strNumFmt );
++ //position:
++ if( m_ePosition == enumXFLineNumberLeft )
++ pAttrList->AddAttribute( A2OUSTR("text:number-position"), A2OUSTR("left") );
++ else if( m_ePosition == enumXFLineNumberRight )
++ pAttrList->AddAttribute( A2OUSTR("text:number-position"), A2OUSTR("right") );
++ else if( m_ePosition == enumXFLineNumberInner )
++ pAttrList->AddAttribute( A2OUSTR("text:number-position"), A2OUSTR("inner") );
++ else if( m_ePosition == enumXFLineNumberOutter )
++ pAttrList->AddAttribute( A2OUSTR("text:number-position"), A2OUSTR("outter") );
++
++ pAttrList->AddAttribute( A2OUSTR("text:increment"), Int32ToOUString(m_nIncrement) );
++
++ if( m_bRestartOnPage )
++ pAttrList->AddAttribute( A2OUSTR("text:restart-on-page"), A2OUSTR("true") );
++ else
++ pAttrList->AddAttribute( A2OUSTR("text:restart-on-page"), A2OUSTR("false") );
++
++ if( m_bCountEmptyLines )
++ pAttrList->AddAttribute( A2OUSTR("text:count-empty-lines"), A2OUSTR("true") );
++ else
++ pAttrList->AddAttribute( A2OUSTR("text:count-empty-lines"), A2OUSTR("false") );
++
++ if( m_bCountFrameLines )
++ pAttrList->AddAttribute( A2OUSTR("text:count-in-floating-frames"), A2OUSTR("true") );
++ else
++ pAttrList->AddAttribute( A2OUSTR("text:count-in-floating-frames"), A2OUSTR("false") );
++
++
++ pStrm->StartElement( A2OUSTR("text:linenumbering-configuration") );
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("text:increment"), Int32ToOUString(m_nSepIncrement) );
++ pStrm->StartElement( A2OUSTR("text:linenumbering-separator") );
++ pStrm->Characters(m_strSeparator);
++ pStrm->EndElement( A2OUSTR("text:linenumbering-separator") );
++
++ pStrm->EndElement( A2OUSTR("text:linenumbering-configuration") );
++}
++
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xflist.cxx lotuswordpro/source/filter/xfilter/xflist.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xflist.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xflist.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,189 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * List object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-17 create this file.
++ ************************************************************************/
++#include "xflist.hxx"
++#include "xflistitem.hxx"
++#include "ixfstream.hxx"
++#include "ixfattrlist.hxx"
++
++XFList::XFList()
++{
++ m_bOrdered = sal_True;
++ m_bContinueNumber = sal_False;
++ m_pHeader = NULL;
++}
++
++XFList::XFList(sal_Bool ordered)
++{
++ m_bOrdered = ordered;
++ m_bContinueNumber = sal_False;
++}
++
++XFList::~XFList()
++{
++}
++
++void XFList::AddItem(XFListItem *pItem)
++{
++ assert(pItem);
++ assert(pItem->GetContentType()!=enumXFContentUnknown);
++
++ Add(pItem);
++}
++
++void XFList::AddItem(rtl::OUString text)
++{
++ XFListItem *pItem = new XFListItem();
++ pItem->Add(text);
++ AddItem(pItem);
++}
++
++void XFList::SetHeader(XFListItem *pItem)
++{
++ if( m_pHeader )
++ delete m_pHeader;
++ pItem->SetIsHeader(sal_True);
++ m_pHeader = pItem;
++}
++
++void XFList::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ assert(NULL!=pAttrList);
++
++ pAttrList->Clear();
++ if( GetStyleName().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
++ if( m_bContinueNumber )
++ pAttrList->AddAttribute( A2OUSTR("text:continue-numbering"), A2OUSTR("true") );
++
++ if( m_bOrdered )
++ pStrm->StartElement( A2OUSTR("text:ordered-list") );
++ else
++ pStrm->StartElement( A2OUSTR("text:unordered-list") );
++
++ if( m_pHeader )
++ {
++ m_pHeader->ToXml(pStrm);
++ }
++ XFContentContainer::ToXml(pStrm);
++
++ if( m_bOrdered )
++ pStrm->EndElement( A2OUSTR("text:ordered-list") );
++ else
++ pStrm->EndElement( A2OUSTR("text:unordered-list") );
++}
++
++void XFList::StartList(IXFStream *pStrm, sal_Bool bContinueNumber)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ assert(NULL!=pAttrList);
++
++ pAttrList->Clear();
++ if( GetStyleName().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
++ if( bContinueNumber )
++ pAttrList->AddAttribute( A2OUSTR("text:continue-numbering"), A2OUSTR("true") );
++
++ if( m_bOrdered )
++ pStrm->StartElement( A2OUSTR("text:ordered-list") );
++ else
++ pStrm->StartElement( A2OUSTR("text:unordered-list") );
++}
++
++void XFList::EndList(IXFStream *pStrm)
++{
++ if( m_bOrdered )
++ pStrm->EndElement( A2OUSTR("text:ordered-list") );
++ else
++ pStrm->EndElement( A2OUSTR("text:unordered-list") );
++}
++
++void XFList::StartListHeader(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pStrm->StartElement( A2OUSTR("text:list-header") );
++}
++
++void XFList::EndListHeader(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pStrm->EndElement( A2OUSTR("text:list-header") );
++}
++
++void XFList::StartListItem(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ assert(NULL!=pAttrList);
++
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("text:list-item") );
++}
++
++void XFList::EndListItem(IXFStream *pStrm)
++{
++ pStrm->EndElement( A2OUSTR("text:list-item") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xflist.hxx lotuswordpro/source/filter/xfilter/xflist.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xflist.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xflist.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,163 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Base list object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-17 create this file.
++ ************************************************************************/
++#ifndef _XFLIST_HXX
++#define _XFLIST_HXX
++
++#include "xflistitem.hxx"
++#include "xfcontentcontainer.hxx"
++
++class XFListItem;
++
++/**
++ * @brief
++ * list obejct for order-list and unordered-list.
++ */
++class XFList : public XFContentContainer
++{
++public:
++ XFList();
++
++ XFList(sal_Bool ordered);
++
++ virtual ~XFList();
++
++public:
++ /**
++ * @descr Set whether it's an ordered list or an unordered list.
++ */
++ void SetOrdered(sal_Bool ordered);
++
++ /**
++ * @descr Set whether to continue to number list.
++ */
++ void SetContinueNumber(sal_Bool bContinueNumber=sal_False);
++
++ /**
++ * @descr Add a list item.
++ */
++ void AddItem(XFListItem *pItem);
++
++ /**
++ * @descr Add a simple text list item.
++ */
++ void AddItem(rtl::OUString text);
++
++ /**
++ * @descr Set the header list item. There can only be one list header.
++ */
++ void SetHeader(XFListItem *pItem);
++
++ /**
++ * @descr Output list obejct.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++
++ virtual void StartList(IXFStream *pStrm, sal_Bool bContinueNumber = sal_False);
++
++ virtual void EndList(IXFStream *pStrm);
++
++ static void StartListHeader(IXFStream *pStrm);
++
++ static void EndListHeader(IXFStream *pStrm);
++
++ static void StartListItem(IXFStream *pStrm);
++
++ static void EndListItem(IXFStream *pStrm);
++
++private:
++ sal_Bool m_bOrdered;
++ sal_Bool m_bContinueNumber;
++ XFListItem *m_pHeader;
++
++};
++
++class XFUnorderedList : public XFList
++{
++public:
++ XFUnorderedList()
++ {
++ SetOrdered(sal_False);
++ }
++};
++
++class XFOrderedList : public XFList
++{
++public:
++ XFOrderedList()
++ {
++ SetOrdered(sal_True);
++ }
++};
++
++inline void XFList::SetOrdered(sal_Bool ordered)
++{
++ m_bOrdered = ordered;
++}
++
++inline void XFList::SetContinueNumber(sal_Bool bContinueNumber)
++{
++ m_bContinueNumber = bContinueNumber;
++}
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xflistitem.hxx lotuswordpro/source/filter/xfilter/xflistitem.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xflistitem.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xflistitem.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,118 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * List item.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-02-17 create this file.
++ ************************************************************************/
++#ifndef _XFLISTITEM_HXX
++#define _XFLISTITEM_HXX
++
++#include "xfcontent.hxx"
++#include "xfcontentcontainer.hxx"
++#include "xfparagraph.hxx"
++
++class XFListItem : public XFContentContainer
++{
++public:
++ XFListItem();
++
++public:
++ void SetIsHeader(sal_Bool isHeader=sal_True);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ sal_Bool m_bIsHeader;
++};
++
++inline XFListItem::XFListItem()
++{
++ m_bIsHeader = sal_False;
++}
++
++inline void XFListItem::SetIsHeader(sal_Bool isHeader)
++{
++ m_bIsHeader = isHeader;
++}
++
++inline void XFListItem::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ if( GetStyleName().getLength() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
++
++ if( !m_bIsHeader )
++ {
++ pStrm->StartElement( A2OUSTR("text:list-item") );
++ XFContentContainer::ToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("text:list-item") );
++ }
++ else
++ {
++ pStrm->StartElement( A2OUSTR("text:list-header") );
++ XFContentContainer::ToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("text:list-header") );
++ }
++}
++
++
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfliststyle.cxx lotuswordpro/source/filter/xfilter/xfliststyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfliststyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfliststyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,346 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Styles for ordered list and unordered list.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-07 create the file.
++ * 2005-01-20 use XFNumFmt to fill XFListLevelNumber.
++ ************************************************************************/
++#include "xfliststyle.hxx"
++
++XFListLevel::XFListLevel()
++{
++ m_nLevel = 0;
++ m_nDisplayLevel = 0;
++ m_fIndent = 0;
++ m_fMinLabelWidth = 0.499;
++ m_fMinLabelDistance = 0;
++ m_eAlign = enumXFAlignStart;
++ m_eListType = enumXFListLevelNumber;
++}
++
++void XFListLevel::ToXml(IXFStream *pStrm)
++{
++}
++
++//----------------------------------------------------
++
++void XFListlevelNumber::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("text:level"), Int16ToOUString(m_nLevel) );
++ //text:style-name,ignore now.
++ m_aNumFmt.ToXml(pStrm);
++ if( m_nDisplayLevel )
++ pAttrList->AddAttribute( A2OUSTR("text:display-levels"), Int16ToOUString(m_nDisplayLevel) );
++
++ pStrm->StartElement( A2OUSTR("text:list-level-style-number") );
++
++ //<style:properties>...</style:properties>
++ pAttrList->Clear();
++ if( m_fIndent > FLOAT_MIN )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:space-before"), DoubleToOUString(m_fIndent) + A2OUSTR("cm") );
++ }
++ if( m_fMinLabelWidth > FLOAT_MIN )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:min-label-width"), DoubleToOUString(m_fMinLabelWidth) + A2OUSTR("cm") );
++ }
++ if( m_fMinLabelDistance > FLOAT_MIN )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:min-label-distance"), DoubleToOUString(m_fMinLabelDistance) + A2OUSTR("cm") );
++ }
++ pAttrList->AddAttribute( A2OUSTR("fo:text-align"), GetAlignName(m_eAlign) );
++
++
++ pStrm->StartElement( A2OUSTR("style:properties") );
++ pStrm->EndElement( A2OUSTR("style:properties") );
++
++ pStrm->EndElement( A2OUSTR("text:list-level-style-number") );
++}
++
++void XFListLevelBullet::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("text:level"), Int16ToOUString(m_nLevel) );
++ //text:style-name,ignore now.
++ m_aNumFmt.ToXml(pStrm);
++ //bullet-char
++ rtl::OUString bullet(m_chBullet);
++ pAttrList->AddAttribute( A2OUSTR("text:bullet-char"), bullet );
++
++ pStrm->StartElement( A2OUSTR("text:list-level-style-bullet") );
++
++ //<style:properties>...</style:properties>
++ pAttrList->Clear();
++ if( m_fIndent != 0 )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:space-before"), DoubleToOUString(m_fIndent) + A2OUSTR("cm") );
++ }
++ if( m_fMinLabelWidth != 0 )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:min-label-width"), DoubleToOUString(m_fMinLabelWidth) + A2OUSTR("cm") );
++ }
++ if( m_fMinLabelDistance != 0 )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:min-label-distance"), DoubleToOUString(m_fMinLabelDistance) + A2OUSTR("cm") );
++ }
++
++ pAttrList->AddAttribute( A2OUSTR("fo:text-align"), GetAlignName(m_eAlign) );
++
++ if( m_strFontName.getLength() > 0 )
++ {
++ pAttrList->AddAttribute( A2OUSTR("style:font-name"), m_strFontName );
++ }
++ pStrm->StartElement( A2OUSTR("style:properties") );
++ pStrm->EndElement( A2OUSTR("style:properties") );
++
++ pStrm->EndElement( A2OUSTR("text:list-level-style-bullet") );
++}
++
++//----------------------------------------------------
++XFListStyle::XFListStyle()
++{
++ XFNumFmt nf;
++ nf.SetSuffix( A2OUSTR(".") );
++ nf.SetFormat( A2OUSTR("1") );
++
++ for( int i=0; i<10; i++ )
++ {
++ m_pListLevels[i] = new XFListlevelNumber();
++ m_pListLevels[i]->SetListlevelType(enumXFListLevelNumber);
++ m_pListLevels[i]->SetMinLabelWidth(0.499);
++ m_pListLevels[i]->SetIndent(0.501*(i+1));
++ m_pListLevels[i]->SetLevel(i+1);
++ ( (XFListlevelNumber*)m_pListLevels[i])->SetNumFmt(nf);
++ }
++}
++
++XFListStyle::XFListStyle(const XFListStyle& other)
++{
++ enumXFListLevel type;
++ for( int i=0; i<10; i++ )
++ {
++ type = other.m_pListLevels[i]->m_eListType;
++ if( type == enumXFListLevelNumber )
++ {
++ XFListlevelNumber *pNum = (XFListlevelNumber*)other.m_pListLevels[i];
++ m_pListLevels[i] = new XFListlevelNumber(*pNum);
++ }
++ else if( type == enumXFListLevelBullet )
++ {
++ XFListLevelBullet *pBullet = (XFListLevelBullet*)other.m_pListLevels[i];
++ m_pListLevels[i] = new XFListLevelBullet(*pBullet);
++ }
++ else
++ m_pListLevels[i] = NULL;
++ }
++}
++
++XFListStyle& XFListStyle::operator=(const XFListStyle& other)
++{
++ enumXFListLevel type;
++ for( int i=0; i<10; i++ )
++ {
++ type = other.m_pListLevels[i]->m_eListType;
++ if( type == enumXFListLevelNumber )
++ {
++ XFListlevelNumber *pNum = (XFListlevelNumber*)m_pListLevels[i];
++ m_pListLevels[i] = new XFListlevelNumber(*pNum);
++ }
++ else if( type == enumXFListLevelBullet )
++ {
++ XFListLevelBullet *pBullet = (XFListLevelBullet*)m_pListLevels[i];
++ m_pListLevels[i] = new XFListLevelBullet(*pBullet);
++ }
++ else
++ m_pListLevels[i] = NULL;
++ }
++ return *this;
++}
++
++XFListStyle::~XFListStyle()
++{
++ for( int i=0; i<10; i++ )
++ {
++ if( m_pListLevels[i] )
++ delete m_pListLevels[i];
++ }
++}
++
++void XFListStyle::SetDisplayLevel(sal_Int32 level, sal_Int16 nDisplayLevel)
++{
++ assert(level>=1&&level<=10);
++
++ XFListLevel *pLevel = m_pListLevels[level-1];
++ if( !pLevel )
++ {
++ pLevel = new XFListlevelNumber();
++ pLevel->SetListlevelType(enumXFListLevelNumber);
++ pLevel->SetLevel(level+1);
++ pLevel->SetMinLabelWidth(0.499);
++ pLevel->SetIndent(0.501*(level+1));
++ pLevel->SetDisplayLevel(nDisplayLevel);
++ m_pListLevels[level-1] = pLevel;
++ }
++ else
++ pLevel->SetDisplayLevel(nDisplayLevel);
++}
++
++void XFListStyle::SetListPosition(sal_Int32 level,
++ double indent,
++ double minLabelWidth,
++ double minLabelDistance,
++ enumXFAlignType align
++ )
++{
++ assert(level>=1&&level<=10);
++
++ XFListLevel *pLevel = m_pListLevels[level-1];
++ if( !pLevel )
++ {
++ XFListLevelBullet * pLevel = new XFListLevelBullet();
++ pLevel->SetListlevelType(enumXFListLevelNumber);
++ pLevel->SetLevel(level+1);
++ pLevel->SetIndent(indent);
++ pLevel->SetMinLabelWidth(minLabelWidth);
++ pLevel->SetMinLabelDistance(minLabelDistance);
++ pLevel->SetAlignType(align);
++ m_pListLevels[level-1] = pLevel;
++ }
++ else
++ {
++ pLevel->SetIndent(indent);
++ pLevel->SetMinLabelWidth(minLabelWidth);
++ pLevel->SetMinLabelDistance(minLabelDistance);
++ pLevel->SetAlignType(align);
++ }
++}
++
++void XFListStyle::SetListBullet(sal_Int32 level,
++ UChar32 bullet,
++ rtl::OUString fontname,
++ rtl::OUString prefix,
++ rtl::OUString suffix
++ )
++{
++ assert(level>=1&&level<=10);
++
++ if( m_pListLevels[level-1] )
++ delete m_pListLevels[level-1];
++
++ XFListLevelBullet *pLevel = new XFListLevelBullet();
++ pLevel->SetPrefix(prefix);
++ pLevel->SetSuffix(suffix);
++ pLevel->SetBulletChar(bullet);
++ pLevel->SetFontName(fontname);
++ //
++ pLevel->SetListlevelType(enumXFListLevelBullet);
++ pLevel->SetMinLabelWidth(0.499);
++ pLevel->SetIndent(0.501*level);
++ pLevel->SetLevel(level);
++ m_pListLevels[level-1] = pLevel;
++}
++
++void XFListStyle::SetListNumber(sal_Int32 level, XFNumFmt& fmt, sal_Int16 start )
++{
++ assert(level>=1&&level<=10);
++
++ if( m_pListLevels[level-1] )
++ delete m_pListLevels[level-1];
++
++ XFListlevelNumber *pLevel = new XFListlevelNumber();
++ pLevel->SetNumFmt(fmt);
++ pLevel->SetStartValue(start);
++ //
++ pLevel->SetListlevelType(enumXFListLevelNumber);
++ pLevel->SetMinLabelWidth(0.499);
++ pLevel->SetIndent(0.501*level);
++ pLevel->SetLevel(level);
++ m_pListLevels[level-1] = pLevel;
++}
++
++void XFListStyle::ToXml(IXFStream *pStrm)
++{
++ std::vector<XFListLevel*>::iterator it;
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
++ if( GetParentStyleName().getLength() > 0 )
++ pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
++ pStrm->StartElement( A2OUSTR("text:list-style") );
++
++ for( int i=0; i<10; i++ )
++ {
++ XFListLevel *pLevel = m_pListLevels[i];
++ if( pLevel )
++ pLevel->ToXml(pStrm);
++ }
++
++ pStrm->EndElement( A2OUSTR("text:list-style") );
++}
++
++
++
++
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfliststyle.hxx lotuswordpro/source/filter/xfilter/xfliststyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfliststyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfliststyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,269 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++* @file
++* Styles for ordered list and unordered list.
++************************************************************************/
++/*************************************************************************
++* Change History
++* 2005-1-7 create the file.
++************************************************************************/
++#ifndef _XFLISTSTYLE_HXX
++#define _XFLISTSTYLE_HXX
++
++#include "xfglobal.hxx"
++#include "xfstyle.hxx"
++#include "xfnumfmt.hxx"
++#include "unicode/utypes.h"
++#include <vector>
++
++class IXFStream;
++
++enum enumXFListLevel
++{
++ enumXFListLevelBullet,
++ enumXFListLevelNumber,
++ enumXFListLevelImage
++};
++
++/**************************************************************************
++ * @descr
++ * Bullet style wrapper,the underline bullet type can be:
++ * number,image,or bullet.
++ *************************************************************************/
++class XFListLevel
++{
++public:
++ XFListLevel();
++
++ virtual ~XFListLevel(){}
++
++ void SetListlevelType(enumXFListLevel type);
++
++ void SetLevel(sal_Int16 level);
++
++ void SetDisplayLevel(sal_Int16 nDisplayLevel);
++
++ void SetIndent(double indent);
++
++ void SetMinLabelWidth(double labelWidth);
++
++ void SetMinLabelDistance(double distance);
++
++ void SetAlignType(enumXFAlignType align);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++ friend class XFListStyle;
++protected:
++ sal_Int16 m_nLevel;
++ sal_Int16 m_nDisplayLevel;
++ double m_fIndent;
++ double m_fMinLabelWidth;
++ double m_fMinLabelDistance;
++ enumXFAlignType m_eAlign;
++ enumXFListLevel m_eListType;
++};
++
++class XFListlevelNumber : public XFListLevel
++{
++public:
++ XFListlevelNumber()
++ {
++ m_eListType = enumXFListLevelNumber;
++ }
++public:
++ void SetNumFmt(XFNumFmt& fmt)
++ {
++ m_aNumFmt = fmt;
++ }
++
++ void SetStartValue(sal_Int16 start)
++ {
++ m_aNumFmt.SetStartValue(start);
++ }
++
++ virtual void ToXml(IXFStream *pStrm);
++private:
++ XFNumFmt m_aNumFmt;
++};
++
++
++class XFListLevelBullet : public XFListLevel
++{
++public:
++ XFListLevelBullet()
++ {
++ m_eListType = enumXFListLevelBullet;
++ }
++
++ void SetBulletChar(UChar32 ch)
++ {
++ m_chBullet = ch;
++ }
++ void SetPrefix(rtl::OUString prefix)
++ {
++ m_aNumFmt.SetPrefix(prefix);
++ }
++ void SetSuffix(rtl::OUString suffix)
++ {
++ m_aNumFmt.SetSuffix(suffix);
++ }
++ void SetFontName(rtl::OUString name)
++ {
++ m_strFontName = name;
++ }
++
++ virtual void ToXml(IXFStream *pStrm);
++private:
++ XFNumFmt m_aNumFmt;
++ int32_t m_chBullet;
++ rtl::OUString m_strFontName;
++};
++
++//not complete.
++class XFListLevelImage : public XFListLevel
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++private:
++ sal_Int16 m_nWidth;
++ sal_Int16 m_nHeight;
++ rtl::OUString m_strBinaryData;
++};
++
++
++class XFListStyle : public XFStyle
++{
++public:
++ XFListStyle();
++
++ XFListStyle(const XFListStyle& other);
++
++ XFListStyle& operator=(const XFListStyle& other);
++
++ virtual ~XFListStyle();
++
++public:
++ void SetDisplayLevel(sal_Int32 level, sal_Int16 nShowLevel);
++
++ void SetListPosition(sal_Int32 level,
++ double indent,
++ double minLabelWidth,
++ double minLabelDistance,
++ enumXFAlignType align=enumXFAlignStart
++ );
++
++ void SetListBullet(sal_Int32 level,
++ UChar32 bullet_char,
++ rtl::OUString fontname = A2OUSTR(""),
++ rtl::OUString prefix = A2OUSTR(""),
++ rtl::OUString suffix = A2OUSTR("")
++ );
++
++ void SetListNumber( sal_Int32 level, XFNumFmt& numFmt, sal_Int16 nStartValue = 1 );
++
++ //not implemented now.
++ void SetListImage(){}
++
++ virtual enumXFStyle GetStyleFamily()
++ {
++ return enumXFStyleList;
++ }
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ XFListLevel *m_pListLevels[10];
++};
++
++
++
++inline void XFListLevel::SetListlevelType(enumXFListLevel type)
++{
++ m_eListType = type;
++}
++
++inline void XFListLevel::SetAlignType(enumXFAlignType align)
++{
++ m_eAlign = align;
++}
++
++inline void XFListLevel::SetLevel(sal_Int16 level)
++{
++ m_nLevel = level;
++}
++
++inline void XFListLevel::SetDisplayLevel(sal_Int16 nDisplayLevel)
++{
++ m_nDisplayLevel = nDisplayLevel;
++}
++
++inline void XFListLevel::SetIndent(double indent)
++{
++ m_fIndent = indent;
++}
++
++inline void XFListLevel::SetMinLabelWidth(double labelWidth)
++{
++ m_fMinLabelWidth = labelWidth;
++}
++
++inline void XFListLevel::SetMinLabelDistance(double distance)
++{
++ m_fMinLabelDistance = distance;
++}
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfmargins.cxx lotuswordpro/source/filter/xfilter/xfmargins.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfmargins.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfmargins.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,129 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Margins object, include left margin,right margin,top margin and bottom margin.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-19 create this file.
++ ************************************************************************/
++
++
++#include "xfmargins.hxx"
++
++XFMargins::XFMargins()
++{
++ Reset();
++}
++
++void XFMargins::Reset()
++{
++ m_fLeft = 0;
++ m_fRight = 0;
++ m_fTop = 0;
++ m_fBottom = 0;
++ m_nFlag = 0;
++}
++
++void XFMargins::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ //margin left:
++ if( m_nFlag&XFMARGINS_FLAG_LEFT )
++ {
++ pAttrList->AddAttribute( A2OUSTR("fo:margin-left"), DoubleToOUString(m_fLeft) + A2OUSTR("cm") );
++ }
++ //margin right:
++ if( m_nFlag&XFMARGINS_FLAG_RIGHT )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:margin-right"), DoubleToOUString(m_fRight) + A2OUSTR("cm") );
++ }
++ //margin top:
++ if( m_nFlag&XFMARGINS_FLAG_TOP )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:margin-top"), DoubleToOUString(m_fTop) + A2OUSTR("cm") );
++ }
++ //margin bottom:
++ if( m_nFlag&XFMARGINS_FLAG_BOTTOM )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:margin-bottom"), DoubleToOUString(m_fBottom) + A2OUSTR("cm") );
++ }
++}
++
++bool operator==(XFMargins& indent1, XFMargins& indent2)
++{
++ return (
++ (indent1.m_nFlag == indent2.m_nFlag) &&
++ (indent1.m_fLeft == indent2.m_fLeft) &&
++ (indent1.m_fRight == indent2.m_fRight) &&
++ (indent1.m_fTop == indent2.m_fTop) &&
++ (indent1.m_fBottom == indent2.m_fBottom)
++ );
++}
++bool operator!=(XFMargins& indent1, XFMargins& indent2)
++{
++ return !(indent1==indent2);
++}
++
++XFMargins& XFMargins::operator=(XFMargins& other)
++{
++ m_nFlag = other.m_nFlag;
++ m_fLeft = other.m_fLeft;
++ m_fRight = other.m_fRight;
++ m_fTop = other.m_fTop;
++ m_fBottom = other.m_fBottom;
++ return *this;
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfmargins.hxx lotuswordpro/source/filter/xfilter/xfmargins.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfmargins.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfmargins.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,147 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Margins object, include left margin,right margin,top margin and bottom margin.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-19 create this file.
++ ************************************************************************/
++#ifndef _XFMARGINS_HXX
++#define _XFMARGINS_HXX
++
++#include "xfglobal.hxx"
++#include "ixfproperty.hxx"
++
++#define XFMARGINS_FLAG_LEFT 0x00000001
++#define XFMARGINS_FLAG_RIGHT 0x00000002
++#define XFMARGINS_FLAG_TOP 0x00000004
++#define XFMARGINS_FLAG_BOTTOM 0x00000008
++
++class XFMargins : public IXFProperty
++{
++public:
++ XFMargins();
++public:
++ void Reset();
++ void SetLeft(double left);
++ void SetRight(double right);
++ void SetTop(double top);
++ void SetBottom(double bottom);
++
++ double GetLeft();
++ double GetRight();
++ double GetTop();
++ double GetBottom();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++ friend bool operator==(XFMargins& indent1, XFMargins& indent2);
++ friend bool operator!=(XFMargins& indent1, XFMargins& indent2);
++ XFMargins& operator=(XFMargins& other);
++private:
++ double m_fLeft;
++ double m_fRight;
++ double m_fTop;
++ double m_fBottom;
++ int m_nFlag;
++};
++
++inline void XFMargins::SetLeft(double left)
++{
++ m_fLeft = left;
++ m_nFlag |= XFMARGINS_FLAG_LEFT;
++}
++
++inline void XFMargins::SetRight(double right)
++{
++ m_fRight = right;
++ m_nFlag |= XFMARGINS_FLAG_RIGHT;
++}
++
++inline void XFMargins::SetTop(double top)
++{
++ m_fTop = top;
++ m_nFlag |= XFMARGINS_FLAG_TOP;
++}
++
++inline void XFMargins::SetBottom(double bottom)
++{
++ m_fBottom = bottom;
++ m_nFlag |= XFMARGINS_FLAG_BOTTOM;
++}
++
++inline double XFMargins::GetLeft()
++{
++ return m_fLeft;
++}
++
++inline double XFMargins::GetRight()
++{
++ return m_fRight;
++}
++
++inline double XFMargins::GetTop()
++{
++ return m_fTop;
++}
++
++inline double XFMargins::GetBottom()
++{
++ return m_fBottom;
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfmasterpage.cxx lotuswordpro/source/filter/xfilter/xfmasterpage.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfmasterpage.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfmasterpage.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,132 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Master page object which was used to apply a layout to the pages.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#include "xfmasterpage.hxx"
++#include "xfpagemaster.hxx"
++#include "xfstylemanager.hxx"
++#include "xffooter.hxx"
++#include "xfheader.hxx"
++#include "../lwpglobalmgr.hxx"
++XFMasterPage::XFMasterPage()
++{
++ m_pHeader = NULL;
++ m_pFooter = NULL;
++}
++
++XFMasterPage::~XFMasterPage()
++{
++ if( m_pHeader )
++ delete m_pHeader;
++ if( m_pFooter )
++ delete m_pFooter;
++}
++
++void XFMasterPage::SetHeader(XFHeader *pHeader)
++{
++ if( m_pHeader )
++ delete m_pHeader;
++ m_pHeader = pHeader;
++}
++
++void XFMasterPage::SetFooter(XFFooter *pFooter)
++{
++ if( m_pFooter )
++ delete m_pFooter;
++ m_pFooter = pFooter;
++}
++
++enumXFStyle XFMasterPage::GetStyleFamily()
++{
++ return enumXFStyleMasterPage;
++}
++
++
++void XFMasterPage::SetPageMaster(rtl::OUString pm)
++{
++ m_strPageMaster = pm;
++}
++
++void XFMasterPage::SetPageMaster(XFPageMaster *pPM)
++{
++ if( pPM->GetStyleName().getLength() > 0 )
++ m_strPageMaster = pPM->GetStyleName();
++ else
++ {
++ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
++ m_strPageMaster = pXFStyleManager->AddStyle(pPM)->GetStyleName();
++ }
++}
++
++void XFMasterPage::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("style:name"), m_strStyleName );
++ pAttrList->AddAttribute( A2OUSTR("style:page-master-name"), m_strPageMaster );
++ pStrm->StartElement( A2OUSTR("style:master-page") );
++ if( m_pHeader )
++ m_pHeader->ToXml(pStrm);
++ if( m_pFooter )
++ m_pFooter->ToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("style:master-page") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfmasterpage.hxx lotuswordpro/source/filter/xfilter/xfmasterpage.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfmasterpage.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfmasterpage.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,99 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Master page object which was used to apply a layout to the pages.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef _XFMASTERPAGE_HXX
++#define _XFMASTERPAGE_HXX
++
++#include "xfstyle.hxx"
++#include "xfcontentcontainer.hxx"
++
++class XFPageMaster;
++class XFFooter;
++class XFHeader;
++class XFMasterPage : public XFStyle
++{
++public:
++ XFMasterPage();
++
++ virtual ~XFMasterPage();
++
++public:
++ void SetPageMaster(rtl::OUString pm);
++
++ void SetPageMaster(XFPageMaster *pPM);
++
++ void SetHeader(XFHeader *pHeader);
++
++ void SetFooter(XFFooter *pFooter);
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ rtl::OUString m_strPageMaster;
++ XFHeader *m_pHeader;
++ XFFooter *m_pFooter;
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfnumberstyle.cxx lotuswordpro/source/filter/xfilter/xfnumberstyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfnumberstyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfnumberstyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,388 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Number style for table cell.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-03-23 create this file.
++ ************************************************************************/
++#include "xfnumberstyle.hxx"
++
++XFNumberStyle::XFNumberStyle():m_aColor(0,0,0),m_aNegativeColor(255,0,0)
++{
++ m_eType = enumXFNumberNumber;
++ m_nDecimalDigits = 0;
++ m_nMinInteger = 1;
++ m_nMinExponent = 2;
++ m_bGroup = sal_False;
++ m_bRedIfNegative = sal_False;
++ m_bCurrencySymbolPost = sal_False;
++}
++
++XFNumberStyle::XFNumberStyle(enumXFNumberType type)
++{
++ m_eType = type;
++ m_nDecimalDigits = 0;
++ m_nMinInteger = 1;
++ m_nMinExponent = 1;
++ m_bRedIfNegative = sal_False;
++ m_bCurrencySymbolPost = sal_False;
++}
++
++enumXFStyle XFNumberStyle::GetStyleFamily()
++{
++ return enumXFStyleNumber;
++}
++
++sal_Bool XFNumberStyle::Equal(IXFStyle *pStyle)
++{
++ if( !pStyle || pStyle->GetStyleFamily() != enumXFStyleNumber )
++ return sal_False;
++ XFNumberStyle *pOther = (XFNumberStyle*)pStyle;
++ if( !pOther )
++ return sal_False;
++
++ if( m_eType != pOther->m_eType )
++ return sal_False;
++ if( m_nDecimalDigits != pOther->m_nDecimalDigits )
++ return sal_False;
++ if( m_nMinInteger != pOther->m_nMinInteger )
++ return sal_False;
++ if( m_bRedIfNegative != pOther->m_bRedIfNegative )
++ return sal_False;
++ if( m_bGroup != pOther->m_bGroup )
++ return sal_False;
++ if( m_aColor != pOther->m_aColor )
++ return sal_False;
++ if( m_strPrefix != pOther->m_strPrefix )
++ return sal_False;
++ if( m_strSuffix != pOther->m_strSuffix )
++ return sal_False;
++
++ //When category of number format is scientific, the number can not be displayed normally in table.
++ if ( m_nMinExponent != pOther->m_nMinExponent )
++ return sal_False;
++
++ if( m_bRedIfNegative )
++ {
++ if( m_aNegativeColor != pOther->m_aNegativeColor )
++ return sal_False;
++ if( m_strNegativePrefix != pOther->m_strNegativePrefix )
++ return sal_False;
++ if( m_strNegativeSuffix != pOther->m_strNegativeSuffix )
++ return sal_False;
++ }
++
++ if( m_eType == enuMXFNumberCurrency )
++ {
++ if( m_bCurrencySymbolPost != pOther->m_bCurrencySymbolPost )
++ return sal_False;
++ if( m_strCurrencySymbol != pOther->m_strCurrencySymbol )
++ return sal_False;
++ }
++
++ return sal_True;
++}
++
++void XFNumberStyle::ToXml(IXFStream *pStrm)
++{
++ // for Text content number format
++ if (m_eType == enumXFText)
++ {
++ ToXml_StartElement(pStrm);
++ ToXml_EndElement(pStrm);
++ return;
++ }
++ // END for Text content number format
++
++ if( !m_bRedIfNegative )
++ {
++ ToXml_Normal(pStrm);
++ }
++ else
++ {
++ ToXml_Negative(pStrm);
++ }
++}
++
++void XFNumberStyle::ToXml_StartElement(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
++ if( GetParentStyleName().getLength() > 0 )
++ pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
++
++ pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("data-style") );
++
++ if( m_eType == enumXFNumberNumber )
++ {
++ pStrm->StartElement( A2OUSTR("number:number-style") );
++ }
++ else if( m_eType == enumXFNumberPercent )
++ {
++ pStrm->StartElement( A2OUSTR("number:percentage-style") );
++ }
++ else if( m_eType == enuMXFNumberCurrency )
++ {
++ pStrm->StartElement( A2OUSTR("number:currency-style") );
++ }
++ else if( m_eType == enumXFNumberScientific )
++ {
++ pStrm->StartElement( A2OUSTR("number:number-style") );
++ }
++ // for Text content number format
++ else if (m_eType == enumXFText)
++ {
++ pStrm->StartElement( A2OUSTR("number:text-content"));
++ }
++ // END for Text content number format
++
++}
++
++void XFNumberStyle::ToXml_EndElement(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
++ pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("data-style") );
++
++ if( m_eType == enumXFNumberNumber )
++ {
++ pStrm->EndElement( A2OUSTR("number:number-style") );
++ }
++ else if( m_eType == enumXFNumberPercent )
++ {
++ pStrm->EndElement( A2OUSTR("number:percentage-style") );
++ }
++ else if( m_eType == enuMXFNumberCurrency )
++ {
++ pStrm->EndElement( A2OUSTR("number:currency-style") );
++ }
++ else if( m_eType == enumXFNumberScientific )
++ {
++ pStrm->EndElement( A2OUSTR("number:number-style") );
++ }
++ // for Text content number format
++ else if (m_eType == enumXFText)
++ {
++ pStrm->EndElement( A2OUSTR("number:text-content"));
++ }
++ // END for Text content number format
++
++}
++void XFNumberStyle::ToXml_Normal(IXFStream *pStrm)
++{
++ ToXml_StartElement(pStrm);
++
++ ToXml_Content(pStrm,sal_False);
++
++ ToXml_EndElement(pStrm);
++}
++
++void XFNumberStyle::ToXml_Negative(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ rtl::OUString strStyleName = GetStyleName();
++ rtl::OUString strGEStyle = strStyleName + A2OUSTR("PO");
++
++ SetStyleName(strGEStyle);
++ ToXml_Normal(pStrm);
++ SetStyleName(strStyleName);
++
++ ToXml_StartElement(pStrm);
++
++ ToXml_Content(pStrm,sal_True);
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("style:condition"), A2OUSTR("value()>=0") );
++ pAttrList->AddAttribute( A2OUSTR("style:apply-style-name"), strGEStyle );
++ pStrm->StartElement( A2OUSTR("style:map") );
++ pStrm->EndElement( A2OUSTR("style:map") );
++
++ ToXml_EndElement(pStrm);
++}
++
++void XFNumberStyle::ToXml_Content(IXFStream *pStrm, sal_Bool nagetive)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ //color:
++ if( !nagetive )
++ pAttrList->AddAttribute( A2OUSTR("fo:color"), m_aColor.ToString() );
++ else
++ pAttrList->AddAttribute( A2OUSTR("fo:color"), m_aNegativeColor.ToString() );
++
++ pStrm->StartElement( A2OUSTR("style:properties") );
++ pStrm->EndElement( A2OUSTR("style:properties") );
++
++ if( !nagetive )
++ {
++ if( m_strPrefix.getLength()>0 )
++ {
++ pStrm->StartElement( A2OUSTR("number:text") );
++ pStrm->Characters(m_strPrefix);
++ pStrm->EndElement( A2OUSTR("number:text") );
++ }
++ }
++ else
++ {
++ if( m_strNegativePrefix.getLength() == 0 )
++ m_strNegativePrefix = m_strPrefix;
++ if( m_strNegativePrefix.getLength()>0 )
++ {
++ pStrm->StartElement( A2OUSTR("number:text") );
++ // pStrm->Characters(m_strNegativePrefix);
++ pStrm->Characters(m_strNegativePrefix + A2OUSTR("-"));
++ pStrm->EndElement( A2OUSTR("number:text") );
++ }
++ else
++ {
++ pStrm->StartElement( A2OUSTR("number:text") );
++ pStrm->Characters(A2OUSTR("-"));
++ pStrm->EndElement( A2OUSTR("number:text") );
++ }
++ }
++
++ if( m_eType == enuMXFNumberCurrency && !m_bCurrencySymbolPost )
++ {
++ if( m_strCurrencySymbol.getLength() > 0 )
++ {
++ pStrm->StartElement( A2OUSTR("number:currency-symbol") );
++ pStrm->Characters(m_strCurrencySymbol);
++ pStrm->EndElement( A2OUSTR("number:currency-symbol") );
++ }
++ }
++
++ //When category of number format is scientific, the number can not be displayed normally in table.
++ if ( m_eType == enumXFNumberScientific )
++ {
++ pAttrList->Clear();
++ pAttrList->AddAttribute(A2OUSTR("number:decimal-places"), Int32ToOUString(m_nDecimalDigits));
++ pAttrList->AddAttribute(A2OUSTR("number:min-integer-digits"), Int32ToOUString(m_nMinInteger));
++ pAttrList->AddAttribute(A2OUSTR("number:min-exponent-digits"), Int32ToOUString(m_nMinExponent));
++ pStrm->StartElement( A2OUSTR("number:scientific-number") );
++ pStrm->EndElement( A2OUSTR("number:scientific-number") );
++ }
++ else
++ {
++ pAttrList->Clear();
++ pAttrList->AddAttribute(A2OUSTR("number:decimal-places"),Int32ToOUString(m_nDecimalDigits));
++ pAttrList->AddAttribute(A2OUSTR("number:min-integer-digits"),Int32ToOUString(m_nMinInteger));
++
++ if( m_bGroup )
++ pAttrList->AddAttribute(A2OUSTR("number:grouping"),A2OUSTR("true"));
++ else
++ pAttrList->AddAttribute(A2OUSTR("number:grouping"),A2OUSTR("false"));
++
++ pStrm->StartElement( A2OUSTR("number:number") );
++ pStrm->EndElement( A2OUSTR("number:number") );
++ }
++
++ if( m_eType == enuMXFNumberCurrency && m_bCurrencySymbolPost )
++ {
++ if( m_strCurrencySymbol.getLength()>0 )
++ {
++ pStrm->StartElement( A2OUSTR("number:currency-symbol") );
++ pStrm->Characters(m_strCurrencySymbol);
++ pStrm->EndElement( A2OUSTR("number:currency-symbol") );
++ }
++ }
++
++ if( !nagetive )
++ {
++ if( m_strSuffix.getLength()>0 )
++ {
++ pStrm->StartElement( A2OUSTR("number:text") );
++ pStrm->Characters(m_strSuffix);
++ pStrm->EndElement( A2OUSTR("number:text") );
++ }
++ else
++ {
++ if( m_eType == enumXFNumberPercent )
++ {
++ pStrm->StartElement( A2OUSTR("number:text") );
++ pStrm->Characters(A2OUSTR("%"));
++ pStrm->EndElement( A2OUSTR("number:text") );
++ }
++ }
++ }
++ else
++ {
++ if( m_strNegativeSuffix.getLength() == 0 )
++ m_strNegativeSuffix = m_strSuffix;
++ if( m_strNegativeSuffix.getLength()>0 )
++ {
++ pStrm->StartElement( A2OUSTR("number:text") );
++ pStrm->Characters(m_strNegativeSuffix);
++ pStrm->EndElement( A2OUSTR("number:text") );
++ }
++ else
++ {
++ if( m_eType == enumXFNumberPercent )
++ {
++ pStrm->StartElement( A2OUSTR("number:text") );
++ pStrm->Characters(A2OUSTR("%"));
++ pStrm->EndElement( A2OUSTR("number:text") );
++ }
++ }
++ }
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfnumberstyle.hxx lotuswordpro/source/filter/xfilter/xfnumberstyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfnumberstyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfnumberstyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,197 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Number style for table cell.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-03-23 create this file.
++ ************************************************************************/
++#ifndef _XFNUMBERSTYLE_HXX
++#define _XFNUMBERSTYLE_HXX
++
++#include "xfstyle.hxx"
++#include "xfstylemanager.hxx"
++#include "xfcolor.hxx"
++#include <rtl/ustring.hxx>
++
++class XFNumberStyle : public XFStyle
++{
++public:
++ XFNumberStyle();
++
++ XFNumberStyle(enumXFNumberType type );
++
++public:
++ void SetDecimalDigits(sal_Int32 decimal);
++
++ void SetMinInteger(sal_Int32 integer);
++
++ void SetMinExponent(sal_Int32 exponent);
++
++ void SetGroup(sal_Bool group = sal_True);
++
++ void SetColor(const XFColor& color);
++ XFColor GetColor(){return m_aColor;}//add by ,2005/11/30
++
++ void SetPrefix(rtl::OUString prefix);
++
++ void SetSurfix(rtl::OUString surfix);
++
++ void SetNegativeStyle(rtl::OUString prefix, rtl::OUString suffix, const XFColor& color=XFColor(255,0,0));
++
++ void SetNumberType(enumXFNumberType type);
++
++ void SetCurrencySymbol(sal_Bool post, rtl::OUString symbol, sal_Bool bShowSpace=sal_False);
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual sal_Bool Equal(IXFStyle *pStyle);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++protected:
++ void ToXml_StartElement(IXFStream *pStrm);
++
++ void ToXml_EndElement(IXFStream *pStrm);
++
++ void ToXml_Normal(IXFStream *pStrm);
++
++ void ToXml_Negative(IXFStream *pStrm);
++
++ void ToXml_Content(IXFStream *pStrm, sal_Bool nagetive);
++
++protected:
++ enumXFNumberType m_eType;
++ sal_Int32 m_nDecimalDigits;
++ sal_Int32 m_nMinInteger;
++ sal_Int32 m_nMinExponent;
++ sal_Bool m_bGroup;
++ XFColor m_aColor;
++ sal_Bool m_bCurrencySymbolPost;
++ rtl::OUString m_strCurrencySymbol;
++ rtl::OUString m_strPrefix;
++ rtl::OUString m_strSuffix;
++
++ sal_Bool m_bRedIfNegative;
++ XFColor m_aNegativeColor;
++ rtl::OUString m_strNegativePrefix;
++ rtl::OUString m_strNegativeSuffix;
++};
++
++inline void XFNumberStyle::SetDecimalDigits(sal_Int32 decimal)
++{
++ m_nDecimalDigits = decimal;
++}
++
++inline void XFNumberStyle::SetMinInteger(sal_Int32 integer)
++{
++ m_nMinInteger = integer;
++}
++
++inline void XFNumberStyle::SetMinExponent(sal_Int32 exponent)
++{
++ m_nMinExponent = exponent;
++}
++
++inline void XFNumberStyle::SetNegativeStyle(rtl::OUString prefix, rtl::OUString suffix, const XFColor& color)
++{
++ m_bRedIfNegative = sal_True;
++ m_aNegativeColor = color;
++ m_strNegativePrefix = prefix;
++ m_strNegativeSuffix = suffix;
++}
++
++inline void XFNumberStyle::SetGroup(sal_Bool group)
++{
++ m_bGroup = group;
++}
++
++inline void XFNumberStyle::SetColor(const XFColor& color)
++{
++ m_aColor = color;
++}
++
++inline void XFNumberStyle::SetNumberType(enumXFNumberType type)
++{
++ m_eType = type;
++}
++
++inline void XFNumberStyle::SetPrefix(rtl::OUString prefix)
++{
++ m_strPrefix = prefix;
++}
++
++inline void XFNumberStyle::SetSurfix(rtl::OUString surfix)
++{
++ m_strSuffix = surfix;
++}
++
++inline void XFNumberStyle::SetCurrencySymbol(sal_Bool post, rtl::OUString symbol, sal_Bool bShowSpace)
++{
++ m_bCurrencySymbolPost = post;
++ m_strCurrencySymbol = symbol;
++
++ if( bShowSpace )
++ {
++ if( post )
++ m_strCurrencySymbol = A2OUSTR(" ") + m_strCurrencySymbol;
++ else
++ m_strCurrencySymbol += A2OUSTR(" ");
++ }
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfnumfmt.hxx lotuswordpro/source/filter/xfilter/xfnumfmt.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfnumfmt.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfnumfmt.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,153 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Number format. a),A),i),1),(1)
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-17 create this file.
++ ************************************************************************/
++
++#ifndef _XFNUMFMT_HXX
++#define _XFNUMFMT_HXX
++
++#include "xfglobal.hxx"
++#include "ixfproperty.hxx"
++
++/**
++ * @brief
++ * Bullet number format.
++ */
++class XFNumFmt : public IXFProperty
++{
++public:
++ XFNumFmt()
++ {
++ m_nStartValue = 0;
++ }
++
++public:
++ /**********************************************************************
++ * @descr: set the prefix of the number format,that the '(' of output
++ (1 item1
++ (2 item2
++ * @param: prefix
++ *********************************************************************/
++ void SetPrefix(rtl::OUString prefix)
++ {
++ m_strPrefix = prefix;
++ }
++
++ /**********************************************************************
++ * @descr: set the suffix of the number format,that the ')' of output
++ 1) item1
++ 2) item2
++ * @param: prefix
++ *********************************************************************/
++ void SetSuffix(rtl::OUString suffix)
++ {
++ m_strSuffix = suffix;
++ }
++
++ /**********************************************************************
++ * @descr: set the display value. ie. if you set format to '1',then
++ the ouput would be:
++ 1 item1
++ 2 item2
++ or if you set the format to 'a', then the output would be:
++ a item1
++ b item2
++ some sepecial, if you set the format to a sequence,ie. "Ò,¶þ,È,..."
++ the output would be:
++ Ò item1
++ ¶þ item2
++ È item3
++
++ Of cource, for unordered-list, you can also set the format to
++ be a bullet char,ie:
++ '','','','','',
++ * @param: prefix
++ *********************************************************************/
++ void SetFormat(rtl::OUString format)
++ {
++ m_strFormat = format;
++ }
++
++ void SetStartValue(sal_Int16 start)
++ {
++ m_nStartValue = start;
++ }
++
++ virtual void ToXml(IXFStream *pStrm)
++ {
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ if( m_strPrefix.getLength() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("style:num-prefix"), m_strPrefix );
++ if( m_strSuffix.getLength() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("style:num-suffix"), m_strSuffix );
++ pAttrList->AddAttribute( A2OUSTR("style:num-format"), m_strFormat );
++ if( m_nStartValue != 0 )
++ pAttrList->AddAttribute( A2OUSTR("text:start-value"), Int16ToOUString(m_nStartValue) );
++ }
++private:
++ rtl::OUString m_strPrefix;
++ rtl::OUString m_strSuffix;
++ rtl::OUString m_strFormat;
++ sal_Int16 m_nStartValue;
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfofficemeta.cxx lotuswordpro/source/filter/xfilter/xfofficemeta.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfofficemeta.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfofficemeta.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,150 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Implemention file for Meta data,pls reference to the header file.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-26 create this file.
++ * 2004-01-05 it works now.
++ ************************************************************************/
++#include "xfofficemeta.hxx"
++#include "ixfstream.hxx"
++#include "ixfattrlist.hxx"
++
++void XFOfficeMeta::SetGenerator(rtl::OUString generator)
++{
++ m_strGenerator = generator;
++}
++
++void XFOfficeMeta::SetTitle(rtl::OUString title)
++{
++ m_strTitle = title;
++}
++
++void XFOfficeMeta::SetCreator(rtl::OUString creator)
++{
++ m_strCreator = creator;
++}
++void XFOfficeMeta::SetDescription(rtl::OUString dsr)
++{
++ m_strDsr = dsr;
++}
++void XFOfficeMeta::SetKeywords(rtl::OUString keywords)
++{
++ m_strKeywords = keywords;
++}
++void XFOfficeMeta::SetCreationTime(rtl::OUString crtime)
++{
++ m_strCrtime = crtime;
++}
++void XFOfficeMeta::SetLastTime(rtl::OUString lstime)
++{
++ m_strLstime = lstime;
++}
++void XFOfficeMeta::SetEditTime(rtl::OUString edtime)
++{
++ m_strEdtime = edtime;
++}
++void XFOfficeMeta::ToXml(IXFStream *pStream)
++{
++ IXFAttrList *pAttrList = pStream->GetAttrList();
++
++ pAttrList->Clear();
++ pStream->StartElement( A2OUSTR("office:meta") );
++
++ //generator:
++ pStream->StartElement( A2OUSTR("meta:generator") );
++ pStream->Characters( m_strGenerator );
++ pStream->EndElement( A2OUSTR("meta:generator") );
++
++ //title
++ pStream->StartElement( A2OUSTR("dc:title") );
++ pStream->Characters( m_strTitle );
++ pStream->EndElement( A2OUSTR("dc:title") );
++
++ //keywords
++ pStream->StartElement( A2OUSTR("meta:keywords") );
++ pStream->StartElement( A2OUSTR("meta:keyword") );
++ pStream->Characters( m_strKeywords );
++ pStream->EndElement( A2OUSTR("meta:keyword") );
++ pStream->EndElement( A2OUSTR("meta:keywords") );
++
++ //creation time
++ pStream->StartElement( A2OUSTR("meta:creation-date") );
++ pStream->Characters( m_strCrtime);
++ pStream->EndElement( A2OUSTR("meta:creation-date") );
++
++ //last revision time
++ pStream->StartElement( A2OUSTR("dc:date") );
++ pStream->Characters( m_strLstime);
++ pStream->EndElement( A2OUSTR("dc:date") );
++ //total edit time
++ pStream->StartElement( A2OUSTR("meta:editing-duration") );
++ pStream->Characters( m_strEdtime);
++ pStream->EndElement( A2OUSTR("meta:editing-duration") );
++
++ //description
++ pStream->StartElement( A2OUSTR("dc:description") );
++ pStream->Characters( m_strDsr );
++ pStream->EndElement( A2OUSTR("dc:description") );
++ //creator
++ pStream->StartElement( A2OUSTR("meta:initial-creator") );
++ pStream->Characters( m_strCreator );
++ pStream->EndElement( A2OUSTR("meta:initial-creator") );
++
++ pStream->EndElement( A2OUSTR("office:meta") );
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfofficemeta.hxx lotuswordpro/source/filter/xfilter/xfofficemeta.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfofficemeta.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfofficemeta.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,98 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Meta info for the full document.
++ * You can see this by click: File->Properties.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-26 create this file.
++ ************************************************************************/
++#ifndef _XFOFFICEMETA_HXX
++#define _XFOFFICEMETA_HXX
++
++#include "xfglobal.hxx"
++
++class XFOfficeMeta : public IXFObject
++{
++public:
++ XFOfficeMeta(){};
++ virtual ~XFOfficeMeta(){};
++
++ void SetGenerator(rtl::OUString generator);
++ void SetTitle(rtl::OUString title);
++ void SetCreator(rtl::OUString creator);
++ void SetDescription(rtl::OUString dsr);
++ void SetKeywords(rtl::OUString keywords);
++ void SetCreationTime(rtl::OUString crtime);
++ void SetLastTime(rtl::OUString lstime);
++ void SetEditTime(rtl::OUString edtime);
++
++ virtual void ToXml(IXFStream *pStream);
++private:
++ rtl::OUString m_strGenerator;
++ rtl::OUString m_strTitle;
++ rtl::OUString m_strCreator;
++ rtl::OUString m_strDsr;
++ rtl::OUString m_strKeywords;
++ rtl::OUString m_strCrtime;
++ rtl::OUString m_strLstime;
++ rtl::OUString m_strEdtime;
++
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfoleobj.cxx lotuswordpro/source/filter/xfilter/xfoleobj.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfoleobj.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfoleobj.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,118 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ 2005-02-25 Created
++ ************************************************************************/
++#include "xfoleobj.hxx"
++#include "xfbase64.hxx"
++
++XFOleObject::XFOleObject()
++{
++}
++
++void XFOleObject::SetOleData(sal_uInt8 *buf, int len)
++{
++ m_strData = XFBase64::Encode(buf, len);
++}
++
++void XFOleObject::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ if( GetStyleName().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("draw:style-name"), GetStyleName() );
++
++ assert(m_strName.getLength()>0); //name should not be null.
++ if( m_strName.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("draw:name"), m_strName );
++ //anchor type:
++ switch( m_eAnchor )
++ {
++ case enumXFAnchorPara:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("paragraph") );
++ break;
++ case enumXFAnchorPage:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("page") );
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-page-number"), Int32ToOUString(m_nAnchorPage) );
++ break;
++ case enumXFAnchorChar:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("char") );
++ break;
++ case enumXFAnchorAsChar:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("as-char") );
++ break;
++ case enumXFAnchorFrame:
++ pAttrList->AddAttribute( A2OUSTR("text:anchor-type"), A2OUSTR("frame") );
++ break;
++ }
++ pAttrList->AddAttribute( A2OUSTR("svg:x"), DoubleToOUString(m_aRect.GetX()) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("svg:y"), DoubleToOUString(m_aRect.GetY()) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("svg:width"), DoubleToOUString(m_aRect.GetWidth()) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("svg:height"), DoubleToOUString(m_aRect.GetHeight()) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("draw:z-index"), Int32ToOUString(m_nZIndex) );
++
++ if( m_strNextLink.getLength() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("draw:chain-next-name"), m_strNextLink );
++
++ pStrm->StartElement( A2OUSTR("draw:object-ole") );
++
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("office:binary-data") );
++ pStrm->Characters(m_strData);
++ pStrm->EndElement( A2OUSTR("office:binary-data") );
++
++ pStrm->EndElement( A2OUSTR("draw:object-ole") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfoleobj.hxx lotuswordpro/source/filter/xfilter/xfoleobj.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfoleobj.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfoleobj.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,89 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ 2005-02-25 Created
++ ************************************************************************/
++#ifndef _XFOLEOBJ_HXX
++#define _XFOLEOBJ_HXX
++
++#include "xfframe.hxx"
++
++/**
++ * @brief
++ * Ole object.
++ * Ole object is a frame object, it inherits all properties of frame obejct.
++ */
++class XFOleObject : public XFFrame
++{
++public:
++ XFOleObject();
++
++public:
++ /**
++ * @descr Set ole object data. The data will be base64 encoded before sent to SODC.
++ */
++ void SetOleData(sal_uInt8 *buf, int len);
++
++ /**
++ * @descr output ole obejct.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ rtl::OUString m_strData;
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfoutlinestyle.cxx lotuswordpro/source/filter/xfilter/xfoutlinestyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfoutlinestyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfoutlinestyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,131 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Outline style for the full document.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-02-2 create and implements.
++ ************************************************************************/
++#include "xfoutlinestyle.hxx"
++
++XFOutlineLevelStyle::XFOutlineLevelStyle()
++{
++ m_nLevel = 0;
++ m_fIndent = 0;
++ m_fMinLabelWidth = 0;
++ m_fMinLabelDistance = 0;
++ m_eAlign = enumXFAlignNone;
++ m_pNumFmt = NULL;
++}
++
++XFOutlineLevelStyle::~XFOutlineLevelStyle()
++{
++ if( m_pNumFmt )
++ delete m_pNumFmt;
++}
++
++void XFOutlineLevelStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ assert(m_nLevel>0);
++ pAttrList->AddAttribute( A2OUSTR("text:level"), Int32ToOUString(m_nLevel) );
++ if( GetStyleName().getLength() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
++ if( m_pNumFmt )
++ m_pNumFmt->ToXml(pStrm);
++ else
++ pAttrList->AddAttribute( A2OUSTR("style:num-format"), A2OUSTR("") );
++ pStrm->StartElement( A2OUSTR("text:outline-level-style") );
++
++ pAttrList->Clear();
++ if( m_fIndent )
++ pAttrList->AddAttribute( A2OUSTR("text:space-before"), DoubleToOUString(m_fIndent) + A2OUSTR("cm") );
++ if( m_fMinLabelWidth )
++ pAttrList->AddAttribute( A2OUSTR("text:min-label-width"), DoubleToOUString(m_fMinLabelWidth) + A2OUSTR("cm") );
++ if( m_fMinLabelDistance )
++ pAttrList->AddAttribute( A2OUSTR("text:min-label-distance"), DoubleToOUString(m_fMinLabelDistance) + A2OUSTR("cm") );
++ if( enumXFAlignNone != m_eAlign )
++ pAttrList->AddAttribute( A2OUSTR("fo:text-align"), GetAlignName(m_eAlign) );
++ pStrm->StartElement( A2OUSTR("style:properties") );
++ pStrm->EndElement( A2OUSTR("style:properties") );
++
++ pStrm->EndElement( A2OUSTR("text:outline-level-style") );
++}
++
++XFOutlineStyle::XFOutlineStyle()
++{
++ for( int i=0; i<10; i++ )
++ m_aLevels[i].SetLevel(i+1);
++}
++
++enumXFStyle XFOutlineStyle::GetStyleFamily()
++{
++ return enumXFStyleOutline;
++}
++
++void XFOutlineStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pStrm->StartElement( A2OUSTR("text:outline-style") );
++ for( int i=0; i<10; i++ )
++ m_aLevels[i].ToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("text:outline-style") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfoutlinestyle.hxx lotuswordpro/source/filter/xfilter/xfoutlinestyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfoutlinestyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfoutlinestyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,191 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Outline style for the full document.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-02-2 create and implements.
++ ************************************************************************/
++#ifndef _XFOUTLINESTYLE_HXX
++#define _XFOUTLINESTYLE_HXX
++
++#include "xfstyle.hxx"
++#include "xfnumfmt.hxx"
++
++class XFNumFmt;
++class XFOutlineLevelStyle : public XFStyle
++{
++public:
++ XFOutlineLevelStyle();
++
++ virtual ~XFOutlineLevelStyle();
++
++public:
++ void SetNumFmt(XFNumFmt& fmt);
++
++ void SetLevel(sal_Int16 level);
++
++ void SetIndent(double indent);
++
++ void SetMinLabelWidth(double labelWidth);
++
++ void SetMinLabelDistance(double distance);
++
++ void SetTextAlign(enumXFAlignType align);
++
++ virtual void ToXml(IXFStream *pStrm);
++private:
++ XFNumFmt *m_pNumFmt;
++ sal_Int16 m_nLevel;
++ double m_fIndent;
++ double m_fMinLabelWidth;
++ double m_fMinLabelDistance;
++ enumXFAlignType m_eAlign;
++};
++
++class XFOutlineStyle : public XFStyle
++{
++public:
++ XFOutlineStyle();
++
++public:
++ void SetNumFmt(sal_Int32 level, XFNumFmt& fmt);
++
++ void SetIndent(sal_Int32 level, double indent);
++
++ void SetMinLabelWidth(sal_Int32 level, double labelWidth);
++
++ void SetMinLabelDistance(sal_Int32 level, double distance);
++
++ void SetTextAlign(sal_Int32 level, enumXFAlignType align);
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ XFOutlineLevelStyle m_aLevels[10];
++};
++
++
++//
++//XFOutlineLevelStyle:
++//
++inline void XFOutlineLevelStyle::SetNumFmt(XFNumFmt& fmt)
++{
++ m_pNumFmt = new XFNumFmt(fmt);
++}
++
++inline void XFOutlineLevelStyle::SetLevel(sal_Int16 level)
++{
++ m_nLevel = level;
++}
++
++inline void XFOutlineLevelStyle::SetIndent(double indent)
++{
++ m_fIndent = indent;
++}
++
++inline void XFOutlineLevelStyle::SetMinLabelWidth(double width)
++{
++ m_fMinLabelWidth = width;
++}
++
++inline void XFOutlineLevelStyle::SetMinLabelDistance(double distance)
++{
++ m_fMinLabelDistance = distance;
++}
++
++inline void XFOutlineLevelStyle::SetTextAlign(enumXFAlignType align)
++{
++ m_eAlign = align;
++}
++
++//
++//XFOutlineStyle:
++//
++inline void XFOutlineStyle::SetNumFmt(sal_Int32 level, XFNumFmt& fmt)
++{
++ assert(level>=1&&level<=10);
++ m_aLevels[level].SetNumFmt(fmt);
++}
++
++inline void XFOutlineStyle::SetIndent(sal_Int32 level, double indent)
++{
++ assert(level>=1&&level<=10);
++ m_aLevels[level].SetIndent(indent);
++}
++
++inline void XFOutlineStyle::SetMinLabelWidth(sal_Int32 level, double width)
++{
++ assert(level>=1&&level<=10);
++ m_aLevels[level].SetMinLabelWidth(width);
++}
++
++inline void XFOutlineStyle::SetMinLabelDistance(sal_Int32 level, double distance)
++{
++ assert(level>=1&&level<=10);
++ m_aLevels[level].SetMinLabelDistance(distance);
++}
++
++inline void XFOutlineStyle::SetTextAlign(sal_Int32 level, enumXFAlignType align)
++{
++ assert(level>=1&&level<=10);
++ m_aLevels[level].SetTextAlign(align);
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfpadding.hxx lotuswordpro/source/filter/xfilter/xfpadding.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfpadding.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfpadding.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,210 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Padding for paragraph.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-28 move some structure out of this file.
++ ************************************************************************/
++#ifndef _XFPADDING_HXX
++#define _XFPADDING_HXX
++
++#include "xfglobal.hxx"
++#include "ixfproperty.hxx"
++
++#define XFPADDING_FLAG_LEFT 0X00000001
++#define XFPADDING_FLAG_RIGHT 0X00000002
++#define XFPADDING_FLAG_TOP 0X00000004
++#define XFPADDING_FLAG_BOTTOM 0X00000008
++
++/**
++ * @brief
++ * Padings for paragraph,frame,...
++ */
++class XFPadding : public IXFProperty
++{
++public:
++ XFPadding();
++
++public:
++ /**
++ * @descr Reset all values.
++ */
++ void Reset();
++
++ /**
++ * @descr Set padding left.
++ */
++ void SetLeft(double left);
++
++ /**
++ * @descr Set padding right.
++ */
++ void SetRight(double right);
++
++ /**
++ * @descr Set padding top.
++ */
++ void SetTop(double top);
++
++ /**
++ * @descr Set padding bottom.
++ */
++ void SetBottom(double bottom);
++
++ /**
++ * @descr Output padding properties.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++
++ friend bool operator==(XFPadding& p1, XFPadding& p2);
++ friend bool operator!=(XFPadding& p1, XFPadding& p2);
++private:
++ int m_nFlag;
++ double m_fLeft;
++ double m_fRight;
++ double m_fTop;
++ double m_fBottom;
++};
++
++
++inline XFPadding::XFPadding()
++{
++ Reset();
++}
++
++inline void XFPadding::Reset()
++{
++ m_nFlag = 0;
++ m_fLeft = 0;
++ m_fRight = 0;
++ m_fTop = 0;
++ m_fBottom = 0;
++}
++
++inline void XFPadding::SetLeft(double left)
++{
++ m_fLeft = left;
++ m_nFlag |= XFPADDING_FLAG_LEFT;
++}
++
++inline void XFPadding::SetRight(double right)
++{
++ m_fRight = right;
++ m_nFlag |= XFPADDING_FLAG_RIGHT;
++}
++
++inline void XFPadding::SetTop(double top)
++{
++ m_fTop = top;
++ m_nFlag |= XFPADDING_FLAG_TOP;
++}
++
++inline void XFPadding::SetBottom(double bottom)
++{
++ m_fBottom = bottom;
++ m_nFlag |= XFPADDING_FLAG_BOTTOM;
++}
++
++inline void XFPadding::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ if( (m_fLeft == m_fRight) && (m_fLeft == m_fTop) && (m_fLeft== m_fBottom ) && m_nFlag == 0x00000015 )
++ {
++ pAttrList->AddAttribute( A2OUSTR("fo:padding"), DoubleToOUString(m_fLeft) + A2OUSTR("cm") );
++ return;
++ }
++ //margin left:
++ if( m_nFlag&XFPADDING_FLAG_LEFT )
++ {
++ pAttrList->AddAttribute( A2OUSTR("fo:padding-left"), DoubleToOUString(m_fLeft) + A2OUSTR("cm") );
++ }
++ //margin right:
++ if( m_nFlag&XFPADDING_FLAG_RIGHT )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:padding-right"), DoubleToOUString(m_fRight) + A2OUSTR("cm") );
++ }
++ //margin top:
++ if( m_nFlag&XFPADDING_FLAG_TOP )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:padding-top"), DoubleToOUString(m_fTop) + A2OUSTR("cm") );
++ }
++ //margin bottom:
++ if( m_nFlag&XFPADDING_FLAG_BOTTOM )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:padding-bottom"), DoubleToOUString(m_fBottom) + A2OUSTR("cm") );
++ }
++}
++
++inline bool operator==(XFPadding& p1, XFPadding& p2)
++{
++ return (
++ (p1.m_nFlag == p2.m_nFlag) &&
++ (p1.m_fLeft == p2.m_fLeft) &&
++ (p1.m_fRight == p2.m_fRight) &&
++ (p1.m_fTop == p2.m_fTop) &&
++ (p1.m_fBottom == p2.m_fBottom)
++ );
++}
++
++inline bool operator!=(XFPadding& p1, XFPadding& p2)
++{
++ return !(p1==p2);
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfpagecount.hxx lotuswordpro/source/filter/xfilter/xfpagecount.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfpagecount.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfpagecount.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,89 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Page number field.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-31 create this file.
++ ************************************************************************/
++#ifndef _XFPAGECOUNT_HXX
++#define _XFPAGECOUNT_HXX
++
++#include "xfglobal.hxx"
++#include "xfcontent.hxx"
++#include "xfnumfmt.hxx"
++
++/**
++ * @brief
++ * Page count field.
++ */
++class XFPageCount : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++inline void XFPageCount::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pStrm->StartElement( A2OUSTR("text:page-count") );
++ pStrm->EndElement( A2OUSTR("text:page-count") );
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfpagemaster.cxx lotuswordpro/source/filter/xfilter/xfpagemaster.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfpagemaster.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfpagemaster.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,300 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Page master used bye XFMasterPage.
++ * It is the real object to define header and footer of pages.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-17 create this file.
++ ************************************************************************/
++#include "xfpagemaster.hxx"
++#include "ixfstream.hxx"
++#include "ixfattrlist.hxx"
++#include "xfborders.hxx"
++#include "xfshadow.hxx"
++#include "xfcolumns.hxx"
++#include "xfheaderstyle.hxx"
++#include "xffooterstyle.hxx"
++#include "xfbgimage.hxx"
++
++XFPageMaster::XFPageMaster()
++{
++ m_fPageWidth = 0;
++ m_fPageHeight = 0;
++ m_eUsage = enumXFPageUsageNone;
++ m_eTextDir = enumXFTextDirNone;
++ m_bPrintOrient = sal_True;
++ m_pBorders = NULL;
++ m_pShadow = NULL;
++ m_pColumns = NULL;
++ m_pBGImage = NULL;
++
++ m_pHeaderStyle = NULL;
++ m_pFooterStyle = NULL;
++
++ m_eSepAlign = enumXFAlignNone;
++ m_fSepWidth = 0;
++ m_aSepColor = 0;
++ m_fSepSpaceAbove = 0;
++ m_fSepSpaceBelow = 0;
++ m_nSepLengthPercent = 0;
++}
++
++XFPageMaster::~XFPageMaster()
++{
++ if( m_pBorders )
++ delete m_pBorders;
++ if( m_pShadow )
++ delete m_pShadow;
++ if( m_pColumns )
++ delete m_pColumns;
++ if( m_pHeaderStyle )
++ delete m_pHeaderStyle;
++ if( m_pFooterStyle )
++ delete m_pFooterStyle;
++ if( m_pBGImage )
++ delete m_pBGImage;
++}
++
++enumXFStyle XFPageMaster::GetStyleFamily()
++{
++ return enumXFStylePageMaster;
++}
++
++void XFPageMaster::SetPageWidth(double width)
++{
++ m_fPageWidth = width;
++}
++
++void XFPageMaster::SetPageHeight(double height)
++{
++ m_fPageHeight = height;
++}
++
++void XFPageMaster::SetMargins(double left, double right,double top, double bottom)
++{
++ if( left != -1 )
++ m_aMargin.SetLeft(left);
++ if( right != -1 )
++ m_aMargin.SetRight(right);
++ if( top != -1 )
++ m_aMargin.SetTop(top);
++ if( bottom != -1 )
++ m_aMargin.SetBottom(bottom);
++}
++
++void XFPageMaster::SetBorders(XFBorders *pBorders)
++{
++ if( m_pBorders && (pBorders != m_pBorders) )
++ delete m_pBorders;
++ m_pBorders = pBorders;
++}
++
++void XFPageMaster::SetShadow(XFShadow *pShadow)
++{
++ if( m_pShadow && (pShadow != m_pShadow) )
++ delete m_pShadow;
++ m_pShadow = pShadow;
++}
++
++void XFPageMaster::SetBackColor(XFColor color)
++{
++ m_aBackColor = color;
++}
++
++void XFPageMaster::SetBackImage(XFBGImage *image)
++{
++ if( m_pBGImage )
++ delete m_pBGImage;
++ m_pBGImage = image;
++}
++
++void XFPageMaster::SetColumns(XFColumns *pColumns)
++{
++ if( m_pColumns && (pColumns != m_pColumns) )
++ delete m_pColumns;
++ m_pColumns = pColumns;
++}
++
++ void XFPageMaster::SetHeaderStyle(XFHeaderStyle *pHeaderStyle)
++{
++ if( m_pHeaderStyle && (pHeaderStyle != m_pHeaderStyle) )
++ delete m_pHeaderStyle;
++ m_pHeaderStyle = pHeaderStyle;
++}
++
++void XFPageMaster::SetFooterStyle(XFFooterStyle *pFooterStyle)
++{
++ if( m_pFooterStyle && (pFooterStyle != m_pFooterStyle) )
++ delete m_pFooterStyle;
++ m_pFooterStyle = pFooterStyle;
++}
++
++void XFPageMaster::SetFootNoteSeparator(
++ enumXFAlignType align,
++ double width,
++ sal_Int32 lengthPercent,
++ double spaceAbove,
++ double spaceBelow,
++ XFColor color
++ )
++{
++ m_eSepAlign = align;
++ m_fSepWidth = width;
++ m_nSepLengthPercent = lengthPercent;
++ m_fSepSpaceAbove = spaceAbove;
++ m_fSepSpaceBelow = spaceBelow;
++ m_aSepColor = color;
++}
++
++/**
++ *
++ <style:page-master style:name="pm1">
++ <style:properties fo:page-width="20.999cm" fo:page-height="29.699cm" style:num-format="1"
++ style:print-orientation="portrait" fo:margin-top="1.249cm" fo:margin-bottom="1.249cm"
++ fo:margin-left="3.175cm" fo:margin-right="3.175cm" style:writing-mode="lr-tb"
++ style:layout-grid-color="#c0c0c0" style:layout-grid-lines="42"
++ style:layout-grid-base-height="0.494cm" style:layout-grid-ruby-height="0.141cm"
++ style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false"
++ style:layout-grid-display="false" style:footnote-max-height="0cm">
++ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm"
++ style:distance-after-sep="0.101cm" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
++ </style:properties>
++ <style:header-style>
++ <style:properties fo:min-height="1.291cm" fo:margin-bottom="0.792cm" style:dynamic-spacing="true"/>
++ </style:header-style>
++ <style:footer-style>
++ <style:properties fo:min-height="1.291cm" fo:margin-top="0.792cm" style:dynamic-spacing="true"/>
++ </style:footer-style>
++ </style:page-master>
++
++ */
++void XFPageMaster::ToXml(IXFStream *pStream)
++{
++ IXFAttrList *pAttrList = pStream->GetAttrList();
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute(A2OUSTR("style:name"),GetStyleName());
++
++ if( m_eUsage != enumXFPageUsageNone )
++ pAttrList->AddAttribute(A2OUSTR("style:page-usage"), GetPageUsageName(m_eUsage));
++
++ pStream->StartElement( A2OUSTR("style:page-master") );
++
++ //style:properties
++ pAttrList->Clear();
++ if( m_fPageWidth != 0 )
++ pAttrList->AddAttribute( A2OUSTR("fo:page-width"), DoubleToOUString(m_fPageWidth) + A2OUSTR("cm") );
++ if( m_fPageHeight != 0 )
++ pAttrList->AddAttribute( A2OUSTR("fo:page-height"), DoubleToOUString(m_fPageHeight) + A2OUSTR("cm") );
++
++ m_aMargin.ToXml(pStream);
++
++ if( m_bPrintOrient )
++ pAttrList->AddAttribute( A2OUSTR("style:print-orientation"), A2OUSTR("portrait") );
++ else
++ pAttrList->AddAttribute( A2OUSTR("style:print-orientation"), A2OUSTR("landscape") );
++
++ if( m_pBorders )
++ m_pBorders->ToXml(pStream);
++ if( m_pShadow )
++ pAttrList->AddAttribute( A2OUSTR("style:shadow"), m_pShadow->ToString() );
++
++ if( m_aBackColor.IsValid() )
++ pAttrList->AddAttribute( A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
++
++ //text directory
++ if( m_eTextDir != enumXFTextDirNone )
++ pAttrList->AddAttribute( A2OUSTR("style:writing-mode"), GetTextDirName(m_eTextDir) );
++
++ pStream->StartElement( A2OUSTR("style:properties") );
++ if( m_pColumns )
++ m_pColumns->ToXml(pStream);
++
++ if( m_pBGImage )
++ m_pBGImage->ToXml(pStream);
++
++ if( m_eSepAlign || m_nSepLengthPercent>0 || m_fSepSpaceAbove>0 || m_fSepSpaceBelow>0 )
++ {
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("style:width"), DoubleToOUString(m_fSepWidth) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("style:distance-before-sep"), DoubleToOUString(m_fSepSpaceAbove) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("style:distance-after-sep"), DoubleToOUString(m_fSepSpaceBelow) + A2OUSTR("cm") );
++ pAttrList->AddAttribute( A2OUSTR("style:color"), m_aSepColor.ToString() );
++ if( m_eSepAlign == enumXFAlignStart )
++ pAttrList->AddAttribute( A2OUSTR("style:adjustment"), A2OUSTR("left") );
++ else if( m_eSepAlign == enumXFAlignCenter )
++ pAttrList->AddAttribute( A2OUSTR("style:adjustment"), A2OUSTR("center") );
++ else if( m_eSepAlign == enumXFAlignEnd )
++ pAttrList->AddAttribute( A2OUSTR("style:adjustment"), A2OUSTR("right") );
++ pAttrList->AddAttribute( A2OUSTR("style:rel-width"), Int32ToOUString(m_nSepLengthPercent) + A2OUSTR("%") );
++ pStream->StartElement( A2OUSTR("style:footnote-sep") );
++ pStream->EndElement( A2OUSTR("style:footnote-sep") );
++ }
++
++ pStream->EndElement( A2OUSTR("style:properties") );
++
++ //header style:
++ if( m_pHeaderStyle )
++ m_pHeaderStyle->ToXml(pStream);
++ //footer style:
++ if( m_pFooterStyle )
++ m_pFooterStyle->ToXml(pStream);
++
++ pStream->EndElement( A2OUSTR("style:page-master") );
++
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfpagemaster.hxx lotuswordpro/source/filter/xfilter/xfpagemaster.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfpagemaster.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfpagemaster.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,169 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Page master used bye XFMasterPage.
++ * It is the real object to define header and footer of pages.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-17 create this file.
++ ************************************************************************/
++#ifndef _XFPAGEMASTER_HXX
++#define _XFPAGEMASTER_HXX
++
++#include "xfglobal.hxx"
++#include "xfstyle.hxx"
++#include "xfcolor.hxx"
++#include "xfmargins.hxx"
++
++class XFBorders;
++class XFShadow;
++class XFColumns;
++class XFHeaderStyle;
++class XFFooterStyle;
++class XFBGImage;
++
++class XFPageMaster : public XFStyle
++{
++public:
++ XFPageMaster();
++
++ virtual ~XFPageMaster();
++
++public:
++ void SetPageWidth(double width);
++
++ void SetPageHeight(double height);
++
++ void SetMargins(double left=-1, double right=-1,double top=-1, double bottom=-1);
++
++ void SetPageUsage(enumXFPageUsage usage);
++
++ void SetPrintOrient(sal_Bool bUseWidth=sal_True);
++
++ void SetBorders(XFBorders *pBorders);
++
++ void SetShadow(XFShadow *pShadow);
++
++ void SetBackColor(XFColor color);
++
++ void SetBackImage(XFBGImage *image);
++
++ void SetColumns(XFColumns *pColumns);
++
++ void SetHeaderStyle(XFHeaderStyle *pHeaderStyle);
++
++ void SetFooterStyle(XFFooterStyle *pFooterStyle);
++
++ void SetTextDir(enumXFTextDir dir);
++
++ void SetFootNoteSeparator(enumXFAlignType align = enumXFAlignStart,
++ double width = 0.05,
++ sal_Int32 lengthPercent = 25,
++ double spaceAbove = 0.1,
++ double spaceBelow = 0.1,
++ XFColor color=XFColor(0,0,0)
++ );
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual void ToXml(IXFStream *pStream);
++
++private:
++ double m_fPageWidth;
++ double m_fPageHeight;
++
++ XFMargins m_aMargin;
++
++ enumXFPageUsage m_eUsage;
++ enumXFTextDir m_eTextDir;
++ sal_Bool m_bPrintOrient;
++
++ XFBorders *m_pBorders;
++ XFShadow *m_pShadow;
++ XFColor m_aBackColor;
++ XFColumns *m_pColumns;
++ XFBGImage *m_pBGImage;
++
++ XFHeaderStyle *m_pHeaderStyle;
++ XFFooterStyle *m_pFooterStyle;
++ //seperator:
++ enumXFAlignType m_eSepAlign;
++ double m_fSepWidth;
++ XFColor m_aSepColor;
++ double m_fSepSpaceAbove;
++ double m_fSepSpaceBelow;
++ sal_Int32 m_nSepLengthPercent;
++
++};
++
++inline void XFPageMaster::SetPageUsage(enumXFPageUsage usage)
++{
++ this->m_eUsage = usage;
++}
++
++inline void XFPageMaster::SetPrintOrient(sal_Bool bUseWidth)
++{
++ m_bPrintOrient = bUseWidth;
++}
++
++inline void XFPageMaster::SetTextDir(enumXFTextDir dir)
++{
++ m_eTextDir = dir;
++}
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfpagenumber.hxx lotuswordpro/source/filter/xfilter/xfpagenumber.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfpagenumber.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfpagenumber.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,101 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Page number field.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-31 create this file.
++ ************************************************************************/
++#ifndef _XFPAGENUMBER_HXX
++#define _XFPAGENUMBER_HXX
++
++#include "xfglobal.hxx"
++#include "xfcontent.hxx"
++#include "xfnumfmt.hxx"
++
++/**
++ * @brief
++ * Page number field.
++ */
++class XFPageNumber : public XFContent
++{
++public:
++ void SetNumFmt(rtl::OUString fmt);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ XFNumFmt m_aNumFmt;
++};
++
++inline void XFPageNumber::SetNumFmt(rtl::OUString fmt)
++{
++ m_aNumFmt.SetFormat(fmt);
++}
++
++inline void XFPageNumber::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ m_aNumFmt.ToXml(pStrm);
++ pAttrList->AddAttribute( A2OUSTR("text:select-page"), A2OUSTR("current") );
++ pStrm->StartElement( A2OUSTR("text:page-number") );
++ pStrm->EndElement( A2OUSTR("text:page-number") );
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfparagraph.cxx lotuswordpro/source/filter/xfilter/xfparagraph.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfparagraph.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfparagraph.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,123 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Paragraph object of OOo, it will output <text:p >...</text:p> element.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-26 create this file.
++ ************************************************************************/
++#include "xfparagraph.hxx"
++#include "ixfstream.hxx"
++#include "ixfattrlist.hxx"
++#include "xftextcontent.hxx"
++
++XFParagraph::XFParagraph()
++{
++
++}
++
++XFParagraph::XFParagraph(rtl::OUString& text,rtl::OUString& style)
++{
++ IXFContent *pText = new XFTextContent(text);
++ Add(pText);
++
++ SetStyleName(style);
++}
++
++XFParagraph::~XFParagraph()
++{
++}
++
++enumXFContent XFParagraph::GetContentType()
++{
++ return enumXFContentPara;
++}
++
++/**
++ * The paragraph obejct serial function,the ouput will be like:
++ * <text:p>
++ * <text:span text:style-name="T1">text content</text:span>
++ * text.
++ * <text:span text:style-name="T1">text content</text:span>
++ * </text:p>
++ */
++void XFParagraph::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ assert(pAttrList);
++
++ pAttrList->Clear();
++ if( GetStyleName().getLength() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
++ pStrm->StartElement( A2OUSTR("text:p") );
++
++ XFContentContainer::ToXml(pStrm);
++
++ pStrm->EndElement( A2OUSTR("text:p") );
++}
++
++void XFParagraph::ClearContents()
++{
++ Reset();
++}
++
++sal_Bool XFParagraph::HasContents()
++{
++ return GetCount()>0;
++}
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfparagraph.hxx lotuswordpro/source/filter/xfilter/xfparagraph.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfparagraph.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfparagraph.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,99 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Paragraph object of OOo, it will output <text:p >...</text:p> element.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-26 create this file.
++ ************************************************************************/
++#ifndef _XFPARAGRAPH_HXX
++#define _XFPARAGRAPH_HXX
++
++#include "xfglobal.hxx"
++#include "xfcontentcontainer.hxx"
++#include <vector>
++
++class IXFStream;
++class IXFTextSpan;
++
++/**
++ * @brief
++ * Paragraph object for SODC.
++ * You can call Add() to add text span or drawing obejcts to XFParagraph.
++ */
++class XFParagraph : public XFContentContainer
++{
++public:
++ XFParagraph();
++
++ XFParagraph(rtl::OUString& text, rtl::OUString& style);
++
++ virtual ~XFParagraph();
++
++public:
++ void ClearContents();
++
++ sal_Bool HasContents();
++
++ virtual enumXFContent GetContentType();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfparastyle.cxx lotuswordpro/source/filter/xfilter/xfparastyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfparastyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfparastyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,527 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Styles for paragraph.
++ * Styles for paragraph may include many style,include font,indent,margin,
++ * shadow,line height,and so on.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-10 create this file.
++ * 2005-01-20 move some structure out of this file.
++ ************************************************************************/
++#include "xfparastyle.hxx"
++#include "xffont.hxx"
++#include "xfborders.hxx"
++#include "xftabstyle.hxx"
++#include "xfbgimage.hxx"
++
++XFParaStyle::XFParaStyle()
++{
++ //init member variables:
++ m_nFlag = 0;
++ m_eAlignType = enumXFAlignNone;
++ m_eLastLineAlign = enumXFAlignNone;
++ m_bJustSingleWord = sal_False;
++ m_bKeepWithNext = sal_False;
++ m_nPageNumber = 0;
++ m_fTextIndent = 0;
++
++ m_pFont = NULL;
++ m_pBorders = NULL;
++ m_pBGImage = NULL;
++
++ m_nLineNumberRestart = 0;
++ m_bNumberLines = sal_True;
++ m_bNumberRight = sal_False;
++}
++
++XFParaStyle::XFParaStyle(XFParaStyle& other)
++{
++ m_strParentStyleName = other.m_strParentStyleName;
++ m_nFlag = other.m_nFlag;
++ m_eAlignType = other.m_eAlignType;
++ m_fTextIndent = other.m_fTextIndent;
++ m_bNumberLines = other.m_bNumberLines;
++ m_nLineNumberRestart = other.m_nLineNumberRestart;
++ m_bNumberRight = other.m_bNumberRight;
++
++ if( other.m_pFont )
++ m_pFont = other.m_pFont;
++ else
++ m_pFont = NULL;
++
++ if( other.m_pBorders )
++ m_pBorders = new XFBorders(*other.m_pBorders);
++ else
++ m_pBorders = NULL;
++ m_aBackColor = other.m_aBackColor;
++ if( other.m_pBGImage )
++ m_pBGImage = new XFBGImage(*other.m_pBGImage);
++ else
++ m_pBGImage = NULL;
++
++ m_aShadow = other.m_aShadow;
++ m_aMargin = other.m_aMargin;
++ m_aDropcap = other.m_aDropcap;
++ m_aLineHeight = other.m_aLineHeight;
++ m_aPadding = other.m_aPadding;
++ m_aBreaks = other.m_aBreaks;
++// m_aTabs = other.m_aTabs;
++ for( int i=0; i<other.m_aTabs.GetCount(); i++ )
++ {
++ IXFStyle *pStyle = other.m_aTabs.Item(i);
++ if( pStyle )
++ {
++ XFTabStyle *pTabStyle = (XFTabStyle*)(pStyle);
++ if( pTabStyle )
++ {
++ XFTabStyle *pCopyStyle = new XFTabStyle(*pTabStyle);
++ m_aTabs.AddStyle(pCopyStyle);
++ }
++ }
++ }
++}
++
++XFParaStyle& XFParaStyle::operator=(XFParaStyle& other)
++{
++ m_strParentStyleName = other.m_strParentStyleName;
++ m_nFlag = other.m_nFlag;
++ m_eAlignType = other.m_eAlignType;
++ m_fTextIndent = other.m_fTextIndent;
++ m_bNumberLines = other.m_bNumberLines;
++ m_nLineNumberRestart = other.m_nLineNumberRestart;
++ m_bNumberRight = other.m_bNumberRight;
++
++ if( other.m_pFont )
++ m_pFont = other.m_pFont;
++ else
++ m_pFont = NULL;
++
++ if( other.m_pBorders )
++ m_pBorders = new XFBorders(*other.m_pBorders);
++ else
++ m_pBorders = NULL;
++ m_aBackColor = other.m_aBackColor;
++ if( other.m_pBGImage )
++ m_pBGImage = new XFBGImage(*other.m_pBGImage);
++ else
++ m_pBGImage = NULL;
++
++ m_aShadow = other.m_aShadow;
++ m_aMargin = other.m_aMargin;
++ m_aDropcap = other.m_aDropcap;
++ m_aLineHeight = other.m_aLineHeight;
++ m_aPadding = other.m_aPadding;
++ m_aBreaks = other.m_aBreaks;
++ // m_aTabs = other.m_aTabs;
++ for( int i=0; i<other.m_aTabs.GetCount(); i++ )
++ {
++ IXFStyle *pStyle = other.m_aTabs.Item(i);
++ if( pStyle )
++ {
++ XFTabStyle *pTabStyle = (XFTabStyle*)(pStyle);
++ if( pTabStyle )
++ {
++ XFTabStyle *pCopyStyle = new XFTabStyle(*pTabStyle);
++ m_aTabs.AddStyle(pCopyStyle);
++ }
++ }
++ }
++
++ return *this;
++}
++
++XFParaStyle::~XFParaStyle()
++{
++ if( m_pBorders )
++ delete m_pBorders;
++ if( m_pBGImage )
++ delete m_pBGImage;
++}
++
++enumXFStyle XFParaStyle::GetStyleFamily()
++{
++ return enumXFStylePara;
++}
++
++void XFParaStyle::SetFont(XFFont *pFont)
++{
++ m_pFont = pFont;
++}
++
++void XFParaStyle::SetIndent(double indent )
++{
++ m_fTextIndent = indent;
++}
++
++void XFParaStyle::SetMargins(double left, double right, double top, double bottom)
++{
++ if( left != -1 )
++ m_aMargin.SetLeft(left);
++ if( right != -1 )
++ m_aMargin.SetRight(right);
++ if( top != -1 )
++ m_aMargin.SetTop(top);
++ if( bottom != -1 )
++ m_aMargin.SetBottom( bottom );
++}
++
++void XFParaStyle::SetShadow(enumXFShadowPos pos, double offset, XFColor& color)
++{
++ m_aShadow.SetPosition(pos);
++ m_aShadow.SetOffset(offset);
++ m_aShadow.SetColor(color);
++}
++
++void XFParaStyle::SetBackColor(XFColor& color)
++{
++ m_aBackColor = color;
++ m_nFlag |= XFPARA_FLAG_BACKCOLOR;
++}
++
++void XFParaStyle::SetBackImage(XFBGImage *image)
++{
++ if( m_pBGImage )
++ delete m_pBGImage;
++ m_pBGImage = image;
++}
++
++void XFParaStyle::SetBorders(XFBorders *pBorders)
++{
++ if( m_pBorders )
++ delete m_pBorders;
++ m_pBorders = pBorders;
++}
++
++void XFParaStyle::SetDropCap(sal_Int16 nLength,
++ sal_Int16 nLines,
++ double fDistance
++ )
++{
++ assert(nLength>=1);
++ assert(nLines>=2);
++ assert(fDistance>=0);
++
++ m_aDropcap.SetCharCount(nLength);
++ m_aDropcap.SetLines(nLines);
++ m_aDropcap.SetDistance(fDistance);
++}
++
++void XFParaStyle::SetLineHeight(enumLHType type, double value)
++{
++ if( type == enumLHNone )
++ {
++ return;
++ }
++ switch(type)
++ {
++ case enumLHHeight:
++ m_aLineHeight.SetHeight(value) ;
++ break;
++ case enumLHLeast:
++ m_aLineHeight.SetLeastHeight(value);
++ break;
++ case enumLHPercent: //perhaps i should redesign the interface here,ohm..
++ m_aLineHeight.SetPercent((sal_Int32)value);
++ break;
++ case enumLHSpace:
++ m_aLineHeight.SetSpace(value*0.5666); //don't known why,just suspect.
++ break;
++ }
++}
++
++void XFParaStyle::AddTabStyle(enumXFTab type, double len, sal_Unicode leader, sal_Unicode delimiter)
++{
++ XFTabStyle *tab = new XFTabStyle();
++ tab->SetTabType(type);
++ tab->SetLength(len);
++ tab->SetLeaderChar(leader);
++ tab->SetDelimiter(delimiter);
++ m_aTabs.AddStyle(tab);
++}
++
++/**
++ *Affirm whether two XFParaStyle objects are equal.
++ */
++sal_Bool XFParaStyle::Equal(IXFStyle *pStyle)
++{
++ if( this == pStyle )
++ return sal_True;
++ if( !pStyle || pStyle->GetStyleFamily() != enumXFStylePara )
++ return sal_False;
++
++ XFParaStyle *pOther = (XFParaStyle*)(pStyle);
++ if( !pOther )
++ return sal_False;
++
++ if( m_nFlag != pOther->m_nFlag )
++ return sal_False;
++ if( m_strParentStyleName != pOther->m_strParentStyleName )
++ return sal_False;
++ if( m_strMasterPage != pOther->m_strMasterPage )
++ return sal_False;
++ if( m_fTextIndent != pOther->m_fTextIndent )
++ return sal_False;
++ if( m_bJustSingleWord != pOther->m_bJustSingleWord )
++ return sal_False;
++ if( m_bKeepWithNext != pOther->m_bKeepWithNext )
++ return sal_False;
++ //line number:
++ if( m_bNumberLines != pOther->m_bNumberLines )
++ return sal_False;
++ if( m_nLineNumberRestart != pOther->m_nLineNumberRestart )
++ return sal_False;
++ //align:
++ if( m_eAlignType != pOther->m_eAlignType )
++ return sal_False;
++ //last line align:
++ if( m_eLastLineAlign != pOther->m_eLastLineAlign )
++ return sal_False;
++
++ //shadow:
++ if( m_aShadow != pOther->m_aShadow )
++ return sal_False;
++ //margin:
++ if( m_aMargin != pOther->m_aMargin )
++ return sal_False;
++
++ if( m_aPadding != pOther->m_aPadding )
++ return sal_False;
++
++ //dropcap:
++ if( m_aDropcap != pOther->m_aDropcap )
++ return sal_False;
++ //line height:
++ if( m_aLineHeight != pOther->m_aLineHeight )
++ return sal_False;
++ //breaks:
++ if( m_aBreaks != pOther->m_aBreaks )
++ return sal_False;
++ if( m_nPageNumber != pOther->m_nPageNumber )
++ return sal_False;
++ if( m_aTabs != pOther->m_aTabs )
++ return sal_False;
++
++ //font:
++ if( m_pFont )
++ {
++ if( !pOther->m_pFont )
++ return sal_False;
++ if(*m_pFont != *pOther->m_pFont )
++ return sal_False;
++ }
++ else if( pOther->m_pFont )
++ return sal_False;
++
++ //border:
++ if( m_pBorders )
++ {
++ if( !pOther->m_pBorders )
++ return sal_False;
++ if( *m_pBorders != *pOther->m_pBorders )
++ return sal_False;
++ }
++ else if( pOther->m_pBorders )
++ return sal_False;
++
++ if( m_pBGImage )
++ {
++ if( !pOther->m_pBGImage )
++ return sal_False;
++ if( *m_pBGImage != *pOther->m_pBGImage )
++ return sal_False;
++ }
++ else if( pOther->m_pBGImage )
++ return sal_False;//add end
++
++ //number right
++ if ( m_bNumberRight != pOther->m_bNumberRight)
++ return sal_False;
++
++ return sal_True;
++}
++
++void XFParaStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ rtl::OUString style = GetStyleName();
++
++ pAttrList->Clear();
++ if( style.getLength() )
++ pAttrList->AddAttribute(A2OUSTR("style:name"),GetStyleName());
++ pAttrList->AddAttribute(A2OUSTR("style:family"), A2OUSTR("paragraph"));
++ if( GetParentStyleName().getLength() > 0 )
++ pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
++
++ if( m_strMasterPage.getLength() > 0 )
++ pAttrList->AddAttribute(A2OUSTR("style:master-page-name"),m_strMasterPage);
++ pStrm->StartElement(A2OUSTR("style:style"));
++
++ //Paragraph properties:
++ pAttrList->Clear();
++
++ //text indent:
++ if( m_fTextIndent )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:text-indent"), DoubleToOUString(m_fTextIndent) + A2OUSTR("cm") );
++ }
++ //padding:
++ m_aPadding.ToXml(pStrm);
++ //margin:
++ m_aMargin.ToXml(pStrm);
++
++ //text align:
++ if( m_eAlignType != enumXFAlignNone )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:text-align"), GetAlignName(m_eAlignType) );
++ }
++ //last line align:
++ if( m_eLastLineAlign != enumXFAlignNone )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:fo:text-align-last"), GetAlignName(m_eLastLineAlign) );
++ if( m_bJustSingleWord )
++ pAttrList->AddAttribute(A2OUSTR("style:justify-single-word"), A2OUSTR("true") );
++ }
++ //line number:
++ if( m_bNumberLines )
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:number-lines"), A2OUSTR("true") );
++ pAttrList->AddAttribute( A2OUSTR("text:line-number"), Int32ToOUString(m_nLineNumberRestart) );
++ }
++ else
++ {
++ pAttrList->AddAttribute( A2OUSTR("text:number-lines"), A2OUSTR("false") );
++ assert(m_nLineNumberRestart>0);
++ pAttrList->AddAttribute( A2OUSTR("text:line-number"), A2OUSTR("0") );
++ }
++
++ //shadow:
++ m_aShadow.ToXml(pStrm);
++ //borders:
++ if( m_pBorders )
++ m_pBorders->ToXml(pStrm);
++ //line height:
++ m_aLineHeight.ToXml(pStrm);
++
++ //background color:
++ if( m_nFlag&XFPARA_FLAG_BACKCOLOR && m_aBackColor.IsValid() )
++ {
++ pAttrList->AddAttribute(A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
++ }
++ //Font properties:
++ if( m_pFont )
++ m_pFont->ToXml(pStrm);
++
++ //page number:
++ if( m_nPageNumber )
++ pAttrList->AddAttribute(A2OUSTR("fo:page-number"), Int32ToOUString(m_nPageNumber) );
++ //page breaks:
++ m_aBreaks.ToXml(pStrm);
++
++ if( m_bKeepWithNext )
++ pAttrList->AddAttribute(A2OUSTR("fo:fo:keep-with-next"), A2OUSTR("true") );
++
++ pStrm->StartElement(A2OUSTR("style:properties"));
++
++ //dropcap:
++ m_aDropcap.ToXml(pStrm);
++
++ //tabs:
++ if( m_aTabs.GetCount() > 0 )
++ {
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("style:tab-stops") );
++ m_aTabs.ToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("style:tab-stops") );
++ }
++
++ //background color:
++ if( m_pBGImage )
++ m_pBGImage->ToXml(pStrm);
++
++ pStrm->EndElement(A2OUSTR("style:properties"));
++
++ pStrm->EndElement(A2OUSTR("style:style"));
++}
++
++XFDefaultParaStyle::XFDefaultParaStyle()
++{
++ m_fTabDistance = 1.28;
++}
++
++enumXFStyle XFDefaultParaStyle::GetStyleFamily()
++{
++ return enumXFStyleDefaultPara;
++}
++
++
++void XFDefaultParaStyle::ToXml(IXFStream * pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ pAttrList->AddAttribute(A2OUSTR("style:family"), A2OUSTR("paragraph"));
++ pStrm->StartElement(A2OUSTR("style:default-style"));
++
++ //Paragraph properties:
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute(A2OUSTR("style:tab-stop-distance"), DoubleToOUString(m_fTabDistance) + A2OUSTR("cm") );
++
++ pStrm->StartElement(A2OUSTR("style:properties"));
++ pStrm->EndElement(A2OUSTR("style:properties"));
++ pStrm->EndElement(A2OUSTR("style:default-style"));
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfparastyle.hxx lotuswordpro/source/filter/xfilter/xfparastyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfparastyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfparastyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,364 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Styles for paragraph.
++ * Styles for paragraph may include many style,include font,indent,margin,
++ * shadow,line height,and so on.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-10 create this file.
++ * 2005-01-20 move some structure out of this file.
++ ************************************************************************/
++#ifndef _XFPARASTYLE_HXX
++#define _XFPARASTYLE_HXX
++
++#include "xfglobal.hxx"
++#include "xfstyle.hxx"
++#include "xfcolor.hxx"
++#include "xfmargins.hxx"
++#include "xfbreaks.hxx"
++#include "xfpadding.hxx"
++#include "xfshadow.hxx"
++#include "xfdropcap.hxx"
++#include "xfstylecont.hxx"
++#include "xflineheight.hxx"
++
++#define XFPARA_FLAG_FONT 0X00000001
++#define XFPARA_FLAG_DROPCAP 0X00000002
++#define XFPARA_FLAG_BACKCOLOR 0X00000004
++
++class XFFont;
++class XFBorders;
++class XFBGImage;
++
++/**
++ * @brief
++ * Style object for aragraph.
++ */
++class XFParaStyle : public XFStyle
++{
++public:
++ XFParaStyle();
++
++ XFParaStyle(XFParaStyle& other);
++
++ XFParaStyle& operator=(XFParaStyle& other);
++
++ virtual ~XFParaStyle();
++
++public:
++ /**
++ * @descr Set layout for the paragraph.When such property was setted, this paragraph will
++ * start at an new page.
++ */
++ void SetMasterPage(rtl::OUString master);
++
++ rtl::OUString GetMasterPage();
++
++ /**
++ * @descr set the paragraph defaut font.
++ * @param font font obejct to be setted.Font object are deleted by font-factory,so
++ * dont't delete it in the destructure function of para style.
++ */
++ void SetFont(XFFont *font);
++
++ /**
++ * @descr get the font object.
++ */
++ XFFont* GetFont(){ return m_pFont; }
++
++ /**
++ * @descr Set the indent of the paragraph.This is the indent for
++ the first line.
++ * @param indent value of the first-line indent.
++ */
++ void SetIndent(double indent );
++
++ /**
++ * @descr Set line number style.
++ */
++ void SetLineNumber(sal_Bool show, sal_Int32 restart=1);
++ /**
++ * @descr Set the pading of the paragraph.This is the distance
++ between the border and the top of the text.
++ * @param indent value of the padding.
++ */
++ void SetPadding(double left, double right = -1, double top = -1, double bottom = -1);
++
++ /**
++ * @descr Set the Margins of the paragraph.
++ * @param -1: don't change.
++ other: set value.
++ */
++ void SetMargins(double left, double right=-1,double top=-1, double bottom=-1);
++
++ /**
++ * @descr Set alignment property of the paragraph.
++ * @param eAlign alignment type,left,right,center or justify.
++ */
++ void SetAlignType(enumXFAlignType eAlign);
++
++ enumXFAlignType GetAlighType();
++
++
++ /**
++ * @descr Set last line alignment property of the paragraph.
++ * @param eAlign alignment type,left,right,center or justify.
++ eJustSingleWord If chars of the last-line'word should be
++ stretched.
++ */
++ void SetLastLineAlign(enumXFAlignType align,sal_Bool bJustSingleWord = sal_False);
++
++ /**
++ * @descr Set the shadow of the paragraph.there is 4 postions, you
++ can find it in the definition of enumShadowPos.
++ * @param pos
++ * @param offset the distance between the paragraph border and the shadow.
++ * @param color color to fill the shadow.
++ */
++ void SetShadow(enumXFShadowPos pos, double offset, XFColor& color);
++
++ /**
++ * @descr The borders is complex,so you have to create one before use.
++ Very few paragraphs will readly have borders property,this way
++ we can save much memory.
++ * @param pBorders borders of the paragraph,please reference the XFBorders.
++ */
++ void SetBorders(XFBorders *pBorders);
++
++ /**
++ * @descr Set drop caption of the paragraph.
++ * @param nLength number of chars to be droped.
++ * @param nLines line of which the droped chars will occupy.
++ */
++ void SetDropCap(sal_Int16 nLength = 1,sal_Int16 nLines = 3,double fDistance = 0);
++
++ /**
++ * @descr Set line height of the paragraph.
++ * @param type type of line height,fixed,space,percent or cm.
++ * @param value value of the line height
++ */
++ void SetLineHeight(enumLHType type, double value);
++
++ /**
++ * @descr Set background color of the paragraph.
++ * @param color value of the back color.
++ */
++ void SetBackColor(XFColor& color);
++
++ /**
++ * @descr Set background image of the paragraph.
++ * @param image the background image to set.
++ */
++ void SetBackImage(XFBGImage *image);
++
++ /**
++ * descr You can only set one break property for every para style object.
++ */
++ void SetBreaks(enumXFBreaks breaks);
++
++ /**
++ * @descr For paragraph numbering.
++ */
++ void SetPageNumber(sal_Int32 num);
++
++ /**
++ * @descr Add a tab style.
++ */
++ void AddTabStyle(enumXFTab type, double len, sal_Unicode leader = '*', sal_Unicode delimiter='.');
++
++ /**
++ * @descr for para style copy operator,sometimes you may need to override tab styles.
++ */
++ void ClearTabStyles();
++
++ /**
++ * descr set the paragraph to be in the same page with the next paragraph.
++ * If that can't be insured,the paragraph will start with a new page.
++ */
++ void SetKeepWithNext(sal_Bool keepWithNext);
++
++ sal_uInt32 GetFlag(){ return m_nFlag; }
++
++ /**
++ * @descr return margins.
++ */
++ XFMargins GetMargins(){return m_aMargin;}
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual sal_Bool Equal(IXFStyle *pStyle);
++
++ virtual void ToXml(IXFStream *strm);
++
++ void SetNumberRight(sal_Bool bFlag){m_bNumberRight = bFlag;}
++ sal_Bool GetNumberRight(){return m_bNumberRight;}
++
++protected:
++ rtl::OUString m_strMasterPage;
++ enumXFAlignType m_eAlignType;
++ enumXFAlignType m_eLastLineAlign;
++ sal_Bool m_bJustSingleWord;
++ sal_Bool m_bKeepWithNext;
++
++ double m_fTextIndent;
++ XFColor m_aBackColor;
++ XFMargins m_aMargin;
++ XFPadding m_aPadding;
++ XFStyleContainer m_aTabs;
++ XFFont *m_pFont;
++ XFShadow m_aShadow;
++ XFBorders *m_pBorders;
++ XFBGImage *m_pBGImage;
++ XFDropcap m_aDropcap;
++ XFLineHeight m_aLineHeight;
++ XFBreaks m_aBreaks;
++ sal_Int32 m_nPageNumber;
++ sal_Bool m_bNumberLines;
++ sal_Int32 m_nLineNumberRestart;
++
++ sal_uInt32 m_nFlag;
++ sal_Bool m_bNumberRight;
++};
++
++inline void XFParaStyle::SetMasterPage(rtl::OUString master)
++{
++ m_strMasterPage = master;
++}
++
++inline void XFParaStyle::SetBreaks(enumXFBreaks breaks)
++{
++ m_aBreaks.SetBreakType(breaks);
++}
++
++inline void XFParaStyle::SetPageNumber(sal_Int32 num)
++{
++ assert(num>0);
++ m_nPageNumber = num;
++}
++
++inline void XFParaStyle::SetLineNumber(sal_Bool show, sal_Int32 restart)
++{
++ m_bNumberLines = show;
++ m_nLineNumberRestart = restart;
++}
++
++inline void XFParaStyle::SetPadding(double left, double right, double top, double bottom)
++{
++ m_aPadding.SetLeft(left);
++ if( right == -1 )
++ m_aPadding.SetRight(left);
++ else
++ m_aPadding.SetRight(right);
++ if( top == -1 )
++ m_aPadding.SetTop(left);
++ else
++ m_aPadding.SetTop(top);
++ if( bottom == -1 )
++ m_aPadding.SetBottom(left);
++ else
++ m_aPadding.SetBottom(bottom);
++}
++
++inline void XFParaStyle::SetAlignType(enumXFAlignType eAlign)
++{
++ m_eAlignType = eAlign;
++}
++
++inline void XFParaStyle::SetLastLineAlign(enumXFAlignType align, sal_Bool bJustSingleWord)
++{
++ m_eLastLineAlign = align;
++ m_bJustSingleWord = bJustSingleWord;
++}
++
++inline void XFParaStyle::SetKeepWithNext(sal_Bool keep)
++{
++ m_bKeepWithNext = keep;
++}
++
++inline void XFParaStyle::ClearTabStyles()
++{
++ m_aTabs.Reset();
++}
++
++inline rtl::OUString XFParaStyle::GetMasterPage()
++{
++ return m_strMasterPage;
++}
++
++inline enumXFAlignType XFParaStyle::GetAlighType()
++{
++ return m_eAlignType;
++}
++
++class XFDefaultParaStyle : public XFStyle
++{
++public:
++ XFDefaultParaStyle();
++ void SetTabDistance(double len);
++ enumXFStyle GetStyleFamily();
++ virtual void ToXml(IXFStream *pStrm);
++private:
++ double m_fTabDistance;
++};
++
++inline void XFDefaultParaStyle::SetTabDistance(double len)
++{
++ m_fTabDistance = len;
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfplaceholder.hxx lotuswordpro/source/filter/xfilter/xfplaceholder.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfplaceholder.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfplaceholder.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,144 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * place holder object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-05-24 create this file.
++ ************************************************************************/
++
++#ifndef _XFPLACEHOLDER_HXX
++#define _XFPLACEHOLDER_HXX
++
++#include "xfcontent.hxx"
++
++/**
++ * @brief
++ * Index entry obejct.
++ */
++class XFHolderStart : public XFContent
++{
++public:
++ XFHolderStart();
++ ~XFHolderStart();
++ void SetType(rtl::OUString sType);
++ void SetDesc(rtl::OUString sDesc);
++ void SetPrompt(rtl::OUString sText);
++ void ToXml(IXFStream *pStrm);
++private:
++ rtl::OUString m_strType;
++ rtl::OUString m_strDesc;
++ rtl::OUString m_strText;
++};
++
++XFHolderStart::XFHolderStart()
++{
++}
++
++XFHolderStart::~XFHolderStart()
++{
++}
++
++inline void XFHolderStart::SetType(rtl::OUString sType)
++{
++ m_strType = sType;
++}
++
++inline void XFHolderStart::SetDesc(rtl::OUString sDesc)
++{
++ m_strDesc = sDesc;
++}
++
++inline void XFHolderStart::SetPrompt(rtl::OUString sText)
++{
++ m_strText = sText;
++}
++
++inline void XFHolderStart::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("text:placeholder-type"),m_strType);
++ if (m_strDesc.getLength()>0)
++ pAttrList->AddAttribute( A2OUSTR("text:description"), m_strDesc);
++ pStrm->StartElement( A2OUSTR("text:placeholder") );
++ if( m_strText.getLength()>0)
++ pStrm->Characters(m_strText);
++}
++
++class XFHolderEnd : public XFContent
++{
++public:
++ XFHolderEnd();
++ ~XFHolderEnd();
++ void ToXml(IXFStream *pStrm);
++};
++
++XFHolderEnd::XFHolderEnd()
++{
++}
++
++XFHolderEnd::~XFHolderEnd()
++{
++}
++
++inline void XFHolderEnd::ToXml(IXFStream *pStrm)
++{
++ pStrm->EndElement( A2OUSTR("text:placeholder") );
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfpoint.hxx lotuswordpro/source/filter/xfilter/xfpoint.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfpoint.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfpoint.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,106 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Reperesent a point.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-18 create this file.
++ ************************************************************************/
++#ifndef _XFPOINT_HXX
++#define _XFPOINT_HXX
++
++class XFPoint
++{
++public:
++ XFPoint()
++ {
++ m_fX = m_fY = 0;
++ }
++
++ XFPoint(double x, double y)
++ {
++ m_fX = x;
++ m_fY = y;
++ }
++
++public:
++ void SetX(double x)
++ {
++ m_fX = x;
++ }
++
++ void SetY(double y)
++ {
++ m_fY = y;
++ }
++
++ double GetX() const
++ {
++ return m_fX;
++ }
++
++ double GetY() const
++ {
++ return m_fY;
++ }
++
++private:
++ double m_fX;
++ double m_fY;
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfpvector.hxx lotuswordpro/source/filter/xfilter/xfpvector.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfpvector.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfpvector.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,100 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Pointer vector.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef _XFPVECTOR_HXX
++#define _XFPVECTOR_HXX
++
++#include <vector>
++
++template<class T>
++class XFPVector : public std::vector<T>
++{
++public:
++ ~XFPVector()
++ {
++ std::vector<T>::iterator it;
++ for( it=begin(); it != end(); it++ )
++ {
++ T pT = *it;
++ if( pT )
++ {
++ delete pT;
++ }
++ }
++ }
++
++ void Reset()
++ {
++ std::vector<T>::iterator it;
++ for( it=begin(); it != end(); it++ )
++ {
++ T *pT = *it;
++ if( pT )
++ {
++ delete pT;
++ }
++ }
++ clear();
++ }
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfrect.hxx lotuswordpro/source/filter/xfilter/xfrect.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfrect.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfrect.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,140 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Rect object
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-2-18 create this file.
++ ************************************************************************/
++#ifndef _XFRECT_HXX
++#define _XFRECT_HXX
++
++#include "xfpoint.hxx"
++
++class XFRect
++{
++public:
++ XFRect()
++ {
++ m_fWidth = m_fHeight = 0;
++ }
++
++ XFRect(double x, double y, double width, double height):m_aPoint(x,y)
++ {
++ m_fWidth = width;
++ m_fHeight = height;
++ }
++
++public:
++ void SetX(double x)
++ {
++ m_aPoint.SetX(x);
++ }
++
++ double GetX() const
++ {
++ return m_aPoint.GetX();
++ }
++
++ void SetY(double y)
++ {
++ m_aPoint.SetY(y);
++ }
++
++ double GetY() const
++ {
++ return m_aPoint.GetY();
++ }
++
++ void SetWidth(double width)
++ {
++ m_fWidth = width;
++ }
++
++ double GetWidth() const
++ {
++ return m_fWidth;
++ }
++
++ void SetHeight(double height)
++ {
++ m_fHeight = height;
++ }
++
++ double GetHeight() const
++ {
++ return m_fHeight;
++ }
++
++ void SetStartPoint(XFPoint pt)
++ {
++ m_aPoint = pt;
++ }
++
++ void SetSize(double width, double height)
++ {
++ m_fWidth = width;
++ m_fHeight = height;
++ }
++
++public:
++ XFPoint m_aPoint;
++ double m_fWidth;
++ double m_fHeight;
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfrow.cxx lotuswordpro/source/filter/xfilter/xfrow.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfrow.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfrow.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,185 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Table object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-24 create and implements.
++ ************************************************************************/
++#include "xfrow.hxx"
++#include "xfcell.hxx"
++#include "xftable.hxx"
++
++XFRow::XFRow()
++{
++ m_nRepeat = 0;
++ m_nRow = 0;
++}
++
++XFRow::XFRow(const XFRow& other)
++{
++ m_pOwnerTable = NULL;
++ m_nRepeat = other.m_nRepeat;
++ m_nRow = other.m_nRow;
++
++ for( int i=1; i<=other.GetCellCount(); i++ )
++ {
++ XFCell *pCell = new XFCell;
++ *pCell = *other.GetCell(i);
++ AddCell(pCell);
++ }
++}
++
++XFRow& XFRow::operator=(const XFRow& other)
++{
++ m_pOwnerTable = NULL;
++ m_nRepeat = other.m_nRepeat;
++ m_nRow = other.m_nRow;
++
++ for( int i=1; i<=other.GetCellCount(); i++ )
++ {
++ XFCell *pCell = new XFCell;
++ *pCell = *other.GetCell(i);
++ AddCell(pCell);
++ }
++ return *this;
++}
++
++
++XFRow::~XFRow()
++{
++ std::map<sal_Int32,XFCell*>::iterator it;
++ for( it=m_aCells.begin(); it!=m_aCells.end(); it++ )
++ {
++ XFCell *pCell = (*it).second;
++ if( pCell )
++ delete pCell;
++ }
++}
++
++void XFRow::AddCell(XFCell *pCell)
++{
++ if( !pCell )
++ return;
++/* sal_Int32 col = pCell->GetCol();
++ if( col<1 )
++ {
++ pCell->SetCol(m_aCells.size()+1);
++ }
++
++ col = pCell->GetCol();
++ if( m_aCells.find(col) != m_aCells.end() )
++ delete m_aCells[col];
++*/
++ sal_Int32 col = m_aCells.size()+1;
++ pCell->SetCol(col);
++ pCell->SetOwnerRow(this);
++ m_aCells[col]=pCell;
++}
++
++sal_Int32 XFRow::GetCellCount() const
++{
++ return m_aCells.size();
++}
++
++XFCell* XFRow::GetCell(sal_Int32 col) const
++{
++ if( m_aCells.find(col) == m_aCells.end() )
++ return NULL;
++ else
++ return m_aCells.find(col)->second;
++}
++
++rtl::OUString XFRow::GetRowName()
++{
++ if( m_pOwnerTable && m_pOwnerTable->IsSubTable() )
++ return m_pOwnerTable->GetTableName();
++ return A2OUSTR("");
++}
++
++void XFRow::ToXml(IXFStream *pStrm)
++{
++ sal_Int32 lastCol = 0;
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ if( GetStyleName().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("table:style-name"), GetStyleName() );
++ if( m_nRepeat )
++ pAttrList->AddAttribute( A2OUSTR("table:number-rows-repeated"), Int32ToOUString(m_nRepeat) );
++ pStrm->StartElement( A2OUSTR("table:table-row") );
++
++ std::map<sal_Int32,XFCell*>::iterator it = m_aCells.begin();
++ for( ; it!=m_aCells.end(); it++ )
++ {
++ int col = (*it).first;
++ XFCell *pCell = (*it).second;
++ if( !pCell )
++ continue;
++ if( col>lastCol+1 )
++ {
++ XFCell *pNULLCell = new XFCell();
++ if( col>lastCol+2 )
++ pNULLCell->SetRepeated(col-lastCol-1);
++ pNULLCell->ToXml(pStrm);
++ }
++ pCell->ToXml(pStrm);
++ lastCol = col;
++ }
++
++ pStrm->EndElement( A2OUSTR("table:table-row") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfrow.hxx lotuswordpro/source/filter/xfilter/xfrow.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfrow.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfrow.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,142 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Table row object. A table is consist by rows.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-28 create and implements.
++ ************************************************************************/
++#ifndef _XFROW_HXX
++#define _XFROW_HXX
++
++#include "xfcontent.hxx"
++#include <map>
++
++class XFCell;
++class XFTable;
++class XFRow : public XFContent
++{
++public:
++ XFRow();
++
++ XFRow(const XFRow& other);
++
++ XFRow& operator=(const XFRow& other);
++
++ virtual ~XFRow();
++
++public:
++ void AddCell(XFCell *pCell);
++
++ void SetRepeated(sal_Int32 repeat);
++
++ void SetRow(sal_Int32 row);
++
++ void SetOwnerTable(XFTable *pTable);
++
++ sal_Int32 GetRow();
++
++ sal_Int32 GetCellCount() const;
++
++ XFCell* GetCell(sal_Int32 col) const;
++
++ XFTable* GetOwnerTable();
++
++ rtl::OUString GetRowName();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++ void RemoveCell(sal_Int32 cell);
++
++private:
++ XFTable *m_pOwnerTable;
++ std::map<sal_Int32,XFCell*> m_aCells;
++ sal_Int32 m_nRepeat;
++ sal_Int32 m_nRow;
++};
++
++inline void XFRow::SetRepeated(sal_Int32 repeat)
++{
++ m_nRepeat = repeat;
++}
++
++inline void XFRow::SetRow(sal_Int32 row)
++{
++ m_nRow = row;
++}
++
++inline void XFRow::SetOwnerTable(XFTable *pTable)
++{
++ m_pOwnerTable = pTable;
++}
++
++inline sal_Int32 XFRow::GetRow()
++{
++ return m_nRow;
++}
++
++inline XFTable* XFRow::GetOwnerTable()
++{
++ return m_pOwnerTable;
++}
++
++inline void XFRow::RemoveCell(sal_Int32 cell)
++{
++ m_aCells.erase(cell);
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfrowstyle.cxx lotuswordpro/source/filter/xfilter/xfrowstyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfrowstyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfrowstyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,129 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Table row style, ie. table row height.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-28 create and implements.
++ ************************************************************************/
++#include "xfrowstyle.hxx"
++#include "xfbgimage.hxx"
++
++XFRowStyle::XFRowStyle():m_fHeight(0)
++{
++ m_fHeight = 0;
++ m_fMinHeight = 0;
++ m_pBGImage = NULL;
++}
++
++
++void XFRowStyle::SetbackImage(XFBGImage *pImage)
++{
++ if( m_pBGImage )
++ delete m_pBGImage;
++ m_pBGImage = pImage;
++}
++
++enumXFStyle XFRowStyle::GetStyleFamily()
++{
++ return enumXFStyleTableRow;
++}
++
++void XFRowStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
++ if( GetParentStyleName().getLength() > 0 )
++ pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
++
++ pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("table-row") );
++ pStrm->StartElement( A2OUSTR("style:style") );
++
++ pAttrList->Clear();
++ if( m_fMinHeight )
++ pAttrList->AddAttribute( A2OUSTR("style:min-row-height"), DoubleToOUString(m_fMinHeight) + A2OUSTR("cm") );
++ else if( m_fHeight )
++ pAttrList->AddAttribute( A2OUSTR("style:row-height"), DoubleToOUString(m_fHeight) + A2OUSTR("cm") );
++
++ if( m_aBackColor.IsValid() && !m_pBGImage )
++ pAttrList->AddAttribute( A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
++ pStrm->StartElement( A2OUSTR("style:properties") );
++ if( m_pBGImage )
++ m_pBGImage->ToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("style:properties") );
++
++ pStrm->EndElement( A2OUSTR("style:style") );
++}
++
++XFRowStyle& XFRowStyle::operator=(XFRowStyle& other)
++{
++ m_fHeight = other.m_fHeight;
++ m_fMinHeight = other.m_fMinHeight;
++ m_aBackColor = other.m_aBackColor;
++
++ if( m_pBGImage )
++ delete m_pBGImage;
++
++ if( other.m_pBGImage )
++ m_pBGImage = new XFBGImage(*other.m_pBGImage);
++ else
++ m_pBGImage = NULL;
++ return *this;
++}
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfrowstyle.hxx lotuswordpro/source/filter/xfilter/xfrowstyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfrowstyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfrowstyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,126 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Table row style, ie. table row height.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-28 create and implements.
++ ************************************************************************/
++#ifndef _XFROWSTYLE_HXX
++#define _XFROWSTYLE_HXX
++
++#include "xfglobal.hxx"
++#include "xfstyle.hxx"
++#include "xfcolor.hxx"
++
++class XFBGImage;
++class XFRowStyle : public XFStyle
++{
++public:
++ XFRowStyle();
++ XFRowStyle& operator=(XFRowStyle& other);
++
++public:
++ void SetRowHeight(double height);
++
++ double GetRowHeight();
++
++ void SetMinRowHeight(double height);
++
++ void SetBackColor(XFColor& color);
++
++ void SetbackImage(XFBGImage *pImage);
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ double m_fHeight;
++ double m_fMinHeight;
++ XFColor m_aBackColor;
++ XFBGImage *m_pBGImage;
++};
++
++inline void XFRowStyle::SetRowHeight(double height)
++{
++ m_fHeight = height;
++}
++
++inline void XFRowStyle::SetMinRowHeight(double height)
++{
++ m_fMinHeight = height;
++}
++
++inline void XFRowStyle::SetBackColor(XFColor& color)
++{
++ m_aBackColor = color;
++}
++inline double XFRowStyle::GetRowHeight()
++{
++ if (m_fMinHeight > FLOAT_MIN)
++ {
++ return m_fMinHeight;
++ }
++
++ else if (m_fHeight > FLOAT_MIN)
++ {
++ return m_fHeight;
++ }
++ return 0;
++}
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfruby.hxx lotuswordpro/source/filter/xfilter/xfruby.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfruby.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfruby.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,113 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * ruby text.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-06-21 create this file.
++ ************************************************************************/
++#ifndef _XFRUBY_HXX
++#define _XFRUBY_HXX
++
++#include "xfcontent.hxx"
++
++class XFRubyStart : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++class XFRubyEnd : public XFContent
++{
++public:
++ void SetText(rtl::OUString sText);
++ virtual void ToXml(IXFStream *pStrm);
++private:
++ rtl::OUString m_strText;
++};
++
++void XFRubyStart::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ if( GetStyleName().getLength())
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName());
++ pStrm->StartElement( A2OUSTR("text:ruby") );
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("text:ruby-base") );
++}
++
++void XFRubyEnd::SetText(rtl::OUString sText)
++{
++ m_strText = sText;
++}
++
++void XFRubyEnd::ToXml(IXFStream *pStrm)
++{
++ pStrm->EndElement( A2OUSTR("text:ruby-base") );
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ if( GetStyleName().getLength())
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName());
++ pStrm->StartElement( A2OUSTR("text:ruby-text") );
++ if( m_strText.getLength() )
++ pStrm->Characters(m_strText);
++ pStrm->EndElement( A2OUSTR("text:ruby-text") );
++ pStrm->EndElement( A2OUSTR("text:ruby") );
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfrubystyle.hxx lotuswordpro/source/filter/xfilter/xfrubystyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfrubystyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfrubystyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,143 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * ruby style.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-06-21 create this file.
++ ************************************************************************/
++#ifndef _XFRUBYSTYLE_HXX
++#define _XFRUBYSTYLE_HXX
++
++#include "xfglobal.hxx"
++#include "xfstyle.hxx"
++#include "xfdefs.hxx"
++
++class XFRubyStyle : public XFStyle
++{
++public:
++ XFRubyStyle(){};
++ virtual ~XFRubyStyle(){};
++ virtual void ToXml(IXFStream *strm);
++ void SetPosition(enumXFRubyPosition ePosition);
++ void SetAlignment(enumXFRubyPosition eAlignment);
++ enumXFStyle GetStyleFamily();
++
++private:
++ enumXFRubyPosition m_ePos;
++ enumXFRubyPosition m_eAlign;
++};
++
++void XFRubyStyle::SetPosition(enumXFRubyPosition ePosition)
++{
++ m_ePos = ePosition;
++}
++void XFRubyStyle::SetAlignment(enumXFRubyPosition eAlignment)
++{
++ m_eAlign = eAlignment;
++}
++enumXFStyle XFRubyStyle::GetStyleFamily()
++{
++ return enumXFStyleRuby;
++}
++void XFRubyStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ rtl::OUString style = GetStyleName();
++
++ pAttrList->Clear();
++ if( style.getLength() )
++ pAttrList->AddAttribute(A2OUSTR("style:name"),GetStyleName());
++ pAttrList->AddAttribute(A2OUSTR("style:family"), A2OUSTR("ruby"));
++ pStrm->StartElement(A2OUSTR("style:style"));
++
++ pAttrList->Clear();
++
++ OUString sPos;
++ if (m_eAlign == enumXFRubyLeft)
++ {
++ sPos = A2OUSTR("left");
++ }
++ else if(m_eAlign == enumXFRubyRight)
++ {
++ sPos = A2OUSTR("right");
++ }
++ else if(m_eAlign == enumXFRubyCenter)
++ {
++ sPos = A2OUSTR("center");
++ }
++ if (sPos.getLength()>0)
++ pAttrList->AddAttribute(A2OUSTR("style:ruby-align"),sPos);
++
++ OUString sAlign;
++ if (m_ePos == enumXFRubyTop)
++ {
++ sAlign = A2OUSTR("above");
++ }
++ else if(m_ePos == enumXFRubyBottom)
++ {
++ sAlign = A2OUSTR("below");
++ }
++ if (sAlign.getLength()>0)
++ pAttrList->AddAttribute(A2OUSTR("style:ruby-position"),sAlign);
++
++ pStrm->StartElement(A2OUSTR("style:properties"));
++ pStrm->EndElement(A2OUSTR("style:properties"));
++ pStrm->EndElement(A2OUSTR("style:style"));
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsaxattrlist.cxx lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfsaxattrlist.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,88 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Document object of the xml filter framework.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++
++#include "xfsaxattrlist.hxx"
++#include "xmloff/attrlist.hxx"
++
++XFSaxAttrList::XFSaxAttrList()
++{
++ m_pSvAttrList = new SvXMLAttributeList();
++ m_xAttrList.set(m_pSvAttrList);
++}
++
++XFSaxAttrList::~XFSaxAttrList()
++{
++ //pls don't delete m_pSvAttrList,because when m_xAttrList release,the object will be automatic deleted.
++// if( m_pSvAttrList )
++// delete m_pSvAttrList;
++}
++
++void XFSaxAttrList::AddAttribute(const rtl::OUString& name, const rtl::OUString& value)
++{
++ m_pSvAttrList->AddAttribute(name,value);
++}
++
++void XFSaxAttrList::Clear()
++{
++ m_pSvAttrList->Clear();
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsaxattrlist.hxx lotuswordpro/source/filter/xfilter/xfsaxattrlist.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfsaxattrlist.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfsaxattrlist.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,101 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Wrapper the attibute list of a xml element.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef _XFSAXATTRLIST_HXX
++#define _XFSAXATTRLIST_HXX
++
++#include "ixfattrlist.hxx"
++#include "xmloff/attrlist.hxx"
++#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
++
++using namespace ::com::sun::star::uno;
++using namespace ::com::sun::star::xml::sax;
++
++class XFSaxAttrList : public IXFAttrList
++{
++public:
++ XFSaxAttrList();
++
++ virtual ~XFSaxAttrList();
++
++public:
++ //Interface ISaxAttributeList:
++ virtual void AddAttribute(const rtl::OUString& name, const rtl::OUString& value);
++
++ virtual void Clear();
++
++ Reference<XAttributeList> GetAttributeList();
++
++ friend class XFSaxStream;
++private:
++ SvXMLAttributeList *m_pSvAttrList;
++ Reference<XAttributeList> m_xAttrList;
++
++};
++
++inline Reference<XAttributeList> XFSaxAttrList::GetAttributeList()
++{
++ return m_xAttrList;
++}
++
++#endif //XFSAXATTRLIST_INC
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsaxstream.cxx lotuswordpro/source/filter/xfilter/xfsaxstream.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfsaxstream.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfsaxstream.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,130 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Tool for sax writer.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-12-23 create this file.
++ ************************************************************************/
++#include "xfsaxstream.hxx"
++#include "xfsaxattrlist.hxx"
++
++#include <cppuhelper/implbase1.hxx>
++#include <cppuhelper/implbase3.hxx>
++#include <cppuhelper/factory.hxx>
++
++#include <com/sun/star/document/XFilter.hpp>
++#include <com/sun/star/document/XImporter.hpp>
++#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
++#include <com/sun/star/lang/XServiceInfo.hpp>
++#include <com/sun/star/io/XInputStream.hpp>
++
++using namespace ::rtl;
++using namespace ::cppu;
++using namespace ::com::sun::star::lang;
++using namespace ::com::sun::star::io;
++using namespace ::com::sun::star::registry;
++using namespace ::com::sun::star::document;
++using namespace ::com::sun::star::beans;
++using namespace ::com::sun::star::xml::sax;
++using namespace ::com::sun::star::uno;
++
++XFSaxStream::XFSaxStream(Reference<XDocumentHandler>& xHandler)
++{
++ m_aHandler = xHandler;
++ m_pAttrList = new XFSaxAttrList();
++}
++
++XFSaxStream::~XFSaxStream()
++{
++ if( m_pAttrList )
++ delete m_pAttrList;
++}
++
++void XFSaxStream::StartDocument()
++{
++ m_aHandler->startDocument();
++}
++
++void XFSaxStream::EndDocument()
++{
++ m_aHandler->endDocument();
++}
++
++void XFSaxStream::StartElement(const rtl::OUString& oustr)
++{
++ m_aHandler->startElement( oustr, m_pAttrList->GetAttributeList() );
++ m_pAttrList->Clear();
++}
++
++void XFSaxStream::EndElement(const rtl::OUString& oustr)
++{
++ m_aHandler->endElement(oustr);
++
++ if( m_pAttrList )
++ m_pAttrList->Clear();
++}
++
++void XFSaxStream::Characters(const rtl::OUString& oustr)
++{
++ m_aHandler->characters(oustr);
++}
++
++IXFAttrList* XFSaxStream::GetAttrList()
++{
++ return m_pAttrList;
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsaxstream.hxx lotuswordpro/source/filter/xfilter/xfsaxstream.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfsaxstream.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfsaxstream.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,138 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Tool for sax writer.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-12-23 create this file.
++ ************************************************************************/
++#ifndef _XFSAXSTREAM_HXX
++#define _XFSAXSTREAM_HXX
++
++#include "ixfstream.hxx"
++
++#include <cppuhelper/implbase1.hxx>
++#include <cppuhelper/implbase3.hxx>
++#include <cppuhelper/factory.hxx>
++#include <com/sun/star/document/XFilter.hpp>
++#include <com/sun/star/document/XImporter.hpp>
++#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
++#include <com/sun/star/lang/XServiceInfo.hpp>
++#include <com/sun/star/io/XInputStream.hpp>
++
++using namespace ::rtl;
++using namespace ::cppu;
++using namespace ::com::sun::star::lang;
++using namespace ::com::sun::star::io;
++using namespace ::com::sun::star::registry;
++using namespace ::com::sun::star::document;
++using namespace ::com::sun::star::beans;
++using namespace ::com::sun::star::xml::sax;
++using namespace ::com::sun::star::uno;
++
++class XFSaxAttrList;
++class IXFAttrList;
++
++/**
++ * @brief
++ * Sax stream object, XDocumentHandler wrapper.
++ */
++class XFSaxStream : public IXFStream
++{
++public:
++ XFSaxStream(Reference<XDocumentHandler>& xHandler);
++
++ virtual ~XFSaxStream();
++
++public:
++ /**
++ * @descr Start document callback.
++ */
++ virtual void StartDocument();
++
++ /**
++ * @descr End document callback.
++ */
++ virtual void EndDocument();
++
++ /**
++ * @descr Start output element.
++ */
++ virtual void StartElement(const rtl::OUString& oustr);
++
++ /**
++ * @descr End output element.
++ */
++ virtual void EndElement(const rtl::OUString& oustr);
++
++ /**
++ * @descr Output Character section.
++ */
++ virtual void Characters(const rtl::OUString& oustr);
++
++ /**
++ * @descr Get the attribute list interface.
++ */
++ virtual IXFAttrList* GetAttrList();
++
++public:
++ Reference<XDocumentHandler> m_aHandler;
++ XFSaxAttrList *m_pAttrList;
++};
++
++#endif //XFSAXSTREAM_INC
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsection.cxx lotuswordpro/source/filter/xfilter/xfsection.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfsection.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfsection.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,155 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Section object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-12-28 create this file.
++ ************************************************************************/
++#include "xfsection.hxx"
++
++XFSection::XFSection()
++{
++ m_bProtected = sal_False;
++ m_bHiden = sal_False;
++ m_strSectionName = XFGlobal::GenSectionName();
++}
++
++XFSection::~XFSection()
++{
++}
++
++void XFSection::SetSectionName(rtl::OUString name)
++{
++ m_strSectionName = name;
++}
++
++void XFSection::SetSourceLink( rtl::OUString link)
++{
++ m_strSourceLink = link;
++}
++
++void XFSection::SetProtected(sal_Bool bProtected)
++{
++ m_bProtected = bProtected;
++}
++
++void XFSection::SetHiden(sal_Bool hiden)
++{
++ m_bHiden = hiden;
++}
++
++void XFSection::ToXml(IXFStream *pStrm)
++{
++ assert(m_strSectionName.getLength() > 0 );
++
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ rtl::OUString style = GetStyleName();
++ if( style.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), style);
++ //section name
++ if( m_strSectionName.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("text:name"), m_strSectionName);
++ if( m_bProtected )
++ pAttrList->AddAttribute( A2OUSTR("text:protected"), A2OUSTR("true") );
++ if( m_bHiden )
++ pAttrList->AddAttribute( A2OUSTR("text:display"), A2OUSTR("none") );
++
++ pStrm->StartElement( A2OUSTR("text:section") );
++ if( m_strSourceLink.getLength() )
++ {
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("xlink:href"), m_strSourceLink);
++ pAttrList->AddAttribute( A2OUSTR("text:filter-name"), A2OUSTR("wordpro"));
++ pStrm->StartElement( A2OUSTR("text:section-source") );
++ pStrm->EndElement( A2OUSTR("text:section-source") );
++ }
++
++ XFContentContainer::ToXml(pStrm);
++
++ pStrm->EndElement( A2OUSTR("text:section") );
++
++}
++/*
++void XFSection::ToXmlHeader(IXFStream *pStrm)
++{
++ assert(m_strSectionName.getLength() > 0 );
++
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ rtl::OUString style = GetStyleName();
++ if( style.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), style);
++ //section name
++ if( m_strSectionName.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("text:name"), m_strSectionName);
++ if( m_bProtected )
++ pAttrList->AddAttribute( A2OUSTR("text:protected"), A2OUSTR("true") );
++ if( m_bHiden )
++ pAttrList->AddAttribute( A2OUSTR("text:display"), A2OUSTR("none") );
++
++ pStrm->StartElement( A2OUSTR("text:section") );
++}
++
++void XFSection::ToXmlTail(IXFStream *pStrm)
++{
++ pStrm->EndElement( A2OUSTR("text:section") );
++}
++*/
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsection.hxx lotuswordpro/source/filter/xfilter/xfsection.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfsection.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfsection.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,121 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Section object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-12-28 create this file.
++ ************************************************************************/
++#ifndef _XFSECTION_HXX
++#define _XFSECTION_HXX
++
++#include "xfcontentcontainer.hxx"
++#include "xfcontent.hxx"
++#include "xfcolor.hxx"
++#include <vector>
++
++/**
++ * @brief
++ * Section object.
++ */
++class XFSection : public XFContentContainer
++{
++public:
++ XFSection();
++
++ virtual ~XFSection();
++
++public:
++ /**
++ * @descr Set section name. If not setted, i'll generate a name for it.
++ */
++ void SetSectionName(rtl::OUString name);
++
++ void SetSourceLink(rtl::OUString link);
++
++ /**
++ * @descr Set protected.
++ */
++ void SetProtected(sal_Bool bProtected);
++
++ /**
++ * @descr Set hidden.
++ */
++ void SetHiden(sal_Bool hiden);
++
++ /**
++ * @descr Output section obejct.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++/*
++private:
++ void ToXmlHeader(IXFStream *pStrm);
++
++ void ToXmlTail(IXFStream *pStrm);
++*/
++private:
++ rtl::OUString m_strSectionName;
++ sal_Bool m_bProtected;
++ sal_Bool m_bHiden;
++ XFColor m_aBackColor;
++ double m_fMarginLeft;
++ double m_fMarginRight;
++ rtl::OUString m_strSourceLink;
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsectionstyle.cxx lotuswordpro/source/filter/xfilter/xfsectionstyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfsectionstyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfsectionstyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,156 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Section style,whose family is "section"
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-10 create this file.
++ ************************************************************************/
++#include "xfsectionstyle.hxx"
++#include "xfcolumns.hxx"
++
++XFSectionStyle::XFSectionStyle()
++{
++ m_fMarginLeft = 0;
++ m_fMarginRight = 0;
++ m_pBackImage = NULL;
++ m_pColumns = NULL;
++}
++
++XFSectionStyle::~XFSectionStyle()
++{
++ if( m_pColumns )
++ delete m_pColumns;
++ if( m_pBackImage )
++ delete m_pBackImage;
++}
++
++enumXFStyle XFSectionStyle::GetStyleFamily()
++{
++ return enumXFStyleSection;
++}
++
++void XFSectionStyle::SetMarginLeft(double left)
++{
++ m_fMarginLeft = left;
++}
++
++void XFSectionStyle::SetMarginRight(double right)
++{
++ m_fMarginRight = right;
++}
++
++void XFSectionStyle::SetBackColor(const XFColor& color)
++{
++ m_aBackColor = color;
++}
++
++void XFSectionStyle::SetColumns(XFColumns *pColumns)
++{
++ if( m_pColumns )
++ delete m_pColumns;
++ m_pColumns = pColumns;
++}
++
++void XFSectionStyle::SetBackImage(XFBGImage *image)
++{
++ if( m_pBackImage )
++ delete m_pBackImage;
++ m_pBackImage = image;
++}
++
++void XFSectionStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
++ pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("section") );
++
++ pStrm->StartElement( A2OUSTR("style:style") );
++
++ pAttrList->Clear();
++ if( m_fMarginLeft != 0 )
++ {
++ pAttrList->AddAttribute( A2OUSTR("fo:margin-left"), DoubleToOUString(m_fMarginLeft) + A2OUSTR("cm") );
++ }
++ if( m_fMarginRight != 0 )
++ {
++ pAttrList->AddAttribute( A2OUSTR("fo:margin-right"), DoubleToOUString(m_fMarginRight) + A2OUSTR("cm") );
++ }
++ if( m_aBackColor.IsValid() && !m_pBackImage )
++ {
++ pAttrList->AddAttribute( A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
++ }
++ else
++ {
++ pAttrList->AddAttribute( A2OUSTR("fo:background-color"), A2OUSTR("transparent") );
++ }
++
++ pStrm->StartElement( A2OUSTR("style:properties") );
++
++ if( m_pColumns )
++ m_pColumns->ToXml(pStrm);
++ if( m_pBackImage )
++ m_pBackImage->ToXml(pStrm);
++
++ pStrm->EndElement( A2OUSTR("style:properties") );
++
++ pStrm->EndElement( A2OUSTR("style:style") );
++
++
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsectionstyle.hxx lotuswordpro/source/filter/xfilter/xfsectionstyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfsectionstyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfsectionstyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,107 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Section style,whose family is "section"
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-10 create this file.
++ ************************************************************************/
++#ifndef _XFSECTIONSTYLE_HXX
++#define _XFSECTIONSTYLE_HXX
++
++#include "xfglobal.hxx"
++#include "xfstyle.hxx"
++#include "xfbgimage.hxx"
++#include "xfcolor.hxx"
++
++class XFColumns;
++/*
++ * @descr
++ * Section style, include background color,background image, columns and margins.
++ */
++class XFSectionStyle : public XFStyle
++{
++public:
++ XFSectionStyle();
++
++ virtual ~XFSectionStyle();
++
++public:
++ void SetMarginLeft(double left);
++
++ void SetMarginRight(double right);
++
++ void SetBackColor(const XFColor& color);
++
++ void SetColumns(XFColumns *pColumns);
++
++ void SetBackImage(XFBGImage *image);
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ double m_fMarginLeft;
++ double m_fMarginRight;
++ XFColor m_aBackColor;
++ XFColumns *m_pColumns;
++ XFBGImage *m_pBackImage;
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfshadow.cxx lotuswordpro/source/filter/xfilter/xfshadow.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfshadow.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfshadow.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,128 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Shadow object,now only used by paragraph object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#include "xfshadow.hxx"
++
++XFShadow::XFShadow():m_aColor(128,128,0)
++{
++ m_ePosition = enumXFShadowNone;
++ m_fOffset = 0.18;
++}
++
++XFShadow::~XFShadow()
++{
++}
++
++rtl::OUString XFShadow::ToString()
++{
++ rtl::OUString buf;
++ rtl::OUString strOff = DoubleToOUString(m_fOffset);
++
++ buf = m_aColor.ToString();
++ switch(m_ePosition)
++ {
++ case enumXFShadowRightBottom:
++ buf += A2OUSTR(" ") + strOff + A2OUSTR("cm") + A2OUSTR(" ") + strOff + A2OUSTR("cm");
++ break;
++ case enumXFShadowRightTop:
++ buf += A2OUSTR(" ") + strOff + A2OUSTR("cm") + A2OUSTR(" -") + strOff + A2OUSTR("cm");
++ break;
++ case enumXFShadowLeftBottom:
++ buf += A2OUSTR(" -") + strOff + A2OUSTR("cm") + A2OUSTR(" ") + strOff + A2OUSTR("cm");
++ break;
++ case enumXFShadowLeftTop:
++ buf += A2OUSTR(" -") + strOff + A2OUSTR("cm") + A2OUSTR(" -") + strOff + A2OUSTR("cm");
++ break;
++ }
++
++ return buf;
++}
++
++void XFShadow::Reset()
++{
++ m_ePosition = enumXFShadowNone;
++ m_fOffset = 0;
++}
++
++void XFShadow::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ if( m_ePosition == enumXFShadowNone )
++ return;
++ else
++ pAttrList->AddAttribute( A2OUSTR("style:shadow"), ToString() );
++}
++
++sal_Bool operator==(XFShadow& s1, XFShadow& s2)
++{
++ if( (s1.m_ePosition == s2.m_ePosition) &&
++ (s1.m_fOffset == s2.m_fOffset) &&
++ (s1.m_aColor == s2.m_aColor)
++ )
++ return sal_True;
++ return sal_False;
++}
++
++sal_Bool operator!=(XFShadow& s1, XFShadow& s2)
++{
++ return !(s1==s2);
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfshadow.hxx lotuswordpro/source/filter/xfilter/xfshadow.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfshadow.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfshadow.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,157 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Shadow object,now only used by paragraph object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef _XFSHADOW_HXX
++#define _XFSHADOW_HXX
++
++#include "xfglobal.hxx"
++#include "ixfproperty.hxx"
++#include "xfcolor.hxx"
++
++/**
++ * @brief
++ * Shadow object.
++ */
++class XFShadow : public IXFProperty
++{
++public:
++ XFShadow();
++
++ virtual ~XFShadow();
++
++public:
++ /**
++ * @descr set shadow position. You can refer to enumXFShadowPos to get all posible positions.
++ */
++ void SetPosition(enumXFShadowPos pos);
++
++ /**
++ * @descr return shadow position.
++ */
++ enumXFShadowPos GetPosition();
++
++ /**
++ * @descr Set shadow offset from owner obejct.
++ */
++ void SetOffset(double offset);
++
++ /**
++ * @descr return shadow offset.
++ */
++ double GetOffset();
++
++ /**
++ * @descr Set shadow color.
++ */
++ void SetColor(const XFColor& color);
++
++ /**
++ * @descr return shadow color.
++ */
++ XFColor GetColor();
++
++ void Reset();
++
++ rtl::OUString ToString();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++ friend sal_Bool operator==(XFShadow& s1, XFShadow& s2);
++ friend sal_Bool operator!=(XFShadow& s1, XFShadow& s2);
++private:
++ enumXFShadowPos m_ePosition;
++ double m_fOffset;
++ XFColor m_aColor;
++};
++
++
++inline void XFShadow::SetPosition(enumXFShadowPos pos)
++{
++ m_ePosition = pos;
++}
++
++inline enumXFShadowPos XFShadow::GetPosition()
++{
++ return m_ePosition;
++}
++
++inline void XFShadow::SetOffset(double offset)
++{
++ m_fOffset = offset;
++}
++
++inline double XFShadow::GetOffset()
++{
++ return m_fOffset;
++}
++
++inline void XFShadow::SetColor(const XFColor& color)
++{
++ m_aColor = color;
++}
++
++inline XFColor XFShadow::GetColor()
++{
++ return m_aColor;
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfstylecont.cxx lotuswordpro/source/filter/xfilter/xfstylecont.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfstylecont.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfstylecont.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,299 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Font object to serial to xml filter.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#include "xfstylecont.hxx"
++#include "ixfstyle.hxx"
++#include "xffont.hxx"
++#include "xftextstyle.hxx"
++#include "xfparastyle.hxx"
++#include "xffontfactory.hxx"
++#include "../lwpglobalmgr.hxx"
++
++XFStyleContainer::XFStyleContainer(const rtl::OUString& strStyleNamePrefix)
++ :m_strStyleNamePrefix(strStyleNamePrefix)
++{
++}
++
++XFStyleContainer::XFStyleContainer(const XFStyleContainer& other)
++ :m_strStyleNamePrefix(other.m_strStyleNamePrefix)
++{
++ this->m_aStyles = other.m_aStyles;
++}
++
++XFStyleContainer& XFStyleContainer::operator=(const XFStyleContainer& other)
++{
++ this->m_strStyleNamePrefix = other.m_strStyleNamePrefix;
++ this->m_aStyles = other.m_aStyles;
++ return *this;
++}
++
++XFStyleContainer::~XFStyleContainer()
++{
++ std::vector<IXFStyle*>::iterator it;
++ for( it = m_aStyles.begin(); it != m_aStyles.end(); it++ )
++ {
++ IXFStyle *pStyle = *it;
++ if( pStyle )
++ delete pStyle;
++ }
++}
++
++
++void XFStyleContainer::Reset()
++{
++ std::vector<IXFStyle*>::iterator it;
++
++ for( it = m_aStyles.begin(); it != m_aStyles.end(); it++ )
++ {
++ IXFStyle *pStyle = *it;
++ if( pStyle )
++ delete pStyle;
++ }
++ m_aStyles.clear();
++}
++
++IXFStyle* XFStyleContainer::AddStyle(IXFStyle *pStyle)
++{
++ IXFStyle *pConStyle = NULL;
++ rtl::OUString name;
++
++ if( !pStyle )
++ return NULL;
++ //no matter we want to delete the style or not,XFFont obejct should be saved first.
++ ManageStyleFont(pStyle);
++
++ if( pStyle->GetStyleName().getLength()==0 )
++ pConStyle = FindSameStyle(pStyle);
++
++ if( pConStyle )//such a style has exist:
++ {
++ delete pStyle;
++ return pConStyle;
++ }
++ else
++ {
++ if( pStyle->GetStyleName().getLength() == 0 )
++ {
++ name = m_strStyleNamePrefix + Int32ToOUString(m_aStyles.size()+1);
++ pStyle->SetStyleName(name);
++ }
++ else
++ {
++ name = pStyle->GetStyleName();
++ //for name conflict
++ if(FindStyle( name))
++ {
++ name = name + Int32ToOUString(m_aStyles.size()+1);
++ pStyle->SetStyleName(name);
++ }
++ }
++
++
++ m_aStyles.push_back(pStyle);
++ //transform the font object to XFFontFactory
++
++ return pStyle;
++ }
++}
++
++IXFStyle* XFStyleContainer::FindSameStyle(IXFStyle *pStyle)
++{
++ std::vector<IXFStyle*>::iterator it;
++ for( it = m_aStyles.begin(); it != m_aStyles.end(); it++ )
++ {
++ IXFStyle *pConStyle = *it;
++ if( !pConStyle )
++ continue;
++
++ if( pConStyle->Equal(pStyle) )
++ return pConStyle;
++ }
++
++ return NULL;
++}
++
++IXFStyle* XFStyleContainer::FindStyle(rtl::OUString name)
++{
++ std::vector<IXFStyle*>::iterator it;
++ for( it = m_aStyles.begin(); it != m_aStyles.end(); it++ )
++ {
++ IXFStyle *pConStyle = *it;
++ if( !pConStyle )
++ continue;
++
++ if( pConStyle->GetStyleName() == name )
++ return pConStyle;
++ }
++
++ return NULL;
++}
++
++IXFStyle* XFStyleContainer::Item(int index)
++{
++ assert(index>=0&&index<m_aStyles.size());
++ if( index >=0 && index < m_aStyles.size() )
++ {
++ return m_aStyles[index];
++ }
++ return NULL;
++}
++
++void XFStyleContainer::ToXml(IXFStream *pStrm)
++{
++ std::vector<IXFStyle*>::iterator it;
++
++ for( it = m_aStyles.begin(); it != m_aStyles.end(); it++ )
++ {
++ IXFStyle *pStyle = *it;
++
++ assert(pStyle);
++ if( !pStyle )
++ continue;
++
++ pStyle->ToXml(pStrm);
++ }
++}
++
++
++void XFStyleContainer::ManageStyleFont(IXFStyle *pStyle)
++{
++ XFFont *pStyleFont = NULL;
++ XFFont *pFactoryFont = NULL;
++
++ if( !pStyle )
++ return;
++
++ if( pStyle->GetStyleFamily() == enumXFStyleText )
++ {
++ XFTextStyle *pTS = (XFTextStyle*)pStyle;
++ pStyleFont = pTS->GetFont();
++ if( !pStyleFont )
++ return;
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ XFFontFactory* pFontFactory = pGlobal->GetXFFontFactory();
++ pFactoryFont = pFontFactory->FindSameFont(pStyleFont);
++ //this font has been exists in the factory:
++ if( pFactoryFont )
++ {
++ pTS->SetFont(pFactoryFont);
++ if( pStyleFont != pFactoryFont )
++ delete pStyleFont;
++ }
++ else
++ {
++ pFontFactory->AddFont(pStyleFont);
++ }
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStylePara )
++ {
++ XFParaStyle *pPS = (XFParaStyle*)pStyle;
++ pStyleFont = pPS->GetFont();
++ if( !pStyleFont )
++ return;
++ LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance();
++ XFFontFactory* pFontFactory = pGlobal->GetXFFontFactory();
++ pFactoryFont = pFontFactory->FindSameFont(pStyleFont);
++ //this font has been exists in the factory:
++ if( pFactoryFont )
++ {
++ pPS->SetFont(pFactoryFont);
++ if( pFactoryFont != pStyleFont )
++ delete pStyleFont;
++ }
++ else
++ {
++ pFontFactory->AddFont(pStyleFont);
++ }
++ }
++}
++
++bool operator==(XFStyleContainer& b1, XFStyleContainer& b2)
++{
++ if( b1.m_strStyleNamePrefix != b2.m_strStyleNamePrefix )
++ return false;
++ if( b1.m_aStyles.size() != b2.m_aStyles.size() )
++ return false;
++ for( int i=0; i<b1.m_aStyles.size(); i++ )
++ {
++ IXFStyle *pS1 = b1.m_aStyles[i];
++ IXFStyle *pS2 = b2.m_aStyles[i];
++
++ if( pS1 )
++ {
++ if( !pS2 )
++ return false;
++ if( !pS1->Equal(pS2) )
++ return false;
++ }
++ else
++ {
++ if( pS2 )
++ return false;
++ }
++ }
++ return true;
++}
++
++bool operator!=(XFStyleContainer& b1, XFStyleContainer& b2)
++{
++ return !(b1==b2);
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfstylecont.hxx lotuswordpro/source/filter/xfilter/xfstylecont.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfstylecont.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfstylecont.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,140 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Style container,which response for special style,ie. text style.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef _XFSTYLECONTAINER_HXX
++#define _XFSTYLECONTAINER_HXX
++
++#include "xfglobal.hxx"
++#include <vector>
++
++class IXFStyle;
++
++/**
++ * @descr container obejct for styles.
++ * All styles can be placed into an style container.
++ */
++class XFStyleContainer : public IXFObject
++{
++public:
++ XFStyleContainer(){};
++
++ XFStyleContainer(const rtl::OUString& strStyleNamePrefix);
++
++ XFStyleContainer(const XFStyleContainer& other);
++
++ XFStyleContainer& operator=(const XFStyleContainer& other);
++
++ virtual ~XFStyleContainer();
++
++public:
++ /**
++ * @descr Add style to container.
++ * If the same style has exist, then pStyle will be deleted, and the same style will be return.
++ */
++ IXFStyle* AddStyle(IXFStyle *pStyle);
++
++ /**
++ * @descr Find the same style.
++ */
++ IXFStyle* FindSameStyle(IXFStyle *pStyle);
++
++ /**
++ * @descr get style by name.
++ */
++ IXFStyle* FindStyle(rtl::OUString name);
++
++ /**
++ * @descr clear container.
++ */
++ void Reset();
++
++ /**
++ * @descr get count of styles in the container.
++ */
++ sal_Int32 GetCount();
++
++ /**
++ * @descr get style by index.
++ */
++ IXFStyle* Item(int index);
++
++ /**
++ * @descr Output all style.
++ */
++ virtual void ToXml(IXFStream *pStrm);
++
++ friend bool operator==(XFStyleContainer& b1, XFStyleContainer& b2);
++ friend bool operator!=(XFStyleContainer& b1, XFStyleContainer& b2);
++private:
++ static void ManageStyleFont(IXFStyle *pStyle);
++private:
++ std::vector<IXFStyle*> m_aStyles;
++ rtl::OUString m_strStyleNamePrefix;
++};
++
++inline sal_Int32 XFStyleContainer::GetCount()
++{
++ return m_aStyles.size();
++}
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfstyle.cxx lotuswordpro/source/filter/xfilter/xfstyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfstyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfstyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,107 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Base style object .
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-28 create this file.
++ ************************************************************************/
++#include "xfstyle.hxx"
++
++XFStyle::XFStyle()
++{
++
++}
++
++XFStyle::~XFStyle()
++{
++}
++
++rtl::OUString XFStyle::GetStyleName()
++{
++ return m_strStyleName;
++}
++
++void XFStyle::SetStyleName(const rtl::OUString& styleName)
++{
++ m_strStyleName = styleName;
++}
++
++rtl::OUString XFStyle::GetParentStyleName()
++{
++ return m_strParentStyleName;
++}
++
++void XFStyle::SetParentStyleName(const rtl::OUString& styleName)
++{
++ m_strParentStyleName = styleName;
++}
++
++enumXFStyle XFStyle::GetStyleFamily()
++{
++ return enumXFStyleUnknown;
++}
++
++void XFStyle::SetStyleFamily(enumXFStyle family)
++{
++ m_enumFamily = family;
++}
++
++sal_Bool XFStyle::Equal(IXFStyle *pStyle)
++{
++ return sal_False;
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfstylefamily.hxx lotuswordpro/source/filter/xfilter/xfstylefamily.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfstylefamily.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfstylefamily.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,72 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _XFSTYLEFAMILY_HXX
++#define _XFSTYLEFAMILY_HXX
++
++enum enumXFStyleFamily
++{
++ enumXFStyleUnknown,
++ enumXFStyleText,
++ enumXFStylePara,
++ enumXFStyleList,
++ enumXFStyleSection,
++ enumXFStyleGraphics,
++ enumXFStylePageMaster,
++ enumXFStyleMasterPage,
++ enumXFStyleDate
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfstyle.hxx lotuswordpro/source/filter/xfilter/xfstyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfstyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfstyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,122 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Base style object .
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-28 create this file.
++ ************************************************************************/
++#ifndef _XFSTYLE_HXX
++#define _XFSTYLE_HXX
++
++#include "ixfstyle.hxx"
++
++/**
++ * @brief
++ * implements ixfstyle interface. This is the base class for all concentrate style.
++ */
++class XFStyle : public IXFStyle
++{
++public:
++ XFStyle();
++
++ virtual ~XFStyle();
++
++public:
++ /**
++ * @descr get style name.
++ */
++ virtual rtl::OUString GetStyleName();
++
++ /**
++ * @descr set style name.
++ */
++ virtual void SetStyleName(const rtl::OUString& styleName);
++
++ /**
++ * @descr Set parent style name.
++ */
++ virtual rtl::OUString GetParentStyleName();
++
++ /**
++ * @descr return parent style name.
++ */
++ virtual void SetParentStyleName(const rtl::OUString& styleName);
++
++ /**
++ * @descr get styel family.
++ */
++ virtual enumXFStyle GetStyleFamily();
++
++ /**
++ * @descr set style family.
++ */
++ virtual void SetStyleFamily(enumXFStyle family);
++
++ /**
++ * @descr decide whether two style are equal.
++ */
++ virtual sal_Bool Equal(IXFStyle *pStyle);
++
++protected:
++ rtl::OUString m_strStyleName;
++ rtl::OUString m_strParentStyleName;
++ enumXFStyle m_enumFamily;
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfstylemanager.cxx lotuswordpro/source/filter/xfilter/xfstylemanager.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfstylemanager.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfstylemanager.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,388 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Style manager for the filter.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#include "xfstylemanager.hxx"
++#include "ixfstyle.hxx"
++
++XFStyleManager::XFStyleManager() : s_aStdArrowStyles( A2OUSTR("arrow") ),s_aListStyles( A2OUSTR("L") ),
++ s_aTextStyles( A2OUSTR("T") ),s_aParaStyles( A2OUSTR("P") ),s_aSectionStyles( A2OUSTR("Sect") ),
++ s_aPageMasters( A2OUSTR("PM") ),s_aMasterpages( A2OUSTR("MP") ),s_aDateStyles( A2OUSTR("N") ),
++ s_aGraphicsStyles( A2OUSTR("fr") ),s_aTableStyles( A2OUSTR("table") ),s_aTableCellStyles( A2OUSTR("cell") ),
++ s_aTableRowStyles( A2OUSTR("row") ),s_aTableColStyles( A2OUSTR("col") ),s_pOutlineStyle(NULL)
++{
++}
++
++XFStyleManager::~XFStyleManager()
++{
++ Reset();
++}
++
++void XFStyleManager::Reset()
++{
++ if( s_pOutlineStyle )
++ {
++ delete s_pOutlineStyle;
++ s_pOutlineStyle = NULL;
++ }
++
++ s_aStdTextStyles.Reset();
++ s_aStdParaStyles.Reset();
++ s_aStdStrokeDashStyles.Reset();
++ s_aStdAreaStyles.Reset();
++ s_aStdArrowStyles.Reset();
++ s_aTextStyles.Reset();
++ s_aParaStyles.Reset();
++ s_aListStyles.Reset();
++ s_aSectionStyles.Reset();
++ s_aPageMasters.Reset();
++ s_aMasterpages.Reset();
++ s_aDateStyles.Reset();
++ s_aGraphicsStyles.Reset();
++ s_aConfigManager.Reset();
++ //must clear all static containers.
++ s_aFontDecls.clear();
++}
++
++void XFStyleManager::AddFontDecl(rtl::OUString name, rtl::OUString family, sal_Bool fixed)
++{
++ s_aFontDecls.push_back( XFFontDecl(name, family, fixed) );
++}
++
++void XFStyleManager::AddFontDecl(XFFontDecl& aFontDecl)
++{
++ s_aFontDecls.push_back(aFontDecl);
++}
++
++IXFStyle* XFStyleManager::AddStyle(IXFStyle *pStyle)
++{
++ assert(pStyle);
++ rtl::OUString name;
++ IXFStyle *pStyleRet = NULL;
++
++ if( !pStyle )
++ return NULL;
++ name = pStyle->GetStyleName();
++
++ if( pStyle->GetStyleFamily() == enumXFStyleText )
++ {
++ if( name.getLength() )
++ {
++ pStyleRet = s_aStdTextStyles.AddStyle(pStyle);
++ }
++ else
++ pStyleRet = s_aTextStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStylePara )
++ {
++ if( name.getLength() )
++ {
++ pStyleRet = s_aStdParaStyles.AddStyle(pStyle);
++ }
++ else
++ pStyleRet = s_aParaStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleDefaultPara )
++ {
++ pStyleRet = s_aStdParaStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleList )
++ {
++ pStyleRet = s_aListStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleSection )
++ {
++ pStyleRet = s_aSectionStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStylePageMaster )
++ {
++ pStyleRet = s_aPageMasters.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleMasterPage )
++ {
++ //Master page don't need name.
++ pStyleRet = s_aMasterpages.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleDate )
++ {
++ pStyleRet = s_aDateStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleTime )
++ {
++ pStyleRet = s_aDateStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleNumber )
++ {
++ pStyleRet = s_aDateStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStylePercent )
++ {
++ pStyleRet = s_aDateStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleCurrency )
++ {
++ pStyleRet = s_aDateStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleGraphics )
++ {
++ pStyleRet = s_aGraphicsStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleTable )
++ {
++ pStyleRet = s_aTableStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleTableCell )
++ {
++ pStyleRet = s_aTableCellStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleTableRow )
++ {
++ pStyleRet = s_aTableRowStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleTableCol )
++ {
++ pStyleRet = s_aTableColStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleOutline )
++ {
++ if( s_pOutlineStyle )
++ delete s_pOutlineStyle;
++ s_pOutlineStyle = pStyle;
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleStrokeDash )
++ {
++ pStyleRet = s_aStdStrokeDashStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleArea )
++ {
++ pStyleRet = s_aStdAreaStyles.AddStyle(pStyle);
++ }
++ else if( pStyle->GetStyleFamily() == enumXFStyleArrow )
++ {
++ pStyleRet = s_aStdArrowStyles.AddStyle(pStyle);
++ }
++ else if (pStyle->GetStyleFamily() == enumXFStyleRuby)
++ {
++ pStyleRet = s_aRubyStyles.AddStyle(pStyle);
++ }
++
++ return pStyleRet;
++}
++
++IXFStyle* XFStyleManager::FindStyle(rtl::OUString name)
++{
++ IXFStyle *pStyle = (IXFStyle*)FindParaStyle(name);
++ if( pStyle )
++ return pStyle;
++ pStyle = (IXFStyle*)FindTextStyle(name);
++ if( pStyle )
++ return pStyle;
++ pStyle = s_aListStyles.FindStyle(name);
++ if( pStyle )
++ return pStyle;
++ pStyle = s_aSectionStyles.FindStyle(name);
++ if( pStyle )
++ return pStyle;
++ pStyle = s_aPageMasters.FindStyle(name);
++ if( pStyle )
++ return pStyle;
++ pStyle = s_aMasterpages.FindStyle(name);
++ if( pStyle )
++ return pStyle;
++ pStyle = s_aDateStyles.FindStyle(name);
++ if( pStyle )
++ return pStyle;
++ pStyle = s_aGraphicsStyles.FindStyle(name);
++ if( pStyle )
++ return pStyle;
++ pStyle = s_aTableStyles.FindStyle(name);
++ if( pStyle )
++ return pStyle;
++ pStyle = s_aTableCellStyles.FindStyle(name);
++ if( pStyle )
++ return pStyle;
++ pStyle = s_aTableRowStyles.FindStyle(name);
++ if( pStyle )
++ return pStyle;
++ pStyle = s_aTableColStyles.FindStyle(name);
++ if( pStyle )
++ return pStyle;
++ if(s_pOutlineStyle && s_pOutlineStyle->GetStyleName() == name )
++ return s_pOutlineStyle;
++ pStyle = s_aStdStrokeDashStyles.FindStyle(name);
++ if( pStyle )
++ return pStyle;
++ pStyle = s_aStdAreaStyles.FindStyle(name);
++ if( pStyle )
++ return pStyle;
++ pStyle = s_aStdArrowStyles.FindStyle(name);
++ if( pStyle )
++ return pStyle;
++
++ return NULL;
++}
++
++XFParaStyle* XFStyleManager::FindParaStyle(rtl::OUString name)
++{
++ IXFStyle *pStyle = s_aParaStyles.FindStyle(name);
++ if( pStyle )
++ return (XFParaStyle*)pStyle;
++ else
++ return (XFParaStyle*)s_aStdParaStyles.FindStyle(name);
++}
++
++XFTextStyle* XFStyleManager::FindTextStyle(rtl::OUString name)
++{
++ IXFStyle *pStyle = s_aTextStyles.FindStyle(name);
++ if( pStyle )
++ return (XFTextStyle*)pStyle;
++ else
++ return (XFTextStyle*)s_aStdTextStyles.FindStyle(name);
++}
++
++void XFStyleManager::SetLineNumberConfig(XFLineNumberConfig *pLNConf)
++{
++ s_aConfigManager.SetLineNumberConfig(pLNConf);
++}
++
++void XFStyleManager::SetFootnoteConfig(XFFootnoteConfig *pFNConfig)
++{
++ s_aConfigManager.SetFootnoteConfig(pFNConfig);
++}
++
++void XFStyleManager::SetEndnoteConfig(XFEndnoteConfig *pENConfig)
++{
++ s_aConfigManager.SetEndnoteConfig(pENConfig);
++}
++
++void XFStyleManager::ToXml(IXFStream *pStrm)
++{
++ std::vector<XFFontDecl>::iterator itDecl;
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("office:font-decls") );
++
++ //font declarations:
++ for( itDecl = s_aFontDecls.begin(); itDecl != s_aFontDecls.end(); itDecl++ )
++ {
++ XFFontDecl &f = *itDecl;
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("style:name"), f.GetFontName() );
++ pAttrList->AddAttribute( A2OUSTR("fo:font-family"), f.GetFontFamily() );
++ if( f.GetFontPitchFixed() )
++ pAttrList->AddAttribute( A2OUSTR("style:font-pitch"), A2OUSTR("fixed") );
++ else
++ pAttrList->AddAttribute( A2OUSTR("style:font-pitch"), A2OUSTR("variable") );
++ pStrm->StartElement( A2OUSTR("style:font-decl") );
++ pStrm->EndElement( A2OUSTR("style:font-decl") );
++ }
++
++ pStrm->EndElement( A2OUSTR("office:font-decls") );
++
++ //office:styles:
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("office:styles") );
++
++ s_aStdParaStyles.ToXml(pStrm);
++ s_aStdTextStyles.ToXml(pStrm);
++ s_aStdStrokeDashStyles.ToXml(pStrm);
++ s_aStdAreaStyles.ToXml(pStrm);
++ s_aStdArrowStyles.ToXml(pStrm);
++ //date,time styles:
++ s_aDateStyles.ToXml(pStrm);
++ s_aConfigManager.ToXml(pStrm);
++ //for optimist.
++ s_aListStyles.ToXml(pStrm);
++
++ if( s_pOutlineStyle )
++ s_pOutlineStyle->ToXml(pStrm);
++
++ pStrm->EndElement( A2OUSTR("office:styles") );
++
++ //automatic styles:
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("office:automatic-styles") );
++
++ s_aTableStyles.ToXml(pStrm);
++ s_aTableCellStyles.ToXml(pStrm);
++ s_aTableRowStyles.ToXml(pStrm);
++ s_aTableColStyles.ToXml(pStrm);
++ s_aParaStyles.ToXml(pStrm);
++ s_aTextStyles.ToXml(pStrm);
++ s_aSectionStyles.ToXml(pStrm);
++ s_aPageMasters.ToXml(pStrm);
++ s_aRubyStyles.ToXml(pStrm);
++ //graphics:
++ s_aGraphicsStyles.ToXml(pStrm);
++
++ pStrm->EndElement( A2OUSTR("office:automatic-styles") );
++
++ //master:styles
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("office:master-styles") );
++ //masters pages:
++ s_aMasterpages.ToXml(pStrm);
++
++ pStrm->EndElement( A2OUSTR("office:master-styles") );
++}
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfstylemanager.hxx lotuswordpro/source/filter/xfilter/xfstylemanager.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfstylemanager.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfstylemanager.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,149 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Style manager for the filter.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef _XFSTYLEMANAGER_HXX
++#define _XFSTYLEMANAGER_HXX
++
++#include "xfglobal.hxx"
++#include "xffontdecl.hxx"
++#include "xfstylecont.hxx"
++#include "xfconfigmanager.hxx"
++#include <map>
++#include <vector>
++
++class IXFStream;
++class IXFStyle;
++class XFOutlineStyle;
++class XFParaStyle;
++class XFTextStyle;
++class XFLineNumberConfig;
++class XFFootnoteConfig;
++class XFEndnoteConfig;
++
++/**
++ * @brief
++ * Style manager for the filter.
++ * This is a global obejct, all styles will be placed here before output.
++ */
++class XFStyleManager// : public IXFObject
++{
++public:
++ XFStyleManager();
++ ~XFStyleManager();
++ XFStyleManager(XFStyleManager& other){}
++
++ XFStyleManager operator=(XFStyleManager& other){}
++
++public:
++ /**
++ * @descr clear all styles, called before load file.
++ */
++ void Reset();
++
++ void AddFontDecl(XFFontDecl& aFontDecl);
++
++ void AddFontDecl(rtl::OUString name, rtl::OUString family, sal_Bool fixed = false);
++
++ IXFStyle* AddStyle(IXFStyle *pStyle);
++
++ IXFStyle* FindStyle(rtl::OUString name);
++
++ XFParaStyle* FindParaStyle(rtl::OUString name);
++
++ XFTextStyle* FindTextStyle(rtl::OUString name);
++
++ void SetLineNumberConfig(XFLineNumberConfig *pLNConfig);
++
++ void SetFootnoteConfig(XFFootnoteConfig *pFNConfig);
++
++ void SetEndnoteConfig(XFEndnoteConfig *pFNConfig);
++
++ void ToXml(IXFStream *strm);
++
++private:
++ std::vector<XFFontDecl> s_aFontDecls;
++ //standard styles that can be inherited,<office:styles>
++ XFStyleContainer s_aStdTextStyles;
++ XFStyleContainer s_aStdParaStyles;
++ XFStyleContainer s_aStdStrokeDashStyles;
++ XFStyleContainer s_aStdAreaStyles;
++ XFStyleContainer s_aStdArrowStyles;
++ XFConfigManager s_aConfigManager;
++ //automatic styles,<office:automatic-styles>
++ XFStyleContainer s_aTextStyles;
++ XFStyleContainer s_aParaStyles;
++ XFStyleContainer s_aListStyles;
++ XFStyleContainer s_aSectionStyles;
++ XFStyleContainer s_aPageMasters;
++ XFStyleContainer s_aMasterpages;
++ XFStyleContainer s_aDateStyles;
++ XFStyleContainer s_aGraphicsStyles;
++ XFStyleContainer s_aTableStyles;
++ XFStyleContainer s_aTableCellStyles;
++ XFStyleContainer s_aTableRowStyles;
++ XFStyleContainer s_aTableColStyles;
++ IXFStyle *s_pOutlineStyle;
++ XFStyleContainer s_aRubyStyles;
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfsubject.hxx lotuswordpro/source/filter/xfilter/xfsubject.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfsubject.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfsubject.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,85 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Page number field.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-31 create this file.
++ ************************************************************************/
++#ifndef _XFSUBJECT_HXX
++#define _XFSUBJECT_HXX
++
++#include "xfglobal.hxx"
++#include "xfcontent.hxx"
++#include "xfnumfmt.hxx"
++
++class XFSubject : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++inline void XFSubject::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pStrm->StartElement( A2OUSTR("text:subject") );
++ pStrm->EndElement( A2OUSTR("text:subject") );
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftable.cxx lotuswordpro/source/filter/xfilter/xftable.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xftable.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftable.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,319 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Table object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-24 create and implements.
++ ************************************************************************/
++#include "xftable.hxx"
++#include "xfrow.hxx"
++#include "xfcolstyle.hxx"
++#include "xfstylemanager.hxx"
++#include <cassert>
++
++XFTable::XFTable()
++{
++ m_strName = XFGlobal::GenTableName();
++ m_bSubTable = sal_False;
++ m_pOwnerCell = NULL;
++}
++
++XFTable::XFTable(const XFTable& other)
++{
++ m_strName = other.m_strName;
++ m_bSubTable = other.m_bSubTable;
++ m_pOwnerCell = NULL;
++ for( int i=1; i<=other.m_aHeaderRows.GetCount(); i++ )
++ {
++ XFRow *pRow = (XFRow*)other.m_aHeaderRows.GetContent(i+1);
++ if( pRow )
++ {
++ m_aHeaderRows.Add( new XFRow(*pRow) );
++ }
++ }
++
++ m_aColumns = other.m_aColumns;
++ m_strDefCellStyle = other.m_strDefCellStyle;
++ m_strDefRowStyle = other.m_strDefRowStyle;
++ m_strDefColStyle = other.m_strDefColStyle;
++}
++
++XFTable& XFTable::operator =(const XFTable& other)
++{
++ m_strName = other.m_strName;
++ m_bSubTable = other.m_bSubTable;
++ m_pOwnerCell = NULL;
++ for( int i=1; i<=other.m_aHeaderRows.GetCount(); i++ )
++ {
++ XFRow *pRow = (XFRow*)other.m_aHeaderRows.GetContent(i);
++ if( pRow )
++ {
++ m_aHeaderRows.Add( new XFRow(*pRow) );
++ }
++ }
++
++ m_aColumns = other.m_aColumns;
++ m_strDefCellStyle = other.m_strDefCellStyle;
++ m_strDefRowStyle = other.m_strDefRowStyle;
++ m_strDefColStyle = other.m_strDefColStyle;
++ return *this;
++}
++
++
++
++XFTable::~XFTable()
++{
++ std::map<sal_Int32,XFRow*>::iterator it;
++ for( it=m_aRows.begin(); it!=m_aRows.end(); it++ )
++ {
++ XFRow *pRow = (*it).second;
++ if( pRow )
++ delete pRow;
++ }
++ m_aRows.clear();
++ m_aColumns.clear();
++}
++
++void XFTable::SetColumnStyle(sal_Int32 col, rtl::OUString style)
++{
++ m_aColumns[col] = style;
++}
++
++void XFTable::AddRow(XFRow *pRow)
++{
++ assert(pRow);
++ if( !pRow )
++ return;
++
++ int row = pRow->GetRow();
++
++ if( row<1 )
++ pRow->SetRow(m_aRows.size()+1);
++
++ row = pRow->GetRow();
++ if( m_aRows.find(row) != m_aRows.end() )
++ delete m_aRows[row];
++
++ pRow->SetOwnerTable(this);
++ m_aRows[row] = pRow;
++}
++
++void XFTable::AddHeaderRow(XFRow *pRow)
++{
++ if( !pRow )
++ return;
++ m_aHeaderRows.Add(pRow);
++}
++
++rtl::OUString XFTable::GetTableName()
++{
++ if( m_bSubTable )
++ {
++ return m_pOwnerCell->GetCellName();
++ }
++ else
++ return m_strName;
++}
++
++sal_Int32 XFTable::GetRowCount()
++{
++ sal_Int32 rowMax = -1;
++ std::map<sal_Int32,XFRow*>::iterator it;
++ for( it=m_aRows.begin(); it!=m_aRows.end(); it++ )
++ {
++ if( it->first>rowMax )
++ rowMax = it->first;
++ }
++
++ return rowMax;
++/*
++ if( m_aRows.size()<1 )
++ return 0;
++ std::map<sal_Int32,XFRow*>::iterator it = m_aRows.end();
++ it--;
++ return it->first;*/
++}
++
++XFRow* XFTable::GetRow(sal_Int32 row)
++{
++ return m_aRows[row];
++}
++
++sal_Int32 XFTable::GetColumnCount()
++{
++ int colMax = -1;
++ std::map<sal_Int32,rtl::OUString>::iterator it;
++ for( it=m_aColumns.begin(); it!=m_aColumns.end(); it++ )
++ {
++ if( it->first>colMax )
++ colMax = it->first;
++ }
++ return colMax;
++/*
++ if( m_aColumns.size()<1 )
++ return 0;
++ std::map<sal_Int32,rtl::OUString>::iterator it = m_aColumns.end();
++ it--;
++ return it->first;*/
++}
++
++rtl::OUString XFTable::GetColumnStyle(sal_Int32 col)
++{
++ if( m_aColumns.find(col) != m_aColumns.end() )
++ return m_aColumns[col];
++ return A2OUSTR("");
++}
++
++enumXFContent XFTable::GetContentType()
++{
++ return enumXFContentTable;
++}
++
++void XFTable::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ //sub table shouldn't use table name.
++ if( !m_bSubTable )
++ pAttrList->AddAttribute( A2OUSTR("table:name"), m_strName);
++
++ if( GetStyleName().getLength() )
++ pAttrList->AddAttribute( A2OUSTR("table:style-name"), GetStyleName() );
++
++ if( m_bSubTable )
++ pStrm->StartElement( A2OUSTR("table:sub-table") );
++ else
++ pStrm->StartElement( A2OUSTR("table:table") );
++
++ //test code
++// sal_Int32 rowMax = GetRowCount();
++// sal_Int32 colMax = GetColumnCount();
++ //output columns:
++ {
++ int lastCol = 0;
++ std::map<sal_Int32,rtl::OUString>::iterator it;
++ for( it=m_aColumns.begin(); it!=m_aColumns.end(); it++ )
++ {
++ sal_Int32 col = (*it).first;
++ rtl::OUString style = m_aColumns[col];
++
++ //default col repeated:
++ if( col >lastCol+1 )
++ {
++ if( col > lastCol + 2 )
++ {
++ if( m_strDefColStyle.getLength() > 0 )
++ {
++ pAttrList->AddAttribute( A2OUSTR("table:style-name"), m_strDefColStyle );
++ }
++ pAttrList->AddAttribute( A2OUSTR("table:number-columns-repeated"), Int32ToOUString(col-lastCol-1) );
++ }
++ pStrm->StartElement( A2OUSTR("table:table-column") );
++ pStrm->EndElement( A2OUSTR("table:table-column") );
++ }
++
++ if( style.getLength() > 0 )
++ {
++ pAttrList->AddAttribute( A2OUSTR("table:style-name"), style );
++ }
++ pStrm->StartElement( A2OUSTR("table:table-column") );
++ pStrm->EndElement( A2OUSTR("table:table-column") );
++ lastCol = col;
++ }
++ }
++
++ if( m_aHeaderRows.GetCount()>0 )
++ {
++ pStrm->StartElement( A2OUSTR("table:table-header-rows") );
++ m_aHeaderRows.ToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("table:table-header-rows") );
++ }
++ //output rows:
++ {
++ int lastRow = 0;
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ std::map<sal_Int32,XFRow* >::iterator it = m_aRows.begin();
++ for( ; it!=m_aRows.end(); it++ )
++ {
++ int row = (*it).first;
++ XFRow *pRow = (*it).second;
++
++ //null row repeated:
++ if( row>lastRow+1 )
++ {
++ XFRow *pNullRow = new XFRow();
++ pNullRow->SetStyleName(m_strDefRowStyle);
++ if( row>lastRow+2)
++ pNullRow->SetRepeated(row-lastRow-1);
++ XFCell *pCell = new XFCell();
++ pCell->SetStyleName(m_strDefCellStyle);
++ pNullRow->AddCell(pCell);
++ pNullRow->ToXml(pStrm);
++ }
++ pRow->ToXml(pStrm);
++ lastRow = row;
++ }
++ }
++
++ if( m_bSubTable )
++ pStrm->EndElement( A2OUSTR("table:sub-table") );
++ else
++ pStrm->EndElement( A2OUSTR("table:table") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftable.hxx lotuswordpro/source/filter/xfilter/xftable.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xftable.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftable.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,172 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Table object.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-24 create and implements.
++ ************************************************************************/
++#ifndef _XFTABLE_HXX
++#define _XFTABLE_HXX
++
++#include "xfcontent.hxx"
++#include "xfrow.hxx"
++#include "xfcell.hxx"
++#include "xfcontentcontainer.hxx"
++#include <map>
++#include <vector>
++
++class XFTable : public XFContent
++{
++public:
++ XFTable();
++
++ XFTable(const XFTable& other);
++
++ XFTable& operator=(const XFTable& other);
++
++ virtual ~XFTable();
++
++public:
++ void SetTableName(rtl::OUString name);
++
++ void SetColumnStyle(sal_Int32 col, rtl::OUString style);
++
++ void AddRow(XFRow *pRow);
++
++ void AddHeaderRow(XFRow *pRow);
++
++ void SetDefaultCellStyle(rtl::OUString style);
++
++ void SetDefaultRowStyle(rtl::OUString style);
++
++ void SetDefaultColStyle(rtl::OUString style);
++
++public:
++ void SetOwnerCell(XFCell *pCell);
++
++ rtl::OUString GetTableName();
++
++ sal_Int32 GetRowCount();
++
++ XFRow* GetRow(sal_Int32 row);
++
++ sal_Int32 GetColumnCount();
++
++ rtl::OUString GetColumnStyle(sal_Int32 col);
++
++ sal_Bool IsSubTable();
++
++ void Normalize();
++
++ enumXFContent GetContentType();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++ void RemoveRow(sal_Int32 row);
++
++private:
++ rtl::OUString m_strName;
++ sal_Bool m_bSubTable;
++ XFCell *m_pOwnerCell;
++ XFContentContainer m_aHeaderRows;
++ std::map<sal_Int32,XFRow*> m_aRows;
++ std::map<sal_Int32,rtl::OUString> m_aColumns;
++ rtl::OUString m_strDefCellStyle;
++ rtl::OUString m_strDefRowStyle;
++ rtl::OUString m_strDefColStyle;
++};
++
++inline void XFTable::SetTableName(rtl::OUString name)
++{
++ m_strName = name;
++}
++
++inline void XFTable::SetOwnerCell(XFCell *pCell)
++{
++ m_pOwnerCell = pCell;
++ m_bSubTable = (pCell!=NULL);
++}
++
++inline sal_Bool XFTable::IsSubTable()
++{
++ return m_bSubTable;
++}
++
++
++inline void XFTable::SetDefaultCellStyle(rtl::OUString style)
++{
++ m_strDefCellStyle = style;
++}
++
++inline void XFTable::SetDefaultRowStyle(rtl::OUString style)
++{
++ m_strDefRowStyle = style;
++}
++
++inline void XFTable::SetDefaultColStyle(rtl::OUString style)
++{
++ m_strDefColStyle = style;
++}
++
++inline void XFTable::RemoveRow(sal_Int32 row)
++{
++ m_aRows.erase(row);
++}
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftablestyle.cxx lotuswordpro/source/filter/xfilter/xftablestyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xftablestyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftablestyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,139 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Table style.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-24 create and implements.
++ ************************************************************************/
++#include "xftablestyle.hxx"
++#include "xfbgimage.hxx"
++
++XFTableStyle::XFTableStyle()
++{
++ m_fWidth = 2;
++ m_eAlign = enumXFAlignStart;
++ m_pBGImage = NULL;
++}
++
++XFTableStyle::~XFTableStyle()
++{
++ if( m_pBGImage )
++ delete m_pBGImage;
++}
++
++void XFTableStyle::SetBackImage(XFBGImage *pImage)
++{
++ if( m_pBGImage )
++ delete m_pBGImage;
++
++ m_pBGImage = pImage;
++}
++
++enumXFStyle XFTableStyle::GetStyleFamily()
++{
++ return enumXFStyleTable;
++}
++
++void XFTableStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
++ if( GetParentStyleName().getLength() > 0 )
++ pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
++ pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("table") );
++ pStrm->StartElement( A2OUSTR("style:style") );
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("style:width"), DoubleToOUString(m_fWidth) + A2OUSTR("cm") );
++ //text align:
++ if( m_eAlign == enumXFAlignStart )
++ {
++ pAttrList->AddAttribute(A2OUSTR("table:align"),A2OUSTR("left"));
++ }
++ else if( m_eAlign == enumXFAlignCenter )
++ {
++ pAttrList->AddAttribute(A2OUSTR("table:align"),A2OUSTR("center"));
++ }
++ else if( m_eAlign == enumXFAlignEnd )
++ {
++ pAttrList->AddAttribute(A2OUSTR("table:align"),A2OUSTR("right"));
++ }
++ else if( m_eAlign == enumXFALignMargins )
++ {
++ pAttrList->AddAttribute(A2OUSTR("table:align"),A2OUSTR("margins"));
++ }
++ //background color:
++ if( m_aBackColor.IsValid() && !m_pBGImage )
++ pAttrList->AddAttribute(A2OUSTR("fo:background-color"), m_aBackColor.ToString() );
++ //shadow:
++ m_aShadow.ToXml(pStrm);
++ //margin:
++ m_aMargins.ToXml(pStrm);
++ //breaks:
++ m_aBreaks.ToXml(pStrm);
++
++ pStrm->StartElement( A2OUSTR("style:properties") );
++ if( m_pBGImage )
++ m_pBGImage->ToXml(pStrm);
++
++ pStrm->EndElement( A2OUSTR("style:properties") );
++
++ pStrm->EndElement( A2OUSTR("style:style") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftablestyle.hxx lotuswordpro/source/filter/xfilter/xftablestyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xftablestyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftablestyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,155 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Table style.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-24 create and implements.
++ ************************************************************************/
++#ifndef _XFTABLESTYLE_HXX
++#define _XFTABLESTYLE_HXX
++
++#include "xfstyle.hxx"
++#include "xfmargins.hxx"
++#include "xfshadow.hxx"
++#include "xfcolor.hxx"
++#include "xfbreaks.hxx"
++
++class XFBGImage;
++class XFTableStyle : public XFStyle
++{
++public:
++ XFTableStyle();
++
++ virtual ~XFTableStyle();
++
++public:
++ void SetWidth(double width);
++
++ void SetAlign(enumXFAlignType eAlign, double offset = 0);
++
++ void SetShadow(enumXFShadowPos pos, double offset = 0.18, XFColor color=XFColor(128,128,0) );
++
++ void SetMargins(double left=-1, double right=-1, double top=-1, double bottom=-1);
++
++ void SetBackColor(XFColor& color);
++
++ void SetBackImage(XFBGImage *pImage);
++
++ void SetBreaks(enumXFBreaks breaks);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++ virtual enumXFStyle GetStyleFamily();
++
++private:
++ double m_fWidth;
++ XFColor m_aBackColor;
++ XFBGImage *m_pBGImage;
++ XFShadow m_aShadow;
++ XFMargins m_aMargins;
++ XFBreaks m_aBreaks;
++ enumXFAlignType m_eAlign;
++};
++
++inline void XFTableStyle::SetWidth(double width)
++{
++ m_fWidth = width;
++}
++
++inline void XFTableStyle::SetAlign(enumXFAlignType eAlign, double offset)
++{
++ m_eAlign = eAlign;
++ if( m_eAlign == enumXFAlignStart )
++ {
++ m_aMargins.SetLeft(offset);
++ m_aMargins.SetRight(0);
++ m_aMargins.SetTop(0);
++ m_aMargins.SetBottom(0);
++ }
++}
++
++inline void XFTableStyle::SetShadow(enumXFShadowPos pos, double offset, XFColor color)
++{
++ m_aShadow.SetColor(color);
++ m_aShadow.SetOffset(offset);
++ m_aShadow.SetPosition(pos);
++}
++
++inline void XFTableStyle::SetMargins(double left, double right, double top, double bottom)
++{
++ if( left != -1 )
++ m_aMargins.SetLeft(left);
++ if( right != -1 )
++ m_aMargins.SetRight(right);
++ if( top != -1 )
++ m_aMargins.SetTop(top);
++ if( bottom != -1 )
++ m_aMargins.SetBottom(bottom);
++}
++
++inline void XFTableStyle::SetBackColor(XFColor& color)
++{
++ m_aBackColor = color;
++}
++
++inline void XFTableStyle::SetBreaks(enumXFBreaks breaks)
++{
++ m_aBreaks.SetBreakType(breaks);
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftabstop.hxx lotuswordpro/source/filter/xfilter/xftabstop.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xftabstop.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftabstop.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,84 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/**************************************************************************
++ * @file
++ * Tab stop object,<text:tab-stop/>
++ *************************************************************************/
++/**************************************************************************
++ * Change History
++ * 2004-01-11 create this file.
++ *************************************************************************/
++#ifndef _XFTABSTOP_HXX
++#define _XFTABSTOP_HXX
++
++#include "xfglobal.hxx"
++#include "xfcontent.hxx"
++
++class XFTabStop : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++inline void XFTabStop::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("text:tab-stop") );
++ pStrm->EndElement( A2OUSTR("text:tab-stop") );
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftabstyle.cxx lotuswordpro/source/filter/xfilter/xftabstyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xftabstyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftabstyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,102 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Tab style for paragraph.include tab offset and tab char properties.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-27 create this file.
++ ************************************************************************/
++#include "xftabstyle.hxx"
++
++XFTabStyle::XFTabStyle()
++{
++ m_eType = enumXFTabNone;
++ m_fLength = 0;
++}
++
++void XFTabStyle::ToXml(IXFStream *pStrm)
++{
++ assert(m_fLength>0);
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pAttrList->AddAttribute( A2OUSTR("style:position"), DoubleToOUString(m_fLength) + A2OUSTR("cm") );
++ switch(m_eType)
++ {
++ case enumXFTabLeft:
++ pAttrList->AddAttribute( A2OUSTR("style:type"), A2OUSTR("left") );
++ break;
++ case enumXFTabCenter:
++ pAttrList->AddAttribute( A2OUSTR("style:type"), A2OUSTR("center") );
++ break;
++ case enumXFTabRight:
++ pAttrList->AddAttribute( A2OUSTR("style:type"), A2OUSTR("right") );
++ break;
++ case enumXFTabChar:
++ pAttrList->AddAttribute( A2OUSTR("style:type"), A2OUSTR("char") );
++ break;
++ }
++ //delimiter:
++ if( m_eType == enumXFTabChar )
++ pAttrList->AddAttribute( A2OUSTR("style:char"), m_strDelimiter );
++ //leader char:
++ if( m_strLeader.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("style:leader-char"), m_strLeader );
++
++ pStrm->StartElement( A2OUSTR("style:tab-stop") );
++ pStrm->EndElement( A2OUSTR("style:tab-stop") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftabstyle.hxx lotuswordpro/source/filter/xfilter/xftabstyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xftabstyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftabstyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,122 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Tab style for paragraph.include tab offset and tab char properties.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-27 create this file.
++ ************************************************************************/
++#ifndef _XFTABSSTYLE_HXX
++#define _XFTABSSTYLE_HXX
++
++#include "xfglobal.hxx"
++#include "xfstyle.hxx"
++#include <vector>
++
++class XFTabStyle : public XFStyle
++{
++public:
++ XFTabStyle();
++
++public:
++ void SetTabType(enumXFTab type);
++
++ void SetLength(double len);
++
++ void SetDelimiter(sal_Unicode delimiter);
++
++ void SetLeaderChar(sal_Unicode leader);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ enumXFTab m_eType;
++ double m_fLength;
++ rtl::OUString m_strDelimiter;
++ rtl::OUString m_strLeader;
++};
++
++inline void XFTabStyle::SetTabType(enumXFTab type)
++{
++ m_eType = type;
++}
++
++inline void XFTabStyle::SetLength(double len)
++{
++ m_fLength = len;
++}
++
++inline void XFTabStyle::SetDelimiter(sal_Unicode delimiter)
++{
++ sal_Unicode chs[2];
++ chs[0] = delimiter;
++ chs[1] = 0;
++
++ m_strDelimiter = rtl::OUString(chs);
++}
++
++inline void XFTabStyle::SetLeaderChar(sal_Unicode leader)
++{
++ sal_Unicode chs[2];
++ chs[0] = leader;
++ chs[1] = 0;
++
++ m_strLeader = rtl::OUString(chs);
++}
++
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextboxstyle.cxx lotuswordpro/source/filter/xfilter/xftextboxstyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xftextboxstyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftextboxstyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,102 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#include "xftextboxstyle.hxx"
++#include "xfcolumns.hxx"
++#include "xfborders.hxx"
++#include "xfshadow.hxx"
++#include "xfbgimage.hxx"
++
++XFTextBoxStyle::XFTextBoxStyle()
++{
++}
++
++XFTextBoxStyle::~XFTextBoxStyle()
++{
++}
++
++enumXFStyle XFTextBoxStyle::GetStyleFamily()
++{
++ return enumXFStyleGraphics;
++}
++
++void XFTextBoxStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
++ if( GetParentStyleName().getLength() > 0 )
++ pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
++ pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("graphics") );
++ //parent style name ignore now.
++ pStrm->StartElement( A2OUSTR("style:style") );
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("draw:stroke"), A2OUSTR("none") );
++ pAttrList->AddAttribute( A2OUSTR("svg:stroke-color"), A2OUSTR("#000000") );
++ pAttrList->AddAttribute( A2OUSTR("draw:fill"), A2OUSTR("none") );
++ pAttrList->AddAttribute( A2OUSTR("draw:fill-color"), A2OUSTR("#ffffff") );
++ pAttrList->AddAttribute( A2OUSTR("draw:auto-grow-height"), A2OUSTR("true") );
++ pAttrList->AddAttribute( A2OUSTR("style:run-through"), A2OUSTR("foreground") );
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("run-through") );
++ pAttrList->AddAttribute( A2OUSTR("style:wrap"), A2OUSTR("run-through") );
++ pAttrList->AddAttribute( A2OUSTR("style:number-wrapped-paragraphs"), A2OUSTR("no-limit") );
++ pAttrList->AddAttribute( A2OUSTR("style:wrap-contour"), A2OUSTR("false") );
++
++ pStrm->StartElement( A2OUSTR("style:properties") );
++ pStrm->EndElement( A2OUSTR("style:properties") );
++
++ pStrm->EndElement( A2OUSTR("style:style") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextboxstyle.hxx lotuswordpro/source/filter/xfilter/xftextboxstyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xftextboxstyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftextboxstyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,89 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++#ifndef _XFTEXTBOXSTYLE_HXX
++#define _XFTEXTBOXSTYLE_HXX
++
++#include "xfglobal.hxx"
++#include "xfstyle.hxx"
++#include "xfmargins.hxx"
++#include "xfcolor.hxx"
++#include "xfpadding.hxx"
++
++class XFBorders;
++class XFColumns;
++class XFShadow;
++class XFBGImage;
++
++/**
++* @brief
++* Style for all frame obejcts.
++*/
++class XFTextBoxStyle : public XFStyle
++{
++public:
++ XFTextBoxStyle();
++
++ virtual ~XFTextBoxStyle();
++
++public:
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++protected:
++};
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextcontent.cxx lotuswordpro/source/filter/xfilter/xftextcontent.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xftextcontent.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftextcontent.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,125 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Text content, it's an adapter for string to IXFObject.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ 2005-02-02 create and implemente.
++ ************************************************************************/
++#include "xftextcontent.hxx"
++#include "ixfstream.hxx"
++
++XFTextContent::XFTextContent(rtl::OUString text):m_strText(text)
++{
++}
++
++XFTextContent::~XFTextContent()
++{
++}
++
++enumXFContent XFTextContent::GetContentType()
++{
++ return enumXFContentText;
++}
++
++void XFTextContent::SetText(const rtl::OUString& text)
++{
++ m_strText = text;
++}
++
++rtl::OUString XFTextContent::GetText()
++{
++ return m_strText;
++}
++
++void XFTextContent::ToXml(IXFStream *pStrm)
++{
++// pStrm->Characters(m_strText);
++ rtl::OUString sSpaceToken = rtl::OUString::createFromAscii(" ");
++ sSpaceToken += rtl::OUString::createFromAscii(" ");
++ rtl::OUString sSubString;
++ sal_Int32 nIndex = 0;
++ sal_Int32 nSize = m_strText.getLength();
++ sal_Int32 i,j;
++ for (i=0; i<nSize;)
++ {
++ sSubString = m_strText.copy(i,nSize-i);
++ nIndex = sSubString.indexOf(sSpaceToken);
++ if (nIndex == -1)
++ {
++ pStrm->Characters(sSubString);
++ return;
++ }
++ else
++ {
++ if (nIndex != 0)
++ pStrm->Characters(sSubString.copy(0,nIndex));
++ for (j=nIndex+1;j<nSize-i;j++)
++ {
++ if (sSubString[j] != sal_Char(' '))
++ break;
++ }
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("text:c"), rtl::OUString::valueOf(j-nIndex) );
++ pStrm->StartElement( A2OUSTR("text:s") );
++ pStrm->EndElement( A2OUSTR("text:s") );
++
++ i+=j;
++ }
++ }
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextcontent.hxx lotuswordpro/source/filter/xfilter/xftextcontent.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xftextcontent.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftextcontent.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,105 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Text content, it's an adapter for string to IXFObject.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ 2005-02-02 create and implemente.
++ ************************************************************************/
++#ifndef _XFTEXTCONTENT_HXX
++#define _XFTEXTCONTENT_HXX
++
++#include "xfglobal.hxx"
++#include "xfcontent.hxx"
++
++class IXFStream;
++
++/**
++ * @brief
++ * Adapter for text to content.
++ */
++class XFTextContent : public XFContent
++{
++public:
++ XFTextContent(){}
++
++ XFTextContent(rtl::OUString text);
++
++ virtual ~XFTextContent();
++
++public:
++ /**
++ * @descr Set the text.
++ */
++ void SetText(const rtl::OUString& text);
++
++ /**
++ * @descr return the content.
++ * @return text content.
++ */
++ rtl::OUString GetText();
++
++ virtual enumXFContent GetContentType();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ rtl::OUString m_strText;
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextheading.cxx lotuswordpro/source/filter/xfilter/xftextheading.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xftextheading.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftextheading.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,108 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Heading text for OOo.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-07 create this file.
++ * 2005-01-10 it works now.
++ ************************************************************************/
++#include "xftextheading.hxx"
++#include "xftextcontent.hxx"
++
++XFTextHeading::XFTextHeading()
++{
++ m_pContent = NULL;
++ m_nLevel = 0;
++}
++
++XFTextHeading::~XFTextHeading()
++{
++ if( m_pContent )
++ delete m_pContent;
++}
++
++enumXFContent XFTextHeading::GetContentType()
++{
++ return enumXFContentHeading;
++}
++
++void XFTextHeading::SetLevel(sal_Int16 level)
++{
++ m_nLevel = level;
++}
++
++void XFTextHeading::SetText(rtl::OUString text)
++{
++ m_pContent = new XFTextContent(text);
++}
++
++void XFTextHeading::ToXml(IXFStream *pStrm)
++{
++ rtl::OUString style = GetStyleName();
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ assert(m_nLevel>0);
++ pAttrList->Clear();
++ if( style.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), style );
++ pAttrList->AddAttribute( A2OUSTR("text:level"), Int16ToOUString(m_nLevel) );
++
++ pStrm->StartElement( A2OUSTR("text:h") );
++ m_pContent->ToXml(pStrm);
++ pStrm->EndElement( A2OUSTR("text:h") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextheading.hxx lotuswordpro/source/filter/xfilter/xftextheading.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xftextheading.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftextheading.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,93 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Heading text for OOo.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-07 create this file.
++ * 2005-01-10 it works now.
++ ************************************************************************/
++#ifndef _XFTEXTHEADING_HXX
++#define _XFTEXTHEADING_HXX
++
++#include "xfglobal.hxx"
++#include "xfcontent.hxx"
++
++class XFTextContent;
++/**
++ * @descr
++ * <text:h> object. It has a single property text:level.
++ * This object use the same style type with <text:p>
++ */
++class XFTextHeading : public XFContent
++{
++public:
++ XFTextHeading();
++ virtual ~XFTextHeading();
++
++ void SetLevel(sal_Int16 level);
++ void SetText(rtl::OUString text);
++
++ virtual enumXFContent GetContentType();
++ virtual void ToXml(IXFStream *pStrm);
++private:
++ XFTextContent *m_pContent;
++ sal_Int16 m_nLevel;
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextspan.cxx lotuswordpro/source/filter/xfilter/xftextspan.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xftextspan.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftextspan.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,191 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * An span of text with style.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#include "xftextspan.hxx"
++#include "ixfstream.hxx"
++#include "ixfattrlist.hxx"
++#include "xftextcontent.hxx"
++
++XFTextSpan::XFTextSpan()
++{
++
++}
++
++XFTextSpan::XFTextSpan(rtl::OUString& text,
++ rtl::OUString& style
++ )
++{
++ Add(text);
++ SetStyleName(style);
++}
++
++XFTextSpan::~XFTextSpan()
++{
++ std::vector<IXFContent*>::iterator it;
++ for( it = m_aContents.begin(); it != m_aContents.end(); it++ )
++ {
++ IXFContent *pContent = *it;
++ if( pContent )
++ {
++ delete pContent;
++ }
++ }
++ m_aContents.clear();
++}
++
++enumXFContent XFTextSpan::GetContentType()
++{
++ return enumXFContentSpan;
++}
++
++void XFTextSpan::SetText(rtl::OUString& text)
++{
++ m_aContents.clear();
++ Add(text);
++}
++
++rtl::OUString XFTextSpan::GetText()
++{
++ rtl::OUString text;
++ std::vector<IXFContent*>::iterator it;
++
++ it = m_aContents.begin();
++ if( it != m_aContents.end() )
++ {
++ IXFContent *pContent = *it;
++ if( pContent->GetContentType() != enumXFContentText )
++ {
++ assert(false);
++ }
++ XFTextContent *pText = (XFTextContent*)pContent;
++ if( pText )
++ text = pText->GetText();
++ }
++
++ return text;
++}
++
++void XFTextSpan::Add(IXFContent *pContent)
++{
++ m_aContents.push_back(pContent);
++}
++
++void XFTextSpan::Add(rtl::OUString& text)
++{
++ IXFContent *pText = new XFTextContent(text);
++ Add(pText);
++}
++
++void XFTextSpan::ToXml(IXFStream *pStrm)
++{
++ rtl::OUString style = GetStyleName();
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ assert(pAttrList);
++
++ pAttrList->Clear();
++ if( style.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
++ pStrm->StartElement( A2OUSTR("text:span") );
++
++ std::vector<IXFContent*>::iterator it;
++ for( it= m_aContents.begin(); it!= m_aContents.end(); it++ )
++ {
++ IXFContent *pContent = *it;
++ if( pContent )
++ pContent->ToXml(pStrm);
++ }
++
++ pStrm->EndElement( A2OUSTR("text:span") );
++}
++
++void XFTextSpanStart::ToXml(IXFStream *pStrm)
++{
++ rtl::OUString style = GetStyleName();
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ assert(pAttrList);
++
++ pAttrList->Clear();
++ if( style.getLength() )
++ pAttrList->AddAttribute( A2OUSTR("text:style-name"), GetStyleName() );
++ pStrm->StartElement( A2OUSTR("text:span") );
++
++ std::vector<IXFContent*>::iterator it;
++ for( it= m_aContents.begin(); it!= m_aContents.end(); it++ )
++ {
++ IXFContent *pContent = *it;
++ if( pContent )
++ pContent->ToXml(pStrm);
++ }
++}
++void XFTextSpanEnd::ToXml(IXFStream *pStrm)
++{
++ std::vector<IXFContent*>::iterator it;
++ for( it= m_aContents.begin(); it!= m_aContents.end(); it++ )
++ {
++ IXFContent *pContent = *it;
++ if( pContent )
++ pContent->ToXml(pStrm);
++ }
++ pStrm->EndElement( A2OUSTR("text:span") );
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextspan.hxx lotuswordpro/source/filter/xfilter/xftextspan.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xftextspan.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftextspan.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,103 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * An span of text with style.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef _XFTEXTSPAN_HXX
++#define _XFTEXTSPAN_HXX
++
++#include "xfglobal.hxx"
++#include "xfcontent.hxx"
++#include <vector>
++
++class IXFStream;
++
++class XFTextSpan : public XFContent
++{
++public:
++ XFTextSpan();
++ XFTextSpan(rtl::OUString& text, rtl::OUString& style );
++
++ virtual ~XFTextSpan();
++
++ void SetText(rtl::OUString& text);
++ rtl::OUString GetText();
++ void Add(IXFContent *pContent);
++ void Add(rtl::OUString& text);
++
++ virtual enumXFContent GetContentType();
++ virtual void ToXml(IXFStream *pStrm);
++protected:
++ std::vector<IXFContent*> m_aContents;
++};
++
++class XFTextSpanStart : public XFTextSpan //for adding style of power field
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++class XFTextSpanEnd : public XFTextSpan //for adding style of power field
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextstyle.cxx lotuswordpro/source/filter/xfilter/xftextstyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xftextstyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftextstyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,142 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Style for <text:p> or <text:h> or <text:span>
++ * Now we have only font attributes.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-26 create this file.
++ ************************************************************************/
++#include "xftextstyle.hxx"
++#include "ixfattrlist.hxx"
++#include "ixfstream.hxx"
++#include "xffont.hxx"
++#include "xfutil.hxx"
++
++XFTextStyle::XFTextStyle()
++{
++ m_pFont = NULL;
++}
++
++XFTextStyle::~XFTextStyle()
++{
++}
++
++void XFTextStyle::SetFont(XFFont *font)
++{
++ m_pFont = font;
++}
++
++sal_Bool XFTextStyle::Equal(IXFStyle *pStyle)
++{
++ if( !pStyle || pStyle->GetStyleFamily() != enumXFStyleText )
++ {
++ return sal_False;
++ }
++
++ XFTextStyle *pOther = (XFTextStyle*)pStyle;
++ if( !pOther )
++ {
++ return sal_False;
++ }
++
++ if( m_pFont )
++ {
++ if( !pOther->m_pFont )
++ return sal_False;
++ if( *m_pFont != *pOther->m_pFont )
++ return sal_False;
++ }
++ else if( pOther->m_pFont )
++ return sal_False;
++
++ return sal_True;
++}
++
++enumXFStyle XFTextStyle::GetStyleFamily()
++{
++ return enumXFStyleText;
++}
++
++void XFTextStyle::ToXml(IXFStream *strm)
++{
++ IXFAttrList *pAttrList = strm->GetAttrList();
++ rtl::OUString style = GetStyleName();
++
++ pAttrList->Clear();
++ if( style.getLength() )
++ pAttrList->AddAttribute(rtl::OUString::createFromAscii("style:name"),GetStyleName());
++ if( GetParentStyleName().getLength() > 0 )
++ pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
++
++ pAttrList->AddAttribute(rtl::OUString::createFromAscii("style:family"),A2OUSTR("text") );
++ strm->StartElement(rtl::OUString::createFromAscii("style:style"));
++
++ //Font properties:
++ pAttrList->Clear();
++ //font name:
++ if( m_pFont )
++ m_pFont->ToXml(strm);
++
++ strm->StartElement(rtl::OUString::createFromAscii("style:properties"));
++ strm->EndElement(rtl::OUString::createFromAscii("style:properties"));
++
++ strm->EndElement(rtl::OUString::createFromAscii("style:style"));
++}
++
++
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftextstyle.hxx lotuswordpro/source/filter/xfilter/xftextstyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xftextstyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftextstyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,123 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Style for <text:p> or <text:h> or <text:span>
++ * Now we have only font attributes.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-26 create this file.
++ * 2005-01-04 Change the static style id.
++ * 2005-01-20 Get rid of the static id.
++ ************************************************************************/
++#ifndef _XFTEXTSTYLE_HXX
++#define _XFTEXTSTYLE_HXX
++
++#include "xfglobal.hxx"
++#include "xfstyle.hxx"
++
++class IXFStream;
++class XFFont;
++
++class XFTextStyle : public XFStyle
++{
++public:
++ XFTextStyle();
++
++ virtual ~XFTextStyle();
++
++public:
++ /**
++ * @descr: set the font for the text span.
++ */
++ void SetFont(XFFont *font);
++
++ XFFont* GetFont(){ return m_pFont; }
++
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual sal_Bool Equal(IXFStyle *pStyle);
++
++ virtual void ToXml(IXFStream *strm);
++
++private:
++ XFFont *m_pFont;
++};
++
++#endif
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftexttable.cxx lotuswordpro/source/filter/xfilter/xftexttable.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xftexttable.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftexttable.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,142 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Text table object. It's the table used in writer.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-03-31 create and implements.
++ ************************************************************************/
++#include "xftexttable.hxx"
++
++XFTextTable::XFTextTable()
++{
++
++}
++
++void XFTextTable::SetColCount(sal_Int32 col)
++{
++ m_nColCount = col;
++}
++
++void XFTextTable::SetRowCount(sal_Int32 row)
++{
++ m_nRowCount = row;
++}
++
++void XFTextTable::SetCell(sal_Int32 row, sal_Int32 col, XFCell *pCell)
++{
++ if( row<0 || col<0 || !pCell )
++ return;
++
++ XFRow *pRow = GetRow(row);
++ if( !pRow )
++ {
++ pRow = new XFRow();
++ pRow->SetRow(row);
++ AddRow(pRow);
++
++ pRow = GetRow(row);
++ }
++ if( !pRow )
++ return;
++ pCell->SetCol(col);
++
++ pRow->AddCell(pCell);
++}
++
++virtual void XFTextTable::ToXml(IXFStream *pStrm)
++{
++ for( int i=0; i<m_nColCount; i++ )
++ {
++ rtl::OUString strColStyle = GetColumnStyle(i);
++ if( strColStyle.getLength()>0 )
++ SetColumnStyle(col, m_strDefColStyle);
++ }
++
++ for( int i=0; i<m_nRowCount; i++ )
++ {
++ XFRow *pRow = GetRow(i);
++ if( !pRow )
++ {
++ pRow = new XFRow();
++ pRow->SetRow(i);
++ pRow->SetStyleName(m_strDefRowStyle);
++
++ XFCell *pCell = new XFCell();
++ pCell->SetColumnSpaned(m_nColCount);
++ pRow->AddCell(pCell);
++
++ SetRow(i, pRow);
++ }
++ else
++ {
++ for( int j=0; j<m_nColCount; j++ )
++ {
++ XFCell *pCell = pRow->GetCell(j);
++ if( !pCell )
++ {
++ pCell = new XFCell();
++ pCell->SetCol(j);
++ pCell->SetStyleName(m_strDefCellStyle);
++ pRow->AddCell(pCell);
++ }
++ }
++ }
++ }
++
++ XFTable::ToXml(pStrm);
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftexttable.hxx lotuswordpro/source/filter/xfilter/xftexttable.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xftexttable.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftexttable.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,87 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Text table object. It's the table used in writer.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-03-31 create and implements.
++ ************************************************************************/
++#ifndef _XFTEXTTABLE_HXX
++#define _XFTEXTTABLE_HXX
++
++#include "xftable.hxx"
++
++class XFTextTable : public XFTable
++{
++public:
++ XFTextTable();
++
++private:
++ void SetRowCount(sal_Int32 row);
++
++ void SetColCount(sal_Int32 col);
++
++ rtl::OUString SetCell(sal_Int32 row, sal_Int32 col, XFCell *pCell);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ sal_Int32 m_nColCount;
++ sal_Int32 m_nRowCount;
++};
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftime.cxx lotuswordpro/source/filter/xfilter/xftime.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xftime.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftime.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,91 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Time field with time style.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-21 create this file.
++ ************************************************************************/
++#include "xftime.hxx"
++
++XFTime::XFTime()
++{
++ m_bFixed = 0;
++ rtl_zeroMemory(&m_aDateTime,sizeof(m_aDateTime));
++}
++
++XFTime::~XFTime()
++{
++}
++
++void XFTime::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ if( GetStyleName().getLength() > 0 )
++ pAttrList->AddAttribute( A2OUSTR("style:data-style-name"), GetStyleName() );
++ pAttrList->AddAttribute( A2OUSTR("text:time-value"), DateTimeToOUString(m_aDateTime) );
++ if( m_bFixed )
++ pAttrList->AddAttribute( A2OUSTR("text:fixed"), A2OUSTR("true") );
++
++ pStrm->StartElement( A2OUSTR("text:time") );
++ pStrm->Characters(m_strText);
++ pStrm->EndElement( A2OUSTR("text:time") );
++}
++
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftime.hxx lotuswordpro/source/filter/xfilter/xftime.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xftime.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftime.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,109 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Time field with time style.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-21 create this file.
++ ************************************************************************/
++#ifndef _XFTIME_HXX
++#define _XFTIME_HXX
++
++#include "xfglobal.hxx"
++#include "xfcontent.hxx"
++
++class XFTime : public XFContent
++{
++public:
++ XFTime();
++
++ virtual ~XFTime();
++
++public:
++ void SetDate(XFDateTime& dt);
++
++ void SetText(rtl::OUString& text);
++
++ void SetFixed(sal_Bool fixed = sal_True);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++private:
++ sal_Bool m_bFixed;
++
++ rtl::OUString m_strText;
++
++ XFDateTime m_aDateTime;
++};
++
++inline void XFTime::SetDate(XFDateTime& dt)
++{
++ m_aDateTime = dt;
++}
++
++inline void XFTime::SetText(rtl::OUString& text)
++{
++ m_strText = text;
++}
++
++inline void XFTime::SetFixed(sal_Bool fixed)
++{
++ m_bFixed = fixed;
++}
++
++#endif
++
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftimestyle.cxx lotuswordpro/source/filter/xfilter/xftimestyle.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xftimestyle.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftimestyle.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,152 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Time style. The TIme format for time field.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-20 create this file.
++ ************************************************************************/
++
++#include "xftimestyle.hxx"
++
++XFTimePart::XFTimePart()
++{
++ m_nDecimalPos = 0;
++}
++
++void XFTimePart::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ switch(m_ePart)
++ {
++ case enumXFDateHour:
++ pAttrList->Clear();
++ if( m_bLongFmt )
++ pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
++ pStrm->StartElement( A2OUSTR("number:hours") );
++ pStrm->EndElement( A2OUSTR("number:hours") );
++ break;
++ case enumXFDateMinute:
++ pAttrList->Clear();
++ if( m_bLongFmt )
++ pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
++ if( m_nDecimalPos>0 )
++ pAttrList->AddAttribute( A2OUSTR("number:decimal-places"), Int32ToOUString(m_nDecimalPos) );
++
++ pStrm->StartElement( A2OUSTR("number:minutes") );
++ pStrm->EndElement( A2OUSTR("number:minutes") );
++ break;
++ case enumXFDateSecond:
++ pAttrList->Clear();
++ if( m_bLongFmt )
++ pAttrList->AddAttribute( A2OUSTR("number:style"), A2OUSTR("long") );
++ pStrm->StartElement( A2OUSTR("number:seconds") );
++ pStrm->EndElement( A2OUSTR("number:seconds") );
++ break;
++ case enumXFDateText:
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("number:text") );
++ pStrm->Characters( m_strText );
++ pStrm->EndElement( A2OUSTR("number:text") );
++ break;
++ }
++}
++
++XFTimeStyle::XFTimeStyle()
++{
++ m_bFixed = sal_True;
++ m_bAmPm = sal_False;
++ m_bTruncate = sal_True;
++}
++
++XFTimeStyle::~XFTimeStyle()
++{
++}
++
++enumXFStyle XFTimeStyle::GetStyleFamily()
++{
++ return enumXFStyleTime;
++}
++
++
++void XFTimeStyle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++
++ pAttrList->Clear();
++ pAttrList->AddAttribute( A2OUSTR("style:name"), GetStyleName() );
++ if( GetParentStyleName().getLength() > 0 )
++ pAttrList->AddAttribute(A2OUSTR("style:parent-style-name"),GetParentStyleName());
++ pAttrList->AddAttribute( A2OUSTR("style:family"), A2OUSTR("data-style") );
++ if (!m_bTruncate)
++ pAttrList->AddAttribute( A2OUSTR("number:truncate-on-overflow"), A2OUSTR("false") );
++ pStrm->StartElement( A2OUSTR("number:time-style") );
++
++ std::vector<XFTimePart>::iterator it;
++ for( it = m_aParts.begin(); it != m_aParts.end(); it++ )
++ {
++ (*it).ToXml(pStrm);
++ }
++ if( m_bAmPm )
++ {
++ pAttrList->Clear();
++ pStrm->StartElement( A2OUSTR("number:am-pm") );
++ pStrm->EndElement( A2OUSTR("number:am-pm") );
++ }
++ pStrm->EndElement( A2OUSTR("number:time-style") );
++}
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftimestyle.hxx lotuswordpro/source/filter/xfilter/xftimestyle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xftimestyle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftimestyle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,205 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Time style. The TIme format for time field.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-20 create this file.
++ ************************************************************************/
++#ifndef _XFTIMESTYLE_HXX
++#define _XFTIMESTYLE_HXX
++
++#include "xfglobal.hxx"
++#include "xfstyle.hxx"
++#include "ixfproperty.hxx"
++#include <vector>
++
++class XFDateTimePart : public XFStyle
++{
++public:
++ XFDateTimePart()
++ {
++ m_ePart = enumXFDateUnknown;
++ m_bLongFmt = sal_False;
++ }
++
++ virtual ~XFDateTimePart(){}
++public:
++ void SetPartType(enumXFDatePart ePart);
++
++ void SetLongFmt(sal_Bool bLongFmt);
++
++ void SetText(rtl::OUString& text);
++
++protected:
++ enumXFDatePart m_ePart;
++ sal_Bool m_bLongFmt;
++ rtl::OUString m_strText;
++};
++
++class XFTimePart : public XFDateTimePart
++{
++public:
++ XFTimePart();
++
++ virtual ~XFTimePart(){}
++public:
++ void SetDecimalPos(sal_Int32 pos);
++
++ virtual void ToXml(IXFStream *pStrm);
++
++protected:
++ sal_Int32 m_nDecimalPos;
++};
++
++class XFTimeStyle : public XFStyle
++{
++public:
++ XFTimeStyle();
++
++ virtual ~XFTimeStyle();
++
++public:
++
++ void AddHour( sal_Bool bLongFmt = sal_True );
++
++ void AddMinute( sal_Bool bLongFmt = sal_True );
++
++ void AddSecond( sal_Bool bLongFmt = sal_True, sal_Int16 nDecimalPos = 2);
++
++ void SetAmPm(sal_Bool bAmPm);
++
++ void AddText( rtl::OUString part );
++
++ virtual enumXFStyle GetStyleFamily();
++
++ virtual void ToXml(IXFStream *pStrm);
++
++ void SetTruncate(sal_Bool bTrunc);
++
++private:
++ sal_Bool m_bFixed;
++ sal_Bool m_bAmPm;
++ std::vector<XFTimePart> m_aParts;
++ sal_Bool m_bTruncate;
++};
++
++
++inline void XFDateTimePart::SetPartType(enumXFDatePart ePart)
++{
++ m_ePart = ePart;
++}
++
++inline void XFDateTimePart::SetLongFmt(sal_Bool bLongFmt)
++{
++ m_bLongFmt = bLongFmt;
++}
++
++inline void XFDateTimePart::SetText(rtl::OUString& text)
++{
++ m_strText = text;
++}
++
++inline void XFTimePart::SetDecimalPos(sal_Int32 pos)
++{
++ m_nDecimalPos = pos;
++}
++
++inline void XFTimeStyle::AddHour( sal_Bool bLongFmt )
++{
++ XFTimePart part;
++ part.SetPartType(enumXFDateHour);
++ part.SetLongFmt(bLongFmt);
++ m_aParts.push_back(part);
++}
++
++inline void XFTimeStyle::AddMinute( sal_Bool bLongFmt )
++{
++ XFTimePart part;
++ part.SetPartType(enumXFDateMinute);
++ part.SetLongFmt(bLongFmt);
++ m_aParts.push_back(part);
++}
++
++inline void XFTimeStyle::AddSecond( sal_Bool bLongFmt, sal_Int16 pos)
++{
++ XFTimePart part;
++ part.SetPartType(enumXFDateSecond);
++ part.SetLongFmt(bLongFmt);
++ part.SetDecimalPos(pos);
++ m_aParts.push_back(part);
++}
++
++inline void XFTimeStyle::SetAmPm(sal_Bool bAmPm)
++{
++ m_bAmPm = bAmPm;
++}
++
++inline void XFTimeStyle::AddText( rtl::OUString text )
++{
++ XFTimePart part;
++ part.SetPartType(enumXFDateText);
++ part.SetText(text);
++ m_aParts.push_back(part);
++}
++
++inline void XFTimeStyle::SetTruncate(sal_Bool bTrunc)
++{
++ m_bTruncate = bTrunc;
++}
++
++#endif
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xftitle.hxx lotuswordpro/source/filter/xfilter/xftitle.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xftitle.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xftitle.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,89 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Page number field.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2005-01-31 create this file.
++ ************************************************************************/
++#ifndef _XFTITLE_HXX
++#define _XFTITLE_HXX
++
++#include "xfglobal.hxx"
++#include "xfcontent.hxx"
++#include "xfnumfmt.hxx"
++
++/**
++ * @brief
++ * Title field.
++ */
++class XFTitle : public XFContent
++{
++public:
++ virtual void ToXml(IXFStream *pStrm);
++};
++
++inline void XFTitle::ToXml(IXFStream *pStrm)
++{
++ IXFAttrList *pAttrList = pStrm->GetAttrList();
++ pAttrList->Clear();
++
++ pStrm->StartElement( A2OUSTR("text:title") );
++ pStrm->EndElement( A2OUSTR("text:title") );
++}
++
++#endif
+\ No newline at end of file
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfutil.cxx lotuswordpro/source/filter/xfilter/xfutil.cxx
+--- lotuswordpro.bak/source/filter/xfilter/xfutil.cxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfutil.cxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,562 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Util functions for xml filter.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ * 2005-01-24 add some enum tool funtion here.
++ ************************************************************************/
++#include <stdio.h>
++#include "xfutil.hxx"
++#include "xfparagraph.hxx"
++#include "xfcontentcontainer.hxx"
++#include <rtl/ustrbuf.hxx>
++#include <sstream>
++
++rtl::OUString Int32ToOUString(sal_Int32 num)
++{
++ /*std::stringstream sstrm;
++
++ sstrm<<(int)num;
++ return rtl::OUString::createFromAscii(sstrm.str().c_str());
++ */
++ return rtl::OUString::valueOf(num);
++}
++
++rtl::OUString Int16ToOUString(sal_Int16 num)
++{
++ /*std::stringstream sstrm;
++
++ sstrm<<(int)num;
++ return rtl::OUString::createFromAscii(sstrm.str().c_str());
++ */
++ sal_Int32 nNum = static_cast<sal_Int32>(num);
++ return rtl::OUString::valueOf(nNum);
++}
++
++rtl::OUString FloatToOUString(float num, sal_Int32 precision)
++{
++ /*std::stringstream sstrm;
++ std::string strRet;
++
++ sstrm.precision(precision);
++ sstrm<<num;
++ return rtl::OUString::createFromAscii(sstrm.str().c_str());
++ */
++ return rtl::OUString::valueOf(num);
++}
++
++rtl::OUString DoubleToOUString(double num, sal_Int32 precision)
++{
++ /*std::stringstream sstrm;
++ std::string strRet;
++
++ sstrm.precision(precision);
++ sstrm<<num;
++ return rtl::OUString::createFromAscii(sstrm.str().c_str());
++ */
++ return rtl::OUString::valueOf(num);
++}
++
++rtl::OUString OEMToOUString(const std::string& str)
++{
++ return rtl::OUString();
++}
++
++rtl::OUString ColorToOUString( sal_uInt32 color)
++{
++ unsigned int c = color&0x00ffffff;
++ unsigned char r;
++ unsigned char g;
++ unsigned char b;
++ char buf[8];
++
++ unsigned int temp = c;
++ r = temp&0x000000ff;
++
++ temp = c;
++ g = (temp&0x0000ff00)>>8;
++
++ temp = c;
++ b = (temp&0x00ff0000)>>16;
++
++ rtl_zeroMemory(buf,8);
++ sprintf(buf,"#%2x%2x%2x",r,g,b);
++ for( int i=0; i<6; i++ )
++ {
++ if( buf[i] == ' ' )
++ buf[i] = '0';
++ }
++ return rtl::OUString::createFromAscii(buf);
++}
++
++rtl::OUString DateTimeToOUString(XFDateTime& dt)
++{
++ rtl::OUStringBuffer buf;
++ buf.append(dt.nYear);
++ buf.append( A2OUSTR("-") );
++ buf.append(dt.nMonth);
++ buf.append( A2OUSTR("-") );
++ buf.append(dt.nDay);
++ buf.append( A2OUSTR("T") );
++ buf.append(dt.nHour);
++ buf.append( A2OUSTR(":") );
++ buf.append(dt.nMinute);
++ buf.append( A2OUSTR(":") );
++ buf.append(dt.nSecond);
++ buf.append( A2OUSTR(".") );
++ buf.append(dt.nMillSecond);
++
++ return buf.makeStringAndClear();
++}
++
++rtl::OUString GetTableColName(sal_Int32 col)
++{
++ int remain;
++ char ch;
++ std::string strOut;
++
++ if( col <= 26 )
++ {
++ ch = 'A' + col -1;
++ strOut += ch;
++ return A2OUSTR(strOut.c_str());
++ }
++
++ while( col>26 )
++ {
++ remain = col%26;
++ col = col/26;
++ ch = 'A' + remain -1;
++ strOut += ch;
++ }
++
++ ch = 'A' + remain -1;
++ strOut += ch;
++ return A2OUSTR(strOut.c_str());
++}
++
++//tool functions:
++rtl::OUString GetUnderlineName(enumXFUnderline type)
++{
++ switch(type)
++ {
++ case enumXFUnderlineNone:
++ return A2OUSTR("none");
++ break;
++ case enumXFUnderlineSingle:
++ return A2OUSTR("single");
++ break;
++ case enumXFUnderlineDouble:
++ return A2OUSTR("double");
++ break;
++ case enumXFUnderlineDotted:
++ return A2OUSTR("dotted");
++ break;
++ case enumXFUnderlineDash:
++ return A2OUSTR("dash");
++ break;
++ case enumXFUnderlineLongDash:
++ return A2OUSTR("long-dash");
++ break;
++ case enumXFUnderlineDotDash:
++ return A2OUSTR("dot-dash");
++ break;
++ case enumXFUnderlineDotDotDash:
++ return A2OUSTR("dot-dot-dash");
++ break;
++ case enumXFUnderlineWave:
++ return A2OUSTR("wave");
++ break;
++ case enumXFUnderlineBold:
++ return A2OUSTR("bold");
++ break;
++ case enumXFUnderlineBoldDotted:
++ return A2OUSTR("bold-dotted");
++ break;
++ case enumXFUnderlineBoldDash:
++ return A2OUSTR("bold-dash");
++ break;
++ case enumXFUnderlineBoldLongDash:
++ return A2OUSTR("bold-long-dash");
++ break;
++ case enumXFUnderlineBoldDotDash:
++ return A2OUSTR("bold-dot-dash");
++ break;
++ case enumXFUnderlineBoldDotDotDash:
++ return A2OUSTR("bold-dot-dot-dash");
++ break;
++ case enumXFUnderlineBoldWave:
++ return A2OUSTR("bold-wave");
++ break;
++ case enumXFUnderlineDoubleWave:
++ return A2OUSTR("double-wave");
++ break;
++ case enumXFUnderlineSmallWave:
++ return A2OUSTR("samll-wave");
++ break;
++ }
++ return A2OUSTR("");
++}
++
++rtl::OUString GetReliefName(enumXFRelief type)
++{
++ switch(type)
++ {
++ case enumXFReliefEngraved:
++ return A2OUSTR("engraved");
++ break;
++ case enumXFReliefEmbossed:
++ return A2OUSTR("embossed");
++ break;
++ }
++ return A2OUSTR("");
++}
++
++rtl::OUString GetCrossoutName(enumXFCrossout type)
++{
++ switch(type)
++ {
++ case enumXFCrossoutSignel:
++ return A2OUSTR("single-line");
++ break;
++ case enumXFCrossoutDouble:
++ return A2OUSTR("double-line");
++ break;
++ case enumXFCrossoutThick:
++ return A2OUSTR("thick-line");
++ break;
++ case enumXFCrossoutSlash:
++ return A2OUSTR("slash");
++ break;
++ case enumXFCrossoutX:
++ return A2OUSTR("X");
++ break;
++ }
++
++}
++
++rtl::OUString GetTransformName(enumXFTransform type)
++{
++ switch(type) {
++ case enumXFTransformUpper:
++ return A2OUSTR("uppercase");
++ break;
++ case enumXFTransformLower:
++ return A2OUSTR("lowercase");
++ break;
++ case enumXFTransformCapitalize:
++ return A2OUSTR("capitalize");
++ break;
++ case enumXFTransformSmallCaps:
++ return A2OUSTR("small-caps");
++ break;
++ }
++ return A2OUSTR("");
++}
++
++rtl::OUString GetEmphasizeName(enumXFEmphasize type)
++{
++ switch(type) {
++ case enumXFEmphasizeDot:
++ return A2OUSTR("dot");
++ break;
++ case enumXFEmphasizeCircle:
++ return A2OUSTR("circle");
++ break;
++ case enumXFEmphasizeDisc:
++ return A2OUSTR("disc");
++ break;
++ case enumXFEmphasizeAccent:
++ return A2OUSTR("accent");
++ break;
++ }
++ return A2OUSTR("");
++}
++
++rtl::OUString GetTextDirName(enumXFTextDir dir)
++{
++ switch(dir)
++ {
++ case enumXFTextDirLR:
++ return A2OUSTR("lr");
++ break;
++ case enumXFTextDirLR_TB:
++ return A2OUSTR("lr-tb");
++ break;
++ case enumXFTextDirPage:
++ return A2OUSTR("page");
++ break;
++ case enumXFTextDirRL:
++ return A2OUSTR("rl");
++ break;
++ case enumXFTextDirRL_TB:
++ return A2OUSTR("rl-tb");
++ break;
++ case enumXFTextDirTB:
++ return A2OUSTR("tb");
++ break;
++ case enumXFTextDirTB_LR:
++ return A2OUSTR("tb-lr");
++ break;
++ case enumXFTextDirTB_RL:
++ return A2OUSTR("tb-rl");
++ break;
++ }
++ return A2OUSTR("");
++}
++
++rtl::OUString GetFrameXPos(enumXFFrameXPos pos)
++{
++ switch(pos)
++ {
++ case enumXFFrameXPosLeft:
++ return A2OUSTR("left");
++ break;
++ case enumXFFrameXPosRight:
++ return A2OUSTR("right");
++ break;
++ case enumXFFrameXPosCenter:
++ return A2OUSTR("center");
++ break;
++ case enumXFFrameXPosFromLeft:
++ return A2OUSTR("from-left");
++ break;
++ }
++ return A2OUSTR("");
++}
++
++rtl::OUString GetFrameXRel(enumXFFrameXRel rel)
++{
++ switch(rel)
++ {
++ case enumXFFrameXRelPage:
++ return A2OUSTR("page");
++ break;
++ case enumXFFrameXRelPageContent:
++ return A2OUSTR("page-content");
++ break;
++ case enumXFFrameXRelPageEndMargin:
++ return A2OUSTR("page-end-margin");
++ break;
++ case enumXFFrameXRelPageStartMargin:
++ return A2OUSTR("page-start-margin");
++ break;
++ case enumXFFrameXRelPara:
++ return A2OUSTR("paragraph");
++ break;
++ case enumXFFrameXRelParaContent:
++ return A2OUSTR("paragraph-content");
++ break;
++ case enumXFFrameXRelParaEndMargin:
++ return A2OUSTR("paragraph-end-margin");
++ break;
++ case enumXFFrameXRelParaStartMargin:
++ return A2OUSTR("paragraph-start-margin");
++ break;
++ case enumXFFrameXRelChar:
++ return A2OUSTR("char");
++ break;
++ case enumXFFrameXRelFrame:
++ return A2OUSTR("frame");
++ break;
++ case enumXFFrameXRelFrameContent:
++ return A2OUSTR("frame-content");
++ break;
++ case enumXFFrameXRelFrameEndMargin:
++ return A2OUSTR("frame-end-margin");
++ break;
++ case enumXFFrameXRelFrameStartMargin:
++ return A2OUSTR("frame-start-margin");
++ break;
++ }
++}
++
++rtl::OUString GetFrameYPos(enumXFFrameYPos pos)
++{
++ switch(pos)
++ {
++ case enumXFFrameYPosTop:
++ return A2OUSTR("top");
++ case enumXFFrameYPosMiddle:
++ return A2OUSTR("middle");
++ case enumXFFrameYPosBottom:
++ return A2OUSTR("bottom");
++ case enumXFFrameYPosFromTop:
++ return A2OUSTR("from-top");
++ case enumXFFrameYPosBelow:
++ return A2OUSTR("below");
++ }
++ return A2OUSTR("");
++}
++
++rtl::OUString GetFrameYRel(enumXFFrameYRel rel)
++{
++ switch(rel)
++ {
++ case enumXFFrameYRelBaseLine:
++ return A2OUSTR("baseline");
++ case enumXFFrameYRelChar:
++ return A2OUSTR("char");
++ case enumXFFrameYRelFrame:
++ return A2OUSTR("frame");
++ case enumXFFrameYRelFrameContent:
++ return A2OUSTR("frame-content");
++ case enumXFFrameYRelLine:
++ return A2OUSTR("line");
++ case enumXFFrameYRelPage:
++ return A2OUSTR("page");
++ case enumXFFrameYRelPageContent:
++ return A2OUSTR("page-content");
++ case enumXFFrameYRelPara:
++ return A2OUSTR("paragraph");
++ case enumXFFrameYRelParaContent:
++ return A2OUSTR("paragraph-content");
++ case enumXFFrameYRelText:
++ return A2OUSTR("text");
++ }
++ return A2OUSTR("");
++}
++
++rtl::OUString GetAlignName(enumXFAlignType align)
++{
++ if( align == enumXFAlignStart )
++ return A2OUSTR("start");
++ else if( align == enumXFAlignCenter )
++ return A2OUSTR("center");
++ else if( align == enumXFAlignEnd )
++ return A2OUSTR("end");
++ else if( align == enumXFAlignJustify )
++ return A2OUSTR("justify");
++ else if( align == enumXFAlignBottom )
++ return A2OUSTR("bottom");
++ else if( align == enumXFAlignTop )
++ return A2OUSTR("top");
++ else if( align == enumXFAlignMiddle )
++ return A2OUSTR("middle");
++ else if( align == enumXFALignMargins )
++ return A2OUSTR("margins");
++
++ return A2OUSTR("");
++}
++
++rtl::OUString GetDrawKind(enumXFDrawKind kind)
++{
++ if( kind == enumXFDrawKindFull )
++ return A2OUSTR("full");
++ else if( kind == enumXFDrawKindSection )
++ return A2OUSTR("section");
++ else if( kind == enumXFDrawKindCut )
++ return A2OUSTR("cut");
++ else //( kind == enumXFDrawKindArc )
++ return A2OUSTR("arc");
++}
++
++rtl::OUString GetPageUsageName(enumXFPageUsage usage)
++{
++ switch(usage)
++ {
++ case enumXFPageUsageAll:
++ return A2OUSTR("all");
++ case enumXFPageUsageLeft:
++ return A2OUSTR("left");
++ case enumXFPageUsageRight:
++ return A2OUSTR("right");
++ case enumXFPageUsageMirror:
++ return A2OUSTR("mirrored");
++ }
++ return A2OUSTR("");
++}
++
++rtl::OUString GetValueType(enumXFValueType type)
++{
++ switch(type)
++ {
++ case enumXFValueTypeBoolean:
++ return A2OUSTR("boolean");
++ case enumXFValueTypeCurrency:
++ return A2OUSTR("currency");
++ case enumXFValueTypeDate:
++ return A2OUSTR("date");
++ case enumXFValueTypeFloat:
++ return A2OUSTR("float");
++ case enumXFValueTypePercentage:
++ return A2OUSTR("percentage");
++ case enumXFValueTypeString:
++ return A2OUSTR("string");
++ case enumXFValueTypeTime:
++ return A2OUSTR("time");
++ }
++ return A2OUSTR("");
++}
++
++rtl::OUString GetColorMode(enumXFColorMode mode)
++{
++ switch(mode)
++ {
++ case enumXFColorStandard:
++ return A2OUSTR("standard");
++ case enumXFColorGreyscale:
++ return A2OUSTR("greyscale");
++ case enumXFColorWatermark:
++ return A2OUSTR("watermark");
++ case enumXFColorMono:
++ return A2OUSTR("mono");
++ }
++ return A2OUSTR("");
++}
+diff -urNp lotuswordpro.bak/source/filter/xfilter/xfutil.hxx lotuswordpro/source/filter/xfilter/xfutil.hxx
+--- lotuswordpro.bak/source/filter/xfilter/xfutil.hxx 1970-01-01 08:00:00.000000000 +0800
++++ lotuswordpro/source/filter/xfilter/xfutil.hxx 2008-10-22 11:42:34.000000000 +0800
+@@ -0,0 +1,122 @@
++/*************************************************************************
++ *
++ * The Contents of this file are made available subject to the terms of
++ * either of the following licenses
++ *
++ * - GNU Lesser General Public License Version 2.1
++ * - Sun Industry Standards Source License Version 1.1
++ *
++ * Sun Microsystems Inc., October, 2000
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2000 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * 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
++ *
++ *
++ * Sun Industry Standards Source License Version 1.1
++ * =================================================
++ * The contents of this file are subject to the Sun Industry Standards
++ * Source License Version 1.1 (the "License"); You may not use this file
++ * except in compliance with the License. You may obtain a copy of the
++ * License at http://www.openoffice.org/license.html.
++ *
++ * Software provided under this License is provided on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ * See the License for the specific provisions governing your rights and
++ * obligations concerning the Software.
++ *
++ * The Initial Developer of the Original Code is: IBM Corporation
++ *
++ * Copyright: 2008 by IBM Corporation
++ *
++ * All Rights Reserved.
++ *
++ * Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++/*************************************************************************
++ * @file
++ * Tool funtions for xml filter.
++ * Don't use any template for the ***TOOUString function list for easy.
++ ************************************************************************/
++/*************************************************************************
++ * Change History
++ * 2004-12-23 create this file.
++ ************************************************************************/
++#ifndef _XFUTIL_HXX
++#define _XFUTIL_HXX
++
++#include "xfdefs.hxx"
++#include <rtl/ustring.hxx>
++#include <rtl/memory.h>
++#include <string>
++
++
++#define A2OUSTR(str) rtl::OUString::createFromAscii(str)
++
++rtl::OUString Int32ToOUString(sal_Int32 num);
++
++rtl::OUString Int16ToOUString(sal_Int16 num);
++
++rtl::OUString FloatToOUString(float num, sal_Int32 precision=6);
++
++rtl::OUString DoubleToOUString(double num, sal_Int32 precision=6);
++
++rtl::OUString OEMToOUString(const std::string& str);
++
++rtl::OUString ColorToOUString( sal_uInt32 color);
++
++rtl::OUString DateTimeToOUString(XFDateTime& dt);
++
++rtl::OUString GetTableColName(sal_Int32 col);
++
++rtl::OUString GetUnderlineName(enumXFUnderline type);
++
++rtl::OUString GetReliefName(enumXFRelief type);
++
++rtl::OUString GetCrossoutName(enumXFCrossout type);
++
++rtl::OUString GetTransformName(enumXFTransform type);
++
++rtl::OUString GetEmphasizeName(enumXFEmphasize type);
++
++rtl::OUString GetTextDirName(enumXFTextDir dir);
++
++rtl::OUString GetFrameXPos(enumXFFrameXPos pos);
++
++rtl::OUString GetFrameXRel(enumXFFrameXRel rel);
++
++rtl::OUString GetFrameYPos(enumXFFrameYPos pos);
++
++rtl::OUString GetFrameYRel(enumXFFrameYRel rel);
++
++rtl::OUString GetAlignName(enumXFAlignType align);
++
++rtl::OUString GetDrawKind(enumXFDrawKind kind);
++
++rtl::OUString GetPageUsageName(enumXFPageUsage usage);
++
++rtl::OUString GetValueType(enumXFValueType type);
++
++rtl::OUString GetColorMode(enumXFColorMode mode);
++
++#endif
++
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]