summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lippka <cl@openoffice.org>2009-12-03 18:53:41 +0100
committerChristian Lippka <cl@openoffice.org>2009-12-03 18:53:41 +0100
commit1be43c60fb32783312c18e4f65d63f4d7a55ca70 (patch)
treeed45748dd36b84b3b2f84b1a8bf093a8ba58f114
parent5e3ff24a76d5819f2074716b7fc9a90eac51280b (diff)
renaissance01: #i107213# further layout work, initial support for new layout toolbox control
-rw-r--r--sd/inc/sdpage.hxx3
-rw-r--r--sd/inc/shapelist.hxx2
-rw-r--r--sd/sdi/sdraw.sdi2
-rw-r--r--sd/source/core/sdpage.cxx63
-rw-r--r--sd/source/core/shapelist.cxx38
-rw-r--r--sd/source/ui/app/layoutctrl.cxx338
-rw-r--r--sd/source/ui/app/makefile.mk6
-rw-r--r--sd/source/ui/app/sddll2.cxx2
-rw-r--r--sd/source/ui/func/fuinsert.cxx27
-rw-r--r--sd/source/ui/func/smarttag.cxx41
-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/smarttag.hxx8
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx1
-rw-r--r--sd/source/ui/view/drviews2.cxx26
-rw-r--r--sd/source/ui/view/drviews7.cxx20
-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.cxx115
-rw-r--r--sd/source/ui/view/viewshel.cxx3
-rw-r--r--sd/uiconfig/simpress/toolbar/commontaskbar.xml2
21 files changed, 675 insertions, 181 deletions
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 7ccb4093f6fb..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();
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/sdpage.cxx b/sd/source/core/sdpage.cxx
index 7f80b5bd763a..60cc0a2c30de 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;
@@ -2382,6 +2382,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..ce79068438c1
--- /dev/null
+++ b/sd/source/ui/app/layoutctrl.cxx
@@ -0,0 +1,338 @@
+/*************************************************************************
+ *
+ * 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 <svx/toolbarmenu.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 );
+
+class SdLayoutDockingWindow : public SfxPopupWindow
+{
+ using FloatingWindow::StateChanged;
+
+private:
+ boost::scoped_ptr<ToolbarMenu> mpToolbarMenu;
+ 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:
+ SdLayoutDockingWindow( USHORT nId, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow = 0);
+ ~SdLayoutDockingWindow();
+
+ virtual SfxPopupWindow* Clone() const;
+
+ virtual void Paint( const Rectangle& rRect );
+
+ virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+};
+
+// class SdLayoutControl ------------------------------------------
+
+SdLayoutControl::SdLayoutControl( USHORT _nSlotId, USHORT _nId, ToolBox& rTbx )
+: SfxToolBoxControl( _nSlotId, _nId, rTbx )
+{
+}
+
+// -----------------------------------------------------------------------
+
+SdLayoutControl::~SdLayoutControl()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void SdLayoutControl::Select( BOOL bMod1 )
+{
+ (void)bMod1;
+}
+
+// -----------------------------------------------------------------------
+
+void SdLayoutControl::StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState )
+{
+ SfxToolBoxControl::StateChanged( nSID, eState, pState );
+}
+
+// -----------------------------------------------------------------------
+
+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()
+{
+ SdLayoutDockingWindow* pWin = new SdLayoutDockingWindow( GetId(), m_xFrame, &GetToolBox() );
+ pWin->StartPopupMode( &GetToolBox(), TRUE );
+ pWin->GrabFocus();
+ SetPopupWindow( pWin );
+ return pWin;
+}
+
+// -----------------------------------------------------------------------
+
+SdLayoutDockingWindow::SdLayoutDockingWindow( USHORT nId, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, Window* pParentWindow )
+: SfxPopupWindow( nId, rFrame, pParentWindow, WB_SYSTEMWINDOW|WB_BORDER|WB_NEEDSFOCUS )
+, 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, SdLayoutDockingWindow, 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, SdLayoutDockingWindow, 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" )));
+}
+
+SfxPopupWindow* SdLayoutDockingWindow::Clone() const
+{
+ return new SdLayoutDockingWindow( GetId(), mxFrame );
+}
+
+void SdLayoutDockingWindow::Paint( const Rectangle& rRect )
+{
+ SfxPopupWindow::Paint(rRect);
+}
+
+void SdLayoutDockingWindow::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ SfxPopupWindow::DataChanged( rDCEvt );
+
+ if( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
+ {
+ // const bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
+
+ // todo switch images
+ }
+}
+
+// -----------------------------------------------------------------------
+
+SdLayoutDockingWindow::~SdLayoutDockingWindow()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void SdLayoutDockingWindow::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( SdLayoutDockingWindow, 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 SdLayoutDockingWindow::PopupModeEnd()
+{
+ if ( IsVisible() )
+ mbPopupMode = FALSE;
+ SfxPopupWindow::PopupModeEnd();
+}
+
+// -----------------------------------------------------------------------
+
+void SdLayoutDockingWindow::GetFocus (void)
+{
+ SfxPopupWindow::GetFocus();
+ if( mpToolbarMenu )
+ mpToolbarMenu->GrabFocus();
+}
+
+
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..b0906e278b33 100644
--- a/sd/source/ui/app/sddll2.cxx
+++ b/sd/source/ui/app/sddll2.cxx
@@ -92,6 +92,7 @@
#include "PaneChildWindows.hxx"
#include "tmplctrl.hxx"
+#include "layoutctrl.hxx"
/*************************************************************************
|*
@@ -230,4 +231,5 @@ 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 );
}
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 12c94fbf9f8f..4486df11d6b7 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 99212adc12f1..c07fabbfe962 100644
--- a/sd/source/ui/func/smarttag.cxx
+++ b/sd/source/ui/func/smarttag.cxx
@@ -156,18 +156,6 @@ void SmartTag::CheckPossibilities()
{
}
-// --------------------------------------------------------------------
-
-void SmartTag::onMouseEnter(SmartHdl& rHdl)
-{
-}
-
-// --------------------------------------------------------------------
-
-void SmartTag::onMouseLeave()
-{
-}
-
// ====================================================================
SmartTagSet::SmartTagSet( View& rView )
@@ -284,35 +272,6 @@ bool SmartTagSet::MouseButtonDown( const MouseEvent& rMEvt )
// --------------------------------------------------------------------
-void SmartTagSet::MouseMove(const MouseEvent& rMEvt)
-{
- SmartTagReference xTag;
-
- SmartHdl* pSmartHdl = 0;
- if( !rMEvt.IsLeaveWindow() )
- {
- Point aMDPos( mrView.GetViewShell()->GetActiveWindow()->PixelToLogic( rMEvt.GetPosPixel() ) );
- SdrHdl* pHdl = mrView.PickHandle(aMDPos);
-
- pSmartHdl = dynamic_cast< SmartHdl* >( pHdl );
- if( pSmartHdl )
- xTag = pSmartHdl->getTag();
- }
-
- if( xTag != mxMouseOverTag )
- {
- if( mxMouseOverTag.is() )
- mxMouseOverTag->onMouseLeave();
-
- mxMouseOverTag = xTag;
-
- if( mxMouseOverTag.is() )
- mxMouseOverTag->onMouseEnter(*pSmartHdl);
- }
-}
-
-// --------------------------------------------------------------------
-
bool SmartTagSet::KeyInput( const KeyEvent& rKEvt )
{
if( mxSelectedTag.is() )
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/smarttag.hxx b/sd/source/ui/inc/smarttag.hxx
index 561d2e495ebd..7a9f682f38a1 100644
--- a/sd/source/ui/inc/smarttag.hxx
+++ b/sd/source/ui/inc/smarttag.hxx
@@ -76,12 +76,6 @@ public:
/** returns true if this smart tag is currently selected */
bool isSelected() const;
- /** is called once if the mouse enters this tag */
- virtual void onMouseEnter(SmartHdl& rHdl);
-
- /** is called once if the mouse leaves this tag */
- virtual void onMouseLeave();
-
::sd::View& getView() const { return mrView; }
protected:
@@ -147,8 +141,6 @@ public:
a special context, returned in rContext. */
bool getContext( SdrViewContext& rContext ) const;
- void MouseMove(const MouseEvent& rMEvt);
-
// support point editing
BOOL HasMarkablePoints() const;
ULONG GetMarkablePointCount() const;
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/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 27d5f6202369..7c814ff9d718 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -432,14 +432,26 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
|| mePageKind==PK_NOTES
|| (mePageKind==PK_HANDOUT && meEditMode==EM_MASTERPAGE))
{
- if ( mpDrawView->IsTextEdit() )
- mpDrawView->SdrEndTextEdit();
+ 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());
+ }
}
Cancel();
rReq.Done ();
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 983033be7b8c..ad966a40a18c 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -309,6 +309,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/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 72534b476a73..b4543d753605 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
index a6684fcdfd3e..802296322c35 100644
--- a/sd/source/ui/view/viewoverlaymanager.cxx
+++ b/sd/source/ui/view/viewoverlaymanager.cxx
@@ -41,6 +41,8 @@
#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>
@@ -88,15 +90,6 @@ public:
/** returns true if the SmartTag consumes this event. */
virtual bool RequestHelp( const HelpEvent& rHEvt );
- /** returns true if the SmartTag consumes this event. */
- virtual bool Command( const CommandEvent& rCEvt );
-
- /** is called once if the mouse enters this tag */
- virtual void onMouseEnter(SmartHdl& rHdl);
-
- /** is called once if the mouse leaves this tag */
- virtual void onMouseLeave();
-
protected:
virtual void addCustomHandles( SdrHdlList& rHandlerList );
virtual void disposing();
@@ -106,33 +99,36 @@ protected:
private:
ViewOverlayManager& mrManager;
SdrObjectWeakRef mxPlaceholderObj;
- ImageButtonHdl* mpSelectedHdl;
};
class ImageButtonHdl : public SmartHdl
{
public:
- ImageButtonHdl( const SmartTagReference& xTag, const Image& rImage, const Point& rPnt );
+ ImageButtonHdl( const SmartTagReference& xTag, USHORT nSID, const Image& rImage, const Point& rPnt );
virtual ~ImageButtonHdl();
virtual void CreateB2dIAObject();
virtual BOOL IsFocusHdl() const;
- virtual Pointer GetSdrDragPointer() const;
+ virtual Pointer GetPointer() const;
virtual bool isMarkable() const;
- void select( bool bSelect );
+ virtual void onMouseEnter();
+ virtual void onMouseLeave();
+
+ USHORT getSlotId() const { return mnSID; }
+
private:
rtl::Reference< ChangePlaceholderTag > mxTag;
- bool mbSelected;
Image maImage;
+ USHORT mnSID;
};
// --------------------------------------------------------------------
-ImageButtonHdl::ImageButtonHdl( const SmartTagReference& xTag, const Image& rImage, const Point& rPnt )
+ImageButtonHdl::ImageButtonHdl( const SmartTagReference& xTag, USHORT nSID, const Image& rImage, const Point& rPnt )
: SmartHdl( xTag, rPnt )
, mxTag( dynamic_cast< ChangePlaceholderTag* >( xTag.get() ) )
-, mbSelected(false)
, maImage( rImage )
+, mnSID( nSID )
{
}
@@ -140,19 +136,20 @@ ImageButtonHdl::ImageButtonHdl( const SmartTagReference& xTag, const Image& rIma
ImageButtonHdl::~ImageButtonHdl()
{
- if( mxTag.is() && (mxTag->mpSelectedHdl == this) )
- mxTag->mpSelectedHdl = 0;
}
// --------------------------------------------------------------------
-void ImageButtonHdl::select( bool bSelect )
+void ImageButtonHdl::onMouseEnter()
{
- if( bSelect != mbSelected )
- {
- mbSelected = bSelect;
- Touch();
- }
+ Touch();
+}
+
+// --------------------------------------------------------------------
+
+void ImageButtonHdl::onMouseLeave()
+{
+ Touch();
}
// --------------------------------------------------------------------
@@ -171,7 +168,7 @@ void ImageButtonHdl::CreateB2dIAObject()
BitmapEx aBitmapEx( maImage.GetBitmapEx() );
- const double fAlpha = mbSelected ? 0.0 : 0.5;
+ const double fAlpha = isMouseOver() ? 0.0 : 0.6;
if(pHdlList)
{
@@ -207,7 +204,7 @@ void ImageButtonHdl::CreateB2dIAObject()
BOOL ImageButtonHdl::IsFocusHdl() const
{
- return TRUE;
+ return false;
}
// --------------------------------------------------------------------
@@ -219,7 +216,7 @@ bool ImageButtonHdl::isMarkable() const
// --------------------------------------------------------------------
-Pointer ImageButtonHdl::GetSdrDragPointer() const
+Pointer ImageButtonHdl::GetPointer() const
{
return Pointer( POINTER_ARROW );
}
@@ -242,8 +239,18 @@ ChangePlaceholderTag::~ChangePlaceholderTag()
// --------------------------------------------------------------------
/** returns true if the ChangePlaceholderTag handled the event. */
-bool ChangePlaceholderTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& /*rHdl*/ )
+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;
}
@@ -269,45 +276,16 @@ bool ChangePlaceholderTag::KeyInput( const KeyEvent& rKEvt )
}
/** returns true if the SmartTag consumes this event. */
-bool ChangePlaceholderTag::RequestHelp( const HelpEvent& /*rHEvt*/ )
+bool ChangePlaceholderTag::RequestHelp( const HelpEvent& rHEvt )
{
- return false;
-}
+ 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 );
-/** returns true if the SmartTag consumes this event. */
-bool ChangePlaceholderTag::Command( const CommandEvent& rCEvt )
-{
- return false;
-}
-
-/** is called once if the mouse enters this tag */
-void ChangePlaceholderTag::onMouseEnter(SmartHdl& rHdl)
-{
- ImageButtonHdl* pHdl = dynamic_cast< ImageButtonHdl* >( &rHdl );
- if( mpSelectedHdl != 0 )
- {
- if( mpSelectedHdl == pHdl )
- return;
-
- mpSelectedHdl->select(false);
- }
-
- mpSelectedHdl = pHdl;
-
- if( mpSelectedHdl )
- {
- mpSelectedHdl->select( true );
- }
-}
-
-/** is called once if the mouse leaves this tag */
-void ChangePlaceholderTag::onMouseLeave()
-{
- if( mpSelectedHdl )
- {
- mpSelectedHdl->select( false );
- mpSelectedHdl = 0;
- }
+ return true;
}
// --------------------------------------------------------------------
@@ -362,7 +340,7 @@ void ChangePlaceholderTag::addCustomHandles( SdrHdlList& rHandlerList )
aImg = Image(b);
}
- ImageButtonHdl* pHdl = new ImageButtonHdl( xThis, aImg, aPoint );
+ ImageButtonHdl* pHdl = new ImageButtonHdl( xThis, ViewOverlayManager::mnButtonSlots[i], aImg, aPoint );
pHdl->SetObjHdlNum( SMART_TAG_HDL_NUM );
pHdl->SetPageView( mrView.GetSdrPageView() );
@@ -495,6 +473,8 @@ void ViewOverlayManager::UpdateTags()
IMPL_LINK(ViewOverlayManager,UpdateTagsHdl, void *, EMPTYARG)
{
+ OSL_TRACE("ViewOverlayManager::UpdateTagsHdl");
+
mnUpdateTagsEvent = 0;
bool bChanges = DisposeTags();
bChanges |= CreateTags();
@@ -519,10 +499,11 @@ bool ViewOverlayManager::CreateTags()
for( std::list< SdrObject* >::const_iterator iter( rShapes.begin() ); iter != rShapes.end(); iter++ )
{
- if( (*iter)->IsEmptyPresObj() && ((*iter)->GetObjIdentifier() == OBJ_OUTLINETEXT) )
+ 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;
}
}
}
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 98c425110c23..208d5426c8bd 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -579,9 +579,6 @@ void ViewShell::MouseButtonDown(const MouseEvent& rMEvt, ::sd::Window* pWin)
void ViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin)
{
- if( GetView() )
- GetView()->getSmartTags().MouseMove( rMEvt );
-
if (rMEvt.IsLeaveWindow())
{
if ( ! mpImpl->mpUpdateLockForMouse.expired())
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"/>