summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brinkmann <hbrinkm@openoffice.org>2010-05-27 11:57:15 +0200
committerHenning Brinkmann <hbrinkm@openoffice.org>2010-05-27 11:57:15 +0200
commitcbba191cf0fff148935f24d111cb124bd5a5328b (patch)
treeb5547d0a8b6e97cb2fcf32ca1940e84a1b2f0c37
parent1c61ef0b983bb57c7ab72ca5763b0c7a0eca5d44 (diff)
hb33issues01: #b6951450# export table spacing
-rw-r--r--sw/source/filter/ww8/attributeoutputbase.hxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx7
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx38
-rw-r--r--sw/source/filter/ww8/ww8attributeoutput.hxx2
4 files changed, 49 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx
index 51a0d9de4374..9a3885e8b5b3 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -232,6 +232,8 @@ public:
virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) = 0;
+ virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) = 0;
+
virtual void TableRowEnd( sal_uInt32 nDepth ) = 0;
/// Start of the styles table.
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index bb26e670928a..594978e260dc 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1460,6 +1460,13 @@ void DocxAttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_
#endif
}
+void DocxAttributeOutput::TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ )
+{
+#if OSL_DEBUG_LEVEL > 0
+ fprintf( stderr, "TODO: DocxAttributeOutput::TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )\n" );
+#endif
+}
+
void DocxAttributeOutput::TableRowEnd( sal_uInt32 /*nDepth*/ )
{
#if OSL_DEBUG_LEVEL > 0
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 6bf7ecbb8cdf..0e06aac836a2 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -58,10 +58,12 @@
#include <filter/msfilter/msoleexp.hxx>
#include <filter/msfilter/msocximex.hxx>
#include <editeng/lrspitem.hxx>
+#include <editeng/ulspitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/brshitem.hxx>
#include <swtypes.hxx>
#include <swrect.hxx>
+#include <swtblfmt.hxx>
#include <txatbase.hxx>
#include <fmtcntnt.hxx>
#include <fmtpdsc.hxx>
@@ -1910,6 +1912,7 @@ void WW8AttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTa
TableBidi( pTableTextNodeInfoInner );
TableVerticalCell( pTableTextNodeInfoInner );
TableOrientation( pTableTextNodeInfoInner );
+ TableSpacing( pTableTextNodeInfoInner );
}
}
}
@@ -2091,6 +2094,41 @@ void WW8AttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t
}
}
+void WW8AttributeOutput::TableSpacing(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
+{
+ const SwTable * pTable = pTableTextNodeInfoInner->getTable();
+ const SwTableFmt * pTableFmt = dynamic_cast<const SwTableFmt *>(pTable->GetRegisteredIn());
+
+ if (pTableFmt != NULL)
+ {
+ const SvxULSpaceItem & rUL = pTableFmt->GetULSpace();
+
+ if (rUL.GetUpper() > 0)
+ {
+ sal_uInt8 nPadding = 2;
+ sal_uInt8 nPcVert = 0;
+ sal_uInt8 nPcHorz = 0;
+
+ sal_uInt8 nTPc = (nPadding << 4) | (nPcVert << 2) | nPcHorz;
+
+ m_rWW8Export.InsUInt16(NS_sprm::LN_TPc);
+ m_rWW8Export.pO->Insert( nTPc, m_rWW8Export.pO->Count() );
+
+ m_rWW8Export.InsUInt16(NS_sprm::LN_TDyaAbs);
+ m_rWW8Export.InsUInt16(rUL.GetUpper());
+
+ m_rWW8Export.InsUInt16(NS_sprm::LN_TDyaFromText);
+ m_rWW8Export.InsUInt16(rUL.GetUpper());
+ }
+
+ if (rUL.GetLower() > 0)
+ {
+ m_rWW8Export.InsUInt16(NS_sprm::LN_TDyaFromTextBottom);
+ m_rWW8Export.InsUInt16(rUL.GetLower());
+ }
+ }
+}
+
void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
{
const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx
index b9d9038b484b..b9d9ba38c246 100644
--- a/sw/source/filter/ww8/ww8attributeoutput.hxx
+++ b/sw/source/filter/ww8/ww8attributeoutput.hxx
@@ -124,6 +124,8 @@ public:
virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+ virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
virtual void TableRowEnd( sal_uInt32 nDepth = 1 );
/// Start of the styles table.