LibreOffice Module editeng (master) 1
SvXMLAutoCorrectExport.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
21
22#include <com/sun/star/util/MeasureUnit.hpp>
23#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
26#include <xmloff/xmltoken.hxx>
27
28using namespace ::com::sun::star::uno;
29using namespace ::com::sun::star;
30using namespace ::xmloff::token;
31
33 const css::uno::Reference< css::uno::XComponentContext > & xContext,
34 const SvxAutocorrWordList * pNewAutocorr_List,
35 const OUString &rFileName,
36 css::uno::Reference< css::xml::sax::XDocumentHandler> const &rHandler)
37: SvXMLExport( xContext, "", rFileName, util::MeasureUnit::CM, rHandler ),
38 pAutocorr_List( pNewAutocorr_List )
39{
43}
44
46{
47 GetDocHandler()->startDocument();
48
50
52 GetNamespaceMap_().GetAttrNameByKey ( XML_NAMESPACE_BLOCKLIST ),
53 GetNamespaceMap_().GetNameByKey ( XML_NAMESPACE_BLOCKLIST ) );
54 {
57 for (auto const& content : rContent)
58 {
61 content.GetShort());
64 content.IsTextOnly() ? content.GetLong() : content.GetShort());
65
66 SvXMLElementExport aBlock( *this, XML_NAMESPACE_BLOCKLIST, XML_BLOCK, true, true);
67 }
68 }
69 GetDocHandler()->endDocument();
70 return ERRCODE_NONE;
71}
72
74 const css::uno::Reference< css::uno::XComponentContext > & xContext,
75 const SvStringsISortDtor &rNewList,
76 const OUString &rFileName,
77 css::uno::Reference< css::xml::sax::XDocumentHandler> const &rHandler)
78: SvXMLExport( xContext, "", rFileName, util::MeasureUnit::CM, rHandler ),
79 rList( rNewList )
80{
84}
85
87{
88 GetDocHandler()->startDocument();
89
91
93 GetNamespaceMap_().GetAttrNameByKey ( XML_NAMESPACE_BLOCKLIST ),
94 GetNamespaceMap_().GetNameByKey ( XML_NAMESPACE_BLOCKLIST ) );
95 {
97 sal_uInt16 nBlocks= rList.size();
98 for ( sal_uInt16 i = 0; i < nBlocks; i++)
99 {
102 rList[i] );
103 SvXMLElementExport aBlock( *this, XML_NAMESPACE_BLOCKLIST, XML_BLOCK, true, true);
104 }
105 }
106 GetDocHandler()->endDocument();
107 return ERRCODE_NONE;
108}
109
110/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SvxAutocorrWordList * pAutocorr_List
SvXMLAutoCorrectExport(const css::uno::Reference< css::uno::XComponentContext > &xContext, const SvxAutocorrWordList *pNewAutocorr_List, const OUString &rFileName, css::uno::Reference< css::xml::sax::XDocumentHandler > const &rHandler)
ErrCode exportDoc(enum ::xmloff::token::XMLTokenEnum eClass=::xmloff::token::XML_TOKEN_INVALID) override
ErrCode exportDoc(enum ::xmloff::token::XMLTokenEnum eClass=::xmloff::token::XML_TOKEN_INVALID) override
SvXMLExceptionListExport(const css::uno::Reference< css::uno::XComponentContext > &xContext, const SvStringsISortDtor &rNewList, const OUString &rFileName, css::uno::Reference< css::xml::sax::XDocumentHandler > const &rHandler)
const SvStringsISortDtor & rList
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
SvXMLNamespaceMap & GetNamespaceMap_()
void addChaffWhenEncryptedStorage()
const css::uno::Reference< css::xml::sax::XDocumentHandler > & GetDocHandler() const
sal_uInt16 Add(const OUString &rPrefix, const OUString &rName, sal_uInt16 nKey=XML_NAMESPACE_UNKNOWN)
const AutocorrWordSetType & getSortedContent() const
Definition: svxacorr.cxx:2961
std::vector< SvxAutocorrWord > AutocorrWordSetType
Definition: svxacorr.hxx:179
size_type size() const
#define ERRCODE_NONE
int i
const sal_uInt16 XML_NAMESPACE_NONE
XMLTokenEnum
XML_BLOCK
XML_NAME
XML_BLOCK_LIST
XML_N_BLOCK_LIST
XML_ABBREVIATED_NAME
XML_NP_BLOCK_LIST
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
constexpr sal_uInt16 XML_NAMESPACE_BLOCKLIST