summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-08 15:26:58 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-11-14 18:42:15 +0100
commit6806a1cae7703fb3dd1f36578cee6c5eaa797269 (patch)
tree17f64b6b25c451c00104a7bc48950f1793104b3e
parent71aec8511c8f934619c52d151346badf00c2d169 (diff)
sw_redlinehide_3: adapt SwFormatFootnote::GetFootnoteText()
Change-Id: I206d7345525a4de0f9ece6bac575f82ff1f96df8
-rw-r--r--sw/inc/fmtftn.hxx2
-rw-r--r--sw/source/core/txtnode/atrftn.cxx11
-rw-r--r--sw/source/uibase/docvw/edtwin2.cxx3
3 files changed, 10 insertions, 6 deletions
diff --git a/sw/inc/fmtftn.hxx b/sw/inc/fmtftn.hxx
index 5c22c157fb49..44ccc9556c46 100644
--- a/sw/inc/fmtftn.hxx
+++ b/sw/inc/fmtftn.hxx
@@ -85,7 +85,7 @@ public:
const SwTextFootnote *GetTextFootnote() const { return m_pTextAttr; }
SwTextFootnote *GetTextFootnote() { return m_pTextAttr; }
- void GetFootnoteText( OUString& rStr ) const;
+ OUString GetFootnoteText(SwRootFrame const& rLayout) const;
/// Returns string to be displayed of footnote / endnote.
OUString GetViewNumStr(const SwDoc& rDoc, SwRootFrame const* pLayout,
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index a2b3f35b5e70..e1a849b35d2c 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -179,8 +179,9 @@ SwFormatFootnote::~SwFormatFootnote()
{
}
-void SwFormatFootnote::GetFootnoteText( OUString& rStr ) const
+OUString SwFormatFootnote::GetFootnoteText(SwRootFrame const& rLayout) const
{
+ OUStringBuffer buf;
if( m_pTextAttr->GetStartNode() )
{
SwNodeIndex aIdx( *m_pTextAttr->GetStartNode(), 1 );
@@ -189,16 +190,20 @@ void SwFormatFootnote::GetFootnoteText( OUString& rStr ) const
pCNd = aIdx.GetNodes().GoNext( &aIdx );
if( pCNd->IsTextNode() ) {
- rStr = static_cast<SwTextNode*>(pCNd)->GetExpandText(nullptr/*TODO*/);
+ buf.append(static_cast<SwTextNode*>(pCNd)->GetExpandText(&rLayout));
++aIdx;
while ( !aIdx.GetNode().IsEndNode() ) {
if ( aIdx.GetNode().IsTextNode() )
- rStr += " " + aIdx.GetNode().GetTextNode()->GetExpandText(nullptr/*TODO*/);
+ {
+ buf.append(" ");
+ buf.append(aIdx.GetNode().GetTextNode()->GetExpandText(&rLayout));
+ }
++aIdx;
}
}
}
+ return buf.makeStringAndClear();
}
/// return the view string of the foot/endnote
diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx
index cb6e4d07181f..d85cb168b02f 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -246,8 +246,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
if( aContentAtPos.pFndTextAttr && aContentAtPos.aFnd.pAttr )
{
const SwFormatFootnote* pFootnote = static_cast<const SwFormatFootnote*>(aContentAtPos.aFnd.pAttr);
- OUString sTmp;
- pFootnote->GetFootnoteText( sTmp );
+ OUString sTmp(pFootnote->GetFootnoteText(*rSh.GetLayout()));
sText = SwResId( pFootnote->IsEndNote()
? STR_ENDNOTE : STR_FTNNOTE ) + sTmp;
bBalloon = true;