update dev300-m58
[ooovba.git] / svx / source / table / viewcontactoftableobj.cxx
blobffc23078b16bde54305708b553bb84f95e3f6eb8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: viewcontactoftableobj.cxx,v $
10 * $Revision: 1.4.18.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
34 #include "viewcontactoftableobj.hxx"
35 #include <svx/svdotable.hxx>
36 #include <com/sun/star/table/XTable.hpp>
37 #include <basegfx/polygon/b2dpolygontools.hxx>
38 #include <basegfx/polygon/b2dpolygon.hxx>
39 #include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
40 #include <drawinglayer/attribute/sdrattribute.hxx>
41 #include <svx/sdr/primitive2d/sdrattributecreator.hxx>
42 #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
43 #include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
44 #include <drawinglayer/attribute/sdrattribute.hxx>
45 #include <svx/sdr/primitive2d/sdrattributecreator.hxx>
46 #include <drawinglayer/attribute/fillattribute.hxx>
47 #include <basegfx/matrix/b2dhommatrix.hxx>
48 #include <svx/sdr/attribute/sdrtextattribute.hxx>
49 #include <svx/sdr/attribute/sdrallattribute.hxx>
50 #include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
51 #include <svx/borderline.hxx>
52 #include <drawinglayer/primitive2d/borderlineprimitive2d.hxx>
54 #include "cell.hxx"
55 #include "tablelayouter.hxx"
57 //////////////////////////////////////////////////////////////////////////////
59 using namespace com::sun::star;
61 //////////////////////////////////////////////////////////////////////////////
63 namespace drawinglayer
65 namespace primitive2d
67 class SdrCellPrimitive2D : public BasePrimitive2D
69 private:
70 basegfx::B2DHomMatrix maTransform;
71 attribute::SdrFillTextAttribute maSdrFTAttribute;
73 protected:
74 // local decomposition.
75 virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
77 public:
78 SdrCellPrimitive2D(
79 const basegfx::B2DHomMatrix& rTransform,
80 const attribute::SdrFillTextAttribute& rSdrFTAttribute)
81 : BasePrimitive2D(),
82 maTransform(rTransform),
83 maSdrFTAttribute(rSdrFTAttribute)
87 // data access
88 const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
89 const attribute::SdrFillTextAttribute& getSdrFTAttribute() const { return maSdrFTAttribute; }
91 // compare operator
92 virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
94 // provide unique ID
95 DeclPrimitrive2DIDBlock()
98 Primitive2DSequence SdrCellPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
100 Primitive2DSequence aRetval;
102 if(getSdrFTAttribute().getFill() || getSdrFTAttribute().getText())
104 // prepare unit polygon
105 const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
106 const basegfx::B2DPolyPolygon aUnitPolyPolygon(basegfx::tools::createPolygonFromRect(aUnitRange));
108 // add fill
109 if(getSdrFTAttribute().getFill())
111 appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(
112 aUnitPolyPolygon,
113 getTransform(),
114 *getSdrFTAttribute().getFill(),
115 getSdrFTAttribute().getFillFloatTransGradient()));
118 // add text
119 if(getSdrFTAttribute().getText())
121 appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(
122 aUnitPolyPolygon,
123 getTransform(),
124 *getSdrFTAttribute().getText(),
126 true, false));
130 return aRetval;
133 bool SdrCellPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
135 if(BasePrimitive2D::operator==(rPrimitive))
137 const SdrCellPrimitive2D& rCompare = (SdrCellPrimitive2D&)rPrimitive;
139 return (getTransform() == rCompare.getTransform()
140 && getSdrFTAttribute() == rCompare.getSdrFTAttribute());
143 return false;
146 // provide unique ID
147 ImplPrimitrive2DIDBlock(SdrCellPrimitive2D, PRIMITIVE2D_ID_SDRCELLPRIMITIVE2D)
149 } // end of namespace primitive2d
150 } // end of namespace drawinglayer
152 //////////////////////////////////////////////////////////////////////////////
154 namespace drawinglayer
156 namespace primitive2d
158 class SdrBorderlinePrimitive2D : public BasePrimitive2D
160 private:
161 basegfx::B2DHomMatrix maTransform;
162 SvxBorderLine maLeftLine;
163 SvxBorderLine maBottomLine;
164 SvxBorderLine maRightLine;
165 SvxBorderLine maTopLine;
167 // bitfield
168 unsigned mbLeftIsOutside : 1;
169 unsigned mbBottomIsOutside : 1;
170 unsigned mbRightIsOutside : 1;
171 unsigned mbTopIsOutside : 1;
172 unsigned mbInTwips : 1;
174 protected:
175 // local decomposition.
176 virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
178 public:
179 SdrBorderlinePrimitive2D(
180 const basegfx::B2DHomMatrix& rTransform,
181 const SvxBorderLine& rLeftLine,
182 const SvxBorderLine& rBottomLine,
183 const SvxBorderLine& rRightLine,
184 const SvxBorderLine& rTopLine,
185 bool bLeftIsOutside,
186 bool bBottomIsOutside,
187 bool bRightIsOutside,
188 bool bTopIsOutside,
189 bool bInTwips)
190 : BasePrimitive2D(),
191 maTransform(rTransform),
192 maLeftLine(rLeftLine),
193 maBottomLine(rBottomLine),
194 maRightLine(rRightLine),
195 maTopLine(rTopLine),
196 mbLeftIsOutside(bLeftIsOutside),
197 mbBottomIsOutside(bBottomIsOutside),
198 mbRightIsOutside(bRightIsOutside),
199 mbTopIsOutside(bTopIsOutside),
200 mbInTwips(bInTwips)
205 // data access
206 const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
207 const SvxBorderLine& getLeftLine() const { return maLeftLine; }
208 const SvxBorderLine& getBottomLine() const { return maBottomLine; }
209 const SvxBorderLine& getRightLine() const { return maRightLine; }
210 const SvxBorderLine& getTopLine() const { return maTopLine; }
211 bool getLeftIsOutside() const { return mbLeftIsOutside; }
212 bool getBottomIsOutside() const { return mbBottomIsOutside; }
213 bool getRightIsOutside() const { return mbRightIsOutside; }
214 bool getTopIsOutside() const { return mbTopIsOutside; }
215 bool getInTwips() const { return mbInTwips; }
217 // compare operator
218 virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
220 // provide unique ID
221 DeclPrimitrive2DIDBlock()
224 sal_uInt16 getBorderLineOutWidth(const SvxBorderLine& rLineA)
226 return (1 == rLineA.GetOutWidth() ? 0 : rLineA.GetOutWidth());
229 sal_uInt16 getBorderLineDistance(const SvxBorderLine& rLineA)
231 return (1 == rLineA.GetDistance() ? 0 : rLineA.GetDistance());
234 sal_uInt16 getBorderLineInWidth(const SvxBorderLine& rLineA)
236 return (1 == rLineA.GetInWidth() ? 0 : rLineA.GetInWidth());
239 sal_uInt16 getBorderLineWidth(const SvxBorderLine& rLineA)
241 return getBorderLineOutWidth(rLineA) + getBorderLineDistance(rLineA) + getBorderLineInWidth(rLineA);
244 double getInnerExtend(const SvxBorderLine& rLineA, bool bSideToUse)
246 if(!rLineA.isEmpty())
248 if(rLineA.isDouble())
250 // reduce to inner edge of associated matching line
251 return -((getBorderLineWidth(rLineA) / 2.0) - (bSideToUse ? getBorderLineOutWidth(rLineA) : getBorderLineInWidth(rLineA)));
253 else
255 // extend to overlap with single line
256 return getBorderLineWidth(rLineA) / 2.0;
260 return 0.0;
263 double getOuterExtend(const SvxBorderLine& rLineA)
265 if(!rLineA.isEmpty())
267 // extend to overlap with single line
268 return getBorderLineWidth(rLineA) / 2.0;
271 return 0.0;
274 double getChangedValue(sal_uInt16 nValue, bool bChangeToMM)
276 if(1 == nValue)
277 return 1.0;
279 if(bChangeToMM)
280 return nValue * (127.0 / 72.0);
282 return (double)nValue;
285 Primitive2DSequence SdrBorderlinePrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
287 Primitive2DSequence xRetval(4);
288 sal_uInt32 nInsert(0);
289 const double fTwipsToMM(getInTwips() ? (127.0 / 72.0) : 1.0);
291 if(!getLeftLine().isEmpty())
293 // create left line from top to bottom
294 const basegfx::B2DPoint aStart(getTransform() * basegfx::B2DPoint(0.0, 0.0));
295 const basegfx::B2DPoint aEnd(getTransform() * basegfx::B2DPoint(0.0, 1.0));
297 if(!aStart.equal(aEnd))
299 const double fExtendIS(getInnerExtend(getTopLine(), false));
300 const double fExtendIE(getInnerExtend(getBottomLine(), true));
301 double fExtendOS(0.0);
302 double fExtendOE(0.0);
304 if(getLeftIsOutside())
306 if(getTopIsOutside())
308 fExtendOS = getOuterExtend(getTopLine());
311 if(getBottomIsOutside())
313 fExtendOE = getOuterExtend(getBottomLine());
317 xRetval[nInsert++] = Primitive2DReference(new BorderLinePrimitive2D(
318 aStart,
319 aEnd,
320 getChangedValue(getLeftLine().GetOutWidth(), getInTwips()),
321 getChangedValue(getLeftLine().GetDistance(), getInTwips()),
322 getChangedValue(getLeftLine().GetInWidth(), getInTwips()),
323 fExtendIS * fTwipsToMM,
324 fExtendIE * fTwipsToMM,
325 fExtendOS * fTwipsToMM,
326 fExtendOE * fTwipsToMM,
327 true,
328 getLeftIsOutside(),
329 getLeftLine().GetColor().getBColor()));
333 if(!getBottomLine().isEmpty())
335 // create bottom line from left to right
336 const basegfx::B2DPoint aStart(getTransform() * basegfx::B2DPoint(0.0, 1.0));
337 const basegfx::B2DPoint aEnd(getTransform() * basegfx::B2DPoint(1.0, 1.0));
339 if(!aStart.equal(aEnd))
341 const double fExtendIS(getInnerExtend(getLeftLine(), true));
342 const double fExtendIE(getInnerExtend(getRightLine(), false));
343 double fExtendOS(0.0);
344 double fExtendOE(0.0);
346 if(getBottomIsOutside())
348 if(getLeftIsOutside())
350 fExtendOS = getOuterExtend(getLeftLine());
353 if(getRightIsOutside())
355 fExtendOE = getOuterExtend(getRightLine());
359 xRetval[nInsert++] = Primitive2DReference(new BorderLinePrimitive2D(
360 aStart,
361 aEnd,
362 getChangedValue(getBottomLine().GetOutWidth(), getInTwips()),
363 getChangedValue(getBottomLine().GetDistance(), getInTwips()),
364 getChangedValue(getBottomLine().GetInWidth(), getInTwips()),
365 fExtendIS * fTwipsToMM,
366 fExtendIE * fTwipsToMM,
367 fExtendOS * fTwipsToMM,
368 fExtendOE * fTwipsToMM,
369 true,
370 getBottomIsOutside(),
371 getBottomLine().GetColor().getBColor()));
375 if(!getRightLine().isEmpty())
377 // create right line from top to bottom
378 const basegfx::B2DPoint aStart(getTransform() * basegfx::B2DPoint(1.0, 0.0));
379 const basegfx::B2DPoint aEnd(getTransform() * basegfx::B2DPoint(1.0, 1.0));
381 if(!aStart.equal(aEnd))
383 const double fExtendIS(getInnerExtend(getTopLine(), false));
384 const double fExtendIE(getInnerExtend(getBottomLine(), true));
385 double fExtendOS(0.0);
386 double fExtendOE(0.0);
388 if(getRightIsOutside())
390 if(getTopIsOutside())
392 fExtendOS = getOuterExtend(getTopLine());
395 if(getBottomIsOutside())
397 fExtendOE = getOuterExtend(getBottomLine());
401 xRetval[nInsert++] = Primitive2DReference(new BorderLinePrimitive2D(
402 aStart,
403 aEnd,
404 getChangedValue(getRightLine().GetOutWidth(), getInTwips()),
405 getChangedValue(getRightLine().GetDistance(), getInTwips()),
406 getChangedValue(getRightLine().GetInWidth(), getInTwips()),
407 fExtendOS * fTwipsToMM,
408 fExtendOE * fTwipsToMM,
409 fExtendIS * fTwipsToMM,
410 fExtendIE * fTwipsToMM,
411 getRightIsOutside(),
412 true,
413 getRightLine().GetColor().getBColor()));
417 if(!getTopLine().isEmpty())
419 // create top line from left to right
420 const basegfx::B2DPoint aStart(getTransform() * basegfx::B2DPoint(0.0, 0.0));
421 const basegfx::B2DPoint aEnd(getTransform() * basegfx::B2DPoint(1.0, 0.0));
423 if(!aStart.equal(aEnd))
425 const double fExtendIS(getInnerExtend(getLeftLine(), true));
426 const double fExtendIE(getInnerExtend(getRightLine(), false));
427 double fExtendOS(0.0);
428 double fExtendOE(0.0);
430 if(getTopIsOutside())
432 if(getLeftIsOutside())
434 fExtendOS = getOuterExtend(getLeftLine());
437 if(getRightIsOutside())
439 fExtendOE = getOuterExtend(getRightLine());
443 xRetval[nInsert++] = Primitive2DReference(new BorderLinePrimitive2D(
444 aStart,
445 aEnd,
446 getChangedValue(getTopLine().GetOutWidth(), getInTwips()),
447 getChangedValue(getTopLine().GetDistance(), getInTwips()),
448 getChangedValue(getTopLine().GetInWidth(), getInTwips()),
449 fExtendOS * fTwipsToMM,
450 fExtendOE * fTwipsToMM,
451 fExtendIS * fTwipsToMM,
452 fExtendIE * fTwipsToMM,
453 getTopIsOutside(),
454 true,
455 getTopLine().GetColor().getBColor()));
459 xRetval.realloc(nInsert);
460 return xRetval;
463 bool SdrBorderlinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
465 if(BasePrimitive2D::operator==(rPrimitive))
467 const SdrBorderlinePrimitive2D& rCompare = (SdrBorderlinePrimitive2D&)rPrimitive;
469 return (getTransform() == rCompare.getTransform()
470 && getLeftLine() == rCompare.getLeftLine()
471 && getBottomLine() == rCompare.getBottomLine()
472 && getRightLine() == rCompare.getRightLine()
473 && getTopLine() == rCompare.getTopLine()
474 && getLeftIsOutside() == rCompare.getLeftIsOutside()
475 && getBottomIsOutside() == rCompare.getBottomIsOutside()
476 && getRightIsOutside() == rCompare.getRightIsOutside()
477 && getTopIsOutside() == rCompare.getTopIsOutside()
478 && getInTwips() == rCompare.getInTwips());
481 return false;
484 // provide unique ID
485 ImplPrimitrive2DIDBlock(SdrBorderlinePrimitive2D, PRIMITIVE2D_ID_SDRBORDERLINEPRIMITIVE2D)
487 } // end of namespace primitive2d
488 } // end of namespace drawinglayer
490 //////////////////////////////////////////////////////////////////////////////
492 namespace sdr
494 namespace contact
496 void impGetLine(SvxBorderLine& aLine, const sdr::table::TableLayouter& rLayouter, sal_Int32 nX, sal_Int32 nY, bool bHorizontal, sal_Int32 nColCount, sal_Int32 nRowCount, bool bIsRTL)
498 if(nX >= 0 && nX <= nColCount && nY >= 0 && nY <= nRowCount)
500 const SvxBorderLine* pLine = rLayouter.getBorderLine(nX, nY, bHorizontal);
502 if(pLine)
504 // copy line content
505 aLine = *pLine;
507 // check for mirroring. This shall always be done when it is
508 // not a top- or rightmost line
509 bool bMirror(aLine.isDouble());
511 if(bMirror)
513 if(bHorizontal)
515 // mirror all bottom lines
516 bMirror = (0 != nY);
518 else
520 // mirror all left lines
521 bMirror = (bIsRTL ? 0 != nX : nX != nColCount);
525 if(bMirror)
527 aLine.SetOutWidth(pLine->GetInWidth());
528 aLine.SetInWidth(pLine->GetOutWidth());
531 return;
535 // no success, copy empty line
536 const SvxBorderLine aEmptyLine;
537 aLine = aEmptyLine;
540 drawinglayer::primitive2d::Primitive2DSequence ViewContactOfTableObj::createViewIndependentPrimitive2DSequence() const
542 drawinglayer::primitive2d::Primitive2DSequence xRetval;
543 const sdr::table::SdrTableObj& rTableObj = GetTableObj();
544 const uno::Reference< com::sun::star::table::XTable > xTable = rTableObj.getTable();
545 const SfxItemSet& rObjectItemSet = rTableObj.GetMergedItemSet();
547 if(xTable.is())
549 // create primitive representation for table
550 const sal_Int32 nRowCount(xTable->getRowCount());
551 const sal_Int32 nColCount(xTable->getColumnCount());
552 const sal_Int32 nAllCount(nRowCount * nColCount);
554 if(nAllCount)
556 const sdr::table::TableLayouter& rTableLayouter = rTableObj.getTableLayouter();
557 const bool bIsRTL(com::sun::star::text::WritingMode_RL_TB == rTableObj.GetWritingMode());
558 sdr::table::CellPos aCellPos;
559 sdr::table::CellRef xCurrentCell;
560 basegfx::B2IRectangle aCellArea;
562 // create range using the model data directly. This is in SdrTextObj::aRect which i will access using
563 // GetGeoRect() to not trigger any calculations. It's the unrotated geometry.
564 const Rectangle& rObjectRectangle(rTableObj.GetGeoRect());
565 const basegfx::B2DRange aObjectRange(rObjectRectangle.Left(), rObjectRectangle.Top(), rObjectRectangle.Right(), rObjectRectangle.Bottom());
567 // for each cell we need potentially a cell primitive and a border primitive
568 // (e.g. single cell). Prepare sequences and input counters
569 drawinglayer::primitive2d::Primitive2DSequence xCellSequence(nAllCount);
570 drawinglayer::primitive2d::Primitive2DSequence xBorderSequence(nAllCount);
571 sal_uInt32 nCellInsert(0);
572 sal_uInt32 nBorderInsert(0);
574 // variables for border lines
575 SvxBorderLine aLeftLine;
576 SvxBorderLine aBottomLine;
577 SvxBorderLine aRightLine;
578 SvxBorderLine aTopLine;
580 // create single primitives per cell
581 for(aCellPos.mnRow = 0; aCellPos.mnRow < nRowCount; aCellPos.mnRow++)
583 for(aCellPos.mnCol = 0; aCellPos.mnCol < nColCount; aCellPos.mnCol++)
585 xCurrentCell.set(dynamic_cast< sdr::table::Cell* >(xTable->getCellByPosition(aCellPos.mnCol, aCellPos.mnRow).get()));
587 if(xCurrentCell.is() && !xCurrentCell->isMerged())
589 if(rTableLayouter.getCellArea(aCellPos, aCellArea))
591 // create cell transformation matrix
592 basegfx::B2DHomMatrix aCellMatrix;
593 aCellMatrix.set(0, 0, (double)aCellArea.getWidth());
594 aCellMatrix.set(1, 1, (double)aCellArea.getHeight());
595 aCellMatrix.set(0, 2, (double)aCellArea.getMinX() + aObjectRange.getMinX());
596 aCellMatrix.set(1, 2, (double)aCellArea.getMinY() + aObjectRange.getMinY());
598 // handle cell fillings and text
599 const SfxItemSet& rCellItemSet = xCurrentCell->GetItemSet();
600 const sal_uInt32 nTextIndex(nColCount * aCellPos.mnRow + aCellPos.mnCol);
601 const SdrText* pSdrText = rTableObj.getText(nTextIndex);
602 drawinglayer::attribute::SdrFillTextAttribute* pAttribute = 0;
604 if(pSdrText)
606 // #i101508# take cell's local text frame distances into account
607 const sal_Int32 nLeft(xCurrentCell->GetTextLeftDistance());
608 const sal_Int32 nRight(xCurrentCell->GetTextRightDistance());
609 const sal_Int32 nUpper(xCurrentCell->GetTextUpperDistance());
610 const sal_Int32 nLower(xCurrentCell->GetTextLowerDistance());
612 pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(
613 rCellItemSet,
614 pSdrText,
615 &nLeft,
616 &nUpper,
617 &nRight,
618 &nLower);
620 else
622 pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(
623 rCellItemSet,
624 pSdrText);
627 if(pAttribute)
629 if(pAttribute->isVisible())
631 const drawinglayer::primitive2d::Primitive2DReference xCellReference(new drawinglayer::primitive2d::SdrCellPrimitive2D(
632 aCellMatrix, *pAttribute));
633 xCellSequence[nCellInsert++] = xCellReference;
636 delete pAttribute;
639 // handle cell borders
640 const sal_Int32 nX(bIsRTL ? nColCount - aCellPos.mnCol : aCellPos.mnCol);
641 const sal_Int32 nY(aCellPos.mnRow);
643 // get access values for X,Y at the cell's end
644 const sal_Int32 nXSpan(xCurrentCell->getColumnSpan());
645 const sal_Int32 nYSpan(xCurrentCell->getRowSpan());
646 const sal_Int32 nXRight(bIsRTL ? nX - nXSpan : nX + nXSpan);
647 const sal_Int32 nYBottom(nY + nYSpan);
649 // get basic lines
650 impGetLine(aLeftLine, rTableLayouter, nX, nY, false, nColCount, nRowCount, bIsRTL);
651 impGetLine(aBottomLine, rTableLayouter, nX, nYBottom, true, nColCount, nRowCount, bIsRTL);
652 impGetLine(aRightLine, rTableLayouter, nXRight, nY, false, nColCount, nRowCount, bIsRTL);
653 impGetLine(aTopLine, rTableLayouter, nX, nY, true, nColCount, nRowCount, bIsRTL);
655 // create the primtive containing all data for one cell with borders
656 xBorderSequence[nBorderInsert++] = drawinglayer::primitive2d::Primitive2DReference(
657 new drawinglayer::primitive2d::SdrBorderlinePrimitive2D(
658 aCellMatrix,
659 aLeftLine,
660 aBottomLine,
661 aRightLine,
662 aTopLine,
663 bIsRTL ? nX == nColCount : 0 == nX,
664 nRowCount == nYBottom,
665 bIsRTL ? 0 == nXRight : nXRight == nColCount,
666 0 == nY,
667 true));
673 // no empty references; reallocate sequences by used count
674 xCellSequence.realloc(nCellInsert);
675 xBorderSequence.realloc(nBorderInsert);
677 // append to target. We want fillings and text first
678 xRetval = xCellSequence;
679 drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, xBorderSequence);
683 if(xRetval.hasElements())
685 // check and create evtl. shadow for created content
686 drawinglayer::attribute::SdrShadowAttribute* pNewShadowAttribute = drawinglayer::primitive2d::createNewSdrShadowAttribute(rObjectItemSet);
688 if(pNewShadowAttribute)
690 xRetval = drawinglayer::primitive2d::createEmbeddedShadowPrimitive(xRetval, *pNewShadowAttribute);
691 delete pNewShadowAttribute;
695 return xRetval;
698 ViewContactOfTableObj::ViewContactOfTableObj(::sdr::table::SdrTableObj& rTableObj)
699 : ViewContactOfSdrObj(rTableObj)
703 ViewContactOfTableObj::~ViewContactOfTableObj()
706 } // end of namespace contact
707 } // end of namespace sdr
709 //////////////////////////////////////////////////////////////////////////////
710 // eof