1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
10 * Sun Microsystems Inc., October, 2000
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
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.
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.
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,
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.
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.
46 * The Initial Developer of the Original Code is: IBM Corporation
48 * Copyright: 2008 by IBM Corporation
50 * All Rights Reserved.
52 * Contributor(s): _______________________________________
55 ************************************************************************/
58 * For LWP filter architecture prototype - cell layouts
62 #include "lwpcelllayout.hxx"
63 #include "lwpnumericfmt.hxx"
64 #include "lwptable.hxx"
65 #include "lwprowlayout.hxx"
66 #include <lwpfilehdr.hxx>
67 #include <lwpglobalmgr.hxx>
69 #include <sal/log.hxx>
70 #include <comphelper/configuration.hxx>
72 #include <xfilter/xfstylemanager.hxx>
73 #include <xfilter/xfcell.hxx>
74 #include <xfilter/xfcellstyle.hxx>
75 #include <xfilter/xfcolstyle.hxx>
77 LwpCellLayout::LwpCellLayout(LwpObjectHeader
const &objHdr
, LwpSvStream
* pStrm
)
78 : LwpMiddleLayout(objHdr
, pStrm
)
79 , m_bConvertCell(false)
86 LwpCellLayout::~LwpCellLayout()
90 * @short Get table layout pointer, if default cell layout, return NULL
91 * @param LwpTableLayout *
94 LwpTableLayout
* LwpCellLayout::GetTableLayout()
96 LwpRowLayout
* pRow
= dynamic_cast<LwpRowLayout
*>(GetParent().obj().get());
101 LwpTableLayout
* pTableLayout
= pRow
->GetParentTableLayout();
105 * @short Get table pointer, if default cell layout, return NULL
109 LwpTable
* LwpCellLayout::GetTable()
111 LwpTableLayout
* pTableLayout
= GetTableLayout();
116 LwpTable
*pTable
= pTableLayout
->GetTable();
120 * @short Set current cell layout to cell layout map
124 void LwpCellLayout::SetCellMap()
126 LwpTableLayout
* pTableLayout
= GetTableLayout();
128 pTableLayout
->SetWordProCellMap(crowid
, ccolid
, this);
131 * @short Get actual width of this cell layout
135 double LwpCellLayout::GetActualWidth()
138 LwpTableLayout
* pTableLayout
= GetTableLayout();
140 if (pTableLayout
== nullptr)
142 return GetGeometryWidth();
145 OUString strColStyle
= pTableLayout
->GetColumnWidth(ccolid
);
147 XFStyleManager
* pXFStyleManager
= LwpGlobalMgr::GetInstance()->GetXFStyleManager();
148 XFColStyle
*pStyle
= static_cast<XFColStyle
*>(pXFStyleManager
->FindStyle(strColStyle
));
151 return pStyle
->GetWidth();
154 return GetGeometryWidth();
158 * @short Apply padding to cell style
159 * @param pCellStyle - pointer of XFCellStyle
162 void LwpCellLayout::ApplyPadding(XFCellStyle
*pCellStyle
)
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
));
171 * @short Apply border to cell style according to cell position, default cell layout won't use this function
173 * @return pCellStyle - pointer of XFCellStyle
175 void LwpCellLayout::ApplyBorders(XFCellStyle
*pCellStyle
)
177 // judge cell border type
178 LwpCellBorderType eType
= GetCellBorderType(crowid
, ccolid
, GetTableLayout());
180 // get left cell and judge if neighbour border is different
181 std::unique_ptr
<XFBorders
> xBorders(GetXFBorders());
189 case enumNoBottomBorder
:
190 xBorders
->SetWidth(enumXFBorderBottom
, 0);
192 case enumNoLeftBorder
:
193 xBorders
->SetWidth(enumXFBorderLeft
, 0);
195 case enumNoLeftNoBottomBorder
:
196 xBorders
->SetWidth(enumXFBorderBottom
, 0);
197 xBorders
->SetWidth(enumXFBorderLeft
, 0);
199 case enumWholeBorder
:
204 pCellStyle
->SetBorders(xBorders
.release());
207 * @short Apply watermark to cell style
208 * @param pCellStyle - pointer of XFCellStyle
211 void LwpCellLayout::ApplyWatermark(XFCellStyle
*pCellStyle
)
213 std::unique_ptr
<XFBGImage
> xBGImage(GetXFBGImage());
216 pCellStyle
->SetBackImage(xBGImage
);
221 * @short Apply pattern fill to cell style
222 * @param pCellStyle - pointer of XFCellStyle
225 void LwpCellLayout::ApplyPatternFill(XFCellStyle
* pCellStyle
)
227 std::unique_ptr
<XFBGImage
> xXFBGImage(GetFillPattern());
230 pCellStyle
->SetBackImage(xXFBGImage
);
235 * @short Apply background to cell style
236 * @param pCellStyle - pointer of XFCellStyle
239 void LwpCellLayout::ApplyBackGround(XFCellStyle
* pCellStyle
)
243 ApplyPatternFill(pCellStyle
);
247 ApplyBackColor(pCellStyle
);
251 * @short Apply back color to cell style
252 * @param pCellStyle - pointer of XFCellStyle
255 void LwpCellLayout::ApplyBackColor(XFCellStyle
*pCellStyle
)
257 LwpColor
* pColor
= GetBackColor();
258 if(pColor
&& pColor
->IsValidColor())
260 XFColor
aXFColor(pColor
->To24Color());
261 pCellStyle
->SetBackColor(aXFColor
);
265 * @short register style of cell layout
266 * @param pCellStyle The style of the cell, which would be applied to the cell.
269 void LwpCellLayout::ApplyFmtStyle(XFCellStyle
*pCellStyle
)
271 LwpLayoutNumerics
* pLayoutNumerics
= dynamic_cast<LwpLayoutNumerics
*>(cLayNumerics
.obj().get());
272 if (!pLayoutNumerics
)
274 // if current layout doesn't have format, go to based on layout
275 LwpCellLayout
* pCellLayout
= dynamic_cast<LwpCellLayout
*>(GetBasedOnStyle().get());
278 pLayoutNumerics
= dynamic_cast<LwpLayoutNumerics
*>(pCellLayout
->GetNumericsObject().obj().get());
282 // apply format style
285 XFStyle
* pStyle
= pLayoutNumerics
->Convert();
288 XFStyleManager
* pXFStyleManager
= LwpGlobalMgr::GetInstance()->GetXFStyleManager();
289 m_NumfmtName
= pXFStyleManager
->AddStyle(std::unique_ptr
<XFStyle
>(pStyle
)).m_pStyle
->GetStyleName();
290 pCellStyle
->SetDataStyle(m_NumfmtName
);
295 * @short get style name according to cell position, only table default cells use this function
296 * @param nRow - default cell position row number
297 * @param nCol - default cell position col number
298 * @return OUString - registered cell style name
300 OUString
const & LwpCellLayout::GetCellStyleName(sal_uInt16 nRow
, sal_uInt16 nCol
, LwpTableLayout
* pTableLayout
)
302 // judge cell border type
303 LwpCellBorderType eType
= GetCellBorderType(nRow
, nCol
, pTableLayout
);
304 return m_CellStyleNames
[eType
];
308 * @param aTableID - ID of the table which this cell belongs to
309 * @param bIsTopRow - whether current cell is top row
310 * @param bIsRightCol - whether current cell is the rightest column
313 rtl::Reference
<XFCell
> LwpCellLayout::ConvertCell(LwpObjectID aTableID
, sal_uInt16 nRow
, sal_uInt16 nCol
)
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());
323 rtl::Reference
<XFCell
> xXFCell(new XFCell
);
324 OUString aStyleName
= m_StyleName
;
326 // if cell layout is aTableID's default cell layout
327 // we should adjust its style by current position
328 if (pTable
->GetDefaultCellStyle() == GetObjectID())
330 aStyleName
= GetCellStyleName(nRow
, nCol
, pTable
->GetTableLayout().get());
334 LwpStory
* pStory
= dynamic_cast<LwpStory
*>(m_Content
.obj().get());
337 pStory
->XFConvert(xXFCell
.get());
340 ApplyProtect(xXFCell
.get(), aTableID
);
341 xXFCell
->SetStyleName(aStyleName
);
345 LwpPara
* LwpCellLayout::GetLastParaOfPreviousStory()
347 LwpObjectID
* pPreStoryID
= GetPreviousCellStory();
348 if (pPreStoryID
&& !(pPreStoryID
->IsNull()))
350 LwpStory
* pPreStory
= dynamic_cast<LwpStory
*>(pPreStoryID
->obj(VO_STORY
).get());
353 SAL_WARN("lwp", "unexpected null VO_STORY");
356 return dynamic_cast<LwpPara
*>(pPreStory
->GetLastPara().obj(VO_PARA
).get());
365 * @short Get previous cell which used for bullet inside cell
367 * @return LwpObjectID * - object ID of cell content story
369 LwpObjectID
* LwpCellLayout::GetPreviousCellStory()
371 LwpTable
*pTable
= GetTable();
377 sal_uInt16 nRow
= crowid
;
378 sal_uInt16 nCol
= ccolid
;
380 // if table is reset paragraph in columns, get cell on the top side of current cell
381 if (pTable
->IsNumberDown())
391 // if not, get cell on the left side of current cell
401 nCol
= pTable
->GetColumn() - 1;
410 // get the object id pointer of previous cell story
411 LwpTableLayout
* pTableLayout
= GetTableLayout();
417 return pTableLayout
->SearchCellStoryMap(nRow
, nCol
);
421 * @short judge border type by cell neighbour
424 * @param pTableLayout
425 * @return LwpCellBorderType
427 LwpCellBorderType
LwpCellLayout::GetCellBorderType(sal_uInt16 nRow
, sal_uInt16 nCol
, LwpTableLayout
* pTableLayout
)
430 return enumWholeBorder
;
432 // get left cell and judge if neighbour border is different
433 std::unique_ptr
<XFBorders
> xBorders(GetXFBorders());
436 return enumWholeBorder
;
438 XFBorder
& rLeftBorder
= xBorders
->GetLeft();
439 XFBorder
& rBottomBorder
= xBorders
->GetBottom();
440 bool bNoLeftBorder
= false;
441 bool bNoBottomBorder
= false;
443 LwpCellLayout
* pLeftNeighbour
= GetCellByRowCol(nRow
, GetLeftColID(nCol
), pTableLayout
);
446 std::unique_ptr
<XFBorders
> pNeighbourBorders
= pLeftNeighbour
->GetXFBorders();
447 if (pNeighbourBorders
)
449 XFBorder
& rRightBorder
= pNeighbourBorders
->GetRight();
450 if (rLeftBorder
== rRightBorder
)
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;
461 LwpCellLayout
* pBelowNeighbour
= GetCellByRowCol(GetBelowRowID(nRow
), nCol
, pTableLayout
);
462 if (pBelowNeighbour
) //&& (eType == enumRightNotLastCellBorder || eType == enumLeftNotLastCellBorder) )
464 std::unique_ptr
<XFBorders
> pBelowBorders
= pBelowNeighbour
->GetXFBorders();
467 XFBorder
& rTopBorder
= pBelowBorders
->GetTop();
468 if (rTopBorder
== rBottomBorder
)
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;
484 return enumNoLeftNoBottomBorder
;
486 return enumNoBottomBorder
;
490 return enumNoLeftBorder
;
492 return enumWholeBorder
;
496 * @short Get neighbour cell by specifying ROW+COL
499 * @return LwpCellLayout *
501 LwpCellLayout
* LwpCellLayout::GetCellByRowCol(sal_uInt16 nRow
, sal_uInt16 nCol
, LwpTableLayout
* pTableLayout
)
503 return pTableLayout
->GetCellByRowCol(nRow
, nCol
);
506 * @short Register table's default cell layout
510 void LwpCellLayout::RegisterDefaultCell()
512 XFStyleManager
* pXFStyleManager
= LwpGlobalMgr::GetInstance()->GetXFStyleManager();
513 for (sal_uInt16 eLoop
= enumWholeBorder
; eLoop
< enumCellBorderTopLimit
; eLoop
++)
515 // register cell style
516 std::unique_ptr
<XFCellStyle
> xCellStyle(new XFCellStyle());
518 ApplyPadding(xCellStyle
.get());
519 ApplyBackColor(xCellStyle
.get());
520 ApplyWatermark(xCellStyle
.get());
521 ApplyFmtStyle(xCellStyle
.get());
522 xCellStyle
->SetAlignType(enumXFAlignNone
, GetVerticalAlignmentType());
524 std::unique_ptr
<XFBorders
> xBorders(GetXFBorders());
529 case enumNoBottomBorder
:
533 // remove bottom line
534 xBorders
->SetWidth(enumXFBorderBottom
, 0);
536 case enumNoLeftNoBottomBorder
:
540 // remove left and bottom
541 xBorders
->SetWidth(enumXFBorderLeft
, 0);
542 xBorders
->SetWidth(enumXFBorderBottom
, 0);
544 case enumWholeBorder
:
550 case enumNoLeftBorder
:
555 xBorders
->SetWidth(enumXFBorderLeft
, 0);
560 xCellStyle
->SetBorders(xBorders
.release());
562 m_CellStyleNames
[eLoop
] = pXFStyleManager
->AddStyle(std::move(xCellStyle
)).m_pStyle
->GetStyleName();
566 * @short Register 4 types of cell style and register content styles
572 void LwpCellLayout::RegisterStyle()
574 rtl::Reference
<LwpVirtualLayout
> xParent(dynamic_cast<LwpVirtualLayout
*>(GetParent().obj().get()));
575 if (!xParent
.is() || xParent
->GetLayoutType() != LWP_ROW_LAYOUT
)
577 // default cell layout, we must register 4 styles for it
578 RegisterDefaultCell();
582 // register cell style
583 std::unique_ptr
<XFCellStyle
> xCellStyle(new XFCellStyle
);
585 ApplyPadding(xCellStyle
.get());
586 ApplyBackGround(xCellStyle
.get());
587 ApplyWatermark(xCellStyle
.get());
588 ApplyFmtStyle(xCellStyle
.get());
589 ApplyBorders(xCellStyle
.get());
591 xCellStyle
->SetAlignType(enumXFAlignNone
, GetVerticalAlignmentType());
593 XFStyleManager
* pXFStyleManager
= LwpGlobalMgr::GetInstance()->GetXFStyleManager();
594 m_StyleName
= pXFStyleManager
->AddStyle(std::move(xCellStyle
)).m_pStyle
->GetStyleName();
596 // content object register styles
597 rtl::Reference
<LwpObject
> pObj
= m_Content
.obj();
600 pObj
->SetFoundry(m_pFoundry
);
601 pObj
->DoRegisterStyle();
604 //register child layout style
605 RegisterChildStyle();
608 * @short Read cell layout
612 void LwpCellLayout::Read()
614 LwpObjectStream
* pStrm
= m_pObjStrm
.get();
616 LwpMiddleLayout::Read();
618 // before the layout hierarchy rework
619 if (LwpFileHeader::m_nFileRevision
< 0x000b)
625 crowid
= pStrm
->QuickReaduInt16();
626 ccolid
= static_cast<sal_uInt8
>(pStrm
->QuickReaduInt16()); // written as a lushort
630 type
= pStrm
->QuickReaduInt16();
632 cType
= static_cast<LeaderDotType
>(type
);
634 cLayNumerics
.ReadIndexed(pStrm
);
635 cLayDiagonalLine
.ReadIndexed(pStrm
);
642 * Apply protect attribute to cell of table
643 * @param aTableID - ID of the table which the cell belongs to
647 void LwpCellLayout::ApplyProtect(XFCell
* pCell
, LwpObjectID aTableID
)
649 bool bProtected
= false;
650 // judge current cell
651 if (GetIsProtected())
658 LwpCellLayout
* pBase
= dynamic_cast<LwpCellLayout
*>(GetBasedOnStyle().get());
659 if (pBase
&& pBase
->GetIsProtected())
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())
676 pCell
->SetProtect(bProtected
);
679 LwpConnectedCellLayout::LwpConnectedCellLayout(LwpObjectHeader
const &objHdr
, LwpSvStream
* pStrm
)
680 : LwpCellLayout(objHdr
, pStrm
)
688 LwpConnectedCellLayout::~LwpConnectedCellLayout()
691 * @short Set current connected cell layout to cell layout map
692 * @param pCellLayoutMap - cell layout map reference
695 void LwpConnectedCellLayout::SetCellMap()
697 LwpTableLayout
* pTableLayout
= GetTableLayout();
701 sal_uInt16 nRowSpan
= m_nRealrowspan
;
703 for (sal_uInt16 iLoop
= 0; iLoop
< nRowSpan
; iLoop
++)
705 for (sal_uInt16 jLoop
= 0; jLoop
< cnumcols
; jLoop
++)
706 pTableLayout
->SetWordProCellMap(iLoop
+ crowid
, jLoop
+ ccolid
, this);
711 * @short judge border type by cell neighbour
714 * @param pTableLayout
715 * @return LwpCellBorderType
717 LwpCellBorderType
LwpConnectedCellLayout::GetCellBorderType(sal_uInt16 nRow
, sal_uInt16 nCol
, LwpTableLayout
* pTableLayout
)
720 throw std::runtime_error("missing table layout");
722 sal_uInt16 nRowSpan
= m_nRealrowspan
;
724 // get left cell and judge if neighbour border is different
725 std::unique_ptr
<XFBorders
> xBorders(GetXFBorders());
728 return enumWholeBorder
;
730 XFBorder
& rLeftBorder
= xBorders
->GetLeft();
731 XFBorder
& rBottomBorder
= xBorders
->GetBottom();
732 bool bNoLeftBorder
= true;
733 bool bNoBottomBorder
= true;
737 bNoLeftBorder
= false;
741 for (sal_uInt16 iLoop
=0; iLoop
< nRowSpan
; iLoop
++)
743 LwpCellLayout
* pLeftNeighbour
= GetCellByRowCol(nRow
+iLoop
, GetLeftColID(nCol
), pTableLayout
);
746 std::unique_ptr
<XFBorders
> pNeighbourBorders(pLeftNeighbour
->GetXFBorders());
747 if (pNeighbourBorders
)
749 XFBorder
& rRightBorder
= pNeighbourBorders
->GetRight();
750 if (rLeftBorder
!= rRightBorder
)
752 // if left border is different with right border of left cell
753 // we should not ignored it
754 bNoLeftBorder
= false;
762 LwpTable
* pTable
= pTableLayout
->GetTable();
764 throw std::runtime_error("missing table");
766 if ( (nRow
+ nRowSpan
) == pTable
->GetRow())
768 bNoBottomBorder
= false;
772 for (sal_uInt16 iLoop
= 0; iLoop
< cnumcols
; iLoop
++)
774 LwpCellLayout
* pBelowNeighbour
= GetCellByRowCol(nRow
+ nRowSpan
, nCol
+iLoop
, pTableLayout
);
777 std::unique_ptr
<XFBorders
> pBelowBorders(pBelowNeighbour
->GetXFBorders());
780 XFBorder
& rTopBorder
= pBelowBorders
->GetTop();
781 if (rTopBorder
!= rBottomBorder
)
783 // if bottom border is different with right border of left cell
784 // we should not ignored it
785 bNoBottomBorder
= false;
799 return enumNoLeftNoBottomBorder
;
801 return enumNoBottomBorder
;
805 return enumNoLeftBorder
;
807 return enumWholeBorder
;
810 * @short Read connected cell layout
814 void LwpConnectedCellLayout::Read()
816 LwpCellLayout::Read();
818 cnumrows
= m_pObjStrm
->QuickReaduInt16();
819 sal_uInt16 numcols
= m_pObjStrm
->QuickReaduInt16(); // written as a lushort
820 cnumcols
= static_cast<sal_uInt8
>(numcols
);
822 m_nRealrowspan
= cnumrows
;
823 if (comphelper::IsFuzzing())
824 m_nRealrowspan
= std::min
<sal_uInt16
>(m_nRealrowspan
, 128);
825 m_nRealcolspan
= cnumcols
;
827 m_pObjStrm
->SkipExtra();
830 rtl::Reference
<XFCell
> LwpConnectedCellLayout::ConvertCell(LwpObjectID aTableID
, sal_uInt16 nRow
, sal_uInt16 nCol
)
832 rtl::Reference
<XFCell
> xXFCell
= LwpCellLayout::ConvertCell(aTableID
, nRow
, nCol
);
833 xXFCell
->SetColumnSpaned(cnumcols
);
838 * @short parse connected cell layout
839 * @param pOutputStream - output stream
842 void LwpConnectedCellLayout::Parse(IXFStream
* /*pOutputStream*/)
846 LwpHiddenCellLayout::LwpHiddenCellLayout(LwpObjectHeader
const &objHdr
, LwpSvStream
* pStrm
)
847 : LwpCellLayout(objHdr
, pStrm
)
850 LwpHiddenCellLayout::~LwpHiddenCellLayout()
853 * @short Set current hidden cell layout to cell layout map
857 void LwpHiddenCellLayout::SetCellMap()
861 * @short Read hidden cell layout
865 void LwpHiddenCellLayout::Read()
867 LwpCellLayout::Read();
869 cconnectedlayout
.ReadIndexed(m_pObjStrm
.get());
870 m_pObjStrm
->SkipExtra();
874 * @short Convert hidden cell layout
875 * @param aTableID - Object ID of table
876 * @return XFCell * - pointer to converted cell
879 rtl::Reference
<XFCell
> LwpHiddenCellLayout::ConvertCell(LwpObjectID aTableID
, sal_uInt16 nRow
, sal_uInt16 nCol
)
881 if (!cconnectedlayout
.obj().is())
883 LwpConnectedCellLayout
* pConnCell
= dynamic_cast<LwpConnectedCellLayout
* >(cconnectedlayout
.obj().get());
885 if (!pConnCell
|| nRow
< (pConnCell
->GetNumrows()+pConnCell
->GetRowID()))
887 // if the hidden cell should be displayed for limit of SODC
888 // use the default cell layout
889 rtl::Reference
<XFCell
> xXFCell
;
890 LwpTable
*pTable
= dynamic_cast<LwpTable
*>(aTableID
.obj().get());
893 LwpCellLayout
*pDefault
= dynamic_cast<LwpCellLayout
*>(pTable
->GetDefaultCellStyle().obj().get());
896 xXFCell
= pDefault
->DoConvertCell(aTableID
, nRow
, nCol
);
900 xXFCell
= pConnCell
->DoConvertCell(aTableID
, nRow
, nCol
);
902 xXFCell
->SetColumnSpaned(pConnCell
->GetNumcols());
911 * @short parse hidden cell layout
912 * @param pOutputStream - output stream
915 void LwpHiddenCellLayout::Parse(IXFStream
* /*pOutputStream*/)
919 LwpParallelColumnsBlock::LwpParallelColumnsBlock(LwpObjectHeader
const &objHdr
, LwpSvStream
* pStrm
):LwpCellLayout(objHdr
, pStrm
)
922 LwpParallelColumnsBlock::~LwpParallelColumnsBlock()
925 void LwpParallelColumnsBlock::Read()
927 LwpCellLayout::Read();
928 m_pObjStrm
->SkipExtra();
931 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */