40#include <editeng/editeng.hxx>
71 maVersion(rProps.getVersion())
81 return std::unique_ptr<BaseProperties>(
new TextProperties(*
this, rObj));
121 for(sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
168 sal_Int32 nOldLineWidth(0);
182 if(!pNewItem && !nWhich && rObj.
HasText() )
219 const sal_Int32 nDifference((nNewLineWidth - nOldLineWidth) / 2);
275 for(sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
277 std::optional<SfxItemSet> pTempSet;
280 if(bDontRemoveHardAttr)
291 aNewStyleSheetName = aNewStyleSheetName.copy(0, aNewStyleSheetName.getLength() - 1);
292 sal_Int16 nDepth = rOutliner.
GetDepth(nPara);
293 aNewStyleSheetName += OUString::number( nDepth <= 0 ? 1 : nDepth + 1);
298 DBG_ASSERT( pNewStyle,
"AutoStyleSheetName - Style not found!" );
316 if(bDontRemoveHardAttr)
338 sal_uInt16 nW(pItem->Which());
402 std::vector<const SfxPoolItem*> aChangedItems;
407 aChangedItems.push_back(pItem);
428 pOutliner->SetText(*pParaObj);
430 sal_Int32 nParaCount(pOutliner->GetParagraphCount());
436 for(sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
442 SfxItemSet aParaSet(pOutliner->GetParaAttribs(nPara));
469 std::vector<EECharAttrib> aAttribs;
472 for(
const auto& rAttrib : aAttribs)
494 aColorSet.
Put(aSet,
false);
498 for(
const auto& rAttrib : aAttribs)
521 aSet.
Put(aParaSet,
false);
528 pOutliner->SetParaAttribs(nPara, aSet);
565 if(SfxHintId::DataChanged ==
nId)
587 if(SfxHintId::Dying ==
nId)
600 const SfxStyleSheetModifiedHint* pExtendedHint =
dynamic_cast<const SfxStyleSheetModifiedHint*
>(&rHint);
603 && SfxHintId::StyleSheetModified == pExtendedHint->GetId())
605 const OUString& aOldName(pExtendedHint->GetOldName());
606 OUString aNewName(pExtendedHint->GetStyleSheet()->GetName());
607 SfxStyleFamily eFamily = pExtendedHint->GetStyleSheet()->GetFamily();
609 if(aOldName != aNewName)
sal_Int32 GetTextLen() const
void QuickSetAttribs(const SfxItemSet &rSet, const ESelection &rSel)
void GetCharAttribs(sal_Int32 nPara, std::vector< EECharAttrib > &rLst) const
void ChangeStyleSheetName(SfxStyleFamily eFamily, std::u16string_view rOldName, const OUString &rNewName)
void SetText(const OutlinerParaObject &)
std::optional< OutlinerParaObject > CreateParaObject(sal_Int32 nStartPara=0, sal_Int32 nParaCount=EE_PARA_ALL) const
sal_Int16 GetDepth(sal_Int32 nPara) const
void SetStyleSheet(sal_Int32 nPara, SfxStyleSheet *pStyle)
void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &)
void RemoveAttribs(const ESelection &rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich)
SfxItemSet const & GetParaAttribs(sal_Int32 nPara) const
void RemoveCharAttribs(sal_Int32 nPara, sal_uInt16 nWhich=0)
sal_Int32 GetParagraphCount() const
SfxStyleSheetBasePool * GetStyleSheetPool() const
void ActionChanged() const
virtual SdrInventor GetObjInventor() const
bool DoesSupportTextIndentingOnLineWidthChange() const
SdrModel & getSdrModelFromSdrObject() const
bool IsTextEditActive() const
SdrOutliner & ImpGetDrawOutliner() const
sal_Int32 GetTextColumnsSpacing() const
virtual SdrText * getActiveText() const
returns the currently active text.
void NbcSetOutlinerParaObjectForText(std::optional< OutlinerParaObject > pTextObject, SdrText *pText)
virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt=true, bool bWdt=true)
bool IsLinkedText() const
SdrObjKind GetTextKind() const
virtual bool HasText() const override
virtual void SetVerticalWriting(bool bVertical)
virtual SdrObjKind GetObjIdentifier() const override
SVX_DLLPRIVATE SdrOutliner * GetTextEditOutliner() const
sal_Int16 GetTextColumnsNumber() const
OutlinerParaObject * GetOutlinerParaObject()
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
SfxItemPool * GetPool() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
virtual SfxItemSet & GetItemSet()
const SvxFieldData * GetField() const
virtual void ItemSetChanged(o3tl::span< const SfxPoolItem *const > aChangedItems, sal_uInt16 nDeletedWhich) override
virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem *pNewItem=nullptr) override
virtual void ForceStyleToHardAttributes() override
virtual const SfxItemSet & GetObjectItemSet() const override
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast) override
virtual SfxStyleSheet * GetStyleSheet() const override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
const SdrObject & GetSdrObject() const
const SfxPoolItem & GetItem(const sal_uInt16 nWhich) const
std::optional< SfxItemSet > mxItemSet
virtual void SetObjectItemDirect(const SfxPoolItem &rItem) override
virtual void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr, bool bBroadcast) override
virtual std::unique_ptr< BaseProperties > Clone(SdrObject &rObj) const override
void SetObjectItemNoBroadcast(const SfxPoolItem &rItem)
virtual const svx::ITextProvider & getTextProvider() const
Get the TextProvider related to our SdrObject.
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem *pNewItem=nullptr) override
virtual void ForceStyleToHardAttributes() override
virtual void ForceDefaultAttributes() override
virtual void ItemSetChanged(o3tl::span< const SfxPoolItem *const > aChangedItems, sal_uInt16 nDeletedWhich) override
virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool &rPool) override
virtual sal_uInt32 getVersion() const override
virtual ~TextProperties() override
TextProperties(SdrObject &rObj)
This interface provides access to text object(s) in an SdrObject.
virtual sal_Int32 getTextCount() const =0
Return the number of texts available for this object.
virtual SdrText * getText(sal_Int32 nIndex) const =0
Return the nth available text.
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
#define DBG_ASSERT(sCon, aError)
virtual OUString GetName() const override
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
constexpr TypedWhichId< SvxAdjustItem > EE_PARA_JUST(EE_PARA_START+16)
constexpr sal_uInt16 EE_ITEMS_END(EE_FEATURE_END)
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
constexpr sal_uInt16 EE_ITEMS_START(OWN_ATTR_VALUE_END+1)
std::unique_ptr< sal_Int32[]> pData
static constexpr auto Items
bool IsInvalidItem(const SfxPoolItem *pItem)
@ SDRTEXTVERTADJUST_CENTER
@ SDRTEXTHORZADJUST_CENTER
SdrMetricItem makeSdrTextUpperDistItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextRightDistItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextLowerDistItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextLeftDistItem(tools::Long mnHeight)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_LEFTDIST(SDRATTR_MISC_FIRST+4)
constexpr sal_uInt16 SDRATTR_START(XATTR_START)
constexpr sal_uInt16 SDRATTR_TEXTCOLUMNS_FIRST(SDRATTR_SOFTEDGE_LAST+1)
constexpr sal_uInt16 SDRATTR_MISC_LAST(SDRATTR_TEXT_CLIPVERTOVERFLOW)
constexpr sal_uInt16 SDRATTR_MISC_FIRST(SDRATTR_CAPTION_LAST+1)
constexpr sal_uInt16 SDRATTR_TEXTCOLUMNS_LAST(SDRATTR_TEXTCOLUMNS_SPACING)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_RIGHTDIST(SDRATTR_MISC_FIRST+5)
constexpr sal_uInt16 SDRATTR_SHADOW_LAST(SDRATTR_SHADOWALIGNMENT)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_LOWERDIST(SDRATTR_MISC_FIRST+7)
constexpr TypedWhichId< SvxWritingModeItem > SDRATTR_TEXTDIRECTION(SDRATTR_NOTPERSIST_FIRST+34)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXT_UPPERDIST(SDRATTR_MISC_FIRST+6)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_CONTOURFRAME(SDRATTR_MISC_FIRST+21)
std::unique_ptr< SdrOutliner > SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel &rModel)
Create an Outliner with the engine-global default settings on the heap.
@ OutlineText
TitleText, special text object for StarDraw.
constexpr TypedWhichId< XLineWidthItem > XATTR_LINEWIDTH(XATTR_LINE_FIRST+2)
constexpr TypedWhichId< XLineStyleItem > XATTR_LINESTYLE(XATTR_LINE_FIRST)