DOCX import: never call lcl_start/endElement if handling mce elements

The problem was that after handling the mce elements
(AlternativeContent, Choice, Fallback) we still invoked the lcl version
of these methods and this resulted in duplicated properties in the
dmapper, finally resulting in incorrect position of the textbox.

Change-Id: Ib581162cba703fc1e2e44c1a9e63358891d6f78c
This commit is contained in:
Miklos Vajna
2013-12-05 18:20:51 +01:00
parent b780e0c263
commit 31c65a129a
3 changed files with 12 additions and 2 deletions

Binary file not shown.

View File

@@ -1583,6 +1583,16 @@ DECLARE_OOXMLIMPORT_TEST(testMceWpg, "mce-wpg.docx")
getParagraphOfText(1, xText, "DML1");
}
DECLARE_OOXMLIMPORT_TEST(testMceNested, "mce-nested.docx")
{
// Vertical position of the textbox was incorrect due to incorrect nested mce handling.
uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
// positionV's posOffset from the bugdoc, was 0.
CPPUNIT_ASSERT_EQUAL(sal_Int32(EMU_TO_MM100(2514600)), getProperty<sal_Int32>(xFrame, "VertOrientPosition"));
}
DECLARE_OOXMLIMPORT_TEST(testFdo70457, "fdo70457.docx")
{
// The document contains a rotated bitmap

View File

@@ -242,7 +242,7 @@ void SAL_CALL OOXMLFastContextHandler::startFastElement
if (oox::getNamespace(Element) == static_cast<sal_Int32>(NS_mce))
m_bDiscardChildren = prepareMceContext(Element, Attribs);
if (!m_bDiscardChildren)
else if (!m_bDiscardChildren)
{
attributes(Attribs);
lcl_startFastElement(Element, Attribs);
@@ -283,7 +283,7 @@ throw (uno::RuntimeException, xml::sax::SAXException)
m_bTookChoice = aState.m_bTookChoice;
}
if (!m_bDiscardChildren)
else if (!m_bDiscardChildren)
lcl_endFastElement(Element);
#ifdef DEBUG_CONTEXT_HANDLER