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: ...@@ -85,7 +85,7 @@ public:
const SwTextFootnote *GetTextFootnote() const { return m_pTextAttr; } const SwTextFootnote *GetTextFootnote() const { return m_pTextAttr; }
SwTextFootnote *GetTextFootnote() { 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. /// Returns string to be displayed of footnote / endnote.
OUString GetViewNumStr(const SwDoc& rDoc, SwRootFrame const* pLayout, OUString GetViewNumStr(const SwDoc& rDoc, SwRootFrame const* pLayout,
......
...@@ -179,8 +179,9 @@ SwFormatFootnote::~SwFormatFootnote() ...@@ -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() ) if( m_pTextAttr->GetStartNode() )
{ {
SwNodeIndex aIdx( *m_pTextAttr->GetStartNode(), 1 ); SwNodeIndex aIdx( *m_pTextAttr->GetStartNode(), 1 );
...@@ -189,16 +190,20 @@ void SwFormatFootnote::GetFootnoteText( OUString& rStr ) const ...@@ -189,16 +190,20 @@ void SwFormatFootnote::GetFootnoteText( OUString& rStr ) const
pCNd = aIdx.GetNodes().GoNext( &aIdx ); pCNd = aIdx.GetNodes().GoNext( &aIdx );
if( pCNd->IsTextNode() ) { if( pCNd->IsTextNode() ) {
rStr = static_cast<SwTextNode*>(pCNd)->GetExpandText(nullptr/*TODO*/); buf.append(static_cast<SwTextNode*>(pCNd)->GetExpandText(&rLayout));
++aIdx; ++aIdx;
while ( !aIdx.GetNode().IsEndNode() ) { while ( !aIdx.GetNode().IsEndNode() ) {
if ( aIdx.GetNode().IsTextNode() ) if ( aIdx.GetNode().IsTextNode() )
rStr += " " + aIdx.GetNode().GetTextNode()->GetExpandText(nullptr/*TODO*/); {
buf.append(" ");
buf.append(aIdx.GetNode().GetTextNode()->GetExpandText(&rLayout));
}
++aIdx; ++aIdx;
} }
} }
} }
return buf.makeStringAndClear();
} }
/// return the view string of the foot/endnote /// return the view string of the foot/endnote
......
...@@ -246,8 +246,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) ...@@ -246,8 +246,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
if( aContentAtPos.pFndTextAttr && aContentAtPos.aFnd.pAttr ) if( aContentAtPos.pFndTextAttr && aContentAtPos.aFnd.pAttr )
{ {
const SwFormatFootnote* pFootnote = static_cast<const SwFormatFootnote*>(aContentAtPos.aFnd.pAttr); const SwFormatFootnote* pFootnote = static_cast<const SwFormatFootnote*>(aContentAtPos.aFnd.pAttr);
OUString sTmp; OUString sTmp(pFootnote->GetFootnoteText(*rSh.GetLayout()));
pFootnote->GetFootnoteText( sTmp );
sText = SwResId( pFootnote->IsEndNote() sText = SwResId( pFootnote->IsEndNote()
? STR_ENDNOTE : STR_FTNNOTE ) + sTmp; ? STR_ENDNOTE : STR_FTNNOTE ) + sTmp;
bBalloon = true; 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