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 namespace ::xmloff::token;
40
41
43 SvXMLImport& rImport,
44 Reference<XPropertySet> & rPropSet)
45 : XMLIndexSourceBaseContext(rImport, rPropSet, UseStyles::Single),
46 bUseCalc(false),
47 bUseChart(false),
48 bUseDraw(false),
49 bUseMath(false),
50 bUseOtherObjects(false)
51{
52}
53
55{
56}
57
59{
60 bool bTmp(false);
61
62 switch (aIter.getToken())
63 {
65 if (::sax::Converter::convertBool(bTmp, aIter.toView()))
66 {
67 bUseOtherObjects = bTmp;
68 }
69 break;
70
72 if (::sax::Converter::convertBool(bTmp, aIter.toView()))
73 {
74 bUseCalc = bTmp;
75 }
76 break;
77
79 if (::sax::Converter::convertBool(bTmp, aIter.toView()))
80 {
81 bUseChart = bTmp;
82 }
83 break;
84
86 if (::sax::Converter::convertBool(bTmp, aIter.toView()))
87 {
88 bUseDraw = bTmp;
89 }
90 break;
91
93 if (::sax::Converter::convertBool(bTmp, aIter.toView()))
94 {
95 bUseMath = bTmp;
96 }
97 break;
98
99 default:
101 break;
102 }
103}
104
106{
107 rIndexPropertySet->setPropertyValue("CreateFromStarCalc", css::uno::Any(bUseCalc));
108 rIndexPropertySet->setPropertyValue("CreateFromStarChart", css::uno::Any(bUseChart));
109 rIndexPropertySet->setPropertyValue("CreateFromStarDraw", css::uno::Any(bUseDraw));
110 rIndexPropertySet->setPropertyValue("CreateFromStarMath", css::uno::Any(bUseMath));
111 rIndexPropertySet->setPropertyValue("CreateFromOtherEmbeddedObjects", css::uno::Any(bUseOtherObjects));
112
114}
115
116css::uno::Reference< css::xml::sax::XFastContextHandler > XMLIndexObjectSourceContext::createFastChildContext(
117 sal_Int32 nElement,
118 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
119{
121 {
124 XML_TOKEN_INVALID, // no outline-level attr
127 }
128 else
129 {
131 xAttrList);
132 }
133
134}
135
136/* 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:1426
@ XML_USE_SPREADSHEET_OBJECTS
Definition: xmltoken.hxx:2082
TEXT
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:97