fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / filter / xml / xmlconti.cxx
blob7f5ba32ff476616772a5b54b8229321cd1e25b46
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "xmlconti.hxx"
21 #include "xmlimprt.hxx"
22 #include "global.hxx"
23 #include "document.hxx"
25 #include <xmloff/xmltkmap.hxx>
26 #include <xmloff/nmspmap.hxx>
27 #include <xmloff/xmlnmspe.hxx>
28 #include <xmloff/xmltoken.hxx>
30 using namespace xmloff::token;
32 ScXMLContentContext::ScXMLContentContext( ScXMLImport& rImport,
33 sal_uInt16 nPrfx,
34 const OUString& rLName,
35 const ::com::sun::star::uno::Reference<
36 ::com::sun::star::xml::sax::XAttributeList>& /* xAttrList */,
37 OUStringBuffer& sTempValue) :
38 SvXMLImportContext( rImport, nPrfx, rLName ),
39 sOUText(),
40 sValue(sTempValue)
44 ScXMLContentContext::~ScXMLContentContext()
48 SvXMLImportContext *ScXMLContentContext::CreateChildContext( sal_uInt16 nPrefix,
49 const OUString& rLName,
50 const ::com::sun::star::uno::Reference<
51 ::com::sun::star::xml::sax::XAttributeList>& xAttrList )
53 SvXMLImportContext *pContext = 0;
55 if ((nPrefix == XML_NAMESPACE_TEXT) && IsXMLToken(rLName, XML_S))
57 sal_Int32 nRepeat(0);
58 sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
59 for( sal_Int16 i=0; i < nAttrCount; ++i )
61 const OUString& sAttrName(xAttrList->getNameByIndex( i ));
62 const OUString& sAttrValue(xAttrList->getValueByIndex( i ));
63 OUString aLocalName;
64 sal_uInt16 nPrfx = GetScImport().GetNamespaceMap().GetKeyByAttrName(
65 sAttrName, &aLocalName );
66 if ((nPrfx == XML_NAMESPACE_TEXT) && IsXMLToken(aLocalName, XML_C))
67 nRepeat = sAttrValue.toInt32();
69 if (nRepeat)
70 for (sal_Int32 j = 0; j < nRepeat; ++j)
71 sOUText.append(' ');
72 else
73 sOUText.append(' ');
76 if( !pContext )
77 pContext = new SvXMLImportContext( GetImport(), nPrefix, rLName );
79 return pContext;
82 void ScXMLContentContext::Characters( const OUString& rChars )
84 sOUText.append(rChars);
87 void ScXMLContentContext::EndElement()
89 sValue.append(sOUText.toString());
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */