diff options
Diffstat (limited to 'writerfilter')
41 files changed, 7671 insertions, 2583 deletions
diff --git a/writerfilter/Library_writerfilter.mk b/writerfilter/Library_writerfilter.mk index 1de3e786fd0e..6e3f6d8e18d0 100644 --- a/writerfilter/Library_writerfilter.mk +++ b/writerfilter/Library_writerfilter.mk @@ -37,7 +37,7 @@ $(eval $(call gb_Library_set_componentfile,writerfilter,writerfilter/util/writer $(eval $(call gb_Library_set_include,writerfilter,\ $$(INCLUDE) \ - -I$(OUTDIR)/inc/offuh \ +)) -I$(realpath $(SRCDIR)/writerfilter/inc) \ -I$(WORKDIR)/CustomTarget/writerfilter/source \ -I$(WORKDIR)/CustomTarget/writerfilter/source/ooxml \ @@ -47,6 +47,11 @@ $(eval $(call gb_Library_set_include,writerfilter,\ -I$(realpath $(SRCDIR)/writerfilter/source/dmapper) \ )) +$(eval $(call gb_Library_add_api,writerfilter,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_set_componentfile,writerfilter,writerfilter/util/writerfilter)) $(eval $(call gb_Library_add_defs,writerfilter,\ @@ -62,8 +67,10 @@ $(eval $(call gb_Library_add_linked_libs,writerfilter,\ i18nisolang1 \ i18npaper \ oox \ + rtftok \ sal \ sot \ + svt \ tl \ utl \ $(gb_STDLIBS) \ diff --git a/writerfilter/Module_writerfilter.mk b/writerfilter/Module_writerfilter.mk index d51031d8b881..01f149b8cac8 100644 --- a/writerfilter/Module_writerfilter.mk +++ b/writerfilter/Module_writerfilter.mk @@ -28,6 +28,7 @@ $(eval $(call gb_Module_Module,writerfilter)) $(eval $(call gb_Module_add_targets,writerfilter,\ + Library_rtftok \ Library_writerfilter \ Package_inc \ Package_writerfilter_generated \ @@ -37,7 +38,4 @@ $(eval $(call gb_Module_add_targets,writerfilter,\ # Library_resourcemodel \ # Library_writerfilter_uno \ - # not used - # Library_rtftok - # vim: set noet ts=4 sw=4: diff --git a/writerfilter/inc/WriterFilterDllApi.hxx b/writerfilter/inc/WriterFilterDllApi.hxx index dff806017c8a..358e5cd624bc 100644 --- a/writerfilter/inc/WriterFilterDllApi.hxx +++ b/writerfilter/inc/WriterFilterDllApi.hxx @@ -35,6 +35,12 @@ #else #define WRITERFILTER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT #endif +#if defined(WRITERFILTER_RTFTOK_DLLIMPLEMENTATION) +#define WRITERFILTER_RTFTOK_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define WRITERFILTER_RTFTOK_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif + #define WRITERFILTER_DLLPRIVATE SAL_DLLPRIVATE #endif /* INCLUDED_WRITERFILTERDLLAPI_H */ diff --git a/writerfilter/inc/dmapper/DomainMapper.hxx b/writerfilter/inc/dmapper/DomainMapper.hxx index d9d40aa32ad9..71190a158e1e 100644 --- a/writerfilter/inc/dmapper/DomainMapper.hxx +++ b/writerfilter/inc/dmapper/DomainMapper.hxx @@ -106,6 +106,7 @@ public: void PopListProperties(); bool IsOOXMLImport() const; + bool IsRTFImport() const; ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > GetTextFactory() const; void AddListIDToLFOTable( sal_Int32 nAbstractNumId ); ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > GetCurrentTextRange(); diff --git a/writerfilter/inc/rtftok/RTFDocument.hxx b/writerfilter/inc/rtftok/RTFDocument.hxx new file mode 100644 index 000000000000..72fe6bd2d952 --- /dev/null +++ b/writerfilter/inc/rtftok/RTFDocument.hxx @@ -0,0 +1,72 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef _RTFDOCUMENT_HXX_ +#define _RTFDOCUMENT_HXX_ + +#include <resourcemodel/WW8ResourceModel.hxx> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/frame/XFrame.hpp> + +namespace writerfilter { + namespace rtftok { + /// The RTFDocument opens and resolves the RTF document. + class WRITERFILTER_RTFTOK_DLLPUBLIC RTFDocument + : public writerfilter::Reference<Stream> + { + public: + /// Pointer to this stream. + typedef ::boost::shared_ptr<RTFDocument> Pointer_t; + + virtual ~RTFDocument() { } + + /// Resolves this document to a stream handler. + virtual void resolve(Stream & rHandler) = 0; + + /// Returns string representation of the type of this reference. (Debugging purpose only.) + virtual ::std::string getType() const = 0; + }; + + /// Interface to create an RTFDocument instance. + class WRITERFILTER_RTFTOK_DLLPUBLIC RTFDocumentFactory + { + public: + static RTFDocument::Pointer_t + createDocument( + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext, + ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > const & xInputStream, + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > const & xDstDoc, + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > const & xFrame); + }; + } // namespace rtftok +} // namespace writerfilter + +#endif // _RTFDOCUMENT_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/inc/rtftok/RTFInputSource.hxx b/writerfilter/inc/rtftok/RTFInputSource.hxx deleted file mode 100644 index 5a0ca071ab1a..000000000000 --- a/writerfilter/inc/rtftok/RTFInputSource.hxx +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef INCLUDED_RTFINPUTSOURCE_HXX -#define INCLUDED_RTFINPUTSOURCE_HXX - -namespace writerfilter { namespace rtftok { - -class RTFInputSource -{ -public: - virtual int read(void *buffer, int maxLen) = 0; -}; - -} } /* end namespace writerfilter::rtftok */ - - -#endif /* INCLUDED_RTFINPUTSOURCE_HXX */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/inc/rtftok/RTFParseException.hxx b/writerfilter/inc/rtftok/RTFParseException.hxx deleted file mode 100644 index 338711e57cb7..000000000000 --- a/writerfilter/inc/rtftok/RTFParseException.hxx +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef INCLUDED_RTFPARSEEXCEPTION_HXX -#define INCLUDED_RTFPARSEEXCEPTION_HXX - -namespace writerfilter { namespace rtftok { - -class RTFParseException -{ -public: - RTFParseException(char *message); -}; - -} } /* end namespace writerfilter::rtftok */ - - -#endif /* INCLUDED_RTFPARSEEXCEPTION_HXX */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/inc/rtftok/RTFScanner.hxx b/writerfilter/inc/rtftok/RTFScanner.hxx deleted file mode 100644 index 9f1e2c655402..000000000000 --- a/writerfilter/inc/rtftok/RTFScanner.hxx +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef INCLUDED_RTFSCANNER_HXX -#define INCLUDED_RTFSCANNER_HXX - -#include <WriterFilterDllApi.hxx> -#include <vector> -#include <rtftok/RTFInputSource.hxx> -#include <rtftok/RTFScannerHandler.hxx> - -namespace writerfilter { namespace rtftok { - -class WRITERFILTER_DLLPUBLIC RTFScanner { -public: - RTFScanner(RTFScannerHandler &eventHandler_) : eventHandler(eventHandler_) {}; - virtual ~RTFScanner() { } - - const char* YYText() { return yytext; } - int YYLeng() { return yyleng; } - - virtual int yylex() = 0; - - int lineno() const { return yylineno; } - -protected: - char* yytext; - int yyleng; - int yylineno; // only maintained if you use %option yylineno - int yy_flex_debug; // only has effect with -d or "%option debug" - RTFScannerHandler &eventHandler; - - -public: - static writerfilter::rtftok::RTFScanner* createRTFScanner(writerfilter::rtftok::RTFInputSource& inputSource, writerfilter::rtftok::RTFScannerHandler &eventHandler); -}; - -} } /* end namespace writerfilter::rtftok */ - - -#endif /* INCLUDED_RTFSCANNER_HXX */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/inc/rtftok/RTFScannerHandler.hxx b/writerfilter/inc/rtftok/RTFScannerHandler.hxx deleted file mode 100644 index aa423439fa53..000000000000 --- a/writerfilter/inc/rtftok/RTFScannerHandler.hxx +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef INCLUDED_RTFSCANNERHANDLER_HXX -#define INCLUDED_RTFSCANNERHANDLER_HXX - -namespace writerfilter { namespace rtftok { - -class RTFScannerHandler -{ -public: - virtual void dest(char*token, char*value)=0; - virtual void ctrl(char*token, char*value)=0; - virtual void lbrace(void)=0; - virtual void rbrace(void)=0; - virtual void addSpaces(int count)=0; - virtual void addBinData(unsigned char data)=0; - virtual void addChar(char ch) =0; - virtual void addCharU(sal_Unicode ch) =0; - virtual void addHexChar(char* hexch) =0; - -}; - -} } /* end namespace writerfilter::rtftok */ - -#endif /* INCLUDED_RTFSCANNERHANDLER_HXX */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 4e3624405b9a..231b1aba3953 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1634,7 +1634,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType case NS_sprm::LN_PBrcBetween: // sprmPBrcBetween { //in binary format the borders are directly provided in OOXML they are inside of properties - if( IsOOXMLImport() ) + if( IsOOXMLImport() || IsRTFImport() ) { writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get()) @@ -1968,7 +1968,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType break; case NS_sprm::LN_CFDStrike : /*sprmCFDStrike double strike through*/ rContext->Insert(ePropertyId, true, - uno::makeAny( awt::FontStrikeout::DOUBLE ) ); + uno::makeAny( nIntValue ? awt::FontStrikeout::DOUBLE : awt::FontStrikeout::NONE ) ); break; case NS_sprm::LN_CFOutline: /*sprmCFOutline*/ case NS_sprm::LN_CFShadow: /*sprmCFShadow*/ @@ -2085,7 +2085,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType rContext->Insert(PROP_CHAR_CHAR_KERNING, true, uno::makeAny( sal_Int16(ConversionHelper::convertTwipToMM100(sal_Int16(nIntValue))) ) ); break; case NS_sprm::LN_CHpsKern: // sprmCHpsKern auto kerning is bound to a minimum font size in Word - but not in Writer :-( - rContext->Insert(PROP_CHAR_AUTO_KERNING, true, uno::makeAny( true ) ); + rContext->Insert(PROP_CHAR_AUTO_KERNING, true, uno::makeAny( sal_Bool(nIntValue) ) ); break; case NS_sprm::LN_CMajority50: break; // sprmCMajority50 @@ -2684,9 +2684,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType break; case 0x6877: //underlining color { - sal_Int32 nColor = ConversionHelper::ConvertColor(nIntValue); rContext->Insert(PROP_CHAR_UNDERLINE_HAS_COLOR, true, uno::makeAny( true ) ); - rContext->Insert(PROP_CHAR_UNDERLINE_COLOR, true, uno::makeAny( nColor ) ); + rContext->Insert(PROP_CHAR_UNDERLINE_COLOR, true, uno::makeAny( nIntValue ) ); } break; case 0x6815: @@ -3677,6 +3676,11 @@ bool DomainMapper::IsOOXMLImport() const return m_pImpl->IsOOXMLImport(); } +bool DomainMapper::IsRTFImport() const +{ + return m_pImpl->IsRTFImport(); +} + uno::Reference < lang::XMultiServiceFactory > DomainMapper::GetTextFactory() const { return m_pImpl->GetTextFactory(); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index bdaf3eb2d1fc..3b698970ed98 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -937,13 +937,7 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap ) uno::Reference< text::XTextRange > xParaEnd( xCur, uno::UNO_QUERY ); CheckParaRedline( xParaEnd ); - // Remove the last empty section paragraph if needed - if ( m_bIsLastParaInSection && !m_bParaChanged ) - { - RemoveLastParagraph( ); - m_bIsLastParaInSection = false; - } - + m_bIsLastParaInSection = false; m_bParaChanged = false; } if( !bKeepLastParagraphProperties ) diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 60ccc230b43d..d4147b1cb782 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -545,7 +545,7 @@ public: void appendTableManager( ) { boost::shared_ptr< DomainMapperTableManager > pMngr( - new DomainMapperTableManager( m_eDocumentType == DOCUMENT_OOXML ) ); + new DomainMapperTableManager( m_eDocumentType == DOCUMENT_OOXML || m_eDocumentType == DOCUMENT_RTF ) ); m_aTableManagers.push( pMngr ); } @@ -562,6 +562,8 @@ public: bool IsOOXMLImport() const { return m_eDocumentType == DOCUMENT_OOXML; } + bool IsRTFImport() const { return m_eDocumentType == DOCUMENT_RTF; } + void InitPageMargins() { m_aPageMargins = _PageMar(); } void SetPageMarginTwip( PageMarElement eElement, sal_Int32 nValue ); const _PageMar& GetPageMargins() const {return m_aPageMargins;} diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index fb2cd53f0190..049f5b941af9 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -916,7 +916,7 @@ void ListsManager::lcl_sprm( Sprm& rSprm ) void ListsManager::lcl_entry( int /* pos */, writerfilter::Reference<Properties>::Pointer_t ref ) { - if( m_rDMapper.IsOOXMLImport() ) + if( m_rDMapper.IsOOXMLImport() || m_rDMapper.IsRTFImport() ) { ref->resolve(*this); } diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 9ae05891e072..18b0ef39c981 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -837,130 +837,130 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) if( m_nColumnCount > 0 && xSection.is()) ApplyColumnProperties( xSection ); } - else + //get the properties and create appropriate page styles + uno::Reference< beans::XPropertySet > xFollowPageStyle = GetPageStyle( rDM_Impl.GetPageStyles(), rDM_Impl.GetTextFactory(), false ); + + if( m_nDzaGutter > 0 ) { - //get the properties and create appropriate page styles - uno::Reference< beans::XPropertySet > xFollowPageStyle = GetPageStyle( rDM_Impl.GetPageStyles(), rDM_Impl.GetTextFactory(), false ); + //todo: iGutterPos from DocProperties are missing + if( m_bGutterRTL ) + m_nRightMargin += m_nDzaGutter; + else + m_nLeftMargin += m_nDzaGutter; + } + operator[]( PropertyDefinition( PROP_LEFT_MARGIN, false )) = uno::makeAny( m_nLeftMargin ); + operator[]( PropertyDefinition( PROP_RIGHT_MARGIN, false )) = uno::makeAny( m_nRightMargin ); + + /*** if headers/footers are available then the top/bottom margins of the + header/footer are copied to the top/bottom margin of the page + */ + CopyLastHeaderFooter( false, rDM_Impl ); + PrepareHeaderFooterProperties( false ); + + const ::rtl::OUString sTrayIndex = rPropNameSupplier.GetName( PROP_PRINTER_PAPER_TRAY_INDEX ); + if( m_nPaperBin >= 0 ) + xFollowPageStyle->setPropertyValue( sTrayIndex, uno::makeAny( m_nPaperBin ) ); + uno::Reference< text::XTextColumns > xColumns; + if( m_nColumnCount > 0 ) + xColumns = ApplyColumnProperties( xFollowPageStyle ); - if( m_nDzaGutter > 0 ) - { - //todo: iGutterPos from DocProperties are missing - if( m_bGutterRTL ) - m_nRightMargin += m_nDzaGutter; - else - m_nLeftMargin += m_nDzaGutter; - } - operator[]( PropertyDefinition( PROP_LEFT_MARGIN, false )) = uno::makeAny( m_nLeftMargin ); - operator[]( PropertyDefinition( PROP_RIGHT_MARGIN, false )) = uno::makeAny( m_nRightMargin ); - - /*** if headers/footers are available then the top/bottom margins of the - header/footer are copied to the top/bottom margin of the page - */ - CopyLastHeaderFooter( false, rDM_Impl ); - PrepareHeaderFooterProperties( false ); - - const ::rtl::OUString sTrayIndex = rPropNameSupplier.GetName( PROP_PRINTER_PAPER_TRAY_INDEX ); - if( m_nPaperBin >= 0 ) - xFollowPageStyle->setPropertyValue( sTrayIndex, uno::makeAny( m_nPaperBin ) ); - uno::Reference< text::XTextColumns > xColumns; - if( m_nColumnCount > 0 ) - xColumns = ApplyColumnProperties( xFollowPageStyle ); - - //prepare text grid properties - sal_Int32 nHeight = 1; - PropertyMap::iterator aElement = find(PropertyDefinition( PROP_HEIGHT, false )); - if( aElement != end()) - aElement->second >>= nHeight; - - sal_Int32 nWidth = 1; - aElement = find(PropertyDefinition( PROP_WIDTH, false )); - if( aElement != end()) - aElement->second >>= nWidth; - - text::WritingMode eWritingMode = text::WritingMode_LR_TB; - aElement = find(PropertyDefinition( PROP_WRITING_MODE, false )); - if( aElement != end()) - aElement->second >>= eWritingMode; - - - - sal_Int32 nTextAreaHeight = eWritingMode == text::WritingMode_LR_TB ? - nHeight - m_nTopMargin - m_nBottomMargin : - nWidth - m_nLeftMargin - m_nRightMargin; - - operator[]( PropertyDefinition( PROP_GRID_LINES, false )) = - uno::makeAny( static_cast<sal_Int16>(nTextAreaHeight/m_nGridLinePitch)); - - sal_Int32 nCharWidth = 423; //240 twip/ 12 pt - //todo: is '0' the right index here? - const StyleSheetEntryPtr pEntry = rDM_Impl.GetStyleSheetTable()->FindStyleSheetByISTD(::rtl::OUString::valueOf(static_cast<sal_Int32>(0), 16)); - if( pEntry.get( ) ) - { - PropertyMap::iterator aElement_ = pEntry->pProperties->find(PropertyDefinition( PROP_CHAR_HEIGHT_ASIAN, false )); - if( aElement_ != pEntry->pProperties->end()) - { - double fHeight = 0; - if( aElement_->second >>= fHeight ) - nCharWidth = ConversionHelper::convertTwipToMM100( (long)( fHeight * 20.0 + 0.5 )); - } - } + //prepare text grid properties + sal_Int32 nHeight = 1; + PropertyMap::iterator aElement = find(PropertyDefinition( PROP_HEIGHT, false )); + if( aElement != end()) + aElement->second >>= nHeight; - //dxtCharSpace - if(m_nDxtCharSpace) - { - sal_Int32 nCharSpace = m_nDxtCharSpace; - //main lives in top 20 bits, and is signed. - sal_Int32 nMain = (nCharSpace & 0xFFFFF000); - nMain /= 0x1000; - nCharWidth += ConversionHelper::convertTwipToMM100( nMain * 20 ); - - sal_Int32 nFraction = (nCharSpace & 0x00000FFF); - nFraction = (nFraction * 20)/0xFFF; - nCharWidth += ConversionHelper::convertTwipToMM100( nFraction ); - } - operator[]( PropertyDefinition( PROP_GRID_BASE_HEIGHT, false )) = uno::makeAny( nCharWidth ); - sal_Int32 nRubyHeight = m_nGridLinePitch - nCharWidth; - if(nRubyHeight < 0 ) - nRubyHeight = 0; - operator[]( PropertyDefinition( PROP_GRID_RUBY_HEIGHT, false )) = uno::makeAny( nRubyHeight ); + sal_Int32 nWidth = 1; + aElement = find(PropertyDefinition( PROP_WIDTH, false )); + if( aElement != end()) + aElement->second >>= nWidth; + + text::WritingMode eWritingMode = text::WritingMode_LR_TB; + aElement = find(PropertyDefinition( PROP_WRITING_MODE, false )); + if( aElement != end()) + aElement->second >>= eWritingMode; - sal_Int16 nGridMode = text::TextGridMode::NONE; - switch (m_nGridType) - { - case NS_ooxml::LN_Value_wordprocessingml_ST_DocGrid_lines: - nGridMode = text::TextGridMode::LINES; - break; - case NS_ooxml::LN_Value_wordprocessingml_ST_DocGrid_linesAndChars: - nGridMode = text::TextGridMode::LINES_AND_CHARS; - break; - default: - break; - } - operator[](PropertyDefinition(PROP_GRID_MODE, false)) = uno::makeAny(nGridMode); + sal_Int32 nTextAreaHeight = eWritingMode == text::WritingMode_LR_TB ? + nHeight - m_nTopMargin - m_nBottomMargin : + nWidth - m_nLeftMargin - m_nRightMargin; - _ApplyProperties( xFollowPageStyle ); + operator[]( PropertyDefinition( PROP_GRID_LINES, false )) = + uno::makeAny( static_cast<sal_Int16>(nTextAreaHeight/m_nGridLinePitch)); - //todo: creating a "First Page" style depends on HasTitlePage und _fFacingPage_ - if( m_bTitlePage ) + sal_Int32 nCharWidth = 423; //240 twip/ 12 pt + //todo: is '0' the right index here? + const StyleSheetEntryPtr pEntry = rDM_Impl.GetStyleSheetTable()->FindStyleSheetByISTD(::rtl::OUString::valueOf(static_cast<sal_Int32>(0), 16)); + if( pEntry.get( ) ) + { + PropertyMap::iterator aElement_ = pEntry->pProperties->find(PropertyDefinition( PROP_CHAR_HEIGHT_ASIAN, false )); + if( aElement_ != pEntry->pProperties->end()) { - CopyLastHeaderFooter( true, rDM_Impl ); - PrepareHeaderFooterProperties( true ); - uno::Reference< beans::XPropertySet > xFirstPageStyle = GetPageStyle( - rDM_Impl.GetPageStyles(), rDM_Impl.GetTextFactory(), true ); - _ApplyProperties( xFirstPageStyle ); - - sal_Int32 nPaperBin = m_nFirstPaperBin >= 0 ? m_nFirstPaperBin : m_nPaperBin >= 0 ? m_nPaperBin : 0; - if( nPaperBin ) - xFollowPageStyle->setPropertyValue( sTrayIndex, uno::makeAny( nPaperBin ) ); - if( xColumns.is() ) - xFollowPageStyle->setPropertyValue( - rPropNameSupplier.GetName( PROP_TEXT_COLUMNS ), uno::makeAny( xColumns )); + double fHeight = 0; + if( aElement_->second >>= fHeight ) + nCharWidth = ConversionHelper::convertTwipToMM100( (long)( fHeight * 20.0 + 0.5 )); } + } + + //dxtCharSpace + if(m_nDxtCharSpace) + { + sal_Int32 nCharSpace = m_nDxtCharSpace; + //main lives in top 20 bits, and is signed. + sal_Int32 nMain = (nCharSpace & 0xFFFFF000); + nMain /= 0x1000; + nCharWidth += ConversionHelper::convertTwipToMM100( nMain * 20 ); + + sal_Int32 nFraction = (nCharSpace & 0x00000FFF); + nFraction = (nFraction * 20)/0xFFF; + nCharWidth += ConversionHelper::convertTwipToMM100( nFraction ); + } + operator[]( PropertyDefinition( PROP_GRID_BASE_HEIGHT, false )) = uno::makeAny( nCharWidth ); + sal_Int32 nRubyHeight = m_nGridLinePitch - nCharWidth; + if(nRubyHeight < 0 ) + nRubyHeight = 0; + operator[]( PropertyDefinition( PROP_GRID_RUBY_HEIGHT, false )) = uno::makeAny( nRubyHeight ); + + sal_Int16 nGridMode = text::TextGridMode::NONE; + + switch (m_nGridType) + { + case NS_ooxml::LN_Value_wordprocessingml_ST_DocGrid_lines: + nGridMode = text::TextGridMode::LINES; + break; + case NS_ooxml::LN_Value_wordprocessingml_ST_DocGrid_linesAndChars: + nGridMode = text::TextGridMode::LINES_AND_CHARS; + break; + default: + break; + } + + operator[](PropertyDefinition(PROP_GRID_MODE, false)) = uno::makeAny(nGridMode); + + _ApplyProperties( xFollowPageStyle ); - ApplyBorderToPageStyles( rDM_Impl.GetPageStyles( ), rDM_Impl.GetTextFactory( ), m_nBorderParams ); + //todo: creating a "First Page" style depends on HasTitlePage und _fFacingPage_ + if( m_bTitlePage ) + { + CopyLastHeaderFooter( true, rDM_Impl ); + PrepareHeaderFooterProperties( true ); + uno::Reference< beans::XPropertySet > xFirstPageStyle = GetPageStyle( + rDM_Impl.GetPageStyles(), rDM_Impl.GetTextFactory(), true ); + _ApplyProperties( xFirstPageStyle ); + + sal_Int32 nPaperBin = m_nFirstPaperBin >= 0 ? m_nFirstPaperBin : m_nPaperBin >= 0 ? m_nPaperBin : 0; + if( nPaperBin ) + xFollowPageStyle->setPropertyValue( sTrayIndex, uno::makeAny( nPaperBin ) ); + if( xColumns.is() ) + xFollowPageStyle->setPropertyValue( + rPropNameSupplier.GetName( PROP_TEXT_COLUMNS ), uno::makeAny( xColumns )); + } + + ApplyBorderToPageStyles( rDM_Impl.GetPageStyles( ), rDM_Impl.GetTextFactory( ), m_nBorderParams ); + if ( m_nBreakType != 0 ) + { try { { @@ -992,7 +992,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) { OSL_FAIL( "Exception in SectionPropertyMap::CloseSectionGroup"); (void)rEx; - } + } } } diff --git a/writerfilter/source/doctok/DffImpl.cxx b/writerfilter/source/doctok/DffImpl.cxx index cc7b21f26123..25f9b72b11e5 100644 --- a/writerfilter/source/doctok/DffImpl.cxx +++ b/writerfilter/source/doctok/DffImpl.cxx @@ -285,11 +285,6 @@ DffOPT::get_property(sal_uInt32 nPos) return writerfilter::Reference<Properties>::Pointer_t(pTmp); } -sal_uInt32 DffOPT::get_extraoffset_count() -{ - return get_property_count(); -} - sal_uInt32 DffOPT::get_extraoffset(sal_uInt32 pos) { sal_uInt32 nResult; diff --git a/writerfilter/source/doctok/WW8DocumentImpl.cxx b/writerfilter/source/doctok/WW8DocumentImpl.cxx index f7b79a31882a..6c6e649d4439 100644 --- a/writerfilter/source/doctok/WW8DocumentImpl.cxx +++ b/writerfilter/source/doctok/WW8DocumentImpl.cxx @@ -116,11 +116,6 @@ WW8DocumentIteratorImpl::getSubDocument() const return mpDocument->getSubDocument(mCpAndFc); } -WW8SED * WW8DocumentIteratorImpl::getSED() const -{ - return mpDocument->getSED(mCpAndFc); -} - WW8Stream::Sequence WW8DocumentIteratorImpl::getText() { return mpDocument->getText(mCpAndFc); @@ -588,12 +583,6 @@ void WW8DocumentImpl::parseBinTableCpAndFcs(WW8BinTable & rTable, { for (sal_uInt32 i = 0; i < rTable.getEntryCount(); i++) { -#if 0 - char sBuffer[255]; - snprintf(sBuffer, 255, "%ld", i); - char sBufferPageNum[255]; - snprintf(sBufferPageNum, 255, "%ld", rTable.getPageNumber(i)); -#endif Fc aFcFromTable(rTable.getFc(i)); if (aFcFromTable < mpPieceTable->getFirstFc()) @@ -751,16 +740,6 @@ CpAndFc WW8DocumentImpl::getEndnoteEndCp() const return mEndnoteEndCpAndFc; } -CpAndFc WW8DocumentImpl::getTextboxEndCp() const -{ - return mTextboxEndCpAndFc; -} - -CpAndFc WW8DocumentImpl::getTextboxHeaderEndCp() const -{ - return mTextboxHeaderEndCpAndFc; -} - CpAndFc WW8DocumentImpl::getNextCp(const CpAndFc & rCpAndFc) const { CpAndFc aResult = mCpAndFcEnd; @@ -1129,16 +1108,6 @@ writerfilter::Reference<Stream>::Pointer_t WW8DocumentImpl::getHeader(sal_uInt32 CpAndFc aCpAndFcStart(getHeaderCpAndFc(nPos)); CpAndFc aCpAndFcEnd(getHeaderCpAndFc(nPos + 1)); -#if 0 - sal_uInt32 nEquals = 1; - while (aCpAndFcEnd == aCpAndFcStart && nPos + nEquals < getHeaderCount()) - { - ++nEquals; - - aCpAndFcEnd = getHeaderCpAndFc(nPos + nEquals); - } -#endif - if (aCpAndFcStart < aCpAndFcEnd) pResult = writerfilter::Reference<Stream>::Pointer_t (new WW8DocumentImpl(*this, aCpAndFcStart, aCpAndFcEnd)); @@ -1146,22 +1115,6 @@ writerfilter::Reference<Stream>::Pointer_t WW8DocumentImpl::getHeader(sal_uInt32 return pResult; } -sal_uInt32 WW8DocumentImpl::getFootnoteCount() const -{ - return (mpFootnoteHelper.get() != NULL) ? mpFootnoteHelper->getCount() : 0; -} - -writerfilter::Reference<Stream>::Pointer_t -WW8DocumentImpl::getFootnote(sal_uInt32 nPos) -{ - writerfilter::Reference<Stream>::Pointer_t pResult; - - if (! bSubDocument) - pResult = mpFootnoteHelper->get(nPos); - - return pResult; -} - writerfilter::Reference<Stream>::Pointer_t WW8DocumentImpl::getFootnote(const CpAndFc & rCpAndFc) { @@ -1173,22 +1126,6 @@ WW8DocumentImpl::getFootnote(const CpAndFc & rCpAndFc) return pResult; } -sal_uInt32 WW8DocumentImpl::getEndnoteCount() const -{ - return mpEndnoteHelper.get() != NULL ? mpEndnoteHelper->getCount() : 0; -} - -writerfilter::Reference<Stream>::Pointer_t -WW8DocumentImpl::getEndnote(sal_uInt32 nPos) -{ - writerfilter::Reference<Stream>::Pointer_t pResult; - - if (! bSubDocument) - pResult = mpEndnoteHelper->get(nPos); - - return pResult; -} - writerfilter::Reference<Stream>::Pointer_t WW8DocumentImpl::getEndnote(const CpAndFc & rCpAndFc) { @@ -1200,22 +1137,6 @@ WW8DocumentImpl::getEndnote(const CpAndFc & rCpAndFc) return pResult; } -sal_uInt32 WW8DocumentImpl::getAnnotationCount() const -{ - return mpAnnotationHelper.get() != NULL ? - mpAnnotationHelper->getCount() : 0; -} - -writerfilter::Reference<Stream>::Pointer_t -WW8DocumentImpl::getAnnotation(sal_uInt32 nPos) -{ - writerfilter::Reference<Stream>::Pointer_t pResult; - - if (! bSubDocument) - pResult = mpAnnotationHelper->get(nPos); - - return pResult; -} writerfilter::Reference<Stream>::Pointer_t WW8DocumentImpl::getAnnotation(const CpAndFc & rCpAndFc) @@ -1308,11 +1229,6 @@ WW8FLD::Pointer_t WW8DocumentImpl::getCurrentFLD() const return mpFLD; } -sal_uInt32 WW8DocumentImpl::getPicLocation() const -{ - return mfcPicLoc; -} - void WW8DocumentImpl::setPicLocation(sal_uInt32 fcPicLoc) { mfcPicLoc = fcPicLoc; @@ -1421,13 +1337,6 @@ CpAndFc WW8DocumentImpl::getCpAndFc(const Cp & cp, PropertyType type) const return CpAndFc(cp, aFc, type); } -CpAndFc WW8DocumentImpl::getCpAndFc(const Fc & fc, PropertyType type) const -{ - Cp aCp = fc2cp(fc); - - return CpAndFc(aCp, fc, type); -} - void WW8DocumentImpl::resolvePicture(Stream & rStream) { WW8Stream::Pointer_t pStream = getDataStream(); @@ -1672,24 +1581,11 @@ void WW8DocumentImpl::resolve(Stream & rStream) rStream.props(pFibRgFcLcb2000); } -#if 0 - if (mpTextBoxStories.get() != NULL) - { - output.addItem("<textbox.boxes>"); - mpTextBoxStories->dump(output); - output.addItem("</textbox.boxes>"); - } -#endif if (mpFib->get_lcbPlcftxbxBkd() > 0) { PLCF<WW8BKD> aPLCF(*mpTableStream, mpFib->get_fcPlcftxbxBkd(), mpFib->get_lcbPlcftxbxBkd()); -#if 0 - output.addItem("<textbox.breaks>"); - aPLCF.dump(output); - output.addItem("</textbox.breaks>"); -#endif } if (mpDffBlock.get() != NULL) @@ -1711,33 +1607,6 @@ void WW8DocumentImpl::resolve(Stream & rStream) rStream.info("/headers"); } -#if 0 - { - sal_uInt32 nFootnoteCount = getFootnoteCount(); - for (sal_uInt32 n = 0; n < nFootnoteCount; ++n) - { - //clog << "<footnote num=\"" << n << "\"/>" << endl; - - writerfilter::Reference<Stream>::Pointer_t pFootnote(getFootnote(n)); - - if (pFootnote.get() != NULL) - rStream.substream(NS_rtf::LN_footnote, pFootnote); - } - } - { - sal_uInt32 nEndnoteCount = getEndnoteCount(); - for (sal_uInt32 n = 0; n < nEndnoteCount; ++n) - { - //clog << "<endnote num=\"" << n << "\"/>" << endl; - - writerfilter::Reference<Stream>::Pointer_t pEndnote(getEndnote(n)); - - if (pEndnote.get() != NULL) - rStream.substream(NS_rtf::LN_endnote, pEndnote); - } - } -#endif - writerfilter::Reference<Table>::Pointer_t pSttbRgtplc = getListTplcs(); if (pSttbRgtplc.get() != NULL) diff --git a/writerfilter/source/doctok/WW8PropertySetImpl.cxx b/writerfilter/source/doctok/WW8PropertySetImpl.cxx index 53ff1c051675..196939f9c064 100644 --- a/writerfilter/source/doctok/WW8PropertySetImpl.cxx +++ b/writerfilter/source/doctok/WW8PropertySetImpl.cxx @@ -54,12 +54,6 @@ WW8PropertySetIterator::~WW8PropertySetIterator() { } -WW8PropertyImpl::WW8PropertyImpl(WW8Stream & rStream, - sal_uInt32 nOffset, sal_uInt32 nCount) -: WW8StructBase(rStream, nOffset, nCount) -{ -} - WW8PropertyImpl::WW8PropertyImpl(const WW8StructBase & rBase, sal_uInt32 nOffset, sal_uInt32 nCount) @@ -67,13 +61,6 @@ WW8PropertyImpl::WW8PropertyImpl(const WW8StructBase & rBase, { } -WW8PropertyImpl::WW8PropertyImpl(WW8StructBase * pBase, - sal_uInt32 nOffset, - sal_uInt32 nCount) -: WW8StructBase(pBase, nOffset, nCount) -{ -} - WW8PropertyImpl::~WW8PropertyImpl() { } @@ -164,28 +151,6 @@ sal_uInt32 WW8PropertyImpl::getByteLength() const return nParamSize + 2; } -sal_uInt32 WW8PropertyImpl::getParamOffset() const -{ - sal_uInt32 nReturn = 0; - - if (get_spra() == 6) - nReturn = 1; - - switch (getId()) - { - case 0xd608: - case 0xd609: - nReturn = 3; - - break; - - default: - break; - } - - return nReturn; -} - void WW8PropertyImpl::dump(OutputWithDepth<string> & o) const { o.addItem(toString()); diff --git a/writerfilter/source/doctok/WW8ResourceModelImpl.cxx b/writerfilter/source/doctok/WW8ResourceModelImpl.cxx index d23ca33d8f31..008b8624515b 100644 --- a/writerfilter/source/doctok/WW8ResourceModelImpl.cxx +++ b/writerfilter/source/doctok/WW8ResourceModelImpl.cxx @@ -201,12 +201,6 @@ string WW8PropertiesReference::getType() const } WW8BinaryObjReference::WW8BinaryObjReference -(WW8StructBase & rParent, sal_uInt32 nOffset, sal_uInt32 nCount) -: WW8StructBase(rParent, nOffset, nCount) -{ -} - -WW8BinaryObjReference::WW8BinaryObjReference (WW8StructBase * pParent, sal_uInt32 nOffset, sal_uInt32 nCount) : WW8StructBase(pParent, nOffset, nCount) { @@ -218,12 +212,6 @@ WW8BinaryObjReference::WW8BinaryObjReference { } -WW8BinaryObjReference::WW8BinaryObjReference -(WW8Stream & rStream, sal_uInt32 nOffset, sal_uInt32 nCount) -: WW8StructBase(rStream, nOffset, nCount) -{ -} - writerfilter::Reference<BinaryObj>::Pointer_t WW8BinaryObjReference::getBinary() { diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx index b018aed2cfda..3c326d98bf29 100644 --- a/writerfilter/source/filter/RtfFilter.cxx +++ b/writerfilter/source/filter/RtfFilter.cxx @@ -32,10 +32,16 @@ #include <osl/module.hxx> #include <tools/solar.h> #include <RtfFilter.hxx> +#include <comphelper/mediadescriptor.hxx> +#include <dmapper/DomainMapper.hxx> +#include <rtftok/RTFDocument.hxx> +#include <com/sun/star/frame/XFrame.hpp> +#include <svtools/miscopt.hxx> using namespace ::rtl; using namespace ::cppu; using namespace ::com::sun::star; +using ::comphelper::MediaDescriptor; RtfFilter::RtfFilter( const uno::Reference< uno::XComponentContext >& rxContext) : m_xContext( rxContext ) @@ -65,6 +71,39 @@ sal_Bool RtfFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescri } else if ( m_xDstDoc.is() ) { + SvtMiscOptions aMiscOptions; + if (aMiscOptions.IsExperimentalMode()) + { + MediaDescriptor aMediaDesc( aDescriptor ); +#ifdef DEBUG_IMPORT + OUString sURL = aMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_URL(), OUString() ); + ::std::string sURLc = OUStringToOString(sURL, RTL_TEXTENCODING_ASCII_US).getStr(); + + writerfilter::TagLogger::Pointer_t dmapperLogger + (writerfilter::TagLogger::getInstance("DOMAINMAPPER")); + dmapperLogger->setFileName(sURLc); + dmapperLogger->startDocument(); +#endif + uno::Reference< io::XInputStream > xInputStream; + + aMediaDesc.addInputStream(); + aMediaDesc[ MediaDescriptor::PROP_INPUTSTREAM() ] >>= xInputStream; + + uno::Reference<frame::XFrame> xFrame = aMediaDesc.getUnpackedValueOrDefault(MediaDescriptor::PROP_FRAME(), + uno::Reference<frame::XFrame>()); + + writerfilter::Stream::Pointer_t pStream( + new writerfilter::dmapper::DomainMapper(m_xContext, xInputStream, m_xDstDoc, writerfilter::dmapper::DOCUMENT_RTF)); + writerfilter::rtftok::RTFDocument::Pointer_t const pDocument( + writerfilter::rtftok::RTFDocumentFactory::createDocument(m_xContext, xInputStream, m_xDstDoc, xFrame)); + pDocument->resolve(*pStream); +#ifdef DEBUG_IMPORT + dmapperLogger->endDocument(); +#endif + return sal_True; + } + + // if not, then use the old importer uno::Reference< lang::XMultiServiceFactory > xMSF(m_xContext->getServiceManager(), uno::UNO_QUERY_THROW); uno::Reference< uno::XInterface > xIfc( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.RtfImport" ))), uno::UNO_QUERY_THROW); if (!xIfc.is()) diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx index 1e039d6febc6..252d4ac6903b 100644 --- a/writerfilter/source/filter/WriterFilter.cxx +++ b/writerfilter/source/filter/WriterFilter.cxx @@ -60,11 +60,6 @@ static struct ::cppu::ImplementationEntry s_component_entries [] = { 0, 0, 0, 0, 0, 0 } // terminate with NULL }; -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(sal_Char const * implName, ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry ) { return ::cppu::component_getFactoryHelper(implName, xMgr, xRegistry, s_component_entries ); diff --git a/writerfilter/source/rtftok/FlexLexer.h b/writerfilter/source/rtftok/FlexLexer.h deleted file mode 100644 index 375012b723a7..000000000000 --- a/writerfilter/source/rtftok/FlexLexer.h +++ /dev/null @@ -1,151 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef __FLEX_LEXER_H -// Never included before - need to define base class. -#define __FLEX_LEXER_H -typedef void ostream; -#include <vector> -#include <rtftok/RTFInputSource.hxx> - -extern "C++" { - -struct yy_buffer_state; -typedef int yy_state_type; - -} -#include <rtftok/RTFScanner.hxx> -#endif - -#if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce) -// Either this is the first time through (yyFlexLexerOnce not defined), -// or this is a repeated include to define a different flavor of -// yyFlexLexer, as discussed in the flex man page. -#define yyFlexLexerOnce - -class yyFlexLexer : public writerfilter::rtftok::RTFScanner { -private: - class RtfTokenizer* tokenizerInstance; - - void split_ctrl(char *yytext, char* token, char *value); - void raise_ctrl(char* yytext); - void raise_dest(char* yytext); - void raise_destOrCtrl(char* yytext); -protected: - int num_lines; - sal_uInt64 num_chars; - int star_flag; - -public: - // arg_yyin and arg_yyout default to the cin and cout, but we - // only make that assignment when initializing in yylex(). - yyFlexLexer( class writerfilter::rtftok::RTFInputSource* arg_yyin, class writerfilter::rtftok::RTFScannerHandler &eventHandler ); - - virtual ~yyFlexLexer(); - - void yy_switch_to_buffer( struct yy_buffer_state* new_buffer ); - struct yy_buffer_state* yy_create_buffer( class writerfilter::rtftok::RTFInputSource* s, int size ); - void yy_delete_buffer( struct yy_buffer_state* b ); - void yyrestart( class writerfilter::rtftok::RTFInputSource* s ); - - virtual int yylex(); - virtual void switch_streams( class writerfilter::rtftok::RTFInputSource* new_in, ostream* new_out ); - -protected: - -// int LexerInput( char* buf, int max_size ); - virtual void LexerOutput( const char* buf, int size ); - virtual void LexerError( const char* msg ); - - void yyunput( int c, char* buf_ptr ); - int yyinput(); - - void yy_load_buffer_state(); - void yy_init_buffer( struct yy_buffer_state* b, class writerfilter::rtftok::RTFInputSource* s ); - void yy_flush_buffer( struct yy_buffer_state* b ); - - int yy_start_stack_ptr; - int yy_start_stack_depth; - int* yy_start_stack; - - void yy_push_state( int new_state ); - void yy_pop_state(); - int yy_top_state(); - - yy_state_type yy_get_previous_state(); - yy_state_type yy_try_NUL_trans( yy_state_type current_state ); - int yy_get_next_buffer(); - - class writerfilter::rtftok::RTFInputSource* yyin; // input source for default LexerInput - ostream* yyout; // output sink for default LexerOutput - - struct yy_buffer_state* yy_current_buffer; - - // yy_hold_char holds the character lost when yytext is formed. - char yy_hold_char; - - // Number of characters read into yy_ch_buf. - int yy_n_chars; - - // Points to current character in buffer. - char* yy_c_buf_p; - - int yy_init; // whether we need to initialize - int yy_start; // start state number - - // Flag which is used to allow yywrap()'s to do buffer switches - // instead of setting up a fresh yyin. A bit of a hack ... - int yy_did_buffer_switch_on_eof; - - // The following are not always needed, but may be depending - // on use of certain flex features (like REJECT or yymore()). - - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; - - yy_state_type* yy_state_buf; - yy_state_type* yy_state_ptr; - - char* yy_full_match; - int* yy_full_state; - int yy_full_lp; - - int yy_lp; - int yy_looking_for_trail_begin; - - int yy_more_flag; - int yy_more_len; - int yy_more_offset; - int yy_prev_more_offset; - - private: - -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/RTFParseException.cxx b/writerfilter/source/rtftok/RTFParseException.cxx deleted file mode 100644 index ddfe2e5adb15..000000000000 --- a/writerfilter/source/rtftok/RTFParseException.cxx +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <rtftok/RTFParseException.hxx> - -writerfilter::rtftok::RTFParseException::RTFParseException(char * /*message*/) -{ -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/RTFScanner.lex b/writerfilter/source/rtftok/RTFScanner.lex deleted file mode 100644 index 1cbc636f5348..000000000000 --- a/writerfilter/source/rtftok/RTFScanner.lex +++ /dev/null @@ -1,333 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -/* compile with flex++ -8 -f -+ -Sflex.skl -ortfparser.cxx rtfparser.lex */ -%option yylineno -%{ -#include <math.h> -#include <string.h> -#include <osl/file.h> -#include <sal/macros.h> -#include <assert.h> -#include <vector> - -#if defined (UNX) - #define stricmp strcasecmp -#endif - -writerfilter::rtftok::RTFScanner* writerfilter::rtftok::RTFScanner::createRTFScanner(class writerfilter::rtftok::RTFInputSource& inputSource, writerfilter::rtftok::RTFScannerHandler &eventHandler) -{ - return new yyFlexLexer(&inputSource, eventHandler); -} - - - -extern "C" { -//int isatty(int fd) { return 0; } -int yywrap(void) { return 1; } -} - -/* -oslFileHandle yy_osl_in=NULL; -#define YY_INPUT(buf,result,max_size) \ -{\ -{\ - assert(yy_osl_in!=NULL);\ - sal_Bool isEOF;\ - oslFileError ret=osl_isEndOfFile( yy_osl_in, &isEOF );\ - assert(ret==osl_File_E_None);\ - if (isEOF)\ - {\ - result=YY_NULL;\ - }\ - else\ - {\ - sal_uInt64 bytesRead;\ - ret=osl_readFile( yy_osl_in, buf, max_size, &bytesRead);\ - assert(ret==osl_File_E_None);\ - result = bytesRead; \ - }\ -}\ -} -*/ - -//extern RtfTokenizer* this; -void yyFlexLexer::split_ctrl(char *_yytext, char* token, char *value) - { - int i=0; // skip first '\' - while(_yytext[i]!=0 && (_yytext[i]=='\r' || _yytext[i]=='\n')) i++; - while(_yytext[i]!=0 && (_yytext[i]<'A' || (_yytext[i]>'Z' && _yytext[i]<'a') || _yytext[i]>'z')) i++; - while(_yytext[i]!=0 && _yytext[i]>='A') *(token++)=_yytext[i++]; - *token=0; - while(_yytext[i]!=0 && _yytext[i]>' ') *(value++)=_yytext[i++]; - *value=0; - } - - void yyFlexLexer::raise_ctrl(char* _yytext) - { - char token[50]; - char value[50]; - split_ctrl(_yytext, token, value); - eventHandler.ctrl(token, value); - } - - void yyFlexLexer::raise_dest(char* _yytext) - { - char token[50]; - char value[50]; - split_ctrl(_yytext, token, value); - eventHandler.dest(token, value); - } - -#define _num_of_destctrls (SAL_N_ELEMENTS(_destctrls)) -static const char* _destctrls[] = { -"aftncn", -"aftnsep", -"aftnsepc", -"annotation", -"atnauthor", -"atndate", -"atnicn", -"atnid", -"atnparent", -"atnref", -"atntime", -"atrfend", -"atrfstart", -"author", -"background", -"bkmkend", -"bkmkstart", -"buptim", -"category", -"colortbl", -"comment", -"company", -"creatim", -"datafield", -"do", -"doccomm", -"docvar", -"dptxbxtext", -"falt", -"fchars", -"ffdeftext", -"ffentrymcr", -"ffexitmcr", -"ffformat", -"ffhelptext", -"ffl", -"ffname", -"ffstattext", -"field", -"file", -"filetbl", -"fldinst", -"fldrslt", -"fldtype", -"fname", -"fontemb", -"fontfile", -"fonttbl", -"footer", -"footer", -"footerf", -"footerl", -"footnote", -"formfield", -"ftncn", -"ftnsep", -"ftnsepc", -"g", -"generator", -"gridtbl", -"header", -"header", -"headerf", -"headerl", -"htmltag", -"info", -"keycode", -"keywords", -"lchars", -"levelnumbers", -"leveltext", -"lfolevel", -"list", -"listlevel", -"listname", -"listoverride", -"listoverridetable", -"listtable", -"listtext", -"manager", -"mhtmltag", -"nesttableprops", -"nextfile", -"nonesttables", -"nonshppict", -"objalias", -"objclass", -"objdata", -"object", -"objname", -"objsect", -"objtime", -"oldcprops", -"oldpprops", -"oldsprops", -"oldtprops", -"operator", -"panose", -"pgp", -"pgptbl", -"picprop", -"pict", -"pn", -"pnseclvl", -"pntext", -"pntxta", -"pntxtb", -"printim", -"private", -"pwd", -"pxe", -"result", -"revtbl", -"revtim", -"rsidtbl", -"rtf", -"rxe", -"shp", -"shpgrp", -"shpinst", -"shppict", -"shprslt", -"shptxt", -"sn", -"sp", -"stylesheet", -"subject", -"sv", -"tc", -"template", -"title", -"txe", -"ud", -"upr", -"urtf", -"userprops", -"xe" -}; - - void yyFlexLexer::raise_destOrCtrl(char* _yytext) - { - char token[50]; - char value[50]; - split_ctrl(_yytext, token, value); - char* result=(char*)bsearch(token, _destctrls, _num_of_destctrls, 20, (int (*)(const void*, const void*))stricmp); - if (result) - { - eventHandler.dest(token, value); - } - else - { - eventHandler.lbrace(); - eventHandler.ctrl(token, value); - } - } - -%} - -%% -\{\\upr\{" "? { /* skip upr destination */ - int c; - int br=1; - while (br>0 && (c = yyinput()) != EOF) - { - if (c=='}') br--; - if (c=='{') br++; - } - eventHandler.lbrace(); - num_chars+=yyleng; -} - - -\\bin(("+"|"-")?[0-9]*)?" "? { - raise_dest(yytext); - num_chars+=yyleng; - int len=atoi(yytext+4); - num_chars+=len; - // pictureBytes=2*len; - while ( len ) - { - int c = yyinput(); - eventHandler.addBinData((unsigned char)c); - len--; - } - eventHandler.rbrace(); -} - -\{[\r\n]*\\\*\\[A-Za-z]+(("+"|"-")?[0-9]*)?" "? { /* stared dest word */ - raise_dest(yytext); - num_chars+=yyleng; -} -\{[\r\n]*\\[A-Za-z]+(("+"|"-")?[0-9]*)?" "? { /* dest word */ - raise_destOrCtrl(yytext); -} -\\[A-Za-z]+(("+"|"-")?[0-9]*)?" "? { /* ctrl word */ - raise_ctrl(yytext); - star_flag=0; - num_chars+=yyleng; -} -\\\'[A-Fa-f0-9][A-Fa-f0-9] { /* hex char */ - eventHandler.addHexChar(yytext); - num_chars+=yyleng; -} -\\* { /* star */ - star_flag=1; - num_chars+=yyleng; -} -\{ { /* lbrace */ - eventHandler.lbrace(); - num_chars+=yyleng; -} -\} { /* rbrace */ - eventHandler.rbrace(); - num_chars+=yyleng; -} -\\\| { num_chars+=yyleng;} -\\~ {num_chars+=yyleng; eventHandler.addCharU(0xa0);} -\\- {num_chars+=yyleng;} -\\_ {num_chars+=yyleng;} -\\\: {num_chars+=yyleng;} -\n { ++num_lines;num_chars+=yyleng;} -\r {num_chars+=yyleng;} -\t {num_chars+=yyleng;} -" "(" "+) { eventHandler.addSpaces(yyleng); num_chars+=yyleng;} -. { eventHandler.addChar(yytext[0]); num_chars+=yyleng;} -%% diff --git a/writerfilter/source/rtftok/RTFScanner.skl b/writerfilter/source/rtftok/RTFScanner.skl deleted file mode 100644 index 071eab6c9272..000000000000 --- a/writerfilter/source/rtftok/RTFScanner.skl +++ /dev/null @@ -1,1527 +0,0 @@ -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -%- -#include <stdio.h> -%* - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include <math.h> -#include <osl/file.h> -#include <rtl/alloc.h> -#include <rtftok/RTFInputSource.hxx> -#include <rtftok/RTFParseException.hxx> - -static const int EOF=0; - -%+ -//class istream; -%* - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -%- -extern FILE *yyin, *yyout; -%* - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { -%- - FILE *yy_input_file; -%+ -// istream* yy_input_file; - writerfilter::rtftok::RTFInputSource *yy_input_file; -%* - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -%- Standard (non-C++) definition -static YY_BUFFER_STATE yy_current_buffer = 0; -%* - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -%- Standard (non-C++) definition -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); -%* - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -%% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here - -%- Standard (non-C++) definition -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); -%* - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ -%% code to fiddle yytext and yyleng for yymore() goes here - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ -%% code to copy yytext_ptr to yytext[] goes here, if %array - yy_c_buf_p = yy_cp; - -%% data tables for the DFA and the user's section 1 definitions go here - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -%- -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif -%* - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -%- Standard (non-C++) definition -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -%* -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include <stdlib.h> -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -%- Standard (non-C++) definition -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -%+ C++ definition -#define ECHO LexerOutput( yytext, yyleng ) -%* -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ -%% fread()/read() definition of YY_INPUT goes here unless we're doing C++ -%+ C++ definition -{result=yyin->read(buf, max_size);} -%* -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -%- -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -%+ -#define YY_FATAL_ERROR(msg) LexerError( msg ) -%* -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -%- Standard (non-C++) definition -#define YY_DECL int yylex YY_PROTO(( void )) -%+ C++ definition -#define YY_DECL int yyFlexLexer::yylex() -%* -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -%% YY_RULE_SETUP definition goes here - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -%% user's declarations go here - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) -%- - yyin = stdin; -%+ -// yyin = &cin; - yyin = NULL; -%* - - if ( ! yyout ) -%- - yyout = stdout; -%+ -// yyout = &cout; - yyout = NULL; -%* - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { -%% yymore()-related code goes here - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - -%% code to set up and find next match goes here - -yy_find_action: -%% code to find the action number goes here - - YY_DO_BEFORE_ACTION; - -%% code for yylineno update goes here - -do_action: /* This label is used only to access EOF actions. */ - -%% debug code goes here - - switch ( yy_act ) - { /* beginning of action switch */ -%% actions go here - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { -%% code to do back-up for compressed tables and set up yy_cp goes here - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - -%+ -yyFlexLexer::yyFlexLexer( writerfilter::rtftok::RTFInputSource* arg_yyin, class writerfilter::rtftok::RTFScannerHandler &eventHandler ) -: writerfilter::rtftok::RTFScanner(eventHandler) - { - yyin = arg_yyin; - yyout = 0; - yy_c_buf_p = 0; - yy_init = 1; - yy_start = 0; - yy_flex_debug = 0; - yylineno = 1; // this will only get updated if %option yylineno - - yy_did_buffer_switch_on_eof = 0; - - yy_looking_for_trail_begin = 0; - yy_more_flag = 0; - yy_more_len = 0; - yy_more_offset = yy_prev_more_offset = 0; - - yy_start_stack_ptr = yy_start_stack_depth = 0; - yy_start_stack = 0; - - yy_current_buffer = 0; - -#ifdef YY_USES_REJECT - yy_state_buf = new yy_state_type[YY_BUF_SIZE + 2]; -#else - yy_state_buf = 0; -#endif - - num_lines=0; - num_chars=0; - star_flag=false; - } - -yyFlexLexer::~yyFlexLexer() - { - delete yy_state_buf; - yy_delete_buffer( yy_current_buffer ); - } - -void yyFlexLexer::switch_streams( writerfilter::rtftok::RTFInputSource* new_in, ostream* new_out ) - { - if ( new_in ) - { - yy_delete_buffer( yy_current_buffer ); - yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) ); - } - - if ( new_out ) - yyout = new_out; - } - -#if 0 -#ifdef YY_INTERACTIVE -int yyFlexLexer::LexerInput( char* buf, int /* max_size */ ) -#else -int yyFlexLexer::LexerInput( char* buf, int max_size ) -#endif -{ - OSL_ASSERT(yyin!=NULL); - ::com::sun::star::uno::Sequence< ::sal_Int8 > buffer; - int len=yyin->readSomeBytes(buffer,max_size); - if (len>0) - { - sal_Int8 *_buffer=buffer.getArray(); - memcpy(buf, _buffer, len); - return len; - } - else - { - return YY_NULL; - } -} -#endif - -void yyFlexLexer::LexerOutput( const char* buf, int size ) - { -// (void) yyout->write( buf, size ); - } -%* - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -%- -static int yy_get_next_buffer() -%+ -int yyFlexLexer::yy_get_next_buffer() -%* - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -%- -static yy_state_type yy_get_previous_state() -%+ -yy_state_type yyFlexLexer::yy_get_previous_state() -%* - { - register yy_state_type yy_current_state; - register char *yy_cp; - -%% code to get the start state into yy_current_state goes here - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { -%% code to find the next state goes here - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -%- -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif -%+ -yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) -%* - { - register int yy_is_jam; -%% code to find the next state, and perhaps do backing up, goes here - - return yy_is_jam ? 0 : yy_current_state; - } - - -%- -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif -%+ -void yyFlexLexer::yyunput( int c, register char* yy_bp ) -%* - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - -%% update yylineno here - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -%- -#endif /* ifndef YY_NO_UNPUT */ -%* - - -%- -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif -%+ -int yyFlexLexer::yyinput() -%* - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - -%% update BOL and yylineno - - return c; - } - - -%- -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif -%+ -void yyFlexLexer::yyrestart( writerfilter::rtftok::RTFInputSource* input_file ) -%* - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -%- -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif -%+ -void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -%* - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -%- -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif -%+ -void yyFlexLexer::yy_load_buffer_state() -%* - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -%- -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif -%+ -YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( writerfilter::rtftok::RTFInputSource* file, int size ) -%* - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -%- -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif -%+ -void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b ) -%* - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -%- -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - -%+ -//extern "C" int isatty YY_PROTO(( int )); -void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, writerfilter::rtftok::RTFInputSource* file ) -%* - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -%- -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif -%+ - b->yy_is_interactive = 0; -%* - } - - -%- -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - -%+ -void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b ) -%* - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } -%* - - -#ifndef YY_NO_SCAN_BUFFER -%- -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -%* -#endif - - -#ifndef YY_NO_SCAN_STRING -%- -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -%* -#endif - - -#ifndef YY_NO_SCAN_BYTES -%- -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -%* -#endif - - -#ifndef YY_NO_PUSH_STATE -%- -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif -%+ -void yyFlexLexer::yy_push_state( int new_state ) -%* - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -%- -static void yy_pop_state() -%+ -void yyFlexLexer::yy_pop_state() -%* - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -%- -static int yy_top_state() -%+ -int yyFlexLexer::yy_top_state() -%* - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -%- -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - -%+ - -void yyFlexLexer::LexerError( yyconst char msg[] ) - { -// cerr << msg << '\n'; -// exit( YY_EXIT_FAILURE ); - throw writerfilter::rtftok::RTFParseException("fatal error: %s"/*, msg*/); - } -%* - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) rtl_allocateMemory( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - return (void *) rtl_reallocateMemory( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - rtl_freeMemory( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif - diff --git a/writerfilter/source/rtftok/rtfcharsets.cxx b/writerfilter/source/rtftok/rtfcharsets.cxx new file mode 100644 index 000000000000..96f6feb9237e --- /dev/null +++ b/writerfilter/source/rtftok/rtfcharsets.cxx @@ -0,0 +1,75 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include <rtftypes.hxx> +#include <sal/macros.h> + +namespace writerfilter { +namespace rtftok { + +// See RTF spec v1.9.1, page 19 +RTFEncoding aRTFEncodings[] = { + // charset codepage Windows / Mac name + {0, 1252}, // ANSI + {1, 0}, // Default + {2, 42}, // Symbol + {77, 10000}, // Mac Roman + {78, 10001}, // Mac Shift Jis + {79, 10003}, // Mac Hangul + {80, 10008}, // Mac GB2312 + {81, 10002}, // Mac Big5 + {83, 10005}, // Mac Herbrew + {84, 10004}, // Mac Arabic + {85, 10006}, // Mac Greek + {86, 10081}, // Mac Turkish + {87, 10021}, // Mac Thai + {88, 10029}, // Mac East Europe + {89, 10007}, // Mac Russian + {128, 932}, // Shift JIS + {129, 949}, // Hangul + {130, 1361}, // Johab + {134, 936}, // GB2312 + {136, 950}, // Big5 + {161, 1253}, // Greek + {162, 1254}, // Turkish + {163, 1258}, // Viatnamese + {177, 1255}, // Herbrew + {178, 1256}, // Arabic + {186, 1257}, // Baltic + {204, 1251}, // Russian + {222, 874}, // Thai + {238, 1250}, // Eastern European + {254, 437}, // PC 437 + {255, 850}, // OEM +}; + +int nRTFEncodings = SAL_N_ELEMENTS(aRTFEncodings); + +} // namespace rtftok +} // namespace writerfilter + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfcontrolwords.cxx b/writerfilter/source/rtftok/rtfcontrolwords.cxx new file mode 100644 index 000000000000..9034f6f4caa3 --- /dev/null +++ b/writerfilter/source/rtftok/rtfcontrolwords.cxx @@ -0,0 +1,1855 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include <rtfdocumentimpl.hxx> +#include <rtftypes.hxx> +#include <rtfcontrolwords.hxx> +#include <sal/macros.h> + +namespace writerfilter { +namespace rtftok { + +RTFSymbol aRTFControlWords[] = { + // sKeyword nControlType nIndex + {"'", CONTROL_SYMBOL, RTF_HEXCHAR}, + {"-", CONTROL_SYMBOL, RTF_OPTHYPH}, + {"*", CONTROL_SYMBOL, RTF_IGNORE}, + {":", CONTROL_SYMBOL, RTF_SUBENTRY}, + {"\\", CONTROL_SYMBOL, RTF_BACKSLASH}, + {"_", CONTROL_SYMBOL, RTF_NOBRKHYPH}, + {"{", CONTROL_SYMBOL, RTF_LBRACE}, + {"|", CONTROL_SYMBOL, RTF_FORMULA}, + {"}", CONTROL_SYMBOL, RTF_RBRACE}, + {"~", CONTROL_SYMBOL, RTF_NOBREAK}, + {"ab", CONTROL_TOGGLE, RTF_AB}, + {"absh", CONTROL_VALUE, RTF_ABSH}, + {"abslock", CONTROL_FLAG, RTF_ABSLOCK}, + {"absnoovrlp", CONTROL_TOGGLE, RTF_ABSNOOVRLP}, + {"absw", CONTROL_VALUE, RTF_ABSW}, + {"acaps", CONTROL_TOGGLE, RTF_ACAPS}, + {"acccircle", CONTROL_TOGGLE, RTF_ACCCIRCLE}, + {"acccomma", CONTROL_TOGGLE, RTF_ACCCOMMA}, + {"accdot", CONTROL_TOGGLE, RTF_ACCDOT}, + {"accnone", CONTROL_TOGGLE, RTF_ACCNONE}, + {"accunderdot", CONTROL_TOGGLE, RTF_ACCUNDERDOT}, + {"acf", CONTROL_VALUE, RTF_ACF}, + {"adeff", CONTROL_VALUE, RTF_ADEFF}, + {"additive", CONTROL_FLAG, RTF_ADDITIVE}, + {"adeflang", CONTROL_VALUE, RTF_ADEFLANG}, + {"adjustright", CONTROL_FLAG, RTF_ADJUSTRIGHT}, + {"adn", CONTROL_VALUE, RTF_ADN}, + {"aenddoc", CONTROL_FLAG, RTF_AENDDOC}, + {"aendnotes", CONTROL_FLAG, RTF_AENDNOTES}, + {"aexpnd", CONTROL_VALUE, RTF_AEXPND}, + {"af", CONTROL_VALUE, RTF_AF}, + {"afelev", CONTROL_FLAG, RTF_AFELEV}, + {"afs", CONTROL_VALUE, RTF_AFS}, + {"aftnbj", CONTROL_FLAG, RTF_AFTNBJ}, + {"aftncn", CONTROL_DESTINATION, RTF_AFTNCN}, + {"aftnnalc", CONTROL_FLAG, RTF_AFTNNALC}, + {"aftnnar", CONTROL_FLAG, RTF_AFTNNAR}, + {"aftnnauc", CONTROL_FLAG, RTF_AFTNNAUC}, + {"aftnnchi", CONTROL_FLAG, RTF_AFTNNCHI}, + {"aftnnchosung", CONTROL_FLAG, RTF_AFTNNCHOSUNG}, + {"aftnncnum", CONTROL_FLAG, RTF_AFTNNCNUM}, + {"aftnndbar", CONTROL_FLAG, RTF_AFTNNDBAR}, + {"aftnndbnum", CONTROL_FLAG, RTF_AFTNNDBNUM}, + {"aftnndbnumd", CONTROL_FLAG, RTF_AFTNNDBNUMD}, + {"aftnndbnumk", CONTROL_FLAG, RTF_AFTNNDBNUMK}, + {"aftnndbnumt", CONTROL_FLAG, RTF_AFTNNDBNUMT}, + {"aftnnganada", CONTROL_FLAG, RTF_AFTNNGANADA}, + {"aftnngbnum", CONTROL_FLAG, RTF_AFTNNGBNUM}, + {"aftnngbnumd", CONTROL_FLAG, RTF_AFTNNGBNUMD}, + {"aftnngbnumk", CONTROL_FLAG, RTF_AFTNNGBNUMK}, + {"aftnngbnuml", CONTROL_FLAG, RTF_AFTNNGBNUML}, + {"aftnnrlc", CONTROL_FLAG, RTF_AFTNNRLC}, + {"aftnnruc", CONTROL_FLAG, RTF_AFTNNRUC}, + {"aftnnzodiac", CONTROL_FLAG, RTF_AFTNNZODIAC}, + {"aftnnzodiacd", CONTROL_FLAG, RTF_AFTNNZODIACD}, + {"aftnnzodiacl", CONTROL_FLAG, RTF_AFTNNZODIACL}, + {"aftnrestart", CONTROL_FLAG, RTF_AFTNRESTART}, + {"aftnrstcont", CONTROL_FLAG, RTF_AFTNRSTCONT}, + {"aftnsep", CONTROL_DESTINATION, RTF_AFTNSEP}, + {"aftnsepc", CONTROL_DESTINATION, RTF_AFTNSEPC}, + {"aftnstart", CONTROL_VALUE, RTF_AFTNSTART}, + {"aftntj", CONTROL_FLAG, RTF_AFTNTJ}, + {"ai", CONTROL_TOGGLE, RTF_AI}, + {"alang", CONTROL_VALUE, RTF_ALANG}, + {"allowfieldendsel", CONTROL_FLAG, RTF_ALLOWFIELDENDSEL}, + {"allprot", CONTROL_FLAG, RTF_ALLPROT}, + {"alntblind", CONTROL_FLAG, RTF_ALNTBLIND}, + {"alt", CONTROL_FLAG, RTF_ALT}, + {"animtext", CONTROL_VALUE, RTF_ANIMTEXT}, + {"annotation", CONTROL_DESTINATION, RTF_ANNOTATION}, + {"annotprot", CONTROL_FLAG, RTF_ANNOTPROT}, + {"ansi", CONTROL_FLAG, RTF_ANSI}, + {"ansicpg", CONTROL_VALUE, RTF_ANSICPG}, + {"aoutl", CONTROL_TOGGLE, RTF_AOUTL}, + {"ApplyBrkRules", CONTROL_FLAG, RTF_APPLYBRKRULES}, + {"ascaps", CONTROL_TOGGLE, RTF_ASCAPS}, + {"ashad", CONTROL_TOGGLE, RTF_ASHAD}, + {"asianbrkrule", CONTROL_FLAG, RTF_ASIANBRKRULE}, + {"aspalpha", CONTROL_TOGGLE, RTF_ASPALPHA}, + {"aspnum", CONTROL_TOGGLE, RTF_ASPNUM}, + {"astrike", CONTROL_TOGGLE, RTF_ASTRIKE}, + {"atnauthor", CONTROL_DESTINATION, RTF_ATNAUTHOR}, + {"atndate", CONTROL_DESTINATION, RTF_ATNDATE}, + {"atnicn", CONTROL_DESTINATION, RTF_ATNICN}, + {"atnid", CONTROL_DESTINATION, RTF_ATNID}, + {"atnparent", CONTROL_DESTINATION, RTF_ATNPARENT}, + {"atnref", CONTROL_DESTINATION, RTF_ATNREF}, + {"atntime", CONTROL_DESTINATION, RTF_ATNTIME}, + {"atrfend", CONTROL_DESTINATION, RTF_ATRFEND}, + {"atrfstart", CONTROL_DESTINATION, RTF_ATRFSTART}, + {"aul", CONTROL_TOGGLE, RTF_AUL}, + {"auld", CONTROL_TOGGLE, RTF_AULD}, + {"auldb", CONTROL_TOGGLE, RTF_AULDB}, + {"aulnone", CONTROL_TOGGLE, RTF_AULNONE}, + {"aulw", CONTROL_TOGGLE, RTF_AULW}, + {"aup", CONTROL_VALUE, RTF_AUP}, + {"author", CONTROL_DESTINATION, RTF_AUTHOR}, + {"autofmtoverride", CONTROL_FLAG, RTF_AUTOFMTOVERRIDE}, + {"b", CONTROL_TOGGLE, RTF_B}, + {"background", CONTROL_DESTINATION, RTF_BACKGROUND}, + {"bdbfhdr", CONTROL_FLAG, RTF_BDBFHDR}, + {"bdrrlswsix", CONTROL_FLAG, RTF_BDRRLSWSIX}, + {"bgbdiag", CONTROL_FLAG, RTF_BGBDIAG}, + {"bgcross", CONTROL_FLAG, RTF_BGCROSS}, + {"bgdcross", CONTROL_FLAG, RTF_BGDCROSS}, + {"bgdkbdiag", CONTROL_FLAG, RTF_BGDKBDIAG}, + {"bgdkcross", CONTROL_FLAG, RTF_BGDKCROSS}, + {"bgdkdcross", CONTROL_FLAG, RTF_BGDKDCROSS}, + {"bgdkfdiag", CONTROL_FLAG, RTF_BGDKFDIAG}, + {"bgdkhoriz", CONTROL_FLAG, RTF_BGDKHORIZ}, + {"bgdkvert", CONTROL_FLAG, RTF_BGDKVERT}, + {"bgfdiag", CONTROL_FLAG, RTF_BGFDIAG}, + {"bghoriz", CONTROL_FLAG, RTF_BGHORIZ}, + {"bgvert", CONTROL_FLAG, RTF_BGVERT}, + {"bin", CONTROL_VALUE, RTF_BIN}, + {"binfsxn", CONTROL_VALUE, RTF_BINFSXN}, + {"binsxn", CONTROL_VALUE, RTF_BINSXN}, + {"bkmkcolf", CONTROL_VALUE, RTF_BKMKCOLF}, + {"bkmkcoll", CONTROL_VALUE, RTF_BKMKCOLL}, + {"bkmkend", CONTROL_DESTINATION, RTF_BKMKEND}, + {"bkmkpub", CONTROL_FLAG, RTF_BKMKPUB}, + {"bkmkstart", CONTROL_DESTINATION, RTF_BKMKSTART}, + {"bliptag", CONTROL_VALUE, RTF_BLIPTAG}, + {"blipuid", CONTROL_DESTINATION, RTF_BLIPUID}, + {"blipupi", CONTROL_VALUE, RTF_BLIPUPI}, + {"blue", CONTROL_VALUE, RTF_BLUE}, + {"bookfold", CONTROL_FLAG, RTF_BOOKFOLD}, + {"bookfoldrev", CONTROL_FLAG, RTF_BOOKFOLDREV}, + {"bookfoldsheets", CONTROL_VALUE, RTF_BOOKFOLDSHEETS}, + {"box", CONTROL_FLAG, RTF_BOX}, + {"brdrart", CONTROL_VALUE, RTF_BRDRART}, + {"brdrb", CONTROL_FLAG, RTF_BRDRB}, + {"brdrbar", CONTROL_FLAG, RTF_BRDRBAR}, + {"brdrbtw", CONTROL_FLAG, RTF_BRDRBTW}, + {"brdrcf", CONTROL_VALUE, RTF_BRDRCF}, + {"brdrdash", CONTROL_FLAG, RTF_BRDRDASH}, + {"brdrdashd", CONTROL_FLAG, RTF_BRDRDASHD}, + {"brdrdashdd", CONTROL_FLAG, RTF_BRDRDASHDD}, + {"brdrdashdot", CONTROL_FLAG, RTF_BRDRDASHDOT}, + {"brdrdashdotdot", CONTROL_FLAG, RTF_BRDRDASHDOTDOT}, + {"brdrdashdotstr", CONTROL_FLAG, RTF_BRDRDASHDOTSTR}, + {"brdrdashsm", CONTROL_FLAG, RTF_BRDRDASHSM}, + {"brdrdb", CONTROL_FLAG, RTF_BRDRDB}, + {"brdrdot", CONTROL_FLAG, RTF_BRDRDOT}, + {"brdremboss", CONTROL_FLAG, RTF_BRDREMBOSS}, + {"brdrengrave", CONTROL_FLAG, RTF_BRDRENGRAVE}, + {"brdrframe", CONTROL_FLAG, RTF_BRDRFRAME}, + {"brdrhair", CONTROL_FLAG, RTF_BRDRHAIR}, + {"brdrinset", CONTROL_FLAG, RTF_BRDRINSET}, + {"brdrl", CONTROL_FLAG, RTF_BRDRL}, + {"brdrnil", CONTROL_FLAG, RTF_BRDRNIL}, + {"brdrnone", CONTROL_FLAG, RTF_BRDRNONE}, + {"brdroutset", CONTROL_FLAG, RTF_BRDROUTSET}, + {"brdrr", CONTROL_FLAG, RTF_BRDRR}, + {"brdrs", CONTROL_FLAG, RTF_BRDRS}, + {"brdrsh", CONTROL_FLAG, RTF_BRDRSH}, + {"brdrt", CONTROL_FLAG, RTF_BRDRT}, + {"brdrtbl", CONTROL_FLAG, RTF_BRDRTBL}, + {"brdrth", CONTROL_FLAG, RTF_BRDRTH}, + {"brdrthtnlg", CONTROL_FLAG, RTF_BRDRTHTNLG}, + {"brdrthtnmg", CONTROL_FLAG, RTF_BRDRTHTNMG}, + {"brdrthtnsg", CONTROL_FLAG, RTF_BRDRTHTNSG}, + {"brdrtnthlg", CONTROL_FLAG, RTF_BRDRTNTHLG}, + {"brdrtnthmg", CONTROL_FLAG, RTF_BRDRTNTHMG}, + {"brdrtnthsg", CONTROL_FLAG, RTF_BRDRTNTHSG}, + {"brdrtnthtnlg", CONTROL_FLAG, RTF_BRDRTNTHTNLG}, + {"brdrtnthtnmg", CONTROL_FLAG, RTF_BRDRTNTHTNMG}, + {"brdrtnthtnsg", CONTROL_FLAG, RTF_BRDRTNTHTNSG}, + {"brdrtriple", CONTROL_FLAG, RTF_BRDRTRIPLE}, + {"brdrw", CONTROL_VALUE, RTF_BRDRW}, + {"brdrwavy", CONTROL_FLAG, RTF_BRDRWAVY}, + {"brdrwavydb", CONTROL_FLAG, RTF_BRDRWAVYDB}, + {"brkfrm", CONTROL_FLAG, RTF_BRKFRM}, + {"brsp", CONTROL_VALUE, RTF_BRSP}, + {"bullet", CONTROL_SYMBOL, RTF_BULLET}, + {"buptim", CONTROL_DESTINATION, RTF_BUPTIM}, + {"bxe", CONTROL_FLAG, RTF_BXE}, + {"caccentfive", CONTROL_FLAG, RTF_CACCENTFIVE}, + {"caccentfour", CONTROL_FLAG, RTF_CACCENTFOUR}, + {"caccentone", CONTROL_FLAG, RTF_CACCENTONE}, + {"caccentsix", CONTROL_FLAG, RTF_CACCENTSIX}, + {"caccentthree", CONTROL_FLAG, RTF_CACCENTTHREE}, + {"caccenttwo", CONTROL_FLAG, RTF_CACCENTTWO}, + {"cachedcolbal", CONTROL_FLAG, RTF_CACHEDCOLBAL}, + {"caps", CONTROL_TOGGLE, RTF_CAPS}, + {"category", CONTROL_DESTINATION, RTF_CATEGORY}, + {"cb", CONTROL_VALUE, RTF_CB}, + {"cbackgroundone", CONTROL_FLAG, RTF_CBACKGROUNDONE}, + {"cbackgroundtwo", CONTROL_FLAG, RTF_CBACKGROUNDTWO}, + {"cbpat", CONTROL_VALUE, RTF_CBPAT}, + {"cchs", CONTROL_VALUE, RTF_CCHS}, + {"cell", CONTROL_SYMBOL, RTF_CELL}, + {"cellx", CONTROL_VALUE, RTF_CELLX}, + {"cf", CONTROL_VALUE, RTF_CF}, + {"cfollowedhyperlink", CONTROL_FLAG, RTF_CFOLLOWEDHYPERLINK}, + {"cfpat", CONTROL_VALUE, RTF_CFPAT}, + {"cgrid", CONTROL_VALUE, RTF_CGRID}, + {"charrsid", CONTROL_VALUE, RTF_CHARRSID}, + {"charscalex", CONTROL_VALUE, RTF_CHARSCALEX}, + {"chatn", CONTROL_SYMBOL, RTF_CHATN}, + {"chbgbdiag", CONTROL_FLAG, RTF_CHBGBDIAG}, + {"chbgcross", CONTROL_FLAG, RTF_CHBGCROSS}, + {"chbgdcross", CONTROL_FLAG, RTF_CHBGDCROSS}, + {"chbgdkbdiag", CONTROL_FLAG, RTF_CHBGDKBDIAG}, + {"chbgdkcross", CONTROL_FLAG, RTF_CHBGDKCROSS}, + {"chbgdkdcross", CONTROL_FLAG, RTF_CHBGDKDCROSS}, + {"chbgdkfdiag", CONTROL_FLAG, RTF_CHBGDKFDIAG}, + {"chbgdkhoriz", CONTROL_FLAG, RTF_CHBGDKHORIZ}, + {"chbgdkvert", CONTROL_FLAG, RTF_CHBGDKVERT}, + {"chbgfdiag", CONTROL_FLAG, RTF_CHBGFDIAG}, + {"chbghoriz", CONTROL_FLAG, RTF_CHBGHORIZ}, + {"chbgvert", CONTROL_FLAG, RTF_CHBGVERT}, + {"chbrdr", CONTROL_FLAG, RTF_CHBRDR}, + {"chcbpat", CONTROL_VALUE, RTF_CHCBPAT}, + {"chcfpat", CONTROL_VALUE, RTF_CHCFPAT}, + {"chdate", CONTROL_SYMBOL, RTF_CHDATE}, + {"chdpa", CONTROL_SYMBOL, RTF_CHDPA}, + {"chdpl", CONTROL_SYMBOL, RTF_CHDPL}, + {"chftn", CONTROL_SYMBOL, RTF_CHFTN}, + {"chftnsep", CONTROL_SYMBOL, RTF_CHFTNSEP}, + {"chftnsepc", CONTROL_SYMBOL, RTF_CHFTNSEPC}, + {"chpgn", CONTROL_SYMBOL, RTF_CHPGN}, + {"chhres", CONTROL_VALUE, RTF_CHHRES}, + {"chshdng", CONTROL_VALUE, RTF_CHSHDNG}, + {"chtime", CONTROL_SYMBOL, RTF_CHTIME}, + {"chyperlink", CONTROL_FLAG, RTF_CHYPERLINK}, + {"clbgbdiag", CONTROL_FLAG, RTF_CLBGBDIAG}, + {"clbgcross", CONTROL_FLAG, RTF_CLBGCROSS}, + {"clbgdcross", CONTROL_FLAG, RTF_CLBGDCROSS}, + {"clbgdkbdiag", CONTROL_FLAG, RTF_CLBGDKBDIAG}, + {"clbgdkcross", CONTROL_FLAG, RTF_CLBGDKCROSS}, + {"clbgdkdcross", CONTROL_FLAG, RTF_CLBGDKDCROSS}, + {"clbgdkfdiag", CONTROL_FLAG, RTF_CLBGDKFDIAG}, + {"clbgdkhor", CONTROL_FLAG, RTF_CLBGDKHOR}, + {"clbgdkvert", CONTROL_FLAG, RTF_CLBGDKVERT}, + {"clbgfdiag", CONTROL_FLAG, RTF_CLBGFDIAG}, + {"clbghoriz", CONTROL_FLAG, RTF_CLBGHORIZ}, + {"clbgvert", CONTROL_FLAG, RTF_CLBGVERT}, + {"clbrdrb", CONTROL_FLAG, RTF_CLBRDRB}, + {"clbrdrl", CONTROL_FLAG, RTF_CLBRDRL}, + {"clbrdrr", CONTROL_FLAG, RTF_CLBRDRR}, + {"clbrdrt", CONTROL_FLAG, RTF_CLBRDRT}, + {"clcbpat", CONTROL_VALUE, RTF_CLCBPAT}, + {"clcbpatraw", CONTROL_VALUE, RTF_CLCBPATRAW}, + {"clcfpat", CONTROL_VALUE, RTF_CLCFPAT}, + {"clcfpatraw", CONTROL_VALUE, RTF_CLCFPATRAW}, + {"cldel", CONTROL_FLAG, RTF_CLDEL}, + {"cldelauth", CONTROL_VALUE, RTF_CLDELAUTH}, + {"cldeldttm", CONTROL_VALUE, RTF_CLDELDTTM}, + {"cldgll", CONTROL_FLAG, RTF_CLDGLL}, + {"cldglu", CONTROL_FLAG, RTF_CLDGLU}, + {"clFitText", CONTROL_FLAG, RTF_CLFITTEXT}, + {"clftsWidth", CONTROL_VALUE, RTF_CLFTSWIDTH}, + {"clhidemark", CONTROL_FLAG, RTF_CLHIDEMARK}, + {"clins", CONTROL_FLAG, RTF_CLINS}, + {"clinsauth", CONTROL_VALUE, RTF_CLINSAUTH}, + {"clinsdttm", CONTROL_VALUE, RTF_CLINSDTTM}, + {"clmgf", CONTROL_FLAG, RTF_CLMGF}, + {"clmrg", CONTROL_FLAG, RTF_CLMRG}, + {"clmrgd", CONTROL_FLAG, RTF_CLMRGD}, + {"clmrgdauth", CONTROL_VALUE, RTF_CLMRGDAUTH}, + {"clmrgddttm", CONTROL_VALUE, RTF_CLMRGDDTTM}, + {"clmrgdr", CONTROL_FLAG, RTF_CLMRGDR}, + {"clNoWrap", CONTROL_FLAG, RTF_CLNOWRAP}, + {"clpadb", CONTROL_VALUE, RTF_CLPADB}, + {"clpadfb", CONTROL_VALUE, RTF_CLPADFB}, + {"clpadfl", CONTROL_VALUE, RTF_CLPADFL}, + {"clpadfr", CONTROL_VALUE, RTF_CLPADFR}, + {"clpadft", CONTROL_VALUE, RTF_CLPADFT}, + {"clpadl", CONTROL_VALUE, RTF_CLPADL}, + {"clpadr", CONTROL_VALUE, RTF_CLPADR}, + {"clpadt", CONTROL_VALUE, RTF_CLPADT}, + {"clspb", CONTROL_VALUE, RTF_CLSPB}, + {"clspfb", CONTROL_VALUE, RTF_CLSPFB}, + {"clspfl", CONTROL_VALUE, RTF_CLSPFL}, + {"clspfr", CONTROL_VALUE, RTF_CLSPFR}, + {"clspft", CONTROL_VALUE, RTF_CLSPFT}, + {"clspl", CONTROL_VALUE, RTF_CLSPL}, + {"clspr", CONTROL_VALUE, RTF_CLSPR}, + {"clspt", CONTROL_VALUE, RTF_CLSPT}, + {"clshdng", CONTROL_VALUE, RTF_CLSHDNG}, + {"clshdngraw", CONTROL_VALUE, RTF_CLSHDNGRAW}, + {"clshdrawnil", CONTROL_FLAG, RTF_CLSHDRAWNIL}, + {"clsplit", CONTROL_FLAG, RTF_CLSPLIT}, + {"clsplitr", CONTROL_FLAG, RTF_CLSPLITR}, + {"cltxbtlr", CONTROL_FLAG, RTF_CLTXBTLR}, + {"cltxlrtb", CONTROL_FLAG, RTF_CLTXLRTB}, + {"cltxlrtbv", CONTROL_FLAG, RTF_CLTXLRTBV}, + {"cltxtbrl", CONTROL_FLAG, RTF_CLTXTBRL}, + {"cltxtbrlv", CONTROL_FLAG, RTF_CLTXTBRLV}, + {"clvertalb", CONTROL_FLAG, RTF_CLVERTALB}, + {"clvertalc", CONTROL_FLAG, RTF_CLVERTALC}, + {"clvertalt", CONTROL_FLAG, RTF_CLVERTALT}, + {"clvmgf", CONTROL_FLAG, RTF_CLVMGF}, + {"clvmrg", CONTROL_FLAG, RTF_CLVMRG}, + {"clwWidth", CONTROL_VALUE, RTF_CLWWIDTH}, + {"cmaindarkone", CONTROL_FLAG, RTF_CMAINDARKONE}, + {"cmaindarktwo", CONTROL_FLAG, RTF_CMAINDARKTWO}, + {"cmainlightone", CONTROL_FLAG, RTF_CMAINLIGHTONE}, + {"cmainlighttwo", CONTROL_FLAG, RTF_CMAINLIGHTTWO}, + {"collapsed", CONTROL_FLAG, RTF_COLLAPSED}, + {"colno", CONTROL_VALUE, RTF_COLNO}, + {"colorschememapping", CONTROL_DESTINATION, RTF_COLORSCHEMEMAPPING}, + {"colortbl", CONTROL_DESTINATION, RTF_COLORTBL}, + {"cols", CONTROL_VALUE, RTF_COLS}, + {"colsr", CONTROL_VALUE, RTF_COLSR}, + {"colsx", CONTROL_VALUE, RTF_COLSX}, + {"column", CONTROL_SYMBOL, RTF_COLUMN}, + {"colw", CONTROL_VALUE, RTF_COLW}, + {"comment", CONTROL_DESTINATION, RTF_COMMENT}, + {"company", CONTROL_DESTINATION, RTF_COMPANY}, + {"contextualspace", CONTROL_FLAG, RTF_CONTEXTUALSPACE}, + {"cpg", CONTROL_VALUE, RTF_CPG}, + {"crauth", CONTROL_VALUE, RTF_CRAUTH}, + {"crdate", CONTROL_VALUE, RTF_CRDATE}, + {"creatim", CONTROL_DESTINATION, RTF_CREATIM}, + {"cs", CONTROL_VALUE, RTF_CS}, + {"cshade", CONTROL_VALUE, RTF_CSHADE}, + {"ctextone", CONTROL_FLAG, RTF_CTEXTONE}, + {"ctexttwo", CONTROL_FLAG, RTF_CTEXTTWO}, + {"ctint", CONTROL_VALUE, RTF_CTINT}, + {"ctrl", CONTROL_FLAG, RTF_CTRL}, + {"cts", CONTROL_VALUE, RTF_CTS}, + {"cufi", CONTROL_VALUE, RTF_CUFI}, + {"culi", CONTROL_VALUE, RTF_CULI}, + {"curi", CONTROL_VALUE, RTF_CURI}, + {"cvmme", CONTROL_FLAG, RTF_CVMME}, + {"datafield", CONTROL_DESTINATION, RTF_DATAFIELD}, + {"datastore", CONTROL_DESTINATION, RTF_DATASTORE}, + {"date", CONTROL_FLAG, RTF_DATE}, + {"dbch", CONTROL_FLAG, RTF_DBCH}, + {"defchp", CONTROL_DESTINATION, RTF_DEFCHP}, + {"deff", CONTROL_VALUE, RTF_DEFF}, + {"defformat", CONTROL_FLAG, RTF_DEFFORMAT}, + {"deflang", CONTROL_VALUE, RTF_DEFLANG}, + {"deflangfe", CONTROL_VALUE, RTF_DEFLANGFE}, + {"defpap", CONTROL_DESTINATION, RTF_DEFPAP}, + {"defshp", CONTROL_FLAG, RTF_DEFSHP}, + {"deftab", CONTROL_VALUE, RTF_DEFTAB}, + {"deleted", CONTROL_TOGGLE, RTF_DELETED}, + {"delrsid", CONTROL_VALUE, RTF_DELRSID}, + {"dfrauth", CONTROL_VALUE, RTF_DFRAUTH}, + {"dfrdate", CONTROL_VALUE, RTF_DFRDATE}, + {"dfrmtxtx", CONTROL_VALUE, RTF_DFRMTXTX}, + {"dfrmtxty", CONTROL_VALUE, RTF_DFRMTXTY}, + {"dfrstart", CONTROL_VALUE, RTF_DFRSTART}, + {"dfrstop", CONTROL_VALUE, RTF_DFRSTOP}, + {"dfrxst", CONTROL_VALUE, RTF_DFRXST}, + {"dghorigin", CONTROL_VALUE, RTF_DGHORIGIN}, + {"dghshow", CONTROL_VALUE, RTF_DGHSHOW}, + {"dghspace", CONTROL_VALUE, RTF_DGHSPACE}, + {"dgmargin", CONTROL_FLAG, RTF_DGMARGIN}, + {"dgsnap", CONTROL_FLAG, RTF_DGSNAP}, + {"dgvorigin", CONTROL_VALUE, RTF_DGVORIGIN}, + {"dgvshow", CONTROL_VALUE, RTF_DGVSHOW}, + {"dgvspace", CONTROL_VALUE, RTF_DGVSPACE}, + {"dibitmap", CONTROL_VALUE, RTF_DIBITMAP}, + {"disabled", CONTROL_TOGGLE, RTF_DISABLED}, + {"dn", CONTROL_VALUE, RTF_DN}, + {"dntblnsbdb", CONTROL_FLAG, RTF_DNTBLNSBDB}, + {"do", CONTROL_DESTINATION, RTF_DO}, + {"dobxcolumn", CONTROL_FLAG, RTF_DOBXCOLUMN}, + {"dobxmargin", CONTROL_FLAG, RTF_DOBXMARGIN}, + {"dobxpage", CONTROL_FLAG, RTF_DOBXPAGE}, + {"dobymargin", CONTROL_FLAG, RTF_DOBYMARGIN}, + {"dobypage", CONTROL_FLAG, RTF_DOBYPAGE}, + {"dobypara", CONTROL_FLAG, RTF_DOBYPARA}, + {"doccomm", CONTROL_DESTINATION, RTF_DOCCOMM}, + {"doctemp", CONTROL_FLAG, RTF_DOCTEMP}, + {"doctype", CONTROL_VALUE, RTF_DOCTYPE}, + {"docvar", CONTROL_DESTINATION, RTF_DOCVAR}, + {"dodhgt", CONTROL_VALUE, RTF_DODHGT}, + {"dolock", CONTROL_FLAG, RTF_DOLOCK}, + {"donotembedlingdata", CONTROL_VALUE, RTF_DONOTEMBEDLINGDATA}, + {"donotembedsysfont", CONTROL_VALUE, RTF_DONOTEMBEDSYSFONT}, + {"donotshowcomments", CONTROL_FLAG, RTF_DONOTSHOWCOMMENTS}, + {"donotshowinsdel", CONTROL_FLAG, RTF_DONOTSHOWINSDEL}, + {"donotshowmarkup", CONTROL_FLAG, RTF_DONOTSHOWMARKUP}, + {"donotshowprops", CONTROL_FLAG, RTF_DONOTSHOWPROPS}, + {"dpaendhol", CONTROL_FLAG, RTF_DPAENDHOL}, + {"dpaendl", CONTROL_VALUE, RTF_DPAENDL}, + {"dpaendsol", CONTROL_FLAG, RTF_DPAENDSOL}, + {"dpaendw", CONTROL_VALUE, RTF_DPAENDW}, + {"dparc", CONTROL_FLAG, RTF_DPARC}, + {"dparcflipx", CONTROL_FLAG, RTF_DPARCFLIPX}, + {"dparcflipy", CONTROL_FLAG, RTF_DPARCFLIPY}, + {"dpastarthol", CONTROL_FLAG, RTF_DPASTARTHOL}, + {"dpastartl", CONTROL_VALUE, RTF_DPASTARTL}, + {"dpastartsol", CONTROL_FLAG, RTF_DPASTARTSOL}, + {"dpastartw", CONTROL_VALUE, RTF_DPASTARTW}, + {"dpcallout", CONTROL_FLAG, RTF_DPCALLOUT}, + {"dpcoa", CONTROL_VALUE, RTF_DPCOA}, + {"dpcoaccent", CONTROL_FLAG, RTF_DPCOACCENT}, + {"dpcobestfit", CONTROL_FLAG, RTF_DPCOBESTFIT}, + {"dpcoborder", CONTROL_FLAG, RTF_DPCOBORDER}, + {"dpcodabs", CONTROL_FLAG, RTF_DPCODABS}, + {"dpcodbottom", CONTROL_FLAG, RTF_DPCODBOTTOM}, + {"dpcodcenter", CONTROL_FLAG, RTF_DPCODCENTER}, + {"dpcodescent", CONTROL_VALUE, RTF_DPCODESCENT}, + {"dpcodtop", CONTROL_FLAG, RTF_DPCODTOP}, + {"dpcolength", CONTROL_VALUE, RTF_DPCOLENGTH}, + {"dpcominusx", CONTROL_FLAG, RTF_DPCOMINUSX}, + {"dpcominusy", CONTROL_FLAG, RTF_DPCOMINUSY}, + {"dpcooffset", CONTROL_VALUE, RTF_DPCOOFFSET}, + {"dpcosmarta", CONTROL_FLAG, RTF_DPCOSMARTA}, + {"dpcotdouble", CONTROL_FLAG, RTF_DPCOTDOUBLE}, + {"dpcotright", CONTROL_FLAG, RTF_DPCOTRIGHT}, + {"dpcotsingle", CONTROL_FLAG, RTF_DPCOTSINGLE}, + {"dpcottriple", CONTROL_FLAG, RTF_DPCOTTRIPLE}, + {"dpcount", CONTROL_VALUE, RTF_DPCOUNT}, + {"dpellipse", CONTROL_FLAG, RTF_DPELLIPSE}, + {"dpendgroup", CONTROL_FLAG, RTF_DPENDGROUP}, + {"dpfillbgcb", CONTROL_VALUE, RTF_DPFILLBGCB}, + {"dpfillbgcg", CONTROL_VALUE, RTF_DPFILLBGCG}, + {"dpfillbgcr", CONTROL_VALUE, RTF_DPFILLBGCR}, + {"dpfillbggray", CONTROL_VALUE, RTF_DPFILLBGGRAY}, + {"dpfillbgpal", CONTROL_FLAG, RTF_DPFILLBGPAL}, + {"dpfillfgcb", CONTROL_VALUE, RTF_DPFILLFGCB}, + {"dpfillfgcg", CONTROL_VALUE, RTF_DPFILLFGCG}, + {"dpfillfgcr", CONTROL_VALUE, RTF_DPFILLFGCR}, + {"dpfillfggray", CONTROL_VALUE, RTF_DPFILLFGGRAY}, + {"dpfillfgpal", CONTROL_FLAG, RTF_DPFILLFGPAL}, + {"dpfillpat", CONTROL_VALUE, RTF_DPFILLPAT}, + {"dpgroup", CONTROL_FLAG, RTF_DPGROUP}, + {"dpline", CONTROL_FLAG, RTF_DPLINE}, + {"dplinecob", CONTROL_VALUE, RTF_DPLINECOB}, + {"dplinecog", CONTROL_VALUE, RTF_DPLINECOG}, + {"dplinecor", CONTROL_VALUE, RTF_DPLINECOR}, + {"dplinedado", CONTROL_FLAG, RTF_DPLINEDADO}, + {"dplinedadodo", CONTROL_FLAG, RTF_DPLINEDADODO}, + {"dplinedash", CONTROL_FLAG, RTF_DPLINEDASH}, + {"dplinedot", CONTROL_FLAG, RTF_DPLINEDOT}, + {"dplinegray", CONTROL_VALUE, RTF_DPLINEGRAY}, + {"dplinehollow", CONTROL_FLAG, RTF_DPLINEHOLLOW}, + {"dplinepal", CONTROL_FLAG, RTF_DPLINEPAL}, + {"dplinesolid", CONTROL_FLAG, RTF_DPLINESOLID}, + {"dplinew", CONTROL_VALUE, RTF_DPLINEW}, + {"dppolycount", CONTROL_VALUE, RTF_DPPOLYCOUNT}, + {"dppolygon", CONTROL_FLAG, RTF_DPPOLYGON}, + {"dppolyline", CONTROL_FLAG, RTF_DPPOLYLINE}, + {"dpptx", CONTROL_VALUE, RTF_DPPTX}, + {"dppty", CONTROL_VALUE, RTF_DPPTY}, + {"dprect", CONTROL_FLAG, RTF_DPRECT}, + {"dproundr", CONTROL_FLAG, RTF_DPROUNDR}, + {"dpshadow", CONTROL_FLAG, RTF_DPSHADOW}, + {"dpshadx", CONTROL_VALUE, RTF_DPSHADX}, + {"dpshady", CONTROL_VALUE, RTF_DPSHADY}, + {"dptxbtlr", CONTROL_FLAG, RTF_DPTXBTLR}, + {"dptxbx", CONTROL_FLAG, RTF_DPTXBX}, + {"dptxbxmar", CONTROL_VALUE, RTF_DPTXBXMAR}, + {"dptxbxtext", CONTROL_DESTINATION, RTF_DPTXBXTEXT}, + {"dptxlrtb", CONTROL_FLAG, RTF_DPTXLRTB}, + {"dptxlrtbv", CONTROL_FLAG, RTF_DPTXLRTBV}, + {"dptxtbrl", CONTROL_FLAG, RTF_DPTXTBRL}, + {"dptxtbrlv", CONTROL_FLAG, RTF_DPTXTBRLV}, + {"dpx", CONTROL_VALUE, RTF_DPX}, + {"dpxsize", CONTROL_VALUE, RTF_DPXSIZE}, + {"dpy", CONTROL_VALUE, RTF_DPY}, + {"dpysize", CONTROL_VALUE, RTF_DPYSIZE}, + {"dropcapli", CONTROL_VALUE, RTF_DROPCAPLI}, + {"dropcapt", CONTROL_VALUE, RTF_DROPCAPT}, + {"ds", CONTROL_VALUE, RTF_DS}, + {"dxfrtext", CONTROL_VALUE, RTF_DXFRTEXT}, + {"dy", CONTROL_VALUE, RTF_DY}, + {"ebcend", CONTROL_DESTINATION, RTF_EBCEND}, + {"ebcstart", CONTROL_DESTINATION, RTF_EBCSTART}, + {"edmins", CONTROL_VALUE, RTF_EDMINS}, + {"embo", CONTROL_TOGGLE, RTF_EMBO}, + {"emdash", CONTROL_SYMBOL, RTF_EMDASH}, + {"emfblip", CONTROL_FLAG, RTF_EMFBLIP}, + {"emspace", CONTROL_SYMBOL, RTF_EMSPACE}, + {"endash", CONTROL_SYMBOL, RTF_ENDASH}, + {"enddoc", CONTROL_FLAG, RTF_ENDDOC}, + {"endnhere", CONTROL_FLAG, RTF_ENDNHERE}, + {"endnotes", CONTROL_FLAG, RTF_ENDNOTES}, + {"enforceprot", CONTROL_VALUE, RTF_ENFORCEPROT}, + {"enspace", CONTROL_SYMBOL, RTF_ENSPACE}, + {"expnd", CONTROL_VALUE, RTF_EXPND}, + {"expndtw", CONTROL_VALUE, RTF_EXPNDTW}, + {"expshrtn", CONTROL_FLAG, RTF_EXPSHRTN}, + {"f", CONTROL_VALUE, RTF_F}, + {"faauto", CONTROL_FLAG, RTF_FAAUTO}, + {"facenter", CONTROL_FLAG, RTF_FACENTER}, + {"facingp", CONTROL_FLAG, RTF_FACINGP}, + {"factoidname", CONTROL_DESTINATION, RTF_FACTOIDNAME}, + {"fafixed", CONTROL_FLAG, RTF_FAFIXED}, + {"fahang", CONTROL_FLAG, RTF_FAHANG}, + {"falt", CONTROL_DESTINATION, RTF_FALT}, + {"faroman", CONTROL_FLAG, RTF_FAROMAN}, + {"favar", CONTROL_FLAG, RTF_FAVAR}, + {"fbias", CONTROL_VALUE, RTF_FBIAS}, + {"fbidi", CONTROL_FLAG, RTF_FBIDI}, + {"fbidis", CONTROL_FLAG, RTF_FBIDIS}, + {"fbimajor", CONTROL_FLAG, RTF_FBIMAJOR}, + {"fbiminor", CONTROL_FLAG, RTF_FBIMINOR}, + {"fchars", CONTROL_DESTINATION, RTF_FCHARS}, + {"fcharset", CONTROL_VALUE, RTF_FCHARSET}, + {"fcs", CONTROL_VALUE, RTF_FCS}, + {"fdbmajor", CONTROL_FLAG, RTF_FDBMAJOR}, + {"fdbminor", CONTROL_FLAG, RTF_FDBMINOR}, + {"fdecor", CONTROL_FLAG, RTF_FDECOR}, + {"felnbrelev", CONTROL_FLAG, RTF_FELNBRELEV}, + {"fet", CONTROL_VALUE, RTF_FET}, + {"fetch", CONTROL_FLAG, RTF_FETCH}, + {"ffdefres", CONTROL_VALUE, RTF_FFDEFRES}, + {"ffdeftext", CONTROL_DESTINATION, RTF_FFDEFTEXT}, + {"ffentrymcr", CONTROL_DESTINATION, RTF_FFENTRYMCR}, + {"ffexitmcr", CONTROL_DESTINATION, RTF_FFEXITMCR}, + {"ffformat", CONTROL_DESTINATION, RTF_FFFORMAT}, + {"ffhaslistbox", CONTROL_VALUE, RTF_FFHASLISTBOX}, + {"ffhelptext", CONTROL_DESTINATION, RTF_FFHELPTEXT}, + {"ffhps", CONTROL_VALUE, RTF_FFHPS}, + {"ffl", CONTROL_DESTINATION, RTF_FFL}, + {"ffmaxlen", CONTROL_VALUE, RTF_FFMAXLEN}, + {"ffname", CONTROL_DESTINATION, RTF_FFNAME}, + {"ffownhelp", CONTROL_VALUE, RTF_FFOWNHELP}, + {"ffownstat", CONTROL_VALUE, RTF_FFOWNSTAT}, + {"ffprot", CONTROL_VALUE, RTF_FFPROT}, + {"ffrecalc", CONTROL_VALUE, RTF_FFRECALC}, + {"ffres", CONTROL_VALUE, RTF_FFRES}, + {"ffsize", CONTROL_VALUE, RTF_FFSIZE}, + {"ffstattext", CONTROL_DESTINATION, RTF_FFSTATTEXT}, + {"fftype", CONTROL_VALUE, RTF_FFTYPE}, + {"fftypetxt", CONTROL_VALUE, RTF_FFTYPETXT}, + {"fhimajor", CONTROL_FLAG, RTF_FHIMAJOR}, + {"fhiminor", CONTROL_FLAG, RTF_FHIMINOR}, + {"fi", CONTROL_VALUE, RTF_FI}, + {"fid", CONTROL_VALUE, RTF_FID}, + {"field", CONTROL_DESTINATION, RTF_FIELD}, + {"file", CONTROL_DESTINATION, RTF_FILE}, + {"filetbl", CONTROL_DESTINATION, RTF_FILETBL}, + {"fittext", CONTROL_VALUE, RTF_FITTEXT}, + {"fjgothic", CONTROL_FLAG, RTF_FJGOTHIC}, + {"fjminchou", CONTROL_FLAG, RTF_FJMINCHOU}, + {"fldalt", CONTROL_FLAG, RTF_FLDALT}, + {"flddirty", CONTROL_FLAG, RTF_FLDDIRTY}, + {"fldedit", CONTROL_FLAG, RTF_FLDEDIT}, + {"fldinst", CONTROL_DESTINATION, RTF_FLDINST}, + {"fldlock", CONTROL_FLAG, RTF_FLDLOCK}, + {"fldpriv", CONTROL_FLAG, RTF_FLDPRIV}, + {"fldrslt", CONTROL_DESTINATION, RTF_FLDRSLT}, + {"fldtype", CONTROL_DESTINATION, RTF_FLDTYPE}, + {"flomajor", CONTROL_FLAG, RTF_FLOMAJOR}, + {"flominor", CONTROL_FLAG, RTF_FLOMINOR}, + {"fmodern", CONTROL_FLAG, RTF_FMODERN}, + {"fn", CONTROL_VALUE, RTF_FN}, + {"fname", CONTROL_DESTINATION, RTF_FNAME}, + {"fnetwork", CONTROL_FLAG, RTF_FNETWORK}, + {"fnil", CONTROL_FLAG, RTF_FNIL}, + {"fnonfilesys", CONTROL_FLAG, RTF_FNONFILESYS}, + {"fontemb", CONTROL_DESTINATION, RTF_FONTEMB}, + {"fontfile", CONTROL_DESTINATION, RTF_FONTFILE}, + {"fonttbl", CONTROL_DESTINATION, RTF_FONTTBL}, + {"footer", CONTROL_DESTINATION, RTF_FOOTER}, + {"footerf", CONTROL_DESTINATION, RTF_FOOTERF}, + {"footerl", CONTROL_DESTINATION, RTF_FOOTERL}, + {"footerr", CONTROL_DESTINATION, RTF_FOOTERR}, + {"footery", CONTROL_VALUE, RTF_FOOTERY}, + {"footnote", CONTROL_DESTINATION, RTF_FOOTNOTE}, + {"forceupgrade", CONTROL_FLAG, RTF_FORCEUPGRADE}, + {"formdisp", CONTROL_FLAG, RTF_FORMDISP}, + {"formfield", CONTROL_DESTINATION, RTF_FORMFIELD}, + {"formprot", CONTROL_FLAG, RTF_FORMPROT}, + {"formshade", CONTROL_FLAG, RTF_FORMSHADE}, + {"fosnum", CONTROL_VALUE, RTF_FOSNUM}, + {"fprq", CONTROL_VALUE, RTF_FPRQ}, + {"fracwidth", CONTROL_FLAG, RTF_FRACWIDTH}, + {"frelative", CONTROL_VALUE, RTF_FRELATIVE}, + {"frmtxbtlr", CONTROL_FLAG, RTF_FRMTXBTLR}, + {"frmtxlrtb", CONTROL_FLAG, RTF_FRMTXLRTB}, + {"frmtxlrtbv", CONTROL_FLAG, RTF_FRMTXLRTBV}, + {"frmtxtbrl", CONTROL_FLAG, RTF_FRMTXTBRL}, + {"frmtxtbrlv", CONTROL_FLAG, RTF_FRMTXTBRLV}, + {"froman", CONTROL_FLAG, RTF_FROMAN}, + {"fromhtml", CONTROL_VALUE, RTF_FROMHTML}, + {"fromtext", CONTROL_FLAG, RTF_FROMTEXT}, + {"fs", CONTROL_VALUE, RTF_FS}, + {"fscript", CONTROL_FLAG, RTF_FSCRIPT}, + {"fswiss", CONTROL_FLAG, RTF_FSWISS}, + {"ftech", CONTROL_FLAG, RTF_FTECH}, + {"ftnalt", CONTROL_FLAG, RTF_FTNALT}, + {"ftnbj", CONTROL_FLAG, RTF_FTNBJ}, + {"ftncn", CONTROL_DESTINATION, RTF_FTNCN}, + {"ftnil", CONTROL_FLAG, RTF_FTNIL}, + {"ftnlytwnine", CONTROL_FLAG, RTF_FTNLYTWNINE}, + {"ftnnalc", CONTROL_FLAG, RTF_FTNNALC}, + {"ftnnar", CONTROL_FLAG, RTF_FTNNAR}, + {"ftnnauc", CONTROL_FLAG, RTF_FTNNAUC}, + {"ftnnchi", CONTROL_FLAG, RTF_FTNNCHI}, + {"ftnnchosung", CONTROL_FLAG, RTF_FTNNCHOSUNG}, + {"ftnncnum", CONTROL_FLAG, RTF_FTNNCNUM}, + {"ftnndbar", CONTROL_FLAG, RTF_FTNNDBAR}, + {"ftnndbnum", CONTROL_FLAG, RTF_FTNNDBNUM}, + {"ftnndbnumd", CONTROL_FLAG, RTF_FTNNDBNUMD}, + {"ftnndbnumk", CONTROL_FLAG, RTF_FTNNDBNUMK}, + {"ftnndbnumt", CONTROL_FLAG, RTF_FTNNDBNUMT}, + {"ftnnganada", CONTROL_FLAG, RTF_FTNNGANADA}, + {"ftnngbnum", CONTROL_FLAG, RTF_FTNNGBNUM}, + {"ftnngbnumd", CONTROL_FLAG, RTF_FTNNGBNUMD}, + {"ftnngbnumk", CONTROL_FLAG, RTF_FTNNGBNUMK}, + {"ftnngbnuml", CONTROL_FLAG, RTF_FTNNGBNUML}, + {"ftnnrlc", CONTROL_FLAG, RTF_FTNNRLC}, + {"ftnnruc", CONTROL_FLAG, RTF_FTNNRUC}, + {"ftnnzodiac", CONTROL_FLAG, RTF_FTNNZODIAC}, + {"ftnnzodiacd", CONTROL_FLAG, RTF_FTNNZODIACD}, + {"ftnnzodiacl", CONTROL_FLAG, RTF_FTNNZODIACL}, + {"ftnrestart", CONTROL_FLAG, RTF_FTNRESTART}, + {"ftnrstcont", CONTROL_FLAG, RTF_FTNRSTCONT}, + {"ftnrstpg", CONTROL_FLAG, RTF_FTNRSTPG}, + {"ftnsep", CONTROL_DESTINATION, RTF_FTNSEP}, + {"ftnsepc", CONTROL_DESTINATION, RTF_FTNSEPC}, + {"ftnstart", CONTROL_VALUE, RTF_FTNSTART}, + {"ftntj", CONTROL_FLAG, RTF_FTNTJ}, + {"fttruetype", CONTROL_FLAG, RTF_FTTRUETYPE}, + {"fvaliddos", CONTROL_FLAG, RTF_FVALIDDOS}, + {"fvalidhpfs", CONTROL_FLAG, RTF_FVALIDHPFS}, + {"fvalidmac", CONTROL_FLAG, RTF_FVALIDMAC}, + {"fvalidntfs", CONTROL_FLAG, RTF_FVALIDNTFS}, + {"g", CONTROL_DESTINATION, RTF_G}, + {"gcw", CONTROL_VALUE, RTF_GCW}, + {"generator", CONTROL_DESTINATION, RTF_GENERATOR}, + {"green", CONTROL_VALUE, RTF_GREEN}, + {"grfdocevents", CONTROL_VALUE, RTF_GRFDOCEVENTS}, + {"gridtbl", CONTROL_DESTINATION, RTF_GRIDTBL}, + {"gutter", CONTROL_VALUE, RTF_GUTTER}, + {"gutterprl", CONTROL_FLAG, RTF_GUTTERPRL}, + {"guttersxn", CONTROL_VALUE, RTF_GUTTERSXN}, + {"header", CONTROL_DESTINATION, RTF_HEADER}, + {"headerf", CONTROL_DESTINATION, RTF_HEADERF}, + {"headerl", CONTROL_DESTINATION, RTF_HEADERL}, + {"headerr", CONTROL_DESTINATION, RTF_HEADERR}, + {"headery", CONTROL_VALUE, RTF_HEADERY}, + {"hich", CONTROL_FLAG, RTF_HICH}, + {"highlight", CONTROL_VALUE, RTF_HIGHLIGHT}, + {"hl", CONTROL_DESTINATION, RTF_HL}, + {"hlfr", CONTROL_DESTINATION, RTF_HLFR}, + {"hlinkbase", CONTROL_DESTINATION, RTF_HLINKBASE}, + {"hlloc", CONTROL_DESTINATION, RTF_HLLOC}, + {"hlsrc", CONTROL_DESTINATION, RTF_HLSRC}, + {"horzdoc", CONTROL_FLAG, RTF_HORZDOC}, + {"horzsect", CONTROL_FLAG, RTF_HORZSECT}, + {"horzvert", CONTROL_VALUE, RTF_HORZVERT}, + {"hr", CONTROL_VALUE, RTF_HR}, + {"hres", CONTROL_VALUE, RTF_HRES}, + {"hrule", CONTROL_FLAG, RTF_HRULE}, + {"hsv", CONTROL_DESTINATION, RTF_HSV}, + {"htmautsp", CONTROL_FLAG, RTF_HTMAUTSP}, + {"htmlbase", CONTROL_FLAG, RTF_HTMLBASE}, + {"htmlrtf", CONTROL_TOGGLE, RTF_HTMLRTF}, + {"htmltag", CONTROL_DESTINATION, RTF_HTMLTAG}, + {"hwelev", CONTROL_FLAG, RTF_HWELEV}, + {"hyphauto", CONTROL_TOGGLE, RTF_HYPHAUTO}, + {"hyphcaps", CONTROL_TOGGLE, RTF_HYPHCAPS}, + {"hyphconsec", CONTROL_VALUE, RTF_HYPHCONSEC}, + {"hyphhotz", CONTROL_VALUE, RTF_HYPHHOTZ}, + {"hyphpar", CONTROL_TOGGLE, RTF_HYPHPAR}, + {"i", CONTROL_TOGGLE, RTF_I}, + {"id", CONTROL_VALUE, RTF_ID}, + {"ignoremixedcontent", CONTROL_VALUE, RTF_IGNOREMIXEDCONTENT}, + {"ilfomacatclnup", CONTROL_VALUE, RTF_ILFOMACATCLNUP}, + {"ilvl", CONTROL_VALUE, RTF_ILVL}, + {"impr", CONTROL_TOGGLE, RTF_IMPR}, + {"indmirror", CONTROL_FLAG, RTF_INDMIRROR}, + {"indrlsweleven", CONTROL_FLAG, RTF_INDRLSWELEVEN}, + {"info", CONTROL_DESTINATION, RTF_INFO}, + {"insrsid", CONTROL_VALUE, RTF_INSRSID}, + {"intbl", CONTROL_FLAG, RTF_INTBL}, + {"ipgp", CONTROL_VALUE, RTF_IPGP}, + {"irowband", CONTROL_VALUE, RTF_IROWBAND}, + {"irow", CONTROL_VALUE, RTF_IROW}, + {"itap", CONTROL_VALUE, RTF_ITAP}, + {"ixe", CONTROL_FLAG, RTF_IXE}, + {"jcompress", CONTROL_FLAG, RTF_JCOMPRESS}, + {"jexpand", CONTROL_FLAG, RTF_JEXPAND}, + {"jis", CONTROL_FLAG, RTF_JIS}, + {"jpegblip", CONTROL_FLAG, RTF_JPEGBLIP}, + {"jsksu", CONTROL_FLAG, RTF_JSKSU}, + {"keep", CONTROL_FLAG, RTF_KEEP}, + {"keepn", CONTROL_FLAG, RTF_KEEPN}, + {"kerning", CONTROL_VALUE, RTF_KERNING}, + {"keycode", CONTROL_DESTINATION, RTF_KEYCODE}, + {"keywords", CONTROL_DESTINATION, RTF_KEYWORDS}, + {"krnprsnet", CONTROL_FLAG, RTF_KRNPRSNET}, + {"ksulang", CONTROL_VALUE, RTF_KSULANG}, + {"jclisttab", CONTROL_FLAG, RTF_JCLISTTAB}, + {"landscape", CONTROL_FLAG, RTF_LANDSCAPE}, + {"lang", CONTROL_VALUE, RTF_LANG}, + {"langfe", CONTROL_VALUE, RTF_LANGFE}, + {"langfenp", CONTROL_VALUE, RTF_LANGFENP}, + {"langnp", CONTROL_VALUE, RTF_LANGNP}, + {"lastrow", CONTROL_FLAG, RTF_LASTROW}, + {"latentstyles", CONTROL_DESTINATION, RTF_LATENTSTYLES}, + {"lbr", CONTROL_VALUE, RTF_LBR}, + {"lchars", CONTROL_DESTINATION, RTF_LCHARS}, + {"ldblquote", CONTROL_SYMBOL, RTF_LDBLQUOTE}, + {"level", CONTROL_VALUE, RTF_LEVEL}, + {"levelfollow", CONTROL_VALUE, RTF_LEVELFOLLOW}, + {"levelindent", CONTROL_VALUE, RTF_LEVELINDENT}, + {"leveljc", CONTROL_VALUE, RTF_LEVELJC}, + {"leveljcn", CONTROL_VALUE, RTF_LEVELJCN}, + {"levellegal", CONTROL_VALUE, RTF_LEVELLEGAL}, + {"levelnfc", CONTROL_VALUE, RTF_LEVELNFC}, + {"levelnfcn", CONTROL_VALUE, RTF_LEVELNFCN}, + {"levelnorestart", CONTROL_VALUE, RTF_LEVELNORESTART}, + {"levelnumbers", CONTROL_DESTINATION, RTF_LEVELNUMBERS}, + {"levelold", CONTROL_VALUE, RTF_LEVELOLD}, + {"levelpicture", CONTROL_VALUE, RTF_LEVELPICTURE}, + {"levelpicturenosize", CONTROL_FLAG, RTF_LEVELPICTURENOSIZE}, + {"levelprev", CONTROL_VALUE, RTF_LEVELPREV}, + {"levelprevspace", CONTROL_VALUE, RTF_LEVELPREVSPACE}, + {"levelspace", CONTROL_VALUE, RTF_LEVELSPACE}, + {"levelstartat", CONTROL_VALUE, RTF_LEVELSTARTAT}, + {"leveltemplateid", CONTROL_VALUE, RTF_LEVELTEMPLATEID}, + {"leveltext", CONTROL_DESTINATION, RTF_LEVELTEXT}, + {"lfolevel", CONTROL_DESTINATION, RTF_LFOLEVEL}, + {"li", CONTROL_VALUE, RTF_LI}, + {"line", CONTROL_SYMBOL, RTF_LINE}, + {"linebetcol", CONTROL_FLAG, RTF_LINEBETCOL}, + {"linecont", CONTROL_FLAG, RTF_LINECONT}, + {"linemod", CONTROL_VALUE, RTF_LINEMOD}, + {"lineppage", CONTROL_FLAG, RTF_LINEPPAGE}, + {"linerestart", CONTROL_FLAG, RTF_LINERESTART}, + {"linestart", CONTROL_VALUE, RTF_LINESTART}, + {"linestarts", CONTROL_VALUE, RTF_LINESTARTS}, + {"linex", CONTROL_VALUE, RTF_LINEX}, + {"linkself", CONTROL_FLAG, RTF_LINKSELF}, + {"linkstyles", CONTROL_FLAG, RTF_LINKSTYLES}, + {"linkval", CONTROL_DESTINATION, RTF_LINKVAL}, + {"lin", CONTROL_VALUE, RTF_LIN}, + {"lisa", CONTROL_VALUE, RTF_LISA}, + {"lisb", CONTROL_VALUE, RTF_LISB}, + {"list", CONTROL_DESTINATION, RTF_LIST}, + {"listhybrid", CONTROL_FLAG, RTF_LISTHYBRID}, + {"listid", CONTROL_VALUE, RTF_LISTID}, + {"listlevel", CONTROL_DESTINATION, RTF_LISTLEVEL}, + {"listname", CONTROL_DESTINATION, RTF_LISTNAME}, + {"listoverride", CONTROL_DESTINATION, RTF_LISTOVERRIDE}, + {"listoverridecount", CONTROL_VALUE, RTF_LISTOVERRIDECOUNT}, + {"listoverrideformat", CONTROL_VALUE, RTF_LISTOVERRIDEFORMAT}, + {"listoverridestartat", CONTROL_FLAG, RTF_LISTOVERRIDESTARTAT}, + {"listoverridetable", CONTROL_DESTINATION, RTF_LISTOVERRIDETABLE}, + {"listpicture", CONTROL_DESTINATION, RTF_LISTPICTURE}, + {"listrestarthdn", CONTROL_VALUE, RTF_LISTRESTARTHDN}, + {"listsimple", CONTROL_VALUE, RTF_LISTSIMPLE}, + {"liststyleid", CONTROL_VALUE, RTF_LISTSTYLEID}, + {"liststylename", CONTROL_DESTINATION, RTF_LISTSTYLENAME}, + {"listtable", CONTROL_DESTINATION, RTF_LISTTABLE}, + {"listtemplateid", CONTROL_VALUE, RTF_LISTTEMPLATEID}, + {"listtext", CONTROL_DESTINATION, RTF_LISTTEXT}, + {"lnbrkrule", CONTROL_FLAG, RTF_LNBRKRULE}, + {"lndscpsxn", CONTROL_FLAG, RTF_LNDSCPSXN}, + {"lnongrid", CONTROL_FLAG, RTF_LNONGRID}, + {"loch", CONTROL_FLAG, RTF_LOCH}, + {"lquote", CONTROL_SYMBOL, RTF_LQUOTE}, + {"ls", CONTROL_VALUE, RTF_LS}, + {"lsdlocked", CONTROL_VALUE, RTF_LSDLOCKED}, + {"lsdlockeddef", CONTROL_VALUE, RTF_LSDLOCKEDDEF}, + {"lsdlockedexcept", CONTROL_DESTINATION, RTF_LSDLOCKEDEXCEPT}, + {"lsdpriority", CONTROL_VALUE, RTF_LSDPRIORITY}, + {"lsdprioritydef", CONTROL_VALUE, RTF_LSDPRIORITYDEF}, + {"lsdqformat", CONTROL_VALUE, RTF_LSDQFORMAT}, + {"lsdqformatdef", CONTROL_VALUE, RTF_LSDQFORMATDEF}, + {"lsdsemihidden", CONTROL_VALUE, RTF_LSDSEMIHIDDEN}, + {"lsdsemihiddendef", CONTROL_VALUE, RTF_LSDSEMIHIDDENDEF}, + {"lsdstimax", CONTROL_VALUE, RTF_LSDSTIMAX}, + {"lsdunhideused", CONTROL_VALUE, RTF_LSDUNHIDEUSED}, + {"lsdunhideuseddef", CONTROL_VALUE, RTF_LSDUNHIDEUSEDDEF}, + {"ltrch", CONTROL_FLAG, RTF_LTRCH}, + {"ltrdoc", CONTROL_FLAG, RTF_LTRDOC}, + {"ltrmark", CONTROL_SYMBOL, RTF_LTRMARK}, + {"ltrpar", CONTROL_FLAG, RTF_LTRPAR}, + {"ltrrow", CONTROL_FLAG, RTF_LTRROW}, + {"ltrsect", CONTROL_FLAG, RTF_LTRSECT}, + {"lvltentative", CONTROL_FLAG, RTF_LVLTENTATIVE}, + {"lytcalctblwd", CONTROL_FLAG, RTF_LYTCALCTBLWD}, + {"lytexcttp", CONTROL_FLAG, RTF_LYTEXCTTP}, + {"lytprtmet", CONTROL_FLAG, RTF_LYTPRTMET}, + {"lyttblrtgr", CONTROL_FLAG, RTF_LYTTBLRTGR}, + {"mac", CONTROL_FLAG, RTF_MAC}, + {"macc", CONTROL_DESTINATION, RTF_MACC}, + {"maccPr", CONTROL_DESTINATION, RTF_MACCPR}, + {"macpict", CONTROL_FLAG, RTF_MACPICT}, + {"mailmerge", CONTROL_DESTINATION, RTF_MAILMERGE}, + {"makebackup", CONTROL_FLAG, RTF_MAKEBACKUP}, + {"maln", CONTROL_DESTINATION, RTF_MALN}, + {"malnScr", CONTROL_DESTINATION, RTF_MALNSCR}, + {"manager", CONTROL_DESTINATION, RTF_MANAGER}, + {"margb", CONTROL_VALUE, RTF_MARGB}, + {"margbsxn", CONTROL_VALUE, RTF_MARGBSXN}, + {"margl", CONTROL_VALUE, RTF_MARGL}, + {"marglsxn", CONTROL_VALUE, RTF_MARGLSXN}, + {"margmirror", CONTROL_FLAG, RTF_MARGMIRROR}, + {"margmirsxn", CONTROL_FLAG, RTF_MARGMIRSXN}, + {"margPr", CONTROL_DESTINATION, RTF_MARGPR}, + {"margr", CONTROL_VALUE, RTF_MARGR}, + {"margrsxn", CONTROL_VALUE, RTF_MARGRSXN}, + {"margSz", CONTROL_VALUE, RTF_MARGSZ}, + {"margt", CONTROL_VALUE, RTF_MARGT}, + {"margtsxn", CONTROL_VALUE, RTF_MARGTSXN}, + {"mbar", CONTROL_DESTINATION, RTF_MBAR}, + {"mbarPr", CONTROL_DESTINATION, RTF_MBARPR}, + {"mbaseJc", CONTROL_DESTINATION, RTF_MBASEJC}, + {"mbegChr", CONTROL_DESTINATION, RTF_MBEGCHR}, + {"mborderBox", CONTROL_DESTINATION, RTF_MBORDERBOX}, + {"mborderBoxPr", CONTROL_DESTINATION, RTF_MBORDERBOXPR}, + {"mbox", CONTROL_DESTINATION, RTF_MBOX}, + {"mboxPr", CONTROL_DESTINATION, RTF_MBOXPR}, + {"mbrk", CONTROL_VALUE, RTF_MBRK}, + {"mbrkBin", CONTROL_VALUE, RTF_MBRKBIN}, + {"mbrkBinSub", CONTROL_VALUE, RTF_MBRKBINSUB}, + {"mcGp", CONTROL_VALUE, RTF_MCGP}, + {"mcGpRule", CONTROL_VALUE, RTF_MCGPRULE}, + {"mchr", CONTROL_DESTINATION, RTF_MCHR}, + {"mcount", CONTROL_DESTINATION, RTF_MCOUNT}, + {"mcSp", CONTROL_VALUE, RTF_MCSP}, + {"mctrlPr", CONTROL_DESTINATION, RTF_MCTRLPR}, + {"md", CONTROL_DESTINATION, RTF_MD}, + {"mdefJc", CONTROL_VALUE, RTF_MDEFJC}, + {"mdeg", CONTROL_DESTINATION, RTF_MDEG}, + {"mdegHide", CONTROL_DESTINATION, RTF_MDEGHIDE}, + {"mden", CONTROL_DESTINATION, RTF_MDEN}, + {"mdiff", CONTROL_DESTINATION, RTF_MDIFF}, + {"mdiffSty", CONTROL_VALUE, RTF_MDIFFSTY}, + {"mdispdef", CONTROL_VALUE, RTF_MDISPDEF}, + {"mdPr", CONTROL_DESTINATION, RTF_MDPR}, + {"me", CONTROL_DESTINATION, RTF_ME}, + {"mendChr", CONTROL_DESTINATION, RTF_MENDCHR}, + {"meqArr", CONTROL_DESTINATION, RTF_MEQARR}, + {"meqArrPr", CONTROL_DESTINATION, RTF_MEQARRPR}, + {"mf", CONTROL_DESTINATION, RTF_MF}, + {"mfName", CONTROL_DESTINATION, RTF_MFNAME}, + {"mfPr", CONTROL_DESTINATION, RTF_MFPR}, + {"mfunc", CONTROL_DESTINATION, RTF_MFUNC}, + {"mfuncPr", CONTROL_DESTINATION, RTF_MFUNCPR}, + {"mgroupChr", CONTROL_DESTINATION, RTF_MGROUPCHR}, + {"mgroupChrPr", CONTROL_DESTINATION, RTF_MGROUPCHRPR}, + {"mgrow", CONTROL_DESTINATION, RTF_MGROW}, + {"mhideBot", CONTROL_DESTINATION, RTF_MHIDEBOT}, + {"mhideLeft", CONTROL_DESTINATION, RTF_MHIDELEFT}, + {"mhideRight", CONTROL_DESTINATION, RTF_MHIDERIGHT}, + {"mhideTop", CONTROL_DESTINATION, RTF_MHIDETOP}, + {"mhtmltag", CONTROL_DESTINATION, RTF_MHTMLTAG}, + {"min", CONTROL_VALUE, RTF_MIN}, + {"minterSp", CONTROL_VALUE, RTF_MINTERSP}, + {"mintLim", CONTROL_VALUE, RTF_MINTLIM}, + {"mintraSp", CONTROL_VALUE, RTF_MINTRASP}, + {"mjc", CONTROL_VALUE, RTF_MJC}, + {"mlim", CONTROL_DESTINATION, RTF_MLIM}, + {"mlimloc", CONTROL_DESTINATION, RTF_MLIMLOC}, + {"mlimlow", CONTROL_DESTINATION, RTF_MLIMLOW}, + {"mlimlowPr", CONTROL_DESTINATION, RTF_MLIMLOWPR}, + {"mlimupp", CONTROL_DESTINATION, RTF_MLIMUPP}, + {"mlimuppPr", CONTROL_DESTINATION, RTF_MLIMUPPPR}, + {"mlit", CONTROL_FLAG, RTF_MLIT}, + {"mlMargin", CONTROL_VALUE, RTF_MLMARGIN}, + {"mm", CONTROL_DESTINATION, RTF_MM}, + {"mmaddfieldname", CONTROL_DESTINATION, RTF_MMADDFIELDNAME}, + {"mmath", CONTROL_DESTINATION, RTF_MMATH}, + {"mmathFont", CONTROL_VALUE, RTF_MMATHFONT}, + {"mmathPict", CONTROL_DESTINATION, RTF_MMATHPICT}, + {"mmathPr", CONTROL_DESTINATION, RTF_MMATHPR}, + {"mmattach", CONTROL_FLAG, RTF_MMATTACH}, + {"mmaxdist", CONTROL_DESTINATION, RTF_MMAXDIST}, + {"mmblanklines", CONTROL_FLAG, RTF_MMBLANKLINES}, + {"mmc", CONTROL_DESTINATION, RTF_MMC}, + {"mmcJc", CONTROL_DESTINATION, RTF_MMCJC}, + {"mmconnectstr", CONTROL_DESTINATION, RTF_MMCONNECTSTR}, + {"mmconnectstrdata", CONTROL_DESTINATION, RTF_MMCONNECTSTRDATA}, + {"mmcPr", CONTROL_DESTINATION, RTF_MMCPR}, + {"mmcs", CONTROL_DESTINATION, RTF_MMCS}, + {"mmdatasource", CONTROL_DESTINATION, RTF_MMDATASOURCE}, + {"mmdatatypeaccess", CONTROL_FLAG, RTF_MMDATATYPEACCESS}, + {"mmdatatypeexcel", CONTROL_FLAG, RTF_MMDATATYPEEXCEL}, + {"mmdatatypefile", CONTROL_FLAG, RTF_MMDATATYPEFILE}, + {"mmdatatypeodbc", CONTROL_FLAG, RTF_MMDATATYPEODBC}, + {"mmdatatypeodso", CONTROL_FLAG, RTF_MMDATATYPEODSO}, + {"mmdatatypeqt", CONTROL_FLAG, RTF_MMDATATYPEQT}, + {"mmdefaultsql", CONTROL_FLAG, RTF_MMDEFAULTSQL}, + {"mmdestemail", CONTROL_FLAG, RTF_MMDESTEMAIL}, + {"mmdestfax", CONTROL_FLAG, RTF_MMDESTFAX}, + {"mmdestnewdoc", CONTROL_FLAG, RTF_MMDESTNEWDOC}, + {"mmdestprinter", CONTROL_FLAG, RTF_MMDESTPRINTER}, + {"mmerrors", CONTROL_VALUE, RTF_MMERRORS}, + {"mmfttypeaddress", CONTROL_FLAG, RTF_MMFTTYPEADDRESS}, + {"mmfttypebarcode", CONTROL_FLAG, RTF_MMFTTYPEBARCODE}, + {"mmfttypedbcolumn", CONTROL_FLAG, RTF_MMFTTYPEDBCOLUMN}, + {"mmfttypemapped", CONTROL_FLAG, RTF_MMFTTYPEMAPPED}, + {"mmfttypenull", CONTROL_FLAG, RTF_MMFTTYPENULL}, + {"mmfttypesalutation", CONTROL_FLAG, RTF_MMFTTYPESALUTATION}, + {"mmheadersource", CONTROL_DESTINATION, RTF_MMHEADERSOURCE}, + {"mmjdsotype", CONTROL_VALUE, RTF_MMJDSOTYPE}, + {"mmlinktoquery", CONTROL_FLAG, RTF_MMLINKTOQUERY}, + {"mmmailsubject", CONTROL_DESTINATION, RTF_MMMAILSUBJECT}, + {"mmmaintypecatalog", CONTROL_FLAG, RTF_MMMAINTYPECATALOG}, + {"mmmaintypeemail", CONTROL_FLAG, RTF_MMMAINTYPEEMAIL}, + {"mmmaintypeenvelopes", CONTROL_FLAG, RTF_MMMAINTYPEENVELOPES}, + {"mmmaintypefax", CONTROL_FLAG, RTF_MMMAINTYPEFAX}, + {"mmmaintypelabels", CONTROL_FLAG, RTF_MMMAINTYPELABELS}, + {"mmmaintypeletters", CONTROL_FLAG, RTF_MMMAINTYPELETTERS}, + {"mmodso", CONTROL_DESTINATION, RTF_MMODSO}, + {"mmodsoactive", CONTROL_VALUE, RTF_MMODSOACTIVE}, + {"mmodsocoldelim", CONTROL_VALUE, RTF_MMODSOCOLDELIM}, + {"mmodsocolumn", CONTROL_VALUE, RTF_MMODSOCOLUMN}, + {"mmodsodynaddr", CONTROL_VALUE, RTF_MMODSODYNADDR}, + {"mmodsofhdr", CONTROL_VALUE, RTF_MMODSOFHDR}, + {"mmodsofilter", CONTROL_DESTINATION, RTF_MMODSOFILTER}, + {"mmodsofldmpdata", CONTROL_DESTINATION, RTF_MMODSOFLDMPDATA}, + {"mmodsofmcolumn", CONTROL_VALUE, RTF_MMODSOFMCOLUMN}, + {"mmodsohash", CONTROL_VALUE, RTF_MMODSOHASH}, + {"mmodsolid", CONTROL_VALUE, RTF_MMODSOLID}, + {"mmodsomappedname", CONTROL_DESTINATION, RTF_MMODSOMAPPEDNAME}, + {"mmodsoname", CONTROL_DESTINATION, RTF_MMODSONAME}, + {"mmodsorecipdata", CONTROL_DESTINATION, RTF_MMODSORECIPDATA}, + {"mmodsosort", CONTROL_DESTINATION, RTF_MMODSOSORT}, + {"mmodsosrc", CONTROL_DESTINATION, RTF_MMODSOSRC}, + {"mmodsotable", CONTROL_DESTINATION, RTF_MMODSOTABLE}, + {"mmodsoudl", CONTROL_DESTINATION, RTF_MMODSOUDL}, + {"mmodsoudldata", CONTROL_DESTINATION, RTF_MMODSOUDLDATA}, + {"mmodsouniquetag", CONTROL_DESTINATION, RTF_MMODSOUNIQUETAG}, + {"mmPr", CONTROL_DESTINATION, RTF_MMPR}, + {"mmquery", CONTROL_DESTINATION, RTF_MMQUERY}, + {"mmr", CONTROL_DESTINATION, RTF_MMR}, + {"mmreccur", CONTROL_VALUE, RTF_MMRECCUR}, + {"mmshowdata", CONTROL_FLAG, RTF_MMSHOWDATA}, + {"mnary", CONTROL_DESTINATION, RTF_MNARY}, + {"mnaryLim", CONTROL_VALUE, RTF_MNARYLIM}, + {"mnaryPr", CONTROL_DESTINATION, RTF_MNARYPR}, + {"mnoBreak", CONTROL_DESTINATION, RTF_MNOBREAK}, + {"mnor", CONTROL_FLAG, RTF_MNOR}, + {"mnum", CONTROL_DESTINATION, RTF_MNUM}, + {"mo", CONTROL_VALUE, RTF_MO}, + {"mobjDist", CONTROL_DESTINATION, RTF_MOBJDIST}, + {"moMath", CONTROL_DESTINATION, RTF_MOMATH}, + {"moMathPara", CONTROL_DESTINATION, RTF_MOMATHPARA}, + {"moMathParaPr", CONTROL_DESTINATION, RTF_MOMATHPARAPR}, + {"mopEmu", CONTROL_DESTINATION, RTF_MOPEMU}, + {"mphant", CONTROL_DESTINATION, RTF_MPHANT}, + {"mphantPr", CONTROL_DESTINATION, RTF_MPHANTPR}, + {"mplcHide", CONTROL_DESTINATION, RTF_MPLCHIDE}, + {"mpos", CONTROL_DESTINATION, RTF_MPOS}, + {"mpostSp", CONTROL_VALUE, RTF_MPOSTSP}, + {"mpreSp", CONTROL_VALUE, RTF_MPRESP}, + {"mr", CONTROL_DESTINATION, RTF_MR}, + {"mrad", CONTROL_DESTINATION, RTF_MRAD}, + {"mradPr", CONTROL_DESTINATION, RTF_MRADPR}, + {"mrMargin", CONTROL_VALUE, RTF_MRMARGIN}, + {"mrPr", CONTROL_DESTINATION, RTF_MRPR}, + {"mrSp", CONTROL_VALUE, RTF_MRSP}, + {"mrSpRule", CONTROL_VALUE, RTF_MRSPRULE}, + {"mscr", CONTROL_VALUE, RTF_MSCR}, + {"msepChr", CONTROL_DESTINATION, RTF_MSEPCHR}, + {"mshow", CONTROL_DESTINATION, RTF_MSHOW}, + {"mshp", CONTROL_DESTINATION, RTF_MSHP}, + {"msmallFrac", CONTROL_VALUE, RTF_MSMALLFRAC}, + {"msmcap", CONTROL_FLAG, RTF_MSMCAP}, + {"msPre", CONTROL_DESTINATION, RTF_MSPRE}, + {"msPrePr", CONTROL_DESTINATION, RTF_MSPREPR}, + {"msSub", CONTROL_DESTINATION, RTF_MSSUB}, + {"msSubPr", CONTROL_DESTINATION, RTF_MSSUBPR}, + {"msSubSup", CONTROL_DESTINATION, RTF_MSSUBSUP}, + {"msSubSupPr", CONTROL_DESTINATION, RTF_MSSUBSUPPR}, + {"msSup", CONTROL_DESTINATION, RTF_MSSUP}, + {"msSupPr", CONTROL_DESTINATION, RTF_MSSUPPR}, + {"mstrikeBLTR", CONTROL_DESTINATION, RTF_MSTRIKEBLTR}, + {"mstrikeH", CONTROL_DESTINATION, RTF_MSTRIKEH}, + {"mstrikeTLBR", CONTROL_DESTINATION, RTF_MSTRIKETLBR}, + {"mstrikeV", CONTROL_DESTINATION, RTF_MSTRIKEV}, + {"msty", CONTROL_VALUE, RTF_MSTY}, + {"msub", CONTROL_DESTINATION, RTF_MSUB}, + {"msubHide", CONTROL_DESTINATION, RTF_MSUBHIDE}, + {"msup", CONTROL_DESTINATION, RTF_MSUP}, + {"msupHide", CONTROL_DESTINATION, RTF_MSUPHIDE}, + {"mtransp", CONTROL_DESTINATION, RTF_MTRANSP}, + {"mtype", CONTROL_DESTINATION, RTF_MTYPE}, + {"muser", CONTROL_FLAG, RTF_MUSER}, + {"mvauth", CONTROL_VALUE, RTF_MVAUTH}, + {"mvdate", CONTROL_VALUE, RTF_MVDATE}, + {"mvertJc", CONTROL_DESTINATION, RTF_MVERTJC}, + {"mvf", CONTROL_FLAG, RTF_MVF}, + {"mvfmf", CONTROL_DESTINATION, RTF_MVFMF}, + {"mvfml", CONTROL_DESTINATION, RTF_MVFML}, + {"mvt", CONTROL_FLAG, RTF_MVT}, + {"mvtof", CONTROL_DESTINATION, RTF_MVTOF}, + {"mvtol", CONTROL_DESTINATION, RTF_MVTOL}, + {"mwrapIndent", CONTROL_VALUE, RTF_MWRAPINDENT}, + {"mwrapRight", CONTROL_VALUE, RTF_MWRAPRIGHT}, + {"mzeroAsc", CONTROL_DESTINATION, RTF_MZEROASC}, + {"mzeroDesc", CONTROL_DESTINATION, RTF_MZERODESC}, + {"mzeroWid", CONTROL_DESTINATION, RTF_MZEROWID}, + {"nestcell", CONTROL_SYMBOL, RTF_NESTCELL}, + {"nestrow", CONTROL_SYMBOL, RTF_NESTROW}, + {"nesttableprops", CONTROL_DESTINATION, RTF_NESTTABLEPROPS}, + {"newtblstyruls", CONTROL_FLAG, RTF_NEWTBLSTYRULS}, + {"nextfile", CONTROL_DESTINATION, RTF_NEXTFILE}, + {"noafcnsttbl", CONTROL_FLAG, RTF_NOAFCNSTTBL}, + {"nobrkwrptbl", CONTROL_FLAG, RTF_NOBRKWRPTBL}, + {"nocolbal", CONTROL_FLAG, RTF_NOCOLBAL}, + {"nocompatoptions", CONTROL_FLAG, RTF_NOCOMPATOPTIONS}, + {"nocwrap", CONTROL_FLAG, RTF_NOCWRAP}, + {"nocxsptable", CONTROL_FLAG, RTF_NOCXSPTABLE}, + {"noextrasprl", CONTROL_FLAG, RTF_NOEXTRASPRL}, + {"nofchars", CONTROL_VALUE, RTF_NOFCHARS}, + {"nofcharsws", CONTROL_VALUE, RTF_NOFCHARSWS}, + {"nofeaturethrottle", CONTROL_FLAG, RTF_NOFEATURETHROTTLE}, + {"nofpages", CONTROL_VALUE, RTF_NOFPAGES}, + {"nofwords", CONTROL_VALUE, RTF_NOFWORDS}, + {"nogrowautofit", CONTROL_FLAG, RTF_NOGROWAUTOFIT}, + {"noindnmbrts", CONTROL_FLAG, RTF_NOINDNMBRTS}, + {"nojkernpunct", CONTROL_FLAG, RTF_NOJKERNPUNCT}, + {"nolead", CONTROL_FLAG, RTF_NOLEAD}, + {"noline", CONTROL_FLAG, RTF_NOLINE}, + {"nolnhtadjtbl", CONTROL_FLAG, RTF_NOLNHTADJTBL}, + {"nonesttables", CONTROL_DESTINATION, RTF_NONESTTABLES}, + {"nonshppict", CONTROL_FLAG, RTF_NONSHPPICT}, + {"nooverflow", CONTROL_FLAG, RTF_NOOVERFLOW}, + {"noproof", CONTROL_FLAG, RTF_NOPROOF}, + {"noqfpromote", CONTROL_FLAG, RTF_NOQFPROMOTE}, + {"nosectexpand", CONTROL_FLAG, RTF_NOSECTEXPAND}, + {"nosnaplinegrid", CONTROL_FLAG, RTF_NOSNAPLINEGRID}, + {"nospaceforul", CONTROL_FLAG, RTF_NOSPACEFORUL}, + {"nosupersub", CONTROL_FLAG, RTF_NOSUPERSUB}, + {"notabind", CONTROL_FLAG, RTF_NOTABIND}, + {"notbrkcnstfrctbl", CONTROL_FLAG, RTF_NOTBRKCNSTFRCTBL}, + {"notcvasp", CONTROL_FLAG, RTF_NOTCVASP}, + {"notvatxbx", CONTROL_FLAG, RTF_NOTVATXBX}, + {"nouicompat", CONTROL_FLAG, RTF_NOUICOMPAT}, + {"noultrlspc", CONTROL_FLAG, RTF_NOULTRLSPC}, + {"nowidctlpar", CONTROL_FLAG, RTF_NOWIDCTLPAR}, + {"nowrap", CONTROL_FLAG, RTF_NOWRAP}, + {"nowwrap", CONTROL_FLAG, RTF_NOWWRAP}, + {"noxlattoyen", CONTROL_FLAG, RTF_NOXLATTOYEN}, + {"objalias", CONTROL_DESTINATION, RTF_OBJALIAS}, + {"objalign", CONTROL_VALUE, RTF_OBJALIGN}, + {"objattph", CONTROL_FLAG, RTF_OBJATTPH}, + {"objautlink", CONTROL_FLAG, RTF_OBJAUTLINK}, + {"objclass", CONTROL_DESTINATION, RTF_OBJCLASS}, + {"objcropb", CONTROL_VALUE, RTF_OBJCROPB}, + {"objcropl", CONTROL_VALUE, RTF_OBJCROPL}, + {"objcropr", CONTROL_VALUE, RTF_OBJCROPR}, + {"objcropt", CONTROL_VALUE, RTF_OBJCROPT}, + {"objdata", CONTROL_DESTINATION, RTF_OBJDATA}, + {"object", CONTROL_DESTINATION, RTF_OBJECT}, + {"objemb", CONTROL_FLAG, RTF_OBJEMB}, + {"objh", CONTROL_VALUE, RTF_OBJH}, + {"objhtml", CONTROL_FLAG, RTF_OBJHTML}, + {"objicemb", CONTROL_FLAG, RTF_OBJICEMB}, + {"objlink", CONTROL_FLAG, RTF_OBJLINK}, + {"objlock", CONTROL_FLAG, RTF_OBJLOCK}, + {"objname", CONTROL_DESTINATION, RTF_OBJNAME}, + {"objocx", CONTROL_FLAG, RTF_OBJOCX}, + {"objpub", CONTROL_FLAG, RTF_OBJPUB}, + {"objscalex", CONTROL_VALUE, RTF_OBJSCALEX}, + {"objscaley", CONTROL_VALUE, RTF_OBJSCALEY}, + {"objsect", CONTROL_DESTINATION, RTF_OBJSECT}, + {"objsetsize", CONTROL_FLAG, RTF_OBJSETSIZE}, + {"objsub", CONTROL_FLAG, RTF_OBJSUB}, + {"objtime", CONTROL_DESTINATION, RTF_OBJTIME}, + {"objtransy", CONTROL_VALUE, RTF_OBJTRANSY}, + {"objupdate", CONTROL_FLAG, RTF_OBJUPDATE}, + {"objw", CONTROL_VALUE, RTF_OBJW}, + {"ogutter", CONTROL_VALUE, RTF_OGUTTER}, + {"oldas", CONTROL_FLAG, RTF_OLDAS}, + {"oldcprops", CONTROL_DESTINATION, RTF_OLDCPROPS}, + {"oldlinewrap", CONTROL_FLAG, RTF_OLDLINEWRAP}, + {"oldpprops", CONTROL_DESTINATION, RTF_OLDPPROPS}, + {"oldsprops", CONTROL_DESTINATION, RTF_OLDSPROPS}, + {"oldtprops", CONTROL_DESTINATION, RTF_OLDTPROPS}, + {"oleclsid", CONTROL_DESTINATION, RTF_OLECLSID}, + {"operator", CONTROL_DESTINATION, RTF_OPERATOR}, + {"otblrul", CONTROL_FLAG, RTF_OTBLRUL}, + {"outl", CONTROL_TOGGLE, RTF_OUTL}, + {"outlinelevel", CONTROL_VALUE, RTF_OUTLINELEVEL}, + {"overlay", CONTROL_FLAG, RTF_OVERLAY}, + {"page", CONTROL_SYMBOL, RTF_PAGE}, + {"pagebb", CONTROL_FLAG, RTF_PAGEBB}, + {"panose", CONTROL_DESTINATION, RTF_PANOSE}, + {"paperh", CONTROL_VALUE, RTF_PAPERH}, + {"paperw", CONTROL_VALUE, RTF_PAPERW}, + {"par", CONTROL_SYMBOL, RTF_PAR}, + {"pararsid", CONTROL_VALUE, RTF_PARARSID}, + {"pard", CONTROL_FLAG, RTF_PARD}, + {"password", CONTROL_DESTINATION, RTF_PASSWORD}, + {"passwordhash", CONTROL_DESTINATION, RTF_PASSWORDHASH}, + {"pc", CONTROL_FLAG, RTF_PC}, + {"pca", CONTROL_FLAG, RTF_PCA}, + {"pgbrdrb", CONTROL_FLAG, RTF_PGBRDRB}, + {"pgbrdrfoot", CONTROL_FLAG, RTF_PGBRDRFOOT}, + {"pgbrdrhead", CONTROL_FLAG, RTF_PGBRDRHEAD}, + {"pgbrdrl", CONTROL_FLAG, RTF_PGBRDRL}, + {"pgbrdropt", CONTROL_VALUE, RTF_PGBRDROPT}, + {"pgbrdrr", CONTROL_FLAG, RTF_PGBRDRR}, + {"pgbrdrsnap", CONTROL_FLAG, RTF_PGBRDRSNAP}, + {"pgbrdrt", CONTROL_FLAG, RTF_PGBRDRT}, + {"pghsxn", CONTROL_VALUE, RTF_PGHSXN}, + {"pgnbidia", CONTROL_FLAG, RTF_PGNBIDIA}, + {"pgnbidib", CONTROL_FLAG, RTF_PGNBIDIB}, + {"pgnchosung", CONTROL_FLAG, RTF_PGNCHOSUNG}, + {"pgncnum", CONTROL_FLAG, RTF_PGNCNUM}, + {"pgncont", CONTROL_FLAG, RTF_PGNCONT}, + {"pgndbnum", CONTROL_FLAG, RTF_PGNDBNUM}, + {"pgndbnumd", CONTROL_FLAG, RTF_PGNDBNUMD}, + {"pgndbnumk", CONTROL_FLAG, RTF_PGNDBNUMK}, + {"pgndbnumt", CONTROL_FLAG, RTF_PGNDBNUMT}, + {"pgndec", CONTROL_FLAG, RTF_PGNDEC}, + {"pgndecd", CONTROL_FLAG, RTF_PGNDECD}, + {"pgnganada", CONTROL_FLAG, RTF_PGNGANADA}, + {"pgngbnum", CONTROL_FLAG, RTF_PGNGBNUM}, + {"pgngbnumd", CONTROL_FLAG, RTF_PGNGBNUMD}, + {"pgngbnumk", CONTROL_FLAG, RTF_PGNGBNUMK}, + {"pgngbnuml", CONTROL_FLAG, RTF_PGNGBNUML}, + {"pgnhindia", CONTROL_FLAG, RTF_PGNHINDIA}, + {"pgnhindib", CONTROL_FLAG, RTF_PGNHINDIB}, + {"pgnhindic", CONTROL_FLAG, RTF_PGNHINDIC}, + {"pgnhindid", CONTROL_FLAG, RTF_PGNHINDID}, + {"pgnhn", CONTROL_VALUE, RTF_PGNHN}, + {"pgnhnsc", CONTROL_FLAG, RTF_PGNHNSC}, + {"pgnhnsh", CONTROL_FLAG, RTF_PGNHNSH}, + {"pgnhnsm", CONTROL_FLAG, RTF_PGNHNSM}, + {"pgnhnsn", CONTROL_FLAG, RTF_PGNHNSN}, + {"pgnhnsp", CONTROL_FLAG, RTF_PGNHNSP}, + {"pgnid", CONTROL_FLAG, RTF_PGNID}, + {"pgnlcltr", CONTROL_FLAG, RTF_PGNLCLTR}, + {"pgnlcrm", CONTROL_FLAG, RTF_PGNLCRM}, + {"pgnrestart", CONTROL_FLAG, RTF_PGNRESTART}, + {"pgnstart", CONTROL_VALUE, RTF_PGNSTART}, + {"pgnstarts", CONTROL_VALUE, RTF_PGNSTARTS}, + {"pgnthaia", CONTROL_FLAG, RTF_PGNTHAIA}, + {"pgnthaib", CONTROL_FLAG, RTF_PGNTHAIB}, + {"pgnthaic", CONTROL_FLAG, RTF_PGNTHAIC}, + {"pgnucltr", CONTROL_FLAG, RTF_PGNUCLTR}, + {"pgnucrm", CONTROL_FLAG, RTF_PGNUCRM}, + {"pgnvieta", CONTROL_FLAG, RTF_PGNVIETA}, + {"pgnx", CONTROL_VALUE, RTF_PGNX}, + {"pgny", CONTROL_VALUE, RTF_PGNY}, + {"pgnzodiac", CONTROL_FLAG, RTF_PGNZODIAC}, + {"pgnzodiacd", CONTROL_FLAG, RTF_PGNZODIACD}, + {"pgnzodiacl", CONTROL_FLAG, RTF_PGNZODIACL}, + {"pgp", CONTROL_DESTINATION, RTF_PGP}, + {"pgptbl", CONTROL_DESTINATION, RTF_PGPTBL}, + {"pgwsxn", CONTROL_VALUE, RTF_PGWSXN}, + {"phcol", CONTROL_FLAG, RTF_PHCOL}, + {"phmrg", CONTROL_FLAG, RTF_PHMRG}, + {"phpg", CONTROL_FLAG, RTF_PHPG}, + {"picbmp", CONTROL_FLAG, RTF_PICBMP}, + {"picbpp", CONTROL_VALUE, RTF_PICBPP}, + {"piccropb", CONTROL_VALUE, RTF_PICCROPB}, + {"piccropl", CONTROL_VALUE, RTF_PICCROPL}, + {"piccropr", CONTROL_VALUE, RTF_PICCROPR}, + {"piccropt", CONTROL_VALUE, RTF_PICCROPT}, + {"pich", CONTROL_VALUE, RTF_PICH}, + {"pichgoal", CONTROL_VALUE, RTF_PICHGOAL}, + {"picprop", CONTROL_DESTINATION, RTF_PICPROP}, + {"picscaled", CONTROL_FLAG, RTF_PICSCALED}, + {"picscalex", CONTROL_VALUE, RTF_PICSCALEX}, + {"picscaley", CONTROL_VALUE, RTF_PICSCALEY}, + {"pict", CONTROL_DESTINATION, RTF_PICT}, + {"picw", CONTROL_VALUE, RTF_PICW}, + {"picwgoal", CONTROL_VALUE, RTF_PICWGOAL}, + {"pindtabqc", CONTROL_FLAG, RTF_PINDTABQC}, + {"pindtabql", CONTROL_FLAG, RTF_PINDTABQL}, + {"pindtabqr", CONTROL_FLAG, RTF_PINDTABQR}, + {"plain", CONTROL_FLAG, RTF_PLAIN}, + {"pmartabqc", CONTROL_FLAG, RTF_PMARTABQC}, + {"pmartabql", CONTROL_FLAG, RTF_PMARTABQL}, + {"pmartabqr", CONTROL_FLAG, RTF_PMARTABQR}, + {"pmmetafile", CONTROL_VALUE, RTF_PMMETAFILE}, + {"pn", CONTROL_DESTINATION, RTF_PN}, + {"pnacross", CONTROL_FLAG, RTF_PNACROSS}, + {"pnaiu", CONTROL_FLAG, RTF_PNAIU}, + {"pnaiud", CONTROL_FLAG, RTF_PNAIUD}, + {"pnaiueo", CONTROL_FLAG, RTF_PNAIUEO}, + {"pnaiueod", CONTROL_FLAG, RTF_PNAIUEOD}, + {"pnb", CONTROL_TOGGLE, RTF_PNB}, + {"pnbidia", CONTROL_FLAG, RTF_PNBIDIA}, + {"pnbidib", CONTROL_FLAG, RTF_PNBIDIB}, + {"pncaps", CONTROL_TOGGLE, RTF_PNCAPS}, + {"pncard", CONTROL_FLAG, RTF_PNCARD}, + {"pncf", CONTROL_VALUE, RTF_PNCF}, + {"pnchosung", CONTROL_FLAG, RTF_PNCHOSUNG}, + {"pncnum", CONTROL_FLAG, RTF_PNCNUM}, + {"pndbnum", CONTROL_FLAG, RTF_PNDBNUM}, + {"pndbnumd", CONTROL_FLAG, RTF_PNDBNUMD}, + {"pndbnumk", CONTROL_FLAG, RTF_PNDBNUMK}, + {"pndbnuml", CONTROL_FLAG, RTF_PNDBNUML}, + {"pndbnumt", CONTROL_FLAG, RTF_PNDBNUMT}, + {"pndec", CONTROL_FLAG, RTF_PNDEC}, + {"pndecd", CONTROL_FLAG, RTF_PNDECD}, + {"pnf", CONTROL_VALUE, RTF_PNF}, + {"pnfs", CONTROL_VALUE, RTF_PNFS}, + {"pnganada", CONTROL_FLAG, RTF_PNGANADA}, + {"pngblip", CONTROL_FLAG, RTF_PNGBLIP}, + {"pngbnum", CONTROL_FLAG, RTF_PNGBNUM}, + {"pngbnumd", CONTROL_FLAG, RTF_PNGBNUMD}, + {"pngbnumk", CONTROL_FLAG, RTF_PNGBNUMK}, + {"pngbnuml", CONTROL_FLAG, RTF_PNGBNUML}, + {"pnhang", CONTROL_FLAG, RTF_PNHANG}, + {"pni", CONTROL_TOGGLE, RTF_PNI}, + {"pnindent", CONTROL_VALUE, RTF_PNINDENT}, + {"pniroha", CONTROL_FLAG, RTF_PNIROHA}, + {"pnirohad", CONTROL_FLAG, RTF_PNIROHAD}, + {"pnlcltr", CONTROL_FLAG, RTF_PNLCLTR}, + {"pnlcrm", CONTROL_FLAG, RTF_PNLCRM}, + {"pnlvl", CONTROL_VALUE, RTF_PNLVL}, + {"pnlvlblt", CONTROL_FLAG, RTF_PNLVLBLT}, + {"pnlvlbody", CONTROL_FLAG, RTF_PNLVLBODY}, + {"pnlvlcont", CONTROL_FLAG, RTF_PNLVLCONT}, + {"pnnumonce", CONTROL_FLAG, RTF_PNNUMONCE}, + {"pnord", CONTROL_FLAG, RTF_PNORD}, + {"pnordt", CONTROL_FLAG, RTF_PNORDT}, + {"pnprev", CONTROL_FLAG, RTF_PNPREV}, + {"pnqc", CONTROL_FLAG, RTF_PNQC}, + {"pnql", CONTROL_FLAG, RTF_PNQL}, + {"pnqr", CONTROL_FLAG, RTF_PNQR}, + {"pnrauth", CONTROL_VALUE, RTF_PNRAUTH}, + {"pnrdate", CONTROL_VALUE, RTF_PNRDATE}, + {"pnrestart", CONTROL_FLAG, RTF_PNRESTART}, + {"pnrnfc", CONTROL_VALUE, RTF_PNRNFC}, + {"pnrnot", CONTROL_FLAG, RTF_PNRNOT}, + {"pnrpnbr", CONTROL_VALUE, RTF_PNRPNBR}, + {"pnrrgb", CONTROL_VALUE, RTF_PNRRGB}, + {"pnrstart", CONTROL_VALUE, RTF_PNRSTART}, + {"pnrstop", CONTROL_VALUE, RTF_PNRSTOP}, + {"pnrxst", CONTROL_VALUE, RTF_PNRXST}, + {"pnscaps", CONTROL_TOGGLE, RTF_PNSCAPS}, + {"pnseclvl", CONTROL_DESTINATION, RTF_PNSECLVL}, + {"pnsp", CONTROL_VALUE, RTF_PNSP}, + {"pnstart", CONTROL_VALUE, RTF_PNSTART}, + {"pnstrike", CONTROL_TOGGLE, RTF_PNSTRIKE}, + {"pntext", CONTROL_DESTINATION, RTF_PNTEXT}, + {"pntxta", CONTROL_DESTINATION, RTF_PNTXTA}, + {"pntxtb", CONTROL_DESTINATION, RTF_PNTXTB}, + {"pnucltr", CONTROL_FLAG, RTF_PNUCLTR}, + {"pnucrm", CONTROL_FLAG, RTF_PNUCRM}, + {"pnul", CONTROL_TOGGLE, RTF_PNUL}, + {"pnuld", CONTROL_FLAG, RTF_PNULD}, + {"pnuldash", CONTROL_FLAG, RTF_PNULDASH}, + {"pnuldashd", CONTROL_FLAG, RTF_PNULDASHD}, + {"pnuldashdd", CONTROL_FLAG, RTF_PNULDASHDD}, + {"pnuldb", CONTROL_FLAG, RTF_PNULDB}, + {"pnulhair", CONTROL_FLAG, RTF_PNULHAIR}, + {"pnulnone", CONTROL_FLAG, RTF_PNULNONE}, + {"pnulth", CONTROL_FLAG, RTF_PNULTH}, + {"pnulw", CONTROL_FLAG, RTF_PNULW}, + {"pnulwave", CONTROL_FLAG, RTF_PNULWAVE}, + {"pnzodiac", CONTROL_FLAG, RTF_PNZODIAC}, + {"pnzodiacd", CONTROL_FLAG, RTF_PNZODIACD}, + {"pnzodiacl", CONTROL_FLAG, RTF_PNZODIACL}, + {"posnegx", CONTROL_VALUE, RTF_POSNEGX}, + {"posnegy", CONTROL_VALUE, RTF_POSNEGY}, + {"posx", CONTROL_VALUE, RTF_POSX}, + {"posxc", CONTROL_FLAG, RTF_POSXC}, + {"posxi", CONTROL_FLAG, RTF_POSXI}, + {"posxl", CONTROL_FLAG, RTF_POSXL}, + {"posxo", CONTROL_FLAG, RTF_POSXO}, + {"posxr", CONTROL_FLAG, RTF_POSXR}, + {"posy", CONTROL_VALUE, RTF_POSY}, + {"posyb", CONTROL_FLAG, RTF_POSYB}, + {"posyc", CONTROL_FLAG, RTF_POSYC}, + {"posyil", CONTROL_FLAG, RTF_POSYIL}, + {"posyin", CONTROL_FLAG, RTF_POSYIN}, + {"posyout", CONTROL_FLAG, RTF_POSYOUT}, + {"posyt", CONTROL_FLAG, RTF_POSYT}, + {"prauth", CONTROL_VALUE, RTF_PRAUTH}, + {"prcolbl", CONTROL_FLAG, RTF_PRCOLBL}, + {"prdate", CONTROL_VALUE, RTF_PRDATE}, + {"printdata", CONTROL_FLAG, RTF_PRINTDATA}, + {"printim", CONTROL_DESTINATION, RTF_PRINTIM}, + {"private", CONTROL_DESTINATION, RTF_PRIVATE}, + {"propname", CONTROL_DESTINATION, RTF_PROPNAME}, + {"proptype", CONTROL_VALUE, RTF_PROPTYPE}, + {"protect", CONTROL_TOGGLE, RTF_PROTECT}, + {"protend", CONTROL_DESTINATION, RTF_PROTEND}, + {"protlevel", CONTROL_VALUE, RTF_PROTLEVEL}, + {"protstart", CONTROL_DESTINATION, RTF_PROTSTART}, + {"protusertbl", CONTROL_DESTINATION, RTF_PROTUSERTBL}, + {"psover", CONTROL_FLAG, RTF_PSOVER}, + {"psz", CONTROL_VALUE, RTF_PSZ}, + {"ptabldot", CONTROL_FLAG, RTF_PTABLDOT}, + {"ptablmdot", CONTROL_FLAG, RTF_PTABLMDOT}, + {"ptablminus", CONTROL_FLAG, RTF_PTABLMINUS}, + {"ptablnone", CONTROL_FLAG, RTF_PTABLNONE}, + {"ptabluscore", CONTROL_FLAG, RTF_PTABLUSCORE}, + {"pubauto", CONTROL_FLAG, RTF_PUBAUTO}, + {"pvmrg", CONTROL_FLAG, RTF_PVMRG}, + {"pvpara", CONTROL_FLAG, RTF_PVPARA}, + {"pvpg", CONTROL_FLAG, RTF_PVPG}, + {"pwd", CONTROL_VALUE, RTF_PWD}, + {"pxe", CONTROL_DESTINATION, RTF_PXE}, + {"qc", CONTROL_FLAG, RTF_QC}, + {"qd", CONTROL_FLAG, RTF_QD}, + {"qj", CONTROL_FLAG, RTF_QJ}, + {"qk", CONTROL_VALUE, RTF_QK}, + {"ql", CONTROL_FLAG, RTF_QL}, + {"qmspace", CONTROL_SYMBOL, RTF_QMSPACE}, + {"qr", CONTROL_FLAG, RTF_QR}, + {"qt", CONTROL_FLAG, RTF_QT}, + {"rawclbgdkbdiag", CONTROL_FLAG, RTF_RAWCLBGDKBDIAG}, + {"rawclbgbdiag", CONTROL_FLAG, RTF_RAWCLBGBDIAG}, + {"rawclbgcross", CONTROL_FLAG, RTF_RAWCLBGCROSS}, + {"rawclbgdcross", CONTROL_FLAG, RTF_RAWCLBGDCROSS}, + {"rawclbgdkcross", CONTROL_FLAG, RTF_RAWCLBGDKCROSS}, + {"rawclbgdkdcross", CONTROL_FLAG, RTF_RAWCLBGDKDCROSS}, + {"rawclbgdkfdiag", CONTROL_FLAG, RTF_RAWCLBGDKFDIAG}, + {"rawclbgdkhor", CONTROL_FLAG, RTF_RAWCLBGDKHOR}, + {"rawclbgdkvert", CONTROL_FLAG, RTF_RAWCLBGDKVERT}, + {"rawclbgfdiag", CONTROL_FLAG, RTF_RAWCLBGFDIAG}, + {"rawclbghoriz", CONTROL_FLAG, RTF_RAWCLBGHORIZ}, + {"rawclbgvert", CONTROL_FLAG, RTF_RAWCLBGVERT}, + {"rdblquote", CONTROL_SYMBOL, RTF_RDBLQUOTE}, + {"readonlyrecommended", CONTROL_FLAG, RTF_READONLYRECOMMENDED}, + {"readprot", CONTROL_FLAG, RTF_READPROT}, + {"red", CONTROL_VALUE, RTF_RED}, + {"relyonvml", CONTROL_VALUE, RTF_RELYONVML}, + {"remdttm", CONTROL_FLAG, RTF_REMDTTM}, + {"rempersonalinfo", CONTROL_FLAG, RTF_REMPERSONALINFO}, + {"result", CONTROL_DESTINATION, RTF_RESULT}, + {"revauth", CONTROL_VALUE, RTF_REVAUTH}, + {"revauthdel", CONTROL_VALUE, RTF_REVAUTHDEL}, + {"revbar", CONTROL_VALUE, RTF_REVBAR}, + {"revdttm", CONTROL_VALUE, RTF_REVDTTM}, + {"revdttmdel", CONTROL_VALUE, RTF_REVDTTMDEL}, + {"revised", CONTROL_TOGGLE, RTF_REVISED}, + {"revisions", CONTROL_FLAG, RTF_REVISIONS}, + {"revprop", CONTROL_VALUE, RTF_REVPROP}, + {"revprot", CONTROL_FLAG, RTF_REVPROT}, + {"revtbl", CONTROL_DESTINATION, RTF_REVTBL}, + {"revtim", CONTROL_DESTINATION, RTF_REVTIM}, + {"ri", CONTROL_VALUE, RTF_RI}, + {"rin", CONTROL_VALUE, RTF_RIN}, + {"row", CONTROL_SYMBOL, RTF_ROW}, + {"rquote", CONTROL_SYMBOL, RTF_RQUOTE}, + {"rsid", CONTROL_VALUE, RTF_RSID}, + {"rsidroot", CONTROL_VALUE, RTF_RSIDROOT}, + {"rsidtbl", CONTROL_DESTINATION, RTF_RSIDTBL}, + {"rsltbmp", CONTROL_FLAG, RTF_RSLTBMP}, + {"rslthtml", CONTROL_FLAG, RTF_RSLTHTML}, + {"rsltmerge", CONTROL_FLAG, RTF_RSLTMERGE}, + {"rsltpict", CONTROL_FLAG, RTF_RSLTPICT}, + {"rsltrtf", CONTROL_FLAG, RTF_RSLTRTF}, + {"rslttxt", CONTROL_FLAG, RTF_RSLTTXT}, + {"rtf", CONTROL_DESTINATION, RTF_RTF}, + {"rtlch", CONTROL_FLAG, RTF_RTLCH}, + {"rtldoc", CONTROL_FLAG, RTF_RTLDOC}, + {"rtlgutter", CONTROL_FLAG, RTF_RTLGUTTER}, + {"rtlmark", CONTROL_SYMBOL, RTF_RTLMARK}, + {"rtlpar", CONTROL_FLAG, RTF_RTLPAR}, + {"rtlrow", CONTROL_FLAG, RTF_RTLROW}, + {"rtlsect", CONTROL_FLAG, RTF_RTLSECT}, + {"rxe", CONTROL_DESTINATION, RTF_RXE}, + {"s", CONTROL_VALUE, RTF_S}, + {"sa", CONTROL_VALUE, RTF_SA}, + {"saauto", CONTROL_TOGGLE, RTF_SAAUTO}, + {"saftnnalc", CONTROL_FLAG, RTF_SAFTNNALC}, + {"saftnnar", CONTROL_FLAG, RTF_SAFTNNAR}, + {"saftnnauc", CONTROL_FLAG, RTF_SAFTNNAUC}, + {"saftnnchi", CONTROL_FLAG, RTF_SAFTNNCHI}, + {"saftnnchosung", CONTROL_FLAG, RTF_SAFTNNCHOSUNG}, + {"saftnncnum", CONTROL_FLAG, RTF_SAFTNNCNUM}, + {"saftnndbar", CONTROL_FLAG, RTF_SAFTNNDBAR}, + {"saftnndbnum", CONTROL_FLAG, RTF_SAFTNNDBNUM}, + {"saftnndbnumd", CONTROL_FLAG, RTF_SAFTNNDBNUMD}, + {"saftnndbnumk", CONTROL_FLAG, RTF_SAFTNNDBNUMK}, + {"saftnndbnumt", CONTROL_FLAG, RTF_SAFTNNDBNUMT}, + {"saftnnganada", CONTROL_FLAG, RTF_SAFTNNGANADA}, + {"saftnngbnum", CONTROL_FLAG, RTF_SAFTNNGBNUM}, + {"saftnngbnumd", CONTROL_FLAG, RTF_SAFTNNGBNUMD}, + {"saftnngbnumk", CONTROL_FLAG, RTF_SAFTNNGBNUMK}, + {"saftnngbnuml", CONTROL_FLAG, RTF_SAFTNNGBNUML}, + {"saftnnrlc", CONTROL_FLAG, RTF_SAFTNNRLC}, + {"saftnnruc", CONTROL_FLAG, RTF_SAFTNNRUC}, + {"saftnnzodiac", CONTROL_FLAG, RTF_SAFTNNZODIAC}, + {"saftnnzodiacd", CONTROL_FLAG, RTF_SAFTNNZODIACD}, + {"saftnnzodiacl", CONTROL_FLAG, RTF_SAFTNNZODIACL}, + {"saftnrestart", CONTROL_FLAG, RTF_SAFTNRESTART}, + {"saftnrstcont", CONTROL_FLAG, RTF_SAFTNRSTCONT}, + {"saftnstart", CONTROL_VALUE, RTF_SAFTNSTART}, + {"sautoupd", CONTROL_FLAG, RTF_SAUTOUPD}, + {"saveinvalidxml", CONTROL_FLAG, RTF_SAVEINVALIDXML}, + {"saveprevpict", CONTROL_FLAG, RTF_SAVEPREVPICT}, + {"sb", CONTROL_VALUE, RTF_SB}, + {"sbasedon", CONTROL_VALUE, RTF_SBASEDON}, + {"sbauto", CONTROL_TOGGLE, RTF_SBAUTO}, + {"sbkcol", CONTROL_FLAG, RTF_SBKCOL}, + {"sbkeven", CONTROL_FLAG, RTF_SBKEVEN}, + {"sbknone", CONTROL_FLAG, RTF_SBKNONE}, + {"sbkodd", CONTROL_FLAG, RTF_SBKODD}, + {"sbkpage", CONTROL_FLAG, RTF_SBKPAGE}, + {"sbys", CONTROL_FLAG, RTF_SBYS}, + {"scaps", CONTROL_TOGGLE, RTF_SCAPS}, + {"scompose", CONTROL_FLAG, RTF_SCOMPOSE}, + {"sec", CONTROL_VALUE, RTF_SEC}, + {"sect", CONTROL_SYMBOL, RTF_SECT}, + {"sectd", CONTROL_FLAG, RTF_SECTD}, + {"sectdefaultcl", CONTROL_FLAG, RTF_SECTDEFAULTCL}, + {"sectexpand", CONTROL_VALUE, RTF_SECTEXPAND}, + {"sectlinegrid", CONTROL_VALUE, RTF_SECTLINEGRID}, + {"sectnum", CONTROL_SYMBOL, RTF_SECTNUM}, + {"sectrsid", CONTROL_VALUE, RTF_SECTRSID}, + {"sectspecifycl", CONTROL_FLAG, RTF_SECTSPECIFYCL}, + {"sectspecifygenN", CONTROL_FLAG, RTF_SECTSPECIFYGENN}, + {"sectspecifyl", CONTROL_FLAG, RTF_SECTSPECIFYL}, + {"sectunlocked", CONTROL_FLAG, RTF_SECTUNLOCKED}, + {"sftnbj", CONTROL_FLAG, RTF_SFTNBJ}, + {"sftnnalc", CONTROL_FLAG, RTF_SFTNNALC}, + {"sftnnar", CONTROL_FLAG, RTF_SFTNNAR}, + {"sftnnauc", CONTROL_FLAG, RTF_SFTNNAUC}, + {"sftnnchi", CONTROL_FLAG, RTF_SFTNNCHI}, + {"sftnnchosung", CONTROL_FLAG, RTF_SFTNNCHOSUNG}, + {"sftnncnum", CONTROL_FLAG, RTF_SFTNNCNUM}, + {"sftnndbar", CONTROL_FLAG, RTF_SFTNNDBAR}, + {"sftnndbnum", CONTROL_FLAG, RTF_SFTNNDBNUM}, + {"sftnndbnumd", CONTROL_FLAG, RTF_SFTNNDBNUMD}, + {"sftnndbnumk", CONTROL_FLAG, RTF_SFTNNDBNUMK}, + {"sftnndbnumt", CONTROL_FLAG, RTF_SFTNNDBNUMT}, + {"sftnnganada", CONTROL_FLAG, RTF_SFTNNGANADA}, + {"sftnngbnum", CONTROL_FLAG, RTF_SFTNNGBNUM}, + {"sftnngbnumd", CONTROL_FLAG, RTF_SFTNNGBNUMD}, + {"sftnngbnumk", CONTROL_FLAG, RTF_SFTNNGBNUMK}, + {"sftnngbnuml", CONTROL_FLAG, RTF_SFTNNGBNUML}, + {"sftnnrlc", CONTROL_FLAG, RTF_SFTNNRLC}, + {"sftnnruc", CONTROL_FLAG, RTF_SFTNNRUC}, + {"sftnnzodiac", CONTROL_FLAG, RTF_SFTNNZODIAC}, + {"sftnnzodiacd", CONTROL_FLAG, RTF_SFTNNZODIACD}, + {"sftnnzodiacl", CONTROL_FLAG, RTF_SFTNNZODIACL}, + {"sftnrestart", CONTROL_FLAG, RTF_SFTNRESTART}, + {"sftnrstcont", CONTROL_FLAG, RTF_SFTNRSTCONT}, + {"sftnrstpg", CONTROL_FLAG, RTF_SFTNRSTPG}, + {"sftnstart", CONTROL_VALUE, RTF_SFTNSTART}, + {"sftntj", CONTROL_FLAG, RTF_SFTNTJ}, + {"shad", CONTROL_TOGGLE, RTF_SHAD}, + {"shading", CONTROL_VALUE, RTF_SHADING}, + {"shidden", CONTROL_FLAG, RTF_SHIDDEN}, + {"shift", CONTROL_FLAG, RTF_SHIFT}, + {"showplaceholdtext", CONTROL_VALUE, RTF_SHOWPLACEHOLDTEXT}, + {"showxmlerrors", CONTROL_VALUE, RTF_SHOWXMLERRORS}, + {"shp", CONTROL_DESTINATION, RTF_SHP}, + {"shpbottom", CONTROL_VALUE, RTF_SHPBOTTOM}, + {"shpbxcolumn", CONTROL_FLAG, RTF_SHPBXCOLUMN}, + {"shpbxignore", CONTROL_FLAG, RTF_SHPBXIGNORE}, + {"shpbxmargin", CONTROL_FLAG, RTF_SHPBXMARGIN}, + {"shpbxpage", CONTROL_FLAG, RTF_SHPBXPAGE}, + {"shpbyignore", CONTROL_FLAG, RTF_SHPBYIGNORE}, + {"shpbymargin", CONTROL_FLAG, RTF_SHPBYMARGIN}, + {"shpbypage", CONTROL_FLAG, RTF_SHPBYPAGE}, + {"shpbypara", CONTROL_FLAG, RTF_SHPBYPARA}, + {"shpfblwtxt", CONTROL_VALUE, RTF_SHPFBLWTXT}, + {"shpfhdr", CONTROL_VALUE, RTF_SHPFHDR}, + {"shpgrp", CONTROL_DESTINATION, RTF_SHPGRP}, + {"shpinst", CONTROL_DESTINATION, RTF_SHPINST}, + {"shpleft", CONTROL_VALUE, RTF_SHPLEFT}, + {"shplid", CONTROL_VALUE, RTF_SHPLID}, + {"shplockanchor", CONTROL_FLAG, RTF_SHPLOCKANCHOR}, + {"shppict", CONTROL_DESTINATION, RTF_SHPPICT}, + {"shpright", CONTROL_VALUE, RTF_SHPRIGHT}, + {"shprslt", CONTROL_DESTINATION, RTF_SHPRSLT}, + {"shptop", CONTROL_VALUE, RTF_SHPTOP}, + {"shptxt", CONTROL_DESTINATION, RTF_SHPTXT}, + {"shpwrk", CONTROL_VALUE, RTF_SHPWRK}, + {"shpwr", CONTROL_VALUE, RTF_SHPWR}, + {"shpz", CONTROL_VALUE, RTF_SHPZ}, + {"sl", CONTROL_VALUE, RTF_SL}, + {"slink", CONTROL_VALUE, RTF_SLINK}, + {"slmult", CONTROL_VALUE, RTF_SLMULT}, + {"slocked", CONTROL_FLAG, RTF_SLOCKED}, + {"sn", CONTROL_DESTINATION, RTF_SN}, + {"snaptogridincell", CONTROL_FLAG, RTF_SNAPTOGRIDINCELL}, + {"snext", CONTROL_VALUE, RTF_SNEXT}, + {"softcol", CONTROL_FLAG, RTF_SOFTCOL}, + {"softlheight", CONTROL_VALUE, RTF_SOFTLHEIGHT}, + {"softline", CONTROL_FLAG, RTF_SOFTLINE}, + {"softpage", CONTROL_FLAG, RTF_SOFTPAGE}, + {"sp", CONTROL_DESTINATION, RTF_SP}, + {"spersonal", CONTROL_FLAG, RTF_SPERSONAL}, + {"spltpgpar", CONTROL_FLAG, RTF_SPLTPGPAR}, + {"splytwnine", CONTROL_FLAG, RTF_SPLYTWNINE}, + {"spriority", CONTROL_VALUE, RTF_SPRIORITY}, + {"sprsbsp", CONTROL_FLAG, RTF_SPRSBSP}, + {"sprslnsp", CONTROL_FLAG, RTF_SPRSLNSP}, + {"sprsspbf", CONTROL_FLAG, RTF_SPRSSPBF}, + {"sprstsm", CONTROL_FLAG, RTF_SPRSTSM}, + {"sprstsp", CONTROL_FLAG, RTF_SPRSTSP}, + {"spv", CONTROL_FLAG, RTF_SPV}, + {"sqformat", CONTROL_FLAG, RTF_SQFORMAT}, + {"srauth", CONTROL_VALUE, RTF_SRAUTH}, + {"srdate", CONTROL_VALUE, RTF_SRDATE}, + {"sreply", CONTROL_FLAG, RTF_SREPLY}, + {"ssemihidden", CONTROL_VALUE, RTF_SSEMIHIDDEN}, + {"staticval", CONTROL_DESTINATION, RTF_STATICVAL}, + {"stextflow", CONTROL_VALUE, RTF_STEXTFLOW}, + {"strike", CONTROL_TOGGLE, RTF_STRIKE}, + {"striked", CONTROL_TOGGLE, RTF_STRIKED}, + {"stshfbi", CONTROL_VALUE, RTF_STSHFBI}, + {"stshfdbch", CONTROL_VALUE, RTF_STSHFDBCH}, + {"stshfhich", CONTROL_VALUE, RTF_STSHFHICH}, + {"stshfloch", CONTROL_VALUE, RTF_STSHFLOCH}, + {"stylelock", CONTROL_FLAG, RTF_STYLELOCK}, + {"stylelockbackcomp", CONTROL_FLAG, RTF_STYLELOCKBACKCOMP}, + {"stylelockenforced", CONTROL_FLAG, RTF_STYLELOCKENFORCED}, + {"stylelockqfset", CONTROL_FLAG, RTF_STYLELOCKQFSET}, + {"stylelocktheme", CONTROL_FLAG, RTF_STYLELOCKTHEME}, + {"stylesheet", CONTROL_DESTINATION, RTF_STYLESHEET}, + {"stylesortmethod", CONTROL_VALUE, RTF_STYLESORTMETHOD}, + {"styrsid", CONTROL_VALUE, RTF_STYRSID}, + {"sub", CONTROL_FLAG, RTF_SUB}, + {"subdocument", CONTROL_VALUE, RTF_SUBDOCUMENT}, + {"subfontbysize", CONTROL_FLAG, RTF_SUBFONTBYSIZE}, + {"subject", CONTROL_DESTINATION, RTF_SUBJECT}, + {"sunhideused", CONTROL_VALUE, RTF_SUNHIDEUSED}, + {"super", CONTROL_FLAG, RTF_SUPER}, + {"sv", CONTROL_DESTINATION, RTF_SV}, + {"svb", CONTROL_DESTINATION, RTF_SVB}, + {"swpbdr", CONTROL_FLAG, RTF_SWPBDR}, + {"tab", CONTROL_SYMBOL, RTF_TAB}, + {"tabsnoovrlp", CONTROL_FLAG, RTF_TABSNOOVRLP}, + {"taprtl", CONTROL_FLAG, RTF_TAPRTL}, + {"tb", CONTROL_VALUE, RTF_TB}, + {"tblind", CONTROL_VALUE, RTF_TBLIND}, + {"tblindtype", CONTROL_VALUE, RTF_TBLINDTYPE}, + {"tbllkbestfit", CONTROL_FLAG, RTF_TBLLKBESTFIT}, + {"tbllkborder", CONTROL_FLAG, RTF_TBLLKBORDER}, + {"tbllkcolor", CONTROL_FLAG, RTF_TBLLKCOLOR}, + {"tbllkfont", CONTROL_FLAG, RTF_TBLLKFONT}, + {"tbllkhdrcols", CONTROL_FLAG, RTF_TBLLKHDRCOLS}, + {"tbllkhdrrows", CONTROL_FLAG, RTF_TBLLKHDRROWS}, + {"tbllklastcol", CONTROL_FLAG, RTF_TBLLKLASTCOL}, + {"tbllklastrow", CONTROL_FLAG, RTF_TBLLKLASTROW}, + {"tbllknocolband", CONTROL_FLAG, RTF_TBLLKNOCOLBAND}, + {"tbllknorowband", CONTROL_FLAG, RTF_TBLLKNOROWBAND}, + {"tbllkshading", CONTROL_FLAG, RTF_TBLLKSHADING}, + {"tblrsid", CONTROL_VALUE, RTF_TBLRSID}, + {"tc", CONTROL_DESTINATION, RTF_TC}, + {"tcelld", CONTROL_FLAG, RTF_TCELLD}, + {"tcf", CONTROL_VALUE, RTF_TCF}, + {"tcl", CONTROL_VALUE, RTF_TCL}, + {"tcn", CONTROL_FLAG, RTF_TCN}, + {"tdfrmtxtBottom", CONTROL_VALUE, RTF_TDFRMTXTBOTTOM}, + {"tdfrmtxtLeft", CONTROL_VALUE, RTF_TDFRMTXTLEFT}, + {"tdfrmtxtRight", CONTROL_VALUE, RTF_TDFRMTXTRIGHT}, + {"tdfrmtxtTop", CONTROL_VALUE, RTF_TDFRMTXTTOP}, + {"template", CONTROL_DESTINATION, RTF_TEMPLATE}, + {"themedata", CONTROL_DESTINATION, RTF_THEMEDATA}, + {"themelang", CONTROL_VALUE, RTF_THEMELANG}, + {"themelangcs", CONTROL_VALUE, RTF_THEMELANGCS}, + {"themelangfe", CONTROL_VALUE, RTF_THEMELANGFE}, + {"time", CONTROL_FLAG, RTF_TIME}, + {"title", CONTROL_DESTINATION, RTF_TITLE}, + {"titlepg", CONTROL_FLAG, RTF_TITLEPG}, + {"tldot", CONTROL_FLAG, RTF_TLDOT}, + {"tleq", CONTROL_FLAG, RTF_TLEQ}, + {"tlhyph", CONTROL_FLAG, RTF_TLHYPH}, + {"tlmdot", CONTROL_FLAG, RTF_TLMDOT}, + {"tlth", CONTROL_FLAG, RTF_TLTH}, + {"tlul", CONTROL_FLAG, RTF_TLUL}, + {"toplinepunct", CONTROL_FLAG, RTF_TOPLINEPUNCT}, + {"tphcol", CONTROL_FLAG, RTF_TPHCOL}, + {"tphmrg", CONTROL_FLAG, RTF_TPHMRG}, + {"tphpg", CONTROL_FLAG, RTF_TPHPG}, + {"tposnegx", CONTROL_VALUE, RTF_TPOSNEGX}, + {"tposnegy", CONTROL_VALUE, RTF_TPOSNEGY}, + {"tposxc", CONTROL_FLAG, RTF_TPOSXC}, + {"tposxi", CONTROL_FLAG, RTF_TPOSXI}, + {"tposxl", CONTROL_FLAG, RTF_TPOSXL}, + {"tposx", CONTROL_VALUE, RTF_TPOSX}, + {"tposxo", CONTROL_FLAG, RTF_TPOSXO}, + {"tposxr", CONTROL_FLAG, RTF_TPOSXR}, + {"tposy", CONTROL_VALUE, RTF_TPOSY}, + {"tposyb", CONTROL_FLAG, RTF_TPOSYB}, + {"tposyc", CONTROL_FLAG, RTF_TPOSYC}, + {"tposyil", CONTROL_FLAG, RTF_TPOSYIL}, + {"tposyin", CONTROL_FLAG, RTF_TPOSYIN}, + {"tposyout", CONTROL_FLAG, RTF_TPOSYOUT}, + {"tposyt", CONTROL_FLAG, RTF_TPOSYT}, + {"tpvmrg", CONTROL_FLAG, RTF_TPVMRG}, + {"tpvpara", CONTROL_FLAG, RTF_TPVPARA}, + {"tpvpg", CONTROL_FLAG, RTF_TPVPG}, + {"tqc", CONTROL_FLAG, RTF_TQC}, + {"tqdec", CONTROL_FLAG, RTF_TQDEC}, + {"tqr", CONTROL_FLAG, RTF_TQR}, + {"trackformatting", CONTROL_VALUE, RTF_TRACKFORMATTING}, + {"trackmoves", CONTROL_VALUE, RTF_TRACKMOVES}, + {"transmf", CONTROL_FLAG, RTF_TRANSMF}, + {"trauth", CONTROL_VALUE, RTF_TRAUTH}, + {"trautofit", CONTROL_TOGGLE, RTF_TRAUTOFIT}, + {"trbgbdiag", CONTROL_FLAG, RTF_TRBGBDIAG}, + {"trbgcross", CONTROL_FLAG, RTF_TRBGCROSS}, + {"trbgdcross", CONTROL_FLAG, RTF_TRBGDCROSS}, + {"trbgdkbdiag", CONTROL_FLAG, RTF_TRBGDKBDIAG}, + {"trbgdkcross", CONTROL_FLAG, RTF_TRBGDKCROSS}, + {"trbgdkdcross", CONTROL_FLAG, RTF_TRBGDKDCROSS}, + {"trbgdkfdiag", CONTROL_FLAG, RTF_TRBGDKFDIAG}, + {"trbgdkhor", CONTROL_FLAG, RTF_TRBGDKHOR}, + {"trbgdkvert", CONTROL_FLAG, RTF_TRBGDKVERT}, + {"trbgfdiag", CONTROL_FLAG, RTF_TRBGFDIAG}, + {"trbghoriz", CONTROL_FLAG, RTF_TRBGHORIZ}, + {"trbgvert", CONTROL_FLAG, RTF_TRBGVERT}, + {"trbrdrb", CONTROL_FLAG, RTF_TRBRDRB}, + {"trbrdrh", CONTROL_FLAG, RTF_TRBRDRH}, + {"trbrdrl", CONTROL_FLAG, RTF_TRBRDRL}, + {"trbrdrr", CONTROL_FLAG, RTF_TRBRDRR}, + {"trbrdrt", CONTROL_FLAG, RTF_TRBRDRT}, + {"trbrdrv", CONTROL_FLAG, RTF_TRBRDRV}, + {"trcbpat", CONTROL_VALUE, RTF_TRCBPAT}, + {"trcfpat", CONTROL_VALUE, RTF_TRCFPAT}, + {"trdate", CONTROL_VALUE, RTF_TRDATE}, + {"trftsWidthA", CONTROL_VALUE, RTF_TRFTSWIDTHA}, + {"trftsWidthB", CONTROL_VALUE, RTF_TRFTSWIDTHB}, + {"trftsWidth", CONTROL_VALUE, RTF_TRFTSWIDTH}, + {"trgaph", CONTROL_VALUE, RTF_TRGAPH}, + {"trhdr", CONTROL_FLAG, RTF_TRHDR}, + {"trkeep", CONTROL_FLAG, RTF_TRKEEP}, + {"trkeepfollow", CONTROL_FLAG, RTF_TRKEEPFOLLOW}, + {"trleft", CONTROL_VALUE, RTF_TRLEFT}, + {"trowd", CONTROL_FLAG, RTF_TROWD}, + {"trpaddb", CONTROL_VALUE, RTF_TRPADDB}, + {"trpaddfb", CONTROL_VALUE, RTF_TRPADDFB}, + {"trpaddfl", CONTROL_VALUE, RTF_TRPADDFL}, + {"trpaddfr", CONTROL_VALUE, RTF_TRPADDFR}, + {"trpaddft", CONTROL_VALUE, RTF_TRPADDFT}, + {"trpaddl", CONTROL_VALUE, RTF_TRPADDL}, + {"trpaddr", CONTROL_VALUE, RTF_TRPADDR}, + {"trpaddt", CONTROL_VALUE, RTF_TRPADDT}, + {"trpadob", CONTROL_VALUE, RTF_TRPADOB}, + {"trpadofb", CONTROL_VALUE, RTF_TRPADOFB}, + {"trpadofl", CONTROL_VALUE, RTF_TRPADOFL}, + {"trpadofr", CONTROL_VALUE, RTF_TRPADOFR}, + {"trpadoft", CONTROL_VALUE, RTF_TRPADOFT}, + {"trpadol", CONTROL_VALUE, RTF_TRPADOL}, + {"trpador", CONTROL_VALUE, RTF_TRPADOR}, + {"trpadot", CONTROL_VALUE, RTF_TRPADOT}, + {"trpat", CONTROL_VALUE, RTF_TRPAT}, + {"trqc", CONTROL_FLAG, RTF_TRQC}, + {"trql", CONTROL_FLAG, RTF_TRQL}, + {"trqr", CONTROL_FLAG, RTF_TRQR}, + {"trrh", CONTROL_VALUE, RTF_TRRH}, + {"trshdng", CONTROL_VALUE, RTF_TRSHDNG}, + {"trspdb", CONTROL_VALUE, RTF_TRSPDB}, + {"trspdfb", CONTROL_VALUE, RTF_TRSPDFB}, + {"trspdfl", CONTROL_VALUE, RTF_TRSPDFL}, + {"trspdfr", CONTROL_VALUE, RTF_TRSPDFR}, + {"trspdft", CONTROL_VALUE, RTF_TRSPDFT}, + {"trspdl", CONTROL_VALUE, RTF_TRSPDL}, + {"trspdr", CONTROL_VALUE, RTF_TRSPDR}, + {"trspdt", CONTROL_VALUE, RTF_TRSPDT}, + {"trspob", CONTROL_VALUE, RTF_TRSPOB}, + {"trspofb", CONTROL_VALUE, RTF_TRSPOFB}, + {"trspofl", CONTROL_VALUE, RTF_TRSPOFL}, + {"trspofr", CONTROL_VALUE, RTF_TRSPOFR}, + {"trspoft", CONTROL_VALUE, RTF_TRSPOFT}, + {"trspol", CONTROL_VALUE, RTF_TRSPOL}, + {"trspor", CONTROL_VALUE, RTF_TRSPOR}, + {"trspot", CONTROL_VALUE, RTF_TRSPOT}, + {"truncatefontheight", CONTROL_FLAG, RTF_TRUNCATEFONTHEIGHT}, + {"truncex", CONTROL_FLAG, RTF_TRUNCEX}, + {"trwWidthA", CONTROL_VALUE, RTF_TRWWIDTHA}, + {"trwWidthB", CONTROL_VALUE, RTF_TRWWIDTHB}, + {"trwWidth", CONTROL_VALUE, RTF_TRWWIDTH}, + {"ts", CONTROL_VALUE, RTF_TS}, + {"tsbgbdiag", CONTROL_FLAG, RTF_TSBGBDIAG}, + {"tsbgcross", CONTROL_FLAG, RTF_TSBGCROSS}, + {"tsbgdcross", CONTROL_FLAG, RTF_TSBGDCROSS}, + {"tsbgdkbdiag", CONTROL_FLAG, RTF_TSBGDKBDIAG}, + {"tsbgdkcross", CONTROL_FLAG, RTF_TSBGDKCROSS}, + {"tsbgdkdcross", CONTROL_FLAG, RTF_TSBGDKDCROSS}, + {"tsbgdkfdiag", CONTROL_FLAG, RTF_TSBGDKFDIAG}, + {"tsbgdkhor", CONTROL_FLAG, RTF_TSBGDKHOR}, + {"tsbgdkvert", CONTROL_FLAG, RTF_TSBGDKVERT}, + {"tsbgfdiag", CONTROL_FLAG, RTF_TSBGFDIAG}, + {"tsbghoriz", CONTROL_FLAG, RTF_TSBGHORIZ}, + {"tsbgvert", CONTROL_FLAG, RTF_TSBGVERT}, + {"tsbrdrb", CONTROL_FLAG, RTF_TSBRDRB}, + {"tsbrdrdgl", CONTROL_FLAG, RTF_TSBRDRDGL}, + {"tsbrdrdgr", CONTROL_FLAG, RTF_TSBRDRDGR}, + {"tsbrdrh", CONTROL_FLAG, RTF_TSBRDRH}, + {"tsbrdrl", CONTROL_FLAG, RTF_TSBRDRL}, + {"tsbrdrr", CONTROL_FLAG, RTF_TSBRDRR}, + {"tsbrdrt", CONTROL_FLAG, RTF_TSBRDRT}, + {"tsbrdrv", CONTROL_FLAG, RTF_TSBRDRV}, + {"tscbandhorzeven", CONTROL_FLAG, RTF_TSCBANDHORZEVEN}, + {"tscbandhorzodd", CONTROL_FLAG, RTF_TSCBANDHORZODD}, + {"tscbandsh", CONTROL_VALUE, RTF_TSCBANDSH}, + {"tscbandsv", CONTROL_VALUE, RTF_TSCBANDSV}, + {"tscbandverteven", CONTROL_FLAG, RTF_TSCBANDVERTEVEN}, + {"tscbandvertodd", CONTROL_FLAG, RTF_TSCBANDVERTODD}, + {"tscellcbpat", CONTROL_VALUE, RTF_TSCELLCBPAT}, + {"tscellcfpat", CONTROL_VALUE, RTF_TSCELLCFPAT}, + {"tscellpaddb", CONTROL_VALUE, RTF_TSCELLPADDB}, + {"tscellpaddfb", CONTROL_VALUE, RTF_TSCELLPADDFB}, + {"tscellpaddfl", CONTROL_VALUE, RTF_TSCELLPADDFL}, + {"tscellpaddfr", CONTROL_VALUE, RTF_TSCELLPADDFR}, + {"tscellpaddft", CONTROL_VALUE, RTF_TSCELLPADDFT}, + {"tscellpaddl", CONTROL_VALUE, RTF_TSCELLPADDL}, + {"tscellpaddr", CONTROL_VALUE, RTF_TSCELLPADDR}, + {"tscellpaddt", CONTROL_VALUE, RTF_TSCELLPADDT}, + {"tscellpct", CONTROL_VALUE, RTF_TSCELLPCT}, + {"tscellwidth", CONTROL_VALUE, RTF_TSCELLWIDTH}, + {"tscellwidthfts", CONTROL_VALUE, RTF_TSCELLWIDTHFTS}, + {"tscfirstcol", CONTROL_FLAG, RTF_TSCFIRSTCOL}, + {"tscfirstrow", CONTROL_FLAG, RTF_TSCFIRSTROW}, + {"tsclastcol", CONTROL_FLAG, RTF_TSCLASTCOL}, + {"tsclastrow", CONTROL_FLAG, RTF_TSCLASTROW}, + {"tscnecell", CONTROL_FLAG, RTF_TSCNECELL}, + {"tscnwcell", CONTROL_FLAG, RTF_TSCNWCELL}, + {"tscsecell", CONTROL_FLAG, RTF_TSCSECELL}, + {"tscswcell", CONTROL_FLAG, RTF_TSCSWCELL}, + {"tsd", CONTROL_FLAG, RTF_TSD}, + {"tsnowrap", CONTROL_FLAG, RTF_TSNOWRAP}, + {"tsrowd", CONTROL_FLAG, RTF_TSROWD}, + {"tsvertalb", CONTROL_FLAG, RTF_TSVERTALB}, + {"tsvertalc", CONTROL_FLAG, RTF_TSVERTALC}, + {"tsvertalt", CONTROL_FLAG, RTF_TSVERTALT}, + {"twoinone", CONTROL_VALUE, RTF_TWOINONE}, + {"twoonone", CONTROL_FLAG, RTF_TWOONONE}, + {"tx", CONTROL_VALUE, RTF_TX}, + {"txbxtwalways", CONTROL_FLAG, RTF_TXBXTWALWAYS}, + {"txbxtwfirst", CONTROL_FLAG, RTF_TXBXTWFIRST}, + {"txbxtwfirstlast", CONTROL_FLAG, RTF_TXBXTWFIRSTLAST}, + {"txbxtwlast", CONTROL_FLAG, RTF_TXBXTWLAST}, + {"txbxtwno", CONTROL_FLAG, RTF_TXBXTWNO}, + {"txe", CONTROL_DESTINATION, RTF_TXE}, + {"u", CONTROL_VALUE, RTF_U}, + {"uc", CONTROL_VALUE, RTF_UC}, + {"ud", CONTROL_DESTINATION, RTF_UD}, + {"ul", CONTROL_TOGGLE, RTF_UL}, + {"ulc", CONTROL_VALUE, RTF_ULC}, + {"uld", CONTROL_FLAG, RTF_ULD}, + {"uldash", CONTROL_TOGGLE, RTF_ULDASH}, + {"uldashd", CONTROL_TOGGLE, RTF_ULDASHD}, + {"uldashdd", CONTROL_TOGGLE, RTF_ULDASHDD}, + {"uldb", CONTROL_TOGGLE, RTF_ULDB}, + {"ulhair", CONTROL_TOGGLE, RTF_ULHAIR}, + {"ulhwave", CONTROL_TOGGLE, RTF_ULHWAVE}, + {"ulldash", CONTROL_TOGGLE, RTF_ULLDASH}, + {"ulnone", CONTROL_FLAG, RTF_ULNONE}, + {"ulth", CONTROL_TOGGLE, RTF_ULTH}, + {"ulthd", CONTROL_TOGGLE, RTF_ULTHD}, + {"ulthdash", CONTROL_TOGGLE, RTF_ULTHDASH}, + {"ulthdashd", CONTROL_TOGGLE, RTF_ULTHDASHD}, + {"ulthdashdd", CONTROL_TOGGLE, RTF_ULTHDASHDD}, + {"ulthldash", CONTROL_TOGGLE, RTF_ULTHLDASH}, + {"ululdbwave", CONTROL_TOGGLE, RTF_ULULDBWAVE}, + {"ulw", CONTROL_FLAG, RTF_ULW}, + {"ulwave", CONTROL_TOGGLE, RTF_ULWAVE}, + {"up", CONTROL_VALUE, RTF_UP}, + {"upr", CONTROL_DESTINATION, RTF_UPR}, + {"urtf", CONTROL_VALUE, RTF_URTF}, + {"useltbaln", CONTROL_FLAG, RTF_USELTBALN}, + {"usenormstyforlist", CONTROL_FLAG, RTF_USENORMSTYFORLIST}, + {"userprops", CONTROL_DESTINATION, RTF_USERPROPS}, + {"usexform", CONTROL_FLAG, RTF_USEXFORM}, + {"utinl", CONTROL_FLAG, RTF_UTINL}, + {"v", CONTROL_TOGGLE, RTF_V}, + {"validatexml", CONTROL_VALUE, RTF_VALIDATEXML}, + {"vern", CONTROL_VALUE, RTF_VERN}, + {"version", CONTROL_VALUE, RTF_VERSION}, + {"vertal", CONTROL_FLAG, RTF_VERTAL}, + {"vertalb", CONTROL_FLAG, RTF_VERTALB}, + {"vertalc", CONTROL_FLAG, RTF_VERTALC}, + {"vertalj", CONTROL_FLAG, RTF_VERTALJ}, + {"vertalt", CONTROL_FLAG, RTF_VERTALT}, + {"vertdoc", CONTROL_FLAG, RTF_VERTDOC}, + {"vertsect", CONTROL_FLAG, RTF_VERTSECT}, + {"viewbksp", CONTROL_VALUE, RTF_VIEWBKSP}, + {"viewkind", CONTROL_VALUE, RTF_VIEWKIND}, + {"viewnobound", CONTROL_FLAG, RTF_VIEWNOBOUND}, + {"viewscale", CONTROL_VALUE, RTF_VIEWSCALE}, + {"viewzk", CONTROL_VALUE, RTF_VIEWZK}, + {"wbitmap", CONTROL_VALUE, RTF_WBITMAP}, + {"wbmbitspixel", CONTROL_VALUE, RTF_WBMBITSPIXEL}, + {"wbmplanes", CONTROL_VALUE, RTF_WBMPLANES}, + {"wbmwidthbyte", CONTROL_VALUE, RTF_WBMWIDTHBYTE}, + {"webhidden", CONTROL_FLAG, RTF_WEBHIDDEN}, + {"wgrffmtfilter", CONTROL_DESTINATION, RTF_WGRFFMTFILTER}, + {"widctlpar", CONTROL_FLAG, RTF_WIDCTLPAR}, + {"widowctrl", CONTROL_FLAG, RTF_WIDOWCTRL}, + {"windowcaption", CONTROL_DESTINATION, RTF_WINDOWCAPTION}, + {"wmetafile", CONTROL_VALUE, RTF_WMETAFILE}, + {"wpeqn", CONTROL_FLAG, RTF_WPEQN}, + {"wpjst", CONTROL_FLAG, RTF_WPJST}, + {"wpsp", CONTROL_FLAG, RTF_WPSP}, + {"wraparound", CONTROL_FLAG, RTF_WRAPAROUND}, + {"wrapdefault", CONTROL_FLAG, RTF_WRAPDEFAULT}, + {"wrapthrough", CONTROL_FLAG, RTF_WRAPTHROUGH}, + {"wraptight", CONTROL_FLAG, RTF_WRAPTIGHT}, + {"wraptrsp", CONTROL_FLAG, RTF_WRAPTRSP}, + {"writereservation", CONTROL_DESTINATION, RTF_WRITERESERVATION}, + {"writereservhash", CONTROL_DESTINATION, RTF_WRITERESERVHASH}, + {"wrppunct", CONTROL_FLAG, RTF_WRPPUNCT}, + {"xe", CONTROL_DESTINATION, RTF_XE}, + {"xef", CONTROL_VALUE, RTF_XEF}, + {"xform", CONTROL_DESTINATION, RTF_XFORM}, + {"xmlattr", CONTROL_FLAG, RTF_XMLATTR}, + {"xmlattrname", CONTROL_DESTINATION, RTF_XMLATTRNAME}, + {"xmlattrns", CONTROL_VALUE, RTF_XMLATTRNS}, + {"xmlattrvalue", CONTROL_DESTINATION, RTF_XMLATTRVALUE}, + {"xmlclose", CONTROL_DESTINATION, RTF_XMLCLOSE}, + {"xmlname", CONTROL_DESTINATION, RTF_XMLNAME}, + {"xmlns", CONTROL_VALUE, RTF_XMLNS}, + {"xmlnstbl", CONTROL_DESTINATION, RTF_XMLNSTBL}, + {"xmlopen", CONTROL_DESTINATION, RTF_XMLOPEN}, + {"xmlsdttcell", CONTROL_FLAG, RTF_XMLSDTTCELL}, + {"xmlsdttpara", CONTROL_FLAG, RTF_XMLSDTTPARA}, + {"xmlsdttregular", CONTROL_FLAG, RTF_XMLSDTTREGULAR}, + {"xmlsdttrow", CONTROL_FLAG, RTF_XMLSDTTROW}, + {"xmlsdttunknown", CONTROL_FLAG, RTF_XMLSDTTUNKNOWN}, + {"yr", CONTROL_VALUE, RTF_YR}, + {"yts", CONTROL_VALUE, RTF_YTS}, + {"yxe", CONTROL_FLAG, RTF_YXE}, + {"zwbo", CONTROL_SYMBOL, RTF_ZWBO}, + {"zwj", CONTROL_SYMBOL, RTF_ZWJ}, + {"zwnbo", CONTROL_SYMBOL, RTF_ZWNBO}, + {"zwnj", CONTROL_SYMBOL, RTF_ZWNJ}, +}; +int nRTFControlWords = SAL_N_ELEMENTS(aRTFControlWords); + +} // namespace rtftok +} // namespace writerfilter + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfcontrolwords.hxx b/writerfilter/source/rtftok/rtfcontrolwords.hxx new file mode 100644 index 000000000000..a6c35312c19f --- /dev/null +++ b/writerfilter/source/rtftok/rtfcontrolwords.hxx @@ -0,0 +1,1854 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef _RTFCONTROLWORDS_HXX_ +#define _RTFCONTROLWORDS_HXX_ + +namespace writerfilter { +namespace rtftok { + +enum RTFKeyword +{ + RTF_HEXCHAR, + RTF_OPTHYPH, + RTF_IGNORE, + RTF_SUBENTRY, + RTF_BACKSLASH, + RTF_NOBRKHYPH, + RTF_LBRACE, + RTF_FORMULA, + RTF_RBRACE, + RTF_NOBREAK, + RTF_AB, + RTF_ABSH, + RTF_ABSLOCK, + RTF_ABSNOOVRLP, + RTF_ABSW, + RTF_ACAPS, + RTF_ACCCIRCLE, + RTF_ACCCOMMA, + RTF_ACCDOT, + RTF_ACCNONE, + RTF_ACCUNDERDOT, + RTF_ACF, + RTF_ADEFF, + RTF_ADDITIVE, + RTF_ADEFLANG, + RTF_ADJUSTRIGHT, + RTF_ADN, + RTF_AENDDOC, + RTF_AENDNOTES, + RTF_AEXPND, + RTF_AF, + RTF_AFELEV, + RTF_AFS, + RTF_AFTNBJ, + RTF_AFTNCN, + RTF_AFTNNALC, + RTF_AFTNNAR, + RTF_AFTNNAUC, + RTF_AFTNNCHI, + RTF_AFTNNCHOSUNG, + RTF_AFTNNCNUM, + RTF_AFTNNDBAR, + RTF_AFTNNDBNUM, + RTF_AFTNNDBNUMD, + RTF_AFTNNDBNUMK, + RTF_AFTNNDBNUMT, + RTF_AFTNNGANADA, + RTF_AFTNNGBNUM, + RTF_AFTNNGBNUMD, + RTF_AFTNNGBNUMK, + RTF_AFTNNGBNUML, + RTF_AFTNNRLC, + RTF_AFTNNRUC, + RTF_AFTNNZODIAC, + RTF_AFTNNZODIACD, + RTF_AFTNNZODIACL, + RTF_AFTNRESTART, + RTF_AFTNRSTCONT, + RTF_AFTNSEP, + RTF_AFTNSEPC, + RTF_AFTNSTART, + RTF_AFTNTJ, + RTF_AI, + RTF_ALANG, + RTF_ALLOWFIELDENDSEL, + RTF_ALLPROT, + RTF_ALNTBLIND, + RTF_ALT, + RTF_ANIMTEXT, + RTF_ANNOTATION, + RTF_ANNOTPROT, + RTF_ANSI, + RTF_ANSICPG, + RTF_AOUTL, + RTF_APPLYBRKRULES, + RTF_ASCAPS, + RTF_ASHAD, + RTF_ASIANBRKRULE, + RTF_ASPALPHA, + RTF_ASPNUM, + RTF_ASTRIKE, + RTF_ATNAUTHOR, + RTF_ATNDATE, + RTF_ATNICN, + RTF_ATNID, + RTF_ATNPARENT, + RTF_ATNREF, + RTF_ATNTIME, + RTF_ATRFEND, + RTF_ATRFSTART, + RTF_AUL, + RTF_AULD, + RTF_AULDB, + RTF_AULNONE, + RTF_AULW, + RTF_AUP, + RTF_AUTHOR, + RTF_AUTOFMTOVERRIDE, + RTF_B, + RTF_BACKGROUND, + RTF_BDBFHDR, + RTF_BDRRLSWSIX, + RTF_BGBDIAG, + RTF_BGCROSS, + RTF_BGDCROSS, + RTF_BGDKBDIAG, + RTF_BGDKCROSS, + RTF_BGDKDCROSS, + RTF_BGDKFDIAG, + RTF_BGDKHORIZ, + RTF_BGDKVERT, + RTF_BGFDIAG, + RTF_BGHORIZ, + RTF_BGVERT, + RTF_BIN, + RTF_BINFSXN, + RTF_BINSXN, + RTF_BKMKCOLF, + RTF_BKMKCOLL, + RTF_BKMKEND, + RTF_BKMKPUB, + RTF_BKMKSTART, + RTF_BLIPTAG, + RTF_BLIPUID, + RTF_BLIPUPI, + RTF_BLUE, + RTF_BOOKFOLD, + RTF_BOOKFOLDREV, + RTF_BOOKFOLDSHEETS, + RTF_BOX, + RTF_BRDRART, + RTF_BRDRB, + RTF_BRDRBAR, + RTF_BRDRBTW, + RTF_BRDRCF, + RTF_BRDRDASH, + RTF_BRDRDASHD, + RTF_BRDRDASHDD, + RTF_BRDRDASHDOT, + RTF_BRDRDASHDOTDOT, + RTF_BRDRDASHDOTSTR, + RTF_BRDRDASHSM, + RTF_BRDRDB, + RTF_BRDRDOT, + RTF_BRDREMBOSS, + RTF_BRDRENGRAVE, + RTF_BRDRFRAME, + RTF_BRDRHAIR, + RTF_BRDRINSET, + RTF_BRDRL, + RTF_BRDRNIL, + RTF_BRDRNONE, + RTF_BRDROUTSET, + RTF_BRDRR, + RTF_BRDRS, + RTF_BRDRSH, + RTF_BRDRT, + RTF_BRDRTBL, + RTF_BRDRTH, + RTF_BRDRTHTNLG, + RTF_BRDRTHTNMG, + RTF_BRDRTHTNSG, + RTF_BRDRTNTHLG, + RTF_BRDRTNTHMG, + RTF_BRDRTNTHSG, + RTF_BRDRTNTHTNLG, + RTF_BRDRTNTHTNMG, + RTF_BRDRTNTHTNSG, + RTF_BRDRTRIPLE, + RTF_BRDRW, + RTF_BRDRWAVY, + RTF_BRDRWAVYDB, + RTF_BRKFRM, + RTF_BRSP, + RTF_BULLET, + RTF_BUPTIM, + RTF_BXE, + RTF_CACCENTFIVE, + RTF_CACCENTFOUR, + RTF_CACCENTONE, + RTF_CACCENTSIX, + RTF_CACCENTTHREE, + RTF_CACCENTTWO, + RTF_CACHEDCOLBAL, + RTF_CAPS, + RTF_CATEGORY, + RTF_CB, + RTF_CBACKGROUNDONE, + RTF_CBACKGROUNDTWO, + RTF_CBPAT, + RTF_CCHS, + RTF_CELL, + RTF_CELLX, + RTF_CF, + RTF_CFOLLOWEDHYPERLINK, + RTF_CFPAT, + RTF_CGRID, + RTF_CHARRSID, + RTF_CHARSCALEX, + RTF_CHATN, + RTF_CHBGBDIAG, + RTF_CHBGCROSS, + RTF_CHBGDCROSS, + RTF_CHBGDKBDIAG, + RTF_CHBGDKCROSS, + RTF_CHBGDKDCROSS, + RTF_CHBGDKFDIAG, + RTF_CHBGDKHORIZ, + RTF_CHBGDKVERT, + RTF_CHBGFDIAG, + RTF_CHBGHORIZ, + RTF_CHBGVERT, + RTF_CHBRDR, + RTF_CHCBPAT, + RTF_CHCFPAT, + RTF_CHDATE, + RTF_CHDPA, + RTF_CHDPL, + RTF_CHFTN, + RTF_CHFTNSEP, + RTF_CHFTNSEPC, + RTF_CHPGN, + RTF_CHHRES, + RTF_CHSHDNG, + RTF_CHTIME, + RTF_CHYPERLINK, + RTF_CLBGBDIAG, + RTF_CLBGCROSS, + RTF_CLBGDCROSS, + RTF_CLBGDKBDIAG, + RTF_CLBGDKCROSS, + RTF_CLBGDKDCROSS, + RTF_CLBGDKFDIAG, + RTF_CLBGDKHOR, + RTF_CLBGDKVERT, + RTF_CLBGFDIAG, + RTF_CLBGHORIZ, + RTF_CLBGVERT, + RTF_CLBRDRB, + RTF_CLBRDRL, + RTF_CLBRDRR, + RTF_CLBRDRT, + RTF_CLCBPAT, + RTF_CLCBPATRAW, + RTF_CLCFPAT, + RTF_CLCFPATRAW, + RTF_CLDEL, + RTF_CLDELAUTH, + RTF_CLDELDTTM, + RTF_CLDGLL, + RTF_CLDGLU, + RTF_CLFITTEXT, + RTF_CLFTSWIDTH, + RTF_CLHIDEMARK, + RTF_CLINS, + RTF_CLINSAUTH, + RTF_CLINSDTTM, + RTF_CLMGF, + RTF_CLMRG, + RTF_CLMRGD, + RTF_CLMRGDAUTH, + RTF_CLMRGDDTTM, + RTF_CLMRGDR, + RTF_CLNOWRAP, + RTF_CLPADB, + RTF_CLPADFB, + RTF_CLPADFL, + RTF_CLPADFR, + RTF_CLPADFT, + RTF_CLPADL, + RTF_CLPADR, + RTF_CLPADT, + RTF_CLSPB, + RTF_CLSPFB, + RTF_CLSPFL, + RTF_CLSPFR, + RTF_CLSPFT, + RTF_CLSPL, + RTF_CLSPR, + RTF_CLSPT, + RTF_CLSHDNG, + RTF_CLSHDNGRAW, + RTF_CLSHDRAWNIL, + RTF_CLSPLIT, + RTF_CLSPLITR, + RTF_CLTXBTLR, + RTF_CLTXLRTB, + RTF_CLTXLRTBV, + RTF_CLTXTBRL, + RTF_CLTXTBRLV, + RTF_CLVERTALB, + RTF_CLVERTALC, + RTF_CLVERTALT, + RTF_CLVMGF, + RTF_CLVMRG, + RTF_CLWWIDTH, + RTF_CMAINDARKONE, + RTF_CMAINDARKTWO, + RTF_CMAINLIGHTONE, + RTF_CMAINLIGHTTWO, + RTF_COLLAPSED, + RTF_COLNO, + RTF_COLORSCHEMEMAPPING, + RTF_COLORTBL, + RTF_COLS, + RTF_COLSR, + RTF_COLSX, + RTF_COLUMN, + RTF_COLW, + RTF_COMMENT, + RTF_COMPANY, + RTF_CONTEXTUALSPACE, + RTF_CPG, + RTF_CRAUTH, + RTF_CRDATE, + RTF_CREATIM, + RTF_CS, + RTF_CSHADE, + RTF_CTEXTONE, + RTF_CTEXTTWO, + RTF_CTINT, + RTF_CTRL, + RTF_CTS, + RTF_CUFI, + RTF_CULI, + RTF_CURI, + RTF_CVMME, + RTF_DATAFIELD, + RTF_DATASTORE, + RTF_DATE, + RTF_DBCH, + RTF_DEFCHP, + RTF_DEFF, + RTF_DEFFORMAT, + RTF_DEFLANG, + RTF_DEFLANGFE, + RTF_DEFPAP, + RTF_DEFSHP, + RTF_DEFTAB, + RTF_DELETED, + RTF_DELRSID, + RTF_DFRAUTH, + RTF_DFRDATE, + RTF_DFRMTXTX, + RTF_DFRMTXTY, + RTF_DFRSTART, + RTF_DFRSTOP, + RTF_DFRXST, + RTF_DGHORIGIN, + RTF_DGHSHOW, + RTF_DGHSPACE, + RTF_DGMARGIN, + RTF_DGSNAP, + RTF_DGVORIGIN, + RTF_DGVSHOW, + RTF_DGVSPACE, + RTF_DIBITMAP, + RTF_DISABLED, + RTF_DN, + RTF_DNTBLNSBDB, + RTF_DO, + RTF_DOBXCOLUMN, + RTF_DOBXMARGIN, + RTF_DOBXPAGE, + RTF_DOBYMARGIN, + RTF_DOBYPAGE, + RTF_DOBYPARA, + RTF_DOCCOMM, + RTF_DOCTEMP, + RTF_DOCTYPE, + RTF_DOCVAR, + RTF_DODHGT, + RTF_DOLOCK, + RTF_DONOTEMBEDLINGDATA, + RTF_DONOTEMBEDSYSFONT, + RTF_DONOTSHOWCOMMENTS, + RTF_DONOTSHOWINSDEL, + RTF_DONOTSHOWMARKUP, + RTF_DONOTSHOWPROPS, + RTF_DPAENDHOL, + RTF_DPAENDL, + RTF_DPAENDSOL, + RTF_DPAENDW, + RTF_DPARC, + RTF_DPARCFLIPX, + RTF_DPARCFLIPY, + RTF_DPASTARTHOL, + RTF_DPASTARTL, + RTF_DPASTARTSOL, + RTF_DPASTARTW, + RTF_DPCALLOUT, + RTF_DPCOA, + RTF_DPCOACCENT, + RTF_DPCOBESTFIT, + RTF_DPCOBORDER, + RTF_DPCODABS, + RTF_DPCODBOTTOM, + RTF_DPCODCENTER, + RTF_DPCODESCENT, + RTF_DPCODTOP, + RTF_DPCOLENGTH, + RTF_DPCOMINUSX, + RTF_DPCOMINUSY, + RTF_DPCOOFFSET, + RTF_DPCOSMARTA, + RTF_DPCOTDOUBLE, + RTF_DPCOTRIGHT, + RTF_DPCOTSINGLE, + RTF_DPCOTTRIPLE, + RTF_DPCOUNT, + RTF_DPELLIPSE, + RTF_DPENDGROUP, + RTF_DPFILLBGCB, + RTF_DPFILLBGCG, + RTF_DPFILLBGCR, + RTF_DPFILLBGGRAY, + RTF_DPFILLBGPAL, + RTF_DPFILLFGCB, + RTF_DPFILLFGCG, + RTF_DPFILLFGCR, + RTF_DPFILLFGGRAY, + RTF_DPFILLFGPAL, + RTF_DPFILLPAT, + RTF_DPGROUP, + RTF_DPLINE, + RTF_DPLINECOB, + RTF_DPLINECOG, + RTF_DPLINECOR, + RTF_DPLINEDADO, + RTF_DPLINEDADODO, + RTF_DPLINEDASH, + RTF_DPLINEDOT, + RTF_DPLINEGRAY, + RTF_DPLINEHOLLOW, + RTF_DPLINEPAL, + RTF_DPLINESOLID, + RTF_DPLINEW, + RTF_DPPOLYCOUNT, + RTF_DPPOLYGON, + RTF_DPPOLYLINE, + RTF_DPPTX, + RTF_DPPTY, + RTF_DPRECT, + RTF_DPROUNDR, + RTF_DPSHADOW, + RTF_DPSHADX, + RTF_DPSHADY, + RTF_DPTXBTLR, + RTF_DPTXBX, + RTF_DPTXBXMAR, + RTF_DPTXBXTEXT, + RTF_DPTXLRTB, + RTF_DPTXLRTBV, + RTF_DPTXTBRL, + RTF_DPTXTBRLV, + RTF_DPX, + RTF_DPXSIZE, + RTF_DPY, + RTF_DPYSIZE, + RTF_DROPCAPLI, + RTF_DROPCAPT, + RTF_DS, + RTF_DXFRTEXT, + RTF_DY, + RTF_EBCEND, + RTF_EBCSTART, + RTF_EDMINS, + RTF_EMBO, + RTF_EMDASH, + RTF_EMFBLIP, + RTF_EMSPACE, + RTF_ENDASH, + RTF_ENDDOC, + RTF_ENDNHERE, + RTF_ENDNOTES, + RTF_ENFORCEPROT, + RTF_ENSPACE, + RTF_EXPND, + RTF_EXPNDTW, + RTF_EXPSHRTN, + RTF_F, + RTF_FAAUTO, + RTF_FACENTER, + RTF_FACINGP, + RTF_FACTOIDNAME, + RTF_FAFIXED, + RTF_FAHANG, + RTF_FALT, + RTF_FAROMAN, + RTF_FAVAR, + RTF_FBIAS, + RTF_FBIDI, + RTF_FBIDIS, + RTF_FBIMAJOR, + RTF_FBIMINOR, + RTF_FCHARS, + RTF_FCHARSET, + RTF_FCS, + RTF_FDBMAJOR, + RTF_FDBMINOR, + RTF_FDECOR, + RTF_FELNBRELEV, + RTF_FET, + RTF_FETCH, + RTF_FFDEFRES, + RTF_FFDEFTEXT, + RTF_FFENTRYMCR, + RTF_FFEXITMCR, + RTF_FFFORMAT, + RTF_FFHASLISTBOX, + RTF_FFHELPTEXT, + RTF_FFHPS, + RTF_FFL, + RTF_FFMAXLEN, + RTF_FFNAME, + RTF_FFOWNHELP, + RTF_FFOWNSTAT, + RTF_FFPROT, + RTF_FFRECALC, + RTF_FFRES, + RTF_FFSIZE, + RTF_FFSTATTEXT, + RTF_FFTYPE, + RTF_FFTYPETXT, + RTF_FHIMAJOR, + RTF_FHIMINOR, + RTF_FI, + RTF_FID, + RTF_FIELD, + RTF_FILE, + RTF_FILETBL, + RTF_FITTEXT, + RTF_FJGOTHIC, + RTF_FJMINCHOU, + RTF_FLDALT, + RTF_FLDDIRTY, + RTF_FLDEDIT, + RTF_FLDINST, + RTF_FLDLOCK, + RTF_FLDPRIV, + RTF_FLDRSLT, + RTF_FLDTYPE, + RTF_FLOMAJOR, + RTF_FLOMINOR, + RTF_FMODERN, + RTF_FN, + RTF_FNAME, + RTF_FNETWORK, + RTF_FNIL, + RTF_FNONFILESYS, + RTF_FONTEMB, + RTF_FONTFILE, + RTF_FONTTBL, + RTF_FOOTER, + RTF_FOOTERF, + RTF_FOOTERL, + RTF_FOOTERR, + RTF_FOOTERY, + RTF_FOOTNOTE, + RTF_FORCEUPGRADE, + RTF_FORMDISP, + RTF_FORMFIELD, + RTF_FORMPROT, + RTF_FORMSHADE, + RTF_FOSNUM, + RTF_FPRQ, + RTF_FRACWIDTH, + RTF_FRELATIVE, + RTF_FRMTXBTLR, + RTF_FRMTXLRTB, + RTF_FRMTXLRTBV, + RTF_FRMTXTBRL, + RTF_FRMTXTBRLV, + RTF_FROMAN, + RTF_FROMHTML, + RTF_FROMTEXT, + RTF_FS, + RTF_FSCRIPT, + RTF_FSWISS, + RTF_FTECH, + RTF_FTNALT, + RTF_FTNBJ, + RTF_FTNCN, + RTF_FTNIL, + RTF_FTNLYTWNINE, + RTF_FTNNALC, + RTF_FTNNAR, + RTF_FTNNAUC, + RTF_FTNNCHI, + RTF_FTNNCHOSUNG, + RTF_FTNNCNUM, + RTF_FTNNDBAR, + RTF_FTNNDBNUM, + RTF_FTNNDBNUMD, + RTF_FTNNDBNUMK, + RTF_FTNNDBNUMT, + RTF_FTNNGANADA, + RTF_FTNNGBNUM, + RTF_FTNNGBNUMD, + RTF_FTNNGBNUMK, + RTF_FTNNGBNUML, + RTF_FTNNRLC, + RTF_FTNNRUC, + RTF_FTNNZODIAC, + RTF_FTNNZODIACD, + RTF_FTNNZODIACL, + RTF_FTNRESTART, + RTF_FTNRSTCONT, + RTF_FTNRSTPG, + RTF_FTNSEP, + RTF_FTNSEPC, + RTF_FTNSTART, + RTF_FTNTJ, + RTF_FTTRUETYPE, + RTF_FVALIDDOS, + RTF_FVALIDHPFS, + RTF_FVALIDMAC, + RTF_FVALIDNTFS, + RTF_G, + RTF_GCW, + RTF_GENERATOR, + RTF_GREEN, + RTF_GRFDOCEVENTS, + RTF_GRIDTBL, + RTF_GUTTER, + RTF_GUTTERPRL, + RTF_GUTTERSXN, + RTF_HEADER, + RTF_HEADERF, + RTF_HEADERL, + RTF_HEADERR, + RTF_HEADERY, + RTF_HICH, + RTF_HIGHLIGHT, + RTF_HL, + RTF_HLFR, + RTF_HLINKBASE, + RTF_HLLOC, + RTF_HLSRC, + RTF_HORZDOC, + RTF_HORZSECT, + RTF_HORZVERT, + RTF_HR, + RTF_HRES, + RTF_HRULE, + RTF_HSV, + RTF_HTMAUTSP, + RTF_HTMLBASE, + RTF_HTMLRTF, + RTF_HTMLTAG, + RTF_HWELEV, + RTF_HYPHAUTO, + RTF_HYPHCAPS, + RTF_HYPHCONSEC, + RTF_HYPHHOTZ, + RTF_HYPHPAR, + RTF_I, + RTF_ID, + RTF_IGNOREMIXEDCONTENT, + RTF_ILFOMACATCLNUP, + RTF_ILVL, + RTF_IMPR, + RTF_INDMIRROR, + RTF_INDRLSWELEVEN, + RTF_INFO, + RTF_INSRSID, + RTF_INTBL, + RTF_IPGP, + RTF_IROWBAND, + RTF_IROW, + RTF_ITAP, + RTF_IXE, + RTF_JCOMPRESS, + RTF_JEXPAND, + RTF_JIS, + RTF_JPEGBLIP, + RTF_JSKSU, + RTF_KEEP, + RTF_KEEPN, + RTF_KERNING, + RTF_KEYCODE, + RTF_KEYWORDS, + RTF_KRNPRSNET, + RTF_KSULANG, + RTF_JCLISTTAB, + RTF_LANDSCAPE, + RTF_LANG, + RTF_LANGFE, + RTF_LANGFENP, + RTF_LANGNP, + RTF_LASTROW, + RTF_LATENTSTYLES, + RTF_LBR, + RTF_LCHARS, + RTF_LDBLQUOTE, + RTF_LEVEL, + RTF_LEVELFOLLOW, + RTF_LEVELINDENT, + RTF_LEVELJC, + RTF_LEVELJCN, + RTF_LEVELLEGAL, + RTF_LEVELNFC, + RTF_LEVELNFCN, + RTF_LEVELNORESTART, + RTF_LEVELNUMBERS, + RTF_LEVELOLD, + RTF_LEVELPICTURE, + RTF_LEVELPICTURENOSIZE, + RTF_LEVELPREV, + RTF_LEVELPREVSPACE, + RTF_LEVELSPACE, + RTF_LEVELSTARTAT, + RTF_LEVELTEMPLATEID, + RTF_LEVELTEXT, + RTF_LFOLEVEL, + RTF_LI, + RTF_LINE, + RTF_LINEBETCOL, + RTF_LINECONT, + RTF_LINEMOD, + RTF_LINEPPAGE, + RTF_LINERESTART, + RTF_LINESTART, + RTF_LINESTARTS, + RTF_LINEX, + RTF_LINKSELF, + RTF_LINKSTYLES, + RTF_LINKVAL, + RTF_LIN, + RTF_LISA, + RTF_LISB, + RTF_LIST, + RTF_LISTHYBRID, + RTF_LISTID, + RTF_LISTLEVEL, + RTF_LISTNAME, + RTF_LISTOVERRIDE, + RTF_LISTOVERRIDECOUNT, + RTF_LISTOVERRIDEFORMAT, + RTF_LISTOVERRIDESTARTAT, + RTF_LISTOVERRIDETABLE, + RTF_LISTPICTURE, + RTF_LISTRESTARTHDN, + RTF_LISTSIMPLE, + RTF_LISTSTYLEID, + RTF_LISTSTYLENAME, + RTF_LISTTABLE, + RTF_LISTTEMPLATEID, + RTF_LISTTEXT, + RTF_LNBRKRULE, + RTF_LNDSCPSXN, + RTF_LNONGRID, + RTF_LOCH, + RTF_LQUOTE, + RTF_LS, + RTF_LSDLOCKED, + RTF_LSDLOCKEDDEF, + RTF_LSDLOCKEDEXCEPT, + RTF_LSDPRIORITY, + RTF_LSDPRIORITYDEF, + RTF_LSDQFORMAT, + RTF_LSDQFORMATDEF, + RTF_LSDSEMIHIDDEN, + RTF_LSDSEMIHIDDENDEF, + RTF_LSDSTIMAX, + RTF_LSDUNHIDEUSED, + RTF_LSDUNHIDEUSEDDEF, + RTF_LTRCH, + RTF_LTRDOC, + RTF_LTRMARK, + RTF_LTRPAR, + RTF_LTRROW, + RTF_LTRSECT, + RTF_LVLTENTATIVE, + RTF_LYTCALCTBLWD, + RTF_LYTEXCTTP, + RTF_LYTPRTMET, + RTF_LYTTBLRTGR, + RTF_MAC, + RTF_MACC, + RTF_MACCPR, + RTF_MACPICT, + RTF_MAILMERGE, + RTF_MAKEBACKUP, + RTF_MALN, + RTF_MALNSCR, + RTF_MANAGER, + RTF_MARGB, + RTF_MARGBSXN, + RTF_MARGL, + RTF_MARGLSXN, + RTF_MARGMIRROR, + RTF_MARGMIRSXN, + RTF_MARGPR, + RTF_MARGR, + RTF_MARGRSXN, + RTF_MARGSZ, + RTF_MARGT, + RTF_MARGTSXN, + RTF_MBAR, + RTF_MBARPR, + RTF_MBASEJC, + RTF_MBEGCHR, + RTF_MBORDERBOX, + RTF_MBORDERBOXPR, + RTF_MBOX, + RTF_MBOXPR, + RTF_MBRK, + RTF_MBRKBIN, + RTF_MBRKBINSUB, + RTF_MCGP, + RTF_MCGPRULE, + RTF_MCHR, + RTF_MCOUNT, + RTF_MCSP, + RTF_MCTRLPR, + RTF_MD, + RTF_MDEFJC, + RTF_MDEG, + RTF_MDEGHIDE, + RTF_MDEN, + RTF_MDIFF, + RTF_MDIFFSTY, + RTF_MDISPDEF, + RTF_MDPR, + RTF_ME, + RTF_MENDCHR, + RTF_MEQARR, + RTF_MEQARRPR, + RTF_MF, + RTF_MFNAME, + RTF_MFPR, + RTF_MFUNC, + RTF_MFUNCPR, + RTF_MGROUPCHR, + RTF_MGROUPCHRPR, + RTF_MGROW, + RTF_MHIDEBOT, + RTF_MHIDELEFT, + RTF_MHIDERIGHT, + RTF_MHIDETOP, + RTF_MHTMLTAG, + RTF_MIN, + RTF_MINTERSP, + RTF_MINTLIM, + RTF_MINTRASP, + RTF_MJC, + RTF_MLIM, + RTF_MLIMLOC, + RTF_MLIMLOW, + RTF_MLIMLOWPR, + RTF_MLIMUPP, + RTF_MLIMUPPPR, + RTF_MLIT, + RTF_MLMARGIN, + RTF_MM, + RTF_MMADDFIELDNAME, + RTF_MMATH, + RTF_MMATHFONT, + RTF_MMATHPICT, + RTF_MMATHPR, + RTF_MMATTACH, + RTF_MMAXDIST, + RTF_MMBLANKLINES, + RTF_MMC, + RTF_MMCJC, + RTF_MMCONNECTSTR, + RTF_MMCONNECTSTRDATA, + RTF_MMCPR, + RTF_MMCS, + RTF_MMDATASOURCE, + RTF_MMDATATYPEACCESS, + RTF_MMDATATYPEEXCEL, + RTF_MMDATATYPEFILE, + RTF_MMDATATYPEODBC, + RTF_MMDATATYPEODSO, + RTF_MMDATATYPEQT, + RTF_MMDEFAULTSQL, + RTF_MMDESTEMAIL, + RTF_MMDESTFAX, + RTF_MMDESTNEWDOC, + RTF_MMDESTPRINTER, + RTF_MMERRORS, + RTF_MMFTTYPEADDRESS, + RTF_MMFTTYPEBARCODE, + RTF_MMFTTYPEDBCOLUMN, + RTF_MMFTTYPEMAPPED, + RTF_MMFTTYPENULL, + RTF_MMFTTYPESALUTATION, + RTF_MMHEADERSOURCE, + RTF_MMJDSOTYPE, + RTF_MMLINKTOQUERY, + RTF_MMMAILSUBJECT, + RTF_MMMAINTYPECATALOG, + RTF_MMMAINTYPEEMAIL, + RTF_MMMAINTYPEENVELOPES, + RTF_MMMAINTYPEFAX, + RTF_MMMAINTYPELABELS, + RTF_MMMAINTYPELETTERS, + RTF_MMODSO, + RTF_MMODSOACTIVE, + RTF_MMODSOCOLDELIM, + RTF_MMODSOCOLUMN, + RTF_MMODSODYNADDR, + RTF_MMODSOFHDR, + RTF_MMODSOFILTER, + RTF_MMODSOFLDMPDATA, + RTF_MMODSOFMCOLUMN, + RTF_MMODSOHASH, + RTF_MMODSOLID, + RTF_MMODSOMAPPEDNAME, + RTF_MMODSONAME, + RTF_MMODSORECIPDATA, + RTF_MMODSOSORT, + RTF_MMODSOSRC, + RTF_MMODSOTABLE, + RTF_MMODSOUDL, + RTF_MMODSOUDLDATA, + RTF_MMODSOUNIQUETAG, + RTF_MMPR, + RTF_MMQUERY, + RTF_MMR, + RTF_MMRECCUR, + RTF_MMSHOWDATA, + RTF_MNARY, + RTF_MNARYLIM, + RTF_MNARYPR, + RTF_MNOBREAK, + RTF_MNOR, + RTF_MNUM, + RTF_MO, + RTF_MOBJDIST, + RTF_MOMATH, + RTF_MOMATHPARA, + RTF_MOMATHPARAPR, + RTF_MOPEMU, + RTF_MPHANT, + RTF_MPHANTPR, + RTF_MPLCHIDE, + RTF_MPOS, + RTF_MPOSTSP, + RTF_MPRESP, + RTF_MR, + RTF_MRAD, + RTF_MRADPR, + RTF_MRMARGIN, + RTF_MRPR, + RTF_MRSP, + RTF_MRSPRULE, + RTF_MSCR, + RTF_MSEPCHR, + RTF_MSHOW, + RTF_MSHP, + RTF_MSMALLFRAC, + RTF_MSMCAP, + RTF_MSPRE, + RTF_MSPREPR, + RTF_MSSUB, + RTF_MSSUBPR, + RTF_MSSUBSUP, + RTF_MSSUBSUPPR, + RTF_MSSUP, + RTF_MSSUPPR, + RTF_MSTRIKEBLTR, + RTF_MSTRIKEH, + RTF_MSTRIKETLBR, + RTF_MSTRIKEV, + RTF_MSTY, + RTF_MSUB, + RTF_MSUBHIDE, + RTF_MSUP, + RTF_MSUPHIDE, + RTF_MTRANSP, + RTF_MTYPE, + RTF_MUSER, + RTF_MVAUTH, + RTF_MVDATE, + RTF_MVERTJC, + RTF_MVF, + RTF_MVFMF, + RTF_MVFML, + RTF_MVT, + RTF_MVTOF, + RTF_MVTOL, + RTF_MWRAPINDENT, + RTF_MWRAPRIGHT, + RTF_MZEROASC, + RTF_MZERODESC, + RTF_MZEROWID, + RTF_NESTCELL, + RTF_NESTROW, + RTF_NESTTABLEPROPS, + RTF_NEWTBLSTYRULS, + RTF_NEXTFILE, + RTF_NOAFCNSTTBL, + RTF_NOBRKWRPTBL, + RTF_NOCOLBAL, + RTF_NOCOMPATOPTIONS, + RTF_NOCWRAP, + RTF_NOCXSPTABLE, + RTF_NOEXTRASPRL, + RTF_NOFCHARS, + RTF_NOFCHARSWS, + RTF_NOFEATURETHROTTLE, + RTF_NOFPAGES, + RTF_NOFWORDS, + RTF_NOGROWAUTOFIT, + RTF_NOINDNMBRTS, + RTF_NOJKERNPUNCT, + RTF_NOLEAD, + RTF_NOLINE, + RTF_NOLNHTADJTBL, + RTF_NONESTTABLES, + RTF_NONSHPPICT, + RTF_NOOVERFLOW, + RTF_NOPROOF, + RTF_NOQFPROMOTE, + RTF_NOSECTEXPAND, + RTF_NOSNAPLINEGRID, + RTF_NOSPACEFORUL, + RTF_NOSUPERSUB, + RTF_NOTABIND, + RTF_NOTBRKCNSTFRCTBL, + RTF_NOTCVASP, + RTF_NOTVATXBX, + RTF_NOUICOMPAT, + RTF_NOULTRLSPC, + RTF_NOWIDCTLPAR, + RTF_NOWRAP, + RTF_NOWWRAP, + RTF_NOXLATTOYEN, + RTF_OBJALIAS, + RTF_OBJALIGN, + RTF_OBJATTPH, + RTF_OBJAUTLINK, + RTF_OBJCLASS, + RTF_OBJCROPB, + RTF_OBJCROPL, + RTF_OBJCROPR, + RTF_OBJCROPT, + RTF_OBJDATA, + RTF_OBJECT, + RTF_OBJEMB, + RTF_OBJH, + RTF_OBJHTML, + RTF_OBJICEMB, + RTF_OBJLINK, + RTF_OBJLOCK, + RTF_OBJNAME, + RTF_OBJOCX, + RTF_OBJPUB, + RTF_OBJSCALEX, + RTF_OBJSCALEY, + RTF_OBJSECT, + RTF_OBJSETSIZE, + RTF_OBJSUB, + RTF_OBJTIME, + RTF_OBJTRANSY, + RTF_OBJUPDATE, + RTF_OBJW, + RTF_OGUTTER, + RTF_OLDAS, + RTF_OLDCPROPS, + RTF_OLDLINEWRAP, + RTF_OLDPPROPS, + RTF_OLDSPROPS, + RTF_OLDTPROPS, + RTF_OLECLSID, + RTF_OPERATOR, + RTF_OTBLRUL, + RTF_OUTL, + RTF_OUTLINELEVEL, + RTF_OVERLAY, + RTF_PAGE, + RTF_PAGEBB, + RTF_PANOSE, + RTF_PAPERH, + RTF_PAPERW, + RTF_PAR, + RTF_PARARSID, + RTF_PARD, + RTF_PASSWORD, + RTF_PASSWORDHASH, + RTF_PC, + RTF_PCA, + RTF_PGBRDRB, + RTF_PGBRDRFOOT, + RTF_PGBRDRHEAD, + RTF_PGBRDRL, + RTF_PGBRDROPT, + RTF_PGBRDRR, + RTF_PGBRDRSNAP, + RTF_PGBRDRT, + RTF_PGHSXN, + RTF_PGNBIDIA, + RTF_PGNBIDIB, + RTF_PGNCHOSUNG, + RTF_PGNCNUM, + RTF_PGNCONT, + RTF_PGNDBNUM, + RTF_PGNDBNUMD, + RTF_PGNDBNUMK, + RTF_PGNDBNUMT, + RTF_PGNDEC, + RTF_PGNDECD, + RTF_PGNGANADA, + RTF_PGNGBNUM, + RTF_PGNGBNUMD, + RTF_PGNGBNUMK, + RTF_PGNGBNUML, + RTF_PGNHINDIA, + RTF_PGNHINDIB, + RTF_PGNHINDIC, + RTF_PGNHINDID, + RTF_PGNHN, + RTF_PGNHNSC, + RTF_PGNHNSH, + RTF_PGNHNSM, + RTF_PGNHNSN, + RTF_PGNHNSP, + RTF_PGNID, + RTF_PGNLCLTR, + RTF_PGNLCRM, + RTF_PGNRESTART, + RTF_PGNSTART, + RTF_PGNSTARTS, + RTF_PGNTHAIA, + RTF_PGNTHAIB, + RTF_PGNTHAIC, + RTF_PGNUCLTR, + RTF_PGNUCRM, + RTF_PGNVIETA, + RTF_PGNX, + RTF_PGNY, + RTF_PGNZODIAC, + RTF_PGNZODIACD, + RTF_PGNZODIACL, + RTF_PGP, + RTF_PGPTBL, + RTF_PGWSXN, + RTF_PHCOL, + RTF_PHMRG, + RTF_PHPG, + RTF_PICBMP, + RTF_PICBPP, + RTF_PICCROPB, + RTF_PICCROPL, + RTF_PICCROPR, + RTF_PICCROPT, + RTF_PICH, + RTF_PICHGOAL, + RTF_PICPROP, + RTF_PICSCALED, + RTF_PICSCALEX, + RTF_PICSCALEY, + RTF_PICT, + RTF_PICW, + RTF_PICWGOAL, + RTF_PINDTABQC, + RTF_PINDTABQL, + RTF_PINDTABQR, + RTF_PLAIN, + RTF_PMARTABQC, + RTF_PMARTABQL, + RTF_PMARTABQR, + RTF_PMMETAFILE, + RTF_PN, + RTF_PNACROSS, + RTF_PNAIU, + RTF_PNAIUD, + RTF_PNAIUEO, + RTF_PNAIUEOD, + RTF_PNB, + RTF_PNBIDIA, + RTF_PNBIDIB, + RTF_PNCAPS, + RTF_PNCARD, + RTF_PNCF, + RTF_PNCHOSUNG, + RTF_PNCNUM, + RTF_PNDBNUM, + RTF_PNDBNUMD, + RTF_PNDBNUMK, + RTF_PNDBNUML, + RTF_PNDBNUMT, + RTF_PNDEC, + RTF_PNDECD, + RTF_PNF, + RTF_PNFS, + RTF_PNGANADA, + RTF_PNGBLIP, + RTF_PNGBNUM, + RTF_PNGBNUMD, + RTF_PNGBNUMK, + RTF_PNGBNUML, + RTF_PNHANG, + RTF_PNI, + RTF_PNINDENT, + RTF_PNIROHA, + RTF_PNIROHAD, + RTF_PNLCLTR, + RTF_PNLCRM, + RTF_PNLVL, + RTF_PNLVLBLT, + RTF_PNLVLBODY, + RTF_PNLVLCONT, + RTF_PNNUMONCE, + RTF_PNORD, + RTF_PNORDT, + RTF_PNPREV, + RTF_PNQC, + RTF_PNQL, + RTF_PNQR, + RTF_PNRAUTH, + RTF_PNRDATE, + RTF_PNRESTART, + RTF_PNRNFC, + RTF_PNRNOT, + RTF_PNRPNBR, + RTF_PNRRGB, + RTF_PNRSTART, + RTF_PNRSTOP, + RTF_PNRXST, + RTF_PNSCAPS, + RTF_PNSECLVL, + RTF_PNSP, + RTF_PNSTART, + RTF_PNSTRIKE, + RTF_PNTEXT, + RTF_PNTXTA, + RTF_PNTXTB, + RTF_PNUCLTR, + RTF_PNUCRM, + RTF_PNUL, + RTF_PNULD, + RTF_PNULDASH, + RTF_PNULDASHD, + RTF_PNULDASHDD, + RTF_PNULDB, + RTF_PNULHAIR, + RTF_PNULNONE, + RTF_PNULTH, + RTF_PNULW, + RTF_PNULWAVE, + RTF_PNZODIAC, + RTF_PNZODIACD, + RTF_PNZODIACL, + RTF_POSNEGX, + RTF_POSNEGY, + RTF_POSX, + RTF_POSXC, + RTF_POSXI, + RTF_POSXL, + RTF_POSXO, + RTF_POSXR, + RTF_POSY, + RTF_POSYB, + RTF_POSYC, + RTF_POSYIL, + RTF_POSYIN, + RTF_POSYOUT, + RTF_POSYT, + RTF_PRAUTH, + RTF_PRCOLBL, + RTF_PRDATE, + RTF_PRINTDATA, + RTF_PRINTIM, + RTF_PRIVATE, + RTF_PROPNAME, + RTF_PROPTYPE, + RTF_PROTECT, + RTF_PROTEND, + RTF_PROTLEVEL, + RTF_PROTSTART, + RTF_PROTUSERTBL, + RTF_PSOVER, + RTF_PSZ, + RTF_PTABLDOT, + RTF_PTABLMDOT, + RTF_PTABLMINUS, + RTF_PTABLNONE, + RTF_PTABLUSCORE, + RTF_PUBAUTO, + RTF_PVMRG, + RTF_PVPARA, + RTF_PVPG, + RTF_PWD, + RTF_PXE, + RTF_QC, + RTF_QD, + RTF_QJ, + RTF_QK, + RTF_QL, + RTF_QMSPACE, + RTF_QR, + RTF_QT, + RTF_RAWCLBGDKBDIAG, + RTF_RAWCLBGBDIAG, + RTF_RAWCLBGCROSS, + RTF_RAWCLBGDCROSS, + RTF_RAWCLBGDKCROSS, + RTF_RAWCLBGDKDCROSS, + RTF_RAWCLBGDKFDIAG, + RTF_RAWCLBGDKHOR, + RTF_RAWCLBGDKVERT, + RTF_RAWCLBGFDIAG, + RTF_RAWCLBGHORIZ, + RTF_RAWCLBGVERT, + RTF_RDBLQUOTE, + RTF_READONLYRECOMMENDED, + RTF_READPROT, + RTF_RED, + RTF_RELYONVML, + RTF_REMDTTM, + RTF_REMPERSONALINFO, + RTF_RESULT, + RTF_REVAUTH, + RTF_REVAUTHDEL, + RTF_REVBAR, + RTF_REVDTTM, + RTF_REVDTTMDEL, + RTF_REVISED, + RTF_REVISIONS, + RTF_REVPROP, + RTF_REVPROT, + RTF_REVTBL, + RTF_REVTIM, + RTF_RI, + RTF_RIN, + RTF_ROW, + RTF_RQUOTE, + RTF_RSID, + RTF_RSIDROOT, + RTF_RSIDTBL, + RTF_RSLTBMP, + RTF_RSLTHTML, + RTF_RSLTMERGE, + RTF_RSLTPICT, + RTF_RSLTRTF, + RTF_RSLTTXT, + RTF_RTF, + RTF_RTLCH, + RTF_RTLDOC, + RTF_RTLGUTTER, + RTF_RTLMARK, + RTF_RTLPAR, + RTF_RTLROW, + RTF_RTLSECT, + RTF_RXE, + RTF_S, + RTF_SA, + RTF_SAAUTO, + RTF_SAFTNNALC, + RTF_SAFTNNAR, + RTF_SAFTNNAUC, + RTF_SAFTNNCHI, + RTF_SAFTNNCHOSUNG, + RTF_SAFTNNCNUM, + RTF_SAFTNNDBAR, + RTF_SAFTNNDBNUM, + RTF_SAFTNNDBNUMD, + RTF_SAFTNNDBNUMK, + RTF_SAFTNNDBNUMT, + RTF_SAFTNNGANADA, + RTF_SAFTNNGBNUM, + RTF_SAFTNNGBNUMD, + RTF_SAFTNNGBNUMK, + RTF_SAFTNNGBNUML, + RTF_SAFTNNRLC, + RTF_SAFTNNRUC, + RTF_SAFTNNZODIAC, + RTF_SAFTNNZODIACD, + RTF_SAFTNNZODIACL, + RTF_SAFTNRESTART, + RTF_SAFTNRSTCONT, + RTF_SAFTNSTART, + RTF_SAUTOUPD, + RTF_SAVEINVALIDXML, + RTF_SAVEPREVPICT, + RTF_SB, + RTF_SBASEDON, + RTF_SBAUTO, + RTF_SBKCOL, + RTF_SBKEVEN, + RTF_SBKNONE, + RTF_SBKODD, + RTF_SBKPAGE, + RTF_SBYS, + RTF_SCAPS, + RTF_SCOMPOSE, + RTF_SEC, + RTF_SECT, + RTF_SECTD, + RTF_SECTDEFAULTCL, + RTF_SECTEXPAND, + RTF_SECTLINEGRID, + RTF_SECTNUM, + RTF_SECTRSID, + RTF_SECTSPECIFYCL, + RTF_SECTSPECIFYGENN, + RTF_SECTSPECIFYL, + RTF_SECTUNLOCKED, + RTF_SFTNBJ, + RTF_SFTNNALC, + RTF_SFTNNAR, + RTF_SFTNNAUC, + RTF_SFTNNCHI, + RTF_SFTNNCHOSUNG, + RTF_SFTNNCNUM, + RTF_SFTNNDBAR, + RTF_SFTNNDBNUM, + RTF_SFTNNDBNUMD, + RTF_SFTNNDBNUMK, + RTF_SFTNNDBNUMT, + RTF_SFTNNGANADA, + RTF_SFTNNGBNUM, + RTF_SFTNNGBNUMD, + RTF_SFTNNGBNUMK, + RTF_SFTNNGBNUML, + RTF_SFTNNRLC, + RTF_SFTNNRUC, + RTF_SFTNNZODIAC, + RTF_SFTNNZODIACD, + RTF_SFTNNZODIACL, + RTF_SFTNRESTART, + RTF_SFTNRSTCONT, + RTF_SFTNRSTPG, + RTF_SFTNSTART, + RTF_SFTNTJ, + RTF_SHAD, + RTF_SHADING, + RTF_SHIDDEN, + RTF_SHIFT, + RTF_SHOWPLACEHOLDTEXT, + RTF_SHOWXMLERRORS, + RTF_SHP, + RTF_SHPBOTTOM, + RTF_SHPBXCOLUMN, + RTF_SHPBXIGNORE, + RTF_SHPBXMARGIN, + RTF_SHPBXPAGE, + RTF_SHPBYIGNORE, + RTF_SHPBYMARGIN, + RTF_SHPBYPAGE, + RTF_SHPBYPARA, + RTF_SHPFBLWTXT, + RTF_SHPFHDR, + RTF_SHPGRP, + RTF_SHPINST, + RTF_SHPLEFT, + RTF_SHPLID, + RTF_SHPLOCKANCHOR, + RTF_SHPPICT, + RTF_SHPRIGHT, + RTF_SHPRSLT, + RTF_SHPTOP, + RTF_SHPTXT, + RTF_SHPWRK, + RTF_SHPWR, + RTF_SHPZ, + RTF_SL, + RTF_SLINK, + RTF_SLMULT, + RTF_SLOCKED, + RTF_SN, + RTF_SNAPTOGRIDINCELL, + RTF_SNEXT, + RTF_SOFTCOL, + RTF_SOFTLHEIGHT, + RTF_SOFTLINE, + RTF_SOFTPAGE, + RTF_SP, + RTF_SPERSONAL, + RTF_SPLTPGPAR, + RTF_SPLYTWNINE, + RTF_SPRIORITY, + RTF_SPRSBSP, + RTF_SPRSLNSP, + RTF_SPRSSPBF, + RTF_SPRSTSM, + RTF_SPRSTSP, + RTF_SPV, + RTF_SQFORMAT, + RTF_SRAUTH, + RTF_SRDATE, + RTF_SREPLY, + RTF_SSEMIHIDDEN, + RTF_STATICVAL, + RTF_STEXTFLOW, + RTF_STRIKE, + RTF_STRIKED, + RTF_STSHFBI, + RTF_STSHFDBCH, + RTF_STSHFHICH, + RTF_STSHFLOCH, + RTF_STYLELOCK, + RTF_STYLELOCKBACKCOMP, + RTF_STYLELOCKENFORCED, + RTF_STYLELOCKQFSET, + RTF_STYLELOCKTHEME, + RTF_STYLESHEET, + RTF_STYLESORTMETHOD, + RTF_STYRSID, + RTF_SUB, + RTF_SUBDOCUMENT, + RTF_SUBFONTBYSIZE, + RTF_SUBJECT, + RTF_SUNHIDEUSED, + RTF_SUPER, + RTF_SV, + RTF_SVB, + RTF_SWPBDR, + RTF_TAB, + RTF_TABSNOOVRLP, + RTF_TAPRTL, + RTF_TB, + RTF_TBLIND, + RTF_TBLINDTYPE, + RTF_TBLLKBESTFIT, + RTF_TBLLKBORDER, + RTF_TBLLKCOLOR, + RTF_TBLLKFONT, + RTF_TBLLKHDRCOLS, + RTF_TBLLKHDRROWS, + RTF_TBLLKLASTCOL, + RTF_TBLLKLASTROW, + RTF_TBLLKNOCOLBAND, + RTF_TBLLKNOROWBAND, + RTF_TBLLKSHADING, + RTF_TBLRSID, + RTF_TC, + RTF_TCELLD, + RTF_TCF, + RTF_TCL, + RTF_TCN, + RTF_TDFRMTXTBOTTOM, + RTF_TDFRMTXTLEFT, + RTF_TDFRMTXTRIGHT, + RTF_TDFRMTXTTOP, + RTF_TEMPLATE, + RTF_THEMEDATA, + RTF_THEMELANG, + RTF_THEMELANGCS, + RTF_THEMELANGFE, + RTF_TIME, + RTF_TITLE, + RTF_TITLEPG, + RTF_TLDOT, + RTF_TLEQ, + RTF_TLHYPH, + RTF_TLMDOT, + RTF_TLTH, + RTF_TLUL, + RTF_TOPLINEPUNCT, + RTF_TPHCOL, + RTF_TPHMRG, + RTF_TPHPG, + RTF_TPOSNEGX, + RTF_TPOSNEGY, + RTF_TPOSXC, + RTF_TPOSXI, + RTF_TPOSXL, + RTF_TPOSX, + RTF_TPOSXO, + RTF_TPOSXR, + RTF_TPOSY, + RTF_TPOSYB, + RTF_TPOSYC, + RTF_TPOSYIL, + RTF_TPOSYIN, + RTF_TPOSYOUT, + RTF_TPOSYT, + RTF_TPVMRG, + RTF_TPVPARA, + RTF_TPVPG, + RTF_TQC, + RTF_TQDEC, + RTF_TQR, + RTF_TRACKFORMATTING, + RTF_TRACKMOVES, + RTF_TRANSMF, + RTF_TRAUTH, + RTF_TRAUTOFIT, + RTF_TRBGBDIAG, + RTF_TRBGCROSS, + RTF_TRBGDCROSS, + RTF_TRBGDKBDIAG, + RTF_TRBGDKCROSS, + RTF_TRBGDKDCROSS, + RTF_TRBGDKFDIAG, + RTF_TRBGDKHOR, + RTF_TRBGDKVERT, + RTF_TRBGFDIAG, + RTF_TRBGHORIZ, + RTF_TRBGVERT, + RTF_TRBRDRB, + RTF_TRBRDRH, + RTF_TRBRDRL, + RTF_TRBRDRR, + RTF_TRBRDRT, + RTF_TRBRDRV, + RTF_TRCBPAT, + RTF_TRCFPAT, + RTF_TRDATE, + RTF_TRFTSWIDTHA, + RTF_TRFTSWIDTHB, + RTF_TRFTSWIDTH, + RTF_TRGAPH, + RTF_TRHDR, + RTF_TRKEEP, + RTF_TRKEEPFOLLOW, + RTF_TRLEFT, + RTF_TROWD, + RTF_TRPADDB, + RTF_TRPADDFB, + RTF_TRPADDFL, + RTF_TRPADDFR, + RTF_TRPADDFT, + RTF_TRPADDL, + RTF_TRPADDR, + RTF_TRPADDT, + RTF_TRPADOB, + RTF_TRPADOFB, + RTF_TRPADOFL, + RTF_TRPADOFR, + RTF_TRPADOFT, + RTF_TRPADOL, + RTF_TRPADOR, + RTF_TRPADOT, + RTF_TRPAT, + RTF_TRQC, + RTF_TRQL, + RTF_TRQR, + RTF_TRRH, + RTF_TRSHDNG, + RTF_TRSPDB, + RTF_TRSPDFB, + RTF_TRSPDFL, + RTF_TRSPDFR, + RTF_TRSPDFT, + RTF_TRSPDL, + RTF_TRSPDR, + RTF_TRSPDT, + RTF_TRSPOB, + RTF_TRSPOFB, + RTF_TRSPOFL, + RTF_TRSPOFR, + RTF_TRSPOFT, + RTF_TRSPOL, + RTF_TRSPOR, + RTF_TRSPOT, + RTF_TRUNCATEFONTHEIGHT, + RTF_TRUNCEX, + RTF_TRWWIDTHA, + RTF_TRWWIDTHB, + RTF_TRWWIDTH, + RTF_TS, + RTF_TSBGBDIAG, + RTF_TSBGCROSS, + RTF_TSBGDCROSS, + RTF_TSBGDKBDIAG, + RTF_TSBGDKCROSS, + RTF_TSBGDKDCROSS, + RTF_TSBGDKFDIAG, + RTF_TSBGDKHOR, + RTF_TSBGDKVERT, + RTF_TSBGFDIAG, + RTF_TSBGHORIZ, + RTF_TSBGVERT, + RTF_TSBRDRB, + RTF_TSBRDRDGL, + RTF_TSBRDRDGR, + RTF_TSBRDRH, + RTF_TSBRDRL, + RTF_TSBRDRR, + RTF_TSBRDRT, + RTF_TSBRDRV, + RTF_TSCBANDHORZEVEN, + RTF_TSCBANDHORZODD, + RTF_TSCBANDSH, + RTF_TSCBANDSV, + RTF_TSCBANDVERTEVEN, + RTF_TSCBANDVERTODD, + RTF_TSCELLCBPAT, + RTF_TSCELLCFPAT, + RTF_TSCELLPADDB, + RTF_TSCELLPADDFB, + RTF_TSCELLPADDFL, + RTF_TSCELLPADDFR, + RTF_TSCELLPADDFT, + RTF_TSCELLPADDL, + RTF_TSCELLPADDR, + RTF_TSCELLPADDT, + RTF_TSCELLPCT, + RTF_TSCELLWIDTH, + RTF_TSCELLWIDTHFTS, + RTF_TSCFIRSTCOL, + RTF_TSCFIRSTROW, + RTF_TSCLASTCOL, + RTF_TSCLASTROW, + RTF_TSCNECELL, + RTF_TSCNWCELL, + RTF_TSCSECELL, + RTF_TSCSWCELL, + RTF_TSD, + RTF_TSNOWRAP, + RTF_TSROWD, + RTF_TSVERTALB, + RTF_TSVERTALC, + RTF_TSVERTALT, + RTF_TWOINONE, + RTF_TWOONONE, + RTF_TX, + RTF_TXBXTWALWAYS, + RTF_TXBXTWFIRST, + RTF_TXBXTWFIRSTLAST, + RTF_TXBXTWLAST, + RTF_TXBXTWNO, + RTF_TXE, + RTF_U, + RTF_UC, + RTF_UD, + RTF_UL, + RTF_ULC, + RTF_ULD, + RTF_ULDASH, + RTF_ULDASHD, + RTF_ULDASHDD, + RTF_ULDB, + RTF_ULHAIR, + RTF_ULHWAVE, + RTF_ULLDASH, + RTF_ULNONE, + RTF_ULTH, + RTF_ULTHD, + RTF_ULTHDASH, + RTF_ULTHDASHD, + RTF_ULTHDASHDD, + RTF_ULTHLDASH, + RTF_ULULDBWAVE, + RTF_ULW, + RTF_ULWAVE, + RTF_UP, + RTF_UPR, + RTF_URTF, + RTF_USELTBALN, + RTF_USENORMSTYFORLIST, + RTF_USERPROPS, + RTF_USEXFORM, + RTF_UTINL, + RTF_V, + RTF_VALIDATEXML, + RTF_VERN, + RTF_VERSION, + RTF_VERTAL, + RTF_VERTALB, + RTF_VERTALC, + RTF_VERTALJ, + RTF_VERTALT, + RTF_VERTDOC, + RTF_VERTSECT, + RTF_VIEWBKSP, + RTF_VIEWKIND, + RTF_VIEWNOBOUND, + RTF_VIEWSCALE, + RTF_VIEWZK, + RTF_WBITMAP, + RTF_WBMBITSPIXEL, + RTF_WBMPLANES, + RTF_WBMWIDTHBYTE, + RTF_WEBHIDDEN, + RTF_WGRFFMTFILTER, + RTF_WIDCTLPAR, + RTF_WIDOWCTRL, + RTF_WINDOWCAPTION, + RTF_WMETAFILE, + RTF_WPEQN, + RTF_WPJST, + RTF_WPSP, + RTF_WRAPAROUND, + RTF_WRAPDEFAULT, + RTF_WRAPTHROUGH, + RTF_WRAPTIGHT, + RTF_WRAPTRSP, + RTF_WRITERESERVATION, + RTF_WRITERESERVHASH, + RTF_WRPPUNCT, + RTF_XE, + RTF_XEF, + RTF_XFORM, + RTF_XMLATTR, + RTF_XMLATTRNAME, + RTF_XMLATTRNS, + RTF_XMLATTRVALUE, + RTF_XMLCLOSE, + RTF_XMLNAME, + RTF_XMLNS, + RTF_XMLNSTBL, + RTF_XMLOPEN, + RTF_XMLSDTTCELL, + RTF_XMLSDTTPARA, + RTF_XMLSDTTREGULAR, + RTF_XMLSDTTROW, + RTF_XMLSDTTUNKNOWN, + RTF_YR, + RTF_YTS, + RTF_YXE, + RTF_ZWBO, + RTF_ZWJ, + RTF_ZWNBO, + RTF_ZWNJ +}; + +} // namespace rtftok +} // namespace writerfilter + +#endif // _RTFCONTROLWORDS_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfdocumentfactory.cxx b/writerfilter/source/rtftok/rtfdocumentfactory.cxx new file mode 100644 index 000000000000..a397565c085d --- /dev/null +++ b/writerfilter/source/rtftok/rtfdocumentfactory.cxx @@ -0,0 +1,44 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include <rtfdocumentimpl.hxx> + +namespace writerfilter { +namespace rtftok { + +RTFDocument::Pointer_t RTFDocumentFactory::createDocument(uno::Reference< uno::XComponentContext > const & xContext, + uno::Reference< io::XInputStream > const & xInputStream, + uno::Reference< lang::XComponent > const & xDstDoc, + uno::Reference< frame::XFrame > const & xFrame) +{ + return RTFDocument::Pointer_t(new RTFDocumentImpl(xContext, xInputStream, xDstDoc, xFrame)); +} + +} // namespace rtftok +} // namespace writerfilter + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx new file mode 100644 index 000000000000..930059d431d0 --- /dev/null +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -0,0 +1,2547 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include <rtfdocumentimpl.hxx> +#include <rtftypes.hxx> +#include <rtfcontrolwords.hxx> +#include <rtfvalue.hxx> +#include <rtfsprm.hxx> +#include <rtfreferenceproperties.hxx> +#include <doctok/sprmids.hxx> // NS_sprm namespace +#include <doctok/resourceids.hxx> // NS_rtf namespace +#include <ooxml/resourceids.hxx> // NS_ooxml namespace +#include <ooxml/OOXMLFastTokens.hxx> // ooxml namespace +#include <unotools/ucbstreamhelper.hxx> +#include <rtl/strbuf.hxx> +#include <rtl/ustrbuf.hxx> +#include <rtl/tencinfo.h> +#include <svl/lngmisc.hxx> +#include <editeng/borderline.hxx> +#include <unotools/streamwrap.hxx> +#include <com/sun/star/beans/XPropertySet.hpp> + +using std::make_pair; +using rtl::OString; +using rtl::OStringBuffer; +using rtl::OUString; +using rtl::OUStringBuffer; +using rtl::OUStringToOString; + +namespace writerfilter { +namespace rtftok { + +static RTFSprms_t& lcl_getNumPr(std::stack<RTFParserState>& aStates) +{ + // insert the numpr sprm if necessary + RTFValue::Pointer_t p = RTFSprm::find(aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_numPr); + if (!p.get()) + { + RTFSprms_t aAttributes; + RTFSprms_t aSprms; + RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms)); + aStates.top().aParagraphSprms.push_back(make_pair(NS_ooxml::LN_CT_PPrBase_numPr, pValue)); + p = RTFSprm::find(aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_numPr); + } + return p->getSprms(); +} + +static Id lcl_getParagraphBorder(sal_uInt32 nIndex) +{ + static const Id aBorderIds[] = + { + NS_sprm::LN_PBrcTop, NS_sprm::LN_PBrcLeft, NS_sprm::LN_PBrcBottom, NS_sprm::LN_PBrcRight + }; + + return aBorderIds[nIndex]; +} + +static void lcl_putNestedAttribute(RTFSprms_t& rSprms, Id nParent, Id nId, RTFValue::Pointer_t pValue, + bool bOverwrite = false, bool bAttribute = true) +{ + RTFValue::Pointer_t pParent = RTFSprm::find(rSprms, nParent); + if (!pParent.get()) + { + RTFSprms_t aAttributes; + RTFValue::Pointer_t pParentValue(new RTFValue(aAttributes)); + rSprms.push_back(make_pair(nParent, pParentValue)); + pParent = pParentValue; + } + RTFSprms_t& rAttributes = (bAttribute ? pParent->getAttributes() : pParent->getSprms()); + if (bOverwrite) + for (RTFSprms_t::iterator i = rAttributes.begin(); i != rAttributes.end(); ++i) + if (i->first == nId) + { + i->second = pValue; + return; + } + rAttributes.push_back(make_pair(nId, pValue)); +} + +static void lcl_putNestedSprm(RTFSprms_t& rSprms, Id nParent, Id nId, RTFValue::Pointer_t pValue, bool bOverwrite = false) +{ + lcl_putNestedAttribute(rSprms, nParent, nId, pValue, bOverwrite, false); +} + +static RTFSprms_t& lcl_getLastAttributes(RTFSprms_t& rSprms, Id nId) +{ + RTFValue::Pointer_t p = RTFSprm::find(rSprms, nId); + if (p->getSprms().size()) + return p->getSprms().back().second->getAttributes(); + else + { + OSL_FAIL("trying to set property when no type is defined"); + return p->getSprms(); + } +} + +static void lcl_putBorderProperty(std::stack<RTFParserState>& aStates, Id nId, RTFValue::Pointer_t pValue) +{ + if (aStates.top().nBorderState == BORDER_PARAGRAPH) + for (int i = 0; i < 4; i++) + { + RTFValue::Pointer_t p = RTFSprm::find(aStates.top().aParagraphSprms, lcl_getParagraphBorder(i)); + if (p.get()) + { + RTFSprms_t& rAttributes = p->getAttributes(); + rAttributes.push_back(make_pair(nId, pValue)); + } + } + else if (aStates.top().nBorderState == BORDER_CELL) + { + // Attributes of the last border type + RTFSprms_t& rAttributes = lcl_getLastAttributes(aStates.top().aTableCellSprms, NS_ooxml::LN_CT_TcPrBase_tcBorders); + rAttributes.push_back(make_pair(nId, pValue)); + } + else if (aStates.top().nBorderState == BORDER_PAGE) + { + // Attributes of the last border type + RTFSprms_t& rAttributes = lcl_getLastAttributes(aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgBorders); + rAttributes.push_back(make_pair(nId, pValue)); + } +} + +static void lcl_Break(Stream& rMapper) +{ + sal_uInt8 sBreak[] = { 0xd }; + rMapper.text(sBreak, 1); +} + +static void lcl_TableBreak(Stream& rMapper) +{ + lcl_Break(rMapper); + rMapper.endParagraphGroup(); + rMapper.startParagraphGroup(); +} + +// NEEDSWORK: DocxAttributeOutput's impl_AppendTwoDigits does the same. +static void lcl_AppendTwoDigits(OStringBuffer &rBuffer, sal_Int32 nNum) +{ + if ( nNum < 0 || nNum > 99 ) + { + rBuffer.append( "00" ); + return; + } + + if ( nNum < 10 ) + rBuffer.append( '0' ); + + rBuffer.append( nNum ); +} + +// NEEDSWORK: sw::ms::DTTM2DateTime and DocxAttributeOutput's +// impl_DateTimeToOString could be combined to do the same. +static OString lcl_DTTM22OString(long lDTTM) +{ + sal_uInt16 lMin = (sal_uInt16)(lDTTM & 0x0000003F); + lDTTM >>= 6; + sal_uInt16 lHour= (sal_uInt16)(lDTTM & 0x0000001F); + lDTTM >>= 5; + sal_uInt16 lDay = (sal_uInt16)(lDTTM & 0x0000001F); + lDTTM >>= 5; + sal_uInt16 lMon = (sal_uInt16)(lDTTM & 0x0000000F); + lDTTM >>= 4; + sal_uInt16 lYear= (sal_uInt16)(lDTTM & 0x000001FF) + 1900; + + OStringBuffer aBuf; + aBuf.append(sal_Int32(lYear)); + aBuf.append('-'); + lcl_AppendTwoDigits(aBuf, lMon); + aBuf.append('-'); + lcl_AppendTwoDigits(aBuf, lDay); + aBuf.append('T'); + lcl_AppendTwoDigits(aBuf, lHour); + aBuf.append(':'); + lcl_AppendTwoDigits(aBuf, lMin); + aBuf.append(":00Z"); + return aBuf.makeStringAndClear(); +} + +static writerfilter::Reference<Properties>::Pointer_t lcl_getBookmarkProperties(int nPos, OUString& rString) +{ + RTFSprms_t aAttributes; + RTFValue::Pointer_t pPos(new RTFValue(nPos)); + if (rString.getLength()) + { + // If present, this should be sent first. + RTFValue::Pointer_t pString(new RTFValue(rString)); + aAttributes.push_back(make_pair(NS_rtf::LN_BOOKMARKNAME, pString)); + } + aAttributes.push_back(make_pair(NS_rtf::LN_IBKL, pPos)); + return writerfilter::Reference<Properties>::Pointer_t(new RTFReferenceProperties(aAttributes)); +} + +static writerfilter::Reference<Properties>::Pointer_t lcl_getBookmarkProperties(int nPos) +{ + OUString aStr; + return lcl_getBookmarkProperties(nPos, aStr); +} + +static int lcl_AsHex(char ch) +{ + int ret = 0; + if (isdigit(ch)) + ret = ch - '0'; + else + { + if (islower(ch)) + { + if (ch < 'a' || ch > 'f') + return -1; + ret = ch - 'a'; + } + else + { + if (ch < 'A' || ch > 'F') + return -1; + ret = ch - 'A'; + } + ret += 10; + } + return ret; +} + +static const char* lcl_RtfToString(RTFKeyword nKeyword) +{ + for (int i = 0; i < nRTFControlWords; i++) + { + if (nKeyword == aRTFControlWords[i].nIndex) + return aRTFControlWords[i].sKeyword; + } + return NULL; +} +RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& xContext, + uno::Reference<io::XInputStream> const& xInputStream, + uno::Reference<lang::XComponent> const& xDstDoc, + uno::Reference<frame::XFrame> const& xFrame) + : m_xContext(xContext), + m_xInputStream(xInputStream), + m_xDstDoc(xDstDoc), + m_xFrame(xFrame), + m_nGroup(0), + m_aDefaultState(), + m_bSkipUnknown(false), + m_aFontEncodings(), + m_aColorTable(), + m_bFirstRun(true), + m_bNeedPap(false), + m_aListTableSprms(), + m_aSettingsTableSprms(), + m_xStorage(), + m_aTableBuffer(), + m_bTable(false), + m_aSuperBuffer(), + m_bSuper(false), + m_bHasFootnote(false), + m_bIsSubstream(false), + m_nHeaderFooterPositions(), + m_nGroupStartPos(0), + m_aBookmarks(), + m_aAuthors() +{ + OSL_ENSURE(xInputStream.is(), "no input stream"); + if (!xInputStream.is()) + throw uno::RuntimeException(); + m_pInStream = utl::UcbStreamHelper::CreateStream( xInputStream, sal_True ); + + m_xModelFactory.set(m_xDstDoc, uno::UNO_QUERY); + OSL_ASSERT(m_xModelFactory.is()); + + m_pGraphicHelper = new oox::GraphicHelper(m_xContext, xFrame, m_xStorage); +} + +RTFDocumentImpl::~RTFDocumentImpl() +{ +} + +SvStream& RTFDocumentImpl::Strm() +{ + return *m_pInStream; +} + +Stream& RTFDocumentImpl::Mapper() +{ + return *m_pMapperStream; +} + +void RTFDocumentImpl::setSubstream(bool bIsSubtream) +{ + m_bIsSubstream = bIsSubtream; +} + +void RTFDocumentImpl::setIgnoreFirst(OUString& rIgnoreFirst) +{ + m_aIgnoreFirst = rIgnoreFirst; +} + +void RTFDocumentImpl::resolveSubstream(sal_uInt32 nPos, Id nId) +{ + OUString aStr; + resolveSubstream(nPos, nId, aStr); +} +void RTFDocumentImpl::resolveSubstream(sal_uInt32 nPos, Id nId, OUString& rIgnoreFirst) +{ + sal_uInt32 nCurrent = Strm().Tell(); + // Seek to header position, parse, then seek back. + RTFDocumentImpl::Pointer_t pImpl(new RTFDocumentImpl(m_xContext, m_xInputStream, m_xDstDoc, m_xFrame)); + pImpl->setSubstream(true); + pImpl->setIgnoreFirst(rIgnoreFirst); + pImpl->seek(nPos); + OSL_TRACE("substream start"); + Mapper().substream(nId, pImpl); + OSL_TRACE("substream end"); + Strm().Seek(nCurrent); + nPos = 0; +} + +void RTFDocumentImpl::parBreak() +{ + // end previous paragraph + Mapper().startCharacterGroup(); + lcl_Break(Mapper()); + Mapper().endCharacterGroup(); + Mapper().endParagraphGroup(); + + // start new one + Mapper().startParagraphGroup(); +} + +void RTFDocumentImpl::sectBreak(bool bFinal = false) +{ + while (m_nHeaderFooterPositions.size()) + { + std::pair<Id, sal_uInt32> aPair = m_nHeaderFooterPositions.front(); + m_nHeaderFooterPositions.pop_front(); + resolveSubstream(aPair.second, aPair.first); + } + + RTFValue::Pointer_t pBreak = RTFSprm::find(m_aStates.top().aSectionSprms, NS_sprm::LN_SBkc); + // In case the last section is a continous one, we don't need to output a section break. + if (bFinal && pBreak.get() && !pBreak->getInt()) + RTFSprm::erase(m_aStates.top().aSectionSprms, NS_sprm::LN_SBkc); + + // Section properties are a paragraph sprm. + RTFValue::Pointer_t pValue(new RTFValue(m_aStates.top().aSectionAttributes, m_aStates.top().aSectionSprms)); + RTFSprms_t aAttributes; + RTFSprms_t aSprms; + aSprms.push_back(make_pair(NS_ooxml::LN_CT_PPr_sectPr, pValue)); + writerfilter::Reference<Properties>::Pointer_t const pProperties( + new RTFReferenceProperties(aAttributes, aSprms) + ); + // The trick is that we send properties of the previous section right now, which will be exactly what dmapper expects. + Mapper().props(pProperties); + Mapper().endParagraphGroup(); + if (!m_bIsSubstream) + Mapper().endSectionGroup(); + if (!bFinal) + { + Mapper().startSectionGroup(); + Mapper().startParagraphGroup(); + } +} + +void RTFDocumentImpl::seek(sal_uInt32 nPos) +{ + Strm().Seek(nPos); +} + +sal_uInt32 RTFDocumentImpl::getColorTable(sal_uInt32 nIndex) +{ + if (nIndex < m_aColorTable.size()) + return m_aColorTable[nIndex]; + return 0; +} + +sal_uInt32 RTFDocumentImpl::getEncodingTable(sal_uInt32 nFontIndex) +{ + if (nFontIndex < m_aFontEncodings.size()) + return m_aFontEncodings[nFontIndex]; + return 0; +} + +void RTFDocumentImpl::resolve(Stream & rMapper) +{ + m_pMapperStream = &rMapper; + switch (resolveParse()) + { + case ERROR_OK: + OSL_TRACE("%s: finished without errors", OSL_THIS_FUNC); + break; + case ERROR_GROUP_UNDER: + OSL_TRACE("%s: unmatched '}'", OSL_THIS_FUNC); + break; + case ERROR_GROUP_OVER: + OSL_TRACE("%s: unmatched '{'", OSL_THIS_FUNC); + break; + case ERROR_EOF: + OSL_TRACE("%s: unexpected end of file", OSL_THIS_FUNC); + break; + case ERROR_HEX_INVALID: + OSL_TRACE("%s: invalid hex char", OSL_THIS_FUNC); + break; + } +} + +int RTFDocumentImpl::resolvePict(char ch, bool bInline) +{ + SvMemoryStream aStream; + int b = 0, count = 2; + + // TODO this discards properties after the 'pib' property + if (!bInline) + resolveShapeProperties(m_aStates.top().aShapeProperties); + + // Read the group. + while(!Strm().IsEof() && ch != '{' && ch != '}' && ch != '\\') + { + if (ch != 0x0d && ch != 0x0a) + { + b = b << 4; + char parsed = lcl_AsHex(ch); + if (parsed == -1) + return ERROR_HEX_INVALID; + b += parsed; + count--; + if (!count) + { + aStream << (char)b; + count = 2; + b = 0; + } + } + Strm() >> ch; + } + Strm().SeekRel(-1); + + // Store, and get its URL. + aStream.Seek(0); + uno::Reference<io::XInputStream> xInputStream(new utl::OInputStreamWrapper(&aStream)); + OUString aGraphicUrl = m_pGraphicHelper->importGraphicObject(xInputStream); + + // Wrap it in an XShape. + uno::Reference<drawing::XShape> xShape; + OUString aService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GraphicObjectShape")); + xShape.set(m_xModelFactory->createInstance(aService), uno::UNO_QUERY); + OSL_ASSERT(xShape.is()); + uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY); + OSL_ASSERT(xPropertySet.is()); + xPropertySet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicURL")), uno::Any(aGraphicUrl)); + + // Send it to the dmapper. + RTFSprms_t aSprms; + RTFSprms_t aAttributes; + // shape attribute + RTFSprms_t aPicAttributes; + RTFValue::Pointer_t pShapeValue(new RTFValue(xShape)); + aPicAttributes.push_back(make_pair(NS_ooxml::LN_shape, pShapeValue)); + // pic sprm + RTFSprms_t aGraphicDataAttributes; + RTFSprms_t aGraphicDataSprms; + RTFValue::Pointer_t pPicValue(new RTFValue(aPicAttributes)); + aGraphicDataSprms.push_back(make_pair(NS_ooxml::LN_pic_pic, pPicValue)); + // graphicData sprm + RTFSprms_t aGraphicAttributes; + RTFSprms_t aGraphicSprms; + RTFValue::Pointer_t pGraphicDataValue(new RTFValue(aGraphicDataAttributes, aGraphicDataSprms)); + aGraphicSprms.push_back(make_pair(NS_ooxml::LN_CT_GraphicalObject_graphicData, pGraphicDataValue)); + // graphic sprm + RTFValue::Pointer_t pGraphicValue(new RTFValue(aGraphicAttributes, aGraphicSprms)); + // extent sprm + RTFSprms_t aExtentAttributes; + for (RTFSprms_t::iterator i = m_aStates.top().aCharacterAttributes.begin(); i != m_aStates.top().aCharacterAttributes.end(); ++i) + if (i->first == NS_rtf::LN_XEXT || i->first == NS_rtf::LN_YEXT) + aExtentAttributes.push_back(make_pair(i->first, i->second)); + RTFValue::Pointer_t pExtentValue(new RTFValue(aExtentAttributes)); + // docpr sprm + RTFSprms_t aDocprAttributes; + for (RTFSprms_t::iterator i = m_aStates.top().aCharacterAttributes.begin(); i != m_aStates.top().aCharacterAttributes.end(); ++i) + if (i->first == NS_ooxml::LN_CT_NonVisualDrawingProps_name || i->first == NS_ooxml::LN_CT_NonVisualDrawingProps_descr) + aDocprAttributes.push_back(make_pair(i->first, i->second)); + RTFValue::Pointer_t pDocprValue(new RTFValue(aDocprAttributes)); + if (bInline) + { + RTFSprms_t aInlineAttributes; + RTFSprms_t aInlineSprms; + aInlineSprms.push_back(make_pair(NS_ooxml::LN_CT_Inline_extent, pExtentValue)); + aInlineSprms.push_back(make_pair(NS_ooxml::LN_CT_Inline_docPr, pDocprValue)); + aInlineSprms.push_back(make_pair(NS_ooxml::LN_graphic_graphic, pGraphicValue)); + // inline sprm + RTFValue::Pointer_t pValue(new RTFValue(aInlineAttributes, aInlineSprms)); + aSprms.push_back(make_pair(NS_ooxml::LN_inline_inline, pValue)); + } + else // anchored + { + // wrap sprm + RTFSprms_t aAnchorWrapAttributes; + for (RTFSprms_t::iterator i = m_aStates.top().aCharacterAttributes.begin(); i != m_aStates.top().aCharacterAttributes.end(); ++i) + if (i->first == NS_ooxml::LN_CT_WrapSquare_wrapText) + aAnchorWrapAttributes.push_back(make_pair(i->first, i->second)); + RTFValue::Pointer_t pAnchorWrapValue(new RTFValue(aAnchorWrapAttributes)); + RTFSprms_t aAnchorAttributes; + RTFSprms_t aAnchorSprms; + aAnchorSprms.push_back(make_pair(NS_ooxml::LN_CT_Anchor_extent, pExtentValue)); + if (aAnchorWrapAttributes.size()) + aAnchorSprms.push_back(make_pair(NS_ooxml::LN_EG_WrapType_wrapSquare, pAnchorWrapValue)); + aAnchorSprms.push_back(make_pair(NS_ooxml::LN_CT_Anchor_docPr, pDocprValue)); + aAnchorSprms.push_back(make_pair(NS_ooxml::LN_graphic_graphic, pGraphicValue)); + // anchor sprm + RTFValue::Pointer_t pValue(new RTFValue(aAnchorAttributes, aAnchorSprms)); + aSprms.push_back(make_pair(NS_ooxml::LN_anchor_anchor, pValue)); + } + writerfilter::Reference<Properties>::Pointer_t const pProperties(new RTFReferenceProperties(aAttributes, aSprms)); + Mapper().props(pProperties); + + return 0; +} + +int RTFDocumentImpl::resolveChars(char ch) +{ + OStringBuffer aBuf; + + if (m_aStates.top().nDestinationState == DESTINATION_PICT) + return resolvePict(ch, true); + else if (m_aStates.top().nDestinationState == DESTINATION_SHAPEPROPERTYVALUEPICT) + return resolvePict(ch, false); + while(!Strm().IsEof() && ch != '{' && ch != '}' && ch != '\\') + { + if (ch != 0x0d && ch != 0x0a) + { + if (m_aStates.top().nCharsToSkip == 0) + aBuf.append(ch); + else + m_aStates.top().nCharsToSkip--; + } + // read a single char if we're in hex mode + if (m_aStates.top().nInternalState == INTERNAL_HEX) + break; + Strm() >> ch; + } + if (m_aStates.top().nInternalState != INTERNAL_HEX && !Strm().IsEof()) + Strm().SeekRel(-1); + if (m_aStates.top().nDestinationState == DESTINATION_SKIP) + return 0; + OString aStr = aBuf.makeStringAndClear(); + if (m_aStates.top().nDestinationState == DESTINATION_LEVELNUMBERS) + { + if (aStr.toChar() != ';') + m_aStates.top().aLevelNumbers.push_back(sal_Int32(ch)); + return 0; + } + OSL_TRACE("%s: collected '%s'", OSL_THIS_FUNC, aStr.getStr()); + + OUString aOUStr(OStringToOUString(aStr, m_aStates.top().nCurrentEncoding)); + + if (m_aStates.top().nDestinationState == DESTINATION_COLORTABLE) + { + // we hit a ';' at the end of each color entry + sal_uInt32 color = (m_aStates.top().aCurrentColor.nRed << 16) | ( m_aStates.top().aCurrentColor.nGreen << 8) + | m_aStates.top().aCurrentColor.nBlue; + m_aColorTable.push_back(color); + // set components back to zero + m_aStates.top().aCurrentColor = RTFColorTableEntry(); + } + else + text(aOUStr); + + return 0; +} + +void RTFDocumentImpl::text(OUString& rString) +{ + bool bRet = true; + switch (m_aStates.top().nDestinationState) + { + case DESTINATION_FONTENTRY: + case DESTINATION_STYLEENTRY: + case DESTINATION_REVISIONENTRY: + // drop the ; at the end if it's there + if (rString.endsWithAsciiL(";", 1)) + rString = rString.copy(0, rString.getLength() - 1); + case DESTINATION_LEVELTEXT: + case DESTINATION_SHAPEPROPERTYNAME: + case DESTINATION_SHAPEPROPERTYVALUE: + case DESTINATION_BOOKMARKEND: + m_aDestinationText.append(rString); + break; + default: bRet = false; break; + } + if (bRet) + return; + + if (m_aIgnoreFirst.getLength() && m_aIgnoreFirst.equals(rString)) + { + m_aIgnoreFirst = OUString(); + return; + } + + writerfilter::Reference<Properties>::Pointer_t const pParagraphProperties( + new RTFReferenceProperties(m_aStates.top().aParagraphAttributes, m_aStates.top().aParagraphSprms) + ); + + if (m_bFirstRun) + { + // output settings table + RTFSprms_t aAttributes; + writerfilter::Reference<Properties>::Pointer_t const pProp(new RTFReferenceProperties(aAttributes, m_aSettingsTableSprms)); + RTFReferenceTable::Entries_t aSettingsTableEntries; + aSettingsTableEntries.insert(make_pair(0, pProp)); + writerfilter::Reference<Table>::Pointer_t const pTable(new RTFReferenceTable(aSettingsTableEntries)); + Mapper().table(NS_ooxml::LN_settings_settings, pTable); + // start initial paragraph + if (!m_bIsSubstream) + Mapper().startSectionGroup(); + Mapper().startParagraphGroup(); + Mapper().props(pParagraphProperties); + m_bFirstRun = false; + } + if (m_bNeedPap) + { + if (!m_bTable && !m_bSuper) + Mapper().props(pParagraphProperties); + else + { + RTFValue::Pointer_t pValue(new RTFValue(m_aStates.top().aParagraphAttributes, m_aStates.top().aParagraphSprms)); + if (m_bTable) + m_aTableBuffer.push_back(make_pair(BUFFER_PROPS, pValue)); + else + m_aSuperBuffer.push_back(make_pair(BUFFER_PROPS, pValue)); + } + m_bNeedPap = false; + } + + // Don't return earlier, a bookmark start has to be in a paragraph group. + if (m_aStates.top().nDestinationState == DESTINATION_BOOKMARKSTART) + { + m_aDestinationText.append(rString); + return; + } + + if (!m_bTable && !m_bSuper && m_aStates.top().nDestinationState != DESTINATION_FOOTNOTE) + Mapper().startCharacterGroup(); + else + { + RTFValue::Pointer_t pValue; + if (m_bTable) + m_aTableBuffer.push_back(make_pair(BUFFER_STARTRUN, pValue)); + else + m_aSuperBuffer.push_back(make_pair(BUFFER_STARTRUN, pValue)); + } + if (m_aStates.top().nDestinationState == DESTINATION_NORMAL || m_aStates.top().nDestinationState == DESTINATION_FIELDRESULT) + { + if (!m_bTable && !m_bSuper) + { + writerfilter::Reference<Properties>::Pointer_t const pProperties( + new RTFReferenceProperties(m_aStates.top().aCharacterAttributes, m_aStates.top().aCharacterSprms) + ); + Mapper().props(pProperties); + } + else + { + RTFValue::Pointer_t pValue(new RTFValue(m_aStates.top().aCharacterAttributes, m_aStates.top().aCharacterSprms)); + if (m_bTable) + m_aTableBuffer.push_back(make_pair(BUFFER_PROPS, pValue)); + else + m_aSuperBuffer.push_back(make_pair(BUFFER_PROPS, pValue)); + } + } + if (!m_bTable && !m_bSuper) + Mapper().utext(reinterpret_cast<sal_uInt8 const*>(rString.getStr()), rString.getLength()); + else + { + RTFValue::Pointer_t pValue(new RTFValue(rString)); + if (m_bTable) + m_aTableBuffer.push_back(make_pair(BUFFER_UTEXT, pValue)); + else + m_aSuperBuffer.push_back(make_pair(BUFFER_UTEXT, pValue)); + } + if (!m_bTable && !m_bSuper && m_aStates.top().nDestinationState != DESTINATION_FOOTNOTE) + Mapper().endCharacterGroup(); + else + { + RTFValue::Pointer_t pValue; + if (m_bTable) + m_aTableBuffer.push_back(make_pair(BUFFER_ENDRUN, pValue)); + else + m_aSuperBuffer.push_back(make_pair(BUFFER_ENDRUN, pValue)); + } +} + +void RTFDocumentImpl::replayBuffer(std::deque< std::pair<RTFBufferTypes, RTFValue::Pointer_t> >& rBuffer) +{ + while (rBuffer.size()) + { + std::pair<RTFBufferTypes, RTFValue::Pointer_t> aPair = rBuffer.front(); + rBuffer.pop_front(); + if (aPair.first == BUFFER_PROPS) + { + writerfilter::Reference<Properties>::Pointer_t const pProp( + new RTFReferenceProperties(aPair.second->getAttributes(), aPair.second->getSprms()) + ); + Mapper().props(pProp); + } + else if (aPair.first == BUFFER_CELLEND) + { + RTFValue::Pointer_t pValue(new RTFValue(1)); + m_aStates.top().aTableCellSprms.push_back(make_pair(NS_sprm::LN_PCell, pValue)); + writerfilter::Reference<Properties>::Pointer_t const pTableCellProperties( + new RTFReferenceProperties(m_aStates.top().aTableCellAttributes, m_aStates.top().aTableCellSprms) + ); + Mapper().props(pTableCellProperties); + lcl_TableBreak(Mapper()); + break; + } + else if (aPair.first == BUFFER_STARTRUN) + Mapper().startCharacterGroup(); + else if (aPair.first == BUFFER_UTEXT) + { + OUString aString(aPair.second->getString()); + Mapper().utext(reinterpret_cast<sal_uInt8 const*>(aString.getStr()), aString.getLength()); + } + else if (aPair.first == BUFFER_ENDRUN) + Mapper().endCharacterGroup(); + else if (aPair.first == BUFFER_PAR) + parBreak(); + else + OSL_FAIL("should not happen"); + } + +} + +int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) +{ + bool bParsed = true; + switch (nKeyword) + { + case RTF_RTF: + break; + case RTF_FONTTBL: + m_aStates.top().nDestinationState = DESTINATION_FONTTABLE; + break; + case RTF_COLORTBL: + m_aStates.top().nDestinationState = DESTINATION_COLORTABLE; + break; + case RTF_STYLESHEET: + m_aStates.top().nDestinationState = DESTINATION_STYLESHEET; + break; + case RTF_FIELD: + // A field consists of an fldinst and an fldrslt group. + break; + case RTF_FLDINST: + { + sal_uInt8 sFieldStart[] = { 0x13 }; + Mapper().startCharacterGroup(); + Mapper().text(sFieldStart, 1); + Mapper().endCharacterGroup(); + m_aStates.top().nDestinationState = DESTINATION_FIELDINSTRUCTION; + } + break; + case RTF_FLDRSLT: + m_aStates.top().nDestinationState = DESTINATION_FIELDRESULT; + break; + case RTF_LISTTABLE: + m_aStates.top().nDestinationState = DESTINATION_LISTTABLE; + break; + case RTF_LIST: + m_aStates.top().nDestinationState = DESTINATION_LISTENTRY; + break; + case RTF_LISTOVERRIDETABLE: + m_aStates.top().nDestinationState = DESTINATION_LISTOVERRIDETABLE; + break; + case RTF_LISTOVERRIDE: + m_aStates.top().nDestinationState = DESTINATION_LISTOVERRIDEENTRY; + break; + case RTF_LISTLEVEL: + m_aStates.top().nDestinationState = DESTINATION_LISTLEVEL; + break; + case RTF_LEVELTEXT: + m_aStates.top().nDestinationState = DESTINATION_LEVELTEXT; + break; + case RTF_LEVELNUMBERS: + m_aStates.top().nDestinationState = DESTINATION_LEVELNUMBERS; + break; + case RTF_SHPPICT: + m_aStates.top().nDestinationState = DESTINATION_SHPPICT; + break; + case RTF_PICT: + if (m_aStates.top().nDestinationState != DESTINATION_SHAPEPROPERTYVALUE) + m_aStates.top().nDestinationState = DESTINATION_PICT; // as character + else + m_aStates.top().nDestinationState = DESTINATION_SHAPEPROPERTYVALUEPICT; // anchored inside a shape + break; + case RTF_PICPROP: + m_aStates.top().nDestinationState = DESTINATION_PICPROP; + break; + case RTF_SP: + m_aStates.top().nDestinationState = DESTINATION_SHAPEPROPERTY; + break; + case RTF_SN: + m_aStates.top().nDestinationState = DESTINATION_SHAPEPROPERTYNAME; + break; + case RTF_SV: + m_aStates.top().nDestinationState = DESTINATION_SHAPEPROPERTYVALUE; + break; + case RTF_SHP: + m_aStates.top().nDestinationState = DESTINATION_SHAPE; + break; + case RTF_SHPINST: + m_aStates.top().nDestinationState = DESTINATION_SHAPEINSTRUCTION; + break; + case RTF_NESTTABLEPROPS: + m_aStates.top().nDestinationState = DESTINATION_NESTEDTABLEPROPERTIES; + break; + case RTF_HEADER: + case RTF_FOOTER: + case RTF_HEADERL: + case RTF_HEADERR: + case RTF_HEADERF: + case RTF_FOOTERL: + case RTF_FOOTERR: + case RTF_FOOTERF: + if (!m_bIsSubstream) + { + Id nId = 0; + sal_uInt32 nPos = m_nGroupStartPos - 1; + switch (nKeyword) + { + case RTF_HEADER: nId = NS_rtf::LN_headerr; break; + case RTF_FOOTER: nId = NS_rtf::LN_footerr; break; + case RTF_HEADERL: nId = NS_rtf::LN_headerl; break; + case RTF_HEADERR: nId = NS_rtf::LN_headerr; break; + case RTF_HEADERF: nId = NS_rtf::LN_headerr; break; // TODO figure out how to use NS_rtf::LN_headerf + case RTF_FOOTERL: nId = NS_rtf::LN_footerl; break; + case RTF_FOOTERR: nId = NS_rtf::LN_footerr; break; + case RTF_FOOTERF: nId = NS_rtf::LN_footerr; break; // same here, NS_rtf::LN_footerf could be used + default: break; + } + m_nHeaderFooterPositions.push_back(make_pair(nId, nPos)); + m_aStates.top().nDestinationState = DESTINATION_SKIP; + } + break; + case RTF_FOOTNOTE: + if (!m_bIsSubstream) + { + Id nId = NS_rtf::LN_footnote; + + // Check if this is an endnote. + OStringBuffer aBuf; + char ch; + for (int i = 0; i < 7; ++i) + { + Strm() >> ch; + aBuf.append(ch); + } + OString aKeyword = aBuf.makeStringAndClear(); + if (aKeyword.equals("\\ftnalt")) + nId = NS_rtf::LN_endnote; + + m_bHasFootnote = true; + m_bSuper = false; + bool bCustomMark = false; + OUString aCustomMark; + while (m_aSuperBuffer.size()) + { + std::pair<RTFBufferTypes, RTFValue::Pointer_t> aPair = m_aSuperBuffer.front(); + m_aSuperBuffer.pop_front(); + if (aPair.first == BUFFER_UTEXT) + { + aCustomMark = aPair.second->getString(); + bCustomMark = true; + } + } + m_aStates.top().nDestinationState = DESTINATION_FOOTNOTE; + if (bCustomMark) + Mapper().startCharacterGroup(); + resolveSubstream(m_nGroupStartPos - 1, nId, aCustomMark); + if (bCustomMark) + { + m_aStates.top().aCharacterAttributes.clear(); + m_aStates.top().aCharacterSprms.clear(); + RTFValue::Pointer_t pValue(new RTFValue(1)); + m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_FtnEdnRef_customMarkFollows, pValue)); + text(aCustomMark); + Mapper().endCharacterGroup(); + } + m_aStates.top().nDestinationState = DESTINATION_SKIP; + } + break; + case RTF_BKMKSTART: + m_aStates.top().nDestinationState = DESTINATION_BOOKMARKSTART; + break; + case RTF_BKMKEND: + m_aStates.top().nDestinationState = DESTINATION_BOOKMARKEND; + break; + case RTF_REVTBL: + m_aStates.top().nDestinationState = DESTINATION_REVISIONTABLE; + break; + case RTF_LISTTEXT: + // Should be ignored by any reader that understands Word 97 through Word 2007 numbering. + case RTF_NONESTTABLES: + // This destination should be ignored by readers that support nested tables. + m_aStates.top().nDestinationState = DESTINATION_SKIP; + break; + default: + OSL_TRACE("%s: TODO handle destination '%s'", OSL_THIS_FUNC, lcl_RtfToString(nKeyword)); + // Make sure we skip destinations (even without \*) till we don't handle them + m_aStates.top().nDestinationState = DESTINATION_SKIP; + bParsed = false; + break; + } + + skipDestination(bParsed); + return 0; +} + +int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) +{ + bool bParsed = true; + sal_uInt8 cCh = 0; + + // Trivial symbols + switch (nKeyword) + { + case RTF_LINE: cCh = '\n'; break; + case RTF_TAB: cCh = '\t'; break; + case RTF_BACKSLASH: cCh = '\\'; break; + case RTF_LBRACE: cCh = '{'; break; + case RTF_RBRACE: cCh = '}'; break; + case RTF_EMDASH: cCh = 151; break; + case RTF_ENDASH: cCh = 150; break; + case RTF_BULLET: cCh = 149; break; + case RTF_LQUOTE: cCh = 145; break; + case RTF_RQUOTE: cCh = 146; break; + case RTF_LDBLQUOTE: cCh = 147; break; + case RTF_RDBLQUOTE: cCh = 148; break; + default: break; + } + if (cCh > 0) + { + OUString aStr(OStringToOUString(OString(cCh), RTL_TEXTENCODING_MS_1252)); + text(aStr); + skipDestination(bParsed); + return 0; + } + + switch (nKeyword) + { + case RTF_IGNORE: + m_bSkipUnknown = true; + return 0; // don't reset m_bSkipUnknown after this keyword + break; + case RTF_PAR: + { + if (!m_bTable) + parBreak(); + else + { + RTFValue::Pointer_t pValue; + m_aTableBuffer.push_back(make_pair(BUFFER_PAR, pValue)); + } + // but don't emit properties yet, since they may change till the first text token arrives + m_bNeedPap = true; + } + break; + case RTF_SECT: + sectBreak(); + break; + case RTF_NOBREAK: + { + OUString aStr(SVT_HARD_SPACE); + text(aStr); + } + break; + case RTF_NOBRKHYPH: + { + OUString aStr(SVT_HARD_HYPHEN); + text(aStr); + } + break; + case RTF_OPTHYPH: + { + OUString aStr(SVT_SOFT_HYPHEN); + text(aStr); + } + break; + case RTF_HEXCHAR: + m_aStates.top().nInternalState = INTERNAL_HEX; + break; + case RTF_CELL: + case RTF_NESTCELL: + { + if (m_bNeedPap) + { + // There were no runs in the cell, so we need to send paragraph properties here. + RTFValue::Pointer_t pValue(new RTFValue(m_aStates.top().aParagraphAttributes, m_aStates.top().aParagraphSprms)); + m_aTableBuffer.push_back(make_pair(BUFFER_PROPS, pValue)); + } + + RTFValue::Pointer_t pValue; + m_aTableBuffer.push_back(make_pair(BUFFER_CELLEND, pValue)); + m_bNeedPap = true; + } + break; + case RTF_ROW: + case RTF_NESTROW: + { + writerfilter::Reference<Properties>::Pointer_t const pParagraphProperties( + new RTFReferenceProperties(m_aStates.top().aParagraphAttributes, m_aStates.top().aParagraphSprms) + ); + Mapper().props(pParagraphProperties); + + // Table width. + RTFValue::Pointer_t pUnitValue(new RTFValue(3)); + lcl_putNestedAttribute(m_aStates.top().aTableRowSprms, + NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_type, pUnitValue); + RTFValue::Pointer_t pWidthValue(new RTFValue(m_aStates.top().nCellX)); + lcl_putNestedAttribute(m_aStates.top().aTableRowSprms, + NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_w, pWidthValue); + + RTFValue::Pointer_t pRowValue(new RTFValue(1)); + m_aStates.top().aTableRowSprms.push_back(make_pair(NS_sprm::LN_PRow, pRowValue)); + writerfilter::Reference<Properties>::Pointer_t const pTableRowProperties( + new RTFReferenceProperties(m_aStates.top().aTableRowAttributes, m_aStates.top().aTableRowSprms) + ); + Mapper().props(pTableRowProperties); + + lcl_TableBreak(Mapper()); + m_bNeedPap = true; + m_aTableBuffer.clear(); + } + break; + case RTF_COLUMN: + { + sal_uInt8 sBreak[] = { 0xe }; + Mapper().startCharacterGroup(); + Mapper().text(sBreak, 1); + Mapper().endCharacterGroup(); + } + break; + case RTF_CHFTN: + // Nothing to do, dmapper assumes this is the default. + break; + default: + OSL_TRACE("%s: TODO handle symbol '%s'", OSL_THIS_FUNC, lcl_RtfToString(nKeyword)); + bParsed = false; + break; + } + skipDestination(bParsed); + return 0; +} + +int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) +{ + bool bParsed = true; + int nParam = -1; + + // Indentation + switch (nKeyword) + { + case RTF_QC: nParam = 1; break; + case RTF_QJ: nParam = 3; break; + case RTF_QL: nParam = 0; break; + case RTF_QR: nParam = 2; break; + case RTF_QD: nParam = 4; break; + default: break; + } + if (nParam >= 0) + { + RTFValue::Pointer_t pValue(new RTFValue(nParam)); + m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_PJc, pValue)); + skipDestination(bParsed); + return 0; + } + + // Tab kind. + switch (nKeyword) + { + case RTF_TQR: nParam = 2; break; + case RTF_TQC: nParam = 1; break; + case RTF_TQDEC: nParam = 3; break; + default: break; + } + if (nParam >= 0) + { + RTFValue::Pointer_t pValue(new RTFValue(nParam)); + m_aStates.top().aTabAttributes.push_back(make_pair(NS_ooxml::LN_CT_TabStop_val, pValue)); + skipDestination(bParsed); + return 0; + } + + // Tab lead. + switch (nKeyword) + { + case RTF_TLDOT: nParam = 1; break; + case RTF_TLMDOT: nParam = NS_ooxml::LN_Value_ST_TabTlc_middleDot; break; + case RTF_TLHYPH: nParam = 2; break; + case RTF_TLUL: nParam = 3; break; + case RTF_TLTH: nParam = 2; break; // thick line is not supported by dmapper, this is just a hack + case RTF_TLEQ: nParam = 0; break; // equal sign isn't, either + default: break; + } + if (nParam >= 0) + { + RTFValue::Pointer_t pValue(new RTFValue(nParam)); + m_aStates.top().aTabAttributes.push_back(make_pair(NS_ooxml::LN_CT_TabStop_leader, pValue)); + skipDestination(bParsed); + return 0; + } + + // Border types + switch (nKeyword) + { + // brdrhair and brdrs are the same, brdrw will make a difference + case RTF_BRDRHAIR: nParam = editeng::SOLID; break; + case RTF_BRDRS: nParam = editeng::SOLID; break; + case RTF_BRDRDOT: nParam = editeng::DOTTED; break; + case RTF_BRDRDASH: nParam = editeng::DASHED; break; + case RTF_BRDRDB: nParam = editeng::DOUBLE; break; + case RTF_BRDRTNTHSG: nParam = editeng::THINTHICK_SMALLGAP; break; + case RTF_BRDRTNTHMG: nParam = editeng::THINTHICK_MEDIUMGAP; break; + case RTF_BRDRTNTHLG: nParam = editeng::THINTHICK_LARGEGAP; break; + case RTF_BRDRTHTNSG: nParam = editeng::THICKTHIN_SMALLGAP; break; + case RTF_BRDRTHTNMG: nParam = editeng::THICKTHIN_MEDIUMGAP; break; + case RTF_BRDRTHTNLG: nParam = editeng::THICKTHIN_LARGEGAP; break; + case RTF_BRDREMBOSS: nParam = editeng::EMBOSSED; break; + case RTF_BRDRENGRAVE: nParam = editeng::ENGRAVED; break; + case RTF_BRDROUTSET: nParam = editeng::OUTSET; break; + case RTF_BRDRINSET: nParam = editeng::INSET; break; + case RTF_BRDRNONE: nParam = editeng::NO_STYLE; break; + default: break; + } + if (nParam >= 0) + { + RTFValue::Pointer_t pValue(new RTFValue(nParam)); + lcl_putBorderProperty(m_aStates, NS_rtf::LN_BRCTYPE, pValue); + skipDestination(bParsed); + return 0; + } + + // Section breaks + switch (nKeyword) + { + case RTF_SBKNONE: nParam = 0; break; + case RTF_SBKCOL: nParam = 1; break; + case RTF_SBKPAGE: nParam = 2; break; + case RTF_SBKEVEN: nParam = 3; break; + case RTF_SBKODD: nParam = 4; break; + default: break; + } + if (nParam >= 0) + { + RTFValue::Pointer_t pValue(new RTFValue(nParam)); + m_aStates.top().aSectionSprms.push_back(make_pair(NS_sprm::LN_SBkc, pValue)); + skipDestination(bParsed); + return 0; + } + + // Trivial paragraph flags + switch (nKeyword) + { + case RTF_KEEP: nParam = NS_sprm::LN_PFKeep; break; + case RTF_KEEPN: nParam = NS_sprm::LN_PFKeepFollow; break; + case RTF_WIDCTLPAR: nParam = NS_sprm::LN_PFWidowControl; break; + case RTF_INTBL: m_bTable = true; nParam = NS_sprm::LN_PFInTable; break; + case RTF_PAGEBB: nParam = NS_sprm::LN_PFPageBreakBefore; break; + default: break; + } + if (nParam >= 0) + { + RTFValue::Pointer_t pValue(new RTFValue(1)); + m_aStates.top().aParagraphSprms.push_back(make_pair(nParam, pValue)); + skipDestination(bParsed); + return 0; + } + + switch (nKeyword) + { + case RTF_FNIL: + case RTF_FROMAN: + case RTF_FSWISS: + case RTF_FMODERN: + case RTF_FSCRIPT: + case RTF_FDECOR: + case RTF_FTECH: + case RTF_FBIDI: + // TODO ooxml:CT_Font_family seems to be ignored by the domain mapper + break; + case RTF_ANSI: + m_aStates.top().nCurrentEncoding = RTL_TEXTENCODING_MS_1252; + break; + case RTF_PLAIN: + m_aStates.top().aCharacterSprms = m_aDefaultState.aCharacterSprms; + m_aStates.top().aCharacterAttributes = m_aDefaultState.aCharacterAttributes; + break; + case RTF_PARD: + m_aStates.top().aParagraphSprms = m_aDefaultState.aParagraphSprms; + m_aStates.top().aParagraphAttributes = m_aDefaultState.aParagraphAttributes; + m_bTable = false; + break; + case RTF_SECTD: + m_aStates.top().aSectionSprms = m_aDefaultState.aSectionSprms; + m_aStates.top().aSectionAttributes = m_aDefaultState.aSectionAttributes; + break; + case RTF_TROWD: + m_aStates.top().aTableRowSprms = m_aDefaultState.aTableRowSprms; + m_aStates.top().aTableRowAttributes = m_aDefaultState.aTableRowAttributes; + m_aStates.top().nCellX = 0; + m_aStates.top().aTableCellsSprms = m_aDefaultState.aTableCellsSprms; + m_aStates.top().aTableCellsAttributes = m_aDefaultState.aTableCellsAttributes; + break; + case RTF_NOWIDCTLPAR: + { + RTFValue::Pointer_t pValue(new RTFValue(0)); + m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_PFWidowControl, pValue)); + } + break; + case RTF_BOX: + { + RTFSprms_t aAttributes; + RTFValue::Pointer_t pValue(new RTFValue(aAttributes)); + m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_PBrcTop, pValue)); + m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_PBrcLeft, pValue)); + m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_PBrcBottom, pValue)); + m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_PBrcRight, pValue)); + m_aStates.top().nBorderState = BORDER_PARAGRAPH; + } + break; + case RTF_LTRSECT: + case RTF_RTLSECT: + { + RTFValue::Pointer_t pValue(new RTFValue(nKeyword == RTF_LTRSECT ? 0 : 1)); + m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_STextFlow, pValue)); + } + break; + case RTF_LTRPAR: + case RTF_RTLPAR: + { + RTFValue::Pointer_t pValue(new RTFValue(nKeyword == RTF_LTRPAR ? 0 : 1)); + m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_PFrameTextFlow, pValue)); + } + break; + case RTF_LTRROW: + case RTF_RTLROW: + { + RTFValue::Pointer_t pValue(new RTFValue(nKeyword == RTF_LTRROW ? 0 : 1)); + m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_TTextFlow, pValue)); + } + break; + case RTF_LTRCH: + case RTF_RTLCH: + // dmapper does not support these. + break; + case RTF_ULNONE: + { + RTFValue::Pointer_t pValue(new RTFValue(0)); + m_aStates.top().aCharacterSprms.push_back(make_pair(NS_sprm::LN_CKul, pValue)); + } + break; + case RTF_NONSHPPICT: + m_aStates.top().nDestinationState = DESTINATION_SKIP; + break; + case RTF_CLBRDRT: + case RTF_CLBRDRL: + case RTF_CLBRDRB: + case RTF_CLBRDRR: + { + RTFSprms_t aAttributes; + RTFSprms_t aSprms; + RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms)); + switch (nKeyword) + { + case RTF_CLBRDRT: nParam = NS_ooxml::LN_CT_TcBorders_top; break; + case RTF_CLBRDRL: nParam = NS_ooxml::LN_CT_TcBorders_left; break; + case RTF_CLBRDRB: nParam = NS_ooxml::LN_CT_TcBorders_bottom; break; + case RTF_CLBRDRR: nParam = NS_ooxml::LN_CT_TcBorders_right; break; + default: break; + } + lcl_putNestedSprm(m_aStates.top().aTableCellSprms, NS_ooxml::LN_CT_TcPrBase_tcBorders, nParam, pValue); + m_aStates.top().nBorderState = BORDER_CELL; + } + break; + case RTF_PGBRDRT: + case RTF_PGBRDRL: + case RTF_PGBRDRB: + case RTF_PGBRDRR: + { + RTFSprms_t aAttributes; + RTFSprms_t aSprms; + RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms)); + switch (nKeyword) + { + case RTF_PGBRDRT: nParam = NS_ooxml::LN_CT_PageBorders_top; break; + case RTF_PGBRDRL: nParam = NS_ooxml::LN_CT_PageBorders_left; break; + case RTF_PGBRDRB: nParam = NS_ooxml::LN_CT_PageBorders_bottom; break; + case RTF_PGBRDRR: nParam = NS_ooxml::LN_CT_PageBorders_right; break; + default: break; + } + lcl_putNestedSprm(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgBorders, nParam, pValue); + m_aStates.top().nBorderState = BORDER_PAGE; + } + break; + case RTF_CLVMGF: + { + RTFValue::Pointer_t pValue(new RTFValue(NS_ooxml::LN_Value_ST_Merge_restart)); + m_aStates.top().aTableCellSprms.push_back(make_pair(NS_ooxml::LN_CT_TcPrBase_vMerge, pValue)); + } + break; + case RTF_CLVMRG: + { + RTFValue::Pointer_t pValue(new RTFValue(NS_ooxml::LN_Value_ST_Merge_continue)); + m_aStates.top().aTableCellSprms.push_back(make_pair(NS_ooxml::LN_CT_TcPrBase_vMerge, pValue)); + } + break; + case RTF_CLVERTALT: + case RTF_CLVERTALC: + case RTF_CLVERTALB: + { + switch (nKeyword) + { + case RTF_CLVERTALT: nParam = 0; break; + case RTF_CLVERTALC: nParam = 1; break; + case RTF_CLVERTALB: nParam = 3; break; + default: break; + } + RTFValue::Pointer_t pValue(new RTFValue(nParam)); + m_aStates.top().aTableCellSprms.push_back(make_pair(NS_ooxml::LN_CT_TcPrBase_vAlign, pValue)); + } + break; + case RTF_TRKEEP: + { + RTFValue::Pointer_t pValue(new RTFValue(1)); + m_aStates.top().aTableRowSprms.push_back(make_pair(NS_sprm::LN_TCantSplit, pValue)); + } + case RTF_SECTUNLOCKED: + { + RTFValue::Pointer_t pValue(new RTFValue(!nParam)); + m_aStates.top().aSectionSprms.push_back(make_pair(NS_ooxml::LN_EG_SectPrContents_formProt, pValue)); + } + case RTF_PGNDEC: + case RTF_PGNUCRM: + case RTF_PGNLCRM: + case RTF_PGNUCLTR: + case RTF_PGNLCLTR: + case RTF_PGNBIDIA: + case RTF_PGNBIDIB: + break; + // These should be mapped to NS_ooxml::LN_EG_SectPrContents_pgNumType, but dmapper has no API for that at the moment. + break; + case RTF_LOCH: + // Noop, dmapper detects this automatically. + break; + case RTF_HICH: + m_aStates.top().bIsCjk = true; + break; + case RTF_DBCH: + m_aStates.top().bIsCjk = false; + break; + case RTF_TITLEPG: + { + RTFValue::Pointer_t pValue(new RTFValue(1)); + m_aStates.top().aSectionSprms.push_back(make_pair(NS_ooxml::LN_EG_SectPrContents_titlePg, pValue)); + } + break; + case RTF_SUPER: + { + m_bSuper = true; + OUString aValue(RTL_CONSTASCII_USTRINGPARAM("superscript")); + RTFValue::Pointer_t pValue(new RTFValue(aValue)); + m_aStates.top().aCharacterSprms.push_back(make_pair(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue)); + } + break; + case RTF_SUB: + { + OUString aValue(RTL_CONSTASCII_USTRINGPARAM("subscript")); + RTFValue::Pointer_t pValue(new RTFValue(aValue)); + m_aStates.top().aCharacterSprms.push_back(make_pair(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue)); + } + break; + case RTF_LINEPPAGE: + case RTF_LINECONT: + { + RTFValue::Pointer_t pValue(new RTFValue(nKeyword == RTF_LINEPPAGE ? 0 : 2)); + lcl_putNestedAttribute(m_aStates.top().aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_lnNumType, NS_ooxml::LN_CT_LineNumber_restart, pValue); + } + break; + default: + OSL_TRACE("%s: TODO handle flag '%s'", OSL_THIS_FUNC, lcl_RtfToString(nKeyword)); + bParsed = false; + break; + } + skipDestination(bParsed); + return 0; +} + +int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) +{ + bool bParsed = true; + int nSprm = 0; + RTFValue::Pointer_t pIntValue(new RTFValue(nParam)); + // Trivial table sprms. + switch (nKeyword) + { + case RTF_FPRQ: nSprm = NS_rtf::LN_PRQ; break; + case RTF_LEVELJC: nSprm = NS_ooxml::LN_CT_Lvl_lvlJc; break; + case RTF_LEVELNFC: nSprm = NS_rtf::LN_NFC; break; + case RTF_LEVELSTARTAT: nSprm = NS_rtf::LN_ISTARTAT; break; + default: break; + } + if (nSprm > 0) + { + m_aStates.top().aTableSprms.push_back(make_pair(nSprm, pIntValue)); + skipDestination(bParsed); + return 0; + } + // Trivial character sprms. + switch (nKeyword) + { + case RTF_AF: nSprm = (m_aStates.top().bIsCjk ? NS_sprm::LN_CRgFtc1 : NS_sprm::LN_CRgFtc2); break; + case RTF_FS: nSprm = NS_sprm::LN_CHps; break; + case RTF_AFS: nSprm = NS_sprm::LN_CHpsBi; break; + case RTF_ANIMTEXT: nSprm = NS_sprm::LN_CSfxText; break; + case RTF_EXPNDTW: nSprm = NS_sprm::LN_CDxaSpace; break; + case RTF_KERNING: nSprm = NS_sprm::LN_CHpsKern; break; + case RTF_CHARSCALEX: nSprm = NS_sprm::LN_CCharScale; break; + case RTF_LANG: nSprm = NS_sprm::LN_CRgLid0; break; + case RTF_LANGFE: nSprm = NS_sprm::LN_CRgLid1; break; + default: break; + } + if (nSprm > 0) + { + m_aStates.top().aCharacterSprms.push_back(make_pair(nSprm, pIntValue)); + skipDestination(bParsed); + return 0; + } + // Trivial paragraph sprms. + switch (nKeyword) + { + case RTF_FI: nSprm = NS_sprm::LN_PDxaLeft1; break; + case RTF_LI: nSprm = NS_sprm::LN_PDxaLeft; break; + case RTF_LIN: nSprm = 0x845e; break; + case RTF_RI: nSprm = NS_sprm::LN_PDxaRight; break; + case RTF_RIN: nSprm = 0x845d; break; + case RTF_SB: nSprm = NS_sprm::LN_PDyaBefore; break; + case RTF_SA: nSprm = NS_sprm::LN_PDyaAfter; break; + case RTF_ITAP: nSprm = NS_sprm::LN_PTableDepth; break; + default: break; + } + if (nSprm > 0) + { + m_aStates.top().aParagraphSprms.push_back(make_pair(nSprm, pIntValue)); + skipDestination(bParsed); + return 0; + } + + // Trivial table attributes. + switch (nKeyword) + { + case RTF_SBASEDON: nSprm = NS_rtf::LN_ISTDBASE; break; + case RTF_SNEXT: nSprm = NS_rtf::LN_ISTDNEXT; break; + default: break; + } + if (nSprm > 0) + { + m_aStates.top().aTableAttributes.push_back(make_pair(nSprm, pIntValue)); + skipDestination(bParsed); + return 0; + } + + // Trivial paragraph attributes. + switch (nKeyword) + { + // NS_sprm::LN_PDyaLine could be used, but that won't work with slmult + case RTF_SL: nSprm = NS_ooxml::LN_CT_Spacing_line; break; + default: break; + } + if (nSprm > 0) + { + m_aStates.top().aParagraphAttributes.push_back(make_pair(nSprm, pIntValue)); + skipDestination(bParsed); + return 0; + } + + // Trivial character attributes. + switch (nKeyword) + { + case RTF_PICW: nSprm = NS_rtf::LN_XEXT; if (m_aStates.top().nPictureScaleX) nParam = m_aStates.top().nPictureScaleX * nParam; break; + case RTF_PICH: nSprm = NS_rtf::LN_YEXT; if (m_aStates.top().nPictureScaleY) nParam = m_aStates.top().nPictureScaleY * nParam; break; + default: break; + } + if (nSprm > 0) + { + RTFValue::Pointer_t pValue(new RTFValue(nParam)); + m_aStates.top().aCharacterAttributes.push_back(make_pair(nSprm, pValue)); + skipDestination(bParsed); + return 0; + } + + // Then check for the more complex ones. + switch (nKeyword) + { + case RTF_F: + if (m_aStates.top().nDestinationState == DESTINATION_FONTENTRY) + m_aStates.top().nCurrentFontIndex = nParam; + else + { + m_aStates.top().aCharacterSprms.push_back(make_pair(NS_sprm::LN_CRgFtc0, pIntValue)); + m_aStates.top().nCurrentEncoding = getEncodingTable(nParam); + } + break; + case RTF_RED: + m_aStates.top().aCurrentColor.nRed = nParam; + break; + case RTF_GREEN: + m_aStates.top().aCurrentColor.nGreen = nParam; + break; + case RTF_BLUE: + m_aStates.top().aCurrentColor.nBlue = nParam; + break; + case RTF_FCHARSET: + { + // we always send text to the domain mapper in OUString, so no + // need to send encoding info + int i; + for (i = 0; i < nRTFEncodings; i++) + { + if (aRTFEncodings[i].charset == nParam) + break; + } + if (i == nRTFEncodings) + // not found + return 0; + m_aFontEncodings[m_aStates.top().nCurrentFontIndex] = rtl_getTextEncodingFromWindowsCodePage(aRTFEncodings[i].codepage); + } + break; + case RTF_CF: + { + // NS_sprm::LN_CIco won't work, that would be an index in a static table + m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_Color_val, pIntValue)); + } + break; + case RTF_S: + if (m_aStates.top().nDestinationState == DESTINATION_STYLEENTRY) + { + m_aStates.top().nCurrentStyleIndex = nParam; + m_aStates.top().aTableAttributes.push_back(make_pair(NS_rtf::LN_ISTD, pIntValue)); + } + else + m_aStates.top().aParagraphAttributes.push_back(make_pair(NS_rtf::LN_ISTD, pIntValue)); + break; + case RTF_CS: + if (m_aStates.top().nDestinationState == DESTINATION_STYLEENTRY) + { + m_aStates.top().nCurrentStyleIndex = nParam; + m_aStates.top().aTableAttributes.push_back(make_pair(NS_rtf::LN_ISTD, pIntValue)); + RTFValue::Pointer_t pValue(new RTFValue(2)); + m_aStates.top().aTableAttributes.push_back(make_pair(NS_rtf::LN_SGC, pValue)); // character style + } + else + m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_rtf::LN_ISTD, pIntValue)); + break; + case RTF_DEFF: + m_aDefaultState.aCharacterSprms.push_back(make_pair(NS_sprm::LN_CRgFtc0, pIntValue)); + break; + case RTF_DEFLANG: + m_aDefaultState.aCharacterSprms.push_back(make_pair(NS_sprm::LN_CRgLid0, pIntValue)); + break; + case RTF_ADEFLANG: + m_aDefaultState.aCharacterSprms.push_back(make_pair(NS_sprm::LN_CLidBi, pIntValue)); + break; + case RTF_CHCBPAT: + { + RTFValue::Pointer_t pValue(new RTFValue(getColorTable(nParam))); + lcl_putNestedAttribute(m_aStates.top().aCharacterSprms, NS_sprm::LN_CShd, NS_ooxml::LN_CT_Shd_fill, pValue); + } + break; + case RTF_CLCBPAT: + { + RTFValue::Pointer_t pValue(new RTFValue(getColorTable(nParam))); + lcl_putNestedAttribute(m_aStates.top().aTableCellSprms, + NS_ooxml::LN_CT_TcPrBase_shd, NS_ooxml::LN_CT_Shd_fill, pValue); + } + break; + case RTF_CBPAT: + { + RTFValue::Pointer_t pValue(new RTFValue(getColorTable(nParam))); + lcl_putNestedAttribute(m_aStates.top().aParagraphSprms, NS_sprm::LN_PShd, NS_ooxml::LN_CT_Shd_fill, pValue); + } + break; + case RTF_ULC: + { + RTFValue::Pointer_t pValue(new RTFValue(getColorTable(nParam))); + m_aStates.top().aCharacterSprms.push_back(make_pair(0x6877, pValue)); + } + break; + case RTF_UP: // TODO handle when point size is not shrinking + { + OUString aValue(RTL_CONSTASCII_USTRINGPARAM("superscript")); + RTFValue::Pointer_t pValue(new RTFValue(aValue)); + m_aStates.top().aCharacterSprms.push_back(make_pair(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue)); + } + break; + case RTF_DN: + { + OUString aValue(RTL_CONSTASCII_USTRINGPARAM("subscript")); + RTFValue::Pointer_t pValue(new RTFValue(aValue)); + m_aStates.top().aCharacterSprms.push_back(make_pair(NS_ooxml::LN_EG_RPrBase_vertAlign, pValue)); + } + break; + case RTF_HORZVERT: + { + RTFValue::Pointer_t pValue(new RTFValue(true)); + m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_EastAsianLayout_vert, pValue)); + if (nParam) + // rotate fits to a single line + m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_EastAsianLayout_vertCompress, pValue)); + } + break; + case RTF_EXPND: + { + RTFValue::Pointer_t pValue(new RTFValue(nParam/5)); + m_aStates.top().aCharacterSprms.push_back(make_pair(NS_sprm::LN_CDxaSpace, pValue)); + } + break; + case RTF_TWOINONE: + { + RTFValue::Pointer_t pValue(new RTFValue(true)); + m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_EastAsianLayout_combine, pValue)); + if (nParam > 0) + m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_EastAsianLayout_combineBrackets, pIntValue)); + } + break; + case RTF_SLMULT: + if (nParam > 0) + { + RTFValue::Pointer_t pValue(new RTFValue(NS_ooxml::LN_Value_wordprocessingml_ST_LineSpacingRule_auto)); + m_aStates.top().aParagraphAttributes.push_back(make_pair(NS_ooxml::LN_CT_Spacing_lineRule, pValue)); + } + break; + case RTF_BRDRW: + { + // dmapper expects it in 1/8 pt, we have it in twip - but avoid rounding 1 to 0 + if (nParam > 1) + nParam = nParam * 2 / 5; + RTFValue::Pointer_t pValue(new RTFValue(nParam)); + lcl_putBorderProperty(m_aStates, NS_rtf::LN_DPTLINEWIDTH, pValue); + } + break; + case RTF_BRDRCF: + { + RTFValue::Pointer_t pValue(new RTFValue(getColorTable(nParam))); + lcl_putBorderProperty(m_aStates, NS_ooxml::LN_CT_Border_color, pValue); + } + break; + case RTF_BRSP: + { + // dmapper expects it in points, we have it in twip + RTFValue::Pointer_t pValue(new RTFValue(nParam / 20)); + lcl_putBorderProperty(m_aStates, NS_rtf::LN_DPTSPACE, pValue); + } + break; + case RTF_TX: + { + m_aStates.top().aTabAttributes.push_back(make_pair(NS_ooxml::LN_CT_TabStop_pos, pIntValue)); + RTFValue::Pointer_t pValue(new RTFValue(m_aStates.top().aTabAttributes)); + lcl_putNestedSprm(m_aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_tabs, NS_ooxml::LN_CT_Tabs_tab, pValue); + m_aStates.top().aTabAttributes.clear(); + } + break; + case RTF_ILVL: + { + RTFSprms_t& rSprms = lcl_getNumPr(m_aStates); + rSprms.push_back(make_pair(NS_sprm::LN_PIlvl, pIntValue)); + } + case RTF_LISTTEMPLATEID: + // This one is not referenced anywhere, so it's pointless to store it at the moment. + break; + case RTF_LISTID: + { + if (m_aStates.top().nDestinationState == DESTINATION_LISTENTRY) + m_aStates.top().aTableAttributes.push_back(make_pair(NS_ooxml::LN_CT_AbstractNum_abstractNumId, pIntValue)); + else if (m_aStates.top().nDestinationState == DESTINATION_LISTOVERRIDEENTRY) + m_aStates.top().aTableSprms.push_back(make_pair(NS_ooxml::LN_CT_Num_abstractNumId, pIntValue)); + } + break; + case RTF_LS: + { + if (m_aStates.top().nDestinationState == DESTINATION_LISTOVERRIDEENTRY) + m_aStates.top().aTableAttributes.push_back(make_pair(NS_rtf::LN_LSID, pIntValue)); + else + { + RTFSprms_t& rSprms = lcl_getNumPr(m_aStates); + rSprms.push_back(make_pair(NS_sprm::LN_PIlfo, pIntValue)); + } + } + break; + case RTF_U: + if ((SAL_MIN_INT16 <= nParam) && (nParam <= SAL_MAX_INT16)) + { + OUString aStr(static_cast<sal_Unicode>(nParam)); + text(aStr); + m_aStates.top().nCharsToSkip = m_aStates.top().nUc; + } + break; + case RTF_LEVELFOLLOW: + case RTF_LISTOVERRIDECOUNT: + // Ignore these for now, the exporter always emits them with a zero parameter. + break; + case RTF_PICSCALEX: + m_aStates.top().nPictureScaleX = 0.01 * nParam; + break; + case RTF_PICSCALEY: + m_aStates.top().nPictureScaleY = 0.01 * nParam; + break; + case RTF_SHPWRK: + { + int nValue = 0; + switch (nParam) + { + case 0: nValue = NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_bothSides; break; + case 1: nValue = NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_left; break; + case 2: nValue = NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_right; break; + case 3: nValue = NS_ooxml::LN_Value_wordprocessingDrawing_ST_WrapText_largest; break; + default: break; + } + RTFValue::Pointer_t pValue(new RTFValue(nValue)); + m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_WrapSquare_wrapText, pValue)); + } + break; + case RTF_CELLX: + { + int nCellX = nParam - m_aStates.top().nCellX; + m_aStates.top().nCellX = nParam; + RTFValue::Pointer_t pXValue(new RTFValue(nCellX)); + m_aStates.top().aTableRowSprms.push_back(make_pair(NS_ooxml::LN_CT_TblGridBase_gridCol, pXValue)); + + replayBuffer(m_aTableBuffer); + + // Reset cell properties. + RTFSprms::Pointer_t pTableCellSprms(new RTFSprms_t(m_aStates.top().aTableCellSprms)); + m_aStates.top().aTableCellsSprms.push_back(pTableCellSprms); + RTFSprms::Pointer_t pTableCellAttributes(new RTFSprms_t(m_aStates.top().aTableCellAttributes)); + m_aStates.top().aTableCellsAttributes.push_back(pTableCellAttributes); + m_aStates.top().aTableCellSprms = m_aDefaultState.aTableCellSprms; + m_aStates.top().aTableCellAttributes = m_aDefaultState.aTableCellAttributes; + } + break; + case RTF_TRRH: + { + lcl_putNestedAttribute(m_aStates.top().aTableRowSprms, + NS_ooxml::LN_CT_TrPrBase_trHeight, NS_ooxml::LN_CT_Height_val, pIntValue); + } + break; + case RTF_COLS: + lcl_putNestedAttribute(m_aStates.top().aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_cols, NS_ooxml::LN_CT_Columns_num, pIntValue); + break; + case RTF_COLSX: + lcl_putNestedAttribute(m_aStates.top().aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_cols, NS_ooxml::LN_CT_Columns_space, pIntValue); + break; + case RTF_COLNO: + lcl_putNestedSprm(m_aStates.top().aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_cols, NS_ooxml::LN_CT_Columns_col, pIntValue); + break; + case RTF_COLW: + case RTF_COLSR: + { + RTFSprms_t& rAttributes = lcl_getLastAttributes(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_cols); + rAttributes.push_back(make_pair((nKeyword == RTF_COLW ? NS_ooxml::LN_CT_Column_w : NS_ooxml::LN_CT_Column_space), + pIntValue)); + } + break; + case RTF_PAPERH: + lcl_putNestedAttribute(m_aDefaultState.aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_h, pIntValue, true); + break; + case RTF_PAPERW: + lcl_putNestedAttribute(m_aDefaultState.aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_w, pIntValue, true); + break; + case RTF_PGHSXN: + lcl_putNestedAttribute(m_aStates.top().aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_h, pIntValue, true); + break; + case RTF_PGWSXN: + lcl_putNestedAttribute(m_aStates.top().aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_w, pIntValue, true); + break; + case RTF_MARGL: + lcl_putNestedAttribute(m_aDefaultState.aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_left, pIntValue, true); + break; + case RTF_MARGR: + lcl_putNestedAttribute(m_aDefaultState.aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_right, pIntValue, true); + break; + case RTF_MARGT: + lcl_putNestedAttribute(m_aDefaultState.aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_top, pIntValue, true); + break; + case RTF_MARGB: + lcl_putNestedAttribute(m_aDefaultState.aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_bottom, pIntValue, true); + break; + case RTF_MARGLSXN: + lcl_putNestedAttribute(m_aStates.top().aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_left, pIntValue, true); + break; + case RTF_MARGRSXN: + lcl_putNestedAttribute(m_aStates.top().aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_right, pIntValue, true); + break; + case RTF_MARGTSXN: + lcl_putNestedAttribute(m_aStates.top().aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_top, pIntValue, true); + break; + case RTF_MARGBSXN: + lcl_putNestedAttribute(m_aStates.top().aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_bottom, pIntValue, true); + break; + case RTF_HEADERY: + lcl_putNestedAttribute(m_aStates.top().aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_header, pIntValue, true); + break; + case RTF_FOOTERY: + lcl_putNestedAttribute(m_aStates.top().aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_footer, pIntValue, true); + break; + case RTF_DEFTAB: + m_aSettingsTableSprms.push_back(make_pair(NS_ooxml::LN_CT_Settings_defaultTabStop, pIntValue)); + break; + case RTF_LINEMOD: + lcl_putNestedAttribute(m_aStates.top().aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_lnNumType, NS_ooxml::LN_CT_LineNumber_countBy, pIntValue); + break; + case RTF_LINEX: + if (nParam) + lcl_putNestedAttribute(m_aStates.top().aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_lnNumType, NS_ooxml::LN_CT_LineNumber_distance, pIntValue); + break; + case RTF_LINESTARTS: + lcl_putNestedAttribute(m_aStates.top().aSectionSprms, + NS_ooxml::LN_EG_SectPrContents_lnNumType, NS_ooxml::LN_CT_LineNumber_start, pIntValue); + break; + case RTF_REVAUTH: + case RTF_REVAUTHDEL: + { + RTFValue::Pointer_t pValue(new RTFValue(m_aAuthors[nParam])); + lcl_putNestedAttribute(m_aStates.top().aCharacterSprms, + NS_ooxml::LN_trackchange, NS_ooxml::LN_CT_TrackChange_author, pValue); + } + break; + case RTF_REVDTTM: + case RTF_REVDTTMDEL: + { + OUString aStr(OStringToOUString(lcl_DTTM22OString(nParam), m_aStates.top().nCurrentEncoding)); + RTFValue::Pointer_t pValue(new RTFValue(aStr)); + lcl_putNestedAttribute(m_aStates.top().aCharacterSprms, + NS_ooxml::LN_trackchange, NS_ooxml::LN_CT_TrackChange_date, pValue); + } + break; + default: + OSL_TRACE("%s: TODO handle value '%s'", OSL_THIS_FUNC, lcl_RtfToString(nKeyword)); + bParsed = false; + break; + } + skipDestination(bParsed); + return 0; +} + +int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam) +{ + bool bParsed = true; + int nSprm = -1; + RTFValue::Pointer_t pBoolValue(new RTFValue(!bParam || nParam != 0)); + + // Map all underline keywords to a single sprm. + switch (nKeyword) + { + case RTF_UL: nSprm = 1; break; + case RTF_ULD: nSprm = 4; break; + case RTF_ULDASH: nSprm = 7; break; + case RTF_ULDASHD: nSprm = 9; break; + case RTF_ULDASHDD: nSprm = 10; break; + case RTF_ULDB: nSprm = 3; break; + case RTF_ULHWAVE: nSprm = 27; break; + case RTF_ULLDASH: nSprm = 39; break; + case RTF_ULTH: nSprm = 6; break; + case RTF_ULTHD: nSprm = 20; break; + case RTF_ULTHDASH: nSprm = 23; break; + case RTF_ULTHDASHD: nSprm = 25; break; + case RTF_ULTHDASHDD: nSprm = 26; break; + case RTF_ULTHLDASH: nSprm = 55; break; + case RTF_ULULDBWAVE: nSprm = 43; break; + case RTF_ULW: nSprm = 2; break; + case RTF_ULWAVE: nSprm = 11; break; + default: break; + } + if (nSprm >= 0) + { + RTFValue::Pointer_t pValue(new RTFValue((!bParam || nParam != 0) ? nSprm : 0)); + m_aStates.top().aCharacterSprms.push_back(make_pair(NS_sprm::LN_CKul, pValue)); + skipDestination(bParsed); + return 0; + } + + // Accent characters (over dot / over coma). + switch (nKeyword) + { + case RTF_ACCNONE: nSprm = 0; break; + case RTF_ACCDOT: nSprm = 1; break; + case RTF_ACCCOMMA: nSprm = 2; break; + case RTF_ACCCIRCLE: nSprm = 3; break; + case RTF_ACCUNDERDOT: nSprm = 4; break; + default: break; + } + if (nSprm >= 0) + { + RTFValue::Pointer_t pValue(new RTFValue((!bParam || nParam != 0) ? nSprm : 0)); + m_aStates.top().aCharacterSprms.push_back(make_pair(NS_sprm::LN_CKcd, pValue)); + skipDestination(bParsed); + return 0; + } + + // Trivial character sprms. + switch (nKeyword) + { + case RTF_B: nSprm = NS_sprm::LN_CFBold; break; + case RTF_AB: nSprm = NS_sprm::LN_CFBoldBi; break; + case RTF_I: nSprm = NS_sprm::LN_CFItalic; break; + case RTF_AI: nSprm = NS_sprm::LN_CFItalicBi; break; + case RTF_UL: nSprm = NS_sprm::LN_CKul; break; + case RTF_OUTL: nSprm = NS_sprm::LN_CFOutline; break; + case RTF_SHAD: nSprm = NS_sprm::LN_CFShadow; break; + case RTF_V: nSprm = NS_sprm::LN_CFVanish; break; + case RTF_STRIKE: nSprm = NS_sprm::LN_CFStrike; break; + case RTF_STRIKED: nSprm = NS_sprm::LN_CFDStrike; break; + case RTF_SCAPS: nSprm = NS_sprm::LN_CFSmallCaps; break; + case RTF_IMPR: nSprm = NS_sprm::LN_CFImprint; break; + default: break; + } + if (nSprm >= 0) + { + m_aStates.top().aCharacterSprms.push_back(make_pair(nSprm, pBoolValue)); + skipDestination(bParsed); + return 0; + } + + switch (nKeyword) + { + case RTF_ASPALPHA: + m_aStates.top().aParagraphSprms.push_back(make_pair(NS_sprm::LN_PFAutoSpaceDE, pBoolValue)); + break; + case RTF_DELETED: + case RTF_REVISED: + { + RTFValue::Pointer_t pValue(new RTFValue(nKeyword == RTF_DELETED ? ooxml::OOXML_del : ooxml::OOXML_ins)); + lcl_putNestedAttribute(m_aStates.top().aCharacterSprms, + NS_ooxml::LN_trackchange, NS_ooxml::LN_token, pValue); + } + break; + default: + OSL_TRACE("%s: TODO handle toggle '%s'", OSL_THIS_FUNC, lcl_RtfToString(nKeyword)); + bParsed = false; + break; + } + skipDestination(bParsed); + return 0; +} + +void RTFDocumentImpl::skipDestination(bool bParsed) +{ + if (m_bSkipUnknown) + { + if (!bParsed) + { + OSL_TRACE("%s: skipping destination", OSL_THIS_FUNC); + m_aStates.top().nDestinationState = DESTINATION_SKIP; + } + m_bSkipUnknown = false; + } +} + +int RTFDocumentImpl::dispatchKeyword(OString& rKeyword, bool bParam, int nParam) +{ + if (m_aStates.top().nDestinationState == DESTINATION_SKIP) + return 0; + /*OSL_TRACE("%s: keyword '\\%s' with param? %d param val: '%d'", OSL_THIS_FUNC, + rKeyword.getStr(), (bParam ? 1 : 0), (bParam ? nParam : 0));*/ + int i, ret; + for (i = 0; i < nRTFControlWords; i++) + { + if (!strcmp(rKeyword.getStr(), aRTFControlWords[i].sKeyword)) + break; + } + if (i == nRTFControlWords) + { + OSL_TRACE("%s: unknown keyword '\\%s'", OSL_THIS_FUNC, rKeyword.getStr()); + skipDestination(false); + return 0; + } + + switch (aRTFControlWords[i].nControlType) + { + case CONTROL_FLAG: + // flags ignore any parameter by definition + if ((ret = dispatchFlag(aRTFControlWords[i].nIndex))) + return ret; + break; + case CONTROL_DESTINATION: + // same for destinations + if ((ret = dispatchDestination(aRTFControlWords[i].nIndex))) + return ret; + break; + case CONTROL_SYMBOL: + // and symbols + if ((ret = dispatchSymbol(aRTFControlWords[i].nIndex))) + return ret; + break; + case CONTROL_TOGGLE: + if ((ret = dispatchToggle(aRTFControlWords[i].nIndex, bParam, nParam))) + return ret; + break; + case CONTROL_VALUE: + // values require a parameter by definition + if (bParam && (ret = dispatchValue(aRTFControlWords[i].nIndex, nParam))) + return ret; + break; + } + + return 0; +} + +int RTFDocumentImpl::resolveKeyword() +{ + char ch; + OStringBuffer aBuf; + bool bNeg = false; + bool bParam = false; + int nParam = 0; + + Strm() >> ch; + if (Strm().IsEof()) + return ERROR_EOF; + + if (!isalpha(ch)) + { + aBuf.append(ch); + OString aKeyword = aBuf.makeStringAndClear(); + // control symbols aren't followed by a space, so we can return here + // without doing any SeekRel() + return dispatchKeyword(aKeyword, bParam, nParam); + } + while(isalpha(ch)) + { + aBuf.append(ch); + Strm() >> ch; + } + + if (ch == '-') + { + // in case we'll have a parameter, that will be negative + bNeg = true; + Strm() >> ch; + if (Strm().IsEof()) + return ERROR_EOF; + } + if (isdigit(ch)) + { + OStringBuffer aParameter; + + // we have a parameter + bParam = true; + while(isdigit(ch)) + { + aParameter.append(ch); + Strm() >> ch; + } + nParam = aParameter.makeStringAndClear().toInt32(); + if (bNeg) + nParam = -nParam; + } + if (ch != ' ') + Strm().SeekRel(-1); + OString aKeyword = aBuf.makeStringAndClear(); + return dispatchKeyword(aKeyword, bParam, nParam); +} + +int RTFDocumentImpl::pushState() +{ + //OSL_TRACE("%s before push: %d", OSL_THIS_FUNC, m_nGroup); + + m_nGroupStartPos = Strm().Tell(); + RTFParserState aState; + if (m_aStates.empty()) + aState = m_aDefaultState; + else + aState = m_aStates.top(); + m_aStates.push(aState); + + m_nGroup++; + + if (m_aStates.top().nDestinationState == DESTINATION_FONTTABLE) + m_aStates.top().nDestinationState = DESTINATION_FONTENTRY; + else if (m_aStates.top().nDestinationState == DESTINATION_STYLESHEET) + m_aStates.top().nDestinationState = DESTINATION_STYLEENTRY; + else if (m_aStates.top().nDestinationState == DESTINATION_FIELDRESULT) + m_aStates.top().nDestinationState = DESTINATION_NORMAL; + else if (m_aStates.top().nDestinationState == DESTINATION_REVISIONTABLE) + m_aStates.top().nDestinationState = DESTINATION_REVISIONENTRY; + + return 0; +} + +RTFSprms_t RTFDocumentImpl::mergeSprms() +{ + RTFSprms_t aSprms; + for (RTFSprms_t::iterator i = m_aStates.top().aTableSprms.begin(); + i != m_aStates.top().aTableSprms.end(); ++i) + aSprms.push_back(make_pair(i->first, i->second)); + for (RTFSprms_t::iterator i = m_aStates.top().aCharacterSprms.begin(); + i != m_aStates.top().aCharacterSprms.end(); ++i) + aSprms.push_back(make_pair(i->first, i->second)); + for (RTFSprms_t::iterator i = m_aStates.top().aParagraphSprms.begin(); + i != m_aStates.top().aParagraphSprms.end(); ++i) + aSprms.push_back(make_pair(i->first, i->second)); + return aSprms; +} + +RTFSprms_t RTFDocumentImpl::mergeAttributes() +{ + RTFSprms_t aAttributes; + for (RTFSprms_t::iterator i = m_aStates.top().aTableAttributes.begin(); + i != m_aStates.top().aTableAttributes.end(); ++i) + aAttributes.push_back(make_pair(i->first, i->second)); + for (RTFSprms_t::iterator i = m_aStates.top().aCharacterAttributes.begin(); + i != m_aStates.top().aCharacterAttributes.end(); ++i) + aAttributes.push_back(make_pair(i->first, i->second)); + for (RTFSprms_t::iterator i = m_aStates.top().aParagraphAttributes.begin(); + i != m_aStates.top().aParagraphAttributes.end(); ++i) + aAttributes.push_back(make_pair(i->first, i->second)); + return aAttributes; +} + +int RTFDocumentImpl::popState() +{ + //OSL_TRACE("%s before pop: m_nGroup %d, dest state: %d", OSL_THIS_FUNC, m_nGroup, m_aStates.top().nDestinationState); + + RTFReferenceTable::Entry_t aEntry; + bool bFontEntryEnd = false; + bool bStyleEntryEnd = false; + RTFSprms_t aSprms; + RTFSprms_t aAttributes; + bool bListEntryEnd = false; + bool bListLevelEnd = false; + bool bListOverrideEntryEnd = false; + bool bLevelTextEnd = false; + std::vector< std::pair<rtl::OUString, rtl::OUString> > aShapeProperties; + bool bPopShapeProperties = false; + bool bPicPropEnd = false; + + if (m_aStates.top().nDestinationState == DESTINATION_FONTTABLE) + { + writerfilter::Reference<Table>::Pointer_t const pTable(new RTFReferenceTable(m_aStates.top().aFontTableEntries)); + Mapper().table(NS_rtf::LN_FONTTABLE, pTable); + } + else if (m_aStates.top().nDestinationState == DESTINATION_STYLESHEET) + { + writerfilter::Reference<Table>::Pointer_t const pTable(new RTFReferenceTable(m_aStates.top().aStyleTableEntries)); + Mapper().table(NS_rtf::LN_STYLESHEET, pTable); + } + else if (m_aStates.top().nDestinationState == DESTINATION_LISTOVERRIDETABLE) + { + RTFSprms_t aListTableAttributes; + writerfilter::Reference<Properties>::Pointer_t const pProp(new RTFReferenceProperties(aListTableAttributes, m_aListTableSprms)); + RTFReferenceTable::Entries_t aListTableEntries; + aListTableEntries.insert(make_pair(0, pProp)); + writerfilter::Reference<Table>::Pointer_t const pTable(new RTFReferenceTable(aListTableEntries)); + Mapper().table(NS_rtf::LN_LISTTABLE, pTable); + } + else if (m_aStates.top().nDestinationState == DESTINATION_FONTENTRY) + { + RTFValue::Pointer_t pValue(new RTFValue(m_aDestinationText.makeStringAndClear())); + m_aStates.top().aTableAttributes.push_back(make_pair(NS_rtf::LN_XSZFFN, pValue)); + + bFontEntryEnd = true; + writerfilter::Reference<Properties>::Pointer_t const pProp( + new RTFReferenceProperties(m_aStates.top().aTableAttributes, m_aStates.top().aTableSprms) + ); + aEntry.first = m_aStates.top().nCurrentFontIndex; + aEntry.second = pProp; + } + else if (m_aStates.top().nDestinationState == DESTINATION_STYLEENTRY) + { + RTFValue::Pointer_t pValue(new RTFValue(m_aDestinationText.makeStringAndClear())); + m_aStates.top().aTableAttributes.push_back(make_pair(NS_rtf::LN_XSTZNAME1, pValue)); + + bStyleEntryEnd = true; + writerfilter::Reference<Properties>::Pointer_t const pProp( + new RTFReferenceProperties(mergeAttributes(), mergeSprms()) + ); + aEntry.first = m_aStates.top().nCurrentStyleIndex; + aEntry.second = pProp; + } + else if (m_aStates.top().nDestinationState == DESTINATION_LISTENTRY) + { + aAttributes = m_aStates.top().aTableAttributes; + aSprms = m_aStates.top().aTableSprms; + for (RTFSprms_t::iterator i = m_aStates.top().aListLevelEntries.begin(); + i != m_aStates.top().aListLevelEntries.end(); ++i) + aSprms.push_back(make_pair(i->first, i->second)); + bListEntryEnd = true; + } + else if (m_aStates.top().nDestinationState == DESTINATION_LISTLEVEL) + { + aAttributes = m_aStates.top().aTableAttributes; + aSprms = m_aStates.top().aTableSprms; + bListLevelEnd = true; + } + else if (m_aStates.top().nDestinationState == DESTINATION_LISTOVERRIDEENTRY) + { + aAttributes = m_aStates.top().aTableAttributes; + aSprms = m_aStates.top().aTableSprms; + bListOverrideEntryEnd = true; + } + else if (m_aStates.top().nDestinationState == DESTINATION_FIELDINSTRUCTION) + { + sal_uInt8 sFieldSep[] = { 0x14 }; + Mapper().startCharacterGroup(); + Mapper().text(sFieldSep, 1); + Mapper().endCharacterGroup(); + } + else if (m_aStates.top().nDestinationState == DESTINATION_FIELDRESULT) + { + sal_uInt8 sFieldEnd[] = { 0x15 }; + Mapper().startCharacterGroup(); + Mapper().text(sFieldEnd, 1); + Mapper().endCharacterGroup(); + } + else if (m_aStates.top().nDestinationState == DESTINATION_LEVELTEXT) + { + OUString aStr = m_aDestinationText.makeStringAndClear(); + + // The first character is the length of the string (the rest should be ignored). + sal_Int32 nLength(aStr.toChar()); + OUString aValue = aStr.copy(1, nLength); + RTFValue::Pointer_t pValue(new RTFValue(aValue, true)); + m_aStates.top().aTableAttributes.push_back(make_pair(NS_ooxml::LN_CT_LevelText_val, pValue)); + + aAttributes = m_aStates.top().aTableAttributes; + bLevelTextEnd = true; + } + else if (m_aStates.top().nDestinationState == DESTINATION_LEVELNUMBERS) + { + RTFSprms_t& rAttributes = RTFSprm::find(m_aStates.top().aTableSprms, NS_ooxml::LN_CT_Lvl_lvlText)->getAttributes(); + RTFValue::Pointer_t pValue = RTFSprm::find(rAttributes, NS_ooxml::LN_CT_LevelText_val); + OUString aOrig = pValue->getString(); + + OUStringBuffer aBuf; + sal_Int32 nReplaces = 1; + for (int i = 0; i < aOrig.getLength(); i++) + { + if (std::find(m_aStates.top().aLevelNumbers.begin(), m_aStates.top().aLevelNumbers.end(), i+1) + != m_aStates.top().aLevelNumbers.end()) + { + aBuf.append(sal_Unicode('%')); + // '1.1.1' -> '%1.%2.%3', but '1.' (with '2.' prefix omitted) is %2. + aBuf.append(sal_Int32(nReplaces++ + m_aStates.top().nListLevelNum + 1 - m_aStates.top().aLevelNumbers.size())); + } + else + aBuf.append(aOrig.copy(i, 1)); + } + pValue->setString(aBuf.makeStringAndClear()); + } + else if (m_aStates.top().nDestinationState == DESTINATION_SHAPEPROPERTYNAME + || m_aStates.top().nDestinationState == DESTINATION_SHAPEPROPERTYVALUE + || m_aStates.top().nDestinationState == DESTINATION_SHAPEPROPERTY) + { + aShapeProperties = m_aStates.top().aShapeProperties; + if (m_aStates.top().nDestinationState == DESTINATION_SHAPEPROPERTYNAME) + aShapeProperties.push_back(make_pair(m_aDestinationText.makeStringAndClear(), OUString())); + else if (m_aStates.top().nDestinationState == DESTINATION_SHAPEPROPERTYVALUE) + aShapeProperties.back().second = m_aDestinationText.makeStringAndClear(); + bPopShapeProperties = true; + } + else if (m_aStates.top().nDestinationState == DESTINATION_PICPROP) + { + aShapeProperties = m_aStates.top().aShapeProperties; + bPicPropEnd = true; + } + else if (m_aStates.top().nDestinationState == DESTINATION_REVISIONENTRY) + m_aAuthors[m_aAuthors.size()] = m_aDestinationText.makeStringAndClear(); + else if (m_aStates.top().nDestinationState == DESTINATION_BOOKMARKSTART) + { + OUString aStr = m_aDestinationText.makeStringAndClear(); + int nPos = m_aBookmarks.size(); + m_aBookmarks[aStr] = nPos; + Mapper().props(lcl_getBookmarkProperties(nPos, aStr)); + } + else if (m_aStates.top().nDestinationState == DESTINATION_BOOKMARKEND) + Mapper().props(lcl_getBookmarkProperties(m_aBookmarks[m_aDestinationText.makeStringAndClear()])); + + // See if we need to end a track change + RTFValue::Pointer_t pTrackchange = RTFSprm::find(m_aStates.top().aCharacterSprms, NS_ooxml::LN_trackchange); + if (pTrackchange.get()) + { + RTFSprms_t aTCAttributes; + RTFValue::Pointer_t pValue(new RTFValue(0)); + aTCAttributes.push_back(make_pair(NS_ooxml::LN_endtrackchange, pValue)); + writerfilter::Reference<Properties>::Pointer_t const pProperties(new RTFReferenceProperties(aTCAttributes)); + Mapper().props(pProperties); + } + + // This is the end of the doc, see if we need to close the last section. + if (m_nGroup == 1) + sectBreak(true); + + m_aStates.pop(); + + m_nGroup--; + + if (bFontEntryEnd) + m_aStates.top().aFontTableEntries.insert(make_pair(aEntry.first, aEntry.second)); + else if (bStyleEntryEnd) + m_aStates.top().aStyleTableEntries.insert(make_pair(aEntry.first, aEntry.second)); + // list table + else if (bListEntryEnd) + { + RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms)); + m_aListTableSprms.push_back(make_pair(NS_ooxml::LN_CT_Numbering_abstractNum, pValue)); + } + else if (bListLevelEnd) + { + RTFValue::Pointer_t pInnerValue(new RTFValue(m_aStates.top().nListLevelNum++)); + aAttributes.push_back(make_pair(NS_ooxml::LN_CT_Lvl_ilvl, pInnerValue)); + + RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms)); + m_aStates.top().aListLevelEntries.push_back(make_pair(NS_ooxml::LN_CT_AbstractNum_lvl, pValue)); + } + // list override table + else if (bListOverrideEntryEnd) + { + RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms)); + m_aListTableSprms.push_back(make_pair(NS_ooxml::LN_CT_Numbering_num, pValue)); + } + else if (bLevelTextEnd) + { + RTFValue::Pointer_t pValue(new RTFValue(aAttributes)); + m_aStates.top().aTableSprms.push_back(make_pair(NS_ooxml::LN_CT_Lvl_lvlText, pValue)); + } + else if (bPopShapeProperties) + m_aStates.top().aShapeProperties = aShapeProperties; + else if (bPicPropEnd) + resolveShapeProperties(aShapeProperties); + if (m_bSuper) + { + if (!m_bHasFootnote) + replayBuffer(m_aSuperBuffer); + m_bSuper = m_bHasFootnote = false; + } + + return 0; +} + +void RTFDocumentImpl::resolveShapeProperties(std::vector< std::pair<rtl::OUString, rtl::OUString> >& rShapeProperties) +{ + for (std::vector< std::pair<rtl::OUString, rtl::OUString> >::iterator i = rShapeProperties.begin(); i != rShapeProperties.end(); ++i) + { + if (i->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("shapeType"))) + { + int nValue = i->second.toInt32(); + switch (nValue) + { + case 75: // picture frame + break; + default: + OSL_TRACE("%s: TODO handle shape type '%d'", OSL_THIS_FUNC, nValue); + break; + } + } + else if (i->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("wzName"))) + { + RTFValue::Pointer_t pValue(new RTFValue(i->second)); + m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_NonVisualDrawingProps_name, pValue)); + } + else if (i->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("wzDescription"))) + { + RTFValue::Pointer_t pValue(new RTFValue(i->second)); + m_aStates.top().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_NonVisualDrawingProps_descr, pValue)); + } + else + OSL_TRACE("%s: TODO handle shape property '%s':'%s'", OSL_THIS_FUNC, + OUStringToOString( i->first, RTL_TEXTENCODING_UTF8 ).getStr(), + OUStringToOString( i->second, RTL_TEXTENCODING_UTF8 ).getStr()); + } +} + +int RTFDocumentImpl::resolveParse() +{ + OSL_TRACE("%s", OSL_THIS_FUNC); + char ch; + int ret; + // for hex chars + int b = 0, count = 2; + + while ((Strm() >> ch, !Strm().IsEof())) + { + //OSL_TRACE("%s: parsing character '%c'", OSL_THIS_FUNC, ch); + if (m_nGroup < 0) + return ERROR_GROUP_UNDER; + if (!m_aStates.empty() && m_aStates.top().nInternalState == INTERNAL_BIN) + { + OSL_TRACE("%s: TODO, binary internal state", OSL_THIS_FUNC); + } + else + { + switch (ch) + { + case '{': + if ((ret = pushState())) + return ret; + break; + case '}': + if ((ret = popState())) + return ret; + if (m_bIsSubstream && m_nGroup == 0) + return 0; + break; + case '\\': + if ((ret = resolveKeyword())) + return ret; + break; + case 0x0d: + case 0x0a: + break; // ignore these + default: + if (m_aStates.top().nInternalState == INTERNAL_NORMAL) + { + if ((ret = resolveChars(ch))) + return ret; + } + else + { + OSL_TRACE("%s: hex internal state", OSL_THIS_FUNC); + b = b << 4; + char parsed = lcl_AsHex(ch); + if (parsed == -1) + return ERROR_HEX_INVALID; + b += parsed; + count--; + if (!count) + { + if ((ret = resolveChars(b))) + return ret; + count = 2; + b = 0; + m_aStates.top().nInternalState = INTERNAL_NORMAL; + } + } + break; + } + } + } + + if (m_nGroup < 0) + return ERROR_GROUP_UNDER; + else if (m_nGroup > 0) + return ERROR_GROUP_OVER; + return 0; +} + +::std::string RTFDocumentImpl::getType() const +{ + return "RTFDocumentImpl"; +} + +RTFParserState::RTFParserState() + : nInternalState(INTERNAL_NORMAL), + nDestinationState(DESTINATION_NORMAL), + nBorderState(BORDER_NONE), + aTableSprms(), + aTableAttributes(), + aCharacterSprms(), + aCharacterAttributes(), + aParagraphSprms(), + aParagraphAttributes(), + aSectionSprms(), + aSectionAttributes(), + aTableRowSprms(), + aTableRowAttributes(), + aTableCellSprms(), + aTableCellAttributes(), + aTabAttributes(), + aFontTableEntries(), + nCurrentFontIndex(0), + aCurrentColor(), + aStyleTableEntries(), + nCurrentStyleIndex(0), + nCurrentEncoding(0), + nUc(1), + nCharsToSkip(0), + nListLevelNum(0), + aListLevelEntries(), + aLevelNumbers(), + nPictureScaleX(0), + nPictureScaleY(0), + aShapeProperties(), + nCellX(0), + aTableCellsSprms(), + aTableCellsAttributes(), + bIsCjk(false) +{ +} + +RTFColorTableEntry::RTFColorTableEntry() + : nRed(0), + nGreen(0), + nBlue(0) +{ +} + +} // namespace rtftok +} // namespace writerfilter + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx new file mode 100644 index 000000000000..90618a8103e0 --- /dev/null +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -0,0 +1,305 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef _RTFDOCUMENTIMPL_HXX_ +#define _RTFDOCUMENTIMPL_HXX_ + +#include <memory> +#include <stack> +#include <vector> + +#include <rtl/strbuf.hxx> +#include <oox/helper/graphichelper.hxx> +#include <oox/helper/storagebase.hxx> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +#include <resourcemodel/WW8ResourceModel.hxx> +#include <rtftok/RTFDocument.hxx> +#include <rtfcontrolwords.hxx> +#include <rtfreferencetable.hxx> +#include <rtfsprm.hxx> + +class SvStream; + +namespace writerfilter { + namespace rtftok { + enum RTFInternalState + { + INTERNAL_NORMAL, + INTERNAL_BIN, + INTERNAL_HEX + }; + + enum RTFDesitnationState + { + DESTINATION_NORMAL, + DESTINATION_SKIP, + DESTINATION_FONTTABLE, + DESTINATION_FONTENTRY, + DESTINATION_COLORTABLE, + DESTINATION_STYLESHEET, + DESTINATION_STYLEENTRY, + DESTINATION_FIELDINSTRUCTION, + DESTINATION_FIELDRESULT, + DESTINATION_LISTTABLE, + DESTINATION_LISTENTRY, + DESTINATION_LISTOVERRIDETABLE, + DESTINATION_LISTOVERRIDEENTRY, + DESTINATION_LISTLEVEL, + DESTINATION_LEVELTEXT, + DESTINATION_LEVELNUMBERS, + DESTINATION_SHPPICT, + DESTINATION_PICT, + DESTINATION_PICPROP, + DESTINATION_SHAPEPROPERTY, + DESTINATION_SHAPEPROPERTYNAME, + DESTINATION_SHAPEPROPERTYVALUE, + DESTINATION_SHAPE, + DESTINATION_SHAPEINSTRUCTION, + DESTINATION_SHAPEPROPERTYVALUEPICT, + DESTINATION_NESTEDTABLEPROPERTIES, + DESTINATION_FOOTNOTE, + DESTINATION_BOOKMARKSTART, + DESTINATION_BOOKMARKEND, + DESTINATION_REVISIONTABLE, + DESTINATION_REVISIONENTRY + }; + + enum RTFBorderState + { + BORDER_NONE, + BORDER_PARAGRAPH, + BORDER_CELL, + BORDER_PAGE + }; + + enum RTFErrors + { + ERROR_OK, + ERROR_GROUP_UNDER, + ERROR_GROUP_OVER, + ERROR_EOF, + ERROR_HEX_INVALID + }; + + enum RTFControlTypes + { + CONTROL_FLAG, // eg \sbknone takes no parameter + CONTROL_DESTINATION, // eg \fonttbl, if ignored, the whole group should be skipped + CONTROL_SYMBOL, // eg \tab + CONTROL_TOGGLE, // eg \b (between on and off) + CONTROL_VALUE // eg \fs (requires parameter) + }; + + /// Minimalistic buffer elements for nested cells. + enum RTFBufferTypes + { + BUFFER_PROPS, + BUFFER_CELLEND, + BUFFER_STARTRUN, + BUFFER_UTEXT, + BUFFER_ENDRUN, + BUFFER_PAR + }; + + /// An entry in the color table. + class RTFColorTableEntry + { + public: + RTFColorTableEntry(); + sal_uInt8 nRed; + sal_uInt8 nGreen; + sal_uInt8 nBlue; + }; + + /// State of the parser, which gets saved / restored when changing groups. + class RTFParserState + { + public: + RTFParserState(); + RTFInternalState nInternalState; + RTFDesitnationState nDestinationState; + RTFBorderState nBorderState; + // font table, stylesheet table + RTFSprms_t aTableSprms; + RTFSprms_t aTableAttributes; + // reset by plain + RTFSprms_t aCharacterSprms; + RTFSprms_t aCharacterAttributes; + // reset by pard + RTFSprms_t aParagraphSprms; + RTFSprms_t aParagraphAttributes; + // reset by sectd + RTFSprms_t aSectionSprms; + RTFSprms_t aSectionAttributes; + // reset by trowd + RTFSprms_t aTableRowSprms; + RTFSprms_t aTableRowAttributes; + // reset by cellx + RTFSprms_t aTableCellSprms; + RTFSprms_t aTableCellAttributes; + // reset by tx + RTFSprms_t aTabAttributes; + + RTFReferenceTable::Entries_t aFontTableEntries; + int nCurrentFontIndex; + + RTFColorTableEntry aCurrentColor; + + RTFReferenceTable::Entries_t aStyleTableEntries; + int nCurrentStyleIndex; + + rtl_TextEncoding nCurrentEncoding; + + /// Current \uc value. + int nUc; + /// Characters to skip, set to nUc by \u. + int nCharsToSkip; + + /// Next list level index to use when parsing list table. + int nListLevelNum; + /// List level entries, which will form a list entry later. + RTFSprms_t aListLevelEntries; + + /// List of character positions in leveltext to replace. + std::vector<sal_Int32> aLevelNumbers; + + float nPictureScaleX; + float nPictureScaleY; + std::vector< std::pair<rtl::OUString, rtl::OUString> > aShapeProperties; + + /// Current cellx value. + int nCellX; + std::deque<RTFSprms::Pointer_t> aTableCellsSprms; + std::deque<RTFSprms::Pointer_t> aTableCellsAttributes; + + /// CJK or CTL? + bool bIsCjk; + }; + + /// Implementation of the RTFDocument interface. + class RTFDocumentImpl + : public RTFDocument + { + public: + typedef ::boost::shared_ptr<RTFDocumentImpl> Pointer_t; + RTFDocumentImpl(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const& xContext, + com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const& xInputStream, + com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const& xDstDoc, + com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const& xFrame); + virtual ~RTFDocumentImpl(); + virtual void resolve(Stream & rHandler); + virtual std::string getType() const; + + SvStream& Strm(); + Stream& Mapper(); + sal_uInt32 getColorTable(sal_uInt32 nIndex); + sal_uInt32 getEncodingTable(sal_uInt32 nFontIndex); + void skipDestination(bool bParsed); + RTFSprms_t mergeSprms(); + RTFSprms_t mergeAttributes(); + void setSubstream(bool bIsSubtream); + void setIgnoreFirst(rtl::OUString& rIgnoreFirst); + void resolveSubstream(sal_uInt32 nPos, Id nId); + void resolveSubstream(sal_uInt32 nPos, Id nId, rtl::OUString& rIgnoreFirst); + void seek(sal_uInt32 nPos); + private: + int resolveParse(); + int resolveKeyword(); + void resolveShapeProperties(std::vector< std::pair<rtl::OUString, rtl::OUString> >& rShapeProperties); + + int dispatchKeyword(rtl::OString& rKeyword, bool bParam, int nParam); + int dispatchFlag(RTFKeyword nKeyword); + int dispatchDestination(RTFKeyword nKeyword); + int dispatchSymbol(RTFKeyword nKeyword); + int dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam); + int dispatchValue(RTFKeyword nKeyword, int nParam); + + int resolveChars(char ch); + /// Resolve a picture: If not inline, then anchored. + int resolvePict(char ch, bool bInline); + int pushState(); + int popState(); + void text(rtl::OUString& rString); + void parBreak(); + void sectBreak(bool bFinal); + void replayBuffer(std::deque< std::pair<RTFBufferTypes, RTFValue::Pointer_t> >& rBuffer); + + com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const& m_xContext; + com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const& m_xInputStream; + com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const& m_xDstDoc; + com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const& m_xFrame; + com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> m_xModelFactory; + SvStream* m_pInStream; + Stream* m_pMapperStream; + /// Same as m_aStates.size(), except that this can be negative for invalid input. + int m_nGroup; + std::stack<RTFParserState> m_aStates; + /// Read by RTF_PARD. + RTFParserState m_aDefaultState; + bool m_bSkipUnknown; + /// Font index <-> encoding map, *not* part of the parser state + std::map<int, rtl_TextEncoding> m_aFontEncodings; + /// Color index <-> RGB color value map + std::vector<sal_uInt32> m_aColorTable; + bool m_bFirstRun; + /// If paragraph properties should be emitted on next run. + bool m_bNeedPap; + /// The list table and list override table combined. + RTFSprms_t m_aListTableSprms; + /// The settings table. + RTFSprms_t m_aSettingsTableSprms; + + oox::StorageRef m_xStorage; + oox::GraphicHelper* m_pGraphicHelper; + + /// Buffered table cells, till cell definitions are not reached. + std::deque< std::pair<RTFBufferTypes, RTFValue::Pointer_t> > m_aTableBuffer; + bool m_bTable; + /// Buffered superscript, till footnote is reached (or not). + std::deque< std::pair<RTFBufferTypes, RTFValue::Pointer_t> > m_aSuperBuffer; + bool m_bSuper; + bool m_bHasFootnote; + /// If this is a substream. + bool m_bIsSubstream; + std::deque< std::pair<Id, sal_uInt32> > m_nHeaderFooterPositions; + sal_uInt32 m_nGroupStartPos; + /// Ignore the first occurrence of this text. + rtl::OUString m_aIgnoreFirst; + /// Bookmark name <-> index map. + std::map<rtl::OUString, int> m_aBookmarks; + /// Revision index <-> author map. + std::map<int, rtl::OUString> m_aAuthors; + /// Text from special destinations. + rtl::OUStringBuffer m_aDestinationText; + }; + } // namespace rtftok +} // namespace writerfilter + +#endif // _RTFDOCUMENTIMPL_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfreferenceproperties.cxx b/writerfilter/source/rtftok/rtfreferenceproperties.cxx new file mode 100644 index 000000000000..6ca5f1d68a3f --- /dev/null +++ b/writerfilter/source/rtftok/rtfreferenceproperties.cxx @@ -0,0 +1,69 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include <rtfreferenceproperties.hxx> +#include <rtfsprm.hxx> + +namespace writerfilter { +namespace rtftok { + +RTFReferenceProperties::RTFReferenceProperties(RTFSprms_t rAttributes, RTFSprms_t rSprms) + : m_rAttributes(rAttributes), + m_rSprms(rSprms) +{ +} + +RTFReferenceProperties::RTFReferenceProperties(RTFSprms_t rAttributes) + : m_rAttributes(rAttributes), + m_rSprms() +{ +} + +RTFReferenceProperties::~RTFReferenceProperties() +{ +} + +void RTFReferenceProperties::resolve(Properties& rHandler) +{ + for (RTFSprms_t::iterator i = m_rAttributes.begin(); i != m_rAttributes.end(); ++i) + rHandler.attribute(i->first, *i->second.get()); + for (RTFSprms_t::iterator i = m_rSprms.begin(); i != m_rSprms.end(); ++i) + { + RTFSprm aSprm(i->first, i->second); + rHandler.sprm(aSprm); + } +} + +std::string RTFReferenceProperties::getType() const +{ + return "RTFReferenceProperties"; +} + +} // namespace rtftok +} // namespace writerfilter + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfreferenceproperties.hxx b/writerfilter/source/rtftok/rtfreferenceproperties.hxx new file mode 100644 index 000000000000..a689e5f8d645 --- /dev/null +++ b/writerfilter/source/rtftok/rtfreferenceproperties.hxx @@ -0,0 +1,58 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef _RTFREFERENCEPROPERTIES_HXX_ +#define _RTFREFERENCEPROPERTIES_HXX_ + +#include <map> +#include <resourcemodel/WW8ResourceModel.hxx> +#include <rtfsprm.hxx> + +class SvStream; + +namespace writerfilter { + namespace rtftok { + /// Sends RTFSprm instances to DomainMapper. + class RTFReferenceProperties + : public writerfilter::Reference<Properties> + { + public: + RTFReferenceProperties(RTFSprms_t rAttributes, RTFSprms_t rSprms); + RTFReferenceProperties(RTFSprms_t rAttributes); + virtual ~RTFReferenceProperties(); + virtual void resolve(Properties & rHandler); + virtual std::string getType() const; + private: + RTFSprms_t m_rAttributes; + RTFSprms_t m_rSprms; + }; + } // namespace rtftok +} // namespace writerfilter + +#endif // _RTFREFERENCEPROPERTIES_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfreferencetable.cxx b/writerfilter/source/rtftok/rtfreferencetable.cxx new file mode 100644 index 000000000000..9966c68f6903 --- /dev/null +++ b/writerfilter/source/rtftok/rtfreferencetable.cxx @@ -0,0 +1,56 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include <rtfreferencetable.hxx> + +namespace writerfilter { +namespace rtftok { + +RTFReferenceTable::RTFReferenceTable(Entries_t const& rEntries) + : m_aEntries(rEntries) +{ +} + +RTFReferenceTable::~RTFReferenceTable() +{ +} + +void RTFReferenceTable::resolve(Table& rHandler) +{ + for (Entries_t::const_iterator i = m_aEntries.begin(); i != m_aEntries.end(); ++i) + rHandler.entry(i->first, i->second); +} + +std::string RTFReferenceTable::getType() const +{ + return "RTFReferenceTable"; +} + +} // namespace rtftok +} // namespace writerfilter + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfreferencetable.hxx b/writerfilter/source/rtftok/rtfreferencetable.hxx new file mode 100644 index 000000000000..f0e0194c0f87 --- /dev/null +++ b/writerfilter/source/rtftok/rtfreferencetable.hxx @@ -0,0 +1,57 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef _RTFREFERENCETABLE_HXX_ +#define _RTFREFERENCETABLE_HXX_ + +#include <map> +#include <resourcemodel/WW8ResourceModel.hxx> + +class SvStream; + +namespace writerfilter { + namespace rtftok { + /// Sends tables (e.g. font table) to the domain mapper. + class RTFReferenceTable + : public writerfilter::Reference<Table> + { + public: + typedef std::map<int, writerfilter::Reference<Properties>::Pointer_t> Entries_t; + typedef std::pair<int, writerfilter::Reference<Properties>::Pointer_t> Entry_t; + RTFReferenceTable(Entries_t const& rEntries); + virtual ~RTFReferenceTable(); + virtual void resolve(Table & rHandler); + virtual std::string getType() const; + private: + Entries_t m_aEntries; + }; + } // namespace rtftok +} // namespace writerfilter + +#endif // _RTFREFERENCETABLE_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx new file mode 100644 index 000000000000..e5d3e263d98a --- /dev/null +++ b/writerfilter/source/rtftok/rtfsprm.cxx @@ -0,0 +1,121 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include <rtfsprm.hxx> +#include <rtl/strbuf.hxx> + +#include <resourcemodel/QNameToString.hxx> + +using rtl::OStringBuffer; + +namespace writerfilter { +namespace rtftok { + +RTFSprm::RTFSprm(Id nKeyword, RTFValue::Pointer_t& pValue) + : m_nKeyword(nKeyword), + m_pValue(pValue) +{ +} + +sal_uInt32 RTFSprm::getId() const +{ + return m_nKeyword; +} + +Value::Pointer_t RTFSprm::getValue() +{ + return Value::Pointer_t(m_pValue->Clone()); +} + +writerfilter::Reference<BinaryObj>::Pointer_t RTFSprm::getBinary() +{ + return m_pValue->getBinary(); +} + +writerfilter::Reference<Stream>::Pointer_t RTFSprm::getStream() +{ + return m_pValue->getStream(); +} + +writerfilter::Reference<Properties>::Pointer_t RTFSprm::getProps() +{ + return m_pValue->getProperties(); +} + +Sprm::Kind RTFSprm::getKind() +{ + return Sprm::UNKNOWN; +} + +std::string RTFSprm::getName() const +{ + return "RTFSprm"; +} + +std::string RTFSprm::toString() const +{ + OStringBuffer aBuf("RTFSprm"); + + std::string sResult = (*QNameToString::Instance())(m_nKeyword); + if (sResult.length() == 0) + sResult = (*SprmIdToString::Instance())(m_nKeyword); + + aBuf.append(" ('"); + if (sResult.length() == 0) + aBuf.append(sal_Int32(m_nKeyword)); + else + aBuf.append(sResult.c_str()); + aBuf.append("', '"); + aBuf.append(m_pValue->toString().c_str()); + aBuf.append("')"); + + return aBuf.makeStringAndClear().getStr(); +} + +RTFValue::Pointer_t RTFSprm::find(RTFSprms_t &rVector, Id nKeyword) +{ + for (RTFSprms_t::iterator i = rVector.begin(); i != rVector.end(); ++i) + if (i->first == nKeyword) + return i->second; + RTFValue::Pointer_t pValue; + return pValue; +} + +void RTFSprm::erase(RTFSprms_t &rVector, Id nKeyword) +{ + for (RTFSprms_t::iterator i = rVector.begin(); i != rVector.end(); ++i) + if (i->first == nKeyword) + { + rVector.erase(i); + return; + } +} + +} // namespace rtftok +} // namespace writerfilter + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfsprm.hxx b/writerfilter/source/rtftok/rtfsprm.hxx new file mode 100644 index 000000000000..441c7e9aa8b0 --- /dev/null +++ b/writerfilter/source/rtftok/rtfsprm.hxx @@ -0,0 +1,68 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef _RTFSPRM_HXX_ +#define _RTFSPRM_HXX_ + +#include <string> +#include <resourcemodel/WW8ResourceModel.hxx> +#include <rtfcontrolwords.hxx> +#include <rtfvalue.hxx> + +namespace writerfilter { + namespace rtftok { + /// A list of RTFSprm + typedef std::vector< std::pair<Id, RTFValue::Pointer_t> > RTFSprms_t; + namespace RTFSprms { + typedef ::boost::shared_ptr<RTFSprms_t> Pointer_t; + } + /// RTF keyword with a parameter + class RTFSprm + : public Sprm + { + public: + RTFSprm(Id nKeyword, RTFValue::Pointer_t& pValue); + virtual sal_uInt32 getId() const; + virtual Value::Pointer_t getValue(); + virtual writerfilter::Reference<BinaryObj>::Pointer_t getBinary(); + virtual writerfilter::Reference<Stream>::Pointer_t getStream(); + virtual writerfilter::Reference<Properties>::Pointer_t getProps(); + virtual Kind getKind(); + virtual std::string getName() const; + virtual std::string toString() const; + static RTFValue::Pointer_t find(RTFSprms_t& rVector, Id nKeyword); + static void erase(RTFSprms_t& rVector, Id nKeyword); + private: + Id m_nKeyword; + RTFValue::Pointer_t& m_pValue; + }; + } // namespace rtftok +} // namespace writerfilter + +#endif // _RTFSPRM_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtftypes.hxx b/writerfilter/source/rtftok/rtftypes.hxx new file mode 100644 index 000000000000..3f437f34b534 --- /dev/null +++ b/writerfilter/source/rtftok/rtftypes.hxx @@ -0,0 +1,58 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef _RTFTYPES_HXX_ +#define _RTFTYPES_HXX_ + +#include <rtfcontrolwords.hxx> + +namespace writerfilter { + namespace rtftok { + /// Respresents an RTF Control Word + typedef struct + { + const char *sKeyword; + int nControlType; + RTFKeyword nIndex; + } RTFSymbol; + extern RTFSymbol aRTFControlWords[]; + extern int nRTFControlWords; + + /// RTF legacy charsets + typedef struct + { + int charset; + int codepage; + } RTFEncoding; + extern RTFEncoding aRTFEncodings[]; + extern int nRTFEncodings; + } // namespace rtftok +} // namespace writerfilter + +#endif // _RTFTYPES_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfvalue.cxx b/writerfilter/source/rtftok/rtfvalue.cxx new file mode 100644 index 000000000000..54fbd6cbe790 --- /dev/null +++ b/writerfilter/source/rtftok/rtfvalue.cxx @@ -0,0 +1,174 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include <rtfvalue.hxx> +#include <rtfreferenceproperties.hxx> +#include <rtl/strbuf.hxx> +#include <rtl/ustrbuf.hxx> + +namespace writerfilter { +namespace rtftok { + +using rtl::OString; +using rtl::OUString; + +RTFValue::RTFValue(int nValue, rtl::OUString sValue, RTFSprms_t rAttributes, + RTFSprms_t rSprms, uno::Reference<drawing::XShape> rShape) + : m_nValue(nValue), + m_sValue(sValue), + m_rAttributes(rAttributes), + m_rSprms(rSprms), + m_rShape(rShape), + m_bForceString(false) +{ +} + +RTFValue::RTFValue(int nValue) + : m_nValue(nValue), + m_sValue(), + m_rAttributes(), + m_rSprms(), + m_rShape(), + m_bForceString(false) +{ +} + +RTFValue::RTFValue(OUString sValue, bool bForce) + : m_nValue(), + m_sValue(sValue), + m_rAttributes(), + m_rSprms(), + m_rShape(), + m_bForceString(bForce) +{ +} + +RTFValue::RTFValue(RTFSprms_t rAttributes) + : m_nValue(), + m_sValue(), + m_rAttributes(rAttributes), + m_rSprms(), + m_rShape(), + m_bForceString(false) +{ +} + +RTFValue::RTFValue(RTFSprms_t rAttributes, RTFSprms_t rSprms) + : m_nValue(), + m_sValue(), + m_rAttributes(rAttributes), + m_rSprms(rSprms), + m_rShape(), + m_bForceString(false) +{ +} + +RTFValue::RTFValue(uno::Reference<drawing::XShape> rShape) + : m_nValue(), + m_sValue(), + m_rAttributes(), + m_rSprms(), + m_rShape(rShape), + m_bForceString(false) +{ +} + +int RTFValue::getInt() const +{ + return m_nValue; +} + +OUString RTFValue::getString() const +{ + if (m_sValue.getLength() > 0 || m_bForceString) + return m_sValue; + else + return OUString::valueOf(sal_Int32(m_nValue)); +} + +void RTFValue::setString(OUString sValue) +{ + m_sValue = sValue; +} + +uno::Any RTFValue::getAny() const +{ + uno::Any ret; + if (m_sValue.getLength() > 0 || m_bForceString) + ret <<= m_sValue; + else if (m_rShape.is()) + ret <<= m_rShape; + else + ret <<= static_cast<sal_Int32>(m_nValue); + return ret; +} + +writerfilter::Reference<Properties>::Pointer_t RTFValue::getProperties() +{ + writerfilter::Reference<Properties>::Pointer_t const pProperties( + new RTFReferenceProperties(m_rAttributes, m_rSprms) + ); + return pProperties; +} + +writerfilter::Reference<Stream>::Pointer_t RTFValue::getStream() +{ + return writerfilter::Reference<Stream>::Pointer_t(); +} + +writerfilter::Reference<BinaryObj>::Pointer_t RTFValue::getBinary() +{ + return writerfilter::Reference<BinaryObj>::Pointer_t(); +} + +std::string RTFValue::toString() const +{ + if (m_sValue.getLength() > 0 || m_bForceString) + return OUStringToOString(m_sValue, RTL_TEXTENCODING_UTF8).getStr(); + else + return OString::valueOf(static_cast<sal_Int32>(m_nValue)).getStr(); +} + +RTFValue* RTFValue::Clone() +{ + return new RTFValue(m_nValue, m_sValue, m_rAttributes, m_rSprms, m_rShape); +} + +RTFSprms_t& RTFValue::getAttributes() +{ + return m_rAttributes; +} + +RTFSprms_t& RTFValue::getSprms() +{ + return m_rSprms; +} + +} // namespace rtftok +} // namespace writerfilter + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfvalue.hxx b/writerfilter/source/rtftok/rtfvalue.hxx new file mode 100644 index 000000000000..e03971936ac9 --- /dev/null +++ b/writerfilter/source/rtftok/rtfvalue.hxx @@ -0,0 +1,76 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef _RTFVALUE_HXX_ +#define _RTFVALUE_HXX_ + +#include <string> +#include <map> +#include <rtl/ustrbuf.hxx> +#include <resourcemodel/WW8ResourceModel.hxx> + +namespace writerfilter { + namespace rtftok { + /// Value of an RTF keyword + class RTFValue + : public Value + { + public: + typedef ::boost::shared_ptr<RTFValue> Pointer_t; + RTFValue(int nValue, rtl::OUString sValue, std::vector< std::pair<Id, RTFValue::Pointer_t> > rAttributes, + std::vector< std::pair<Id, RTFValue::Pointer_t> > rSprms, uno::Reference<drawing::XShape> rShape); + RTFValue(int nValue); + RTFValue(rtl::OUString sValue, bool bForce = false); + RTFValue(std::vector< std::pair<Id, RTFValue::Pointer_t> > rAttributes); + RTFValue(std::vector< std::pair<Id, RTFValue::Pointer_t> > rAttributes, + std::vector< std::pair<Id, RTFValue::Pointer_t> > rSprms); + RTFValue(uno::Reference<drawing::XShape> rShape); + void setString(rtl::OUString sValue); + virtual int getInt() const; + virtual rtl::OUString getString() const; + virtual uno::Any getAny() const; + virtual writerfilter::Reference<Properties>::Pointer_t getProperties(); + virtual writerfilter::Reference<Stream>::Pointer_t getStream(); + virtual writerfilter::Reference<BinaryObj>::Pointer_t getBinary(); + virtual std::string toString() const; + virtual RTFValue* Clone(); + std::vector< std::pair<Id, RTFValue::Pointer_t> >& getAttributes(); + std::vector< std::pair<Id, RTFValue::Pointer_t> >& getSprms(); + private: + int m_nValue; + rtl::OUString m_sValue; + std::vector< std::pair<Id, RTFValue::Pointer_t> > m_rAttributes; + std::vector< std::pair<Id, RTFValue::Pointer_t> > m_rSprms; + uno::Reference<drawing::XShape> m_rShape; + bool m_bForceString; + }; + } // namespace rtftok +} // namespace writerfilter + +#endif // _RTFVALUE_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/unocomponent/component.cxx b/writerfilter/unocomponent/component.cxx index d715a70a9ae1..1bb79c7ba069 100644 --- a/writerfilter/unocomponent/component.cxx +++ b/writerfilter/unocomponent/component.cxx @@ -56,12 +56,6 @@ static struct ::cppu::ImplementationEntry s_component_entries [] = { 0, 0, 0, 0, 0, 0 } // terminate with NULL }; - -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(sal_Char const * implName, ::com::sun::star::lang::XMultiServiceFactory * xMgr, ::com::sun::star::registry::XRegistryKey * xRegistry ) { fprintf(stderr, "Loading service: %s: ", implName); diff --git a/writerfilter/unocomponent/exports.dxp b/writerfilter/unocomponent/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/writerfilter/unocomponent/exports.dxp +++ b/writerfilter/unocomponent/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory |