21 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
22 #include <com/sun/star/container/XNamed.hpp>
23 #include <com/sun/star/container/XNameAccess.hpp>
24 #include <com/sun/star/container/XIndexAccess.hpp>
28 #include <com/sun/star/style/XStyle.hpp>
29 #include <com/sun/star/beans/XPropertySet.hpp>
43 #include <tablemodel.hxx>
49 #include <svx/strings.hrc>
54 #include <libxml/xmlwriter.h>
57 #include <boost/property_tree/ptree.hpp>
59 using ::com::sun::star::uno::Any;
60 using ::com::sun::star::uno::Reference;
61 using ::com::sun::star::uno::UNO_QUERY;
62 using ::com::sun::star::uno::UNO_QUERY_THROW;
63 using ::com::sun::star::uno::Exception;
64 using ::com::sun::star::container::XIndexAccess;
65 using ::com::sun::star::style::XStyle;
66 using ::com::sun::star::table::XTableRows;
67 using ::com::sun::star::table::XTableColumns;
68 using ::com::sun::star::table::XTable;
70 using ::com::sun::star::util::XModifyBroadcaster;
90 explicit TableProperties(
SdrObject& rObj );
93 TableProperties(
const TableProperties& rProps,
SdrObject& rObj );
96 std::unique_ptr<BaseProperties>
Clone(
SdrObject& rObj)
const override;
98 virtual void ItemChange(
const sal_uInt16 nWhich,
const SfxPoolItem* pNewItem =
nullptr)
override;
103 TableProperties::TableProperties(
SdrObject& rObj)
108 TableProperties::TableProperties(
const TableProperties& rProps,
SdrObject& rObj)
113 std::unique_ptr<BaseProperties> TableProperties::Clone(
SdrObject& rObj)
const
115 return std::unique_ptr<BaseProperties>(
new TableProperties(*
this, rObj));
118 void TableProperties::ItemChange(
const sal_uInt16 nWhich,
const SfxPoolItem* pNewItem)
121 AttributeProperties::ItemChange( nWhich, pNewItem );
123 TextProperties::ItemChange( nWhich, pNewItem );
140 EE_ITEMS_START, EE_ITEMS_END>);
153 TableStyleSettings::TableStyleSettings()
154 : mbUseFirstRow(true)
155 , mbUseLastRow(
false)
156 , mbUseFirstColumn(
false)
157 , mbUseLastColumn(
false)
158 , mbUseRowBanding(true)
159 , mbUseColumnBanding(
false)
201 std::vector<std::unique_ptr<SdrUndoAction>>
maUndos;
223 void DragEdge(
bool mbHorizontal,
int nEdge, sal_Int32 nOffset );
228 virtual void SAL_CALL
modified(
const css::lang::EventObject& aEvent )
override;
231 virtual void SAL_CALL
disposing(
const css::lang::EventObject& Source )
override;
237 virtual bool isInUse()
override;
264 : mpTableObj( nullptr )
265 , mbSkipChangeLayout(
false)
284 const sal_Int32 nColumns(rEnd.
mnCol - rStart.
mnCol + 1);
285 const sal_Int32 nRows(rEnd.
mnRow - rStart.
mnRow + 1);
307 mxTable->init(nColumns, nRows);
310 for( sal_Int32 nRow = 0; nRow < nRows; ++nRow )
312 for( sal_Int32 nCol = 0; nCol < nColumns; ++nCol )
try
314 CellRef xTargetCell( dynamic_cast< Cell* >(
mxTable->getCellByPosition( nCol, nRow ).get() ) );
315 if( xTargetCell.is() )
316 xTargetCell->cloneFrom( dynamic_cast< Cell* >( xOldTable->getCellByPosition( rStart.
mnCol + nCol, rStart.
mnRow + nRow ).get() ) );
325 Reference< XTableRows > xNewRows(
mxTable->getRows(), css::uno::UNO_SET_THROW );
326 static const OUStringLiteral sHeight(
u"Height" );
327 for( sal_Int32 nRow = 0; nRow < nRows; ++nRow )
330 xNewSet->setPropertyValue( sHeight,
Any(
mpLayouter->getRowHeight( rStart.
mnRow + nRow ) ) );
334 Reference< XTableColumns > xNewColumns(
mxTable->getColumns(), css::uno::UNO_SET_THROW );
335 static const OUStringLiteral sWidth(
u"Width" );
336 for( sal_Int32 nCol = 0; nCol < nColumns; ++nCol )
339 xNewSet->setPropertyValue( sWidth,
Any(
mpLayouter->getColumnWidth( rStart.
mnCol + nCol ) ) );
347 Reference< XModifyListener > xListener( static_cast< css::util::XModifyListener* >(
this) );
348 xOldTable->removeModifyListener( xListener );
349 xOldTable->dispose();
357 Reference< XModifyListener > xListener( static_cast< css::util::XModifyListener* >(
this) );
358 mxTable->addModifyListener( xListener );
371 mxTable->init( nColumns, nRows );
372 Reference< XModifyListener > xListener( static_cast< css::util::XModifyListener* >(
this) );
373 mxTable->addModifyListener( xListener );
402 Reference< XModifyListener > xListener( static_cast< css::util::XModifyListener* >(
this) );
403 mxTable->removeModifyListener( xListener );
421 Reference< XModifyListener > xListener( static_cast< css::util::XModifyListener* >(
this) );
422 mxTable->addModifyListener( xListener );
425 Reference< XIndexAccess > xNewTableStyle;
429 if(rSource.
mxTableStyle.is() && &rSourceSdrModel == &rTargetSdrModel)
435 if(!xNewTableStyle.is() && rSource.
mxTableStyle.is())
try
438 const OUString sStyleName( Reference< XNamed >( rSource.
mxTableStyle, UNO_QUERY_THROW )->getName() );
439 Reference< XStyleFamiliesSupplier > xSFS(rTargetSdrModel.getUnoModel(), UNO_QUERY_THROW );
443 if( xTableFamilyAccess->hasByName( sStyleName ) )
446 xTableFamilyAccess->getByName( sStyleName ) >>= xNewTableStyle;
451 Reference< XIndexAccess > xIndexAccess( xTableFamilyAccess, UNO_QUERY_THROW );
452 xIndexAccess->getByIndex( 0 ) >>= xNewTableStyle;
496 Reference< XStyle > xStyle;
523 if( (aPos.
mnRow & 1) == 0 )
535 if( (aPos.
mnCol & 1) == 0 )
559 if( xCell.is() && ( xCell->GetStyleSheet() != pStyle ) )
561 xCell->SetStyleSheet( pStyle,
true );
579 Reference< XModifyListener > xListener( static_cast< css::util::XModifyListener* >(
this) );
580 mxTable->removeModifyListener( xListener );
589 if( !((nEdge >= 0) &&
mxTable.is()))
594 static const OUStringLiteral sSize(
u"Size" );
599 sal_Int32 nHeight =
mpLayouter->getRowHeight( (!nEdge)?nEdge:(nEdge-1) );
604 Reference< XIndexAccess > xRows(
mxTable->getRows(), UNO_QUERY_THROW );
606 xRowSet->setPropertyValue( sSize,
Any( nHeight ) );
630 nWidth =
mpLayouter->getColumnWidth( (!nEdge)?nEdge:(nEdge-1) );
632 Reference< XIndexAccess > xCols(
mxTable->getColumns(), UNO_QUERY_THROW );
637 xColSet->setPropertyValue( sSize,
Any( nWidth ) );
639 else if(!bRTL && nEdge>0)
642 xColSet->setPropertyValue( sSize,
Any( nWidth ) );
651 nWidth = std::max(static_cast<sal_Int32>(nWidth - nOffset), sal_Int32(0));
654 xColSet->setPropertyValue(sSize,
Any(nWidth));
707 Reference< XModifyBroadcaster > xBroadcaster(
mxTableStyle, UNO_QUERY );
708 if( xBroadcaster.is() )
710 Reference< XModifyListener > xListener( static_cast< css::util::XModifyListener* >(
this) );
711 xBroadcaster->addModifyListener( xListener );
721 Reference< XModifyBroadcaster > xBroadcaster(
mxTableStyle, UNO_QUERY );
722 if( xBroadcaster.is() )
724 Reference< XModifyListener > xListener( static_cast< css::util::XModifyListener* >(
this) );
725 xBroadcaster->removeModifyListener( xListener );
738 (
void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SdrTableObjImpl"));
742 (
void)xmlTextWriterEndElement(pWriter);
763 xCell.set( dynamic_cast< Cell* >(
mxTable->getCellByPosition( rPos.
mnCol, rPos.
mnRow ).get() ) );
780 std::vector<sal_Int32> aRet;
783 aRet =
mxTable->getColumnWidths();
802 bool bInteractiveMightGrowBecauseTextChanged =
805 if( bInteractiveMightGrowBecauseTextChanged
825 mpLayouter->LayoutTable( rArea, bFitWidth, bFitHeight );
852 return std::make_unique<TableProperties>(*this);
861 return std::make_unique<sdr::contact::ViewContactOfTableObj>(*this);
894 const ::tools::Rectangle& rNewRect,
906 init( nColumns, nRows );
915 mpImpl->init(
this, nColumns, nRows );
956 if(
mpImpl->mxTable.is() )
970 case WritingMode_LR_TB:
972 case WritingMode_RL_TB:
974 case WritingMode_TB_RL:
985 case WritingMode_LR_TB:
987 case WritingMode_RL_TB:
989 case WritingMode_TB_RL:
1000 case WritingMode_LR_TB:
1001 case WritingMode_RL_TB:
1003 case WritingMode_TB_RL:
1014 case WritingMode_LR_TB:
1015 case WritingMode_RL_TB:
1017 case WritingMode_TB_RL:
1029 if( xCell.is() && xCell->isMerged() )
1031 sal_Int32 nTemp = 0;
1035 if( aPos.
mnCol > 0 )
1040 else if( bEdgeTravel && (aPos.
mnRow > 0) )
1058 if( xCell->isMerged() )
1062 xCell =
mpImpl->getCell(aPos);
1066 aPos.
mnCol += xCell->getColumnSpan();
1072 aPos.
mnCol += xCell->getColumnSpan();
1075 if( aPos.
mnCol <
mpImpl->mxTable->getColumnCount() )
1078 if( bEdgeTravel && ((aPos.
mnRow + 1) <
mpImpl->getRowCount()) )
1098 if( xCell.is() && xCell->isMerged() )
1100 sal_Int32 nTemp = 0;
1104 if( aPos.
mnRow > 0 )
1108 else if( bEdgeTravel && (aPos.
mnCol > 0) )
1127 if( xCell->isMerged() )
1130 xCell =
mpImpl->getCell(aPos);
1135 aPos.
mnRow += xCell->getRowSpan();
1140 if( bEdgeTravel && (aPos.
mnCol + 1) <
mpImpl->mxTable->getColumnCount() )
1145 while( aPos.
mnCol <
mpImpl->mxTable->getColumnCount() )
1147 xCell =
mpImpl->getCell( aPos );
1148 if( xCell.is() && !xCell->isMerged() )
1165 return mpImpl->maTableStyle;
1179 mpImpl->maTableStyle = rStyle;
1193 const sal_Int32 nColCount =
mpImpl->getColumnCount();
1194 const sal_Int32 nRowCount =
mpImpl->getRowCount();
1204 bool bVrtHit =
false;
1207 while( rnX <= nColCount )
1209 if( nX - aTol <= 0 )
1215 if( rnX == nColCount )
1218 nX -=
mpImpl->mpLayouter->getColumnWidth( rnX );
1229 if( nX - aTol <= 0 )
1239 nX -=
mpImpl->mpLayouter->getColumnWidth( rnX );
1248 bool bHrzHit =
false;
1249 while( rnY <= nRowCount )
1251 if( nY - aTol <= 0 )
1257 if( rnY == nRowCount )
1260 nY -=
mpImpl->mpLayouter->getRowHeight(rnY);
1268 if( bVrtHit &&
mpImpl->mpLayouter->isEdgeVisible( rnX, rnY,
false ) )
1271 if( bHrzHit &&
mpImpl->mpLayouter->isEdgeVisible( rnX, rnY,
true ) )
1275 if( xCell.is() && xCell->isMerged() )
1280 nX +=
mpImpl->mpLayouter->getColumnWidth( rnX );
1283 while(xCell.is() && xCell->isMerged())
1285 nX +=
mpImpl->mpLayouter->getColumnWidth( rnX+i );
1287 if(rnX+i < nColCount)
1307 if(
mpImpl.is() && (
mpImpl->mxTableStyle != xTableStyle) )
1309 mpImpl->disconnectTableStyle();
1310 mpImpl->mxTableStyle = xTableStyle;
1311 mpImpl->connectTableStyle();
1321 return mpImpl->mxTableStyle;
1325 static Reference< XIndexAccess > aTmp;
1344 if(
mpImpl->mxTable.is() )
1346 const sal_Int32 nColCount =
mpImpl->getColumnCount();
1349 CellPos aPos( nIndex % nColCount, nIndex / nColCount );
1362 if(
mpImpl->mxTable.is() )
1364 const sal_Int32 nColCount =
mpImpl->getColumnCount();
1365 const sal_Int32 nRowCount =
mpImpl->getRowCount();
1367 return nColCount * nRowCount;
1381 const sal_Int32 nColCount =
mpImpl->mxTable->getColumnCount();
1384 CellPos aPos( nIndex % nColCount, nIndex / nColCount );
1415 assert(
mpImpl.is() &&
mpImpl->mpLayouter &&
"getTableLayouter() error: no mpImpl or mpLayouter (!)");
1416 return *(
mpImpl->mpLayouter);
1505 nStat0 |= EEControlBits::AUTOPAGESIZE;
1525 if (xCell->GetOutlinerParaObject())
1526 pPara = *xCell->GetOutlinerParaObject();
1535 if( !pTestObj || !bHitTest || (pTestObj !=
this) || (pTestObj->GetOutlinerParaObject() != xCell->GetOutlinerParaObject()) )
1558 aTextPos.AdjustY(nFreeHgt/2 );
1560 aTextPos.AdjustY(nFreeHgt );
1564 *pAnchorRect=aAnkRect;
1574 if( !
mpImpl->mxActiveCell.is() )
1579 return mpImpl->mxActiveCell;
1602 mpImpl->DragEdge(bHorizontal, nEdge, nOffset);
1612 mpImpl->mxActiveCell.set( dynamic_cast< Cell* >(
mpImpl->mxTable->getCellByPosition( rPos.
mnCol, rPos.
mnRow ).get() ) );
1613 if(
mpImpl->mxActiveCell.is() &&
mpImpl->mxActiveCell->isMerged() )
1617 mpImpl->mxActiveCell.set( dynamic_cast< Cell* >(
mpImpl->mxTable->getCellByPosition( aOrigin.
mnCol, aOrigin.
mnRow ).get() ) );
1618 mpImpl->maEditPos = aOrigin;
1622 mpImpl->maEditPos = rPos;
1634 rPos =
mpImpl->maEditPos;
1644 rCellRect = xCell->getCellRect();
1664 xCell->TakeTextAnchorRect( aAnkRect );
1668 rAnchorRect=aAnkRect;
1681 Size aPaperMin,aPaperMax;
1686 aAnkSiz.
AdjustWidth( -1 ); aAnkSiz.AdjustHeight( -1 );
1688 Size aMaxSiz(aAnkSiz.Width(),1000000);
1690 if (aTmpSiz.Height()!=0)
1691 aMaxSiz.setHeight(aTmpSiz.Height() );
1698 aPaperMin.
setWidth( aAnkSiz.Width() );
1700 if (pViewMin!=
nullptr)
1702 *pViewMin=aViewInit;
1726 if (pPaperMin!=
nullptr) *pPaperMin=aPaperMin;
1727 if (pPaperMax!=
nullptr) *pPaperMax=aPaperMax;
1728 if (pViewInit!=
nullptr) *pViewInit=aViewInit;
1743 eRet=EEAnchorMode::TopLeft;
1747 eRet=EEAnchorMode::BottomLeft;
1751 eRet=EEAnchorMode::VCenterLeft;
1764 if (!aName.isEmpty())
1765 sName +=
" '" + aName +
"'";
1773 return SvxResId(STR_ObjNamePluralTable);
1815 rOutl.
Init( OutlinerMode::TextObject );
1831 nStat |= EEControlBits::AUTOPAGESIZE;
1852 for (std::unique_ptr<SdrUndoAction>& pAction :
mpImpl->maUndos)
1890 return xCell->GetOutlinerParaObject();
1910 xCell->SetOutlinerParaObject( std::move(pTextObject) );
1923 if (
mpImpl->mbSkipChangeLayout)
1985 mpImpl->LayoutTable( aRectangle, !bWidth, !bHeight );
1987 if( aRectangle != rR )
2008 return rModeItem.
GetValue() == css::text::WritingMode_TB_RL;
2026 return WritingMode_LR_TB;
2032 eWritingMode = pItem->GetValue();
2035 ( eWritingMode != WritingMode_TB_RL ) &&
2038 if ( pItem->GetValue() == SvxFrameDirection::Horizontal_LR_TB )
2039 eWritingMode = WritingMode_LR_TB;
2041 eWritingMode = WritingMode_RL_TB;
2044 return eWritingMode;
2049 mpImpl->maUndos.push_back(std::unique_ptr<SdrUndoAction>(pUndo));
2054 mpImpl->mbSkipChangeLayout = bSkipChangeLayout;
2070 const sal_Int32 nRowCount =
mpImpl->getRowCount();
2071 const sal_Int32 nColCount =
mpImpl->getColumnCount();
2073 if( nRowCount && nColCount )
2074 nCount += nRowCount + nColCount + 2 + 1;
2081 const sal_Int32 nRowCount =
mpImpl->getRowCount();
2082 const sal_Int32 nColCount =
mpImpl->getColumnCount();
2085 std::vector<TableEdgeHdl*> aRowEdges(nRowCount + 1);
2086 for (
auto const & rEdge :
mpImpl->mpLayouter->getHorizontalEdges())
2089 aPoint.AdjustY(rEdge.nPosition);
2091 std::unique_ptr<TableEdgeHdl> pHdl(
new TableEdgeHdl(aPoint,
true, rEdge.nMin, rEdge.nMax, nColCount + 1));
2092 pHdl->SetPointNum(rEdge.nIndex);
2093 aRowEdges[rEdge.nIndex] = pHdl.get();
2094 rHdlList.
AddHdl(std::move(pHdl));
2098 std::vector<TableEdgeHdl*> aColEdges(nColCount + 1);
2099 for (
auto const & rEdge :
mpImpl->mpLayouter->getVerticalEdges())
2102 aPoint.AdjustX(rEdge.nPosition);
2104 std::unique_ptr<TableEdgeHdl> pHdl(
new TableEdgeHdl(aPoint,
false, rEdge.nMin, rEdge.nMax, nRowCount + 1));
2105 pHdl->SetPointNum(rEdge.nIndex);
2106 aColEdges[rEdge.nIndex] = pHdl.get();
2107 rHdlList.
AddHdl(std::move(pHdl));
2117 for( sal_Int32 nRow = 0; nRow <= nRowCount; ++nRow )
2119 const sal_Int32 nRowHeight = (nRow == nRowCount) ? 0 : rLayouter.
getRowHeight(nRow);
2122 for( sal_Int32 nCol = 0; nCol <= nColCount; ++nCol )
2124 const sal_Int32 nColWidth = (nCol == nColCount) ? 0 : rLayouter.
getColumnWidth(nCol);
2126 if( nRowHeight > 0 )
2156 for(
size_t nHdl = 0; nHdl < tempList.
GetHdlCount(); ++nHdl )
2158 tempList.
MoveTo(rHdlList);
2161 for(
size_t nHdl = 0; nHdl < nHdlCount; ++nHdl )
2162 rHdlList.
GetHdl(nHdl)->
SetObj(const_cast<SdrTableObj*>(
this));
2227 if (aNewRectangle !=
maRect)
2348 return PointerStyle::Cross;
2354 xNewCell = Cell::create( *
this );
2360 return std::make_unique<TableObjectGeoData>();
2366 DBG_ASSERT( dynamic_cast< TableObjectGeoData* >( &rGeo ),
"svx::SdrTableObj::SaveGeoData(), illegal geo data!" );
2375 DBG_ASSERT( dynamic_cast< const TableObjectGeoData* >( &rGeo ),
"svx::SdrTableObj::SaveGeoData(), illegal geo data!" );
2393 mpImpl->CropTableModelToSelection(rStart, rEnd);
2401 mpImpl->mpLayouter->DistributeColumns(
maRect, nFirstColumn, nLastColumn, bOptimize, bMinimize );
2411 mpImpl->mpLayouter->DistributeRows(
maRect, nFirstRow, nLastRow, bOptimize, bMinimize );
2430 mpImpl->mxTable->lockBroadcasts();
2437 mpImpl->mxTable->unlockBroadcasts();
2442 (
void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SdrTableObj"));
2443 (
void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
2447 mpImpl->dumpAsXml(pWriter);
2449 (
void)xmlTextWriterEndElement(pWriter);
2458 boost::property_tree::ptree aTableColumns;
2462 boost::property_tree::ptree
aEntries;
2463 auto const & aEdges =
mpImpl->mpLayouter->getVerticalEdges();
2464 for (
auto & rEdge : aEdges)
2466 if (rEdge.nIndex == 0)
2470 else if (rEdge.nIndex == sal_Int32(aEdges.size() - 1))
2476 boost::property_tree::ptree aEntry;
2480 aEntry.put(
"hidden",
false);
2481 aEntries.push_back(std::make_pair(
"", aEntry));
2484 aTableColumns.push_back(std::make_pair(
"entries", aEntries));
2486 rJsonRoot.add_child(
"columns", aTableColumns);
2488 boost::property_tree::ptree aTableRows;
2492 boost::property_tree::ptree
aEntries;
2493 auto const & aEdges =
mpImpl->mpLayouter->getHorizontalEdges();
2494 for (
auto & rEdge : aEdges)
2496 if (rEdge.nIndex == 0)
2500 else if (rEdge.nIndex == sal_Int32(aEdges.size() - 1))
2506 boost::property_tree::ptree aEntry;
2510 aEntry.put(
"hidden",
false);
2511 aEntries.push_back(std::make_pair(
"", aEntry));
2514 aTableRows.push_back(std::make_pair(
"entries", aEntries));
2516 rJsonRoot.add_child(
"rows", aTableRows);
bool findMergeOrigin(const TableModelRef &xTable, sal_Int32 nMergedX, sal_Int32 nMergedY, sal_Int32 &rOriginX, sal_Int32 &rOriginY)
returns true if the cell(nMergedX,nMergedY) is merged with other cells.
void LayoutTable(tools::Rectangle &rArea, bool bFitWidth, bool bFitHeight)
CellPos getNextRow(const CellPos &rPos, bool bEdgeTravel) const
virtual std::unique_ptr< sdr::properties::BaseProperties > CreateObjectSpecificProperties() override
CellPos getRightCell(const CellPos &rPos, bool bEdgeTravel) const
virtual OutlinerParaObject * GetOutlinerParaObject() const override
static sal_Int32 lastRowCount
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
css::uno::Reference< css::table::XTable > getTable() const
virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt=true, bool bWdt=true)
virtual const tools::Rectangle & GetCurrentBoundRect() const
tools::Long GetDX() const
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
constexpr sal_uInt16 SDRATTR_TABLE_FIRST(SDRATTR_CUSTOMSHAPE_LAST+1)
void setTableStyle(const css::uno::Reference< css::container::XIndexAccess > &xAutoFormatStyle)
constexpr auto toTwips(N number, Length from)
struct _xmlTextWriter * xmlTextWriterPtr
sal_Int32 getRowCount() const
CellPos getUpCell(const CellPos &rPos, bool bEdgeTravel) const
void setWidth(tools::Long nWidth)
static constexpr auto Items
tools::Long GetDY() const
virtual bool IsAutoGrowWidth() const override
const Point & GetStart() const
CellRef getCell(const CellPos &rPos) const
void SetPaperSize(const Size &rSize)
virtual bool beginSpecialDrag(SdrDragStat &rDrag) const override
tools::Long GetTextLeftDistance() const
Left inner spacing to borders.
bool isValid(const sdr::table::CellPos &rPos) const
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat &rDrag) const override
Polygon dragged by the user when creating the object.
basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat &rDrag) const
void CropTableModelToSelection(const CellPos &rStart, const CellPos &rEnd)
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
void TakeTextRect(const sdr::table::CellPos &rPos, SdrOutliner &rOutliner,::tools::Rectangle &rTextRect, bool bNoEditText,::tools::Rectangle *pAnchorRect) const
At the same time, we set the text in the outliner (if applicable the EditOutliners') as well as the P...
void createCell(sdr::table::CellRef &xCell)
virtual void setActiveText(sal_Int32 nIndex) override
Changes the current active text.
virtual bool IsFontwork() const override
Abstract base class (ABC) for all UndoActions of DrawingEngine.
virtual void TakeTextEditArea(Size *pPaperMin, Size *pPaperMax, tools::Rectangle *pViewInit, tools::Rectangle *pViewMin) const override
sal_uInt32 GetPointNum() const
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
virtual void SetBoundRectDirty()
SdrOutliner * GetCellTextEditOutliner(const sdr::table::Cell &rCell) const
void CropTableModelToSelection(const CellPos &rStart, const CellPos &rEnd)
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
const sal_Int32 first_column_style
sal_Int32 GetParagraphCount() const
virtual SfxItemSet & GetItemSet()
virtual void BrkCreate(SdrDragStat &rStat) override
rtl::Reference< SdrTableObjImpl > mpImpl
virtual void EndTextEdit(SdrOutliner &rOutl) override
void Init(OutlinerMode nMode)
constexpr sal_uInt16 SDRATTR_MISC_LAST(SDRATTR_TEXT_CHAINNEXTNAME)
const sal_Int32 last_column_style
All geometrical data of an arbitrary object for use in undo/redo.
void SetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
CellPos getLeftCell(const CellPos &rPos, bool bEdgeTravel) const
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
constexpr TypedWhichId< SvxFrameDirectionItem > EE_PARA_WRITINGDIR(EE_PARA_START+0)
virtual void SetChanged() override
constexpr sal_uInt16 SDRATTR_START(XATTR_START)
virtual sal_uInt32 GetHdlCount() const override
Via GetHdlCount the number of Handles can be retrieved.
static bool rowSizeChanged
virtual PointerStyle GetCreatePointer() const override
get the cursor/pointer that signals creating this object
TableStyleSettings maTableStyle
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...
const SdrHdl * GetHdl() const
virtual bool applySpecialDrag(SdrDragStat &rDrag) override
virtual SdrText * getText(sal_Int32 nIndex) const override
Returns the nth available text.
virtual const tools::Rectangle & GetLogicRect() const override
void SetControlWord(EEControlBits nWord)
virtual std::unique_ptr< SdrObjGeoData > NewGeoData() const override
A derived class must override these 3 methods if it has own geometric data that must be saved for Und...
virtual const tools::Rectangle & GetSnapRect() const override
void DragEdge(bool mbHorizontal, int nEdge, sal_Int32 nOffset)
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
rtl::Reference< Cell > CellRef
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
OUString SvxResId(TranslateId aId)
virtual void NbcSetSnapRect(const tools::Rectangle &rRect) override
css::text::WritingMode GetValue() const
virtual bool IsReallyEdited() const override
Returns true only if we are in edit mode and the user actually changed anything.
SfxStyleSheet * GetStyleSheet() const
void SetOrtho4Possible(bool bOn=true)
bool mbDisableAutoWidthOnDragging
SdrTableObjImpl & operator=(const SdrTableObjImpl &rSource)
void TakeCreateRect(tools::Rectangle &rRect) const
void DistributeColumns(sal_Int32 nFirstColumn, sal_Int32 nLastColumn, const bool bOptimize, const bool bMinimize)
const sdr::table::TableStyleSettings & getTableStyleSettings() const
CellPos getPreviousCell(const CellPos &rPos, bool bEdgeTravel) const
EEControlBits GetControlWord() const
void SetObjectItem(const SfxPoolItem &rItem)
void DistributeRows(sal_Int32 nFirstRow, sal_Int32 nLastRow, const bool bOptimize, const bool bMinimize)
void getActiveCellPos(sdr::table::CellPos &rPos) const
virtual EEAnchorMode GetOutlinerViewAnchorMode() const override
static SdrTableObjImpl * lastLayoutTable
virtual void SetBoundAndSnapRectsDirty(bool bNotMyself=false, bool bRecursive=true)
virtual bool HasText() const override
tools::Rectangle ImpDragCalcRect(const SdrDragStat &rDrag) const
void SetEndDragChangesLayout(bool bOn)
SdrOutliner & GetHitTestOutliner() const
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
CellPos getPreviousRow(const CellPos &rPos, bool bEdgeTravel) const
virtual ~SdrTableObjImpl() override
const SfxPoolItem & GetObjectItem(const sal_uInt16 nWhich) const
virtual void AddToHdlList(SdrHdlList &rHdlList) const override
constexpr TypedWhichId< SvxWritingModeItem > SDRATTR_TEXTDIRECTION(SDRATTR_NOTPERSIST_FIRST+34)
void SetNoSnap(bool bOn=true)
std::vector< sal_Int32 > getColumnWidths() const
Get widths of the columns in the table.
void ResizeRect(tools::Rectangle &rRect, const Point &rRef, const Fraction &rxFact, const Fraction &ryFact)
Reference< XIndexAccess > mxTableStyle
#define TOOLS_WARN_EXCEPTION(area, stream)
void SetObj(SdrObject *pNewObj)
void init(sal_Int32 nColumns, sal_Int32 nRows)
void SetText(const OutlinerParaObject &)
#define DBG_ASSERT(sCon, aError)
virtual void SAL_CALL modified(const css::lang::EventObject &aEvent) override
Reference< XAnimationNode > Clone(const Reference< XAnimationNode > &xSourceNode, const SdPage *pSource, const SdPage *pTarget)
const sal_Int32 first_row_style
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
void MoveTo(SdrHdlList &rOther)
class SAL_NO_VTABLE XPropertySet
TableHitKind
SdrTableHitKind.
SdrOutliner * mpEditingOutliner
virtual bool isInUse() override
const sal_Int32 even_columns_style
void BroadcastObjectChange() const
sal_Int32 getColumnWidth(sal_Int32 nColumn) const
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
CellPos getLastCell() const
sal_Int32 GetPointCount() const
void ActionChanged() const
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
void changeEdge(bool bHorizontal, int nEdge, sal_Int32 nOffset)
SdrModel & getSdrModelFromSdrObject() const
SdrObjUserCall * m_pUserCall
void TakeTextAnchorRect(const sdr::table::CellPos &rPos,::tools::Rectangle &rAnchorRect) const
virtual void SetLogicRect(const tools::Rectangle &rRect)
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
virtual void NbcMove(const Size &rSiz) override
The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and SetLogicRect call the corresponding ...
virtual void SaveGeoData(SdrObjGeoData &rGeo) const override
void SetEndDragChangesAttributes(bool bOn)
std::optional< OutlinerParaObject > CreateParaObject(sal_Int32 nStartPara=0, sal_Int32 nParaCount=EE_PARA_ALL) const
void SetMoveOutside(bool bMoveOutside)
static std::vector< sal_Int32 > lastColWidths
TableHitKind CheckTableHit(const Point &rPos, sal_Int32 &rnX, sal_Int32 &rnY, const sal_uInt16 aTol=0) const
std::unique_ptr< TableLayouter > mpLayouter
tools::Rectangle maLogicRect
CellPos getDownCell(const CellPos &rPos, bool bEdgeTravel) const
virtual SdrTableObj * CloneSdrObject(SdrModel &rTargetModel) const override
bool operator==(const TableStyleSettings &r) const
css::text::WritingMode GetWritingMode() const
Paragraph * GetParagraph(sal_Int32 nAbsPos) const
void setTableStyleSettings(const sdr::table::TableStyleSettings &rStyle)
virtual SdrText * getActiveText() const override
Returns the currently active text.
const css::uno::Reference< css::container::XIndexAccess > & getTableStyle() const
const SfxItemSet & GetActiveCellItemSet() const
static SfxUnoStyleSheet * getUnoStyleSheet(const css::uno::Reference< css::style::XStyle > &xStyle)
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
bool isEdgeVisible(sal_Int32 nEdgeX, sal_Int32 nEdgeY, bool bHorizontal) const
checks if the given edge is visible.
virtual const tools::Rectangle & GetLastBoundRect() const
static CellPos getFirstCell()
size_t GetHdlCount() const
SdrHdl * GetHdl(size_t nNum) const
constexpr sal_uInt16 SDRATTR_SHADOW_LAST(SDRATTR_SHADOWBLUR)
void AddUndo(SdrUndoAction *pUndo)
Add an undo action that should be on the undo stack after ending text edit.
void SetActionRect(const tools::Rectangle &rR)
constexpr sal_uInt16 SDRATTR_TABLE_LAST(SDRATTR_TABLE_TEXT_ROTATION)
sal_Int32 getRowCount() const
friend class SdrTableObjImpl
bool IsTextEditActive() const
EditStatusFlags GetStatusWord() const
void SetMaxAutoPaperSize(const Size &rSz)
virtual bool BegTextEdit(SdrOutliner &rOutl) override
void init(SdrTableObj *pTable, sal_Int32 nColumns, sal_Int32 nRows)
virtual bool MovCreate(SdrDragStat &rStat) override
static tools::Rectangle lastLayoutInputRectangle
virtual bool BegCreate(SdrDragStat &rStat) override
Every object must be able to create itself interactively.
const sal_Int32 odd_columns_style
static tools::Rectangle lastLayoutResultRectangle
tools::Rectangle maLogicRect
static bool lastLayoutFitWidth
sal_Int32 GetValidDragOffset(const SdrDragStat &rDrag) const
virtual OUString TakeObjNameSingul() const override
const sal_Int32 body_style
constexpr tools::Long Height() const
virtual OutlinerParaObject * GetOutlinerParaObject() const override
const sal_Int32 even_rows_style
virtual void AdjustToMaxRect(const tools::Rectangle &rMaxRect, bool bShrinkOnly=false) override
virtual void onEditOutlinerStatusEvent(EditStatus *pEditStatus) override
called from the SdrObjEditView during text edit when the status of the edit outliner changes ...
virtual bool IsVerticalWriting() const override
CellPos getNextCell(const CellPos &rPos, bool bEdgeTravel) const
void SetMinAutoPaperSize(const Size &rSz)
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
void dumpAsXml(xmlTextWriterPtr pWriter) const
tools::Long AdjustWidth(tools::Long n)
virtual void NbcReformatText() override
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
void SetRefDevice(OutputDevice *pRefDev)
virtual void NbcSetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject) override
virtual bool hasSpecialDrag() const override
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
bool IsHorizontalEdge() const
virtual void RestoreGeoData(const SdrObjGeoData &rGeo) override
const Point & GetNow() const
bool SetUpdateLayout(bool bUpdate)
sal_Int32 getRowHeight(sal_Int32 nRow) const
sal_Int32 getColumnCount() const
static sal_Int32 lastColCount
void setActiveCell(const sdr::table::CellPos &rPos)
sal_Int32 getColumnCount() const
static WritingMode lastLayoutMode
void disconnectTableStyle()
void setHeight(tools::Long nHeight)
void UpdateCells(tools::Rectangle const &rArea)
virtual sal_Int32 getTextCount() const override
Returns the number of texts available for this object.
ScXMLEditAttributeMap::Entry const aEntries[]
void SetTextObj(const SdrTextObj *pObj)
SdrTableObj(SdrModel &rSdrModel)
static bool lastLayoutFitHeight
virtual bool BckCreate(SdrDragStat &rStat) override
virtual bool IsAutoGrowHeight() const override
virtual SdrObjKind GetObjIdentifier() const override
std::vector< std::unique_ptr< SdrUndoAction > > maUndos
const SdrTextObj * GetTextObj() const
virtual sal_Int32 CheckTextHit(const Point &rPnt) const override
Returns the index of the text that contains the given point or -1.
virtual void SetVerticalWriting(bool bVertical) override
virtual void SetChanged()
virtual ~SdrTableObj() override
constexpr sal_uInt16 SDRATTR_MISC_FIRST(SDRATTR_CAPTION_LAST+1)
void SetSkipChangeLayout(bool bSkipChangeLayout)
Next time layouting would be done, skip it (to layout at the end of multiple actions).
TableStyleSettings & operator=(const TableStyleSettings &rStyle)
virtual OUString TakeObjNamePlural() const override
static void ImpJustifyRect(tools::Rectangle &rRect)
virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat &rDrag) const override
const OUString & GetName() const
void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle &rBoundRect) const
virtual bool AdjustTextFrameWidthAndHeight() override
const sdr::table::CellRef & getActiveCell() const
The active table has the focus or is currently edited.
const TableLayouter & getTableLayouter() const
const sal_Int32 last_row_style
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
SdrHdlKind GetKind() const
void getCellBounds(const sdr::table::CellPos &rPos,::tools::Rectangle &rCellRect)
bool m_bDetectedRangeSegmentation false
bool createTableEdgesJson(boost::property_tree::ptree &rJsonRoot)
const sal_Int32 odd_rows_style
const Size & GetPaperSize() const