summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-03-05 11:28:02 +0000
committerOliver Bolte <obo@openoffice.org>2009-03-05 11:28:02 +0000
commit0867a19ab0f7afad7de7c7313115c3e20f0fe0a6 (patch)
tree4b91c7954c60df55d91bfe4ba1f5023653e08427 /sw
parenta721bf635ab4f5849a94bd46ea397330f3838951 (diff)
CWS-TOOLING: integrate CWS hb19_DEV300
2009-02-24 12:55:47 +0100 hbrinkm r268394 : #i99451# OutWW8TableDefinition: initalize nSz with nTblOffset 2009-02-23 15:25:36 +0100 od r268360 : #i99384# method <SwTxtFormatter::NewTabPortion(..)> - correct handling of automatic tab stop at left margin 2009-02-18 15:05:24 +0100 hbrinkm r268226 : #i99024# transfered changes from hb17 to hb19 2009-02-18 14:50:05 +0100 hbrinkm r268223 : #ii98553# transfered changes from hb17 to hb19 2009-02-18 14:35:37 +0100 hbrinkm r268220 : #i98465# transfered changes from hb17 to hb19 2009-02-18 14:32:49 +0100 hbrinkm r268219 : #i98585# transfered changes from hb17 to hb19
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/dbgoutsw.hxx42
-rw-r--r--sw/source/core/text/txttab.cxx26
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.cxx343
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.hxx87
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx64
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx206
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx23
7 files changed, 583 insertions, 208 deletions
diff --git a/sw/inc/dbgoutsw.hxx b/sw/inc/dbgoutsw.hxx
index db87d87f03..7e4fa39a4d 100644
--- a/sw/inc/dbgoutsw.hxx
+++ b/sw/inc/dbgoutsw.hxx
@@ -66,28 +66,28 @@ class SwTxtFmtColl;
extern bool bDbgOutStdErr;
extern bool bDbgOutPrintAttrSet;
-const char * dbg_out(const void * pVoid);
-const char * dbg_out(const String & aStr);
-const char * dbg_out(const SwRect & rRect);
-const char * dbg_out(const SwFrmFmt & rFrmFmt);
-const char * dbg_out(const SwNode & rNode);
-const char * dbg_out(const SwTxtAttr & rAttr);
-const char * dbg_out(const SwpHints &rHints);
-const char * dbg_out(const SfxPoolItem & rItem);
-const char * dbg_out(const SfxPoolItem * pItem);
-const char * dbg_out(const SfxItemSet & rSet);
-const char * dbg_out(SwNodes & rNodes);
+SW_DLLPUBLIC const char * dbg_out(const void * pVoid);
+SW_DLLPUBLIC const char * dbg_out(const String & aStr);
+SW_DLLPUBLIC const char * dbg_out(const SwRect & rRect);
+SW_DLLPUBLIC const char * dbg_out(const SwFrmFmt & rFrmFmt);
+SW_DLLPUBLIC const char * dbg_out(const SwNode & rNode);
+SW_DLLPUBLIC const char * dbg_out(const SwTxtAttr & rAttr);
+SW_DLLPUBLIC const char * dbg_out(const SwpHints &rHints);
+SW_DLLPUBLIC const char * dbg_out(const SfxPoolItem & rItem);
+SW_DLLPUBLIC const char * dbg_out(const SfxPoolItem * pItem);
+SW_DLLPUBLIC const char * dbg_out(const SfxItemSet & rSet);
+SW_DLLPUBLIC const char * dbg_out(SwNodes & rNodes);
// const char * dbg_out(SwOutlineNodes & rNodes);
-const char * dbg_out(const SwPosition & rPos);
-const char * dbg_out(const SwPaM & rPam);
-const char * dbg_out(const SwNodeNum & rNum);
-const char * dbg_out(const SwUndo & rUndo);
-const char * dbg_out(const SwUndos & rUndos);
-const char * dbg_out(const SwRewriter & rRewriter);
-const char * dbg_out(const SwNumRule & rRule);
-const char * dbg_out(const SwTxtFmtColl & rFmt);
-const char * dbg_out(const SwFrmFmts & rFrmFmts);
-const char * dbg_out(const SwNumRuleTbl & rTbl);
+SW_DLLPUBLIC const char * dbg_out(const SwPosition & rPos);
+SW_DLLPUBLIC const char * dbg_out(const SwPaM & rPam);
+SW_DLLPUBLIC const char * dbg_out(const SwNodeNum & rNum);
+SW_DLLPUBLIC const char * dbg_out(const SwUndo & rUndo);
+SW_DLLPUBLIC const char * dbg_out(const SwUndos & rUndos);
+SW_DLLPUBLIC const char * dbg_out(const SwRewriter & rRewriter);
+SW_DLLPUBLIC const char * dbg_out(const SwNumRule & rRule);
+SW_DLLPUBLIC const char * dbg_out(const SwTxtFmtColl & rFmt);
+SW_DLLPUBLIC const char * dbg_out(const SwFrmFmts & rFrmFmts);
+SW_DLLPUBLIC const char * dbg_out(const SwNumRuleTbl & rTbl);
template<typename tKey, typename tMember, typename fHashFunction>
String lcl_dbg_out(const std::hash_map<tKey, tMember, fHashFunction> & rMap)
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index f335b671e1..dfa6aaae09 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -235,24 +235,16 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
}
// <--
- // --> OD 2008-02-07 #newlistlevelattrs#
- // In case that the proposed new tab stop position is the list tab stop
- // position, do not force a tab stop at left margin.
-// if( nNextPos > 0 &&
-// ( bRTL && nTabLeft - nForced < nCurrentAbsPos ||
-// !bRTL && nTabLeft + nForced > nCurrentAbsPos ) )
- // --> OD 2008-06-05 #i89181#
- // Now the application of a tab stop at the left margin in case a list
- // tab stop is processed depends on compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST.
-// const bool bIsListTabStopPosition( pTabStop &&
-// aLineInf.IsListTabStopIncluded() &&
-// nNextPos == aLineInf.GetListTabStopPosition() );
-// if ( !bIsListTabStopPosition &&
+ // --> OD 2009-02-23 #i99384#
+ // correction of condition, when a tab stop at the left margin can
+ // be applied:
+ // If the paragraph is not inside a list having a list tab stop following
+ // the list label or no further tab stop found in such a paragraph,
+ // a tab stop at the left margin can be applied. If this condition is
+ // not hold, it is overruled by compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST.
const bool bTabAtLeftMargin =
- // it is not the list tab stop:
- ( !pTabStop ||
- !aLineInf.IsListTabStopIncluded() ||
- nNextPos != aLineInf.GetListTabStopPosition() ) &&
+ ( !aLineInf.IsListTabStopIncluded() ||
+ !pTabStop ) ||
// compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
pFrm->GetTxtNode()->getIDocumentSettingAccess()->
get(IDocumentSettingAccess::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST);
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx
index 6c777eae1d..fdab27e362 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -41,13 +41,126 @@
namespace ww8
{
+
+// WW8TableNodeInfoInner
+
+WW8TableNodeInfoInner::WW8TableNodeInfoInner(WW8TableNodeInfo * pParent)
+: mpParent(pParent)
+, mnCell(0)
+, mnRow(0)
+, mbEndOfLine(false)
+, mbEndOfCell(false)
+, mpTableBox(NULL)
+, mpTable(NULL)
+{
+}
+
+WW8TableNodeInfoInner::~WW8TableNodeInfoInner()
+{
+}
+
+void WW8TableNodeInfoInner::setDepth(sal_uInt32 nDepth)
+{
+ mnDepth = nDepth;
+}
+
+void WW8TableNodeInfoInner::setCell(sal_uInt32 nCell)
+{
+ mnCell = nCell;
+}
+
+void WW8TableNodeInfoInner::setRow(sal_uInt32 nRow)
+{
+ mnRow = nRow;
+}
+
+void WW8TableNodeInfoInner::setEndOfLine(bool bEndOfLine)
+{
+ mbEndOfLine = bEndOfLine;
+}
+
+void WW8TableNodeInfoInner::setEndOfCell(bool bEndOfCell)
+{
+ mbEndOfCell = bEndOfCell;
+}
+
+void WW8TableNodeInfoInner::setTableBox(const SwTableBox * pTableBox)
+{
+ mpTableBox = pTableBox;
+}
+
+void WW8TableNodeInfoInner::setTable(const SwTable * pTable)
+{
+ mpTable = pTable;
+}
+
+sal_uInt32 WW8TableNodeInfoInner::getDepth() const
+{
+ return mnDepth;
+}
+
+sal_uInt32 WW8TableNodeInfoInner::getCell() const
+{
+ return mnCell;
+}
+
+sal_uInt32 WW8TableNodeInfoInner::getRow() const
+{
+ return mnRow;
+}
+
+bool WW8TableNodeInfoInner::isEndOfCell() const
+{
+ return mbEndOfCell;
+}
+
+bool WW8TableNodeInfoInner::isEndOfLine() const
+{
+ return mbEndOfLine;
+}
+
+const SwNode * WW8TableNodeInfoInner::getNode() const
+{
+ const SwNode * pResult = NULL;
+
+ if (mpParent != NULL)
+ pResult = mpParent->getNode();
+
+ return pResult;
+}
+
+const SwTableBox * WW8TableNodeInfoInner::getTableBox() const
+{
+ return mpTableBox;
+}
+
+const SwTable * WW8TableNodeInfoInner::getTable() const
+{
+ return mpTable;
+}
+
+string WW8TableNodeInfoInner::toString() const
+{
+ static char buffer[256];
+ snprintf(buffer, sizeof(buffer),
+ "<tableinner depth=\"%" SAL_PRIxUINT32 "\""
+ " cell=\"%" SAL_PRIxUINT32 "\""
+ " row=\"%" SAL_PRIxUINT32 "\""
+ " endOfCell=\"%s\""
+ " endOfLine=\"%s\"/>",
+ mnDepth, mnCell, mnRow,
+ mbEndOfCell ? "yes" : "no",
+ mbEndOfLine ? "yes" : "no");
+
+ return string(buffer);
+}
+
// WW8TableTextNodeInfo
-WW8TableNodeInfo::WW8TableNodeInfo(const SwNode * pNode,
- const SwTableBox * pTableBox,
- const SwTable * pTable)
- :mnDepth(0), mbEndOfLine(false), mbEndOfCell(false),
- mpNode(pNode), mpTableBox(pTableBox), mpTable(pTable)
+WW8TableNodeInfo::WW8TableNodeInfo(const SwNode * pNode)
+:
+ mnDepth(0),
+ mpNode(pNode)
{
}
@@ -57,19 +170,28 @@ WW8TableNodeInfo::~WW8TableNodeInfo()
::std::string WW8TableNodeInfo::toString() const
{
- ::std::string sResult = "<tableNodeInfo depth=\"";
- static char buffer[256];
- snprintf(buffer, sizeof(buffer), "%" SAL_PRIxUINT32, mnDepth);
- sResult += buffer;
- sResult += "\" endOfLine=\"";
- sResult += mbEndOfLine ? "yes" : "no";
- sResult += "\" endOfCell=\"";
- sResult += mbEndOfCell ? "yes" : "no";
- sResult += "\">";
+ static char buffer[1024];
+ snprintf(buffer, sizeof(buffer),
+ "<tableNodeInfo depth=\"%" SAL_PRIxUINT32 "\">"
+ , getDepth());
+
+ ::std::string sResult(buffer);
+
+ Inners_t::const_iterator aIt(mInners.begin());
+ Inners_t::const_iterator aEnd(mInners.end());
+ while (aIt != aEnd)
+ {
+ WW8TableNodeInfoInner::Pointer_t pInner = aIt->second;
+ sResult += pInner->toString();
+
+ aIt++;
+ }
+
#ifdef DEBUG
sResult += dbg_out(*mpNode);
#endif
+
sResult +="</tableNodeInfo>";
return sResult;
@@ -78,40 +200,62 @@ WW8TableNodeInfo::~WW8TableNodeInfo()
void WW8TableNodeInfo::setDepth(sal_uInt32 nDepth)
{
mnDepth = nDepth;
+
+ Inners_t::iterator aIt = mInners.find(mnDepth);
+
+ if (aIt == mInners.end())
+ mInners[mnDepth] = WW8TableNodeInfoInner::Pointer_t(new WW8TableNodeInfoInner(this));
+
+ mInners[mnDepth]->setDepth(mnDepth);
}
void WW8TableNodeInfo::setEndOfLine(bool bEndOfLine)
{
- mbEndOfLine = bEndOfLine;
+ WW8TableNodeInfoInner::Pointer_t pInner = getInnerForDepth(mnDepth);
+ pInner->setEndOfLine(bEndOfLine);
+
+#ifdef DEBUG
+ ::std::clog << "<endOfLine depth=\"" << mnDepth << "\">"
+ << toString() << "</endOfLine>" << ::std::endl;
+#endif
}
void WW8TableNodeInfo::setEndOfCell(bool bEndOfCell)
{
- mbEndOfCell = bEndOfCell;
+ WW8TableNodeInfoInner::Pointer_t pInner = getInnerForDepth(mnDepth);
+ pInner->setEndOfCell(bEndOfCell);
+
+#ifdef DEBUG
+ ::std::clog << "<endOfCell depth=\"" << mnDepth << "\">"
+ << toString() << "</endOfCell>" << ::std::endl;
+#endif
}
void WW8TableNodeInfo::setTableBox(const SwTableBox * pTableBox)
{
- mpTableBox = pTableBox;
+ getInnerForDepth(mnDepth)->setTableBox(pTableBox);
}
void WW8TableNodeInfo::setTable(const SwTable * pTable)
{
- mpTable = pTable;
+ getInnerForDepth(mnDepth)->setTable(pTable);
}
void WW8TableNodeInfo::setCell(sal_uInt32 nCell)
{
- mnCell = nCell;
+ getInnerForDepth(mnDepth)->setCell(nCell);
}
void WW8TableNodeInfo::setRow(sal_uInt32 nRow)
{
- mnRow = nRow;
+ getInnerForDepth(mnDepth)->setRow(nRow);
}
sal_uInt32 WW8TableNodeInfo::getDepth() const
{
+ if (mInners.size() > 0)
+ return mInners.begin()->second->getDepth();
+
return mnDepth;
}
@@ -122,34 +266,61 @@ const SwNode * WW8TableNodeInfo::getNode() const
const SwTableBox * WW8TableNodeInfo::getTableBox() const
{
- return mpTableBox;
+ return getInnerForDepth(mnDepth)->getTableBox();
}
const SwTable * WW8TableNodeInfo::getTable() const
{
- return mpTable;
+ return getInnerForDepth(mnDepth)->getTable();
}
bool WW8TableNodeInfo::isEndOfLine() const
{
- return mbEndOfLine;
+ return getInnerForDepth(mnDepth)->isEndOfLine();
}
bool WW8TableNodeInfo::isEndOfCell() const
{
- return mbEndOfCell;
+ return getInnerForDepth(mnDepth)->isEndOfCell();
}
sal_uInt32 WW8TableNodeInfo::getCell() const
{
- return mnCell;
+ return getInnerForDepth(mnDepth)->getCell();
}
sal_uInt32 WW8TableNodeInfo::getRow() const
{
- return mnRow;
+ return getInnerForDepth(mnDepth)->getRow();
+}
+
+const ww8::WW8TableNodeInfo::Inners_t & WW8TableNodeInfo::getInners() const
+{
+ return mInners;
+}
+
+const WW8TableNodeInfoInner::Pointer_t WW8TableNodeInfo::getFirstInner() const
+{
+ WW8TableNodeInfoInner::Pointer_t pResult;
+
+ if (mInners.size() > 0)
+ pResult = mInners.begin()->second;
+
+ return pResult;
}
+
+const WW8TableNodeInfoInner::Pointer_t WW8TableNodeInfo::getInnerForDepth(sal_uInt32 nDepth) const
+{
+ WW8TableNodeInfoInner::Pointer_t pResult;
+ Inners_t::const_iterator aIt = mInners.find(nDepth);
+ if (aIt != mInners.end())
+ {
+ pResult = aIt->second;
+ }
+
+ return pResult;
+}
// WW8TableInfo
@@ -181,10 +352,11 @@ void WW8TableInfo::processSwTable(const SwTable * pTable)
#endif
}
-void WW8TableInfo::processTableLine(const SwTable * pTable,
- const SwTableLine * pTableLine,
- sal_uInt32 nRow,
- sal_uInt32 nDepth)
+void
+WW8TableInfo::processTableLine(const SwTable * pTable,
+ const SwTableLine * pTableLine,
+ sal_uInt32 nRow,
+ sal_uInt32 nDepth)
{
#ifdef DEBUG
::std::clog << "<processTableLine row=\"" << nRow << "\" depth=\""
@@ -199,23 +371,77 @@ void WW8TableInfo::processTableLine(const SwTable * pTable,
{
const SwTableBox * pBox = rBoxes[n];
- pTextNodeInfo = processTableBox(pTable, pBox, nRow, n, nDepth);
+ processTableBox(pTable, pBox, nRow, n, nDepth, n == rBoxes.Count() - 1);
}
- if (pTextNodeInfo.get() != NULL)
- pTextNodeInfo->setEndOfLine(true);
-
#ifdef DEBUG
::std::clog << "</processTableLine>" << ::std::endl;
#endif
}
-WW8TableNodeInfo::Pointer_t
+WW8TableNodeInfo::Pointer_t
+WW8TableInfo::processTableBoxLines(const SwTableBox * pBox,
+ const SwTable * pTable,
+ const SwTableBox * pBoxToSet,
+ sal_uInt32 nRow,
+ sal_uInt32 nCell,
+ sal_uInt32 nDepth)
+{
+#ifdef DEBUG
+ ::std::clog << "<processTableBoxLines depth=\"" << nDepth
+ << "\" row=\"" << nRow << "\" cell=\"" << nCell << "\">" << ::std::endl;
+#endif
+
+ const SwTableLines & rLines = pBox->GetTabLines();
+ WW8TableNodeInfo::Pointer_t pNodeInfo;
+
+ if (rLines.Count() > 0)
+ {
+ for (sal_uInt32 n = 0; n < rLines.Count(); n++)
+ {
+ const SwTableLine * pLine = rLines[n];
+ const SwTableBoxes & rBoxes = pLine->GetTabBoxes();
+
+ for (USHORT nBox = 0; nBox < rBoxes.Count(); nBox++)
+ pNodeInfo = processTableBoxLines(rBoxes[nBox], pTable, pBoxToSet, nRow, nCell, nDepth);
+ }
+ }
+ else
+ {
+ const SwStartNode * pSttNd = pBox->GetSttNd();
+ const SwEndNode * pEndNd = pSttNd->EndOfSectionNode();
+ SwPaM aPaM(*pSttNd, 0);
+ SwPaM aEndPaM(*pEndNd, 0);
+
+ bool bDone = false;
+ while (!bDone)
+ {
+ SwNode & rNode = aPaM.GetPoint()->nNode.GetNode();
+
+ pNodeInfo = insertTableNodeInfo(&rNode, pTable, pBoxToSet, nRow, nCell, nDepth);
+
+ if (aPaM.GetPoint()->nNode == aEndPaM.GetPoint()->nNode)
+ bDone = true;
+ else
+ aPaM.GetPoint()->nNode++;
+ }
+ }
+
+#ifdef DEBUG
+ ::std::clog << "</processTableBoxLines>" << ::std::endl;
+#endif
+
+ return pNodeInfo;
+}
+
+
+void
WW8TableInfo::processTableBox(const SwTable * pTable,
const SwTableBox * pBox,
sal_uInt32 nRow,
sal_uInt32 nCell,
- sal_uInt32 nDepth)
+ sal_uInt32 nDepth,
+ bool bEndOfLine)
{
#ifdef DEBUG
::std::clog << "<processTableBox row=\"" << nRow << "\" cell=\"" << nCell
@@ -224,21 +450,25 @@ WW8TableInfo::processTableBox(const SwTable * pTable,
WW8TableNodeInfo::Pointer_t pNodeInfo;
const SwTableLines & rLines = pBox->GetTabLines();
+ const SwStartNode * pSttNd = pBox->GetSttNd();
WW8TableNodeInfo::Pointer_t pEndOfCellInfo;
if (rLines.Count() > 0)
- {
-
+ {
+ pNodeInfo = processTableBoxLines(pBox, pTable, pBox, nRow, nCell, nDepth);
+ pNodeInfo->setEndOfCell(true);
+ if (bEndOfLine)
+ pNodeInfo->setEndOfLine(true);
+
for (sal_uInt32 n = 0; n < rLines.Count(); n++)
{
const SwTableLine * pLine = rLines[n];
-
- processTableLine(pTable, pLine, n, nDepth + 1);
+
+ processTableLine(pTable, pLine, n, 1);
}
}
else
{
- const SwStartNode * pSttNd = pBox->GetSttNd();
SwPaM aPaM(*pSttNd, 0);
bool bDone = false;
@@ -265,10 +495,10 @@ WW8TableInfo::processTableBox(const SwTable * pTable,
{
nDepthInsideCell--;
- if (nDepthInsideCell == 1 && pEndOfCellInfo.get() == NULL)
+ if (nDepthInsideCell == 0 && pEndOfCellInfo.get() == NULL)
pEndOfCellInfo = pNodeInfo;
- SwEndNode * pEndNode = dynamic_cast<SwEndNode *> (&rNode);
+ SwEndNode * pEndNode = rNode.GetEndNode( );
SwStartNode * pTmpSttNd = pEndNode->StartOfSectionNode();
if (pTmpSttNd == pSttNd)
bDone = true;
@@ -277,15 +507,19 @@ WW8TableInfo::processTableBox(const SwTable * pTable,
aPaM.GetPoint()->nNode++;
}
while (!bDone);
-
+
if (pEndOfCellInfo.get() != NULL)
- pEndOfCellInfo->setEndOfCell(true);
- }
+ {
+ pEndOfCellInfo->setEndOfCell(true);
+
+ if (bEndOfLine)
+ pEndOfCellInfo->setEndOfLine(true);
+ }
+ }
+
#ifdef DEBUG
::std::clog << "</processTableBox>" << ::std::endl;
#endif
-
- return pEndOfCellInfo;
}
WW8TableNodeInfo::Pointer_t WW8TableInfo::insertTableNodeInfo
@@ -301,16 +535,15 @@ WW8TableNodeInfo::Pointer_t WW8TableInfo::insertTableNodeInfo
if (pNodeInfo.get() == NULL)
{
pNodeInfo = WW8TableNodeInfo::Pointer_t
- (new WW8TableNodeInfo(pNode, pTableBox, pTable));
+ (new WW8TableNodeInfo(pNode));
mMap.insert(Map_t::value_type(pNode, pNodeInfo));
}
- else
- {
- pNodeInfo->setTable(pTable);
- pNodeInfo->setTableBox(pTableBox);
- }
-
+
pNodeInfo->setDepth(nDepth + pNodeInfo->getDepth());
+
+ pNodeInfo->setTable(pTable);
+ pNodeInfo->setTableBox(pTableBox);
+
pNodeInfo->setCell(nCell);
pNodeInfo->setRow(nRow);
diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx
index b361ef4611..4c5b675e8d 100644
--- a/sw/source/filter/ww8/WW8TableInfo.hxx
+++ b/sw/source/filter/ww8/WW8TableInfo.hxx
@@ -32,6 +32,8 @@
#define WW8_TABLE_INFO_HXX
#include <hash_map>
#include <string>
+#include <map>
+#include <functional>
#include <boost/shared_ptr.hpp>
#include <sal/types.h>
@@ -44,24 +46,61 @@ class SwWW8Writer;
namespace ww8
{
using namespace ::std;
-
-class WW8TableNodeInfo
+
+class WW8TableNodeInfo;
+
+class WW8TableNodeInfoInner
{
+ WW8TableNodeInfo * mpParent;
sal_uInt32 mnDepth;
sal_uInt32 mnCell;
sal_uInt32 mnRow;
bool mbEndOfLine;
bool mbEndOfCell;
- const SwNode * mpNode;
const SwTableBox * mpTableBox;
- const SwTable * mpTable;
+ const SwTable * mpTable;
+
+public:
+ typedef boost::shared_ptr<WW8TableNodeInfoInner> Pointer_t;
+
+ WW8TableNodeInfoInner(WW8TableNodeInfo * pParent);
+ ~WW8TableNodeInfoInner();
+
+ void setDepth(sal_uInt32 nDepth);
+ void setCell(sal_uInt32 nCell);
+ void setRow(sal_uInt32 nRow);
+ void setEndOfLine(bool bEndOfLine);
+ void setEndOfCell(bool bEndOfCell);
+ void setTableBox(const SwTableBox * pTableBox);
+ void setTable(const SwTable * pTable);
+
+ sal_uInt32 getDepth() const;
+ sal_uInt32 getCell() const;
+ sal_uInt32 getRow() const;
+ bool isEndOfCell() const;
+ bool isEndOfLine() const;
+ const SwTableBox * getTableBox() const;
+ const SwTable * getTable() const;
+
+ const SwNode * getNode() const;
+
+ string toString() const;
+};
+
+class WW8TableNodeInfo
+{
+public:
+ typedef map<sal_uInt32, WW8TableNodeInfoInner::Pointer_t, greater<sal_uInt32> > Inners_t;
+
+private:
+ sal_uInt32 mnDepth;
+ const SwNode * mpNode;
+ Inners_t mInners;
- public:
+public:
typedef boost::shared_ptr<WW8TableNodeInfo> Pointer_t;
- WW8TableNodeInfo(const SwNode * pTxtNode,
- const SwTableBox * pTableBox,
- const SwTable * pTable);
+ WW8TableNodeInfo(const SwNode * pTxtNode);
virtual ~WW8TableNodeInfo();
void setDepth(sal_uInt32 nDepth);
@@ -73,11 +112,16 @@ class WW8TableNodeInfo
void setRow(sal_uInt32 nRow);
sal_uInt32 getDepth() const;
+ bool isEndOfLine() const;
+ bool isEndOfCell() const;
const SwNode * getNode() const;
const SwTableBox * getTableBox() const;
const SwTable * getTable() const;
- bool isEndOfLine() const;
- bool isEndOfCell() const;
+
+ const Inners_t & getInners() const;
+ const WW8TableNodeInfoInner::Pointer_t getFirstInner() const;
+ const WW8TableNodeInfoInner::Pointer_t getInnerForDepth(sal_uInt32 nDepth) const;
+
sal_uInt32 getCell() const;
sal_uInt32 getRow() const;
@@ -95,18 +139,27 @@ class WW8TableInfo
typedef hash_map<const SwNode *, WW8TableNodeInfo::Pointer_t, hashNode > Map_t;
Map_t mMap;
- void processTableLine(const SwTable * pTable,
- const SwTableLine * pTableLine,
- sal_uInt32 nRow,
- sal_uInt32 nDepth);
+ void
+ processTableLine(const SwTable * pTable,
+ const SwTableLine * pTableLine,
+ sal_uInt32 nRow,
+ sal_uInt32 nDepth);
- WW8TableNodeInfo::Pointer_t
+ void
processTableBox(const SwTable * pTable,
const SwTableBox * pTableBox,
sal_uInt32 nRow,
sal_uInt32 nCell,
- sal_uInt32 nDepth);
-
+ sal_uInt32 nDepth, bool bEndOfLine);
+
+ WW8TableNodeInfo::Pointer_t
+ processTableBoxLines(const SwTableBox * pBox,
+ const SwTable * pTable,
+ const SwTableBox * pBoxToSet,
+ sal_uInt32 nRow,
+ sal_uInt32 nCell,
+ sal_uInt32 nDepth);
+
WW8TableNodeInfo::Pointer_t
insertTableNodeInfo(const SwNode * pNode,
const SwTable * pTable,
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 83e38178f3..fc15a62c45 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1513,9 +1513,12 @@ Writer& OutWW8_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
String aStr( pNd->GetTxt() );
- ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo =
- rWW8Wrt.mpTableInfo->getTableNodeInfo(pNd);
-
+ ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo(rWW8Wrt.mpTableInfo->getTableNodeInfo(pNd));
+ ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner;
+
+ if (pTextNodeInfo.get() != NULL)
+ pTextNodeInfoInner = pTextNodeInfo->getFirstInner();
+
xub_StrLen nAktPos = 0;
xub_StrLen nEnd = aStr.Len();
bool bUnicode = rWW8Wrt.bWrtWW8, bRedlineAtEnd = false;
@@ -1647,7 +1650,7 @@ Writer& OutWW8_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
}
}
- rWW8Wrt.WriteCR(pTextNodeInfo);
+ rWW8Wrt.WriteCR(pTextNodeInfoInner);
if (pTextNodeInfo.get() != NULL)
{
@@ -1655,7 +1658,7 @@ Writer& OutWW8_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
::std::clog << pTextNodeInfo->toString() << ::std::endl;
#endif
- rWW8Wrt.OutWW8TableInfoCell(pTextNodeInfo);
+ rWW8Wrt.OutWW8TableInfoCell(pTextNodeInfoInner);
}
rWW8Wrt.pPapPlc->AppendFkpEntry( rWrt.Strm().Tell(), pO->Count(),
@@ -1722,7 +1725,7 @@ Writer& OutWW8_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
rWW8Wrt.pop_charpropstart();
rWW8Wrt.EndTOX(*pTOXSect);
}
- rWW8Wrt.WriteCR(pTextNodeInfo); // CR danach
+ rWW8Wrt.WriteCR(pTextNodeInfoInner); // CR danach
}
}
}
@@ -1781,7 +1784,7 @@ Writer& OutWW8_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
rWW8Wrt.EndTOX( *pTOXSect );
}
- rWW8Wrt.WriteCR(pTextNodeInfo); // CR danach
+ rWW8Wrt.WriteCR(pTextNodeInfoInner); // CR danach
if( bRedlineAtEnd )
{
@@ -1814,7 +1817,7 @@ Writer& OutWW8_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
::std::clog << pTextNodeInfo->toString() << ::std::endl;
#endif
- rWW8Wrt.OutWW8TableInfoCell(pTextNodeInfo);
+ rWW8Wrt.OutWW8TableInfoCell(pTextNodeInfoInner);
}
if( !bFlyInTable )
@@ -2100,20 +2103,20 @@ Writer& OutWW8_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
pO->GetData() );
pO->Remove( 0, pO->Count() ); // leeren
- if (pTextNodeInfo.get() != NULL)
+ if (pTextNodeInfoInner.get() != NULL)
{
- if (pTextNodeInfo->isEndOfLine())
+ if (pTextNodeInfoInner->isEndOfLine())
{
- rWW8Wrt.WriteRowEnd(pTextNodeInfo->getDepth());
-
+ rWW8Wrt.WriteRowEnd(pTextNodeInfoInner->getDepth());
+
pO->Insert( (BYTE*)&nSty, 2, pO->Count() ); // Style #
- rWW8Wrt.OutWW8TableInfoRow(pTextNodeInfo);
+ rWW8Wrt.OutWW8TableInfoRow(pTextNodeInfoInner);
rWW8Wrt.pPapPlc->AppendFkpEntry( rWrt.Strm().Tell(), pO->Count(),
pO->GetData() );
- pO->Remove( 0, pO->Count() ); // leeren
+ pO->Remove( 0, pO->Count() ); // leeren
}
}
-
+
#ifdef DEBUG
::std::clog << "</OutWW8_SwTxtNode>" << ::std::endl;
#endif
@@ -2121,6 +2124,37 @@ Writer& OutWW8_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
return rWrt;
}
+void SwWW8Writer::OutWW8TableNodeInfo(ww8::WW8TableNodeInfo::Pointer_t pNodeInfo)
+{
+ SVBT16 nSty;
+ ShortToSVBT16( nStyleBeforeFly, nSty );
+
+ ww8::WW8TableNodeInfo::Inners_t::const_iterator aIt
+ (pNodeInfo->getInners().begin());
+ ww8::WW8TableNodeInfo::Inners_t::const_iterator aItEnd
+ (pNodeInfo->getInners().end());
+
+ while (aIt != aItEnd)
+ {
+ ww8::WW8TableNodeInfoInner::Pointer_t pInner = aIt->second;
+ if (pInner->isEndOfCell())
+ {
+ WriteRowEnd(pInner->getDepth());
+
+ pO->Insert( (BYTE*)&nSty, 2, pO->Count() ); // Style #
+ OutWW8TableInfoRow(pInner);
+ pPapPlc->AppendFkpEntry( Strm().Tell(), pO->Count(),
+ pO->GetData() );
+ pO->Remove( 0, pO->Count() ); // leeren
+ }
+
+ if (pInner->isEndOfLine())
+ {
+ }
+
+ aIt++;
+ }
+}
#if 0
/* */
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index eed986bc79..cf14b6b1b0 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1695,9 +1695,9 @@ void SwWW8Writer::OutSwString(const String& rStr, xub_StrLen nStt,
#endif
}
-void SwWW8Writer::WriteCR(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo)
+void SwWW8Writer::WriteCR(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
- if (pTableTextNodeInfo.get() != NULL && pTableTextNodeInfo->getDepth() == 1 && pTableTextNodeInfo->isEndOfCell())
+ if (pTableTextNodeInfoInner.get() != NULL && pTableTextNodeInfoInner->getDepth() == 1 && pTableTextNodeInfoInner->isEndOfCell())
WriteChar('\007');
else
WriteChar( '\015' );
@@ -1784,9 +1784,9 @@ WW8SaveData::~WW8SaveData()
}
void SwWW8Writer::OutWW8TableInfoCell
-(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo)
+(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
- sal_uInt32 nDepth = pTableTextNodeInfo->getDepth();
+ sal_uInt32 nDepth = pTableTextNodeInfoInner->getDepth();
if (nDepth > 0)
{
@@ -1796,7 +1796,7 @@ void SwWW8Writer::OutWW8TableInfoCell
InsUInt16(0x6649);
InsUInt32(nDepth);
- if (nDepth > 1 && pTableTextNodeInfo->isEndOfCell())
+ if (nDepth > 1 && pTableTextNodeInfoInner->isEndOfCell())
{
InsUInt16(0x244b);
pO->Insert((BYTE)0x1, pO->Count());
@@ -1805,15 +1805,15 @@ void SwWW8Writer::OutWW8TableInfoCell
}
void SwWW8Writer::OutWW8TableInfoRow
-(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo)
+(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
- sal_uInt32 nDepth = pTableTextNodeInfo->getDepth();
+ sal_uInt32 nDepth = pTableTextNodeInfoInner->getDepth();
if (nDepth > 0)
{
/* Row */
- if (pTableTextNodeInfo->isEndOfLine())
+ if (pTableTextNodeInfoInner->isEndOfLine())
{
InsUInt16(0x2416);
pO->Insert((BYTE)0x1, pO->Count());
@@ -1835,13 +1835,14 @@ void SwWW8Writer::OutWW8TableInfoRow
pO->Insert((BYTE)0x1, pO->Count());
}
- OutWW8TableDefinition(pTableTextNodeInfo);
- OutWW8TableHeight(pTableTextNodeInfo);
- OutWW8TableBackgrounds(pTableTextNodeInfo);
- OutWW8TableDefaultBorders(pTableTextNodeInfo);
- OutWW8TableCanSplit(pTableTextNodeInfo);
- OutWW8TableBidi(pTableTextNodeInfo);
- OutWW8TableVerticalCell(pTableTextNodeInfo);
+ OutWW8TableDefinition(pTableTextNodeInfoInner);
+ OutWW8TableHeight(pTableTextNodeInfoInner);
+ OutWW8TableBackgrounds(pTableTextNodeInfoInner);
+ OutWW8TableDefaultBorders(pTableTextNodeInfoInner);
+ OutWW8TableCanSplit(pTableTextNodeInfoInner);
+ OutWW8TableBidi(pTableTextNodeInfoInner);
+ OutWW8TableVerticalCell(pTableTextNodeInfoInner);
+ OutWW8TableOrientation(pTableTextNodeInfoInner);
}
}
}
@@ -1850,15 +1851,7 @@ static sal_uInt16 lcl_TCFlags(const SwTableBox * pBox)
{
sal_uInt16 nFlags = 0;
- long nRowSpan = pBox->getRowSpan();
-
- if (nRowSpan != 0)
- {
- nFlags |= (1 << 5);
-
- if (nRowSpan > 0)
- nFlags |= (1 << 6);
- }
+ //long nRowSpan = pBox->getRowSpan();
const SwFrmFmt * pFmt = pBox->GetFrmFmt();
switch (pFmt->GetVertOrient().GetVertOrient())
@@ -1877,9 +1870,9 @@ static sal_uInt16 lcl_TCFlags(const SwTableBox * pBox)
}
void SwWW8Writer::OutWW8TableVerticalCell
-(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo)
+(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
- const SwTableBox * pTabBox = pTableTextNodeInfo->getTableBox();
+ const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
const SwTableLine * pTabLine = pTabBox->GetUpper();
const SwTableBoxes & rTblBoxes = pTabLine->GetTabBoxes();
@@ -1900,9 +1893,9 @@ void SwWW8Writer::OutWW8TableVerticalCell
}
void SwWW8Writer::OutWW8TableCanSplit
-(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo)
+(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
- const SwTableBox * pTabBox = pTableTextNodeInfo->getTableBox();
+ const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
const SwTableLine * pTabLine = pTabBox->GetUpper();
const SwFrmFmt * pLineFmt = pTabLine->GetFrmFmt();
@@ -1928,9 +1921,9 @@ void SwWW8Writer::OutWW8TableCanSplit
}
void SwWW8Writer::OutWW8TableBidi
-(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo)
+(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
- const SwTable * pTable = pTableTextNodeInfo->getTable();
+ const SwTable * pTable = pTableTextNodeInfoInner->getTable();
const SwFrmFmt * pFrmFmt = pTable->GetFrmFmt();
if (bWrtWW8)
@@ -1944,9 +1937,9 @@ void SwWW8Writer::OutWW8TableBidi
}
void SwWW8Writer::OutWW8TableHeight
-(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo)
+(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
- const SwTableBox * pTabBox = pTableTextNodeInfo->getTableBox();
+ const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
const SwTableLine * pTabLine = pTabBox->GetUpper();
const SwFrmFmt * pLineFmt = pTabLine->GetFrmFmt();
@@ -1993,16 +1986,54 @@ void SwWW8Writer::OutWW8TableHeight
}
+void SwWW8Writer::OutWW8TableOrientation
+(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
+{
+ const SwTable * pTable = pTableTextNodeInfoInner->getTable();
+
+ const SwFrmFmt *pFmt = pTable->GetFrmFmt();
+ ASSERT(pFmt,"Impossible");
+ if (!pFmt)
+ return;
+
+ const SwFmtHoriOrient &rHori = pFmt->GetHoriOrient();
+ const SwFmtVertOrient &rVert = pFmt->GetVertOrient();
+
+ if (
+ (text::RelOrientation::PRINT_AREA == rHori.GetRelationOrient() ||
+ text::RelOrientation::FRAME == rHori.GetRelationOrient())
+ &&
+ (text::RelOrientation::PRINT_AREA == rVert.GetRelationOrient() ||
+ text::RelOrientation::FRAME == rVert.GetRelationOrient())
+ )
+ {
+ sal_Int16 eHOri = rHori.GetHoriOrient();
+ switch (eHOri)
+ {
+ case text::HoriOrientation::CENTER:
+ case text::HoriOrientation::RIGHT:
+ if( bWrtWW8 )
+ InsUInt16(0x5400 );
+ else
+ pO->Insert(182, pO->Count());
+ InsUInt16(text::HoriOrientation::RIGHT == eHOri ? 2 : 1);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
void SwWW8Writer::OutWW8TableDefinition
-(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo)
+(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
- const SwTableBox * pTabBox = pTableTextNodeInfo->getTableBox();
+ const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
const SwTableLine * pTabLine = pTabBox->GetUpper();
const SwTableBoxes & rTabBoxes = pTabLine->GetTabBoxes();
- const SwNode * pTxtNd = pTableTextNodeInfo->getNode();
- const SwTable * pTable = pTableTextNodeInfo->getTable();
+ const SwNode * pTxtNd = pTableTextNodeInfoInner->getNode();
+ const SwTable * pTable = pTableTextNodeInfoInner->getTable();
- if( pTable->GetRowsToRepeat() > pTableTextNodeInfo->getRow())
+ if( pTable->GetRowsToRepeat() > pTableTextNodeInfoInner->getRow())
{
if( bWrtWW8 )
InsUInt16( 0x3404 );
@@ -2056,11 +2087,6 @@ void SwWW8Writer::OutWW8TableDefinition
{
case text::HoriOrientation::CENTER:
case text::HoriOrientation::RIGHT:
- if( bWrtWW8 )
- InsUInt16(0x5400 );
- else
- pO->Insert(182, pO->Count());
- InsUInt16(text::HoriOrientation::RIGHT == eHOri ? 2 : 1);
break;
default:
@@ -2124,7 +2150,7 @@ void SwWW8Writer::OutWW8TableDefinition
}
}
- SwTwips nSz = 0;
+ SwTwips nSz = nTblOffset;
sal_uInt32 n = 0;
InsUInt16(nTblOffset);
@@ -2168,9 +2194,9 @@ void SwWW8Writer::OutWW8TableDefinition
}
void SwWW8Writer::OutWW8TableDefaultBorders
-(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo)
+(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
- const SwTableBox * pTabBox = pTableTextNodeInfo->getTableBox();
+ const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
const SwFrmFmt * pFrmFmt = pTabBox->GetFrmFmt();
//Set Default, just taken from the first cell of the first
@@ -2197,9 +2223,9 @@ void SwWW8Writer::OutWW8TableDefaultBorders
}
void SwWW8Writer::OutWW8TableBackgrounds
-(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo)
+(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
{
- const SwTableBox * pTabBox = pTableTextNodeInfo->getTableBox();
+ const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
const SwTableLine * pTabLine = pTabBox->GetUpper();
const SwTableBoxes & rTabBoxes = pTabLine->GetTabBoxes();
@@ -3237,14 +3263,60 @@ void SwWW8Writer::WriteFormData(SwFieldBookmark &rFieldmark)
}
+void SwWW8Writer::OutWW8_TableNodeInfoInner(ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner)
+{
+ SVBT16 nStyle;
+ ShortToSVBT16(nStyleBeforeFly, nStyle);
+
+#ifdef DEBUG
+ ::std::clog << "<OutWW8_TableNodeInfoInner>" << pNodeInfoInner->toString();
+#endif
+
+ pO->Remove( 0, pO->Count() ); // leeren
+
+ if (pNodeInfoInner->isEndOfCell())
+ {
+#ifdef DEBUG
+ ::std::clog << "<endOfCell/>" << ::std::endl;
+#endif
+ WriteCR(pNodeInfoInner);
+
+ pO->Insert( (BYTE*)&nStyle, 2, pO->Count() ); // Style #
+ OutWW8TableInfoCell(pNodeInfoInner);
+ pPapPlc->AppendFkpEntry( Strm().Tell(), pO->Count(),
+ pO->GetData() );
+
+ pO->Remove( 0, pO->Count() ); // leeren
+ }
+
+ if (pNodeInfoInner->isEndOfLine())
+ {
+#ifdef DEBUG
+ ::std::clog << "<endOfLine/>" << ::std::endl;
+#endif
+ WriteRowEnd(pNodeInfoInner->getDepth());
+
+ pO->Insert( (BYTE*)&nStyle, 2, pO->Count() ); // Style #
+ OutWW8TableInfoRow(pNodeInfoInner);
+ pPapPlc->AppendFkpEntry( Strm().Tell(), pO->Count(),
+ pO->GetData() );
+
+ pO->Remove( 0, pO->Count() ); // leeren
+ }
+#ifdef DEBUG
+ ::std::clog << "</OutWW8_TableNodeInfoInner>" << ::std::endl;
+#endif
+}
+
void SwWW8Writer::OutWW8_SwEndNode(SwNode * pNode)
{
+#ifdef DEBUG
+ ::std::clog << "<OutWW8_SwEndNode>" << dbg_out(pNode) << ::std::endl;
+#endif
+
ww8::WW8TableNodeInfo::Pointer_t pNodeInfo =
mpTableInfo->getTableNodeInfo(pNode);
- SVBT16 nStyle;
- ShortToSVBT16(nStyleBeforeFly, nStyle);
-
if (pNodeInfo)
{
if (pNodeInfo.get() != NULL)
@@ -3253,33 +3325,21 @@ void SwWW8Writer::OutWW8_SwEndNode(SwNode * pNode)
::std::clog << pNodeInfo->toString() << ::std::endl;
#endif
- pO->Remove( 0, pO->Count() ); // leeren
-
- if (pNodeInfo->isEndOfCell())
+ const ww8::WW8TableNodeInfo::Inners_t aInners = pNodeInfo->getInners();
+ ww8::WW8TableNodeInfo::Inners_t::const_iterator aIt(aInners.begin());
+ ww8::WW8TableNodeInfo::Inners_t::const_iterator aEnd(aInners.end());
+ while (aIt != aEnd)
{
- WriteCR(pNodeInfo);
-
- pO->Insert( (BYTE*)&nStyle, 2, pO->Count() ); // Style #
- OutWW8TableInfoCell(pNodeInfo);
- pPapPlc->AppendFkpEntry( Strm().Tell(), pO->Count(),
- pO->GetData() );
-
- pO->Remove( 0, pO->Count() ); // leeren
- }
-
- if (pNodeInfo->isEndOfLine())
- {
- WriteRowEnd(pNodeInfo->getDepth());
-
- pO->Insert( (BYTE*)&nStyle, 2, pO->Count() ); // Style #
- OutWW8TableInfoRow(pNodeInfo);
- pPapPlc->AppendFkpEntry( Strm().Tell(), pO->Count(),
- pO->GetData() );
-
- pO->Remove( 0, pO->Count() ); // leeren
+ ww8::WW8TableNodeInfoInner::Pointer_t pInner = aIt->second;
+ OutWW8_TableNodeInfoInner(pInner);
+ aIt++;
}
}
}
+#ifdef DEBUG
+ ::std::clog << "</OutWW8_SwEndNode>" << ::std::endl;
+#endif
+
}
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 87e6ffd80a..a0a9fda74c 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -557,15 +557,18 @@ public:
void AppendFlyInFlys(const sw::Frame& rFrmFmt, const Point& rNdTopLeft);
void WriteOutliner(const OutlinerParaObject& rOutliner, BYTE nTyp);
void WriteSdrTextObj(const SdrObject& rObj, BYTE nTyp);
- void OutWW8TableInfoCell(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo);
- void OutWW8TableInfoRow(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo);
- void OutWW8TableDefinition(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo);
- void OutWW8TableDefaultBorders(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo);
- void OutWW8TableBackgrounds(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo);
- void OutWW8TableHeight(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo);
- void OutWW8TableCanSplit(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo);
- void OutWW8TableBidi(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo);
- void OutWW8TableVerticalCell(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo);
+ void OutWW8TableInfoCell(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo);
+ void OutWW8TableInfoRow(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo);
+ void OutWW8TableDefinition(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo);
+ void OutWW8TableDefaultBorders(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo);
+ void OutWW8TableBackgrounds(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo);
+ void OutWW8TableHeight(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo);
+ void OutWW8TableCanSplit(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo);
+ void OutWW8TableBidi(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo);
+ void OutWW8TableVerticalCell(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo);
+ void OutWW8TableNodeInfo(ww8::WW8TableNodeInfo::Pointer_t pNodeInfo);
+ void OutWW8_TableNodeInfoInner(ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner);
+ void OutWW8TableOrientation(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner);
UINT32 GetSdrOrdNum( const SwFrmFmt& rFmt ) const;
void CreateEscher();
@@ -592,7 +595,7 @@ public:
void WriteAsStringTable(const ::std::vector<String>&, INT32& rfcSttbf,
INT32& rlcbSttbf, USHORT nExtraLen = 0);
void WriteText();
- void WriteCR(ww8::WW8TableNodeInfo::Pointer_t pTableTextNodeInfo = ww8::WW8TableNodeInfo::Pointer_t());
+ void WriteCR(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner = ww8::WW8TableNodeInfoInner::Pointer_t());
void WriteChar( sal_Unicode c );
void WriteRowEnd(sal_uInt32 nDepth = 1);
#if 0