LibreOffice Module sw (master) 1
WW8TableInfo.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <iostream>
21#include <stdio.h>
22#include "WW8TableInfo.hxx"
23#include <fmtfsize.hxx>
25#include <swtable.hxx>
26#include <frmfmt.hxx>
27#include <pam.hxx>
28#include <dbgoutsw.hxx>
29#include <sal/log.hxx>
30#include <osl/diagnose.h>
31#include <rtl/string.hxx>
32
33namespace ww8
34{
35
37: mpParent(pParent)
38, mnDepth(0)
39, mnCell(0)
40, mnRow(0)
41, mnShadowsBefore(0)
42, mnShadowsAfter(0)
43, mbEndOfLine(false)
44, mbFinalEndOfLine(false)
45, mbEndOfCell(false)
46, mbFirstInTable(false)
47, mbVertMerge(false)
48, mpTableBox(nullptr)
49, mpTable(nullptr)
50{
51}
52
53void WW8TableNodeInfoInner::setDepth(sal_uInt32 nDepth)
54{
55 mnDepth = nDepth;
56}
57
58void WW8TableNodeInfoInner::setCell(sal_uInt32 nCell)
59{
60 mnCell = nCell;
61}
62
63void WW8TableNodeInfoInner::setRow(sal_uInt32 nRow)
64{
65 mnRow = nRow;
66}
67
68void WW8TableNodeInfoInner::setShadowsBefore(sal_uInt32 nShadowsBefore)
69{
70 mnShadowsBefore = nShadowsBefore;
71}
72
73void WW8TableNodeInfoInner::setShadowsAfter(sal_uInt32 nShadowsAfter)
74{
75 mnShadowsAfter = nShadowsAfter;
76}
77
79{
80 mbEndOfLine = bEndOfLine;
81}
82
84{
85 mbFinalEndOfLine = bFinalEndOfLine;
86}
87
89{
90 mbEndOfCell = bEndOfCell;
91}
92
94{
95 mbFirstInTable = bFirstInTable;
96}
97
99
100{
101 mbVertMerge = bVertMerge;
102}
103
105{
106 mpTableBox = pTableBox;
107}
108
110{
111 mpTable = pTable;
112}
113
115{
116 maRect = rRect;
117}
118
120{
121 const SwNode * pResult = nullptr;
122
123 if (mpParent != nullptr)
124 pResult = mpParent->getNode();
125
126 return pResult;
127}
128
130{
131 TableBoxVectorPtr pResult = std::make_shared<TableBoxVector>();
132
135
136 if (!pCellGrid)
137 {
138 const SwTableLine * pTabLine = getTableBox()->GetUpper();
139 const SwTableBoxes & rTableBoxes = pTabLine->GetTabBoxes();
140
141 sal_uInt8 nBoxes = rTableBoxes.size();
142 if (nBoxes > MAXTABLECELLS)
143 nBoxes = MAXTABLECELLS;
144 for ( sal_uInt8 n = 0; n < nBoxes; n++ )
145 {
146 pResult->push_back(rTableBoxes[n]);
147 }
148 }
149 else
150 pResult = pCellGrid->getTableBoxesOfRow(this);
151
152 return pResult;
153}
154
156{
157 GridColsPtr pResult = std::make_shared<GridCols>();
158 WidthsPtr pWidths;
159
160 // Check which columns should be checked - only the current row,
161 // or all the rows together
162 if (calculateColumnsFromAllRows)
163 {
164 // Calculate the width of all the columns based on ALL the rows.
165 // The difference is that this kind of draws vertical lines,
166 // so that if the rows look like this:
167 //
168 // ------------------------
169 // | | |
170 // ------------------------
171 // | | |
172 // ------------------------
173 // | | |
174 // ------------------------
175
176 // then the actual column widths will be broken down like this:
177 //
178 // ------------------------
179 // | | | | |
180 // ------------------------
181
182 // See the example at
183 // http://officeopenxml.com/WPtableGrid.php
184 // Under "Word 2007 Example"
186 }
187 else
188 {
189 // Calculate the width of all the columns based on the current row
190 pWidths = getWidthsOfRow();
191 }
192
193 const SwFrameFormat *pFormat = getTable()->GetFrameFormat();
194 OSL_ENSURE(pFormat,"Impossible");
195 if (!pFormat)
196 return pResult;
197
198 const SwFormatFrameSize &rSize = pFormat->GetFrameSize();
199 tools::ULong nTableSz = static_cast<tools::ULong>(rSize.GetWidth());
200
201 tools::Long nPageSize = 0;
202 bool bRelBoxSize = false;
203
204 rBase.GetTablePageSize( this, nPageSize, bRelBoxSize );
205
206 SwTwips nSz = 0;
207 for (const auto& rWidth : *pWidths)
208 {
209 nSz += rWidth;
210 SwTwips nCalc = nSz;
211 if ( bRelBoxSize )
212 nCalc = ( nCalc * nPageSize ) / nTableSz;
213
214 pResult->push_back( nCalc );
215 }
216
217 return pResult;
218}
219
221{
222 WidthsPtr pWidths;
223
226
227 if (!pCellGrid)
228 {
229 const SwTable * pTable = getTable();
230 const SwTableLines& rTableLines = pTable->GetTabLines();
231 const size_t nNumOfLines = rTableLines.size();
232
233 // Go over all the rows - and for each row - calculate where
234 // there is a separator between columns
235 WidthsPtr pSeparators = std::make_shared<Widths>();
236 for ( size_t nLineIndex = 0; nLineIndex < nNumOfLines; ++nLineIndex )
237 {
238 const SwTableLine *pCurrentLine = rTableLines[nLineIndex];
239 const SwTableBoxes & rTabBoxes = pCurrentLine->GetTabBoxes();
240 size_t nBoxes = rTabBoxes.size();
241 if (nBoxes > MAXTABLECELLS)
242 nBoxes = MAXTABLECELLS;
243
244 sal_uInt32 nSeparatorPosition = 0;
245 for (size_t nBoxIndex = 0; nBoxIndex < nBoxes; ++nBoxIndex)
246 {
247 const SwFrameFormat* pBoxFormat = rTabBoxes[ nBoxIndex ]->GetFrameFormat();
248 const SwFormatFrameSize& rLSz = pBoxFormat->GetFrameSize();
249 nSeparatorPosition += rLSz.GetWidth();
250 pSeparators->push_back(nSeparatorPosition);
251 }
252 }
253
254 // Sort the separator positions and remove any duplicates
255 std::sort(pSeparators->begin(), pSeparators->end());
256 std::vector<sal_uInt32>::iterator it = std::unique(pSeparators->begin(), pSeparators->end());
257 pSeparators->erase(it, pSeparators->end());
258
259 // Calculate the widths based on the position of the unique & sorted
260 // column separators
261 pWidths = std::make_shared<Widths>();
262 sal_uInt32 nPreviousWidth = 0;
263 for (const sal_uInt32 nCurrentWidth : *pSeparators)
264 {
265 pWidths->push_back(nCurrentWidth - nPreviousWidth);
266 nPreviousWidth = nCurrentWidth;
267 }
268 }
269 else
270 {
271 pWidths = pCellGrid->getWidthsOfRow(this);
272 }
273
274 return pWidths;
275}
276
278{
279 WidthsPtr pWidths;
280
283
284 if (!pCellGrid)
285 {
286 const SwTableBox * pTabBox = getTableBox();
287 const SwTableLine * pTabLine = pTabBox->GetUpper();
288 const SwTableBoxes & rTabBoxes = pTabLine->GetTabBoxes();
289
290 pWidths = std::make_shared<Widths>();
291 // number of cell written
292 sal_uInt32 nBoxes = rTabBoxes.size();
293 if (nBoxes > MAXTABLECELLS)
294 nBoxes = MAXTABLECELLS;
295
296 for (sal_uInt32 n = 0; n < nBoxes; n++)
297 {
298 const SwFrameFormat* pBoxFormat = rTabBoxes[ n ]->GetFrameFormat();
299 const SwFormatFrameSize& rLSz = pBoxFormat->GetFrameSize();
300
301 pWidths->push_back(rLSz.GetWidth());
302 }
303 }
304 else
305 pWidths = pCellGrid->getWidthsOfRow(this);
306
307 return pWidths;
308}
309
311{
312 RowSpansPtr pResult = std::make_shared<RowSpans>();
313
316
317 if (!pCellGrid)
318 {
319 const SwTableBox * pTabBox = getTableBox();
320 const SwTableLine * pTabLine = pTabBox->GetUpper();
321 const SwTableBoxes & rTabBoxes = pTabLine->GetTabBoxes();
322
323 sal_uInt32 nBoxes = rTabBoxes.size();
324 if (nBoxes > MAXTABLECELLS)
325 nBoxes = MAXTABLECELLS;
326
327 for (sal_uInt32 n = 0; n < nBoxes; ++n)
328 {
329 pResult->push_back(rTabBoxes[n]->getRowSpan());
330 }
331 }
332 else
333 pResult = pCellGrid->getRowSpansOfRow(this);
334
335 return pResult;
336 }
337
338
339#ifdef DBG_UTIL
341{
342 static char buffer[256];
343 snprintf(buffer, sizeof(buffer),
344 "<tableinner depth=\"%" SAL_PRIuUINT32 "\""
345 " cell=\"%" SAL_PRIuUINT32 "\""
346 " row=\"%" SAL_PRIuUINT32 "\""
347 " endOfCell=\"%s\""
348 " endOfLine=\"%s\""
349 " shadowsBefore=\"%" SAL_PRIuUINT32 "\""
350 " shadowsAfter=\"%" SAL_PRIuUINT32 "\""
351 " vertMerge=\"%s\"/>",
353 mbEndOfCell ? "yes" : "no",
354 mbEndOfLine ? "yes" : "no",
357 mbVertMerge ? "yes" : "no");
358
359 return std::string(buffer);
360}
361#endif
362
364 const SwNode * pNode)
365: mpParent(pParent),
366 mnDepth(0),
367 mpNode(pNode),
368 mpNext(nullptr),
369 mpNextNode(nullptr)
370{
371}
372
374{
375}
376
377#ifdef DBG_UTIL
378std::string WW8TableNodeInfo::toString() const
379{
380 static char buffer[1024];
381 snprintf(buffer, sizeof(buffer),
382 "<tableNodeInfo p=\"%p\" depth=\"%" SAL_PRIuUINT32 "\">"
383 ,this, getDepth());
384
385 std::string sResult(buffer);
386
387 for (const auto& rInner : mInners)
388 {
389 WW8TableNodeInfoInner::Pointer_t pInner = rInner.second;
390 sResult += pInner->toString();
391 }
392 sResult += dbg_out(*mpNode);
393 sResult += "</tableNodeInfo>";
394
395 return sResult;
396}
397#endif
398
399void WW8TableNodeInfo::setDepth(sal_uInt32 nDepth)
400{
401 mnDepth = nDepth;
402
403 Inners_t::iterator aIt = mInners.find(mnDepth);
404
405 if (aIt == mInners.end())
406 mInners[mnDepth] = std::make_shared<ww8::WW8TableNodeInfoInner>(this);
407
408 mInners[mnDepth]->setDepth(mnDepth);
409}
410
412{
414 pInner->setEndOfLine(bEndOfLine);
415
416#ifdef DBG_UTIL
417 SAL_INFO( "sw.ww8", "<endOfLine depth=\"" << mnDepth << "\">" << toString() << "</endOfLine>" );
418#endif
419}
420
422{
424 pInner->setEndOfCell(bEndOfCell);
425
426#ifdef DBG_UTIL
427 SAL_INFO( "sw.ww8", "<endOfCell depth=\"" << mnDepth << "\">" << toString() << "</endOfCell>" );
428#endif
429}
430
431void WW8TableNodeInfo::setFirstInTable(bool bFirstInTable)
432{
434
435 pInner->setFirstInTable(bFirstInTable);
436
437#ifdef DBG_UTIL
438 SAL_INFO( "sw.ww8", "<firstInTable depth=\"" << mnDepth << "\">" << toString() << "</firstInTable>" );
439#endif
440}
441
443{
445
446 pInner->setVertMerge(bVertMerge);
447
448#ifdef DBG_UTIL
449 SAL_INFO( "sw.ww8", "<vertMerge depth=\"" << mnDepth << "\">" << toString() << "</vertMerge>" );
450#endif
451}
452
454{
455 getInnerForDepth(mnDepth)->setTableBox(pTableBox);
456}
457
459{
460 getInnerForDepth(mnDepth)->setTable(pTable);
461}
462
464{
465 mpNext = pNext;
466
467#ifdef DBG_UTIL
468 SAL_INFO( "sw.ww8", "<setnext><from>" << toString() << "</from><to>" << pNext->toString() << "</to></setnext>" );
469#endif
470}
471
473{
474 mpNextNode = pNode;
475}
476
478{
479 getInnerForDepth(mnDepth)->setRect(rRect);
480}
481
482void WW8TableNodeInfo::setCell(sal_uInt32 nCell)
483{
484 getInnerForDepth(mnDepth)->setCell(nCell);
485}
486
487void WW8TableNodeInfo::setRow(sal_uInt32 nRow)
488{
489 getInnerForDepth(mnDepth)->setRow(nRow);
490}
491
492void WW8TableNodeInfo::setShadowsBefore(sal_uInt32 nShadowsBefore)
493{
494 getInnerForDepth(mnDepth)->setShadowsBefore(nShadowsBefore);
495}
496
497void WW8TableNodeInfo::setShadowsAfter(sal_uInt32 nShadowsAfter)
498{
499 getInnerForDepth(mnDepth)->setShadowsAfter(nShadowsAfter);
500}
501
502
504{
505 if (!mInners.empty())
506 return mInners.begin()->second->getDepth();
507
508 return mnDepth;
509}
510
511
513{
514 return getInnerForDepth(mnDepth)->getTableBox();
515}
516
518{
519 return getInnerForDepth(mnDepth)->getCell();
520}
521
522sal_uInt32 WW8TableNodeInfo::getRow() const
523{
524 return getInnerForDepth(mnDepth)->getRow();
525}
526
528{
530
531 if (!mInners.empty())
532 pResult = mInners.begin()->second;
533
534 return pResult;
535}
536
538{
540
541 Inners_t::const_iterator aIt = mInners.find(nDepth);
542 if (aIt != mInners.end())
543 {
544 pResult = aIt->second;
545 }
546
547 return pResult;
548}
549
551{
552}
553
555{
556}
557
560{
561 SwTableCellInfo aTableCellInfo(pTable);
562
563 while (aTableCellInfo.getNext())
564 {
565 SwRect aRect = aTableCellInfo.getRect();
566
567 SAL_INFO( "sw.ww8", "<CellFrame>" );
568 SAL_INFO( "sw.ww8", "<rect top=\"" << aRect.Top() << "\" bottom=\"" << aRect.Bottom()
569 << "\" left=\"" << aRect.Left() << "\" right=\"" << aRect.Right() << "\"/>" );
570 const SwTableBox * pTableBox = aTableCellInfo.getTableBox();
571 const SwStartNode * pSttNd = pTableBox->GetSttNd();
572
573 if (pSttNd != nullptr)
574 {
575 SwPaM aPam(*pSttNd, 0);
576
577 bool bDone = false;
578 do
579 {
580 SwNode & rNode = aPam.GetPoint()->GetNode();
581
582 insertTableNodeInfo(&rNode, pTable, pTableBox, 0, 0, 1, & aRect);
583
584 if (rNode.IsEndNode())
585 {
586 SwEndNode * pEndNode = rNode.GetEndNode();
587 SwStartNode * pTmpSttNd = pEndNode->StartOfSectionNode();
588
589 if (pTmpSttNd == pSttNd)
590 bDone = true;
591 }
592
593 aPam.GetPoint()->Adjust(SwNodeOffset(1));
594 }
595 while (!bDone);
596 }
597
598 SAL_INFO( "sw.ww8", "</CellFrame>" );
599 }
600
601 return reorderByLayout(pTable, rLastRowEnds);
602}
603
605{
606 SAL_INFO( "sw.ww8", "<processSwTable>" );
607
608 WW8TableNodeInfo * pPrev = nullptr;
609 RowEndInners_t aLastRowEnds;
610
611 if (pTable->IsTableComplex() && pTable->HasLayout())
612 {
613 pPrev = processSwTableByLayout(pTable, aLastRowEnds);
614#ifdef DBG_UTIL
615 SAL_INFO( "sw.ww8", getCellGridForTable(pTable)->toString());
616#endif
617 }
618 else
619 {
620 const SwTableLines & rLines = pTable->GetTabLines();
621
622 for (size_t n = 0; n < rLines.size(); ++n)
623 {
624 const SwTableLine * pLine = rLines[n];
625
626 pPrev = processTableLine(pTable, pLine, static_cast<sal_uInt32>(n), 1, pPrev, aLastRowEnds);
627 }
628
629 }
630
631 if (pPrev)
632 {
633 SwTableNode * pTableNode = pTable->GetTableNode();
634 SwEndNode * pEndNode = pTableNode->EndOfSectionNode();
635 pPrev->setNextNode(pEndNode);
636 assert(!aLastRowEnds.empty());
637 for (auto &a : aLastRowEnds)
638 {
639 assert(a.second->isEndOfLine());
640 a.second->setFinalEndOfLine(true);
641 }
642 }
643 SAL_INFO( "sw.ww8", "</processSwTable>" );
644}
645
648 const SwTableLine * pTableLine,
649 sal_uInt32 nRow,
650 sal_uInt32 nDepth,
651 WW8TableNodeInfo * pPrev,
652 RowEndInners_t &rLastRowEnds)
653{
654 SAL_INFO( "sw.ww8", "<processTableLine row=\"" << nRow << "\" depth=\"" << nDepth << "\">" );
655
656 const SwTableBoxes & rBoxes = pTableLine->GetTabBoxes();
657
658 for (size_t n = 0; n < rBoxes.size(); ++n)
659 {
660 const SwTableBox * pBox = rBoxes[n];
661
662 pPrev = processTableBox(pTable, pBox, nRow, static_cast<sal_uInt32>(n), nDepth, n == rBoxes.size() - 1, pPrev, rLastRowEnds);
663 }
664
665 SAL_INFO( "sw.ww8", "</processTableLine>" );
666
667 return pPrev;
668}
669
672 const SwTable * pTable,
673 const SwTableBox * pBoxToSet,
674 sal_uInt32 nRow,
675 sal_uInt32 nCell,
676 sal_uInt32 nDepth)
677{
678 SAL_INFO( "sw.ww8", "<processTableBoxLines depth=\"" << nDepth << "\" row=\"" << nRow
679 << "\" cell=\"" << nCell << "\">" );
680
681 const SwTableLines & rLines = pBox->GetTabLines();
683
684 if (!rLines.empty())
685 {
686 for (size_t n = 0; n < rLines.size(); ++n)
687 {
688 const SwTableLine * pLine = rLines[n];
689 const SwTableBoxes & rBoxes = pLine->GetTabBoxes();
690
691 for (size_t nBox = 0; nBox < rBoxes.size(); ++nBox)
692 pNodeInfo = processTableBoxLines(rBoxes[nBox], pTable, pBoxToSet, nRow, nCell, nDepth);
693 }
694 }
695 else
696 {
697 const SwStartNode * pSttNd = pBox->GetSttNd();
698 const SwEndNode * pEndNd = pSttNd->EndOfSectionNode();
699 SwPaM aPaM(*pSttNd, 0);
700 SwPaM aEndPaM(*pEndNd, 0);
701
702 bool bDone = false;
703 while (!bDone)
704 {
705 SwNode & rNode = aPaM.GetPoint()->GetNode();
706
707 pNodeInfo = insertTableNodeInfo(&rNode, pTable, pBoxToSet, nRow, nCell, nDepth);
708
709 if (aPaM.GetPoint()->GetNode() == aEndPaM.GetPoint()->GetNode())
710 bDone = true;
711 else
712 aPaM.GetPoint()->Adjust(SwNodeOffset(1));
713 }
714 }
715
716 SAL_INFO( "sw.ww8", "</processTableBoxLines>" );
717
718 return pNodeInfo;
719}
720
721static void updateFinalEndOfLine(RowEndInners_t &rLastRowEnds, WW8TableNodeInfo const * pEndOfCellInfo)
722{
723 sal_Int32 nDepth = pEndOfCellInfo->getDepth();
724 WW8TableNodeInfoInner::Pointer_t pInner = pEndOfCellInfo->getInnerForDepth(nDepth);
725
726 auto aIt = rLastRowEnds.find(nDepth);
727 if (aIt == rLastRowEnds.end() || (pInner->getRow() > aIt->second->getRow()))
728 rLastRowEnds[nDepth] = pInner.get();
729}
730
731WW8TableNodeInfo *
733 const SwTableBox * pBox,
734 sal_uInt32 nRow,
735 sal_uInt32 nCell,
736 sal_uInt32 nDepth,
737 bool bEndOfLine,
738 WW8TableNodeInfo * pPrev,
739 RowEndInners_t &rLastRowEnds)
740{
741 SAL_INFO( "sw.ww8", "<processTableBox row=\"" << nRow << "\" cell=\"" << nCell
742 << "\" depth=\"" << nDepth << "\">" );
743
745 const SwTableLines & rLines = pBox->GetTabLines();
746 const SwStartNode * pSttNd = pBox->GetSttNd();
747 WW8TableNodeInfo::Pointer_t pEndOfCellInfo;
748
749 if (!rLines.empty())
750 {
751 pNodeInfo = processTableBoxLines(pBox, pTable, pBox, nRow, nCell, nDepth);
752 pNodeInfo->setEndOfCell(true);
753 if (bEndOfLine)
754 {
755 pNodeInfo->setEndOfLine(true);
756 updateFinalEndOfLine(rLastRowEnds, pNodeInfo.get());
757 }
758
759 for (size_t n = 0; n < rLines.size(); n++)
760 {
761 const SwTableLine * pLine = rLines[n];
762
763 pPrev = processTableLine(pTable, pLine, n, 1, pPrev, rLastRowEnds);
764 }
765 }
766 else
767 {
768 SwPaM aPaM(*pSttNd, 0);
769
770 bool bDone = false;
771 sal_uInt32 nDepthInsideCell = 0;
772
773 do
774 {
775 SwNode & rNode = aPaM.GetPoint()->GetNode();
776
777 if (rNode.IsStartNode())
778 {
779 if (nDepthInsideCell > 0)
780 pEndOfCellInfo.reset();
781
782 nDepthInsideCell++;
783 }
784
785 pNodeInfo = insertTableNodeInfo(&rNode, pTable, pBox, nRow, nCell, nDepth);
786
787 if (pPrev)
788 pPrev->setNext(pNodeInfo.get());
789
790 pPrev = pNodeInfo.get();
791
792 if (nDepthInsideCell == 1 && rNode.IsTextNode())
793 pEndOfCellInfo = pNodeInfo;
794
795 if (rNode.IsEndNode())
796 {
797 nDepthInsideCell--;
798
799 if (nDepthInsideCell == 0 && !pEndOfCellInfo)
800 pEndOfCellInfo = pNodeInfo;
801
802 SwEndNode * pEndNode = rNode.GetEndNode( );
803 SwStartNode * pTmpSttNd = pEndNode->StartOfSectionNode();
804 if (pTmpSttNd == pSttNd)
805 bDone = true;
806 }
807
808 aPaM.GetPoint()->Adjust(SwNodeOffset(1));
809 }
810 while (!bDone);
811
812 if (pEndOfCellInfo)
813 {
814 pEndOfCellInfo->setEndOfCell(true);
815
816 if (bEndOfLine)
817 {
818 pEndOfCellInfo->setEndOfLine(true);
819 updateFinalEndOfLine(rLastRowEnds, pEndOfCellInfo.get());
820 }
821 }
822 }
823
824 SAL_INFO( "sw.ww8", "</processTableBox>" );
825
826 return pPrev;
827}
828
830(const SwNode * pNode,
831 const SwTable * pTable,
832 const SwTableBox * pTableBox,
833 sal_uInt32 nRow,
834 sal_uInt32 nCell,
835 sal_uInt32 nDepth,
836 SwRect const * pRect)
837{
839
840 if (!pNodeInfo)
841 {
842 pNodeInfo =
843 std::make_shared<ww8::WW8TableNodeInfo>(this, pNode);
844 mMap.emplace(pNode, pNodeInfo);
845 }
846
847 pNodeInfo->setDepth(nDepth + pNodeInfo->getDepth());
848
849 pNodeInfo->setTable(pTable);
850 pNodeInfo->setTableBox(pTableBox);
851
852 pNodeInfo->setCell(nCell);
853 pNodeInfo->setRow(nRow);
854
855 if (pNode->IsTextNode())
856 {
857 FirstInTableMap_t::const_iterator aIt = mFirstInTableMap.find(pTable);
858 if (aIt == mFirstInTableMap.end())
859 {
860 mFirstInTableMap[pTable] = pNode;
861 pNodeInfo->setFirstInTable(true);
862 }
863 }
864
865 if (pRect)
866 {
868
869 pCellGrid->insert(*pRect, pNodeInfo.get());
870 pNodeInfo->setRect(*pRect);
871 }
872
873#ifdef DBG_UTIL
874 SAL_INFO( "sw.ww8", pNodeInfo->toString());
875#endif
876 return pNodeInfo;
877}
878
880(const SwTable * pTable, bool bCreate)
881{
883 CellGridMap_t::iterator aIt = mCellGridMap.find(pTable);
884
885 if (aIt == mCellGridMap.end())
886 {
887 if (bCreate)
888 {
889 pResult = std::make_shared<ww8::WW8TableCellGrid>();
890 mCellGridMap[pTable] = pResult;
891 }
892 }
893 else
894 pResult = mCellGridMap[pTable];
895
896 return pResult;
897}
898
900(const SwNode * pNode)
901{
903 Map_t::iterator aIt = mMap.find(pNode);
904
905 if (aIt != mMap.end())
906 pResult = (*aIt).second;
907
908 return pResult;
909}
910
912{
913 const SwNode * pResult = nullptr;
914
916
917 if (pNodeInfo)
918 {
919 WW8TableNodeInfo * pNextInfo = pNodeInfo->getNext();
920
921 if (pNextInfo != nullptr)
922 pResult = pNextInfo->getNode();
923 else
924 {
925 const SwNode * pNextNode = pNodeInfo->getNextNode();
926
927 if (pNextNode != nullptr)
928 pResult = pNextNode;
929 }
930 }
931
932 return pResult;
933}
934
936{
937 bool bRet = false;
938
939 if (rInfo.mpNode != nullptr)
940 {
941 if (mpNode == nullptr)
942 {
943 bRet = true;
944 }
945 else
946 {
947 if (mpNode->GetIndex() < rInfo.mpNode->GetIndex())
948 bRet = true;
949 }
950 }
951
952 return bRet;
953}
954
955bool CellInfo::operator < (const CellInfo & aCellInfo) const
956{
957 bool aRet = false;
958
959 if (top() < aCellInfo.top())
960 aRet = true;
961 else if (top() == aCellInfo.top())
962 {
963 if (left() < aCellInfo.left())
964 aRet = true;
965 else if (left() == aCellInfo.left())
966 {
967 if (width() < aCellInfo.width())
968 aRet = true;
969 else if (width() == aCellInfo.width())
970 {
971 if (height() < aCellInfo.height())
972 aRet = true;
973 else if (height() == aCellInfo.height())
974 {
975 if (aCellInfo.getTableNodeInfo())
976 {
977 if (m_pNodeInfo == nullptr)
978 aRet = true;
979 else
980 {
981 aRet = *m_pNodeInfo < *aCellInfo.getTableNodeInfo();
982 }
983 }
984 }
985 }
986 }
987 }
988
989 return aRet;
990}
991
992#ifdef DBG_UTIL
993std::string CellInfo::toString() const
994{
995 static char sBuffer[256];
996
997 snprintf(sBuffer, sizeof(sBuffer),
998 "<cellinfo left=\"%" SAL_PRIdINT64 "\""
999 " right=\"%" SAL_PRIdINT64 "\""
1000 " top=\"%" SAL_PRIdINT64 "\""
1001 " bottom=\"%" SAL_PRIdINT64 "\""
1002 " node=\"%p\"/>",
1003 sal_Int64(left()),
1004 sal_Int64(right()),
1005 sal_Int64(top()),
1006 sal_Int64(bottom()),
1007 m_pNodeInfo);
1008
1009 return sBuffer;
1010}
1011#endif
1012
1014{
1016
1017#ifdef DBG_UTIL
1018 SAL_INFO( "sw.ww8", pCellGrid->toString());
1019#endif
1020
1021 pCellGrid->addShadowCells();
1022 return pCellGrid->connectCells(rLastRowEnds);
1023}
1024
1026{
1027}
1028
1030{
1031}
1032
1034{
1036
1037 RowTops_t::iterator aIt = m_aRowTops.find(nTop);
1038
1039 if (aIt == m_aRowTops.end())
1040 {
1041 if (bCreate)
1042 {
1043 pResult = std::make_shared<ww8::WW8TableCellGridRow>();
1044 m_aRows[nTop] = pResult;
1045 m_aRowTops.insert(nTop);
1046 }
1047 }
1048 else
1049 pResult = m_aRows[nTop];
1050
1051 return pResult;
1052}
1053
1054WW8TableCellGrid::RowTops_t::const_iterator WW8TableCellGrid::getRowTopsBegin() const
1055{
1056 return m_aRowTops.begin();
1057}
1058
1059WW8TableCellGrid::RowTops_t::const_iterator WW8TableCellGrid::getRowTopsEnd() const
1060{
1061 return m_aRowTops.end();
1062}
1063
1064CellInfoMultiSet::const_iterator WW8TableCellGrid::getCellsBegin(tools::Long nTop)
1065{
1066 return getRow(nTop)->begin();
1067}
1068
1069CellInfoMultiSet::const_iterator WW8TableCellGrid::getCellsEnd(tools::Long nTop)
1070{
1071 return getRow(nTop)->end();
1072}
1073
1075 WW8TableNodeInfo * pNodeInfo,
1076 const tools::ULong * pFormatFrameWidth)
1077{
1078 CellInfo aCellInfo(rRect, pNodeInfo);
1079
1080 if (pFormatFrameWidth != nullptr)
1081 aCellInfo.setFormatFrameWidth(*pFormatFrameWidth);
1082
1084 pRow->insert(aCellInfo);
1085}
1086
1088{
1089 SAL_INFO( "sw.ww8", "<addShadowCells>" );
1090
1091 RowTops_t::const_iterator aTopsIt = getRowTopsBegin();
1092
1093 while (aTopsIt != getRowTopsEnd())
1094 {
1095 CellInfoMultiSet::const_iterator aCellIt = getCellsBegin(*aTopsIt);
1096 CellInfoMultiSet::const_iterator aCellEndIt = getCellsEnd(*aTopsIt);
1097
1098 RowSpansPtr pRowSpans = std::make_shared<RowSpans>();
1099
1100 bool bBeginningOfCell = true;
1101 bool bVertMerge = false;
1102 SwRect aRect = aCellIt->getRect();
1103 sal_Int32 nRowSpan = 1;
1104 while (aCellIt != aCellEndIt)
1105 {
1106 WW8TableNodeInfo * pNodeInfo = aCellIt->getTableNodeInfo();
1107
1108 if (bBeginningOfCell)
1109 {
1110 RowTops_t::const_iterator aRowSpanIt(aTopsIt);
1111 ++aRowSpanIt;
1112
1113 if (aRowSpanIt != getRowTopsEnd() &&
1114 *aRowSpanIt < aCellIt->bottom())
1115 {
1116 aRect.Top(*aRowSpanIt);
1117 tools::ULong nFormatFrameWidth = aCellIt->getFormatFrameWidth();
1118 insert(aRect, nullptr, &nFormatFrameWidth);
1119
1120 bVertMerge = true;
1121 }
1122 else
1123 bVertMerge = false;
1124
1125 nRowSpan = 1;
1126 while (aRowSpanIt != getRowTopsEnd() &&
1127 *aRowSpanIt < aCellIt->bottom())
1128 {
1129 ++aRowSpanIt;
1130 nRowSpan++;
1131 }
1132
1133 if (pNodeInfo)
1134 pRowSpans->push_back(nRowSpan);
1135 else
1136 pRowSpans->push_back(-nRowSpan);
1137 }
1138
1139 if (pNodeInfo)
1140 {
1141 pNodeInfo->setVertMerge(bVertMerge);
1142 }
1143
1144 ++aCellIt;
1145 if (aCellIt != aCellEndIt)
1146 {
1147 bBeginningOfCell = (aRect.Left() != aCellIt->left());
1148 aRect = aCellIt->getRect();
1149 }
1150 }
1151
1152 WW8TableCellGridRow::Pointer_t pRow = getRow(*aTopsIt);
1153 if (pRow)
1154 pRow->setRowSpans(pRowSpans);
1155
1156 ++aTopsIt;
1157 }
1158 SAL_INFO( "sw.ww8", "</addShadowCells>" );
1159}
1160
1162{
1163 RowTops_t::const_iterator aTopsIt = getRowTopsBegin();
1164 sal_uInt32 nRow = 0;
1165 WW8TableNodeInfo * pLastNodeInfo = nullptr;
1166
1167 while (aTopsIt != getRowTopsEnd())
1168 {
1169 CellInfoMultiSet::const_iterator aCellIt = getCellsBegin(*aTopsIt);
1170 CellInfoMultiSet::const_iterator aCellEndIt = getCellsEnd(*aTopsIt);
1171 GridColsPtr pWidths = std::make_shared<Widths>();
1172 TableBoxVectorPtr pTableBoxes = std::make_shared<TableBoxVector>();
1173
1174 sal_uInt32 nShadows = 0;
1175 sal_uInt32 nCell = 0;
1176 bool bBeginningOfCell = true;
1177 WW8TableNodeInfo * pEndOfCellInfo = nullptr;
1178 sal_uInt32 nDepthInCell = 0;
1179 while (aCellIt != aCellEndIt)
1180 {
1181 tools::Long nCellX = aCellIt->left();
1182 WW8TableNodeInfo * pNodeInfo = aCellIt->getTableNodeInfo();
1183 if (pNodeInfo)
1184 {
1185 const SwNode * pNode = pNodeInfo->getNode();
1186
1187 if (pNode->IsStartNode())
1188 {
1189 nDepthInCell++;
1190 pEndOfCellInfo = nullptr;
1191 }
1192
1193 if (nDepthInCell == 1 && pNode->IsTextNode())
1194 pEndOfCellInfo = pNodeInfo;
1195
1196 pNodeInfo->setShadowsBefore(nShadows);
1197 pNodeInfo->setCell(nCell);
1198 pNodeInfo->setRow(nRow);
1199 if (pLastNodeInfo)
1200 {
1201 pLastNodeInfo->setNext(pNodeInfo);
1202 pLastNodeInfo->setNextNode(pNode);
1203 }
1204 pLastNodeInfo = pNodeInfo;
1205 nShadows = 0;
1206
1207 if (pNode->IsEndNode())
1208 {
1209 nDepthInCell--;
1210
1211 if (nDepthInCell == 0 && !pEndOfCellInfo)
1212 pEndOfCellInfo = pNodeInfo;
1213 }
1214 }
1215 else
1216 {
1217 nShadows++;
1218 }
1219
1220 if (bBeginningOfCell)
1221 {
1222 pWidths->push_back(aCellIt->getFormatFrameWidth());
1223
1224 if (pNodeInfo)
1225 pTableBoxes->push_back(pNodeInfo->getTableBox());
1226 else
1227 pTableBoxes->push_back(nullptr);
1228 }
1229
1230 ++aCellIt;
1231 bBeginningOfCell = false;
1232
1233 if (aCellIt != aCellEndIt && aCellIt->left() != nCellX)
1234 {
1235 nCell++;
1236 bBeginningOfCell = true;
1237
1238 if (pEndOfCellInfo)
1239 {
1240 pEndOfCellInfo->setEndOfCell(true);
1241 }
1242
1243 pEndOfCellInfo = nullptr;
1244 }
1245 }
1246
1247 pLastNodeInfo->setShadowsAfter(nShadows);
1248
1249 if (!pEndOfCellInfo)
1250 {
1251 pEndOfCellInfo = pLastNodeInfo;
1252 }
1253
1254 pEndOfCellInfo->setEndOfCell(true);
1255 pLastNodeInfo->setEndOfLine(true);
1256 updateFinalEndOfLine(rLastRowEnds, pLastNodeInfo);
1257
1258 WW8TableCellGridRow::Pointer_t pRow(getRow(*aTopsIt));
1259 pRow->setTableBoxVector(pTableBoxes);
1260 pRow->setWidths(pWidths);
1261
1262 ++aTopsIt;
1263 nRow++;
1264 }
1265
1266 return pLastNodeInfo;
1267}
1268
1269#ifdef DBG_UTIL
1271{
1272 std::string sResult = "<WW8TableCellGrid>";
1273
1274 RowTops_t::const_iterator aTopsIt = getRowTopsBegin();
1275 static char sBuffer[1024];
1276 while (aTopsIt != getRowTopsEnd())
1277 {
1278 sResult += "<row y=\"";
1279 sResult += OString::number(*aTopsIt);
1280 sResult += "\">";
1281
1282 CellInfoMultiSet::const_iterator aCellIt = getCellsBegin(*aTopsIt);
1283 CellInfoMultiSet::const_iterator aCellsEnd = getCellsEnd(*aTopsIt);
1284
1285 while (aCellIt != aCellsEnd)
1286 {
1287 snprintf(sBuffer, sizeof(sBuffer), "<cellInfo top=\"%" SAL_PRIdINT64 "\" bottom=\"%" SAL_PRIdINT64 "\" left=\"%" SAL_PRIdINT64 "\" right=\"%" SAL_PRIdINT64 "\">",
1288 sal_Int64(aCellIt->top()), sal_Int64(aCellIt->bottom()), sal_Int64(aCellIt->left()), sal_Int64(aCellIt->right()));
1289 sResult += sBuffer;
1290
1291 WW8TableNodeInfo * pInfo = aCellIt->getTableNodeInfo();
1292 if (pInfo)
1293 sResult += pInfo->toString();
1294 else
1295 sResult += "<shadow/>\n";
1296
1297 sResult += "</cellInfo>\n";
1298 ++aCellIt;
1299 }
1300
1301 WW8TableCellGridRow::Pointer_t pRow = getRow(*aTopsIt);
1302 WidthsPtr pWidths = pRow->getWidths();
1303 if (pWidths != nullptr)
1304 {
1305 sResult += "<widths>";
1306
1307 Widths::const_iterator aItEnd = pWidths->end();
1308 for (Widths::const_iterator aIt = pWidths->begin();
1309 aIt != aItEnd;
1310 ++aIt)
1311 {
1312 if (aIt != pWidths->begin())
1313 sResult += ", ";
1314
1315 snprintf(sBuffer, sizeof(sBuffer), "%" SAL_PRIxUINT32 "", *aIt);
1316 sResult += sBuffer;
1317 }
1318
1319 sResult += "</widths>";
1320 }
1321
1322 RowSpansPtr pRowSpans = pRow->getRowSpans();
1323 if (pRowSpans)
1324 {
1325 sResult += "<rowspans>";
1326
1327 RowSpans::const_iterator aItEnd = pRowSpans->end();
1328 for (RowSpans::const_iterator aIt = pRowSpans->begin();
1329 aIt != aItEnd;
1330 ++aIt)
1331 {
1332 if (aIt != pRowSpans->begin())
1333 sResult += ", ";
1334
1335 snprintf(sBuffer, sizeof(sBuffer), "%" SAL_PRIxUINT32 "", *aIt);
1336 sResult += sBuffer;
1337 }
1338
1339 sResult += "</rowspans>";
1340 }
1341
1342 sResult += "</row>\n";
1343 ++aTopsIt;
1344 }
1345
1346 sResult += "</WW8TableCellGrid>\n";
1347
1348 return sResult;
1349}
1350#endif
1351
1353(WW8TableNodeInfoInner const * pNodeInfoInner)
1354{
1355 TableBoxVectorPtr pResult;
1357 getRow(pNodeInfoInner->getRect().Top(), false);
1358
1359 if (pRow)
1360 {
1361 pResult = pRow->getTableBoxVector();
1362 }
1363
1364 return pResult;
1365}
1366
1368(WW8TableNodeInfoInner const * pNodeInfoInner)
1369{
1370 GridColsPtr pResult;
1371
1373 getRow(pNodeInfoInner->getRect().Top(), false);
1374
1375 if (pRow)
1376 {
1377 pResult = pRow->getWidths();
1378 }
1379
1380 return pResult;
1381}
1382
1384(WW8TableNodeInfoInner const * pNodeInfoInner)
1385{
1386 RowSpansPtr pResult;
1387
1389 getRow(pNodeInfoInner->getRect().Top(), false);
1390
1391 if (pRow)
1392 {
1393 pResult = pRow->getRowSpans();
1394 }
1395
1396 return pResult;
1397}
1398
1400: m_pCellInfos(std::make_shared<CellInfoMultiSet>())
1401{
1402}
1403
1405{
1406}
1407
1409{
1410 m_pCellInfos->insert(rCellInfo);
1411
1412#ifdef DBG_UTIL
1413 SAL_INFO( "sw.ww8", "<gridRowInsert>" << rCellInfo.toString() << "</gridRowInsert>" );
1414#endif
1415}
1416
1417CellInfoMultiSet::const_iterator WW8TableCellGridRow::begin() const
1418{
1419 return m_pCellInfos->begin();
1420}
1421
1422CellInfoMultiSet::const_iterator WW8TableCellGridRow::end() const
1423{
1424 return m_pCellInfos->end();
1425}
1426
1428{
1429 if (pTableBoxVector->size() > MAXTABLECELLS)
1430 pTableBoxVector->resize(MAXTABLECELLS);
1431 m_pTableBoxVector = pTableBoxVector;
1432}
1433
1435{
1436 m_pWidths = pWidths;
1437}
1438
1440{
1441 m_pRowSpans = pRowSpans;
1442}
1443
1444
1445CellInfo::CellInfo(const SwRect & aRect, WW8TableNodeInfo * pNodeInfo)
1446: m_aRect(aRect), m_pNodeInfo(pNodeInfo), m_nFormatFrameWidth(0)
1447{
1448 if (pNodeInfo != nullptr)
1449 {
1450 const SwTableBox * pBox = pNodeInfo->getTableBox();
1451 const SwFrameFormat * pFrameFormat = pBox->GetFrameFormat();
1452 const SwFormatFrameSize & rSize = pFrameFormat->GetFrameSize();
1453
1454 m_nFormatFrameWidth = rSize.GetWidth();
1455 }
1456}
1457
1458}
1459
1460/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
EdgeEntry * mpNext
sal_Int32 mnDepth
void GetTablePageSize(ww8::WW8TableNodeInfoInner const *pTableTextNodeInfoInner, tools::Long &rPageSize, bool &rRelBoxSize)
Definition: wrtww8.cxx:2557
tools::Long GetWidth() const
Ends a section of nodes in the document model.
Definition: node.hxx:378
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
Style of a layout element.
Definition: frmfmt.hxx:72
Base class of the Writer document model elements.
Definition: node.hxx:98
SwNodeOffset GetIndex() const
Definition: node.hxx:312
bool IsEndNode() const
Definition: node.hxx:189
bool IsStartNode() const
Definition: node.hxx:187
bool IsTextNode() const
Definition: node.hxx:190
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:153
SwEndNode * GetEndNode()
Definition: node.hxx:634
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:695
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
const SwPosition * GetPoint() const
Definition: pam.hxx:253
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void Top(const tools::Long nTop)
Definition: swrect.hxx:206
void Right(const tools::Long nRight)
Definition: swrect.hxx:202
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:211
void Left(const tools::Long nLeft)
Definition: swrect.hxx:197
Starts a section of nodes in the document model.
Definition: node.hxx:348
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:443
SwTableLine * GetUpper()
Definition: swtable.hxx:477
SwFrameFormat * GetFrameFormat()
Definition: swtable.hxx:481
SwTableLines & GetTabLines()
Definition: swtable.hxx:474
const SwStartNode * GetSttNd() const
Definition: swtable.hxx:495
SwRect getRect() const
Definition: swtable.cxx:3171
const SwTableBox * getTableBox() const
Definition: swtable.cxx:3181
SwTableLine is one table row in the document model.
Definition: swtable.hxx:376
SwTableBoxes & GetTabBoxes()
Definition: swtable.hxx:386
size_type size() const
Definition: swtable.hxx:76
bool empty() const
Definition: swtable.hxx:75
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:113
SwTableNode * GetTableNode() const
Definition: swtable.cxx:2315
SwTableLines & GetTabLines()
Definition: swtable.hxx:206
SwTableFormat * GetFrameFormat()
Definition: swtable.hxx:209
bool IsTableComplex() const
Definition: swtable.cxx:1445
bool HasLayout() const
Definition: swtable.cxx:3196
WW8TableNodeInfo * getTableNodeInfo() const
tools::Long top() const
tools::Long height() const
tools::Long width() const
tools::ULong m_nFormatFrameWidth
tools::Long left() const
bool operator<(const CellInfo &aCellInfo) const
std::string toString() const
CellInfo(const SwRect &aRect, WW8TableNodeInfo *pNodeInfo)
WW8TableNodeInfo * m_pNodeInfo
tools::Long bottom() const
void setFormatFrameWidth(tools::ULong nFormatFrameWidth)
tools::Long right() const
CellInfoMultiSet::const_iterator begin() const
void insert(const CellInfo &rCellInfo)
CellInfoMultiSet::const_iterator end() const
void setWidths(WidthsPtr const &pGridCols)
std::shared_ptr< WW8TableCellGridRow > Pointer_t
void setTableBoxVector(TableBoxVectorPtr const &pTableBoxVector)
std::shared_ptr< CellInfoMultiSet > m_pCellInfos
TableBoxVectorPtr m_pTableBoxVector
void setRowSpans(RowSpansPtr const &pRowSpans)
std::shared_ptr< WW8TableCellGrid > Pointer_t
WidthsPtr getWidthsOfRow(WW8TableNodeInfoInner const *pNodeInfo)
WW8TableCellGridRow::Pointer_t getRow(tools::Long nTop, bool bCreate=true)
RowSpansPtr getRowSpansOfRow(WW8TableNodeInfoInner const *pNodeInfo)
WW8TableNodeInfo * connectCells(RowEndInners_t &rLastRowEnds)
RowTops_t::const_iterator getRowTopsEnd() const
void insert(const SwRect &rRect, WW8TableNodeInfo *pNodeInfo, tools::ULong const *pFormatFrameWidth=nullptr)
CellInfoMultiSet::const_iterator getCellsBegin(tools::Long nTop)
CellInfoMultiSet::const_iterator getCellsEnd(tools::Long nTop)
RowTops_t::const_iterator getRowTopsBegin() const
TableBoxVectorPtr getTableBoxesOfRow(WW8TableNodeInfoInner const *pNodeInfo)
WW8TableNodeInfo * processTableBox(const SwTable *pTable, const SwTableBox *pTableBox, sal_uInt32 nRow, sal_uInt32 nCell, sal_uInt32 nDepth, bool bEndOfLine, WW8TableNodeInfo *pPrev, RowEndInners_t &rLastRowEnds)
WW8TableNodeInfo::Pointer_t getTableNodeInfo(const SwNode *pNode)
FirstInTableMap_t mFirstInTableMap
WW8TableCellGrid::Pointer_t getCellGridForTable(const SwTable *pTable, bool bCreate=true)
WW8TableNodeInfo * processTableLine(const SwTable *pTable, const SwTableLine *pTableLine, sal_uInt32 nRow, sal_uInt32 nDepth, WW8TableNodeInfo *pPrev, RowEndInners_t &rLastRowEnds)
WW8TableNodeInfo * reorderByLayout(const SwTable *pTable, RowEndInners_t &rLastRowEnds)
WW8TableNodeInfo * processSwTableByLayout(const SwTable *pTable, RowEndInners_t &rLastRowEnds)
void processSwTable(const SwTable *pTable)
WW8TableNodeInfo::Pointer_t insertTableNodeInfo(const SwNode *pNode, const SwTable *pTable, const SwTableBox *pTableBox, sal_uInt32 nRow, sal_uInt32 nCell, sal_uInt32 nDepth, SwRect const *pRect=nullptr)
WW8TableNodeInfo::Pointer_t processTableBoxLines(const SwTableBox *pBox, const SwTable *pTable, const SwTableBox *pBoxToSet, sal_uInt32 nRow, sal_uInt32 nCell, sal_uInt32 nDepth)
const SwNode * getNextNode(const SwNode *pNode)
CellGridMap_t mCellGridMap
void setTableBox(const SwTableBox *pTableBox)
const SwNode * getNode() const
const SwTableBox * mpTableBox
const SwTableBox * getTableBox() const
void setRect(const SwRect &rRect)
GridColsPtr getGridColsOfRow(AttributeOutputBase &rBase, bool calculateColumnsFromAllRows=false)
const SwTable * getTable() const
void setFinalEndOfLine(bool bEndOfLine)
WidthsPtr getColumnWidthsBasedOnAllRows() const
void setEndOfLine(bool bEndOfLine)
RowSpansPtr getRowSpansOfRow() const
std::string toString() const
void setCell(sal_uInt32 nCell)
void setFirstInTable(bool bFirstInTable)
TableBoxVectorPtr getTableBoxesOfRow() const
void setShadowsBefore(sal_uInt32 nShadowsBefore)
WW8TableNodeInfoInner(WW8TableNodeInfo *pParent)
WW8TableNodeInfo * mpParent
void setDepth(sal_uInt32 nDepth)
void setRow(sal_uInt32 nRow)
const SwRect & getRect() const
WidthsPtr getWidthsOfRow() const
void setEndOfCell(bool bEndOfCell)
void setVertMerge(bool bVertMerge)
std::shared_ptr< WW8TableNodeInfoInner > Pointer_t
void setTable(const SwTable *pTable)
void setShadowsAfter(sal_uInt32 nShadowsAfter)
WW8TableInfo * getParent() const
WW8TableNodeInfoInner::Pointer_t getFirstInner() const
void setNextNode(const SwNode *pNode)
void setShadowsAfter(sal_uInt32 nShadowsAfter)
void setRect(const SwRect &rRect)
void setVertMerge(bool bVertMerge)
void setCell(sal_uInt32 nCell)
void setEndOfLine(bool bEndOfLine)
void setNext(WW8TableNodeInfo *pNext)
WW8TableNodeInfo * getNext() const
void setEndOfCell(bool bEndOfCell)
const SwNode * getNode() const
void setTableBox(const SwTableBox *pTableBox)
sal_uInt32 getCell() const
void setShadowsBefore(sal_uInt32 nShadowsBefore)
void setDepth(sal_uInt32 nDepth)
WW8TableNodeInfo * mpNext
sal_uInt32 getDepth() const
void setFirstInTable(bool bFirstInTable)
WW8TableNodeInfo(WW8TableInfo *pParent, const SwNode *pTextNode)
const SwTableBox * getTableBox() const
std::shared_ptr< WW8TableNodeInfo > Pointer_t
void setRow(sal_uInt32 nRow)
std::string toString() const
WW8TableNodeInfoInner::Pointer_t getInnerForDepth(sal_uInt32 nDepth) const
bool operator<(const WW8TableNodeInfo &rInfo) const
void setTable(const SwTable *pTable)
sal_uInt32 getRow() const
const SwNode * mpNextNode
const SwNode * mpNode
const char * dbg_out(const void *pVoid)
Definition: dbgoutsw.cxx:71
RegionData_Impl * mpParent
sal_Int32 mnRow
OString bottom
sal_Int64 n
uno_Any a
AlgAtomPtr mpNode
#define SAL_INFO(area, stream)
std::shared_ptr< T > make_shared(Args &&... args)
unsigned long ULong
long Long
OUString toString(OptionInfo const *info)
static void updateFinalEndOfLine(RowEndInners_t &rLastRowEnds, WW8TableNodeInfo const *pEndOfCellInfo)
std::shared_ptr< RowSpans > RowSpansPtr
std::shared_ptr< GridCols > GridColsPtr
std::shared_ptr< TableBoxVector > TableBoxVectorPtr
std::multiset< CellInfo > CellInfoMultiSet
std::shared_ptr< Widths > WidthsPtr
std::map< sal_uInt32, WW8TableNodeInfoInner *, std::greater< sal_uInt32 > > RowEndInners_t
const unsigned int MAXTABLECELLS
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
Definition: nodeoffset.hxx:16
void Adjust(SwNodeOffset nDelta)
Adjust node position, and resets content position to zero.
Definition: pam.cxx:257
SwNode & GetNode() const
Definition: pam.hxx:81
std::vector< SwTableBox * > SwTableBoxes
Definition: swtable.hxx:105
tools::Long SwTwips
Definition: swtypes.hxx:51
unsigned char sal_uInt8