summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/app.hrc2
-rw-r--r--sd/inc/cusshow.hxx4
-rw-r--r--sd/inc/sdpage.hxx3
-rw-r--r--sd/inc/shapelist.hxx4
-rw-r--r--[-rwxr-xr-x]sd/prj/build.lst0
-rw-r--r--sd/sdi/sdraw.sdi2
-rw-r--r--sd/source/core/cusshow.cxx10
-rw-r--r--sd/source/core/sdpage.cxx63
-rw-r--r--sd/source/core/shapelist.cxx38
-rw-r--r--sd/source/ui/app/layoutctrl.cxx379
-rw-r--r--sd/source/ui/app/makefile.mk6
-rw-r--r--sd/source/ui/app/sddll2.cxx5
-rw-r--r--sd/source/ui/app/strings.src77
-rw-r--r--sd/source/ui/dlg/custsdlg.cxx1
-rw-r--r--sd/source/ui/dlg/layoutdialog.cxx296
-rw-r--r--sd/source/ui/dlg/layoutdialog.hrc33
-rw-r--r--sd/source/ui/dlg/layoutdialog.src53
-rw-r--r--sd/source/ui/dlg/makefile.mk9
-rw-r--r--sd/source/ui/func/fuinsert.cxx27
-rw-r--r--sd/source/ui/func/smarttag.cxx14
-rw-r--r--sd/source/ui/inc/DrawViewShell.hxx2
-rw-r--r--sd/source/ui/inc/View.hxx2
-rw-r--r--sd/source/ui/inc/layoutctrl.hxx53
-rw-r--r--sd/source/ui/inc/layoutdialog.hxx56
-rw-r--r--sd/source/ui/inc/smarttag.hxx1
-rw-r--r--sd/source/ui/inc/strings.hrc38
-rw-r--r--sd/source/ui/inc/view/viewoverlaymanager.hxx82
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx1
-rw-r--r--sd/source/ui/toolpanel/LayoutMenu.cxx83
-rw-r--r--sd/source/ui/view/drviews1.cxx4
-rw-r--r--sd/source/ui/view/drviews2.cxx39
-rw-r--r--sd/source/ui/view/drviews6.cxx28
-rw-r--r--sd/source/ui/view/drviews7.cxx20
-rw-r--r--sd/source/ui/view/drviewsa.cxx5
-rw-r--r--sd/source/ui/view/makefile.mk3
-rw-r--r--sd/source/ui/view/sdview4.cxx20
-rw-r--r--sd/source/ui/view/sdview5.cxx84
-rw-r--r--sd/source/ui/view/viewoverlaymanager.cxx549
-rw-r--r--sd/uiconfig/simpress/toolbar/commontaskbar.xml2
39 files changed, 1890 insertions, 208 deletions
diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc
index 0ccbbf921b6b..f78cf1c16716 100644
--- a/sd/inc/app.hrc
+++ b/sd/inc/app.hrc
@@ -443,6 +443,8 @@
#define SID_SELECT_BACKGROUND (SID_SD_START+422)
#define SID_OBJECT_CROP (SID_SD_START+423)
+#define SID_LAYOUT_DIALOG_WIN (SID_SD_START+424)
+
// Slots for the tool pane popup
#define SID_TP_APPLY_TO_ALL_SLIDES (SID_SD_START+425)
#define SID_TP_APPLY_TO_SELECTED_SLIDES (SID_SD_START+426)
diff --git a/sd/inc/cusshow.hxx b/sd/inc/cusshow.hxx
index 1bf8b5e724eb..ca3a44583f73 100644
--- a/sd/inc/cusshow.hxx
+++ b/sd/inc/cusshow.hxx
@@ -67,8 +67,8 @@ public:
// @@@ copy ctor, but no copy assignment? @@@
SdCustomShow( const SdCustomShow& rShow );
- void SetName(const String& rName) { aName = rName; }
- String GetName() const { return aName; }
+ void SetName(const String& rName);
+ String GetName() const;
SdDrawDocument* GetDoc() const { return pDoc; }
diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index 842c70d50fd3..698684dcc765 100644
--- a/sd/inc/sdpage.hxx
+++ b/sd/inc/sdpage.hxx
@@ -214,6 +214,9 @@ public:
/** inserts the given SdrObject into the presentation object list */
void InsertPresObj(SdrObject* pObj, PresObjKind eKind );
+ /** replace the given SdrObject with the new SdrObject in the presentation object list */
+ void ReplacePresObj(SdrObject* pOldObj, SdrObject* pNewObj, PresObjKind eNewKind );
+
void SetAutoLayout(AutoLayout eLayout, BOOL bInit=FALSE, BOOL bCreate=FALSE);
AutoLayout GetAutoLayout() const { return meAutoLayout; }
void CreateTitleAndLayout(BOOL bInit=FALSE, BOOL bCreate=FALSE);
diff --git a/sd/inc/shapelist.hxx b/sd/inc/shapelist.hxx
index 3e370f2d1220..977371008033 100644
--- a/sd/inc/shapelist.hxx
+++ b/sd/inc/shapelist.hxx
@@ -50,6 +50,8 @@ namespace sd
a pointer to the next shape in list or 0*/
SdrObject* removeShape( SdrObject& rObject );
+ void replaceShape( SdrObject& rOldObject, SdrObject& rNewObject );
+
/** removes all shapes from this list */
void clear();
@@ -79,6 +81,8 @@ namespace sd
*/
bool hasMore() const;
+ const std::list< SdrObject* >& getList() const { return maShapeList; }
+
private:
virtual void ObjectInDestruction(const SdrObject& rObject);
diff --git a/sd/prj/build.lst b/sd/prj/build.lst
index bc8bf923f7e5..bc8bf923f7e5 100755..100644
--- a/sd/prj/build.lst
+++ b/sd/prj/build.lst
diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi
index 7c37e455276c..0e91fb2c9134 100644
--- a/sd/sdi/sdraw.sdi
+++ b/sd/sdi/sdraw.sdi
@@ -4391,7 +4391,7 @@ SfxVoidItem ModifyPage SID_MODIFYPAGE
GroupId = GID_MODIFY;
]
-SfxVoidItem AssignLayout SID_ASSIGN_LAYOUT
+SfxUInt32Item AssignLayout SID_ASSIGN_LAYOUT
(SfxUInt32Item WhatPage ID_VAL_WHATPAGE, SfxUInt32Item WhatLayout ID_VAL_WHATLAYOUT)
[
/* flags: */
diff --git a/sd/source/core/cusshow.cxx b/sd/source/core/cusshow.cxx
index 78dc2192293a..25f0d47e9f8a 100644
--- a/sd/source/core/cusshow.cxx
+++ b/sd/source/core/cusshow.cxx
@@ -127,3 +127,13 @@ void SdCustomShow::RemovePage( const SdPage* pPage )
}
}
+void SdCustomShow::SetName(const String& rName)
+{
+ aName = rName;
+}
+
+String SdCustomShow::GetName() const
+{
+ return aName;
+}
+
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 69d1d0203936..0f58407a65b7 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -1088,24 +1088,24 @@ static const LayoutDescriptor& GetLayoutDescriptor( AutoLayout eLayout )
{
LayoutDescriptor( 0, PRESOBJ_TITLE, PRESOBJ_TEXT ), // AUTOLAYOUT_TITLE
LayoutDescriptor( 0, PRESOBJ_TITLE, PRESOBJ_OUTLINE ), // AUTOLAYOUT_ENUM
- LayoutDescriptor( 0, PRESOBJ_TITLE, PRESOBJ_CHART ), // AUTOLAYOUT_CHART
+ LayoutDescriptor( 0, PRESOBJ_TITLE, PRESOBJ_OUTLINE ), // AUTOLAYOUT_CHART
LayoutDescriptor( 1, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE ), // AUTOLAYOUT_2TEXT
- LayoutDescriptor( 1, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_CHART ), // AUTOLAYOUT_TEXTCHART
- LayoutDescriptor( 0, PRESOBJ_TITLE, PRESOBJ_ORGCHART ), // AUTOLAYOUT_ORG
- LayoutDescriptor( 1, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_GRAPHIC ), // AUTOLAYOUT_TEXTCLbIP
- LayoutDescriptor( 1, PRESOBJ_TITLE, PRESOBJ_CHART, PRESOBJ_OUTLINE ), // AUTOLAYOUT_CHARTTEXT
- LayoutDescriptor( 0, PRESOBJ_TITLE, PRESOBJ_TABLE ), // AUTOLAYOUT_TAB
- LayoutDescriptor( 1, PRESOBJ_TITLE, PRESOBJ_GRAPHIC, PRESOBJ_OUTLINE ), // AUTOLAYOUT_CLIPTEXT
- LayoutDescriptor( 1, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OBJECT ), // AUTOLAYOUT_TEXTOBJ
+ LayoutDescriptor( 1, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE ), // AUTOLAYOUT_TEXTCHART
+ LayoutDescriptor( 0, PRESOBJ_TITLE, PRESOBJ_OUTLINE ), // AUTOLAYOUT_ORG
+ LayoutDescriptor( 1, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE ), // AUTOLAYOUT_TEXTCLbIP
+ LayoutDescriptor( 1, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE ), // AUTOLAYOUT_CHARTTEXT
+ LayoutDescriptor( 0, PRESOBJ_TITLE, PRESOBJ_OUTLINE ), // AUTOLAYOUT_TAB
+ LayoutDescriptor( 1, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE ), // AUTOLAYOUT_CLIPTEXT
+ LayoutDescriptor( 1, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE ), // AUTOLAYOUT_TEXTOBJ
LayoutDescriptor( 0, PRESOBJ_TITLE, PRESOBJ_OBJECT ), // AUTOLAYOUT_OBJ
- LayoutDescriptor( 2, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OBJECT, PRESOBJ_OBJECT ), // AUTOLAYOUT_TEXT2OBJ
- LayoutDescriptor( 1, PRESOBJ_TITLE, PRESOBJ_OBJECT, PRESOBJ_OUTLINE ), // AUTOLAYOUT_TEXTOBJ
- LayoutDescriptor( 4, PRESOBJ_TITLE, PRESOBJ_OBJECT, PRESOBJ_OUTLINE ), // AUTOLAYOUT_OBJOVERTEXT
- LayoutDescriptor( 3, PRESOBJ_TITLE, PRESOBJ_OBJECT, PRESOBJ_OBJECT, PRESOBJ_OUTLINE ), // AUTOLAYOUT_2OBJTEXT
- LayoutDescriptor( 5, PRESOBJ_TITLE, PRESOBJ_OBJECT, PRESOBJ_OBJECT, PRESOBJ_OUTLINE ), // AUTOLAYOUT_2OBJOVERTEXT
- LayoutDescriptor( 4, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OBJECT ), // AUTOLAYOUT_TEXTOVEROBJ
- LayoutDescriptor( 6, PRESOBJ_TITLE, PRESOBJ_OBJECT, PRESOBJ_OBJECT, // AUTOLAYOUT_4OBJ
- PRESOBJ_OBJECT, PRESOBJ_OBJECT ),
+ LayoutDescriptor( 2, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE ), // AUTOLAYOUT_TEXT2OBJ
+ LayoutDescriptor( 1, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE ), // AUTOLAYOUT_TEXTOBJ
+ LayoutDescriptor( 4, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE ), // AUTOLAYOUT_OBJOVERTEXT
+ LayoutDescriptor( 3, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE ), // AUTOLAYOUT_2OBJTEXT
+ LayoutDescriptor( 5, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE ), // AUTOLAYOUT_2OBJOVERTEXT
+ LayoutDescriptor( 4, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE ), // AUTOLAYOUT_TEXTOVEROBJ
+ LayoutDescriptor( 6, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE, // AUTOLAYOUT_4OBJ
+ PRESOBJ_OUTLINE, PRESOBJ_OUTLINE ),
LayoutDescriptor( 0, PRESOBJ_TITLE, PRESOBJ_NONE ), // AUTOLAYOUT_ONLY_TITLE
LayoutDescriptor( 0, PRESOBJ_NONE ), // AUTOLAYOUT_NONE
LayoutDescriptor( 0, PRESOBJ_PAGE, PRESOBJ_NOTES ), // AUTOLAYOUT_NOTES
@@ -1114,16 +1114,16 @@ static const LayoutDescriptor& GetLayoutDescriptor( AutoLayout eLayout )
LayoutDescriptor( 0 ), // AUTOLAYOUT_HANDOUT3
LayoutDescriptor( 0 ), // AUTOLAYOUT_HANDOUT4
LayoutDescriptor( 0 ), // AUTOLAYOUT_HANDOUT6
- LayoutDescriptor( 7, PRESOBJ_TITLE|VERTICAL, PRESOBJ_OUTLINE|VERTICAL, PRESOBJ_CHART ),// AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART
+ LayoutDescriptor( 7, PRESOBJ_TITLE|VERTICAL, PRESOBJ_OUTLINE|VERTICAL, PRESOBJ_OUTLINE ),// AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART
LayoutDescriptor( 8, PRESOBJ_TITLE|VERTICAL, PRESOBJ_OUTLINE|VERTICAL ), // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
LayoutDescriptor( 0, PRESOBJ_TITLE, PRESOBJ_OUTLINE|VERTICAL ), // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE
- LayoutDescriptor( 9, PRESOBJ_TITLE, PRESOBJ_GRAPHIC, PRESOBJ_OUTLINE|VERTICAL ), // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE_CLIPART
+ LayoutDescriptor( 9, PRESOBJ_TITLE, PRESOBJ_OUTLINE|VERTICAL, PRESOBJ_OUTLINE|VERTICAL ), // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE_CLIPART
LayoutDescriptor( 0 ), // AUTOLAYOUT_HANDOUT9
LayoutDescriptor( 10, PRESOBJ_TEXT, PRESOBJ_NONE ), // AUTOLAYOUT_ONLY_TEXT
- LayoutDescriptor( 6, PRESOBJ_TITLE, PRESOBJ_GRAPHIC, PRESOBJ_GRAPHIC, // AUTOLAYOUT_4CLIPART
+ LayoutDescriptor( 6, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE, // AUTOLAYOUT_4CLIPART
PRESOBJ_GRAPHIC, PRESOBJ_GRAPHIC ),
- LayoutDescriptor( 11, PRESOBJ_TITLE, PRESOBJ_GRAPHIC, PRESOBJ_GRAPHIC, // AUTOLAYOUT_6CLIPART
- PRESOBJ_GRAPHIC, PRESOBJ_GRAPHIC, PRESOBJ_GRAPHIC, PRESOBJ_GRAPHIC )
+ LayoutDescriptor( 11, PRESOBJ_TITLE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE, // AUTOLAYOUT_6CLIPART
+ PRESOBJ_OUTLINE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE, PRESOBJ_OUTLINE )
};
if( (eLayout < AUTOLAYOUT__START) || (eLayout >= AUTOLAYOUT__END) )
@@ -1407,7 +1407,7 @@ void findAutoLayoutShapesImpl( SdPage& rPage, const LayoutDescriptor& rDescripto
bFound = eSdrObjKind == OBJ_TITLETEXT;
break;
case PRESOBJ_OUTLINE:
- bFound = (eSdrObjKind == OBJ_OUTLINETEXT) || ((eSdrObjKind == OBJ_TEXT) && bPresStyle);
+ bFound = (eSdrObjKind == OBJ_OUTLINETEXT) || ((eSdrObjKind == OBJ_TEXT) || (eSdrObjKind == OBJ_GRAF) || (eSdrObjKind == OBJ_OLE2) || (eSdrObjKind == OBJ_MEDIA) && bPresStyle);
break;
case PRESOBJ_GRAPHIC:
bFound = eSdrObjKind == OBJ_GRAF;
@@ -2348,6 +2348,25 @@ void SdPage::InsertPresObj(SdrObject* pObj, PresObjKind eKind )
}
}
+void SdPage::ReplacePresObj(SdrObject* pOldObj, SdrObject* pNewObj, PresObjKind eNewKind )
+{
+ if( !pNewObj )
+ {
+ RemovePresObj( pOldObj );
+ }
+ else if( pOldObj )
+ {
+ SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pNewObj, true);
+ if( pInfo )
+ pInfo->mePresObjKind = eNewKind;
+ maPresentationShapeList.replaceShape(*pOldObj, *pNewObj);
+ }
+ else
+ {
+ InsertPresObj( pNewObj, eNewKind );
+ }
+}
+
/*************************************************************************
|*
|* Text des Objektes setzen
diff --git a/sd/source/core/shapelist.cxx b/sd/source/core/shapelist.cxx
index 80c030646ee2..c1b97a0a4414 100644
--- a/sd/source/core/shapelist.cxx
+++ b/sd/source/core/shapelist.cxx
@@ -87,6 +87,44 @@ SdrObject* ShapeList::removeShape( SdrObject& rObject )
return 0;
}
+void ShapeList::replaceShape( SdrObject& rOldObject, SdrObject& rNewObject )
+{
+ if( &rOldObject == &rNewObject )
+ return;
+
+ ListImpl::iterator aIter( std::find( maShapeList.begin(), maShapeList.end(), &rNewObject ) );
+ if( aIter != maShapeList.end() )
+ {
+ bool bIterErased = aIter == maIter;
+ (*aIter)->RemoveObjectUser(*this);
+ aIter = maShapeList.erase( aIter );
+
+ if( bIterErased )
+ maIter = aIter;
+ }
+
+ aIter = std::find( maShapeList.begin(), maShapeList.end(), &rOldObject );
+ if( aIter != maShapeList.end() )
+ {
+ bool bIterErased = aIter == maIter;
+
+ ListImpl::iterator iNew( maShapeList.insert( aIter, &rNewObject ) );
+
+ (*aIter)->RemoveObjectUser(*this);
+ aIter = maShapeList.erase( aIter );
+
+ rNewObject.AddObjectUser( *this );
+
+ if( bIterErased )
+ maIter = iNew;
+ }
+ else
+ {
+ DBG_ERROR("sd::ShapeList::replaceShape(), given shape not part of list!");
+ addShape( rNewObject );
+ }
+}
+
/** removes all shapes from this list
NOTE: iterators will become invalid */
void ShapeList::clear()
diff --git a/sd/source/ui/app/layoutctrl.cxx b/sd/source/ui/app/layoutctrl.cxx
new file mode 100644
index 000000000000..71069cadab8f
--- /dev/null
+++ b/sd/source/ui/app/layoutctrl.cxx
@@ -0,0 +1,379 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tmplctrl.cxx,v $
+ *
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sd.hxx"
+
+#include <com/sun/star/text/WritingMode.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+
+#include <boost/scoped_ptr.hpp>
+
+#include <vcl/menu.hxx>
+#include <vcl/status.hxx>
+#include <vcl/toolbox.hxx>
+
+#include <svtools/languageoptions.hxx>
+#include <svtools/style.hxx>
+#include <svtools/stritem.hxx>
+#include <svtools/miscopt.hxx>
+#include <svtools/valueset.hxx>
+
+#include <sfx2/dispatch.hxx>
+#include <sfx2/dockwin.hxx>
+
+#include <svx/toolbarmenu.hxx>
+
+#include "layoutdialog.hxx"
+#include "sdresid.hxx"
+#include "res_bmp.hrc"
+#include "strings.hrc"
+#include "layoutctrl.hxx"
+#include "ViewShellBase.hxx"
+#include "drawdoc.hxx"
+#include "sdattr.hrc"
+#include "app.hrc"
+#include "glob.hrc"
+
+using ::rtl::OUString;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::beans;
+
+SFX_IMPL_TOOLBOX_CONTROL( SdLayoutControl, SfxVoidItem );
+
+#if 0
+class SdLayoutDialogContent : public SfxDockingWindow
+{
+ using DockingWindow::StateChanged;
+
+private:
+ ToolBox* mpToolBox;
+ ValueSet* mpLayoutSet;
+ AutoLayout meCurrentLayout;
+
+ /*boost::scoped_ptr<FixedText> mpTitle;
+ boost::scoped_ptr<FixedLine> mpSeperator;
+ boost::scoped_ptr<Menu> mpMenu;*/
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
+
+ bool mbPopupMode;
+
+ DECL_LINK( SelectHdl, void * );
+
+protected:
+ virtual void PopupModeEnd();
+
+ /** This function is called when the window gets the focus. It grabs
+ the focus to the line ends value set so that it can be controlled with
+ the keyboard.
+ */
+ virtual void GetFocus (void);
+
+public:
+ SdLayoutDialogContent( SfxBindings* pBindings, SfxChildWindow *pCW, ::Window* pParent, const SdResId& rSdResId, ViewShellBase& rBase);
+ ~SdLayoutDialogContent();
+
+ virtual SfxDockingWindow* Clone() const;
+
+ virtual void Paint( const Rectangle& rRect );
+
+ virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+};
+#endif
+// class SdLayoutControl ------------------------------------------
+
+SdLayoutControl::SdLayoutControl( USHORT _nSlotId, USHORT _nId, ToolBox& rTbx )
+: SfxToolBoxControl( _nSlotId, _nId, rTbx )
+{
+ rTbx.SetItemBits( _nId, TIB_DROPDOWNONLY | rTbx.GetItemBits( _nId ) );
+ rTbx.Invalidate();
+}
+
+// -----------------------------------------------------------------------
+
+SdLayoutControl::~SdLayoutControl()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void SdLayoutControl::Select( BOOL bMod1 )
+{
+ (void)bMod1;
+}
+
+// -----------------------------------------------------------------------
+
+void SdLayoutControl::StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState )
+{
+ SfxToolBoxControl::StateChanged( nSID, eState, pState );
+}
+
+SfxPopupWindowType SdLayoutControl::GetPopupWindowType() const
+{
+ return SFX_POPUPWINDOW_ONCLICK;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPopupWindow* SdLayoutControl::CreatePopupWindow()
+{
+ OUString sResourceName( RTL_CONSTASCII_USTRINGPARAM( "private:resource/dockingwindow/" ) );
+ sResourceName += OUString::valueOf( static_cast<sal_Int32>(GetId()) );
+ createAndPositionSubToolBar( sResourceName );
+/*
+ SfxPopupWindow* pWin = 0;
+
+ ToolBox& rTbx = GetToolBox();
+ SfxViewFrame* pViewFrame = SfxViewFrame::Current();
+ if( pViewFrame )
+ {
+ pWin = sd::LayoutDialogChildWindow::createChildWindow( *pViewFrame, &rTbx );
+ if( pWin )
+ {
+ pWin->EnableDocking(true);
+ Window::GetDockingManager()->StartPopupMode( &rTbx, pWin );
+ }
+ }
+ SetPopupWindow( pWin );
+ */
+ return 0;
+}
+
+#if 0
+// -----------------------------------------------------------------------
+
+struct snewfoil_value_info
+{
+ USHORT mnBmpResId;
+ USHORT mnHCBmpResId;
+ USHORT mnStrResId;
+ WritingMode meWritingMode;
+ AutoLayout maAutoLayout;
+};
+static snewfoil_value_info standard[] =
+{
+ {BMP_FOIL_20, BMP_FOIL_20_H, STR_AUTOLAYOUT_NONE, WritingMode_LR_TB, AUTOLAYOUT_NONE},
+ {BMP_FOIL_00, BMP_FOIL_00_H, STR_AUTOLAYOUT_TITLE, WritingMode_LR_TB, AUTOLAYOUT_TITLE},
+ {BMP_FOIL_01, BMP_FOIL_01_H, STR_AUTOLAYOUT_CONTENT, WritingMode_LR_TB, AUTOLAYOUT_ENUM},
+ {BMP_FOIL_03, BMP_FOIL_03_H, STR_AUTOLAYOUT_2CONTENT, WritingMode_LR_TB, AUTOLAYOUT_2TEXT},
+ {BMP_FOIL_19, BMP_FOIL_19_H, STR_AUTOLAYOUT_ONLY_TITLE, WritingMode_LR_TB, AUTOLAYOUT_ONLY_TITLE},
+ {BMP_FOIL_25, BMP_FOIL_25_H, STR_AUTOLAYOUT_ONLY_TEXT, WritingMode_LR_TB, AUTOLAYOUT_ONLY_TEXT},
+ {BMP_FOIL_12, BMP_FOIL_12_H, STR_AUTOLAYOUT_CONTENT_2CONTENT, WritingMode_LR_TB, AUTOLAYOUT_TEXT2OBJ},
+ {BMP_FOIL_15, BMP_FOIL_15_H, STR_AUTOLAYOUT_2CONTENT_CONTENT, WritingMode_LR_TB, AUTOLAYOUT_2OBJTEXT},
+ {BMP_FOIL_16, BMP_FOIL_16_H, STR_AUTOLAYOUT_2CONTENT_OVER_CONTENT,WritingMode_LR_TB, AUTOLAYOUT_2OBJOVERTEXT},
+ {BMP_FOIL_14, BMP_FOIL_14_H, STR_AUTOLAYOUT_CONTENT_OVER_CONTENT, WritingMode_LR_TB, AUTOLAYOUT_OBJOVERTEXT},
+ {BMP_FOIL_18, BMP_FOIL_18_H, STR_AUTOLAYOUT_4CONTENT, WritingMode_LR_TB, AUTOLAYOUT_4OBJ},
+ {BMP_FOIL_27, BMP_FOIL_27_H, STR_AUTOLAYOUT_6CONTENT, WritingMode_LR_TB, AUTOLAYOUT_6CLIPART},
+
+ // vertical
+ {BMP_FOIL_21, BMP_FOIL_21_H, STR_AL_VERT_TITLE_TEXT_CHART, WritingMode_TB_RL,AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART},
+ {BMP_FOIL_22, BMP_FOIL_22_H, STR_AL_VERT_TITLE_VERT_OUTLINE, WritingMode_TB_RL, AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE},
+ {BMP_FOIL_23, BMP_FOIL_23_H, STR_AL_TITLE_VERT_OUTLINE, WritingMode_TB_RL, AUTOLAYOUT_TITLE_VERTICAL_OUTLINE},
+ {BMP_FOIL_24, BMP_FOIL_24_H, STR_AL_TITLE_VERT_OUTLINE_CLIPART, WritingMode_TB_RL, AUTOLAYOUT_TITLE_VERTICAL_OUTLINE_CLIPART},
+
+ {0, 0, 0, WritingMode_LR_TB, AUTOLAYOUT_NONE}
+};
+
+SfxPopupWindowType SdLayoutControl::GetPopupWindowType() const
+{
+ return SFX_POPUPWINDOW_ONCLICK;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPopupWindow* SdLayoutControl::CreatePopupWindow()
+{
+ ToolBox& rTbx = GetToolBox();
+ SdLayoutDialogContent* pWin = new SdLayoutDialogContent( GetId(), m_xFrame, &rTbx );
+// pWin->StartPopupMode( &rTbx, FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_NOKEYCLOSE );
+ pWin->EnableDocking(true);
+
+ Window::GetDockingManager()->StartPopupMode( &rTbx, pWin );
+// SetPopupWindow( pWin );
+// return pWin;
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+SdLayoutDialogContent::SdLayoutDialogContent( USHORT nId, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow )
+: SfxDockingWindow( nId, rFrame, pParentWindow, WB_SYSTEMWINDOW )
+, mxFrame( rFrame )
+, mbPopupMode(true)
+, meCurrentLayout( AUTOLAYOUT_NONE )
+{
+// SetHelpId( HID_POPUP_LAYOUT );
+
+ const Color aMenuColor( GetSettings().GetStyleSettings().GetMenuColor() );
+ const Color aMenuBarColor( GetSettings().GetStyleSettings().GetMenuBarColor() );
+ const Color aMenuTextColor( GetSettings().GetStyleSettings().GetMenuBarColor() );
+ const Color aMenuBarTextColor( GetSettings().GetStyleSettings().GetMenuBarTextColor() );
+
+ const bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
+ SvtLanguageOptions aLanguageOptions;
+ const bool bVerticalEnabled = aLanguageOptions.IsVerticalTextEnabled();
+
+ mpToolbarMenu.reset( new ToolbarMenu( this, WB_CLIPCHILDREN ) );
+// mpToolbarMenu->SetHelpId( HID_MENU_EXTRUSION_DIRECTION );
+ mpToolbarMenu->SetSelectHdl( LINK( this, SdLayoutDialogContent, SelectHdl ) );
+
+
+ mpLayoutSet = new ValueSet( mpToolbarMenu.get(), WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT );
+// mpLayoutSet->SetHelpId( HID_VALUESET_EXTRUSION_LIGHTING );
+
+ mpLayoutSet->SetSelectHdl( LINK( this, SdLayoutDialogContent, SelectHdl ) );
+ mpLayoutSet->SetColCount( 4 );
+ mpLayoutSet->EnableFullItemMode( FALSE );
+
+ Size aLayoutItemSize;
+
+ USHORT nItem = 1;
+ for( snewfoil_value_info* pInfo = &standard[0]; pInfo->mnBmpResId; pInfo++ )
+ {
+ if( !bVerticalEnabled && (pInfo->meWritingMode == WritingMode_TB_RL) )
+ continue;
+
+ String aText( SdResId( pInfo->mnStrResId ) );
+ BitmapEx aBmp( SdResId( bHighContrast ? pInfo->mnHCBmpResId : pInfo->mnBmpResId ) );
+ mpLayoutSet->InsertItem( static_cast<USHORT>(pInfo->maAutoLayout)+1, aBmp, aText );
+
+ aLayoutItemSize.Width() = std::max( aLayoutItemSize.Width(), aBmp.GetSizePixel().Width() );
+ aLayoutItemSize.Height() = std::max( aLayoutItemSize.Height(), aBmp.GetSizePixel().Height() );
+ }
+
+ aLayoutItemSize = mpLayoutSet->CalcItemSizePixel( aLayoutItemSize );
+ Size aValueSize = mpLayoutSet->CalcWindowSizePixel( aLayoutItemSize );
+ mpLayoutSet->SetSizePixel( aValueSize );
+
+ mpToolbarMenu->appendEntry( -1, String( SdResId( STR_UNDO_MODIFY_PAGE ) ) );
+ mpToolbarMenu->appendEntry( 0, mpLayoutSet );
+ mpToolbarMenu->appendSeparator();
+ mpToolbarMenu->appendEntry( 1, String( RTL_CONSTASCII_USTRINGPARAM("Reset Slide Layout") ));
+
+ SetOutputSizePixel( mpToolbarMenu->getMenuSize() );
+ mpToolbarMenu->SetOutputSizePixel( GetOutputSizePixel() );
+
+ mpToolbarMenu->Show();
+
+ AddStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AssignLayout" )));
+}
+
+SfxDockingWindow* SdLayoutDialogContent::Clone() const
+{
+ return new SdLayoutDialogContent( GetId(), mxFrame );
+}
+
+void SdLayoutDialogContent::Paint( const Rectangle& rRect )
+{
+ SfxDockingWindow::Paint(rRect);
+}
+
+void SdLayoutDialogContent::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ SfxDockingWindow::DataChanged( rDCEvt );
+
+ if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
+ {
+ // const bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
+
+ // todo switch images
+ }
+}
+
+// -----------------------------------------------------------------------
+
+SdLayoutDialogContent::~SdLayoutDialogContent()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void SdLayoutDialogContent::StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState )
+{
+ if( (nSID == SID_ASSIGN_LAYOUT) && (eState != SFX_ITEM_DISABLED) )
+ {
+ const SfxUInt32Item* pStateItem = dynamic_cast< const SfxUInt32Item* >(pState);
+ if( pStateItem )
+ {
+ meCurrentLayout = static_cast< AutoLayout >( pStateItem->GetValue() );
+ mpLayoutSet->SelectItem( static_cast<USHORT>(meCurrentLayout)+1 );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( SdLayoutDialogContent, SelectHdl, void *, pControl )
+{
+ if ( IsInPopupMode() )
+ EndPopupMode();
+
+ AutoLayout eLayout = meCurrentLayout;
+
+ if( pControl == mpLayoutSet )
+ eLayout = static_cast< AutoLayout >(mpLayoutSet->GetSelectItemId()-1);
+
+ const rtl::OUString aCommand( RTL_CONSTASCII_USTRINGPARAM( ".uno:AssignLayout" ));
+
+ Sequence< PropertyValue > aArgs( 1 );
+ aArgs[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("WhatLayout") );
+ aArgs[0].Value <<= static_cast<sal_Int32>(eLayout);
+
+ SfxToolBoxControl::Dispatch( Reference< ::com::sun::star::frame::XDispatchProvider >( mxFrame->getController(), UNO_QUERY ), aCommand, aArgs );
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+void SdLayoutDialogContent::PopupModeEnd()
+{
+ if ( IsVisible() )
+ mbPopupMode = FALSE;
+ SfxDockingWindow::PopupModeEnd();
+}
+
+// -----------------------------------------------------------------------
+
+void SdLayoutDialogContent::GetFocus (void)
+{
+ SfxDockingWindow::GetFocus();
+ if( mpToolbarMenu )
+ mpToolbarMenu->GrabFocus();
+}
+#endif
+
+
diff --git a/sd/source/ui/app/makefile.mk b/sd/source/ui/app/makefile.mk
index 82a6177a9e95..9be951710db0 100644
--- a/sd/source/ui/app/makefile.mk
+++ b/sd/source/ui/app/makefile.mk
@@ -74,12 +74,14 @@ SLOFILES = \
$(SLO)$/sdresid.obj \
$(SLO)$/sdpopup.obj \
$(SLO)$/sdxfer.obj \
- $(SLO)$/tmplctrl.obj
+ $(SLO)$/tmplctrl.obj \
+ $(SLO)$/layoutctrl.obj
EXCEPTIONSFILES= \
$(SLO)$/sdxfer.obj \
$(SLO)$/sdmod1.obj \
- $(SLO)$/tmplctrl.obj
+ $(SLO)$/tmplctrl.obj \
+ $(SLO)$/layoutctrl.obj
.IF "$(GUI)" == "WNT"
diff --git a/sd/source/ui/app/sddll2.cxx b/sd/source/ui/app/sddll2.cxx
index c222e5f3cb44..3c56631aadf7 100644
--- a/sd/source/ui/app/sddll2.cxx
+++ b/sd/source/ui/app/sddll2.cxx
@@ -92,6 +92,8 @@
#include "PaneChildWindows.hxx"
#include "tmplctrl.hxx"
+#include "layoutctrl.hxx"
+#include "layoutdialog.hxx"
/*************************************************************************
|*
@@ -230,4 +232,7 @@ void SdDLL::RegisterControllers()
SvxFrameLineColorToolBoxControl::RegisterControl(SID_FRAME_LINECOLOR, pMod );
SvxFrameToolBoxControl::RegisterControl(SID_ATTR_BORDER, pMod );
SvxSubToolBoxControl::RegisterControl(SID_OPTIMIZE_TABLE, pMod);
+
+ SdLayoutControl::RegisterControl( SID_ASSIGN_LAYOUT, pMod );
+ sd::LayoutDialogChildWindow::RegisterChildWindow( sal_False, pMod );
}
diff --git a/sd/source/ui/app/strings.src b/sd/source/ui/app/strings.src
index 696e92940b9f..13f3503b5d31 100644
--- a/sd/source/ui/app/strings.src
+++ b/sd/source/ui/app/strings.src
@@ -169,6 +169,7 @@ String STR_HANDOUT_MODE
{
Text [ en-US ] = "Handout" ;
};
+
String STR_AUTOLAYOUT_NONE
{
Text [ en-US ] = "Blank Slide" ;
@@ -185,77 +186,41 @@ String STR_AUTOLAYOUT_TITLE
{
Text [ en-US ] = "Title Slide" ;
};
-String STR_AUTOLAYOUT_OBJ
-{
- Text [ en-US ] = "Title, Object" ;
-};
-String STR_AUTOLAYOUT_ENUM
-{
- Text [ en-US ] = "Title, Text" ;
-};
-String STR_AUTOLAYOUT_CHART
-{
- Text [ en-US ] = "Title, Chart" ;
-};
-String STR_AUTOLAYOUT_TAB
-{
- Text [ en-US ] = "Title, Spreadsheet" ;
-};
-String STR_AUTOLAYOUT_CLIPTEXT
-{
- Text [ en-US ] = "Title, Clipart, Text" ;
-};
-String STR_AUTOLAYOUT_2TEXT
+String STR_AUTOLAYOUT_CONTENT
{
- Text [ en-US ] = "Title, 2 Text Blocks" ;
+ Text [ en-US ] = "Title, Content" ;
};
-String STR_AUTOLAYOUT_TEXTCHART
+String STR_AUTOLAYOUT_2CONTENT
{
- Text [ en-US ] = "Title, Text, Chart" ;
+ Text [ en-US ] = "Title and 2 Content" ;
};
-String STR_AUTOLAYOUT_TEXTCLIP
+String STR_AUTOLAYOUT_CONTENT_2CONTENT
{
- Text [ en-US ] = "Title, Text, Clipart" ;
+ Text [ en-US ] = "Title, Content and 2 Content" ;
};
-String STR_AUTOLAYOUT_CHARTTEXT
+String STR_AUTOLAYOUT_2CONTENT_CONTENT
{
- Text [ en-US ] = "Title, Chart, Text" ;
+ Text [ en-US ] = "Title, 2 Content and Content" ;
};
-String STR_AUTOLAYOUT_TEXTOBJ
+String STR_AUTOLAYOUT_CONTENT_OVER_2CONTENT
{
- Text [ en-US ] = "Title, Text, Object" ;
+ Text [ en-US ] = "Title, Content over 2 Content" ;
};
-String STR_AUTOLAYOUT_TEXT2OBJ
+String STR_AUTOLAYOUT_2CONTENT_OVER_CONTENT
{
- Text [ en-US ] = "Title, Text, 2 Objects" ;
+ Text [ en-US ] = "Title, 2 Content over Content" ;
};
-String STR_AUTOLAYOUT_OBJTEXT
+String STR_AUTOLAYOUT_CONTENT_OVER_CONTENT
{
- Text [ en-US ] = "Title, Object, Text" ;
+ Text [ en-US ] = "Title, Content over Content" ;
};
-String STR_AUTOLAYOUT_OBJOVERTEXT
+String STR_AUTOLAYOUT_4CONTENT
{
- Text [ en-US ] = "Title, Object Above Text" ;
+ Text [ en-US ] = "Title, 4 Content" ;
};
-String STR_AUTOLAYOUT_2OBJTEXT
+String STR_AUTOLAYOUT_6CONTENT
{
- Text [ en-US ] = "Title, 2 Objects, Text" ;
-};
-String STR_AUTOLAYOUT_2OBJOVERTEXT
-{
- Text [ en-US ] = "Title, 2 Objects Above Text" ;
-};
-String STR_AUTOLAYOUT_TEXTOVEROBJ
-{
- Text [ en-US ] = "Title, Text Above Object" ;
-};
-String STR_AUTOLAYOUT_4OBJ
-{
- Text [ en-US ] = "Title, 4 Objects" ;
-};
-String STR_AUTOLAYOUT_4CLIPART
-{
- Text [ en-US ] = "Title, 4 Cliparts" ;
+ Text [ en-US ] = "Title, 6 Content" ;
};
String STR_AL_TITLE_VERT_OUTLINE
{
@@ -273,10 +238,6 @@ String STR_AL_VERT_TITLE_VERT_OUTLINE
{
Text [ en-US ] = "Vertical Title, Vertical Text" ;
};
-String STR_AUTOLAYOUT_6CLIPART
-{
- Text [ en-US ] = "Title, 6 Cliparts" ;
-};
String STR_AUTOLAYOUT_HANDOUT1
{
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index 631a3b8a23f2..9876e193ff38 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -45,7 +45,6 @@
#include "sdpage.hxx"
#include "cusshow.hxx"
#include "app.hxx"
-#include "optsitem.hxx"
#include <vcl/msgbox.hxx>
diff --git a/sd/source/ui/dlg/layoutdialog.cxx b/sd/source/ui/dlg/layoutdialog.cxx
new file mode 100644
index 000000000000..c431db29d651
--- /dev/null
+++ b/sd/source/ui/dlg/layoutdialog.cxx
@@ -0,0 +1,296 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: LayerDialogContent.cxx,v $
+ * $Revision: 1.7 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sd.hxx"
+
+#include <com/sun/star/frame/XFrame.hpp>
+#include "layoutdialog.hxx"
+#include <sfx2/dockwin.hxx>
+#include "app.hrc"
+#include <sfx2/app.hxx>
+
+// Instantiate the implementation of the docking window before files
+// are included that define ::sd::Window. The ... macros are not really
+// namespace proof.
+namespace sd {
+SFX_IMPL_DOCKINGWINDOW(LayoutDialogChildWindow, SID_LAYOUT_DIALOG_WIN)
+}
+
+#include <vcl/image.hxx>
+
+#include <sfx2/dispatch.hxx>
+#include <sfx2/imagemgr.hxx>
+#include <sfx2/tbxctrl.hxx>
+
+#include <svtools/languageoptions.hxx>
+#include <svtools/valueset.hxx>
+
+#include <svx/toolbarmenu.hxx>
+
+#include <com/sun/star/text/WritingMode.hpp>
+
+#include "layoutdialog.hrc"
+#include "glob.hrc"
+#include "strings.hrc"
+#include "res_bmp.hrc"
+#include "sdresid.hxx"
+#include "View.hxx"
+#include "drawdoc.hxx"
+#include "ViewShellBase.hxx"
+#include "DrawViewShell.hxx"
+
+using ::rtl::OUString;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::frame;
+
+namespace sd {
+
+///
+class SdLayoutDialogContent : public SfxPopupWindow
+{
+public:
+ SdLayoutDialogContent( ViewShellBase& rBase, Window* pParent);
+ virtual ~SdLayoutDialogContent();
+
+protected:
+ virtual void Resize (void);
+
+ DECL_LINK( SelectHdl, void * );
+
+private:
+ boost::scoped_ptr<ToolbarMenu> mpToolbarMenu;
+ ValueSet* mpLayoutSet;
+ AutoLayout meCurrentLayout;
+ ViewShellBase& mrBase;
+};
+
+// -----------------------------------------------------------------------
+
+LayoutDialogChildWindow::LayoutDialogChildWindow(::Window* _pParent, USHORT nId, SfxBindings* pBindings, SfxChildWinInfo* pInfo)
+: SfxChildWindow (_pParent, nId)
+{
+ ViewShellBase& rBase (*ViewShellBase::GetViewShellBase(pBindings->GetDispatcher()->GetFrame()));
+ SdLayoutDialogContent* pContent = new SdLayoutDialogContent (rBase, _pParent);
+ pWindow = pContent;
+ eChildAlignment = SFX_ALIGN_NOALIGNMENT;
+// pContent->Initialize(pInfo);
+}
+
+LayoutDialogChildWindow::~LayoutDialogChildWindow (void)
+{
+
+}
+
+SfxPopupWindow* LayoutDialogChildWindow::createChildWindow(SfxViewFrame& rViewFrame, ::Window* pParent)
+{
+ SfxPopupWindow* pWin = 0;
+ sd::ViewShellBase* pViewShellBase = sd::ViewShellBase::GetViewShellBase( &rViewFrame );
+ if( pViewShellBase )
+ {
+ pWin = new SdLayoutDialogContent( *pViewShellBase, pParent );
+ }
+ return pWin;
+}
+
+// -----------------------------------------------------------------------
+
+struct snewfoil_value_info
+{
+ USHORT mnBmpResId;
+ USHORT mnHCBmpResId;
+ USHORT mnStrResId;
+ WritingMode meWritingMode;
+ AutoLayout maAutoLayout;
+};
+static snewfoil_value_info standard[] =
+{
+ {BMP_FOIL_20, BMP_FOIL_20_H, STR_AUTOLAYOUT_NONE, WritingMode_LR_TB, AUTOLAYOUT_NONE},
+ {BMP_FOIL_00, BMP_FOIL_00_H, STR_AUTOLAYOUT_TITLE, WritingMode_LR_TB, AUTOLAYOUT_TITLE},
+ {BMP_FOIL_01, BMP_FOIL_01_H, STR_AUTOLAYOUT_CONTENT, WritingMode_LR_TB, AUTOLAYOUT_ENUM},
+ {BMP_FOIL_03, BMP_FOIL_03_H, STR_AUTOLAYOUT_2CONTENT, WritingMode_LR_TB, AUTOLAYOUT_2TEXT},
+ {BMP_FOIL_19, BMP_FOIL_19_H, STR_AUTOLAYOUT_ONLY_TITLE, WritingMode_LR_TB, AUTOLAYOUT_ONLY_TITLE},
+ {BMP_FOIL_25, BMP_FOIL_25_H, STR_AUTOLAYOUT_ONLY_TEXT, WritingMode_LR_TB, AUTOLAYOUT_ONLY_TEXT},
+ {BMP_FOIL_12, BMP_FOIL_12_H, STR_AUTOLAYOUT_CONTENT_2CONTENT, WritingMode_LR_TB, AUTOLAYOUT_TEXT2OBJ},
+ {BMP_FOIL_15, BMP_FOIL_15_H, STR_AUTOLAYOUT_2CONTENT_CONTENT, WritingMode_LR_TB, AUTOLAYOUT_2OBJTEXT},
+ {BMP_FOIL_16, BMP_FOIL_16_H, STR_AUTOLAYOUT_2CONTENT_OVER_CONTENT,WritingMode_LR_TB, AUTOLAYOUT_2OBJOVERTEXT},
+ {BMP_FOIL_14, BMP_FOIL_14_H, STR_AUTOLAYOUT_CONTENT_OVER_CONTENT, WritingMode_LR_TB, AUTOLAYOUT_OBJOVERTEXT},
+ {BMP_FOIL_18, BMP_FOIL_18_H, STR_AUTOLAYOUT_4CONTENT, WritingMode_LR_TB, AUTOLAYOUT_4OBJ},
+ {BMP_FOIL_27, BMP_FOIL_27_H, STR_AUTOLAYOUT_6CONTENT, WritingMode_LR_TB, AUTOLAYOUT_6CLIPART},
+
+ // vertical
+ {BMP_FOIL_21, BMP_FOIL_21_H, STR_AL_VERT_TITLE_TEXT_CHART, WritingMode_TB_RL,AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART},
+ {BMP_FOIL_22, BMP_FOIL_22_H, STR_AL_VERT_TITLE_VERT_OUTLINE, WritingMode_TB_RL, AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE},
+ {BMP_FOIL_23, BMP_FOIL_23_H, STR_AL_TITLE_VERT_OUTLINE, WritingMode_TB_RL, AUTOLAYOUT_TITLE_VERTICAL_OUTLINE},
+ {BMP_FOIL_24, BMP_FOIL_24_H, STR_AL_TITLE_VERT_OUTLINE_CLIPART, WritingMode_TB_RL, AUTOLAYOUT_TITLE_VERTICAL_OUTLINE_CLIPART},
+
+ {0, 0, 0, WritingMode_LR_TB, AUTOLAYOUT_NONE}
+};
+
+// -----------------------------------------------------------------------
+
+SdLayoutDialogContent::SdLayoutDialogContent( ViewShellBase& rBase, Window* pParent )
+: SfxPopupWindow(SID_ASSIGN_LAYOUT, rBase.GetFrame()->GetTopFrame()->GetFrameInterface(), pParent, SdResId( FLT_WIN_LAYOUT_DIALOG ))
+, meCurrentLayout( AUTOLAYOUT_NONE )
+, mrBase(rBase)
+{
+ String sResetSlideLayout( SdResId( STR_RESET_LAYOUT ) );
+
+ FreeResource();
+
+// SetHelpId( HID_POPUP_LAYOUT );
+
+ const Color aMenuColor( GetSettings().GetStyleSettings().GetMenuColor() );
+ const Color aMenuBarColor( GetSettings().GetStyleSettings().GetMenuBarColor() );
+ const Color aMenuTextColor( GetSettings().GetStyleSettings().GetMenuBarColor() );
+ const Color aMenuBarTextColor( GetSettings().GetStyleSettings().GetMenuBarTextColor() );
+
+ const bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
+ SvtLanguageOptions aLanguageOptions;
+ const bool bVerticalEnabled = aLanguageOptions.IsVerticalTextEnabled();
+
+ mpToolbarMenu.reset( new ToolbarMenu( this, WB_CLIPCHILDREN ) );
+// mpToolbarMenu->SetHelpId( HID_MENU_EXTRUSION_DIRECTION );
+ mpToolbarMenu->SetSelectHdl( LINK( this, SdLayoutDialogContent, SelectHdl ) );
+
+
+ mpLayoutSet = new ValueSet( mpToolbarMenu.get(), WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT );
+// mpLayoutSet->SetHelpId( HID_VALUESET_EXTRUSION_LIGHTING );
+
+ mpLayoutSet->SetSelectHdl( LINK( this, SdLayoutDialogContent, SelectHdl ) );
+ mpLayoutSet->SetColCount( 4 );
+ mpLayoutSet->EnableFullItemMode( FALSE );
+
+ Size aLayoutItemSize;
+
+ USHORT nItem = 1;
+ for( snewfoil_value_info* pInfo = &standard[0]; pInfo->mnBmpResId; pInfo++ )
+ {
+ if( !bVerticalEnabled && (pInfo->meWritingMode == WritingMode_TB_RL) )
+ continue;
+
+ String aText( SdResId( pInfo->mnStrResId ) );
+ BitmapEx aBmp( SdResId( bHighContrast ? pInfo->mnHCBmpResId : pInfo->mnBmpResId ) );
+ mpLayoutSet->InsertItem( static_cast<USHORT>(pInfo->maAutoLayout)+1, aBmp, aText );
+
+ aLayoutItemSize.Width() = std::max( aLayoutItemSize.Width(), aBmp.GetSizePixel().Width() );
+ aLayoutItemSize.Height() = std::max( aLayoutItemSize.Height(), aBmp.GetSizePixel().Height() );
+ }
+
+ aLayoutItemSize = mpLayoutSet->CalcItemSizePixel( aLayoutItemSize );
+ Size aValueSize = mpLayoutSet->CalcWindowSizePixel( aLayoutItemSize );
+ mpLayoutSet->SetSizePixel( aValueSize );
+
+ mpToolbarMenu->appendEntry( -1, String( SdResId( STR_UNDO_MODIFY_PAGE ) ) );
+ mpToolbarMenu->appendEntry( 0, mpLayoutSet );
+ mpToolbarMenu->appendSeparator();
+
+ Reference< XFrame > xFrame( GetFrame(), UNO_QUERY );
+ if( xFrame.is() )
+ {
+ Image aImg( ::GetImage( xFrame, OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:Undo") ), FALSE, FALSE ) );
+ mpToolbarMenu->appendEntry( 1, sResetSlideLayout, aImg);
+ }
+ else
+ {
+ mpToolbarMenu->appendEntry( 1, sResetSlideLayout);
+ }
+
+ SetOutputSizePixel( mpToolbarMenu->getMenuSize() );
+ mpToolbarMenu->SetOutputSizePixel( GetOutputSizePixel() );
+
+ mpToolbarMenu->Show();
+
+// AddStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AssignLayout" )));
+}
+
+SdLayoutDialogContent::~SdLayoutDialogContent()
+{
+}
+
+void SdLayoutDialogContent::Resize (void)
+{
+ SfxPopupWindow::Resize();
+ mpToolbarMenu->SetPosSizePixel( Point(0,0), GetSizePixel() );
+}
+
+/*
+void SdLayoutDialogContent::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ SfxDockingWindow::DataChanged( rDCEvt );
+
+ if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
+ {
+ // const bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
+
+ // todo switch images
+ }
+}
+*/
+
+// -----------------------------------------------------------------------
+
+/*
+void SdLayoutDialogContent::StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState )
+{
+ if( (nSID == SID_ASSIGN_LAYOUT) && (eState != SFX_ITEM_DISABLED) )
+ {
+ const SfxUInt32Item* pStateItem = dynamic_cast< const SfxUInt32Item* >(pState);
+ if( pStateItem )
+ {
+ meCurrentLayout = static_cast< AutoLayout >( pStateItem->GetValue() );
+ mpLayoutSet->SelectItem( static_cast<USHORT>(meCurrentLayout)+1 );
+ }
+ }
+}
+*/
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( SdLayoutDialogContent, SelectHdl, void *, pControl )
+{
+ if ( IsInPopupMode() )
+ EndPopupMode();
+/*
+ AutoLayout eLayout = meCurrentLayout;
+
+ if( pControl == mpLayoutSet )
+ eLayout = static_cast< AutoLayout >(mpLayoutSet->GetSelectItemId()-1);
+
+ const SfxUInt32Item aItem(ID_VAL_WHATLAYOUT, eLayout);
+ GetBindings().GetDispatcher()->Execute(SID_ASSIGN_LAYOUT,SFX_CALLMODE_ASYNCHRON,&aItem,0);
+*/
+ return 0;
+}
+
+} // end of namespace sd
diff --git a/sd/source/ui/dlg/layoutdialog.hrc b/sd/source/ui/dlg/layoutdialog.hrc
new file mode 100644
index 000000000000..c53f5342f2b5
--- /dev/null
+++ b/sd/source/ui/dlg/layoutdialog.hrc
@@ -0,0 +1,33 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: LayerDialog.src,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#define FLT_WIN_LAYOUT_DIALOG 795
+
+#define STR_RESET_LAYOUT 1
diff --git a/sd/source/ui/dlg/layoutdialog.src b/sd/source/ui/dlg/layoutdialog.src
new file mode 100644
index 000000000000..a9a3d315faf0
--- /dev/null
+++ b/sd/source/ui/dlg/layoutdialog.src
@@ -0,0 +1,53 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: LayerDialog.src,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "app.hrc"
+#include "layoutdialog.hrc"
+#include "helpids.h"
+
+DockingWindow FLT_WIN_LAYOUT_DIALOG
+{
+ HelpId = HID_SD_SLIDE_LAYOUTS;
+ Border = TRUE ;
+ Hide = TRUE ;
+ SVLook = TRUE ;
+ Sizeable = TRUE ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ Zoomable = TRUE ;
+ Dockable = TRUE ;
+ EnableResizing = TRUE ;
+
+ String STR_RESET_LAYOUT
+ {
+ Text[ en-US ] = "Reset Slide Layout";
+ };
+};
+
diff --git a/sd/source/ui/dlg/makefile.mk b/sd/source/ui/dlg/makefile.mk
index ee62a9c29d7d..252950a73a5e 100644
--- a/sd/source/ui/dlg/makefile.mk
+++ b/sd/source/ui/dlg/makefile.mk
@@ -76,7 +76,8 @@ SRC1FILES =\
LayerDialog.src \
PaneDockingWindow.src \
layeroptionsdlg.src \
- printdialog.src
+ printdialog.src \
+ layoutdialog.src
SLOFILES = \
@@ -126,7 +127,8 @@ SLOFILES = \
$(SLO)$/PaneChildWindows.obj \
$(SLO)$/PaneDockingWindow.obj \
$(SLO)$/PaneShells.obj \
- $(SLO)$/printdialog.obj
+ $(SLO)$/printdialog.obj \
+ $(SLO)$/layoutdialog.obj
LIB1TARGET= $(SLB)$/$(TARGET).lib
@@ -153,7 +155,8 @@ LIB1OBJFILES= \
$(SLO)$/PaneChildWindows.obj \
$(SLO)$/PaneDockingWindow.obj \
$(SLO)$/PaneShells.obj \
- $(SLO)$/printdialog.obj
+ $(SLO)$/printdialog.obj \
+ $(SLO)$/layoutdialog.obj
LIB2TARGET= $(SLB)$/sdui.lib
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 578830b37c25..b6f368d09052 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -147,34 +147,15 @@ void FuInsertGraphic::DoExecute( SfxRequest& )
if( mpViewShell && mpViewShell->ISA(DrawViewShell))
{
sal_Int8 nAction = DND_ACTION_COPY;
- SdrGrafObj* pEmptyGrafObj = NULL;
-
- if ( mpView->AreObjectsMarked() )
- {
- /**********************************************************
- * Is an empty graphic object available?
- **********************************************************/
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
-
- if (rMarkList.GetMarkCount() == 1)
- {
- SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObj = pMark->GetMarkedSdrObj();
-
- if (pObj->GetObjInventor() == SdrInventor &&
- pObj->GetObjIdentifier() == OBJ_GRAF)
- {
- nAction = DND_ACTION_LINK;
- pEmptyGrafObj = (SdrGrafObj*) pObj;
- }
- }
- }
+ SdrObject* pPickObj = mpView->GetEmptyPresentationObject( PRESOBJ_GRAPHIC );
+ if( pPickObj )
+ nAction = DND_ACTION_LINK;
Point aPos;
Rectangle aRect(aPos, mpWindow->GetOutputSizePixel() );
aPos = aRect.Center();
aPos = mpWindow->PixelToLogic(aPos);
- SdrGrafObj* pGrafObj = mpView->InsertGraphic(aGraphic, nAction, aPos, pEmptyGrafObj, NULL);
+ SdrGrafObj* pGrafObj = mpView->InsertGraphic(aGraphic, nAction, aPos, pPickObj, NULL);
if(pGrafObj && aDlg.IsAsLink())
{
diff --git a/sd/source/ui/func/smarttag.cxx b/sd/source/ui/func/smarttag.cxx
index ecd2c7a685f6..c07fabbfe962 100644
--- a/sd/source/ui/func/smarttag.cxx
+++ b/sd/source/ui/func/smarttag.cxx
@@ -175,6 +175,12 @@ void SmartTagSet::add( const SmartTagReference& xTag )
{
maSet.insert( xTag );
mrView.InvalidateAllWin();
+
+ if( xTag == mxMouseOverTag )
+ mxMouseOverTag.clear();
+
+ if( xTag == mxSelectedTag )
+ mxSelectedTag.clear();
}
// --------------------------------------------------------------------
@@ -185,6 +191,12 @@ void SmartTagSet::remove( const SmartTagReference& xTag )
if( aIter != maSet.end() )
maSet.erase( aIter );
mrView.InvalidateAllWin();
+
+ if( xTag == mxMouseOverTag )
+ mxMouseOverTag.clear();
+
+ if( xTag == mxSelectedTag )
+ mxSelectedTag.clear();
}
// --------------------------------------------------------------------
@@ -196,6 +208,8 @@ void SmartTagSet::Dispose()
for( std::set< SmartTagReference >::iterator aIter( aSet.begin() ); aIter != aSet.end(); )
(*aIter++)->Dispose();
mrView.InvalidateAllWin();
+ mxMouseOverTag.clear();
+ mxSelectedTag.clear();
}
// --------------------------------------------------------------------
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index b9a3e062955b..2b9ee36a2cc6 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -60,6 +60,7 @@ class LayerTabBar;
class Ruler;
class SdUnoDrawView;
class AnnotationManager;
+class ViewOverlayManager;
#define CHECK_RANGE(nMin, nValue, nMax) ((nValue >= nMin) && (nValue <= nMax))
@@ -499,6 +500,7 @@ private:
using ViewShell::Notify;
::std::auto_ptr< AnnotationManager > mpAnnotationManager;
+ ::std::auto_ptr< ViewOverlayManager > mpViewOverlayManager;
};
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index 6f63ab1c90f8..de30ee1292a9 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -211,6 +211,8 @@ public:
void SetMarkedPointsSmoothPossible( bool bSet ) { bSetMarkedPointsSmoothPossible = bSet; }
void SetMarkedSegmentsKindPossible( bool bSet ) { bSetMarkedSegmentsKindPossible = bSet; }
+ SdrObject* GetEmptyPresentationObject( PresObjKind eKind );
+
protected:
DECL_LINK( OnParagraphInsertedHdl, ::Outliner * );
DECL_LINK( OnParagraphRemovingHdl, ::Outliner * );
diff --git a/sd/source/ui/inc/layoutctrl.hxx b/sd/source/ui/inc/layoutctrl.hxx
new file mode 100644
index 000000000000..de9f93ea524a
--- /dev/null
+++ b/sd/source/ui/inc/layoutctrl.hxx
@@ -0,0 +1,53 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: tmplctrl.hxx,v $
+ *
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SD_LAYOUTCTRL_HXX
+#define _SD_LAYOUTCTRL_HXX
+
+#include <sfx2/tbxctrl.hxx>
+
+class SdLayoutControl : public SfxToolBoxControl
+{
+public:
+ SdLayoutControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
+ ~SdLayoutControl();
+
+ using SfxToolBoxControl::Select;
+ virtual void Select( BOOL bMod1 = FALSE );
+ virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+
+ SFX_DECL_TOOLBOX_CONTROL();
+};
+
+
+#endif
+
diff --git a/sd/source/ui/inc/layoutdialog.hxx b/sd/source/ui/inc/layoutdialog.hxx
new file mode 100644
index 000000000000..6dd427901856
--- /dev/null
+++ b/sd/source/ui/inc/layoutdialog.hxx
@@ -0,0 +1,56 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: LayerDialogContent.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef SD_LAYOUTDIALOG_HXX
+#define SD_LAYOUTDIALOG_HXX
+
+#include <sfx2/childwin.hxx>
+
+class SfxViewFrame;
+class ::Window;
+class SfxPopupWindow;
+
+namespace sd {
+
+class LayoutDialogChildWindow : public SfxChildWindow
+{
+public:
+ LayoutDialogChildWindow ( ::Window*, USHORT, SfxBindings*, SfxChildWinInfo*);
+ virtual ~LayoutDialogChildWindow (void);
+
+ SFX_DECL_CHILDWINDOW(LayerDialogChildWindow);
+
+ static SfxPopupWindow* createChildWindow(SfxViewFrame& rViewFrame, ::Window* pParent);
+};
+
+} // end of namespace sd
+
+#endif
+
diff --git a/sd/source/ui/inc/smarttag.hxx b/sd/source/ui/inc/smarttag.hxx
index feaa0fa27fd8..7a9f682f38a1 100644
--- a/sd/source/ui/inc/smarttag.hxx
+++ b/sd/source/ui/inc/smarttag.hxx
@@ -166,6 +166,7 @@ private:
::sd::View& mrView;
SmartTagReference mxSelectedTag;
+ SmartTagReference mxMouseOverTag;
};
/** a derivation from this handle is the visual representation for a smart tag.
diff --git a/sd/source/ui/inc/strings.hrc b/sd/source/ui/inc/strings.hrc
index b04582046502..c29b8bc5f8fb 100644
--- a/sd/source/ui/inc/strings.hrc
+++ b/sd/source/ui/inc/strings.hrc
@@ -171,26 +171,20 @@
#define STR_DRAW_MEDIA_TOOLBOX RID_DRAW_MEDIA_TOOLBOX
// IDs fuer Praesentationsfolien
-#define STR_AUTOLAYOUT_NONE (RID_APP_START+210)
-#define STR_AUTOLAYOUT_ONLY_TITLE (RID_APP_START+211)
-#define STR_AUTOLAYOUT_TITLE (RID_APP_START+212)
-#define STR_AUTOLAYOUT_OBJ (RID_APP_START+213)
-#define STR_AUTOLAYOUT_ENUM (RID_APP_START+214)
-#define STR_AUTOLAYOUT_CHART (RID_APP_START+215)
-#define STR_AUTOLAYOUT_TAB (RID_APP_START+217)
-#define STR_AUTOLAYOUT_CLIPTEXT (RID_APP_START+218)
-#define STR_AUTOLAYOUT_2TEXT (RID_APP_START+219)
-#define STR_AUTOLAYOUT_TEXTCHART (RID_APP_START+220)
-#define STR_AUTOLAYOUT_TEXTCLIP (RID_APP_START+221)
-#define STR_AUTOLAYOUT_CHARTTEXT (RID_APP_START+222)
-#define STR_AUTOLAYOUT_TEXTOBJ (RID_APP_START+223)
-#define STR_AUTOLAYOUT_TEXT2OBJ (RID_APP_START+224)
-#define STR_AUTOLAYOUT_OBJTEXT (RID_APP_START+225)
-#define STR_AUTOLAYOUT_OBJOVERTEXT (RID_APP_START+226)
-#define STR_AUTOLAYOUT_2OBJTEXT (RID_APP_START+227)
-#define STR_AUTOLAYOUT_2OBJOVERTEXT (RID_APP_START+228)
-#define STR_AUTOLAYOUT_TEXTOVEROBJ (RID_APP_START+229)
-#define STR_AUTOLAYOUT_4OBJ (RID_APP_START+230)
+#define STR_AUTOLAYOUT_NONE (RID_APP_START+210)
+#define STR_AUTOLAYOUT_ONLY_TITLE (RID_APP_START+211)
+#define STR_AUTOLAYOUT_ONLY_TEXT (RID_APP_START+212)
+#define STR_AUTOLAYOUT_TITLE (RID_APP_START+213)
+#define STR_AUTOLAYOUT_CONTENT (RID_APP_START+214)
+#define STR_AUTOLAYOUT_2CONTENT (RID_APP_START+215)
+#define STR_AUTOLAYOUT_CONTENT_2CONTENT (RID_APP_START+217)
+#define STR_AUTOLAYOUT_2CONTENT_CONTENT (RID_APP_START+218)
+#define STR_AUTOLAYOUT_CONTENT_OVER_2CONTENT (RID_APP_START+219)
+#define STR_AUTOLAYOUT_2CONTENT_OVER_CONTENT (RID_APP_START+220)
+#define STR_AUTOLAYOUT_CONTENT_OVER_CONTENT (RID_APP_START+221)
+#define STR_AUTOLAYOUT_4CONTENT (RID_APP_START+222)
+#define STR_AUTOLAYOUT_6CONTENT (RID_APP_START+223)
+
#define STR_AUTOLAYOUT_HANDOUT1 (RID_APP_START+231)
#define STR_AUTOLAYOUT_HANDOUT2 (RID_APP_START+232)
#define STR_AUTOLAYOUT_HANDOUT3 (RID_APP_START+233)
@@ -198,13 +192,9 @@
#define STR_AUTOLAYOUT_HANDOUT6 (RID_APP_START+235)
#define STR_AUTOLAYOUT_NOTES (RID_APP_START+236)
#define STR_AUTOLAYOUT_HANDOUT9 (RID_APP_START+237)
-#define STR_AUTOLAYOUT_ONLY_TEXT (RID_APP_START+238)
-#define STR_AUTOLAYOUT_4CLIPART (RID_APP_START+239)
#define STR_TRANSFORM (RID_APP_START+240)
-#define STR_AUTOLAYOUT_6CLIPART (RID_APP_START+241)
-
#define STR_EXPORT_HTML_NAME (RID_APP_START+244)
#define STR_EXPORT_HTML_FILTER (RID_APP_START+245)
#define STR_EXPORT_DIALOG_TITLE (RID_APP_START+261)
diff --git a/sd/source/ui/inc/view/viewoverlaymanager.hxx b/sd/source/ui/inc/view/viewoverlaymanager.hxx
new file mode 100644
index 000000000000..54164c08c138
--- /dev/null
+++ b/sd/source/ui/inc/view/viewoverlaymanager.hxx
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: $
+ * $Revision: $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SD_VIEWOVERLAYMANAGER_HXX
+#define _SD_VIEWOVERLAYMANAGER_HXX
+
+//#include <com/sun/star/drawing/XDrawView.hpp>
+
+#include <vcl/image.hxx>
+#include <svtools/lstner.hxx>
+#include "EventMultiplexer.hxx"
+#include "ViewShellBase.hxx"
+
+namespace sd
+{
+
+typedef std::vector< rtl::Reference< SmartTag > > ViewTagVector;
+
+class ViewOverlayManager : public SfxListener
+{
+public:
+ ViewOverlayManager( ViewShellBase& rViewShellBase );
+ virtual ~ViewOverlayManager();
+
+ void onZoomChanged();
+ void UpdateTags();
+
+ DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent*);
+ DECL_LINK(UpdateTagsHdl, void *);
+
+ bool CreateTags();
+ bool DisposeTags();
+
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+
+ static const int ButtonCount = 4;
+ static Image maLargeButtonImages[ButtonCount];
+ static Image maSmallButtonImages[ButtonCount];
+ static USHORT mnButtonSlots[ButtonCount];
+
+private:
+ void UpdateImages();
+
+ ViewShellBase& mrBase;
+ ULONG mnUpdateTagsEvent;
+
+ ViewTagVector maTagVector;
+
+// ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView > mxView;
+// ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotationAccess > mxCurrentPage;
+};
+
+}
+
+#endif // _SD_VIEWOVERLAYMANAGER_HXX
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
index 2eac8b757780..8e9083aa092b 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
@@ -294,6 +294,7 @@ void SelectionManager::SelectionHasChanged (const bool bMakeSelectionVisible)
pViewShell->Invalidate(SID_HIDE_SLIDE);
pViewShell->Invalidate(SID_DELETE_PAGE);
pViewShell->Invalidate(SID_DELETE_MASTER_PAGE);
+ pViewShell->Invalidate(SID_ASSIGN_LAYOUT);
// StatusBar
pViewShell->Invalidate (SID_STATUS_PAGE);
diff --git a/sd/source/ui/toolpanel/LayoutMenu.cxx b/sd/source/ui/toolpanel/LayoutMenu.cxx
index b78042e2e9ae..5f9dbf0f6e74 100644
--- a/sd/source/ui/toolpanel/LayoutMenu.cxx
+++ b/sd/source/ui/toolpanel/LayoutMenu.cxx
@@ -164,60 +164,37 @@ static snewfoil_value_info handout[] =
static snewfoil_value_info standard[] =
{
- {BMP_FOIL_20, BMP_FOIL_20_H, STR_AUTOLAYOUT_NONE, WritingMode_LR_TB,
- AUTOLAYOUT_NONE},
- {BMP_FOIL_00, BMP_FOIL_00_H, STR_AUTOLAYOUT_TITLE, WritingMode_LR_TB,
- AUTOLAYOUT_TITLE},
- {BMP_FOIL_01, BMP_FOIL_01_H, STR_AUTOLAYOUT_ENUM, WritingMode_LR_TB,
- AUTOLAYOUT_ENUM},
- {BMP_FOIL_03, BMP_FOIL_03_H, STR_AUTOLAYOUT_2TEXT, WritingMode_LR_TB,
- AUTOLAYOUT_2TEXT},
- {BMP_FOIL_19, BMP_FOIL_19_H, STR_AUTOLAYOUT_ONLY_TITLE, WritingMode_LR_TB,
- AUTOLAYOUT_ONLY_TITLE},
- {BMP_FOIL_25, BMP_FOIL_25_H, STR_AUTOLAYOUT_ONLY_TEXT, WritingMode_LR_TB,
- AUTOLAYOUT_ONLY_TEXT},
- {BMP_FOIL_11, BMP_FOIL_11_H, STR_AUTOLAYOUT_OBJ, WritingMode_LR_TB,
- AUTOLAYOUT_OBJ},
- {BMP_FOIL_02, BMP_FOIL_02_H, STR_AUTOLAYOUT_CHART, WritingMode_LR_TB,
- AUTOLAYOUT_CHART},
- {BMP_FOIL_08, BMP_FOIL_08_H, STR_AUTOLAYOUT_TAB, WritingMode_LR_TB,
- AUTOLAYOUT_TAB},
- {BMP_FOIL_09, BMP_FOIL_09_H, STR_AUTOLAYOUT_CLIPTEXT, WritingMode_LR_TB,
- AUTOLAYOUT_CLIPTEXT},
- {BMP_FOIL_04, BMP_FOIL_04_H, STR_AUTOLAYOUT_TEXTCHART, WritingMode_LR_TB,
- AUTOLAYOUT_TEXTCHART},
- {BMP_FOIL_06, BMP_FOIL_06_H, STR_AUTOLAYOUT_TEXTCLIP, WritingMode_LR_TB,
- AUTOLAYOUT_TEXTCLIP},
- {BMP_FOIL_07, BMP_FOIL_07_H, STR_AUTOLAYOUT_CHARTTEXT, WritingMode_LR_TB,
- AUTOLAYOUT_CHARTTEXT},
- {BMP_FOIL_10, BMP_FOIL_10_H, STR_AUTOLAYOUT_TEXTOBJ, WritingMode_LR_TB,
- AUTOLAYOUT_TEXTOBJ},
- {BMP_FOIL_12, BMP_FOIL_12_H, STR_AUTOLAYOUT_TEXT2OBJ, WritingMode_LR_TB,
- AUTOLAYOUT_TEXT2OBJ},
- {BMP_FOIL_13, BMP_FOIL_13_H, STR_AUTOLAYOUT_OBJTEXT, WritingMode_LR_TB,
- AUTOLAYOUT_OBJTEXT},
- {BMP_FOIL_14, BMP_FOIL_14_H, STR_AUTOLAYOUT_OBJOVERTEXT, WritingMode_LR_TB,
- AUTOLAYOUT_OBJOVERTEXT},
- {BMP_FOIL_15, BMP_FOIL_15_H, STR_AUTOLAYOUT_2OBJTEXT, WritingMode_LR_TB,
- AUTOLAYOUT_2OBJTEXT},
- {BMP_FOIL_16, BMP_FOIL_16_H, STR_AUTOLAYOUT_2OBJOVERTEXT,
- WritingMode_LR_TB, AUTOLAYOUT_2OBJOVERTEXT},
- {BMP_FOIL_17, BMP_FOIL_17_H, STR_AUTOLAYOUT_TEXTOVEROBJ, WritingMode_LR_TB,
- AUTOLAYOUT_TEXTOVEROBJ},
- {BMP_FOIL_18, BMP_FOIL_18_H, STR_AUTOLAYOUT_4OBJ, WritingMode_LR_TB,
- AUTOLAYOUT_4OBJ},
- {BMP_FOIL_26, BMP_FOIL_26_H, STR_AUTOLAYOUT_4CLIPART, WritingMode_LR_TB, AUTOLAYOUT_4CLIPART},
- {BMP_FOIL_27, BMP_FOIL_27_H, STR_AUTOLAYOUT_6CLIPART, WritingMode_LR_TB, AUTOLAYOUT_6CLIPART},
-
+ {BMP_FOIL_20, BMP_FOIL_20_H, STR_AUTOLAYOUT_NONE, WritingMode_LR_TB, AUTOLAYOUT_NONE},
+ {BMP_FOIL_00, BMP_FOIL_00_H, STR_AUTOLAYOUT_TITLE, WritingMode_LR_TB, AUTOLAYOUT_TITLE},
+ {BMP_FOIL_01, BMP_FOIL_01_H, STR_AUTOLAYOUT_CONTENT, WritingMode_LR_TB, AUTOLAYOUT_ENUM},
+ {BMP_FOIL_03, BMP_FOIL_03_H, STR_AUTOLAYOUT_2CONTENT, WritingMode_LR_TB, AUTOLAYOUT_2TEXT},
+ {BMP_FOIL_19, BMP_FOIL_19_H, STR_AUTOLAYOUT_ONLY_TITLE, WritingMode_LR_TB, AUTOLAYOUT_ONLY_TITLE},
+ {BMP_FOIL_25, BMP_FOIL_25_H, STR_AUTOLAYOUT_ONLY_TEXT, WritingMode_LR_TB, AUTOLAYOUT_ONLY_TEXT},
+ {BMP_FOIL_12, BMP_FOIL_12_H, STR_AUTOLAYOUT_CONTENT_2CONTENT, WritingMode_LR_TB, AUTOLAYOUT_TEXT2OBJ},
+ {BMP_FOIL_15, BMP_FOIL_15_H, STR_AUTOLAYOUT_2CONTENT_CONTENT, WritingMode_LR_TB, AUTOLAYOUT_2OBJTEXT},
+//STR_AUTOLAYOUT_CONTENT_OVER_2CONTENT
+ {BMP_FOIL_16, BMP_FOIL_16_H, STR_AUTOLAYOUT_2CONTENT_OVER_CONTENT,WritingMode_LR_TB, AUTOLAYOUT_2OBJOVERTEXT},
+ {BMP_FOIL_14, BMP_FOIL_14_H, STR_AUTOLAYOUT_CONTENT_OVER_CONTENT, WritingMode_LR_TB, AUTOLAYOUT_OBJOVERTEXT},
+ {BMP_FOIL_18, BMP_FOIL_18_H, STR_AUTOLAYOUT_4CONTENT, WritingMode_LR_TB, AUTOLAYOUT_4OBJ},
+ {BMP_FOIL_27, BMP_FOIL_27_H, STR_AUTOLAYOUT_6CONTENT, WritingMode_LR_TB, AUTOLAYOUT_6CLIPART},
+/*
+ {BMP_FOIL_11, BMP_FOIL_11_H, STR_AUTOLAYOUT_OBJ, WritingMode_LR_TB, AUTOLAYOUT_OBJ},
+ {BMP_FOIL_02, BMP_FOIL_02_H, STR_AUTOLAYOUT_CHART, WritingMode_LR_TB, AUTOLAYOUT_CHART},
+ {BMP_FOIL_08, BMP_FOIL_08_H, STR_AUTOLAYOUT_TAB, WritingMode_LR_TB, AUTOLAYOUT_TAB},
+ {BMP_FOIL_09, BMP_FOIL_09_H, STR_AUTOLAYOUT_CLIPTEXT, WritingMode_LR_TB, AUTOLAYOUT_CLIPTEXT},
+ {BMP_FOIL_04, BMP_FOIL_04_H, STR_AUTOLAYOUT_TEXTCHART, WritingMode_LR_TB, AUTOLAYOUT_TEXTCHART},
+ {BMP_FOIL_06, BMP_FOIL_06_H, STR_AUTOLAYOUT_TEXTCLIP, WritingMode_LR_TB, AUTOLAYOUT_TEXTCLIP},
+ {BMP_FOIL_07, BMP_FOIL_07_H, STR_AUTOLAYOUT_CHARTTEXT, WritingMode_LR_TB, AUTOLAYOUT_CHARTTEXT},
+ {BMP_FOIL_10, BMP_FOIL_10_H, STR_AUTOLAYOUT_TEXTOBJ, WritingMode_LR_TB, AUTOLAYOUT_TEXTOBJ},
+ {BMP_FOIL_13, BMP_FOIL_13_H, STR_AUTOLAYOUT_OBJTEXT, WritingMode_LR_TB, AUTOLAYOUT_OBJTEXT},
+ {BMP_FOIL_17, BMP_FOIL_17_H, STR_AUTOLAYOUT_TEXTOVEROBJ, WritingMode_LR_TB, AUTOLAYOUT_TEXTOVEROBJ},
+ {BMP_FOIL_26, BMP_FOIL_26_H, STR_AUTOLAYOUT_4CLIPART, WritingMode_LR_TB, AUTOLAYOUT_4CLIPART},
+*/
// vertical
- {BMP_FOIL_21, BMP_FOIL_21_H, STR_AL_VERT_TITLE_TEXT_CHART,
- WritingMode_TB_RL, AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART},
- {BMP_FOIL_22, BMP_FOIL_22_H, STR_AL_VERT_TITLE_VERT_OUTLINE,
- WritingMode_TB_RL, AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE},
- {BMP_FOIL_23, BMP_FOIL_23_H, STR_AL_TITLE_VERT_OUTLINE, WritingMode_TB_RL,
- AUTOLAYOUT_TITLE_VERTICAL_OUTLINE},
- {BMP_FOIL_24, BMP_FOIL_24_H, STR_AL_TITLE_VERT_OUTLINE_CLIPART,
- WritingMode_TB_RL, AUTOLAYOUT_TITLE_VERTICAL_OUTLINE_CLIPART},
+ {BMP_FOIL_21, BMP_FOIL_21_H, STR_AL_VERT_TITLE_TEXT_CHART, WritingMode_TB_RL,AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART},
+ {BMP_FOIL_22, BMP_FOIL_22_H, STR_AL_VERT_TITLE_VERT_OUTLINE, WritingMode_TB_RL, AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE},
+ {BMP_FOIL_23, BMP_FOIL_23_H, STR_AL_TITLE_VERT_OUTLINE, WritingMode_TB_RL, AUTOLAYOUT_TITLE_VERTICAL_OUTLINE},
+ {BMP_FOIL_24, BMP_FOIL_24_H, STR_AL_TITLE_VERT_OUTLINE_CLIPART, WritingMode_TB_RL, AUTOLAYOUT_TITLE_VERTICAL_OUTLINE_CLIPART},
{0, 0, 0, WritingMode_LR_TB, AUTOLAYOUT_NONE}
};
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 2077a852f960..e870f706f810 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -71,6 +71,8 @@
#include <svx/dialogs.hrc>
+#include "view/viewoverlaymanager.hxx"
+
#include "glob.hrc"
#include "app.hrc"
#include "res_bmp.hrc"
@@ -295,6 +297,7 @@ void DrawViewShell::SetZoom( long nZoom )
ViewShell::SetZoom( nZoom );
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM );
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER );
+ mpViewOverlayManager->onZoomChanged();
}
/*************************************************************************
@@ -308,6 +311,7 @@ void DrawViewShell::SetZoomRect( const Rectangle& rZoomRect )
ViewShell::SetZoomRect( rZoomRect );
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM );
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER );
+ mpViewOverlayManager->onZoomChanged();
}
/*************************************************************************
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 12b81a01d3ba..bf8407383909 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -101,6 +101,8 @@
#include <strings.hrc>
+#include "layoutdialog.hxx"
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -428,18 +430,35 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_ASSIGN_LAYOUT:
{
- if (mePageKind==PK_STANDARD
- || mePageKind==PK_NOTES
- || (mePageKind==PK_HANDOUT && meEditMode==EM_MASTERPAGE))
+ if (mePageKind==PK_STANDARD || mePageKind==PK_NOTES || (mePageKind==PK_HANDOUT && meEditMode==EM_MASTERPAGE))
{
- if ( mpDrawView->IsTextEdit() )
- mpDrawView->SdrEndTextEdit();
+ if( rReq.GetArgs() )
+ {
+ const SfxUInt32Item* pWhatPage = static_cast< const SfxUInt32Item* > ( rReq.GetArg( ID_VAL_WHATPAGE, FALSE, TYPE(SfxUInt32Item) ) );
+ const SfxUInt32Item* pWhatLayout = static_cast< const SfxUInt32Item* > ( rReq.GetArg( ID_VAL_WHATLAYOUT, FALSE, TYPE(SfxUInt32Item) ) );
+
+ if( pWhatLayout )
+ {
+ if ( mpDrawView->IsTextEdit() )
+ mpDrawView->SdrEndTextEdit();
- SFX_REQUEST_ARG (rReq, pWhatPage, SfxUInt32Item, ID_VAL_WHATPAGE, FALSE);
- SFX_REQUEST_ARG (rReq, pWhatLayout, SfxUInt32Item, ID_VAL_WHATLAYOUT, FALSE);
- ::sd::ViewShell::mpImpl->AssignLayout (
- GetDoc()->GetSdPage((USHORT)pWhatPage->GetValue(), mePageKind),
- (AutoLayout)pWhatLayout->GetValue());
+ USHORT nPage;
+ if( pWhatPage )
+ {
+ nPage = pWhatPage->GetValue();
+ }
+ else
+ {
+ nPage = maTabControl.GetCurPageId() - 1;
+ }
+
+ ::sd::ViewShell::mpImpl->AssignLayout(GetDoc()->GetSdPage((USHORT)nPage, mePageKind),(AutoLayout)pWhatLayout->GetValue());
+ }
+ }
+ else
+ {
+ GetViewFrame()->ToggleChildWindow( sd::LayoutDialogChildWindow::GetChildWindowId() );
+ }
}
Cancel();
rReq.Done ();
diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx
index d89bb43a0098..7dd139e88067 100644
--- a/sd/source/ui/view/drviews6.cxx
+++ b/sd/source/ui/view/drviews6.cxx
@@ -73,6 +73,7 @@
#include "AnimationChildWindow.hxx"
#include "NavigatorChildWindow.hxx"
#include "LayerDialogChildWindow.hxx"
+#include "layoutdialog.hxx"
#include "sdresid.hxx"
#include "fupoor.hxx"
#include "fusldlg.hxx"
@@ -371,6 +372,11 @@ void DrawViewShell::SetChildWindowState( SfxItemSet& rSet )
USHORT nId = ::avmedia::MediaPlayer::GetChildWindowId();
rSet.Put( SfxBoolItem( SID_AVMEDIA_PLAYER, GetViewFrame()->HasChildWindow( nId ) ) );
}
+ if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_LAYOUT_DIALOG_WIN ) )
+ {
+ USHORT nId = LayoutDialogChildWindow::GetChildWindowId();
+ rSet.Put( SfxBoolItem( SID_LAYOUT_DIALOG_WIN, GetViewFrame()->HasChildWindow( nId ) ) );
+ }
}
@@ -735,6 +741,28 @@ void DrawViewShell::FuTemp04(SfxRequest& rReq)
}
break;
+ case SID_LAYOUT_DIALOG_WIN:
+ {
+ if ( rReq.GetArgs() )
+ {
+ GetViewFrame()->SetChildWindow(
+ LayoutDialogChildWindow::GetChildWindowId(),
+ ((const SfxBoolItem&) (rReq.GetArgs()->
+ Get(SID_LAYOUT_DIALOG_WIN))).GetValue());
+ }
+ else
+ {
+ GetViewFrame()->ToggleChildWindow(
+ LayoutDialogChildWindow::GetChildWindowId());
+ }
+
+ GetViewFrame()->GetBindings().Invalidate(SID_LAYOUT_DIALOG_WIN);
+ Cancel();
+ rReq.Ignore ();
+ }
+ break;
+
+
case SID_DISPLAY_MASTER_BACKGROUND:
case SID_DISPLAY_MASTER_OBJECTS:
{
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index cc7fd3106fa2..0ba354fbe8d8 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -297,6 +297,26 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
GetMenuStateSel(rSet);
+ if (SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_ASSIGN_LAYOUT))
+ {
+ bool bDisable = true;
+ if( pPageView )
+ {
+ SdPage* pPage = dynamic_cast< SdPage* >( pPageView->GetPage() );
+
+ if( pPage )
+ {
+ rSet.Put( SfxUInt32Item( SID_ASSIGN_LAYOUT, static_cast< sal_uInt32 >(pPage->GetAutoLayout()) ) );
+ bDisable = false;
+ }
+ }
+
+ if(bDisable)
+ {
+ rSet.DisableItem(SID_EXPAND_PAGE);
+ }
+ }
+
if (SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_EXPAND_PAGE))
{
bool bDisable = true;
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 2eb4282bb6e5..dddfe4d94f47 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -65,6 +65,7 @@
#include <svtools/cliplistener.hxx>
#include <svx/float3d.hxx>
+#include "view/viewoverlaymanager.hxx"
#include "app.hrc"
#include "helpids.h"
#include "strings.hrc"
@@ -174,7 +175,8 @@ DrawViewShell::DrawViewShell( SfxViewFrame* pFrame, ::Window* pParentWindow, con
DrawViewShell::~DrawViewShell()
{
- mpAnnotationManager.release();
+ mpAnnotationManager.reset();
+ mpViewOverlayManager.reset();
OSL_ASSERT (GetViewShell()!=NULL);
@@ -419,6 +421,7 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
}
mpAnnotationManager.reset( new AnnotationManager( GetViewShellBase() ) );
+ mpViewOverlayManager.reset( new ViewOverlayManager( GetViewShellBase() ) );
}
diff --git a/sd/source/ui/view/makefile.mk b/sd/source/ui/view/makefile.mk
index a65f3fd7c87f..89b6f3d232c4 100644
--- a/sd/source/ui/view/makefile.mk
+++ b/sd/source/ui/view/makefile.mk
@@ -113,7 +113,8 @@ SLOFILES = \
$(SLO)$/ViewShellManager.obj \
$(SLO)$/ViewShellHint.obj \
$(SLO)$/ViewTabBar.obj \
- $(SLO)$/WindowUpdater.obj
+ $(SLO)$/WindowUpdater.obj \
+ $(SLO)$/ViewOverlayManager.obj
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 9d301368418c..e75f1e981ea9 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -120,11 +120,20 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
if( mnAction == DND_ACTION_LINK && pPickObj && pPV )
{
- if( pPickObj->ISA( SdrGrafObj ) )
+ const bool bIsGraphic = pPickObj->ISA( SdrGrafObj );
+ if( bIsGraphic || pObj->IsEmptyPresObj() )
{
- // Das Objekt wird mit der Bitmap gefuellt
- pNewGrafObj = (SdrGrafObj*) pPickObj->Clone();
- pNewGrafObj->SetGraphic(rGraphic);
+ if( bIsGraphic )
+ {
+ // Das Objekt wird mit der Bitmap gefuellt
+ pNewGrafObj = (SdrGrafObj*) pPickObj->Clone();
+ pNewGrafObj->SetGraphic(rGraphic);
+ }
+ else
+ {
+ pNewGrafObj = new SdrGrafObj( rGraphic, pPickObj->GetLogicRect() );
+ pNewGrafObj->SetEmptyPresObj(TRUE);
+ }
if ( pNewGrafObj->IsEmptyPresObj() )
{
@@ -149,8 +158,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
AddUndo( new sd::UndoObjectPresentationKind( *pPickObj ) );
AddUndo( new sd::UndoObjectPresentationKind( *pNewGrafObj ) );
}
- pPage->RemovePresObj(pPickObj);
- pPage->InsertPresObj(pNewGrafObj, PRESOBJ_GRAPHIC);
+ pPage->ReplacePresObj(pPickObj, pNewGrafObj, PRESOBJ_GRAPHIC);
if( !bUndo )
{
diff --git a/sd/source/ui/view/sdview5.cxx b/sd/source/ui/view/sdview5.cxx
index 6fc8349dfb21..a459011b5f10 100644
--- a/sd/source/ui/view/sdview5.cxx
+++ b/sd/source/ui/view/sdview5.cxx
@@ -30,3 +30,87 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sd.hxx"
+
+#include "sdpage.hxx"
+#include "View.hxx"
+#include "pres.hxx"
+
+namespace sd {
+
+static bool implIsMultiPresObj( PresObjKind eKind )
+{
+ switch( eKind )
+ {
+ case PRESOBJ_OUTLINE:
+ case PRESOBJ_GRAPHIC:
+ case PRESOBJ_OBJECT:
+ case PRESOBJ_CHART:
+ case PRESOBJ_ORGCHART:
+ case PRESOBJ_TABLE:
+ case PRESOBJ_IMAGE:
+ return true;
+ default:
+ return false;
+ }
+}
+
+SdrObject* View::GetEmptyPresentationObject( PresObjKind eKind )
+{
+ SdrObject* pEmptyObj = 0;
+
+ SdrPageView* pPV = GetSdrPageView();
+ if( pPV )
+ {
+ SdPage* pPage = static_cast< SdPage* >( pPV->GetPage() );
+ if( pPage )
+ {
+ // first try selected shape
+ if ( AreObjectsMarked() )
+ {
+ /**********************************************************
+ * Is an empty graphic object available?
+ **********************************************************/
+ const SdrMarkList& rMarkList = GetMarkedObjectList();
+
+ if (rMarkList.GetMarkCount() == 1)
+ {
+ SdrMark* pMark = rMarkList.GetMark(0);
+ SdrObject* pObj = pMark->GetMarkedSdrObj();
+
+ if( pObj->IsEmptyPresObj() && implIsMultiPresObj( pPage->GetPresObjKind(pObj) ) )
+ pEmptyObj = pObj;
+ }
+ }
+
+ // try to find empty pres obj of same type
+ if( !pEmptyObj )
+ {
+ int nIndex = 1;
+ do
+ {
+ pEmptyObj = pPage->GetPresObj(eKind, nIndex++ );
+ }
+ while( (pEmptyObj != 0) && (!pEmptyObj->IsEmptyPresObj()) );
+ }
+
+ // last try to find empty pres obj of multiple type
+ if( !pEmptyObj )
+ {
+ const std::list< SdrObject* >& rShapes = pPage->GetPresentationShapeList().getList();
+
+ for( std::list< SdrObject* >::const_iterator iter( rShapes.begin() ); iter != rShapes.end(); iter++ )
+ {
+ if( (*iter)->IsEmptyPresObj() && implIsMultiPresObj(pPage->GetPresObjKind(*iter)) )
+ {
+ pEmptyObj = (*iter);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return pEmptyObj;
+}
+
+} \ No newline at end of file
diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx
new file mode 100644
index 000000000000..802296322c35
--- /dev/null
+++ b/sd/source/ui/view/viewoverlaymanager.cxx
@@ -0,0 +1,549 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: $
+ * $Revision: $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sd.hxx"
+
+#include "sddll.hxx"
+
+#include <com/sun/star/frame/XFrame.hpp>
+#include <sfx2/imagemgr.hxx>
+#include <sfx2/viewfrm.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/app.hxx>
+#include <sfx2/request.hxx>
+#include <sfx2/dispatch.hxx>
+
+#include <vcl/help.hxx>
+
+#include <svx/sdrpagewindow.hxx>
+#include <svx/sdrpaintwindow.hxx>
+#include <svx/sdr/overlay/overlayanimatedbitmapex.hxx>
+#include <svx/sdr/overlay/overlaybitmapex.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
+#include <svx/svxids.hrc>
+
+#include "view/viewoverlaymanager.hxx"
+
+#include "DrawDocShell.hxx"
+#include "DrawViewShell.hxx"
+#include "DrawController.hxx"
+#include "glob.hrc"
+#include "sdresid.hxx"
+#include "EventMultiplexer.hxx"
+#include "ViewShellManager.hxx"
+#include "helpids.h"
+#include "sdpage.hxx"
+#include "drawdoc.hxx"
+#include "smarttag.hxx"
+
+using ::rtl::OUString;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::frame;
+
+namespace sd {
+
+class ImageButtonHdl;
+
+const sal_uInt32 SMART_TAG_HDL_NUM = SAL_MAX_UINT32;
+
+class ChangePlaceholderTag : public SmartTag
+{
+ friend class ImageButtonHdl;
+public:
+ ChangePlaceholderTag( ViewOverlayManager& rManager, ::sd::View& rView, SdrObject& rPlaceholderObj );
+ virtual ~ChangePlaceholderTag();
+
+ /** returns true if the SmartTag handled the event. */
+ virtual bool MouseButtonDown( const MouseEvent&, SmartHdl& );
+
+ /** returns true if the SmartTag consumes this event. */
+ virtual bool KeyInput( const KeyEvent& rKEvt );
+
+ /** returns true if the SmartTag consumes this event. */
+ virtual bool RequestHelp( const HelpEvent& rHEvt );
+
+protected:
+ virtual void addCustomHandles( SdrHdlList& rHandlerList );
+ virtual void disposing();
+ virtual void select();
+ virtual void deselect();
+
+private:
+ ViewOverlayManager& mrManager;
+ SdrObjectWeakRef mxPlaceholderObj;
+};
+
+class ImageButtonHdl : public SmartHdl
+{
+public:
+ ImageButtonHdl( const SmartTagReference& xTag, USHORT nSID, const Image& rImage, const Point& rPnt );
+ virtual ~ImageButtonHdl();
+ virtual void CreateB2dIAObject();
+ virtual BOOL IsFocusHdl() const;
+ virtual Pointer GetPointer() const;
+ virtual bool isMarkable() const;
+
+ virtual void onMouseEnter();
+ virtual void onMouseLeave();
+
+ USHORT getSlotId() const { return mnSID; }
+
+private:
+ rtl::Reference< ChangePlaceholderTag > mxTag;
+ Image maImage;
+ USHORT mnSID;
+};
+
+// --------------------------------------------------------------------
+
+ImageButtonHdl::ImageButtonHdl( const SmartTagReference& xTag, USHORT nSID, const Image& rImage, const Point& rPnt )
+: SmartHdl( xTag, rPnt )
+, mxTag( dynamic_cast< ChangePlaceholderTag* >( xTag.get() ) )
+, maImage( rImage )
+, mnSID( nSID )
+{
+}
+
+// --------------------------------------------------------------------
+
+ImageButtonHdl::~ImageButtonHdl()
+{
+}
+
+// --------------------------------------------------------------------
+
+void ImageButtonHdl::onMouseEnter()
+{
+ Touch();
+}
+
+// --------------------------------------------------------------------
+
+void ImageButtonHdl::onMouseLeave()
+{
+ Touch();
+}
+
+// --------------------------------------------------------------------
+
+void ImageButtonHdl::CreateB2dIAObject()
+{
+ // first throw away old one
+ GetRidOfIAObject();
+
+ const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
+
+ const Point aTagPos( GetPos() );
+ basegfx::B2DPoint aPosition( aTagPos.X(), aTagPos.Y() );
+
+ const bool bFocused = IsFocusHdl() && pHdlList && (pHdlList->GetFocusHdl() == this);
+
+ BitmapEx aBitmapEx( maImage.GetBitmapEx() );
+
+ const double fAlpha = isMouseOver() ? 0.0 : 0.6;
+
+ if(pHdlList)
+ {
+ SdrMarkView* pView = pHdlList->GetView();
+
+ if(pView && !pView->areMarkHandlesHidden())
+ {
+ SdrPageView* pPageView = pView->GetSdrPageView();
+
+ if(pPageView)
+ {
+ for(sal_uInt32 b = 0; b < pPageView->PageWindowCount(); b++)
+ {
+ const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
+
+ SdrPaintWindow& rPaintWindow = rPageWindow.GetPaintWindow();
+ if(rPaintWindow.OutputToWindow() && rPageWindow.GetOverlayManager() )
+ {
+ ::sdr::overlay::OverlayObject* pOverlayObject = 0;
+
+ // animate focused handles
+ pOverlayObject = new ::sdr::overlay::OverlayBitmapEx( aPosition, aBitmapEx, 0, 0, fAlpha );
+ rPageWindow.GetOverlayManager()->add(*pOverlayObject);
+ maOverlayGroup.append(*pOverlayObject);
+ }
+ }
+ }
+ }
+ }
+}
+
+// --------------------------------------------------------------------
+
+BOOL ImageButtonHdl::IsFocusHdl() const
+{
+ return false;
+}
+
+// --------------------------------------------------------------------
+
+bool ImageButtonHdl::isMarkable() const
+{
+ return false;
+}
+
+// --------------------------------------------------------------------
+
+Pointer ImageButtonHdl::GetPointer() const
+{
+ return Pointer( POINTER_ARROW );
+}
+
+// ====================================================================
+
+ChangePlaceholderTag::ChangePlaceholderTag( ViewOverlayManager& rManager, ::sd::View& rView, SdrObject& rPlaceholderObj )
+: SmartTag( rView )
+, mrManager( rManager )
+, mxPlaceholderObj( &rPlaceholderObj )
+{
+}
+
+// --------------------------------------------------------------------
+
+ChangePlaceholderTag::~ChangePlaceholderTag()
+{
+}
+
+// --------------------------------------------------------------------
+
+/** returns true if the ChangePlaceholderTag handled the event. */
+bool ChangePlaceholderTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& rHdl )
+{
+ USHORT nSID = static_cast< ImageButtonHdl& >(rHdl).getSlotId();
+
+ if( mxPlaceholderObj.get() )
+ {
+ SdrPageView* pPV = mrView.GetSdrPageView();
+ mrView.MarkObj(mxPlaceholderObj.get(), pPV, FALSE);
+ }
+
+ mrView.GetViewShell()->GetViewFrame()->GetDispatcher()->Execute( nSID, SFX_CALLMODE_ASYNCHRON);
+
+ return false;
+}
+
+// --------------------------------------------------------------------
+
+/** returns true if the SmartTag consumes this event. */
+bool ChangePlaceholderTag::KeyInput( const KeyEvent& rKEvt )
+{
+ USHORT nCode = rKEvt.GetKeyCode().GetCode();
+ switch( nCode )
+ {
+ case KEY_DOWN:
+ case KEY_UP:
+ case KEY_LEFT:
+ case KEY_RIGHT:
+ case KEY_ESCAPE:
+ case KEY_TAB:
+ case KEY_RETURN:
+ case KEY_SPACE:
+ default:
+ return false;
+ }
+}
+
+/** returns true if the SmartTag consumes this event. */
+bool ChangePlaceholderTag::RequestHelp( const HelpEvent& rHEvt )
+{
+ Rectangle aItemRect( rHEvt.GetMousePosPixel(), Size(1,1) );
+ String aHelpText(RTL_CONSTASCII_USTRINGPARAM("I'm a help text"));
+ if( rHEvt.GetMode() == HELPMODE_BALLOON )
+ Help::ShowBalloon( static_cast< ::Window* >(mrView.GetFirstOutputDevice()), aItemRect.Center(), aItemRect, aHelpText);
+ else
+ Help::ShowQuickHelp( static_cast< ::Window* >(mrView.GetFirstOutputDevice()), aItemRect, aHelpText );
+
+ return true;
+}
+
+// --------------------------------------------------------------------
+
+void ChangePlaceholderTag::addCustomHandles( SdrHdlList& rHandlerList )
+{
+ if( mxPlaceholderObj.is() )
+ {
+ SdrObject* pPlaceholder = mxPlaceholderObj.get();
+ SmartTagReference xThis( this );
+ const Rectangle& rSnapRect = pPlaceholder->GetSnapRect();
+ const Point aPoint;
+
+ OutputDevice* pDev = mrView.GetFirstOutputDevice();
+ if( pDev == 0 )
+ pDev = Application::GetDefaultDevice();
+
+ Size aShapeSizePix = pDev->LogicToPixel(rSnapRect.GetSize());
+ long nShapeSizePix = std::min(aShapeSizePix.Width(),aShapeSizePix.Height());
+
+ Image* pImages = (nShapeSizePix > 300) ? &ViewOverlayManager::maLargeButtonImages[0] : &ViewOverlayManager::maSmallButtonImages[0];
+
+ Size aButtonSize( pDev->PixelToLogic(pImages[0].GetSizePixel()) );
+ if( 200 > nShapeSizePix )
+ {
+ aButtonSize.Width() >>= 1; aButtonSize.Height() >>= 1;
+ }
+
+ const long nBorderPix = (nShapeSizePix > 300) ? 4 : (nShapeSizePix > 100) ? 2 : 1;
+ Size aBorder( pDev->PixelToLogic(Size(nBorderPix,nBorderPix)) );
+
+ const int nColumns = (ViewOverlayManager::ButtonCount+1) >> 1;
+ const int nRows = (ViewOverlayManager::ButtonCount + nColumns - 1) / nColumns;
+
+ long all_width = (nColumns * aButtonSize.Width()) + ((nColumns-1) * aBorder.Width());
+ long all_height = (nRows * aButtonSize.Height()) + ((nRows-1) * aBorder.Height());
+
+ Point aPos( rSnapRect.Center() );
+ aPos.X() -= all_width >> 1;
+ aPos.Y() -= all_height >> 1;
+
+ long nStartX = aPos.X();
+
+ for( int i = 0, c = 0; i < ViewOverlayManager::ButtonCount; i++ )
+ {
+ Image aImg( pImages[i] );
+ if( 200 > nShapeSizePix )
+ {
+ BitmapEx b( aImg.GetBitmapEx() );
+ const double scale = 0.5;
+ b.Scale( scale, scale );
+ aImg = Image(b);
+ }
+
+ ImageButtonHdl* pHdl = new ImageButtonHdl( xThis, ViewOverlayManager::mnButtonSlots[i], aImg, aPoint );
+ pHdl->SetObjHdlNum( SMART_TAG_HDL_NUM );
+ pHdl->SetPageView( mrView.GetSdrPageView() );
+
+ pHdl->SetPos( aPos );
+
+ rHandlerList.AddHdl( pHdl );
+
+ if( ++c == nColumns )
+ {
+ aPos.X() = nStartX;
+ aPos.Y() += aButtonSize.Height() + aBorder.Height();
+ c = 0;
+ }
+ else
+ {
+ aPos.X() += aButtonSize.Width() + aBorder.Width();
+ }
+ }
+ }
+}
+
+// --------------------------------------------------------------------
+
+void ChangePlaceholderTag::disposing()
+{
+ SmartTag::disposing();
+}
+
+// --------------------------------------------------------------------
+
+void ChangePlaceholderTag::select()
+{
+ SmartTag::select();
+}
+
+// --------------------------------------------------------------------
+
+void ChangePlaceholderTag::deselect()
+{
+ SmartTag::deselect();
+}
+
+// --------------------------------------------------------------------
+
+Image ViewOverlayManager::maSmallButtonImages[ViewOverlayManager::ButtonCount];
+Image ViewOverlayManager::maLargeButtonImages[ViewOverlayManager::ButtonCount];
+USHORT ViewOverlayManager::mnButtonSlots[ViewOverlayManager::ButtonCount] = { SID_INSERT_TABLE, SID_INSERT_DIAGRAM, SID_INSERT_GRAPHIC, SID_INSERT_AVMEDIA };
+
+// --------------------------------------------------------------------
+
+static Image lcl_getslotimage( ::com::sun::star::uno::Reference<com::sun::star::frame::XFrame>& xFrame, USHORT nSID, BOOL b1, BOOL b2 )
+{
+ rtl::OUString aSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
+ aSlotURL += rtl::OUString::valueOf( sal_Int32( nSID ));
+ return ::GetImage( xFrame, aSlotURL, b1, b2 );
+}
+
+ViewOverlayManager::ViewOverlayManager( ViewShellBase& rViewShellBase )
+: mrBase( rViewShellBase )
+, mnUpdateTagsEvent( 0 )
+{
+ Link aLink( LINK(this,ViewOverlayManager,EventMultiplexerListener) );
+ mrBase.GetEventMultiplexer()->AddEventListener(aLink, tools::EventMultiplexerEvent::EID_CURRENT_PAGE);
+
+ StartListening( *mrBase.GetDocShell() );
+}
+
+// --------------------------------------------------------------------
+
+ViewOverlayManager::~ViewOverlayManager()
+{
+ Link aLink( LINK(this,ViewOverlayManager,EventMultiplexerListener) );
+ mrBase.GetEventMultiplexer()->RemoveEventListener( aLink );
+
+ if( mnUpdateTagsEvent )
+ {
+ Application::RemoveUserEvent( mnUpdateTagsEvent );
+ mnUpdateTagsEvent = 0;
+ }
+
+ DisposeTags();
+}
+
+// --------------------------------------------------------------------
+
+void ViewOverlayManager::UpdateImages()
+{
+ try
+ {
+ Reference<XFrame> xFrame(mrBase.GetFrame()->GetTopFrame()->GetFrameInterface(), UNO_QUERY_THROW);
+ for( int i = 0; i < ButtonCount; i++ )
+ {
+ maSmallButtonImages[i] = lcl_getslotimage( xFrame, mnButtonSlots[i], FALSE, FALSE );
+ maLargeButtonImages[i] = lcl_getslotimage( xFrame, mnButtonSlots[i], TRUE, FALSE );
+ }
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR( "ViewOverlayManager::ViewOverlayManager(), exception caught!" );
+ }
+}
+
+// --------------------------------------------------------------------
+
+void ViewOverlayManager::Notify(SfxBroadcaster&, const SfxHint& rHint)
+{
+ const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if (pSimpleHint != NULL)
+ {
+ if (pSimpleHint->GetId() == SFX_HINT_DOCCHANGED)
+ {
+ UpdateTags();
+ }
+ }
+}
+
+void ViewOverlayManager::onZoomChanged()
+{
+ if( !maTagVector.empty() )
+ {
+ UpdateTags();
+ }
+}
+
+void ViewOverlayManager::UpdateTags()
+{
+ if( !mnUpdateTagsEvent )
+ mnUpdateTagsEvent = Application::PostUserEvent( LINK( this, ViewOverlayManager, UpdateTagsHdl ) );
+}
+
+IMPL_LINK(ViewOverlayManager,UpdateTagsHdl, void *, EMPTYARG)
+{
+ OSL_TRACE("ViewOverlayManager::UpdateTagsHdl");
+
+ mnUpdateTagsEvent = 0;
+ bool bChanges = DisposeTags();
+ bChanges |= CreateTags();
+
+ if( bChanges && mrBase.GetDrawView() )
+ static_cast< ::sd::View* >( mrBase.GetDrawView() )->updateHandles();
+ return 0;
+}
+
+bool ViewOverlayManager::CreateTags()
+{
+ bool bChanges = false;
+
+ SdPage* pPage = mrBase.GetMainViewShell()->getCurrentPage();
+
+ if( pPage )
+ {
+ if( !maSmallButtonImages[0] )
+ UpdateImages();
+
+ const std::list< SdrObject* >& rShapes = pPage->GetPresentationShapeList().getList();
+
+ for( std::list< SdrObject* >::const_iterator iter( rShapes.begin() ); iter != rShapes.end(); iter++ )
+ {
+ if( (*iter)->IsEmptyPresObj() && ((*iter)->GetObjIdentifier() == OBJ_OUTLINETEXT) && !static_cast<SdrTextObj*>((*iter))->HasEditText() )
+ {
+ rtl::Reference< SmartTag > xTag( new ChangePlaceholderTag( *this, *mrBase.GetMainViewShell()->GetView(), *(*iter) ) );
+ maTagVector.push_back(xTag);
+ bChanges = true;
+ }
+ }
+ }
+
+ return bChanges;
+}
+
+// --------------------------------------------------------------------
+
+bool ViewOverlayManager::DisposeTags()
+{
+ if( !maTagVector.empty() )
+ {
+ ViewTagVector vec;
+ vec.swap( maTagVector );
+
+ ViewTagVector::iterator iter = vec.begin();
+ do
+ {
+ (*iter++)->Dispose();
+ }
+ while( iter != vec.end() );
+ return true;
+ }
+
+ return false;
+}
+
+// --------------------------------------------------------------------
+
+IMPL_LINK(ViewOverlayManager,EventMultiplexerListener,
+ tools::EventMultiplexerEvent*,pEvent)
+{
+ switch (pEvent->meEventId)
+ {
+ case tools::EventMultiplexerEvent::EID_CURRENT_PAGE:
+ UpdateTags();
+ break;
+ }
+ return 0;
+}
+
+}
diff --git a/sd/uiconfig/simpress/toolbar/commontaskbar.xml b/sd/uiconfig/simpress/toolbar/commontaskbar.xml
index 5e4ce1cff6f0..8be9e7ae9450 100644
--- a/sd/uiconfig/simpress/toolbar/commontaskbar.xml
+++ b/sd/uiconfig/simpress/toolbar/commontaskbar.xml
@@ -2,7 +2,7 @@
<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink">
<toolbar:toolbaritem xlink:href=".uno:InsertPage" toolbar:helpid="27014"/>
- <toolbar:toolbaritem xlink:href=".uno:ModifyPage" toolbar:visible="false" toolbar:helpid="27046"/>
+ <toolbar:toolbaritem xlink:href=".uno:AssignLayout" toolbar:helpid="27435" toolbar:style="dropdown"/>
<toolbar:toolbaritem xlink:href=".uno:PresentationLayout" toolbar:helpid="27064"/>
<toolbar:toolbaritem xlink:href=".uno:DuplicatePage" toolbar:visible="false" toolbar:helpid="27342"/>
<toolbar:toolbaritem xlink:href=".uno:ExpandPage" toolbar:visible="false" toolbar:helpid="27343"/>