LibreOffice Module writerperfect (master) 1
xmlimp.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
10#include <sal/config.h>
11
12#include "xmlimp.hxx"
13
14#include <string_view>
15
16#include <initializer_list>
17#include <unordered_map>
18
19#include <com/sun/star/svg/XSVGWriter.hpp>
20#include <com/sun/star/uri/UriReferenceFactory.hpp>
21#include <com/sun/star/xml/sax/InputSource.hpp>
22#include <com/sun/star/xml/sax/Parser.hpp>
23#include <com/sun/star/xml/sax/Writer.hpp>
25#include <rtl/uri.hxx>
26#include <tools/gen.hxx>
27#include <tools/stream.hxx>
28#include <tools/urlobj.hxx>
31
32#include "xmlfmt.hxx"
33#include "xmlictxt.hxx"
34#include "xmlmetai.hxx"
35#include "xmltext.hxx"
36
37using namespace com::sun::star;
38
39namespace writerperfect::exp
40{
41namespace
42{
44OUString GetMimeType(const OUString& rExtension)
45{
46 static const std::unordered_map<OUString, OUString> vMimeTypes = {
47 { "gif", "image/gif" },
48 { "jpg", "image/jpeg" },
49 { "png", "image/png" },
50 { "svg", "image/svg+xml" },
51 };
52
53 auto it = vMimeTypes.find(rExtension);
54 return it == vMimeTypes.end() ? OUString() : it->second;
55}
56
58OUString FindMediaDir(const OUString& rDocumentBaseURL,
59 const uno::Sequence<beans::PropertyValue>& rFilterData)
60{
61 OUString aMediaDir;
62
63 // See if filter data contains a media directory explicitly.
64 auto pProp = std::find_if(
65 rFilterData.begin(), rFilterData.end(),
66 [](const beans::PropertyValue& rProp) { return rProp.Name == "RVNGMediaDir"; });
67 if (pProp != rFilterData.end())
68 pProp->Value >>= aMediaDir;
69
70 if (!aMediaDir.isEmpty())
71 return aMediaDir + "/";
72
73 // Not set explicitly, try to pick it up from the base directory.
74 INetURLObject aURL(rDocumentBaseURL);
75 try
76 {
77 aMediaDir = rtl::Uri::convertRelToAbs(rDocumentBaseURL, aURL.GetBase()) + "/";
78 }
79 catch (const rtl::MalformedUriException&)
80 {
81 DBG_UNHANDLED_EXCEPTION("writerperfect");
82 }
83 return aMediaDir;
84}
85
87OUString FindCoverImage(const OUString& rDocumentBaseURL, OUString& rMimeType,
88 const uno::Sequence<beans::PropertyValue>& rFilterData)
89{
90 OUString aRet;
91
92 // See if filter data contains a cover image explicitly.
93 auto pProp = std::find_if(
94 rFilterData.begin(), rFilterData.end(),
95 [](const beans::PropertyValue& rProp) { return rProp.Name == "RVNGCoverImage"; });
96 if (pProp != rFilterData.end())
97 pProp->Value >>= aRet;
98
99 if (!aRet.isEmpty())
100 {
101 INetURLObject aRetURL(aRet);
102 rMimeType = GetMimeType(aRetURL.GetFileExtension());
103 return aRet;
104 }
105
106 // Not set explicitly, try to pick it up from the base directory.
107 if (rDocumentBaseURL.isEmpty())
108 return aRet;
109
110 static const std::initializer_list<std::u16string_view> vExtensions
111 = { u"gif", u"jpg", u"png", u"svg" };
112
113 OUString aMediaDir = FindMediaDir(rDocumentBaseURL, rFilterData);
114 for (const auto& rExtension : vExtensions)
115 {
116 aRet = aMediaDir + "cover." + rExtension;
117 if (!aRet.isEmpty())
118 {
119 SvFileStream aStream(aRet, StreamMode::READ);
120 if (aStream.IsOpen())
121 {
122 rMimeType = GetMimeType(OUString(rExtension));
123 // File exists.
124 return aRet;
125 }
126
127 aRet.clear();
128 }
129 }
130
131 return aRet;
132}
133
135void FindXMPMetadata(const uno::Reference<uno::XComponentContext>& xContext,
136 const OUString& rDocumentBaseURL,
137 const uno::Sequence<beans::PropertyValue>& rFilterData,
138 librevenge::RVNGPropertyList& rMetaData)
139{
140 // See if filter data contains metadata explicitly.
141 OUString aValue;
142 for (const auto& rProp : rFilterData)
143 {
144 if (rProp.Name == "RVNGIdentifier")
145 {
146 rProp.Value >>= aValue;
147 if (!aValue.isEmpty())
148 rMetaData.insert("dc:identifier", aValue.toUtf8().getStr());
149 }
150 else if (rProp.Name == "RVNGTitle")
151 {
152 rProp.Value >>= aValue;
153 if (!aValue.isEmpty())
154 rMetaData.insert("dc:title", aValue.toUtf8().getStr());
155 }
156 else if (rProp.Name == "RVNGInitialCreator")
157 {
158 rProp.Value >>= aValue;
159 if (!aValue.isEmpty())
160 rMetaData.insert("meta:initial-creator", aValue.toUtf8().getStr());
161 }
162 else if (rProp.Name == "RVNGLanguage")
163 {
164 rProp.Value >>= aValue;
165 if (!aValue.isEmpty())
166 rMetaData.insert("dc:language", aValue.toUtf8().getStr());
167 }
168 else if (rProp.Name == "RVNGDate")
169 {
170 rProp.Value >>= aValue;
171 if (!aValue.isEmpty())
172 rMetaData.insert("dc:date", aValue.toUtf8().getStr());
173 }
174 }
175
176 // If not set explicitly, try to pick it up from the base directory.
177 if (rDocumentBaseURL.isEmpty())
178 return;
179
180 OUString aMediaDir = FindMediaDir(rDocumentBaseURL, rFilterData);
181 OUString aURL = aMediaDir + "metadata.xmp";
182 SvFileStream aStream(aURL, StreamMode::READ);
183 if (!aStream.IsOpen())
184 return;
185
186 xml::sax::InputSource aInputSource;
188 aInputSource.aInputStream = xStream;
189 uno::Reference<xml::sax::XParser> xParser = xml::sax::Parser::create(xContext);
190 rtl::Reference<XMPParser> xXMP(new XMPParser(rMetaData));
191 xParser->setDocumentHandler(xXMP);
192 try
193 {
194 xParser->parseStream(aInputSource);
195 }
196 catch (const uno::Exception&)
197 {
198 DBG_UNHANDLED_EXCEPTION("writerperfect", "parseStream() failed");
199 return;
200 }
201}
202
204class XMLBodyContext : public XMLImportContext
205{
206public:
207 XMLBodyContext(XMLImport& rImport);
208
210 CreateChildContext(const OUString& rName,
211 const uno::Reference<xml::sax::XAttributeList>& /*xAttribs*/) override;
212};
213}
214
215XMLBodyContext::XMLBodyContext(XMLImport& rImport)
216 : XMLImportContext(rImport)
217{
218}
219
221XMLBodyContext::CreateChildContext(const OUString& rName,
223{
224 if (rName == "office:text")
225 return new XMLBodyContentContext(GetImport());
226 return nullptr;
227}
228
229namespace
230{
232class XMLOfficeDocContext : public XMLImportContext
233{
234public:
235 XMLOfficeDocContext(XMLImport& rImport);
236
238 CreateChildContext(const OUString& rName,
239 const uno::Reference<xml::sax::XAttributeList>& /*xAttribs*/) override;
240
241 // Handles metafile for a single page.
242 void HandleFixedLayoutPage(const FixedLayoutPage& rPage, bool bFirst);
243};
244}
245
246XMLOfficeDocContext::XMLOfficeDocContext(XMLImport& rImport)
247 : XMLImportContext(rImport)
248{
249}
250
251rtl::Reference<XMLImportContext> XMLOfficeDocContext::CreateChildContext(
252 const OUString& rName, const uno::Reference<xml::sax::XAttributeList>& /*xAttribs*/)
253{
254 if (rName == "office:meta")
255 return new XMLMetaDocumentContext(GetImport());
256 if (rName == "office:automatic-styles")
257 return new XMLStylesContext(GetImport(), XMLStylesContext::StyleType_AUTOMATIC);
258 if (rName == "office:styles")
259 return new XMLStylesContext(GetImport(), XMLStylesContext::StyleType_NONE);
260 if (rName == "office:master-styles")
261 return new XMLStylesContext(GetImport(), XMLStylesContext::StyleType_NONE);
262 if (rName == "office:font-face-decls")
263 return new XMLFontFaceDeclsContext(GetImport());
264 if (rName == "office:body")
265 {
266 if (GetImport().GetPageMetafiles().empty())
267 return new XMLBodyContext(GetImport());
268
269 // Ignore text from doc model in the fixed layout case, instead
270 // insert the page metafiles.
271 bool bFirst = true;
272 for (const auto& rPage : GetImport().GetPageMetafiles())
273 {
274 HandleFixedLayoutPage(rPage, bFirst);
275 if (bFirst)
276 bFirst = false;
277 }
278 }
279 return nullptr;
280}
281
282void XMLOfficeDocContext::HandleFixedLayoutPage(const FixedLayoutPage& rPage, bool bFirst)
283{
284 uno::Reference<uno::XComponentContext> xCtx = GetImport().GetComponentContext();
285 uno::Reference<xml::sax::XWriter> xSaxWriter = xml::sax::Writer::create(xCtx);
286 if (!xSaxWriter.is())
287 return;
288
289 // [-loplugin:redundantfcast] false positive:
291 { comphelper::makePropertyValue("DTDString", false) })) };
293 xCtx->getServiceManager()->createInstanceWithArgumentsAndContext(
294 "com.sun.star.svg.SVGWriter", aArguments, xCtx),
295 uno::UNO_QUERY);
296 if (!xSVGWriter.is())
297 return;
298
299 SvMemoryStream aMemoryStream;
300 xSaxWriter->setOutputStream(new utl::OStreamWrapper(aMemoryStream));
301
302 xSVGWriter->write(xSaxWriter, rPage.aMetafile);
303
304 // Have all the info, invoke the generator.
305 librevenge::RVNGPropertyList aPageProperties;
306 // Pixel -> inch.
307 double fWidth = rPage.aCssPixels.getWidth();
308 fWidth /= 96;
309 aPageProperties.insert("fo:page-width", fWidth);
310 double fHeight = rPage.aCssPixels.getHeight();
311 fHeight /= 96;
312 aPageProperties.insert("fo:page-height", fHeight);
313
314 if (!rPage.aChapterNames.empty())
315 {
316 // Name of chapters starting on this page.
317 librevenge::RVNGPropertyListVector aChapterNames;
318 for (const auto& rName : rPage.aChapterNames)
319 {
320 librevenge::RVNGPropertyList aChapter;
321 aChapter.insert("librevenge:name", rName.toUtf8().getStr());
322 aChapterNames.append(aChapter);
323 }
324 aPageProperties.insert("librevenge:chapter-names", aChapterNames);
325 }
326
327 GetImport().GetGenerator().openPageSpan(aPageProperties);
328 librevenge::RVNGPropertyList aParagraphProperties;
329 if (!bFirst)
330 // All pages except the first one needs a page break before the page
331 // metafile.
332 aParagraphProperties.insert("fo:break-before", "page");
333 GetImport().GetGenerator().openParagraph(aParagraphProperties);
334 librevenge::RVNGPropertyList aImageProperties;
335 aImageProperties.insert("librevenge:mime-type", "image/svg+xml");
336 librevenge::RVNGBinaryData aBinaryData;
337 aBinaryData.append(static_cast<const unsigned char*>(aMemoryStream.GetData()),
338 aMemoryStream.GetSize());
339 aImageProperties.insert("office:binary-data", aBinaryData);
340 GetImport().GetGenerator().insertBinaryObject(aImageProperties);
341 GetImport().GetGenerator().closeParagraph();
342 GetImport().GetGenerator().closePageSpan();
343}
344
345XMLImport::XMLImport(const uno::Reference<uno::XComponentContext>& xContext,
346 librevenge::RVNGTextInterface& rGenerator, const OUString& rURL,
347 const uno::Sequence<beans::PropertyValue>& rDescriptor,
348 const std::vector<FixedLayoutPage>& rPageMetafiles)
349 : mrGenerator(rGenerator)
350 , mxContext(xContext)
351 , mbIsInPageSpan(false)
352 , mrPageMetafiles(rPageMetafiles)
353{
355 auto pDescriptor = std::find_if(
356 rDescriptor.begin(), rDescriptor.end(),
357 [](const beans::PropertyValue& rProp) { return rProp.Name == "FilterData"; });
358 if (pDescriptor != rDescriptor.end())
359 pDescriptor->Value >>= aFilterData;
360
361 maMediaDir = FindMediaDir(rURL, aFilterData);
362
363 OUString aMimeType;
364 OUString aCoverImage = FindCoverImage(rURL, aMimeType, aFilterData);
365 if (!aCoverImage.isEmpty())
366 {
367 librevenge::RVNGBinaryData aBinaryData;
368 SvFileStream aStream(aCoverImage, StreamMode::READ);
369 SvMemoryStream aMemoryStream;
370 aMemoryStream.WriteStream(aStream);
371 aBinaryData.append(static_cast<const unsigned char*>(aMemoryStream.GetData()),
372 aMemoryStream.GetSize());
373 librevenge::RVNGPropertyList aCoverImageProperties;
374 aCoverImageProperties.insert("office:binary-data", aBinaryData);
375 aCoverImageProperties.insert("librevenge:mime-type", aMimeType.toUtf8().getStr());
376 maCoverImages.append(aCoverImageProperties);
377 }
378
379 FindXMPMetadata(mxContext, rURL, aFilterData, maMetaData);
380
381 mxUriReferenceFactory = uri::UriReferenceFactory::create(mxContext);
382}
383
384const librevenge::RVNGPropertyListVector& XMLImport::GetCoverImages() const
385{
386 return maCoverImages;
387}
388
389const librevenge::RVNGPropertyList& XMLImport::GetMetaData() const { return maMetaData; }
390
391namespace
392{
394bool FileURLExists(const OUString& rURL)
395{
396 SvFileStream aStream(rURL, StreamMode::READ);
397 return aStream.IsOpen();
398}
399}
400
401PopupState XMLImport::FillPopupData(const OUString& rURL, librevenge::RVNGPropertyList& rPropList)
402{
404 try
405 {
406 xUriRef = mxUriReferenceFactory->parse(rURL);
407 }
408 catch (const uno::Exception&)
409 {
410 DBG_UNHANDLED_EXCEPTION("writerperfect", "XUriReference::parse() failed");
411 }
412 bool bAbsolute = true;
413 if (xUriRef.is())
414 bAbsolute = xUriRef->isAbsolute();
415 if (bAbsolute)
417
418 // Default case: relative URL, popup data was in the same directory as the
419 // document at insertion time.
420 OUString aAbs = maMediaDir + rURL;
421 if (!FileURLExists(aAbs))
422 // Fallback case: relative URL, popup data was in the default media
423 // directory at insertion time.
424 aAbs = maMediaDir + "../" + rURL;
425
426 if (!FileURLExists(aAbs))
427 // Relative link, but points to non-existing file: don't emit that to
428 // librevenge, since it will be invalid anyway.
429 return PopupState::Ignore;
430
431 SvFileStream aStream(aAbs, StreamMode::READ);
432 librevenge::RVNGBinaryData aBinaryData;
433 SvMemoryStream aMemoryStream;
434 aMemoryStream.WriteStream(aStream);
435 aBinaryData.append(static_cast<const unsigned char*>(aMemoryStream.GetData()),
436 aMemoryStream.GetSize());
437 rPropList.insert("office:binary-data", aBinaryData);
438
439 INetURLObject aAbsURL(aAbs);
440 OUString aMimeType = GetMimeType(aAbsURL.GetFileExtension());
441 rPropList.insert("librevenge:mime-type", aMimeType.toUtf8().getStr());
442
444}
445
446const std::vector<FixedLayoutPage>& XMLImport::GetPageMetafiles() const { return mrPageMetafiles; }
447
449{
450 return mxContext;
451}
452
454XMLImport::CreateContext(std::u16string_view rName,
456{
457 if (rName == u"office:document")
458 return new XMLOfficeDocContext(*this);
459 return nullptr;
460}
461
462librevenge::RVNGTextInterface& XMLImport::GetGenerator() const { return mrGenerator; }
463
464std::map<OUString, librevenge::RVNGPropertyList>& XMLImport::GetAutomaticTextStyles()
465{
467}
468
469std::map<OUString, librevenge::RVNGPropertyList>& XMLImport::GetAutomaticParagraphStyles()
470{
472}
473
474std::map<OUString, librevenge::RVNGPropertyList>& XMLImport::GetAutomaticCellStyles()
475{
477}
478
479std::map<OUString, librevenge::RVNGPropertyList>& XMLImport::GetAutomaticColumnStyles()
480{
482}
483
484std::map<OUString, librevenge::RVNGPropertyList>& XMLImport::GetAutomaticRowStyles()
485{
487}
488
489std::map<OUString, librevenge::RVNGPropertyList>& XMLImport::GetAutomaticTableStyles()
490{
492}
493
494std::map<OUString, librevenge::RVNGPropertyList>& XMLImport::GetAutomaticGraphicStyles()
495{
497}
498
499std::map<OUString, librevenge::RVNGPropertyList>& XMLImport::GetTextStyles()
500{
501 return maTextStyles;
502}
503
504std::map<OUString, librevenge::RVNGPropertyList>& XMLImport::GetParagraphStyles()
505{
506 return maParagraphStyles;
507}
508
509std::map<OUString, librevenge::RVNGPropertyList>& XMLImport::GetCellStyles()
510{
511 return maCellStyles;
512}
513
514std::map<OUString, librevenge::RVNGPropertyList>& XMLImport::GetColumnStyles()
515{
516 return maColumnStyles;
517}
518
519std::map<OUString, librevenge::RVNGPropertyList>& XMLImport::GetRowStyles() { return maRowStyles; }
520
521std::map<OUString, librevenge::RVNGPropertyList>& XMLImport::GetTableStyles()
522{
523 return maTableStyles;
524}
525
526std::map<OUString, librevenge::RVNGPropertyList>& XMLImport::GetGraphicStyles()
527{
528 return maGraphicStyles;
529}
530
531std::map<OUString, librevenge::RVNGPropertyList>& XMLImport::GetPageLayouts()
532{
533 return maPageLayouts;
534}
535
536std::map<OUString, librevenge::RVNGPropertyList>& XMLImport::GetMasterStyles()
537{
538 return maMasterStyles;
539}
540
541void XMLImport::startDocument() { mrGenerator.startDocument(librevenge::RVNGPropertyList()); }
542
543void XMLImport::endDocument() { mrGenerator.endDocument(); }
544
545void XMLImport::startElement(const OUString& rName,
547{
549 if (!maContexts.empty())
550 {
551 if (maContexts.top().is())
552 xContext = maContexts.top()->CreateChildContext(rName, xAttribs);
553 }
554 else
555 xContext = CreateContext(rName, xAttribs);
556
557 if (xContext.is())
558 xContext->startElement(rName, xAttribs);
559
560 maContexts.push(xContext);
561}
562
563void XMLImport::endElement(const OUString& rName)
564{
565 if (maContexts.empty())
566 return;
567
568 if (maContexts.top().is())
569 maContexts.top()->endElement(rName);
570
571 maContexts.pop();
572}
573
574void XMLImport::characters(const OUString& rChars)
575{
576 if (maContexts.top().is())
577 maContexts.top()->characters(rChars);
578}
579
580void XMLImport::ignorableWhitespace(const OUString& /*rWhitespaces*/) {}
581
582void XMLImport::processingInstruction(const OUString& /*rTarget*/, const OUString& /*rData*/) {}
583
585
586void XMLImport::HandlePageSpan(const librevenge::RVNGPropertyList& rPropertyList)
587{
588 OUString sMasterPageName;
589 OUString sLayoutName;
590
591 if (rPropertyList["style:master-page-name"])
592 sMasterPageName = OStringToOUString(
593 rPropertyList["style:master-page-name"]->getStr().cstr(), RTL_TEXTENCODING_UTF8);
594 else if (!GetIsInPageSpan())
595 sMasterPageName = "Standard";
596
597 if (sMasterPageName.getLength())
598 {
599 librevenge::RVNGPropertyList& rMasterPage = GetMasterStyles()[sMasterPageName];
600 if (rMasterPage["style:page-layout-name"])
601 {
602 sLayoutName = OStringToOUString(rMasterPage["style:page-layout-name"]->getStr().cstr(),
603 RTL_TEXTENCODING_UTF8);
604 }
605 }
606
607 if (sLayoutName.getLength())
608 {
609 librevenge::RVNGPropertyList& rPageLayout = GetPageLayouts()[sLayoutName];
610
611 if (GetIsInPageSpan())
612 GetGenerator().closePageSpan();
613
614 GetGenerator().openPageSpan(rPageLayout);
615 mbIsInPageSpan = true;
616 }
617}
618
619} // namespace writerperfect
620
621/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XInputStream > xStream
OUString GetFileExtension() const
const void * GetData()
sal_uInt64 GetSize()
SvStream & WriteStream(SvStream &rStream)
void SAL_CALL endDocument() override
Definition: xmlimp.cxx:543
std::map< OUString, librevenge::RVNGPropertyList > maAutomaticGraphicStyles
Definition: xmlimp.hxx:84
const css::uno::Reference< css::uno::XComponentContext > & mxContext
Definition: xmlimp.hxx:91
std::map< OUString, librevenge::RVNGPropertyList > maParagraphStyles
Definition: xmlimp.hxx:75
void HandlePageSpan(const librevenge::RVNGPropertyList &rPropertyList)
Definition: xmlimp.cxx:586
std::map< OUString, librevenge::RVNGPropertyList > & GetParagraphStyles()
Definition: xmlimp.cxx:504
std::map< OUString, librevenge::RVNGPropertyList > maRowStyles
Definition: xmlimp.hxx:81
std::map< OUString, librevenge::RVNGPropertyList > maTextStyles
Definition: xmlimp.hxx:73
std::map< OUString, librevenge::RVNGPropertyList > maAutomaticRowStyles
Definition: xmlimp.hxx:80
std::map< OUString, librevenge::RVNGPropertyList > & GetPageLayouts()
Definition: xmlimp.cxx:531
void SAL_CALL startElement(const OUString &rName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs) override
Definition: xmlimp.cxx:545
css::uno::Reference< css::uri::XUriReferenceFactory > mxUriReferenceFactory
Definition: xmlimp.hxx:92
std::map< OUString, librevenge::RVNGPropertyList > & GetTextStyles()
Definition: xmlimp.cxx:499
std::map< OUString, librevenge::RVNGPropertyList > & GetCellStyles()
Definition: xmlimp.cxx:509
rtl::Reference< XMLImportContext > CreateContext(std::u16string_view rName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs)
Definition: xmlimp.cxx:454
std::map< OUString, librevenge::RVNGPropertyList > & GetColumnStyles()
Definition: xmlimp.cxx:514
std::map< OUString, librevenge::RVNGPropertyList > & GetAutomaticRowStyles()
Definition: xmlimp.cxx:484
std::map< OUString, librevenge::RVNGPropertyList > maCellStyles
Definition: xmlimp.hxx:77
const librevenge::RVNGPropertyList & GetMetaData() const
Definition: xmlimp.cxx:389
std::map< OUString, librevenge::RVNGPropertyList > & GetAutomaticTableStyles()
Definition: xmlimp.cxx:489
std::map< OUString, librevenge::RVNGPropertyList > & GetAutomaticParagraphStyles()
Definition: xmlimp.cxx:469
std::map< OUString, librevenge::RVNGPropertyList > maColumnStyles
Definition: xmlimp.hxx:79
std::map< OUString, librevenge::RVNGPropertyList > & GetTableStyles()
Definition: xmlimp.cxx:521
std::map< OUString, librevenge::RVNGPropertyList > & GetAutomaticColumnStyles()
Definition: xmlimp.cxx:479
const css::uno::Reference< css::uno::XComponentContext > & GetComponentContext() const
Definition: xmlimp.cxx:448
const std::vector< FixedLayoutPage > & GetPageMetafiles() const
Definition: xmlimp.cxx:446
const std::vector< FixedLayoutPage > & mrPageMetafiles
Definition: xmlimp.hxx:95
void SAL_CALL ignorableWhitespace(const OUString &rWhitespaces) override
Definition: xmlimp.cxx:580
std::map< OUString, librevenge::RVNGPropertyList > maAutomaticColumnStyles
Definition: xmlimp.hxx:78
std::map< OUString, librevenge::RVNGPropertyList > & GetGraphicStyles()
Definition: xmlimp.cxx:526
librevenge::RVNGPropertyList maMetaData
Author, date, etc – overwrites what would be from the document out of the box.
Definition: xmlimp.hxx:90
void SAL_CALL startDocument() override
Definition: xmlimp.cxx:541
std::map< OUString, librevenge::RVNGPropertyList > maAutomaticParagraphStyles
Definition: xmlimp.hxx:74
std::map< OUString, librevenge::RVNGPropertyList > & GetMasterStyles()
Definition: xmlimp.cxx:536
void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > &xLocator) override
Definition: xmlimp.cxx:584
std::map< OUString, librevenge::RVNGPropertyList > & GetRowStyles()
Definition: xmlimp.cxx:519
std::map< OUString, librevenge::RVNGPropertyList > maAutomaticCellStyles
Definition: xmlimp.hxx:76
std::map< OUString, librevenge::RVNGPropertyList > & GetAutomaticCellStyles()
Definition: xmlimp.cxx:474
librevenge::RVNGTextInterface & mrGenerator
Definition: xmlimp.hxx:70
bool GetIsInPageSpan() const
Definition: xmlimp.hxx:130
std::map< OUString, librevenge::RVNGPropertyList > maTableStyles
Definition: xmlimp.hxx:83
std::map< OUString, librevenge::RVNGPropertyList > & GetAutomaticTextStyles()
Definition: xmlimp.cxx:464
PopupState FillPopupData(const OUString &rURL, librevenge::RVNGPropertyList &rPropList)
Definition: xmlimp.cxx:401
std::map< OUString, librevenge::RVNGPropertyList > & GetAutomaticGraphicStyles()
Definition: xmlimp.cxx:494
std::map< OUString, librevenge::RVNGPropertyList > maAutomaticTextStyles
Definition: xmlimp.hxx:72
std::map< OUString, librevenge::RVNGPropertyList > maPageLayouts
Definition: xmlimp.hxx:86
void SAL_CALL processingInstruction(const OUString &rTarget, const OUString &rData) override
Definition: xmlimp.cxx:582
std::map< OUString, librevenge::RVNGPropertyList > maMasterStyles
Definition: xmlimp.hxx:87
void SAL_CALL characters(const OUString &rChars) override
Definition: xmlimp.cxx:574
void SAL_CALL endElement(const OUString &rName) override
Definition: xmlimp.cxx:563
std::map< OUString, librevenge::RVNGPropertyList > maGraphicStyles
Definition: xmlimp.hxx:85
std::stack< rtl::Reference< XMLImportContext > > maContexts
Definition: xmlimp.hxx:71
librevenge::RVNGPropertyListVector maCoverImages
Definition: xmlimp.hxx:88
std::map< OUString, librevenge::RVNGPropertyList > maAutomaticTableStyles
Definition: xmlimp.hxx:82
const librevenge::RVNGPropertyListVector & GetCoverImages() const
Definition: xmlimp.cxx:384
librevenge::RVNGTextInterface & GetGenerator() const
Definition: xmlimp.cxx:462
#define DBG_UNHANDLED_EXCEPTION(...)
URL aURL
uno::Reference< uno::XComponentContext > mxContext
float u
Sequence< PropertyValue > aArguments
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
PopupState
States describing the result of a link -> popup conversion.
Definition: xmlimp.hxx:56
@ Consumed
The relative link was converted to a popup.
@ NotConsumed
The absolute link was not handled.
@ Ignore
The relative link is invalid and should be ignored.
const sal_Unicode *const aMimeType[]