diff options
author | Andre Fischer <af@apache.org> | 2013-04-29 07:44:43 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-05-20 11:33:24 +0100 |
commit | 603c089e4261a028d9ea70012cb5b1f4effcb545 (patch) | |
tree | 8978cd43cf0f801eddc2a8e5edaa405d685a652b /sfx2/source/sidebar/SidebarChildWindow.cxx | |
parent | 8035ea995506557c6711c637435374a056662b8b (diff) |
Resolves: #i122082# Hide sidebar panels for read only documents
(cherry picked from commit aae247a34cd6f3bf421e57bbec08837d73ddf258)
Conflicts:
sfx2/inc/sfx2/sidebar/SidebarChildWindow.hxx
sfx2/inc/sfx2/sidebar/Theme.hxx
sfx2/source/sidebar/SidebarChildWindow.cxx
sfx2/source/sidebar/SidebarController.cxx
sfx2/source/sidebar/SidebarDockingWindow.cxx
Change-Id: Ib59132d6d5e177d5a02ee24973b0fb07114db60a
Diffstat (limited to 'sfx2/source/sidebar/SidebarChildWindow.cxx')
-rw-r--r-- | sfx2/source/sidebar/SidebarChildWindow.cxx | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/sfx2/source/sidebar/SidebarChildWindow.cxx b/sfx2/source/sidebar/SidebarChildWindow.cxx index f02b37c54b40..cb001ceaf4c5 100644 --- a/sfx2/source/sidebar/SidebarChildWindow.cxx +++ b/sfx2/source/sidebar/SidebarChildWindow.cxx @@ -15,6 +15,8 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ + +#include "TabBar.hxx" #include "sfx2/sidebar/SidebarChildWindow.hxx" #include "SidebarDockingWindow.hxx" #include "sfx2/sfxsids.hrc" @@ -44,9 +46,9 @@ SidebarChildWindow::SidebarChildWindow ( eChildAlignment = SFX_ALIGN_RIGHT; this->pWindow->SetHelpId(HID_SIDEBAR_WINDOW); - this->pWindow->SetOutputSizePixel(Size(300, 450)); + this->pWindow->SetOutputSizePixel(Size(GetDefaultWidth(this->pWindow), 450)); - SfxDockingWindow* pDockingParent = dynamic_cast<SfxDockingWindow*>(pParentWindow); + SfxDockingWindow* pDockingParent = dynamic_cast<SfxDockingWindow*>(this->pWindow); if (pDockingParent != NULL) pDockingParent->Initialize(pInfo); SetHideNotDelete(sal_True); @@ -55,4 +57,21 @@ SidebarChildWindow::SidebarChildWindow ( } + + +sal_Int32 SidebarChildWindow::GetDefaultWidth (Window* pWindow) +{ + if (pWindow != NULL) + { + // Width of the paragraph panel. + const static sal_Int32 nMaxPropertyPageWidth (115); + + return pWindow->LogicToPixel(Point(nMaxPropertyPageWidth,1), MAP_APPFONT).X() + + TabBar::GetDefaultWidth(); + } + else + return 0; +} + + } } // end of namespace sfx2::sidebar |