tdf#60683 tdf#55946 doc import: use style's anchor info

make CppunitTest_sw_ww8export CPPUNIT_TEST_NAME=testBnc787942

Change-Id: Ie1dc179fc3954b5eed73f3ee1f6dc95f4785f3e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152331
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index fd4da52..9658c7e 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -575,11 +575,11 @@ DECLARE_WW8EXPORT_TEST(testFdo81102, "fdo81102.doc")
DECLARE_WW8EXPORT_TEST(testBnc787942, "bnc787942.doc")
{
    // The frame ended up on the second page instead of first.

    // this is on page 1 in Word
    parseDump("/root/page[1]/body/txt[4]/anchored");

    CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_PARALLEL, getProperty<text::WrapTextMode>(getShape(1), "Surround"));
    CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(getShape(1), "HoriOrientRelation"));
}

DECLARE_WW8EXPORT_TEST(testTdf133504_wrapNotBeside, "tdf133504_wrapNotBeside.doc")
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index ee70150..71fd719 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -418,11 +418,12 @@ ApoTestResults SwWW8ImplReader::TestApo(int nCellLevel, bool bTableRowEnd,
    to see if we are still in that frame.
    */

    aRet.m_bHasSprm37 = m_xPlcxMan->HasParaSprm(m_bVer67 ? 37 : 0x2423).pSprm != nullptr;
    SprmResult aSrpm29 = m_xPlcxMan->HasParaSprm(m_bVer67 ? 29 : 0x261B);
    aRet.m_bHasSprm37 = m_xPlcxMan->HasParaSprm(m_bVer67 ? 37 : 0x2423).pSprm != nullptr; // sprmPWr
    SprmResult aSrpm29 = m_xPlcxMan->HasParaSprm(m_bVer67 ? 29 : 0x261B); // sprmPPc
    const sal_uInt8 *pSrpm29 = aSrpm29.pSprm;
    aRet.m_bHasSprm29 = pSrpm29 != nullptr;
    aRet.m_nSprm29 = (pSrpm29 && aSrpm29.nRemainingData >= 1) ? *pSrpm29 : 0;
    const sal_Int16 nTPc = aRet.mpStyleApo ? aRet.mpStyleApo->nTPc : 0;
    aRet.m_nSprm29 = (pSrpm29 && aSrpm29.nRemainingData >= 1) ? *pSrpm29 : nTPc;

    // Is there some frame data here
    bool bNowApo = aRet.HasFrame() || pTopLevelTable;