LibreOffice Module editeng (master) 1
unoforou.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 <svl/style.hxx>
24#include <com/sun/star/i18n/WordType.hpp>
25
26#include <svl/itemset.hxx>
27#include <editeng/editeng.hxx>
28#include <editeng/editdata.hxx>
29#include <editeng/outliner.hxx>
30#include <editeng/unoedhlp.hxx>
31#include <svl/poolitem.hxx>
32
33#include <editeng/unoforou.hxx>
34#include <editeng/outlobj.hxx>
35#include "unofored_internal.hxx"
36
37using namespace ::com::sun::star;
38
39
40SvxOutlinerForwarder::SvxOutlinerForwarder( Outliner& rOutl, bool bOutlText /* = false */ ) :
41 rOutliner( rOutl ),
42 bOutlinerText( bOutlText ),
43 mnParaAttribsCache( 0 )
44{
45}
46
48{
49 flushCache();
50}
51
53{
55}
56
57sal_Int32 SvxOutlinerForwarder::GetTextLen( sal_Int32 nParagraph ) const
58{
59 return rOutliner.GetEditEngine().GetTextLen( nParagraph );
60}
61
62OUString SvxOutlinerForwarder::GetText( const ESelection& rSel ) const
63{
65 // in the time being use as the hack for the EditEngine:
66 EditEngine* pEditEngine = const_cast<EditEngine*>(&rOutliner.GetEditEngine());
67 return pEditEngine->GetText( rSel );
68}
69
70static SfxItemSet ImplOutlinerForwarderGetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib, EditEngine& rEditEngine )
71{
72 if( rSel.nStartPara == rSel.nEndPara )
73 {
75
76 switch( nOnlyHardAttrib )
77 {
79 nFlags = GetAttribsFlags::ALL;
80 break;
83 break;
84 default:
85 OSL_FAIL("unknown flags for SvxOutlinerForwarder::GetAttribs");
86 }
87 return rEditEngine.GetAttribs( rSel.nStartPara, rSel.nStartPos, rSel.nEndPos, nFlags );
88 }
89 else
90 {
91 return rEditEngine.GetAttribs( rSel, nOnlyHardAttrib );
92 }
93}
94
96{
97 if( moAttribsCache && ( EditEngineAttribs::All == nOnlyHardAttrib ) )
98 {
99 // have we the correct set in cache?
100 if( maAttribCacheSelection == rSel )
101 {
102 // yes! just return the cache
103 return *moAttribsCache;
104 }
105 else
106 {
107 // no, we need delete the old cache
108 moAttribsCache.reset();
109 }
110 }
111
114 EditEngine& rEditEngine = const_cast<EditEngine&>(rOutliner.GetEditEngine());
115
116 SfxItemSet aSet( ImplOutlinerForwarderGetAttribs( rSel, nOnlyHardAttrib, rEditEngine ) );
117
118 if( EditEngineAttribs::All == nOnlyHardAttrib )
119 {
120 moAttribsCache.emplace( aSet );
122 }
123
124 SfxStyleSheet* pStyle = rEditEngine.GetStyleSheet( rSel.nStartPara );
125 if( pStyle )
126 aSet.SetParent( &(pStyle->GetItemSet() ) );
127
128 return aSet;
129}
130
132{
134 {
135 // have we the correct set in cache?
136 if( nPara == mnParaAttribsCache )
137 {
138 // yes! just return the cache
139 return *moParaAttribsCache;
140 }
141 else
142 {
143 // no, we need delete the old cache
144 moParaAttribsCache.reset();
145 }
146 }
147
148 moParaAttribsCache.emplace( rOutliner.GetParaAttribs( nPara ) );
149 mnParaAttribsCache = nPara;
150
151 EditEngine& rEditEngine = const_cast<EditEngine&>(rOutliner.GetEditEngine());
152
153 SfxStyleSheet* pStyle = rEditEngine.GetStyleSheet( nPara );
154 if( pStyle )
155 moParaAttribsCache->SetParent( &(pStyle->GetItemSet() ) );
156
157 return *moParaAttribsCache;
158}
159
160void SvxOutlinerForwarder::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
161{
162 flushCache();
163
164 const SfxItemSet* pOldParent = rSet.GetParent();
165 if( pOldParent )
166 const_cast<SfxItemSet*>(&rSet)->SetParent( nullptr );
167
168 rOutliner.SetParaAttribs( nPara, rSet );
169
170 if( pOldParent )
171 const_cast<SfxItemSet*>(&rSet)->SetParent( pOldParent );
172}
173
175{
176 rOutliner.RemoveAttribs( rSelection, false/*bRemoveParaAttribs*/, 0 );
177}
178
180{
182}
183
184void SvxOutlinerForwarder::GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const
185{
186 const_cast<EditEngine&>(rOutliner.GetEditEngine()).GetPortions( nPara, rList );
187}
188
189OUString SvxOutlinerForwarder::GetStyleSheet(sal_Int32 nPara) const
190{
191 if (auto pStyle = rOutliner.GetStyleSheet(nPara))
192 return pStyle->GetName();
193 return OUString();
194}
195
196void SvxOutlinerForwarder::SetStyleSheet(sal_Int32 nPara, const OUString& rStyleName)
197{
198 auto pStyleSheetPool = rOutliner.GetStyleSheetPool();
199 if (auto pStyle = pStyleSheetPool ? pStyleSheetPool->Find(rStyleName, SfxStyleFamily::Para) : nullptr)
200 rOutliner.SetStyleSheet(nPara, static_cast<SfxStyleSheet*>(pStyle));
201}
202
203void SvxOutlinerForwarder::QuickInsertText( const OUString& rText, const ESelection& rSel )
204{
205 flushCache();
206 if( rText.isEmpty() )
207 {
208 rOutliner.QuickDelete( rSel );
209 }
210 else
211 {
212 rOutliner.QuickInsertText( rText, rSel );
213 }
214}
215
217{
218 flushCache();
220}
221
223{
224 flushCache();
225 rOutliner.QuickInsertField( rFld, rSel );
226}
227
229{
230 flushCache();
232}
233
234OUString SvxOutlinerForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, std::optional<Color>& rpTxtColor, std::optional<Color>& rpFldColor, std::optional<FontLineStyle>& rpFldLineStyle )
235{
236 return rOutliner.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor, rpFldLineStyle );
237}
238
240{
241}
242
244{
245 // cannot reliably query outliner state
246 // while in the middle of an update
247 return rOutliner.IsUpdateLayout();
248}
249
250SfxItemState SvxOutlinerForwarder::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const
251{
252 return GetSvxEditEngineItemState( rOutliner.GetEditEngine(), rSel, nWhich );
253}
254
255SfxItemState SvxOutlinerForwarder::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
256{
257 const SfxItemSet& rSet = rOutliner.GetParaAttribs( nPara );
258 return rSet.GetItemState( nWhich );
259}
260
261
263{
264 moAttribsCache.reset();
265 moParaAttribsCache.reset();
266}
267
268LanguageType SvxOutlinerForwarder::GetLanguage( sal_Int32 nPara, sal_Int32 nIndex ) const
269{
270 return rOutliner.GetLanguage(nPara, nIndex);
271}
272
273sal_Int32 SvxOutlinerForwarder::GetFieldCount( sal_Int32 nPara ) const
274{
275 return rOutliner.GetEditEngine().GetFieldCount(nPara);
276}
277
278EFieldInfo SvxOutlinerForwarder::GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const
279{
280 return rOutliner.GetEditEngine().GetFieldInfo( nPara, nField );
281}
282
284{
285 return rOutliner.GetBulletInfo( nPara );
286}
287
288tools::Rectangle SvxOutlinerForwarder::GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const
289{
290 // EditEngine's 'internal' methods like GetCharacterBounds()
291 // don't rotate for vertical text.
292 Size aSize( rOutliner.CalcTextSize() );
293 // swap width and height
294 tools::Long tmp = aSize.Width();
295 aSize.setWidth(aSize.Height());
296 aSize.setHeight(tmp);
297 bool bIsVertical( rOutliner.IsVertical() );
298
299 // #108900# Handle virtual position one-past-the end of the string
300 if( nIndex >= GetTextLen(nPara) )
301 {
302 tools::Rectangle aLast;
303
304 if( nIndex )
305 {
306 // use last character, if possible
308
309 // move at end of this last character, make one pixel wide
310 aLast.Move( aLast.Right() - aLast.Left(), 0 );
311 aLast.SetSize( Size(1, aLast.GetHeight()) );
312
313 // take care for CTL
314 aLast = SvxEditSourceHelper::EEToUserSpace( aLast, aSize, bIsVertical );
315 }
316 else
317 {
318 // #109864# Bounds must lie within the paragraph
319 aLast = GetParaBounds( nPara );
320
321 // #109151# Don't use paragraph height, but line height
322 // instead. aLast is already CTL-correct
323 if( bIsVertical)
324 aLast.SetSize( Size( rOutliner.GetLineHeight(nPara), 1 ) );
325 else
326 aLast.SetSize( Size( 1, rOutliner.GetLineHeight(nPara) ) );
327 }
328
329 return aLast;
330 }
331 else
332 {
334 aSize, bIsVertical );
335 }
336}
337
339{
340 return rOutliner.GetParaBounds( nPara );
341}
342
344{
345 return rOutliner.GetRefMapMode();
346}
347
349{
350 return rOutliner.GetRefDevice();
351}
352
353bool SvxOutlinerForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPara, sal_Int32& nIndex ) const
354{
355 Size aSize( rOutliner.CalcTextSize() );
356 // swap width and height
357 tools::Long tmp = aSize.Width();
358 aSize.setWidth(aSize.Height());
359 aSize.setHeight(tmp);
361 aSize,
363
364 EPosition aDocPos = rOutliner.GetEditEngine().FindDocPosition( aEEPos );
365
366 nPara = aDocPos.nPara;
367 nIndex = aDocPos.nIndex;
368
369 return true;
370}
371
372bool SvxOutlinerForwarder::GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, sal_Int32& nStart, sal_Int32& nEnd ) const
373{
374 ESelection aRes = rOutliner.GetEditEngine().GetWord( ESelection(nPara, nIndex, nPara, nIndex), css::i18n::WordType::DICTIONARY_WORD );
375
376 if( aRes.nStartPara == nPara &&
377 aRes.nStartPara == aRes.nEndPara )
378 {
379 nStart = aRes.nStartPos;
380 nEnd = aRes.nEndPos;
381
382 return true;
383 }
384
385 return false;
386}
387
388bool SvxOutlinerForwarder::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell ) const
389{
390 SvxEditSourceHelper::GetAttributeRun( nStartIndex, nEndIndex, rOutliner.GetEditEngine(), nPara, nIndex, bInCell );
391 return true;
392}
393
394sal_Int32 SvxOutlinerForwarder::GetLineCount( sal_Int32 nPara ) const
395{
396 return rOutliner.GetLineCount(nPara);
397}
398
399sal_Int32 SvxOutlinerForwarder::GetLineLen( sal_Int32 nPara, sal_Int32 nLine ) const
400{
401 return rOutliner.GetLineLen(nPara, nLine);
402}
403
404void SvxOutlinerForwarder::GetLineBoundaries( /*out*/sal_Int32 &rStart, /*out*/sal_Int32 &rEnd, sal_Int32 nPara, sal_Int32 nLine ) const
405{
406 return rOutliner.GetEditEngine().GetLineBoundaries( rStart, rEnd, nPara, nLine );
407}
408
409sal_Int32 SvxOutlinerForwarder::GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) const
410{
412}
413
415{
417
418 return true;
419}
420
422{
423 flushCache();
424 rOutliner.QuickDelete( rSelection );
426
427 return true;
428}
429
430bool SvxOutlinerForwarder::InsertText( const OUString& rStr, const ESelection& rSelection )
431{
432 flushCache();
433 rOutliner.QuickInsertText( rStr, rSelection );
435
436 return true;
437}
438
439sal_Int16 SvxOutlinerForwarder::GetDepth( sal_Int32 nPara ) const
440{
441 DBG_ASSERT( 0 <= nPara && nPara < GetParagraphCount(), "SvxOutlinerForwarder::GetDepth: Invalid paragraph index");
442
443 Paragraph* pPara = rOutliner.GetParagraph( nPara );
444
445 sal_Int16 nLevel = -1;
446
447 if( pPara )
448 nLevel = rOutliner.GetDepth( nPara );
449
450 return nLevel;
451}
452
453bool SvxOutlinerForwarder::SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth )
454{
455 DBG_ASSERT( 0 <= nPara && nPara < GetParagraphCount(), "SvxOutlinerForwarder::SetDepth: Invalid paragraph index");
456
457 if( (nNewDepth >= -1) && (nNewDepth <= 9) && (0 <= nPara && nPara < GetParagraphCount()) )
458 {
459 Paragraph* pPara = rOutliner.GetParagraph( nPara );
460 if( pPara )
461 {
462 rOutliner.SetDepth( pPara, nNewDepth );
463
464// const bool bOutlinerText = pSdrObject && (pSdrObject->GetObjInventor() == SdrInventor::Default) && (pSdrObject->GetObjIdentifier() == OBJ_OUTLINETEXT);
465 if( bOutlinerText )
467
468 return true;
469 }
470 }
471
472 return false;
473}
474
476{
477 if( 0 <= nPara && nPara < GetParagraphCount() )
478 {
479 return rOutliner.GetNumberingStartValue( nPara );
480 }
481 else
482 {
483 OSL_FAIL( "SvxOutlinerForwarder::GetNumberingStartValue)(), Invalid paragraph index");
484 return -1;
485 }
486}
487
488void SvxOutlinerForwarder::SetNumberingStartValue( sal_Int32 nPara, sal_Int32 nNumberingStartValue )
489{
490 if( 0 <= nPara && nPara < GetParagraphCount() )
491 {
492 rOutliner.SetNumberingStartValue( nPara, nNumberingStartValue );
493 }
494 else
495 {
496 OSL_FAIL( "SvxOutlinerForwarder::SetNumberingStartValue)(), Invalid paragraph index");
497 }
498}
499
501{
502 if( 0 <= nPara && nPara < GetParagraphCount() )
503 {
504 return rOutliner.IsParaIsNumberingRestart( nPara );
505 }
506 else
507 {
508 OSL_FAIL( "SvxOutlinerForwarder::IsParaIsNumberingRestart)(), Invalid paragraph index");
509 return false;
510 }
511}
512
513void SvxOutlinerForwarder::SetParaIsNumberingRestart( sal_Int32 nPara, bool bParaIsNumberingRestart )
514{
515 if( 0 <= nPara && nPara < GetParagraphCount() )
516 {
517 rOutliner.SetParaIsNumberingRestart( nPara, bParaIsNumberingRestart );
518 }
519 else
520 {
521 OSL_FAIL( "SvxOutlinerForwarder::SetParaIsNumberingRestart)(), Invalid paragraph index");
522 }
523}
524
526{
527 EditEngine& rEditEngine = const_cast< EditEngine& >( rOutliner.GetEditEngine() );
528 return &rEditEngine.GetEmptyItemSet();
529}
530
532{
533 EditEngine& rEditEngine = const_cast< EditEngine& >( rOutliner.GetEditEngine() );
534 rEditEngine.InsertParagraph( rEditEngine.GetParagraphCount(), OUString() );
535}
536
537sal_Int32 SvxOutlinerForwarder::AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet & /*rSet*/ )
538{
539 sal_Int32 nLen = 0;
540
541 EditEngine& rEditEngine = const_cast< EditEngine& >( rOutliner.GetEditEngine() );
542 sal_Int32 nParaCount = rEditEngine.GetParagraphCount();
543 DBG_ASSERT( 0 <= nPara && nPara < nParaCount, "paragraph index out of bounds" );
544 if (0 <= nPara && nPara < nParaCount)
545 {
546 nLen = rEditEngine.GetTextLen( nPara );
547 rEditEngine.QuickInsertText( rText, ESelection( nPara, nLen, nPara, nLen ) );
548 }
549
550 return nLen;
551}
552
554{
555 const SvxOutlinerForwarder* pSourceForwarder = dynamic_cast< const SvxOutlinerForwarder* >( &rSource );
556 if( !pSourceForwarder )
557 return;
558 std::optional<OutlinerParaObject> pNewOutlinerParaObject = pSourceForwarder->rOutliner.CreateParaObject();
559 rOutliner.SetText( *pNewOutlinerParaObject );
560}
561
562
564{
565 return -1;
566}
567
569{
570}
571
573{
574 return false;
575}
576
578{
579}
580
581
582/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString GetWord(sal_Int32 nPara, sal_Int32 nIndex)
Definition: editeng.cxx:663
OUString GetText(LineEnd eEnd=LINEEND_LF) const
Definition: editeng.cxx:573
EPosition FindDocPosition(const Point &rDocPos) const
Definition: editeng.cxx:2433
sal_Int32 GetParagraphCount() const
Definition: editeng.cxx:589
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
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
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_uInt16 GetFieldCount(sal_Int32 nPara) const
Definition: editeng.cxx:2321
void QuickInsertText(const OUString &rText, const ESelection &rSel)
Definition: editeng.cxx:2084
const SfxStyleSheet * GetStyleSheet(sal_Int32 nPara) const
Definition: editeng.cxx:2148
void QuickSetAttribs(const SfxItemSet &rSet, const ESelection &rSel)
Definition: outlin2.cxx:446
SfxStyleSheetPool * GetStyleSheetPool()
Definition: outlin2.cxx:256
void SetText(const OutlinerParaObject &)
Definition: outliner.cxx:559
void SetLevelDependentStyleSheet(sal_Int32 nPara)
Definition: outliner.cxx:1902
const EditEngine & GetEditEngine() const
Definition: outlin2.cxx:515
bool IsParaIsNumberingRestart(sal_Int32 nPara) const
Definition: outliner.cxx:281
bool IsUpdateLayout() const
Definition: outlin2.cxx:50
void QuickInsertText(const OUString &rText, const ESelection &rSel)
Definition: outlin2.cxx:451
const SfxItemSet & GetEmptyItemSet() const
Definition: outlin2.cxx:55
LanguageType GetLanguage(sal_Int32 nPara, sal_Int32 nPos) const
Definition: outlin2.cxx:560
Paragraph * GetParagraph(sal_Int32 nAbsPos) const
Definition: outliner.cxx:1345
void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel)
Definition: outlin2.cxx:463
MapMode const & GetRefMapMode() const
Definition: outlin2.cxx:70
std::optional< OutlinerParaObject > CreateParaObject(sal_Int32 nStartPara=0, sal_Int32 nParaCount=EE_PARA_ALL) const
Definition: outliner.cxx:361
tools::Rectangle GetParaBounds(sal_Int32 nParagraph) const
Definition: outlin2.cxx:407
sal_Int16 GetDepth(sal_Int32 nPara) const
Definition: outliner.cxx:229
void SetStyleSheet(sal_Int32 nPara, SfxStyleSheet *pStyle)
Definition: outliner.cxx:666
void SetDepth(Paragraph *pParagraph, sal_Int16 nNewDepth)
Definition: outliner.cxx:236
void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &)
Definition: outliner.cxx:749
void QuickFormatDoc()
Definition: outlin2.cxx:475
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: outliner.cxx:637
sal_uInt32 GetLineCount(sal_Int32 nParagraph) const
Definition: outlin2.cxx:316
void QuickDelete(const ESelection &rSel)
Definition: outlin2.cxx:457
EBulletInfo GetBulletInfo(sal_Int32 nPara)
Definition: outliner.cxx:1586
sal_Int16 GetNumberingStartValue(sal_Int32 nPara) const
Definition: outliner.cxx:257
void QuickInsertLineBreak(const ESelection &rSel)
Definition: outlin2.cxx:469
void RemoveAttribs(const ESelection &rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich)
Definition: outlin2.cxx:565
SfxItemSet const & GetParaAttribs(sal_Int32 nPara) const
Definition: outliner.cxx:1699
void SetNumberingStartValue(sal_Int32 nPara, sal_Int16 nNumberingStartValue)
Definition: outliner.cxx:264
Size CalcTextSize()
Definition: outlin2.cxx:241
bool IsVertical() const
Definition: outlin2.cxx:530
sal_uInt32 GetLineHeight(sal_Int32 nParagraph)
Definition: outlin2.cxx:326
sal_Int32 GetLineLen(sal_Int32 nParagraph, sal_Int32 nLine) const
Definition: outlin2.cxx:321
OutputDevice * GetRefDevice() const
Definition: outlin2.cxx:402
SfxStyleSheet * GetStyleSheet(sal_Int32 nPara)
Definition: outlin2.cxx:261
sal_Int32 GetParagraphCount() const
Definition: outliner.cxx:1340
void SetParaIsNumberingRestart(sal_Int32 nPara, bool bParaIsNumberingRestart)
Definition: outliner.cxx:288
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.
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
virtual sal_Int32 GetTextLen(sal_Int32 nParagraph) const override
Definition: unoforou.cxx:57
virtual MapMode GetMapMode() const override
Query the map mode of the underlying EditEngine/Outliner.
Definition: unoforou.cxx:343
virtual OUString GetStyleSheet(sal_Int32 nPara) const override
Definition: unoforou.cxx:189
virtual bool QuickFormatDoc(bool bFull=false) override
Updates the formatting.
Definition: unoforou.cxx:414
virtual EBulletInfo GetBulletInfo(sal_Int32 nPara) const override
Query information regarding bullets for given paragraph on the underlying edit engine.
Definition: unoforou.cxx:283
virtual bool InsertText(const OUString &, const ESelection &) override
Insert/Replace given text in given range and reformat text.
Definition: unoforou.cxx:430
virtual const SfxItemSet * GetEmptyItemSetPtr() override
Definition: unoforou.cxx:525
ESelection maAttribCacheSelection
if we have a cached attribute item set, this is the selection of it
Definition: unoforou.hxx:44
virtual OutputDevice * GetRefDevice() const override
Query the reference output device of the underlying EditEngine/Outliner.
Definition: unoforou.cxx:348
virtual sal_Int32 GetLineNumberAtIndex(sal_Int32 nPara, sal_Int32 nIndex) const override
Query the line number for an index in the paragraphs text.
Definition: unoforou.cxx:409
std::optional< SfxItemSet > moAttribsCache
this pointer may be null or point to an item set for the attribs of the selection maAttribsSelection
Definition: unoforou.hxx:41
virtual SfxItemSet GetAttribs(const ESelection &rSel, EditEngineAttribs nOnlyHardAttrib=EditEngineAttribs::All) const override
Definition: unoforou.cxx:95
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: unoforou.cxx:372
virtual LanguageType GetLanguage(sal_Int32, sal_Int32) const override
Query language of character at given position on the underlying edit engine.
Definition: unoforou.cxx:268
virtual bool SetDepth(sal_Int32 nPara, sal_Int16 nNewDepth) override
Set the outline depth of given paragraph.
Definition: unoforou.cxx:453
virtual void SetStyleSheet(sal_Int32 nPara, const OUString &rStyleName) override
Definition: unoforou.cxx:196
virtual void GetLineBoundaries(sal_Int32 &rStart, sal_Int32 &rEnd, sal_Int32 nPara, sal_Int32 nLine) const override
Query bounds of line in paragraph.
Definition: unoforou.cxx:404
virtual bool Delete(const ESelection &) override
Delete given text range and reformat text.
Definition: unoforou.cxx:421
virtual SfxItemSet GetParaAttribs(sal_Int32 nPara) const override
Definition: unoforou.cxx:131
virtual void SetParaIsNumberingRestart(sal_Int32 nPara, bool bParaIsNumberingRestart) override
Definition: unoforou.cxx:513
virtual sal_Int32 GetParagraphCount() const override
Definition: unoforou.cxx:52
Outliner & rOutliner
Definition: unoforou.hxx:36
virtual void QuickSetAttribs(const SfxItemSet &rSet, const ESelection &rSel) override
Definition: unoforou.cxx:228
virtual void AppendParagraph() override
Definition: unoforou.cxx:531
virtual void QuickInsertText(const OUString &rText, const ESelection &rSel) override
Definition: unoforou.cxx:203
virtual sal_Int32 AppendTextPortion(sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet) override
Definition: unoforou.cxx:537
virtual sal_Int32 GetNumberingStartValue(sal_Int32 nPara) override
Definition: unoforou.cxx:475
virtual bool IsParaIsNumberingRestart(sal_Int32 nPara) override
Definition: unoforou.cxx:500
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: unoforou.cxx:388
virtual void GetPortions(sal_Int32 nPara, std::vector< sal_Int32 > &rList) const override
Definition: unoforou.cxx:184
virtual void FieldClicked(const SvxFieldItem &rField) override
Definition: unoforou.cxx:239
virtual EFieldInfo GetFieldInfo(sal_Int32 nPara, sal_uInt16 nField) const override
Query information for given field number in the underlying edit engine.
Definition: unoforou.cxx:278
virtual void SetNumberingStartValue(sal_Int32 nPara, sal_Int32 nNumberingStartValue) override
Definition: unoforou.cxx:488
virtual sal_Int32 GetLineLen(sal_Int32 nPara, sal_Int32 nLine) const override
Query line length.
Definition: unoforou.cxx:399
virtual SfxItemPool * GetPool() const override
Definition: unoforou.cxx:179
virtual SfxItemState GetItemState(const ESelection &rSel, sal_uInt16 nWhich) const override
Definition: unoforou.cxx:250
virtual bool IsValid() const override
Query state of forwarder.
Definition: unoforou.cxx:243
virtual void CopyText(const SvxTextForwarder &rSource) override
Definition: unoforou.cxx:553
std::optional< SfxItemSet > moParaAttribsCache
this pointer may be null or point to an item set for the paragraph mnParaAttribsCache
Definition: unoforou.hxx:48
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: unoforou.cxx:234
virtual sal_Int16 GetDepth(sal_Int32 nPara) const override
Get the outline depth of given paragraph.
Definition: unoforou.cxx:439
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: unoforou.cxx:353
virtual OUString GetText(const ESelection &rSel) const override
Definition: unoforou.cxx:62
virtual sal_Int32 GetFieldCount(sal_Int32 nPara) const override
Query number of fields in the underlying edit engine.
Definition: unoforou.cxx:273
virtual void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &rSet) override
Definition: unoforou.cxx:160
SvxOutlinerForwarder(Outliner &rOutl, bool bOutlText)
Definition: unoforou.cxx:40
virtual tools::Rectangle GetCharBounds(sal_Int32 nPara, sal_Int32 nIndex) const override
Query the bounding rectangle of the given character.
Definition: unoforou.cxx:288
virtual ~SvxOutlinerForwarder() override
Definition: unoforou.cxx:47
sal_Int32 mnParaAttribsCache
if we have a cached para attribute item set, this is the paragraph of it
Definition: unoforou.hxx:51
virtual sal_Int32 GetLineCount(sal_Int32 nPara) const override
Query number of lines in the formatted paragraph.
Definition: unoforou.cxx:394
virtual void RemoveAttribs(const ESelection &rSelection) override
Definition: unoforou.cxx:174
virtual tools::Rectangle GetParaBounds(sal_Int32 nPara) const override
Query the bounding rectangle of the given paragraph.
Definition: unoforou.cxx:338
virtual void QuickInsertLineBreak(const ESelection &rSel) override
Definition: unoforou.cxx:216
virtual void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel) override
Definition: unoforou.cxx:222
Contains an EditEngine or an Outliner and unifies access to them.
Definition: unoedsrc.hxx:142
virtual void SetNumberingStartValue(sal_Int32 nPara, sal_Int32 nNumberingStartValue)
Definition: unoforou.cxx:568
virtual sal_Int32 GetNumberingStartValue(sal_Int32 nPara)
Definition: unoforou.cxx:563
virtual bool IsParaIsNumberingRestart(sal_Int32 nPara)
Definition: unoforou.cxx:572
virtual void SetParaIsNumberingRestart(sal_Int32 nPara, bool bParaIsNumberingRestart)
Definition: unoforou.cxx:577
Specialise std::optional template for the case where we are wrapping a o3tl::cow_wrapper type,...
Definition: outlobj.hxx:133
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)
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
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
SfxItemState GetSvxEditEngineItemState(EditEngine const &rEditEngine, const ESelection &rSel, sal_uInt16 nWhich)
Definition: unofored.cxx:178
static SfxItemSet ImplOutlinerForwarderGetAttribs(const ESelection &rSel, EditEngineAttribs nOnlyHardAttrib, EditEngine &rEditEngine)
Definition: unoforou.cxx:70