Kaydet (Commit) 691ca4e1 authored tarafından Vasily Melenchuk's avatar Vasily Melenchuk Kaydeden (comit) Thorsten Behrens

tdf#121440 writerfilter: do not use imported style for foot/endnotes

Extra style is causing editing problem near footnote/endnote
references. This behavior is a side effect of
eaa9cf6a, allowing emission
of these "technical" styles.

Change-Id: I1885b92814746e7b5cd19f3ddd7bc22eb691615e
Reviewed-on: https://gerrit.libreoffice.org/68304
Tested-by: Jenkins
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst e76203f4
......@@ -39,6 +39,7 @@ $(eval $(call gb_CppunitTest_use_externals,sw_ooxmlimport2,\
$(eval $(call gb_CppunitTest_set_include,sw_ooxmlimport2,\
-I$(SRCDIR)/sw/inc \
-I$(SRCDIR)/sw/source/core/inc \
-I$(SRCDIR)/sw/source/uibase/inc \
-I$(SRCDIR)/sw/qa/extras/inc \
$$(INCLUDE) \
))
......
......@@ -17,6 +17,7 @@
#endif
#include <swmodeltestbase.hxx>
#include <wrtsh.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/document/XEmbeddedObjectSupplier2.hpp>
#include <com/sun/star/embed/Aspects.hpp>
......@@ -306,6 +307,22 @@ DECLARE_OOXMLIMPORT_TEST(testTdf122224, "tdf122224.docx")
CPPUNIT_ASSERT_EQUAL(OUString("2000"), xCell->getString());
}
DECLARE_OOXMLIMPORT_TEST(testTdf121440, "tdf121440.docx")
{
// Insert some text in front of footnote
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell();
SwRootFrame* pLayout(pWrtShell->GetLayout());
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
pWrtShell->Insert("test");
// Ensure that inserted text is not superscripted
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Inserted text should be not a superscript!", static_cast<sal_Int32>(0),
getProperty<sal_Int32>(getRun(getParagraph(1), 1), "CharEscapement"));
}
// tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT
CPPUNIT_PLUGIN_IMPLEMENT();
......
......@@ -2015,6 +2015,12 @@ void DomainMapper_Impl::PushFootOrEndnote( bool bIsFootnote )
m_aRedlines.push(std::vector< RedlineParamsPtr >());
PropertyMapPtr pTopContext = GetTopContext();
// Remove style reference, if any. This reference did appear here as a side effect of tdf#43017
// Seems it is not required by LO, but causes side effects during editing. So remove it
// for footnotes/endnotes to restore original LO behavior here.
pTopContext->Erase(PROP_CHAR_STYLE_NAME);
uno::Reference< text::XText > xFootnoteText;
if (GetTextFactory().is())
xFootnoteText.set( GetTextFactory()->createInstance(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment