23#include <com/sun/star/table/XTable.hpp>
62 class SdrCellPrimitive2D :
public BufferedDecompositionPrimitive2D
70 virtual void create2DDecomposition(Primitive2DContainer& rContainer,
const geometry::ViewInformation2D& aViewInformation)
const override;
75 const attribute::SdrFillTextAttribute& rSdrFTAttribute)
83 const attribute::SdrFillTextAttribute& getSdrFTAttribute()
const {
return maSdrFTAttribute; }
86 virtual bool operator==(
const BasePrimitive2D& rPrimitive)
const override;
89 virtual sal_uInt32 getPrimitive2DID()
const override;
94 void SdrCellPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer,
const geometry::ViewInformation2D& )
const
100 if(!getSdrFTAttribute().getFill().isDefault())
104 aTransformed.transform(getTransform());
105 rContainer.push_back(
108 getSdrFTAttribute().getFill(),
109 getSdrFTAttribute().getFillFloatTransGradient()));
114 rContainer.push_back(
122 if(!getSdrFTAttribute().getText().isDefault())
124 rContainer.push_back(
128 getSdrFTAttribute().getText(),
129 attribute::SdrLineAttribute(),
135 bool SdrCellPrimitive2D::operator==(
const BasePrimitive2D& rPrimitive)
const
137 if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
139 const SdrCellPrimitive2D& rCompare =
static_cast<const SdrCellPrimitive2D&
>(rPrimitive);
141 return (getTransform() == rCompare.getTransform()
142 && getSdrFTAttribute() == rCompare.getSdrFTAttribute());
149 sal_uInt32 SdrCellPrimitive2D::getPrimitive2DID()
const
160 class ViewObjectContactOfTableObj :
public ViewObjectContactOfSdrObj
163 ViewObjectContactOfTableObj(ObjectContact& rObjectContact, ViewContact& rViewContact)
164 : ViewObjectContactOfSdrObj(rObjectContact, rViewContact)
182 if(nX >= 0 && nX <= nColCount && nY >= 0 && nY <= nRowCount)
205 bMirror = (bIsRTL ? 0 != nX : nX != nColCount);
214 constexpr double fTwipsToMM(
226 bool const isTaggedPDF,
229 const uno::Reference< css::table::XTable > xTable = rTableObj.
getTable();
238 const sal_Int32 nRowCount(xTable->getRowCount());
239 const sal_Int32 nColCount(xTable->getColumnCount());
240 const sal_Int32 nAllCount(nRowCount * nColCount);
246 const bool bIsRTL(css::text::WritingMode_RL_TB == rTableObj.
GetWritingMode());
275 if(0 == aCellPos.
mnRow)
281 xCurrentCell.set(
dynamic_cast< sdr::table::Cell*
>(xTable->getCellByPosition(aCellPos.
mnCol, aCellPos.
mnRow).get()));
283 if(xCurrentCell.is())
292 if(!xCurrentCell->isMerged())
295 const sal_Int32 nXSpan(xCurrentCell->getColumnSpan());
296 const sal_Int32 nYSpan(xCurrentCell->getRowSpan());
298 if(nXSpan > 1 || nYSpan > 1)
306 if(xCurrentCell.is() && !xCurrentCell->isMerged())
308 if(rTableLayouter.
getCellArea(xCurrentCell, aCellPos, aCellArea))
312 aCellMatrix.
set(0, 0,
static_cast<double>(aCellArea.
getWidth()));
313 aCellMatrix.
set(1, 1,
static_cast<double>(aCellArea.
getHeight()));
314 aCellMatrix.
set(0, 2,
static_cast<double>(aCellArea.
getMinX()) + aObjectRange.
getMinX());
315 aCellMatrix.
set(1, 2,
static_cast<double>(aCellArea.
getMinY()) + aObjectRange.
getMinY());
318 const SfxItemSet& rCellItemSet = xCurrentCell->GetItemSet();
319 const sal_uInt32 nTextIndex(nColCount * aCellPos.
mnRow + aCellPos.
mnCol);
326 const sal_Int32 nLeft(xCurrentCell->GetTextLeftDistance());
327 const sal_Int32 nRight(xCurrentCell->GetTextRightDistance());
328 const sal_Int32 nUpper(xCurrentCell->GetTextUpperDistance());
329 const sal_Int32 nLower(xCurrentCell->GetTextLowerDistance());
349 new drawinglayer::primitive2d::SdrCellPrimitive2D(
350 aCellMatrix, aAttribute));
351 cell.
append(xCellReference);
357 rCellItemSet,
nullptr);
359 =
new drawinglayer::primitive2d::SdrCellPrimitive2D(
360 aCellMatrix, aAttribute);
362 sal_uInt16 nTransparence(
364 if (nTransparence != 0)
366 pCellReference->setTransparenceForShadow(nTransparence);
370 xCellReference(pCellReference);
371 aRetvalForShadow.
append(xCellReference);
374 if (isTaggedPDF && pPage)
392 if (isTaggedPDF && pPage)
407 if(!aCellBorderPrimitives.empty())
421 aTransform.
scale(-1.0, 1.0);
438 aTransform *= aObjectMatrix;
449 aTransform, std::move(aCellBorderPrimitives)));
475 std::move(aRetval), aNewShadowAttribute, aTransformScaleMatrix,
482 std::move(aRetval), aNewShadowAttribute, aTransformScaleMatrix);
488 rVisitor.
visit(std::move(aRetval));
508 rVisitor.
visit(xReference);
512 void ViewObjectContactOfTableObj::createPrimitive2DSequence(
513 DisplayInfo
const& rDisplayInfo,
516 bool const isTaggedPDF(GetObjectContact().isExportTaggedPDF());
541 return *
new ViewObjectContactOfTableObj(rObjectContact, *
this);
The transformation of a rectangle into a polygon, by using angle parameters from GeoStat.
Degree100 m_nRotationAngle
SdrPage * getSdrPageFromSdrObject() const
const SfxItemSet & GetMergedItemSet() const
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
bool IsMasterPage() const
const tools::Rectangle & GetGeoRect() const
const GeoStat & GetGeoStat() const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue)
void translate(double fX, double fY)
void scale(double fX, double fY)
B2DVector getRange() const
B2DPoint getMinimum() const
void append(const Primitive2DReference &)
virtual void visit(const Primitive2DReference &)=0
const TableLayouter & getTableLayouter() const
const sdr::table::TableStyleSettings & getTableStyleSettings() const
css::text::WritingMode GetWritingMode() const
css::uno::Reference< css::table::XTable > getTable() const
virtual SdrText * getText(sal_Int32 nIndex) const override
Returns the nth available text.
sal_Int32 getColumnWidth(sal_Int32 nColumn) const
editeng::SvxBorderLine * getBorderLine(sal_Int32 nEdgeX, sal_Int32 nEdgeY, bool bHorizontal) const
returns the requested borderline in rpBorderLine or a null pointer if there is no border at this edge
sal_Int32 getRowHeight(sal_Int32 nRow) const
bool getCellArea(const CellRef &xCell, const CellPos &rPos, basegfx::B2IRectangle &rArea) const
Stores frame styles of an array of cells, supports merged ranges.
void SetRowHeight(sal_Int32 nRow, sal_Int32 nHeight)
Sets the output height of the specified row.
void SetMergedRange(sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow)
Inserts a new merged cell range.
void SetCellStyleBottom(sal_Int32 nCol, sal_Int32 nRow, const Style &rStyle)
Sets the bottom frame style of the specified cell (nCol,nRow).
void SetCellStyleLeft(sal_Int32 nCol, sal_Int32 nRow, const Style &rStyle)
Sets the left frame style of the cell (nCol,nRow).
void SetCellStyleRight(sal_Int32 nCol, sal_Int32 nRow, const Style &rStyle)
Sets the right frame style of the cell (nCol,nRow).
void SetColWidth(sal_Int32 nCol, sal_Int32 nWidth)
Sets the output width of the specified column.
void Initialize(sal_Int32 nWidth, sal_Int32 nHeight)
Reinitializes the array with the specified size.
drawinglayer::primitive2d::Primitive2DContainer CreateB2DPrimitiveArray() const
Draws the part of the array, that is inside the clipping range.
void SetCellStyleTop(sal_Int32 nCol, sal_Int32 nRow, const Style &rStyle)
Sets the top frame style of the cell (nCol,nRow).
Contains the widths of primary and secondary line of a frame style.
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
B2DHomMatrix createScaleB2DHomMatrix(double fScaleX, double fScaleY)
B2DHomMatrix createScaleShearXRotateTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fShearX, double fRadiant, double fTranslateX, double fTranslateY)
B2DPolygon const & createUnitPolygon()
Primitive2DReference createHiddenGeometryPrimitives2D(const basegfx::B2DHomMatrix &rMatrix)
Primitive2DContainer createEmbeddedShadowPrimitive(Primitive2DContainer &&rContent, const attribute::SdrShadowAttribute &rShadow, const basegfx::B2DHomMatrix &rObjectMatrix, const Primitive2DContainer *pContentForShadow)
attribute::SdrShadowAttribute createNewSdrShadowAttribute(const SfxItemSet &rSet)
Primitive2DReference createTextPrimitive(const basegfx::B2DPolyPolygon &rUnitPolyPolygon, const basegfx::B2DHomMatrix &rObjectTransform, const attribute::SdrTextAttribute &rText, const attribute::SdrLineAttribute &rStroke, bool bCellText, bool bWordWrap)
Primitive2DReference createPolyPolygonFillPrimitive(const basegfx::B2DPolyPolygon &rPolyPolygon, const attribute::SdrFillAttribute &rFill, const attribute::FillGradientAttribute &rFillGradient)
attribute::SdrFillTextAttribute createNewSdrFillTextAttribute(const SfxItemSet &rSet, const SdrText *pText, const sal_Int32 *pLeft, const sal_Int32 *pUpper, const sal_Int32 *pRight, const sal_Int32 *pLower)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_SHADOW(SDRATTR_SHADOW_FIRST+0)
#define PRIMITIVE2D_ID_SDRCELLPRIMITIVE2D
constexpr TypedWhichId< XFillTransparenceItem > XATTR_FILLTRANSPARENCE(XATTR_FILL_FIRST+5)
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)