summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2011-12-07 16:09:26 +0100
committerCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2011-12-07 16:10:42 +0100
commita0afe6f397b508d2b649dab4bfdd05caecf4bd8a (patch)
treeda7d8468f7a816e58f3937ac9006b1ee302e46c5 /sw
parent1658c1f23a68635a1d67105ebf1a7023df8788c0 (diff)
Header/Footer: update the label as the page style may have changed
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/docvw/HeaderFooterWin.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx
index 076ce17a4cd1..d8f6395c52be 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -162,13 +162,6 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const SwPageFrm* pPag
// Use pixels for the rest of the drawing
SetMapMode( MapMode ( MAP_PIXEL ) );
- // Compute the text to show
- m_sLabel = ResId::toString( SW_RES( STR_HEADER_TITLE ) );
- if ( !m_bIsHeader )
- m_sLabel = ResId::toString( SW_RES( STR_FOOTER_TITLE ) );
- sal_Int32 nPos = m_sLabel.lastIndexOf( rtl::OUString::createFromAscii( "%1" ) );
- m_sLabel = m_sLabel.replaceAt( nPos, 2, GetPageFrame()->GetPageDesc()->GetName() );
-
// Create the line control
basegfx::BColor aColor = SwViewOption::GetHeaderFooterMarkColor().getBColor();
m_pLine = new SwDashedLine( GetEditWin(), aColor );
@@ -208,6 +201,13 @@ const SwPageFrm* SwHeaderFooterWin::GetPageFrame( )
void SwHeaderFooterWin::SetOffset( Point aOffset, long nXLineStart, long nXLineEnd )
{
+ // Compute the text to show
+ m_sLabel = ResId::toString( SW_RES( STR_HEADER_TITLE ) );
+ if ( !m_bIsHeader )
+ m_sLabel = ResId::toString( SW_RES( STR_FOOTER_TITLE ) );
+ sal_Int32 nPos = m_sLabel.lastIndexOf( rtl::OUString::createFromAscii( "%1" ) );
+ m_sLabel = m_sLabel.replaceAt( nPos, 2, GetPageFrame()->GetPageDesc()->GetName() );
+
// Compute the text size and get the box position & size from it
Rectangle aTextRect;
GetTextBoundRect( aTextRect, String( m_sLabel ) );