LibreOffice Module editeng (master) 1
unofored.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20
21#include <osl/diagnose.h>
22#include <tools/debug.hxx>
23#include <editeng/eeitem.hxx>
24#include <com/sun/star/i18n/WordType.hpp>
25
26#include <svl/itemset.hxx>
27#include <editeng/editeng.hxx>
28#include <editeng/unoedhlp.hxx>
29#include <editeng/editdata.hxx>
30#include <editeng/outliner.hxx>
31#include <editeng/editobj.hxx>
32
33#include <editeng/unofored.hxx>
34#include "unofored_internal.hxx"
35
36using namespace ::com::sun::star;
37
38
40 rEditEngine( rEngine )
41{
42}
43
45{
46 // the EditEngine may need to be deleted from the outside
47}
48
50{
52}
53
54sal_Int32 SvxEditEngineForwarder::GetTextLen( sal_Int32 nParagraph ) const
55{
56 return rEditEngine.GetTextLen( nParagraph );
57}
58
59OUString SvxEditEngineForwarder::GetText( const ESelection& rSel ) const
60{
62}
63
65{
66 if( rSel.nStartPara == rSel.nEndPara )
67 {
69 switch( nOnlyHardAttrib )
70 {
72 nFlags = GetAttribsFlags::ALL;
73 break;
76 break;
77 default:
78 OSL_FAIL("unknown flags for SvxOutlinerForwarder::GetAttribs");
79 }
80
81 return rEditEngine.GetAttribs( rSel.nStartPara, rSel.nStartPos, rSel.nEndPos, nFlags );
82 }
83 else
84 {
85 return rEditEngine.GetAttribs( rSel, nOnlyHardAttrib );
86 }
87}
88
90{
91 SfxItemSet aSet( rEditEngine.GetParaAttribs( nPara ) );
92
93 sal_uInt16 nWhich = EE_PARA_START;
94 while( nWhich <= EE_PARA_END )
95 {
96 if( aSet.GetItemState( nWhich ) != SfxItemState::SET )
97 {
98 if( rEditEngine.HasParaAttrib( nPara, nWhich ) )
99 aSet.Put( rEditEngine.GetParaAttrib( nPara, nWhich ) );
100 }
101 nWhich++;
102 }
103
104 return aSet;
105}
106
107void SvxEditEngineForwarder::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
108{
110}
111
113{
114 rEditEngine.RemoveAttribs( rSelection, false/*bRemoveParaAttribs*/, 0 );
115}
116
118{
120}
121
122void SvxEditEngineForwarder::GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const
123{
124 rEditEngine.GetPortions( nPara, rList );
125}
126
127OUString SvxEditEngineForwarder::GetStyleSheet(sal_Int32 nPara) const
128{
129 if (auto pStyle = rEditEngine.GetStyleSheet(nPara))
130 return pStyle->GetName();
131 return OUString();
132}
133
134void SvxEditEngineForwarder::SetStyleSheet(sal_Int32 nPara, const OUString& rStyleName)
135{
136 auto pStyleSheetPool = rEditEngine.GetStyleSheetPool();
137 if (auto pStyle = pStyleSheetPool ? pStyleSheetPool->Find(rStyleName, SfxStyleFamily::Para) : nullptr)
138 rEditEngine.SetStyleSheet(nPara, static_cast<SfxStyleSheet*>(pStyle));
139}
140
141void SvxEditEngineForwarder::QuickInsertText( const OUString& rText, const ESelection& rSel )
142{
143 rEditEngine.QuickInsertText( rText, rSel );
144}
145
147{
149}
150
152{
153 rEditEngine.QuickInsertField( rFld, rSel );
154}
155
157{
159}
160
162{
163 // cannot reliably query EditEngine state
164 // while in the middle of an update
166}
167
168OUString SvxEditEngineForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, std::optional<Color>& rpTxtColor, std::optional<Color>& rpFldColor, std::optional<FontLineStyle>& rpFldLineStyle )
169{
170 return rEditEngine.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor, rpFldLineStyle );
171}
172
174{
175 rEditEngine.FieldClicked( rField );
176}
177
178SfxItemState GetSvxEditEngineItemState( EditEngine const & rEditEngine, const ESelection& rSel, sal_uInt16 nWhich )
179{
180 std::vector<EECharAttrib> aAttribs;
181
182 const SfxPoolItem* pLastItem = nullptr;
183
184 SfxItemState eState = SfxItemState::DEFAULT;
185
186 // check all paragraphs inside the selection
187 for( sal_Int32 nPara = rSel.nStartPara; nPara <= rSel.nEndPara; nPara++ )
188 {
189 SfxItemState eParaState = SfxItemState::DEFAULT;
190
191 // calculate start and endpos for this paragraph
192 sal_Int32 nPos = 0;
193 if( rSel.nStartPara == nPara )
194 nPos = rSel.nStartPos;
195
196 sal_Int32 nEndPos = rSel.nEndPos;
197 if( rSel.nEndPara != nPara )
198 nEndPos = rEditEngine.GetTextLen( nPara );
199
200
201 // get list of char attribs
202 rEditEngine.GetCharAttribs( nPara, aAttribs );
203
204 bool bEmpty = true; // we found no item inside the selection of this paragraph
205 bool bGaps = false; // we found items but there are gaps between them
206 sal_Int32 nLastEnd = nPos;
207
208 const SfxPoolItem* pParaItem = nullptr;
209
210 for (auto const& attrib : aAttribs)
211 {
212 DBG_ASSERT(attrib.pAttr, "GetCharAttribs gives corrupt data");
213
214 const bool bEmptyPortion = attrib.nStart == attrib.nEnd;
215 if((!bEmptyPortion && attrib.nStart >= nEndPos) ||
216 (bEmptyPortion && attrib.nStart > nEndPos))
217 break; // break if we are already behind our selection
218
219 if((!bEmptyPortion && attrib.nEnd <= nPos) ||
220 (bEmptyPortion && attrib.nEnd < nPos))
221 continue; // or if the attribute ends before our selection
222
223 if(attrib.pAttr->Which() != nWhich)
224 continue; // skip if is not the searched item
225
226 // if we already found an item
227 if( pParaItem )
228 {
229 // ... and its different to this one than the state is don't care
230 if(*pParaItem != *(attrib.pAttr))
231 return SfxItemState::DONTCARE;
232 }
233 else
234 pParaItem = attrib.pAttr;
235
236 if( bEmpty )
237 bEmpty = false;
238
239 if(!bGaps && attrib.nStart > nLastEnd)
240 bGaps = true;
241
242 nLastEnd = attrib.nEnd;
243 }
244
245 if( !bEmpty && !bGaps && nLastEnd < ( nEndPos - 1 ) )
246 bGaps = true;
247
248 if( bEmpty )
249 eParaState = SfxItemState::DEFAULT;
250 else if( bGaps )
251 eParaState = SfxItemState::DONTCARE;
252 else
253 eParaState = SfxItemState::SET;
254
255 // if we already found an item check if we found the same
256 if( pLastItem )
257 {
258 if( (pParaItem == nullptr) || (*pLastItem != *pParaItem) )
259 return SfxItemState::DONTCARE;
260 }
261 else
262 {
263 pLastItem = pParaItem;
264 eState = eParaState;
265 }
266 }
267
268 return eState;
269}
270
271SfxItemState SvxEditEngineForwarder::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const
272{
273 return GetSvxEditEngineItemState( rEditEngine, rSel, nWhich );
274}
275
276SfxItemState SvxEditEngineForwarder::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
277{
278 const SfxItemSet& rSet = rEditEngine.GetParaAttribs( nPara );
279 return rSet.GetItemState( nWhich );
280}
281
282LanguageType SvxEditEngineForwarder::GetLanguage( sal_Int32 nPara, sal_Int32 nIndex ) const
283{
284 return rEditEngine.GetLanguage(nPara, nIndex).nLang;
285}
286
287sal_Int32 SvxEditEngineForwarder::GetFieldCount( sal_Int32 nPara ) const
288{
289 return rEditEngine.GetFieldCount(nPara);
290}
291
292EFieldInfo SvxEditEngineForwarder::GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const
293{
294 return rEditEngine.GetFieldInfo( nPara, nField );
295}
296
298{
299 return EBulletInfo();
300}
301
302tools::Rectangle SvxEditEngineForwarder::GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const
303{
304 // EditEngine's 'internal' methods like GetCharacterBounds()
305 // don't rotate for vertical text.
307 // swap width and height
308 tools::Long tmp = aSize.Width();
309 aSize.setWidth(aSize.Height());
310 aSize.setHeight(tmp);
311 bool bIsVertical( rEditEngine.IsEffectivelyVertical() );
312
313 // #108900# Handle virtual position one-past-the end of the string
314 if( nIndex >= rEditEngine.GetTextLen(nPara) )
315 {
316 tools::Rectangle aLast;
317
318 if( nIndex )
319 {
320 // use last character, if possible
321 aLast = rEditEngine.GetCharacterBounds( EPosition(nPara, nIndex-1) );
322
323 // move at end of this last character, make one pixel wide
324 aLast.Move( aLast.Right() - aLast.Left(), 0 );
325 aLast.SetSize( Size(1, aLast.GetHeight()) );
326
327 // take care for CTL
328 aLast = SvxEditSourceHelper::EEToUserSpace( aLast, aSize, bIsVertical );
329 }
330 else
331 {
332 // #109864# Bounds must lie within the paragraph
333 aLast = GetParaBounds( nPara );
334
335 // #109151# Don't use paragraph height, but line height
336 // instead. aLast is already CTL-correct
337 if( bIsVertical)
338 aLast.SetSize( Size( rEditEngine.GetLineHeight(nPara), 1 ) );
339 else
340 aLast.SetSize( Size( 1, rEditEngine.GetLineHeight(nPara) ) );
341 }
342
343 return aLast;
344 }
345 else
346 {
348 aSize, bIsVertical );
349 }
350}
351
353{
354 const Point aPnt = rEditEngine.GetDocPosTopLeft( nPara );
355 sal_uInt32 nWidth;
356 sal_uInt32 nHeight;
357
359 {
360 // Hargl. EditEngine's 'external' methods return the rotated
361 // dimensions, 'internal' methods like GetTextHeight( n )
362 // don't rotate.
363 nWidth = rEditEngine.GetTextHeight( nPara );
364 nHeight = rEditEngine.GetTextHeight();
365 sal_uInt32 nTextWidth = rEditEngine.GetTextHeight();
366
367 return tools::Rectangle( nTextWidth - aPnt.Y() - nWidth, 0, nTextWidth - aPnt.Y(), nHeight );
368 }
369 else
370 {
371 nWidth = rEditEngine.CalcTextWidth();
372 nHeight = rEditEngine.GetTextHeight( nPara );
373
374 return tools::Rectangle( 0, aPnt.Y(), nWidth, aPnt.Y() + nHeight );
375 }
376}
377
379{
380 return rEditEngine.GetRefMapMode();
381}
382
384{
385 return rEditEngine.GetRefDevice();
386}
387
388bool SvxEditEngineForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPara, sal_Int32& nIndex ) const
389{
391 // swap width and height
392 tools::Long tmp = aSize.Width();
393 aSize.setWidth(aSize.Height());
394 aSize.setHeight(tmp);
396 aSize,
398
399 EPosition aDocPos = rEditEngine.FindDocPosition( aEEPos );
400
401 nPara = aDocPos.nPara;
402 nIndex = aDocPos.nIndex;
403
404 return true;
405}
406
407bool SvxEditEngineForwarder::GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, sal_Int32& nStart, sal_Int32& nEnd ) const
408{
409 ESelection aRes = rEditEngine.GetWord( ESelection(nPara, nIndex, nPara, nIndex), css::i18n::WordType::DICTIONARY_WORD );
410
411 if( aRes.nStartPara == nPara &&
412 aRes.nStartPara == aRes.nEndPara )
413 {
414 nStart = aRes.nStartPos;
415 nEnd = aRes.nEndPos;
416
417 return true;
418 }
419
420 return false;
421}
422
423bool SvxEditEngineForwarder::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell ) const
424{
425 SvxEditSourceHelper::GetAttributeRun( nStartIndex, nEndIndex, rEditEngine, nPara, nIndex, bInCell );
426 return true;
427}
428
429sal_Int32 SvxEditEngineForwarder::GetLineCount( sal_Int32 nPara ) const
430{
431 return rEditEngine.GetLineCount(nPara);
432}
433
434sal_Int32 SvxEditEngineForwarder::GetLineLen( sal_Int32 nPara, sal_Int32 nLine ) const
435{
436 return rEditEngine.GetLineLen(nPara, nLine);
437}
438
439void SvxEditEngineForwarder::GetLineBoundaries( /*out*/sal_Int32 &rStart, /*out*/sal_Int32 &rEnd, sal_Int32 nPara, sal_Int32 nLine ) const
440{
441 rEditEngine.GetLineBoundaries(rStart, rEnd, nPara, nLine);
442}
443
444sal_Int32 SvxEditEngineForwarder::GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) const
445{
447}
448
449
451{
453
454 return true;
455}
456
458{
459 rEditEngine.QuickDelete( rSelection );
461
462 return true;
463}
464
465bool SvxEditEngineForwarder::InsertText( const OUString& rStr, const ESelection& rSelection )
466{
467 rEditEngine.QuickInsertText( rStr, rSelection );
469
470 return true;
471}
472
473sal_Int16 SvxEditEngineForwarder::GetDepth( sal_Int32 ) const
474{
475 // EditEngine does not support outline depth
476 return -1;
477}
478
479bool SvxEditEngineForwarder::SetDepth( sal_Int32, sal_Int16 nNewDepth )
480{
481 // EditEngine does not support outline depth
482 return nNewDepth == -1;
483}
484
486{
488}
489
491{
493}
494
495sal_Int32 SvxEditEngineForwarder::AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet & /*rSet*/ )
496{
497 sal_Int32 nLen = 0;
498
499 sal_Int32 nParaCount = rEditEngine.GetParagraphCount();
500 DBG_ASSERT( nPara < nParaCount, "paragraph index out of bounds" );
501 if (0 <= nPara && nPara < nParaCount)
502 {
503 nLen = rEditEngine.GetTextLen( nPara );
504 rEditEngine.QuickInsertText( rText, ESelection( nPara, nLen, nPara, nLen ) );
505 }
506
507 return nLen;
508}
509
511{
512 const SvxEditEngineForwarder* pSourceForwarder = dynamic_cast< const SvxEditEngineForwarder* >( &rSource );
513 if( !pSourceForwarder )
514 return;
515 std::unique_ptr<EditTextObject> pNewTextObject = pSourceForwarder->rEditEngine.CreateTextObject();
516 rEditEngine.SetText( *pNewTextObject );
517}
518
519
520/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void GetPortions(sal_Int32 nPara, std::vector< sal_Int32 > &rList)
Definition: editeng.cxx:1841
OUString GetWord(sal_Int32 nPara, sal_Int32 nIndex)
Definition: editeng.cxx:663
void QuickFormatDoc(bool bFull=false)
Definition: editeng.cxx:2127
OUString GetText(LineEnd eEnd=LINEEND_LF) const
Definition: editeng.cxx:573
virtual OUString CalcFieldValue(const SvxFieldItem &rField, sal_Int32 nPara, sal_Int32 nPos, std::optional< Color > &rTxtColor, std::optional< Color > &rFldColor, std::optional< FontLineStyle > &rFldLineStyle)
Definition: editeng.cxx:2618
std::unique_ptr< EditTextObject > CreateTextObject()
Definition: editeng.cxx:1517
void SetText(const OUString &rStr)
Definition: editeng.cxx:1492
EPosition FindDocPosition(const Point &rDocPos) const
Definition: editeng.cxx:2433
editeng::LanguageSpan GetLanguage(const EditPaM &rPaM) const
Definition: editeng.cxx:482
void QuickInsertLineBreak(const ESelection &rSel)
Definition: editeng.cxx:2109
sal_Int32 GetParagraphCount() const
Definition: editeng.cxx:589
MapMode const & GetRefMapMode() const
Definition: editeng.cxx:164
OutputDevice * GetRefDevice() const
Definition: editeng.cxx:154
void RemoveAttribs(const ESelection &rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich)
Definition: editeng.cxx:1796
void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel)
Definition: editeng.cxx:2118
sal_uInt32 GetTextHeight() const
Definition: editeng.cxx:1439
void QuickDelete(const ESelection &rSel)
Definition: editeng.cxx:2093
SfxItemSet GetAttribs(sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, GetAttribsFlags nFlags=GetAttribsFlags::ALL) const
Definition: editeng.cxx:1791
EFieldInfo GetFieldInfo(sal_Int32 nPara, sal_uInt16 nField) const
Definition: editeng.cxx:2337
sal_Int32 GetTextLen() const
Definition: editeng.cxx:584
void InsertParagraph(sal_Int32 nPara, const EditTextObject &rTxtObj, const bool bAppend=false)
Definition: editeng.cxx:1689
bool IsEffectivelyVertical() const
Definition: editeng.cxx:441
bool HasParaAttrib(sal_Int32 nPara, sal_uInt16 nWhich) const
Definition: editeng.cxx:1759
void SetStyleSheet(const EditSelection &aSel, SfxStyleSheet *pStyle)
Definition: editeng.cxx:2138
tools::Rectangle GetCharacterBounds(const EPosition &rPos) const
Definition: editeng.cxx:2446
sal_Int32 GetLineNumberAtIndex(sal_Int32 nPara, sal_Int32 nIndex) const
Definition: editeng.cxx:615
virtual bool FieldClicked(const SvxFieldItem &rField)
Definition: editeng.cxx:2623
sal_Int32 GetLineLen(sal_Int32 nParagraph, sal_Int32 nLine) const
Definition: editeng.cxx:601
sal_uInt32 CalcTextWidth()
Definition: editeng.cxx:1461
const SfxPoolItem & GetParaAttrib(sal_Int32 nPara, sal_uInt16 nWhich) const
Definition: editeng.cxx:1764
bool IsUpdateLayout() const
Definition: editeng.cxx:1482
const SfxItemSet & GetEmptyItemSet() const
Definition: editeng.cxx:199
void GetLineBoundaries(sal_Int32 &rStart, sal_Int32 &rEnd, sal_Int32 nParagraph, sal_Int32 nLine) const
Definition: editeng.cxx:608
sal_uInt32 GetLineHeight(sal_Int32 nParagraph)
Definition: editeng.cxx:622
SfxStyleSheetPool * GetStyleSheetPool()
Definition: editeng.cxx:2163
sal_Int32 GetLineCount(sal_Int32 nParagraph) const
Definition: editeng.cxx:594
sal_uInt16 GetFieldCount(sal_Int32 nPara) const
Definition: editeng.cxx:2321
void QuickSetAttribs(const SfxItemSet &rSet, const ESelection &rSel)
Definition: editeng.cxx:2063
void QuickInsertText(const OUString &rText, const ESelection &rSel)
Definition: editeng.cxx:2084
const SfxStyleSheet * GetStyleSheet(sal_Int32 nPara) const
Definition: editeng.cxx:2148
virtual void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &rSet)
Definition: editeng.cxx:1747
void GetCharAttribs(sal_Int32 nPara, std::vector< EECharAttrib > &rLst) const
Definition: editeng.cxx:1779
const SfxItemSet & GetParaAttribs(sal_Int32 nPara) const
Definition: editeng.cxx:1754
Point GetDocPosTopLeft(sal_Int32 nParagraph)
Definition: editeng.cxx:1993
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.
Definition: unofored.cxx:302
virtual void GetLineBoundaries(sal_Int32 &rStart, sal_Int32 &rEnd, sal_Int32 nParagraph, sal_Int32 nLine) const override
Query bounds of line in paragraph.
Definition: unofored.cxx:439
virtual void GetPortions(sal_Int32 nPara, std::vector< sal_Int32 > &rList) const override
Definition: unofored.cxx:122
virtual sal_Int32 GetParagraphCount() const override
Definition: unofored.cxx:49
virtual EBulletInfo GetBulletInfo(sal_Int32 nPara) const override
Query information regarding bullets for given paragraph on the underlying edit engine.
Definition: unofored.cxx:297
virtual sal_Int32 GetLineLen(sal_Int32 nPara, sal_Int32 nLine) const override
Query line length.
Definition: unofored.cxx:434
virtual bool IsValid() const override
Query state of forwarder.
Definition: unofored.cxx:161
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.
Definition: unofored.cxx:407
virtual bool SetDepth(sal_Int32 nPara, sal_Int16 nNewDepth) override
Set the outline depth of given paragraph.
Definition: unofored.cxx:479
virtual sal_Int16 GetDepth(sal_Int32 nPara) const override
Get the outline depth of given paragraph.
Definition: unofored.cxx:473
virtual void QuickInsertLineBreak(const ESelection &rSel) override
Definition: unofored.cxx:146
virtual void QuickInsertText(const OUString &rText, const ESelection &rSel) override
Definition: unofored.cxx:141
virtual void QuickSetAttribs(const SfxItemSet &rSet, const ESelection &rSel) override
Definition: unofored.cxx:156
virtual sal_Int32 AppendTextPortion(sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet) override
Definition: unofored.cxx:495
virtual ~SvxEditEngineForwarder() override
Definition: unofored.cxx:44
virtual void AppendParagraph() override
Definition: unofored.cxx:490
virtual void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel) override
Definition: unofored.cxx:151
virtual OutputDevice * GetRefDevice() const override
Query the reference output device of the underlying EditEngine/Outliner.
Definition: unofored.cxx:383
virtual sal_Int32 GetLineNumberAtIndex(sal_Int32 nPara, sal_Int32 nIndex) const override
Query the line number for an index in the paragraphs text.
Definition: unofored.cxx:444
SvxEditEngineForwarder(EditEngine &rEngine)
Definition: unofored.cxx:39
virtual void CopyText(const SvxTextForwarder &rSource) override
Definition: unofored.cxx:510
virtual sal_Int32 GetFieldCount(sal_Int32 nPara) const override
Query number of fields in the underlying edit engine.
Definition: unofored.cxx:287
virtual bool Delete(const ESelection &) override
Delete given text range and reformat text.
Definition: unofored.cxx:457
virtual SfxItemSet GetAttribs(const ESelection &rSel, EditEngineAttribs nOnlyHardAttrib=EditEngineAttribs::All) const override
Definition: unofored.cxx:64
virtual void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &rSet) override
Definition: unofored.cxx:107
EditEngine & rEditEngine
Definition: unofored.hxx:32
virtual SfxItemSet GetParaAttribs(sal_Int32 nPara) const override
Definition: unofored.cxx:89
virtual OUString GetStyleSheet(sal_Int32 nPara) const override
Definition: unofored.cxx:127
virtual OUString GetText(const ESelection &rSel) const override
Definition: unofored.cxx:59
virtual SfxItemState GetItemState(const ESelection &rSel, sal_uInt16 nWhich) const override
Definition: unofored.cxx:271
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.
Definition: unofored.cxx:388
virtual void FieldClicked(const SvxFieldItem &rField) override
Definition: unofored.cxx:173
virtual LanguageType GetLanguage(sal_Int32, sal_Int32) const override
Query language of character at given position on the underlying edit engine.
Definition: unofored.cxx:282
virtual SfxItemPool * GetPool() const override
Definition: unofored.cxx:117
virtual void RemoveAttribs(const ESelection &rSelection) override
Definition: unofored.cxx:112
virtual tools::Rectangle GetParaBounds(sal_Int32 nPara) const override
Query the bounding rectangle of the given paragraph.
Definition: unofored.cxx:352
virtual bool QuickFormatDoc(bool bFull=false) override
Updates the formatting.
Definition: unofored.cxx:450
virtual const SfxItemSet * GetEmptyItemSetPtr() override
Definition: unofored.cxx:485
virtual void SetStyleSheet(sal_Int32 nPara, const OUString &rStyleName) override
Definition: unofored.cxx:134
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
Definition: unofored.cxx:168
virtual sal_Int32 GetLineCount(sal_Int32 nPara) const override
Query number of lines in the formatted paragraph.
Definition: unofored.cxx:429
virtual bool InsertText(const OUString &, const ESelection &) override
Insert/Replace given text in given range and reformat text.
Definition: unofored.cxx:465
virtual MapMode GetMapMode() const override
Query the map mode of the underlying EditEngine/Outliner.
Definition: unofored.cxx:378
virtual EFieldInfo GetFieldInfo(sal_Int32 nPara, sal_uInt16 nField) const override
Query information for given field number in the underlying edit engine.
Definition: unofored.cxx:292
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.
Definition: unofored.cxx:423
virtual sal_Int32 GetTextLen(sal_Int32 nParagraph) const override
Definition: unofored.cxx:54
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.
Definition: unoedhlp.cxx:85
static Point EEToUserSpace(const Point &rPoint, const Size &rEESize, bool bIsVertical)
Convert point from edit engine to user coordinate space.
Definition: unoedhlp.cxx:234
static Point UserSpaceToEE(const Point &rPoint, const Size &rEESize, bool bIsVertical)
Convert point from user to edit engine coordinate space.
Definition: unoedhlp.cxx:239
This item stores a field (SvxFieldData).
Definition: flditem.hxx:70
Contains an EditEngine or an Outliner and unifies access to them.
Definition: unoedsrc.hxx:142
void SetSize(const Size &)
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
constexpr tools::Long Right() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
#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
sal_Int32 nIndex
LineEnd GetSystemLineEnd()
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
sal_uInt16 nPos
long Long
SfxItemState
static SfxItemSet & rSet
sal_Int32 nIndex
Definition: editdata.hxx:91
sal_Int32 nPara
Definition: editdata.hxx:90
sal_Int32 nStartPara
Definition: editdata.hxx:113
sal_Int32 nEndPos
Definition: editdata.hxx:116
sal_Int32 nStartPos
Definition: editdata.hxx:114
sal_Int32 nEndPara
Definition: editdata.hxx:115
LanguageType nLang
Definition: editdata.hxx:350
SfxItemState GetSvxEditEngineItemState(EditEngine const &rEditEngine, const ESelection &rSel, sal_uInt16 nWhich)
Definition: unofored.cxx:178