LibreOffice Module writerfilter (master) 1
DomainMapper_Impl.hxx
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#pragma once
20
21#include <com/sun/star/text/XParagraphCursor.hpp>
22#include <com/sun/star/text/XTextDocument.hpp>
23#include <com/sun/star/text/XTextCursor.hpp>
24#include <com/sun/star/text/XTextAppend.hpp>
25#include <com/sun/star/text/XTextFrame.hpp>
26#include <com/sun/star/style/TabStop.hpp>
27#include <com/sun/star/container/XNameContainer.hpp>
28#include <com/sun/star/embed/XStorage.hpp>
29#include <queue>
30#include <stack>
31#include <string_view>
33#include <unordered_map>
34#include <utility>
35#include <vector>
36#include <optional>
37
39
41
42#include "DomainMapper.hxx"
45#include "PropertyMap.hxx"
46#include "FontTable.hxx"
47#include "NumberingManager.hxx"
48#include "StyleSheetTable.hxx"
49#include "SettingsTable.hxx"
50#include "ThemeHandler.hxx"
51#include "GraphicImport.hxx"
52#include "OLEHandler.hxx"
53#include "FFDataHandler.hxx"
54#include "SmartTagHandler.hxx"
55#include "FormControlHelper.hxx"
56#include <map>
57
58namespace com::sun::star{
59 namespace awt{
60 struct Size;
61 }
62 namespace lang{
63 class XMultiServiceFactory;
64 struct Locale;
65 }
66 namespace text
67 {
68 class XTextField;
69 class XTextFrame;
70 class XFormField;
71 }
72 namespace beans{ class XPropertySet;}
73}
74
76 class OOXMLDocument;
77}
78
79namespace writerfilter::dmapper {
80
81class SdtHelper;
82
83struct PageMar
84{
85 sal_Int32 top;
86 sal_Int32 right;
87 sal_Int32 bottom;
88 sal_Int32 left;
89 sal_Int32 header;
90 sal_Int32 footer;
91 sal_Int32 gutter;
92 public:
93 PageMar();
94};
96{
105
108{
116
118{
123
134{
135 OFF,
136 ON,
138};
139
140// type of stored redlines
142{
143 FRAME = 0,
146 NONE
148
157{
159 sal_Int32 m_nTableDepth;
160
161public:
162 explicit HeaderFooterContext(bool bTextInserted, sal_Int32 nTableDepth);
163 bool getTextInserted() const;
164 sal_Int32 getTableDepth() const;
165};
166
169{
171 bool m_bRemove = false;
172};
173
175class FieldContext : public virtual SvRefBase
176{
178 css::uno::Reference<css::text::XTextRange> m_xStartRange;
179
180 // Two command string:
181 // 0: Normal, inserted command line
182 // 1: Deleted command line
183 OUString m_sCommand[2];
184 OUString m_sResult;
186 std::optional<FieldId> m_eFieldId;
188 // Current command line type: normal or deleted
190
191 css::uno::Reference<css::text::XTextField> m_xTextField;
192 css::uno::Reference<css::text::XFormField> m_xFormField;
193 css::uno::Reference<css::beans::XPropertySet> m_xTOC;
194 css::uno::Reference<css::beans::XPropertySet> m_xTC; // TOX entry
195 css::uno::Reference<css::beans::XPropertySet> m_xCustomField;
196
200
205
206 std::vector<FieldParagraph> m_aParagraphsToFinish;
207
208public:
209 explicit FieldContext(css::uno::Reference<css::text::XTextRange> xStart);
210 ~FieldContext() override;
211
212 const css::uno::Reference<css::text::XTextRange>& GetStartRange() const { return m_xStartRange; }
213
214 void AppendCommand(std::u16string_view rPart);
215 const OUString& GetCommand() const {return m_sCommand[m_bCommandType]; }
216 bool GetCommandIsEmpty(bool bType) const { return m_sCommand[bType].isEmpty(); }
217 void SetCommandType(bool cType) { m_bCommandType = cType; }
218
220 std::optional<FieldId> const & GetFieldId() const { return m_eFieldId; }
221
222 void AppendResult(std::u16string_view rResult) { m_sResult += rResult; }
223 const OUString& GetResult() const { return m_sResult; }
224
225 void CacheVariableValue(const css::uno::Any& rAny);
226 const OUString& GetVariableValue() { return m_sVariableValue; }
227
230
232 bool IsFieldLocked() const { return m_bFieldLocked; }
233
234 const css::uno::Reference<css::beans::XPropertySet>& GetCustomField() const { return m_xCustomField; }
235 void SetCustomField(css::uno::Reference<css::beans::XPropertySet> const& xCustomField) { m_xCustomField = xCustomField; }
236 const css::uno::Reference<css::text::XTextField>& GetTextField() const { return m_xTextField;}
237 void SetTextField(css::uno::Reference<css::text::XTextField> const& xTextField);
238 const css::uno::Reference<css::text::XFormField>& GetFormField() const { return m_xFormField;}
239 void SetFormField(css::uno::Reference<css::text::XFormField> const& xFormField) { m_xFormField = xFormField;}
240
241 void SetTOC(css::uno::Reference<css::beans::XPropertySet> const& xTOC) { m_xTOC = xTOC; }
242 const css::uno::Reference<css::beans::XPropertySet>& GetTOC() const { return m_xTOC; }
243
244 void SetTC(css::uno::Reference<css::beans::XPropertySet> const& xTC) { m_xTC = xTC; }
245 const css::uno::Reference<css::beans::XPropertySet>& GetTC() const { return m_xTC; }
246
247 void SetHyperlinkURL( const OUString& rURL ) { m_sHyperlinkURL = rURL; }
248 const OUString& GetHyperlinkURL() const { return m_sHyperlinkURL; }
249 void SetHyperlinkTarget(const OUString& rTarget) { m_sHyperlinkTarget = rTarget; }
250 const OUString& GetHyperlinkTarget() const { return m_sHyperlinkTarget; }
251
252 void setFFDataHandler(FFDataHandler::Pointer_t pFFDataHandler) { m_pFFDataHandler = pFFDataHandler; }
254
255 void setFormControlHelper(FormControlHelper::Pointer_t pFormControlHelper) { m_pFormControlHelper = pFormControlHelper; }
257 const PropertyMapPtr& getProperties() const { return m_pProperties; }
258
259 ::std::vector<OUString> GetCommandParts() const;
260
261 std::vector<FieldParagraph>& GetParagraphsToFinish() { return m_aParagraphsToFinish; }
262};
263
265{
266 css::uno::Reference<css::text::XTextAppend> xTextAppend;
267 css::uno::Reference<css::text::XTextRange> xInsertPosition;
268 css::uno::Reference<css::text::XParagraphCursor> xCursor;
270
275 std::vector<AnchoredObjectInfo> m_aAnchoredObjects;
276
277 inline TextAppendContext(css::uno::Reference<css::text::XTextAppend> xAppend, const css::uno::Reference<css::text::XTextCursor>& xCur);
278};
279
281{
282 css::uno::Reference<css::text::XTextContent> xTextContent;
284
285 explicit AnchoredContext(css::uno::Reference<css::text::XTextContent> xContent)
286 : xTextContent(std::move(xContent)), bToRemove(false)
287 {
288 }
289};
290
292
293/*-------------------------------------------------------------------------
294 extended tab stop struct
295 -----------------------------------------------------------------------*/
296struct DeletableTabStop : public css::style::TabStop
297{
300 : bDeleted(false)
301 {
302 FillChar = ' '; // same default as SvxXMLTabStopContext_Impl
303 }
304 DeletableTabStop(const css::style::TabStop& rTabStop)
305 : TabStop(rTabStop),
306 bDeleted(false)
307 {
308 }
309};
312{
315 css::uno::Reference<css::text::XTextRange> m_xTextRange;
316 BookmarkInsertPosition(bool bIsStartOfText, OUString rName, css::uno::Reference<css::text::XTextRange> xTextRange):
317 m_bIsStartOfText( bIsStartOfText ),
318 m_sBookmarkName(std::move( rName )),
319 m_xTextRange(std::move( xTextRange ))
320 {}
321};
322
324{
326 sal_Int32 m_Id;
327 OUString m_Ed;
328 OUString m_EdGrp;
329
330 css::uno::Reference<css::text::XTextRange> m_xTextRange;
331
332 PermInsertPosition(bool bIsStartOfText, sal_Int32 id, OUString ed, OUString edGrp, css::uno::Reference<css::text::XTextRange> xTextRange)
333 : m_bIsStartOfText(bIsStartOfText)
334 , m_Id(id)
335 , m_Ed(std::move(ed))
336 , m_EdGrp(std::move(edGrp))
337 , m_xTextRange(std::move(xTextRange))
338 {}
339
340 OUString createBookmarkName() const
341 {
342 OUString bookmarkName;
343
344 assert((!m_Ed.isEmpty()) || (!m_EdGrp.isEmpty()));
345
346 if (m_Ed.isEmpty())
347 {
348 bookmarkName += "permission-for-group:" +
349 OUString::number(m_Id) +
350 ":" +
351 m_EdGrp;
352 }
353 else
354 {
355 bookmarkName += "permission-for-user:" +
356 OUString::number(m_Id) +
357 ":" +
358 m_Ed;
359 }
360
361 //todo: make sure the name is not used already!
362 return bookmarkName;
363 }
364};
365
368{
369 css::uno::Reference<css::text::XTextRange> m_xStart;
370 css::uno::Reference<css::text::XTextRange> m_xEnd;
371};
372
374{
375 OUString sRubyText;
376 OUString sRubyStyle;
377 sal_uInt32 nSprmId;
378 sal_uInt32 nRubyAlign;
379 sal_uInt32 nHps;
380 sal_uInt32 nHpsBaseText;
381
383 nSprmId(0),
384 nRubyAlign(0),
385 nHps(0),
386 nHpsBaseText(0)
387 {
388 }
389};
390
392{
393 sal_Int32 nDistance;
394 sal_Int32 nInterval;
397 nDistance(-1)
398 ,nInterval(0)
399 ,bRestartAtEachPage(true)
400 {}
401
402};
403
406{
407 css::uno::Reference<css::text::XTextContent> m_xAnchoredObject;
408 sal_Int32 m_nLeftMargin = 0;
410};
411
414{
415 css::uno::Reference<css::text::XTextRange> m_xParagraph;
416 std::vector<AnchoredObjectInfo> m_aAnchoredObjects;
417};
418
420{
422 OUString sFont;
424 cSymbol(),
425 sFont()
426 { }
427};
428
429class DomainMapper;
431{
432public:
433 typedef std::map < OUString, BookmarkInsertPosition > BookmarkMap_t;
434 typedef std::map < sal_Int32, PermInsertPosition > PermMap_t;
435
436private:
440 OUString m_aBaseUrl;
441 css::uno::Reference<css::text::XTextDocument> m_xTextDocument;
442 css::uno::Reference<css::beans::XPropertySet> m_xDocumentSettings;
443 css::uno::Reference<css::lang::XMultiServiceFactory> m_xTextFactory;
444 css::uno::Reference<css::uno::XComponentContext> m_xComponentContext;
445 css::uno::Reference<css::container::XNameContainer> m_xPageStyles1;
446 // cache next available number, expensive to repeatedly compute
447 std::optional<int> m_xNextUnusedPageStyleNo;
448 css::uno::Reference<css::container::XNameContainer> m_xCharacterStyles;
449 // cache next available number, expensive to repeatedly compute
451 css::uno::Reference<css::text::XText> m_xBodyText;
452 css::uno::Reference<css::text::XTextContent> m_xEmbedded;
453
454 std::stack<TextAppendContext> m_aTextAppendStack;
455 std::stack<AnchoredContext> m_aAnchoredStack;
456 std::stack<HeaderFooterContext> m_aHeaderFooterStack;
457 std::stack<std::pair<TextAppendContext, bool>> m_aHeaderFooterTextAppendStack;
458 std::deque<FieldContextPtr> m_aFieldStack;
484
489
494
497
498 // TableManagers are stacked: one for each stream to avoid any confusion
499 std::stack< tools::SvRef< DomainMapperTableManager > > m_aTableManagers;
501 // List of document lists overrides. They are applied only once on first occurrence in document
503
504 //each context needs a stack of currently used attributes
505 std::stack<PropertyMapPtr> m_aPropertyStacks[NUMBER_OF_CONTEXTS];
506 std::stack<ContextType> m_aContextStack;
507 std::queue<std::optional<sal_Int16>> m_aFrameDirectionQueue;
511 std::deque< css::uno::Reference<css::drawing::XShape> > m_aPendingShapes;
515
516 std::unique_ptr<ThemeHandler> m_pThemeHandler;
517
521
522 ::std::vector<DeletableTabStop> m_aCurrentTabStops;
523 OUString m_sCurrentParaStyleName; //highly inaccurate. Overwritten by "overlapping" paragraphs like comments, flys.
524 OUString m_sDefaultParaStyleName; //caches the ConvertedStyleName of the default paragraph style
526 bool m_bInStyleSheetImport; //in import of fonts, styles, lists or lfos
527 bool m_bInNumberingImport; //in import of numbering (i.e. numbering.xml)
528 bool m_bInAnyTableImport; //in import of fonts, styles, lists or lfos
530 {
531 none,
532 header,
533 footer,
544 sal_Int32 m_nFootnotes; // footnote count
545 sal_Int32 m_nEndnotes; // endnote count
546 // these are the real first notes, use their content in the first notes
549
552
554 //registered frame properties
555 std::vector<css::beans::PropertyValue> m_aFrameProperties;
556 css::uno::Reference<css::text::XTextRange> m_xFrameStartRange;
557 css::uno::Reference<css::text::XTextRange> m_xFrameEndRange;
558
559 // Redline stack
560 std::stack< std::vector< RedlineParamsPtr > > m_aRedlines;
561 // The redline currently read, may be also stored by a context instead of m_aRedlines.
567 // redline data of the terminating run, if it's a moveFrom deletion or a moveTo insertion
569 // This is for removing workaround (double ZWSPs around the anchoring point) for track
570 // changed images anchored *to* character, if it's followed by a redline text run immediately.
571 // (In that case, the image is part of a tracked text range, no need for the dummy
572 // text ZWSPs to keep the change tracking of the image in Writer.)
574
591 bool m_bSdt;
596
597 css::uno::Reference< css::text::XTextCursor > m_xTOCMarkerCursor;
598
599 //annotation import
600 css::uno::Reference< css::beans::XPropertySet > m_xAnnotationField;
605 std::unordered_map< sal_Int32, AnnotationPosition > m_aAnnotationPositions;
606
607 void SetNumberFormat(const OUString& rCommand, css::uno::Reference<css::beans::XPropertySet> const& xPropertySet, bool bDetectFormat = false);
609 css::uno::Reference<css::beans::XPropertySet> FindOrCreateFieldMaster(const char* pFieldMasterService, const OUString& rFieldMasterName);
610 css::uno::Reference<css::beans::XPropertySet> const & GetDocumentSettings();
611
612 std::map<sal_Int32, css::uno::Any> m_deferredCharacterProperties;
614
615 css::uno::Reference<css::text::XTextRange> m_xGlossaryEntryStart;
616 css::uno::Reference<css::text::XTextRange> m_xSdtEntryStart;
617 std::stack<BookmarkInsertPosition> m_xSdtStarts;
618
619 std::queue< css::uno::Reference< css::text::XTextFrame > > m_xPendingTextBoxFrames;
620
621public:
622 css::uno::Reference<css::text::XTextRange> m_xInsertTextRange;
623 css::uno::Reference<css::text::XTextRange> m_xAltChunkStartingRange;
624 std::deque<sal_Int32> m_aFootnoteIds;
625 std::deque<sal_Int32> m_aEndnoteIds;
626
628private:
630 bool m_bIsAltChunk = false;
632 std::optional<sal_Int16> m_oLineBreakClear;
633
634public:
636 DomainMapper& rDMapper,
637 css::uno::Reference < css::uno::XComponentContext > xContext,
638 css::uno::Reference< css::lang::XComponent > const& xModel,
639 SourceDocumentType eDocumentType,
640 utl::MediaDescriptor const & rMediaDesc);
642
645
647 {
648 return dynamic_cast< SectionPropertyMap* >( m_pLastSectionContext.get( ) );
649 }
650
651 css::uno::Reference<css::container::XNameContainer> const & GetPageStyles();
652 OUString GetUnusedPageStyleName();
653 css::uno::Reference<css::container::XNameContainer> const & GetCharacterStyles();
655 css::uno::Reference<css::text::XText> const & GetBodyText();
656 const css::uno::Reference<css::lang::XMultiServiceFactory>& GetTextFactory() const
657 {
658 return m_xTextFactory;
659 }
660 const css::uno::Reference<css::text::XTextDocument>& GetTextDocument() const
661 {
662 return m_xTextDocument;
663 }
664 void SetDocumentSettingsProperty( const OUString& rPropName, const css::uno::Any& rValue );
665
666 void CreateRedline(css::uno::Reference<css::text::XTextRange> const& xRange, const RedlineParamsPtr& pRedline);
667
668 void CheckParaMarkerRedline(css::uno::Reference<css::text::XTextRange> const& xRange);
669
670 void CheckRedline(css::uno::Reference<css::text::XTextRange> const& xRange);
671
672 void StartParaMarkerChange( );
673 void EndParaMarkerChange( );
674 void StartParaMarkerMove( );
675 void EndParaMarkerMove( );
676 void ChainTextFrames();
677
678 void PushTextBoxContent();
679 void PopTextBoxContent();
680 void AttachTextBoxContentToShape(css::uno::Reference<css::drawing::XShape> xShape);
681
684 void RemoveLastParagraph( );
686 void SetIsLastParagraphInSection( bool bIsLast );
688 void SetRubySprmId( sal_uInt32 nSprmId) { m_aRubyInfo.nSprmId = nSprmId ; }
689 void SetRubyText( OUString const &sText, OUString const &sStyle) {
690 m_aRubyInfo.sRubyText = sText;
691 m_aRubyInfo.sRubyStyle = sStyle;
692 }
693 const RubyInfo & GetRubyInfo() const { return m_aRubyInfo;}
694 void SetRubyInfo(const RubyInfo & rInfo) { m_aRubyInfo = rInfo;}
695
696 void SetIsLastSectionGroup( bool bIsLast );
698 void SetIsFirstParagraphInSection( bool bIsFirst );
699 void SetIsFirstParagraphInSectionAfterRedline( bool bIsFirstAfterRedline );
700 bool GetIsFirstParagraphInSection( bool bAfterRedline = false ) const;
701 void SetIsFirstParagraphInShape(bool bIsFirst);
703 void SetIsDummyParaAddedForTableInSection( bool bIsAdded );
707
709 void SetIsTextFrameInserted( bool bIsInserted );
711 void SetIsTextDeleted(bool bIsTextDeleted) { m_bTextDeleted = bIsTextDeleted; }
712
713 void SetIsPreviousParagraphFramed( bool bIsFramed ) { m_bIsPreviousParagraphFramed = bIsFramed; }
715 void SetParaSectpr(bool bParaSectpr);
716 bool GetParaSectpr() const { return m_bParaSectpr;}
717
718 void SetSymbolChar( sal_Int32 nSymbol) { m_aSymbolData.cSymbol = sal_Unicode(nSymbol); }
719 void SetSymbolFont( OUString const &rName ) { m_aSymbolData.sFont = rName; }
720 const SymbolData & GetSymbolData() const { return m_aSymbolData;}
721
723 void SetSdt(bool bSdt);
724
725 void PushSdt();
726 void PopSdt();
728 const std::stack<BookmarkInsertPosition>& GetSdtStarts() const;
729
731 bool GetSdt() const { return m_bSdt;}
732 bool GetParaChanged() const { return m_bParaChanged;}
733 bool GetParaHadField() const { return m_bParaHadField; }
735
736 void deferBreak( BreakType deferredBreakType );
737 bool isBreakDeferred( BreakType deferredBreakType );
738 void clearDeferredBreaks();
739 void clearDeferredBreak(BreakType deferredBreakType);
742
743 void setSdtEndDeferred(bool bSdtEndDeferred);
744 bool isSdtEndDeferred() const;
745 void setParaSdtEndDeferred(bool bParaSdtEndDeferred);
746 bool isParaSdtEndDeferred() const;
747
748 void finishParagraph( const PropertyMapPtr& pPropertyMap, const bool bRemove = false, const bool bNoNumbering = false);
749 void appendTextPortion( const OUString& rString, const PropertyMapPtr& pPropertyMap );
750 void appendTextContent(const css::uno::Reference<css::text::XTextContent>&, const css::uno::Sequence<css::beans::PropertyValue>&);
751 void appendOLE( const OUString& rStreamName, const std::shared_ptr<OLEHandler>& pOleHandler );
752 void appendStarMath( const Value& v);
753 void adjustLastPara(sal_Int8 nAlign);
754 css::uno::Reference<css::beans::XPropertySet> appendTextSectionAfter(css::uno::Reference<css::text::XTextRange> const & xBefore);
755
757 void appendGlossaryEntry();
759 void setGlossaryEntryStart( css::uno::Reference<css::text::XTextRange> const & xStart )
760 {
761 m_xGlossaryEntryStart = xStart;
762 }
763
764 // push the new properties onto the stack and make it the 'current' property map
765 void PushProperties(ContextType eId);
766 void PushStyleProperties(const PropertyMapPtr& pStyleProperties);
767 void PushListProperties(const PropertyMapPtr& pListProperties);
768 void PopProperties(ContextType eId);
769
772 {
773 return m_pTopContext;
774 }
776
777 bool HasTopText() const;
778 css::uno::Reference<css::text::XTextAppend> const & GetTopTextAppend();
780
781 bool HasTopAnchoredObjects() const;
782
784 {
785 if(!m_pFontTable)
786 m_pFontTable = new FontTable();
787 return m_pFontTable;
788 }
790 {
793 return m_pStyleSheetTable;
794 }
795 OUString GetListStyleName(sal_Int32 nListId);
797
798 std::unique_ptr<ThemeHandler> const& getThemeHandler()
799 {
801 {
802 m_pThemeHandler = std::make_unique<ThemeHandler>(m_pOOXMLDocument->getTheme(), GetSettingsTable()->GetThemeFontLangProperties());
803 }
804 return m_pThemeHandler;
805 }
806
808 {
809 if( !m_pSettingsTable )
811 return m_pSettingsTable;
812 }
813
815 void ResetGraphicImport();
816 // this method deletes the current m_pGraphicImport after import
818
819 void InitTabStopFromStyle(const css::uno::Sequence<css::style::TabStop>& rInitTabStops);
820 void IncorporateTabStop( const DeletableTabStop &aTabStop );
821 css::uno::Sequence<css::style::TabStop> GetCurrentTabStopAndClear();
822
823 void SetCurrentParaStyleName(const OUString& sStringValue) {m_sCurrentParaStyleName = sStringValue;}
824 OUString GetCurrentParaStyleName();
825 OUString GetDefaultParaStyleName();
826
827 // specified style - including inherited properties. Indicate whether paragraph defaults should be checked.
828 css::uno::Any GetPropertyFromStyleSheet(PropertyIds eId, StyleSheetEntryPtr pEntry, const bool bDocDefaults, const bool bPara, bool* bIsDocDefault = nullptr);
829 // current paragraph style - including inherited properties
831 // context's character style - including inherited properties
832 css::uno::Any GetPropertyFromCharStyleSheet(PropertyIds eId, const PropertyMapPtr& rContext);
833 // get property first from the given context, or secondly via inheritance from styles/docDefaults
834 css::uno::Any GetAnyProperty(PropertyIds eId, const PropertyMapPtr& rContext);
835 void SetDocDefaultsImport( bool bSet ) { m_bInDocDefaultsImport = bSet;}
837 void SetStyleSheetImport( bool bSet ) { m_bInStyleSheetImport = bSet;}
839 void SetNumberingImport( bool bSet ) { m_bInNumberingImport = bSet;}
841 void SetAnyTableImport( bool bSet ) { m_bInAnyTableImport = bSet;}
843 bool IsInShape()const { return m_aAnchoredStack.size() > 0;}
844
845 void PushShapeContext(const css::uno::Reference<css::drawing::XShape>& xShape);
846 void PopShapeContext();
847 void UpdateEmbeddedShapeProps(const css::uno::Reference<css::drawing::XShape>& xShape);
849 void PushPendingShape(const css::uno::Reference<css::drawing::XShape>& xShape);
851 css::uno::Reference<css::drawing::XShape> PopPendingShape();
852
855
856 void PopPageHeaderFooter();
858 void ConvertHeaderFooterToTextFrame(bool, bool);
859 static void fillEmptyFrameProperties(std::vector<css::beans::PropertyValue>& rFrameProperties, bool bSetAnchorToChar);
860
861 bool IsInTOC() const;
862
863 void PushFootOrEndnote( bool bIsFootnote );
864 void PopFootOrEndnote();
865 bool IsInFootOrEndnote() const { return m_bInFootOrEndnote; }
866 bool IsInFootnote() const { return IsInFootOrEndnote() && m_bInFootnote; }
867
868 void StartCustomFootnote(const PropertyMapPtr pContext);
869 void EndCustomFootnote();
872 void SetHasFootnoteStyle(bool bVal) { m_bHasFootnoteStyle = bVal; }
874
876
879 sal_Int32 GetFootnoteCount() const { return m_nFootnotes; }
881 sal_Int32 GetEndnoteCount() const { return m_nEndnotes; }
884 css::uno::Reference< css::text::XFootnote > xNoteSrc,
885 css::uno::Reference< css::text::XFootnote > xNoteDest );
887
888 void PushAnnotation();
889 void PopAnnotation();
890 sal_Int32 GetAnnotationId() { return m_nAnnotationId; }
891
893 void PushFieldContext();
894 //the current field context waits for the completion of the command
895 bool IsOpenFieldCommand() const;
896 bool IsOpenField() const;
897 //mark field in current context as locked (fixed)
898 void SetFieldLocked();
899 //collect the pieces of the command
900 void AppendFieldCommand(OUString const & rPartOfCommand);
901 void handleRubyEQField( const FieldContextPtr& pContext);
902 void handleFieldSet
903 (const FieldContextPtr& pContext,
904 css::uno::Reference< css::uno::XInterface > const & xFieldInterface,
905 css::uno::Reference< css::beans::XPropertySet > const& xFieldProperties);
906 void handleFieldAsk
907 (const FieldContextPtr& pContext,
908 css::uno::Reference< css::uno::XInterface > & xFieldInterface,
909 css::uno::Reference< css::beans::XPropertySet > const& xFieldProperties);
910 OUString convertFieldFormula(const OUString& input);
912 (const FieldContextPtr& pContext,
913 css::uno::Reference< css::beans::XPropertySet > const& xFieldProperties);
914 void handleAutoNum
915 (const FieldContextPtr& pContext,
916 css::uno::Reference< css::uno::XInterface > const & xFieldInterface,
917 css::uno::Reference< css::beans::XPropertySet > const& xFieldProperties);
918 static void handleAuthor
919 (std::u16string_view rFirstParam,
920 css::uno::Reference< css::beans::XPropertySet > const& xFieldProperties,
923 (const FieldContextPtr& pContext,
924 OUString const& rFirstParam,
925 css::uno::Reference< css::uno::XInterface > & xFieldInterface);
926 void handleToc
927 (const FieldContextPtr& pContext,
928 const OUString & sTOCServiceName);
929 void handleIndex
930 (const FieldContextPtr& pContext,
931 const OUString & sTOCServiceName);
932
934 (const FieldContextPtr& pContext,
935 const OUString & sTOCServiceName);
937 void CloseFieldCommand();
938 //the _current_ fields require a string type result while TOCs accept richt results
940 void AppendFieldResult(std::u16string_view rResult);
941 //apply the result text to the related field
942 void SetFieldResult(OUString const& rResult);
943 // set FFData of top field context
944 void SetFieldFFData( const FFDataHandler::Pointer_t& pFFDataHandler );
946 void PopFieldContext();
947
949 OUString extractTocTitle();
950 css::uno::Reference<css::beans::XPropertySet> createSectionForRange(css::uno::Reference< css::text::XTextRange > xStart, css::uno::Reference< css::text::XTextRange > xEnd, const OUString & sObjectType, bool stepLeft);
951
952 void SetBookmarkName( const OUString& rBookmarkName );
953 void StartOrEndBookmark( const OUString& rId );
954
955 void SetMoveBookmark( bool IsFrom );
956
957 void setPermissionRangeEd(const OUString& user);
958 void setPermissionRangeEdGrp(const OUString& group);
959 void startOrEndPermissionRange(sal_Int32 permissinId);
960
962 const bool bStart,
963 const sal_Int32 nAnnotationId );
964
965 bool hasTableManager() const
966 {
967 return !m_aTableManagers.empty();
968 }
969
971 {
972 return *m_aTableManagers.top();
973 }
974
976 {
978 m_aTableManagers.push( pMngr );
979 }
980
982 {
983 if (m_pTableHandler)
984 m_aTableManagers.top()->setHandler(m_pTableHandler);
985 }
986
988 {
989 if (hasTableManager())
990 m_aTableManagers.pop();
991 }
992
993 void SetLineNumbering( sal_Int32 nLnnMod, sal_uInt32 nLnc, sal_Int32 ndxaLnn );
995
997
999
1001
1003 void SetPageMarginTwip( PageMarElement eElement, sal_Int32 nValue );
1004 const PageMar& GetPageMargins() const {return m_aPageMargins;}
1005
1008
1011
1012 bool IsInComments() const { return m_bIsInComments; };
1013
1014 std::vector<css::beans::PropertyValue> MakeFrameProperties(const ParagraphProperties& rProps);
1015 void CheckUnregisteredFrameConversion(bool bPreventOverlap = false);
1016
1017 void RegisterFrameConversion(css::uno::Reference<css::text::XTextRange> const& xFrameStartRange,
1018 css::uno::Reference<css::text::XTextRange> const& xFrameEndRange,
1019 std::vector<css::beans::PropertyValue>&& aFrameProperties);
1021
1022 void AddNewRedline( sal_uInt32 sprmId );
1023
1024 sal_Int32 GetCurrentRedlineToken( ) const;
1025 void SetCurrentRedlineAuthor( const OUString& sAuthor );
1026 void SetCurrentRedlineDate( const OUString& sDate );
1027 void SetCurrentRedlineId( sal_Int32 nId );
1028 void SetCurrentRedlineToken( sal_Int32 nToken );
1029 void SetCurrentRedlineRevertProperties( const css::uno::Sequence<css::beans::PropertyValue>& aProperties );
1031 void RemoveTopRedline( );
1032 void SetCurrentRedlineInitials( const OUString& sInitials );
1033 bool IsFirstRun() const { return m_bIsFirstRun;}
1034 void SetIsFirstRun(bool bval) { m_bIsFirstRun = bval;}
1037
1038 void ApplySettingsTable();
1039
1040 css::uno::Reference<css::text::XTextAppend> GetCurrentXText() {
1041 return m_aTextAppendStack.empty() ? nullptr : m_aTextAppendStack.top().xTextAppend;
1042 }
1043
1045 m_aFrameDirectionQueue.push(std::nullopt);
1046 m_bFrameDirectionSet = false;
1047 }
1048 void SetFrameDirection(sal_Int16 nDirection) {
1050 m_aFrameDirectionQueue.back() = nDirection;
1051 m_bFrameDirectionSet = true;
1052 }
1053 }
1054 std::optional<sal_Int16> PopFrameDirection() {
1055 if (m_aFrameDirectionQueue.empty())
1056 return {};
1057 const std::optional<sal_Int16> nDirection = m_aFrameDirectionQueue.front();
1059 return nDirection;
1060 }
1061
1063
1064 sal_Int16 GetListLevel(const StyleSheetEntryPtr& pEntry, const PropertyMapPtr& pParaContext = nullptr);
1065 void ValidateListLevel(const OUString& sStyleIdentifierD);
1066
1072 void deferCharacterProperty(sal_Int32 id, const css::uno::Any& value);
1077 void processDeferredCharacterProperties(bool bCharContext = true);
1078
1079 sal_Int32 getNumberingProperty(const sal_Int32 nListId, sal_Int32 nListLevel, const OUString& aProp);
1081 sal_Int32 getCurrentNumberingProperty(const OUString& aProp);
1082
1084 bool IsNewDoc() const { return m_bIsNewDoc;}
1085
1086 bool IsAltChunk() const { return m_bIsAltChunk;}
1087
1090
1092
1094 std::optional<sal_Int32> m_oBackgroundColor;
1095
1103 sal_Int32 m_nTableDepth;
1108
1113
1117
1119 std::vector<AnchoredObjectsInfo> m_aAnchoredObjectAnchors;
1120
1122 void appendGrabBag(std::vector<css::beans::PropertyValue>& rInteropGrabBag, const OUString& aKey, const OUString& aValue);
1123 void appendGrabBag(std::vector<css::beans::PropertyValue>& rInteropGrabBag, const OUString& aKey, std::vector<css::beans::PropertyValue>& rValue);
1124
1126 void enableInteropGrabBag(const OUString& aName);
1127 void disableInteropGrabBag();
1128 bool isInteropGrabBagEnabled() const;
1129
1132
1134 std::vector<css::beans::PropertyValue> m_aInteropGrabBag;
1135
1137 std::vector<css::beans::PropertyValue> m_aSubInteropGrabBag;
1138
1140 std::pair<OUString, OUString> m_aPositionOffsets;
1142 std::pair<OUString, OUString> m_aAligns;
1144 std::queue<OUString> m_aPositivePercentages;
1146 bool isInIndexContext() const { return m_bStartIndex;}
1149
1151
1154
1156 bool IsSdtEndBefore();
1157
1158 bool IsDiscardHeaderFooter() const;
1159
1161
1162 void SetParaAutoBefore(bool bParaAutoBefore) { m_bParaAutoBefore = bParaAutoBefore; }
1163
1167
1170
1174 std::deque<css::uno::Any> m_aStoredRedlines[StoredRedlines::NONE];
1175
1177
1178 css::uno::Reference< css::embed::XStorage > m_xDocumentStorage;
1179
1181 void HandleAltChunk(const OUString& rStreamName);
1182
1184 void HandlePTab(sal_Int32 nAlignment);
1185
1187 void HandleLineBreakClear(sal_Int32 nClear);
1188
1190 void HandleLineBreak(const PropertyMapPtr& pPropertyMap);
1191
1192 void commentProps(const OUString& sId, const CommentProperties& rProps);
1193
1194 OUString ConvertTOCStyleName(OUString const&);
1195
1196 OUString getFontNameForTheme(const Id id);
1197
1198private:
1199 void PushPageHeaderFooter(bool bHeader, SectionPropertyMap::PageType eType);
1200 // Start a new index section; if needed, finish current paragraph
1201 css::uno::Reference<css::beans::XPropertySet> StartIndexSectionChecked(const OUString& sServiceName);
1202 std::vector<css::uno::Reference< css::drawing::XShape > > m_vTextFramesForChaining ;
1206 css::uno::Reference<css::beans::XPropertySet> m_xPreviousParagraph;
1216
1217 std::unordered_map<OUString, CommentProperties> m_aCommentProps;
1218};
1219
1220TextAppendContext::TextAppendContext(css::uno::Reference<css::text::XTextAppend> xAppend, const css::uno::Reference<css::text::XTextCursor>& xCur)
1221 : xTextAppend(std::move(xAppend))
1222{
1223 xCursor.set(xCur, css::uno::UNO_QUERY);
1225}
1226
1227} //namespace writerfilter::dmapper
1228
1229/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FieldId eFieldId
constexpr sal_Int8 header[]
T * get() const
css::uno::Reference< css::text::XTextAppend > GetCurrentXText()
css::uno::Reference< css::container::XNameContainer > m_xCharacterStyles
void SetLineNumbering(sal_Int32 nLnnMod, sal_uInt32 nLnc, sal_Int32 ndxaLnn)
sal_Int32 getCurrentNumberingProperty(const OUString &aProp)
Get a property of the current numbering style's current level.
void handleRubyEQField(const FieldContextPtr &pContext)
std::queue< std::optional< sal_Int16 > > m_aFrameDirectionQueue
bool m_bParaAutoBefore
Current paragraph has automatic before spacing.
std::vector< css::beans::PropertyValue > m_aFrameProperties
css::uno::Reference< css::text::XTextDocument > m_xTextDocument
void SetNumberFormat(const OUString &rCommand, css::uno::Reference< css::beans::XPropertySet > const &xPropertySet, bool bDetectFormat=false)
std::vector< css::beans::PropertyValue > m_aInteropGrabBag
A toplevel dmapper grabbag, like 'pPr'.
void commentProps(const OUString &sId, const CommentProperties &rProps)
void SetPageMarginTwip(PageMarElement eElement, sal_Int32 nValue)
void SetDocumentSettingsProperty(const OUString &rPropName, const css::uno::Any &rValue)
css::uno::Reference< css::lang::XMultiServiceFactory > m_xTextFactory
css::uno::Reference< css::drawing::XShape > PopPendingShape()
Get the first pending shape, if there are any.
void SetRubyText(OUString const &sText, OUString const &sStyle)
bool handlePreviousParagraphBorderInBetween() const
Check if previous paragraph has borders in between and do the border magic to it if so.
bool m_bIsSplitPara
If the document needs to split paragraph.
void appendTextContent(const css::uno::Reference< css::text::XTextContent > &, const css::uno::Sequence< css::beans::PropertyValue > &)
bool isBreakDeferred(BreakType deferredBreakType)
void RegisterFrameConversion(css::uno::Reference< css::text::XTextRange > const &xFrameStartRange, css::uno::Reference< css::text::XTextRange > const &xFrameEndRange, std::vector< css::beans::PropertyValue > &&aFrameProperties)
void HandleLineBreak(const PropertyMapPtr &pPropertyMap)
Handles <w:br>.
void setPermissionRangeEdGrp(const OUString &group)
bool IsSdtEndBefore()
Check if "SdtEndBefore" property is set.
std::optional< sal_Int16 > PopFrameDirection()
void HandlePTab(sal_Int32 nAlignment)
Handles <w:ptab>.
OUString GetListStyleName(sal_Int32 nListId)
ListsManager::Pointer const & GetListTable()
void InitTabStopFromStyle(const css::uno::Sequence< css::style::TabStop > &rInitTabStops)
std::stack< HeaderFooterContext > m_aHeaderFooterStack
std::queue< OUString > m_aPositivePercentages
ST_PositivePercentage values we received.
std::stack< std::vector< RedlineParamsPtr > > m_aRedlines
bool m_bSdt
If the current paragraph is inside a structured document element.
bool m_bFirstParagraphInCell
Current paragraph in a table is first paragraph of a cell.
std::unordered_map< sal_Int32, AnnotationPosition > m_aAnnotationPositions
OUString ConvertTOCStyleName(OUString const &)
void IncorporateTabStop(const DeletableTabStop &aTabStop)
const std::stack< BookmarkInsertPosition > & GetSdtStarts() const
Gives access to the currently open run/inline SDTs.
sal_Int16 GetListLevel(const StyleSheetEntryPtr &pEntry, const PropertyMapPtr &pParaContext=nullptr)
Return the paragraph's list level (from styles, unless pParacontext is provided).
void CheckParaMarkerRedline(css::uno::Reference< css::text::XTextRange > const &xRange)
css::uno::Reference< css::text::XTextRange > m_xSdtEntryStart
void ValidateListLevel(const OUString &sStyleIdentifierD)
void SetCurrentRedlineInitials(const OUString &sInitials)
PropertyMapPtr GetTopContextOfType(ContextType eId)
void SetFieldResult(OUString const &rResult)
void handleFieldFormula(const FieldContextPtr &pContext, css::uno::Reference< css::beans::XPropertySet > const &xFieldProperties)
void enableInteropGrabBag(const OUString &aName)
Enable, disable and check status of grabbags.
writerfilter::ooxml::OOXMLDocument * getDocumentReference() const
enum writerfilter::dmapper::DomainMapper_Impl::HeaderFooterImportState m_eInHeaderFooterImport
OUString m_aInteropGrabBagName
Name of m_aInteropGrabBag.
std::deque< FieldContextPtr > m_aFieldStack
std::unordered_map< OUString, CommentProperties > m_aCommentProps
void deferBreak(BreakType deferredBreakType)
css::uno::Reference< css::text::XText > m_xBodyText
const css::uno::Reference< css::text::XTextDocument > & GetTextDocument() const
static void fillEmptyFrameProperties(std::vector< css::beans::PropertyValue > &rFrameProperties, bool bSetAnchorToChar)
std::unique_ptr< ThemeHandler > m_pThemeHandler
std::stack< PropertyMapPtr > m_aPropertyStacks[NUMBER_OF_CONTEXTS]
void SetSdt(bool bSdt)
Setter method for m_bSdt.
std::stack< BookmarkInsertPosition > m_xSdtStarts
const css::uno::Reference< css::lang::XMultiServiceFactory > & GetTextFactory() const
bool m_bParaChanged
If the current paragraph has any runs.
void CreateRedline(css::uno::Reference< css::text::XTextRange > const &xRange, const RedlineParamsPtr &pRedline)
bool m_bHasFtnSep
If the current section has a footnote separator.
void HandleLineBreakClear(sal_Int32 nClear)
Handles <w:br w:clear="...">.
void appendGrabBag(std::vector< css::beans::PropertyValue > &rInteropGrabBag, const OUString &aKey, const OUString &aValue)
Append a property to a sub-grabbag if necessary (e.g. 'lineRule', 'auto')
css::uno::Reference< css::beans::XPropertySet > m_xPreviousParagraph
sal_Int32 m_nTableDepth
This contains the raw table depth.
void CheckRedline(css::uno::Reference< css::text::XTextRange > const &xRange)
void SetIsDummyParaAddedForTableInSectionPage(bool bIsAdded)
void SetIsTextFrameInserted(bool bIsInserted)
Track if a textframe has been inserted into this section.
css::uno::Reference< css::text::XTextRange > m_xGlossaryEntryStart
bool m_bSdtEndDeferred
If we want to set "sdt end" on the next character context.
o3tl::sorted_vector< sal_Int32 > m_aListOverrideApplied
std::stack< std::pair< TextAppendContext, bool > > m_aHeaderFooterTextAppendStack
const LineNumberSettings & GetLineNumberSettings() const
std::deque< css::uno::Reference< css::drawing::XShape > > m_aPendingShapes
void handleFieldAsk(const FieldContextPtr &pContext, css::uno::Reference< css::uno::XInterface > &xFieldInterface, css::uno::Reference< css::beans::XPropertySet > const &xFieldProperties)
void PushPageFooter(SectionPropertyMap::PageType eType)
css::uno::Any GetPropertyFromStyleSheet(PropertyIds eId, StyleSheetEntryPtr pEntry, const bool bDocDefaults, const bool bPara, bool *bIsDocDefault=nullptr)
void PushListProperties(const PropertyMapPtr &pListProperties)
void SetCurrentRedlineRevertProperties(const css::uno::Sequence< css::beans::PropertyValue > &aProperties)
void deferCharacterProperty(sal_Int32 id, const css::uno::Any &value)
Used for attributes/sprms which cannot be evaluated immediately (e.g.
std::vector< css::beans::PropertyValue > MakeFrameProperties(const ParagraphProperties &rProps)
css::uno::Reference< css::embed::XStorage > m_xDocumentStorage
SkipFootnoteSeparator m_eSkipFootnoteState
Skip paragraphs from the <w:separator/> footnote.
void AttachTextBoxContentToShape(css::uno::Reference< css::drawing::XShape > xShape)
bool m_bParaSdtEndDeferred
If we want to set "paragraph sdt end" on the next paragraph context.
css::uno::Sequence< css::style::TabStop > GetCurrentTabStopAndClear()
void setPermissionRangeEd(const OUString &user)
css::uno::Reference< css::beans::XPropertySet > StartIndexSectionChecked(const OUString &sServiceName)
static void handleAuthor(std::u16string_view rFirstParam, css::uno::Reference< css::beans::XPropertySet > const &xFieldProperties, FieldId eFieldId)
::std::vector< DeletableTabStop > m_aCurrentTabStops
void AppendFieldCommand(OUString const &rPartOfCommand)
std::vector< css::beans::PropertyValue > m_aSubInteropGrabBag
A sub-grabbag of m_aInteropGrabBag, like 'spacing'.
css::uno::Reference< css::container::XNameContainer > const & GetCharacterStyles()
bool GetSdt() const
Getter method for m_bSdt.
DomainMapper_Impl(DomainMapper &rDMapper, css::uno::Reference< css::uno::XComponentContext > xContext, css::uno::Reference< css::lang::XComponent > const &xModel, SourceDocumentType eDocumentType, utl::MediaDescriptor const &rMediaDesc)
DomainMapperTableManager & getTableManager()
void StartCustomFootnote(const PropertyMapPtr pContext)
std::optional< sal_Int32 > m_oBackgroundColor
Document background color, applied to every page style.
css::uno::Reference< css::beans::XPropertySet > FindOrCreateFieldMaster(const char *pFieldMasterService, const OUString &rFieldMasterName)
const PropertyMapPtr & GetTopContext() const
void PopFieldContext()
The end of field is reached (cFieldEnd appeared) - the command might still be open.
css::uno::Reference< css::beans::XPropertySet > appendTextSectionAfter(css::uno::Reference< css::text::XTextRange > const &xBefore)
void PushPendingShape(const css::uno::Reference< css::drawing::XShape > &xShape)
Add a pending shape: it's currently inserted into the document, but it should be removed before the i...
void SetIsFirstParagraphInSectionAfterRedline(bool bIsFirstAfterRedline)
bool IsNewDoc() const
If we're importing into a new document, or just pasting to an existing one.
bool GetIsFirstParagraphInSection(bool bAfterRedline=false) const
void PushStyleProperties(const PropertyMapPtr &pStyleProperties)
void handleBibliography(const FieldContextPtr &pContext, const OUString &sTOCServiceName)
css::uno::Reference< css::text::XText > const & GetBodyText()
void handleFieldSet(const FieldContextPtr &pContext, css::uno::Reference< css::uno::XInterface > const &xFieldInterface, css::uno::Reference< css::beans::XPropertySet > const &xFieldProperties)
bool m_bIsActualParagraphFramed
Handle redline text portions in a frame, footnotes and redlines: store their data,...
css::uno::Reference< css::text::XTextAppend > const & GetTopTextAppend()
sal_Int32 m_nTableCellDepth
Raw table cell depth.
std::map< sal_Int32, css::uno::Any > m_deferredCharacterProperties
css::uno::Any GetPropertyFromParaStyleSheet(PropertyIds eId)
void AppendFieldResult(std::u16string_view rResult)
void SetCurrentRedlineAuthor(const OUString &sAuthor)
std::optional< sal_Int16 > m_oLineBreakClear
void CheckUnregisteredFrameConversion(bool bPreventOverlap=false)
void substream(Id rName, ::writerfilter::Reference< Stream >::Pointer_t const &ref)
std::vector< AnchoredObjectsInfo > m_aAnchoredObjectAnchors
Paragraphs with anchored objects in the current section.
std::deque< css::uno::Any > m_aStoredRedlines[StoredRedlines::NONE]
css::uno::Reference< css::text::XTextRange > m_xInsertTextRange
void PushPageHeaderFooter(bool bHeader, SectionPropertyMap::PageType eType)
css::uno::Reference< css::beans::XPropertySet > m_xDocumentSettings
css::uno::Reference< css::beans::XPropertySet > m_xAnnotationField
void PushShapeContext(const css::uno::Reference< css::drawing::XShape > &xShape)
std::pair< OUString, OUString > m_aAligns
ST_AlignH/V values we received.
std::pair< OUString, OUString > m_aPositionOffsets
ST_PositionOffset values we received.
std::unique_ptr< ThemeHandler > const & getThemeHandler()
std::stack< tools::SvRef< DomainMapperTableManager > > m_aTableManagers
bool m_bStartedTOC
If we got any text that is the pre-rendered result of the TOC field.
void handleToc(const FieldContextPtr &pContext, const OUString &sTOCServiceName)
void PushFieldContext()
A field context starts with a cFieldStart.
css::uno::Any GetPropertyFromCharStyleSheet(PropertyIds eId, const PropertyMapPtr &rContext)
std::map< sal_Int32, PermInsertPosition > PermMap_t
void appendOLE(const OUString &rStreamName, const std::shared_ptr< OLEHandler > &pOleHandler)
void appendTextPortion(const OUString &rString, const PropertyMapPtr &pPropertyMap)
css::uno::Reference< css::text::XTextCursor > m_xTOCMarkerCursor
void SetCurrentParaStyleName(const OUString &sStringValue)
void appendGlossaryEntry()
AutoText import: each entry is placed in the separate section.
css::uno::Any GetAnyProperty(PropertyIds eId, const PropertyMapPtr &rContext)
sal_Int32 m_nFootnotes
preload footnotes and endnotes
void AddAnnotationPosition(const bool bStart, const sal_Int32 nAnnotationId)
void handleIndex(const FieldContextPtr &pContext, const OUString &sTOCServiceName)
css::uno::Reference< css::text::XTextContent > m_xEmbedded
std::vector< css::uno::Reference< css::drawing::XShape > > m_vTextFramesForChaining
css::uno::Reference< css::container::XNameContainer > const & GetPageStyles()
bool CopyTemporaryNotes(css::uno::Reference< css::text::XFootnote > xNoteSrc, css::uno::Reference< css::text::XFootnote > xNoteDest)
void startOrEndPermissionRange(sal_Int32 permissinId)
void handleAutoNum(const FieldContextPtr &pContext, css::uno::Reference< css::uno::XInterface > const &xFieldInterface, css::uno::Reference< css::beans::XPropertySet > const &xFieldProperties)
void setDocumentReference(writerfilter::ooxml::OOXMLDocument *pDocument)
void SetFieldFFData(const FFDataHandler::Pointer_t &pFFDataHandler)
void processDeferredCharacterProperties(bool bCharContext=true)
Processes properties deferred using deferCharacterProperty().
bool m_bHasFtn
If the current section has footnotes.
bool m_bParaSectpr
If the current paragraph contains section property definitions.
bool m_bParaWithInlineObject
Current paragraph had at least one inline object in it.
std::stack< TextAppendContext > m_aTextAppendStack
void UpdateEmbeddedShapeProps(const css::uno::Reference< css::drawing::XShape > &xShape)
css::uno::Reference< css::text::XTextRange > m_xFrameStartRange
void setGlossaryEntryStart(css::uno::Reference< css::text::XTextRange > const &xStart)
Remember where entry was started.
css::uno::Reference< css::text::XTextRange > m_xFrameEndRange
void appendGrabBag(std::vector< css::beans::PropertyValue > &rInteropGrabBag, const OUString &aKey, std::vector< css::beans::PropertyValue > &rValue)
bool m_bIsDecimalComma
Type of decimal symbol associated to the document language in Writer locale definition.
void finishParagraph(const PropertyMapPtr &pPropertyMap, const bool bRemove=false, const bool bNoNumbering=false)
void PushPageHeader(SectionPropertyMap::PageType eType)
OUString convertFieldFormula(const OUString &input)
Converts a Microsoft Word field formula into LibreOffice syntax.
StyleSheetTablePtr const & GetStyleSheetTable()
tools::SvRef< DomainMapperTableHandler > m_pTableHandler
OUString extractTocTitle()
Returns title of the TOC placed in paragraph(s) before TOC field inside STD-frame.
std::queue< css::uno::Reference< css::text::XTextFrame > > m_xPendingTextBoxFrames
sal_Int32 getNumberingProperty(const sal_Int32 nListId, sal_Int32 nListLevel, const OUString &aProp)
void clearDeferredBreak(BreakType deferredBreakType)
css::uno::Reference< css::beans::XPropertySet > const & GetDocumentSettings()
sal_Int32 m_nLastTableCellParagraphDepth
Table cell depth of the last finished paragraph.
void ImportGraphic(const writerfilter::Reference< Properties >::Pointer_t &)
bool m_bSaxError
SAXException was seen so document will be abandoned.
std::map< OUString, BookmarkInsertPosition > BookmarkMap_t
css::uno::Reference< css::text::XTextRange > m_xAltChunkStartingRange
SkipFootnoteSeparator GetSkipFootnoteState() const
bool m_bRemoveThisParagraph
This is a continuation of already finished paragraph - e.g., first in an index section.
bool IsReadGlossaries() const
If we're importing autotext.
void SetSkipFootnoteState(SkipFootnoteSeparator eId)
void handleDocProperty(const FieldContextPtr &pContext, OUString const &rFirstParam, css::uno::Reference< css::uno::XInterface > &xFieldInterface)
bool m_bCheckFirstFootnoteTab
If the next tab should be ignored, used for footnotes.
void HandleAltChunk(const OUString &rStreamName)
Handles <w:altChunk>.
bool m_bParaHadField
Current paragraph had at least one field in it.
writerfilter::ooxml::OOXMLDocument * m_pOOXMLDocument
css::uno::Reference< css::container::XNameContainer > m_xPageStyles1
const PropertyMapPtr & GetFootnoteContext() const
void SetCurrentRedlineDate(const OUString &sDate)
void SetBookmarkName(const OUString &rBookmarkName)
void setParaSdtEndDeferred(bool bParaSdtEndDeferred)
void ClearPreviousParagraph()
Forget about the previous paragraph, as it's not inside the same start/end node.
void SetLineNumberSettings(const LineNumberSettings &rSet)
void CloseFieldCommand()
The field command has to be closed (cFieldSep appeared).
std::stack< AnchoredContext > m_aAnchoredStack
css::uno::Reference< css::beans::XPropertySet > createSectionForRange(css::uno::Reference< css::text::XTextRange > xStart, css::uno::Reference< css::text::XTextRange > xEnd, const OUString &sObjectType, bool stepLeft)
css::uno::Reference< css::uno::XComponentContext > m_xComponentContext
void SetFormField(css::uno::Reference< css::text::XFormField > const &xFormField)
std::vector< FieldParagraph > & GetParagraphsToFinish()
FieldContext(css::uno::Reference< css::text::XTextRange > xStart)
const OUString & GetHyperlinkTarget() const
const css::uno::Reference< css::text::XFormField > & GetFormField() const
FFDataHandler::Pointer_t m_pFFDataHandler
void AppendCommand(std::u16string_view rPart)
OUString m_sHyperlinkTarget
A frame for the hyperlink when one exists.
const FFDataHandler::Pointer_t & getFFDataHandler() const
const css::uno::Reference< css::text::XTextRange > & GetStartRange() const
void setFFDataHandler(FFDataHandler::Pointer_t pFFDataHandler)
std::optional< FieldId > const & GetFieldId() const
css::uno::Reference< css::text::XTextRange > m_xStartRange
void AppendResult(std::u16string_view rResult)
void SetCustomField(css::uno::Reference< css::beans::XPropertySet > const &xCustomField)
css::uno::Reference< css::text::XTextField > m_xTextField
void SetTC(css::uno::Reference< css::beans::XPropertySet > const &xTC)
PropertyMapPtr m_pProperties
(Character) properties of the field itself.
void setFormControlHelper(FormControlHelper::Pointer_t pFormControlHelper)
FormControlHelper::Pointer_t m_pFormControlHelper
::std::vector< OUString > GetCommandParts() const
void SetHyperlinkURL(const OUString &rURL)
const css::uno::Reference< css::text::XTextField > & GetTextField() const
const FormControlHelper::Pointer_t & getFormControlHelper() const
std::vector< FieldParagraph > m_aParagraphsToFinish
void SetHyperlinkTarget(const OUString &rTarget)
void SetTOC(css::uno::Reference< css::beans::XPropertySet > const &xTOC)
const css::uno::Reference< css::beans::XPropertySet > & GetCustomField() const
const css::uno::Reference< css::beans::XPropertySet > & GetTOC() const
css::uno::Reference< css::beans::XPropertySet > m_xCustomField
css::uno::Reference< css::beans::XPropertySet > m_xTOC
css::uno::Reference< css::text::XFormField > m_xFormField
void CacheVariableValue(const css::uno::Any &rAny)
const css::uno::Reference< css::beans::XPropertySet > & GetTC() const
void SetTextField(css::uno::Reference< css::text::XTextField > const &xTextField)
const OUString & GetHyperlinkURL() const
const PropertyMapPtr & getProperties() const
css::uno::Reference< css::beans::XPropertySet > m_xTC
Storage for state that is relevant outside a header/footer, but not inside it.
HeaderFooterContext(bool bTextInserted, sal_Int32 nTableDepth)
Handler for smart tags, i.e. <w:smartTag> and below.
virtual const oox::drawingml::ThemePtr & getTheme() const =0
FilterGroup & rTarget
def text(shape, orig_st)
class SAL_NO_VTABLE XPropertySet
none
tools::SvRef< FieldContext > FieldContextPtr
SkipFootnoteSeparator
Two special footnotes are a separator line, and a continuation line.
ContextType
property stack element
sal_uInt32 Id
static SfxItemSet & rSet
A container for the extended comment properties linked to the last paragraph of a comment.
AnchoredContext(css::uno::Reference< css::text::XTextContent > xContent)
css::uno::Reference< css::text::XTextContent > xTextContent
Stores original/in-file-format info about a single anchored object.
css::uno::Reference< css::text::XTextContent > m_xAnchoredObject
Stores info about objects anchored to a given paragraph.
std::vector< AnchoredObjectInfo > m_aAnchoredObjects
css::uno::Reference< css::text::XTextRange > m_xParagraph
Stores the start/end positions of an annotation before its insertion.
css::uno::Reference< css::text::XTextRange > m_xEnd
css::uno::Reference< css::text::XTextRange > m_xStart
helper to remember bookmark start position
BookmarkInsertPosition(bool bIsStartOfText, OUString rName, css::uno::Reference< css::text::XTextRange > xTextRange)
css::uno::Reference< css::text::XTextRange > m_xTextRange
DeletableTabStop(const css::style::TabStop &rTabStop)
Information about a paragraph to be finished after a field end.
css::uno::Reference< css::text::XTextRange > m_xTextRange
PermInsertPosition(bool bIsStartOfText, sal_Int32 id, OUString ed, OUString edGrp, css::uno::Reference< css::text::XTextRange > xTextRange)
css::uno::Reference< css::text::XTextRange > xInsertPosition
std::vector< AnchoredObjectInfo > m_aAnchoredObjects
Objects anchored to the current paragraph, may affect the paragraph spacing.
TextAppendContext(css::uno::Reference< css::text::XTextAppend > xAppend, const css::uno::Reference< css::text::XTextCursor > &xCur)
css::uno::Reference< css::text::XTextAppend > xTextAppend
css::uno::Reference< css::text::XParagraphCursor > xCursor
ON
sal_uInt16 sal_Unicode
signed char sal_Int8