cp#2013101510000026: wrong highlight of commented text range imported from doc

When makeFieldBookmark() method is called with
ODF_COMMENTRANGE it will ignore the added field name and
generate an own one. We have to set the name of the
SwPostItField to this generated name so these two names will match.

Note: lTagBkmk is only an identifier but not the exported name
of the fieldmark so we don't need to stick to use it as
a name.

Change-Id: I499abdcce1be0563c308bcf9f5c0a959a07f858b
This commit is contained in:
Zolnai Tamás 2014-01-03 11:38:05 +01:00
parent 6fd7f5b1c9
commit 12e287220e
2 changed files with 3 additions and 5 deletions

View File

@ -194,7 +194,6 @@ DECLARE_WW8IMPORT_TEST(testFdo59530, "fdo59530.doc")
uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
xPropertySet.set(xFields->nextElement(), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString("346376201"), getProperty<OUString>(xPropertySet, "Name"));
CPPUNIT_ASSERT_EQUAL(OUString("M"), getProperty<OUString>(xPropertySet, "Initials"));
}

View File

@ -2124,7 +2124,6 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
OUString sAuthor;
OUString sInitials;
OUString sName;
if( bVer67 )
{
const WW67_ATRD* pDescri = (const WW67_ATRD*)pSD->GetData();
@ -2157,7 +2156,6 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
sal_uInt32 nTagBkmk = SVBT32ToUInt32(pDescri->ITagBkmk);
if (nTagBkmk != 0xFFFFFFFF)
{
sName = OUString::number(nTagBkmk);
int nAtnIndex = GetAnnotationIndex(nTagBkmk);
if (nAtnIndex != -1)
{
@ -2192,14 +2190,15 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
this->pFmtOfJustInsertedApo = 0;
SwPostItField aPostIt(
(SwPostItFieldType*)rDoc.GetSysFldType(RES_POSTITFLD), sAuthor,
sTxt, sInitials, sName, aDate );
sTxt, sInitials, OUString(), aDate );
aPostIt.SetTextObject(pOutliner);
// If this is a range, create the associated fieldmark.
if (pPaM->HasMark())
{
IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess();
pMarksAccess->makeFieldBookmark(*pPaM, aPostIt.GetName(), ODF_COMMENTRANGE);
sw::mark::IFieldmark* pFieldmark = pMarksAccess->makeFieldBookmark(*pPaM, OUString(), ODF_COMMENTRANGE);
aPostIt.SetName(pFieldmark->GetName());
pPaM->Exchange();
pPaM->DeleteMark();
}