diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2017-10-09 11:31:13 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2017-10-23 12:04:43 +0200 |
commit | fbc44fe63b47c1e2df9b4d7e1602f3358087fd62 (patch) | |
tree | 08b4649d9111cd2e1683288a1ba2748d8c89505e /editeng | |
parent | 1bd148495378d811f33a0ff26dc82165bbe961ac (diff) |
tscp: advanced classification dialog for impress
Change-Id: I76c81e6f84de8160c20f1614d7676f2f2c3fb155
Reviewed-on: https://gerrit.libreoffice.org/43361
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/Library_editeng.mk | 1 | ||||
-rw-r--r-- | editeng/source/items/CustomPropertyField.cxx | 72 |
2 files changed, 73 insertions, 0 deletions
diff --git a/editeng/Library_editeng.mk b/editeng/Library_editeng.mk index 7e5790e81339..87e23b8628da 100644 --- a/editeng/Library_editeng.mk +++ b/editeng/Library_editeng.mk @@ -70,6 +70,7 @@ $(eval $(call gb_Library_add_exception_objects,editeng,\ editeng/source/editeng/textconv \ editeng/source/items/borderline \ editeng/source/items/bulitem \ + editeng/source/items/CustomPropertyField \ editeng/source/items/charhiddenitem \ editeng/source/items/flditem \ editeng/source/items/frmitems \ diff --git a/editeng/source/items/CustomPropertyField.cxx b/editeng/source/items/CustomPropertyField.cxx new file mode 100644 index 000000000000..7145bc72c650 --- /dev/null +++ b/editeng/source/items/CustomPropertyField.cxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#include <editeng/CustomPropertyField.hxx> +#include <vcl/metaact.hxx> +#include <com/sun/star/beans/XPropertyContainer.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> + +using namespace css; + +namespace editeng +{ + +CustomPropertyField::CustomPropertyField() + : SvxFieldData() +{} + +CustomPropertyField::CustomPropertyField(OUString const & rKey) + : SvxFieldData() + , msKey(rKey) +{} + +CustomPropertyField::~CustomPropertyField() +{} + +SV_IMPL_PERSIST1(CustomPropertyField); + +SvxFieldData* CustomPropertyField::Clone() const +{ + return new CustomPropertyField(msKey); +} + +bool CustomPropertyField::operator==(const SvxFieldData& rOther) const +{ + if (typeid(rOther) != typeid(*this)) + return false; + + const CustomPropertyField& rOtherField = static_cast<const CustomPropertyField&>(rOther); + return (msKey == rOtherField.msKey); +} + +MetaAction* CustomPropertyField::createBeginComment() const +{ + return new MetaCommentAction("FIELD_SEQ_BEGIN"); +} + +OUString CustomPropertyField::GetFormatted(uno::Reference<document::XDocumentProperties> const & xDocumentProperties) const +{ + if (!xDocumentProperties.is()) + return OUString(); + uno::Reference<beans::XPropertyContainer> xPropertyContainer = xDocumentProperties->getUserDefinedProperties(); + if (!xPropertyContainer.is()) + return OUString(); + uno::Reference<beans::XPropertySet> xPropertySet(xPropertyContainer, uno::UNO_QUERY); + if (!xPropertySet.is()) + return OUString(); + uno::Any aAny = xPropertySet->getPropertyValue(msKey); + if (!aAny.has<OUString>()) + return OUString(); + return aAny.get<OUString>(); +} + +} // end editeng namespace + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |