Anonymous avatar Anonymous committed f0d469c

CWS-TOOLING: integrate CWS c29v001a
2009-10-06 hb #160731# use SetReadOnlyUI instead of item at medium to get read only functionality
2009-10-05 hb #160731# added virtual destructor to IDocumentExternal data to make compilable under wntmsci12
2009-10-02 hb #160731# store fReadOnlyRecommended/fWriteReservation in WW8FibData
2009-10-02 hb #160731# handle stepping of offset correctly when reading strings
2009-10-02 hb #160731# write SttbAssoc/fReadOnlyRecommended/fWriteReservation
2009-10-02 hb #160731# Added new class WW8FibData
2009-10-02 hb #160731# new identifier for external type: FIB
2009-10-02 hb #160731# Added new class WW8FibData
2009-10-02 hb dbg_out for OUString
2009-10-01 hb read and write SttbfAssoc
2009-10-01 hb store external data in SwDoc
2009-09-29 hb merged DEV300_m60
2009-09-29 hb merged changes from private repository
2009-09-04 Henning Brinkmann added WW8Sttb for reading the WW8Sttb
2009-09-15 hb137859 #160401# made compilable
2009-09-15 hb137859 merged changes by hb
2009-09-15 sj93757 #160376# fixed shadow problem
2009-09-15 Henning Brinkmann merged changes for #160401#
2009-09-01 Henning Brinkmann #160401# added fReadOnlyRecommended and fWriteReservation to WW8Fib. If one of those is set, the document is read read-only.

Comments (0)

Files changed (15)

svx/source/msfilter/msdffimp.cxx

 {
 //	MapUnit eMap( rManager.GetModel()->GetScaleUnit() );
 
+	sal_Bool bHasShadow = sal_False;
+
 	for ( void* pDummy = ((DffPropertyReader*)this)->First(); pDummy; pDummy = ((DffPropertyReader*)this)->Next() )
 	{
 		UINT32 nRecType = GetCurKey();
 			break;
 			case DFF_Prop_fshadowObscured :
             {
-                sal_Bool bHasShadow = ( nContent & 2 ) != 0;
-				rSet.Put( SdrShadowItem( bHasShadow ) );
+                bHasShadow = ( nContent & 2 ) != 0;
 				if ( bHasShadow )
                 {
 					if ( !IsProperty( DFF_Prop_shadowOffsetX ) )
 		}
 	}
 
+	if ( bHasShadow )
+	{
+		// #160376# sj: activating shadow only if fill and or linestyle is used
+		// this is required because of the latest drawing layer core changes.
+		// Issue i104085 is related to this.
+		UINT32 nLineFlags(GetPropertyValue( DFF_Prop_fNoLineDrawDash ));
+		if(!IsHardAttribute( DFF_Prop_fLine ) && !IsCustomShapeStrokedByDefault( rObjData.eShapeType ))
+			nLineFlags &= ~0x08;
+		UINT32 nFillFlags(GetPropertyValue( DFF_Prop_fNoFillHitTest ));
+		if(!IsHardAttribute( DFF_Prop_fFilled ) && !IsCustomShapeFilledByDefault( rObjData.eShapeType ))
+			nFillFlags &= ~0x10;
+		if ( nFillFlags & 0x10 )
+		{
+			MSO_FillType eMSO_FillType = (MSO_FillType)GetPropertyValue( DFF_Prop_fillType, mso_fillSolid );
+			switch( eMSO_FillType )
+			{
+				case mso_fillSolid :
+				case mso_fillPattern :
+				case mso_fillTexture :
+				case mso_fillPicture :
+				case mso_fillShade :
+				case mso_fillShadeCenter :
+				case mso_fillShadeShape :
+				case mso_fillShadeScale :
+				case mso_fillShadeTitle :
+				break;
+				// case mso_fillBackground :
+				default:
+					nFillFlags &=~0x10;			// no fillstyle used	
+				break;
+			}
+		}
+		if ( ( ( nLineFlags & 0x08 ) == 0 ) && ( ( nFillFlags & 0x10 ) == 0 ) )	// if there is no fillstyle and linestyle
+			bHasShadow = sal_False;												// we are turning shadow off.
+
+		if ( bHasShadow )
+			rSet.Put( SdrShadowItem( bHasShadow ) );
+	}
 	ApplyLineAttributes( rSet, rObjData.eShapeType ); // #i28269#
 	ApplyFillAttributes( rIn, rSet, rObjData );
 	if ( rObjData.eShapeType != mso_sptNil )

sw/inc/IDocumentExternalData.hxx

+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_I_DOCUMENT_EXTERNAL_DATA_HXX
+#define INCLUDED_I_DOCUMENT_EXTERNAL_DATA_HXX
+
+#include <hash_map>
+#include <boost/shared_ptr.hpp>
+
+namespace sw
+{
+enum tExternalDataType { FIB, STTBF_ASSOC };
+
+struct ExternalDataTypeHash
+{
+    size_t operator()(tExternalDataType eType) const { return eType; }
+};
+
+class ExternalData
+{
+public:
+    ExternalData() {}
+    virtual ~ExternalData() {}
+};
+
+typedef ::boost::shared_ptr<ExternalData> tExternalDataPointer;
+}
+
+
+class IDocumentExternalData
+{
+protected:
+    typedef ::std::hash_map<sw::tExternalDataType, sw::tExternalDataPointer, sw::ExternalDataTypeHash> 
+    tExternalData;
+
+    tExternalData m_externalData;
+
+    virtual ~IDocumentExternalData() {};
+
+public:
+    virtual void setExternalData(sw::tExternalDataType eType, 
+                                 sw::tExternalDataPointer pPayload) = 0;
+    virtual sw::tExternalDataPointer getExternalData(sw::tExternalDataType eType) = 0;
+};
+
+#endif //INCLUDED_I_DOCUMENT_EXTERNAL_DATA_HXX

sw/inc/dbgoutsw.hxx

 #include <hash_map>
 #include <tox.hxx>
 class String;
+
+namespace rtl
+{
+class OUString;
+}
 class SwNode;
 class SwTxtAttr;
 class SwpHints;
 
 SW_DLLPUBLIC const char * dbg_out(const void * pVoid);
 SW_DLLPUBLIC const char * dbg_out(const String & aStr);
+SW_DLLPUBLIC const char * dbg_out(const ::rtl::OUString & aStr);
 SW_DLLPUBLIC const char * dbg_out(const SwRect & rRect);
 SW_DLLPUBLIC const char * dbg_out(const SwFrmFmt & rFrmFmt);
 SW_DLLPUBLIC const char * dbg_out(const SwNode & rNode);
 #include <IDocumentListsAccess.hxx>
 class SwList;
 // <--
+#include <IDocumentExternalData.hxx>
 #define _SVSTDARR_STRINGSDTOR
 #include <svtools/svstdarr.hxx>
 #include <com/sun/star/embed/XEmbeddedObject.hpp>
     public IDocumentOutlineNodes,
     // <--
     // --> OD 2008-03-12 #refactorlists#
-    public IDocumentListsAccess
+    public IDocumentListsAccess,
     // <--
+    public IDocumentExternalData
 {
 
 	friend void _InitCore();
                                              const String sNewListStyleName );
     // <--
 
+    /** IDocumentExternalData */
+    virtual void setExternalData(::sw::tExternalDataType eType, 
+                                 ::sw::tExternalDataPointer pPayload);
+    virtual ::sw::tExternalDataPointer getExternalData(::sw::tExternalDataType eType);
+
+
     /** INextInterface here
     */
 

sw/source/core/doc/dbgoutsw.cxx

     return aDbgOutResult.GetBuffer();
 }
 
+SW_DLLPUBLIC const char * dbg_out(const ::rtl::OUString & aStr)
+{
+    return OUStringToOString(aStr, RTL_TEXTENCODING_ASCII_US).getStr();
+}
+
 
 struct CompareUShort
 {

sw/source/core/doc/doc.cxx

      }
 }
 
+void SwDoc::setExternalData(::sw::tExternalDataType eType,
+                            ::sw::tExternalDataPointer pPayload)
+{
+    m_externalData[eType] = pPayload;
+}
+
+::sw::tExternalDataPointer SwDoc::getExternalData(::sw::tExternalDataType eType)
+{
+    return m_externalData[eType];
+}

sw/source/filter/ww8/WW8FibData.cxx

+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
+
+#include "WW8FibData.hxx"
+
+namespace ww8
+{
+WW8FibData::WW8FibData()
+  : m_bReadOnlyRecommended(false),
+    m_bWriteReservation(false)
+{
+}
+
+WW8FibData::~WW8FibData()
+{
+}
+
+void WW8FibData::setReadOnlyRecommended(bool bReadOnlyRecommended)
+{
+    m_bReadOnlyRecommended = bReadOnlyRecommended;
+}
+
+void WW8FibData::setWriteReservation(bool bWriteReservation)
+{
+    m_bWriteReservation = bWriteReservation;
+}
+
+bool WW8FibData::getReadOnlyRecommended() const
+{
+    return m_bReadOnlyRecommended;
+}
+
+bool WW8FibData::getWriteReservation() const
+{
+    return m_bWriteReservation;
+}
+}

sw/source/filter/ww8/WW8FibData.hxx

+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
+#ifndef INCLUDED_WW8_FIB_DATA_HXX
+#define INCLUDED_WW8_FIB_DATA_HXX
+#include <IDocumentExternalData.hxx>
+
+namespace ww8
+{
+class WW8FibData : public ::sw::ExternalData
+{
+    bool m_bReadOnlyRecommended;
+    bool m_bWriteReservation;
+
+public:
+    WW8FibData();
+    virtual ~WW8FibData();
+
+    void setReadOnlyRecommended(bool bReadOnlyRecommended);
+    void setWriteReservation(bool bWriteReservation);
+    
+    bool getReadOnlyRecommended() const;
+    bool getWriteReservation() const;
+};
+}
+
+#endif // INCLUDED_WW8_FIB_DATA_HXX

sw/source/filter/ww8/WW8Sttbf.cxx

+/*************************************************************************
+ *
+ * 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: ww8par2.hxx,v $
+ * $Revision: 1.47.214.1 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
+
+#include <iostream>
+#include <dbgoutsw.hxx>
+#include "WW8Sttbf.hxx"
+
+namespace ww8
+{
+    WW8Struct::WW8Struct(SvStream& rSt, sal_uInt32 nPos, sal_uInt32 nSize)
+    : mn_offset(0), mn_size(nSize)
+    {
+        rSt.Seek(nPos);
+        
+        mp_data.reset(new BYTE[nSize]);
+        rSt.Read(mp_data.get(), nSize);                
+    }
+    
+    WW8Struct::WW8Struct(WW8Struct * pStruct, sal_uInt32 nPos, sal_uInt32 nSize)
+    : mp_data(pStruct->mp_data), mn_offset(pStruct->mn_offset + nPos), 
+    mn_size(nSize)
+    {
+    }
+    
+    WW8Struct::~WW8Struct()
+    {
+    }
+    
+    sal_uInt8 WW8Struct::getU8(sal_uInt32 nOffset)
+    {
+        sal_uInt8 nResult = 0;
+        
+        if (nOffset < mn_size)
+        {
+            nResult = mp_data[mn_offset + nOffset];
+        }
+        
+        return nResult;
+    }
+    
+    ::rtl::OUString WW8Struct::getUString(sal_uInt32 nOffset, 
+                                          sal_uInt32 nCount)
+    {
+        ::rtl::OUString aResult;
+        
+        if (nCount > 0)
+        {
+            rtl_uString * pNew = 0;
+            rtl_uString_newFromStr_WithLength
+            (&pNew, reinterpret_cast<const sal_Unicode *>(&mp_data[mn_offset + nOffset]),
+             nCount);
+            
+            aResult = rtl::OUString(pNew);
+        }
+
+#ifdef DEBUG
+        char sBuffer[256];
+        snprintf(sBuffer, sizeof(sBuffer), "offset=\"%" SAL_PRIuUINT32 "\" count=\"%" SAL_PRIuUINT32 "\"", 
+                 nOffset, nCount);
+        ::std::clog << "<WW8Struct-getUString" << sBuffer << ">" 
+                    << dbg_out(aResult) << "</WW8Struct-getUString>" 
+                    << ::std::endl;
+#endif
+
+        return aResult;
+        
+    }
+
+    ::rtl::OUString WW8Struct::getString(sal_uInt32 nOffset, 
+                                         sal_uInt32 nCount)
+    {
+        ::rtl::OUString aResult;
+        
+        if (nCount > 0)
+        {
+            ::rtl::OString aOStr(reinterpret_cast<const sal_Char *>(&mp_data[mn_offset + nOffset]),
+                                 nCount);
+            ::rtl::OUString aOUStr(OStringToOUString(aOStr, RTL_TEXTENCODING_ASCII_US));
+            aResult = rtl::OUString(aOUStr);
+        }
+        
+#ifdef DEBUG
+        char sBuffer[256];
+        snprintf(sBuffer, sizeof(sBuffer), "offset=\"%" SAL_PRIuUINT32 "\" count=\"%" SAL_PRIuUINT32 "\"", 
+                 nOffset, nCount);
+        ::std::clog << "<WW8Struct-getString " << sBuffer << ">" 
+                    << dbg_out(aResult) << "</WW8Struct-getUString>" 
+                    << ::std::endl;
+#endif
+
+        return aResult;        
+    }
+}

sw/source/filter/ww8/WW8Sttbf.hxx

+/*************************************************************************
+ *
+ * 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: ww8par2.hxx,v $
+ * $Revision: 1.47.214.1 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
+
+#include <vector>
+#include <boost/shared_ptr.hpp>
+#include <boost/shared_array.hpp>
+#include <tools/solar.h>
+#include <rtl/ustring.hxx>
+#include <tools/stream.hxx>
+#include <IDocumentExternalData.hxx>
+
+namespace ww8
+{
+    typedef boost::shared_array<BYTE> DataArray_t;
+    
+class WW8Struct : public ::sw::ExternalData
+    {
+        DataArray_t mp_data;
+        sal_uInt32 mn_offset;
+        sal_uInt32 mn_size;
+        
+    public:
+        WW8Struct(SvStream& rSt, sal_uInt32 nPos, sal_uInt32 nSize);
+        WW8Struct(WW8Struct * pStruct, sal_uInt32 nPos, sal_uInt32 nSize);
+        virtual ~WW8Struct();
+        
+        sal_uInt8 getU8(sal_uInt32 nOffset);
+
+        sal_uInt16 getU16(sal_uInt32 nOffset) 
+        { return getU8(nOffset) + (getU8(nOffset + 1) << 8); }
+
+        sal_uInt32 getU32(sal_uInt32 nOffset)
+        { return  getU16(nOffset) + (getU16(nOffset + 1) << 16); }
+        
+        ::rtl::OUString getUString(sal_uInt32 nOffset, sal_uInt32 nCount);
+        
+        ::rtl::OUString getString(sal_uInt32 nOffset, sal_uInt32 nCount);
+    };
+    
+typedef ::std::vector<rtl::OUString> StringVector_t;
+    template <class T>
+    class WW8Sttb : public WW8Struct
+    {
+        typedef ::boost::shared_ptr< void > ExtraPointer_t;
+        typedef ::std::vector< ExtraPointer_t > ExtrasVector_t;
+        bool bDoubleByteCharacters;
+        StringVector_t m_Strings;
+        ExtrasVector_t m_Extras;
+        
+    public:
+        WW8Sttb(SvStream& rSt, INT32 nPos, sal_uInt32 nSize);
+        virtual ~WW8Sttb();
+        
+        sal_uInt32 getCount() const;
+        ::rtl::OUString getEntry(sal_uInt32 nEntry) const
+        {
+            return m_Strings[nEntry];
+        }
+
+        StringVector_t & getStrings()
+        {
+            return m_Strings;
+        }
+        
+        const T * getExtra(sal_uInt32 nEntry) const
+        {
+            return dynamic_cast<const T *> (m_Extras[nEntry].get());
+        }
+    };
+    
+    template <class T>
+    WW8Sttb<T>::WW8Sttb(SvStream& rSt, INT32 nPos, sal_uInt32 nSize)
+    : WW8Struct(rSt, nPos, nSize), bDoubleByteCharacters(false)
+    {
+        sal_uInt32 nOffset = 0;
+        
+        if (getU16(nOffset) == 0xffff)
+        {
+            bDoubleByteCharacters = true;
+            nOffset += 2;
+        }
+        
+        sal_uInt16 nCount = getU16(nOffset);
+        sal_uInt16 ncbExtra = getU16(nOffset + 2);
+        
+        nOffset += 4;
+        for (sal_uInt16 i = 0; i < nCount; i++)
+        {
+            if (bDoubleByteCharacters)
+            {
+                sal_uInt16 nStrLen = getU16(nOffset);
+                
+                m_Strings.push_back(getUString(nOffset +2, nStrLen));
+                
+                nOffset += 2 + 2 * nStrLen;
+            }
+            else
+            {
+                sal_uInt8 nStrLen = getU8(nOffset);
+                
+                m_Strings.push_back(getUString(nOffset, nStrLen));
+                
+                nOffset += 1 + nStrLen;
+            }
+            
+            if (ncbExtra > 0)
+            {
+                ExtraPointer_t pExtra(new T(this, nOffset, ncbExtra));
+                m_Extras.push_back(pExtra);
+
+                nOffset += ncbExtra;
+            }
+        }
+    }
+    
+    template <class T>
+    WW8Sttb<T>::~WW8Sttb()
+    {
+    }
+}

sw/source/filter/ww8/makefile.mk

 		$(SLO)$/writerwordglue.obj \
         $(SLO)$/ww8scan.obj \
         $(SLO)$/WW8TableInfo.obj \
-        $(SLO)$/WW8FFData.obj
+        $(SLO)$/WW8FFData.obj \
+        $(SLO)$/WW8Sttbf.obj \
+		$(SLO)$/WW8FibData.obj
 
 
 SLOFILES =	\
 		$(SLO)$/writerhelper.obj \
 		$(SLO)$/writerwordglue.obj \
         $(SLO)$/WW8TableInfo.obj \
-        $(SLO)$/WW8FFData.obj
+        $(SLO)$/WW8FFData.obj \
+        $(SLO)$/WW8Sttbf.obj \
+		$(SLO)$/WW8FibData.obj
 
 
 # --- Tagets -------------------------------------------------------

sw/source/filter/ww8/wrtww8.cxx

 #include <svx/mscodec.hxx>
 #include <osl/time.h>
 #include <rtl/random.h>
+#include "WW8Sttbf.hxx"
+#include "WW8FibData.hxx"
 
 using namespace sw::util;
 using namespace sw::types;
 #endif
 }
 
+typedef ww8::WW8Sttb< ww8::WW8Struct >  WW8SttbAssoc;
+
 void WW8Export::WriteFkpPlcUsw()
 {
     if( !bWrtWW8 )
         ExportDopTypography(pDop->doptypography);
 
         WriteDop( *this );                      // Document-Properties
+
+        // Write SttbfAssoc
+        WW8SttbAssoc * pSttbfAssoc = dynamic_cast<WW8SttbAssoc *>
+            (pDoc->getExternalData(::sw::STTBF_ASSOC).get());
+        ::std::vector<String> aStrings;
+
+        ::ww8::StringVector_t & aSttbStrings = pSttbfAssoc->getStrings();
+        ::ww8::StringVector_t::const_iterator aItEnd = aSttbStrings.end();
+        for (::ww8::StringVector_t::const_iterator aIt = aSttbStrings.begin();
+             aIt != aItEnd; aIt++)
+        {
+            String aStr(aIt->getStr());
+            aStrings.push_back(aStr);
+        }
+
+        WriteAsStringTable(aStrings, pFib->fcSttbfAssoc,
+                           pFib->lcbSttbfAssoc);
+
     }
     Strm().Seek( 0 );
 
+    // Reclaim stored FIB data from document.
+    ::ww8::WW8FibData * pFibData = dynamic_cast<ww8::WW8FibData *>
+          (pDoc->getExternalData(::sw::FIB).get());
+    
+    pFib->fReadOnlyRecommended = 
+        pFibData->getReadOnlyRecommended() ? 1 : 0;
+    pFib->fWriteReservation = 
+        pFibData->getWriteReservation() ? 1 : 0;
+
     pFib->Write( Strm() );  // FIB
 }
 

sw/source/filter/ww8/ww8par.cxx

 #include <dbgoutsw.hxx>
 #endif
 
+#include "WW8Sttbf.hxx"
+#include "WW8FibData.hxx"
 #define MM_250 1417             // WW-Default fuer Hor. Seitenraender: 2.5 cm
 #define MM_200 1134             // WW-Default fuer u.Seitenrand: 2.0 cm
 
     if (mbNewDoc && pStg && !pGloss)
         ReadDocInfo();
 
+    ::ww8::WW8FibData * pFibData = new ::ww8::WW8FibData();    
+    
+    if (pWwFib->fReadOnlyRecommended)
+        pFibData->setReadOnlyRecommended(true);
+    else
+        pFibData->setReadOnlyRecommended(false);
+
+    if (pWwFib->fWriteReservation)
+        pFibData->setWriteReservation(true);
+    else
+        pFibData->setWriteReservation(false);
+            
+    ::sw::tExternalDataPointer pExternalFibData(pFibData);
+
+    rDoc.setExternalData(::sw::FIB, pExternalFibData);
+
+    ::sw::tExternalDataPointer pSttbfAsoc
+          (new ::ww8::WW8Sttb<ww8::WW8Struct>(*pTableStream, pWwFib->fcSttbfAssoc, pWwFib->lcbSttbfAssoc));
+    
+    rDoc.setExternalData(::sw::STTBF_ASSOC, pSttbfAsoc);
+    
+    if (pWwFib->fWriteReservation || pWwFib->fReadOnlyRecommended)
+    {
+        SwDocShell * pDocShell = rDoc.GetDocShell();
+        if (pDocShell)
+            pDocShell->SetReadOnlyUI(sal_True);
+    }
+
     pPaM = new SwPaM(rPos);
 
     pCtrlStck = new SwWW8FltControlStack( &rDoc, nFieldFlags, *this );

sw/source/filter/ww8/ww8scan.cxx

         cQuickSaves = ( aBits1 & 0xf0 ) >> 4;
         fEncrypted  =   aBits2 & 0x01       ;
         fWhichTblStm= ( aBits2 & 0x02 ) >> 1;
-        // dummy    = ( aBits2 & 0x0e ) >> 1;
+        fReadOnlyRecommended = (aBits2 & 0x4) >> 2;
+        fWriteReservation = (aBits2 & 0x8) >> 3;
         fExtChar    = ( aBits2 & 0x10 ) >> 4;
         // dummy    = ( aBits2 & 0x20 ) >> 5;
         fFarEast    = ( aBits2 & 0x40 ) >> 6; // #i90932#
 	nBits16 |= (0xf0 & ( cQuickSaves << 4 ));
 	if( fEncrypted ) 	nBits16 |= 0x0100;
 	if( fWhichTblStm ) 	nBits16 |= 0x0200;
+
+    if (fReadOnlyRecommended) 
+        nBits16 |= 0x0400;
+    if (fWriteReservation) 
+        nBits16 |= 0x0800;
+
 	if( fExtChar ) 		nBits16 |= 0x1000;
 	if( fFarEast )      nBits16 |= 0x4000;  // #i90932#
 	if( fObfuscated )	nBits16 |= 0x8000;

sw/source/filter/ww8/ww8scan.hxx

     UINT16 cQuickSaves :4; // 00F0 count of times file was quicksaved
     UINT16 fEncrypted :1; //0100 1 if file is encrypted, 0 if not
     UINT16 fWhichTblStm :1; //0200 When 0, this fib refers to the table stream
+    UINT16 fReadOnlyRecommended :1;
+    UINT16 fWriteReservation :1;
                                                     // named "0Table", when 1, this fib refers to the
                                                     // table stream named "1Table". Normally, a file
                                                     // will have only one table stream, but under unusual
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.