diff options
author | Oliver Bolte <obo@openoffice.org> | 2009-09-09 09:19:53 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2009-09-09 09:19:53 +0000 |
commit | 393ad5083690784449a6c9a12bbb79fd1b748fef (patch) | |
tree | 7cdf5b170c72510ab29a1aefe316d9b2e46ffe38 /sd/source/ui/toolpanel | |
parent | 447462206a424eae219d9bc2caabc0cdb5e6aab0 (diff) |
CWS-TOOLING: integrate CWS impress174
2009-08-27 18:21:38 +0200 af r275502 : #i73289# Fixed detection of the cases when the layout menu is be disabled.
2009-08-24 17:45:50 +0200 sj r275326 : #i103360# only setting filltype if there is also a correct fill element
2009-08-24 16:11:06 +0200 cl r275322 : #i73871# only remove replaced objects from mark list if replaced by SdrEditView::ReplaceObjectAtView(). see issue for reason
2009-08-24 15:03:33 +0200 cl r275319 : fixed merge error
2009-08-20 12:45:29 +0200 sj r275174 : CWS-TOOLING: rebase CWS impress174 to trunk@275001 (milestone: DEV300:m55)
2009-08-19 15:54:47 +0200 sj r275153 : #158486# text of flipped shapes is not flipped in word
2009-08-17 17:30:16 +0200 sj r275063 : #158486# also correcting text bound for additional text rotation
2009-08-05 11:09:32 +0200 sj r274643 : #i102797# adapted customshape coloring (fixed fontwork)
2009-08-04 14:17:36 +0200 sj r274620 : #i99501# pdf export: fixed export of rotated graphics
2009-07-30 16:15:44 +0200 sj r274494 : #158653# binary ppt import: fixed table border lines
2009-07-27 18:28:02 +0200 sj r274376 : added shape text clipping for customshapes
2009-07-20 18:09:14 +0200 sj r274154 : #i101918# fixed gallery preview (now taking the correct mapmode)
2009-07-13 18:00:58 +0200 cl r273948 : #i103238# clear hard set attributes only if new style set is manually applied
2009-07-13 17:58:07 +0200 cl r273947 : #i73289# do not expand a toolpanel when it gets enabled
2009-07-08 12:39:49 +0200 sj r273827 : #i101566# applied patch from cmc to solve font width inconsistencies
2009-07-08 12:11:13 +0200 sj r273826 : #i87727# added PDFDialog service
2009-07-06 17:22:40 +0200 sj r273755 : #i103360# fixed a merge problem, no more looping when loading transparence gradients on background page
2009-07-03 14:42:07 +0200 sj r273701 : #102797# added patch from thb (Adapted customshape coloring)
2009-07-03 14:09:44 +0200 sj r273696 : #102797# removed warning
2009-07-03 14:01:47 +0200 sj r273695 : #102797# added patch from thb (Adapted customshape coloring)
2009-07-03 13:13:39 +0200 sj r273688 : #102797# added patch from thb (Adapted customshape coloring)
2009-07-03 11:25:30 +0200 sj r273684 : #i103278# fixed import of lines
2009-07-01 16:23:47 +0200 cl r273599 : #i96820# correctly call setChanged on model if table is modified
2009-07-01 14:43:09 +0200 cl r273588 : #i8770# Patch: fix missing type provider for pdf export dialog
2009-07-01 14:40:28 +0200 cl r273586 : #i73871# activate picture bar after converting shape to bitmap
2009-07-01 14:39:05 +0200 cl r273584 : #i73871# activate picture bar after converting shape to bitmap
2009-07-01 14:04:53 +0200 cl r273578 : #i73289# PATCH: Disable layout pane on the masterslide
Diffstat (limited to 'sd/source/ui/toolpanel')
-rw-r--r-- | sd/source/ui/toolpanel/LayoutMenu.cxx | 84 | ||||
-rw-r--r-- | sd/source/ui/toolpanel/LayoutMenu.hxx | 12 | ||||
-rw-r--r-- | sd/source/ui/toolpanel/TitleBar.cxx | 24 | ||||
-rw-r--r-- | sd/source/ui/toolpanel/TitledControl.cxx | 26 | ||||
-rw-r--r-- | sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx | 6 |
5 files changed, 142 insertions, 10 deletions
diff --git a/sd/source/ui/toolpanel/LayoutMenu.cxx b/sd/source/ui/toolpanel/LayoutMenu.cxx index 11b8cbe6f8de..7a39f1c42f15 100644 --- a/sd/source/ui/toolpanel/LayoutMenu.cxx +++ b/sd/source/ui/toolpanel/LayoutMenu.cxx @@ -63,6 +63,7 @@ #include <vcl/image.hxx> #include <svtools/languageoptions.hxx> #include <sfx2/app.hxx> +#include "taskpane/TitledControl.hxx"
#include <sfx2/dispatch.hxx> #include <sfx2/request.hxx> #include <comphelper/processfactory.hxx> @@ -259,7 +260,9 @@ LayoutMenu::LayoutMenu ( | ::sd::tools::EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION | ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED | ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED - | ::sd::tools::EventMultiplexerEvent::EID_CONFIGURATION_UPDATED); + | ::sd::tools::EventMultiplexerEvent::EID_CONFIGURATION_UPDATED + | ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL + | ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER); SetSmartHelpId(SmartId(HID_SD_TASK_PANE_PREVIEW_LAYOUTS)); SetAccessibleName(SdResId(STR_TASKPANEL_LAYOUT_MENU_TITLE)); @@ -418,6 +421,74 @@ bool LayoutMenu::IsResizable (void) +void LayoutMenu::UpdateEnabledState (const MasterMode eMode) +{ + bool bIsEnabled (false); + + ::boost::shared_ptr<ViewShell> pMainViewShell (mrBase.GetMainViewShell()); + if (pMainViewShell) + { + switch (pMainViewShell->GetShellType()) + { + case ViewShell::ST_NONE: + case ViewShell::ST_OUTLINE: + case ViewShell::ST_PRESENTATION: + case ViewShell::ST_TASK_PANE: + // The complete task pane is disabled for these values or + // not even visible. Disabling the LayoutMenu would be + // logical but unnecessary. The main disadvantage is that + // after re-enabling it (typically) another panel is + // expanded. + bIsEnabled = true; + break; + + case ViewShell::ST_DRAW: + case ViewShell::ST_IMPRESS: + { + switch (eMode) + { + case MM_UNKNOWN: + { + ::boost::shared_ptr<DrawViewShell> pDrawViewShell ( + ::boost::dynamic_pointer_cast<DrawViewShell>(pMainViewShell)); + if (pDrawViewShell) + bIsEnabled = pDrawViewShell->GetEditMode() != EM_MASTERPAGE; + break; + } + case MM_NORMAL: + bIsEnabled = true; + break; + + case MM_MASTER: + bIsEnabled = false; + break; + } + break; + } + + case ViewShell::ST_HANDOUT: + case ViewShell::ST_NOTES: + case ViewShell::ST_SLIDE_SORTER: + default: + bIsEnabled = true; + break; + } + + TreeNode* pParentNode = GetParentNode(); + if (pParentNode != NULL) + { + TitledControl* pGrandParentNode + = dynamic_cast<TitledControl*>(pParentNode->GetParentNode()); + if (pGrandParentNode != NULL) + pGrandParentNode->SetEnabledState(bIsEnabled); + } + + } +} + + + + ::Window* LayoutMenu::GetWindow (void) { return this; @@ -907,12 +978,14 @@ void LayoutMenu::UpdateSelection (void) // Find the entry of the menu for to the layout. USHORT nItemCount (GetItemCount()); for (USHORT nId=1; nId<=nItemCount; nId++) + { if (*static_cast<AutoLayout*>(GetItemData(nId)) == aLayout) { SelectItem(nId); bItemSelected = true; break; } + } } while (false); @@ -935,6 +1008,7 @@ IMPL_LINK(LayoutMenu, EventMultiplexerListener, ::sd::tools::EventMultiplexerEve case ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED: mbIsMainViewChangePending = true; + UpdateEnabledState(MM_UNKNOWN); break; case ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED: @@ -949,6 +1023,14 @@ IMPL_LINK(LayoutMenu, EventMultiplexerListener, ::sd::tools::EventMultiplexerEve } break; + case ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL: + UpdateEnabledState(MM_NORMAL); + break; + + case ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER: + UpdateEnabledState(MM_MASTER); + break; + default: /* Ignored */ break; diff --git a/sd/source/ui/toolpanel/LayoutMenu.hxx b/sd/source/ui/toolpanel/LayoutMenu.hxx index 58901e0e7a86..3551d3853a8a 100644 --- a/sd/source/ui/toolpanel/LayoutMenu.hxx +++ b/sd/source/ui/toolpanel/LayoutMenu.hxx @@ -131,6 +131,18 @@ public: void Execute (SfxRequest& rRequest); void GetState (SfxItemSet& rItemSet); + /** The LayoutMenu does not support some main views. In this case the + LayoutMenu is disabled. This state is updated in this method. + @param eMode + On some occasions the edit mode is being switched when this + method is called can not (yet) be reliably detected. Luckily, + in these cases the new value is provided by some broadcaster. + On other occasions the edit mode is not modified and is also not + provided. Therefore the Unknown value. + */ + enum MasterMode { MM_NORMAL, MM_MASTER, MM_UNKNOWN }; + void UpdateEnabledState (const MasterMode eMode); + /** Call this method when the set of displayed layouts is not up-to-date anymore. It will re-assemple this set according to the current settings. diff --git a/sd/source/ui/toolpanel/TitleBar.cxx b/sd/source/ui/toolpanel/TitleBar.cxx index ff08770bf1a5..c4dd6537c9ce 100644 --- a/sd/source/ui/toolpanel/TitleBar.cxx +++ b/sd/source/ui/toolpanel/TitleBar.cxx @@ -216,6 +216,14 @@ bool TitleBar::IsExpanded (void) const } +void TitleBar::SetEnabledState(bool bFlag)
+{
+ if(bFlag)
+ Enable();
+ else
+ Disable();
+ Invalidate ();
+}
void TitleBar::SetFocus (bool bFlag) @@ -454,15 +462,21 @@ void TitleBar::PaintText (const Rectangle& rTextBox) USHORT TitleBar::GetTextStyle (void) { - return TEXT_DRAW_LEFT - | TEXT_DRAW_TOP - | TEXT_DRAW_MULTILINE - | TEXT_DRAW_WORDBREAK; + if(IsEnabled())
+ {
+ return TEXT_DRAW_LEFT
+ | TEXT_DRAW_TOP
+ | TEXT_DRAW_MULTILINE
+ | TEXT_DRAW_WORDBREAK;
+ }
+ else
+ {
+ return TEXT_DRAW_DISABLE;
+ }
} - void TitleBar::PaintBackground (const Rectangle& rTitleBarBox) { // Fill a slightly rounded rectangle. diff --git a/sd/source/ui/toolpanel/TitledControl.cxx b/sd/source/ui/toolpanel/TitledControl.cxx index 14c7c5004e91..2c2e791eb018 100644 --- a/sd/source/ui/toolpanel/TitledControl.cxx +++ b/sd/source/ui/toolpanel/TitledControl.cxx @@ -292,7 +292,7 @@ bool TitledControl::Expand (bool bExpanded) { bool bExpansionStateChanged (false); - if (IsExpandable()) + if (IsExpandable() && IsEnabled()) { if (GetTitleBar()->IsExpanded() != bExpanded) bExpansionStateChanged |= GetTitleBar()->Expand (bExpanded); @@ -338,6 +338,27 @@ bool TitledControl::IsExpanded (void) const return false; } +void TitledControl::SetEnabledState(bool bFlag)
+{
+ if (!bFlag)
+ {
+ GetParentNode()->GetControlContainer().SetExpansionState (
+ this,
+ ControlContainer::ES_COLLAPSE);
+ Disable();
+ }
+ else
+ {
+/*
+ GetParentNode()->GetControlContainer().SetExpansionState (
+ this,
+ ControlContainer::ES_EXPAND);
+*/
+ Enable();
+ }
+
+ GetTitleBar()->SetEnabledState(bFlag);
+}
@@ -406,7 +427,8 @@ IMPL_LINK(TitledControl, WindowEventListener, switch (pWindowEvent->GetId()) { case VCLEVENT_WINDOW_MOUSEBUTTONUP: - (*mpClickHandler)(*this); + if (IsEnabled()) + (*mpClickHandler)(*this); break; } } diff --git a/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx b/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx index 25cb015d2d1d..b647d3e732c7 100644 --- a/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx +++ b/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx @@ -74,7 +74,8 @@ CurrentMasterPagesSelector::CurrentMasterPagesSelector ( Link aLink (LINK(this,CurrentMasterPagesSelector,EventMultiplexerListener)); rBase.GetEventMultiplexer()->AddEventListener(aLink, sd::tools::EventMultiplexerEvent::EID_CURRENT_PAGE - | sd::tools::EventMultiplexerEvent::EID_EDIT_MODE + | sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL + | sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER | sd::tools::EventMultiplexerEvent::EID_PAGE_ORDER | sd::tools::EventMultiplexerEvent::EID_SHAPE_CHANGED | sd::tools::EventMultiplexerEvent::EID_SHAPE_INSERTED @@ -282,7 +283,8 @@ IMPL_LINK(CurrentMasterPagesSelector,EventMultiplexerListener, switch (pEvent->meEventId) { case sd::tools::EventMultiplexerEvent::EID_CURRENT_PAGE: - case sd::tools::EventMultiplexerEvent::EID_EDIT_MODE: + case sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL: + case sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER: case sd::tools::EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION: UpdateSelection(); break; |