From f378c85a705be23ddc7523c3122807393d27095a Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Wed, 7 Dec 2011 16:09:26 +0100 Subject: Header/Footer: update the label as the page style may have changed --- sw/source/ui/docvw/HeaderFooterWin.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sw/source/ui/docvw/HeaderFooterWin.cxx') 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 ) ); -- cgit v1.2.3