Differential D25715 Diff 72487 filters/words/rtf/import/3rdparty/rtf-qt/src/TextDocumentRtfOutput.cpp
Changeset View
Changeset View
Standalone View
Standalone View
filters/words/rtf/import/3rdparty/rtf-qt/src/TextDocumentRtfOutput.cpp
Show First 20 Lines • Show All 156 Lines • ▼ Show 20 Line(s) | 29 | { | |||
---|---|---|---|---|---|
157 | m_cursor->setCharFormat( m_textCharFormatStack.top() ); | 157 | m_cursor->setCharFormat( m_textCharFormatStack.top() ); | ||
158 | } | 158 | } | ||
159 | 159 | | |||
160 | void TextDocumentRtfOutput::setForegroundColour( const int colourIndex ) | 160 | void TextDocumentRtfOutput::setForegroundColour( const int colourIndex ) | ||
161 | { | 161 | { | ||
162 | QColor colour = m_colourTable.value( colourIndex ); | 162 | QColor colour = m_colourTable.value( colourIndex ); | ||
163 | if ( colour.isValid() ) { | 163 | if ( colour.isValid() ) { | ||
164 | m_textCharFormatStack.top().setForeground( colour ); | 164 | m_textCharFormatStack.top().setForeground( colour ); | ||
165 | m_cursor->setCharFormat( m_textCharFormatStack.top() ); | | |||
166 | } else { | 165 | } else { | ||
167 | qCDebug(lcRtf) << "invalid colour at index:" << colourIndex; | 166 | m_textCharFormatStack.top().clearForeground(); | ||
168 | } | 167 | } | ||
168 | m_cursor->setCharFormat( m_textCharFormatStack.top() ); | ||||
169 | } | 169 | } | ||
170 | 170 | | |||
171 | void TextDocumentRtfOutput::setHighlightColour( const int colourIndex ) | 171 | void TextDocumentRtfOutput::setHighlightColour( const int colourIndex ) | ||
172 | { | 172 | { | ||
173 | QColor colour = m_colourTable.value( colourIndex ); | 173 | QColor colour = m_colourTable.value( colourIndex ); | ||
174 | if ( colour.isValid() ) { | 174 | if ( colour.isValid() ) { | ||
175 | m_textCharFormatStack.top().setBackground( colour ); | 175 | m_textCharFormatStack.top().setBackground( colour ); | ||
176 | m_cursor->setCharFormat( m_textCharFormatStack.top() ); | | |||
177 | } else { | 176 | } else { | ||
178 | qCDebug(lcRtf) << "invalid colour at index:" << colourIndex; | 177 | m_textCharFormatStack.top().clearBackground(); | ||
179 | } | 178 | } | ||
179 | m_cursor->setCharFormat( m_textCharFormatStack.top() ); | ||||
180 | } | 180 | } | ||
181 | 181 | | |||
182 | void TextDocumentRtfOutput::setParagraphPatternBackgroundColour( const int colourIndex ) | 182 | void TextDocumentRtfOutput::setParagraphPatternBackgroundColour( const int colourIndex ) | ||
183 | { | 183 | { | ||
184 | QColor colour = m_colourTable.value( colourIndex ); | 184 | QColor colour = m_colourTable.value( colourIndex ); | ||
185 | if ( colour.isValid() ) { | 185 | if ( colour.isValid() ) { | ||
186 | m_paragraphFormat.setBackground( colour ); | 186 | m_paragraphFormat.setBackground( colour ); | ||
187 | m_cursor->setBlockFormat( m_paragraphFormat ); | | |||
188 | } else { | 187 | } else { | ||
189 | qCDebug(lcRtf) << "invalid colour at index:" << colourIndex; | 188 | m_paragraphFormat.clearBackground(); | ||
190 | } | 189 | } | ||
190 | m_cursor->setBlockFormat( m_paragraphFormat ); | ||||
191 | } | 191 | } | ||
192 | 192 | | |||
193 | void TextDocumentRtfOutput::setFont( const int fontIndex ) | 193 | void TextDocumentRtfOutput::setFont( const int fontIndex ) | ||
194 | { | 194 | { | ||
195 | if ( ! m_fontTable.contains( fontIndex ) ) { | 195 | if ( ! m_fontTable.contains( fontIndex ) ) { | ||
196 | qCDebug(lcRtf) << "attempted to select fontIndex" << fontIndex << "not in the font table"; | 196 | qCDebug(lcRtf) << "attempted to select fontIndex" << fontIndex << "not in the font table"; | ||
197 | return; | 197 | return; | ||
198 | } | 198 | } | ||
▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines |