Bump version to 4.3-4
[LibreOffice.git] / writerfilter / source / dmapper / LatentStyleHandler.cxx
blob39b677e999c156eba152a1de6880da31790f2ccb
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/.
8 */
9 #include <LatentStyleHandler.hxx>
10 #include <ooxml/resourceids.hxx>
11 #include "dmapperLoggers.hxx"
13 namespace writerfilter
15 namespace dmapper
18 using namespace ::com::sun::star;
20 LatentStyleHandler::LatentStyleHandler() :
21 LoggedProperties(dmapper_logger, "LatentStyleHandler")
25 LatentStyleHandler::~LatentStyleHandler()
29 void LatentStyleHandler::lcl_attribute(Id rName, Value& rVal)
31 beans::PropertyValue aValue;
32 bool bFound = true;
33 switch (rName)
35 case NS_ooxml::LN_CT_LsdException_name:
36 aValue.Name = "name";
37 break;
38 case NS_ooxml::LN_CT_LsdException_locked:
39 aValue.Name = "locked";
40 break;
41 case NS_ooxml::LN_CT_LsdException_uiPriority:
42 aValue.Name = "uiPriority";
43 break;
44 case NS_ooxml::LN_CT_LsdException_semiHidden:
45 aValue.Name = "semiHidden";
46 break;
47 case NS_ooxml::LN_CT_LsdException_unhideWhenUsed:
48 aValue.Name = "unhideWhenUsed";
49 break;
50 case NS_ooxml::LN_CT_LsdException_qFormat:
51 aValue.Name = "qFormat";
52 break;
53 default:
54 bFound = false;
55 #ifdef DEBUG_DOMAINMAPPER
56 dmapper_logger->element("unhandled");
57 #endif
58 break;
60 if (bFound)
62 aValue.Value = uno::makeAny(rVal.getString());
63 m_aAttributes.push_back(aValue);
68 void LatentStyleHandler::lcl_sprm(Sprm& /*rSprm*/)
72 uno::Sequence<beans::PropertyValue> LatentStyleHandler::getAttributes() const
74 uno::Sequence<beans::PropertyValue> aAttributes(m_aAttributes.size());
75 beans::PropertyValue* pAttributes = aAttributes.getArray();
76 for (std::vector<beans::PropertyValue>::const_iterator i = m_aAttributes.begin(); i != m_aAttributes.end(); ++i)
77 *pAttributes++ = *i;
78 return aAttributes;
81 } // namespace dmapper
82 } // namespace writerfilter
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */