summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedricbosdo@openoffice.org>2010-10-05 21:12:28 +0200
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2010-10-05 21:14:23 +0200
commitbc7fe38f78ea43d5606e69fb4bab9828cc7753f8 (patch)
tree65ac3c046eb9cbf5113c9293a87546cd28965eed
parent0f85353addf5fa26ede1dfa00eae4243a9cd4812 (diff)
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().
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index ae0275f943..50bf4f369a 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++ )
{