[Libreoffice-commits] core.git: sw/source

Michael Stahl mstahl at redhat.com
Wed May 7 06:11:32 PDT 2014


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

New commits:
commit cc0a7699bb79efad488094e33464d4793758ee3f
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

diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx
index 475efa7..4dc1816 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, 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 )
@@ -222,7 +192,6 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, 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