[ooo-build-commit] .: sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Tue Oct 5 12:14:34 PDT 2010


 sw/source/filter/ww8/rtfattributeoutput.cxx |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

New commits:
commit bc7fe38f78ea43d5606e69fb4bab9828cc7753f8
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Tue Oct 5 21:12:28 2010 +0200

    fdo #30604: Fixed the RTF tables export in copy/paste
    
    In the copy/paste the RTF document to export isn't rendered as it's a
    fake document. The width has to be extracted differently.
    
    Beware SwTableBox->GetFrmFmt() isn't the same as SwTable->GetFrmFmt().

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index ae0275f..50bf4f3 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -563,8 +563,8 @@ void RtfAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
     if ( !m_pTableWrt )
         InitTableHelper( pTableTextNodeInfoInner );
 
-    const SwTableBox *pTblBox = pTableTextNodeInfoInner->getTableBox( );
-    SwFrmFmt *pFmt = pTblBox->GetFrmFmt( );
+    const SwTable *pTbl = pTableTextNodeInfoInner->getTable();
+    SwFrmFmt *pFmt = pTbl->GetFrmFmt( );
 
     m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_TROWD);
     TableOrientation( pTableTextNodeInfoInner );
@@ -604,6 +604,19 @@ void RtfAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
     Point aPt;
     SwRect aRect( pFmt->FindLayoutRect( false, &aPt ));
     SwTwips nPageSize = aRect.Width();
+
+    // Handle the page size when not rendered
+    if( 0 == nPageSize )
+    {
+        const SwNode* pNode = pTableTextNodeInfoInner->getNode();
+        const SwFrmFmt* pFrmFmt = GetExport().mpParentFrame ? &GetExport().mpParentFrame->GetFrmFmt() :
+            const_cast<const SwDoc *>(GetExport().pDoc)
+               ->GetPageDesc(0).GetPageFmtOfNode(*pNode, false);
+
+        const SvxLRSpaceItem& rLR = pFrmFmt->GetLRSpace();
+        nPageSize = pFrmFmt->GetFrmSize().GetWidth() -
+                        rLR.GetLeft() - rLR.GetRight();
+    }
     SwTwips nTblSz = pFmt->GetFrmSize().GetWidth();
     for( USHORT i = 0; i < pRow->GetCells().Count(); i++ )
     {


More information about the ooo-build-commit mailing list