diff options
author | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-09-09 09:13:10 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-09-09 21:34:08 +0200 |
commit | 16400db4629133ad59ce8cbc8746a63b33202fd3 (patch) | |
tree | 0e37f19c60edb18847e8e507208203b388df7644 /sw/source/ui/docvw/HeaderFooterWin.cxx | |
parent | 052f181dad89ad34d90513bc9dcd3e3239727933 (diff) |
Header/Footer: don't show the separator action in readonly mode
Diffstat (limited to 'sw/source/ui/docvw/HeaderFooterWin.cxx')
-rw-r--r-- | sw/source/ui/docvw/HeaderFooterWin.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx index e926d5406bcb..1a33706fa97b 100644 --- a/sw/source/ui/docvw/HeaderFooterWin.cxx +++ b/sw/source/ui/docvw/HeaderFooterWin.cxx @@ -150,9 +150,13 @@ SwHeaderFooterWin::~SwHeaderFooterWin( ) MenuButton* SwHeaderFooterWin::GetMenuButton() { if ( !m_pButton ) + { m_pButton = new SwHeaderFooterButton( this ); - m_pButton->Show(); + // Don't blindly show it: check for readonly document + const SwViewOption* pViewOpt = m_pEditWin->GetView().GetWrtShell().GetViewOptions(); + m_pButton->Show( !pViewOpt->IsReadonly() ); + } return m_pButton; } @@ -274,6 +278,15 @@ void SwHeaderFooterWin::ExecuteCommand( sal_uInt16 nSlot ) } } +void SwHeaderFooterWin::SetReadonly( bool bReadonly ) +{ + if ( bReadonly ) + m_pButton->Hide(); + else + m_pButton->Show(); + Update(); +} + SwHeaderFooterButton::SwHeaderFooterButton( SwHeaderFooterWin* pWindow ) : MenuButton( pWindow ), m_pWindow( pWindow ) |