summaryrefslogtreecommitdiff
path: root/sw/source/uibase/docvw/HeaderFooterWin.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-14 11:36:07 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-14 11:36:07 +0900
commit41df7db9459c61cc03dda0dfb344b8ac7bf901cb (patch)
treef4ff645915528e0978ec1373e264fa60bdd4afc7 /sw/source/uibase/docvw/HeaderFooterWin.cxx
parent7587cf88c9a19325d6aa2c4e75a599e476826840 (diff)
refactor sw Sidebar classes to use RenderContext
Change-Id: I09a4abd8fb34470c4c365aa1f604accd80631ab3
Diffstat (limited to 'sw/source/uibase/docvw/HeaderFooterWin.cxx')
-rw-r--r--sw/source/uibase/docvw/HeaderFooterWin.cxx352
1 files changed, 174 insertions, 178 deletions
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 3f8b5686b08a..7ee871dcee93 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -136,35 +136,32 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const SwPageFrm* pPag
m_aFadeTimer( )
{
// Get the font and configure it
- vcl::Font aFont = GetSettings().GetStyleSettings().GetToolFont();
- SetZoomedPointFont( aFont );
-
- // Use pixels for the rest of the drawing
- SetMapMode( MapMode ( MAP_PIXEL ) );
+ vcl::Font aFont = Application::GetSettings().GetStyleSettings().GetToolFont();
+ SetZoomedPointFont(aFont);
// Create the line control
- m_pLine = VclPtr<SwDashedLine>::Create( GetEditWin(), &SwViewOption::GetHeaderFooterMarkColor );
- m_pLine->SetZOrder( this, WINDOW_ZORDER_BEFOR );
+ m_pLine = VclPtr<SwDashedLine>::Create(GetEditWin(), &SwViewOption::GetHeaderFooterMarkColor);
+ m_pLine->SetZOrder(this, WINDOW_ZORDER_BEFOR);
// Create and set the PopupMenu
- m_pPopupMenu = new PopupMenu( SW_RES( MN_HEADERFOOTER_BUTTON ) );
+ m_pPopupMenu = new PopupMenu(SW_RES(MN_HEADERFOOTER_BUTTON));
// Rewrite the menu entries' text
- if ( m_bIsHeader )
+ if (m_bIsHeader)
{
- m_pPopupMenu->SetItemText( FN_HEADERFOOTER_EDIT, SW_RESSTR( STR_FORMAT_HEADER ) );
- m_pPopupMenu->SetItemText( FN_HEADERFOOTER_DELETE, SW_RESSTR( STR_DELETE_HEADER ) );
+ m_pPopupMenu->SetItemText(FN_HEADERFOOTER_EDIT, SW_RESSTR(STR_FORMAT_HEADER));
+ m_pPopupMenu->SetItemText(FN_HEADERFOOTER_DELETE, SW_RESSTR(STR_DELETE_HEADER));
}
else
{
- m_pPopupMenu->SetItemText( FN_HEADERFOOTER_EDIT, SW_RESSTR( STR_FORMAT_FOOTER ) );
- m_pPopupMenu->SetItemText( FN_HEADERFOOTER_DELETE, SW_RESSTR( STR_DELETE_FOOTER ) );
+ m_pPopupMenu->SetItemText(FN_HEADERFOOTER_EDIT, SW_RESSTR(STR_FORMAT_FOOTER));
+ m_pPopupMenu->SetItemText(FN_HEADERFOOTER_DELETE, SW_RESSTR(STR_DELETE_FOOTER));
}
- SetPopupMenu( m_pPopupMenu );
+ SetPopupMenu(m_pPopupMenu);
- m_aFadeTimer.SetTimeout( 50 );
- m_aFadeTimer.SetTimeoutHdl( LINK( this, SwHeaderFooterWin, FadeHandler ) );
+ m_aFadeTimer.SetTimeout(50);
+ m_aFadeTimer.SetTimeoutHdl(LINK(this, SwHeaderFooterWin, FadeHandler));
}
SwHeaderFooterWin::~SwHeaderFooterWin( )
@@ -184,148 +181,146 @@ const SwPageFrm* SwHeaderFooterWin::GetPageFrame( )
return static_cast< const SwPageFrm * >( GetFrame( ) );
}
-void SwHeaderFooterWin::SetOffset( Point aOffset, long nXLineStart, long nXLineEnd )
+void SwHeaderFooterWin::SetOffset(Point aOffset, long nXLineStart, long nXLineEnd)
{
// Compute the text to show
const SwPageDesc* pDesc = GetPageFrame()->GetPageDesc();
bool bIsFirst = !pDesc->IsFirstShared() && GetPageFrame()->OnFirstPage();
bool bIsLeft = !pDesc->IsHeaderShared() && !GetPageFrame()->OnRightPage();
bool bIsRight = !pDesc->IsHeaderShared() && GetPageFrame()->OnRightPage();
- m_sLabel = SW_RESSTR( STR_HEADER_TITLE );
- if ( !m_bIsHeader )
- m_sLabel = bIsFirst ? SW_RESSTR( STR_FIRST_FOOTER_TITLE )
- : bIsLeft ? SW_RESSTR( STR_LEFT_FOOTER_TITLE )
- : bIsRight ? SW_RESSTR( STR_RIGHT_FOOTER_TITLE )
- : SW_RESSTR( STR_FOOTER_TITLE );
+ m_sLabel = SW_RESSTR(STR_HEADER_TITLE);
+ if (!m_bIsHeader)
+ m_sLabel = bIsFirst ? SW_RESSTR(STR_FIRST_FOOTER_TITLE)
+ : bIsLeft ? SW_RESSTR(STR_LEFT_FOOTER_TITLE)
+ : bIsRight ? SW_RESSTR(STR_RIGHT_FOOTER_TITLE)
+ : SW_RESSTR(STR_FOOTER_TITLE );
else
- m_sLabel = bIsFirst ? SW_RESSTR( STR_FIRST_HEADER_TITLE )
- : bIsLeft ? SW_RESSTR( STR_LEFT_HEADER_TITLE )
- : bIsRight ? SW_RESSTR( STR_RIGHT_HEADER_TITLE )
- : SW_RESSTR( STR_HEADER_TITLE );
+ m_sLabel = bIsFirst ? SW_RESSTR(STR_FIRST_HEADER_TITLE)
+ : bIsLeft ? SW_RESSTR(STR_LEFT_HEADER_TITLE)
+ : bIsRight ? SW_RESSTR(STR_RIGHT_HEADER_TITLE)
+ : SW_RESSTR(STR_HEADER_TITLE);
- sal_Int32 nPos = m_sLabel.lastIndexOf( "%1" );
- m_sLabel = m_sLabel.replaceAt( nPos, 2, pDesc->GetName() );
+ sal_Int32 nPos = m_sLabel.lastIndexOf("%1");
+ m_sLabel = m_sLabel.replaceAt(nPos, 2, pDesc->GetName());
// Compute the text size and get the box position & size from it
Rectangle aTextRect;
- GetTextBoundRect( aTextRect, OUString( m_sLabel ) );
- Rectangle aTextPxRect = LogicToPixel( aTextRect );
- FontMetric aFontMetric = GetFontMetric( GetFont() );
- Size aBoxSize ( aTextPxRect.GetWidth() + BUTTON_WIDTH + TEXT_PADDING * 2,
- aFontMetric.GetLineHeight() + TEXT_PADDING * 2 );
+ GetTextBoundRect(aTextRect, OUString(m_sLabel));
+ Rectangle aTextPxRect = LogicToPixel(aTextRect);
+ FontMetric aFontMetric = GetFontMetric(GetFont());
+ Size aBoxSize (aTextPxRect.GetWidth() + BUTTON_WIDTH + TEXT_PADDING * 2,
+ aFontMetric.GetLineHeight() + TEXT_PADDING * 2 );
long nYFooterOff = 0;
- if ( !m_bIsHeader )
+ if (!m_bIsHeader)
nYFooterOff = aBoxSize.Height();
- Point aBoxPos( aOffset.X() - aBoxSize.Width() - BOX_DISTANCE,
- aOffset.Y() - nYFooterOff );
+ Point aBoxPos(aOffset.X() - aBoxSize.Width() - BOX_DISTANCE,
+ aOffset.Y() - nYFooterOff);
- if ( AllSettings::GetLayoutRTL() )
+ if (AllSettings::GetLayoutRTL())
{
aBoxPos.setX( aOffset.X() + BOX_DISTANCE );
}
// Set the position & Size of the window
- SetPosSizePixel( aBoxPos, aBoxSize );
+ SetPosSizePixel(aBoxPos, aBoxSize);
double nYLinePos = aBoxPos.Y();
- if ( !m_bIsHeader )
+ if (!m_bIsHeader)
nYLinePos += aBoxSize.Height();
- Point aLinePos( nXLineStart, nYLinePos );
- Size aLineSize( nXLineEnd - nXLineStart, 1 );
- m_pLine->SetPosSizePixel( aLinePos, aLineSize );
+ Point aLinePos(nXLineStart, nYLinePos);
+ Size aLineSize(nXLineEnd - nXLineStart, 1);
+ m_pLine->SetPosSizePixel(aLinePos, aLineSize);
}
-void SwHeaderFooterWin::ShowAll( bool bShow )
+void SwHeaderFooterWin::ShowAll(bool bShow)
{
- if ( !PopupMenu::IsInExecute() )
+ if (!PopupMenu::IsInExecute())
{
m_bIsAppearing = bShow;
- if ( m_aFadeTimer.IsActive( ) )
+ if (m_aFadeTimer.IsActive())
m_aFadeTimer.Stop();
- m_aFadeTimer.Start( );
+ m_aFadeTimer.Start();
}
}
bool SwHeaderFooterWin::Contains( const Point &rDocPt ) const
{
- Rectangle aRect( GetPosPixel(), GetSizePixel() );
- if ( aRect.IsInside( rDocPt ) )
+ Rectangle aRect(GetPosPixel(), GetSizePixel());
+ if (aRect.IsInside(rDocPt))
return true;
- Rectangle aLineRect( m_pLine->GetPosPixel(), m_pLine->GetSizePixel() );
- if ( aLineRect.IsInside( rDocPt ) )
+ Rectangle aLineRect(m_pLine->GetPosPixel(), m_pLine->GetSizePixel());
+ if (aLineRect.IsInside(rDocPt))
return true;
return false;
}
-void SwHeaderFooterWin::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& )
+void SwHeaderFooterWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
{
- const Rectangle aRect( Rectangle( Point( 0, 0 ), PixelToLogic( GetSizePixel() ) ) );
- drawinglayer::primitive2d::Primitive2DSequence aSeq( 3 );
+ // Use pixels for the rest of the drawing
+ SetMapMode(MapMode(MAP_PIXEL));
- B2DPolygon aPolygon = lcl_GetPolygon( aRect, m_bIsHeader );
+ const Rectangle aRect(Rectangle(Point(0, 0), rRenderContext.PixelToLogic(GetSizePixel())));
+ drawinglayer::primitive2d::Primitive2DSequence aSeq(3);
+
+ B2DPolygon aPolygon = lcl_GetPolygon(aRect, m_bIsHeader);
// Colors
basegfx::BColor aLineColor = SwViewOption::GetHeaderFooterMarkColor().getBColor();
- basegfx::BColor aFillColor = lcl_GetFillColor( aLineColor );
- basegfx::BColor aLighterColor = lcl_GetLighterGradientColor( aFillColor );
+ basegfx::BColor aFillColor = lcl_GetFillColor(aLineColor);
+ basegfx::BColor aLighterColor = lcl_GetLighterGradientColor(aFillColor);
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
- if ( rSettings.GetHighContrastMode() )
+ if (rSettings.GetHighContrastMode())
{
- aFillColor = rSettings.GetDialogColor( ).getBColor();
- aLineColor = rSettings.GetDialogTextColor( ).getBColor();
+ aFillColor = rSettings.GetDialogColor().getBColor();
+ aLineColor = rSettings.GetDialogTextColor().getBColor();
- aSeq[0] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
- B2DPolyPolygon( aPolygon ), aFillColor ) );
+ aSeq[0] = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(B2DPolyPolygon(aPolygon), aFillColor));
}
else
{
- B2DRectangle aGradientRect( aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom() );
+ B2DRectangle aGradientRect(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
double nAngle = M_PI;
- if ( m_bIsHeader )
+ if (m_bIsHeader)
nAngle = 0;
- FillGradientAttribute aFillAttrs( GRADIENTSTYLE_LINEAR, 0.0, 0.0, 0.0, nAngle,
- aLighterColor, aFillColor, 10 );
- aSeq[0] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::FillGradientPrimitive2D(
- aGradientRect, aFillAttrs ) );
+ FillGradientAttribute aFillAttrs(GRADIENTSTYLE_LINEAR, 0.0, 0.0, 0.0, nAngle, aLighterColor, aFillColor, 10);
+ aSeq[0] = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::FillGradientPrimitive2D(aGradientRect, aFillAttrs));
}
// Create the border lines primitive
- aSeq[1] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
- aPolygon, aLineColor ) );
+ aSeq[1] = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aPolygon, aLineColor));
// Create the text primitive
B2DVector aFontSize;
- FontAttribute aFontAttr = drawinglayer::primitive2d::getFontAttributeFromVclFont(
- aFontSize, GetFont(), false, false );
+ FontAttribute aFontAttr = drawinglayer::primitive2d::getFontAttributeFromVclFont(aFontSize, rRenderContext.GetFont(), false, false);
- FontMetric aFontMetric = GetFontMetric( GetFont() );
+ FontMetric aFontMetric = rRenderContext.GetFontMetric(rRenderContext.GetFont());
double nTextOffsetY = aFontMetric.GetAscent() + TEXT_PADDING;
- Point aTextPos( TEXT_PADDING, nTextOffsetY );
+ Point aTextPos(TEXT_PADDING, nTextOffsetY);
- basegfx::B2DHomMatrix aTextMatrix( createScaleTranslateB2DHomMatrix(
- aFontSize.getX(), aFontSize.getY(),
- double( aTextPos.X() ), double( aTextPos.Y() ) ) );
+ basegfx::B2DHomMatrix aTextMatrix(createScaleTranslateB2DHomMatrix(
+ aFontSize.getX(), aFontSize.getY(),
+ double(aTextPos.X()), double(aTextPos.Y())));
- aSeq[2] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
- aTextMatrix,
- OUString( m_sLabel ), 0, m_sLabel.getLength(),
- std::vector< double >( ),
- aFontAttr,
- com::sun::star::lang::Locale(),
- aLineColor ) );
+ aSeq[2] = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
+ aTextMatrix, OUString(m_sLabel), 0, m_sLabel.getLength(),
+ std::vector<double>(), aFontAttr, css::lang::Locale(), aLineColor));
// Create the 'plus' or 'arrow' primitive
- B2DRectangle aSignArea( B2DPoint( aRect.Right() - BUTTON_WIDTH, 0.0 ),
- B2DSize( aRect.Right(), aRect.getHeight() ) );
+ B2DRectangle aSignArea(B2DPoint(aRect.Right() - BUTTON_WIDTH, 0.0),
+ B2DSize(aRect.Right(), aRect.getHeight()));
B2DPolygon aSign;
- if ( IsEmptyHeaderFooter( ) )
+ if (IsEmptyHeaderFooter())
{
// Create the + polygon
double nLeft = aSignArea.getMinX() + TEXT_PADDING;
@@ -335,57 +330,58 @@ void SwHeaderFooterWin::Paint( vcl::RenderContext& /*rRenderContext*/, const Rec
double nTop = aSignArea.getCenterY() - nHalfW;
double nBottom = aSignArea.getCenterY() + nHalfW;
- aSign.append( B2DPoint( nLeft, aSignArea.getCenterY() - 1.0 ) );
- aSign.append( B2DPoint( aSignArea.getCenterX() - 1.0, aSignArea.getCenterY() - 1.0 ) );
- aSign.append( B2DPoint( aSignArea.getCenterX() - 1.0, nTop ) );
- aSign.append( B2DPoint( aSignArea.getCenterX() + 1.0, nTop ) );
- aSign.append( B2DPoint( aSignArea.getCenterX() + 1.0, aSignArea.getCenterY() - 1.0 ) );
- aSign.append( B2DPoint( nRight, aSignArea.getCenterY() - 1.0 ) );
- aSign.append( B2DPoint( nRight, aSignArea.getCenterY() + 1.0 ) );
- aSign.append( B2DPoint( aSignArea.getCenterX() + 1.0, aSignArea.getCenterY() + 1.0 ) );
- aSign.append( B2DPoint( aSignArea.getCenterX() + 1.0, nBottom ) );
- aSign.append( B2DPoint( aSignArea.getCenterX() - 1.0, nBottom ) );
- aSign.append( B2DPoint( aSignArea.getCenterX() - 1.0, aSignArea.getCenterY() + 1.0 ) );
- aSign.append( B2DPoint( nLeft, aSignArea.getCenterY() + 1.0 ) );
- aSign.setClosed( true );
+ aSign.append(B2DPoint(nLeft, aSignArea.getCenterY() - 1.0));
+ aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, aSignArea.getCenterY() - 1.0));
+ aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, nTop));
+ aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, nTop));
+ aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, aSignArea.getCenterY() - 1.0));
+ aSign.append(B2DPoint(nRight, aSignArea.getCenterY() - 1.0));
+ aSign.append(B2DPoint(nRight, aSignArea.getCenterY() + 1.0));
+ aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, aSignArea.getCenterY() + 1.0));
+ aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, nBottom));
+ aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, nBottom));
+ aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, aSignArea.getCenterY() + 1.0));
+ aSign.append(B2DPoint(nLeft, aSignArea.getCenterY() + 1.0));
+ aSign.setClosed(true);
}
else
{
// Create the v polygon
- B2DPoint aLeft( aSignArea.getMinX() + TEXT_PADDING, aSignArea.getCenterY() );
- B2DPoint aRight( aSignArea.getMaxX() - TEXT_PADDING, aSignArea.getCenterY() );
- B2DPoint aBottom( ( aLeft.getX() + aRight.getX() ) / 2.0, aLeft.getY() + 4.0 );
- aSign.append( aLeft );
- aSign.append( aRight );
- aSign.append( aBottom );
- aSign.setClosed( true );
+ B2DPoint aLeft(aSignArea.getMinX() + TEXT_PADDING, aSignArea.getCenterY());
+ B2DPoint aRight(aSignArea.getMaxX() - TEXT_PADDING, aSignArea.getCenterY());
+ B2DPoint aBottom((aLeft.getX() + aRight.getX()) / 2.0, aLeft.getY() + 4.0);
+ aSign.append(aLeft);
+ aSign.append(aRight);
+ aSign.append(aBottom);
+ aSign.setClosed(true);
}
- BColor aSignColor = Color( COL_BLACK ).getBColor( );
- if ( Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
- aSignColor = Color( COL_WHITE ).getBColor( );
+ BColor aSignColor = Color(COL_BLACK).getBColor();
+ if (Application::GetSettings().GetStyleSettings().GetHighContrastMode())
+ aSignColor = Color(COL_WHITE).getBColor();
- aSeq.realloc( aSeq.getLength() + 1 );
- aSeq[ aSeq.getLength() - 1 ] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
- B2DPolyPolygon( aSign ), aSignColor ) );
+ aSeq.realloc(aSeq.getLength() + 1);
+ aSeq[aSeq.getLength() - 1] = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+ B2DPolyPolygon(aSign), aSignColor));
// Create the processor and process the primitives
const drawinglayer::geometry::ViewInformation2D aNewViewInfos;
boost::scoped_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
- drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(
- *this, aNewViewInfos ));
+ drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(rRenderContext, aNewViewInfos));
// TODO Ghost it all if needed
- drawinglayer::primitive2d::Primitive2DSequence aGhostedSeq( 1 );
- double nFadeRate = double( m_nFadeRate ) / 100.0;
+ drawinglayer::primitive2d::Primitive2DSequence aGhostedSeq(1);
+ double nFadeRate = double(m_nFadeRate) / 100.0;
+
const basegfx::BColorModifierSharedPtr aBColorModifier(
- new basegfx::BColorModifier_interpolate(
- Color( COL_WHITE ).getBColor(),
- 1.0 - nFadeRate));
- aGhostedSeq[0] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
- aSeq, aBColorModifier ) );
+ new basegfx::BColorModifier_interpolate(Color(COL_WHITE).getBColor(),
+ 1.0 - nFadeRate));
- pProcessor->process( aGhostedSeq );
+ aGhostedSeq[0] = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::ModifiedColorPrimitive2D(aSeq, aBColorModifier));
+
+ pProcessor->process(aGhostedSeq);
}
bool SwHeaderFooterWin::IsEmptyHeaderFooter( )
@@ -420,11 +416,11 @@ void SwHeaderFooterWin::ExecuteCommand( sal_uInt16 nSlot )
switch ( nSlot )
{
case FN_HEADERFOOTER_EDIT:
- {
- OString sPageId = m_bIsHeader ? OString("header") : OString("footer");
- rView.GetDocShell()->FormatPage(rStyleName, sPageId, rSh);
- }
- break;
+ {
+ OString sPageId = m_bIsHeader ? OString("header") : OString("footer");
+ rView.GetDocShell()->FormatPage(rStyleName, sPageId, rSh);
+ }
+ break;
case FN_HEADERFOOTER_BORDERBACK:
{
const SwPageDesc* pDesc = GetPageFrame()->GetPageDesc();
@@ -440,47 +436,47 @@ void SwHeaderFooterWin::ExecuteCommand( sal_uInt16 nSlot )
SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
RES_SHADOW, RES_SHADOW, 0 );
- aSet.Put( pHFFmt->GetAttrSet() );
-
- // Create a box info item... needed by the dialog
- SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
- const SfxPoolItem *pBoxInfo;
- if ( SfxItemState::SET == pHFFmt->GetAttrSet().GetItemState( SID_ATTR_BORDER_INNER,
- true, &pBoxInfo) )
- aBoxInfo = *static_cast<const SvxBoxInfoItem*>(pBoxInfo);
-
- aBoxInfo.SetTable( false );
- aBoxInfo.SetDist( true);
- aBoxInfo.SetMinDist( false );
- aBoxInfo.SetDefDist( MIN_BORDER_DIST );
- aBoxInfo.SetValid( SvxBoxInfoItemValidFlags::DISABLE );
- aSet.Put( aBoxInfo );
-
- if ( svx::ShowBorderBackgroundDlg( this, &aSet, true ) )
- {
- const SfxPoolItem* pItem;
- if ( SfxItemState::SET == aSet.GetItemState( RES_BACKGROUND, false, &pItem ) ) {
- pHFFmt->SetFmtAttr( *pItem );
- rView.GetDocShell()->SetModified(true);
- }
-
- if ( SfxItemState::SET == aSet.GetItemState( RES_BOX, false, &pItem ) ) {
- pHFFmt->SetFmtAttr( *pItem );
- rView.GetDocShell()->SetModified(true);
- }
-
- if ( SfxItemState::SET == aSet.GetItemState( RES_SHADOW, false, &pItem ) ) {
- pHFFmt->SetFmtAttr( *pItem );
- rView.GetDocShell()->SetModified(true);
- }
+ aSet.Put( pHFFmt->GetAttrSet() );
+
+ // Create a box info item... needed by the dialog
+ SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
+ const SfxPoolItem *pBoxInfo;
+ if ( SfxItemState::SET == pHFFmt->GetAttrSet().GetItemState( SID_ATTR_BORDER_INNER,
+ true, &pBoxInfo) )
+ aBoxInfo = *static_cast<const SvxBoxInfoItem*>(pBoxInfo);
+
+ aBoxInfo.SetTable( false );
+ aBoxInfo.SetDist( true);
+ aBoxInfo.SetMinDist( false );
+ aBoxInfo.SetDefDist( MIN_BORDER_DIST );
+ aBoxInfo.SetValid( SvxBoxInfoItemValidFlags::DISABLE );
+ aSet.Put( aBoxInfo );
+
+ if ( svx::ShowBorderBackgroundDlg( this, &aSet, true ) )
+ {
+ const SfxPoolItem* pItem;
+ if ( SfxItemState::SET == aSet.GetItemState( RES_BACKGROUND, false, &pItem ) ) {
+ pHFFmt->SetFmtAttr( *pItem );
+ rView.GetDocShell()->SetModified(true);
+ }
+
+ if ( SfxItemState::SET == aSet.GetItemState( RES_BOX, false, &pItem ) ) {
+ pHFFmt->SetFmtAttr( *pItem );
+ rView.GetDocShell()->SetModified(true);
+ }
+
+ if ( SfxItemState::SET == aSet.GetItemState( RES_SHADOW, false, &pItem ) ) {
+ pHFFmt->SetFmtAttr( *pItem );
+ rView.GetDocShell()->SetModified(true);
}
}
- break;
+ }
+ break;
case FN_HEADERFOOTER_DELETE:
- {
- rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, false, true );
- }
- break;
+ {
+ rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, false, true );
+ }
+ break;
default:
break;
}
@@ -493,7 +489,7 @@ void SwHeaderFooterWin::SetReadonly( bool bReadonly )
void SwHeaderFooterWin::MouseButtonDown( const MouseEvent& rMEvt )
{
- if ( IsEmptyHeaderFooter( ) )
+ if (IsEmptyHeaderFooter())
{
SwView& rView = GetEditWin()->GetView();
SwWrtShell& rSh = rView.GetWrtShell();
@@ -505,32 +501,32 @@ void SwHeaderFooterWin::MouseButtonDown( const MouseEvent& rMEvt )
MenuButton::MouseButtonDown( rMEvt );
}
-void SwHeaderFooterWin::Select( )
+void SwHeaderFooterWin::Select()
{
- ExecuteCommand( GetCurItemId() );
+ ExecuteCommand(GetCurItemId());
}
IMPL_LINK_NOARG_TYPED(SwHeaderFooterWin, FadeHandler, Timer *, void)
{
- if ( m_bIsAppearing && m_nFadeRate > 0 )
+ if (m_bIsAppearing && m_nFadeRate > 0)
m_nFadeRate -= 25;
- else if ( !m_bIsAppearing && m_nFadeRate < 100 )
+ else if (!m_bIsAppearing && m_nFadeRate < 100)
m_nFadeRate += 25;
- if ( m_nFadeRate != 100 && !IsVisible() )
+ if (m_nFadeRate != 100 && !IsVisible())
{
- Show( true );
- m_pLine->Show( true );
+ Show(true);
+ m_pLine->Show(true);
}
- else if ( m_nFadeRate == 100 && IsVisible( ) )
+ else if (m_nFadeRate == 100 && IsVisible())
{
- Show( false );
- m_pLine->Show( false );
+ Show(false);
+ m_pLine->Show(false);
}
else
Invalidate();
- if ( IsVisible( ) && m_nFadeRate > 0 && m_nFadeRate < 100 )
+ if (IsVisible() && m_nFadeRate > 0 && m_nFadeRate < 100)
m_aFadeTimer.Start();
}