LibreOffice Module lotuswordpro (master) 1
lwpcelllayout.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*************************************************************************
3 *
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
6 *
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
9 *
10 * Sun Microsystems Inc., October, 2000
11 *
12 * GNU Lesser General Public License Version 2.1
13 * =============================================
14 * Copyright 2000 by Sun Microsystems, Inc.
15 * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 *
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License version 2.1, as published by the Free Software Foundation.
20 *
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 *
31 *
32 * Sun Industry Standards Source License Version 1.1
33 * =================================================
34 * The contents of this file are subject to the Sun Industry Standards
35 * Source License Version 1.1 (the "License"); You may not use this file
36 * except in compliance with the License. You may obtain a copy of the
37 * License at http://www.openoffice.org/license.html.
38 *
39 * Software provided under this License is provided on an "AS IS" basis,
40 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
41 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
42 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
43 * See the License for the specific provisions governing your rights and
44 * obligations concerning the Software.
45 *
46 * The Initial Developer of the Original Code is: IBM Corporation
47 *
48 * Copyright: 2008 by IBM Corporation
49 *
50 * All Rights Reserved.
51 *
52 * Contributor(s): _______________________________________
53 *
54 *
55 ************************************************************************/
61#include <memory>
62#include "lwpcelllayout.hxx"
63#include "lwpnumericfmt.hxx"
64#include "lwptable.hxx"
65#include "lwprowlayout.hxx"
66#include <lwpfilehdr.hxx>
67#include <lwpglobalmgr.hxx>
68
69#include <sal/log.hxx>
71
73#include <xfilter/xfcell.hxx>
76
78 : LwpMiddleLayout(objHdr, pStrm)
79 , m_bConvertCell(false)
80 , crowid(0)
81 , ccolid(0)
82 , cType(LDT_NONE)
83{
84}
85
87{}
88
95{
96 LwpRowLayout * pRow = dynamic_cast<LwpRowLayout *>(GetParent().obj().get());
97 if(!pRow)
98 {
99 return nullptr;
100 }
101 LwpTableLayout * pTableLayout = pRow->GetParentTableLayout();
102 return pTableLayout;
103}
110{
111 LwpTableLayout * pTableLayout = GetTableLayout();
112 if(!pTableLayout)
113 {
114 return nullptr;
115 }
116 LwpTable *pTable = pTableLayout->GetTable();
117 return pTable;
118}
125{
126 LwpTableLayout * pTableLayout = GetTableLayout();
127 if (pTableLayout)
128 pTableLayout->SetWordProCellMap(crowid, ccolid, this);
129}
136{
137 //Get table layout
138 LwpTableLayout * pTableLayout = GetTableLayout();
139
140 if (pTableLayout == nullptr)
141 {
142 return GetGeometryWidth();
143 }
144
145 OUString strColStyle = pTableLayout->GetColumnWidth(ccolid);
146
148 XFColStyle *pStyle = static_cast<XFColStyle *>(pXFStyleManager->FindStyle(strColStyle));
149 if(pStyle)
150 {
151 return pStyle->GetWidth();
152 }
153
154 return GetGeometryWidth();
155}
156
163{
164 double fLeft = GetMarginsValue(MARGIN_LEFT);
165 double fRight = GetMarginsValue(MARGIN_RIGHT);
166 double fTop = GetMarginsValue(MARGIN_TOP);
167 double fBottom = GetMarginsValue(MARGIN_BOTTOM);
168 pCellStyle->SetPadding(static_cast<float>(fLeft),static_cast<float>(fRight),static_cast<float>(fTop),static_cast<float>(fBottom));
169}
176{
177 // judge cell border type
179
180 // get left cell and judge if neighbour border is different
181 std::unique_ptr<XFBorders> xBorders(GetXFBorders());
182 if (!xBorders)
183 {
184 return;
185 }
186
187 switch (eType)
188 {
190 xBorders->SetWidth(enumXFBorderBottom, 0);
191 break;
192 case enumNoLeftBorder:
193 xBorders->SetWidth(enumXFBorderLeft, 0);
194 break;
196 xBorders->SetWidth(enumXFBorderBottom, 0);
197 xBorders->SetWidth(enumXFBorderLeft, 0);
198 break;
199 case enumWholeBorder:
200 break;
201 default:
202 assert(false);
203 }
204 pCellStyle->SetBorders(xBorders.release());
205}
212{
213 std::unique_ptr<XFBGImage> xBGImage(GetXFBGImage());
214 if (xBGImage)
215 {
216 pCellStyle->SetBackImage(xBGImage);
217 }
218}
219
226{
227 std::unique_ptr<XFBGImage> xXFBGImage(GetFillPattern());
228 if (xXFBGImage)
229 {
230 pCellStyle->SetBackImage(xXFBGImage);
231 }
232}
233
240{
241 if (IsPatternFill())
242 {
243 ApplyPatternFill(pCellStyle);
244 }
245 else
246 {
247 ApplyBackColor(pCellStyle);
248 }
249}
256{
257 LwpColor* pColor = GetBackColor();
258 if(pColor && pColor->IsValidColor())
259 {
260 XFColor aXFColor(pColor->To24Color());
261 pCellStyle->SetBackColor(aXFColor);
262 }
263}
270{
271 LwpLayoutNumerics* pLayoutNumerics = dynamic_cast<LwpLayoutNumerics*>(cLayNumerics.obj().get());
272 if (!pLayoutNumerics)
273 {
274 // if current layout doesn't have format, go to based on layout
275 LwpCellLayout* pCellLayout = dynamic_cast<LwpCellLayout*>(GetBasedOnStyle().get());
276 if (pCellLayout)
277 {
278 pLayoutNumerics = dynamic_cast<LwpLayoutNumerics*>(pCellLayout->GetNumericsObject().obj().get());
279 }
280 }
281
282 // apply format style
283 if (pLayoutNumerics)
284 {
285 XFStyle* pStyle = pLayoutNumerics->Convert();
286 if (pStyle)
287 {
289 m_NumfmtName = pXFStyleManager->AddStyle(std::unique_ptr<XFStyle>(pStyle)).m_pStyle->GetStyleName();
290 pCellStyle->SetDataStyle(m_NumfmtName);
291 }
292 }
293}
300OUString const & LwpCellLayout::GetCellStyleName(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout)
301{
302 // judge cell border type
303 LwpCellBorderType eType = GetCellBorderType(nRow, nCol, pTableLayout);
304 return m_CellStyleNames[eType];
305}
313rtl::Reference<XFCell> LwpCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol)
314{
315 // if cell layout is aTableID's default cell layout
316 // it can't have any content, bypass these code
317 LwpTable * pTable = dynamic_cast<LwpTable *>(aTableID.obj().get());
318 if (!pTable)
319 {
320 assert(false);
321 return nullptr;
322 }
323 rtl::Reference<XFCell> xXFCell(new XFCell);
324 OUString aStyleName = m_StyleName;
325
326 // if cell layout is aTableID's default cell layout
327 // we should adjust its style by current position
328 if (pTable->GetDefaultCellStyle() == GetObjectID())
329 {
330 aStyleName = GetCellStyleName(nRow, nCol, pTable->GetTableLayout().get());
331 }
332
333 // content of cell
334 LwpStory* pStory = dynamic_cast<LwpStory*>(m_Content.obj().get());
335 if (pStory)
336 {
337 pStory->XFConvert(xXFCell.get());
338 }
339
340 ApplyProtect(xXFCell.get(), aTableID);
341 xXFCell->SetStyleName(aStyleName);
342 return xXFCell;
343}
344
346{
347 LwpObjectID* pPreStoryID = GetPreviousCellStory();
348 if (pPreStoryID && !(pPreStoryID->IsNull()))
349 {
350 LwpStory* pPreStory = dynamic_cast<LwpStory*>(pPreStoryID->obj(VO_STORY).get());
351 if (!pPreStory)
352 {
353 SAL_WARN("lwp", "unexpected null VO_STORY");
354 return nullptr;
355 }
356 return dynamic_cast<LwpPara*>(pPreStory->GetLastPara().obj(VO_PARA).get());
357 }
358 else
359 {
360 return nullptr;
361 }
362}
363
370{
371 LwpTable *pTable = GetTable();
372 if (!pTable)
373 {
374 assert(false);
375 return nullptr;
376 }
377 sal_uInt16 nRow = crowid;
378 sal_uInt16 nCol = ccolid;
379
380 // if table is reset paragraph in columns, get cell on the top side of current cell
381 if (pTable->IsNumberDown())
382 {
383 if (nRow == 0)
384 {
385 return nullptr;
386 }
387 nRow -=1;
388 }
389 else
390 {
391 // if not, get cell on the left side of current cell
392 if (nCol == 0)
393 {
394 if (nRow == 0)
395 {
396 return nullptr;
397 }
398 else
399 {
400 nRow--;
401 nCol = pTable->GetColumn() - 1;
402 }
403 }
404 else
405 {
406 nCol -=1;
407 }
408 }
409
410 // get the object id pointer of previous cell story
411 LwpTableLayout * pTableLayout = GetTableLayout();
412 if (!pTableLayout)
413 {
414 assert(false);
415 return nullptr;
416 }
417 return pTableLayout->SearchCellStoryMap(nRow, nCol);
418}
419
427LwpCellBorderType LwpCellLayout::GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout)
428{
429 if (!pTableLayout)
430 return enumWholeBorder;
431
432 // get left cell and judge if neighbour border is different
433 std::unique_ptr<XFBorders> xBorders(GetXFBorders());
434 if (!xBorders)
435 {
436 return enumWholeBorder;
437 }
438 XFBorder& rLeftBorder = xBorders->GetLeft();
439 XFBorder& rBottomBorder = xBorders->GetBottom();
440 bool bNoLeftBorder = false;
441 bool bNoBottomBorder = false;
442
443 LwpCellLayout * pLeftNeighbour = GetCellByRowCol(nRow, GetLeftColID(nCol), pTableLayout);
444 if (pLeftNeighbour)
445 {
446 std::unique_ptr<XFBorders> pNeighbourBorders = pLeftNeighbour->GetXFBorders();
447 if (pNeighbourBorders)
448 {
449 XFBorder& rRightBorder = pNeighbourBorders->GetRight();
450 if (rLeftBorder == rRightBorder)
451 {
452 // for these 2 types cell, left border should be ignored for sake of avoiding duplication border
453 // but if left border is different with right border of left cell
454 // we should not ignored it
455 bNoLeftBorder = true;
456 }
457 }
458
459 }
460
461 LwpCellLayout * pBelowNeighbour = GetCellByRowCol(GetBelowRowID(nRow), nCol, pTableLayout);
462 if (pBelowNeighbour) //&& (eType == enumRightNotLastCellBorder || eType == enumLeftNotLastCellBorder) )
463 {
464 std::unique_ptr<XFBorders> pBelowBorders = pBelowNeighbour->GetXFBorders();
465 if (pBelowBorders)
466 {
467 XFBorder& rTopBorder = pBelowBorders->GetTop();
468 if (rTopBorder == rBottomBorder)
469 {
470 // for these 2 types cell, bottom border should be ignored for sake of avoiding duplication border
471 // but if bottom border is different with right border of left cell
472 // we should not ignored it
473 bNoBottomBorder = true;
474 }
475 }
476 }
477
478 xBorders.reset();
479
480 if (bNoBottomBorder)
481 {
482 if (bNoLeftBorder)
483 {
485 }
486 return enumNoBottomBorder;
487 }
488 if (bNoLeftBorder)
489 {
490 return enumNoLeftBorder;
491 }
492 return enumWholeBorder;
493}
494
501LwpCellLayout * LwpCellLayout::GetCellByRowCol(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout)
502{
503 return pTableLayout->GetCellByRowCol(nRow, nCol);
504}
511{
513 for (sal_uInt16 eLoop = enumWholeBorder; eLoop < enumCellBorderTopLimit; eLoop++)
514 {
515 // register cell style
516 std::unique_ptr<XFCellStyle> xCellStyle(new XFCellStyle());
517
518 ApplyPadding(xCellStyle.get());
519 ApplyBackColor(xCellStyle.get());
520 ApplyWatermark(xCellStyle.get());
521 ApplyFmtStyle(xCellStyle.get());
522 xCellStyle->SetAlignType(enumXFAlignNone, GetVerticalAlignmentType());
523
524 std::unique_ptr<XFBorders> xBorders(GetXFBorders());
525 if (xBorders)
526 {
527 switch(eLoop)
528 {
530
531 //| |
532
533 // remove bottom line
534 xBorders->SetWidth(enumXFBorderBottom, 0);
535 break;
537
538 // |
539
540 // remove left and bottom
541 xBorders->SetWidth(enumXFBorderLeft, 0);
542 xBorders->SetWidth(enumXFBorderBottom, 0);
543 break;
544 case enumWholeBorder:
545
546 //||
547
548 // nothing to remove
549 break;
550 case enumNoLeftBorder:
551
552 //| |
553
554 // remove left line
555 xBorders->SetWidth(enumXFBorderLeft, 0);
556 break;
557 default:
558 assert(false);
559 }
560 xCellStyle->SetBorders(xBorders.release());
561 }
562 m_CellStyleNames[eLoop] = pXFStyleManager->AddStyle(std::move(xCellStyle)).m_pStyle->GetStyleName();
563 }
564}
573{
574 rtl::Reference<LwpVirtualLayout> xParent(dynamic_cast<LwpVirtualLayout *>(GetParent().obj().get()));
575 if (!xParent.is() || xParent->GetLayoutType() != LWP_ROW_LAYOUT)
576 {
577 // default cell layout, we must register 4 styles for it
579 return;
580 }
581
582 // register cell style
583 std::unique_ptr<XFCellStyle> xCellStyle(new XFCellStyle);
584
585 ApplyPadding(xCellStyle.get());
586 ApplyBackGround(xCellStyle.get());
587 ApplyWatermark(xCellStyle.get());
588 ApplyFmtStyle(xCellStyle.get());
589 ApplyBorders(xCellStyle.get());
590
591 xCellStyle->SetAlignType(enumXFAlignNone, GetVerticalAlignmentType());
592
594 m_StyleName = pXFStyleManager->AddStyle(std::move(xCellStyle)).m_pStyle->GetStyleName();
595
596 // content object register styles
598 if (pObj.is())
599 {
600 pObj->SetFoundry(m_pFoundry);
601 pObj->DoRegisterStyle();
602 }
603
604 //register child layout style
606}
613{
614 LwpObjectStream* pStrm = m_pObjStrm.get();
615
617
618 // before the layout hierarchy rework
620 {
621 assert(false);
622 }
623 else
624 {
625 crowid = pStrm->QuickReaduInt16();
626 ccolid = static_cast<sal_uInt8>(pStrm->QuickReaduInt16()); // written as a lushort
627
628 sal_uInt16 type;
629
630 type = pStrm->QuickReaduInt16();
631 pStrm->SkipExtra();
632 cType = static_cast<LeaderDotType>(type);
633
636
637 pStrm->SkipExtra();
638 }
639}
640
648{
649 bool bProtected = false;
650 // judge current cell
651 if (GetIsProtected())
652 {
653 bProtected = true;
654 }
655 else
656 {
657 // judge base on
658 LwpCellLayout * pBase = dynamic_cast<LwpCellLayout *>(GetBasedOnStyle().get());
659 if (pBase && pBase->GetIsProtected())
660 {
661 bProtected = true;
662 }
663 else
664 {
665 // judge whole table
666 LwpTable * pTable = dynamic_cast<LwpTable *>(aTableID.obj().get());
667 rtl::Reference<LwpTableLayout> xTableLayout(pTable ? pTable->GetTableLayout() : nullptr);
668 LwpSuperTableLayout * pSuper = xTableLayout.is() ? xTableLayout->GetSuperTableLayout() : nullptr;
669 if (pSuper && pSuper->GetIsProtected())
670 {
671 bProtected = true;
672 }
673 }
674 }
675
676 pCell->SetProtect(bProtected);
677}
678
680 : LwpCellLayout(objHdr, pStrm)
681 , cnumrows(0)
682 , cnumcols(0)
683 , m_nRealrowspan(0)
684 , m_nRealcolspan(0)
685{
686}
687
689{}
696{
697 LwpTableLayout * pTableLayout = GetTableLayout();
698 if (!pTableLayout)
699 return;
700
701 sal_uInt16 nRowSpan = m_nRealrowspan;
702
703 for (sal_uInt16 iLoop = 0; iLoop < nRowSpan; iLoop ++)
704 {
705 for (sal_uInt16 jLoop = 0; jLoop < cnumcols; jLoop ++)
706 pTableLayout->SetWordProCellMap(iLoop + crowid, jLoop + ccolid, this);
707 }
708}
709
717LwpCellBorderType LwpConnectedCellLayout::GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout)
718{
719 if (!pTableLayout)
720 throw std::runtime_error("missing table layout");
721
722 sal_uInt16 nRowSpan = m_nRealrowspan;
723
724 // get left cell and judge if neighbour border is different
725 std::unique_ptr<XFBorders> xBorders(GetXFBorders());
726 if( !xBorders)
727 {
728 return enumWholeBorder;
729 }
730 XFBorder& rLeftBorder = xBorders->GetLeft();
731 XFBorder& rBottomBorder = xBorders->GetBottom();
732 bool bNoLeftBorder = true;
733 bool bNoBottomBorder = true;
734
735 if (nCol == 0)
736 {
737 bNoLeftBorder = false;
738 }
739 else
740 {
741 for (sal_uInt16 iLoop=0; iLoop < nRowSpan; iLoop++)
742 {
743 LwpCellLayout * pLeftNeighbour = GetCellByRowCol(nRow+iLoop, GetLeftColID(nCol), pTableLayout);
744 if (pLeftNeighbour)
745 {
746 std::unique_ptr<XFBorders> pNeighbourBorders(pLeftNeighbour->GetXFBorders());
747 if (pNeighbourBorders)
748 {
749 XFBorder& rRightBorder = pNeighbourBorders->GetRight();
750 if (rLeftBorder != rRightBorder)
751 {
752 // if left border is different with right border of left cell
753 // we should not ignored it
754 bNoLeftBorder = false;
755 break;
756 }
757 }
758 }
759 }
760 }
761
762 LwpTable* pTable = pTableLayout->GetTable();
763 if (!pTable)
764 throw std::runtime_error("missing table");
765
766 if ( (nRow + nRowSpan) == pTable->GetRow())
767 {
768 bNoBottomBorder = false;
769 }
770 else
771 {
772 for (sal_uInt16 iLoop = 0; iLoop < cnumcols; iLoop ++)
773 {
774 LwpCellLayout * pBelowNeighbour = GetCellByRowCol(nRow + nRowSpan, nCol+iLoop, pTableLayout);
775 if (pBelowNeighbour)
776 {
777 std::unique_ptr<XFBorders> pBelowBorders(pBelowNeighbour->GetXFBorders());
778 if (pBelowBorders)
779 {
780 XFBorder& rTopBorder = pBelowBorders->GetTop();
781 if (rTopBorder != rBottomBorder)
782 {
783 // if bottom border is different with right border of left cell
784 // we should not ignored it
785 bNoBottomBorder = false;
786 break;
787 }
788 }
789 }
790 }
791 }
792
793 xBorders.reset();
794
795 if (bNoBottomBorder)
796 {
797 if (bNoLeftBorder)
798 {
800 }
801 return enumNoBottomBorder;
802 }
803 if (bNoLeftBorder)
804 {
805 return enumNoLeftBorder;
806 }
807 return enumWholeBorder;
808}
815{
817
818 cnumrows = m_pObjStrm->QuickReaduInt16();
819 sal_uInt16 numcols = m_pObjStrm->QuickReaduInt16(); // written as a lushort
820 cnumcols = static_cast<sal_uInt8>(numcols);
821
824 m_nRealrowspan = std::min<sal_uInt16>(m_nRealrowspan, 128);
826
827 m_pObjStrm->SkipExtra();
828}
829
831{
832 rtl::Reference<XFCell> xXFCell = LwpCellLayout::ConvertCell(aTableID, nRow, nCol);
833 xXFCell->SetColumnSpaned(cnumcols);
834 return xXFCell;
835}
836
843{
844}
845
847 : LwpCellLayout(objHdr, pStrm)
848{}
849
851{}
858{
859}
866{
868
870 m_pObjStrm->SkipExtra();
871
872}
879rtl::Reference<XFCell> LwpHiddenCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol)
880{
881 if (!cconnectedlayout.obj().is())
882 return nullptr;
883 LwpConnectedCellLayout* pConnCell = dynamic_cast<LwpConnectedCellLayout* >(cconnectedlayout.obj().get());
884
885 if (!pConnCell || nRow < (pConnCell->GetNumrows()+pConnCell->GetRowID()))
886 return nullptr;
887 // if the hidden cell should be displayed for limit of SODC
888 // use the default cell layout
890 LwpTable *pTable = dynamic_cast<LwpTable *>(aTableID.obj().get());
891 if (pTable)
892 {
893 LwpCellLayout *pDefault = dynamic_cast<LwpCellLayout *>(pTable->GetDefaultCellStyle().obj().get());
894 if (pDefault)
895 {
896 xXFCell = pDefault->DoConvertCell(aTableID, nRow, nCol);
897 }
898 else
899 {
900 xXFCell = pConnCell->DoConvertCell(aTableID, nRow, nCol);
901 }
902 xXFCell->SetColumnSpaned(pConnCell->GetNumcols());
903 }
904 else
905 {
906 assert(false);
907 }
908 return xXFCell;
909}
915 void LwpHiddenCellLayout::Parse(IXFStream* /*pOutputStream*/)
916{
917}
918
920{}
921
923{}
924
926{
928 m_pObjStrm->SkipExtra();
929}
930
931/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Stream wrapper for sax writer.
Definition: ixfstream.hxx:72
virtual OUString GetStyleName()=0
@descr: return the style name.
VO_CELLLAYOUT object.
virtual ~LwpCellLayout() override
sal_uInt16 crowid
LwpTableLayout * GetTableLayout()
Get table layout pointer, if default cell layout, return NULL.
virtual void SetCellMap()
Set current cell layout to cell layout map.
void ApplyBorders(XFCellStyle *pCellStyle)
Apply border to cell style according to cell position, default cell layout won't use this function.
static sal_uInt16 GetLeftColID(sal_uInt16 nCol)
LwpObjectID * GetPreviousCellStory()
Get previous cell which used for bullet inside cell.
LwpObjectID cLayDiagonalLine
void Read() override
Read cell layout.
sal_uInt8 ccolid
void ApplyPadding(XFCellStyle *pCellStyle)
Apply padding to cell style.
void RegisterDefaultCell()
Register table's default cell layout.
rtl::Reference< XFCell > DoConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol)
void ApplyPatternFill(XFCellStyle *pCellStyle)
Apply pattern fill to cell style.
LwpObjectID cLayNumerics
void ApplyProtect(XFCell *pCell, LwpObjectID aTableID)
Apply protect attribute to cell of table.
void RegisterStyle() override
Register 4 types of cell style and register content styles.
virtual LwpPara * GetLastParaOfPreviousStory() override
OUString const & GetCellStyleName(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout *pTableLayout)
get style name according to cell position, only table default cells use this function
void ApplyFmtStyle(XFCellStyle *pCellStyle)
register style of cell layout
virtual rtl::Reference< XFCell > ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol)
Make the XFCell.
sal_uInt16 GetRowID() const
OUString m_CellStyleNames[enumCellBorderTopLimit]
OUString m_NumfmtName
LwpObjectID & GetNumericsObject()
virtual LwpCellBorderType GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout *pTableLayout)
judge border type by cell neighbour
double GetActualWidth()
Get actual width of this cell layout.
static LwpCellLayout * GetCellByRowCol(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout *pTableLayout)
Get neighbour cell by specifying ROW+COL.
LeaderDotType cType
LwpCellLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
void ApplyWatermark(XFCellStyle *pCellStyle)
Apply watermark to cell style.
void ApplyBackColor(XFCellStyle *pCellStyle)
Apply back color to cell style.
virtual sal_uInt16 GetBelowRowID(sal_uInt16 nRow)
void ApplyBackGround(XFCellStyle *pCellStyle)
Apply background to cell style.
LwpTable * GetTable()
Get table pointer, if default cell layout, return NULL.
lwpcolor class (red, green, blue, extra)
Definition: lwpcolor.hxx:71
bool IsValidColor() const
Definition: lwpcolor.hxx:114
sal_uInt32 To24Color()
@descr return the BGR format
Definition: lwpcolor.cxx:66
VO_CONNECTEDCELLLAYOUT object.
void Read() override
Read connected cell layout.
LwpConnectedCellLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
virtual ~LwpConnectedCellLayout() override
virtual void Parse(IXFStream *pOutputStream) override
parse connected cell layout
virtual rtl::Reference< XFCell > ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol) override
Make the XFCell.
sal_uInt8 GetNumcols() const
virtual LwpCellBorderType GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout *pTableLayout) override
judge border type by cell neighbour
virtual void SetCellMap() override
Set current connected cell layout to cell layout map.
sal_uInt16 GetNumrows() const
LwpObjectID & GetParent()
Definition: lwpdlvlist.hxx:111
static sal_uInt16 m_nFileRevision
Definition: lwpfilehdr.hxx:77
XFStyleManager * GetXFStyleManager()
static LwpGlobalMgr * GetInstance(LwpSvStream *pSvStream=nullptr)
virtual ~LwpHiddenCellLayout() override
void Read() override
Read hidden cell layout.
LwpHiddenCellLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
virtual void Parse(IXFStream *pOutputStream) override
parse hidden cell layout
virtual void SetCellMap() override
Set current hidden cell layout to cell layout map.
virtual rtl::Reference< XFCell > ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol) override
Convert hidden cell layout.
LwpObjectID cconnectedlayout
XFStyle * Convert()
void Read() override
@descr Read name of LwpDLNFVList from object stream
Definition: lwplayout.cxx:574
std::unique_ptr< XFBorders > GetXFBorders()
@descr: create xfborder.
Definition: lwplayout.cxx:834
std::unique_ptr< XFBGImage > GetXFBGImage()
@descr: Create and return xfbgimage object for watermark
Definition: lwplayout.cxx:1381
LwpObjectID m_Content
Definition: lwplayout.hxx:401
std::unique_ptr< XFBGImage > GetFillPattern()
@descr: Get the fill pattern style.
Definition: lwplayout.cxx:1109
double GetGeometryWidth()
@descr: Get layout width, measured by "cm"
Definition: lwplayout.cxx:677
bool IsPatternFill()
@descr: Whether the fill is pattern fill or not
Definition: lwplayout.cxx:1094
LwpColor * GetBackColor()
@descr: Get background color.
Definition: lwplayout.cxx:894
rtl::Reference< LwpObject > GetBasedOnStyle() const
Definition: lwplayout.cxx:619
Base class of all Lwp VO objects.
Definition: lwpobjhdr.hxx:71
object id class
Definition: lwpobjid.hxx:79
void ReadIndexed(LwpSvStream *pStrm)
@descr Read object id with indexed format from stream if index>0, lowid is get from time table per th...
Definition: lwpobjid.cxx:96
rtl::Reference< LwpObject > obj(VO_TYPE tag=VO_INVALID) const
@descr get object from object factory per the object id
Definition: lwpobjid.cxx:183
bool IsNull() const
Definition: lwpobjid.hxx:110
stream class for LwpObject body data provide stream like interface to read object data
Definition: lwpobjstrm.hxx:77
sal_uInt16 QuickReaduInt16(bool *pFailure=nullptr)
@descr Quick read sal_uInt32
Definition: lwpobjstrm.cxx:200
void SkipExtra()
@descr skip extra bytes
Definition: lwpobjstrm.cxx:258
LwpFoundry * m_pFoundry
Definition: lwpobj.hxx:91
std::unique_ptr< LwpObjectStream > m_pObjStrm
Definition: lwpobj.hxx:90
LwpObjectID & GetObjectID()
Definition: lwpobj.hxx:138
virtual ~LwpParallelColumnsBlock() override
LwpParallelColumnsBlock(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
void Read() override
Read cell layout.
VO_ROWLAYOUT obj.
LwpTableLayout * GetParentTableLayout()
virtual void XFConvert(XFContentContainer *pCont) override
@descr default XFConvert function pCont is the XFContentContainer for the object conversion
Definition: lwpstory.cxx:101
LwpObjectID & GetLastPara()
Definition: lwpstory.hxx:140
VO_SUPERTABLELAYOUT object.
encapsulate XInputStream to provide SvStream like interfaces
Definition: lwpsvstream.hxx:69
VO_TABLELAYOUT object and functions for registering styles and converting tables.
LwpCellLayout * GetCellByRowCol(sal_uInt16 nRow, sal_uInt16 nCol)
Get neighbour cell by specifying ROW+COL.
void SetWordProCellMap(sal_uInt16 nRow, sal_uInt16 nCol, LwpCellLayout *pCell)
LwpObjectID * SearchCellStoryMap(sal_uInt16 nRow, sal_uInt16 nCol)
search the cell map
LwpTable * GetTable()
Get table pointer.
OUString GetColumnWidth(sal_uInt16 nCol)
Get column style name by column ID.
VO_TABLE object.
Definition: lwptable.hxx:107
rtl::Reference< LwpTableLayout > GetTableLayout()
Definition: lwptable.hxx:118
bool IsNumberDown() const
Definition: lwptable.cxx:127
sal_uInt16 GetRow() const
Definition: lwptable.hxx:116
sal_uInt16 GetColumn() const
Definition: lwptable.hxx:117
LwpObjectID & GetDefaultCellStyle()
Definition: lwptable.hxx:115
enumXFAlignType GetVerticalAlignmentType() const
Definition: lwplayout.hxx:200
OUString m_StyleName
Definition: lwplayout.hxx:249
bool GetIsProtected()
Definition: lwplayout.hxx:126
void RegisterChildStyle()
@descr: Register child layout style
Definition: lwplayout.cxx:327
double GetMarginsValue(sal_uInt8 nWhichSide)
Definition: lwplayout.hxx:153
Single border object for all objects with borders.
Definition: xfborders.hxx:72
@descr Style object for cell.
Definition: xfcellstyle.hxx:85
void SetBackImage(std::unique_ptr< XFBGImage > &rImage)
descr: set cell background image.
Definition: xfcellstyle.cxx:92
void SetBackColor(XFColor const &color)
@descr: Set background color of the cell.
Definition: xfcellstyle.cxx:87
void SetBorders(XFBorders *pBorders)
@descr: The borders are complex, so you have to create one before use.
Definition: xfcellstyle.cxx:97
void SetDataStyle(const OUString &style)
@descr Set cell data format style name.
void SetPadding(double left, double right, double top, double bottom)
@descr: Set the padding of the paragraph.This is the distance between the border and the top of the t...
Definition: xfcellstyle.cxx:75
@descr Table cell object.
Definition: xfcell.hxx:76
void SetProtect(bool protect)
@descr Set cell protected.
Definition: xfcell.hxx:175
Column style, it has only one property-the column width.
Definition: xfcolstyle.hxx:70
double GetWidth() const
@descr return column width.
Definition: xfcolstyle.hxx:100
Color object.
Definition: xfcolor.hxx:70
Style manager for the filter.
IXFStyle * FindStyle(std::u16string_view name)
IXFStyleRet AddStyle(std::unique_ptr< IXFStyle > pStyle)
implements ixfstyle interface.
Definition: xfstyle.hxx:70
static bool IsFuzzing()
DocumentType eType
#define SAL_WARN(area, stream)
For LWP filter architecture prototype - cell layouts.
LwpCellBorderType
@ enumNoLeftBorder
@ enumWholeBorder
@ enumCellBorderTopLimit
@ enumNoLeftNoBottomBorder
@ enumNoBottomBorder
@ VO_PARA
Definition: lwpdefs.hxx:70
@ VO_STORY
Definition: lwpdefs.hxx:72
const sal_uInt8 MARGIN_BOTTOM
Definition: lwpmargins.hxx:66
const sal_uInt8 MARGIN_RIGHT
Definition: lwpmargins.hxx:64
const sal_uInt8 MARGIN_TOP
Definition: lwpmargins.hxx:65
const sal_uInt8 MARGIN_LEFT
Definition: lwpmargins.hxx:63
For LWP filter architecture prototype - table object.
For LWP filter architecture prototype - row layouts.
For LWP filter architecture prototype - table object.
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
IXFStyle * m_pStyle
Definition: xfstylecont.hxx:71
unsigned char sal_uInt8
ResultType type
@ enumXFAlignNone
Definition: xfdefs.hxx:173
@ enumXFBorderLeft
Definition: xfdefs.hxx:196
@ enumXFBorderBottom
Definition: xfdefs.hxx:199