LibreOffice Module xmloff (master) 1
XMLIndexObjectSourceContext.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
22
23#include <rtl/ustring.hxx>
24
25#include <com/sun/star/beans/XPropertySet.hpp>
26
28
30#include <xmloff/xmlictxt.hxx>
31#include <xmloff/xmlimp.hxx>
33#include <xmloff/xmltoken.hxx>
34
35
36using ::com::sun::star::beans::XPropertySet;
37using ::com::sun::star::uno::Reference;
38using ::com::sun::star::uno::Any;
39using ::com::sun::star::xml::sax::XAttributeList;
41using namespace ::xmloff::token;
42
43
45 SvXMLImport& rImport,
46 Reference<XPropertySet> & rPropSet)
47 : XMLIndexSourceBaseContext(rImport, rPropSet, UseStyles::Single),
48 bUseCalc(false),
49 bUseChart(false),
50 bUseDraw(false),
51 bUseMath(false),
52 bUseOtherObjects(false)
53{
54}
55
57{
58}
59
61{
62 bool bTmp(false);
63
64 switch (aIter.getToken())
65 {
67 if (::sax::Converter::convertBool(bTmp, aIter.toView()))
68 {
69 bUseOtherObjects = bTmp;
70 }
71 break;
72
74 if (::sax::Converter::convertBool(bTmp, aIter.toView()))
75 {
76 bUseCalc = bTmp;
77 }
78 break;
79
81 if (::sax::Converter::convertBool(bTmp, aIter.toView()))
82 {
83 bUseChart = bTmp;
84 }
85 break;
86
88 if (::sax::Converter::convertBool(bTmp, aIter.toView()))
89 {
90 bUseDraw = bTmp;
91 }
92 break;
93
95 if (::sax::Converter::convertBool(bTmp, aIter.toView()))
96 {
97 bUseMath = bTmp;
98 }
99 break;
100
101 default:
103 break;
104 }
105}
106
108{
109 rIndexPropertySet->setPropertyValue("CreateFromStarCalc", css::uno::Any(bUseCalc));
110 rIndexPropertySet->setPropertyValue("CreateFromStarChart", css::uno::Any(bUseChart));
111 rIndexPropertySet->setPropertyValue("CreateFromStarDraw", css::uno::Any(bUseDraw));
112 rIndexPropertySet->setPropertyValue("CreateFromStarMath", css::uno::Any(bUseMath));
113 rIndexPropertySet->setPropertyValue("CreateFromOtherEmbeddedObjects", css::uno::Any(bUseOtherObjects));
114
116}
117
118css::uno::Reference< css::xml::sax::XFastContextHandler > XMLIndexObjectSourceContext::createFastChildContext(
119 sal_Int32 nElement,
120 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
121{
123 {
126 XML_TOKEN_INVALID, // no outline-level attr
129 }
130 else
131 {
133 xAttrList);
134 }
135
136}
137
138/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const char * aLevelStylePropNameTableMap[]
const bool aAllowedTokenTypesTable[]
const SvXMLEnumMapEntry< sal_uInt16 > * aLevelNameTableMap
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:60
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
virtual void ProcessAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &aIter) override
XMLIndexObjectSourceContext(SvXMLImport &rImport, css::uno::Reference< css::beans::XPropertySet > &rPropSet)
Superclass for index source elements.
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
css::uno::Reference< css::beans::XPropertySet > & rIndexPropertySet
tab stops relative to margin or indent?
virtual void ProcessAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &aIter)
Import index entry templates.
static bool convertBool(bool &rBool, std::u16string_view rString)
Handling of tokens in XML:
@ XML_OBJECT_INDEX_ENTRY_TEMPLATE
Definition: xmltoken.hxx:1422
@ XML_USE_SPREADSHEET_OBJECTS
Definition: xmltoken.hxx:2077
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3585
TEXT
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:97