Line data Source code
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 : #include <LatentStyleHandler.hxx>
10 : #include <ooxml/resourceids.hxx>
11 :
12 : namespace writerfilter
13 : {
14 : namespace dmapper
15 : {
16 :
17 : using namespace ::com::sun::star;
18 :
19 232239 : LatentStyleHandler::LatentStyleHandler() :
20 232239 : LoggedProperties("LatentStyleHandler")
21 : {
22 232239 : }
23 :
24 464478 : LatentStyleHandler::~LatentStyleHandler()
25 : {
26 464478 : }
27 :
28 777255 : void LatentStyleHandler::lcl_attribute(Id rName, Value& rVal)
29 : {
30 777255 : beans::PropertyValue aValue;
31 777255 : bool bFound = true;
32 777255 : switch (rName)
33 : {
34 : case NS_ooxml::LN_CT_LsdException_name:
35 232239 : aValue.Name = "name";
36 232239 : break;
37 : case NS_ooxml::LN_CT_LsdException_locked:
38 2838 : aValue.Name = "locked";
39 2838 : break;
40 : case NS_ooxml::LN_CT_LsdException_uiPriority:
41 200814 : aValue.Name = "uiPriority";
42 200814 : break;
43 : case NS_ooxml::LN_CT_LsdException_semiHidden:
44 153167 : aValue.Name = "semiHidden";
45 153167 : break;
46 : case NS_ooxml::LN_CT_LsdException_unhideWhenUsed:
47 154432 : aValue.Name = "unhideWhenUsed";
48 154432 : break;
49 : case NS_ooxml::LN_CT_LsdException_qFormat:
50 33765 : aValue.Name = "qFormat";
51 33765 : break;
52 : default:
53 0 : bFound = false;
54 : #ifdef DEBUG_WRITERFILTER
55 : TagLogger::getInstance().element("unhandled");
56 : #endif
57 0 : break;
58 : }
59 777255 : if (bFound)
60 : {
61 777255 : aValue.Value = uno::makeAny(rVal.getString());
62 777255 : m_aAttributes.push_back(aValue);
63 777255 : }
64 777255 : }
65 :
66 :
67 0 : void LatentStyleHandler::lcl_sprm(Sprm& /*rSprm*/)
68 : {
69 0 : }
70 :
71 232239 : uno::Sequence<beans::PropertyValue> LatentStyleHandler::getAttributes() const
72 : {
73 232239 : uno::Sequence<beans::PropertyValue> aAttributes(m_aAttributes.size());
74 232239 : beans::PropertyValue* pAttributes = aAttributes.getArray();
75 1009494 : for (std::vector<beans::PropertyValue>::const_iterator i = m_aAttributes.begin(); i != m_aAttributes.end(); ++i)
76 777255 : *pAttributes++ = *i;
77 232239 : return aAttributes;
78 : }
79 :
80 : } // namespace dmapper
81 : } // namespace writerfilter
82 :
83 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|