[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sw/source

Michael Stahl mstahl at redhat.com
Thu May 8 00:52:34 PDT 2014


 sw/source/core/fields/chpfld.cxx |   31 -------------------------------
 1 file changed, 31 deletions(-)

New commits:
commit 17aeb9e1f0922154a1cf342d17a869161b114f65
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 7 14:54:54 2014 +0200

    fdo#75519: fix chapter cross references
    
    It would be possible to modify the condition in
    SwChapterField::ChangeExpansion() to check for rTxtNd.GetNumRule() as
    well and make the bugdoc work again, but do we really want to use
    "chapter reference" to refer to plain numbering?  Perhaps it would be
    better to add a "numbering reference" field type; without investigating
    what Word actually does here and what the actual problem is that was
    supposedly fixed here (which is not possible given there's no reproducer
    document) it's best for now to just revert it.
    
    (regression from commit 6319803762d051c4aa645692cde7245a1bbcf7ee)
    
    Change-Id: I7eb9ea46e42729c53c350ff450d49a1eb84ee8eb
    (cherry picked from commit cc0a7699bb79efad488094e33464d4793758ee3f)
    Reviewed-on: https://gerrit.libreoffice.org/9271
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx
index e7fe520..86c6de2 100644
--- a/sw/source/core/fields/chpfld.cxx
+++ b/sw/source/core/fields/chpfld.cxx
@@ -122,41 +122,11 @@ void SwChapterField::ChangeExpansion(const SwFrm* pFrm,
 
 void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, sal_Bool bSrchNum)
 {
-    //i120759,this function is for both the reference chapter field and normal chapter field
-    //bSrchNum can distinguish the two types,to the latter type,the outline num rule is must...
     sNumber = OUString();
     sTitle = OUString();
     sPost = OUString();
     sPre = OUString();
-    //The reference chapter field of normal num rule will be handled in this code segment
-    if (bSrchNum && !rTxtNd.IsOutline())
-    {
-        SwNumRule* pRule(rTxtNd.GetNumRule());
-        if (rTxtNd.IsCountedInList() && pRule)
-        {
-            sNumber = rTxtNd.GetNumString(false);
-
-            int nListLevel = rTxtNd.GetActualListLevel();
-
-            if (nListLevel < 0)
-                nListLevel = 0;
 
-            if (nListLevel >= MAXLEVEL)
-                nListLevel = MAXLEVEL - 1;
-
-            const SwNumFmt& rNFmt = pRule->Get(static_cast<unsigned short>(nListLevel));
-            sPost = rNFmt.GetSuffix();
-            sPre = rNFmt.GetPrefix();
-        }
-        else
-        {
-            sNumber = "??";
-        }
-        sTitle = removeControlChars(rTxtNd.GetExpandTxt());
-    }
-    else
-    {
-    //End
     SwDoc* pDoc = (SwDoc*)rTxtNd.GetDoc();
     const SwTxtNode *pTxtNd = rTxtNd.FindOutlineNodeOfLevel( nLevel );
     if( pTxtNd )
@@ -216,7 +186,6 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, sal_Bool bSrchNum)
         sTitle = removeControlChars(pTxtNd->GetExpandTxt(0, -1, false, false, false, false));
 
     }
-    }
 }
 
 bool SwChapterField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const


More information about the Libreoffice-commits mailing list