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