LibreOffice Module sc (master) 1
textuno.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#include <memory>
21#include <sal/config.h>
22#include <sal/log.hxx>
23
24#include <scitems.hxx>
25#include <editeng/eeitem.hxx>
26#include <svx/svdpool.hxx>
27#include <svx/svdobj.hxx>
28#include <editeng/editeng.hxx>
29#include <editeng/editobj.hxx>
30#include <editeng/flditem.hxx>
31#include <editeng/fhgtitem.hxx>
32#include <editeng/unoprnms.hxx>
33#include <editeng/unofored.hxx>
34#include <utility>
35#include <vcl/svapp.hxx>
36
37#include <editeng/unoipset.hxx>
38#include <textuno.hxx>
39#include <fielduno.hxx>
40#include <editsrc.hxx>
41#include <docsh.hxx>
42#include <editutil.hxx>
43#include <miscuno.hxx>
44#include <cellsuno.hxx>
45#include <cellvalue.hxx>
46#include <cellform.hxx>
47#include <patattr.hxx>
48#include <docfunc.hxx>
49#include <scmod.hxx>
50
51using namespace com::sun::star;
52
54{
55 static const SvxItemPropertySet aHdFtPropertySet_Impl = [] {
56 static SfxItemPropertyMapEntry aHdFtPropertyMap_Impl[] =
57 {
61 SVX_UNOEDIT_NUMBERING_PROPERTY, // for completeness of service ParagraphProperties
62 };
63
64 // modify PropertyMap to include CONVERT_TWIPS flag for font height
65 // (headers/footers are in twips)
66
67 for (auto & rEntry : aHdFtPropertyMap_Impl)
68 {
69 if ( ( rEntry.nWID == EE_CHAR_FONTHEIGHT ||
70 rEntry.nWID == EE_CHAR_FONTHEIGHT_CJK ||
71 rEntry.nWID == EE_CHAR_FONTHEIGHT_CTL ) &&
72 rEntry.nMemberId == MID_FONTHEIGHT )
73 {
74 rEntry.nMemberId |= CONVERT_TWIPS;
75 }
76 }
77
78 return SvxItemPropertySet(aHdFtPropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool());
79 }();
80 return &aHdFtPropertySet_Impl;
81}
82
83SC_SIMPLE_SERVICE_INFO( ScHeaderFooterContentObj, "ScHeaderFooterContentObj", "com.sun.star.sheet.HeaderFooterContent" )
85
87{
88}
89
91
93{
94 return mxLeftText->GetTextObject();
95}
96
98{
99 return mxCenterText->GetTextObject();
100}
101
103{
104 return mxRightText->GetTextObject();
105}
106
107// XHeaderFooterContent
108
109uno::Reference<text::XText> SAL_CALL ScHeaderFooterContentObj::getLeftText()
110{
111 SolarMutexGuard aGuard;
112 uno::Reference<text::XText> xInt(*mxLeftText, uno::UNO_QUERY);
113 return xInt;
114}
115
116uno::Reference<text::XText> SAL_CALL ScHeaderFooterContentObj::getCenterText()
117{
118 SolarMutexGuard aGuard;
119 uno::Reference<text::XText> xInt(*mxCenterText, uno::UNO_QUERY);
120 return xInt;
121}
122
123uno::Reference<text::XText> SAL_CALL ScHeaderFooterContentObj::getRightText()
124{
125 SolarMutexGuard aGuard;
126 uno::Reference<text::XText> xInt(*mxRightText, uno::UNO_QUERY);
127 return xInt;
128}
129
131 const uno::Reference<sheet::XHeaderFooterContent>& rObj)
132{
133 return dynamic_cast<ScHeaderFooterContentObj*>(rObj.get());
134}
135
137 const EditTextObject* pCenter,
138 const EditTextObject* pRight )
139{
140 uno::Reference<css::sheet::XHeaderFooterContent> xThis(this);
144}
145
147 uno::WeakReference<sheet::XHeaderFooterContent> xContent, ScHeaderFooterPart nP, const EditTextObject* pTextObj) :
148 mpTextObj(pTextObj ? pTextObj->Clone() : nullptr),
149 xContentObj(std::move( xContent )),
150 nPart( nP ),
151 bDataValid(false)
152{
153}
154
156{
157 SolarMutexGuard aGuard; // needed for EditEngine dtor
158
159 pForwarder.reset();
160 pEditEngine.reset();
161}
162
164{
165 if (!pEditEngine)
166 {
168 pEnginePool->FreezeIdRanges();
169 std::unique_ptr<ScHeaderEditEngine> pHdrEngine(new ScHeaderEditEngine( pEnginePool.get() ));
170
171 pHdrEngine->EnableUndo( false );
172 pHdrEngine->SetRefMapMode(MapMode(MapUnit::MapTwip));
173
174 // default font must be set, independently of document
175 // -> use global pool from module
176
177 SfxItemSet aDefaults( pHdrEngine->GetEmptyItemSet() );
178 const ScPatternAttr& rPattern = SC_MOD()->GetPool().GetDefaultItem(ATTR_PATTERN);
179 rPattern.FillEditItemSet( &aDefaults );
180 // FillEditItemSet adjusts font height to 1/100th mm,
181 // but for header/footer twips is needed, as in the PatternAttr:
185 pHdrEngine->SetDefaults( aDefaults );
186
189 pHdrEngine->SetData( aData );
190
191 pEditEngine = std::move(pHdrEngine);
193 }
194
195 if (bDataValid)
196 return pForwarder.get();
197
198 if (mpTextObj)
199 pEditEngine->SetTextCurrentDefaults(*mpTextObj);
200
201 bDataValid = true;
202 return pForwarder.get();
203}
204
206{
207 if (pEditEngine)
208 {
209 mpTextObj = pEditEngine->CreateTextObject();
210 }
211}
212
214{
215 mpTextObj = rEditEngine.CreateTextObject();
216 bDataValid = false;
217}
218
220 const uno::WeakReference<sheet::XHeaderFooterContent>& xContent, ScHeaderFooterPart nP, const EditTextObject* pTextObj) :
221 aTextData(xContent, nP, pTextObj)
222{
223 // ScHeaderFooterTextData acquires rContent
224 // pUnoText is created on demand (getString/setString work without it)
225}
226
228{
229 if (!mxUnoText.is())
230 {
231 // can't be aggregated because getString/setString is handled here
233 mxUnoText.set(new SvxUnoText(&aEditSrc, lcl_GetHdFtPropertySet(), uno::Reference<text::XText>()));
234 }
235}
236
238
240{
241 return aTextData.GetTextObject();
242}
243
245{
246 if (!mxUnoText.is())
248 return *mxUnoText;
249}
250
251// XText
252
253uno::Reference<text::XTextCursor> SAL_CALL ScHeaderFooterTextObj::createTextCursor()
254{
255 SolarMutexGuard aGuard;
256 return new ScHeaderFooterTextCursor( this );
257}
258
259uno::Reference<text::XTextCursor> SAL_CALL ScHeaderFooterTextObj::createTextCursorByRange(
260 const uno::Reference<text::XTextRange>& aTextPosition )
261{
262 SolarMutexGuard aGuard;
263 if (!mxUnoText.is())
265 return mxUnoText->createTextCursorByRange(aTextPosition);
267}
268
270{
271 OUString aDummy("???");
272 rData.aTitle = aDummy;
273 rData.aLongDocName = aDummy;
274 rData.aShortDocName = aDummy;
275 rData.aTabName = aDummy;
276 rData.nPageNo = 1;
277 rData.nTotalPages = 99;
278}
279
281{
282 SolarMutexGuard aGuard;
283 OUString aRet;
284 const EditTextObject* pData;
285
286 uno::Reference<css::sheet::XHeaderFooterContent> xContentObj = aTextData.GetContentObj();
287 if (!xContentObj.is())
288 throw css::uno::RuntimeException(
289 "ScHeaderFooterTextObj::getString: no ContentObj");
290
292
293 switch ( aTextData.GetPart() )
294 {
296 pData = pObj->GetLeftEditObject();
297 break;
299 pData = pObj->GetCenterEditObject();
300 break;
302 pData = pObj->GetRightEditObject();
303 break;
304 default:
305 SAL_WARN("sc.ui","unexpected enum value of ScHeaderFooterPart");
306 pData = nullptr;
307 }
308
309 if (pData)
310 {
311 // for pure text, no font info is needed in pool defaults
313
316 aEditEngine.SetData( aData );
317
318 aEditEngine.SetTextCurrentDefaults(*pData);
319 aRet = ScEditUtil::GetSpaceDelimitedString( aEditEngine );
320 }
321 return aRet;
322}
323
324void SAL_CALL ScHeaderFooterTextObj::setString( const OUString& aText )
325{
326 SolarMutexGuard aGuard;
327
328 // for pure text, no font info is needed in pool defaults
330 aEditEngine.SetTextCurrentDefaults( aText );
331 aTextData.UpdateData(aEditEngine);
332}
333
334void SAL_CALL ScHeaderFooterTextObj::insertString( const uno::Reference<text::XTextRange>& xRange,
335 const OUString& aString, sal_Bool bAbsorb )
336{
337 SolarMutexGuard aGuard;
338 if (!mxUnoText.is())
340 mxUnoText->insertString( xRange, aString, bAbsorb );
341}
342
344 const uno::Reference<text::XTextRange>& xRange,
345 sal_Int16 nControlCharacter, sal_Bool bAbsorb )
346{
347 SolarMutexGuard aGuard;
348 if (!mxUnoText.is())
350 mxUnoText->insertControlCharacter( xRange, nControlCharacter, bAbsorb );
351}
352
354 const uno::Reference<text::XTextRange >& xRange,
355 const uno::Reference<text::XTextContent >& xContent,
356 sal_Bool bAbsorb )
357{
358 SolarMutexGuard aGuard;
359 if ( xContent.is() && xRange.is() )
360 {
361 ScEditFieldObj* pHeaderField = dynamic_cast<ScEditFieldObj*>( xContent.get() );
362
363 SvxUnoTextRangeBase* pTextRange =
364 comphelper::getFromUnoTunnel<ScHeaderFooterTextCursor>( xRange );
365
366 if ( pHeaderField && !pHeaderField->IsInserted() && pTextRange )
367 {
368 SvxEditSource* pEditSource = pTextRange->GetEditSource();
369 ESelection aSelection(pTextRange->GetSelection());
370
371 if (!bAbsorb)
372 {
373 // don't replace -> append at end
374 aSelection.Adjust();
375 aSelection.nStartPara = aSelection.nEndPara;
376 aSelection.nStartPos = aSelection.nEndPos;
377 }
378
379 SvxFieldItem aItem(pHeaderField->CreateFieldItem());
380
381 SvxTextForwarder* pForwarder = pEditSource->GetTextForwarder();
382 pForwarder->QuickInsertField( aItem, aSelection );
383 pEditSource->UpdateData();
384
385 // new selection: a digit
386 aSelection.Adjust();
387 aSelection.nEndPara = aSelection.nStartPara;
388 aSelection.nEndPos = aSelection.nStartPos + 1;
389
390 uno::Reference<text::XTextRange> xTextRange;
391 switch ( aTextData.GetPart() )
392 {
394 xTextRange = aTextData.GetContentObj()->getLeftText();
395 break;
397 xTextRange = aTextData.GetContentObj()->getCenterText();
398 break;
400 xTextRange = aTextData.GetContentObj()->getRightText();
401 break;
402 }
403
404 pHeaderField->InitDoc(xTextRange, std::make_unique<ScHeaderFooterEditSource>(aTextData), aSelection);
405
406 // for bAbsorb=FALSE, the new selection must be behind the inserted content
407 // (the xml filter relies on this)
408 if (!bAbsorb)
409 aSelection.nStartPos = aSelection.nEndPos;
410
411 pTextRange->SetSelection( aSelection );
412
413 return;
414 }
415 }
416
417 if (!mxUnoText.is())
419 mxUnoText->insertTextContent( xRange, xContent, bAbsorb );
420}
421
423 const uno::Reference<text::XTextContent>& xContent )
424{
425 SolarMutexGuard aGuard;
426 if ( xContent.is() )
427 {
428 ScEditFieldObj* pHeaderField = dynamic_cast<ScEditFieldObj*>(xContent.get());
429 if ( pHeaderField && pHeaderField->IsInserted() )
430 {
432 pHeaderField->DeleteField();
433 return;
434 }
435 }
436 if (!mxUnoText.is())
438 mxUnoText->removeTextContent( xContent );
439}
440
441uno::Reference<text::XText> SAL_CALL ScHeaderFooterTextObj::getText()
442{
443 SolarMutexGuard aGuard;
444 if (!mxUnoText.is())
446 return mxUnoText->getText();
447}
448
449uno::Reference<text::XTextRange> SAL_CALL ScHeaderFooterTextObj::getStart()
450{
451 SolarMutexGuard aGuard;
452 if (!mxUnoText.is())
454 return mxUnoText->getStart();
455}
456
457uno::Reference<text::XTextRange> SAL_CALL ScHeaderFooterTextObj::getEnd()
458{
459 SolarMutexGuard aGuard;
460 if (!mxUnoText.is())
462 return mxUnoText->getEnd();
463}
464
465// XTextFieldsSupplier
466
467uno::Reference<container::XEnumerationAccess> SAL_CALL ScHeaderFooterTextObj::getTextFields()
468{
469 SolarMutexGuard aGuard;
470 // all fields
471 return new ScHeaderFieldsObj(aTextData);
472}
473
474uno::Reference<container::XNameAccess> SAL_CALL ScHeaderFooterTextObj::getTextFieldMasters()
475{
476 // this does not exists in Calc (?)
477 return nullptr;
478}
479
480// XTextRangeMover
481
483 const uno::Reference<text::XTextRange>& xRange,
484 sal_Int16 nParagraphs )
485{
486 SolarMutexGuard aGuard;
487 if (!mxUnoText.is())
489 mxUnoText->moveTextRange( xRange, nParagraphs );
490}
491
492// XEnumerationAccess
493
494uno::Reference<container::XEnumeration> SAL_CALL ScHeaderFooterTextObj::createEnumeration()
495{
496 SolarMutexGuard aGuard;
497 if (!mxUnoText.is())
499 return mxUnoText->createEnumeration();
500}
501
502// XElementAccess
503
505{
506 SolarMutexGuard aGuard;
507 if (!mxUnoText.is())
509 return mxUnoText->getElementType();
510}
511
513{
514 SolarMutexGuard aGuard;
515 if (!mxUnoText.is())
517 return mxUnoText->hasElements();
518}
519
521 SvxUnoTextCursor( rText.GetUnoText() ),
522 mxTextObj( &rText )
523{
524}
525
527{
528}
529
530// SvxUnoTextCursor methods reimplemented here to return the right objects:
531
532uno::Reference<text::XText> SAL_CALL ScCellTextCursor::getText()
533{
534 return mxTextObj;
535}
536
537uno::Reference<text::XTextRange> SAL_CALL ScCellTextCursor::getStart()
538{
539 SolarMutexGuard aGuard;
540
542
544
545 ESelection aNewSel(GetSelection());
546 aNewSel.nEndPara = aNewSel.nStartPara;
547 aNewSel.nEndPos = aNewSel.nStartPos;
548 pNew->SetSelection( aNewSel );
549
550 return static_cast<SvxUnoTextRangeBase*>(pNew.get());
551}
552
553uno::Reference<text::XTextRange> SAL_CALL ScCellTextCursor::getEnd()
554{
555 SolarMutexGuard aGuard;
556
558
560
561 ESelection aNewSel(GetSelection());
562 aNewSel.nStartPara = aNewSel.nEndPara;
563 aNewSel.nStartPos = aNewSel.nEndPos;
564 pNew->SetSelection( aNewSel );
565
566 return static_cast<SvxUnoTextRangeBase*>(pNew.get());
567}
568
569// XUnoTunnel
570
572
574 SvxUnoTextCursor( rText->GetUnoText() ),
575 rTextObj( rText )
576{}
577
579
580// SvxUnoTextCursor methods reimplemented here to return the right objects:
581
582uno::Reference<text::XText> SAL_CALL ScHeaderFooterTextCursor::getText()
583{
584 SolarMutexGuard aGuard;
585 return rTextObj;
586}
587
588uno::Reference<text::XTextRange> SAL_CALL ScHeaderFooterTextCursor::getStart()
589{
590 SolarMutexGuard aGuard;
591
593
595
596 ESelection aNewSel(GetSelection());
597 aNewSel.nEndPara = aNewSel.nStartPara;
598 aNewSel.nEndPos = aNewSel.nStartPos;
599 pNew->SetSelection( aNewSel );
600
601 return static_cast<SvxUnoTextRangeBase*>(pNew.get());
602}
603
604uno::Reference<text::XTextRange> SAL_CALL ScHeaderFooterTextCursor::getEnd()
605{
606 SolarMutexGuard aGuard;
607
609
611
612 ESelection aNewSel(GetSelection());
613 aNewSel.nStartPara = aNewSel.nEndPara;
614 aNewSel.nStartPos = aNewSel.nEndPos;
615 pNew->SetSelection( aNewSel );
616
617 return static_cast<SvxUnoTextRangeBase*>(pNew.get());
618}
619
620// XUnoTunnel
621
623
624ScDrawTextCursor::ScDrawTextCursor( uno::Reference<text::XText> xParent,
625 const SvxUnoTextBase& rText ) :
626 SvxUnoTextCursor( rText ),
627 xParentText(std::move( xParent ))
628
629{
630}
631
633{
634}
635
636// SvxUnoTextCursor methods reimplemented here to return the right objects:
637
638uno::Reference<text::XText> SAL_CALL ScDrawTextCursor::getText()
639{
640 SolarMutexGuard aGuard;
641 return xParentText;
642}
643
644uno::Reference<text::XTextRange> SAL_CALL ScDrawTextCursor::getStart()
645{
646 SolarMutexGuard aGuard;
647
649
651
652 ESelection aNewSel(GetSelection());
653 aNewSel.nEndPara = aNewSel.nStartPara;
654 aNewSel.nEndPos = aNewSel.nStartPos;
655 pNew->SetSelection( aNewSel );
656
657 return static_cast<SvxUnoTextRangeBase*>(pNew.get());
658}
659
660uno::Reference<text::XTextRange> SAL_CALL ScDrawTextCursor::getEnd()
661{
662 SolarMutexGuard aGuard;
663
665
667
668 ESelection aNewSel(GetSelection());
669 aNewSel.nStartPara = aNewSel.nEndPara;
670 aNewSel.nStartPos = aNewSel.nEndPos;
671 pNew->SetSelection( aNewSel );
672
673 return static_cast<SvxUnoTextRangeBase*>(pNew.get());
674}
675
676// XUnoTunnel
677
679
681{
683 pEnginePool->SetDefaultMetric( MapUnit::Map100thMM );
684 pEnginePool->FreezeIdRanges();
685
686 pEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool.get(), nullptr, true) ); // TRUE: become owner of pool
688 pOriginalSource.reset( new ScSimpleEditSource( pForwarder.get() ) );
689}
690
692{
693 SolarMutexGuard aGuard; // needed for EditEngine dtor
694
695 pOriginalSource.reset();
696 pForwarder.reset();
697 pEditEngine.reset();
698}
699
701 SvxUnoText( GetOriginalSource(), ScCellObj::GetEditPropertySet(), uno::Reference<text::XText>() )
702{
703}
704
706{
707}
708
710{
711 GetEditEngine()->SetTextCurrentDefaults( rTextObject );
712
713 ESelection aSel;
714 ::GetSelection( aSel, GetEditSource()->GetTextForwarder() );
715 SetSelection( aSel );
716}
717
718std::unique_ptr<EditTextObject> ScEditEngineTextObj::CreateTextObject()
719{
721}
722
724 pDocShell( pDocSh ),
725 aCellPos( rP ),
726 bDataValid( false ),
727 bInUpdate( false ),
728 bDirty( false ),
729 bDoUpdate( true )
730{
731 if (pDocShell)
733}
734
736{
737 SolarMutexGuard aGuard; // needed for EditEngine dtor
738
739 if (pDocShell)
740 {
743 }
744 else
745 pEditEngine.reset();
746
747 pForwarder.reset();
748
749 pOriginalSource.reset();
750}
751
753{
754 if (!pOriginalSource)
756 return pOriginalSource.get();
757}
758
760{
761 if (!pEditEngine)
762 {
763 if ( pDocShell )
764 {
767 }
768 else
769 {
771 pEnginePool->FreezeIdRanges();
772 pEditEngine.reset( new ScFieldEditEngine(nullptr, pEnginePool.get(), nullptr, true) );
773 }
774 // currently, GetPortions doesn't work if UpdateMode is sal_False,
775 // this will be fixed (in EditEngine) by src600
776// pEditEngine->SetUpdateMode( sal_False );
777 pEditEngine->EnableUndo( false );
778 if (pDocShell)
779 pEditEngine->SetRefDevice(pDocShell->GetRefDevice());
780 else
781 pEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM));
783 }
784
785 if (bDataValid)
786 return pForwarder.get();
787
788 if (pDocShell)
789 {
791
792 SfxItemSet aDefaults( pEditEngine->GetEmptyItemSet() );
793 if( const ScPatternAttr* pPattern =
794 rDoc.GetPattern( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab() ) )
795 {
796 pPattern->FillEditItemSet( &aDefaults );
797 pPattern->FillEditParaItems( &aDefaults ); // including alignment etc. (for reading)
798 }
799
800 ScRefCellValue aCell(rDoc, aCellPos);
801 if (aCell.getType() == CELLTYPE_EDIT)
802 {
803 const EditTextObject* pObj = aCell.getEditText();
804 pEditEngine->SetTextNewDefaults(*pObj, aDefaults);
805 }
806 else
807 {
808 sal_uInt32 nFormat = rDoc.GetNumberFormat(aCellPos);
809 OUString aText = ScCellFormat::GetInputString(aCell, nFormat, *rDoc.GetFormatTable(), rDoc);
810 if (!aText.isEmpty())
811 pEditEngine->SetTextNewDefaults(aText, aDefaults);
812 else
813 pEditEngine->SetDefaults(aDefaults);
814 }
815 }
816
817 bDataValid = true;
818 return pForwarder.get();
819}
820
822{
823 if ( bDoUpdate )
824 {
825 OSL_ENSURE(pEditEngine != nullptr, "no EditEngine for UpdateData()");
826 if ( pDocShell && pEditEngine )
827 {
828 // during the own UpdateData call, bDataValid must not be reset,
829 // or things like attributes after the text would be lost
830 // (are not stored in the cell)
831 bInUpdate = true; // prevents bDataValid from being reset
832 pDocShell->GetDocFunc().PutData(aCellPos, *pEditEngine, true); // always as text
833
834 bInUpdate = false;
835 bDirty = false;
836 }
837 }
838 else
839 bDirty = true;
840}
841
843{
844 const SfxHintId nId = rHint.GetId();
845 if ( nId == SfxHintId::Dying )
846 {
847 pDocShell = nullptr; // invalid now
848
849 pForwarder.reset();
850 pEditEngine.reset(); // EditEngine uses document's pool
851 }
852 else if ( nId == SfxHintId::DataChanged )
853 {
854 if (!bInUpdate) // not for own UpdateData calls
855 bDataValid = false; // text has to be read from the cell again
856 }
857}
858
860 ScCellTextData( pDocSh, rP ),
861 SvxUnoText( GetOriginalSource(), ScCellObj::GetEditPropertySet(), uno::Reference<text::XText>() )
862{
863}
864
865ScCellTextObj::~ScCellTextObj() COVERITY_NOEXCEPT_FALSE
866{
867}
868
869/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< EditTextObject > CreateTextObject()
static rtl::Reference< SfxItemPool > CreatePool()
SCTAB Tab() const
Definition: address.hxx:283
SCROW Row() const
Definition: address.hxx:274
SCCOL Col() const
Definition: address.hxx:279
Data (incl.
Definition: editsrc.hxx:74
static OUString GetInputString(const ScRefCellValue &rCell, sal_uInt32 nFormat, SvNumberFormatter &rFormatter, const ScDocument &rDoc, const svl::SharedString **pShared=nullptr, bool bFiltering=false, bool bForceSystemLocale=false)
Definition: cellform.cxx:129
really derive cell from range?
Definition: cellsuno.hxx:640
uno3: SvxUnoTextCursor is not derived from XUnoTunnel, but should be (?)
Definition: textuno.hxx:209
rtl::Reference< ScCellObj > mxTextObj
Definition: textuno.hxx:210
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
Definition: textuno.cxx:553
ScCellTextCursor(ScCellObj &rText)
Definition: textuno.cxx:520
virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override
Definition: textuno.cxx:532
virtual ~ScCellTextCursor() noexcept override
Definition: textuno.cxx:526
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
Definition: textuno.cxx:537
ScDocShell * pDocShell
Definition: textuno.hxx:322
ScCellEditSource * GetOriginalSource()
Definition: textuno.cxx:752
std::unique_ptr< ScCellEditSource > pOriginalSource
Definition: textuno.hxx:326
std::unique_ptr< ScFieldEditEngine > pEditEngine
Definition: textuno.hxx:324
std::unique_ptr< SvxEditEngineForwarder > pForwarder
Definition: textuno.hxx:325
virtual SvxTextForwarder * GetTextForwarder()
Definition: textuno.cxx:759
virtual ~ScCellTextData() override
Definition: textuno.cxx:735
ScCellTextData(ScDocShell *pDocSh, const ScAddress &rP)
Definition: textuno.cxx:723
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: textuno.cxx:842
ScAddress aCellPos
Definition: textuno.hxx:323
void UpdateData()
Definition: textuno.cxx:821
ScCellTextObj(ScDocShell *pDocSh, const ScAddress &rP)
Definition: textuno.cxx:859
virtual ~ScCellTextObj() COVERITY_NOEXCEPT_FALSE override
Definition: textuno.cxx:865
void PutData(const ScAddress &rPos, ScEditEngineDefaulter &rEngine, bool bApi)
Definition: docfunc.cxx:1160
OutputDevice * GetRefDevice()
Definition: docsh3.cxx:466
const ScDocument & GetDocument() const
Definition: docsh.hxx:219
ScDocFunc & GetDocFunc()
Definition: docsh.hxx:221
SC_DLLPUBLIC sal_uInt32 GetNumberFormat(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:3640
void AddUnoObject(SfxListener &rObject)
Definition: documen3.cxx:901
std::unique_ptr< ScFieldEditEngine > CreateFieldEditEngine()
Definition: documen2.cxx:1181
void DisposeFieldEditEngine(std::unique_ptr< ScFieldEditEngine > &rpEditEngine)
Definition: documen2.cxx:1203
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
Definition: documen2.cxx:467
void RemoveUnoObject(SfxListener &rObject)
Definition: documen3.cxx:909
SC_DLLPUBLIC const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:4719
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
Definition: textuno.cxx:644
virtual ~ScDrawTextCursor() noexcept override
Definition: textuno.cxx:632
ScDrawTextCursor(css::uno::Reference< css::text::XText > xParent, const SvxUnoTextBase &rText)
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
Definition: textuno.cxx:660
css::uno::Reference< css::text::XText > xParentText
Definition: textuno.hxx:264
virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override
Definition: textuno.cxx:638
void SetTextCurrentDefaults(const EditTextObject &rTextObject)
SetText and apply defaults already set.
Definition: editutil.cxx:619
std::unique_ptr< EditTextObject > CreateTextObject()
Definition: textuno.cxx:718
void SetText(const EditTextObject &rTextObject)
Definition: textuno.cxx:709
virtual ~ScEditEngineTextObj() noexcept override
Definition: textuno.cxx:705
void InitDoc(const css::uno::Reference< css::text::XTextRange > &rContent, std::unique_ptr< ScEditSource > pEditSrc, const ESelection &rSel)
Definition: fielduno.cxx:1062
void DeleteField()
Definition: fielduno.cxx:1085
SvxFieldItem CreateFieldItem()
Definition: fielduno.cxx:1079
bool IsInserted() const
Definition: fielduno.cxx:1101
static OUString GetSpaceDelimitedString(const EditEngine &rEngine)
Retrieves string with paragraphs delimited by spaces.
Definition: editutil.cxx:105
void SetData(const ScHeaderFieldData &rNew)
Definition: editutil.hxx:224
rtl::Reference< ScHeaderFooterTextObj > mxRightText
Definition: textuno.hxx:61
virtual css::uno::Reference< css::text::XText > SAL_CALL getLeftText() override
Definition: textuno.cxx:109
virtual css::uno::Reference< css::text::XText > SAL_CALL getCenterText() override
Definition: textuno.cxx:116
static rtl::Reference< ScHeaderFooterContentObj > getImplementation(const css::uno::Reference< css::sheet::XHeaderFooterContent > &rObj)
Definition: textuno.cxx:130
const EditTextObject * GetLeftEditObject() const
Definition: textuno.cxx:92
virtual ~ScHeaderFooterContentObj() override
Definition: textuno.cxx:90
rtl::Reference< ScHeaderFooterTextObj > mxCenterText
Definition: textuno.hxx:60
void Init(const EditTextObject *pLeft, const EditTextObject *pCenter, const EditTextObject *pRight)
Definition: textuno.cxx:136
const EditTextObject * GetCenterEditObject() const
Definition: textuno.cxx:97
virtual css::uno::Reference< css::text::XText > SAL_CALL getRightText() override
Definition: textuno.cxx:123
const EditTextObject * GetRightEditObject() const
Definition: textuno.cxx:102
rtl::Reference< ScHeaderFooterTextObj > mxLeftText
Definition: textuno.hxx:59
ScHeaderFooterTextObj keeps the authoritative copy of ScHeaderFooterTextData that this class holds re...
Definition: editsrc.hxx:50
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
Definition: textuno.cxx:588
virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override
Definition: textuno.cxx:582
ScHeaderFooterTextCursor(rtl::Reference< ScHeaderFooterTextObj > const &rText)
Definition: textuno.cxx:573
virtual ~ScHeaderFooterTextCursor() noexcept override
Definition: textuno.cxx:578
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
Definition: textuno.cxx:604
rtl::Reference< ScHeaderFooterTextObj > rTextObj
Definition: textuno.hxx:238
ScHeaderFooterTextData(const ScHeaderFooterTextData &)=delete
ScHeaderFooterPart GetPart() const
Definition: textuno.hxx:118
std::unique_ptr< EditTextObject > mpTextObj
Definition: textuno.hxx:98
const EditTextObject * GetTextObject() const
Definition: textuno.hxx:121
std::unique_ptr< SvxEditEngineForwarder > pForwarder
Definition: textuno.hxx:102
std::unique_ptr< ScEditEngineDefaulter > pEditEngine
Definition: textuno.hxx:101
css::uno::Reference< css::sheet::XHeaderFooterContent > GetContentObj() const
Definition: textuno.hxx:119
SvxTextForwarder * GetTextForwarder()
Definition: textuno.cxx:163
Each of these instances represent, the left, center or right part of the header of footer of a page.
Definition: textuno.hxx:136
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &aTextPosition) override
Definition: textuno.cxx:259
virtual void SAL_CALL removeTextContent(const css::uno::Reference< css::text::XTextContent > &xContent) override
Definition: textuno.cxx:422
virtual void SAL_CALL moveTextRange(const css::uno::Reference< css::text::XTextRange > &xRange, sal_Int16 nParagraphs) override
Definition: textuno.cxx:482
virtual void SAL_CALL setString(const OUString &aString) override
Definition: textuno.cxx:324
const EditTextObject * GetTextObject() const
Definition: textuno.cxx:239
virtual void SAL_CALL insertTextContent(const css::uno::Reference< css::text::XTextRange > &xRange, const css::uno::Reference< css::text::XTextContent > &xContent, sal_Bool bAbsorb) override
Definition: textuno.cxx:353
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
Definition: textuno.cxx:253
virtual css::uno::Reference< css::container::XEnumerationAccess > SAL_CALL getTextFields() override
Definition: textuno.cxx:467
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTextFieldMasters() override
Definition: textuno.cxx:474
virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override
Definition: textuno.cxx:441
static void FillDummyFieldData(ScHeaderFieldData &rData)
Definition: textuno.cxx:269
const SvxUnoText & GetUnoText()
Definition: textuno.cxx:244
virtual ~ScHeaderFooterTextObj() override
Definition: textuno.cxx:237
virtual void SAL_CALL insertString(const css::uno::Reference< css::text::XTextRange > &xRange, const OUString &aString, sal_Bool bAbsorb) override
Definition: textuno.cxx:334
virtual css::uno::Type SAL_CALL getElementType() override
Definition: textuno.cxx:504
rtl::Reference< SvxUnoText > mxUnoText
Definition: textuno.hxx:139
virtual OUString SAL_CALL getString() override
Definition: textuno.cxx:280
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: textuno.cxx:494
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
Definition: textuno.cxx:449
virtual void SAL_CALL insertControlCharacter(const css::uno::Reference< css::text::XTextRange > &xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb) override
Definition: textuno.cxx:343
ScHeaderFooterTextObj(const css::uno::WeakReference< css::sheet::XHeaderFooterContent > &xContent, ScHeaderFooterPart nP, const EditTextObject *pTextObj)
Definition: textuno.cxx:219
virtual sal_Bool SAL_CALL hasElements() override
Definition: textuno.cxx:512
ScHeaderFooterTextData aTextData
Definition: textuno.hxx:138
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
Definition: textuno.cxx:457
const SfxPoolItem & GetItem(sal_uInt16 nWhichP) const
Definition: patattr.hxx:73
void FillEditItemSet(SfxItemSet *pEditSet, const SfxItemSet *pCondSet=nullptr) const
Converts all Calc items contained in the own item set to edit engine items and puts them into pEditSe...
Definition: patattr.cxx:868
std::unique_ptr< SvxEditEngineForwarder > pForwarder
Definition: textuno.hxx:296
ScEditEngineDefaulter * GetEditEngine() const
Definition: textuno.hxx:304
std::unique_ptr< ScSimpleEditSource > pOriginalSource
Definition: textuno.hxx:297
std::unique_ptr< ScEditEngineDefaulter > pEditEngine
Definition: textuno.hxx:295
static SdrItemPool & GetGlobalDrawObjectItemPool()
SfxHintId GetId() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
virtual SvxTextForwarder * GetTextForwarder()=0
virtual void UpdateData()=0
virtual void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel)=0
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
@ CELLTYPE_EDIT
Definition: global.hxx:277
SfxHintId
#define SAL_WARN(area, stream)
#define MID_FONTHEIGHT
std::unique_ptr< sal_Int32[]> pData
#define SC_SIMPLE_SERVICE_INFO(ClassName, ClassNameAscii, ServiceAscii)
Definition: miscuno.hxx:63
def text(shape, orig_st)
constexpr OUStringLiteral aData
Reference
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
sal_Int16 nId
#define CONVERT_TWIPS
constexpr TypedWhichId< SvxFontHeightItem > ATTR_FONT_HEIGHT(101)
constexpr TypedWhichId< ScPatternAttr > ATTR_PATTERN(156)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_CJK_FONT_HEIGHT(112)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_CTL_FONT_HEIGHT(117)
#define SC_MOD()
Definition: scmod.hxx:247
sal_Int32 nStartPara
sal_Int32 nEndPos
sal_Int32 nStartPos
void Adjust()
sal_Int32 nEndPara
OUString aLongDocName
Definition: editutil.hxx:202
tools::Long nPageNo
Definition: editutil.hxx:206
OUString aShortDocName
Definition: editutil.hxx:203
OUString aTabName
Definition: editutil.hxx:204
tools::Long nTotalPages
Definition: editutil.hxx:207
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:108
const EditTextObject * getEditText() const
Definition: cellvalue.hxx:136
CellType getType() const
Definition: cellvalue.hxx:133
UNO3_GETIMPLEMENTATION2_IMPL(ScCellTextCursor, SvxUnoTextCursor)
static const SvxItemPropertySet * lcl_GetHdFtPropertySet()
Definition: textuno.cxx:53
ScHeaderFooterPart
Definition: textuno.hxx:49
unsigned char sal_Bool
void GetSelection(struct ESelection &rSel, SvxTextForwarder const *pForwarder) noexcept
#define SVX_UNOEDIT_CHAR_PROPERTIES
#define SVX_UNOEDIT_NUMBERING_PROPERTY
#define SVX_UNOEDIT_PARA_PROPERTIES
#define SVX_UNOEDIT_FONT_PROPERTIES