[Libreoffice-commits] .: Branch 'libreoffice-3-3' - 2 commits - sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Fri Dec 3 02:13:55 PST 2010


 sw/source/filter/ww8/rtfexport.cxx |   25 ++++++++++++++++++-------
 sw/source/filter/ww8/rtfexport.hxx |    7 ++++++-
 sw/source/filter/ww8/wrtww8.hxx    |    2 +-
 sw/source/ui/uiview/view2.cxx      |   12 +++++++++++-
 4 files changed, 36 insertions(+), 10 deletions(-)

New commits:
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 );


More information about the Libreoffice-commits mailing list