summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-05-07 14:54:54 +0200
committerMichael Stahl <mstahl@redhat.com>2014-05-07 15:07:19 +0200
commitcc0a7699bb79efad488094e33464d4793758ee3f (patch)
tree31541e288a9214e2cc263cc51bd8860be04e92ea
parent9bd4bd431cefda3602701ea648e221be01af7a5d (diff)
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
-rw-r--r--sw/source/core/fields/chpfld.cxx31
1 files changed, 0 insertions, 31 deletions
diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx
index 475efa76e532..4dc18169b464 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