summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-05-07 14:54:54 +0200
committerCaolán McNamara <caolanm@redhat.com>2014-05-08 07:52:04 +0000
commit17aeb9e1f0922154a1cf342d17a869161b114f65 (patch)
treea170fbcec7596ad60c09bc6b5c4857c2b691257d /sw
parent8fb7fa143cca628654933459135eee6c3f1450d4 (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 (cherry picked from commit cc0a7699bb79efad488094e33464d4793758ee3f) Reviewed-on: https://gerrit.libreoffice.org/9271 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-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 e7fe5205eba3..86c6de2c1922 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