1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 "ximpnote.hxx"
21 #include <xmloff/xmlnamespace.hxx>
23 using namespace ::com::sun::star
;
24 using namespace ::xmloff::token
;
26 SdXMLNotesContext::SdXMLNotesContext(
27 SdXMLImport
& rImport
, const css::uno::Reference
<css::xml::sax::XFastAttributeList
>& xAttrList
,
28 uno::Reference
<drawing::XShapes
> const& rShapes
)
29 : SdXMLGenericPageContext(rImport
, xAttrList
, rShapes
)
31 OUString sStyleName
, sPageMasterName
;
33 for (auto& aIter
: sax_fastparser::castToFastAttributeList(xAttrList
))
35 OUString sValue
= aIter
.toString();
36 switch (aIter
.getToken())
38 case XML_ELEMENT(STYLE
, XML_PAGE_LAYOUT_NAME
):
40 sPageMasterName
= sValue
;
43 case XML_ELEMENT(DRAW
, XML_STYLE_NAME
):
48 case XML_ELEMENT(PRESENTATION
, XML_USE_HEADER_NAME
):
49 case XML_ELEMENT(PRESENTATION_SO52
, XML_USE_HEADER_NAME
):
50 case XML_ELEMENT(PRESENTATION_OOO
, XML_USE_HEADER_NAME
):
52 maUseHeaderDeclName
= sValue
;
55 case XML_ELEMENT(PRESENTATION
, XML_USE_FOOTER_NAME
):
56 case XML_ELEMENT(PRESENTATION_SO52
, XML_USE_FOOTER_NAME
):
57 case XML_ELEMENT(PRESENTATION_OOO
, XML_USE_FOOTER_NAME
):
59 maUseFooterDeclName
= sValue
;
62 case XML_ELEMENT(PRESENTATION
, XML_USE_DATE_TIME_NAME
):
63 case XML_ELEMENT(PRESENTATION_SO52
, XML_USE_DATE_TIME_NAME
):
64 case XML_ELEMENT(PRESENTATION_OOO
, XML_USE_DATE_TIME_NAME
):
66 maUseDateTimeDeclName
= sValue
;
74 // now delete all up-to-now contained shapes from this notes page
75 uno::Reference
<drawing::XShape
> xShape
;
76 while (rShapes
->getCount())
78 rShapes
->getByIndex(0) >>= xShape
;
80 rShapes
->remove(xShape
);
84 if (!sPageMasterName
.isEmpty())
86 SetPageMaster(sPageMasterName
);
90 SdXMLNotesContext::~SdXMLNotesContext() {}
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */