LibreOffice Module writerfilter (master) 1
OOXMLParserState.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 <stack>
22#include "OOXMLDocumentImpl.hxx"
23#include "OOXMLPropertySet.hxx"
24
25namespace writerfilter::ooxml
26{
34{
37};
38
39class OOXMLParserState final : public virtual SvRefBase
40{
46 unsigned int mnContexts;
47 unsigned int mnHandle;
50 std::stack<OOXMLPropertySet::Pointer_t> mCellProps;
51 std::stack<OOXMLPropertySet::Pointer_t> mRowProps;
52 std::stack<OOXMLPropertySet::Pointer_t> mTableProps;
54 // these 4 save when inTxbxContent
58 std::vector<SavedAlternateState> maSavedAlternateStates;
59 std::vector<OOXMLPropertySet::Pointer_t> mvPostponedBreaks;
63
64public:
66
68 ~OOXMLParserState() override;
69
70 bool isInSectionGroup() const { return mbInSectionGroup; }
71 void setInSectionGroup(bool bInSectionGroup);
72
73 void setLastParagraphInSection(bool bLastParagraphInSection);
75
76 std::vector<SavedAlternateState>& getSavedAlternateStates() { return maSavedAlternateStates; }
77
78 bool isInParagraphGroup() const { return mbInParagraphGroup; }
79 void setInParagraphGroup(bool bInParagraphGroup);
80
81 bool isInCharacterGroup() const { return mbInCharacterGroup; }
82 void setInCharacterGroup(bool bInCharacterGroup);
83
84 void setForwardEvents(bool bForwardEvents);
85 bool isForwardEvents() const { return mbForwardEvents; }
86
87 std::string getHandle() const;
88 void setHandle();
89
90 void setDocument(OOXMLDocumentImpl* pDocument);
92
93 void setXNoteId(const sal_Int32 rId);
94 sal_Int32 getXNoteId() const;
95
96 const OUString& getTarget() const;
97
100 void resolveCellProperties(Stream& rStream);
102 void resolveRowProperties(Stream& rStream);
104 void resolveTableProperties(Stream& rStream);
107 // tdf#108714
108 void resolvePostponedBreak(Stream& rStream);
110
111 void startTable();
112 void endTable();
113
114 void incContextCount();
115
116 void startTxbxContent();
117 void endTxbxContent();
118
119 void setStartFootnote(bool bStartFootnote);
120 bool isStartFootnote() const { return mbStartFootnote; }
121
122 void SetFloatingTableEnded(bool bFloatingTableEnded)
123 {
124 m_bFloatingTableEnded = bFloatingTableEnded;
125 }
127};
128}
129
130/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Handler for a stream.
void setPostponedBreak(const OOXMLPropertySet::Pointer_t &pProps)
std::stack< OOXMLPropertySet::Pointer_t > mTableProps
bool m_bFloatingTableEnded
We just ended a floating table. Starting a paragraph or table resets this.
tools::SvRef< OOXMLParserState > Pointer_t
void setXNoteId(const sal_Int32 rId)
void setInSectionGroup(bool bInSectionGroup)
OOXMLPropertySet::Pointer_t mpCharacterProps
void resolveCharacterProperties(Stream &rStream)
void setForwardEvents(bool bForwardEvents)
void setLastParagraphInSection(bool bLastParagraphInSection)
void setRowProperties(const OOXMLPropertySet::Pointer_t &pProps)
OOXMLPropertySet::Pointer_t GetTableProperties() const
void setInCharacterGroup(bool bInCharacterGroup)
std::stack< OOXMLPropertySet::Pointer_t > mCellProps
void setDocument(OOXMLDocumentImpl *pDocument)
void setInParagraphGroup(bool bInParagraphGroup)
std::vector< OOXMLPropertySet::Pointer_t > mvPostponedBreaks
std::stack< OOXMLPropertySet::Pointer_t > mRowProps
void SetFloatingTableEnded(bool bFloatingTableEnded)
OOXMLDocumentImpl * getDocument() const
std::vector< SavedAlternateState > maSavedAlternateStates
void setCellProperties(const OOXMLPropertySet::Pointer_t &pProps)
void setTableProperties(const OOXMLPropertySet::Pointer_t &pProps)
void setStartFootnote(bool bStartFootnote)
std::vector< SavedAlternateState > & getSavedAlternateStates()
void setCharacterProperties(const OOXMLPropertySet::Pointer_t &pProps)
Struct to store our 'alternate state'.
bool m_bTookChoice
Did we take the Choice or want Fallback instead?