[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Wed Dec 7 07:16:00 PST 2011


 sw/source/ui/docvw/HeaderFooterWin.cxx |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit f378c85a705be23ddc7523c3122807393d27095a
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Wed Dec 7 16:09:26 2011 +0100

    Header/Footer: update the label as the page style may have changed

diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx
index 076ce17..d8f6395 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 ) );


More information about the Libreoffice-commits mailing list