21#include <osl/diagnose.h>
24#include <com/sun/star/i18n/WordType.hpp>
40 rEditEngine( rEngine )
69 switch( nOnlyHardAttrib )
78 OSL_FAIL(
"unknown flags for SvxOutlinerForwarder::GetAttribs");
130 return pStyle->GetName();
137 if (
auto pStyle = pStyleSheetPool ? pStyleSheetPool->Find(rStyleName, SfxStyleFamily::Para) :
nullptr)
180 std::vector<EECharAttrib> aAttribs;
196 sal_Int32 nEndPos = rSel.
nEndPos;
206 sal_Int32 nLastEnd =
nPos;
210 for (
auto const& attrib : aAttribs)
212 DBG_ASSERT(attrib.pAttr,
"GetCharAttribs gives corrupt data");
214 const bool bEmptyPortion = attrib.nStart == attrib.nEnd;
215 if((!bEmptyPortion && attrib.nStart >= nEndPos) ||
216 (bEmptyPortion && attrib.nStart > nEndPos))
219 if((!bEmptyPortion && attrib.nEnd <=
nPos) ||
220 (bEmptyPortion && attrib.nEnd <
nPos))
223 if(attrib.pAttr->Which() != nWhich)
230 if(*pParaItem != *(attrib.pAttr))
231 return SfxItemState::DONTCARE;
234 pParaItem = attrib.pAttr;
239 if(!bGaps && attrib.nStart > nLastEnd)
242 nLastEnd = attrib.nEnd;
245 if( !bEmpty && !bGaps && nLastEnd < ( nEndPos - 1 ) )
249 eParaState = SfxItemState::DEFAULT;
251 eParaState = SfxItemState::DONTCARE;
253 eParaState = SfxItemState::SET;
258 if( (pParaItem ==
nullptr) || (*pLastItem != *pParaItem) )
259 return SfxItemState::DONTCARE;
263 pLastItem = pParaItem;
348 aSize, bIsVertical );
367 return tools::Rectangle( nTextWidth - aPnt.
Y() - nWidth, 0, nTextWidth - aPnt.
Y(), nHeight );
401 nPara = aDocPos.
nPara;
482 return nNewDepth == -1;
500 DBG_ASSERT( nPara < nParaCount,
"paragraph index out of bounds" );
501 if (0 <= nPara && nPara < nParaCount)
513 if( !pSourceForwarder )
void GetPortions(sal_Int32 nPara, std::vector< sal_Int32 > &rList)
OUString GetWord(sal_Int32 nPara, sal_Int32 nIndex)
void QuickFormatDoc(bool bFull=false)
OUString GetText(LineEnd eEnd=LINEEND_LF) const
virtual OUString CalcFieldValue(const SvxFieldItem &rField, sal_Int32 nPara, sal_Int32 nPos, std::optional< Color > &rTxtColor, std::optional< Color > &rFldColor, std::optional< FontLineStyle > &rFldLineStyle)
std::unique_ptr< EditTextObject > CreateTextObject()
void SetText(const OUString &rStr)
EPosition FindDocPosition(const Point &rDocPos) const
editeng::LanguageSpan GetLanguage(const EditPaM &rPaM) const
void QuickInsertLineBreak(const ESelection &rSel)
sal_Int32 GetParagraphCount() const
MapMode const & GetRefMapMode() const
OutputDevice * GetRefDevice() const
void RemoveAttribs(const ESelection &rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich)
void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel)
sal_uInt32 GetTextHeight() const
void QuickDelete(const ESelection &rSel)
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)
bool IsEffectivelyVertical() const
bool HasParaAttrib(sal_Int32 nPara, sal_uInt16 nWhich) const
void SetStyleSheet(const EditSelection &aSel, SfxStyleSheet *pStyle)
tools::Rectangle GetCharacterBounds(const EPosition &rPos) const
sal_Int32 GetLineNumberAtIndex(sal_Int32 nPara, sal_Int32 nIndex) const
virtual bool FieldClicked(const SvxFieldItem &rField)
sal_Int32 GetLineLen(sal_Int32 nParagraph, sal_Int32 nLine) const
sal_uInt32 CalcTextWidth()
const SfxPoolItem & GetParaAttrib(sal_Int32 nPara, sal_uInt16 nWhich) const
bool IsUpdateLayout() const
const SfxItemSet & GetEmptyItemSet() const
void GetLineBoundaries(sal_Int32 &rStart, sal_Int32 &rEnd, sal_Int32 nParagraph, sal_Int32 nLine) const
sal_uInt32 GetLineHeight(sal_Int32 nParagraph)
SfxStyleSheetPool * GetStyleSheetPool()
sal_Int32 GetLineCount(sal_Int32 nParagraph) const
sal_uInt16 GetFieldCount(sal_Int32 nPara) const
void QuickSetAttribs(const SfxItemSet &rSet, const ESelection &rSel)
void QuickInsertText(const OUString &rText, const ESelection &rSel)
const SfxStyleSheet * GetStyleSheet(sal_Int32 nPara) const
virtual void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &rSet)
void GetCharAttribs(sal_Int32 nPara, std::vector< EECharAttrib > &rLst) const
const SfxItemSet & GetParaAttribs(sal_Int32 nPara) const
Point GetDocPosTopLeft(sal_Int32 nParagraph)
constexpr tools::Long Y() const
SfxItemPool * GetPool() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
virtual tools::Rectangle GetCharBounds(sal_Int32 nPara, sal_Int32 nIndex) const override
Query the bounding rectangle of the given character.
virtual void GetLineBoundaries(sal_Int32 &rStart, sal_Int32 &rEnd, sal_Int32 nParagraph, sal_Int32 nLine) const override
Query bounds of line in paragraph.
virtual void GetPortions(sal_Int32 nPara, std::vector< sal_Int32 > &rList) const override
virtual sal_Int32 GetParagraphCount() const override
virtual EBulletInfo GetBulletInfo(sal_Int32 nPara) const override
Query information regarding bullets for given paragraph on the underlying edit engine.
virtual sal_Int32 GetLineLen(sal_Int32 nPara, sal_Int32 nLine) const override
Query line length.
virtual bool IsValid() const override
Query state of forwarder.
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 bool SetDepth(sal_Int32 nPara, sal_Int16 nNewDepth) override
Set the outline depth of given paragraph.
virtual sal_Int16 GetDepth(sal_Int32 nPara) const override
Get the outline depth of given paragraph.
virtual void QuickInsertLineBreak(const ESelection &rSel) override
virtual void QuickInsertText(const OUString &rText, const ESelection &rSel) override
virtual void QuickSetAttribs(const SfxItemSet &rSet, const ESelection &rSel) override
virtual sal_Int32 AppendTextPortion(sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet) override
virtual ~SvxEditEngineForwarder() override
virtual void AppendParagraph() override
virtual void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel) override
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.
SvxEditEngineForwarder(EditEngine &rEngine)
virtual void CopyText(const SvxTextForwarder &rSource) override
virtual sal_Int32 GetFieldCount(sal_Int32 nPara) const override
Query number of fields in the underlying edit engine.
virtual bool Delete(const ESelection &) override
Delete given text range and reformat text.
virtual SfxItemSet GetAttribs(const ESelection &rSel, EditEngineAttribs nOnlyHardAttrib=EditEngineAttribs::All) const override
virtual void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &rSet) override
virtual SfxItemSet GetParaAttribs(sal_Int32 nPara) const override
virtual OUString GetStyleSheet(sal_Int32 nPara) const override
virtual OUString GetText(const ESelection &rSel) const override
virtual SfxItemState GetItemState(const ESelection &rSel, sal_uInt16 nWhich) const override
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 void FieldClicked(const SvxFieldItem &rField) override
virtual LanguageType GetLanguage(sal_Int32, sal_Int32) const override
Query language of character at given position on the underlying edit engine.
virtual SfxItemPool * GetPool() const override
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 bool QuickFormatDoc(bool bFull=false) override
Updates the formatting.
virtual const SfxItemSet * GetEmptyItemSetPtr() override
virtual void SetStyleSheet(sal_Int32 nPara, const OUString &rStyleName) override
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_Int32 GetLineCount(sal_Int32 nPara) const override
Query number of lines in the formatted paragraph.
virtual bool InsertText(const OUString &, const ESelection &) override
Insert/Replace given text in given range and reformat text.
virtual MapMode GetMapMode() const override
Query the map mode of the underlying EditEngine/Outliner.
virtual EFieldInfo GetFieldInfo(sal_Int32 nPara, sal_uInt16 nField) const override
Query information for given field number in the underlying edit engine.
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 sal_Int32 GetTextLen(sal_Int32 nParagraph) const override
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).
Contains an EditEngine or an Outliner and unifies access to them.
#define DBG_ASSERT(sCon, aError)
constexpr sal_uInt16 EE_PARA_START(EE_ITEMS_START+0)
constexpr sal_uInt16 EE_PARA_END(EE_PARA_START+19)
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
LineEnd GetSystemLineEnd()
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
SfxItemState GetSvxEditEngineItemState(EditEngine const &rEditEngine, const ESelection &rSel, sal_uInt16 nWhich)