summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-08-25 20:47:58 -0400
committerAshod Nakashian <ashnakash@gmail.com>2017-08-28 03:51:32 +0200
commitaf694659763de9a787e018df5ba4debd4976cd03 (patch)
treeb0c742ffbbc1f0d2cd036baf5f4b094326d0960e /sw
parent2c3dfd9d3bafc6ad84d750c7bec935b5b164e7f7 (diff)
sw: remove signature metadata on deleting signature field
Change-Id: I1f82b2d59889c1ba84d91880df13d12d3e5b796c Reviewed-on: https://gerrit.libreoffice.org/41594 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/txtnode/thints.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index b6586595a32e..ae8720ba674e 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -76,6 +76,9 @@
#include <map>
#include <memory>
+#include <docsh.hxx>
+#include <rdfhelper.hxx>
+
#ifdef DBG_UTIL
#define CHECK Check(true);
#define CHECK_NOTMERGED Check(false);
@@ -1191,7 +1194,22 @@ void SwTextNode::DestroyAttr( SwTextAttr* pAttr )
case RES_TXTATR_META:
case RES_TXTATR_METAFIELD:
+ {
+ auto pTextMeta = static_txtattr_cast<SwTextMeta*>(pAttr);
+ SwFormatMeta & rFormatMeta( static_cast<SwFormatMeta &>(pTextMeta->GetAttr()) );
+ if (::sw::Meta* pMeta = rFormatMeta.GetMeta())
+ {
+ if (SwDocShell* pDocSh = pDoc->GetDocShell())
+ {
+ static const OUString metaNS("urn:bails");
+ const css::uno::Reference<css::rdf::XResource> xSubject(pMeta->MakeUnoObject(), uno::UNO_QUERY);
+ uno::Reference<frame::XModel> xModel = pDocSh->GetBaseModel();
+ SwRDFHelper::clearStatements(xModel, metaNS, xSubject);
+ }
+ }
+
static_txtattr_cast<SwTextMeta*>(pAttr)->ChgTextNode(nullptr);
+ }
break;
default: