21#include <osl/diagnose.h>
24#include <com/sun/star/i18n/WordType.hpp>
42 bOutlinerText( bOutlText ),
43 mnParaAttribsCache( 0 )
67 return pEditEngine->
GetText( rSel );
76 switch( nOnlyHardAttrib )
85 OSL_FAIL(
"unknown flags for SvxOutlinerForwarder::GetAttribs");
91 return rEditEngine.
GetAttribs( rSel, nOnlyHardAttrib );
192 return pStyle->GetName();
199 if (
auto pStyle = pStyleSheetPool ? pStyleSheetPool->Find(rStyleName, SfxStyleFamily::Para) :
nullptr)
206 if( rText.isEmpty() )
334 aSize, bIsVertical );
366 nPara = aDocPos.
nPara;
445 sal_Int16 nLevel = -1;
457 if( (nNewDepth >= -1) && (nNewDepth <= 9) && (0 <= nPara && nPara <
GetParagraphCount()) )
483 OSL_FAIL(
"SvxOutlinerForwarder::GetNumberingStartValue)(), Invalid paragraph index");
496 OSL_FAIL(
"SvxOutlinerForwarder::SetNumberingStartValue)(), Invalid paragraph index");
508 OSL_FAIL(
"SvxOutlinerForwarder::IsParaIsNumberingRestart)(), Invalid paragraph index");
521 OSL_FAIL(
"SvxOutlinerForwarder::SetParaIsNumberingRestart)(), Invalid paragraph index");
543 DBG_ASSERT( 0 <= nPara && nPara < nParaCount,
"paragraph index out of bounds" );
544 if (0 <= nPara && nPara < nParaCount)
556 if( !pSourceForwarder )
OUString GetWord(sal_Int32 nPara, sal_Int32 nIndex)
OUString GetText(LineEnd eEnd=LINEEND_LF) const
EPosition FindDocPosition(const Point &rDocPos) const
sal_Int32 GetParagraphCount() const
SfxItemSet GetAttribs(sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, GetAttribsFlags nFlags=GetAttribsFlags::ALL) const
EFieldInfo GetFieldInfo(sal_Int32 nPara, sal_uInt16 nField) const
sal_Int32 GetTextLen() const
void InsertParagraph(sal_Int32 nPara, const EditTextObject &rTxtObj, const bool bAppend=false)
tools::Rectangle GetCharacterBounds(const EPosition &rPos) const
sal_Int32 GetLineNumberAtIndex(sal_Int32 nPara, sal_Int32 nIndex) const
const SfxItemSet & GetEmptyItemSet() const
void GetLineBoundaries(sal_Int32 &rStart, sal_Int32 &rEnd, sal_Int32 nParagraph, sal_Int32 nLine) const
sal_uInt16 GetFieldCount(sal_Int32 nPara) const
void QuickInsertText(const OUString &rText, const ESelection &rSel)
const SfxStyleSheet * GetStyleSheet(sal_Int32 nPara) const
void QuickSetAttribs(const SfxItemSet &rSet, const ESelection &rSel)
SfxStyleSheetPool * GetStyleSheetPool()
void SetText(const OutlinerParaObject &)
void SetLevelDependentStyleSheet(sal_Int32 nPara)
const EditEngine & GetEditEngine() const
bool IsParaIsNumberingRestart(sal_Int32 nPara) const
bool IsUpdateLayout() const
void QuickInsertText(const OUString &rText, const ESelection &rSel)
const SfxItemSet & GetEmptyItemSet() const
LanguageType GetLanguage(sal_Int32 nPara, sal_Int32 nPos) const
Paragraph * GetParagraph(sal_Int32 nAbsPos) const
void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel)
MapMode const & GetRefMapMode() const
std::optional< OutlinerParaObject > CreateParaObject(sal_Int32 nStartPara=0, sal_Int32 nParaCount=EE_PARA_ALL) const
tools::Rectangle GetParaBounds(sal_Int32 nParagraph) const
sal_Int16 GetDepth(sal_Int32 nPara) const
void SetStyleSheet(sal_Int32 nPara, SfxStyleSheet *pStyle)
void SetDepth(Paragraph *pParagraph, sal_Int16 nNewDepth)
void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &)
virtual OUString CalcFieldValue(const SvxFieldItem &rField, sal_Int32 nPara, sal_Int32 nPos, std::optional< Color > &rTxtColor, std::optional< Color > &rFldColor, std::optional< FontLineStyle > &rFldLineStyle)
sal_uInt32 GetLineCount(sal_Int32 nParagraph) const
void QuickDelete(const ESelection &rSel)
EBulletInfo GetBulletInfo(sal_Int32 nPara)
sal_Int16 GetNumberingStartValue(sal_Int32 nPara) const
void QuickInsertLineBreak(const ESelection &rSel)
void RemoveAttribs(const ESelection &rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich)
SfxItemSet const & GetParaAttribs(sal_Int32 nPara) const
void SetNumberingStartValue(sal_Int32 nPara, sal_Int16 nNumberingStartValue)
sal_uInt32 GetLineHeight(sal_Int32 nParagraph)
sal_Int32 GetLineLen(sal_Int32 nParagraph, sal_Int32 nLine) const
OutputDevice * GetRefDevice() const
SfxStyleSheet * GetStyleSheet(sal_Int32 nPara)
sal_Int32 GetParagraphCount() const
void SetParaIsNumberingRestart(sal_Int32 nPara, bool bParaIsNumberingRestart)
SfxItemPool * GetPool() const
void SetParent(const SfxItemSet *pNew)
const SfxItemSet * GetParent() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
virtual SfxItemSet & GetItemSet()
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
static void GetAttributeRun(sal_Int32 &nStartIndex, sal_Int32 &nEndIndex, const EditEngine &rEE, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell=false)
Calculate attribute run for EditEngines.
static Point EEToUserSpace(const Point &rPoint, const Size &rEESize, bool bIsVertical)
Convert point from edit engine to user coordinate space.
static Point UserSpaceToEE(const Point &rPoint, const Size &rEESize, bool bIsVertical)
Convert point from user to edit engine coordinate space.
This item stores a field (SvxFieldData).
virtual sal_Int32 GetTextLen(sal_Int32 nParagraph) const override
virtual MapMode GetMapMode() const override
Query the map mode of the underlying EditEngine/Outliner.
virtual OUString GetStyleSheet(sal_Int32 nPara) const override
virtual bool QuickFormatDoc(bool bFull=false) override
Updates the formatting.
virtual EBulletInfo GetBulletInfo(sal_Int32 nPara) const override
Query information regarding bullets for given paragraph on the underlying edit engine.
virtual bool InsertText(const OUString &, const ESelection &) override
Insert/Replace given text in given range and reformat text.
virtual const SfxItemSet * GetEmptyItemSetPtr() override
ESelection maAttribCacheSelection
if we have a cached attribute item set, this is the selection of it
virtual OutputDevice * GetRefDevice() const override
Query the reference output device of the underlying EditEngine/Outliner.
virtual sal_Int32 GetLineNumberAtIndex(sal_Int32 nPara, sal_Int32 nIndex) const override
Query the line number for an index in the paragraphs text.
std::optional< SfxItemSet > moAttribsCache
this pointer may be null or point to an item set for the attribs of the selection maAttribsSelection
virtual SfxItemSet GetAttribs(const ESelection &rSel, EditEngineAttribs nOnlyHardAttrib=EditEngineAttribs::All) const override
virtual bool GetWordIndices(sal_Int32 nPara, sal_Int32 nIndex, sal_Int32 &nStart, sal_Int32 &nEnd) const override
Get the start and the end index of the word at the given index.
virtual LanguageType GetLanguage(sal_Int32, sal_Int32) const override
Query language of character at given position on the underlying edit engine.
virtual bool SetDepth(sal_Int32 nPara, sal_Int16 nNewDepth) override
Set the outline depth of given paragraph.
virtual void SetStyleSheet(sal_Int32 nPara, const OUString &rStyleName) override
virtual void GetLineBoundaries(sal_Int32 &rStart, sal_Int32 &rEnd, sal_Int32 nPara, sal_Int32 nLine) const override
Query bounds of line in paragraph.
virtual bool Delete(const ESelection &) override
Delete given text range and reformat text.
virtual SfxItemSet GetParaAttribs(sal_Int32 nPara) const override
virtual void SetParaIsNumberingRestart(sal_Int32 nPara, bool bParaIsNumberingRestart) override
virtual sal_Int32 GetParagraphCount() const override
virtual void QuickSetAttribs(const SfxItemSet &rSet, const ESelection &rSel) override
virtual void AppendParagraph() override
virtual void QuickInsertText(const OUString &rText, const ESelection &rSel) override
virtual sal_Int32 AppendTextPortion(sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet) override
virtual sal_Int32 GetNumberingStartValue(sal_Int32 nPara) override
virtual bool IsParaIsNumberingRestart(sal_Int32 nPara) override
virtual bool GetAttributeRun(sal_Int32 &nStartIndex, sal_Int32 &nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell=false) const override
Query range of similar attributes.
virtual void GetPortions(sal_Int32 nPara, std::vector< sal_Int32 > &rList) const override
virtual void FieldClicked(const SvxFieldItem &rField) override
virtual EFieldInfo GetFieldInfo(sal_Int32 nPara, sal_uInt16 nField) const override
Query information for given field number in the underlying edit engine.
virtual void SetNumberingStartValue(sal_Int32 nPara, sal_Int32 nNumberingStartValue) override
virtual sal_Int32 GetLineLen(sal_Int32 nPara, sal_Int32 nLine) const override
Query line length.
virtual SfxItemPool * GetPool() const override
virtual SfxItemState GetItemState(const ESelection &rSel, sal_uInt16 nWhich) const override
virtual bool IsValid() const override
Query state of forwarder.
virtual void CopyText(const SvxTextForwarder &rSource) override
std::optional< SfxItemSet > moParaAttribsCache
this pointer may be null or point to an item set for the paragraph mnParaAttribsCache
virtual OUString CalcFieldValue(const SvxFieldItem &rField, sal_Int32 nPara, sal_Int32 nPos, std::optional< Color > &rpTxtColor, std::optional< Color > &rpFldColor, std::optional< FontLineStyle > &rpFldLineStyle) override
virtual sal_Int16 GetDepth(sal_Int32 nPara) const override
Get the outline depth of given paragraph.
virtual bool GetIndexAtPoint(const Point &, sal_Int32 &nPara, sal_Int32 &nIndex) const override
Query paragraph and character index of the character at the given point.
virtual OUString GetText(const ESelection &rSel) const override
virtual sal_Int32 GetFieldCount(sal_Int32 nPara) const override
Query number of fields in the underlying edit engine.
virtual void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &rSet) override
SvxOutlinerForwarder(Outliner &rOutl, bool bOutlText)
virtual tools::Rectangle GetCharBounds(sal_Int32 nPara, sal_Int32 nIndex) const override
Query the bounding rectangle of the given character.
virtual ~SvxOutlinerForwarder() override
sal_Int32 mnParaAttribsCache
if we have a cached para attribute item set, this is the paragraph of it
virtual sal_Int32 GetLineCount(sal_Int32 nPara) const override
Query number of lines in the formatted paragraph.
virtual void RemoveAttribs(const ESelection &rSelection) override
virtual tools::Rectangle GetParaBounds(sal_Int32 nPara) const override
Query the bounding rectangle of the given paragraph.
virtual void QuickInsertLineBreak(const ESelection &rSel) override
virtual void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel) override
Contains an EditEngine or an Outliner and unifies access to them.
virtual void SetNumberingStartValue(sal_Int32 nPara, sal_Int32 nNumberingStartValue)
virtual sal_Int32 GetNumberingStartValue(sal_Int32 nPara)
virtual bool IsParaIsNumberingRestart(sal_Int32 nPara)
virtual void SetParaIsNumberingRestart(sal_Int32 nPara, bool bParaIsNumberingRestart)
Specialise std::optional template for the case where we are wrapping a o3tl::cow_wrapper type,...
#define DBG_ASSERT(sCon, aError)
GetAttribsFlags
values for: SfxItemSet GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd,...
EditEngineAttribs
values for: SfxItemSet GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib = EditEn...
@ OnlyHard
returns all attributes even when they are not set
SfxItemState GetSvxEditEngineItemState(EditEngine const &rEditEngine, const ESelection &rSel, sal_uInt16 nWhich)
static SfxItemSet ImplOutlinerForwarderGetAttribs(const ESelection &rSel, EditEngineAttribs nOnlyHardAttrib, EditEngine &rEditEngine)