summaryrefslogtreecommitdiff
path: root/sw/source/core/txtnode
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-08 13:46:03 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-11-10 19:49:27 +0100
commit1cfe06a6ac01d8b16659938be460a1ced78ff870 (patch)
tree389c03894527974c2676e9b5e08b1a32c3812c7d /sw/source/core/txtnode
parent12cbb804a5ad8b076dd330bb7e2ea67d4bb1bba1 (diff)
sw_redlinehide_3: pass current layout through ModelToViewHelper
The expansion of footnotes (and soon text fields) depends on the layout's mode. In SwXFlatParagraphIterator, just use whatever is SwDoc's "current" layout, should be good enough... Change-Id: Ica3b9eae56b14910c435c0f9c3f8ab6dbcda105f
Diffstat (limited to 'sw/source/core/txtnode')
-rw-r--r--sw/source/core/txtnode/modeltoviewhelper.cxx5
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx4
-rw-r--r--sw/source/core/txtnode/txtedt.cxx6
3 files changed, 9 insertions, 6 deletions
diff --git a/sw/source/core/txtnode/modeltoviewhelper.cxx b/sw/source/core/txtnode/modeltoviewhelper.cxx
index 6b6dcb855e4c..8302e34604ce 100644
--- a/sw/source/core/txtnode/modeltoviewhelper.cxx
+++ b/sw/source/core/txtnode/modeltoviewhelper.cxx
@@ -80,7 +80,8 @@ struct containsPos
}
};
-ModelToViewHelper::ModelToViewHelper(const SwTextNode &rNode, ExpandMode eMode)
+ModelToViewHelper::ModelToViewHelper(const SwTextNode &rNode,
+ SwRootFrame const*const pLayout, ExpandMode eMode)
{
const OUString& rNodeText = rNode.GetText();
m_aRetText = rNodeText;
@@ -162,7 +163,7 @@ ModelToViewHelper::ModelToViewHelper(const SwTextNode &rNode, ExpandMode eMode)
const SwDoc *pDoc = rNode.GetDoc();
aFieldResult.m_sExpand = (eMode & ExpandMode::ReplaceMode)
? OUString(CHAR_ZWSP)
- : rFootnote.GetViewNumStr(*pDoc, nullptr/*TODO?*/);
+ : rFootnote.GetViewNumStr(*pDoc, pLayout);
aFieldResult.m_eType = FieldResult::FOOTNOTE;
}
break;
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index cbf522687445..7dbacee6596d 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3390,8 +3390,8 @@ OUString SwTextNode::GetExpandText( const sal_Int32 nIdx,
{
ExpandMode eMode = ExpandMode::ExpandFields | eAdditionalMode;
- ModelToViewHelper aConversionMap(*this, eMode);
- const OUString& aExpandText = aConversionMap.getViewText();
+ ModelToViewHelper aConversionMap(*this, nullptr/*TODO*/, eMode);
+ const OUString aExpandText = aConversionMap.getViewText();
const sal_Int32 nExpandBegin = aConversionMap.ConvertToViewPosition( nIdx );
sal_Int32 nEnd = nLen == -1 ? GetText().getLength() : nIdx + nLen;
const sal_Int32 nExpandEnd = aConversionMap.ConvertToViewPosition( nEnd );
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 74b33c963af8..d3e640531f79 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1507,7 +1507,7 @@ SwRect SwTextFrame::SmartTagScan(SwTextNode & rNode)
if ( nBegin < nEnd )
{
// Expand the string:
- const ModelToViewHelper aConversionMap(*pNode /*TODO - replace or expand fields for smart tags?*/);
+ const ModelToViewHelper aConversionMap(*pNode, getRootFrame() /*TODO - replace or expand fields for smart tags?*/);
const OUString& aExpandText = aConversionMap.getViewText();
// Ownership ov ConversionMap is passed to SwXTextMarkup object!
@@ -2064,7 +2064,9 @@ bool SwTextNode::CountWords( SwDocStat& rStat,
}
// ConversionMap to expand fields, remove invisible and redline deleted text for scanner
- const ModelToViewHelper aConversionMap(*this, ExpandMode::ExpandFields | ExpandMode::ExpandFootnote | ExpandMode::HideInvisible | ExpandMode::HideDeletions);
+ const ModelToViewHelper aConversionMap(*this,
+ getIDocumentLayoutAccess().GetCurrentLayout(),
+ ExpandMode::ExpandFields | ExpandMode::ExpandFootnote | ExpandMode::HideInvisible | ExpandMode::HideDeletions);
const OUString& aExpandText = aConversionMap.getViewText();
if (aExpandText.isEmpty() && !bCountNumbering)