22 #include <com/sun/star/i18n/ScriptType.hpp>
25 #include <osl/diagnose.h>
40 :
SwPaM( *rPam.GetPoint(), static_cast<
SwPaM*>(pRing) ),
59 if( nEndCnt == nSttCnt )
65 if( nEndCnt < nSttCnt )
67 std::swap(nSttCnt, nEndCnt);
73 const OUString sText( pTNd->
GetText().copy(nSttCnt, nEndCnt - nSttCnt));
76 const sal_Int32 nLen = sText.getLength();
105 pTNd->
EraseText( rIdx, nEndCnt - nSttCnt );
120 case i18n::ScriptType::ASIAN:
122 case i18n::ScriptType::COMPLEX:
143 if( nEndCnt < nSttCnt )
145 std::swap(nSttCnt, nEndCnt);
149 const OUString& rNewStr = rData.
GetText();
153 sal_Int32 nReplace = nEndCnt - nSttCnt;
154 const sal_Int32 nNewLen = rNewStr.getLength();
155 if( nNewLen < nReplace )
168 if( nOWLen < nReplace )
171 pTNd->
EraseText( aIdx, nReplace-nOWLen );
177 nReplace = std::min(nOWLen, nNewLen);
188 if( nSttCnt < nEndCnt )
190 pTNd->
EraseText( aIdx, nEndCnt - nSttCnt );
229 sal_Int32
nPos = std::min(nInPos, nBrkPos);
232 nPos = std::max(nInPos, nBrkPos);
264 sal_Int32 nContentPos )
const
277 if( nPt < nMk || ( nPt == nMk && nPtCnt < nMkCnt ))
279 sal_uLong nTmp = nMk; nMk = nPt; nPt = nTmp;
280 sal_Int32 nTmp2 = nMkCnt; nMkCnt = nPtCnt; nPtCnt = nTmp2;
283 if( nMk <= nNdIdx && nNdIdx <= nPt &&
285 ( nMkCnt <= nContentPos && nContentPos <= nPtCnt )))
299 "more than one InputEngine available" );
sal_uLong GetIndex() const
bool IsMultiSelection() const
const OUString & GetText() const
virtual ~SwExtTextInput() override
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
const SwPosition * GetMark() const
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
IDocumentUndoRedo & GetIDocumentUndoRedo()
OUString m_sOverwriteText
IDocumentContentOperations const & getIDocumentContentOperations() const
SwExtTextInput * GetExtTextInput() const
#define CH_TXTATR_BREAKWORD
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
sal_uLong GetIndex() const
void SetOverwriteCursor(bool bFlag)
PaM is Point and Mark: a selection of the document model.
const OUString & GetText() const
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
virtual bool Overwrite(const SwPaM &rRg, const OUString &rStr)=0
Overwrite string in an existing text node.
bool m_bIsOverwriteCursor
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
const SwPosition * GetPoint() const
SwExtTextInput * GetNext()
virtual bool DoesGroupUndo() const =0
Is Group Undo enabled?
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
static sal_Int16 GetI18NScriptTypeOfLanguage(LanguageType nLang)
Marks a character position inside a document model node.
#define LANGUAGE_DONTKNOW
SwExtTextInput * CreateExtTextInput(const SwPaM &rPam)
virtual void DoGroupUndo(bool const bDoUndo)=0
Enable/Disable Group Undo.
void EraseText(const SwIndex &rIdx, const sal_Int32 nCount=SAL_MAX_INT32, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
delete text content ATTENTION: must not be called with a range that overlaps the start of an attribut...
OUString InsertText(const OUString &rStr, const SwIndex &rIdx, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
insert text content
SwTextNode is a paragraph in the document model.
LanguageType m_eInputLanguage
void ReplaceText(const SwIndex &rStart, const sal_Int32 nDelLen, const OUString &rText)
replace nDelLen characters at rStart with rText in case the replacement does not fit, it is partially inserted up to the capacity of the node
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, bool bExpandCharToPara=false, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
void DeleteExtTextInput(SwExtTextInput *pDel)
sal_Int32 GetIndex() const
LanguageType GetLang(const sal_Int32 nBegin, const sal_Int32 nLen=0, sal_uInt16 nScript=0) const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
std::vector< ExtTextInputAttr > m_aAttrs
SwExtTextInput(const SwPaM &rPam, Ring *pRing)
void SetInputData(const CommandExtTextInputData &rData)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
SwExtTextInput * mpExtInputRing
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Base class of the Writer document model elements.
const ExtTextInputAttr * GetTextAttr() const