21 #include <com/sun/star/drawing/BitmapMode.hpp>
22 #include <com/sun/star/style/XStyle.hpp>
23 #include <com/sun/star/text/WritingMode.hpp>
24 #include <com/sun/star/table/TableBorder.hpp>
25 #include <com/sun/star/table/BorderLine2.hpp>
26 #include <com/sun/star/lang/Locale.hpp>
34 #include <libxml/xmlwriter.h>
62 using ::editeng::SvxBorderLine;
100 {
u"", 0, css::uno::Type(), 0, 0 }
104 return &aSvxCellPropertySet;
114 virtual ~CellTextProvider();
129 CellTextProvider::~CellTextProvider()
133 sal_Int32 CellTextProvider::getTextCount()
const
138 SdrText* CellTextProvider::getText(sal_Int32 nIndex)
const
142 return m_xCell.get();
165 std::unique_ptr<BaseProperties>
Clone(
SdrObject& rObj)
const override;
182 return std::make_unique<SfxItemSet>(rPool,
204 , maTextProvider(mxCell)
211 , maTextProvider(mxCell)
217 OSL_FAIL(
"CellProperties::Clone(), does not work yet!");
218 return std::unique_ptr<BaseProperties>(
new CellProperties(*
this, rObj,
nullptr));
233 const bool bOwnParaObj = pParaObj !=
nullptr;
235 if( pParaObj ==
nullptr )
236 pParaObj =
mxCell->GetOutlinerParaObject();
243 if(
mxCell->IsTextEditActive())
260 for(sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
265 for (
const auto& rWhichId : aCharWhichIds)
273 if(!
mxCell->IsTextEditActive())
284 std::unique_ptr<OutlinerParaObject> pTemp = pOutliner->
CreateParaObject(0, nParaCount);
286 mxCell->SetOutlinerParaObject(std::move(pTemp));
305 bool bVertical(css::text::WritingMode_TB_RL == static_cast<const SvxWritingModeItem*>(pNewItem)->
GetValue());
313 const bool bOwnParaObj = pParaObj !=
nullptr;
315 if( pParaObj ==
nullptr )
316 pParaObj =
mxCell->GetOutlinerParaObject();
334 const bool bOwnParaObj = pParaObj !=
nullptr;
336 if (pParaObj ==
nullptr)
337 pParaObj =
mxCell->GetOutlinerParaObject();
390 if( xCell->mxTable.is() )
392 Reference< XEventListener > xListener( xCell.get() );
393 xCell->mxTable->addEventListener( xListener );
400 SdrTableObj& rTableObj)
404 ,mpProperties( new
sdr::
properties::CellProperties( rTableObj, this ) )
405 ,mnCellContentType( CellContentType_EMPTY )
411 ,mxTable( rTableObj.getTable() )
420 if(
nullptr == GetEditSource())
427 Cell::~Cell() throw()
439 Reference< XEventListener > xThis(
this );
440 mxTable->removeEventListener( xThis );
453 mpProperties.reset();
454 SetOutlinerParaObject(
nullptr );
458 void Cell::merge( sal_Int32 nColumnSpan, sal_Int32 nRowSpan )
470 void Cell::mergeContent(
const CellRef& xSourceCell )
472 SdrTableObj& rTableObj =
dynamic_cast< SdrTableObj&
>( GetObject() );
474 if( !xSourceCell->hasText() )
477 SdrOutliner& rOutliner=rTableObj.ImpGetDrawOutliner();
482 rOutliner.
SetText(*GetOutlinerParaObject());
483 rOutliner.
AddText(*xSourceCell->GetOutlinerParaObject());
487 rOutliner.
SetText(*xSourceCell->GetOutlinerParaObject());
494 SetStyleSheet( GetStyleSheet(),
true );
498 void Cell::cloneFrom(
const CellRef& xCell )
502 replaceContentAndFormatting( xCell );
504 mnCellContentType = xCell->mnCellContentType;
506 msFormula = xCell->msFormula;
507 mfValue = xCell->mfValue;
508 mnError = xCell->mnError;
510 mbMerged = xCell->mbMerged;
518 void Cell::replaceContentAndFormatting(
const CellRef& xSourceCell )
520 if( !(xSourceCell.is() && mpProperties) )
523 mpProperties->SetMergedItemSet( xSourceCell->GetObjectItemSet() );
527 if(
nullptr != xSourceCell->GetOutlinerParaObject())
529 SetOutlinerParaObject( std::make_unique<OutlinerParaObject>(*xSourceCell->GetOutlinerParaObject()) );
532 SdrTableObj& rTableObj =
dynamic_cast< SdrTableObj&
>( GetObject() );
533 SdrTableObj& rSourceTableObj =
dynamic_cast< SdrTableObj&
>( xSourceCell->GetObject() );
535 if(&rSourceTableObj.getSdrModelFromSdrObject() != &rTableObj.getSdrModelFromSdrObject())
539 SetStyleSheet(
nullptr,
true );
544 void Cell::setMerged()
554 void Cell::copyFormatFrom(
const CellRef& xSourceCell )
556 if( !(xSourceCell.is() && mpProperties) )
559 mpProperties->SetMergedItemSet( xSourceCell->GetObjectItemSet() );
560 SdrTableObj& rTableObj =
dynamic_cast< SdrTableObj&
>( GetObject() );
561 SdrTableObj& rSourceTableObj =
dynamic_cast< SdrTableObj&
>( xSourceCell->GetObject() );
563 if(&rSourceTableObj.getSdrModelFromSdrObject() != &rTableObj.getSdrModelFromSdrObject())
567 SetStyleSheet(
nullptr,
true );
574 void Cell::notifyModified()
577 mxTable->setModified(
true );
584 bool Cell::IsActiveCell()
const
587 SdrTableObj& rTableObj =
dynamic_cast< SdrTableObj&
>( GetObject() );
588 if( rTableObj.getActiveCell().get() == this )
594 bool Cell::IsTextEditActive()
const
596 bool isActive =
false;
597 SdrTableObj& rTableObj =
dynamic_cast< SdrTableObj&
>( GetObject() );
598 if(rTableObj.getActiveCell().get() == this )
600 if( rTableObj.CanCreateEditOutlinerParaObject() )
609 bool Cell::hasText()
const
619 if( rTextObj.
GetText(0).isEmpty() )
629 bool Cell::CanCreateEditOutlinerParaObject()
const
631 SdrTableObj& rTableObj =
dynamic_cast< SdrTableObj&
>( GetObject() );
632 if( rTableObj.getActiveCell().get() == this )
633 return rTableObj.CanCreateEditOutlinerParaObject();
637 std::unique_ptr<OutlinerParaObject> Cell::CreateEditOutlinerParaObject()
const
639 SdrTableObj& rTableObj =
dynamic_cast< SdrTableObj&
>( GetObject() );
640 if( rTableObj.getActiveCell().get() == this )
641 return rTableObj.CreateEditOutlinerParaObject();
646 void Cell::SetStyleSheet(
SfxStyleSheet* pStyleSheet,
bool bDontRemoveHardAttr )
649 if( pStyleSheet && pStyleSheet->
GetFamily() != SfxStyleFamily::Frame )
652 if( mpProperties && (mpProperties->GetStyleSheet() != pStyleSheet) )
654 mpProperties->
SetStyleSheet( pStyleSheet, bDontRemoveHardAttr );
663 return mpProperties->GetObjectItemSet();
667 OSL_FAIL(
"Cell::GetObjectItemSet(), called without properties!");
668 return GetObject().GetObjectItemSet();
676 mpProperties->SetObjectItem( rItem );
683 SetObjectItem(rItem);
689 return mpProperties->GetStyleSheet();
696 rAnchorRect.
SetLeft( maCellRect.Left() + GetTextLeftDistance() );
697 rAnchorRect.
SetRight( maCellRect.Right() - GetTextRightDistance() );
698 rAnchorRect.
SetTop( maCellRect.Top() + GetTextUpperDistance() );
699 rAnchorRect.
SetBottom( maCellRect.Bottom() - GetTextLowerDistance() );
703 void Cell::SetMergedItemSetAndBroadcast(
const SfxItemSet& rSet,
bool bClearAllItems)
707 mpProperties->SetMergedItemSetAndBroadcast(rSet, bClearAllItems);
713 sal_Int32 Cell::calcPreferredWidth(
const Size aSize )
716 return getMinimumWidth();
718 Outliner& rOutliner=
static_cast< SdrTableObj&
>( GetObject() ).ImpGetDrawOutliner();
721 ForceOutlinerParaObject( OutlinerMode::TextObject );
723 if( GetOutlinerParaObject() )
724 rOutliner.
SetText(*GetOutlinerParaObject());
729 return GetTextLeftDistance() + GetTextRightDistance() + nPreferredWidth;
732 sal_Int32 Cell::getMinimumWidth()
const
734 return GetTextLeftDistance() + GetTextRightDistance() + 100;
738 sal_Int32 Cell::getMinimumHeight()
743 SdrTableObj& rTableObj =
dynamic_cast< SdrTableObj&
>( GetObject() );
744 sal_Int32 nMinimumHeight = 0;
747 TakeTextAnchorRect( aTextRect );
751 SdrOutliner* pEditOutliner = rTableObj.GetCellTextEditOutliner( *
this );
759 Outliner& rOutliner=rTableObj.ImpGetDrawOutliner();
762 ForceOutlinerParaObject( OutlinerMode::TextObject );
764 if( GetOutlinerParaObject() )
766 rOutliner.
SetText(*GetOutlinerParaObject());
772 nMinimumHeight += GetTextUpperDistance() + GetTextLowerDistance();
773 return nMinimumHeight;
813 void Cell::SetOutlinerParaObject( std::unique_ptr<OutlinerParaObject> pTextObject )
815 bool bNullTextObject = pTextObject ==
nullptr;
819 if( bNullTextObject )
820 ForceOutlinerParaObject( OutlinerMode::TextObject );
835 if (pTableObj && pTableObj->IsTextEditActive())
836 pTableObj->
AddUndo(
new CellUndo(pTableObj, xCell));
852 return CloneProperties(mpProperties.get(),rNewObj,rNewCell);
859 Any SAL_CALL Cell::queryInterface(
const Type & rType )
862 return Any( Reference< XMergeableCell >(
this ) );
865 return Any( Reference< XCell >(
this ) );
868 return Any( Reference< XLayoutConstrains >(
this ) );
871 return Any( Reference< XEventListener >(
this ) );
874 if( aRet.hasValue() )
877 return ::cppu::OWeakObject::queryInterface( rType );
881 void SAL_CALL Cell::acquire() throw ()
887 void SAL_CALL Cell::release() throw ()
896 Sequence< Type > SAL_CALL Cell::getTypes( )
907 return css::uno::Sequence<sal_Int8>();
911 css::awt::Size SAL_CALL Cell::getMinimumSize()
913 return css::awt::Size( getMinimumWidth(), getMinimumHeight() );
917 css::awt::Size SAL_CALL Cell::getPreferredSize()
919 return getMinimumSize();
923 css::awt::Size SAL_CALL Cell::calcAdjustedSize(
const css::awt::Size& aNewSize )
932 sal_Int32 SAL_CALL Cell::getRowSpan()
938 sal_Int32 SAL_CALL Cell::getColumnSpan()
953 OUString SAL_CALL Cell::getFormula( )
959 void SAL_CALL Cell::setFormula(
const OUString& aFormula )
961 if( msFormula != aFormula )
963 msFormula = aFormula;
968 double SAL_CALL Cell::getValue( )
974 void SAL_CALL Cell::setValue(
double nValue )
976 if( mfValue != nValue )
979 mnCellContentType = CellContentType_VALUE;
984 CellContentType SAL_CALL Cell::getType()
986 return mnCellContentType;
990 sal_Int32 SAL_CALL Cell::getError( )
1003 if( pMap->
aType != aAny.getValueType() )
1008 sal_Int32 nValue = 0;
1010 aAny <<= static_cast<sal_Int16>(
nValue);
1014 OSL_FAIL(
"GetAnyForItem() Returnvalue has wrong Type!" );
1021 Reference< XPropertySetInfo > SAL_CALL Cell::getPropertySetInfo()
1023 return mpPropSet->getPropertySetInfo();
1027 void SAL_CALL Cell::setPropertyValue(
const OUString& rPropertyName,
const Any& rValue )
1031 if(mpProperties ==
nullptr)
1032 throw DisposedException();
1037 if( (pMap->
nFlags & PropertyAttribute::READONLY ) != 0 )
1038 throw PropertyVetoException();
1040 switch( pMap->
nWID )
1044 Reference< XStyle > xStyle;
1045 if( !( rValue >>= xStyle ) )
1046 throw IllegalArgumentException();
1049 SetStyleSheet( pStyle,
true );
1054 auto pBorder = o3tl::tryAccess<TableBorder>(rValue);
1060 SvxBorderLine aLine;
1063 aBox.SetLine(bSet ? &aLine :
nullptr, SvxBoxItemLine::TOP);
1064 aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::TOP, pBorder->IsTopLineValid);
1067 aBox.SetLine(bSet ? &aLine :
nullptr, SvxBoxItemLine::BOTTOM);
1068 aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::BOTTOM, pBorder->IsBottomLineValid);
1071 aBox.SetLine(bSet ? &aLine :
nullptr, SvxBoxItemLine::LEFT);
1072 aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::LEFT, pBorder->IsLeftLineValid);
1075 aBox.SetLine(bSet ? &aLine :
nullptr, SvxBoxItemLine::RIGHT);
1076 aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::RIGHT, pBorder->IsRightLineValid);
1079 aBoxInfo.SetLine(bSet ? &aLine :
nullptr, SvxBoxInfoItemLine::HORI);
1080 aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::HORI, pBorder->IsHorizontalLineValid);
1083 aBoxInfo.SetLine(bSet ? &aLine :
nullptr, SvxBoxInfoItemLine::VERT);
1084 aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::VERT, pBorder->IsVerticalLineValid);
1086 aBox.SetAllDistances(pBorder->Distance);
1087 aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::DISTANCE, pBorder->IsDistanceValid);
1089 mpProperties->SetObjectItem(aBox);
1090 mpProperties->SetObjectItem(aBoxInfo);
1096 if(!(rValue >>= eMode) )
1098 sal_Int32 nMode = 0;
1099 if(!(rValue >>= nMode))
1100 throw IllegalArgumentException();
1102 eMode =
static_cast<BitmapMode
>(nMode);
1106 mpProperties->SetObjectItem(
XFillBmpTileItem( eMode == BitmapMode_REPEAT ) );
1111 sal_Int32 nRotVal = 0;
1112 if (!(rValue >>= nRotVal))
1113 throw IllegalArgumentException();
1115 if (nRotVal != 27000 && nRotVal != 9000 && nRotVal != 0)
1116 throw IllegalArgumentException();
1123 SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), {{pMap->
nWID, pMap->
nWID}});
1124 aSet.
Put(mpProperties->GetItem(pMap->
nWID));
1126 bool bSpecial =
false;
1128 switch( pMap->
nWID )
1141 if( rValue >>= aApiName )
1160 aSet.
Put(GetObject().getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->
nWID));
1170 GetObject().getSdrModelFromSdrObject().SetChanged();
1171 mpProperties->SetMergedItemSetAndBroadcast( aSet );
1176 throw UnknownPropertyException( rPropertyName, static_cast<cppu::OWeakObject*>(
this));
1180 Any SAL_CALL Cell::getPropertyValue(
const OUString& PropertyName )
1184 if(mpProperties ==
nullptr)
1185 throw DisposedException();
1190 switch( pMap->
nWID )
1194 return Any( Reference< XStyle >( dynamic_cast< SfxUnoStyleSheet* >( GetStyleSheet() ) ) );
1201 TableBorder aTableBorder;
1203 aTableBorder.IsTopLineValid = rBoxInfoItem.
IsValid(SvxBoxInfoItemValidFlags::TOP);
1205 aTableBorder.IsBottomLineValid = rBoxInfoItem.
IsValid(SvxBoxInfoItemValidFlags::BOTTOM);
1207 aTableBorder.IsLeftLineValid = rBoxInfoItem.
IsValid(SvxBoxInfoItemValidFlags::LEFT);
1209 aTableBorder.IsRightLineValid = rBoxInfoItem.
IsValid(SvxBoxInfoItemValidFlags::RIGHT );
1211 aTableBorder.IsHorizontalLineValid = rBoxInfoItem.
IsValid(SvxBoxInfoItemValidFlags::HORI);
1213 aTableBorder.IsVerticalLineValid = rBoxInfoItem.
IsValid(SvxBoxInfoItemValidFlags::VERT);
1215 aTableBorder.IsDistanceValid = rBoxInfoItem.
IsValid(SvxBoxInfoItemValidFlags::DISTANCE);
1217 return Any( aTableBorder );
1225 return Any( BitmapMode_REPEAT );
1229 return Any( BitmapMode_STRETCH );
1233 return Any( BitmapMode_NO_REPEAT );
1243 SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), {{pMap->
nWID, pMap->
nWID}});
1244 aSet.
Put(mpProperties->GetItem(pMap->
nWID));
1253 aSet.
Put(GetObject().getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->
nWID));
1257 aAny = GetAnyForItem( aSet, pMap );
1264 throw UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(
this));
1268 void SAL_CALL Cell::addPropertyChangeListener(
const OUString& ,
const Reference< XPropertyChangeListener >& )
1273 void SAL_CALL Cell::removePropertyChangeListener(
const OUString& ,
const Reference< XPropertyChangeListener >& )
1278 void SAL_CALL Cell::addVetoableChangeListener(
const OUString& ,
const Reference< XVetoableChangeListener >& )
1283 void SAL_CALL Cell::removeVetoableChangeListener(
const OUString& ,
const Reference< XVetoableChangeListener >& )
1291 void SAL_CALL Cell::setPropertyValues(
const Sequence< OUString >& aPropertyNames,
const Sequence< Any >& aValues )
1295 if(mpProperties ==
nullptr)
1296 throw DisposedException();
1298 const sal_Int32
nCount = aPropertyNames.getLength();
1300 const OUString* pNames = aPropertyNames.getConstArray();
1301 const Any*
pValues = aValues.getConstArray();
1303 for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++, pNames++, pValues++ )
1309 catch( UnknownPropertyException& )
1325 if(mpProperties ==
nullptr)
1326 throw DisposedException();
1328 const sal_Int32 nCount = aPropertyNames.getLength();
1329 Sequence< Any > aRet( nCount );
1330 Any* pValue = aRet.getArray();
1332 for(
const OUString& rName : aPropertyNames )
1338 catch( UnknownPropertyException& )
1353 void SAL_CALL Cell::addPropertiesChangeListener(
const Sequence< OUString >& ,
const Reference< XPropertiesChangeListener >& )
1358 void SAL_CALL Cell::removePropertiesChangeListener(
const Reference< XPropertiesChangeListener >& )
1363 void SAL_CALL Cell::firePropertiesChangeEvent(
const Sequence< OUString >& ,
const Reference< XPropertiesChangeListener >& )
1371 PropertyState SAL_CALL Cell::getPropertyState(
const OUString& PropertyName )
1375 if(mpProperties ==
nullptr)
1376 throw DisposedException();
1382 PropertyState eState;
1383 switch( pMap->
nWID )
1387 const SfxItemSet& rSet = mpProperties->GetMergedItemSet();
1391 if( bStretch || bTile )
1393 eState = PropertyState_DIRECT_VALUE;
1397 eState = PropertyState_DEFAULT_VALUE;
1403 return PropertyState_DIRECT_VALUE;
1407 const SfxItemSet& rSet = mpProperties->GetMergedItemSet();
1409 return PropertyState_DEFAULT_VALUE;
1411 return PropertyState_DIRECT_VALUE;
1415 const SfxItemSet& rSet = mpProperties->GetMergedItemSet();
1419 case SfxItemState::READONLY:
1420 case SfxItemState::SET:
1421 eState = PropertyState_DIRECT_VALUE;
1423 case SfxItemState::DEFAULT:
1424 eState = PropertyState_DEFAULT_VALUE;
1427 eState = PropertyState_AMBIGUOUS_VALUE;
1432 if( PropertyState_DIRECT_VALUE == eState )
1434 switch( pMap->
nWID )
1445 if( ( pItem ==
nullptr ) || pItem->
GetName().isEmpty() )
1446 eState = PropertyState_DEFAULT_VALUE;
1460 if( pItem ==
nullptr )
1461 eState = PropertyState_DEFAULT_VALUE;
1470 throw UnknownPropertyException(PropertyName);
1474 Sequence< PropertyState > SAL_CALL Cell::getPropertyStates(
const Sequence< OUString >& aPropertyName )
1478 if(mpProperties ==
nullptr)
1479 throw DisposedException();
1481 const sal_Int32 nCount = aPropertyName.getLength();
1482 Sequence< PropertyState > aRet( nCount );
1484 std::transform(aPropertyName.begin(), aPropertyName.end(), aRet.begin(),
1485 [
this](
const OUString& rName) -> PropertyState {
1488 return getPropertyState( rName );
1492 return PropertyState_AMBIGUOUS_VALUE;
1500 void SAL_CALL Cell::setPropertyToDefault(
const OUString& PropertyName )
1504 if(mpProperties ==
nullptr)
1505 throw DisposedException();
1510 switch( pMap->
nWID )
1530 mpProperties->ClearObjectItem( pMap->
nWID );
1534 GetObject().getSdrModelFromSdrObject().SetChanged();
1537 throw UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(
this));
1541 Any SAL_CALL Cell::getPropertyDefault(
const OUString& aPropertyName )
1545 if(mpProperties ==
nullptr)
1546 throw DisposedException();
1551 switch( pMap->
nWID )
1554 return Any( BitmapMode_NO_REPEAT );
1558 Reference< XStyle > xStyle;
1559 return Any( xStyle );
1564 TableBorder aBorder;
1565 return Any( aBorder );
1572 SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), {{pMap->
nWID, pMap->
nWID}});
1573 aSet.
Put(GetObject().getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->
nWID));
1574 return GetAnyForItem( aSet, pMap );
1579 throw UnknownPropertyException( aPropertyName, static_cast<cppu::OWeakObject*>(
this));
1586 void SAL_CALL Cell::setAllPropertiesToDefault()
1590 SdrOutliner& rOutliner = GetObject().ImpGetDrawOutliner();
1601 ESelection aSelection( 0, 0, EE_PARA_ALL, EE_TEXTPOS_ALL);
1604 std::unique_ptr<OutlinerParaObject> pTemp = rOutliner.
CreateParaObject(0, nParaCount);
1607 SetOutlinerParaObject(std::move(pTemp));
1614 for(
const OUString& rName : aPropertyNames)
1615 setPropertyToDefault( rName );
1619 Sequence< Any > SAL_CALL Cell::getPropertyDefaults(
const Sequence< OUString >& aPropertyNames )
1621 sal_Int32 nCount = aPropertyNames.getLength();
1622 Sequence< Any > aDefaults( nCount );
1624 std::transform(aPropertyNames.begin(), aPropertyNames.end(), aDefaults.begin(),
1625 [
this](
const OUString& rName) -> Any {
return getPropertyDefault(rName); });
1634 void SAL_CALL Cell::insertTextContent(
const Reference< XTextRange >& xRange,
const Reference< XTextContent >& xContent,
sal_Bool bAbsorb )
1641 void SAL_CALL Cell::removeTextContent(
const Reference< XTextContent >& xContent )
1651 void SAL_CALL Cell::insertString(
const Reference< XTextRange >& xRange,
const OUString& aString,
sal_Bool bAbsorb )
1658 void SAL_CALL Cell::insertControlCharacter(
const Reference< XTextRange >& xRange, sal_Int16 nControlCharacter,
sal_Bool bAbsorb )
1668 OUString SAL_CALL Cell::getString( )
1675 void SAL_CALL Cell::setString(
const OUString& aString )
1682 void SAL_CALL Cell::disposing(
const EventObject& )
1688 void Cell::dumpAsXml(
xmlTextWriterPtr pWriter, sal_Int32 nRow, sal_Int32 nCol)
const
1690 xmlTextWriterStartElement(pWriter, BAD_CAST(
"Cell"));
1691 xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"row"),
"%" SAL_PRIdINT32, nRow);
1692 xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"col"),
"%" SAL_PRIdINT32, nCol);
1696 mpProperties->dumpAsXml(pWriter);
1697 xmlTextWriterEndElement(pWriter);
constexpr TypedWhichId< SvxTextRotateItem > SDRATTR_TABLE_TEXT_ROTATION(SDRATTR_TABLE_FIRST+4)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWHEIGHT(SDRATTR_MISC_FIRST+2)
#define UNO_NAME_TEXT_WORDWRAP
static css::table::BorderLine2 SvxLineToLine(const editeng::SvxBorderLine *pLine, bool bConvert)
constexpr TypedWhichId< SdrTextHorzAdjustItem > SDRATTR_TEXT_HORZADJUST(SDRATTR_MISC_FIRST+13)
constexpr TypedWhichId< XLineEndItem > XATTR_LINEEND(XATTR_LINE_FIRST+5)
constexpr sal_uInt16 SDRATTR_TABLE_FIRST(SDRATTR_CUSTOMSHAPE_LAST+1)
constexpr TypedWhichId< XLineStartItem > XATTR_LINESTART(XATTR_LINE_FIRST+4)
struct _xmlTextWriter * xmlTextWriterPtr
virtual void SAL_CALL insertTextContent(const css::uno::Reference< css::text::XTextRange > &xRange, const css::uno::Reference< css::text::XTextContent > &xContent, sal_Bool bAbsorb) override
#define UNO_NAME_TEXT_RIGHTDIST
virtual void SAL_CALL insertControlCharacter(const css::uno::Reference< css::text::XTextRange > &xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb) override
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWWIDTH(SDRATTR_MISC_FIRST+12)
void SetPaperSize(const Size &rSize)
const editeng::SvxBorderLine * GetVert() const
#define UNO_NAME_TEXT_LOWERDIST
SvxBoxInfoItem & rBoxInfoItem
sdr::table::CellRef mxCell
constexpr sal_uInt16 EE_ITEMS_END(EE_FEATURE_END)
#define SVX_UNOEDIT_OUTLINER_PROPERTIES
sal_Int32 GetParagraphCount() const
virtual const SfxItemSet & GetObjectItemSet() const override
virtual void SAL_CALL setString(const OUString &aString) override
constexpr TypedWhichId< XLineDashItem > XATTR_LINEDASH(XATTR_LINE_FIRST+1)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
#define UNO_NAME_TEXT_UPPERDIST
const editeng::SvxBorderLine * GetRight() const
SfxStyleFamily GetFamily() const
constexpr sal_uInt16 SDRATTR_MISC_LAST(SDRATTR_TEXT_CHAINNEXTNAME)
virtual const tools::Rectangle & GetSnapRect() const override
virtual sal_Int32 getTextCount() const =0
Return the number of texts available for this object.
#define OWN_ATTR_FILLBMP_MODE
std::unique_ptr< SfxItemSet > mpItemSet
const svx::ITextProvider & getTextProvider() const override
Get the TextProvider related to our SdrObject.
void SetStyleSheet(sal_Int32 nPara, const OUString &rName, const SfxStyleFamily &eFamily)
std::unique_ptr< SfxItemSet > CreateObjectSpecificItemSet(SfxItemPool &rPool) override
constexpr sal_uInt16 SDRATTR_START(XATTR_START)
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
Degree10 GetValue() const
virtual void SAL_CALL acquire() SAL_OVERRIDE
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
#define OWN_ATTR_TABLEBORDER
rtl::Reference< Cell > CellRef
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
const SfxItemSet & GetObjectItemSet() const
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_WORDWRAP(SDRATTR_MISC_FIRST+24)
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType)
void RemoveCharAttribs(sal_Int32 nPara, sal_uInt16 nWhich=0)
This interface provides access to text object(s) in an SdrObject.
SfxItemSet const & GetParaAttribs(sal_Int32 nPara)
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
#define UNO_NAME_TEXT_WRITINGMODE
SVX_DLLPRIVATE SdrOutliner * GetTextEditOutliner() const
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_LOWERDIST(SDRATTR_MISC_FIRST+7)
void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &)
OUString GetText(sal_Int32 nPara) const
void SetRotation(TextRotation nRotation)
constexpr TypedWhichId< SvxBoxInfoItem > SDRATTR_TABLE_BORDER_INNER(SDRATTR_TABLE_FIRST+1)
void RemoveAttribs(const ESelection &rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich)
std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const override
void ItemSetChanged(const SfxItemSet &rSet) override
const editeng::SvxBorderLine * GetHori() const
constexpr TypedWhichId< SvxWritingModeItem > SDRATTR_TEXTDIRECTION(SDRATTR_NOTPERSIST_FIRST+34)
const editeng::SvxBorderLine * GetTop() const
std::vector< sal_uInt16 > GetAllCharPropIds(const SfxItemSet &rSet)
const EditTextObject & GetTextObject() const
UNDERLYING_TYPE get() const
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)
void SetText(const OutlinerParaObject &)
const editeng::SvxBorderLine * GetLeft() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
bool IsUndoEnabled() const
returns true if undo is currently enabled This returns false if undo was disabled using EnableUndo( f...
void SetVertical(bool bNew)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
constexpr TypedWhichId< SdrTextVertAdjustItem > SDRATTR_TEXT_VERTADJUST(SDRATTR_MISC_FIRST+8)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_LEFTDIST(SDRATTR_MISC_FIRST+4)
constexpr sal_uInt16 EE_ITEMS_START(OWN_ATTR_VALUE_END+1)
SdrModel & getSdrModelFromSdrObject() const
void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem *pNewItem=nullptr) override
virtual void SAL_CALL removeTextContent(const css::uno::Reference< css::text::XTextContent > &xContent) override
css::uno::Type const & get()
CellProperties(SdrObject &rObj, sdr::table::Cell *pCell)
bool setPropertyValue(uno::Sequence< beans::PropertyValue > &aProp, const OUString &aName, const uno::Any &aValue)
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &...rSn)
SfxItemPool * GetPool() const
const EditEngine & GetEditEngine() const
virtual void ItemSetChanged(const SfxItemSet &rSet) override
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_UPPERDIST(SDRATTR_MISC_FIRST+6)
bool IsValid(SvxBoxInfoItemValidFlags nValid) const
static SfxUnoStyleSheet * getUnoStyleSheet(const css::uno::Reference< css::style::XStyle > &xStyle)
sal_Int32 GetParagraphCount() const
constexpr TypedWhichId< SvxBoxItem > SDRATTR_TABLE_BORDER(SDRATTR_TABLE_FIRST+0)
const PropertyValue * pValues
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
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.
static const SvxItemPropertySet * ImplGetSvxCellPropertySet()
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)
void SetMaxAutoPaperSize(const Size &rSz)
constexpr TypedWhichId< XFillFloatTransparenceItem > XATTR_FILLFLOATTRANSPARENCE(XATTR_FILL_FIRST+11)
virtual void SAL_CALL insertString(const css::uno::Reference< css::text::XTextRange > &xRange, const OUString &aString, sal_Bool bAbsorb) override
static SdrItemPool & GetGlobalDrawObjectItemPool()
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_RIGHTDIST(SDRATTR_MISC_FIRST+5)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual OUString SAL_CALL getString() override
void SetObjectItemSet(const SfxItemSet &rSet)
constexpr TypedWhichId< XFillBmpStretchItem > XATTR_FILLBMP_STRETCH(XATTR_FILL_FIRST+16)
void SvxItemPropertySet_setPropertyValue(const SfxItemPropertySimpleEntry *pMap, const uno::Any &rVal, SfxItemSet &rSet)
#define UNO_NAME_TEXT_LEFTDIST
#define SVX_UNOEDIT_PARA_PROPERTIES
virtual void SetOutlinerParaObject(std::unique_ptr< OutlinerParaObject > pTextObject)
bool IsTopToBottom() const
void AddText(const OutlinerParaObject &, bool bAppend=false)
constexpr TypedWhichId< XFillBmpTileItem > XATTR_FILLBMP_TILE(XATTR_FILL_FIRST+7)
virtual void SAL_CALL release() SAL_OVERRIDE
void SetUpdateMode(bool bUpdate)
const CellTextProvider maTextProvider
void setHeight(tools::Long nHeight)
virtual void SetSnapRect(const tools::Rectangle &rRect)
void dumpAsXml(xmlTextWriterPtr pWriter) const
#define UNO_NAME_TEXT_HORZADJUST
OUString const & GetName() const
const SdrObject & GetSdrObject() const
bool SetFillAttribute(sal_uInt16 nWID, const OUString &rName)
const SvxItemPropertySet * ImplGetSvxUnoOutlinerTextCursorSvxPropertySet()
void ForceDefaultAttributes() override
uno::Any SvxItemPropertySet_getPropertyValue(const SfxItemPropertySimpleEntry *pMap, const SfxItemSet &rSet)
#define EE_PARA_MAX_COUNT
virtual void SetVerticalWriting(bool bVertical) override
sal_uLong GetTextHeight() const
sal_uInt16 GetSmallestDistance() const
constexpr sal_uInt16 SDRATTR_MISC_FIRST(SDRATTR_CAPTION_LAST+1)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
SdrOutliner & ImpGetDrawOutliner() const
const editeng::SvxBorderLine * GetBottom() const
virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem *pNewItem=nullptr) override
#define SVX_UNOEDIT_CHAR_PROPERTIES
static bool IsWhich(sal_uInt16 nId)
static bool LineToSvxLine(const css::table::BorderLine &rLine, editeng::SvxBorderLine &rSvxLine, bool bConvert)
virtual SdrText * getText(sal_Int32 nIndex) const =0
Return the nth available text.
#define UNO_NAME_TEXT_VERTADJUST