Kaydet (Commit) ad292b0a authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide_3: adapt SwFormatFootnote::GetFootnoteText()

Change-Id: I206d7345525a4de0f9ece6bac575f82ff1f96df8
üst d9976f4d
......@@ -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,
......
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment