summaryrefslogtreecommitdiff
path: root/sw/source/ui/docvw/HeaderFooterWin.cxx
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:15:23 +0100
commitf378c85a705be23ddc7523c3122807393d27095a (patch)
tree4860fdc676dabcf4fbbaa1ca1e1be1b01412df59 /sw/source/ui/docvw/HeaderFooterWin.cxx
parente4c8b865d0e05f848bb4b8eac53c1b14466bb8f3 (diff)
Header/Footer: update the label as the page style may have changed
Diffstat (limited to 'sw/source/ui/docvw/HeaderFooterWin.cxx')
-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 ) );