LibreOffice Module editeng (master) 1
editobj.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
22#include <o3tl/safeint.hxx>
23#include <sal/log.hxx>
24
25#include <editeng/macros.hxx>
26#include <editeng/section.hxx>
27#include "editobj2.hxx"
28#include <editeng/editdata.hxx>
29#include <editeng/editeng.hxx>
30#include <editeng/flditem.hxx>
31
33
34#include <libxml/xmlwriter.h>
35#include <algorithm>
36#include <cassert>
37
38#if DEBUG_EDIT_ENGINE
39#include <iostream>
40using std::cout;
41using std::endl;
42#endif
43
44using namespace com::sun::star;
45
46
47static XEditAttribute MakeXEditAttribute( SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 nStart, sal_Int32 nEnd )
48{
49 // Create the new attribute in the pool
50 const SfxPoolItem& rNew = rPool.Put( rItem );
51
52 return XEditAttribute( rNew, nStart, nEnd );
53}
54
55XEditAttribute::XEditAttribute( const SfxPoolItem& rAttr, sal_Int32 nS, sal_Int32 nE )
56 : pItem(&rAttr)
57 , nStart(nS)
58 , nEnd(nE)
59{
60}
61
63{
64 sal_uInt16 nWhich = pItem->Which();
65 return ((nWhich >= EE_FEATURE_START) && (nWhich <= EE_FEATURE_END));
66}
67
69{
70 pItem = &rNew;
71}
72
74 double fFontScaleX, double fFontScaleY,
75 double fSpacingScaleX, double fSpacingScaleY)
76 : pRefDevPtr(pRefDev)
77 , mfFontScaleX(fFontScaleX)
78 , mfFontScaleY(fFontScaleY)
79 , mfSpacingScaleX(fSpacingScaleX)
80 , mfSpacingScaleY(fSpacingScaleY)
81 , nPaperWidth(nPW)
82{
83}
84
86{
87 maList.push_back(std::unique_ptr<XParaPortion>(p));
88}
89
91{
92 return *maList[i];
93}
94
96 eFamily(SfxStyleFamily::Para),
97 aParaAttribs(rPool)
98{
99}
100
101// the real Copy constructor is nonsense, since I have to work with another Pool!
102ContentInfo::ContentInfo( const ContentInfo& rCopyFrom, SfxItemPool& rPoolToUse ) :
103 maText(rCopyFrom.maText),
104 aStyle(rCopyFrom.aStyle),
105 eFamily(rCopyFrom.eFamily),
106 aParaAttribs(rPoolToUse)
107{
108 // this should ensure that the Items end up in the correct Pool!
109 aParaAttribs.Set( rCopyFrom.GetParaAttribs() );
110
111 for (const XEditAttribute & rAttr : rCopyFrom.maCharAttribs)
112 {
114 rPoolToUse, *rAttr.GetItem(), rAttr.GetStart(), rAttr.GetEnd());
115 maCharAttribs.push_back(aMyAttr);
116 }
117
118 if ( rCopyFrom.GetWrongList() )
119 mpWrongs.reset(rCopyFrom.GetWrongList()->Clone());
120}
121
123{
124 for (auto const& charAttrib : maCharAttribs)
125 aParaAttribs.GetPool()->Remove(*charAttrib.GetItem());
126 maCharAttribs.clear();
127}
128
130{
131 maText = rPool.intern(OUString(maText.getData()));
132}
133
134
135OUString ContentInfo::GetText() const
136{
137 rtl_uString* p = const_cast<rtl_uString*>(maText.getData());
138 return OUString(p);
139}
140
141void ContentInfo::SetText( const OUString& rStr )
142{
143 maText = svl::SharedString(rStr.pData, nullptr);
144}
145
147{
148 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("ContentInfo"));
149 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("style"), BAD_CAST(aStyle.toUtf8().getStr()));
150 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("text"));
151 OUString aText = GetText();
152 // TODO share code with sax_fastparser::FastSaxSerializer::write().
153 (void)xmlTextWriterWriteString(pWriter, BAD_CAST(aText.replaceAll("\x01", "&#1;").toUtf8().getStr()));
154 (void)xmlTextWriterEndElement(pWriter);
155 aParaAttribs.dumpAsXml(pWriter);
156 for (auto const& rCharAttribs : maCharAttribs)
157 {
158 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("attribs"));
159 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("start"), "%" SAL_PRIdINT32, rCharAttribs.GetStart());
160 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("end"), "%" SAL_PRIdINT32, rCharAttribs.GetEnd());
161 rCharAttribs.GetItem()->dumpAsXml(pWriter);
162 (void)xmlTextWriterEndElement(pWriter);
163 }
164 (void)xmlTextWriterEndElement(pWriter);
165}
166
168{
169 return mpWrongs.get();
170}
171
173{
174 mpWrongs.reset(p);
175}
176
177// #i102062#
179{
180 if(GetWrongList() == rCompare.GetWrongList())
181 return true;
182
183 if(!GetWrongList() || !rCompare.GetWrongList())
184 return false;
185
186 return (*GetWrongList() == *rCompare.GetWrongList());
187}
188
189#if DEBUG_EDIT_ENGINE
190void ContentInfo::Dump() const
191{
192 cout << "--" << endl;
193 cout << "text: '" << OUString(const_cast<rtl_uString*>(maText.getData())) << "'" << endl;
194 cout << "style: '" << aStyle << "'" << endl;
195
196 for (auto const& attrib : aAttribs)
197 {
198 cout << "attribute: " << endl;
199 cout << " span: [begin=" << attrib.GetStart() << ", end=" << attrib.GetEnd() << "]" << endl;
200 cout << " feature: " << (attrib.IsFeature() ? "yes":"no") << endl;
201 }
202}
203#endif
204
205bool ContentInfo::Equals(const ContentInfo& rCompare, bool bComparePool) const
206{
207 return maText == rCompare.maText && aStyle == rCompare.aStyle && eFamily == rCompare.eFamily
208 && aParaAttribs.Equals(rCompare.aParaAttribs, bComparePool)
209 && maCharAttribs == rCompare.maCharAttribs;
210}
211
213
214std::unique_ptr<EditTextObject> EditTextObjectImpl::Clone() const
215{
216 return std::make_unique<EditTextObjectImpl>(*this);
217}
218
219bool EditTextObject::Equals( const EditTextObject& rCompare ) const
220{
221 return toImpl(*this).Equals(toImpl(rCompare), false /*bComparePool*/);
222}
223
225{
226 bool bOwns = false;
227 if (!pWriter)
228 {
229 pWriter = xmlNewTextWriterFilename("editTextObject.xml", 0);
230 xmlTextWriterSetIndent(pWriter,1);
231 (void)xmlTextWriterSetIndentString(pWriter, BAD_CAST(" "));
232 (void)xmlTextWriterStartDocument(pWriter, nullptr, nullptr, nullptr);
233 bOwns = true;
234 }
235
236 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("EditTextObject"));
237 sal_Int32 nCount = GetParagraphCount();
238 for (sal_Int32 i = 0; i < nCount; ++i)
239 {
240 maContents[i]->dumpAsXml(pWriter);
241 }
242 (void)xmlTextWriterEndElement(pWriter);
243
244 if (bOwns)
245 {
246 (void)xmlTextWriterEndDocument(pWriter);
247 xmlFreeTextWriter(pWriter);
248 }
249}
250
251#if DEBUG_EDIT_ENGINE
252void EditTextObjectImpl::Dump() const
253{
254 for (auto const& content : maContents)
255 content.Dump();
256}
257#endif
258
260{
261 // #i101239# ensure target is an EditEngineItemPool, so that at
262 // pool destruction time of an alien pool, the pool is still alive.
263 // When registering would happen at an alien pool which just uses an
264 // EditEngineItemPool as some sub-pool, that pool could already
265 // be decoupled and deleted which would lead to crashes.
266 for (; pPool; pPool = pPool->GetSecondaryPool())
267 if (dynamic_cast<EditEngineItemPool*>(pPool))
268 return pPool;
269
270 auto pRetval = EditEngine::CreatePool();
271 pRetval->SetDefaultMetric(eDefaultMetric);
272 return pRetval;
273}
274
276 TextRotation eRotation, SvtScriptType eScriptType)
277 : mpPool(getEditEngineItemPool(pP, eDefaultMetric))
278 , meUserType(OutlinerMode::DontKnow)
279 , meScriptType(eScriptType)
280 , meRotation(eRotation)
281 , meMetric(eDefaultMetric)
282 , mbVertical(bVertical)
283{
284}
285
287 : mpPool(r.mpPool)
288 , meUserType(r.meUserType)
289 , meScriptType(r.meScriptType)
290 , meRotation(r.meRotation)
291 , meMetric(r.meMetric)
292 , mbVertical(r.mbVertical)
293{
294 // Do not copy PortionInfo
295
296 maContents.reserve(r.maContents.size());
297 for (auto const& content : r.maContents)
298 maContents.push_back(std::unique_ptr<ContentInfo>(new ContentInfo(*content, *mpPool)));
299}
300
302{
304
305 // Remove contents before deleting the pool instance since each content
306 // has to access the pool instance in its destructor.
307 maContents.clear();
308}
309
310
312{
313 meUserType = n;
314}
315
317{
318 for (auto const& content : maContents)
319 {
320 ContentInfo& rInfo = *content;
321 rInfo.NormalizeString(rPool);
322 }
323}
324
325std::vector<svl::SharedString> EditTextObjectImpl::GetSharedStrings() const
326{
327 std::vector<svl::SharedString> aSSs;
328 aSSs.reserve(maContents.size());
329 for (auto const& content : maContents)
330 {
331 const ContentInfo& rInfo = *content;
332 aSSs.push_back(rInfo.GetSharedString());
333 }
334 return aSSs;
335}
336
338{
341}
342
344{
347}
348
350{
351 if (bVert != mbVertical)
352 {
353 mbVertical = bVert;
355 }
356}
357
359{
360 return mbVertical;
361}
362
364{
365 if (meRotation != nRotation)
366 {
367 meRotation = nRotation;
369 }
370}
371
373{
374 return meRotation;
375}
376
377XEditAttribute EditTextObjectImpl::CreateAttrib( const SfxPoolItem& rItem, sal_Int32 nStart, sal_Int32 nEnd )
378{
379 return MakeXEditAttribute( *mpPool, rItem, nStart, nEnd );
380}
381
383{
384 mpPool->Remove( *rAttr.GetItem() );
385}
386
387
389{
390 maContents.push_back(std::unique_ptr<ContentInfo>(new ContentInfo(*mpPool)));
391 return maContents.back().get();
392}
393
395{
396 size_t nSize = maContents.size();
397 if (nSize > EE_PARA_MAX_COUNT)
398 {
399 SAL_WARN( "editeng", "EditTextObjectImpl::GetParagraphCount - overflow " << nSize);
400 return EE_PARA_MAX_COUNT;
401 }
402 return static_cast<sal_Int32>(nSize);
403}
404
405OUString EditTextObjectImpl::GetText(sal_Int32 nPara) const
406{
407 if (nPara < 0 || o3tl::make_unsigned(nPara) >= maContents.size())
408 return OUString();
409
410 return maContents[nPara]->GetText();
411}
412
414{
415 mpPortionInfo.reset();
416}
417
419{
420 for (auto const& content : maContents)
421 {
422 if ( content->GetWrongList() && !content->GetWrongList()->empty() )
423 return true;
424 }
425 return false;
426}
427
428void EditTextObjectImpl::GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const
429{
430 if (nPara < 0 || o3tl::make_unsigned(nPara) >= maContents.size())
431 return;
432
433 rLst.clear();
434 const ContentInfo& rC = *maContents[nPara];
435 for (const XEditAttribute & rAttr : rC.maCharAttribs)
436 {
437 EECharAttrib aEEAttr(rAttr.GetStart(), rAttr.GetEnd(), rAttr.GetItem());
438 rLst.push_back(aEEAttr);
439 }
440}
441
443{
444 return GetField() != nullptr;
445}
446
448{
449 if (maContents.size() == 1)
450 {
451 const ContentInfo& rC = *maContents[0];
452 if (rC.GetText().getLength() == 1)
453 {
454 size_t nAttribs = rC.maCharAttribs.size();
455 for (size_t nAttr = nAttribs; nAttr; )
456 {
457 const XEditAttribute& rX = rC.maCharAttribs[--nAttr];
458 if (rX.GetItem()->Which() == EE_FEATURE_FIELD)
459 return static_cast<const SvxFieldItem*>(rX.GetItem());
460 }
461 }
462 }
463 return nullptr;
464}
465
466const SvxFieldData* EditTextObjectImpl::GetFieldData(sal_Int32 nPara, size_t nPos, sal_Int32 nType) const
467{
468 if (nPara < 0 || o3tl::make_unsigned(nPara) >= maContents.size())
469 return nullptr;
470
471 const ContentInfo& rC = *maContents[nPara];
472 if (nPos >= rC.maCharAttribs.size())
473 // URL position is out-of-bound.
474 return nullptr;
475
476 size_t nCurPos = 0;
477 for (XEditAttribute const& rAttr : rC.maCharAttribs)
478 {
479 if (rAttr.GetItem()->Which() != EE_FEATURE_FIELD)
480 // Skip attributes that are not fields.
481 continue;
482
483 const SvxFieldItem* pField = static_cast<const SvxFieldItem*>(rAttr.GetItem());
484 const SvxFieldData* pFldData = pField->GetField();
485 if (nType != text::textfield::Type::UNSPECIFIED && nType != pFldData->GetClassId())
486 // Field type doesn't match. Skip it. UNSPECIFIED matches all field types.
487 continue;
488
489 if (nCurPos == nPos)
490 // Found it!
491 return pFldData;
492
493 ++nCurPos;
494 }
495
496 return nullptr; // field not found.
497}
498
499bool EditTextObjectImpl::HasField( sal_Int32 nType ) const
500{
501 size_t nParagraphs = maContents.size();
502 for (size_t nPara = 0; nPara < nParagraphs; ++nPara)
503 {
504 const ContentInfo& rC = *maContents[nPara];
505 size_t nAttrs = rC.maCharAttribs.size();
506 for (size_t nAttr = 0; nAttr < nAttrs; ++nAttr)
507 {
508 const XEditAttribute& rAttr = rC.maCharAttribs[nAttr];
509 if (rAttr.GetItem()->Which() != EE_FEATURE_FIELD)
510 continue;
511
512 if (nType == text::textfield::Type::UNSPECIFIED)
513 // Match any field type.
514 return true;
515
516 const SvxFieldData* pFldData = static_cast<const SvxFieldItem*>(rAttr.GetItem())->GetField();
517 if (pFldData && pFldData->GetClassId() == nType)
518 return true;
519 }
520 }
521 return false;
522}
523
525{
526 const ContentInfo& rC = *maContents[nPara];
527 return rC.GetParaAttribs();
528}
529
531{
532 bool bChanged = false;
533
534 for ( size_t nPara = maContents.size(); nPara; )
535 {
536 ContentInfo& rC = *maContents[--nPara];
537
538 for (size_t nAttr = rC.maCharAttribs.size(); nAttr; )
539 {
540 XEditAttribute& rAttr = rC.maCharAttribs[--nAttr];
541 if ( !_nWhich || (rAttr.GetItem()->Which() == _nWhich) )
542 {
543 mpPool->Remove(*rAttr.GetItem());
544 rC.maCharAttribs.erase(rC.maCharAttribs.begin()+nAttr);
545 bChanged = true;
546 }
547 }
548 }
549
550 if ( bChanged )
552
553 return bChanged;
554}
555
556namespace {
557
558class FindByParagraph
559{
560 sal_Int32 mnPara;
561public:
562 explicit FindByParagraph(sal_Int32 nPara) : mnPara(nPara) {}
563 bool operator() (const editeng::Section& rAttr) const
564 {
565 return rAttr.mnParagraph == mnPara;
566 }
567};
568
569class FindBySectionStart
570{
571 sal_Int32 mnPara;
572 sal_Int32 mnStart;
573public:
574 FindBySectionStart(sal_Int32 nPara, sal_Int32 nStart) : mnPara(nPara), mnStart(nStart) {}
575 bool operator() (const editeng::Section& rAttr) const
576 {
577 return rAttr.mnParagraph == mnPara && rAttr.mnStart == mnStart;
578 }
579};
580
581}
582
583void EditTextObjectImpl::GetAllSections( std::vector<editeng::Section>& rAttrs ) const
584{
585 std::vector<editeng::Section> aAttrs;
586 aAttrs.reserve(maContents.size());
587 std::vector<size_t> aBorders;
588
589 for (size_t nPara = 0; nPara < maContents.size(); ++nPara)
590 {
591 aBorders.clear();
592 const ContentInfo& rC = *maContents[nPara];
593 aBorders.push_back(0);
594 aBorders.push_back(rC.GetText().getLength());
595 for (const XEditAttribute & rAttr : rC.maCharAttribs)
596 {
597 const SfxPoolItem* pItem = rAttr.GetItem();
598 if (!pItem)
599 continue;
600
601 aBorders.push_back(rAttr.GetStart());
602 aBorders.push_back(rAttr.GetEnd());
603 }
604
605 // Sort and remove duplicates for each paragraph.
606 std::sort(aBorders.begin(), aBorders.end());
607 auto itUniqueEnd = std::unique(aBorders.begin(), aBorders.end());
608 aBorders.erase(itUniqueEnd, aBorders.end());
609
610 // Create storage for each section. Note that this creates storage even
611 // for unformatted sections. The entries are sorted first by paragraph,
612 // then by section positions. They don't overlap with each other.
613
614 if (aBorders.size() == 1 && aBorders[0] == 0)
615 {
616 // Empty paragraph. Push an empty section.
617 aAttrs.emplace_back(nPara, 0, 0);
618 continue;
619 }
620
621 auto itBorder = aBorders.begin(), itBorderEnd = aBorders.end();
622 size_t nPrev = *itBorder;
623 size_t nCur;
624 for (++itBorder; itBorder != itBorderEnd; ++itBorder, nPrev = nCur)
625 {
626 nCur = *itBorder;
627 aAttrs.emplace_back(nPara, nPrev, nCur);
628 }
629 }
630
631 if (aAttrs.empty())
632 return;
633
634 // Go through all formatted paragraphs, and store format items.
635 std::vector<editeng::Section>::iterator itAttr = aAttrs.begin();
636 for (sal_Int32 nPara = 0; nPara < static_cast<sal_Int32>(maContents.size()); ++nPara)
637 {
638 const ContentInfo& rC = *maContents[nPara];
639
640 itAttr = std::find_if(itAttr, aAttrs.end(), FindByParagraph(nPara));
641 if (itAttr == aAttrs.end())
642 {
643 // This should never happen. There is a logic error somewhere...
644 assert(false);
645 return;
646 }
647
648 for (const XEditAttribute & rXAttr : rC.maCharAttribs)
649 {
650 const SfxPoolItem* pItem = rXAttr.GetItem();
651 if (!pItem)
652 continue;
653
654 sal_Int32 nStart = rXAttr.GetStart(), nEnd = rXAttr.GetEnd();
655
656 // Find the container whose start position matches.
657 std::vector<editeng::Section>::iterator itCurAttr = std::find_if(itAttr, aAttrs.end(), FindBySectionStart(nPara, nStart));
658 if (itCurAttr == aAttrs.end())
659 {
660 // This should never happen. There is a logic error somewhere...
661 assert(false);
662 return;
663 }
664
665 for (; itCurAttr != aAttrs.end() && itCurAttr->mnParagraph == nPara && itCurAttr->mnEnd <= nEnd; ++itCurAttr)
666 {
667 editeng::Section& rSecAttr = *itCurAttr;
668 // serious bug: will cause duplicate attributes to be exported
669 if (std::none_of(rSecAttr.maAttributes.begin(), rSecAttr.maAttributes.end(),
670 [&pItem](SfxPoolItem const*const pIt)
671 { return pIt->Which() == pItem->Which(); }))
672 {
673 rSecAttr.maAttributes.push_back(pItem);
674 }
675 else
676 {
677 SAL_WARN("editeng", "GetAllSections(): duplicate attribute suppressed");
678 }
679 }
680 }
681 }
682
683 rAttrs.swap(aAttrs);
684}
685
686void EditTextObjectImpl::GetStyleSheet(sal_Int32 nPara, OUString& rName, SfxStyleFamily& rFamily) const
687{
688 if (nPara < 0 || o3tl::make_unsigned(nPara) >= maContents.size())
689 return;
690
691 const ContentInfo& rC = *maContents[nPara];
692 rName = rC.GetStyle();
693 rFamily = rC.GetFamily();
694}
695
696void EditTextObjectImpl::SetStyleSheet(sal_Int32 nPara, const OUString& rName, const SfxStyleFamily& rFamily)
697{
698 if (nPara < 0 || o3tl::make_unsigned(nPara) >= maContents.size())
699 return;
700
701 ContentInfo& rC = *maContents[nPara];
702 rC.SetStyle(rName);
703 rC.SetFamily(rFamily);
704}
705
707 std::u16string_view rOldName, SfxStyleFamily eOldFamily,
708 const OUString& rNewName, SfxStyleFamily eNewFamily )
709{
710 const size_t nParagraphs = maContents.size();
711 bool bChanges = false;
712
713 for (size_t nPara = 0; nPara < nParagraphs; ++nPara)
714 {
715 ContentInfo& rC = *maContents[nPara];
716 if ( rC.GetFamily() == eOldFamily )
717 {
718 if ( rC.GetStyle() == rOldName )
719 {
720 rC.SetStyle(rNewName);
721 rC.SetFamily(eNewFamily);
722 bChanges = true;
723 }
724 }
725 }
726 return bChanges;
727}
728
730 std::u16string_view rOldName, SfxStyleFamily eOldFamily,
731 const OUString& rNewName, SfxStyleFamily eNewFamily)
732{
733 bool bChanges = ImpChangeStyleSheets( rOldName, eOldFamily, rNewName, eNewFamily );
734 if ( bChanges )
736
737 return bChanges;
738}
739
741 std::u16string_view rOldName, const OUString& rNewName )
742{
743 ImpChangeStyleSheets( rOldName, eFamily, rNewName, eFamily );
744}
745
747{
748 return Equals(toImpl(rCompare), true);
749}
750
751bool EditTextObjectImpl::Equals( const EditTextObjectImpl& rCompare, bool bComparePool ) const
752{
753 if( this == &rCompare )
754 return true;
755
756 if( ( bComparePool && mpPool != rCompare.mpPool ) ||
757 ( meMetric != rCompare.meMetric ) ||
758 ( meUserType!= rCompare.meUserType ) ||
759 ( meScriptType != rCompare.meScriptType ) ||
760 ( mbVertical != rCompare.mbVertical ) ||
761 ( meRotation != rCompare.meRotation ) )
762 return false;
763
764 return std::equal(
765 maContents.begin(), maContents.end(), rCompare.maContents.begin(), rCompare.maContents.end(),
766 [bComparePool](const auto& c1, const auto& c2) { return c1->Equals(*c2, bComparePool); });
767}
768
769// #i102062#
771{
772 const EditTextObjectImpl& rCompare = toImpl(rComp);
773 return std::equal(
774 maContents.begin(), maContents.end(), rCompare.maContents.begin(), rCompare.maContents.end(),
775 [](const auto& c1, const auto& c2) { return c1->isWrongListEqual(*c2); });
776}
777
778/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Text maText
OUString GetText() const
Definition: editobj.cxx:135
ContentInfo(SfxItemPool &rPool)
Definition: editobj.cxx:95
void NormalizeString(svl::SharedStringPool &rPool)
Definition: editobj.cxx:129
OUString aStyle
Definition: editobj2.hxx:125
svl::SharedString maText
Definition: editobj2.hxx:124
bool Equals(const ContentInfo &rCompare, bool bComparePool) const
Definition: editobj.cxx:205
const svl::SharedString & GetSharedString() const
Definition: editobj2.hxx:142
SfxStyleFamily GetFamily() const
Definition: editobj2.hxx:152
const SfxItemSet & GetParaAttribs() const
Definition: editobj2.hxx:157
SfxItemSetFixed< EE_PARA_START, EE_CHAR_END > aParaAttribs
Definition: editobj2.hxx:129
std::unique_ptr< WrongList > mpWrongs
Definition: editobj2.hxx:131
void SetStyle(const OUString &rStyle)
Definition: editobj2.hxx:154
const WrongList * GetWrongList() const
Definition: editobj.cxx:167
void SetFamily(const SfxStyleFamily &rFamily)
Definition: editobj2.hxx:155
std::vector< XEditAttribute > maCharAttribs
Definition: editobj2.hxx:127
void SetText(const OUString &rStr)
Definition: editobj.cxx:141
void SetWrongList(WrongList *p)
Definition: editobj.cxx:172
SfxStyleFamily eFamily
Definition: editobj2.hxx:128
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: editobj.cxx:146
const OUString & GetStyle() const
Definition: editobj2.hxx:151
bool isWrongListEqual(const ContentInfo &rCompare) const
Definition: editobj.cxx:178
static rtl::Reference< SfxItemPool > CreatePool()
Definition: editeng.cxx:2631
bool ImpChangeStyleSheets(std::u16string_view rOldName, SfxStyleFamily eOldFamily, const OUString &rNewName, SfxStyleFamily eNewFamily)
Definition: editobj.cxx:706
virtual bool isWrongListEqual(const EditTextObject &rCompare) const override
Definition: editobj.cxx:770
virtual bool IsTopToBottom() const override
Definition: editobj.cxx:343
virtual bool RemoveCharAttribs(sal_uInt16 nWhich) override
Definition: editobj.cxx:530
std::unique_ptr< XParaPortionList > mpPortionInfo
Definition: editobj2.hxx:180
virtual OUString GetText(sal_Int32 nParagraph) const override
Definition: editobj.cxx:405
virtual void ChangeStyleSheetName(SfxStyleFamily eFamily, std::u16string_view rOldName, const OUString &rNewName) override
Definition: editobj.cxx:740
virtual ~EditTextObjectImpl() override
Definition: editobj.cxx:301
virtual void NormalizeString(svl::SharedStringPool &rPool) override
Set paragraph strings to the shared string pool.
Definition: editobj.cxx:316
virtual const SvxFieldItem * GetField() const override
Definition: editobj.cxx:447
virtual bool GetVertical() const override
Definition: editobj.cxx:358
virtual TextRotation GetRotation() const override
Definition: editobj.cxx:372
virtual std::vector< svl::SharedString > GetSharedStrings() const override
Definition: editobj.cxx:325
SvtScriptType meScriptType
Definition: editobj2.hxx:183
virtual void GetStyleSheet(sal_Int32 nPara, OUString &rName, SfxStyleFamily &eFamily) const override
Definition: editobj.cxx:686
virtual bool IsEffectivelyVertical() const override
Definition: editobj.cxx:337
EditTextObjectImpl(SfxItemPool *pPool, MapUnit eDefaultMetric, bool bVertical, TextRotation eRotation, SvtScriptType eScriptType)
Definition: editobj.cxx:275
virtual const SvxFieldData * GetFieldData(sal_Int32 nPara, size_t nPos, sal_Int32 nType) const override
Definition: editobj.cxx:466
virtual bool operator==(const EditTextObject &rCompare) const override
Definition: editobj.cxx:746
ContentInfosType maContents
Definition: editobj2.hxx:178
TextRotation meRotation
Definition: editobj2.hxx:184
virtual sal_Int32 GetParagraphCount() const override
Definition: editobj.cxx:394
virtual void ClearPortionInfo() override
Definition: editobj.cxx:413
ContentInfo * CreateAndInsertContent()
Definition: editobj.cxx:388
virtual std::unique_ptr< EditTextObject > Clone() const override
Definition: editobj.cxx:214
virtual bool HasField(sal_Int32 nType=css::text::textfield::Type::UNSPECIFIED) const override
Definition: editobj.cxx:499
virtual void SetVertical(bool bVert) override
Definition: editobj.cxx:349
OutlinerMode meUserType
Definition: editobj2.hxx:182
rtl::Reference< SfxItemPool > mpPool
Definition: editobj2.hxx:179
virtual void GetAllSections(std::vector< editeng::Section > &rAttrs) const override
Get all text sections in this content.
Definition: editobj.cxx:583
void DestroyAttrib(const XEditAttribute &rAttr)
Definition: editobj.cxx:382
virtual bool ChangeStyleSheets(std::u16string_view rOldName, SfxStyleFamily eOldFamily, const OUString &rNewName, SfxStyleFamily eNewFamily) override
Definition: editobj.cxx:729
virtual void SetStyleSheet(sal_Int32 nPara, const OUString &rName, const SfxStyleFamily &eFamily) override
Definition: editobj.cxx:696
virtual const SfxItemSet & GetParaAttribs(sal_Int32 nPara) const override
Definition: editobj.cxx:524
virtual void SetUserType(OutlinerMode n) override
Definition: editobj.cxx:311
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: editobj.cxx:224
XEditAttribute CreateAttrib(const SfxPoolItem &rItem, sal_Int32 nStart, sal_Int32 nEnd)
Definition: editobj.cxx:377
virtual bool IsFieldObject() const override
Definition: editobj.cxx:442
bool Equals(const EditTextObjectImpl &rCompare, bool bComparePool) const
Definition: editobj.cxx:751
virtual void SetRotation(TextRotation nRotation) override
Definition: editobj.cxx:363
virtual void GetCharAttribs(sal_Int32 nPara, std::vector< EECharAttrib > &rLst) const override
Definition: editobj.cxx:428
virtual bool HasOnlineSpellErrors() const override
Definition: editobj.cxx:418
bool Equals(const EditTextObject &rCompare) const
Compare, ignoring SfxItemPool pointer.
Definition: editobj.cxx:219
virtual ~EditTextObject()
SfxItemPool * GetSecondaryPool() const
const T & Put(std::unique_ptr< T > xItem, sal_uInt16 nWhich=0)
void Remove(const SfxPoolItem &)
SfxItemPool * GetPool() const
void dumpAsXml(xmlTextWriterPtr pWriter) const
bool Set(const SfxItemSet &, bool bDeep=true)
bool Equals(const SfxItemSet &, bool bComparePool) const
sal_uInt16 Which() const
virtual sal_Int32 GetClassId() const
Definition: flditem.hxx:47
This item stores a field (SvxFieldData).
Definition: flditem.hxx:70
const SvxFieldData * GetField() const
Definition: flditem.hxx:81
Keeps track of misspelled ranges in paragraph.
Definition: edtspell.hxx:55
WrongList * Clone() const
Definition: edtspell.cxx:426
const SfxPoolItem * pItem
Definition: editobj2.hxx:50
const SfxPoolItem * GetItem() const
Definition: editobj2.hxx:57
XEditAttribute(const SfxPoolItem &rAttr, sal_Int32 nStart, sal_Int32 nEnd)
Definition: editobj.cxx:55
sal_Int32 & GetEnd()
Definition: editobj2.hxx:60
bool IsFeature() const
Definition: editobj.cxx:62
void SetItem(const SfxPoolItem &rNew)
Definition: editobj.cxx:68
sal_Int32 & GetStart()
Definition: editobj2.hxx:59
ListType maList
Definition: editobj2.hxx:94
void push_back(XParaPortion *p)
Definition: editobj.cxx:85
XParaPortionList(OutputDevice *pRefDev, sal_uInt32 nPW, double fFontScaleX, double fFontScaleY, double fSpacingScaleX, double fSpacingScaleY)
Definition: editobj.cxx:73
const XParaPortion & operator[](size_t i) const
Definition: editobj.cxx:90
SharedString intern(const OUString &rStr)
rtl_uString * getData()
int nCount
#define EE_PARA_MAX_COUNT
Definition: editdata.hxx:51
EditTextObjectImpl & toImpl(EditTextObject &rObj)
Definition: editobj2.hxx:273
static XEditAttribute MakeXEditAttribute(SfxItemPool &rPool, const SfxPoolItem &rItem, sal_Int32 nStart, sal_Int32 nEnd)
Definition: editobj.cxx:47
static rtl::Reference< SfxItemPool > getEditEngineItemPool(SfxItemPool *pPool, MapUnit eDefaultMetric)
Definition: editobj.cxx:259
TextRotation
Definition: editobj.hxx:55
constexpr sal_uInt16 EE_FEATURE_END(EE_FEATURE_FIELD+0)
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
constexpr sal_uInt16 EE_FEATURE_START(EE_CHAR_END+1)
struct _xmlTextWriter * xmlTextWriterPtr
void * p
sal_Int64 n
SvtScriptType
sal_uInt16 nPos
#define SAL_WARN(area, stream)
MapUnit
int i
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
OutlinerMode
Definition: outliner.hxx:563
QPRO_FUNC_TYPE nType
TOOLS_DLLPUBLIC SvStream & endl(SvStream &rStr)
std::vector< const SfxPoolItem * > maAttributes
Definition: section.hxx:27
sal_Int32 mnParagraph
Definition: section.hxx:23
sal_Int32 mnStart
Definition: section.hxx:24
SfxStyleFamily
sal_Int32 mnStart