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>
55 #include <rtl/ustrbuf.hxx>
59 #include <boost/property_tree/ptree.hpp>
61 using ::com::sun::star::uno::Any;
62 using ::com::sun::star::uno::Reference;
63 using ::com::sun::star::uno::UNO_QUERY;
64 using ::com::sun::star::uno::UNO_QUERY_THROW;
65 using ::com::sun::star::uno::Exception;
66 using ::com::sun::star::container::XIndexAccess;
67 using ::com::sun::star::style::XStyle;
68 using ::com::sun::star::table::XTableRows;
69 using ::com::sun::star::table::XTableColumns;
70 using ::com::sun::star::table::XTable;
72 using ::com::sun::star::util::XModifyBroadcaster;
88 std::unique_ptr<SfxItemSet> CreateObjectSpecificItemSet(
SfxItemPool& rPool)
override;
92 explicit TableProperties(
SdrObject& rObj );
95 TableProperties(
const TableProperties& rProps,
SdrObject& rObj );
98 std::unique_ptr<BaseProperties>
Clone(
SdrObject& rObj)
const override;
100 virtual void ItemChange(
const sal_uInt16 nWhich,
const SfxPoolItem* pNewItem =
nullptr)
override;
105 TableProperties::TableProperties(
SdrObject& rObj)
110 TableProperties::TableProperties(
const TableProperties& rProps,
SdrObject& rObj)
115 std::unique_ptr<BaseProperties> TableProperties::Clone(
SdrObject& rObj)
const
117 return std::unique_ptr<BaseProperties>(
new TableProperties(*
this, rObj));
120 void TableProperties::ItemChange(
const sal_uInt16 nWhich,
const SfxPoolItem* pNewItem)
123 AttributeProperties::ItemChange( nWhich, pNewItem );
125 TextProperties::ItemChange( nWhich, pNewItem );
129 std::unique_ptr<SfxItemSet> TableProperties::CreateObjectSpecificItemSet(
SfxItemPool& rPool)
131 return std::make_unique<SfxItemSet>(rPool,
155 TableStyleSettings::TableStyleSettings()
156 : mbUseFirstRow(true)
157 , mbUseLastRow(false)
158 , mbUseFirstColumn(false)
159 , mbUseLastColumn(false)
160 , mbUseRowBanding(true)
161 , mbUseColumnBanding(false)
203 std::vector<std::unique_ptr<SdrUndoAction>>
maUndos;
225 void DragEdge(
bool mbHorizontal,
int nEdge, sal_Int32 nOffset );
230 virtual void SAL_CALL
modified(
const css::lang::EventObject& aEvent )
override;
233 virtual void SAL_CALL
disposing(
const css::lang::EventObject& Source )
override;
239 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 const OUString sHeight(
"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 const OUString sWidth(
"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 const OUString sSize(
"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 ) );
629 nWidth =
mpLayouter->getColumnWidth( (!nEdge)?nEdge:(nEdge-1) );
631 Reference< XIndexAccess > xCols(
mxTable->getColumns(), UNO_QUERY_THROW );
636 xColSet->setPropertyValue( sSize,
Any( nWidth ) );
638 else if(!bRTL && nEdge>0)
641 xColSet->setPropertyValue( sSize,
Any( nWidth ) );
650 nWidth = std::max(static_cast<sal_Int32>(nWidth - nOffset), sal_Int32(0));
653 xColSet->setPropertyValue(sSize,
Any(nWidth));
706 Reference< XModifyBroadcaster > xBroadcaster(
mxTableStyle, UNO_QUERY );
707 if( xBroadcaster.is() )
709 Reference< XModifyListener > xListener( static_cast< css::util::XModifyListener* >(
this) );
710 xBroadcaster->addModifyListener( xListener );
720 Reference< XModifyBroadcaster > xBroadcaster(
mxTableStyle, UNO_QUERY );
721 if( xBroadcaster.is() )
723 Reference< XModifyListener > xListener( static_cast< css::util::XModifyListener* >(
this) );
724 xBroadcaster->removeModifyListener( xListener );
737 xmlTextWriterStartElement(pWriter, BAD_CAST(
"SdrTableObjImpl"));
741 xmlTextWriterEndElement(pWriter);
762 xCell.set( dynamic_cast< Cell* >(
mxTable->getCellByPosition( rPos.
mnCol, rPos.
mnRow ).get() ) );
779 std::vector<sal_Int32> aRet;
782 aRet =
mxTable->getColumnWidths();
801 bool bInteractiveMightGrowBecauseTextChanged =
804 if( bInteractiveMightGrowBecauseTextChanged
823 mpLayouter->LayoutTable( rArea, bFitWidth, bFitHeight );
849 return std::make_unique<TableProperties>(*this);
858 return std::make_unique<sdr::contact::ViewContactOfTableObj>(*this);
891 const ::tools::Rectangle& rNewRect,
903 init( nColumns, nRows );
912 mpImpl->init(
this, nColumns, nRows );
953 if(
mpImpl->mxTable.is() )
967 case WritingMode_LR_TB:
969 case WritingMode_RL_TB:
971 case WritingMode_TB_RL:
982 case WritingMode_LR_TB:
984 case WritingMode_RL_TB:
986 case WritingMode_TB_RL:
997 case WritingMode_LR_TB:
998 case WritingMode_RL_TB:
1000 case WritingMode_TB_RL:
1011 case WritingMode_LR_TB:
1012 case WritingMode_RL_TB:
1014 case WritingMode_TB_RL:
1026 if( xCell.is() && xCell->isMerged() )
1028 sal_Int32 nTemp = 0;
1032 if( aPos.
mnCol > 0 )
1037 else if( bEdgeTravel && (aPos.
mnRow > 0) )
1055 if( xCell->isMerged() )
1059 xCell =
mpImpl->getCell(aPos);
1063 aPos.
mnCol += xCell->getColumnSpan();
1069 aPos.
mnCol += xCell->getColumnSpan();
1072 if( aPos.
mnCol <
mpImpl->mxTable->getColumnCount() )
1075 if( bEdgeTravel && ((aPos.
mnRow + 1) <
mpImpl->getRowCount()) )
1095 if( xCell.is() && xCell->isMerged() )
1097 sal_Int32 nTemp = 0;
1101 if( aPos.
mnRow > 0 )
1105 else if( bEdgeTravel && (aPos.
mnCol > 0) )
1124 if( xCell->isMerged() )
1127 xCell =
mpImpl->getCell(aPos);
1132 aPos.
mnRow += xCell->getRowSpan();
1137 if( bEdgeTravel && (aPos.
mnCol + 1) <
mpImpl->mxTable->getColumnCount() )
1142 while( aPos.
mnCol <
mpImpl->mxTable->getColumnCount() )
1144 xCell =
mpImpl->getCell( aPos );
1145 if( xCell.is() && !xCell->isMerged() )
1162 return mpImpl->maTableStyle;
1176 mpImpl->maTableStyle = rStyle;
1190 const sal_Int32 nColCount =
mpImpl->getColumnCount();
1191 const sal_Int32 nRowCount =
mpImpl->getRowCount();
1201 bool bVrtHit =
false;
1204 while( rnX <= nColCount )
1206 if( nX - aTol <= 0 )
1212 if( rnX == nColCount )
1215 nX -=
mpImpl->mpLayouter->getColumnWidth( rnX );
1226 if( nX - aTol <= 0 )
1236 nX -=
mpImpl->mpLayouter->getColumnWidth( rnX );
1245 bool bHrzHit =
false;
1246 while( rnY <= nRowCount )
1248 if( nY - aTol <= 0 )
1254 if( rnY == nRowCount )
1257 nY -=
mpImpl->mpLayouter->getRowHeight(rnY);
1265 if( bVrtHit &&
mpImpl->mpLayouter->isEdgeVisible( rnX, rnY,
false ) )
1268 if( bHrzHit &&
mpImpl->mpLayouter->isEdgeVisible( rnX, rnY,
true ) )
1272 if( xCell.is() && xCell->isMerged() )
1277 nX +=
mpImpl->mpLayouter->getColumnWidth( rnX );
1280 while(xCell.is() && xCell->isMerged())
1282 nX +=
mpImpl->mpLayouter->getColumnWidth( rnX+i );
1284 if(rnX+i < nColCount)
1304 if(
mpImpl.is() && (
mpImpl->mxTableStyle != xTableStyle) )
1306 mpImpl->disconnectTableStyle();
1307 mpImpl->mxTableStyle = xTableStyle;
1308 mpImpl->connectTableStyle();
1318 return mpImpl->mxTableStyle;
1322 static Reference< XIndexAccess > aTmp;
1341 if(
mpImpl->mxTable.is() )
1343 const sal_Int32 nColCount =
mpImpl->getColumnCount();
1346 CellPos aPos( nIndex % nColCount, nIndex / nColCount );
1359 if(
mpImpl->mxTable.is() )
1361 const sal_Int32 nColCount =
mpImpl->getColumnCount();
1362 const sal_Int32 nRowCount =
mpImpl->getRowCount();
1364 return nColCount * nRowCount;
1378 const sal_Int32 nColCount =
mpImpl->mxTable->getColumnCount();
1381 CellPos aPos( nIndex % nColCount, nIndex / nColCount );
1412 assert(
mpImpl.is() &&
mpImpl->mpLayouter &&
"getTableLayouter() error: no mpImpl or mpLayouter (!)");
1413 return *(
mpImpl->mpLayouter);
1502 nStat0 |= EEControlBits::AUTOPAGESIZE;
1530 if( !pTestObj || !bHitTest || (pTestObj !=
this) || (pTestObj->GetOutlinerParaObject() != xCell->GetOutlinerParaObject()) )
1544 if (
pEdtOutl && !bNoEditText && pPara &&
mpImpl->mxActiveCell == xCell )
1556 aTextPos.AdjustY(nFreeHgt/2 );
1558 aTextPos.AdjustY(nFreeHgt );
1562 *pAnchorRect=aAnkRect;
1572 if( !
mpImpl->mxActiveCell.is() )
1577 return mpImpl->mxActiveCell;
1600 mpImpl->DragEdge(bHorizontal, nEdge, nOffset);
1610 mpImpl->mxActiveCell.set( dynamic_cast< Cell* >(
mpImpl->mxTable->getCellByPosition( rPos.
mnCol, rPos.
mnRow ).get() ) );
1611 if(
mpImpl->mxActiveCell.is() &&
mpImpl->mxActiveCell->isMerged() )
1615 mpImpl->mxActiveCell.set( dynamic_cast< Cell* >(
mpImpl->mxTable->getCellByPosition( aOrigin.
mnCol, aOrigin.
mnRow ).get() ) );
1616 mpImpl->maEditPos = aOrigin;
1620 mpImpl->maEditPos = rPos;
1632 rPos =
mpImpl->maEditPos;
1642 rCellRect = xCell->getCellRect();
1662 xCell->TakeTextAnchorRect( aAnkRect );
1666 rAnchorRect=aAnkRect;
1679 Size aPaperMin,aPaperMax;
1684 aAnkSiz.
AdjustWidth( -1 ); aAnkSiz.AdjustHeight( -1 );
1686 Size aMaxSiz(aAnkSiz.Width(),1000000);
1688 if (aTmpSiz.Height()!=0)
1689 aMaxSiz.setHeight(aTmpSiz.Height() );
1696 aPaperMin.
setWidth( aAnkSiz.Width() );
1698 if (pViewMin!=
nullptr)
1700 *pViewMin=aViewInit;
1724 if (pPaperMin!=
nullptr) *pPaperMin=aPaperMin;
1725 if (pPaperMax!=
nullptr) *pPaperMax=aPaperMax;
1726 if (pViewInit!=
nullptr) *pViewInit=aViewInit;
1741 eRet=EEAnchorMode::TopLeft;
1745 eRet=EEAnchorMode::BottomLeft;
1749 eRet=EEAnchorMode::VCenterLeft;
1762 if (!aName.isEmpty())
1766 sName.append(aName);
1770 return sName.makeStringAndClear();
1776 return SvxResId(STR_ObjNamePluralTable);
1818 rOutl.
Init( OutlinerMode::TextObject );
1835 nStat |= EEControlBits::AUTOPAGESIZE;
1856 for (std::unique_ptr<SdrUndoAction>& pAction :
mpImpl->maUndos)
1865 std::unique_ptr<OutlinerParaObject> pNewText;
1894 return xCell->GetOutlinerParaObject();
1914 xCell->SetOutlinerParaObject( std::move(pTextObject) );
1927 if (
mpImpl->mbSkipChangeLayout)
1989 mpImpl->LayoutTable( aRectangle, !bWidth, !bHeight );
1991 if( aRectangle != rR )
2012 return rModeItem.
GetValue() == css::text::WritingMode_TB_RL;
2030 return WritingMode_LR_TB;
2037 eWritingMode = static_cast< const SvxWritingModeItem * >( pItem )->GetValue();
2039 if ( ( eWritingMode != WritingMode_TB_RL ) &&
2042 if ( static_cast< const SvxFrameDirectionItem * >( pItem )->GetValue() == SvxFrameDirection::Horizontal_LR_TB )
2043 eWritingMode = WritingMode_LR_TB;
2045 eWritingMode = WritingMode_RL_TB;
2048 return eWritingMode;
2053 mpImpl->maUndos.push_back(std::unique_ptr<SdrUndoAction>(pUndo));
2058 mpImpl->mbSkipChangeLayout = bSkipChangeLayout;
2074 const sal_Int32 nRowCount =
mpImpl->getRowCount();
2075 const sal_Int32 nColCount =
mpImpl->getColumnCount();
2077 if( nRowCount && nColCount )
2078 nCount += nRowCount + nColCount + 2 + 1;
2085 const sal_Int32 nRowCount =
mpImpl->getRowCount();
2086 const sal_Int32 nColCount =
mpImpl->getColumnCount();
2089 std::vector<TableEdgeHdl*> aRowEdges(nRowCount + 1);
2090 for (
auto const & rEdge :
mpImpl->mpLayouter->getHorizontalEdges())
2093 aPoint.AdjustY(rEdge.nPosition);
2095 std::unique_ptr<TableEdgeHdl> pHdl(
new TableEdgeHdl(aPoint,
true, rEdge.nMin, rEdge.nMax, nColCount + 1));
2096 pHdl->SetPointNum(rEdge.nIndex);
2097 aRowEdges[rEdge.nIndex] = pHdl.get();
2098 rHdlList.
AddHdl(std::move(pHdl));
2102 std::vector<TableEdgeHdl*> aColEdges(nColCount + 1);
2103 for (
auto const & rEdge :
mpImpl->mpLayouter->getVerticalEdges())
2106 aPoint.AdjustX(rEdge.nPosition);
2108 std::unique_ptr<TableEdgeHdl> pHdl(
new TableEdgeHdl(aPoint,
false, rEdge.nMin, rEdge.nMax, nRowCount + 1));
2109 pHdl->SetPointNum(rEdge.nIndex);
2110 aColEdges[rEdge.nIndex] = pHdl.get();
2111 rHdlList.
AddHdl(std::move(pHdl));
2121 for( sal_Int32 nRow = 0; nRow <= nRowCount; ++nRow )
2123 const sal_Int32 nRowHeight = (nRow == nRowCount) ? 0 : rLayouter.
getRowHeight(nRow);
2126 for( sal_Int32 nCol = 0; nCol <= nColCount; ++nCol )
2128 const sal_Int32 nColWidth = (nCol == nColCount) ? 0 : rLayouter.
getColumnWidth(nCol);
2130 if( nRowHeight > 0 )
2160 for(
size_t nHdl = 0; nHdl < tempList.
GetHdlCount(); ++nHdl )
2162 tempList.
MoveTo(rHdlList);
2165 for(
size_t nHdl = 0; nHdl < nHdlCount; ++nHdl )
2166 rHdlList.
GetHdl(nHdl)->
SetObj(const_cast<SdrTableObj*>(
this));
2231 if (aNewRectangle !=
maRect)
2352 return PointerStyle::Cross;
2358 xNewCell = Cell::create( *
this );
2364 return std::make_unique<TableObjectGeoData>();
2370 DBG_ASSERT( dynamic_cast< TableObjectGeoData* >( &rGeo ),
"svx::SdrTableObj::SaveGeoData(), illegal geo data!" );
2379 DBG_ASSERT( dynamic_cast< const TableObjectGeoData* >( &rGeo ),
"svx::SdrTableObj::SaveGeoData(), illegal geo data!" );
2397 mpImpl->CropTableModelToSelection(rStart, rEnd);
2405 mpImpl->mpLayouter->DistributeColumns(
maRect, nFirstColumn, nLastColumn, bOptimize, bMinimize );
2415 mpImpl->mpLayouter->DistributeRows(
maRect, nFirstRow, nLastRow, bOptimize, bMinimize );
2434 mpImpl->mxTable->lockBroadcasts();
2441 mpImpl->mxTable->unlockBroadcasts();
2446 xmlTextWriterStartElement(pWriter, BAD_CAST(
"SdrTableObj"));
2447 xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
2451 mpImpl->dumpAsXml(pWriter);
2453 xmlTextWriterEndElement(pWriter);
2462 boost::property_tree::ptree aTableColumns;
2466 boost::property_tree::ptree
aEntries;
2467 auto const & aEdges =
mpImpl->mpLayouter->getVerticalEdges();
2468 for (
auto & rEdge : aEdges)
2470 if (rEdge.nIndex == 0)
2474 else if (rEdge.nIndex == sal_Int32(aEdges.size() - 1))
2480 boost::property_tree::ptree aEntry;
2484 aEntry.put(
"hidden",
false);
2485 aEntries.push_back(std::make_pair(
"", aEntry));
2488 aTableColumns.push_back(std::make_pair(
"entries", aEntries));
2490 rJsonRoot.add_child(
"columns", aTableColumns);
2492 boost::property_tree::ptree aTableRows;
2496 boost::property_tree::ptree
aEntries;
2497 auto const & aEdges =
mpImpl->mpLayouter->getHorizontalEdges();
2498 for (
auto & rEdge : aEdges)
2500 if (rEdge.nIndex == 0)
2504 else if (rEdge.nIndex == sal_Int32(aEdges.size() - 1))
2510 boost::property_tree::ptree aEntry;
2514 aEntry.put(
"hidden",
false);
2515 aEntries.push_back(std::make_pair(
"", aEntry));
2518 aTableRows.push_back(std::make_pair(
"entries", aEntries));
2520 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
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)
struct _xmlTextWriter * xmlTextWriterPtr
sal_Int32 getRowCount() const
CellPos getUpCell(const CellPos &rPos, bool bEdgeTravel) const
void setWidth(tools::Long nWidth)
SdrObjUserCall * pUserCall
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
bool bDisableAutoWidthOnDragging
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
constexpr sal_uInt16 EE_ITEMS_END(EE_FEATURE_END)
sal_Int32 GetParagraphCount() const
virtual SfxItemSet & GetItemSet()
virtual void BrkCreate(SdrDragStat &rStat) override
rtl::Reference< SdrTableObjImpl > mpImpl
virtual void EndTextEdit(SdrOutliner &rOutl) override
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.
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.
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...
OUString SvxResId(const char *pId)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
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)
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)
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 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 &)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#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.
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
constexpr sal_uInt16 EE_ITEMS_START(OWN_ATTR_VALUE_END+1)
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
void changeEdge(bool bHorizontal, int nEdge, sal_Int32 nOffset)
SdrModel & getSdrModelFromSdrObject() const
constexpr auto convertMm100ToTwip(N n)
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)
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
virtual void NbcSetOutlinerParaObject(std::unique_ptr< OutlinerParaObject > pTextObject) override
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)
std::unique_ptr< OutlinerParaObject > CreateParaObject(sal_Int32 nStartPara=0, sal_Int32 nParaCount=EE_PARA_ALL) const
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
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
void Init(OutlinerMode nOutlinerMode)
void SetOutlinerParaObject(std::unique_ptr< OutlinerParaObject > pTextObject)
tools::Long Height() const
virtual void RecalcSnapRect() override
Snap is not done on the BoundRect but if possible on logic coordinates (i.e.
void SetRefDevice(OutputDevice *pRefDev)
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
sal_Int32 getRowHeight(sal_Int32 nRow) const
void SetUpdateMode(bool bUpdate)
sal_Int32 getColumnCount() const
static sal_Int32 lastColCount
void setActiveCell(const sdr::table::CellPos &rPos)
sal_Int32 getColumnCount() const
virtual void SetRectsDirty(bool bNotMyself=false, bool bRecursive=true)
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
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
bool GetUpdateMode() 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 createTableEdgesJson(boost::property_tree::ptree &rJsonRoot)
const sal_Int32 odd_rows_style
const Size & GetPaperSize() const