diff options
author | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2012-02-13 11:20:22 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2012-02-13 11:21:26 +0100 |
commit | beb8a85796c78d4cdcf6497b6725fce8f7141d75 (patch) | |
tree | f927f6cbd06f814c6bd0c784960bd6efefbf625a | |
parent | fix RTF import of ffres token for checkboxes (diff) | |
download | core-beb8a85796c78d4cdcf6497b6725fce8f7141d75.tar.gz core-beb8a85796c78d4cdcf6497b6725fce8f7141d75.zip |
Header/Footer, Page Break: don't show them in RO mode (fdo#45548)
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 3 | ||||
-rw-r--r-- | sw/source/ui/docvw/HeaderFooterWin.cxx | 97 | ||||
-rw-r--r-- | sw/source/ui/docvw/PageBreakWin.cxx | 46 | ||||
-rw-r--r-- | sw/source/ui/inc/HeaderFooterWin.hxx | 1 |
4 files changed, 70 insertions, 77 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 8aee0ec69e6c..74abd70bd127 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -3341,6 +3341,7 @@ void SwPageFrm::PaintBreak( ) const { if ( pGlobalShell->GetOut()->GetOutDevType() != OUTDEV_PRINTER && !pGlobalShell->GetViewOptions()->IsPDFExport() && + !pGlobalShell->GetViewOptions()->IsReadonly() && !pGlobalShell->IsPreView() ) { const SwFrm* pBodyFrm = Lower(); @@ -3377,6 +3378,7 @@ void SwColumnFrm::PaintBreak( ) const { if ( pGlobalShell->GetOut()->GetOutDevType() != OUTDEV_PRINTER && !pGlobalShell->GetViewOptions()->IsPDFExport() && + !pGlobalShell->GetViewOptions()->IsReadonly() && !pGlobalShell->IsPreView() ) { const SwFrm* pBodyFrm = Lower(); @@ -3486,6 +3488,7 @@ void SwPageFrm::PaintDecorators( ) const if ( pGlobalShell->GetOut()->GetOutDevType() != OUTDEV_PRINTER && !pGlobalShell->GetViewOptions()->IsPDFExport() && !pGlobalShell->IsPreView() && + !pGlobalShell->GetViewOptions()->IsReadonly() && ( pGlobalShell->IsShowHeaderFooterSeparator( Header ) || pGlobalShell->IsShowHeaderFooterSeparator( Footer ) ) ) { diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx index 330c1ff4f6c6..32e876726ba9 100644 --- a/sw/source/ui/docvw/HeaderFooterWin.cxx +++ b/sw/source/ui/docvw/HeaderFooterWin.cxx @@ -148,7 +148,6 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const SwPageFrm* pPag SwFrameControl( pEditWin, pPageFrm ), m_sLabel( ), m_bIsHeader( bHeader ), - m_bReadonly( false ), m_pPopupMenu( NULL ), m_pLine( NULL ), m_bIsAppearing( false ), @@ -329,57 +328,54 @@ void SwHeaderFooterWin::Paint( const Rectangle& ) com::sun::star::lang::Locale(), aLineColor ) ); - // Create the 'plus' or 'arrow' primitive if not readonly - if ( !m_bReadonly ) - { - B2DRectangle aSignArea( B2DPoint( aRect.Right() - BUTTON_WIDTH, 0.0 ), - B2DSize( aRect.Right(), aRect.getHeight() ) ); + // Create the 'plus' or 'arrow' primitive + B2DRectangle aSignArea( B2DPoint( aRect.Right() - BUTTON_WIDTH, 0.0 ), + B2DSize( aRect.Right(), aRect.getHeight() ) ); - B2DPolygon aSign; - if ( IsEmptyHeaderFooter( ) ) - { - // Create the + polygon - double nLeft = aSignArea.getMinX() + TEXT_PADDING; - double nRight = aSignArea.getMaxX() - TEXT_PADDING; - double nHalfW = ( nRight - nLeft ) / 2.0; - - 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 ); - } - 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 ); - } + B2DPolygon aSign; + if ( IsEmptyHeaderFooter( ) ) + { + // Create the + polygon + double nLeft = aSignArea.getMinX() + TEXT_PADDING; + double nRight = aSignArea.getMaxX() - TEXT_PADDING; + double nHalfW = ( nRight - nLeft ) / 2.0; + + 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 ); + } + 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 ); + } - 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 ] = Primitive2DReference( new PolyPolygonColorPrimitive2D( - B2DPolyPolygon( aSign ), aSignColor ) ); - } + aSeq.realloc( aSeq.getLength() + 1 ); + aSeq[ aSeq.getLength() - 1 ] = Primitive2DReference( new PolyPolygonColorPrimitive2D( + B2DPolyPolygon( aSign ), aSignColor ) ); // Create the processor and process the primitives const drawinglayer::geometry::ViewInformation2D aNewViewInfos; @@ -495,8 +491,7 @@ void SwHeaderFooterWin::ExecuteCommand( sal_uInt16 nSlot ) void SwHeaderFooterWin::SetReadonly( bool bReadonly ) { - m_bReadonly = bReadonly; - Update(); + ShowAll( !bReadonly ); } void SwHeaderFooterWin::MouseButtonDown( const MouseEvent& rMEvt ) diff --git a/sw/source/ui/docvw/PageBreakWin.cxx b/sw/source/ui/docvw/PageBreakWin.cxx index 0edeb618d576..0439bc3da0ee 100644 --- a/sw/source/ui/docvw/PageBreakWin.cxx +++ b/sw/source/ui/docvw/PageBreakWin.cxx @@ -182,30 +182,26 @@ void SwPageBreakWin::Paint( const Rectangle& ) aSeq[2] = Primitive2DReference( new DiscreteBitmapPrimitive2D( aImg.GetBitmapEx(), B2DPoint( nImgOfstX, 1.0 ) ) ); - // Paint the symbol if not readonly button - if ( IsEnabled() ) - { - double nTop = double( aRect.getHeight() ) / 2.0; - double nBottom = nTop + 4.0; - double nLeft = aRect.getWidth( ) - ARROW_WIDTH - 6.0; - if ( bRtl ) - nLeft = ARROW_WIDTH - 2.0; - double nRight = nLeft + 8.0; - - B2DPolygon aTriangle; - aTriangle.append( B2DPoint( nLeft, nTop ) ); - aTriangle.append( B2DPoint( nRight, nTop ) ); - aTriangle.append( B2DPoint( ( nLeft + nRight ) / 2.0, nBottom ) ); - aTriangle.setClosed( true ); - - BColor aTriangleColor = Color( COL_BLACK ).getBColor( ); - if ( Application::GetSettings().GetStyleSettings().GetHighContrastMode() ) - aTriangleColor = Color( COL_WHITE ).getBColor( ); - - aSeq.realloc( aSeq.getLength() + 1 ); - aSeq[ aSeq.getLength() - 1 ] = Primitive2DReference( new PolyPolygonColorPrimitive2D( - B2DPolyPolygon( aTriangle ), aTriangleColor ) ); - } + double nTop = double( aRect.getHeight() ) / 2.0; + double nBottom = nTop + 4.0; + double nLeft = aRect.getWidth( ) - ARROW_WIDTH - 6.0; + if ( bRtl ) + nLeft = ARROW_WIDTH - 2.0; + double nRight = nLeft + 8.0; + + B2DPolygon aTriangle; + aTriangle.append( B2DPoint( nLeft, nTop ) ); + aTriangle.append( B2DPoint( nRight, nTop ) ); + aTriangle.append( B2DPoint( ( nLeft + nRight ) / 2.0, nBottom ) ); + aTriangle.setClosed( true ); + + BColor aTriangleColor = Color( COL_BLACK ).getBColor( ); + if ( Application::GetSettings().GetStyleSettings().GetHighContrastMode() ) + aTriangleColor = Color( COL_WHITE ).getBColor( ); + + aSeq.realloc( aSeq.getLength() + 1 ); + aSeq[ aSeq.getLength() - 1 ] = Primitive2DReference( new PolyPolygonColorPrimitive2D( + B2DPolyPolygon( aTriangle ), aTriangleColor ) ); Primitive2DSequence aGhostedSeq( 1 ); double nFadeRate = double( m_nFadeRate ) / 100.0; @@ -419,7 +415,7 @@ const SwPageFrm* SwPageBreakWin::GetPageFrame( ) void SwPageBreakWin::SetReadonly( bool bReadonly ) { - Enable( !bReadonly ); + ShowAll( !bReadonly ); } void SwPageBreakWin::Fade( bool bFadeIn ) diff --git a/sw/source/ui/inc/HeaderFooterWin.hxx b/sw/source/ui/inc/HeaderFooterWin.hxx index 6075bb3e1ad0..d94931fce754 100644 --- a/sw/source/ui/inc/HeaderFooterWin.hxx +++ b/sw/source/ui/inc/HeaderFooterWin.hxx @@ -41,7 +41,6 @@ class SwHeaderFooterWin : public MenuButton, public SwFrameControl { rtl::OUString m_sLabel; bool m_bIsHeader; - bool m_bReadonly; PopupMenu* m_pPopupMenu; Window* m_pLine; bool m_bIsAppearing; |