summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-07 15:34:03 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-11-10 19:47:00 +0100
commite90db02984daad3ed664d4bd876011f991e59d10 (patch)
treefa814ec813d5fe52202d6c12aacb13a91cdb6b79 /sw
parent1e82786b097e1f6e4e9553d0962130cb2dcb45c7 (diff)
sw_redlinehide_3: adapt SwChapterField::ChangeExpansion()
Add layout parameter to find the correct outline node. Change-Id: I15477dff18c3e5e34b291a92878d938d04497436
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/chpfld.hxx3
-rw-r--r--sw/source/core/fields/chpfld.cxx16
2 files changed, 11 insertions, 8 deletions
diff --git a/sw/inc/chpfld.hxx b/sw/inc/chpfld.hxx
index eb0b6c0ee17b..1b85246fba11 100644
--- a/sw/inc/chpfld.hxx
+++ b/sw/inc/chpfld.hxx
@@ -24,6 +24,7 @@
class SwFrame;
class SwContentNode;
class SwTextNode;
+class SwRootFrame;
enum SwChapterFormat
{
@@ -64,7 +65,7 @@ public:
void ChangeExpansion( const SwFrame&,
const SwContentNode*,
bool bSrchNum = false);
- void ChangeExpansion(const SwTextNode &rNd, bool bSrchNum);
+ void ChangeExpansion(const SwTextNode &rNd, bool bSrchNum, SwRootFrame const* pLayout = nullptr);
inline sal_uInt8 GetLevel() const;
inline void SetLevel(sal_uInt8);
diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx
index a7b1fd3911c6..0702ca92d379 100644
--- a/sw/source/core/fields/chpfld.cxx
+++ b/sw/source/core/fields/chpfld.cxx
@@ -20,6 +20,7 @@
#include <com/sun/star/text/ChapterFormat.hpp>
#include <doc.hxx>
#include <frame.hxx>
+#include <txtfrm.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
#include <chpfld.hxx>
@@ -114,11 +115,12 @@ void SwChapterField::ChangeExpansion(const SwFrame & rFrame,
if ( pTextNode )
{
- ChangeExpansion( *pTextNode, bSrchNum );
+ ChangeExpansion( *pTextNode, bSrchNum, rFrame.getRootFrame() );
}
}
-void SwChapterField::ChangeExpansion(const SwTextNode &rTextNd, bool bSrchNum)
+void SwChapterField::ChangeExpansion(const SwTextNode &rTextNd, bool bSrchNum,
+ SwRootFrame const*const pLayout)
{
m_sNumber.clear();
m_sTitle.clear();
@@ -126,7 +128,7 @@ void SwChapterField::ChangeExpansion(const SwTextNode &rTextNd, bool bSrchNum)
m_sPre.clear();
SwDoc* pDoc = const_cast<SwDoc*>(rTextNd.GetDoc());
- const SwTextNode *pTextNd = rTextNd.FindOutlineNodeOfLevel( m_nLevel );
+ const SwTextNode *pTextNd = rTextNd.FindOutlineNodeOfLevel(m_nLevel, pLayout);
if( pTextNd )
{
if( bSrchNum )
@@ -152,7 +154,7 @@ void SwChapterField::ChangeExpansion(const SwTextNode &rTextNd, bool bSrchNum)
if (!m_nLevel--)
break;
- pONd = pTextNd->FindOutlineNodeOfLevel( m_nLevel );
+ pONd = pTextNd->FindOutlineNodeOfLevel(m_nLevel, pLayout);
}
else
break;
@@ -166,7 +168,7 @@ void SwChapterField::ChangeExpansion(const SwTextNode &rTextNd, bool bSrchNum)
// correction of refactoring done by cws swnumtree:
// retrieve numbering string without prefix and suffix strings
// as stated in the above german comment.
- m_sNumber = pTextNd->GetNumString( false );
+ m_sNumber = pTextNd->GetNumString(false, MAXLEVEL, pLayout);
SwNumRule* pRule( pTextNd->GetNumRule() );
if ( pTextNd->IsCountedInList() && pRule )
@@ -187,8 +189,8 @@ void SwChapterField::ChangeExpansion(const SwTextNode &rTextNd, bool bSrchNum)
m_sNumber = "??";
}
- m_sTitle = removeControlChars(pTextNd->GetExpandText(0, -1, false, false, false));
-
+ m_sTitle = removeControlChars(sw::GetExpandTextMerged(pLayout,
+ *pTextNd, false, false, ExpandMode(0)));
}
}