[ooo-build-commit] Branch 'ooo/master' - sd/source
Jan Holesovsky
kendy at kemper.freedesktop.org
Wed Sep 9 19:53:31 PDT 2009
sd/source/ui/inc/EventMultiplexer.hxx | 9 -
sd/source/ui/inc/taskpane/TitleBar.hxx | 1
sd/source/ui/inc/taskpane/TitledControl.hxx | 2
sd/source/ui/toolpanel/LayoutMenu.cxx | 84 +++++++++-
sd/source/ui/toolpanel/LayoutMenu.hxx | 12 +
sd/source/ui/toolpanel/TitleBar.cxx | 24 ++
sd/source/ui/toolpanel/TitledControl.cxx | 26 ++-
sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx | 6
sd/source/ui/tools/EventMultiplexer.cxx | 12 +
sd/source/ui/unoidl/unopback.cxx | 4
sd/source/ui/view/GraphicObjectBar.cxx | 6
11 files changed, 166 insertions(+), 20 deletions(-)
New commits:
commit c7508b9a247e93c03af0bcae4798ec5658cf0e35
Author: Oliver Bolte <obo at openoffice.org>
Date: Wed Sep 9 09:19:53 2009 +0000
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 at 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
diff --git a/sd/source/ui/inc/EventMultiplexer.hxx b/sd/source/ui/inc/EventMultiplexer.hxx
index 395c311..9ba6cc0 100644
--- a/sd/source/ui/inc/EventMultiplexer.hxx
+++ b/sd/source/ui/inc/EventMultiplexer.hxx
@@ -92,9 +92,10 @@ public:
*/
static const EventId EID_PANE_MANAGER_DYING = 0x00000100;
- /** The edit mode of the ViewShell in the center pane has been modified.
+ /** Edit mode was (or is being) switched to normal mode. Find
+ EID_EDIT_MODE_MASTER below.
*/
- static const EventId EID_EDIT_MODE = 0x00000200;
+ static const EventId EID_EDIT_MODE_NORMAL = 0x00000200;
/** One or more pages have been inserted into or deleted from the model.
*/
@@ -134,6 +135,10 @@ public:
*/
static const EventId EID_CONFIGURATION_UPDATED = 0x00040000;
+ /** Edit mode was (or is being) switched to master mode.
+ */
+ static const EventId EID_EDIT_MODE_MASTER = 0x00080000;
+
const ViewShellBase& mrBase;
EventId meEventId;
const void* mpUserData;
diff --git a/sd/source/ui/inc/taskpane/TitleBar.hxx b/sd/source/ui/inc/taskpane/TitleBar.hxx
index 0cb0a7e..b5271e8 100644
--- a/sd/source/ui/inc/taskpane/TitleBar.hxx
+++ b/sd/source/ui/inc/taskpane/TitleBar.hxx
@@ -92,6 +92,7 @@ public:
virtual void Paint (const Rectangle& rBoundingBox);
virtual bool Expand (bool bFlag = true);
virtual bool IsExpanded (void) const;
+ virtual void SetEnabledState(bool bFlag);
void SetFocus (bool bFlag);
diff --git a/sd/source/ui/inc/taskpane/TitledControl.hxx b/sd/source/ui/inc/taskpane/TitledControl.hxx
index b9da6a9..8103c18 100644
--- a/sd/source/ui/inc/taskpane/TitledControl.hxx
+++ b/sd/source/ui/inc/taskpane/TitledControl.hxx
@@ -135,6 +135,8 @@ public:
*/
virtual bool IsExpandable (void) const;
+ virtual void SetEnabledState(bool bFlag);
+
/** Ownership of the given data remains with the caller. The data
is thus not destroyed when the destructor of this class is
called.
diff --git a/sd/source/ui/toolpanel/LayoutMenu.cxx b/sd/source/ui/toolpanel/LayoutMenu.cxx
index 8338af0..7b479e1 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 aad1dd0..f866ce4 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 f401371..85c8d0e 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 f028096..ccd85fc 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 3200e3c..1389e62 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;
diff --git a/sd/source/ui/tools/EventMultiplexer.cxx b/sd/source/ui/tools/EventMultiplexer.cxx
index 287ac9a..54b47f6 100644
--- a/sd/source/ui/tools/EventMultiplexer.cxx
+++ b/sd/source/ui/tools/EventMultiplexer.cxx
@@ -570,7 +570,12 @@ void SAL_CALL EventMultiplexer::Implementation::propertyChange (
}
else if (rEvent.PropertyName.equals(msEditModePropertyName))
{
- CallListeners(EventMultiplexerEvent::EID_EDIT_MODE);
+ bool bIsMasterPageMode (false);
+ rEvent.NewValue >>= bIsMasterPageMode;
+ if (bIsMasterPageMode)
+ CallListeners(EventMultiplexerEvent::EID_EDIT_MODE_MASTER);
+ else
+ CallListeners(EventMultiplexerEvent::EID_EDIT_MODE_NORMAL);
}
}
@@ -783,8 +788,9 @@ void EventMultiplexer::Implementation::CallListeners (
void EventMultiplexer::Implementation::CallListeners (EventMultiplexerEvent& rEvent)
{
- ListenerList::const_iterator iListener (maListeners.begin());
- ListenerList::const_iterator iListenerEnd (maListeners.end());
+ ListenerList aCopyListeners( maListeners );
+ ListenerList::iterator iListener (aCopyListeners.begin());
+ ListenerList::const_iterator iListenerEnd (aCopyListeners.end());
for (; iListener!=iListenerEnd; ++iListener)
{
if ((iListener->second && rEvent.meEventId) != 0)
diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx
index fd45577..d30ba68 100644
--- a/sd/source/ui/unoidl/unopback.cxx
+++ b/sd/source/ui/unoidl/unopback.cxx
@@ -194,10 +194,8 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet )
setPropertyValue( aPropertyName, *pAny );
}
}
- else
- setPropertyValue( aIt->sName, *pAny );
- }
++aIt;
+ }
}
}
diff --git a/sd/source/ui/view/GraphicObjectBar.cxx b/sd/source/ui/view/GraphicObjectBar.cxx
index fe87a1c..49a9f36 100644
--- a/sd/source/ui/view/GraphicObjectBar.cxx
+++ b/sd/source/ui/view/GraphicObjectBar.cxx
@@ -173,8 +173,10 @@ void GraphicObjectBar::ExecuteFilter( SfxRequest& rReq )
aStr.Append( String( SdResId( STR_UNDO_GRAFFILTER ) ) );
mpView->BegUndo( aStr );
pFilteredObj->SetGraphicObject( aFilterObj );
- mpView->ReplaceObjectAtView( pObj, *pPageView, pFilteredObj );
- mpView->EndUndo();
+ ::sd::View* const pView = mpView;
+ pView->ReplaceObjectAtView( pObj, *pPageView, pFilteredObj );
+ pView->EndUndo();
+ return;
}
}
}
More information about the ooo-build-commit
mailing list