diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-08-12 17:47:20 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-08-21 21:24:39 +0200 |
commit | 32e8b39c952e2bb7caec79a593e9d8ca5921a388 (patch) | |
tree | f936deb647764261d29de4a7c5e6eefb6f7c4c55 /xmloff | |
parent | cc28a7cb04f91f5270aa888ee4d75a69791ce2c7 (diff) |
fdo#82165: ODF import: clear all shapes when removing header content
Shapes anchored to the first or last paragraph survive setString("")
so need to be deleted with some ruse.
(regression from b8499fc3dcf474050f026b8d5cd1d9037bbe42b7)
Change-Id: I00a8132583c45d1953c207932cc7f02f3065ae77
(cherry picked from commit 555c988f3b896e16afc7bdd1bd98e48229599637)
Reviewed-on: https://gerrit.libreoffice.org/10895
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/XMLTextHeaderFooterContext.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/xmloff/source/text/XMLTextHeaderFooterContext.cxx b/xmloff/source/text/XMLTextHeaderFooterContext.cxx index 2a711b02fa73..27cbc9c62a4c 100644 --- a/xmloff/source/text/XMLTextHeaderFooterContext.cxx +++ b/xmloff/source/text/XMLTextHeaderFooterContext.cxx @@ -18,6 +18,7 @@ */ #include <com/sun/star/text/XText.hpp> +#include <com/sun/star/text/XParagraphAppend.hpp> #include <com/sun/star/text/XRelativeTextContentRemove.hpp> #include <xmloff/nmspmap.hxx> #include <xmloff/xmlnmspe.hxx> @@ -158,8 +159,16 @@ SvXMLImportContext *XMLTextHeaderFooterContext::CreateChildContext( if( bRemoveContent ) { - OUString aText; - xText->setString( aText ); + xText->setString(OUString()); + // fdo#82165 shapes anchored at the beginning or end survive + // setString("") - kill them the hard way: SwDoc::DelFullPara() + uno::Reference<text::XParagraphAppend> const xAppend( + xText, uno::UNO_QUERY_THROW); + uno::Reference<lang::XComponent> const xPara( + xAppend->finishParagraph( + uno::Sequence<beans::PropertyValue>()), + uno::UNO_QUERY_THROW); + xPara->dispose(); } UniReference < XMLTextImportHelper > xTxtImport = |