diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-01-03 11:38:05 +0100 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-01-03 16:59:32 +0100 |
commit | 2f7b405765b929e53cb24b98b9fe1dcc1ff5c798 (patch) | |
tree | 1cdc2bdf99ccd51208e52e8e9f5410b33412c092 /sw | |
parent | d3208b11f950861abafdce24364833579e68d22e (diff) |
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
(cherry picked from commit 12e287220ebaf3a8f5eaf7bf526dce2c47f45a20)
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ww8import/ww8import.cxx | 1 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 7 |
2 files changed, 3 insertions, 5 deletions
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index f7c5b6d2a23f..6b6ae44c90f9 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -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")); } diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 8607c58b03e0..96c3b5a68cfa 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -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(); } |