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) :
48 rPropSet, false),
49 bUseCalc(false),
50 bUseChart(false),
51 bUseDraw(false),
52 bUseMath(false),
53 bUseOtherObjects(false)
54{
55}
56
58{
59}
60
62{
63 bool bTmp(false);
64
65 switch (aIter.getToken())
66 {
68 if (::sax::Converter::convertBool(bTmp, aIter.toView()))
69 {
70 bUseOtherObjects = bTmp;
71 }
72 break;
73
75 if (::sax::Converter::convertBool(bTmp, aIter.toView()))
76 {
77 bUseCalc = bTmp;
78 }
79 break;
80
82 if (::sax::Converter::convertBool(bTmp, aIter.toView()))
83 {
84 bUseChart = bTmp;
85 }
86 break;
87
89 if (::sax::Converter::convertBool(bTmp, aIter.toView()))
90 {
91 bUseDraw = bTmp;
92 }
93 break;
94
96 if (::sax::Converter::convertBool(bTmp, aIter.toView()))
97 {
98 bUseMath = bTmp;
99 }
100 break;
101
102 default:
104 break;
105 }
106}
107
109{
110 rIndexPropertySet->setPropertyValue("CreateFromStarCalc", css::uno::Any(bUseCalc));
111 rIndexPropertySet->setPropertyValue("CreateFromStarChart", css::uno::Any(bUseChart));
112 rIndexPropertySet->setPropertyValue("CreateFromStarDraw", css::uno::Any(bUseDraw));
113 rIndexPropertySet->setPropertyValue("CreateFromStarMath", css::uno::Any(bUseMath));
114 rIndexPropertySet->setPropertyValue("CreateFromOtherEmbeddedObjects", css::uno::Any(bUseOtherObjects));
115
117}
118
119css::uno::Reference< css::xml::sax::XFastContextHandler > XMLIndexObjectSourceContext::createFastChildContext(
120 sal_Int32 nElement,
121 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
122{
124 {
127 XML_TOKEN_INVALID, // no outline-level attr
130 }
131 else
132 {
134 xAttrList);
135 }
136
137}
138
139/* 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:1421
@ XML_USE_SPREADSHEET_OBJECTS
Definition: xmltoken.hxx:2076
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3583
TEXT
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:98