kbrown / rpms / libreoffice

Forked from rpms/libreoffice 2 years ago
Clone

Blame SOURCES/0100-cp-2013101510000026-wrong-highlight-of-commented-tex.patch

f0633d
From 28d59a1a48d633f438e344f247362af0858d8911 Mon Sep 17 00:00:00 2001
f0633d
From: =?UTF-8?q?Zolnai=20Tam=C3=A1s?= <tamas.zolnai@collabora.com>
f0633d
Date: Fri, 3 Jan 2014 11:38:05 +0100
f0633d
Subject: [PATCH 100/109] cp#2013101510000026: wrong highlight of commented
f0633d
 text range imported from doc
f0633d
f0633d
When makeFieldBookmark() method is called with
f0633d
ODF_COMMENTRANGE it will ignore the added field name and
f0633d
generate an own one. We have to set the name of the
f0633d
SwPostItField to this generated name so these two names will match.
f0633d
f0633d
Note: lTagBkmk is only an identifier but not the exported name
f0633d
of the fieldmark so we don't need to stick to use it as
f0633d
a name.
f0633d
f0633d
(cherry picked from commit 12e287220ebaf3a8f5eaf7bf526dce2c47f45a20)
f0633d
f0633d
Conflicts:
f0633d
	sw/source/filter/ww8/ww8par.cxx
f0633d
f0633d
(cherry picked from commit d6fc6624e1319257945f49388d635c36685108d5)
f0633d
f0633d
Change-Id: I499abdcce1be0563c308bcf9f5c0a959a07f858b
f0633d
---
f0633d
 sw/qa/extras/ww8import/ww8import.cxx | 1 -
f0633d
 sw/source/filter/ww8/ww8par.cxx      | 7 +++----
f0633d
 2 files changed, 3 insertions(+), 5 deletions(-)
f0633d
f0633d
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
f0633d
index ef68da6..50ef934 100644
f0633d
--- a/sw/qa/extras/ww8import/ww8import.cxx
f0633d
+++ b/sw/qa/extras/ww8import/ww8import.cxx
f0633d
@@ -242,7 +242,6 @@ void Test::testFdo59530()
f0633d
     uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
f0633d
     uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
f0633d
     xPropertySet.set(xFields->nextElement(), uno::UNO_QUERY);
f0633d
-    CPPUNIT_ASSERT_EQUAL(OUString("346376201"), getProperty<OUString>(xPropertySet, "Name"));
f0633d
     CPPUNIT_ASSERT_EQUAL(OUString("M"), getProperty<OUString>(xPropertySet, "Initials"));
f0633d
 }
f0633d
 
f0633d
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
f0633d
index b34b966..56040b7 100644
f0633d
--- a/sw/source/filter/ww8/ww8par.cxx
f0633d
+++ b/sw/source/filter/ww8/ww8par.cxx
f0633d
@@ -1790,7 +1790,6 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
f0633d
 
f0633d
     String sAuthor;
f0633d
     String sInitials;
f0633d
-    String sName;
f0633d
     if( bVer67 )
f0633d
     {
f0633d
         const WW67_ATRD* pDescri = (const WW67_ATRD*)pSD->GetData();
f0633d
@@ -1820,7 +1819,6 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
f0633d
         sal_uInt32 nTagBkmk = SVBT32ToUInt32(pDescri->ITagBkmk);
f0633d
         if (nTagBkmk != 0xFFFFFFFF)
f0633d
         {
f0633d
-            sName = OUString::valueOf(sal_Int32(nTagBkmk));
f0633d
             int nAtnIndex = GetAnnotationIndex(nTagBkmk);
f0633d
             if (nAtnIndex != -1)
f0633d
             {
f0633d
@@ -1855,14 +1853,15 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
f0633d
     this->pFmtOfJustInsertedApo = 0;
f0633d
     SwPostItField aPostIt(
f0633d
         (SwPostItFieldType*)rDoc.GetSysFldType(RES_POSTITFLD), sAuthor,
f0633d
-        sTxt, sInitials, sName, aDate );
f0633d
+        sTxt, sInitials, String(), aDate );
f0633d
     aPostIt.SetTextObject(pOutliner);
f0633d
 
f0633d
     // If this is a range, create the associated fieldmark.
f0633d
     if (pPaM->HasMark())
f0633d
     {
f0633d
         IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess();
f0633d
-        pMarksAccess->makeFieldBookmark(*pPaM, aPostIt.GetName(), ODF_COMMENTRANGE);
f0633d
+        sw::mark::IFieldmark* pFieldmark = pMarksAccess->makeFieldBookmark(*pPaM, OUString(), ODF_COMMENTRANGE);
f0633d
+        aPostIt.SetName(pFieldmark->GetName());
f0633d
         pPaM->Exchange();
f0633d
         pPaM->DeleteMark();
f0633d
     }
f0633d
-- 
f0633d
1.8.4.2
f0633d