[Libreoffice-commits] .: 13 commits - starmath/source sw/source sw/util

Jan Holesovsky kendy at kemper.freedesktop.org
Mon Dec 20 04:24:55 PST 2010


 starmath/source/parse.cxx         |   27 +--
 sw/source/core/inc/bodyfrm.hxx    |    2 
 sw/source/core/inc/frame.hxx      |   10 +
 sw/source/core/inc/txtfrm.hxx     |    4 
 sw/source/core/layout/pagechg.cxx |   16 +
 sw/source/core/text/makefile.mk   |    2 
 sw/source/core/text/porlay.hxx    |    6 
 sw/source/core/text/porlin.hxx    |    7 
 sw/source/core/text/portxt.hxx    |    4 
 sw/source/core/text/xmldump.cxx   |  313 ++++++++++++++++++++++++++++++++++++++
 sw/source/ui/docvw/edtwin.cxx     |   19 ++
 sw/util/makefile.mk               |   15 +
 12 files changed, 409 insertions(+), 16 deletions(-)

New commits:
commit 677651990cf86d931b1f43fdb746387748d43bb6
Merge: 5133de6... 3f54712...
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Mon Dec 20 01:54:36 2010 +0100

    Merge commit 'libreoffice-3.3.0.2'
    
    Conflicts:
    	starmath/source/parse.cxx
    	sw/source/core/text/makefile.mk
    	sw/source/filter/rtf/swparrtf.cxx
    	sw/source/filter/ww8/rtfattributeoutput.cxx

diff --cc starmath/source/parse.cxx
index 59d03d5,072d433..3e4228f
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@@ -2297,18 -2297,23 +2297,23 @@@ void SmParser::Special(
          // conversion of symbol names for 6.0 (XML) file format
          // (name change on import / export.
          // UI uses localized names XML file format does not.)
-         if (IsImportSymbolNames())
+         if( rName.Len() && rName.GetChar( 0 ) == sal_Unicode( '%' ) )
          {
-             const SmLocalizedSymbolData &rLSD = SM_MOD()->GetLocSymbolData();
-             aNewName = rLSD.GetUiSymbolName( rName );
-             bReplace = true;
-         }
-         else if (IsExportSymbolNames())
-         {
-             const SmLocalizedSymbolData &rLSD = SM_MOD()->GetLocSymbolData();
-             aNewName = rLSD.GetExportSymbolName( rName );
-             bReplace = true;
+             if (IsImportSymbolNames())
+             {
+                 const SmLocalizedSymbolData &rLSD = SM_MOD()->GetLocSymbolData();
+                 aNewName = rLSD.GetUiSymbolName( rName.Copy( 1 ) );
 -                bReplace = TRUE;
++                bReplace = true;
+             }
+             else if (IsExportSymbolNames())
+             {
+                 const SmLocalizedSymbolData &rLSD = SM_MOD()->GetLocSymbolData();
+                 aNewName = rLSD.GetExportSymbolName( rName.Copy( 1 ) );
 -                bReplace = TRUE;
++                bReplace = true;
+             }
          }
+         if( aNewName.Len() )
+             aNewName.Insert( '%', 0 );
      }
      else    // 5.0 <-> 6.0 formula text (symbol name) conversion
      {
diff --cc sw/source/core/text/makefile.mk
index c140462,8b943a8..7e1cc17
--- a/sw/source/core/text/makefile.mk
+++ b/sw/source/core/text/makefile.mk
@@@ -47,20 -47,8 +47,21 @@@ CFLAGS+=-DENABLE_GRAPHIT
  # --- Files --------------------------------------------------------
  
  SLOFILES =  \
 -                $(SLO)$/atrstck.obj \
 -                $(SLO)$/EnhancedPDFExportHelper.obj \
 +        $(EXCEPTIONSFILES) \
 +        $(SLO)$/txtcache.obj \
 +        $(SLO)$/txtinit.obj
 +
 +.IF "$(DBG_LEVEL)">="2"
 +SLOFILES +=  \
++        $(SLO)$/xmldump.obj \
 +        $(SLO)$/txtio.obj
 +.ENDIF
 +
 +EXCEPTIONSFILES = \
 +        $(SLO)$/EnhancedPDFExportHelper.obj \
 +        $(SLO)$/SwGrammarMarkUp.obj \
 +        $(SLO)$/atrstck.obj \
 +        $(SLO)$/blink.obj \
          $(SLO)$/frmcrsr.obj \
          $(SLO)$/frmform.obj \
          $(SLO)$/frminf.obj \
@@@ -95,9 -83,37 +96,8 @@@
          $(SLO)$/txtpaint.obj \
          $(SLO)$/txttab.obj \
          $(SLO)$/widorp.obj \
 -        $(SLO)$/blink.obj \
 -        $(SLO)$/noteurl.obj \
 -        $(SLO)$/SwGrammarMarkUp.obj \
 -        $(SLO)$/wrong.obj
 -
 -.IF "$(DBG_LEVEL)">="2"
 -SLOFILES +=  \
 -        $(SLO)$/xmldump.obj \
 -        $(SLO)$/txtio.obj
 -.ENDIF
 -
 -EXCEPTIONSFILES = \
 -        $(SLO)$/EnhancedPDFExportHelper.obj \
 -        $(SLO)$/inftxt.obj \
 -        $(SLO)$/itradj.obj \
 -        $(SLO)$/itrcrsr.obj \
 -        $(SLO)$/porlay.obj \
 -        $(SLO)$/pormulti.obj \
 -        $(SLO)$/SwGrammarMarkUp.obj \
 -        $(SLO)$/txtfly.obj \
          $(SLO)$/wrong.obj
  
--
 -.IF "$(CPUNAME)" == "SPARC"
 -.IF "$(OS)" == "NETBSD"
 -NOOPTFILES = \
 -    $(SLO)$/txtftn.obj
 -.ENDIF
 -.ENDIF
 -
  # --- Tagets -------------------------------------------------------
  
  .INCLUDE :  target.mk
commit 3f54712412e94dc8ecf5c04ca52dbca89aa3fb49
Author: Petr Mladek <pmladek at suse.cz>
Date:   Sat Dec 18 20:35:18 2010 +0100

    Version 3.3.0.2, tag libreoffice-3.3.0.2 (3.3-rc2)
commit 3c703a627697aa5f302af2e4890568371e5fa2f9
Author: os <os at openoffice.org>
Date:   Wed Dec 8 10:17:56 2010 +0100

    #i115956# token translation fixed

diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index e77d3be..072d433 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -2297,18 +2297,23 @@ void SmParser::Special()
         // conversion of symbol names for 6.0 (XML) file format
         // (name change on import / export.
         // UI uses localized names XML file format does not.)
-        if (IsImportSymbolNames())
+        if( rName.Len() && rName.GetChar( 0 ) == sal_Unicode( '%' ) )
         {
-            const SmLocalizedSymbolData &rLSD = SM_MOD()->GetLocSymbolData();
-            aNewName = rLSD.GetUiSymbolName( rName );
-            bReplace = TRUE;
-        }
-        else if (IsExportSymbolNames())
-        {
-            const SmLocalizedSymbolData &rLSD = SM_MOD()->GetLocSymbolData();
-            aNewName = rLSD.GetExportSymbolName( rName );
-            bReplace = TRUE;
+            if (IsImportSymbolNames())
+            {
+                const SmLocalizedSymbolData &rLSD = SM_MOD()->GetLocSymbolData();
+                aNewName = rLSD.GetUiSymbolName( rName.Copy( 1 ) );
+                bReplace = TRUE;
+            }
+            else if (IsExportSymbolNames())
+            {
+                const SmLocalizedSymbolData &rLSD = SM_MOD()->GetLocSymbolData();
+                aNewName = rLSD.GetExportSymbolName( rName.Copy( 1 ) );
+                bReplace = TRUE;
+            }
         }
+        if( aNewName.Len() )
+            aNewName.Insert( '%', 0 );
     }
     else    // 5.0 <-> 6.0 formula text (symbol name) conversion
     {
@@ -2347,7 +2352,7 @@ void SmParser::Special()
 
     if (bReplace  &&  aNewName.Len()  &&  rName != aNewName)
     {
-        Replace( GetTokenIndex() + 1, rName.Len(), aNewName );
+        Replace( GetTokenIndex(), rName.Len(), aNewName );
         rName = aNewName;
     }
 
commit 1db43df96c97a2f61ca74df154500553b35ebdd8
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Thu Dec 2 15:57:31 2010 +0100

    fdo#32039: Missing outline feature in new RTF export filter

diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index b3c0828..d969613 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -764,6 +764,12 @@ void RtfExport::OutputLinkedOLE( const rtl::OUString& )
     OSL_TRACE("%s", OSL_THIS_FUNC);
 }
 
+void RtfExport::OutputTextNode( const SwTxtNode& rNode )
+{
+    if ( !m_bOutOutlineOnly || rNode.IsOutline( ) )
+        MSWordExportBase::OutputTextNode( rNode );
+}
+
 void RtfExport::AppendSection( const SwPageDesc* pPageDesc, const SwSectionFmt* pFmt, ULONG nLnNum )
 {
     OSL_TRACE("%s", OSL_THIS_FUNC);
@@ -772,13 +778,14 @@ void RtfExport::AppendSection( const SwPageDesc* pPageDesc, const SwSectionFmt*
     AttrOutput().SectionBreak( msword::PageBreak, m_pSections->CurrentSectionInfo() );
 }
 
-RtfExport::RtfExport( RtfExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam, Writer* pWriter )
+RtfExport::RtfExport( RtfExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam, Writer* pWriter, bool bOutOutlineOnly )
     : MSWordExportBase( pDocument, pCurrentPam, pOriginalPam ),
       m_pFilter( pFilter ),
       m_pWriter( pWriter ),
       m_pAttrOutput( NULL ),
       m_pSections( NULL ),
       m_pSdrExport( NULL ),
+      m_bOutOutlineOnly( bOutOutlineOnly ),
       eDefaultEncoding(
               rtl_getTextEncodingFromWindowsCharset(
                   sw::ms::rtl_TextEncodingToWinCharset(DEF_ENCODING))),
@@ -1254,16 +1261,20 @@ void RtfExport::WriteHeaderFooter(const SwFrmFmt& rFmt, bool bHeader, const sal_
 /// Glue class to call RtfExport as an internal filter, needed by copy&paste support.
 class SwRTFWriter : public Writer
 {
-       public:
-               SwRTFWriter( const String& rFilterName, const String& rBaseURL );
-               virtual ~SwRTFWriter();
-               virtual ULONG WriteStream();
+    private:
+        bool bOutOutlineOnly;
+
+    public:
+        SwRTFWriter( const String& rFilterName, const String& rBaseURL );
+        virtual ~SwRTFWriter();
+        virtual ULONG WriteStream();
 };
 
-SwRTFWriter::SwRTFWriter( const String& /*rFltName*/, const String & rBaseURL )
+SwRTFWriter::SwRTFWriter( const String& rFltName, const String & rBaseURL )
 {
     OSL_TRACE("%s", OSL_THIS_FUNC);
     SetBaseURL( rBaseURL );
+    bOutOutlineOnly = 'O' == rFltName.GetChar( 0 );
 }
 
 SwRTFWriter::~SwRTFWriter()
@@ -1272,7 +1283,7 @@ SwRTFWriter::~SwRTFWriter()
 ULONG SwRTFWriter::WriteStream()
 {
     OSL_TRACE("%s", OSL_THIS_FUNC);
-    RtfExport aExport( NULL, pDoc, new SwPaM( *pCurPam->End(), *pCurPam->Start() ), pCurPam, this );
+    RtfExport aExport( NULL, pDoc, new SwPaM( *pCurPam->End(), *pCurPam->Start() ), pCurPam, this, bOutOutlineOnly );
     aExport.ExportDocument( true );
     return 0;
 }
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index 5d5a186..50bd72b 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -70,6 +70,7 @@ class RtfExport : public MSWordExportBase
     MSWordSections *m_pSections;
 
     RtfSdrExport *m_pSdrExport;
+    bool m_bOutOutlineOnly;
 
 public:
     /// Access to the attribute output class.
@@ -137,6 +138,9 @@ protected:
     /// Return value indicates if an inherited outline numbering is suppressed.
     virtual bool DisallowInheritingOutlineNumbering(const SwFmt &rFmt);
 
+    /// Output SwTxtNode is depending on outline export mode
+    virtual void OutputTextNode( const SwTxtNode& );
+
     /// Output SwGrfNode
     virtual void OutputGrfNode( const SwGrfNode& );
 
@@ -150,7 +154,8 @@ protected:
 public:
     /// Pass the pDocument, pCurrentPam and pOriginalPam to the base class.
     RtfExport( RtfExportFilter *pFilter, SwDoc *pDocument,
-            SwPaM *pCurrentPam, SwPaM *pOriginalPam, Writer* pWriter );
+            SwPaM *pCurrentPam, SwPaM *pOriginalPam, Writer* pWriter,
+            bool bOutOutlineOnly = false );
 
     /// Destructor.
     virtual ~RtfExport();
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 59bf582..a807481 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -749,7 +749,7 @@ protected:
     virtual void UpdatePosition( SwWW8AttrIter* pAttrIter, xub_StrLen nAktPos, xub_StrLen nEnd );
 
     /// Output SwTxtNode
-    void OutputTextNode( const SwTxtNode& );
+    virtual void OutputTextNode( const SwTxtNode& );
 
     /// Output SwTableNode
     void OutputTableNode( const SwTableNode& );
commit 2c29bb06b76097d6cf745b87a481bda450bc0178
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Thu Dec 2 13:54:13 2010 +0100

    fdo#31190: Use the same method to getthe DBData than the mail merge

diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 172192f..da75a14 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -2339,7 +2339,17 @@ void SwView::GenerateFormLetter(BOOL bUseCurrentDocument)
 
         SwDBData aData;
         SwWrtShell &rSh = GetWrtShell();
-        aData = rSh.GetDBData();
+
+        SvStringsDtor aDBNameList(5, 1);
+        SvStringsDtor aAllDBNames(5, 5);
+        rSh.GetAllUsedDB( aDBNameList, &aAllDBNames );
+        if ( aDBNameList.Count( ) )
+        {
+            String sDBName = *aDBNameList[0];
+            aData.sDataSource = sDBName.GetToken(0, DB_DELIM);
+            aData.sCommand = sDBName.GetToken(1, DB_DELIM);
+            aData.nCommandType = sDBName.GetToken(2, DB_DELIM ).ToInt32();
+        }
         rSh.EnterStdMode(); // Wechsel in Textshell erzwingen; ist fuer
                             // das Mischen von DB-Feldern notwendig.
         AttrChangedNotify( &rSh );
commit c972a97ab7c7e36f2190d1b89e3e49f9d23c7846
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Wed Dec 1 18:27:48 2010 +0100

    Added some more infos to the layout dump

diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 14cea93..20aaf56 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -922,6 +922,7 @@ public:
 public:
 #if OSL_DEBUG_LEVEL > 1
     virtual void dumpAsXml(xmlTextWriterPtr writer);
+    virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer);
     void dumpChildrenAsXml(xmlTextWriterPtr writer);
 #endif
     bool IsCollapse() const;
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 984be9d..475278a 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -610,6 +610,10 @@ public:
     {
         return mnHeightOfLastLine;
     }
+
+#if OSL_DEBUG_LEVEL > 1
+    virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer);
+#endif
 };
 
 /*************************************************************************
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index caa9dff..f655e98 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -260,6 +260,9 @@ void SwFrm::dumpAsXml( xmlTextWriterPtr writer )
     if ( name != NULL )
     {
         xmlTextWriterStartElement( writer, ( const xmlChar * ) name );
+
+        dumpAsXmlAttributes( writer );
+
         if ( IsTxtFrm(  ) )
         {
             SwTxtFrm *pTxtFrm = ( SwTxtFrm * ) this;
@@ -284,6 +287,15 @@ void SwFrm::dumpAsXml( xmlTextWriterPtr writer )
     }
 }
 
+void SwFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
+{
+    xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "ptr" ), "%p", this );
+    xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "next" ), "%p", GetNext() );
+    xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "prev" ), "%p", GetPrev() );
+    xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "upper" ), "%p", this->GetUpper() );
+    xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "lower" ), "%p", this->GetLower() );
+}
+
 void SwFrm::dumpChildrenAsXml( xmlTextWriterPtr writer )
 {
     SwFrm *pFrm = GetLower(  );
@@ -292,3 +304,10 @@ void SwFrm::dumpChildrenAsXml( xmlTextWriterPtr writer )
         pFrm->dumpAsXml( writer );
     }
 }
+
+void SwTxtFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
+{
+    SwFrm::dumpAsXmlAttributes( writer );
+    if ( HasFollow() )
+        xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%p", GetFollow() );
+}
commit d74a4b9d1a9dbaf3e4327ea83dddd1e99b493431
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Wed Dec 1 18:18:14 2010 +0100

    SwBodyFrm::Paint needs to call the parent method in any case

diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 5863e91..4591c8f 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -201,8 +201,8 @@ void SwBodyFrm::Paint( const SwRect& rRect, const SwPrtOptions* ) const
     SwRect aRect = Frm();
     pOut->DrawRect(aRect.SVRect());
     pOut->Pop();
-    SwLayoutFrm::Paint(rRect);
 #endif
+    SwLayoutFrm::Paint(rRect);
 }
 
 /*************************************************************************
commit c5e72df55b787568e8cb45e3b0afc517f594cb3a
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Wed Dec 1 17:00:52 2010 +0100

    Layout debugging: the SwBodyFrm::Paint shouldn't paint in non-debug mode

diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index ab5e523..5863e91 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -192,18 +192,17 @@ void SwBodyFrm::Format( const SwBorderAttrs * )
 void SwBodyFrm::Paint( const SwRect& rRect, const SwPrtOptions* ) const
 {
 #if OSL_DEBUG_LAYOUT > 1
-    fprintf( stderr, "SwBodyFrm::Paint()\n" );
-#endif
+    // Paint a red border around the SwBodyFrm in debug mode
     ViewShell *pSh = GetShell();
     OutputDevice* pOut =  pSh->GetOut();
     pOut->Push();
     pOut->SetLineColor(Color(255, 0, 0));
     pOut->SetFillColor(COL_TRANSPARENT);
-    SwRect aRect(Frm().Left()+5, Frm().Top()+5, Frm().Width()-5, Frm().Height()-5);
-//    SwRect aRect = Frm();
+    SwRect aRect = Frm();
     pOut->DrawRect(aRect.SVRect());
     pOut->Pop();
     SwLayoutFrm::Paint(rRect);
+#endif
 }
 
 /*************************************************************************
commit 54e3f214f58830e52a1276cca42dd16f1cd3b2ce
Author: Florian Reuter <freuter at novell.com>
Date:   Wed Dec 1 16:38:15 2010 +0100

    Added a layout dump hidden feature for dbglevel>1

diff --git a/sw/source/core/inc/bodyfrm.hxx b/sw/source/core/inc/bodyfrm.hxx
index 02fe0c8..5694c0b 100644
--- a/sw/source/core/inc/bodyfrm.hxx
+++ b/sw/source/core/inc/bodyfrm.hxx
@@ -44,6 +44,8 @@ protected:
 public:
     SwBodyFrm( SwFrmFmt* );
 
+    virtual	void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const;
+
     DECL_FIXEDMEMPOOL_NEWDEL(SwBodyFrm)
 };
 
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 9843667..14cea93 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -33,6 +33,11 @@
 #include "swrect.hxx"
 #include "calbck.hxx"	// fuer SwClient
 
+#if OSL_DEBUG_LEVEL > 1
+#include <libxml/encoding.h>
+#include <libxml/xmlwriter.h>
+#endif
+
 class SwLayoutFrm;
 class SwRootFrm;
 class SwPageFrm;
@@ -915,6 +920,10 @@ public:
     void ValidateThisAndAllLowers( const USHORT nStage );
 
 public:
+#if OSL_DEBUG_LEVEL > 1
+    virtual void dumpAsXml(xmlTextWriterPtr writer);
+    void dumpChildrenAsXml(xmlTextWriterPtr writer);
+#endif
     bool IsCollapse() const;
 };
 
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index bf1ff81..ab5e523 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -189,6 +189,23 @@ void SwBodyFrm::Format( const SwBorderAttrs * )
     bValidSize = bValidPrtArea = TRUE;
 }
 
+void SwBodyFrm::Paint( const SwRect& rRect, const SwPrtOptions* ) const
+{
+#if OSL_DEBUG_LAYOUT > 1
+    fprintf( stderr, "SwBodyFrm::Paint()\n" );
+#endif
+    ViewShell *pSh = GetShell();
+    OutputDevice* pOut =  pSh->GetOut();
+    pOut->Push();
+    pOut->SetLineColor(Color(255, 0, 0));
+    pOut->SetFillColor(COL_TRANSPARENT);
+    SwRect aRect(Frm().Left()+5, Frm().Top()+5, Frm().Width()-5, Frm().Height()-5);
+//    SwRect aRect = Frm();
+    pOut->DrawRect(aRect.SVRect());
+    pOut->Pop();
+    SwLayoutFrm::Paint(rRect);
+}
+
 /*************************************************************************
 |*
 |*	SwPageFrm::SwPageFrm(), ~SwPageFrm()
diff --git a/sw/source/core/text/makefile.mk b/sw/source/core/text/makefile.mk
index f7786a5..8b943a8 100644
--- a/sw/source/core/text/makefile.mk
+++ b/sw/source/core/text/makefile.mk
@@ -91,6 +91,7 @@ SLOFILES =  \
 
 .IF "$(DBG_LEVEL)">="2"
 SLOFILES +=  \
+        $(SLO)$/xmldump.obj \
         $(SLO)$/txtio.obj
 .ENDIF
 
diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx
index c668522..5a90ac8 100644
--- a/sw/source/core/text/porlay.hxx
+++ b/sw/source/core/text/porlay.hxx
@@ -259,6 +259,8 @@ public:
 #if OSL_DEBUG_LEVEL > 1
     void DebugPortions( SvStream &rOs, const XubString &rTxt,
                         const xub_StrLen nStart ); //$ ostream
+
+    void dumpLineAsXml(xmlTextWriter* writer, USHORT& ofs, String& aText);
 #endif
 
     OUTPUT_OPERATOR
@@ -368,6 +370,10 @@ public:
 
     const SwDropPortion *FindDropPortion() const;
 
+#if OSL_DEBUG_LEVEL > 1
+    void dumpAsXml( xmlTextWriter* writer, SwTxtFrm* pTxtFrm );
+#endif
+
     OUTPUT_OPERATOR
     DECL_FIXEDMEMPOOL_NEWDEL(SwParaPortion)
 };
diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx
index 489ea59..a3ff1b4 100644
--- a/sw/source/core/text/porlin.hxx
+++ b/sw/source/core/text/porlin.hxx
@@ -30,6 +30,10 @@
 
 #include "possiz.hxx"		// SwPosSize
 
+#if OSL_DEBUG_LEVEL > 1
+#include <libxml/xmlwriter.h>
+#endif
+
 class XubString;
 class SwTxtSizeInfo;
 class SwTxtPaintInfo;
@@ -196,6 +200,9 @@ public:
     // Accessibility: pass information about this portion to the PortionHandler
     virtual void HandlePortion( SwPortionHandler& rPH ) const;
 
+#if OSL_DEBUG_LEVEL > 1
+    void dumpPortionAsXml(USHORT ofs, String& aText, xmlTextWriter* writer);
+#endif
     OUTPUT_OPERATOR
 };
 
diff --git a/sw/source/core/text/portxt.hxx b/sw/source/core/text/portxt.hxx
index 43ed29d..2715c67 100644
--- a/sw/source/core/text/portxt.hxx
+++ b/sw/source/core/text/portxt.hxx
@@ -67,6 +67,10 @@ public:
     // Accessibility: pass information about this portion to the PortionHandler
     virtual void HandlePortion( SwPortionHandler& rPH ) const;
 
+#if OSL_DEBUG_LEVEL > 1
+    void dumpPortionAsXml(USHORT ofs, String& aText, xmlTextWriter* writer);
+#endif
+
     OUTPUT_OPERATOR
     DECL_FIXEDMEMPOOL_NEWDEL(SwTxtPortion)
 };
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
new file mode 100644
index 0000000..caa9dff
--- /dev/null
+++ b/sw/source/core/text/xmldump.cxx
@@ -0,0 +1,294 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Florian Reuter <freuter at novell.com>
+ *                 Cedric Bosdonnat <cbosdonnat at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#include "precompiled_sw.hxx"
+
+#include "frame.hxx"
+#include "txtfrm.hxx"
+#include "porlin.hxx"
+#include "porlay.hxx"
+#include "portxt.hxx"
+#include <SwPortionHandler.hxx>
+
+
+
+class XmlPortionDumper:public SwPortionHandler
+{
+  private:
+    xmlTextWriterPtr writer;
+    USHORT ofs;
+  public:
+
+    XmlPortionDumper( xmlTextWriterPtr some_writer ):writer( some_writer ), ofs( 0 )
+    {
+    }
+
+    virtual ~ XmlPortionDumper(  )
+    {
+    }
+
+    /**
+        @param nLength
+                length of this portion in the model string
+        @param rText
+                text which is painted on-screen
+      */
+    virtual void Text( USHORT nLength,
+                       USHORT nType )
+    {
+        ofs += nLength;
+        xmlTextWriterStartElement( writer, BAD_CAST( "Text" ) );
+        xmlTextWriterWriteFormatAttribute( writer,
+                                           BAD_CAST( "nLength" ),
+                                           "%i", ( int ) nLength );
+        xmlTextWriterWriteFormatAttribute( writer,
+                                           BAD_CAST( "nType" ),
+                                           "%i", ( int ) nType );
+        xmlTextWriterEndElement( writer );
+    }
+
+    /**
+        @param nLength
+                length of this portion in the model string
+        @param rText
+                text which is painted on-screen
+        @param nType
+                type of this portion
+      */
+    virtual void Special( USHORT nLength,
+                          const String & rText,
+                          USHORT nType )
+    {
+        xmlTextWriterStartElement( writer, BAD_CAST( "Special" ) );
+        xmlTextWriterWriteFormatAttribute( writer,
+                                           BAD_CAST( "nLength" ),
+                                           "%i", ( int ) nLength );
+        xmlTextWriterWriteFormatAttribute( writer,
+                                           BAD_CAST( "nType" ),
+                                           "%i", ( int ) nType );
+        rtl::OUString sText( rText );
+        rtl::OString sText8 =::rtl::OUStringToOString( sText,
+                                                       RTL_TEXTENCODING_UTF8 );
+        xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "rText" ),
+                                           "%s", sText8.getStr(  ) );
+
+        xmlTextWriterEndElement( writer );
+        ofs += nLength;
+    }
+
+    virtual void LineBreak(  )
+    {
+        xmlTextWriterStartElement( writer, BAD_CAST( "LineBreak" ) );
+        xmlTextWriterEndElement( writer );
+    }
+
+    /**
+      * @param nLength
+      *         number of 'model string' characters to be skipped
+      */
+    virtual void Skip( USHORT nLength )
+    {
+        xmlTextWriterStartElement( writer, BAD_CAST( "Skip" ) );
+        xmlTextWriterWriteFormatAttribute( writer,
+                                           BAD_CAST( "nLength" ),
+                                           "%i", ( int ) nLength );
+        xmlTextWriterEndElement( writer );
+        ofs += nLength;
+    }
+
+    virtual void Finish(  )
+    {
+        xmlTextWriterStartElement( writer, BAD_CAST( "Finish" ) );
+        xmlTextWriterEndElement( writer );
+    }
+
+};
+
+
+void SwTxtPortion::dumpPortionAsXml( xub_StrLen ofs, XubString & /*aText */,
+                                     xmlTextWriterPtr writer )
+{
+    xmlTextWriterStartElement( writer, BAD_CAST( "SwTxtPortion" ) );
+    xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "ofs" ), "%i", ofs );
+    xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "len" ), "%i",
+                                       ( int ) this->GetLen(  ) );
+
+    xmlTextWriterEndElement( writer );
+}
+
+void SwLinePortion::dumpPortionAsXml( xub_StrLen ofs, XubString & /*aText */,
+                                      xmlTextWriterPtr writer )
+{
+    xmlTextWriterStartElement( writer, BAD_CAST( "SwLinePortion" ) );
+    xmlTextWriterWriteFormatAttribute( writer,
+                                       BAD_CAST( "nWhichPor" ),
+                                       "%04X",
+                                       ( int ) this->GetWhichPor(  ) );
+    xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "ofs" ), "%i", ofs );
+    xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "len" ), "%i",
+                                       ( int ) this->GetLen(  ) );
+    xmlTextWriterEndElement( writer );
+}
+
+void SwLineLayout::dumpLineAsXml( xmlTextWriterPtr writer,
+                                  xub_StrLen & ofs, XubString & aText )
+{                               // not used any longer...
+    xmlTextWriterStartElement( writer, BAD_CAST( "SwLineLayout" ) );
+    SwLinePortion *portion = this;
+    while ( portion != NULL )
+    {
+        portion->dumpPortionAsXml( ofs, aText, writer );
+        ofs += portion->GetLen(  );
+        portion = portion->GetPortion(  );
+    }
+    xmlTextWriterEndElement( writer );
+}
+
+
+void SwParaPortion::dumpAsXml( xmlTextWriterPtr writer, SwTxtFrm * pTxtFrm )
+{
+    xmlTextWriterStartElement( writer, BAD_CAST( "SwParaPortion" ) );
+    SwParaPortion *pPara = this;
+
+    if ( pPara && pTxtFrm )
+    {
+        xub_StrLen ofs = 0;
+        XubString & aText = ( String & ) pTxtFrm->GetTxt(  );
+        if ( pTxtFrm->IsFollow(  ) )
+            ofs += pTxtFrm->GetOfst(  );
+
+        SwLineLayout *pLine = pPara;
+        while ( pLine )
+        {
+            xmlTextWriterStartElement( writer, BAD_CAST( "line" ) );
+            SwLinePortion *pPor = pLine->GetFirstPortion(  );
+            while ( pPor )
+            {
+                pPor->dumpPortionAsXml( ofs, aText, writer );
+                ofs += pPor->GetLen(  );
+                pPor = pPor->GetPortion(  );
+            }
+
+            xmlTextWriterEndElement( writer );  // line
+            pLine = pLine->GetNext(  );
+        }
+    }
+    xmlTextWriterEndElement( writer );
+}
+
+
+void SwFrm::dumpAsXml( xmlTextWriterPtr writer )
+{
+    const char *name = NULL;
+
+    switch ( GetType(  ) )
+    {
+    case FRM_ROOT:
+        name = "root";
+        break;
+    case FRM_PAGE:
+        name = "page";
+        break;
+    case FRM_COLUMN:
+        name = "column";
+        break;
+    case FRM_HEADER:
+        name = "header";
+        break;
+    case FRM_FOOTER:
+        name = "footer";
+        break;
+    case FRM_FTNCONT:
+        name = "ftncont";
+        break;
+    case FRM_FTN:
+        name = "ftn";
+        break;
+    case FRM_BODY:
+        name = "body";
+        break;
+    case FRM_FLY:
+        name = "fly";
+        break;
+    case FRM_SECTION:
+        name = "section";
+        break;
+    case FRM_UNUSED:
+        name = "unused";
+        break;
+    case FRM_TAB:
+        name = "tab";
+        break;
+    case FRM_ROW:
+        name = "row";
+        break;
+    case FRM_CELL:
+        name = "cell";
+        break;
+    case FRM_TXT:
+        name = "txt";
+        break;
+    case FRM_NOTXT:
+        name = "txt";
+        break;
+    };
+
+    if ( name != NULL )
+    {
+        xmlTextWriterStartElement( writer, ( const xmlChar * ) name );
+        if ( IsTxtFrm(  ) )
+        {
+            SwTxtFrm *pTxtFrm = ( SwTxtFrm * ) this;
+            rtl::OUString aTxt = pTxtFrm->GetTxt(  );
+            for ( int i = 0; i < 32; i++ )
+            {
+                aTxt = aTxt.replace( i, '*' );
+            }
+            rtl::OString aTxt8 =::rtl::OUStringToOString( aTxt,
+                                                          RTL_TEXTENCODING_UTF8 );
+            xmlTextWriterWriteString( writer,
+                                      ( const xmlChar * ) aTxt8.getStr(  ) );
+            XmlPortionDumper pdumper( writer );
+            pTxtFrm->VisitPortions( pdumper );
+
+        }
+        else
+        {
+            dumpChildrenAsXml( writer );
+        }
+        xmlTextWriterEndElement( writer );
+    }
+}
+
+void SwFrm::dumpChildrenAsXml( xmlTextWriterPtr writer )
+{
+    SwFrm *pFrm = GetLower(  );
+    for ( ; pFrm != NULL; pFrm = pFrm->GetNext(  ) )
+    {
+        pFrm->dumpAsXml( writer );
+    }
+}
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index bf184f7..2213afb 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -140,6 +140,8 @@
 
 #include <PostItMgr.hxx>
 
+#include "../../core/inc/rootfrm.hxx"
+
 using namespace sw::mark;
 using namespace ::com::sun::star;
 
@@ -1335,6 +1337,23 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
     BOOL bChkInsBlank = pQuickHlpData->bChkInsBlank;
     pQuickHlpData->bChkInsBlank = FALSE;
 
+#if OSL_DEBUG_LEVEL > 1
+    if (rKEvt.GetKeyCode().GetCode() == KEY_F12)
+    {
+        SwRootFrm* pLayout = GetView().GetDocShell()->GetWrtShell()->GetLayout();
+        xmlTextWriterPtr writer = xmlNewTextWriterFilename("layout.xml", 0);
+        if (writer!=NULL)
+        {
+            printf("dumping layout in \"layout.xml\"\n");
+            xmlTextWriterStartDocument(writer, NULL, NULL, NULL);
+            pLayout->dumpAsXml(writer);
+            xmlTextWriterEndDocument(writer);
+            xmlFreeTextWriter(writer);
+        }
+        return;
+    }
+#endif
+
     KeyEvent aKeyEvent( rKEvt );
     // look for vertical mappings
     if( !bIsDocReadOnly && !rSh.IsSelFrmMode() && !rSh.IsObjSelected() )
diff --git a/sw/util/makefile.mk b/sw/util/makefile.mk
index 4088abe..9b07ba1 100644
--- a/sw/util/makefile.mk
+++ b/sw/util/makefile.mk
@@ -1,7 +1,7 @@
 #*************************************************************************
 #
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-# 
+#
 # Copyright 2000, 2010 Oracle and/or its affiliates.
 #
 # OpenOffice.org - a multi-platform office productivity suite
@@ -114,14 +114,16 @@ SHL1STDLIBS+= \
     $(UCBHELPERLIB) \
     $(CPPUHELPERLIB) \
     $(CPPULIB) \
-     \
     $(SALLIB) \
     $(SALHELPERLIB) \
     $(ICUUCLIB) \
-    $(I18NUTILLIB)
-SHL1STDLIBS+= \
+    $(I18NUTILLIB) \
     $(AVMEDIALIB)
 
+.IF "$(DBG_LEVEL)">="2"
+SHL1STDLIBS+= $(LIBXML2LIB)
+.ENDIF
+
 .IF "$(GUI)"=="WNT"
 SHL1STDLIBS+= $(ADVAPI32LIB)
 .ENDIF # WNT
@@ -160,6 +162,8 @@ SHL2OBJS=   $(SLO)$/swdetect.obj \
 .IF "$(DBG_LEVEL)">="2"
 SHL2OBJS+=  \
         $(SLO)$/errhdl.obj
+SHL2STDLIBS+= \
+        $(LIBXML2LIB)
 .ENDIF
 
 SHL2DEPN+=  makefile.mk
@@ -192,6 +196,9 @@ SHL3STDLIBS= \
             $(CPPULIB) \
             $(SALLIB) \
             $(SOTLIB)
+.IF "$(DBG_LEVEL)">="2"
+SHL3STDLIBS+= $(LIBXML2LIB)
+.ENDIF
 
 SHL3LIBS=   $(SLB)$/swui.lib
 LIB3TARGET = $(SLB)$/swui.lib
commit f3b47ff0c59c046e390cf433004fe6d3f03100ee
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 30 13:52:10 2010 +0000

    Resolves: rhbz#657718# Crash in SwObjectFormatterTxtFrm::CreateObjFormatter
    (cherry picked from commit 7f75773f59f4e755c8e18b8f604d3ac56d94914e)

diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx b/sw/source/core/layout/objectformattertxtfrm.cxx
index 472db36..db63431 100644
--- a/sw/source/core/layout/objectformattertxtfrm.cxx
+++ b/sw/source/core/layout/objectformattertxtfrm.cxx
@@ -103,7 +103,7 @@ SwObjectFormatterTxtFrm* SwObjectFormatterTxtFrm::CreateObjFormatter(
     if ( _rAnchorTxtFrm.IsFollow() )
     {
         pMasterOfAnchorFrm = _rAnchorTxtFrm.FindMaster();
-        while ( pMasterOfAnchorFrm->IsFollow() )
+        while ( pMasterOfAnchorFrm && pMasterOfAnchorFrm->IsFollow() )
         {
             pMasterOfAnchorFrm = pMasterOfAnchorFrm->FindMaster();
         }
commit 43eda75d48ecf27b8ad433460892da26c0655f5e
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Tue Nov 30 00:54:45 2010 +0100

    RTF: port last changes from CWS
    
    Conflicts:
    
    	sw/source/filter/ww8/rtfattributeoutput.cxx

diff --git a/sw/inc/ring.hxx b/sw/inc/ring.hxx
index de64a96..238067c 100644
--- a/sw/inc/ring.hxx
+++ b/sw/inc/ring.hxx
@@ -28,9 +28,10 @@
 #ifndef _RING_HXX
 #define _RING_HXX
 
+#include <swdllapi.h>
 #include <swtypes.hxx>
 
-class Ring
+class SW_DLLPUBLIC Ring
 {
     Ring *pNext;
     Ring* pPrev; 	// zur Optimierung, damit das ein/ausketten schneller geht!
diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx
index d62ddbb..4fa3536 100644
--- a/sw/inc/unoframe.hxx
+++ b/sw/inc/unoframe.hxx
@@ -162,7 +162,7 @@ public:
     void			ResetDescriptor();
     //copy text from a given source PaM
     void            SetSelection(SwPaM& rCopySource);
-    static SdrObject *GetOrCreateSdrObject( SwFlyFrmFmt *pFmt );
+	static SW_DLLPUBLIC SdrObject *GetOrCreateSdrObject( SwFlyFrmFmt *pFmt );
 };
 /*-----------------20.02.98 11:28-------------------
 
diff --git a/sw/source/filter/rtf/rtffly.cxx b/sw/source/filter/rtf/rtffly.cxx
index 7a09e9d..26a2c05 100644
--- a/sw/source/filter/rtf/rtffly.cxx
+++ b/sw/source/filter/rtf/rtffly.cxx
@@ -61,6 +61,7 @@
 #include <txtflcnt.hxx>
 #include <fmtflcnt.hxx>
 #include <fltini.hxx>
+#include <unoframe.hxx>
 #include <deque>
 #include <map>
 #include <utility>
@@ -1293,7 +1294,7 @@ void SwRTFParser::InsPicture( const String& rGrfNm, const Graphic* pGrf,
             aFlySet.Put(aSurroundItem);
         }
 
-        SwFrmFmt* pFlyFmt = pDoc->Insert( *pPam,
+        SwFlyFrmFmt* pFlyFmt = pDoc->Insert( *pPam,
                     rGrfNm, aEmptyStr,		// Name der Graphic !!
                     pGrf,
                     &aFlySet,				// Attribute fuer den FlyFrm
@@ -1305,6 +1306,26 @@ void SwRTFParser::InsPicture( const String& rGrfNm, const Graphic* pGrf,
         _SetPictureSize( *pGrfNd, pPos->nNode,
                         (SfxItemSet&)pFlyFmt->GetAttrSet(),
                         pPicType );
+        if( pPicType )
+        {
+            PictPropertyNameValuePairs::const_iterator aIt = pPicType->aPropertyPairs.begin();
+            PictPropertyNameValuePairs::const_iterator aEnd = pPicType->aPropertyPairs.end();
+            while( aIt != aEnd)
+            {
+                if( aIt->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( "wzDescription") ))
+                {
+                    SwXFrame::GetOrCreateSdrObject( pFlyFmt );
+                    pDoc->SetFlyFrmDescription( *(pFlyFmt), aIt->second );
+                }
+                else if( aIt->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( "wzName") ))
+                {
+                    SwXFrame::GetOrCreateSdrObject( pFlyFmt );
+                    pDoc->SetFlyFrmTitle( *(pFlyFmt), aIt->second );
+                }    
+                ++aIt;
+            }
+        }    
+    
     }
 
     if( pGrfAttrSet )
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index 936f5af..63e7e1b 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -1376,6 +1376,7 @@ void SwRTFParser::ReadShapeObject()
     String shpTxt;
     bool bshpTxt=false;
     int txflTextFlow=0;
+    ::rtl::OUString sDescription, sName;
 
 
     while (level>0 && IsParserWorking())
@@ -1433,7 +1434,14 @@ void SwRTFParser::ReadShapeObject()
                       {
                         txflTextFlow=aToken.ToInt32();
                       }
-
+                    else if (sn.EqualsAscii("wzDescription"))
+                    {
+                        sDescription = aToken;
+                    }
+                    else if(sn.EqualsAscii("wzName"))
+                    {
+                        sName = aToken;
+                    }
                 }
                 break;
             case RTF_PICT:
@@ -1459,6 +1467,7 @@ void SwRTFParser::ReadShapeObject()
     }
     SkipToken(-1);
 
+    SdrObject* pSdrObject = 0;
     switch(shapeType)
     {
         case 202: /* Text Box */
@@ -1478,6 +1487,7 @@ void SwRTFParser::ReadShapeObject()
 
             const Rectangle aRect(FRound(aRange.getMinX()), FRound(aRange.getMinY()), FRound(aRange.getMaxX()), FRound(aRange.getMaxY()));
             SdrRectObj* pStroke = new SdrRectObj(aRect);
+            pSdrObject = pStroke;
             pStroke->SetSnapRect(aRect);
             pDoc->GetOrCreateDrawModel(); // create model
             InsertShpObject(pStroke, this->nZOrder++);
@@ -1525,6 +1535,7 @@ void SwRTFParser::ReadShapeObject()
             aLine.append(aPointRightBottom);
 
             SdrPathObj* pStroke = new SdrPathObj(OBJ_PLIN, ::basegfx::B2DPolyPolygon(aLine));
+            pSdrObject = pStroke;
             //pStroke->SetSnapRect(aRect);
 
             InsertShpObject(pStroke, this->nZOrder++);
@@ -1545,11 +1556,17 @@ void SwRTFParser::ReadShapeObject()
             const Rectangle aRect(FRound(aRange.getMinX()), FRound(aRange.getMinY()), FRound(aRange.getMaxX()), FRound(aRange.getMaxY()));
 
             SdrRectObj* pStroke = new SdrGrafObj(aGrf);
+            pSdrObject = pStroke;
             pStroke->SetSnapRect(aRect);
 
             InsertShpObject(pStroke, this->nZOrder++);
         }
     }
+    if( pSdrObject )
+    {
+        pSdrObject->SetDescription(sDescription);
+        pSdrObject->SetTitle(sName);
+    }
 }
 
 extern void sw3io_ConvertFromOldField( SwDoc& rDoc, USHORT& rWhich,
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index e19e3b9..d143904 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2374,7 +2374,7 @@ void DocxAttributeOutput::NumberingLevel( BYTE nLevel,
                     FSNS( XML_w, XML_hint ), "default",
                     FSEND );
         }
-        m_rExport.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN );
+        m_rExport.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rExport.mbExportModeRTF );
 
         m_pSerializer->endElementNS( XML_w, XML_rPr );
     }
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 66fb119..ba53111 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -280,7 +280,8 @@ void RtfAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextN
         if ( m_nTableDepth > 0 && !m_bTableCellOpen )
         {
             ww8::WW8TableNodeInfoInner::Pointer_t pDeepInner( pTextNodeInfo->getInnerForDepth( m_nTableDepth ) );
-            if ( pDeepInner->getCell() == 0 )
+            OSL_ENSURE( pDeepInner, "TableNodeInfoInner not found");
+            if ( pDeepInner && pDeepInner->getCell() == 0 )
                 StartTableRow( pDeepInner );
 
             StartTableCell( pDeepInner );
@@ -1393,7 +1394,7 @@ void RtfAttributeOutput::NumberingLevel( BYTE nLevel,
             m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_F;
             m_rExport.OutULong(m_rExport.maFontHelper.GetId(*pFont));
         }
-        m_rExport.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN );
+        m_rExport.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rExport.mbExportModeRTF );
         m_rExport.Strm() << m_aStyles.makeStringAndClear();
     }
 
@@ -1523,7 +1524,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi
             }
 
             if ( pGrfNode )
-                FlyFrameGraphic( *pGrfNode, rFrame.GetLayoutSize() );
+                FlyFrameGraphic( dynamic_cast<const SwFlyFrmFmt*>( &rFrame.GetFrmFmt() ), *pGrfNode, rFrame.GetLayoutSize() );
             break;
         case sw::Frame::eDrawing:
             {
@@ -1689,16 +1690,23 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi
                             m_aRun.append(OUStringToOString(OUString(FieldString(ww::eFORMDROPDOWN)), m_rExport.eCurrentEncoding));
                             m_aRun.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD "{");
                             m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFTYPE "2"); // 2 = list
+                            m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFHASLISTBOX);
 
-                            xPropSet->getPropertyValue(C2U("DefaultSelection")) >>= aIntSeq;
-                            m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFDEFRES);
-                            // a dropdown list can have only one 'selected item by default'
-                            m_aRun.append((sal_Int32)aIntSeq[0]);
+                            xPropSet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultSelection"))) >>= aIntSeq;
+                            if( aIntSeq.getLength() )
+                            {
+                                m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFDEFRES);
+                                // a dropdown list can have only one 'selected item by default'
+                                m_aRun.append((sal_Int32)aIntSeq[0]);
+                            }
 
-                            xPropSet->getPropertyValue(C2U("SelectedItems")) >>= aIntSeq;
-                            m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFRES);
-                            // a dropdown list can have only one 'currently selected item'
-                            m_aRun.append((sal_Int32)aIntSeq[0]);
+                            xPropSet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SelectedItems"))) >>= aIntSeq;
+                            if( aIntSeq.getLength() )
+                            {
+                                m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFRES);
+                                // a dropdown list can have only one 'currently selected item'
+                                m_aRun.append((sal_Int32)aIntSeq[0]);
+                            }
 
                             sName = C2U("Name");
                             if (xPropSetInfo->hasPropertyByName(sName))
@@ -1729,7 +1737,6 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi
                                 m_aRun.append('}');
                             }
 
-                            m_aRun.append(OOO_STRING_SVTOOLS_RTF_FFHASLISTBOX);
 
                             xPropSet->getPropertyValue(C2U("StringItemList")) >>= aStrSeq;
                             sal_uInt32 nListItems = aStrSeq.getLength();
@@ -1760,7 +1767,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi
                 {
                     SwNodeIndex aIdx(*rFrmFmt.GetCntnt().GetCntntIdx(), 1);
                     SwOLENode& rOLENd = *aIdx.GetNode().GetOLENode();
-                    FlyFrameOLE(rOLENd, rFrame.GetLayoutSize());
+                    FlyFrameOLE(dynamic_cast<const SwFlyFrmFmt*>( &rFrmFmt ), rOLENd, rFrame.GetLayoutSize());
                 }
             }
             break;
@@ -2665,15 +2672,33 @@ void RtfAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace )
     {
         if( m_rExport.bOutPageDescs )
         {
-            if( rULSpace.GetUpper() )
+            
+            OSL_ENSURE( m_rExport.GetCurItemSet(), "Impossible" );
+            if ( !m_rExport.GetCurItemSet() )
+                return;
+
+            HdFtDistanceGlue aDistances( *m_rExport.GetCurItemSet() );
+
+            if ( aDistances.HasHeader() )
             {
-                m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGTSXN);
-                m_aSectionBreaks.append((sal_Int32)rULSpace.GetUpper());
+                if( aDistances.dyaTop )
+                {
+                    m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGTSXN);
+                    m_aSectionBreaks.append((sal_Int32)aDistances.dyaTop);
+                }
+                m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_HEADERY);
+                m_aSectionBreaks.append((sal_Int32)aDistances.dyaHdrTop);
             }
-            if( rULSpace.GetLower() )
+
+            if( aDistances.HasFooter() )
             {
-                m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGBSXN);
-                m_aSectionBreaks.append((sal_Int32)rULSpace.GetLower());
+                if( aDistances.dyaBottom )
+                {
+                    m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_MARGBSXN);
+                    m_aSectionBreaks.append((sal_Int32)aDistances.dyaBottom);
+                }
+                m_aSectionBreaks.append(OOO_STRING_SVTOOLS_RTF_FOOTERY);
+                m_aSectionBreaks.append((sal_Int32)aDistances.dyaHdrBottom);
             }
             if (!m_bBufferSectionBreaks)
                 m_rExport.Strm() << m_aSectionBreaks.makeStringAndClear();
@@ -2814,7 +2839,7 @@ void RtfAttributeOutput::FormatBackground( const SvxBrushItem& rBrush )
 
     if( !rBrush.GetColor().GetTransparency() )
     {
-        m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CHCBPAT);
+        m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CBPAT);
         m_aStyles.append((sal_Int32)m_rExport.GetColor(rBrush.GetColor()));
     }
 }
@@ -3175,9 +3200,23 @@ static OString WriteHex(OString sString)
     return aRet.makeStringAndClear();
 }
 
-static OString ExportPICT(const Size &rOrig, const Size &rRendered, const Size &rMapped,
+void lcl_AppendSP( OStringBuffer& rBuffer,
+    const char cName[], 
+    const ::rtl::OUString& rValue, 
+    const RtfExport& rExport )
+{
+    rBuffer.append( "{" OOO_STRING_SVTOOLS_RTF_SP "{" ); // "{\sp{"
+    rBuffer.append( OOO_STRING_SVTOOLS_RTF_SN " " );//" \sn "
+    rBuffer.append( cName ); //"PropName" 
+    rBuffer.append( "}{" OOO_STRING_SVTOOLS_RTF_SV " " );
+// "}{ \sv " 
+    rBuffer.append( rExport.OutString( rValue, rExport.eCurrentEncoding ) );
+    rBuffer.append( "}}" );
+}
+
+static OString ExportPICT( const SwFlyFrmFmt* pFlyFrmFmt, const Size &rOrig, const Size &rRendered, const Size &rMapped,
     const SwCropGrf &rCr, const char *pBLIPType, const sal_uInt8 *pGraphicAry,
-    unsigned long nSize)
+    unsigned long nSize, const RtfExport& rExport )
 {
     OStringBuffer aRet;
     bool bIsWMF = (const char *)pBLIPType == (const char *)OOO_STRING_SVTOOLS_RTF_WMETAFILE ? true : false;
@@ -3185,6 +3224,18 @@ static OString ExportPICT(const Size &rOrig, const Size &rRendered, const Size &
     {
         aRet.append("{" OOO_STRING_SVTOOLS_RTF_PICT);
 
+        if( pFlyFrmFmt )
+        {
+            String sDescription = pFlyFrmFmt->GetObjDescription();
+            //write picture properties - wzDescription at first
+            //looks like: "{\*\picprop{\sp{\sn PropertyName}{\sv PropertyValue}}}"
+            aRet.append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_PICPROP );//"{\*\picprop
+            lcl_AppendSP( aRet, "wzDescription", sDescription, rExport );
+            String sName = pFlyFrmFmt->GetObjTitle();
+            lcl_AppendSP( aRet, "wzName", sName, rExport );
+            aRet.append( "}" ); //"}"
+        }
+
         long nXCroppedSize = rOrig.Width()-(rCr.GetLeft() + rCr.GetRight());
         long nYCroppedSize = rOrig.Height()-(rCr.GetTop() + rCr.GetBottom());
         /* #127543#: Graphic with a zero height or width, typically copied from webpages, caused
@@ -3277,7 +3328,7 @@ void RtfAttributeOutput::FlyFrameOLEData( SwOLENode& rOLENode )
     }
 }
 
-void RtfAttributeOutput::FlyFrameOLE( SwOLENode& rOLENode, const Size& rSize )
+void RtfAttributeOutput::FlyFrameOLE( const SwFlyFrmFmt* pFlyFrmFmt, SwOLENode& rOLENode, const Size& rSize )
 {
     OSL_TRACE("%s", OSL_THIS_FUNC);
 
@@ -3313,11 +3364,11 @@ void RtfAttributeOutput::FlyFrameOLE( SwOLENode& rOLENode, const Size& rSize )
     nHeight-=nFontHeight/20;
     m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_DN).append(nHeight);
     m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT);
-    m_aRunText.append(ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize));
+    m_aRunText.append(ExportPICT( pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport ));
     m_aRunText.append("}}}}");
 }
 
-void RtfAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size& rSize )
+void RtfAttributeOutput::FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const SwGrfNode& rGrfNode, const Size& rSize )
 {
     OSL_TRACE("%s", OSL_THIS_FUNC);
 
@@ -3390,7 +3441,7 @@ void RtfAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size&
         m_aRunText.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT);
 
     if (pBLIPType)
-        m_aRunText.append(ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize));
+        m_aRunText.append(ExportPICT( pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport));
     else
     {
         aStream.Seek(0);
@@ -3400,7 +3451,7 @@ void RtfAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size&
         nSize = aStream.Tell();
         pGraphicAry = (sal_uInt8*)aStream.GetData();
 
-        m_aRunText.append(ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize));
+        m_aRunText.append(ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport ));
     }
 
     if (!bIsWMF)
@@ -3414,7 +3465,7 @@ void RtfAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size&
         nSize = aStream.Tell();
         pGraphicAry = (sal_uInt8*)aStream.GetData();
 
-        m_aRunText.append(ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize));
+        m_aRunText.append(ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport ));
 
         m_aRunText.append('}');
     }
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx
index 84c50b8..9b3923d 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -45,6 +45,7 @@ class RtfExport;
 class SwGrfNode;
 class SwOLENode;
 class SdrObject;
+class SwFlyFrmFmt;
 
 /// The class that has handlers for various resource types when exporting as RTF
 class RtfAttributeOutput : public AttributeOutputBase
@@ -431,8 +432,8 @@ protected:
 private:
 
     /// Output graphic fly frames.
-    void FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size& rSize );
-    void FlyFrameOLE( SwOLENode& rOLENode, const Size& rSize );
+    void FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const SwGrfNode& rGrfNode, const Size& rSize );
+    void FlyFrameOLE( const SwFlyFrmFmt* pFlyFrmFmt, SwOLENode& rOLENode, const Size& rSize );
     void FlyFrameOLEData( SwOLENode& rOLENode );
 
     /*
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index d18482e..b3c0828 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -348,11 +348,31 @@ void RtfExport::DoComboBox(const rtl::OUString& /*rName*/,
     // this is handled in RtfAttributeOutput::OutputFlyFrame_Impl
 }
 
-void RtfExport::DoFormText(const SwInputField* /*pFld*/)
+void RtfExport::DoFormText(const SwInputField* pFld )
 {
     OSL_TRACE("%s", OSL_THIS_FUNC);
 
-    // this is hanled in RtfAttributeOutput::OutputFlyFrame_Impl
+    ::rtl::OUString sResult = pFld->ExpandField(pDoc->IsClipBoard());
+    ::rtl::OUString sHelp( pFld->GetHelp() );
+    ::rtl::OUString sName = pFld->GetPar2();
+    ::rtl::OUString sStatus = pFld->GetToolTip();
+    m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_FIELD "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FLDINST "{ FORMTEXT }");
+    m_pAttrOutput->RunText().append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FORMFIELD " {" OOO_STRING_SVTOOLS_RTF_FFTYPE "0" );
+    if( sHelp.getLength() )
+        m_pAttrOutput->RunText().append( OOO_STRING_SVTOOLS_RTF_FFOWNHELP );
+    if( sStatus.getLength() )
+        m_pAttrOutput->RunText().append( OOO_STRING_SVTOOLS_RTF_FFOWNSTAT );
+    m_pAttrOutput->RunText().append( OOO_STRING_SVTOOLS_RTF_FFTYPETXT  "0" );
+    
+    if( sName.getLength() )
+        m_pAttrOutput->RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFNAME " ").append( OutString( sName, eDefaultEncoding )).append( "}" );
+    if( sHelp.getLength() )
+        m_pAttrOutput->RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFHELPTEXT " ").append( OutString( sHelp, eDefaultEncoding )).append( "}" );
+    m_pAttrOutput->RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFDEFTEXT " ").append( OutString( sResult, eDefaultEncoding )).append( "}" );
+    if( sStatus.getLength() )
+        m_pAttrOutput->RunText().append( "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFSTATTEXT " ").append( OutString( sStatus, eDefaultEncoding )).append( "}");
+    m_pAttrOutput->RunText().append( "}}}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " " );
+    m_pAttrOutput->RunText().append( OutString( sResult, eDefaultEncoding )).append( "}}" );
 }
 
 ULONG RtfExport::ReplaceCr( BYTE )
@@ -765,6 +785,7 @@ RtfExport::RtfExport( RtfExportFilter *pFilter, SwDoc *pDocument, SwPaM *pCurren
       eCurrentEncoding(eDefaultEncoding),
       bRTFFlySyntax(false)
 {
+    mbExportModeRTF = true;
     // the attribute output for the document
     m_pAttrOutput = new RtfAttributeOutput( *this );
     // that just causes problems for RTF
@@ -915,7 +936,7 @@ OString RtfExport::OutChar(sal_Unicode c, int *pUCMode, rtl_TextEncoding eDestEn
 OString RtfExport::OutString(const String &rStr, rtl_TextEncoding eDestEnc)
 {
     OSL_TRACE("%s, rStr = '%s'", OSL_THIS_FUNC,
-            OUStringToOString( OUString( rStr ), eCurrentEncoding ).getStr());
+            OUStringToOString( OUString( rStr ), eDestEnc ).getStr());
     OStringBuffer aBuf;
     int nUCMode = 1;
     for (xub_StrLen n = 0; n < rStr.Len(); ++n)
@@ -1207,9 +1228,6 @@ void RtfExport::WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader)
 
     OSL_TRACE("%s start", OSL_THIS_FUNC);
 
-    Strm() << (bHeader ? OOO_STRING_SVTOOLS_RTF_HEADERY : OOO_STRING_SVTOOLS_RTF_FOOTERY);
-    OutLong( pAktPageDesc->GetMaster().
-            GetULSpace().GetUpper() );
     const sal_Char* pStr = (bHeader ? OOO_STRING_SVTOOLS_RTF_HEADER : OOO_STRING_SVTOOLS_RTF_FOOTER);
     /* is this a title page? */
     if( pAktPageDesc->GetFollow() && pAktPageDesc->GetFollow() != pAktPageDesc )
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index 2f6bfce..5d5a186 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -82,7 +82,7 @@ public:
     virtual RtfSdrExport& SdrExporter() const;
 
     /// Hack, unfortunately necessary at some places for now.
-    virtual bool HackIsWW8OrHigher() const { return true; }
+    virtual bool HackIsWW8OrHigher() const { return false; }
 
     /// Guess the script (asian/western).
     virtual bool CollapseScriptsforWordOk( USHORT nScript, USHORT nWhich );
@@ -172,9 +172,9 @@ public:
     SvStream& OutLong( long nVal );
     void OutUnicode(const sal_Char *pToken, const String &rContent);
     void OutDateTime(const sal_Char* pStr, const util::DateTime& rDT );
-    rtl::OString OutChar(sal_Unicode c, int *pUCMode, rtl_TextEncoding eDestEnc);
-    rtl::OString OutString(const String &rStr, rtl_TextEncoding eDestEnc);
-    rtl::OString OutHex(ULONG nHex, BYTE nLen);
+    static rtl::OString OutChar(sal_Unicode c, int *pUCMode, rtl_TextEncoding eDestEnc);
+    static rtl::OString OutString(const String &rStr, rtl_TextEncoding eDestEnc);
+    static rtl::OString OutHex(ULONG nHex, BYTE nLen);
     void OutPageDescription( const SwPageDesc& rPgDsc, BOOL bWriteReset, BOOL bCheckForFirstPage );
 
     USHORT GetColor( const Color& rColor ) const;
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index cfe0d26..f2a97c8 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -222,8 +222,9 @@ void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRe
                     m_aShapeProps.insert(std::pair<OString,OString>(OString("fNoFillHitTest"), OString::valueOf(sal_Int32(1))));
                 break;
             case ESCHER_Prop_fNoLineDrawDash:
-                if (it->nPropValue)
-                    m_aShapeProps.insert(std::pair<OString,OString>(OString("fNoLineDrawDash"), OString::valueOf(sal_Int32(1))));
+                // for some reason the value is set to 0x90000 if lines are switched off
+                if( it->nPropValue == 0x90000 )
+                    m_aShapeProps.insert(std::pair<OString,OString>(OString("fLine"), OString::valueOf(sal_Int32(0))));
                 break;
             case ESCHER_Prop_lineColor:
                 m_aShapeProps.insert(std::pair<OString,OString>(OString("lineColor"), OString::valueOf(sal_Int32(it->nPropValue))));
@@ -447,6 +448,13 @@ void RtfSdrExport::AddShapeAttribute( sal_Int32 /*nAttribute*/, const rtl::OStri
 
 extern const char* pShapeTypes[];
 
+void lcl_AppendSP( ::rtl::OStringBuffer& rRunText, const char cName[], const ::rtl::OString& rValue)
+{
+    rRunText.append('{').append(OOO_STRING_SVTOOLS_RTF_SP)
+        .append('{').append(OOO_STRING_SVTOOLS_RTF_SN " ").append(cName).append('}')
+        .append('{').append(OOO_STRING_SVTOOLS_RTF_SV " ").append(rValue).append('}')
+        .append('}');
+}
 sal_Int32 RtfSdrExport::StartShape()
 {
     OSL_TRACE("%s", OSL_THIS_FUNC);
@@ -466,10 +474,10 @@ sal_Int32 RtfSdrExport::StartShape()
     m_rAttrOutput.RunText().append(OOO_STRING_SVTOOLS_RTF_SHPBYIGNORE);
 
     for(std::map<OString,OString>::reverse_iterator i = m_aShapeProps.rbegin(); i != m_aShapeProps.rend(); i++)
-        m_rAttrOutput.RunText().append('{').append(OOO_STRING_SVTOOLS_RTF_SP)
-            .append('{').append(OOO_STRING_SVTOOLS_RTF_SN " ").append((*i).first).append('}')
-            .append('{').append(OOO_STRING_SVTOOLS_RTF_SV " ").append((*i).second).append('}')
-            .append('}');
+        lcl_AppendSP(m_rAttrOutput.RunText(), (*i).first, (*i).second );
+    
+    lcl_AppendSP(m_rAttrOutput.RunText(), "wzDescription", RtfExport::OutString( m_pSdrObject->GetDescription(), m_rExport.eCurrentEncoding));
+    lcl_AppendSP(m_rAttrOutput.RunText(), "wzName", RtfExport::OutString( m_pSdrObject->GetTitle(), m_rExport.eCurrentEncoding));
 
     // now check if we have some text
     const SdrTextObj* pTxtObj = PTR_CAST(SdrTextObj, m_pSdrObject);
diff --git a/sw/source/filter/ww8/rtfsdrexport.hxx b/sw/source/filter/ww8/rtfsdrexport.hxx
index de618d6..b25f519 100644
--- a/sw/source/filter/ww8/rtfsdrexport.hxx
+++ b/sw/source/filter/ww8/rtfsdrexport.hxx
@@ -80,11 +80,13 @@ protected:
     /// Start the shape for which we just collected the information.
     ///
     /// Returns the element's tag number, -1 means we wrote nothing.
+    using EscherEx::StartShape;
     virtual sal_Int32   StartShape();
 
     /// End the shape.
     ///
     /// The parameter is just what we got from StartShape().
+    using EscherEx::EndShape;
     virtual void        EndShape( sal_Int32 nShapeElement );
 
     virtual void        Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
@@ -94,6 +96,7 @@ private:
     virtual void OpenContainer( UINT16 nEscherContainer, int nRecInstance = 0 );
     virtual void CloseContainer();
 
+    using EscherEx::EnterGroup;
     virtual UINT32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 );
     virtual void LeaveGroup();
 
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index 1fbf632..31c1d6b 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -466,9 +466,21 @@ namespace sw
         }
         //SetLayer boilerplate end
 
-        void GetPoolItems(const SfxItemSet &rSet, PoolItems &rItems)
+        void GetPoolItems(const SfxItemSet &rSet, PoolItems &rItems, bool bExportParentItemSet )
         {
-            if (rSet.Count())
+            if( bExportParentItemSet )
+            {
+                USHORT nTotal = rSet.TotalCount();
+                for( USHORT nItem =0; nItem < nTotal; ++nItem )
+                {
+                    const SfxPoolItem* pItem = 0;
+                    if( SFX_ITEM_SET == rSet.GetItemState( rSet.GetWhichByPos( nItem ), true, &pItem ) )
+                    {
+                        rItems[pItem->Which()] = pItem;
+                    }
+                }
+            }
+            else if( rSet.Count())
             {
                 SfxItemIter aIter(rSet);
                 if (const SfxPoolItem *pItem = aIter.GetCurItem())
diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx
index f758092..3cdd0c4 100644
--- a/sw/source/filter/ww8/writerhelper.hxx
+++ b/sw/source/filter/ww8/writerhelper.hxx
@@ -589,7 +589,7 @@ namespace sw
             @author
             <a href="mailto:cmc at openoffice.org">Caol&aacute;n McNamara</a>
         */
-        void GetPoolItems(const SfxItemSet &rSet, PoolItems &rItems);
+        void GetPoolItems(const SfxItemSet &rSet, PoolItems &rItems, bool bExportParentItemSet );
 
         const SfxPoolItem *SearchPoolItems(const PoolItems &rItems,
             sal_uInt16 eType);
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index fb21d28..01bd84f 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -477,7 +477,7 @@ void SwWW8AttrIter::OutAttr( xub_StrLen nSwPos, bool bRuby )
         ClearOverridesFromSet( *pCharFmtItem, aExportSet );
 
     sw::PoolItems aExportItems;
-    GetPoolItems( aExportSet, aExportItems );
+    GetPoolItems( aExportSet, aExportItems, false );
 
     sw::cPoolItemIter aEnd = aRangeItems.end();
     for ( sw::cPoolItemIter aI = aRangeItems.begin(); aI != aEnd; ++aI )
@@ -1601,7 +1601,7 @@ xub_StrLen MSWordExportBase::GetNextPos( SwWW8AttrIter* aAttrIter, const SwTxtNo
     GetSortedBookmarks( rNode, nAktPos, nNextPos - nAktPos );
 
     xub_StrLen nNextBookmark = nNextPos;
-    NearestBookmark( nNextPos );
+    NearestBookmark( nNextPos, nAktPos, false );
 
     return std::min( nNextPos, nNextBookmark );
 }
@@ -1610,8 +1610,9 @@ void MSWordExportBase::UpdatePosition( SwWW8AttrIter* aAttrIter, xub_StrLen nAkt
 {
     xub_StrLen nNextPos;
 
-    // either no bookmark, or it is not at the current position
-    if ( !NearestBookmark( nNextPos ) || nNextPos > nAktPos )
+    // go to next attribute if no bookmark is found of if the bookmark is behind the next attribute position
+    bool bNextBookmark = NearestBookmark( nNextPos, nAktPos, true );
+    if( !bNextBookmark || nNextPos < aAttrIter->WhereNext() )
         aAttrIter->NextPos();
 }
 
@@ -1656,25 +1657,33 @@ public:
     }
 };
 
-bool MSWordExportBase::NearestBookmark( xub_StrLen& rNearest )
+bool MSWordExportBase::NearestBookmark( xub_StrLen& rNearest, const xub_StrLen nAktPos, bool bNextPositionOnly )
 {
     bool bHasBookmark = false;
 
     if ( m_rSortedMarksStart.size( ) > 0 )
     {
         IMark* pMarkStart = m_rSortedMarksStart.front();
-        rNearest = pMarkStart->GetMarkStart().nContent.GetIndex();
-        bHasBookmark = true;
+        xub_StrLen nNext = pMarkStart->GetMarkStart().nContent.GetIndex();
+        if( !bNextPositionOnly || (nNext > nAktPos ))
+        {
+            rNearest = nNext;
+            bHasBookmark = true;
+        }
     }
 
     if ( m_rSortedMarksEnd.size( ) > 0 )
     {
         IMark* pMarkEnd = m_rSortedMarksEnd[0];
-        if ( !bHasBookmark )
-            rNearest = pMarkEnd->GetMarkEnd().nContent.GetIndex();
-        else
-            rNearest = std::min( rNearest, pMarkEnd->GetMarkEnd().nContent.GetIndex() );
-        bHasBookmark = true;
+        xub_StrLen nNext = pMarkEnd->GetMarkEnd().nContent.GetIndex();
+        if( !bNextPositionOnly || nNext > nAktPos )
+        {
+            if ( !bHasBookmark )
+                rNearest = nNext;
+            else
+                rNearest = std::min( rNearest, nNext );
+            bHasBookmark = true;
+        }
     }
 
     return bHasBookmark;
@@ -1696,10 +1705,10 @@ void MSWordExportBase::GetSortedBookmarks( const SwTxtNode& rNode, xub_StrLen nA
             xub_StrLen nStart = pMark->GetMarkStart().nContent.GetIndex();
             xub_StrLen nEnd = pMark->GetMarkEnd().nContent.GetIndex();
 
-            if ( nStart > nAktPos )
+            if ( nStart > nAktPos && ( pMark->GetMarkStart().nNode == rNode.GetIndex()) )
                 aSortedStart.push_back( pMark );
 
-            if ( nEnd > nAktPos )
+            if ( nEnd > nAktPos && nEnd <= ( nAktPos + nLen ) && (pMark->GetMarkEnd().nNode == rNode.GetIndex()) )
                 aSortedEnd.push_back( pMark );
         }
 
@@ -2298,7 +2307,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
             pOutFmtNode = &rNode;
 
             // Pap-Attrs, so script is not necessary
-            OutputItemSet( *pNewSet, true, false, i18n::ScriptType::LATIN);
+            OutputItemSet( *pNewSet, true, false, i18n::ScriptType::LATIN, false);
 
             pStyAttr = 0;
             pOutFmtNode = pOldMod;
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index 5a4cd5a..b430366 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -267,7 +267,7 @@ void WW8AttributeOutput::NumberingLevel( BYTE /*nLevel*/,
             m_rWW8Export.InsUInt16( nFontID );
         }
 
-        m_rWW8Export.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN );
+        m_rWW8Export.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rWW8Export.mbExportModeRTF );
 
         m_rWW8Export.pO = pOldpO;
     }
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index bf7ac8b..ffb8427 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3325,6 +3325,7 @@ MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM
     mnHdFtIndex(0), pAktPageDesc(0), pPapPlc(0), pChpPlc(0), pChpIter(0),
     pStyles( NULL ),
     bHasHdr(false), bHasFtr(false), bSubstituteBullets(true),
+    mbExportModeRTF( false ),
     pDoc( pDocument ),
     pCurPam( pCurrentPam ),
     pOrigPam( pOriginalPam )
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 081609d..59bf582 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -544,6 +544,8 @@ public:
     BYTE bHasHdr : 1;
     BYTE bHasFtr : 1;
     BYTE bSubstituteBullets : 1; // true: SubstituteBullet() gets called
+    
+    bool mbExportModeRTF;
 
     SwDoc *pDoc;
     SwPaM *pCurPam, *pOrigPam;
@@ -594,7 +596,7 @@ public:
     void AppendWordBookmark( const String& rName );
 
     /// Use OutputItem() on an item set according to the parameters.
-    void OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool bChpFmt, USHORT nScript );
+    void OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool bChpFmt, USHORT nScript, bool bExportParentItemSet );
 
     short GetDefaultFrameDirection( ) const;
 
@@ -801,7 +803,7 @@ protected:
     /// Find the nearest bookmark from the current position.
     ///
     /// Returns false when there is no bookmark.
-    bool NearestBookmark( xub_StrLen& rNearest );
+    bool NearestBookmark( xub_StrLen& rNearest, const xub_StrLen nAktPos, bool bNextPositionOnly );
 
     void GetSortedBookmarks( const SwTxtNode& rNd, xub_StrLen nAktPos,
                 xub_StrLen nLen );
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index d8ed387..6aca15e 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -271,20 +271,21 @@ void MSWordExportBase::ExportPoolItemsToCHP( sw::PoolItems &rItems, USHORT nScri
  *      - gebe die Attribute aus; ohne Parents!
  */
 
-void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool bChpFmt, USHORT nScript )
+void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool bChpFmt, USHORT nScript,
+                                      bool bExportParentItemSet )
 {
-    if ( rSet.Count() )
+    if( bExportParentItemSet || rSet.Count() )
     {
         const SfxPoolItem* pItem;
         pISet = &rSet;                  // fuer Doppel-Attribute
 
         // If frame dir is set, but not adjust, then force adjust as well
-        if ( bPapFmt && SFX_ITEM_SET == rSet.GetItemState( RES_FRAMEDIR, false ) )
+        if ( bPapFmt && SFX_ITEM_SET == rSet.GetItemState( RES_FRAMEDIR, bExportParentItemSet ) )
         {
             // No explicit adjust set ?
-            if ( SFX_ITEM_SET != rSet.GetItemState( RES_PARATR_ADJUST, false ) )
+            if ( SFX_ITEM_SET != rSet.GetItemState( RES_PARATR_ADJUST, bExportParentItemSet ) )
             {
-                if ( 0 != ( pItem = rSet.GetItem( RES_PARATR_ADJUST ) ) )
+                if ( 0 != ( pItem = rSet.GetItem( RES_PARATR_ADJUST, bExportParentItemSet ) ) )
                 {
                     // then set the adjust used by the parent format
                     AttrOutput().OutputItem( *pItem );
@@ -292,7 +293,7 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool
             }
         }
 
-        if ( bPapFmt && SFX_ITEM_SET == rSet.GetItemState( RES_PARATR_NUMRULE, false, &pItem ) )
+        if ( bPapFmt && SFX_ITEM_SET == rSet.GetItemState( RES_PARATR_NUMRULE, bExportParentItemSet, &pItem ) )
         {
             AttrOutput().OutputItem( *pItem );
 
@@ -307,7 +308,7 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool
         }
 
         sw::PoolItems aItems;
-        GetPoolItems( rSet, aItems );
+        GetPoolItems( rSet, aItems, bExportParentItemSet );
         if ( bChpFmt )
             ExportPoolItemsToCHP(aItems, nScript);
 
@@ -783,7 +784,7 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF
                     aSet.Put( aLR );
                     CorrectTabStopInSet( aSet, rNFmt.GetAbsLSpace() );
                     OutputItemSet( aSet, bPapFmt, bChpFmt,
-                        i18n::ScriptType::LATIN);
+                        i18n::ScriptType::LATIN, mbExportModeRTF);
                     bCallOutSet = false;
                 }
             }
@@ -801,7 +802,7 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF
                         ItemGet<SvxLRSpaceItem>(aSet, RES_LR_SPACE));
                     aSet.Put( aLR );
                     OutputItemSet( aSet, bPapFmt, bChpFmt,
-                        com::sun::star::i18n::ScriptType::LATIN);
+                        com::sun::star::i18n::ScriptType::LATIN, mbExportModeRTF);
                     bCallOutSet = false;
                 }
                 // <--
@@ -841,7 +842,7 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF
                 bOutFlyFrmAttrs = true;
                 //script doesn't matter if not exporting chp
                 OutputItemSet(aSet, true, false,
-                    i18n::ScriptType::LATIN);
+                    i18n::ScriptType::LATIN, mbExportModeRTF);
                 bOutFlyFrmAttrs = false;
 
                 bCallOutSet = false;
@@ -855,7 +856,7 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF
 
     if( bCallOutSet )
         OutputItemSet( rFmt.GetAttrSet(), bPapFmt, bChpFmt,
-            i18n::ScriptType::LATIN);
+            i18n::ScriptType::LATIN, mbExportModeRTF);
     pOutFmtNode = pOldMod;
 }
 
commit fcfaeb75eff8c18faaf8bc7f0df14ae703d2b2ec
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Mon Nov 29 14:01:33 2010 +0100

    n#636367: Table alignment set to "From Left" when moving the right
    
    When moving the right end of a table, the table alignment came to
    Manual but this caused size weirdness when switching from web to print
    layout. Using the "From left" option for the alignment keeps the size.

diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index f7c7b79..a28dd70 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -983,7 +983,7 @@ void SwTable::SetTabCols( const SwTabCols &rNew, const SwTabCols &rOld,
                 else if(!bLeftDist && rNew.GetRight() + nShRight < rNew.GetRightMax())
                     aOri.SetHoriOrient( text::HoriOrientation::LEFT );
                 else
-                    aOri.SetHoriOrient( text::HoriOrientation::NONE );
+                    aOri.SetHoriOrient( text::HoriOrientation::LEFT_AND_WIDTH );
             }
             pFmt->SetFmtAttr( aOri );
         }
commit 60f8ef2cbe116da6810f83f177f827bf18d69c1a
Author: David Tardon <dtardon at redhat.com>
Date:   Sat Nov 27 16:10:58 2010 +0100

    Resolves: rhbz#657541# avoid null ptr. deref. when iterating through empty itemset

diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 0a2b875..f296171 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -2103,7 +2103,7 @@ struct RemovePresentAttrs
         const SwTxtAttr* const pAutoStyle(i_rAttrSpan.second);
         SfxItemIter aIter(m_rAttrSet);
         const SfxPoolItem* pItem(aIter.GetCurItem());
-        while (true)
+        while (pItem)
         {
             const USHORT nWhich(pItem->Which());
             if (CharFmt::IsItemIncluded(nWhich, pAutoStyle))
@@ -2171,7 +2171,7 @@ lcl_FillWhichIds(const SfxItemSet& i_rAttrSet, std::vector<USHORT>& o_rClearIds)
     o_rClearIds.reserve(i_rAttrSet.Count());
     SfxItemIter aIter(i_rAttrSet);
     const SfxPoolItem* pItem(aIter.GetCurItem());
-    while (true)
+    while (pItem)
     {
         o_rClearIds.push_back(pItem->Which());
 


More information about the Libreoffice-commits mailing list