[ooo-build-commit] Branch 'ooo/master' - 2 commits - sw/inc sw/source

Jan Holesovsky kendy at kemper.freedesktop.org
Fri Oct 16 02:42:14 PDT 2009


 sw/inc/IDocumentExternalData.hxx    |   72 +++++++++++++++++
 sw/inc/dbgoutsw.hxx                 |    6 +
 sw/inc/doc.hxx                      |   10 ++
 sw/source/core/doc/dbgoutsw.cxx     |    5 +
 sw/source/core/doc/doc.cxx          |   10 ++
 sw/source/filter/ww8/WW8FibData.cxx |   65 +++++++++++++++
 sw/source/filter/ww8/WW8FibData.hxx |   54 +++++++++++++
 sw/source/filter/ww8/WW8Sttbf.cxx   |  121 +++++++++++++++++++++++++++++
 sw/source/filter/ww8/WW8Sttbf.hxx   |  148 ++++++++++++++++++++++++++++++++++++
 sw/source/filter/ww8/makefile.mk    |    8 +
 sw/source/filter/ww8/wrtww8.cxx     |   31 +++++++
 sw/source/filter/ww8/ww8par.cxx     |   30 +++++++
 sw/source/filter/ww8/ww8scan.cxx    |    9 +-
 sw/source/filter/ww8/ww8scan.hxx    |    2 
 sw/source/ui/docvw/PostItMgr.cxx    |    8 -
 15 files changed, 567 insertions(+), 12 deletions(-)

New commits:
commit 1be22206766d989ee848110d4bb3ef1ad824622f
Author: Kurt Zenker <kz at openoffice.org>
Date:   Thu Oct 15 16:29:40 2009 +0000

    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.

diff --git a/sw/inc/IDocumentExternalData.hxx b/sw/inc/IDocumentExternalData.hxx
new file mode 100644
index 0000000..85f9347
--- /dev/null
+++ b/sw/inc/IDocumentExternalData.hxx
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * 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
diff --git a/sw/inc/dbgoutsw.hxx b/sw/inc/dbgoutsw.hxx
index cf79434..a4803e3 100644
--- a/sw/inc/dbgoutsw.hxx
+++ b/sw/inc/dbgoutsw.hxx
@@ -35,6 +35,11 @@
 #include <hash_map>
 #include <tox.hxx>
 class String;
+
+namespace rtl
+{
+class OUString;
+}
 class SwNode;
 class SwTxtAttr;
 class SwpHints;
@@ -69,6 +74,7 @@ extern bool bDbgOutPrintAttrSet;
 
 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);
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 55ab9a5..66695ef 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -58,6 +58,7 @@
 #include <IDocumentListsAccess.hxx>
 class SwList;
 // <--
+#include <IDocumentExternalData.hxx>
 #define _SVSTDARR_STRINGSDTOR
 #include <svtools/svstdarr.hxx>
 #include <com/sun/star/embed/XEmbeddedObject.hpp>
@@ -271,8 +272,9 @@ class SW_DLLPUBLIC SwDoc :
     public IDocumentOutlineNodes,
     // <--
     // --> OD 2008-03-12 #refactorlists#
-    public IDocumentListsAccess
+    public IDocumentListsAccess,
     // <--
+    public IDocumentExternalData
 {
 
     friend void _InitCore();
@@ -1046,6 +1048,12 @@ public:
                                              const String sNewListStyleName );
     // <--
 
+    /** IDocumentExternalData */
+    virtual void setExternalData(::sw::tExternalDataType eType, 
+                                 ::sw::tExternalDataPointer pPayload);
+    virtual ::sw::tExternalDataPointer getExternalData(::sw::tExternalDataType eType);
+
+
     /** INextInterface here
     */
 
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index fc9effe..2fb1676 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -111,6 +111,11 @@ SW_DLLPUBLIC const char * dbg_out(const String & aStr)
     return aDbgOutResult.GetBuffer();
 }
 
+SW_DLLPUBLIC const char * dbg_out(const ::rtl::OUString & aStr)
+{
+    return OUStringToOString(aStr, RTL_TEXTENCODING_ASCII_US).getStr();
+}
+
 
 struct CompareUShort
 {
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 3eb6ffb..d5fc279 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -2007,3 +2007,13 @@ void SwDoc::ChkCondColls()
      }
 }
 
+void SwDoc::setExternalData(::sw::tExternalDataType eType,
+                            ::sw::tExternalDataPointer pPayload)
+{
+    m_externalData[eType] = pPayload;
+}
+
+::sw::tExternalDataPointer SwDoc::getExternalData(::sw::tExternalDataType eType)
+{
+    return m_externalData[eType];
+}
diff --git a/sw/source/filter/ww8/WW8FibData.cxx b/sw/source/filter/ww8/WW8FibData.cxx
new file mode 100644
index 0000000..230e65f
--- /dev/null
+++ b/sw/source/filter/ww8/WW8FibData.cxx
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * 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;
+}
+}
diff --git a/sw/source/filter/ww8/WW8FibData.hxx b/sw/source/filter/ww8/WW8FibData.hxx
new file mode 100644
index 0000000..07bea0b
--- /dev/null
+++ b/sw/source/filter/ww8/WW8FibData.hxx
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * 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
diff --git a/sw/source/filter/ww8/WW8Sttbf.cxx b/sw/source/filter/ww8/WW8Sttbf.cxx
new file mode 100644
index 0000000..1d80f20
--- /dev/null
+++ b/sw/source/filter/ww8/WW8Sttbf.cxx
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * 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;        
+    }
+}
diff --git a/sw/source/filter/ww8/WW8Sttbf.hxx b/sw/source/filter/ww8/WW8Sttbf.hxx
new file mode 100644
index 0000000..6e6bc29
--- /dev/null
+++ b/sw/source/filter/ww8/WW8Sttbf.hxx
@@ -0,0 +1,148 @@
+/*************************************************************************
+ *
+ * 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()
+    {
+    }
+}
diff --git a/sw/source/filter/ww8/makefile.mk b/sw/source/filter/ww8/makefile.mk
index 6697cea..164a8fe 100644
--- a/sw/source/filter/ww8/makefile.mk
+++ b/sw/source/filter/ww8/makefile.mk
@@ -69,7 +69,9 @@ EXCEPTIONSFILES = \
         $(SLO)$/writerwordglue.obj \
         $(SLO)$/ww8scan.obj \
         $(SLO)$/WW8TableInfo.obj \
-        $(SLO)$/WW8FFData.obj
+        $(SLO)$/WW8FFData.obj \
+        $(SLO)$/WW8Sttbf.obj \
+        $(SLO)$/WW8FibData.obj
 
 
 SLOFILES =	\
@@ -96,7 +98,9 @@ SLOFILES =	\
         $(SLO)$/writerhelper.obj \
         $(SLO)$/writerwordglue.obj \
         $(SLO)$/WW8TableInfo.obj \
-        $(SLO)$/WW8FFData.obj
+        $(SLO)$/WW8FFData.obj \
+        $(SLO)$/WW8Sttbf.obj \
+        $(SLO)$/WW8FibData.obj
 
 
 # --- Tagets -------------------------------------------------------
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 4d2eb96..f945c0a 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -117,6 +117,8 @@
 #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;
@@ -2535,6 +2537,8 @@ void WW8Export::WriteMainText()
 #endif
 }
 
+typedef ww8::WW8Sttb< ww8::WW8Struct >  WW8SttbAssoc;
+
 void WW8Export::WriteFkpPlcUsw()
 {
     if( !bWrtWW8 )
@@ -2656,9 +2660,36 @@ void WW8Export::WriteFkpPlcUsw()
         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
 }
 
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 070de35..9b5a785 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -138,6 +138,8 @@
 #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
 
@@ -3740,6 +3742,34 @@ ULONG SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
     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 );
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 3f7bf9e..d559608 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -5488,7 +5488,8 @@ WW8Fib::WW8Fib(SvStream& rSt, BYTE nWantedVersion, UINT32 nOffset)
         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#
@@ -5661,6 +5662,12 @@ bool WW8Fib::WriteHeader(SvStream& rStrm)
     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;
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index 9ec0fc7..9d3d0af 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -1033,6 +1033,8 @@ public:
     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
commit 73558f619d10171194f9909adb455b033db334bc
Author: Kurt Zenker <kz at openoffice.org>
Date:   Thu Oct 15 11:39:37 2009 +0000

    CWS-TOOLING: integrate CWS fwk122
    2009-10-06 09:16:04 +0200 mav  r276693 : #i10000# let be compiled on all platforms
    2009-10-05 17:02:17 +0200 cd  r276688 : #i105343# Fix build problems under Linux/Mac
    2009-10-05 16:23:29 +0200 cd  r276687 : #i105489# Remove uiconfigurationmanagerimpl.obj from makefile.mk
    2009-10-05 15:17:05 +0200 cd  r276680 : #i105326# Fix crash when opening file with notes
    2009-10-05 11:02:22 +0200 mav  r276665 : #i105343# allow the view shell to disconnect from listener
    2009-10-02 11:33:45 +0200 cd  r276619 : #i105489# Revert changes done to aggregate sources due to too much regressions

diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index 6aa8f80..9862ace 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -154,14 +154,6 @@ SwPostItMgr::SwPostItMgr(SwView* pView)
         mbWaitingForCalcRects = true;
         mnEventId = Application::PostUserEvent( LINK( this, SwPostItMgr, CalcHdl), 0 );
     }
-
-    //#i#
-    if (HasNotes() && !mpWrtShell->GetViewOptions()->IsPostIts())
-        {
-                SfxRequest aRequest(mpView->GetViewFrame(),FN_VIEW_NOTES);
-                mpView->ExecViewOptions(aRequest);
-        }
-
 }
 
 SwPostItMgr::~SwPostItMgr()	


More information about the ooo-build-commit mailing list