[ooo-build-commit] .: patches/dev300
Jan Holesovsky
kendy at kemper.freedesktop.org
Fri Apr 23 07:49:53 PDT 2010
patches/dev300/field-patch-m13.diff | 2656 ------------
patches/dev300/fit-list-to-size-ooxml-m14.diff | 38
patches/dev300/svx-hacky-htmlselect-control-import-m13.diff | 215
3 files changed, 2909 deletions(-)
New commits:
commit c465adc02327e4f217e04629e0dc50c76447c00b
Author: Jan Holesovsky <kendy at suse.cz>
Date: Fri Apr 23 16:49:08 2010 +0200
More m13/m14 unused patches removed.
* patches/dev300/field-patch-m13.diff:
* patches/dev300/fit-list-to-size-ooxml-m14.diff:
* patches/dev300/svx-hacky-htmlselect-control-import-m13.diff:
diff --git a/patches/dev300/field-patch-m13.diff b/patches/dev300/field-patch-m13.diff
deleted file mode 100644
index 738879b..0000000
--- a/patches/dev300/field-patch-m13.diff
+++ /dev/null
@@ -1,2656 +0,0 @@
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' offapi/com/sun/star/text/XFormField.idl offapi/com/sun/star/text/XFormField.idl
---- offapi/com/sun/star/text/XFormField.idl 2009-08-13 16:13:57.000000000 +0200
-+++ offapi/com/sun/star/text/XFormField.idl 2009-10-09 10:53:45.000000000 +0200
-@@ -11,14 +11,13 @@
- */
- interface XFormField: com::sun::star::uno::XInterface
- {
-- short getType();
-- short getRes();
-- string getDescription( );
--
-- void setType([in] short fieldType );
-- void setRes([in] short res );
-- void setDescription([in] string description );
--
-+ string getFieldType();
-+ void setFieldType([in] string fieldType);
-+
-+ short getParamCount();
-+ string getParamName([in] short i);
-+ string getParamValue([in] short i);
-+ void addParam([in] string name, [in] string value, [in] boolean replaceExisting);
- };
-
- }; }; }; };
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' svtools/source/config/fltrcfg.cxx svtools/source/config/fltrcfg.cxx
---- svtools/source/config/fltrcfg.cxx 2009-08-04 15:49:29.000000000 +0200
-+++ svtools/source/config/fltrcfg.cxx 2009-10-09 10:53:45.000000000 +0200
-@@ -312,7 +312,7 @@
- "Export/EnablePowerPointPreview", // 8
- "Export/EnableExcelPreview", // 9
- "Export/EnableWordPreview", // 10
-- "Import/ImportWWFieldsAsEnhancedFields" // 11
-+ "Import/ImportWWFieldsAsEnhancedFields" // 11
- };
- OUString* pNames = aNames.getArray();
- for(int i = 0; i < nCount; i++)
-@@ -525,8 +525,7 @@
-
- BOOL SvtFilterOptions::IsUseEnhancedFields() const
- {
-- return false; // disable for now;
--// return pImp->IsFlag( FILTERCFG_USE_ENHANCED_FIELDS );
-+ return pImp->IsFlag( FILTERCFG_USE_ENHANCED_FIELDS );
- }
-
- void SvtFilterOptions::SetUseEnhancedFields( BOOL bFlag )
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/inc/IDocumentMarkAccess.hxx sw/inc/IDocumentMarkAccess.hxx
---- sw/inc/IDocumentMarkAccess.hxx 2009-08-13 16:14:38.000000000 +0200
-+++ sw/inc/IDocumentMarkAccess.hxx 2009-10-09 10:53:45.000000000 +0200
-@@ -86,6 +86,13 @@
- const ::rtl::OUString& rProposedName,
- MarkType eMark) =0;
-
-+ virtual sw::mark::IFieldmark* makeFieldBookmark( const SwPaM& rPaM,
-+ const rtl::OUString& rName,
-+ const rtl::OUString& rType) = 0;
-+ virtual sw::mark::IFieldmark* makeNoTextFieldBookmark( const SwPaM& rPaM,
-+ const rtl::OUString& rName,
-+ const rtl::OUString& rType) = 0;
-+
- /** Returns a mark in the document for a paragraph.
- If there is none, a mark will be created.
-
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/inc/IMark.hxx sw/inc/IMark.hxx
---- sw/inc/IMark.hxx 2009-08-13 16:14:38.000000000 +0200
-+++ sw/inc/IMark.hxx 2009-10-09 10:53:45.000000000 +0200
-@@ -51,12 +51,12 @@
- {
- public:
- //getters
-- virtual const SwPosition& GetMarkPos() const =0;
-+ virtual SwPosition& GetMarkPos() const =0;
- // GetOtherMarkPos() is only guaranteed to return a valid
- // reference if IsExpanded() returned true
-- virtual const SwPosition& GetOtherMarkPos() const =0;
-- virtual const SwPosition& GetMarkStart() const =0;
-- virtual const SwPosition& GetMarkEnd() const =0;
-+ virtual SwPosition& GetOtherMarkPos() const =0;
-+ virtual SwPosition& GetMarkStart() const =0;
-+ virtual SwPosition& GetMarkEnd() const =0;
- virtual const ::rtl::OUString& GetName() const =0;
- virtual bool IsExpanded() const =0;
- virtual bool IsCoveringPosition(const SwPosition& rPos) const =0;
-@@ -79,6 +79,9 @@
- { return GetMarkEnd() < rPos; }
- bool EndsAfter(const SwPosition& rPos) const
- { return GetMarkEnd() > rPos; }
-+
-+ // Use for debugging purpose
-+ virtual rtl::OUString toString( ) const = 0;
- };
-
- class IBookmark
-@@ -95,13 +98,25 @@
- : virtual public IMark
- {
- public:
-+ typedef std::pair< ::rtl::OUString, ::rtl::OUString > ParamPair_t;
-+
- //getters
- virtual ::rtl::OUString GetFieldname() const =0;
- virtual ::rtl::OUString GetFieldHelptext() const =0;
-
-+ virtual void addParam( rtl::OUString rParamName,
-+ rtl::OUString rParamValue,
-+ bool bReplaceExisting = true ) = 0;
-+ virtual void addParam( const char* paramName, int value ) = 0;
-+ virtual void addParams( std::vector<ParamPair_t>& params ) = 0;
-+ virtual int getNumOfParams() const = 0;
-+ virtual ParamPair_t getParam( int pos ) const = 0;
-+ virtual ParamPair_t getParam( const char *name, const char *defaultValue = NULL ) const = 0;
-+
- //setters
- virtual void SetFieldname(const ::rtl::OUString& rFieldname) =0;
- virtual void SetFieldHelptext(const ::rtl::OUString& rFieldHelptext) =0;
-+ virtual void invalidate( ) = 0;
- };
-
- class ICheckboxFieldmark
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/inc/crsrsh.hxx sw/inc/crsrsh.hxx
---- sw/inc/crsrsh.hxx 2009-09-09 11:44:12.000000000 +0200
-+++ sw/inc/crsrsh.hxx 2009-10-09 10:53:45.000000000 +0200
-@@ -45,6 +45,7 @@
- #include <node.hxx>
- #include <tblsel.hxx>
- #include <IDocumentMarkAccess.hxx>
-+#include <IMark.hxx>
-
-
- // einige Forward Deklarationen
-@@ -110,7 +111,8 @@
- SW_REFMARK = 0x0100,
- SW_NUMLABEL = 0x0200, // #i23726#
- SW_CONTENT_CHECK = 0x0400, // --> FME 2005-05-13 #i43742# <--
-- SW_SMARTTAG = 0x0800
-+ SW_SMARTTAG = 0x0800,
-+ SW_FORMCTRL = 0x1000
- #ifndef PRODUCT
- ,SW_CURR_ATTRS = 0x4000 // nur zum Debuggen
- ,SW_TABLEBOXVALUE = 0x8000 // nur zum Debuggen
-@@ -122,6 +124,7 @@
- const SfxPoolItem* pAttr;
- const SwRedline* pRedl;
- SwCntntNode * pNode; // #i23726#
-+ const sw::mark::IFieldmark* pFldmark;
- } aFnd;
-
- int nDist; // #i23726#
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/inc/ecmaflds.hxx sw/inc/ecmaflds.hxx
---- sw/inc/ecmaflds.hxx 1970-01-01 01:00:00.000000000 +0100
-+++ sw/inc/ecmaflds.hxx 2009-10-09 10:53:45.000000000 +0200
-@@ -0,0 +1,68 @@
-+/*************************************************************************
-+ *
-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+ *
-+ * Copyright 2008 by Sun Microsystems, Inc.
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: $
-+ * $Revision: $
-+ *
-+ * 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.
-+ *
-+ ************************************************************************/
-+/* and also:
-+ * Author: Florian Reuter <freuter at novell.com>
-+ * Copyright 2008 by Novell, Inc.
-+*/
-+#ifndef _ECMAFLDS_HXX
-+#define _ECMAFLDS_HXX
-+
-+
-+#define ECMA_FORMTEXT "ecma.office-open-xml.field.FORMTEXT"
-+#define ECMA_FORMTEXT_NAME "name"
-+#define ECMA_FORMTEXT_HELPTEXT "helpText"
-+#define ECMA_FORMTEXT_STATUSTEXT "statusText"
-+#define ECMA_FORMTEXT_DEFAULT "default"
-+#define ECMA_FORMTEXT_FORMAT "format"
-+#define ECMA_FORMTEXT_MAXLENGTH "maxLength"
-+#define ECMA_FORMTEXT_TYPE "type"
-+
-+#define ECMA_FORMCHECKBOX "ecma.office-open-xml.field.FORMCHECKBOX"
-+#define ECMA_FORMCHECKBOX_NAME "name"
-+#define ECMA_FORMCHECKBOX_HELPTEXT "helpText"
-+#define ECMA_FORMCHECKBOX_STATUSTEXT "statusText"
-+#define ECMA_FORMCHECKBOX_CHECKED "checked"
-+#define ECMA_FORMCHECKBOX_DEFAULT "default"
-+#define ECMA_FORMCHECKBOX_SIZE "size"
-+#define ECMA_FORMCHECKBOX_SIZEAUTO "sizeAuto"
-+
-+
-+#define ECMA_FORMDROPDOWN "ecma.office-open-xml.field.FORMDROPDOWN"
-+#define ECMA_FORMDROPDOWN_DEFAULT "default"
-+#define ECMA_FORMDROPDOWN_LISTENTRY "listEntry"
-+#define ECMA_FORMDROPDOWN_RESULT "result"
-+
-+#define ECMA_TOC "ecma.office-open-xml.field.TOC"
-+
-+#define ECMA_HYPERLINK "ecma.office-open-xml.field.HYPERLINK"
-+
-+#define ECMA_PAGEREF "ecma.office-open-xml.field.PAGEREF"
-+
-+#endif /* _ECMAFLDS_HXX */
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/inc/editsh.hxx sw/inc/editsh.hxx
---- sw/inc/editsh.hxx 2009-10-07 17:44:55.000000000 +0200
-+++ sw/inc/editsh.hxx 2009-10-09 10:53:45.000000000 +0200
-@@ -44,6 +44,7 @@
- #include <com/sun/star/linguistic2/ProofreadingResult.hpp>
- #include <fldupde.hxx>
- #include <tblenum.hxx>
-+#include <IMark.hxx>
-
- #include <vector>
- #include <swundo.hxx>
-@@ -415,6 +416,9 @@
- const SwTOXType* GetTOXType(TOXTypes eTyp, USHORT nId) const;
- void InsertTOXType(const SwTOXType& rTyp);
-
-+ // new field stuff
-+ BOOL UpdateField(sw::mark::IFieldmark &fieldBM);
-+
- //AutoMark file
- const String& GetTOIAutoMarkURL() const;
- void SetTOIAutoMarkURL(const String& rSet);
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/inc/hintids.hxx sw/inc/hintids.hxx
---- sw/inc/hintids.hxx 2009-10-07 17:44:55.000000000 +0200
-+++ sw/inc/hintids.hxx 2009-10-09 10:53:45.000000000 +0200
-@@ -44,12 +44,8 @@
- #define CH_TXT_ATR_FIELDEND ((sal_Unicode)0x05)
- #define CH_TXT_ATR_SUBST_FIELDSTART ("[")
- #define CH_TXT_ATR_SUBST_FIELDEND ("]")
--//#define CH_TXT_ATR_FORMELEMENT ((sal_Unicode)'#')
- #define CH_TXT_ATR_FORMELEMENT ((sal_Unicode)0x06)
--/*
--#define FIELD_BOOKMARK_PREFIX "__"
--#define FIELD_FORM_BOOKMARK_PREFIX "__FORM"
--*/
-+
- /*
- * Hier kommen erst mal die enums fuer die Hints
- */
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/inc/pam.hxx sw/inc/pam.hxx
---- sw/inc/pam.hxx 2009-08-13 16:14:38.000000000 +0200
-+++ sw/inc/pam.hxx 2009-10-09 10:53:45.000000000 +0200
-@@ -272,6 +272,7 @@
- DECL_FIXEDMEMPOOL_NEWDEL(SwPaM);
-
- String GetTxt() const;
-+ void Invalidate();
- };
-
-
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/inc/unoobj.hxx sw/inc/unoobj.hxx
---- sw/inc/unoobj.hxx 2009-10-09 14:56:15.000000000 +0200
-+++ sw/inc/unoobj.hxx 2009-10-09 15:15:42.000000000 +0200
-@@ -675,13 +675,13 @@
- SwXFieldmark(bool isReplacementObject, ::sw::mark::IMark* pBkm = 0, SwDoc* pDoc = 0);
-
- virtual void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
-- virtual ::rtl::OUString SAL_CALL getDescription(void) throw( ::com::sun::star::uno::RuntimeException );
-- virtual ::sal_Int16 SAL_CALL getType( ) throw (::com::sun::star::uno::RuntimeException);
-- virtual ::sal_Int16 SAL_CALL getRes( ) throw (::com::sun::star::uno::RuntimeException);
-+ virtual ::rtl::OUString SAL_CALL getFieldType(void) throw( ::com::sun::star::uno::RuntimeException );
-+ virtual void SAL_CALL setFieldType( const ::rtl::OUString& description ) throw (::com::sun::star::uno::RuntimeException);
-
-- virtual void SAL_CALL setType( ::sal_Int16 fieldType ) throw (::com::sun::star::uno::RuntimeException);
-- virtual void SAL_CALL setRes( ::sal_Int16 res ) throw (::com::sun::star::uno::RuntimeException);
-- virtual void SAL_CALL setDescription( const ::rtl::OUString& description ) throw (::com::sun::star::uno::RuntimeException);
-+ virtual ::sal_Int16 SAL_CALL getParamCount( ) throw (::com::sun::star::uno::RuntimeException);
-+ virtual ::rtl::OUString SAL_CALL getParamName(::sal_Int16 i) throw( ::com::sun::star::uno::RuntimeException );
-+ virtual ::rtl::OUString SAL_CALL getParamValue(::sal_Int16 i) throw( ::com::sun::star::uno::RuntimeException );
-+ virtual void SAL_CALL addParam( const ::rtl::OUString& name, const ::rtl::OUString& value, ::sal_Bool replaceExisting ) throw (::com::sun::star::uno::RuntimeException);
- };
-
- /*-----------------23.02.98 10:45-------------------
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/core/crsr/bookmrk.cxx sw/source/core/crsr/bookmrk.cxx
---- sw/source/core/crsr/bookmrk.cxx 2009-10-07 17:44:56.000000000 +0200
-+++ sw/source/core/crsr/bookmrk.cxx 2009-10-09 10:57:57.000000000 +0200
-@@ -77,20 +77,20 @@
- const sal_Unicode aStartMark,
- const sal_Unicode aEndMark)
- {
-- const SwPosition& rStart = pField->GetMarkStart();
-- const SwPosition& rEnd = pField->GetMarkEnd();
-+ SwPosition& rStart = pField->GetMarkStart();
-+ SwPosition& rEnd = pField->GetMarkEnd();
- SwTxtNode const * const pStartTxtNode = io_pDoc->GetNodes()[rStart.nNode]->GetTxtNode();
- SwTxtNode const * const pEndTxtNode = io_pDoc->GetNodes()[rEnd.nNode]->GetTxtNode();
- const sal_Unicode ch_start=pStartTxtNode->GetTxt().GetChar(rStart.nContent.GetIndex());
- const sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar(rEnd.nContent.GetIndex()-1);
-- const SwPaM aStartPaM(rStart);
-- const SwPaM aEndPaM(rEnd);
-+ SwPaM aStartPaM(rStart);
-+ SwPaM aEndPaM(rEnd);
- io_pDoc->StartUndo(UNDO_UI_REPLACE, NULL);
- if(ch_start != aStartMark)
- {
- io_pDoc->InsertString(aStartPaM, aStartMark);
- }
-- if(aEndMark && ch_end != aEndMark)
-+ if ( aEndMark && ( ch_end != aEndMark ) && ( rStart != rEnd ) )
- {
- io_pDoc->InsertString(aEndPaM, aEndMark);
- }
-@@ -114,6 +114,11 @@
- }
- }
-
-+ bool MarkBase::IsCoveringPosition(const SwPosition& rPos) const
-+ {
-+ return GetMarkStart() <= rPos && rPos <= GetMarkEnd();
-+ }
-+
- void MarkBase::SetMarkPos(const SwPosition& rNewPos)
- {
- ::boost::scoped_ptr<SwPosition>(new SwPosition(rNewPos)).swap(m_pPos1);
-@@ -126,6 +131,17 @@
- //lcl_FixPosition(*m_pPos2);
- }
-
-+ rtl::OUString MarkBase::toString( ) const
-+ {
-+ rtl::OUStringBuffer buf;
-+ buf.appendAscii( "Mark: ( Name, [ Node1, Index1 ] ): ( " );
-+ buf.append( m_aName ).appendAscii( ", [ " );
-+ buf.append( sal_Int32( GetMarkPos().nNode.GetIndex( ) ) ).appendAscii( ", " );
-+ buf.append( sal_Int32( GetMarkPos().nContent.GetIndex( ) ) ).appendAscii( " ] )" );
-+
-+ return buf.makeStringAndClear( );
-+ }
-+
- MarkBase::~MarkBase()
- { }
-
-@@ -267,6 +283,96 @@
- if(!IsExpanded())
- SetOtherMarkPos(GetMarkPos());
- }
-+
-+ rtl::OUString Fieldmark::toString( ) const
-+ {
-+ rtl::OUStringBuffer buf;
-+ buf.appendAscii( "Fieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( " );
-+ buf.append( m_aName ).appendAscii( ", " );
-+ buf.append( m_aFieldname ).appendAscii( ", [ " );
-+ buf.append( sal_Int32( GetMarkPos().nNode.GetIndex( ) ) ).appendAscii( ", " );
-+ buf.append( sal_Int32( GetMarkPos( ).nContent.GetIndex( ) ) ).appendAscii( " ], [" );
-+ buf.append( sal_Int32( GetOtherMarkPos().nNode.GetIndex( ) ) ).appendAscii( ", " );
-+ buf.append( sal_Int32( GetOtherMarkPos( ).nContent.GetIndex( ) ) ).appendAscii( " ] ) " );
-+
-+ return buf.makeStringAndClear( );
-+ }
-+
-+ void Fieldmark::addParam( ::rtl::OUString paramName,
-+ ::rtl::OUString paramValue,
-+ bool replaceExisting )
-+ {
-+ if ( replaceExisting )
-+ {
-+ bool replaced = false;
-+ const int len = m_params.size( );
-+ for ( int i = 0; i < len; i++ )
-+ {
-+ if ( m_params[i].first.compareTo( paramName ) == 0 )
-+ {
-+ m_params[i] = ParamPair_t( paramName, paramValue );
-+ replaced = true;
-+ }
-+ }
-+ if ( !replaced )
-+ {
-+ m_params.push_back( ParamPair_t( paramName, paramValue ) );
-+ }
-+ }
-+ else
-+ {
-+ m_params.push_back( ParamPair_t( paramName, paramValue ) );
-+ }
-+ }
-+
-+ void Fieldmark::addParam( const char *paramName, int value )
-+ {
-+ rtl::OUString sName = rtl::OUString::createFromAscii( paramName );
-+ rtl::OUString sValue =::rtl::OUString::valueOf( ( sal_Int32 ) value );
-+ addParam( sName, sValue );
-+ }
-+
-+ void Fieldmark::addParams( std::vector < ParamPair_t > ¶ms )
-+ {
-+ for ( std::vector < ParamPair_t >::iterator i = params.begin( );
-+ i != params.end( ); i++ )
-+ {
-+ m_params.push_back( *i );
-+ }
-+ }
-+
-+ int Fieldmark::getNumOfParams( ) const
-+ {
-+ return m_params.size( );
-+ }
-+
-+ Fieldmark::ParamPair_t Fieldmark::getParam( int pos ) const
-+ {
-+ return m_params[pos];
-+ }
-+
-+ Fieldmark::ParamPair_t Fieldmark::getParam( const char *name,
-+ const char *defaultValue ) const
-+ {
-+ for ( std::vector < ParamPair_t >::iterator i = const_cast< Fieldmark* >( this )->m_params.begin( );
-+ i != m_params.end( ); i++ )
-+ {
-+ if ( i->first.compareToAscii( name ) == 0 )
-+ {
-+ return *i;
-+ }
-+ }
-+ return ParamPair_t( rtl::OUString( ),
-+ ( defaultValue ?
-+ rtl::OUString::createFromAscii( defaultValue ) :
-+ rtl::OUString( ) ) );
-+ }
-+
-+ void Fieldmark::invalidate( )
-+ {
-+ SwPaM aPaM( this->GetMarkPos(), this->GetOtherMarkPos() );
-+ aPaM.Invalidate();
-+ }
-
- const ::rtl::OUString Fieldmark::our_sNamePrefix = ::rtl::OUString::createFromAscii("__Fieldmark__");
-
-@@ -285,7 +391,11 @@
-
- void CheckboxFieldmark::InitDoc(SwDoc* const io_pDoc)
- {
-- lcl_AssureFieldMarksSet(this, io_pDoc, CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FIELDEND);
-+ lcl_AssureFieldMarksSet(this, io_pDoc, CH_TXT_ATR_FORMELEMENT, CH_TXT_ATR_FIELDEND);
-+
-+ // For some reason the end mark is moved from 1 by the Insert: we don't
-+ // want this for checkboxes
-+ this->GetMarkEnd( ).nContent--;
- }
-
- void CheckboxFieldmark::SetChecked(bool checked)
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/core/crsr/crossrefbookmark.cxx sw/source/core/crsr/crossrefbookmark.cxx
---- sw/source/core/crsr/crossrefbookmark.cxx 2009-09-09 11:44:12.000000000 +0200
-+++ sw/source/core/crsr/crossrefbookmark.cxx 2009-10-09 10:53:45.000000000 +0200
-@@ -67,7 +67,7 @@
- MarkBase::SetMarkPos(rNewPos);
- }
-
-- const SwPosition& CrossRefBookmark::GetOtherMarkPos() const
-+ SwPosition& CrossRefBookmark::GetOtherMarkPos() const
- {
- OSL_PRECOND(false,
- "<SwCrossRefBookmark::GetOtherMarkPos(..)>"
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/core/crsr/crstrvl.cxx sw/source/core/crsr/crstrvl.cxx
---- sw/source/core/crsr/crstrvl.cxx 2009-10-07 17:44:56.000000000 +0200
-+++ sw/source/core/crsr/crstrvl.cxx 2009-10-09 10:53:45.000000000 +0200
-@@ -1175,6 +1175,17 @@
- }
- }
-
-+ if( !bRet && SwContentAtPos::SW_FORMCTRL & rCntntAtPos.eCntntAtPos )
-+ {
-+ IDocumentMarkAccess* pMarksAccess = GetDoc()->getIDocumentMarkAccess( );
-+ sw::mark::IFieldmark* pFldBookmark = pMarksAccess->getFieldmarkFor( aPos );
-+ if( bCrsrFoundExact && pTxtNd && pFldBookmark) {
-+ rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FORMCTRL;
-+ rCntntAtPos.aFnd.pFldmark = pFldBookmark;
-+ bRet=TRUE;
-+ }
-+ }
-+
- if( !bRet && SwContentAtPos::SW_FTN & rCntntAtPos.eCntntAtPos )
- {
- if( aTmpState.bFtnNoInfo )
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/core/crsr/pam.cxx sw/source/core/crsr/pam.cxx
---- sw/source/core/crsr/pam.cxx 2009-10-07 17:44:56.000000000 +0200
-+++ sw/source/core/crsr/pam.cxx 2009-10-09 10:53:45.000000000 +0200
-@@ -56,6 +56,7 @@
- #include <ndtxt.hxx> // #111827#
-
- #include <IMark.hxx>
-+#include <hints.hxx>
-
- // fuer den dummen ?MSC-? Compiler
- inline xub_StrLen GetSttOrEnd( BOOL bCondition, const SwCntntNode& rNd )
-@@ -827,16 +828,21 @@
- }
- //FIXME FieldBk
- // TODO: Form Protection when Enhanced Fields are enabled
--// if( !bRet )
--// {
--// const SwDoc *pDoc=GetDoc();
--// SwBookmark *pA = ( pDoc && pPoint ? pDoc->getFieldmarkFor( *pPoint ) : NULL );
--// SwBookmark *pB = ( pDoc && pMark ? pDoc->getFieldmarkFor( *pMark ) : pA );
--// bRet = ( pA != pB );
--// bool bProtectForm = pDoc->get( IDocumentSettingAccess::PROTECT_FORM );
--// if( bProtectForm )
--// bRet |= ( pA==NULL || pB==NULL );
--// }
-+ if (!bRet) {
-+ const SwDoc *pDoc = GetDoc();
-+ sw::mark::IMark* pA = NULL;
-+ sw::mark::IMark* pB = NULL;
-+ if ( pDoc )
-+ {
-+ const IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess( );
-+ pA = GetPoint() ? pMarksAccess->getFieldmarkFor( *GetPoint( ) ) : NULL;
-+ pB = GetMark( ) ? pMarksAccess->getFieldmarkFor( *GetMark( ) ) : pA;
-+ bRet = ( pA != pB );
-+ }
-+ bool bProtectForm = pDoc->get( IDocumentSettingAccess::PROTECT_FORM );
-+ if ( bProtectForm )
-+ bRet |= ( pA == NULL || pB == NULL );
-+ }
- return bRet;
- }
-
-@@ -1223,6 +1229,18 @@
- return !(*b.End() <= *a.Start() || *a.End() <= *b.End());
- }
-
-+void SwPaM::Invalidate()
-+{
-+ const SwNode *_pNd=this->GetNode();
-+ const SwTxtNode *_pTxtNd=(_pNd!=NULL?_pNd->GetTxtNode():NULL);
-+ if (_pTxtNd!=NULL) {
-+ //pretent we've added a char to force layout to recalc the portion...
-+ SwInsChr aHint(_pTxtNd->GetIndex());
-+ SwModify *_pModify=(SwModify*)_pTxtNd;
-+ _pModify->Modify( 0, &aHint);
-+ }
-+}
-+
- BOOL SwPaM::LessThan(const SwPaM & a, const SwPaM & b)
- {
- return (*a.Start() < *b.Start()) || (*a.Start() == *b.Start() && *a.End() < *b.End());
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/core/doc/docbm.cxx sw/source/core/doc/docbm.cxx
---- sw/source/core/doc/docbm.cxx 2009-10-07 17:44:56.000000000 +0200
-+++ sw/source/core/doc/docbm.cxx 2009-10-09 10:53:45.000000000 +0200
-@@ -41,6 +41,7 @@
- #include <dcontact.hxx>
- #include <doc.hxx>
- #include <docary.hxx>
-+#include <ecmaflds.hxx>
- #include <editsh.hxx>
- #include <errhdl.hxx>
- #include <fmtanchr.hxx>
-@@ -66,6 +67,23 @@
- #include <viscrs.hxx>
- #include <stdio.h>
-
-+static void lcl_docbm_FixPosition( SwPosition& rPos )
-+{
-+ // make sure the position has 1) the proper node, and 2) a proper index
-+ SwTxtNode* pTxtNode = rPos.nNode.GetNode().GetTxtNode();
-+
-+ if( rPos.nContent.GetIndex() > ( pTxtNode == NULL ? 0 : pTxtNode->Len() ) )
-+ {
-+ DBG_ERROR( "illegal position" );
-+ xub_StrLen nLen = rPos.nContent.GetIndex();
-+ if( pTxtNode == NULL )
-+ nLen = 0;
-+ else if( nLen >= pTxtNode->Len() )
-+ nLen = pTxtNode->Len();
-+ rPos.nContent.Assign( pTxtNode, nLen );
-+ }
-+}
-+
-
- using namespace ::std;
- using namespace ::boost;
-@@ -309,6 +327,17 @@
- : m_pDoc(&rDoc)
- { }
-
-+ void MarkManager::dumpFieldmarks( ) const
-+ {
-+ const_iterator_t pIt = m_vFieldmarks.begin( );
-+ for ( ; pIt != m_vFieldmarks.end( ); pIt++ )
-+ {
-+ rtl::OUString str = ( *pIt )->toString( );
-+ fprintf( stderr, "%s\n",
-+ rtl::OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr( ) );
-+ }
-+ }
-+
- ::sw::mark::IMark* MarkManager::makeMark(const SwPaM& rPaM,
- const ::rtl::OUString& rName,
- const IDocumentMarkAccess::MarkType eType)
-@@ -414,6 +443,30 @@
- return pMark.get();
- }
-
-+ ::sw::mark::IFieldmark* MarkManager::makeFieldBookmark( const SwPaM& rPaM,
-+ const rtl::OUString& rName,
-+ const rtl::OUString& rType )
-+ {
-+ sw::mark::IMark* pMark = makeMark( rPaM, rName,
-+ IDocumentMarkAccess::TEXT_FIELDMARK );
-+ sw::mark::IFieldmark* pFieldMark = dynamic_cast<sw::mark::IFieldmark*>( pMark );
-+ pFieldMark->SetFieldname( rType );
-+
-+ return pFieldMark;
-+ }
-+
-+ ::sw::mark::IFieldmark* MarkManager::makeNoTextFieldBookmark( const SwPaM& rPaM,
-+ const rtl::OUString& rName,
-+ const rtl::OUString& rType)
-+ {
-+ sw::mark::IMark* pMark = makeMark( rPaM, rName,
-+ IDocumentMarkAccess::CHECKBOX_FIELDMARK );
-+ sw::mark::IFieldmark* pFieldMark = dynamic_cast<sw::mark::IFieldmark*>( pMark );
-+ pFieldMark->SetFieldname( rType );
-+
-+ return pFieldMark;
-+ }
-+
- ::sw::mark::IMark* MarkManager::getMarkForTxtNode(const SwTxtNode& rTxtNode,
- const IDocumentMarkAccess::MarkType eType)
- {
-@@ -767,12 +820,7 @@
- {
- const_iterator_t pFieldmark = find_if(
- m_vFieldmarks.begin(),
-- // we do not need to check marks starting behind the positon
-- lower_bound(
-- m_vFieldmarks.begin(),
-- m_vFieldmarks.end(),
-- rPos,
-- bind(&IMark::StartsAfter, _1, _2)),
-+ m_vFieldmarks.end( ),
- bind(&IMark::IsCoveringPosition, _1, rPos));
- if(pFieldmark == m_vFieldmarks.end()) return NULL;
- return dynamic_cast<IFieldmark*>(pFieldmark->get());
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/core/edit/edtox.cxx sw/source/core/edit/edtox.cxx
---- sw/source/core/edit/edtox.cxx 2009-10-07 17:44:57.000000000 +0200
-+++ sw/source/core/edit/edtox.cxx 2009-10-09 12:06:44.000000000 +0200
-@@ -60,6 +60,9 @@
- #ifndef _STATSTR_HRC
- #include <statstr.hrc>
- #endif
-+#include <bookmrk.hxx>
-+#include <ecmaflds.hxx>
-+
-
- using namespace ::com::sun::star;
- using namespace ::com::sun::star::i18n;
-@@ -235,6 +238,25 @@
- return bRet;
- }
-
-+BOOL SwEditShell::UpdateField( sw::mark::IFieldmark &fieldBM)
-+{
-+// SwDocShell* pDocSh = pDoc->GetDocShell();
-+ //@TODO implement me...; add undo etc...
-+ if ( pDoc && fieldBM.IsExpanded( ) ) {
-+ SwPosition aSttPos = fieldBM.GetMarkStart( );
-+ aSttPos.nContent++;
-+
-+ SwPosition aEndPos = fieldBM.GetMarkEnd( );
-+ aEndPos.nContent--;
-+
-+ SwPaM aPaM( aSttPos, aEndPos );
-+ pDoc->DeleteRange(aPaM);
-+ pDoc->InsertString(aPaM, String::CreateFromAscii("Implement me ;-)") );
-+ }
-+ return TRUE;
-+}
-+
-+
- /*--------------------------------------------------------------------
- Beschreibung: Aktuelles Verzeichnis vor oder in dem der Cursor
- steht
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/core/inc/MarkManager.hxx sw/source/core/inc/MarkManager.hxx
---- sw/source/core/inc/MarkManager.hxx 2009-08-13 16:14:40.000000000 +0200
-+++ sw/source/core/inc/MarkManager.hxx 2009-10-09 10:53:45.000000000 +0200
-@@ -43,8 +43,18 @@
- public:
- MarkManager(/*[in/out]*/ SwDoc& rDoc);
-
-+ void dumpFieldmarks( ) const;
-+
- // IDocumentMarkAccess
- virtual ::sw::mark::IMark* makeMark(const SwPaM& rPaM, const ::rtl::OUString& rName, IDocumentMarkAccess::MarkType eMark);
-+
-+ virtual sw::mark::IFieldmark* makeFieldBookmark( const SwPaM& rPaM,
-+ const rtl::OUString& rName,
-+ const rtl::OUString& rType);
-+ virtual sw::mark::IFieldmark* makeNoTextFieldBookmark( const SwPaM& rPaM,
-+ const rtl::OUString& rName,
-+ const rtl::OUString& rType);
-+
- virtual ::sw::mark::IMark* getMarkForTxtNode(const SwTxtNode& rTxtNode, IDocumentMarkAccess::MarkType eMark);
-
- virtual void repositionMark(::sw::mark::IMark* io_pMark, const SwPaM& rPaM);
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/core/inc/bookmrk.hxx sw/source/core/inc/bookmrk.hxx
---- sw/source/core/inc/bookmrk.hxx 2009-10-07 17:44:57.000000000 +0200
-+++ sw/source/core/inc/bookmrk.hxx 2009-10-09 10:53:45.000000000 +0200
-@@ -48,26 +48,31 @@
- {
- public:
- //getters
-- virtual const SwPosition& GetMarkPos() const
-+ virtual SwPosition& GetMarkPos() const
- { return *m_pPos1; }
- virtual const ::rtl::OUString& GetName() const
- { return m_aName; }
-- virtual bool IsCoveringPosition(const SwPosition& rPos) const
-- { return GetMarkStart() <= rPos && rPos <= GetMarkEnd(); };
-- virtual const SwPosition& GetOtherMarkPos() const
-+ virtual bool IsCoveringPosition(const SwPosition& rPos) const;
-+ virtual SwPosition& GetOtherMarkPos() const
- {
- OSL_PRECOND(IsExpanded(), "<SwPosition::GetOtherMarkPos(..)> - I have no other Pos set." );
- return *m_pPos2;
- }
-- virtual const SwPosition& GetMarkStart() const
-+ virtual SwPosition& GetMarkStart() const
- {
-- if(!m_pPos2 /* !IsExpanded()*/) return *m_pPos1;
-- return *m_pPos1 < *m_pPos2 ? *m_pPos1 : *m_pPos2;
-+ if( !IsExpanded() ) return GetMarkPos( );
-+ if ( GetMarkPos( ) < GetOtherMarkPos( ) )
-+ return GetMarkPos();
-+ else
-+ return GetOtherMarkPos( );
- }
-- virtual const SwPosition& GetMarkEnd() const
-+ virtual SwPosition& GetMarkEnd() const
- {
-- if(!m_pPos2 /* !IsExpanded()*/ ) return *m_pPos1;
-- return *m_pPos1 > *m_pPos2 ? *m_pPos1 : *m_pPos2;
-+ if( !IsExpanded() ) return GetMarkPos();
-+ if ( GetMarkPos( ) > GetOtherMarkPos( ) )
-+ return GetMarkPos( );
-+ else
-+ return GetOtherMarkPos( );
- }
- virtual bool IsExpanded() const
- { return m_pPos2; }
-@@ -80,6 +85,8 @@
- virtual void ClearOtherMarkPos()
- { m_pPos2.reset(); }
-
-+ virtual rtl::OUString toString( ) const;
-+
- virtual void Swap()
- {
- if(m_pPos2)
-@@ -183,18 +190,30 @@
- {
- public:
- Fieldmark(const SwPaM& rPaM);
--
-+
- // getters
- ::rtl::OUString GetFieldname() const
- { return m_aFieldname; }
- ::rtl::OUString GetFieldHelptext() const
- { return m_aFieldHelptext; }
-+
-+ void addParam( rtl::OUString rParamName,
-+ rtl::OUString rParamValue,
-+ bool bReplaceExisting = true );
-+ void addParam( const char* paramName, int value );
-+ void addParams(std::vector<ParamPair_t>& params);
-+ int getNumOfParams() const;
-+ ParamPair_t getParam(int pos) const;
-+ ParamPair_t getParam(const char *name, const char *defaultValue) const;
-
- // setters
- void SetFieldname(const ::rtl::OUString& aFieldname)
- { m_aFieldname = aFieldname; }
- void SetFieldHelptext(const ::rtl::OUString& aFieldHelptext)
- { m_aFieldHelptext = aFieldHelptext; }
-+ void invalidate( );
-+
-+ virtual rtl::OUString toString( ) const;
- private:
- //int fftype; // Type: 0 = Text, 1 = Check Box, 2 = List
- //bool ffprot;
-@@ -202,7 +221,7 @@
- ::rtl::OUString m_aFieldname;
- ::rtl::OUString m_aFieldHelptext;
- static const ::rtl::OUString our_sNamePrefix;
--
-+ std::vector<ParamPair_t> m_params;
- };
-
- class TextFieldmark
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/core/inc/crossrefbookmark.hxx sw/source/core/inc/crossrefbookmark.hxx
---- sw/source/core/inc/crossrefbookmark.hxx 2009-09-09 11:44:13.000000000 +0200
-+++ sw/source/core/inc/crossrefbookmark.hxx 2009-10-09 10:53:45.000000000 +0200
-@@ -48,10 +48,10 @@
- const ::rtl::OUString& rPrefix);
-
- // getters
-- virtual const SwPosition& GetOtherMarkPos() const;
-- virtual const SwPosition& GetMarkStart() const
-+ virtual SwPosition& GetOtherMarkPos() const;
-+ virtual SwPosition& GetMarkStart() const
- { return *m_pPos1; }
-- virtual const SwPosition& GetMarkEnd() const
-+ virtual SwPosition& GetMarkEnd() const
- { return *m_pPos1; }
- virtual bool IsExpanded() const
- { return false; }
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/core/text/inftxt.cxx sw/source/core/text/inftxt.cxx
---- sw/source/core/text/inftxt.cxx 2009-10-07 17:44:57.000000000 +0200
-+++ sw/source/core/text/inftxt.cxx 2009-10-09 10:53:45.000000000 +0200
-@@ -1145,27 +1145,30 @@
- {
- SwRect aIntersect;
- CalcRect( rPor, &aIntersect, 0 );
-- if ( aIntersect.HasArea() ) {
-- if (OnWin()) {
-- OutputDevice* pOutDev = (OutputDevice*)GetOut();
-- pOutDev->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
-- pOutDev->SetLineColor( Color(220, 233, 245));
-- pOutDev->SetFillColor( Color(220, 233, 245));
-- pOutDev->DrawRect( aIntersect.SVRect() );
-- pOutDev->Pop();
-- }
-- const int delta=10;
-- Rectangle r(aIntersect.Left()+delta, aIntersect.Top()+delta, aIntersect.Right()-delta, aIntersect.Bottom()-delta);
-- pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
-- pOut->SetLineColor( Color(0, 0, 0));
-- pOut->SetFillColor();
-- pOut->DrawRect( r );
-- if (checked) {
-- pOut->DrawLine(r.TopLeft(), r.BottomRight());
-- pOut->DrawLine(r.TopRight(), r.BottomLeft());
-+ if ( aIntersect.HasArea() )
-+ {
-+ if (OnWin() && SwViewOption::IsFieldShadings() &&
-+ !GetOpt().IsPagePreview())
-+ {
-+ OutputDevice* pOut_ = (OutputDevice*)GetOut();
-+ pOut_->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
-+ pOut_->SetFillColor( SwViewOption::GetFieldShadingsColor() );
-+ pOut_->SetLineColor();
-+ pOut_->DrawRect( aIntersect.SVRect() );
-+ pOut_->Pop();
-+ }
-+ const int delta=10;
-+ Rectangle r(aIntersect.Left()+delta, aIntersect.Top()+delta, aIntersect.Right()-delta, aIntersect.Bottom()-delta);
-+ pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
-+ pOut->SetLineColor( Color(0, 0, 0));
-+ pOut->SetFillColor();
-+ pOut->DrawRect( r );
-+ if (checked) {
-+ pOut->DrawLine(r.TopLeft(), r.BottomRight());
-+ pOut->DrawLine(r.TopRight(), r.BottomLeft());
-+ }
- pOut->Pop();
- }
-- }
- }
-
- /*************************************************************************
-@@ -1219,14 +1222,22 @@
- }
- }
- bool bIsStartMark=(1==GetLen() && CH_TXT_ATR_FIELDSTART==GetTxt().GetChar(GetIdx()));
-- if(pFieldmark) OSL_TRACE("Found Fieldmark");
-+ if(pFieldmark) {
-+ OSL_TRACE("Found Fieldmark");
-+#if DEBUG
-+ rtl::OUString str = pFieldmark->toString( );
-+ fprintf( stderr, "%s\n", rtl::OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr( ) );
-+#endif
-+ }
- if(bIsStartMark) OSL_TRACE("Found StartMark");
-- if (OnWin() && (pFieldmark!=NULL || bIsStartMark))
-+ if (OnWin() && (pFieldmark!=NULL || bIsStartMark) &&
-+ SwViewOption::IsFieldShadings() &&
-+ !GetOpt().IsPagePreview())
- {
- OutputDevice* pOutDev = (OutputDevice*)GetOut();
- pOutDev->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
-- pOutDev->SetLineColor( Color(220, 233, 245));
-- pOutDev->SetFillColor( Color(220, 233, 245));
-+ pOutDev->SetFillColor( SwViewOption::GetFieldShadingsColor() );
-+ pOutDev->SetLineColor( );
- pOutDev->DrawRect( aIntersect.SVRect() );
- pOutDev->Pop();
- }
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/core/text/portxt.cxx sw/source/core/text/portxt.cxx
---- sw/source/core/text/portxt.cxx 2009-09-14 10:18:22.000000000 +0200
-+++ sw/source/core/text/portxt.cxx 2009-10-09 10:53:45.000000000 +0200
-@@ -55,11 +55,13 @@
- #include <IMark.hxx>
- #include <pam.hxx>
- #include <doc.hxx>
-+#include <ecmaflds.hxx>
-
- #if OSL_DEBUG_LEVEL > 1
- const sal_Char *GetLangName( const MSHORT nLang );
- #endif
-
-+using namespace ::sw::mark;
- using namespace ::com::sun::star;
- using namespace ::com::sun::star::i18n::ScriptType;
-
-@@ -769,9 +771,10 @@
- rPH.Text( GetLen(), GetWhichPor() );
- }
-
--void SwFieldMarkPortion::Paint( const SwTxtPaintInfo & rInf) const
-+void SwFieldMarkPortion::Paint( const SwTxtPaintInfo & /*rInf*/) const
- {
-- SwTxtPortion::Paint(rInf);
-+ // These shouldn't be painted!
-+ // SwTxtPortion::Paint(rInf);
- }
-
- sal_Bool SwFieldMarkPortion::Format( SwTxtFormatInfo & )
-@@ -781,38 +784,95 @@
- return ret;
- }
-
-+namespace ecma {
-+ static int getCurrentListIndex( IFieldmark* pBM,
-+ ::rtl::OUString *currentText = NULL )
-+ {
-+ int currentIndex = pBM->getParam( ECMA_FORMDROPDOWN_RESULT, "0" ).second.toInt32();
-+ int idx = 0;
-+ for( int i = 0; i < pBM->getNumOfParams(); i++ )
-+ {
-+ IFieldmark::ParamPair_t p = pBM->getParam( i );
-+ if ( p.first.compareToAscii( ECMA_FORMDROPDOWN_LISTENTRY ) == 0 )
-+ {
-+ if ( idx == currentIndex )
-+ {
-+ if ( currentText!=NULL ) *currentText=p.second;
-+ break;
-+ }
-+ else
-+ idx++;
-+ }
-+ }
-+ return idx;
-+ }
-+} /* ecma */
-
- //FIXME Fieldbk
--//void SwFieldFormPortion::Paint( const SwTxtPaintInfo& rInf ) const
--void SwFieldFormPortion::Paint( const SwTxtPaintInfo& ) const
-+void SwFieldFormPortion::Paint( const SwTxtPaintInfo& rInf ) const
- {
--// SwTxtNode *pNd=const_cast<SwTxtNode*>(rInf.GetTxtFrm()->GetTxtNode());
--// const SwDoc *doc=pNd->GetDoc();
--// SwIndex aIndex( pNd, rInf.GetIdx() );
--// SwPosition aPosition(*pNd, aIndex);
--// pMark = dynamic_cast< doc->getFieldmarkFor(aPosition);
--// OSL_ENSURE(pMark,
--// "SwFieldFormPortion::Paint(..)"
--// " - Where is my form field bookmark???");
-+ SwTxtNode* pNd = const_cast<SwTxtNode*>(rInf.GetTxtFrm()->GetTxtNode());
-+ const SwDoc *doc=pNd->GetDoc();
-+ SwIndex aIndex( pNd, rInf.GetIdx() );
-+ SwPosition aPosition(*pNd, aIndex);
-+
-+ IFieldmark* pBM = doc->getIDocumentMarkAccess( )->getFieldmarkFor( aPosition );
-+
-+ OSL_ENSURE( pBM,
-+ "SwFieldFormPortion::Paint(..)"
-+ " - Where is my form field bookmark???");
-
--// bool checked=(pBM!=NULL?pBM->IsChecked():false);
--// rInf.DrawCheckBox(*this , checked);
-+ if ( pBM != NULL )
-+ {
-+ if ( pBM->GetFieldname( ).equalsAscii( ECMA_FORMCHECKBOX ) )
-+ { // a checkbox...
-+ bool checked = pBM->getParam( ECMA_FORMCHECKBOX_CHECKED ).second.compareToAscii("on") == 0;
-+ rInf.DrawCheckBox( *this , checked);
-+ }
-+ else if ( pBM->GetFieldname( ).equalsAscii( ECMA_FORMDROPDOWN ) )
-+ { // a list...
-+ rtl::OUString aTxt;
-+ rInf.DrawViewOpt( *this, POR_FLD );
-+ rInf.DrawText( aTxt, *this, 0, aTxt.getLength(), false );
-+ }
-+ else
-+ {
-+ assert(0); // unknown type...
-+ }
-+ }
- }
-
--sal_Bool SwFieldFormPortion::Format( SwTxtFormatInfo &rInf )
-+sal_Bool SwFieldFormPortion::Format( SwTxtFormatInfo & rInf )
- {
-- sal_Bool ret=0;
--// ret=SwTxtPortion::Format(rInf);
--
-- Width(rInf.GetTxtHeight());
-- Height(rInf.GetTxtHeight());
-- SetAscent(rInf.GetAscent());
-- //int h=rInf.GetTxtHeight();
--
--/*
-- Height(100);
-- SetAscent(100);
--*/
-+ sal_Bool ret = 0;
-+ SwTxtNode *pNd = const_cast < SwTxtNode * >( rInf.GetTxtFrm( )->GetTxtNode( ) );
-+ const SwDoc *doc = pNd->GetDoc( );
-+ SwIndex aIndex( pNd, rInf.GetIdx( ) );
-+ SwPosition aPosition( *pNd, aIndex );
-+ IFieldmark *pBM = doc->getIDocumentMarkAccess( )->getFieldmarkFor( aPosition );
-+ ASSERT( pBM != NULL, "Where is my form field bookmark???" );
-+ if ( pBM != NULL )
-+ {
-+ if ( pBM->GetFieldname( ).equalsAscii( ECMA_FORMCHECKBOX ) )
-+ {
-+ Width( rInf.GetTxtHeight( ) );
-+ Height( rInf.GetTxtHeight( ) );
-+ SetAscent( rInf.GetAscent( ) );
-+ }
-+ else if ( pBM->GetFieldname( ).equalsAscii( ECMA_FORMDROPDOWN ) )
-+ {
-+ ::rtl::OUString aTxt;
-+ ecma::getCurrentListIndex( pBM, &aTxt );
-+ SwPosSize aPosSize = rInf.GetTxtSize( aTxt );
-+ Width( aPosSize.Width( ) );
-+ Height( aPosSize.Height( ) );
-+ SetAscent( rInf.GetAscent( ) );
-+ }
-+ else
-+ {
-+ assert( 0 ); // unknown type...
-+ }
-+ }
- return ret;
- }
-
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/core/unocore/unobkm.cxx sw/source/core/unocore/unobkm.cxx
---- sw/source/core/unocore/unobkm.cxx 2009-10-07 17:44:57.000000000 +0200
-+++ sw/source/core/unocore/unobkm.cxx 2009-10-09 10:53:45.000000000 +0200
-@@ -7,7 +7,7 @@
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: unobkm.cxx,v $
-- * $Revision: 1.17 $
-+ * $Revision: 1.16 $
- *
- * This file is part of OpenOffice.org.
- *
-@@ -49,6 +49,7 @@
- #include <docsh.hxx>
-
-
-+using namespace ::sw::mark;
- using namespace ::com::sun::star;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::uno;
-@@ -357,66 +358,85 @@
- , isReplacementObject(_isReplacementObject)
- { }
-
--void SwXFieldmark::attachToRange(const uno::Reference< text::XTextRange > & xTextRange)
-+void SwXFieldmark::attachToRange( const uno::Reference < text::XTextRange >& xTextRange )
- throw( lang::IllegalArgumentException, uno::RuntimeException )
- {
-- attachToRangeEx(xTextRange, (isReplacementObject?IDocumentMarkAccess::CHECKBOX_FIELDMARK:IDocumentMarkAccess::TEXT_FIELDMARK));
-+ attachToRangeEx( xTextRange,
-+ ( isReplacementObject ? IDocumentMarkAccess::CHECKBOX_FIELDMARK : IDocumentMarkAccess::TEXT_FIELDMARK ) );
- }
-
--::rtl::OUString SwXFieldmark::getDescription(void) throw( ::com::sun::star::uno::RuntimeException )
-+::rtl::OUString SwXFieldmark::getFieldType( void )
-+ throw( ::com::sun::star::uno::RuntimeException )
- {
-- vos::OGuard aGuard(Application::GetSolarMutex());
--// TODO implement...
--// if(!GetBookmark())
-- ::sw::mark::IFieldmark const * const pMark =
-- dynamic_cast< ::sw::mark::IFieldmark const * const>(GetBookmark());
-- if(!pMark)
-- throw uno::RuntimeException();
-- return pMark->GetFieldHelptext();
-+ vos::OGuard aGuard( Application::GetSolarMutex( ) );
-+ IMark* pMark = const_cast< IMark* >( GetBookmark( ) );
-+ IFieldmark *pBkm = dynamic_cast< IFieldmark* > ( pMark );
-+ if ( pBkm )
-+ return pBkm->GetFieldname( );
-+ else
-+ throw uno::RuntimeException( );
- }
-
--::sal_Int16 SAL_CALL SwXFieldmark::getType() throw (::com::sun::star::uno::RuntimeException)
-+void SwXFieldmark::setFieldType( const::rtl::OUString & fieldType )
-+ throw( ::com::sun::star::uno::RuntimeException )
- {
-- vos::OGuard aGuard(Application::GetSolarMutex());
-- ::sw::mark::ICheckboxFieldmark const * const pAsCheckbox =
-- dynamic_cast< ::sw::mark::ICheckboxFieldmark const * const>(GetBookmark());
-- if(pAsCheckbox)
-- return 1;
-- return 0;
-+ vos::OGuard aGuard( Application::GetSolarMutex( ) );
-+ IMark* pMark = const_cast< IMark* >( GetBookmark( ) );
-+ IFieldmark *pBkm = dynamic_cast< IFieldmark* >( pMark );
-+ if ( pBkm )
-+ pBkm->SetFieldname( fieldType );
-+ else
-+ throw uno::RuntimeException( );
- }
-
--::sal_Int16 SAL_CALL SwXFieldmark::getRes() throw (::com::sun::star::uno::RuntimeException)
-+sal_Int16 SwXFieldmark::getParamCount( )
-+ throw( ::com::sun::star::uno::RuntimeException )
- {
-- vos::OGuard aGuard(Application::GetSolarMutex());
-- ::sw::mark::ICheckboxFieldmark const * const pAsCheckbox =
-- dynamic_cast< ::sw::mark::ICheckboxFieldmark const * const>(GetBookmark());
-- if(pAsCheckbox && pAsCheckbox->IsChecked())
-- return 1;
-- return 0;
-+ vos::OGuard aGuard( Application::GetSolarMutex( ) );
-+ IMark* pMark = const_cast< IMark* >( GetBookmark( ) );
-+ IFieldmark *pBkm = dynamic_cast< IFieldmark* >( pMark );
-+ if ( pBkm )
-+ return pBkm->getNumOfParams( );
-+ else
-+ throw uno::RuntimeException( );
- }
-
--//FIXME Remove Method
--void SAL_CALL SwXFieldmark::setType( ::sal_Int16 ) throw (::com::sun::star::uno::RuntimeException)
-+rtl::OUString SwXFieldmark::getParamName( sal_Int16 i )
-+ throw( ::com::sun::star::uno::RuntimeException )
- {
-- vos::OGuard aGuard(Application::GetSolarMutex());
-- throw uno::RuntimeException();
-+ vos::OGuard aGuard( Application::GetSolarMutex( ) );
-+ IMark* pMark = const_cast< IMark* >( GetBookmark( ) );
-+ IFieldmark *pBkm = dynamic_cast< IFieldmark* >( pMark );
-+ if ( pBkm )
-+ return pBkm->getParam( i ).first;
-+ else
-+ throw uno::RuntimeException( );
- }
-
--//FIXME Remove Method
--void SAL_CALL SwXFieldmark::setRes( ::sal_Int16 ) throw (::com::sun::star::uno::RuntimeException)
-+::rtl::OUString SwXFieldmark::getParamValue( ::sal_Int16 i )
-+ throw( ::com::sun::star::uno::RuntimeException )
- {
-- vos::OGuard aGuard(Application::GetSolarMutex());
-- throw uno::RuntimeException();
-+ vos::OGuard aGuard( Application::GetSolarMutex( ) );
-+ IMark* pMark = const_cast< IMark* >( GetBookmark( ) );
-+ IFieldmark *pBkm = dynamic_cast< IFieldmark* >( pMark );
-+ if ( pBkm )
-+ return pBkm->getParam( i ).second;
-+ else
-+ throw uno::RuntimeException( );
- }
-
--void SAL_CALL SwXFieldmark::setDescription( const ::rtl::OUString& description )
-- throw (::com::sun::star::uno::RuntimeException)
--{
-- vos::OGuard aGuard(Application::GetSolarMutex());
-- const ::sw::mark::IFieldmark* pMark =
-- dynamic_cast<const ::sw::mark::IFieldmark*>(GetBookmark());
-- if(pMark)
-- const_cast< ::sw::mark::IFieldmark*>(pMark)->SetFieldHelptext(description);
-+void SwXFieldmark::addParam( const ::rtl::OUString & name,
-+ const ::rtl::OUString & value,
-+ sal_Bool replaceExisting )
-+ throw( ::com::sun::star::uno::RuntimeException )
-+{
-+ vos::OGuard aGuard( Application::GetSolarMutex( ) );
-+ IMark* pMark = const_cast< IMark* >( GetBookmark( ) );
-+ IFieldmark *pBkm = dynamic_cast< IFieldmark* >( pMark );
-+ if ( pBkm )
-+ pBkm->addParam( const_cast< rtl::OUString& >( name ),
-+ const_cast< rtl::OUString& >( value ),
-+ replaceExisting );
- else
-- throw uno::RuntimeException();
-+ throw uno::RuntimeException( );
- }
-diff --git sw/source/filter/ww8/wrtw8nds.cxx sw/source/filter/ww8/wrtw8nds.cxx
-index b861862..2280b2b 100644
---- sw/source/filter/ww8/wrtw8nds.cxx
-+++ sw/source/filter/ww8/wrtw8nds.cxx
-@@ -110,8 +110,48 @@ using namespace ::com::sun::star;
- using namespace ::com::sun::star::i18n;
- using namespace sw::util;
- using namespace sw::types;
-+using namespace sw::mark;
- using namespace nsFieldFlags;
-
-+
-+static String lcl_getFieldCode( const IFieldmark* pFieldmark ) {
-+ ASSERT(pFieldmark!=NULL, "where is my fieldmark???");
-+ if ( pFieldmark->GetFieldname( ).equalsAscii( ECMA_FORMTEXT ) ) {
-+ return String::CreateFromAscii(" FORMTEXT ");
-+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ECMA_FORMDROPDOWN ) ) {
-+ return String::CreateFromAscii(" FORMDROPDOWN ");
-+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ECMA_FORMCHECKBOX ) ) {
-+ return String::CreateFromAscii(" FORMCHECKBOX ");
-+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ECMA_TOC ) ) {
-+ return String::CreateFromAscii(" TOC ");
-+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ECMA_HYPERLINK ) ) {
-+ return String::CreateFromAscii(" HYPERLINK ");
-+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ECMA_PAGEREF ) ) {
-+ return String::CreateFromAscii(" PAGEREF ");
-+ } else {
-+ return pFieldmark->GetFieldname();
-+ }
-+}
-+
-+ww::eField lcl_getFieldId( const IFieldmark* pFieldmark ) {
-+ ASSERT(pFieldmark!=NULL, "where is my fieldmark???");
-+ if ( pFieldmark->GetFieldname( ).equalsAscii( ECMA_FORMTEXT ) ) {
-+ return ww::eFORMTEXT;
-+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ECMA_FORMDROPDOWN ) ) {
-+ return ww::eFORMDROPDOWN;
-+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ECMA_FORMCHECKBOX ) ) {
-+ return ww::eFORMCHECKBOX;
-+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ECMA_TOC ) ) {
-+ return ww::eTOC;
-+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ECMA_HYPERLINK ) ) {
-+ return ww::eHYPERLINK;
-+ } else if ( pFieldmark->GetFieldname( ).equalsAscii( ECMA_PAGEREF ) ) {
-+ return ww::ePAGEREF;
-+ } else {
-+ return ww::eUNKNOWN;
-+ }
-+}
-+
- /* */
-
- MSWordAttrIter::MSWordAttrIter( MSWordExportBase& rExport )
-@@ -262,22 +302,40 @@ SwAttrIter::SwAttrIter(MSWordExportBase& rWr, const SwTxtNode& rTxtNd) :
- nAktSwPos = SearchNext(1);
- }
-
-+xub_StrLen lcl_getMinPos( xub_StrLen pos1, xub_StrLen pos2 )
-+{
-+ xub_StrLen min = STRING_NOTFOUND;
-+ if ( pos1 == STRING_NOTFOUND && pos2 != STRING_NOTFOUND )
-+ min = pos2;
-+ else if ( pos2 == STRING_NOTFOUND && pos1 != STRING_NOTFOUND )
-+ min = pos1;
-+ else if ( pos2 != STRING_NOTFOUND && pos2 != STRING_NOTFOUND )
-+ {
-+ if ( pos1 < pos2 )
-+ min = pos1;
-+ else
-+ min = pos2;
-+ }
-+
-+ return min;
-+}
-+
- xub_StrLen SwAttrIter::SearchNext( xub_StrLen nStartPos )
- {
- xub_StrLen nPos;
- xub_StrLen nMinPos = STRING_MAXLEN;
-+ xub_StrLen i=0;
-+
- const String aTxt = rNd.GetTxt();
-- xub_StrLen pos = aTxt.Search(CH_TXT_ATR_FIELDSTART, nStartPos);
-- if( pos==STRING_NOTFOUND )
-- {
-- pos = aTxt.Search(CH_TXT_ATR_FIELDEND, nStartPos);
-- if( pos==STRING_NOTFOUND )
-- pos = aTxt.Search(CH_TXT_ATR_FORMELEMENT, nStartPos);
-- }
-- if( pos!=STRING_NOTFOUND )
-- nMinPos=pos;
-+ xub_StrLen fieldEndPos = aTxt.Search(CH_TXT_ATR_FIELDEND, nStartPos);
-+ xub_StrLen fieldStartPos = aTxt.Search(CH_TXT_ATR_FIELDSTART, nStartPos);
-+ xub_StrLen formElementPos = aTxt.Search(CH_TXT_ATR_FORMELEMENT, nStartPos);
-
-- xub_StrLen i=0;
-+ xub_StrLen pos = lcl_getMinPos( fieldEndPos, fieldStartPos );
-+ pos = lcl_getMinPos( pos, formElementPos );
-+
-+ if (pos!=STRING_NOTFOUND)
-+ nMinPos=pos;
-
- // first the redline, then the attributes
- if( pCurRedline )
-@@ -1704,12 +1762,14 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
- ::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
- OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
-
-- if ( pFieldmark )
-- AppendBookmark( pFieldmark->GetName(), true );
-- OutputField( NULL, ww::eFORMTEXT, String::CreateFromAscii( " FORMTEXT " ), WRITEFIELD_START | WRITEFIELD_CMD_START );
-- if ( pFieldmark )
-+ if ( pFieldmark->GetFieldname().equalsAscii( ECMA_FORMTEXT ) )
-+ AppendBookmark( pFieldmark->GetName(), false );
-+ OutputField( NULL, lcl_getFieldId( pFieldmark ), lcl_getFieldCode( pFieldmark ), WRITEFIELD_START | WRITEFIELD_CMD_START );
-+ if ( pFieldmark->GetFieldname( ).equalsAscii( ECMA_FORMTEXT ) )
- WriteFormData( *pFieldmark );
-- OutputField( NULL, ww::eFORMTEXT, String(), WRITEFIELD_CMD_END );
-+ else if ( pFieldmark->GetFieldname( ).equalsAscii( ECMA_HYPERLINK ) )
-+ WriteHyperlinkData( *pFieldmark );
-+ OutputField( NULL, lcl_getFieldId( pFieldmark ), String(), WRITEFIELD_CMD_END );
- }
- else if ( ch == CH_TXT_ATR_FIELDEND )
- {
-@@ -1717,8 +1777,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
- ::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
- OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
-
-- OutputField( NULL, ww::eFORMTEXT, String(), WRITEFIELD_CLOSE );
-- if ( pFieldmark )
-+ OutputField( NULL, lcl_getFieldId( pFieldmark ), String(), WRITEFIELD_CLOSE );
-+ if ( pFieldmark->GetFieldname().equalsAscii( ECMA_FORMTEXT ) )
- AppendBookmark( pFieldmark->GetName(), false );
- }
- else if ( ch == CH_TXT_ATR_FORMELEMENT )
-@@ -1727,13 +1787,18 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
- ::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
- OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
-
-- if ( pFieldmark )
-- AppendBookmark( pFieldmark->GetName(), true );
-- OutputField( NULL, ww::eFORMCHECKBOX, String::CreateFromAscii( " FORMCHECKBOX " ), WRITEFIELD_START | WRITEFIELD_CMD_START );
-- if ( pFieldmark )
-+ bool isEcma = pFieldmark->GetFieldname( ).equalsAscii( ECMA_FORMDROPDOWN ) ||
-+ pFieldmark->GetFieldname( ).equalsAscii( ECMA_FORMCHECKBOX );
-+
-+ if ( isEcma )
-+ AppendBookmark( pFieldmark->GetName(), 0 );
-+ OutputField( NULL, lcl_getFieldId( pFieldmark ),
-+ lcl_getFieldCode( pFieldmark ),
-+ WRITEFIELD_START | WRITEFIELD_CMD_START );
-+ if ( isEcma )
- WriteFormData( *pFieldmark );
-- OutputField( NULL, ww::eFORMCHECKBOX, String(), WRITEFIELD_CMD_END | WRITEFIELD_CLOSE );
-- if ( pFieldmark )
-+ OutputField( NULL, lcl_getFieldId( pFieldmark ), String(), WRITEFIELD_CLOSE );
-+ if ( isEcma )
- AppendBookmark( pFieldmark->GetName(), false );
- }
- nLen -= static_cast< USHORT >( ofs );
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/filter/ww8/wrtww8.cxx sw/source/filter/ww8/wrtww8.cxx
---- sw/source/filter/ww8/wrtww8.cxx 2009-10-07 17:45:00.000000000 +0200
-+++ sw/source/filter/ww8/wrtww8.cxx 2009-10-09 10:53:45.000000000 +0200
-@@ -105,6 +105,7 @@
- #include "ww8attributeoutput.hxx"
-
- #include <IDocumentMarkAccess.hxx>
-+#include <ecmaflds.hxx>
-
- #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
- #include <com/sun/star/document/XDocumentProperties.hpp>
-@@ -3435,11 +3436,20 @@
- const ::sw::mark::IFieldmark* pFieldmark = &rFieldmark;
- const ::sw::mark::ICheckboxFieldmark* pAsCheckbox = dynamic_cast< const ::sw::mark::ICheckboxFieldmark* >( pFieldmark );
-
-+
-+ ASSERT(rFieldmark.GetFieldname().equalsAscii( ECMA_FORMTEXT ) || rFieldmark.GetFieldname().equalsAscii( ECMA_FORMDROPDOWN ) || rFieldmark.GetFieldname().equalsAscii( ECMA_FORMCHECKBOX ), "Unknown field type!!!");
-+ if ( ! ( rFieldmark.GetFieldname().equalsAscii( ECMA_FORMTEXT ) ||
-+ rFieldmark.GetFieldname().equalsAscii( ECMA_FORMDROPDOWN ) ||
-+ rFieldmark.GetFieldname().equalsAscii( ECMA_FORMCHECKBOX ) ) )
-+ return;
-+
- int type = 0; // TextFieldmark
- if ( pAsCheckbox )
- type = 1;
-+ if ( rFieldmark.GetFieldname().equalsAscii( ECMA_FORMDROPDOWN ) )
-+ type=2;
-
-- const ::rtl::OUString ffname = rFieldmark.GetFieldname();
-+ const String ffname = rFieldmark.getParam("name").second;
-
- ULONG nDataStt = pDataStrm->Tell();
- pChpPlc->AppendFkpEntry(Strm().Tell());
-@@ -3461,14 +3471,27 @@
- sal_uInt8 aFldHeader[] =
- {
- 0xFF, 0xFF, 0xFF, 0xFF, // Unicode Marker...
-- 0, 0, 0, 0//, 0, 0, 0, 0
-+ 0, 0, 0, 0, 0, 0 //, 0, 0
- };
-
- aFldHeader[4] |= (type & 0x03);
- int ffres = 0; // rFieldmark.GetFFRes();
- if ( pAsCheckbox && pAsCheckbox->IsChecked() )
- ffres = 1;
-+ else if ( type == 2 )
-+ ffres = rFieldmark.getParam( ECMA_FORMDROPDOWN_RESULT, "0" ).second.toInt32();
- aFldHeader[4] |= ( (ffres<<2) & 0x7C );
-+
-+ std::vector< ::rtl::OUString > aListItems;
-+ if (type==2)
-+ {
-+ aFldHeader[5] |= 0x80; // ffhaslistbox
-+ for ( int i = 0; i < rFieldmark.getNumOfParams() ; i++ )
-+ {
-+ if (rFieldmark.getParam(i).first.compareToAscii(ECMA_FORMDROPDOWN_LISTENTRY)==0)
-+ aListItems.push_back(rFieldmark.getParam(i).second);
-+ }
-+ }
-
- const ::rtl::OUString ffdeftext;
- const ::rtl::OUString ffformat;
-@@ -3477,6 +3500,7 @@
- const ::rtl::OUString ffentrymcr;
- const ::rtl::OUString ffexitmcr;
-
-+
- const sal_uInt8 aFldData[] =
- {
- 0,0,0,0, // len of struct
-@@ -3489,13 +3513,22 @@
- };
- int slen = sizeof( aFldData )
- + sizeof( aFldHeader )
-- + 2*ffname.getLength() + 4
-+ + 2*ffname.Len() + 4
- + 2*ffdeftext.getLength() + 4
- + 2*ffformat.getLength() + 4
- + 2*ffhelptext.getLength() + 4
- + 2*ffstattext.getLength() + 4
- + 2*ffentrymcr.getLength() + 4
- + 2*ffexitmcr.getLength() + 4;
-+ if ( type==2 ) {
-+ slen += 2; // for 0xFF, 0xFF
-+ slen += 4; // for num of list items
-+ const int items = aListItems.size();
-+ for( int i = 0; i < items; i++ ) {
-+ rtl::OUString item = aListItems[i];
-+ slen += 2 * item.getLength() + 2;
-+ }
-+ }
- #ifdef OSL_BIGENDIAN
- slen = SWAPLONG( slen );
- #endif // OSL_BIGENDIAN
-@@ -3506,6 +3539,7 @@
-
- len = sizeof( aFldHeader );
- OSL_ENSURE( len == 8, "SwWW8Writer::WriteFormData(..) - wrong aFldHeader length" );
-+
- pDataStrm->Write( aFldHeader, len );
-
- SwWW8Writer::WriteString_xstz( *pDataStrm, ffname, true ); // Form field name
-@@ -3520,11 +3554,20 @@
- SwWW8Writer::WriteString_xstz( *pDataStrm, String( ffstattext ), true );
- SwWW8Writer::WriteString_xstz( *pDataStrm, String( ffentrymcr ), true );
- SwWW8Writer::WriteString_xstz( *pDataStrm, String( ffexitmcr ), true );
--// if (type==2) {
--// // 0xFF, 0xFF
--// // sal_uInt32 number of strings
--// // (sal_uInt16 len; sal_uInt16 unicode char[len])*num of strings
--// }
-+ if (type==2) {
-+ *pDataStrm<<(sal_uInt16)0xFFFF;
-+ const int items=aListItems.size();
-+ *pDataStrm<<(sal_uInt32)items;
-+ for(int i=0;i<items;i++) {
-+ rtl::OUString item=aListItems[i];
-+ SwWW8Writer::WriteString_xstz( *pDataStrm, item, false );
-+ }
-+ }
-+}
-+
-+void WW8Export::WriteHyperlinkData( const sw::mark::IFieldmark& rFieldmark )
-+{
-+ //@TODO implement me !!!
- }
-
- void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner )
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/filter/ww8/wrtww8.hxx sw/source/filter/ww8/wrtww8.hxx
---- sw/source/filter/ww8/wrtww8.hxx 2009-09-09 11:44:15.000000000 +0200
-+++ sw/source/filter/ww8/wrtww8.hxx 2009-10-09 10:53:45.000000000 +0200
-@@ -709,6 +709,7 @@
-
- /// Write the data of the form field
- virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark ) = 0;
-+ virtual void WriteHyperlinkData( const ::sw::mark::IFieldmark& rFieldmark ) = 0;
-
- virtual void DoComboBox(const rtl::OUString &rName,
- const rtl::OUString &rHelp,
-@@ -1076,6 +1077,7 @@
-
- /// Write the data of the form field
- virtual void WriteFormData( const ::sw::mark::IFieldmark& rFieldmark );
-+ virtual void WriteHyperlinkData( const ::sw::mark::IFieldmark& rFieldmark );
-
- /// Fields.
- WW8_WrPlcFld* CurrentFieldPlc() const;
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/filter/ww8/ww8par.cxx sw/source/filter/ww8/ww8par.cxx
---- sw/source/filter/ww8/ww8par.cxx 2009-10-09 14:56:40.000000000 +0200
-+++ sw/source/filter/ww8/ww8par.cxx 2009-10-09 10:53:45.000000000 +0200
-@@ -1664,7 +1664,6 @@
- maOldApos.push_back(false);
- maOldApos.swap(pRdr->maApos);
- maOldFieldStack.swap(pRdr->maFieldStack);
-- maFieldCtxStack.swap(pRdr->maNewFieldCtxStack);
- }
-
- void WW8ReaderSave::Restore( SwWW8ImplReader* pRdr )
-@@ -1711,7 +1710,6 @@
- pRdr->pPlcxMan->RestoreAllPLCFx(maPLCFxSave);
- pRdr->maApos.swap(maOldApos);
- pRdr->maFieldStack.swap(maOldFieldStack);
-- pRdr->maNewFieldCtxStack.swap(maFieldCtxStack);
- }
-
- void SwWW8ImplReader::Read_HdFtFtnText( const SwNodeIndex* pSttIdx,
-@@ -2830,29 +2828,6 @@
- case 0x15:
- if( !bSpec ) // Juristenparagraph
- cInsert = '\xa7';
-- else
-- {
-- // 0x15 is special --> so it's our field end mark...;
-- // hmmm what about field marks not handled by us??, maybe a problem with nested fields;
-- // probably an area of bugs... [well release quick and release often....]
-- if (!maNewFieldCtxStack.empty() && pPaM!=NULL && pPaM->GetPoint()!=NULL)
-- {
-- ::boost::scoped_ptr<WW8NewFieldCtx> pFieldCtx(maNewFieldCtxStack.back());
-- maNewFieldCtxStack.pop_back();
-- SwPosition aEndPos = *pPaM->GetPoint();
-- SwPaM aFldPam(pFieldCtx->GetPtNode(), pFieldCtx->GetPtCntnt(), aEndPos.nNode, aEndPos.nContent.GetIndex());
-- IDocumentMarkAccess* const pMarkAccess = rDoc.getIDocumentMarkAccess();
-- ::sw::mark::IFieldmark* pFieldmark =
-- dynamic_cast< ::sw::mark::IFieldmark*>(pMarkAccess->makeMark(
-- aFldPam,
-- pFieldCtx->GetBookmarkName(),
-- IDocumentMarkAccess::TEXT_FIELDMARK));
-- OSL_ENSURE(pFieldmark!=NULL,
-- "hmmm; why was the bookmark not created?");
-- if (pFieldmark)
-- pFieldCtx->SetCurrentFieldParamsTo(pFieldmark);
-- }
-- }
- break;
- case 0x9:
- cInsert = '\x9'; // Tab
-@@ -3664,7 +3639,14 @@
-
- bool bInsertSection = (aIter != aStart) ? (aIter->IsContinous() && bThisAndPreviousAreCompatible): false;
- bool bInsertPageDesc = !bInsertSection;
-- bool bProtected = !bUseEnhFields && SectionIsProtected(*aIter); // do we really need this ?? I guess I have a different logic in editshell which disales this...
-+ bool bProtected = SectionIsProtected(*aIter); // do we really need this ?? I guess I have a different logic in editshell which disales this...
-+ if (bUseEnhFields && mrReader.pWDop->fProtEnabled && aIter->IsNotProtected()) {
-+ // here we have the special case that the whole document is protected, with the execption of this section.
-+ // I want to address this when I do the section rework, so for the moment we disable the overall protection then...
-+ mrReader.rDoc.set(IDocumentSettingAccess::PROTECT_FORM, false );
-+ }
-+
-+
- if (bInsertPageDesc)
- {
- /*
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/filter/ww8/ww8par.hxx sw/source/filter/ww8/ww8par.hxx
---- sw/source/filter/ww8/ww8par.hxx 2009-10-09 14:56:35.000000000 +0200
-+++ sw/source/filter/ww8/ww8par.hxx 2009-10-09 10:53:45.000000000 +0200
-@@ -60,6 +60,8 @@
- #include "ww8glsy.hxx"
- #include "wrtww8.hxx"
- #include "../inc/msfilter.hxx"
-+#include <ecmaflds.hxx>
-+#include <IMark.hxx>
-
- class SwDoc;
- class SwPaM;
-@@ -362,6 +364,8 @@
- Position(const SwPosition &rPos);
- Position(const Position &rPos);
- operator SwPosition() const;
-+ SwNodeIndex GetPtNode() { return maPtNode; };
-+ xub_StrLen GetPtCntnt() { return mnPtCntnt; };
- };
- }
- }
-@@ -369,36 +373,30 @@
- class FieldEntry
- {
- public:
-- sw::hack::Position maStartPos;
-- sal_uInt16 mnFieldId;
-- FieldEntry(SwPosition &rPos, sal_uInt16 nFieldId) throw();
-- FieldEntry(const FieldEntry &rOther) throw();
-- FieldEntry &operator=(const FieldEntry &rOther) throw();
-- void Swap(FieldEntry &rOther) throw();
--};
-+ typedef ::std::vector<sw::mark::IFieldmark::ParamPair_t> Params_t;
-
--class WW8NewFieldCtx
--{
- private:
-- SwNodeIndex maPtNode;
-- xub_StrLen mnPtCntnt;
- ::rtl::OUString msBookmarkName;
- ::rtl::OUString msMarkType;
-- typedef ::std::pair< ::rtl::OUString, ::rtl::OUString> Param_t;
-- typedef ::std::vector< Param_t > Params_t;
- Params_t maParams;
-- SwPaM * mpPaM;
-
- public:
-- WW8NewFieldCtx(SwPosition &aStartPos, ::rtl::OUString sBookmarkName, ::rtl::OUString sMarkType);
-- ~WW8NewFieldCtx();
-+ sw::hack::Position maStartPos;
-+ sal_uInt16 mnFieldId;
-+ FieldEntry(SwPosition &rPos, sal_uInt16 nFieldId) throw();
-+ FieldEntry(const FieldEntry &rOther) throw();
-+ FieldEntry &operator=(const FieldEntry &rOther) throw();
-+ void Swap(FieldEntry &rOther) throw();
-+
-+ SwNodeIndex GetPtNode() { return maStartPos.GetPtNode(); };
-+ xub_StrLen GetPtCntnt() { return maStartPos.GetPtCntnt(); };
-
-- SwNodeIndex GetPtNode() { return maPtNode; };
-- xub_StrLen GetPtCntnt() { return mnPtCntnt; };
- ::rtl::OUString GetBookmarkName();
-- ::rtl::OUString GetMarkType();
-+ ::rtl::OUString GetBookmarkType();
-+ void SetBookmarkName(::rtl::OUString bookmarkName);
-+ void SetBookmarkType(::rtl::OUString bookmarkType);
- void AddParam(::rtl::OUString name, ::rtl::OUString value);
-- void SetCurrentFieldParamsTo(::sw::mark::IFieldmark* pFieldmark);
-+ Params_t &getParams();
- };
-
-
-@@ -434,7 +432,6 @@
- bool mbWasParaEnd;
- bool mbHasBorder;
- bool mbFirstPara;
-- std::deque<WW8NewFieldCtx *> maFieldCtxStack;
- public:
- WW8ReaderSave(SwWW8ImplReader* pRdr, WW8_CP nStart=-1);
- void Restore(SwWW8ImplReader* pRdr);
-@@ -889,9 +886,6 @@
- std::deque<FieldEntry> maFieldStack;
- typedef std::deque<FieldEntry>::const_iterator mycFieldIter;
-
-- typedef std::deque<WW8NewFieldCtx *> WW8NewFieldCtxStack_t;
-- WW8NewFieldCtxStack_t maNewFieldCtxStack;
--
- /*
- A stack of open footnotes. Should only be one in it at any time.
- */
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/filter/ww8/ww8par3.cxx sw/source/filter/ww8/ww8par3.cxx
---- sw/source/filter/ww8/ww8par3.cxx 2009-10-09 16:13:55.000000000 +0200
-+++ sw/source/filter/ww8/ww8par3.cxx 2009-10-09 16:30:58.000000000 +0200
-@@ -96,66 +96,14 @@
-
- #include <IMark.hxx>
- #include <svtools/fltrcfg.hxx>
-+#include <ecmaflds.hxx>
-
- #include <stdio.h>
-
- using namespace com::sun::star;
- using namespace sw::util;
- using namespace sw::types;
--
--WW8NewFieldCtx::WW8NewFieldCtx(SwPosition &aStartPos, ::rtl::OUString sBookmarkName, ::rtl::OUString sMarkType)
-- : maPtNode(aStartPos.nNode)
-- , mnPtCntnt(aStartPos.nContent.GetIndex())
-- , msBookmarkName(sBookmarkName)
-- , msMarkType(sMarkType)
-- , mpPaM(NULL)
--{
--}
--
--
--WW8NewFieldCtx::~WW8NewFieldCtx()
--{
-- if (mpPaM) delete mpPaM;
--}
--
--::rtl::OUString WW8NewFieldCtx::GetBookmarkName()
--{
-- return msBookmarkName;
--}
--
--::rtl::OUString WW8NewFieldCtx::GetMarkType()
--{
-- return msMarkType;
--}
--
--void WW8NewFieldCtx::AddParam(::rtl::OUString name, ::rtl::OUString value)
--{
-- maParams.push_back( Param_t(name, value) );
--}
--
--void WW8NewFieldCtx::SetCurrentFieldParamsTo(::sw::mark::IFieldmark* pFieldmark)
--{
-- for(Params_t::iterator i=maParams.begin();i!=maParams.end();i++)
-- {
-- ::rtl::OUString aName=i->first;
-- ::rtl::OUString aValue=i->second;
-- if(aName.compareToAscii("Description")==0)
-- {
-- pFieldmark->SetFieldHelptext(aValue);
-- }
-- else if(aName.compareToAscii("Name")==0)
-- {
-- pFieldmark->SetFieldname(aValue);
-- }
-- else if(aName.compareToAscii("Result")==0)
-- {
-- ::sw::mark::ICheckboxFieldmark* pAsCheckbox =
-- dynamic_cast< ::sw::mark::ICheckboxFieldmark* >(pFieldmark);
-- if(pAsCheckbox)
-- pAsCheckbox->SetChecked(aValue.toInt32()==0);
-- }
-- }
--}
-+using namespace sw::mark;
-
- //-----------------------------------------
- // UNO-Controls
-@@ -233,10 +181,10 @@
-
-
- if (aBookmarkName.Len()>0) {
-- WW8NewFieldCtx *pFieldCtx=new WW8NewFieldCtx(*pPaM->GetPoint(), aBookmarkName, ::rtl::OUString::createFromAscii("ecma.office-open-xml.field.FORMTEXT"));
-- maNewFieldCtxStack.push_back(pFieldCtx);
-- pFieldCtx->AddParam(::rtl::OUString::createFromAscii("Description"), aFormula.sToolTip);
-- pFieldCtx->AddParam(::rtl::OUString::createFromAscii("Name"), aFormula.sTitle);
-+ maFieldStack.back().SetBookmarkName(aBookmarkName);
-+ maFieldStack.back().SetBookmarkType(::rtl::OUString::createFromAscii(ECMA_FORMTEXT));
-+ maFieldStack.back().AddParam(::rtl::OUString::createFromAscii("Description"), aFormula.sToolTip);
-+ maFieldStack.back().AddParam(::rtl::OUString::createFromAscii("Name"), aFormula.sTitle);
- }
- return FLD_TEXT;
- }
-@@ -279,19 +227,22 @@
- aBookmarkName=pB->GetUniqueBookmarkName(aFormula.sTitle);
- }
-
-- if (aBookmarkName.Len()>0) {
-- ::sw::mark::ICheckboxFieldmark* pFieldmark =
-- dynamic_cast< ::sw::mark::ICheckboxFieldmark*>(rDoc.getIDocumentMarkAccess()->makeMark(
-- *pPaM,
-- aBookmarkName,
-- IDocumentMarkAccess::CHECKBOX_FIELDMARK));
-- OSL_ENSURE(pFieldmark,
-- "hmmm; why was the bookmark not created?");
-- if(pFieldmark)
-- {
-- pFieldmark->SetFieldname(aFormula.sTitle);
-- pFieldmark->SetFieldHelptext(aFormula.sToolTip);
-- pFieldmark->SetChecked(aFormula.nChecked!=0);
-+ if (aBookmarkName.Len()>0)
-+ {
-+ IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess( );
-+ IFieldmark* pFieldmark = dynamic_cast<IFieldmark*>( pMarksAccess->makeNoTextFieldBookmark(
-+ *pPaM, aBookmarkName,
-+ rtl::OUString::createFromAscii( ECMA_FORMCHECKBOX ) ) );
-+ ASSERT(pFieldmark!=NULL, "hmmm; why was the bookmark not created?");
-+ if (pFieldmark!=NULL) {
-+ pFieldmark->addParam(
-+ rtl::OUString::createFromAscii(ECMA_FORMCHECKBOX_NAME),
-+ rtl::OUString( aFormula.sTitle ) );
-+ pFieldmark->addParam(
-+ rtl::OUString::createFromAscii(ECMA_FORMCHECKBOX_HELPTEXT), aFormula.sToolTip);
-+ pFieldmark->addParam(
-+ rtl::OUString::createFromAscii(ECMA_FORMCHECKBOX_CHECKED),
-+ ::rtl::OUString::createFromAscii(aFormula.nChecked!=0?"on":"off"));
- // set field data here...
- }
- }
-@@ -306,24 +257,75 @@
- if (0x01 == rStr.GetChar(writer_cast<xub_StrLen>(pF->nLCode-1)))
- ImportFormulaControl(aFormula,pF->nSCode+pF->nLCode-1, WW8_CT_DROPDOWN);
-
-- SwDropDownField aFld(
-- (SwDropDownFieldType*)rDoc.GetSysFldType(RES_DROPDOWN));
-+ const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
-+ sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
-+
-+ if (!bUseEnhFields)
-+ {
-+ SwDropDownField aFld((SwDropDownFieldType*)rDoc.GetSysFldType(RES_DROPDOWN));
-
-- aFld.SetName(aFormula.sTitle);
-- aFld.SetHelp(aFormula.sHelp);
-- aFld.SetToolTip(aFormula.sToolTip);
-+ aFld.SetName(aFormula.sTitle);
-+ aFld.SetHelp(aFormula.sHelp);
-+ aFld.SetToolTip(aFormula.sToolTip);
-+
-+ if (!aFormula.maListEntries.empty())
-+ {
-+ aFld.SetItems(aFormula.maListEntries);
-+ int nIndex = aFormula.fDropdownIndex < aFormula.maListEntries.size() ? aFormula.fDropdownIndex : 0;
-+ aFld.SetSelectedItem(aFormula.maListEntries[nIndex]);
-+ }
-
-- if (!aFormula.maListEntries.empty())
-+ rDoc.InsertPoolItem(*pPaM, SwFmtFld(aFld), 0);
-+ return FLD_OK;
-+ }
-+ else
- {
-- aFld.SetItems(aFormula.maListEntries);
-- int nIndex = aFormula.fDropdownIndex < aFormula.maListEntries.size()
-- ? aFormula.fDropdownIndex : 0;
-- aFld.SetSelectedItem(aFormula.maListEntries[nIndex]);
-- }
-+ //@TODO fix: copy pasting here!!!!!!!!!!!!!!
-+ //REVIEW: don't let this throught.... sometime I forget to get rid of my proof of concept stuff. Please kindly remind me!!!!!
-+
-+ String aBookmarkName;
-+ WW8PLCFx_Book* pB = pPlcxMan->GetBook();
-+ if (pB!=NULL)
-+ {
-+ WW8_CP currentCP=pF->nSCode;
-+ WW8_CP currentLen=pF->nLen;
-+
-+ USHORT bkmFindIdx;
-+ String aBookmarkFind=pB->GetBookmark(currentCP-1, currentCP+currentLen-1, bkmFindIdx);
-
-- rDoc.InsertPoolItem(*pPaM, SwFmtFld(aFld), 0);
-+ if (aBookmarkFind.Len()>0)
-+ {
-+ pB->SetStatus(bkmFindIdx, BOOK_FIELD); // mark as consumed by field
-+ if (aBookmarkFind.Len()>0)
-+ aBookmarkName=aBookmarkFind;
-+ }
-+ }
-
-- return FLD_OK;
-+ if (pB!=NULL && aBookmarkName.Len()==0)
-+ aBookmarkName=pB->GetUniqueBookmarkName(aFormula.sTitle);
-+
-+ if (aBookmarkName.Len()>0)
-+ {
-+ IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess( );
-+ IFieldmark *pFieldmark = dynamic_cast<IFieldmark*>(
-+ pMarksAccess->makeNoTextFieldBookmark( *pPaM, aBookmarkName,
-+ ::rtl::OUString::createFromAscii( ECMA_FORMDROPDOWN ) ) );
-+ ASSERT(pFieldmark!=NULL, "hmmm; why was the bookmark not created?");
-+ if ( pFieldmark != NULL )
-+ {
-+ rtl::OUString sListEntry=rtl::OUString::createFromAscii( ECMA_FORMDROPDOWN_LISTENTRY );
-+ std::vector<String>::iterator it = aFormula.maListEntries.begin();
-+ for( ; it != aFormula.maListEntries.end(); it++ )
-+ pFieldmark->addParam(sListEntry, *it, false);
-+
-+ int nIndex = aFormula.fDropdownIndex < aFormula.maListEntries.size() ? aFormula.fDropdownIndex : 0;
-+ pFieldmark->addParam(ECMA_FORMDROPDOWN_RESULT, nIndex);
-+ // set field data here...
-+ }
-+ }
-+
-+ return FLD_OK;
-+ }
- }
-
- void SwWW8ImplReader::DeleteFormImpl()
-@@ -2140,11 +2142,18 @@
-
- if((aPic.lcb > 0x3A) && !pDataStream->GetError() )
- {
-- pDataStream->Seek( nPicLocFc + aPic.cbHeader );
-+#if 0 // some debug fun; remove this later...
- int len=aPic.lcb-aPic.cbHeader;
- char *pBuf=(char*)malloc(len);
- pDataStream->Read( pBuf, len);
-+ static int _h=0;
-+ char fname[255];
-+ sprintf(fname, "data%03i.data", _h++);
-+ FILE *out=fopen(fname, "wb");
-+ fwrite(pBuf, len, 1, out);
-+ fclose(out);
- pDataStream->Seek( nPicLocFc + aPic.cbHeader );
-+#endif
- aFormula.FormulaRead(nWhich,pDataStream);
- bRet = true;
- }
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/filter/ww8/ww8par5.cxx sw/source/filter/ww8/ww8par5.cxx
---- sw/source/filter/ww8/ww8par5.cxx 2009-10-09 14:56:35.000000000 +0200
-+++ sw/source/filter/ww8/ww8par5.cxx 2009-10-09 10:53:45.000000000 +0200
-@@ -88,22 +88,26 @@
- #include <fmtclds.hxx>
- #include <pagedesc.hxx>
- #include <SwStyleNameMapper.hxx>
--
-+#include <IMark.hxx>
-
- #include "ww8scan.hxx" // WW8FieldDesc
- #include "ww8par.hxx"
- #include "ww8par2.hxx"
- #include "writerhelper.hxx"
- #include "fields.hxx"
-+#include <svtools/fltrcfg.hxx>
-
- #include <algorithm> // #i24377#
-
-+//#define WW_NATIVE_TOC 0
-+
- #define MAX_FIELDLEN 64000
-
- #define WW8_TOX_LEVEL_DELIM ':'
-
- using namespace ::com::sun::star;
- using namespace sw::util;
-+using namespace sw::mark;
- using namespace std; // #i24377#
- using namespace nsSwDocInfoSubType;
-
-@@ -328,9 +332,11 @@
-
- //"_Toc*" and "_Hlt*" are unnecessary
- const String* pName = pB->GetName();
-+#if !defined(WW_NATIVE_TOC)
- if( !pName || pName->EqualsIgnoreCaseAscii( "_Toc", 0, 4 )
- || pName->EqualsIgnoreCaseAscii( "_Hlt", 0, 4 ) )
- return 0;
-+#endif
-
- //JP 16.11.98: ToUpper darf auf keinen Fall gemacht werden, weil der
- //Bookmark- name ein Hyperlink-Ziel sein kann!
-@@ -672,6 +678,9 @@
- if (!pF || !pF->EndPosIsFieldEnd())
- return nRet;
-
-+ const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
-+ sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
-+
- ASSERT(!maFieldStack.empty(), "Empty field stack\n");
- if (!maFieldStack.empty())
- {
-@@ -683,9 +692,40 @@
- nRet = maFieldStack.back().mnFieldId;
- switch (nRet)
- {
-+ case 70:
-+ if (bUseEnhFields && pPaM!=NULL && pPaM->GetPoint()!=NULL) {
-+ SwPosition aEndPos = *pPaM->GetPoint();
-+ SwPaM aFldPam( maFieldStack.back().GetPtNode(), maFieldStack.back().GetPtCntnt(), aEndPos.nNode, aEndPos.nContent.GetIndex());
-+ IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess( );
-+ IFieldmark *pFieldmark = dynamic_cast<IFieldmark*>( pMarksAccess->makeFieldBookmark(
-+ aFldPam, maFieldStack.back().GetBookmarkName(), ::rtl::OUString::createFromAscii(ECMA_FORMTEXT ) ) );
-+ ASSERT(pFieldmark!=NULL, "hmmm; why was the bookmark not created?");
-+ if (pFieldmark!=NULL) {
-+ pFieldmark->addParams(maFieldStack.back().getParams());
-+ }
-+ }
-+ break;
-+#if defined(WW_NATIVE_TOC)
-+ case 8: // TOX_INDEX
-+ case 13: // TOX_CONTENT
-+ case 88: // HYPERLINK
-+ case 37: // REF
-+ if (pPaM!=NULL && pPaM->GetPoint()!=NULL) {
-+
-+ SwPosition aEndPos = *pPaM->GetPoint();
-+ SwPaM aFldPam( maFieldStack.back().GetPtNode(), maFieldStack.back().GetPtCntnt(), aEndPos.nNode, aEndPos.nContent.GetIndex());
-+ SwFieldBookmark *pFieldmark=(SwFieldBookmark*)rDoc.makeFieldBookmark(aFldPam, maFieldStack.back().GetBookmarkName(), maFieldStack.back().GetBookmarkType());
-+ ASSERT(pFieldmark!=NULL, "hmmm; why was the bookmark not created?");
-+ if (pFieldmark!=NULL) {
-+ pFieldmark->addParams(maFieldStack.back().getParams());
-+ }
-+ }
-+ break;
-+#else
- case 88:
- pCtrlStck->SetAttr(*pPaM->GetPoint(),RES_TXTATR_INETFMT);
- break;
-+#endif
- case 36:
- case 68:
- //Move outside the section associated with this type of field
-@@ -703,6 +743,10 @@
- {
- switch (nFieldCode)
- {
-+#if defined(WW_NATIVE_TOC)
-+ case 8: // allow recursive field in TOC...
-+ case 13: // allow recursive field in TOC...
-+#endif
- case 36:
- case 68:
- case 79:
-@@ -741,6 +785,36 @@
- return *this;
- }
-
-+::rtl::OUString FieldEntry::GetBookmarkName()
-+{
-+ return msBookmarkName;
-+}
-+
-+::rtl::OUString FieldEntry::GetBookmarkType()
-+{
-+ return msMarkType;
-+}
-+
-+void FieldEntry::SetBookmarkName(::rtl::OUString bookmarkName)
-+{
-+ msBookmarkName=bookmarkName;
-+}
-+
-+void FieldEntry::SetBookmarkType(::rtl::OUString bookmarkType)
-+{
-+ msMarkType=bookmarkType;
-+}
-+
-+void FieldEntry::AddParam(::rtl::OUString name, ::rtl::OUString value)
-+{
-+ maParams.push_back( IFieldmark::ParamPair_t( name, value ) );
-+}
-+
-+FieldEntry::Params_t &FieldEntry::getParams() {
-+ return maParams;
-+}
-+
-+
- // Read_Field liest ein Feld ein oder, wenn es nicht gelesen werden kann,
- // wird 0 zurueckgegeben, so dass das Feld vom Aufrufer textuell gelesen wird.
- // Returnwert: Gesamtlaenge des Feldes ( zum UEberlesen )
-@@ -2073,6 +2147,17 @@
-
- String sName(GetMappedBookmark(sOrigName));
-
-+#if defined(WW_NATIVE_TOC)
-+ if (1) {
-+ ::rtl::OUString aBookmarkName=::rtl::OUString::createFromAscii("_REF");
-+ maFieldStack.back().SetBookmarkName(aBookmarkName);
-+ maFieldStack.back().SetBookmarkType(::rtl::OUString::createFromAscii(ECMA_PAGEREF));
-+ maFieldStack.back().AddParam(rtl::OUString(), sName);
-+ return FLD_TEXT;
-+ }
-+#endif
-+
-+
- SwGetRefField aFld(
- (SwGetRefFieldType*)rDoc.GetSysFldType( RES_GETREFFLD ), sName,
- REF_BOOKMARK, 0, REF_PAGE );
-@@ -2771,6 +2856,16 @@
-
- eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr )
- {
-+#if defined(WW_NATIVE_TOC)
-+ if (1) {
-+ ::rtl::OUString aBookmarkName=::rtl::OUString::createFromAscii("_TOC");
-+ maFieldStack.back().SetBookmarkName(aBookmarkName);
-+ maFieldStack.back().SetBookmarkType(::rtl::OUString::createFromAscii(ECMA_TOC));
-+// maFieldStack.back().AddParam(::rtl::OUString::createFromAscii("Description"), aFormula.sToolTip);
-+ return FLD_TEXT;
-+ }
-+#endif
-+
- if (pF->nLRes < 3)
- return FLD_TEXT; // ignore (#i25440#)
-
-@@ -3289,6 +3384,16 @@
-
- eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, String& rStr )
- {
-+#if defined(WW_NATIVE_TOC)
-+ if (1) {
-+ ::rtl::OUString aBookmarkName=::rtl::OUString::createFromAscii("_HYPERLINK");
-+ maFieldStack.back().SetBookmarkName(aBookmarkName);
-+ maFieldStack.back().SetBookmarkType(::rtl::OUString::createFromAscii(ECMA_HYPERLINK));
-+// maFieldStack.back().AddParam(::rtl::OUString::createFromAscii("Description"), aFormula.sToolTip);
-+ return FLD_TEXT;
-+ }
-+#endif
-+
- String sURL, sTarget, sMark;
- bool bDataImport = false;
- //HYPERLINk "filename" [switches]
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/ui/docvw/edtwin.cxx sw/source/ui/docvw/edtwin.cxx
---- sw/source/ui/docvw/edtwin.cxx 2009-10-09 14:56:43.000000000 +0200
-+++ sw/source/ui/docvw/edtwin.cxx 2009-10-09 10:53:45.000000000 +0200
-@@ -152,6 +152,7 @@
-
- #include <IMark.hxx>
- #include <doc.hxx>
-+#include <ecmaflds.hxx>
-
- #include "PostItMgr.hxx"
- #include "postit.hxx"
-@@ -161,6 +162,7 @@
- //#define TEST_FOR_BUG91313
- #endif
-
-+using namespace sw::mark;
- using namespace ::com::sun::star;
-
- /*--------------------------------------------------------------------
-@@ -4199,7 +4201,7 @@
-
- SwContentAtPos aCntntAtPos( SwContentAtPos::SW_CLICKFIELD |
- SwContentAtPos::SW_INETATTR |
-- SwContentAtPos::SW_SMARTTAG );
-+ SwContentAtPos::SW_SMARTTAG | SwContentAtPos::SW_FORMCTRL);
-
- if( rSh.GetContentAtPos( aDocPt, aCntntAtPos, TRUE ) )
- {
-@@ -4220,7 +4222,33 @@
- if ( bExecSmarttags && SwSmartTagMgr::Get().IsSmartTagsEnabled() )
- rView.ExecSmartTagPopup( aDocPt );
- }
-- else // if ( SwContentAtPos::SW_INETATTR == aCntntAtPos.eCntntAtPos )
-+ else if ( SwContentAtPos::SW_FORMCTRL == aCntntAtPos.eCntntAtPos )
-+ {
-+ ASSERT( aCntntAtPos.aFnd.pFldmark != NULL, "where is my field ptr???");
-+ if ( aCntntAtPos.aFnd.pFldmark != NULL)
-+ {
-+ IFieldmark *fieldBM = const_cast< IFieldmark* > ( aCntntAtPos.aFnd.pFldmark );
-+ SwDocShell* pDocSh = rView.GetDocShell();
-+ SwDoc *pDoc=pDocSh->GetDoc();
-+ if (fieldBM->GetFieldname( ).equalsAscii( ECMA_FORMCHECKBOX ) )
-+ {
-+ bool isChecked = fieldBM->getParam( ECMA_FORMCHECKBOX_CHECKED ).second.compareToAscii("on") == 0;
-+ isChecked = !isChecked; // swap it...
-+ fieldBM->addParam(
-+ rtl::OUString::createFromAscii( ECMA_FORMCHECKBOX_CHECKED ),
-+ rtl::OUString::createFromAscii( isChecked?"on":"off" ) );
-+ fieldBM->invalidate();
-+ rSh.InvalidateWindows( rView.GetVisArea() );
-+ } else if (fieldBM->GetFieldname().equalsAscii( ECMA_FORMDROPDOWN) ) {
-+ rView.ExecFieldPopup( aDocPt, fieldBM );
-+ fieldBM->invalidate();
-+ rSh.InvalidateWindows( rView.GetVisArea() );
-+ } else {
-+ // unknown type..
-+ }
-+ }
-+ }
-+ else // if ( SwContentAtPos::SW_INETATTR == aCntntAtPos.eCntntAtPos )
- {
- if ( bExecHyperlinks )
- rSh.ClickToINetAttr( *(SwFmtINetFmt*)aCntntAtPos.aFnd.pAttr, nFilter );
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/ui/inc/view.hxx sw/source/ui/inc/view.hxx
---- sw/source/ui/inc/view.hxx 2009-08-13 16:14:46.000000000 +0200
-+++ sw/source/ui/inc/view.hxx 2009-10-09 10:53:45.000000000 +0200
-@@ -42,6 +42,7 @@
- #include <swtypes.hxx>
- #include <shellid.hxx>
- #include <layout/layout.hxx>
-+#include <IMark.hxx>
-
- class SwBaseShell;
- class Button;
-@@ -94,6 +95,7 @@
- class Graphic;
- class GraphicFilter;
- class SwPostItMgr;
-+class SwFieldBookmark;
-
- namespace com{ namespace sun { namespace star {
- namespace view{ class XSelectionSupplier; }
-@@ -465,7 +467,7 @@
-
- DECL_LINK( SpellError, LanguageType * );
- BOOL ExecSpellPopup( const Point& rPt );
--
-+ BOOL ExecFieldPopup( const Point& rPt, sw::mark::IFieldmark *fieldBM );
- // SMARTTAGS
- BOOL ExecSmartTagPopup( const Point& rPt );
-
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/ui/inc/wrtsh.hxx sw/source/ui/inc/wrtsh.hxx
---- sw/source/ui/inc/wrtsh.hxx 2009-10-07 17:45:01.000000000 +0200
-+++ sw/source/ui/inc/wrtsh.hxx 2009-10-09 10:53:45.000000000 +0200
-@@ -35,6 +35,7 @@
- #include <fesh.hxx>
- #include <sortopt.hxx>
- #include <swurl.hxx>
-+#include <IMark.hxx>
-
- class Window;
- class OutputDevice;
-@@ -322,6 +323,9 @@
- void InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0);
- BOOL UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0);
-
-+ // new fields
-+ BOOL UpdateField( sw::mark::IFieldmark &fieldBM);
-+
- // Numerierung und Bullets
- /**
- Turns on numbering or bullets.
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/ui/uiview/viewling.cxx sw/source/ui/uiview/viewling.cxx
---- sw/source/ui/uiview/viewling.cxx 2009-08-04 15:48:03.000000000 +0200
-+++ sw/source/ui/uiview/viewling.cxx 2009-10-09 10:53:45.000000000 +0200
-@@ -114,9 +114,12 @@
- #include <svx/dialogs.hrc>
-
- #include <unomid.h>
-+#include <IMark.hxx>
-+#include <ecmaflds.hxx>
-
- #include <memory>
-
-+using namespace sw::mark;
- using ::rtl::OUString;
- using namespace ::com::sun::star;
- using namespace ::com::sun::star::beans;
-@@ -927,6 +930,139 @@
-
- pWrtShell->Pop( sal_False );
- pWrtShell->LockView( bOldViewLock );
-+
-+ return bRet;
-+}
-+
-+
-+
-+class SwFieldPopup : public PopupMenu
-+{
-+public:
-+ SwFieldPopup() {
-+ InsertItem(1, ::rtl::OUString::createFromAscii("Hello"));
-+ }
-+};
-+
-+class SwFieldListBox : public ListBox
-+{
-+public:
-+ SwFieldListBox(Window* pParent) : ListBox(pParent /*, WB_DROPDOWN*/) {
-+ }
-+
-+ void *GetImplWin() {
-+ return NULL; //FIXME!!!
-+// return mpImplWin;
-+ }
-+
-+protected:
-+ virtual void LoseFocus() {
-+// printf("ListBox: lose focus!!\n");
-+ ListBox::LoseFocus();
-+ }
-+
-+ virtual void Select() {
-+// printf("SELECT!!! IsTravelSelect=%i\n", IsTravelSelect());
-+ ListBox::Select();
-+ }
-+};
-+
-+class SwFieldDialog : public Dialog
-+{
-+private:
-+ SwFieldListBox aListBox;
-+ Edit aText;
-+ int selection;
-+
-+ DECL_LINK( MyListBoxHandler, ListBox * );
-+
-+public:
-+ SwFieldDialog(Window* parent, IFieldmark *fieldBM) : Dialog(parent, WB_BORDER | WB_SYSTEMWINDOW | WB_NOSHADOW ), aListBox(this), aText(this, WB_RIGHT | WB_READONLY), selection(-1) {
-+
-+ assert(fieldBM!=NULL);
-+ if (fieldBM!=NULL) {
-+ int items=fieldBM->getNumOfParams();
-+ for(int i=0;i<items;i++) {
-+ IFieldmark::ParamPair_t p=fieldBM->getParam(i);
-+ if (p.first.compareToAscii(ECMA_FORMDROPDOWN_LISTENTRY)==0) {
-+ aListBox.InsertEntry(p.second);
-+ }
-+ }
-+ }
-+ Size lbSize=aListBox.GetOptimalSize(WINDOWSIZE_PREFERRED);
-+ lbSize.Width()+=50;
-+ lbSize.Height()+=20;
-+ aListBox.SetSizePixel(lbSize);
-+ aListBox.SetSelectHdl( LINK( this, SwFieldDialog, MyListBoxHandler ) );
-+ aListBox.Show();
-+ aText.SetText(rtl::OUString::createFromAscii("Cancel"));
-+ Size tSize=aText.GetOptimalSize(WINDOWSIZE_PREFERRED);
-+ aText.SetSizePixel(Size(lbSize.Width(), tSize.Height()));
-+ aText.SetPosPixel(Point(0, lbSize.Height()));
-+ aText.Show();
-+ SetSizePixel(Size(lbSize.Width(), lbSize.Height()+tSize.Height()));
-+// SetSizePixel(Size(200, 200));
-+ }
-+
-+ int getSelection() {
-+ return selection;
-+ }
-+protected:
-+ /*
-+ virtual void LoseFocus() {
-+ printf("lose focus!!\n");
-+ Dialog::LoseFocus();
-+ printf("close:\n");
-+ EndDialog(8);
-+ }
-+ */
-+
-+ virtual long PreNotify( NotifyEvent& rNEvt ) {
-+ if (rNEvt.GetType() == EVENT_LOSEFOCUS && aListBox.GetImplWin()==rNEvt.GetWindow()) {
-+ EndDialog(8);
-+ return 1;
-+ }
-+ if (rNEvt.GetType() == EVENT_KEYINPUT) {
-+// printf("PreNotify::KEYINPUT\n");
-+ }
-+ return Dialog::PreNotify(rNEvt);
-+ }
-+};
-+
-+IMPL_LINK( SwFieldDialog, MyListBoxHandler, ListBox *, pBox )
-+{
-+// printf("### DROP DOWN SELECT... IsTravelSelect=%i\n", pBox->IsTravelSelect());
-+ if (pBox->IsTravelSelect()) {
-+ return 0;
-+ } else {
-+ this->selection=pBox->GetSelectEntryPos();
-+ EndDialog(9); //@TODO have meaningfull returns...
-+ return 1;
-+ }
-+}
-+
-+
-+BOOL SwView::ExecFieldPopup( const Point& rPt, IFieldmark *fieldBM )
-+{
-+ sal_Bool bRet = sal_False;
-+ const sal_Bool bOldViewLock = pWrtShell->IsViewLocked();
-+ pWrtShell->LockView( sal_True );
-+ pWrtShell->Push();
-+
-+ bRet=sal_True;
-+ const Point aPixPos = GetEditWin().LogicToPixel( rPt );
-+
-+ SwFieldDialog aFldDlg(pEditWin, fieldBM);
-+ aFldDlg.SetPosPixel(pEditWin->OutputToScreenPixel(aPixPos));
-+
-+ short ret=aFldDlg.Execute();
-+ int selection=aFldDlg.getSelection();
-+ if (selection>=0) {
-+ fieldBM->addParam(ECMA_FORMDROPDOWN_RESULT, selection);
-+ }
-+
-+ pWrtShell->Pop( sal_False );
-+ pWrtShell->LockView( bOldViewLock );
-
- return bRet;
- }
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/ui/wrtsh/wrtsh1.cxx sw/source/ui/wrtsh/wrtsh1.cxx
---- sw/source/ui/wrtsh/wrtsh1.cxx 2009-10-09 14:56:41.000000000 +0200
-+++ sw/source/ui/wrtsh/wrtsh1.cxx 2009-10-09 10:53:45.000000000 +0200
-@@ -112,6 +112,7 @@
- #include <paratr.hxx>
- #include <ndtxt.hxx>
- #include <svx/acorrcfg.hxx>
-+#include <IMark.hxx>
-
- // -> #111827#
- #include <SwRewriter.hxx>
-@@ -126,6 +127,7 @@
-
- #include "PostItMgr.hxx"
-
-+using namespace sw::mark;
- using namespace com::sun::star;
-
- #define COMMON_INI_LIST \
-@@ -1756,6 +1758,12 @@
-
- SetSfxViewShell( (SfxViewShell *)&rShell );
- SetFlyMacroLnk( LINK(this, SwWrtShell, ExecFlyMac) );
-+
-+ // place the cursor on the first field...
-+ IFieldmark *pBM = NULL;
-+ if ( IsFormProtected() && ( pBM = GetFieldmarkAfter( ) ) !=NULL ) {
-+ GotoFieldmark(pBM);
-+ }
- }
-
-
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' sw/source/ui/wrtsh/wrtsh2.cxx sw/source/ui/wrtsh/wrtsh2.cxx
---- sw/source/ui/wrtsh/wrtsh2.cxx 2009-10-07 17:45:01.000000000 +0200
-+++ sw/source/ui/wrtsh/wrtsh2.cxx 2009-10-09 10:53:45.000000000 +0200
-@@ -242,6 +242,13 @@
- return bResult;
- }
-
-+BOOL SwWrtShell::UpdateField( sw::mark::IFieldmark &fieldBM )
-+{
-+ return SwEditShell::UpdateField(fieldBM);
-+}
-+
-+
-+
- // ein Klick aus das angegebene Feld. Der Cursor steht auf diesem.
- // Fuehre die vor definierten Aktionen aus.
-
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' xmloff/inc/xmloff/ecmaflds.hxx xmloff/inc/xmloff/ecmaflds.hxx
---- xmloff/inc/xmloff/ecmaflds.hxx 1970-01-01 01:00:00.000000000 +0100
-+++ xmloff/inc/xmloff/ecmaflds.hxx 2009-10-09 10:53:45.000000000 +0200
-@@ -0,0 +1,68 @@
-+/*************************************************************************
-+ *
-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+ *
-+ * Copyright 2008 by Sun Microsystems, Inc.
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: $
-+ * $Revision: $
-+ *
-+ * 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.
-+ *
-+ ************************************************************************/
-+/* and also:
-+ * Author: Florian Reuter <freuter at novell.com>
-+ * Copyright 2008 by Novell, Inc.
-+*/
-+#ifndef _ECMAFLDS_HXX
-+#define _ECMAFLDS_HXX
-+
-+
-+#define ECMA_FORMTEXT "ecma.office-open-xml.field.FORMTEXT"
-+#define ECMA_FORMTEXT_NAME "name"
-+#define ECMA_FORMTEXT_HELPTEXT "helpText"
-+#define ECMA_FORMTEXT_STATUSTEXT "statusText"
-+#define ECMA_FORMTEXT_DEFAULT "default"
-+#define ECMA_FORMTEXT_FORMAT "format"
-+#define ECMA_FORMTEXT_MAXLENGTH "maxLength"
-+#define ECMA_FORMTEXT_TYPE "type"
-+
-+#define ECMA_FORMCHECKBOX "ecma.office-open-xml.field.FORMCHECKBOX"
-+#define ECMA_FORMCHECKBOX_NAME "name"
-+#define ECMA_FORMCHECKBOX_HELPTEXT "helpText"
-+#define ECMA_FORMCHECKBOX_STATUSTEXT "statusText"
-+#define ECMA_FORMCHECKBOX_CHECKED "checked"
-+#define ECMA_FORMCHECKBOX_DEFAULT "default"
-+#define ECMA_FORMCHECKBOX_SIZE "size"
-+#define ECMA_FORMCHECKBOX_SIZEAUTO "sizeAuto"
-+
-+
-+#define ECMA_FORMDROPDOWN "ecma.office-open-xml.field.FORMDROPDOWN"
-+#define ECMA_FORMDROPDOWN_DEFAULT "default"
-+#define ECMA_FORMDROPDOWN_LISTENTRY "listEntry"
-+#define ECMA_FORMDROPDOWN_RESULT "result"
-+
-+#define ECMA_TOC "ecma.office-open-xml.field.TOC"
-+
-+#define ECMA_HYPERLINK "ecma.office-open-xml.field.HYPERLINK"
-+
-+#define ECMA_PAGEREF "ecma.office-open-xml.field.PAGEREF"
-+
-+#endif /* _ECMAFLDS_HXX */
-diff -urN '--exclude=unxlngi6.pro' '--exclude=*.orig' xmloff/source/text/XMLTextMarkImportContext.cxx xmloff/source/text/XMLTextMarkImportContext.cxx
---- xmloff/source/text/XMLTextMarkImportContext.cxx 2009-10-07 17:47:24.000000000 +0200
-+++ xmloff/source/text/XMLTextMarkImportContext.cxx 2009-10-09 11:41:16.000000000 +0200
-@@ -41,6 +41,7 @@
- #include <xmloff/xmltoken.hxx>
- #include <xmloff/xmlimp.hxx>
- #include <xmloff/nmspmap.hxx>
-+#include <xmloff/ecmaflds.hxx>
- #include "xmlnmspe.hxx"
- #include <com/sun/star/xml/sax/XAttributeList.hpp>
- #include <com/sun/star/text/XTextContent.hpp>
-@@ -138,6 +139,33 @@
- { XML_TOKEN_INVALID, 0 },
- };
-
-+
-+static const char *lcl_getFormFieldmarkName(rtl::OUString &name)
-+{
-+ static const char sCheckbox[]=ECMA_FORMCHECKBOX;
-+ static const char sFormDropDown[]=ECMA_FORMDROPDOWN;
-+ if (name.compareToAscii("msoffice.field.FORMCHECKBOX")==0)
-+ return sCheckbox;
... etc. - the rest is truncated
More information about the ooo-build-commit
mailing list