summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--animations/source/animcore/makefile.mk2
-rw-r--r--sd/inc/CustomAnimationEffect.hxx32
-rw-r--r--sd/inc/CustomAnimationPreset.hxx6
-rw-r--r--sd/inc/animations.hxx4
-rw-r--r--sd/inc/anminfo.hxx6
-rw-r--r--sd/inc/app.hrc2
-rw-r--r--sd/inc/drawdoc.hxx22
-rw-r--r--sd/inc/glob.hrc5
-rw-r--r--sd/inc/glob.hxx1
-rw-r--r--sd/inc/helper/simplereferencecomponent.hxx12
-rw-r--r--sd/inc/helpids.h2
-rw-r--r--sd/inc/sdpage.hxx11
-rw-r--r--sd/inc/stlpool.hxx7
-rw-r--r--sd/inc/textapi.hxx69
-rw-r--r--sd/prj/build.lst5
-rw-r--r--sd/sdi/SlideSorterController.sdi4
-rw-r--r--sd/sdi/TaskPaneViewShell.sdi1
-rw-r--r--sd/sdi/_drvwsh.sdi4
-rw-r--r--sd/sdi/drviewsh.sdi40
-rw-r--r--sd/sdi/grviewsh.sdi40
-rw-r--r--sd/sdi/makefile.mk21
-rw-r--r--sd/sdi/sdraw.sdi32
-rw-r--r--sd/source/core/annotations/Annotation.cxx448
-rw-r--r--sd/source/core/annotations/AnnotationAccess.cxx59
-rw-r--r--sd/source/core/annotations/AnnotationEnumeration.cxx96
-rw-r--r--sd/source/core/annotations/makefile.mk53
-rw-r--r--sd/source/core/drawdoc.cxx47
-rw-r--r--sd/source/core/drawdoc4.cxx5
-rw-r--r--sd/source/core/sdpage2.cxx63
-rw-r--r--sd/source/core/text/makefile.mk52
-rw-r--r--sd/source/core/text/textapi.cxx325
-rw-r--r--sd/source/filter/eppt/eppt.cxx154
-rw-r--r--sd/source/filter/eppt/eppt.hxx4
-rw-r--r--sd/source/filter/eppt/epptdef.hxx3
-rw-r--r--sd/source/filter/eppt/epptso.cxx24
-rw-r--r--sd/source/filter/eppt/makefile.mk23
-rw-r--r--sd/source/filter/makefile.mk2
-rw-r--r--sd/source/filter/ppt/makefile.mk7
-rw-r--r--sd/source/filter/ppt/pptin.cxx (renamed from sd/source/filter/pptin.cxx)75
-rw-r--r--sd/source/filter/ppt/pptin.hxx (renamed from sd/source/filter/pptin.hxx)0
-rw-r--r--sd/source/filter/ppt/pptinanimations.cxx2
-rw-r--r--sd/source/filter/ppt/propread.cxx (renamed from sd/source/filter/propread.cxx)0
-rw-r--r--sd/source/filter/ppt/propread.hxx (renamed from sd/source/filter/propread.hxx)0
-rw-r--r--sd/source/filter/sdfilter.cxx23
-rw-r--r--sd/source/filter/sdpptwrp.cxx23
-rw-r--r--sd/source/filter/xml/sdxmlwrp.cxx23
-rw-r--r--sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx52
-rw-r--r--sd/source/ui/accessibility/AccessiblePageShape.cxx21
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx1276
-rwxr-xr-xsd/source/ui/annotations/annotationmanagerimpl.hxx147
-rw-r--r--sd/source/ui/annotations/annotations.hrc68
-rw-r--r--sd/source/ui/annotations/annotations.src212
-rw-r--r--sd/source/ui/annotations/annotationtag.cxx793
-rw-r--r--sd/source/ui/annotations/annotationtag.hxx110
-rw-r--r--sd/source/ui/annotations/annotationwindow.cxx849
-rw-r--r--sd/source/ui/annotations/annotationwindow.hxx180
-rw-r--r--sd/source/ui/annotations/makefile.mk60
-rw-r--r--sd/source/ui/app/app.src28
-rw-r--r--sd/source/ui/app/makefile.mk4
-rw-r--r--sd/source/ui/app/optsitem.cxx57
-rw-r--r--sd/source/ui/app/res_bmp.src8
-rw-r--r--sd/source/ui/app/sdmod.cxx5
-rw-r--r--sd/source/ui/app/sdxfer.cxx3
-rw-r--r--sd/source/ui/app/strings.src6
-rw-r--r--sd/source/ui/dlg/ins_paste.cxx4
-rw-r--r--sd/source/ui/dlg/prltempl.cxx4
-rw-r--r--sd/source/ui/dlg/prltempl.src24
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx8
-rw-r--r--sd/source/ui/docshell/docshell.cxx4
-rw-r--r--sd/source/ui/framework/configuration/ConfigurationController.cxx2
-rw-r--r--sd/source/ui/framework/configuration/ConfigurationUpdater.cxx2
-rw-r--r--sd/source/ui/framework/factories/FullScreenPane.cxx122
-rw-r--r--sd/source/ui/framework/factories/FullScreenPane.hxx21
-rw-r--r--sd/source/ui/framework/factories/Pane.cxx57
-rw-r--r--sd/source/ui/func/fupoor.cxx5
-rw-r--r--sd/source/ui/func/smarttag.cxx81
-rw-r--r--sd/source/ui/inc/AccessibleDrawDocumentView.hxx3
-rw-r--r--sd/source/ui/inc/DrawDocShell.hxx8
-rw-r--r--sd/source/ui/inc/DrawViewShell.hxx7
-rw-r--r--sd/source/ui/inc/EventMultiplexer.hxx9
-rw-r--r--sd/source/ui/inc/FrameView.hxx6
-rwxr-xr-xsd/source/ui/inc/annotationmanager.hxx62
-rw-r--r--sd/source/ui/inc/framework/Pane.hxx41
-rw-r--r--sd/source/ui/inc/ins_paste.hxx8
-rw-r--r--sd/source/ui/inc/optsitem.hxx5
-rw-r--r--sd/source/ui/inc/res_bmp.hrc3
-rw-r--r--sd/source/ui/inc/sdtreelb.hxx4
-rw-r--r--sd/source/ui/inc/smarttag.hxx12
-rw-r--r--sd/source/ui/inc/taskpane/TitleBar.hxx1
-rw-r--r--sd/source/ui/inc/taskpane/TitledControl.hxx2
-rwxr-xr-xsd/source/ui/notes/EditWindow.cxx8
-rw-r--r--sd/source/ui/presenter/PresenterTextView.cxx9
-rw-r--r--sd/source/ui/slidesorter/controller/SlideSorterController.cxx5
-rw-r--r--sd/source/ui/slidesorter/controller/SlsFocusManager.cxx3
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx2
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx12
-rw-r--r--sd/source/ui/slidesorter/shell/SlideSorter.cxx8
-rw-r--r--sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx12
-rw-r--r--sd/source/ui/slidesorter/view/SlideSorterView.cxx2
-rw-r--r--sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx127
-rw-r--r--sd/source/ui/toolpanel/LayoutMenu.cxx84
-rw-r--r--sd/source/ui/toolpanel/LayoutMenu.hxx12
-rw-r--r--sd/source/ui/toolpanel/TaskPaneShellManager.cxx12
-rw-r--r--sd/source/ui/toolpanel/TaskPaneViewShell.cxx1
-rw-r--r--sd/source/ui/toolpanel/TitleBar.cxx24
-rw-r--r--sd/source/ui/toolpanel/TitledControl.cxx26
-rw-r--r--sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx6
-rw-r--r--sd/source/ui/toolpanel/controls/makefile.mk1
-rw-r--r--sd/source/ui/tools/EventMultiplexer.cxx12
-rw-r--r--sd/source/ui/unoidl/randomnode.cxx2
-rw-r--r--sd/source/ui/unoidl/sddetect.cxx2
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx11
-rw-r--r--sd/source/ui/unoidl/unoobj.cxx3
-rw-r--r--sd/source/ui/unoidl/unopage.cxx37
-rw-r--r--sd/source/ui/unoidl/unopage.hxx8
-rw-r--r--sd/source/ui/unoidl/unopback.cxx4
-rw-r--r--sd/source/ui/view/GraphicObjectBar.cxx6
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx27
-rw-r--r--sd/source/ui/view/drviews1.cxx9
-rw-r--r--sd/source/ui/view/drviews4.cxx3
-rw-r--r--sd/source/ui/view/drviews7.cxx11
-rw-r--r--sd/source/ui/view/drviews8.cxx2
-rw-r--r--sd/source/ui/view/drviewsa.cxx43
-rw-r--r--sd/source/ui/view/outlnvsh.cxx2
-rw-r--r--sd/source/ui/view/sdview.cxx34
-rw-r--r--sd/source/ui/view/viewshe2.cxx5
-rw-r--r--sd/source/ui/view/viewshel.cxx13
-rw-r--r--sd/uiconfig/sdraw/accelerator/de/default.xml63
-rw-r--r--sd/uiconfig/sdraw/accelerator/en-GB/default.xml63
-rw-r--r--sd/uiconfig/sdraw/accelerator/en-US/default.xml63
-rw-r--r--sd/uiconfig/sdraw/accelerator/es/default.xml63
-rw-r--r--sd/uiconfig/sdraw/accelerator/fr/default.xml63
-rw-r--r--sd/uiconfig/sdraw/menubar/menubar.xml10
-rw-r--r--sd/uiconfig/sdraw/toolbar/commentsbar.xml11
-rw-r--r--sd/uiconfig/simpress/accelerator/de/default.xml11
-rw-r--r--sd/uiconfig/simpress/accelerator/default.xml71
-rw-r--r--sd/uiconfig/simpress/accelerator/es/default.xml9
-rw-r--r--sd/uiconfig/simpress/accelerator/fr/default.xml4
-rw-r--r--sd/uiconfig/simpress/menubar/menubar.xml10
-rw-r--r--sd/uiconfig/simpress/toolbar/commentsbar.xml11
-rw-r--r--sd/util/hidother.src3
-rw-r--r--sd/util/makefile.mk39
-rw-r--r--sd/util/sdfilt.map (renamed from sd/source/filter/eppt/exports.map)1
-rw-r--r--slideshow/source/engine/OGLTrans/makefile.mk1
-rw-r--r--slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx6
-rw-r--r--slideshow/source/engine/makefile.mk2
-rw-r--r--slideshow/source/engine/slideshowimpl.cxx8
-rw-r--r--slideshow/source/engine/smilfunctionparser.cxx2
-rw-r--r--slideshow/source/inc/delayevent.hxx6
149 files changed, 6427 insertions, 904 deletions
diff --git a/animations/source/animcore/makefile.mk b/animations/source/animcore/makefile.mk
index 2a4cb1702301..b68f0299a53c 100644
--- a/animations/source/animcore/makefile.mk
+++ b/animations/source/animcore/makefile.mk
@@ -39,6 +39,7 @@ NO_BSYMBOLIC=TRUE
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
+.IF "$(L10N_framework)"==""
# --- Files --------------------------------------------------------
#UNOUCRDEP=$(SOLARBINDIR)$/offapi.rdb
#UNOUCRRDB=$(SOLARBINDIR)$/offapi.rdb
@@ -66,6 +67,7 @@ SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
+.ENDIF # L10N_framework
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
diff --git a/sd/inc/CustomAnimationEffect.hxx b/sd/inc/CustomAnimationEffect.hxx
index 8e9d314675ad..795fb4333176 100644
--- a/sd/inc/CustomAnimationEffect.hxx
+++ b/sd/inc/CustomAnimationEffect.hxx
@@ -38,15 +38,13 @@
#include <com/sun/star/util/XChangesListener.hpp>
#include <tools/string.hxx>
-#ifndef BOOST_SHARED_PTR_HPP_INCLUDED
#include <boost/shared_ptr.hpp>
-#endif
-#ifndef _UTL_STLTYPES_HXX_
#include <comphelper/stl_types.hxx>
-#endif
#include <vcl/timer.hxx>
+#include <sddllapi.h>
+
#include <list>
#include <map>
@@ -76,8 +74,8 @@ class CustomAnimationEffect
friend class EffectSequenceHelper;
public:
- CustomAnimationEffect( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
- virtual ~CustomAnimationEffect();
+ SD_DLLPUBLIC CustomAnimationEffect( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
+ SD_DLLPUBLIC virtual ~CustomAnimationEffect();
const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& getNode() const { return mxNode; }
void setNode( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
@@ -94,7 +92,7 @@ public:
void setPresetClass( sal_Int16 nPresetClass );
sal_Int16 getNodeType() const { return mnNodeType; }
- void setNodeType( sal_Int16 nNodeType );
+ SD_DLLPUBLIC void setNodeType( sal_Int16 nNodeType );
::com::sun::star::uno::Any getRepeatCount() const;
void setRepeatCount( const ::com::sun::star::uno::Any& rRepeatCount );
@@ -106,10 +104,10 @@ public:
void setFill( sal_Int16 nFill );
double getBegin() const { return mfBegin; }
- void setBegin( double fBegin );
+ SD_DLLPUBLIC void setBegin( double fBegin );
double getDuration() const { return mfDuration; }
- void setDuration( double fDuration );
+ SD_DLLPUBLIC void setDuration( double fDuration );
double getAbsoluteDuration() const { return mfAbsoluteDuration; }
@@ -117,13 +115,13 @@ public:
void setName( const String& rName ) { maName = rName; }
sal_Int16 getIterateType() const { return mnIterateType; }
- void setIterateType( sal_Int16 nIterateType );
+ SD_DLLPUBLIC void setIterateType( sal_Int16 nIterateType );
double getIterateInterval() const { return mfIterateInterval; }
- void setIterateInterval( double fIterateInterval );
+ SD_DLLPUBLIC void setIterateInterval( double fIterateInterval );
::com::sun::star::uno::Any getTarget() const { return maTarget; }
- void setTarget( const ::com::sun::star::uno::Any& rTarget );
+ SD_DLLPUBLIC void setTarget( const ::com::sun::star::uno::Any& rTarget );
sal_Bool hasAfterEffect() const { return mbHasAfterEffect; }
void setHasAfterEffect( sal_Bool bHasAfterEffect ) { mbHasAfterEffect = bHasAfterEffect; }
@@ -165,7 +163,7 @@ public:
void setGroupId( sal_Int32 nGroupId );
sal_Int16 getTargetSubItem() const { return mnTargetSubItem; }
- void setTargetSubItem( sal_Int16 nSubItem );
+ SD_DLLPUBLIC void setTargetSubItem( sal_Int16 nSubItem );
::rtl::OUString getPath() const;
void setPath( const ::rtl::OUString& rPath );
@@ -175,8 +173,8 @@ public:
void setAudio( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAudio >& xAudio );
bool getStopAudio() const;
- void setStopAudio();
- void createAudio( const ::com::sun::star::uno::Any& rSource, double fVolume = 1.0 );
+ SD_DLLPUBLIC void setStopAudio();
+ SD_DLLPUBLIC void createAudio( const ::com::sun::star::uno::Any& rSource, double fVolume = 1.0 );
void removeAudio();
const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAudio >& getAudio() const { return mxAudio; }
@@ -297,7 +295,7 @@ public:
CustomAnimationEffectPtr append( const CustomAnimationPresetPtr& pDescriptor, const ::com::sun::star::uno::Any& rTarget, double fDuration = -1.0 );
CustomAnimationEffectPtr append( const SdrPathObj& rPathObj, const ::com::sun::star::uno::Any& rTarget, double fDuration = -1.0 );
- void append( const CustomAnimationEffectPtr& pEffect );
+ SD_DLLPUBLIC void append( const CustomAnimationEffectPtr& pEffect );
void insert( EffectSequence::iterator& rPos, const CustomAnimationEffectPtr& pEffect );
void replace( const CustomAnimationEffectPtr& pEffect, const CustomAnimationPresetPtr& pDescriptor, double fDuration = -1.0 );
void replace( const CustomAnimationEffectPtr& pEffect, const CustomAnimationPresetPtr& pDescriptor, const rtl::OUString& rPresetSubType, double fDuration = -1.0 );
@@ -337,7 +335,7 @@ public:
// text group methods
CustomAnimationTextGroupPtr findGroup( sal_Int32 nGroupId );
- CustomAnimationTextGroupPtr createTextGroup( CustomAnimationEffectPtr pEffect, sal_Int32 nTextGrouping, double fTextGroupingAuto, sal_Bool bAnimateForm, sal_Bool bTextReverse );
+ SD_DLLPUBLIC CustomAnimationTextGroupPtr createTextGroup( CustomAnimationEffectPtr pEffect, sal_Int32 nTextGrouping, double fTextGroupingAuto, sal_Bool bAnimateForm, sal_Bool bTextReverse );
void setTextGrouping( CustomAnimationTextGroupPtr pTextGroup, sal_Int32 nTextGrouping );
void setAnimateForm( CustomAnimationTextGroupPtr pTextGroup, sal_Bool bAnimateForm );
void setTextGroupingAuto( CustomAnimationTextGroupPtr pTextGroup, double fTextGroupingAuto );
diff --git a/sd/inc/CustomAnimationPreset.hxx b/sd/inc/CustomAnimationPreset.hxx
index 77b7352056b0..7d826deab9aa 100644
--- a/sd/inc/CustomAnimationPreset.hxx
+++ b/sd/inc/CustomAnimationPreset.hxx
@@ -59,7 +59,7 @@ public:
void add( CustomAnimationEffectPtr pEffect );
- ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > create( const rtl::OUString& rstrSubType );
+ SD_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > create( const rtl::OUString& rstrSubType );
const rtl::OUString& getPresetId() const { return maPresetId; }
const rtl::OUString& getProperty() const { return maProperty; }
@@ -108,11 +108,11 @@ public:
void init();
- static const CustomAnimationPresets& getCustomAnimationPresets();
+ SD_DLLPUBLIC static const CustomAnimationPresets& getCustomAnimationPresets();
::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > getRandomPreset( sal_Int16 nPresetClass ) const;
- CustomAnimationPresetPtr getEffectDescriptor( const rtl::OUString& rPresetId ) const;
+ SD_DLLPUBLIC CustomAnimationPresetPtr getEffectDescriptor( const rtl::OUString& rPresetId ) const;
// const AnimationEffect* getEffect( const rtl::OUString& rPresetId ) const;
// const AnimationEffect* getEffect( const rtl::OUString& rPresetId, const rtl::OUString& rPresetSubType ) const;
diff --git a/sd/inc/animations.hxx b/sd/inc/animations.hxx
index 20f9da50f345..a0f5008e4dad 100644
--- a/sd/inc/animations.hxx
+++ b/sd/inc/animations.hxx
@@ -1,6 +1,8 @@
#ifndef _SD_ANIMATIONS_HXX_
#define _SD_ANIMATIONS_HXX_
+#include <sddllapi.h>
+
namespace sd
{
@@ -21,7 +23,7 @@ typedef std::list< AfterEffectNode > AfterEffectNodeList;
/** inserts the animation node in the given AfterEffectNode at the correct position
in the timing hierarchie of its master */
-void stl_process_after_effect_node_func(AfterEffectNode& rNode);
+SD_DLLPUBLIC void stl_process_after_effect_node_func(AfterEffectNode& rNode);
} // namespace sd;
diff --git a/sd/inc/anminfo.hxx b/sd/inc/anminfo.hxx
index 8acb207d8065..0863e5b1f05e 100644
--- a/sd/inc/anminfo.hxx
+++ b/sd/inc/anminfo.hxx
@@ -38,6 +38,7 @@
#include "anmdef.hxx"
#include <svx/svdobj.hxx>
#include <tools/color.hxx>
+#include <sddllapi.h>
class Polygon;
class Point;
@@ -47,7 +48,6 @@ class SdrObject;
class SdrPathObj;
class SdDrawDocument;
-
class SdAnimationInfo : public SdrObjUserData
{
public:
@@ -78,8 +78,8 @@ public:
ULONG mnPresOrder;
SdrObject& mrObject;
- void SetBookmark( const String& rBookmark );
- String GetBookmark();
+ SD_DLLPUBLIC void SetBookmark( const String& rBookmark );
+ SD_DLLPUBLIC String GetBookmark();
public:
SdAnimationInfo(SdrObject& rObject);
SdAnimationInfo(const SdAnimationInfo& rAnmInfo, SdrObject& rObject);
diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc
index d1852a5e9992..0ccbbf921b6b 100644
--- a/sd/inc/app.hrc
+++ b/sd/inc/app.hrc
@@ -38,7 +38,6 @@
#define SID_BACKGROUND (SID_SD_START)
#define SID_LASTVERSION (SID_SD_START+1)
#define SID_PAGESETUP (SID_SD_START+2)
-#define SID_PASTE2 (SID_SD_START+3)
#define SID_COPYOBJECTS (SID_SD_START+4)
#define SID_MANAGE_LINKS (SID_SD_START+5)
#define SID_CHOOSE (SID_SD_START+7)
@@ -112,7 +111,6 @@
#define SID_DISMANTLE (SID_SD_START+82)
#define SID_SD_HELP_PI (SID_SD_START+83)
#define SID_TIPHELP (SID_SD_START+84)
-#define SID_OBJECT_MIRROR (SID_SD_START+85)
#define SID_STATUS_PAGE (SID_SD_START+86)
#define SID_STATUS_LAYOUT (SID_SD_START+87)
#define SID_STATUS_SELMODE (SID_SD_START+88)
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index 8ef84f263d98..975722604df9 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -33,13 +33,9 @@
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/text/WritingMode.hpp>
-#ifndef _COM_SUN_STAR_FRAME_XMODEL_HDL_
#include <com/sun/star/frame/XModel.hdl>
-#endif
#include <vcl/print.hxx>
-#ifndef _FM_FMMODEL_HXX
#include <svx/fmmodel.hxx>
-#endif
#include "pres.hxx"
#include <svx/pageitem.hxx>
#include <unotools/charclass.hxx>
@@ -51,6 +47,8 @@
// #107844#
#include <svx/svdundo.hxx>
+#include <vector>
+
#ifndef INCLUDED_MEMORY
#include <memory>
#define INCLUDED_MEMORY
@@ -213,6 +211,8 @@ private:
DECL_LINK(OnlineSpellingHdl, Timer*);
DECL_LINK(OnlineSpellEventHdl, EditStatus*);
+ std::vector< rtl::OUString > maAnnotationAuthors;
+
protected:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel();
@@ -246,7 +246,7 @@ public:
SvxNumType GetPageNumType() const;
void SetPageNumType(SvxNumType eType) { mePageNumType = eType; }
- String CreatePageNumValue(USHORT nNum) const;
+ SD_DLLPUBLIC String CreatePageNumValue(USHORT nNum) const;
DocumentType GetDocumentType() const { return meDocType; }
@@ -260,7 +260,7 @@ public:
for newly created slides.
*/
SD_DLLPUBLIC void CreateFirstPages( SdDrawDocument* pRefDocument = 0 );
- BOOL CreateMissingNotesAndHandoutPages();
+ SD_DLLPUBLIC BOOL CreateMissingNotesAndHandoutPages();
void MovePage(USHORT nPgNum, USHORT nNewPos);
void InsertPage(SdrPage* pPage, USHORT nPos=0xFFFF);
@@ -436,7 +436,7 @@ public:
/** deprecated*/
SdAnimationInfo* GetAnimationInfo(SdrObject* pObject) const;
- static SdAnimationInfo* GetShapeUserData(SdrObject& rObject, bool bCreate = false );
+ SD_DLLPUBLIC static SdAnimationInfo* GetShapeUserData(SdrObject& rObject, bool bCreate = false );
SdIMapInfo* GetIMapInfo( SdrObject* pObject ) const;
IMapObject* GetHitIMapObject( SdrObject* pObject, const Point& rWinPoint, const ::Window& rCmpWnd );
@@ -589,8 +589,16 @@ public:
/* converts the given western font height to a corresponding ctl font height, deppending on the system language */
static sal_uInt32 convertFontHeightToCTL( sal_uInt32 nWesternFontHeight );
+ /** Get the style sheet pool if it was a SdStyleSheetPool.
+ */
+ SD_DLLPUBLIC SdStyleSheetPool* GetSdStyleSheetPool() const;
+
void UpdatePageRelativeURLs(const String& rOldName, const String& rNewName);
+ void SetCalcFieldValueHdl( ::Outliner* pOutliner);
+
+ sal_uInt16 GetAnnotationAuthorIndex( const rtl::OUString& rAuthor );
+
private:
/** This member stores the printer independent layout mode. Please
refer to <member>SetPrinterIndependentLayout()</member> for its
diff --git a/sd/inc/glob.hrc b/sd/inc/glob.hrc
index c662cfb0e0a5..7ef9ecad779c 100644
--- a/sd/inc/glob.hrc
+++ b/sd/inc/glob.hrc
@@ -143,7 +143,9 @@
#define STR_RIGHT_PANE_SHELL RID_GLOB_START+115
#define RID_CUSTOMANIMATION_START RID_GLOB_START+120
-#define RID_CUSTOMANIMATION_END RID_GLOB_START+220
+#define RID_CUSTOMANIMATION_END RID_GLOB_START+199
+#define RID_ANNOTATIONS_START RID_GLOB_START+200
+#define RID_ANNOTATIONS_END RID_GLOB_START+220
#define STR_UNDO_ANIMATION RID_GLOB_START+221
#define STR_UNDO_SLIDE_PARAMS RID_GLOB_START+222
#define RID_SLIDESHOW_CONTEXTMENU RID_GLOB_START+223
@@ -153,3 +155,4 @@
#define RID_TABPAGE_PARA_NUMBERING RID_GLOB_START+226
+
diff --git a/sd/inc/glob.hxx b/sd/inc/glob.hxx
index 5ab2253253db..ea9f22d209c5 100644
--- a/sd/inc/glob.hxx
+++ b/sd/inc/glob.hxx
@@ -68,6 +68,7 @@
#define SD_IF_SDLEFTDRAWPANESHELL SFX_INTERFACE_SD_START + 25
#define SD_IF_SDRIGHTPANESHELL SFX_INTERFACE_SD_START + 26
#define SD_IF_SDDRAWTABLEOBJECTBAR SFX_INTERFACE_SD_START + 27
+#define SD_IF_SDANNOTATIONSHELL SFX_INTERFACE_SD_START + 28
// Inventor-Id fuer StarDraw UserData
const UINT32 SdUDInventor=UINT32('S')*0x00000001+
diff --git a/sd/inc/helper/simplereferencecomponent.hxx b/sd/inc/helper/simplereferencecomponent.hxx
index 709e321b0177..0c3f4f4b97bb 100644
--- a/sd/inc/helper/simplereferencecomponent.hxx
+++ b/sd/inc/helper/simplereferencecomponent.hxx
@@ -34,14 +34,10 @@
#include "osl/interlck.h"
#include "sal/types.h"
-#ifndef INCLUDED_CSTDDEF
#include <cstddef>
-#define INCLUDED_CSTDDEF
-#endif
-#ifndef INCLUDED_NEW
#include <new>
-#define INCLUDED_NEW
-#endif
+
+#include <sddllapi.h>
namespace sd {
@@ -60,8 +56,8 @@ public:
the total number of calls to release() by a plattform dependent amount
(which, hopefully, is quite large).
*/
- void acquire();
- void release();
+ SD_DLLPUBLIC void acquire();
+ SD_DLLPUBLIC void release();
void Dispose();
diff --git a/sd/inc/helpids.h b/sd/inc/helpids.h
index 7cd551ad0871..2a0d4e7f867b 100644
--- a/sd/inc/helpids.h
+++ b/sd/inc/helpids.h
@@ -280,3 +280,5 @@
#define HID_SD_CELL_STYLE_LAST_COLUMN (HID_SD_START + 199)
#define HID_SD_TABLE_DESIGN (HID_SD_START + 200)
+#define HID_SD_ANNOTATIONS (HID_SD_START + 201)
+
diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index 8bbabcb57593..842c70d50fd3 100644
--- a/sd/inc/sdpage.hxx
+++ b/sd/inc/sdpage.hxx
@@ -41,6 +41,7 @@
#endif
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/presentation/FadeEffect.hpp>
+#include <com/sun/star/office/XAnnotation.hpp>
#include <list>
#include <functional>
@@ -105,6 +106,8 @@ namespace sd {
bool operator==( const HeaderFooterSettings& rSettings ) const;
};
+
+ typedef std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > > AnnotationVector;
}
namespace sd {
@@ -149,6 +152,8 @@ protected:
Orientation meOrientation; // Print-Orientation
SdPageLink* mpPageLink; // PageLink (nur bei gelinkten Seiten)
+ sd::AnnotationVector maAnnotations;
+
/** holds the smil animation sequences for this page */
::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > mxAnimationNode;
@@ -391,6 +396,12 @@ public:
*/
bool IsPrecious (void) const;
+ void createAnnotation( ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation >& xAnnotation );
+ void addAnnotation( const ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation >& xAnnotation, int nIndex = -1 );
+ void removeAnnotation( const ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation >& xAnnotation );
+ const sd::AnnotationVector& getAnnotations() const { return maAnnotations; }
+ bool hasAnnotations() const { return !maAnnotations.empty(); }
+
private:
bool mbIsPrecious;
diff --git a/sd/inc/stlpool.hxx b/sd/inc/stlpool.hxx
index a924c5d8a995..b8f238802067 100644
--- a/sd/inc/stlpool.hxx
+++ b/sd/inc/stlpool.hxx
@@ -47,6 +47,8 @@
#include <stlfamily.hxx>
#include <stlsheet.hxx>
+#include <sddllapi.h>
+
class SdStyleSheet;
class SdDrawDocument;
class SdPage;
@@ -82,7 +84,7 @@ public:
had to be created. This is used to assert errors in documents
when styles are missing.
*/
- void CreateLayoutStyleSheets(const String& rLayoutName, sal_Bool bCheck = sal_False );
+ SD_DLLPUBLIC void CreateLayoutStyleSheets(const String& rLayoutName, sal_Bool bCheck = sal_False );
void EraseLayoutStyleSheets(const String& rLayoutName);
List* CreateLayoutSheetNames(const String& rLayoutName) const;
void CreateLayoutSheetList(const String& rLayoutName, SdStyleSheetVector& rLayoutSheets);
@@ -150,6 +152,3 @@ private:
};
#endif // _SD_STLPOOL_HXX
-
-
-
diff --git a/sd/inc/textapi.hxx b/sd/inc/textapi.hxx
new file mode 100644
index 000000000000..5b339ab6054d
--- /dev/null
+++ b/sd/inc/textapi.hxx
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * 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: textapi.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_TEXTAPI_HXX_
+#define _SD_TEXTAPI_HXX_
+
+#include <svx/unoedsrc.hxx>
+#include <svx/unotext.hxx>
+#include <svx/eeitem.hxx>
+#include <rtl/ref.hxx>
+
+class SdDrawDocument;
+
+namespace sd {
+
+class TextAPIEditSource;
+
+class TextApiObject : public SvxUnoText
+{
+public:
+ static rtl::Reference< TextApiObject > create( SdDrawDocument* pDoc );
+
+ virtual ~TextApiObject() throw();
+
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+
+ OutlinerParaObject* CreateText();
+ void SetString( const String& rText );
+ void SetText( OutlinerParaObject& rText );
+ String GetText();
+
+ static TextApiObject* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >& );
+
+private:
+ TextAPIEditSource* mpSource;
+ TextApiObject( TextAPIEditSource* pEditSource );
+};
+
+} // namespace sd
+
+
+#endif // _SD_TEXTAPI_HXX_
diff --git a/sd/prj/build.lst b/sd/prj/build.lst
index 40e6ed16ebee..ace6165f64f3 100644
--- a/sd/prj/build.lst
+++ b/sd/prj/build.lst
@@ -13,6 +13,8 @@ sd sd\source\ui\app nmake - all sd_app sd_sdi sd_inc NULL
sd sd\source\ui\dlg nmake - all sd_dlg sd_sdi sd_inc NULL
sd sd\source\core nmake - all sd_core sd_sdi sd_inc NULL
sd sd\source\core\undo nmake - all sd_undo sd_core sd_inc NULL
+sd sd\source\core\text nmake - all sd_text sd_inc NULL
+sd sd\source\core\annotations nmake - all sd_annotations sd_inc NULL
sd sd\source\ui\docshell nmake - all sd_docsh sd_sdi sd_inc NULL
sd sd\source\ui\unoidl nmake - all sd_unid sd_sdi sd_inc NULL
sd sd\source\ui\accessibility nmake - all sd_accessibility sd_inc NULL
@@ -40,4 +42,5 @@ sd sd\source\ui\framework\configuration nmake - all sd_framework_configuration s
sd sd\source\ui\framework\module nmake - all sd_framework_module sd_inc NULL
sd sd\source\ui\framework\factories nmake - all sd_framework_factories sd_inc NULL
sd sd\source\ui\framework\tools nmake - all sd_framework_tools sd_inc NULL
-sd sd\util nmake - all sd_util sd_app sd_cgm sd_core sd_dlg sd_docsh sd_eppt sd_filt sd_func sd_grf sd_unid sd_view sd_xml sd_html sd_ppt sd_accessibility sd_animations sd_toolpanel sd_toolpanel_controls sd_tools sd_slsshell sd_slsmodel sd_slsview sd_slscontroller sd_slscache sd_notes sd_table sd_slideshow sd_presenter sd_undo sd_helper sd_framework_configuration sd_framework_module sd_framework_tools sd_framework_factories NULL
+sd sd\source\ui\annotations nmake - all sd_uiannotations sd_inc NULL
+sd sd\util nmake - all sd_util sd_app sd_cgm sd_core sd_dlg sd_docsh sd_eppt sd_filt sd_func sd_grf sd_unid sd_view sd_xml sd_html sd_ppt sd_accessibility sd_animations sd_toolpanel sd_toolpanel_controls sd_tools sd_slsshell sd_slsmodel sd_slsview sd_slscontroller sd_slscache sd_notes sd_table sd_slideshow sd_presenter sd_undo sd_helper sd_framework_configuration sd_framework_module sd_framework_tools sd_framework_factories sd_text sd_annotations sd_uiannotations NULL
diff --git a/sd/sdi/SlideSorterController.sdi b/sd/sdi/SlideSorterController.sdi
index be2a86160124..ff64d80bd8af 100644
--- a/sd/sdi/SlideSorterController.sdi
+++ b/sd/sdi/SlideSorterController.sdi
@@ -128,7 +128,7 @@ interface SlideSorterView
ExecMethod = FuSupport ;
StateMethod = GetClipboardState ;
]
- SID_PASTE2 // ole : no, status : ?
+ SID_PASTE_SPECIAL // ole : no, status : ?
[
ExecMethod = FuSupport ;
StateMethod = GetClipboardState ;
@@ -199,7 +199,7 @@ interface SlideSorterView
GroupId = GID_DOCUMENT ;
ExecMethod = ExecCtrl ;
StateMethod = GetCtrlState ;
- Asynchron , Volatile , AutoUpdate ,
+ Asynchron , AutoUpdate ,
MenuConfig , AccelConfig , ToolBoxConfig ;
]
SID_SEARCH_DLG // ole : no, status : ?
diff --git a/sd/sdi/TaskPaneViewShell.sdi b/sd/sdi/TaskPaneViewShell.sdi
index ede307b955bf..8d35e88155c4 100644
--- a/sd/sdi/TaskPaneViewShell.sdi
+++ b/sd/sdi/TaskPaneViewShell.sdi
@@ -308,3 +308,4 @@ shell LayoutMenu
shell TaskPaneViewShell
{
}
+
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index 8f758dda5858..b641ab64a1a0 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -62,7 +62,7 @@ interface DrawView
GroupId = GID_DOCUMENT ;
ExecMethod = ExecCtrl ;
StateMethod = GetCtrlState ;
- Asynchron , Volatile , AutoUpdate ,
+ Asynchron , AutoUpdate ,
MenuConfig , AccelConfig , ToolBoxConfig ;
]
SID_PAGEMODE // ole : no, status : play rec
@@ -281,7 +281,7 @@ interface DrawView
StateMethod = GetMenuState ;
]
- SID_PASTE2 // ole : no, status : ?
+ SID_PASTE_SPECIAL // ole : no, status : ?
[
ExecMethod = FuTemporary ;
StateMethod = GetMenuState ;
diff --git a/sd/sdi/drviewsh.sdi b/sd/sdi/drviewsh.sdi
index a41ed20e4ddd..b0dc446a6c72 100644
--- a/sd/sdi/drviewsh.sdi
+++ b/sd/sdi/drviewsh.sdi
@@ -180,6 +180,46 @@ interface ImpressEditView : DrawView
ExecMethod = FuTemporary ;
StateMethod = GetMenuState ;
]
+ SID_SHOW_POSTIT
+ [
+ ExecMethod = ExecuteAnnotation;
+ StateMethod = GetAnnotationState;
+ ]
+ SID_INSERT_POSTIT
+ [
+ ExecMethod = ExecuteAnnotation;
+ StateMethod = GetAnnotationState;
+ ]
+ SID_REPLYTO_POSTIT
+ [
+ ExecMethod = ExecuteAnnotation;
+ StateMethod = GetAnnotationState;
+ ]
+ SID_DELETE_POSTIT
+ [
+ ExecMethod = ExecuteAnnotation;
+ StateMethod = GetAnnotationState;
+ ]
+ SID_DELETEALL_POSTIT
+ [
+ ExecMethod = ExecuteAnnotation;
+ StateMethod = GetAnnotationState;
+ ]
+ SID_PREVIOUS_POSTIT
+ [
+ ExecMethod = ExecuteAnnotation;
+ StateMethod = GetAnnotationState;
+ ]
+ SID_NEXT_POSTIT
+ [
+ ExecMethod = ExecuteAnnotation;
+ StateMethod = GetAnnotationState;
+ ]
+ SID_DELETEALLBYAUTHOR_POSTIT
+ [
+ ExecMethod = ExecuteAnnotation;
+ StateMethod = GetAnnotationState;
+ ]
}
shell DrawViewShell
diff --git a/sd/sdi/grviewsh.sdi b/sd/sdi/grviewsh.sdi
index 12245e6584dc..055f762aa314 100644
--- a/sd/sdi/grviewsh.sdi
+++ b/sd/sdi/grviewsh.sdi
@@ -50,4 +50,44 @@ interface GraphicEditView : DrawView
shell GraphicViewShell
{
import GraphicEditView[Automation];
+ SID_INSERT_POSTIT
+ [
+ ExecMethod = ExecuteAnnotation;
+ StateMethod = GetAnnotationState;
+ ]
+ SID_SHOW_POSTIT
+ [
+ ExecMethod = ExecuteAnnotation;
+ StateMethod = GetAnnotationState;
+ ]
+ SID_REPLYTO_POSTIT
+ [
+ ExecMethod = ExecuteAnnotation;
+ StateMethod = GetAnnotationState;
+ ]
+ SID_DELETE_POSTIT
+ [
+ ExecMethod = ExecuteAnnotation;
+ StateMethod = GetAnnotationState;
+ ]
+ SID_DELETEALL_POSTIT
+ [
+ ExecMethod = ExecuteAnnotation;
+ StateMethod = GetAnnotationState;
+ ]
+ SID_PREVIOUS_POSTIT
+ [
+ ExecMethod = ExecuteAnnotation;
+ StateMethod = GetAnnotationState;
+ ]
+ SID_NEXT_POSTIT
+ [
+ ExecMethod = ExecuteAnnotation;
+ StateMethod = GetAnnotationState;
+ ]
+ SID_DELETEALLBYAUTHOR_POSTIT
+ [
+ ExecMethod = ExecuteAnnotation;
+ StateMethod = GetAnnotationState;
+ ]
}
diff --git a/sd/sdi/makefile.mk b/sd/sdi/makefile.mk
index a442c65e8d64..8a2c8fd971d7 100644
--- a/sd/sdi/makefile.mk
+++ b/sd/sdi/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# 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
@@ -41,6 +41,7 @@ SVSDIINC=$(PRJ)$/source$/ui$/inc
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
+.IF "$(L10N_framework)"==""
# --- Files --------------------------------------------------------
@@ -55,17 +56,18 @@ SVSDI1DEPEND= \
_docsh.sdi \
docshell.sdi \
drtxtob.sdi \
- drbezob.sdi \
- drgrfob.sdi \
+ drbezob.sdi \
+ drgrfob.sdi \
_drvwsh.sdi \
drviewsh.sdi \
- mediaob.sdi \
- tables.sdi\
+ mediaob.sdi \
+ tables.sdi\
outlnvsh.sdi \
SlideSorterController.sdi \
ViewShellBase.sdi \
TaskPaneViewShell.sdi \
sdslots.hrc \
+ $(SOLARINCXDIR)$/svxslots.ilb \
$(PRJ)$/inc$/app.hrc
SVSDI2DEPEND= \
@@ -74,17 +76,18 @@ SVSDI2DEPEND= \
_docsh.sdi \
grdocsh.sdi \
drtxtob.sdi \
- drbezob.sdi \
- drgrfob.sdi \
+ drbezob.sdi \
+ drgrfob.sdi \
_drvwsh.sdi \
grviewsh.sdi \
- mediaob.sdi \
+ mediaob.sdi \
outlnvsh.sdi \
ViewShellBase.sdi \
TaskPaneViewShell.sdi \
sdslots.hrc \
+ $(SOLARINCXDIR)$/svxslots.ilb \
$(PRJ)$/inc$/app.hrc
# --- Targets -------------------------------------------------------
-
+.ENDIF
.INCLUDE : target.mk
diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi
index 515b5b6b84ce..7c37e455276c 100644
--- a/sd/sdi/sdraw.sdi
+++ b/sd/sdi/sdraw.sdi
@@ -339,7 +339,6 @@ SfxVoidItem Break SID_BREAK
GroupId = GID_MODIFY;
]
-//--------------------------------------------------------------------------
SfxVoidItem CapturePoint SID_CAPTUREPOINT
()
[
@@ -1921,7 +1920,7 @@ SfxVoidItem DeleteLayer SID_DELETE_LAYER
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = TRUE,
@@ -1946,7 +1945,7 @@ SfxVoidItem DeletePage SID_DELETE_PAGE
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = TRUE,
@@ -5261,31 +5260,6 @@ SfxBoolItem ParaspaceIncrease SID_PARASPACE_INCREASE
]
//--------------------------------------------------------------------------
-SfxVoidItem PasteClipboard SID_PASTE2
-()
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Volatile,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = TRUE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- /* config: */
- AccelConfig = TRUE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_EDIT;
-]
-
-//--------------------------------------------------------------------------
SfxBoolItem PickThrough SID_PICK_THROUGH
[
@@ -6772,7 +6746,7 @@ SfxVoidItem DeleteMasterPage SID_DELETE_MASTER_PAGE()
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Volatile,
+ Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = TRUE,
diff --git a/sd/source/core/annotations/Annotation.cxx b/sd/source/core/annotations/Annotation.cxx
new file mode 100644
index 000000000000..174c548f222e
--- /dev/null
+++ b/sd/source/core/annotations/Annotation.cxx
@@ -0,0 +1,448 @@
+/*************************************************************************
+ *
+ * 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: unopage.cxx,v $
+ * $Revision: 1.96 $
+ *
+ * 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 "osl/time.h"
+#include "sal/config.h"
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/office/XAnnotation.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+
+#include <comphelper/processfactory.hxx>
+#include <cppuhelper/propertysetmixin.hxx>
+#include <cppuhelper/compbase1.hxx>
+#include <cppuhelper/basemutex.hxx>
+
+#include "drawdoc.hxx"
+#include "sdpage.hxx"
+#include "textapi.hxx"
+
+using ::rtl::OUString;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::office;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::geometry;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::util;
+using namespace ::com::sun::star;
+
+extern void NotifyDocumentEvent( SdDrawDocument* pDocument, const rtl::OUString& rEventName, const Reference< XInterface >& xSource );
+
+namespace sd {
+
+class Annotation : private ::cppu::BaseMutex,
+ public ::cppu::WeakComponentImplHelper1< XAnnotation>,
+ public ::cppu::PropertySetMixin< XAnnotation >
+{
+public:
+ explicit Annotation( const Reference< XComponentContext >& context, SdPage* pPage );
+
+ SdPage* GetPage() const { return mpPage; }
+ SdrModel* GetModel() { return (mpPage != 0) ? mpPage->GetModel() : 0; }
+
+ // XInterface:
+ virtual Any SAL_CALL queryInterface(Type const & type) throw (RuntimeException);
+ virtual void SAL_CALL acquire() throw () { ::cppu::WeakComponentImplHelper1< XAnnotation >::acquire(); }
+ virtual void SAL_CALL release() throw () { ::cppu::WeakComponentImplHelper1< XAnnotation >::release(); }
+
+ // ::com::sun::star::beans::XPropertySet:
+ virtual Reference< XPropertySetInfo > SAL_CALL getPropertySetInfo() throw (RuntimeException);
+ virtual void SAL_CALL setPropertyValue(const OUString & aPropertyName, const Any & aValue) throw (RuntimeException, UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException);
+ virtual Any SAL_CALL getPropertyValue(const OUString & PropertyName) throw (RuntimeException, UnknownPropertyException, WrappedTargetException);
+ virtual void SAL_CALL addPropertyChangeListener(const OUString & aPropertyName, const Reference< XPropertyChangeListener > & xListener) throw (RuntimeException, UnknownPropertyException, WrappedTargetException);
+ virtual void SAL_CALL removePropertyChangeListener(const OUString & aPropertyName, const Reference< XPropertyChangeListener > & aListener) throw (RuntimeException, UnknownPropertyException, WrappedTargetException);
+ virtual void SAL_CALL addVetoableChangeListener(const OUString & PropertyName, const Reference< XVetoableChangeListener > & aListener) throw (RuntimeException, UnknownPropertyException, WrappedTargetException);
+ virtual void SAL_CALL removeVetoableChangeListener(const OUString & PropertyName, const Reference< XVetoableChangeListener > & aListener) throw (RuntimeException, UnknownPropertyException, WrappedTargetException);
+
+ // ::com::sun::star::office::XAnnotation:
+ virtual ::com::sun::star::uno::Any SAL_CALL getAnchor() throw (::com::sun::star::uno::RuntimeException);
+ virtual RealPoint2D SAL_CALL getPosition() throw (RuntimeException);
+ virtual void SAL_CALL setPosition(const RealPoint2D & the_value) throw (RuntimeException);
+ virtual ::com::sun::star::geometry::RealSize2D SAL_CALL getSize() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setSize( const ::com::sun::star::geometry::RealSize2D& _size ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getAuthor() throw (RuntimeException);
+ virtual void SAL_CALL setAuthor(const OUString & the_value) throw (RuntimeException);
+ virtual util::DateTime SAL_CALL getDateTime() throw (RuntimeException);
+ virtual void SAL_CALL setDateTime(const util::DateTime & the_value) throw (RuntimeException);
+ virtual Reference< XText > SAL_CALL getTextRange() throw (RuntimeException);
+
+private:
+ Annotation(const Annotation &); // not defined
+ Annotation& operator=(const Annotation &); // not defined
+
+ // destructor is private and will be called indirectly by the release call virtual ~Annotation() {}
+
+ void createChangeUndo();
+
+ // overload WeakComponentImplHelperBase::disposing()
+ // This function is called upon disposing the component,
+ // if your component needs special work when it becomes
+ // disposed, do it here.
+ virtual void SAL_CALL disposing();
+
+ SdPage* mpPage;
+ Reference< XComponentContext > m_xContext;
+ mutable ::osl::Mutex m_aMutex;
+ RealPoint2D m_Position;
+ RealSize2D m_Size;
+ OUString m_Author;
+ util::DateTime m_DateTime;
+ rtl::Reference< TextApiObject > m_TextRange;
+};
+
+class UndoInsertOrRemoveAnnotation : public SdrUndoAction
+{
+public:
+ UndoInsertOrRemoveAnnotation( Annotation& rAnnotation, bool bInsert );
+
+ virtual void Undo();
+ virtual void Redo();
+
+protected:
+ rtl::Reference< Annotation > mxAnnotation;
+ bool mbInsert;
+ int mnIndex;
+};
+
+struct AnnotationData
+{
+ RealPoint2D m_Position;
+ RealSize2D m_Size;
+ OUString m_Author;
+ util::DateTime m_DateTime;
+
+ void get( const rtl::Reference< Annotation >& xAnnotation )
+ {
+ m_Position = xAnnotation->getPosition();
+ m_Size = xAnnotation->getSize();
+ m_Author = xAnnotation->getAuthor();
+ m_DateTime = xAnnotation->getDateTime();
+ }
+
+ void set( const rtl::Reference< Annotation >& xAnnotation )
+ {
+ xAnnotation->setPosition(m_Position);
+ xAnnotation->setSize(m_Size);
+ xAnnotation->setAuthor(m_Author);
+ xAnnotation->setDateTime(m_DateTime);
+ }
+};
+
+class UndoAnnotation : public SdrUndoAction
+{
+public:
+ UndoAnnotation( Annotation& rAnnotation );
+
+ virtual void Undo();
+ virtual void Redo();
+
+protected:
+ rtl::Reference< Annotation > mxAnnotation;
+ AnnotationData maUndoData;
+ AnnotationData maRedoData;
+};
+
+void createAnnotation( Reference< XAnnotation >& xAnnotation, SdPage* pPage )
+{
+ Reference<XComponentContext> xContext (comphelper_getProcessComponentContext());
+ xAnnotation.set( new Annotation(xContext, pPage) );
+ pPage->addAnnotation(xAnnotation);
+}
+
+Annotation::Annotation( const Reference< XComponentContext >& context, SdPage* pPage )
+: ::cppu::WeakComponentImplHelper1< XAnnotation >(m_aMutex)
+, ::cppu::PropertySetMixin< XAnnotation >(context, static_cast< Implements >(IMPLEMENTS_PROPERTY_SET), Sequence< ::rtl::OUString >())
+, mpPage( pPage )
+{
+}
+
+// overload WeakComponentImplHelperBase::disposing()
+// This function is called upon disposing the component,
+// if your component needs special work when it becomes
+// disposed, do it here.
+void SAL_CALL Annotation::disposing()
+{
+ mpPage = 0;
+ if( m_TextRange.is() )
+ {
+ m_TextRange->dispose();
+ m_TextRange.clear();
+ }
+}
+
+Any Annotation::queryInterface(Type const & type) throw (RuntimeException)
+{
+ return ::cppu::WeakComponentImplHelper1< XAnnotation>::queryInterface(type);
+}
+
+// com.sun.star.beans.XPropertySet:
+Reference< XPropertySetInfo > SAL_CALL Annotation::getPropertySetInfo() throw (RuntimeException)
+{
+ return ::cppu::PropertySetMixin< XAnnotation >::getPropertySetInfo();
+}
+
+void SAL_CALL Annotation::setPropertyValue(const OUString & aPropertyName, const Any & aValue) throw (RuntimeException, UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException)
+{
+ ::cppu::PropertySetMixin< XAnnotation >::setPropertyValue(aPropertyName, aValue);
+}
+
+Any SAL_CALL Annotation::getPropertyValue(const OUString & aPropertyName) throw (RuntimeException, UnknownPropertyException, WrappedTargetException)
+{
+ return ::cppu::PropertySetMixin< XAnnotation >::getPropertyValue(aPropertyName);
+}
+
+void SAL_CALL Annotation::addPropertyChangeListener(const OUString & aPropertyName, const Reference< XPropertyChangeListener > & xListener) throw (RuntimeException, UnknownPropertyException, WrappedTargetException)
+{
+ ::cppu::PropertySetMixin< XAnnotation >::addPropertyChangeListener(aPropertyName, xListener);
+}
+
+void SAL_CALL Annotation::removePropertyChangeListener(const OUString & aPropertyName, const Reference< XPropertyChangeListener > & xListener) throw (RuntimeException, UnknownPropertyException, WrappedTargetException)
+{
+ ::cppu::PropertySetMixin< XAnnotation >::removePropertyChangeListener(aPropertyName, xListener);
+}
+
+void SAL_CALL Annotation::addVetoableChangeListener(const OUString & aPropertyName, const Reference< XVetoableChangeListener > & xListener) throw (RuntimeException, UnknownPropertyException, WrappedTargetException)
+{
+ ::cppu::PropertySetMixin< XAnnotation >::addVetoableChangeListener(aPropertyName, xListener);
+}
+
+void SAL_CALL Annotation::removeVetoableChangeListener(const OUString & aPropertyName, const Reference< XVetoableChangeListener > & xListener) throw (RuntimeException, UnknownPropertyException, WrappedTargetException)
+{
+ ::cppu::PropertySetMixin< XAnnotation >::removeVetoableChangeListener(aPropertyName, xListener);
+}
+
+Any SAL_CALL Annotation::getAnchor() throw (RuntimeException)
+{
+ osl::MutexGuard g(m_aMutex);
+ Any aRet;
+ if( mpPage )
+ {
+ Reference< XDrawPage > xPage( mpPage->getUnoPage(), UNO_QUERY );
+ aRet <<= xPage;
+ }
+ return aRet;
+}
+
+// ::com::sun::star::office::XAnnotation:
+RealPoint2D SAL_CALL Annotation::getPosition() throw (RuntimeException)
+{
+ osl::MutexGuard g(m_aMutex);
+ return m_Position;
+}
+
+void SAL_CALL Annotation::setPosition(const RealPoint2D & the_value) throw (RuntimeException)
+{
+ prepareSet(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Position")),
+ Any(), Any(), 0);
+ {
+ osl::MutexGuard g(m_aMutex);
+ createChangeUndo();
+ m_Position = the_value;
+ }
+}
+
+// ::com::sun::star::office::XAnnotation:
+RealSize2D SAL_CALL Annotation::getSize() throw (RuntimeException)
+{
+ osl::MutexGuard g(m_aMutex);
+ return m_Size;
+}
+
+void SAL_CALL Annotation::setSize(const RealSize2D & the_value) throw (RuntimeException)
+{
+ prepareSet(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Size")),
+ Any(), Any(), 0);
+ {
+ osl::MutexGuard g(m_aMutex);
+ createChangeUndo();
+ m_Size = the_value;
+ }
+}
+
+OUString SAL_CALL Annotation::getAuthor() throw (RuntimeException)
+{
+ osl::MutexGuard g(m_aMutex);
+ return m_Author;
+}
+
+void SAL_CALL Annotation::setAuthor(const OUString & the_value) throw (RuntimeException)
+{
+ prepareSet(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Author")),
+ Any(), Any(), 0);
+ {
+ osl::MutexGuard g(m_aMutex);
+ createChangeUndo();
+ m_Author = the_value;
+ }
+}
+
+util::DateTime SAL_CALL Annotation::getDateTime() throw (RuntimeException)
+{
+ osl::MutexGuard g(m_aMutex);
+ return m_DateTime;
+}
+
+void SAL_CALL Annotation::setDateTime(const util::DateTime & the_value) throw (RuntimeException)
+{
+ prepareSet(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DateTime")),
+ Any(), Any(), 0);
+ {
+ osl::MutexGuard g(m_aMutex);
+ createChangeUndo();
+ m_DateTime = the_value;
+ }
+}
+
+void Annotation::createChangeUndo()
+{
+ SdrModel* pModel = GetModel();
+ if( pModel && pModel->IsUndoEnabled() )
+ pModel->AddUndo( new UndoAnnotation( *this ) );
+
+ if( pModel )
+ {
+ pModel->SetChanged();
+ Reference< XInterface > xSource( static_cast<uno::XWeak*>( this ) );
+ NotifyDocumentEvent( static_cast< SdDrawDocument* >( pModel ), OUString( RTL_CONSTASCII_USTRINGPARAM("OnAnnotationChanged") ), xSource );
+ }
+}
+
+Reference< XText > SAL_CALL Annotation::getTextRange() throw (RuntimeException)
+{
+ osl::MutexGuard g(m_aMutex);
+ if( !m_TextRange.is() && (mpPage != 0) )
+ {
+ m_TextRange = TextApiObject::create( static_cast< SdDrawDocument* >( mpPage->GetModel() ) );
+ }
+ return Reference< XText >( m_TextRange.get() );
+}
+
+SdrUndoAction* CreateUndoInsertOrRemoveAnnotation( const Reference< XAnnotation >& xAnnotation, bool bInsert )
+{
+ Annotation* pAnnotation = dynamic_cast< Annotation* >( xAnnotation.get() );
+ if( pAnnotation )
+ {
+ return new UndoInsertOrRemoveAnnotation( *pAnnotation, bInsert );
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+UndoInsertOrRemoveAnnotation::UndoInsertOrRemoveAnnotation( Annotation& rAnnotation, bool bInsert )
+: SdrUndoAction( *rAnnotation.GetModel() )
+, mxAnnotation( &rAnnotation )
+, mbInsert( bInsert )
+, mnIndex( 0 )
+{
+ SdPage* pPage = rAnnotation.GetPage();
+ if( pPage )
+ {
+ Reference< XAnnotation > xAnnotation( &rAnnotation );
+
+ const AnnotationVector& rVec = pPage->getAnnotations();
+ for( AnnotationVector::const_iterator iter = rVec.begin(); iter != rVec.end(); iter++ )
+ {
+ if( (*iter) == xAnnotation )
+ break;
+
+ mnIndex++;
+ }
+ }
+}
+
+void UndoInsertOrRemoveAnnotation::Undo()
+{
+ SdPage* pPage = mxAnnotation->GetPage();
+ SdrModel* pModel = mxAnnotation->GetModel();
+ if( pPage && pModel )
+ {
+ Reference< XAnnotation > xAnnotation( mxAnnotation.get() );
+ if( mbInsert )
+ {
+ pPage->removeAnnotation( xAnnotation );
+ }
+ else
+ {
+ pPage->addAnnotation( xAnnotation, mnIndex );
+ }
+ }
+}
+
+void UndoInsertOrRemoveAnnotation::Redo()
+{
+ SdPage* pPage = mxAnnotation->GetPage();
+ SdrModel* pModel = mxAnnotation->GetModel();
+ if( pPage && pModel )
+ {
+ Reference< XAnnotation > xAnnotation( mxAnnotation.get() );
+
+ if( mbInsert )
+ {
+ pPage->addAnnotation( xAnnotation, mnIndex );
+ }
+ else
+ {
+ pPage->removeAnnotation( xAnnotation );
+ }
+ }
+}
+
+UndoAnnotation::UndoAnnotation( Annotation& rAnnotation )
+: SdrUndoAction( *rAnnotation.GetModel() )
+, mxAnnotation( &rAnnotation )
+{
+ maUndoData.get( mxAnnotation );
+}
+
+void UndoAnnotation::Undo()
+{
+ maRedoData.get( mxAnnotation );
+ maUndoData.set( mxAnnotation );
+}
+
+void UndoAnnotation::Redo()
+{
+ maUndoData.get( mxAnnotation );
+ maRedoData.set( mxAnnotation );
+}
+
+} // namespace sd
+
diff --git a/sd/source/core/annotations/AnnotationAccess.cxx b/sd/source/core/annotations/AnnotationAccess.cxx
new file mode 100644
index 000000000000..ffcca97962e8
--- /dev/null
+++ b/sd/source/core/annotations/AnnotationAccess.cxx
@@ -0,0 +1,59 @@
+#include "sal/config.h"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "cppuhelper/implbase1.hxx"
+#include "com/sun/star/office/XAnnotationAccess.hpp"
+
+namespace css = ::com::sun::star;
+
+class AnnotationAccess:
+ public ::cppu::WeakImplHelper1<
+ css::office::XAnnotationAccess>
+{
+public:
+ explicit AnnotationAccess(css::uno::Reference< css::uno::XComponentContext > const & context);
+
+ // ::com::sun::star::office::XAnnotationAccess:
+ virtual css::uno::Reference< css::office::XAnnotation > SAL_CALL createAndInsertAnnotation() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL removeAnnotation(const css::uno::Reference< css::office::XAnnotation > & annotation) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException);
+ virtual css::uno::Reference< css::office::XAnnotationEnumeration > SAL_CALL createAnnotationEnumeration() throw (css::uno::RuntimeException);
+
+private:
+ AnnotationAccess(const AnnotationAccess &); // not defined
+ AnnotationAccess& operator=(const AnnotationAccess &); // not defined
+
+ // destructor is private and will be called indirectly by the release call virtual ~AnnotationAccess() {}
+
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
+};
+
+AnnotationAccess::AnnotationAccess(css::uno::Reference< css::uno::XComponentContext > const & context) :
+ m_xContext(context)
+{}
+
+// ::com::sun::star::office::XAnnotationAccess:
+css::uno::Reference< css::office::XAnnotation > SAL_CALL AnnotationAccess::createAndInsertAnnotation() throw (css::uno::RuntimeException)
+{
+ // TODO: Exchange the default return implementation for "createAndInsertAnnotation" !!!
+ // Exchange the default return implementation.
+ // NOTE: Default initialized polymorphic structs can cause problems because of
+ // missing default initialization of primitive types of some C++ compilers or
+ // different Any initialization in Java and C++ polymorphic structs.
+ return css::uno::Reference< css::office::XAnnotation >();
+}
+
+void SAL_CALL AnnotationAccess::removeAnnotation(const css::uno::Reference< css::office::XAnnotation > & annotation) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException)
+{
+ // TODO: Insert your implementation for "removeAnnotation" here.
+}
+
+css::uno::Reference< css::office::XAnnotationEnumeration > SAL_CALL AnnotationAccess::createAnnotationEnumeration() throw (css::uno::RuntimeException)
+{
+ // TODO: Exchange the default return implementation for "createAnnotationEnumeration" !!!
+ // Exchange the default return implementation.
+ // NOTE: Default initialized polymorphic structs can cause problems because of
+ // missing default initialization of primitive types of some C++ compilers or
+ // different Any initialization in Java and C++ polymorphic structs.
+ return css::uno::Reference< css::office::XAnnotationEnumeration >();
+}
+
+
diff --git a/sd/source/core/annotations/AnnotationEnumeration.cxx b/sd/source/core/annotations/AnnotationEnumeration.cxx
new file mode 100644
index 000000000000..69947f3489db
--- /dev/null
+++ b/sd/source/core/annotations/AnnotationEnumeration.cxx
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * 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: unopage.cxx,v $
+ * $Revision: 1.96 $
+ *
+ * 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 "sal/config.h"
+
+#include "cppuhelper/implbase1.hxx"
+
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/office/XAnnotationEnumeration.hpp"
+
+#include "sdpage.hxx"
+namespace css = ::com::sun::star;
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::office;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+
+namespace sd {
+
+class AnnotationEnumeration: public ::cppu::WeakImplHelper1< css::office::XAnnotationEnumeration >
+{
+public:
+ AnnotationEnumeration( const AnnotationVector& rAnnotations );
+
+ // ::com::sun::star::office::XAnnotationEnumeration:
+ virtual ::sal_Bool SAL_CALL hasMoreElements() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::office::XAnnotation > SAL_CALL nextElement() throw (css::uno::RuntimeException, css::container::NoSuchElementException);
+
+private:
+ AnnotationEnumeration(const AnnotationEnumeration &); // not defined
+ AnnotationEnumeration& operator=(const AnnotationEnumeration &); // not defined
+
+ // destructor is private and will be called indirectly by the release call virtual ~AnnotationEnumeration() {}
+
+ AnnotationVector maAnnotations;
+ AnnotationVector::iterator maIter;
+};
+
+Reference< XAnnotationEnumeration > createAnnotationEnumeration( const sd::AnnotationVector& rAnnotations )
+{
+ return new AnnotationEnumeration( rAnnotations );
+}
+
+AnnotationEnumeration::AnnotationEnumeration( const AnnotationVector& rAnnotations )
+: maAnnotations(rAnnotations)
+{
+ maIter = maAnnotations.begin();
+}
+
+// ::com::sun::star::office::XAnnotationEnumeration:
+::sal_Bool SAL_CALL AnnotationEnumeration::hasMoreElements() throw (css::uno::RuntimeException)
+{
+ return maIter != maAnnotations.end() ? sal_True : sal_False;
+}
+
+css::uno::Reference< css::office::XAnnotation > SAL_CALL AnnotationEnumeration::nextElement() throw (css::uno::RuntimeException, css::container::NoSuchElementException)
+{
+ if( maIter == maAnnotations.end() )
+ throw css::container::NoSuchElementException();
+
+ return (*maIter++);
+}
+
+} // namespace sd
+
diff --git a/sd/source/core/annotations/makefile.mk b/sd/source/core/annotations/makefile.mk
new file mode 100644
index 000000000000..0cbf57e3fe45
--- /dev/null
+++ b/sd/source/core/annotations/makefile.mk
@@ -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: makefile.mk,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.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PROJECTPCH=sd
+PROJECTPCHSOURCE=$(PRJ)$/util$/sd
+PRJNAME=sd
+TARGET=annotations
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+
+# --- Files --------------------------------------------------------
+
+SLOFILES = $(SLO)$/Annotation.obj \
+ $(SLO)$/AnnotationEnumeration.obj
+
+# --- Tagets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 564df7b594b7..d5cd14a80b65 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -34,6 +34,7 @@
#include "PageListWatcher.hxx"
#include <com/sun/star/text/WritingMode.hpp>
#include <com/sun/star/document/PrinterIndependentLayout.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
#include <svx/forbiddencharacterstable.hxx>
#include <svx/svxids.hrc>
@@ -41,6 +42,8 @@
#include <svx/eeitem.hxx>
#include <svx/scriptspaceitem.hxx>
+#include <svtools/useroptions.hxx>
+
#ifndef _OFA_MISCCFG_HXX
#include <svtools/misccfg.hxx>
#endif
@@ -222,7 +225,7 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
// Vorlagen existieren.
SdrOutliner& rOutliner = GetDrawOutliner();
rOutliner.SetStyleSheetPool((SfxStyleSheetPool*)GetStyleSheetPool());
- rOutliner.SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl));
+ SetCalcFieldValueHdl( &rOutliner );
// set linguistic options
{
@@ -230,9 +233,12 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
SvtLinguOptions aOptions;
aLinguConfig.GetOptions( aOptions );
- SetLanguage( aOptions.nDefaultLanguage, EE_CHAR_LANGUAGE );
- SetLanguage( aOptions.nDefaultLanguage_CJK, EE_CHAR_LANGUAGE_CJK );
- SetLanguage( aOptions.nDefaultLanguage_CTL, EE_CHAR_LANGUAGE_CTL );
+ SetLanguage( MsLangId::resolveSystemLanguageByScriptType(aOptions.nDefaultLanguage,
+ ::com::sun::star::i18n::ScriptType::LATIN), EE_CHAR_LANGUAGE );
+ SetLanguage( MsLangId::resolveSystemLanguageByScriptType(aOptions.nDefaultLanguage_CJK,
+ ::com::sun::star::i18n::ScriptType::ASIAN), EE_CHAR_LANGUAGE_CJK );
+ SetLanguage( MsLangId::resolveSystemLanguageByScriptType(aOptions.nDefaultLanguage_CTL,
+ ::com::sun::star::i18n::ScriptType::COMPLEX), EE_CHAR_LANGUAGE_CTL );
mbOnlineSpell = aOptions.bIsSpellAuto;
}
@@ -315,7 +321,7 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
SfxItemSet aSet2( pHitTestOutliner->GetEmptyItemSet() );
pHitTestOutliner->SetStyleSheetPool( (SfxStyleSheetPool*)GetStyleSheetPool() );
- pHitTestOutliner->SetCalcFieldValueHdl( LINK(SD_MOD(), SdModule, CalcFieldValueHdl) );
+ SetCalcFieldValueHdl( pHitTestOutliner );
try
{
@@ -1068,5 +1074,36 @@ void SdDrawDocument::MasterPageListChanged()
mpMasterPageListWatcher->Invalidate();
}
+void SdDrawDocument::SetCalcFieldValueHdl(::Outliner* pOutliner)
+{
+ pOutliner->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl));
+}
+
+sal_uInt16 SdDrawDocument::GetAnnotationAuthorIndex( const rtl::OUString& rAuthor )
+{
+ // force current user to have first color
+ if( maAnnotationAuthors.empty() )
+ {
+ SvtUserOptions aUserOptions;
+ maAnnotationAuthors.push_back( aUserOptions.GetFullName() );
+ }
+
+ sal_uInt16 idx = 0;
+ for( std::vector< OUString >::iterator iter( maAnnotationAuthors.begin() ); iter != maAnnotationAuthors.end(); iter++ )
+ {
+ if( (*iter) == rAuthor )
+ {
+ break;
+ }
+ idx++;
+ }
+
+ if( idx == maAnnotationAuthors.size() )
+ {
+ maAnnotationAuthors.push_back( rAuthor );
+ }
+
+ return idx;
+}
// eof
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index ddb1a471d3e0..413323d27e97 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -1543,6 +1543,11 @@ sal_uInt32 SdDrawDocument::convertFontHeightToCTL( sal_uInt32 nWesternFontHeight
return nWesternFontHeight;
}
+SdStyleSheetPool* SdDrawDocument::GetSdStyleSheetPool() const
+{
+ return dynamic_cast< SdStyleSheetPool* >( GetStyleSheetPool() );
+}
+
ModifyGuard::ModifyGuard( DrawDocShell* pDocShell )
: mpDocShell( pDocShell ), mpDoc( 0 )
{
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index d0c38e16593c..3f03640c27fb 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -64,6 +64,10 @@
using namespace ::sd;
using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::office;
+
+extern void NotifyDocumentEvent( SdDrawDocument* pDocument, const rtl::OUString& rEventName, const Reference< XInterface >& xSource );
/*************************************************************************
|*
@@ -586,3 +590,62 @@ void SdPage::setTransitionDuration ( double fTranstionDuration )
mfTransitionDuration = fTranstionDuration;
ActionChanged();
}
+
+namespace sd {
+extern void createAnnotation( Reference< XAnnotation >& xAnnotation, SdPage* pPage );
+extern SdrUndoAction* CreateUndoInsertOrRemoveAnnotation( const Reference< XAnnotation >& xAnnotation, bool bInsert );
+}
+
+void SdPage::createAnnotation( ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation >& xAnnotation )
+{
+ sd::createAnnotation( xAnnotation, this );
+}
+
+void SdPage::addAnnotation( const Reference< XAnnotation >& xAnnotation, int nIndex )
+{
+ if( (nIndex == -1) || (nIndex > (int)maAnnotations.size()) )
+ {
+ maAnnotations.push_back( xAnnotation );
+ }
+ else
+ {
+ maAnnotations.insert( maAnnotations.begin() + nIndex, xAnnotation );
+ }
+
+ if( pModel && pModel->IsUndoEnabled() )
+ {
+ SdrUndoAction* pAction = CreateUndoInsertOrRemoveAnnotation( xAnnotation, true );
+ if( pAction )
+ pModel->AddUndo( pAction );
+ }
+
+ SetChanged();
+
+ if( pModel )
+ {
+ pModel->SetChanged();
+ Reference< XInterface > xSource( xAnnotation, UNO_QUERY );
+ NotifyDocumentEvent( static_cast< SdDrawDocument* >( pModel ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAnnotationInserted" ) ), xSource );
+ }
+}
+
+void SdPage::removeAnnotation( const Reference< XAnnotation >& xAnnotation )
+{
+ if( pModel && pModel->IsUndoEnabled() )
+ {
+ SdrUndoAction* pAction = CreateUndoInsertOrRemoveAnnotation( xAnnotation, false );
+ if( pAction )
+ pModel->AddUndo( pAction );
+ }
+
+ AnnotationVector::iterator iter = std::find( maAnnotations.begin(), maAnnotations.end(), xAnnotation );
+ if( iter != maAnnotations.end() )
+ maAnnotations.erase( iter );
+
+ if( pModel )
+ {
+ pModel->SetChanged();
+ Reference< XInterface > xSource( xAnnotation, UNO_QUERY );
+ NotifyDocumentEvent( static_cast< SdDrawDocument* >( pModel ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAnnotationRemoved" ) ), xSource );
+ }
+}
diff --git a/sd/source/core/text/makefile.mk b/sd/source/core/text/makefile.mk
new file mode 100644
index 000000000000..83ad7f619ce0
--- /dev/null
+++ b/sd/source/core/text/makefile.mk
@@ -0,0 +1,52 @@
+#*************************************************************************
+#
+# 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: makefile.mk,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.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PROJECTPCH=sd
+PROJECTPCHSOURCE=$(PRJ)$/util$/sd
+PRJNAME=sd
+TARGET=text
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+
+# --- Files --------------------------------------------------------
+
+SLOFILES = $(SLO)$/textapi.obj
+
+# --- Tagets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/sd/source/core/text/textapi.cxx b/sd/source/core/text/textapi.cxx
new file mode 100644
index 000000000000..916e577b64e4
--- /dev/null
+++ b/sd/source/core/text/textapi.cxx
@@ -0,0 +1,325 @@
+/*************************************************************************
+ *
+ * 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: textapi.cxx,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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sd.hxx"
+
+#include <com/sun/star/text/XTextField.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+
+#include <textapi.hxx>
+#include <drawdoc.hxx>
+#include <svx/eeitem.hxx>
+#include <svx/editeng.hxx>
+#include <svx/outlobj.hxx>
+#include "Outliner.hxx"
+
+using ::rtl::OUString;
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+
+namespace sd {
+
+class UndoTextAPIChanged : public SdrUndoAction
+{
+public:
+ UndoTextAPIChanged( SdrModel& rModel, TextApiObject* pTextObj );
+ ~UndoTextAPIChanged();
+
+ virtual void Undo();
+ virtual void Redo();
+
+protected:
+ OutlinerParaObject* mpOldText;
+ OutlinerParaObject* mpNewText;
+ rtl::Reference< TextApiObject > mxTextObj;
+};
+
+UndoTextAPIChanged::UndoTextAPIChanged(SdrModel& rModel, TextApiObject* pTextObj )
+: SdrUndoAction( rModel )
+, mpOldText( pTextObj->CreateText() )
+, mpNewText( 0 )
+, mxTextObj( pTextObj )
+{
+}
+
+UndoTextAPIChanged::~UndoTextAPIChanged()
+{
+ delete mpOldText;
+ delete mpNewText;
+}
+
+void UndoTextAPIChanged::Undo()
+{
+ if( !mpNewText )
+ mpNewText = mxTextObj->CreateText();
+
+ mxTextObj->SetText( *mpOldText );
+}
+
+void UndoTextAPIChanged::Redo()
+{
+ if( mpNewText )
+ {
+ mxTextObj->SetText( *mpNewText );
+ }
+}
+
+struct TextAPIEditSource_Impl
+{
+ // needed for "internal" refcounting
+ SdDrawDocument* mpDoc;
+ Outliner* mpOutliner;
+ SvxOutlinerForwarder* mpTextForwarder;
+ sal_Int32 mnRef;
+};
+
+class TextAPIEditSource : public SvxEditSource
+{
+ TextAPIEditSource_Impl* pImpl;
+
+ virtual SvxEditSource* Clone() const;
+ virtual SvxTextForwarder* GetTextForwarder();
+ virtual void UpdateData();
+ explicit TextAPIEditSource( const TextAPIEditSource& rSource );
+
+public:
+ TextAPIEditSource(SdDrawDocument* pDoc);
+ virtual ~TextAPIEditSource();
+
+ void Dispose();
+ void SetText( OutlinerParaObject& rText );
+ void SetString( const String& rText );
+ OutlinerParaObject* CreateText();
+ String GetText();
+ SdDrawDocument* GetDoc() { return pImpl->mpDoc; }
+};
+
+const SvxItemPropertySet* ImplGetSdTextPortionPropertyMap()
+{
+ static const SfxItemPropertyMapEntry aSdTextPortionPropertyEntries[] =
+ {
+ SVX_UNOEDIT_CHAR_PROPERTIES,
+ SVX_UNOEDIT_FONT_PROPERTIES,
+ SVX_UNOEDIT_OUTLINER_PROPERTIES,
+ SVX_UNOEDIT_PARA_PROPERTIES,
+ {MAP_CHAR_LEN("TextField"), EE_FEATURE_FIELD, &::getCppuType((const Reference< XTextField >*)0), PropertyAttribute::READONLY, 0 },
+ {MAP_CHAR_LEN("TextPortionType"), WID_PORTIONTYPE, &::getCppuType((const OUString*)0), PropertyAttribute::READONLY, 0 },
+ {MAP_CHAR_LEN("TextUserDefinedAttributes"), EE_CHAR_XMLATTRIBS, &::getCppuType((const Reference< XNameContainer >*)0) , 0, 0},
+ {MAP_CHAR_LEN("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, &::getCppuType((const Reference< XNameContainer >*)0) , 0, 0},
+ {0,0,0,0,0,0}
+ };
+ static SvxItemPropertySet aSdTextPortionPropertyMap( aSdTextPortionPropertyEntries );
+
+ return &aSdTextPortionPropertyMap;
+}
+
+TextApiObject::TextApiObject( TextAPIEditSource* pEditSource )
+: SvxUnoText( pEditSource, ImplGetSdTextPortionPropertyMap(), Reference < XText >() )
+, mpSource(pEditSource)
+{
+}
+
+TextApiObject::~TextApiObject() throw()
+{
+ dispose();
+}
+
+rtl::Reference< TextApiObject > TextApiObject::create( SdDrawDocument* pDoc )
+{
+ rtl::Reference< TextApiObject > xRet( new TextApiObject( new TextAPIEditSource( pDoc ) ) );
+ return xRet;
+}
+
+void SAL_CALL TextApiObject::dispose() throw(RuntimeException)
+{
+ if( mpSource )
+ {
+ mpSource->Dispose();
+ delete mpSource;
+ mpSource = 0;
+ }
+
+ // SvxUnoText::dispose();
+}
+
+OutlinerParaObject* TextApiObject::CreateText()
+{
+ return mpSource->CreateText();
+}
+
+void TextApiObject::SetString( const String& rText )
+{
+ SdrModel* pModel = mpSource->GetDoc();
+ if( pModel && pModel->IsUndoEnabled() )
+ pModel->AddUndo( new UndoTextAPIChanged( *pModel, this ) );
+
+ mpSource->SetString( rText );
+ maSelection.nStartPara = 0xffff;
+}
+
+void TextApiObject::SetText( OutlinerParaObject& rText )
+{
+ SdrModel* pModel = mpSource->GetDoc();
+ if( pModel && pModel->IsUndoEnabled() )
+ pModel->AddUndo( new UndoTextAPIChanged( *pModel, this ) );
+
+ mpSource->SetText( rText );
+ maSelection.nStartPara = 0xffff;
+}
+
+String TextApiObject::GetText()
+{
+ return mpSource->GetText();
+}
+
+TextApiObject* TextApiObject::getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >& xText )
+{
+ TextApiObject* pImpl = dynamic_cast< TextApiObject* >( xText.get() );
+
+ if( !pImpl )
+ pImpl = dynamic_cast< TextApiObject* >( SvxUnoTextBase::getImplementation( xText ) );
+
+ return pImpl;
+}
+
+TextAPIEditSource::TextAPIEditSource( const TextAPIEditSource& rSource )
+: SvxEditSource( *this )
+{
+ // shallow copy; uses internal refcounting
+ pImpl = rSource.pImpl;
+ pImpl->mnRef++;
+}
+
+SvxEditSource* TextAPIEditSource::Clone() const
+{
+ return new TextAPIEditSource( *this );
+}
+
+void TextAPIEditSource::UpdateData()
+{
+ // data is kept in outliner all the time
+}
+
+TextAPIEditSource::TextAPIEditSource(SdDrawDocument* pDoc)
+: pImpl(new TextAPIEditSource_Impl)
+{
+ pImpl->mpDoc = pDoc;
+ pImpl->mpOutliner = 0;
+ pImpl->mpTextForwarder = 0;
+ pImpl->mnRef = 1;
+}
+
+TextAPIEditSource::~TextAPIEditSource()
+{
+ if (!--pImpl->mnRef)
+ delete pImpl;
+}
+
+void TextAPIEditSource::Dispose()
+{
+ pImpl->mpDoc=0;
+ delete pImpl->mpTextForwarder;
+ pImpl->mpTextForwarder = 0;
+
+ delete pImpl->mpOutliner;
+ pImpl->mpOutliner = 0;
+}
+
+SvxTextForwarder* TextAPIEditSource::GetTextForwarder()
+{
+ if( !pImpl->mpDoc )
+ return 0; // mpDoc == 0 can be used to flag this as disposed
+
+ if( !pImpl->mpOutliner )
+ {
+ //init draw model first
+ pImpl->mpOutliner = new Outliner( pImpl->mpDoc, OUTLINERMODE_TEXTOBJECT );
+ pImpl->mpDoc->SetCalcFieldValueHdl( pImpl->mpOutliner );
+ }
+
+ if( !pImpl->mpTextForwarder )
+ pImpl->mpTextForwarder = new SvxOutlinerForwarder( *pImpl->mpOutliner, 0 );
+
+ return pImpl->mpTextForwarder;
+}
+
+void TextAPIEditSource::SetText( OutlinerParaObject& rText )
+{
+ if ( pImpl->mpDoc )
+ {
+ if( !pImpl->mpOutliner )
+ {
+ //init draw model first
+ pImpl->mpOutliner = new Outliner( pImpl->mpDoc, OUTLINERMODE_TEXTOBJECT );
+ pImpl->mpDoc->SetCalcFieldValueHdl( pImpl->mpOutliner );
+ }
+
+ pImpl->mpOutliner->SetText( rText );
+ }
+}
+
+void TextAPIEditSource::SetString( const String& rText )
+{
+ if ( pImpl->mpDoc )
+ {
+ if( !pImpl->mpOutliner )
+ {
+ //init draw model first
+ pImpl->mpOutliner = new Outliner( pImpl->mpDoc, OUTLINERMODE_TEXTOBJECT );
+ pImpl->mpDoc->SetCalcFieldValueHdl( pImpl->mpOutliner );
+ }
+ else
+ pImpl->mpOutliner->Clear();
+ pImpl->mpOutliner->Insert( rText );
+ }
+}
+
+OutlinerParaObject* TextAPIEditSource::CreateText()
+{
+ if ( pImpl->mpDoc && pImpl->mpOutliner )
+ return pImpl->mpOutliner->CreateParaObject();
+ else
+ return 0;
+}
+
+String TextAPIEditSource::GetText()
+{
+ if ( pImpl->mpDoc && pImpl->mpOutliner )
+ return pImpl->mpOutliner->GetEditEngine().GetText();
+ else
+ return String();
+}
+
+} // namespace sd
diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx
index 2c313d97f2ac..cb31e99aec63 100644
--- a/sd/source/filter/eppt/eppt.cxx
+++ b/sd/source/filter/eppt/eppt.cxx
@@ -50,6 +50,11 @@
#include <com/sun/star/view/PaperOrientation.hpp>
#include <com/sun/star/view/PaperFormat.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/office/XAnnotation.hpp>
+#include <com/sun/star/office/XAnnotationAccess.hpp>
+#include <com/sun/star/office/XAnnotationEnumeration.hpp>
+#include <com/sun/star/geometry/RealPoint2D.hpp>
+#include <com/sun/star/util/DateTime.hpp>
#include <tools/zcodec.hxx>
#include <svx/svxenum.hxx>
#include <sot/storinfo.hxx>
@@ -402,17 +407,17 @@ void PPTWriter::ImplCreateHeaderFooterStrings( SvStream& rStrm, ::com::sun::star
if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "HeaderText" ) ), sal_True ) )
{
if ( aAny >>= aString )
- ImplWriteCString( rStrm, aString, 1 );
+ PPTWriter::WriteCString( rStrm, aString, 1 );
}
if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FooterText" ) ), sal_True ) )
{
if ( aAny >>= aString )
- ImplWriteCString( rStrm, aString, 2 );
+ PPTWriter::WriteCString( rStrm, aString, 2 );
}
if ( PropValue::GetPropertyValue( aAny, rXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "DateTimeText" ) ), sal_True ) )
{
if ( aAny >>= aString )
- ImplWriteCString( rStrm, aString, 0 );
+ PPTWriter::WriteCString( rStrm, aString, 0 );
}
}
}
@@ -1206,6 +1211,93 @@ sal_Bool PPTWriter::ImplCreateMainNotes()
// ---------------------------------------------------------------------------------------------
+static rtl::OUString getInitials( const rtl::OUString& rName )
+{
+ rtl::OUString sInitials;
+
+ const sal_Unicode * pStr = rName.getStr();
+ sal_Int32 nLength = rName.getLength();
+
+ while( nLength )
+ {
+ // skip whitespace
+ while( nLength && (*pStr <= ' ') )
+ {
+ nLength--; pStr++;
+ }
+
+ // take letter
+ if( nLength )
+ {
+ sInitials += rtl::OUString( *pStr );
+ nLength--; pStr++;
+ }
+
+ // skip letters until whitespace
+ while( nLength && (*pStr > ' ') )
+ {
+ nLength--; pStr++;
+ }
+ }
+
+ return sInitials;
+}
+
+void ImplExportComments( uno::Reference< drawing::XDrawPage > xPage, SvMemoryStream& rBinaryTagData10Atom )
+{
+ try
+ {
+ uno::Reference< office::XAnnotationAccess > xAnnotationAccess( xPage, uno::UNO_QUERY_THROW );
+ uno::Reference< office::XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() );
+
+ sal_Int32 nIndex = 1;
+
+ while( xAnnotationEnumeration->hasMoreElements() )
+ {
+ EscherExContainer aComment10( rBinaryTagData10Atom, EPP_Comment10 );
+ {
+ uno::Reference< office::XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement() );
+
+ geometry::RealPoint2D aRealPoint2D( xAnnotation->getPosition() );
+ MapMode aMapDest( MAP_INCH, Point(), Fraction( 1, 576 ), Fraction( 1, 576 ) );
+ Point aPoint( OutputDevice::LogicToLogic( Point( static_cast< sal_Int32 >( aRealPoint2D.X * 100.0 ),
+ static_cast< sal_Int32 >( aRealPoint2D.Y * 100.0 ) ), MAP_100TH_MM, aMapDest ) );
+
+ rtl::OUString sAuthor( xAnnotation->getAuthor() );
+ uno::Reference< text::XText > xText( xAnnotation->getTextRange() );
+ rtl::OUString sText( xText->getString() );
+ rtl::OUString sInitials( getInitials( sAuthor ) );
+ util::DateTime aDateTime( xAnnotation->getDateTime() );
+ if ( sAuthor.getLength() )
+ PPTWriter::WriteCString( rBinaryTagData10Atom, sAuthor, 0 );
+ if ( sText.getLength() )
+ PPTWriter::WriteCString( rBinaryTagData10Atom, sText, 1 );
+ if ( sInitials.getLength() )
+ PPTWriter::WriteCString( rBinaryTagData10Atom, sInitials, 2 );
+
+ sal_Int16 nMilliSeconds = aDateTime.HundredthSeconds * 10;
+ EscherExAtom aCommentAtom10( rBinaryTagData10Atom, EPP_CommentAtom10 );
+ rBinaryTagData10Atom << nIndex++
+ << aDateTime.Year
+ << aDateTime.Month
+ << aDateTime.Day // todo: day of week
+ << aDateTime.Day
+ << aDateTime.Hours
+ << aDateTime.Minutes
+ << aDateTime.Seconds
+ << nMilliSeconds
+ << static_cast< sal_Int32 >( aPoint.X() )
+ << static_cast< sal_Int32 >( aPoint.Y() );
+ }
+ }
+ }
+ catch ( uno::Exception& )
+ {
+ }
+}
+
+// ---------------------------------------------------------------------------------------------
+
sal_Bool PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum )
{
::com::sun::star::uno::Any aAny;
@@ -1567,6 +1659,49 @@ sal_Bool PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum )
mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 1 );
*mpStrm << (sal_uInt32)0xffffff << (sal_uInt32)0x000000 << (sal_uInt32)0x808080 << (sal_uInt32)0x000000 << (sal_uInt32)0x99cc00 << (sal_uInt32)0xcc3333 << (sal_uInt32)0xffcccc << (sal_uInt32)0xb2b2b2;
+ SvMemoryStream aBinaryTagData10Atom;
+ ImplExportComments( mXDrawPage, aBinaryTagData10Atom );
+ if ( mbUseNewAnimations )
+ {
+ SvMemoryStream amsofbtAnimGroup;
+ ppt::AnimationExporter aExporter( aSolverContainer, maSoundCollection );
+ aExporter.doexport( mXDrawPage, amsofbtAnimGroup );
+ sal_uInt32 nmsofbtAnimGroupSize = amsofbtAnimGroup.Tell();
+ if ( nmsofbtAnimGroupSize )
+ {
+ {
+ EscherExAtom aMagic2( aBinaryTagData10Atom, 0x2eeb );
+ aBinaryTagData10Atom << (sal_uInt32)0x01c45df9
+ << (sal_uInt32)0xe1471b30;
+ }
+ {
+ EscherExAtom aMagic( aBinaryTagData10Atom, 0x2b00 );
+ aBinaryTagData10Atom << (sal_uInt32)0;
+ }
+ aBinaryTagData10Atom.Write( amsofbtAnimGroup.GetData(), amsofbtAnimGroup.Tell() );
+ {
+ EscherExContainer aMagic2( aBinaryTagData10Atom, 0x2b02 );
+ }
+ }
+ }
+ if ( aBinaryTagData10Atom.Tell() )
+ {
+ EscherExContainer aProgTags ( *mpStrm, EPP_ProgTags );
+ EscherExContainer aProgBinaryTag( *mpStrm, EPP_ProgBinaryTag );
+ {
+ EscherExAtom aCString( *mpStrm, EPP_CString );
+ *mpStrm << (sal_uInt32)0x5f005f
+ << (sal_uInt32)0x50005f
+ << (sal_uInt32)0x540050
+ << (sal_uInt16)0x31
+ << (sal_uInt16)0x30;
+ }
+ {
+ EscherExAtom aBinaryTagData( *mpStrm, EPP_BinaryTagData );
+ mpStrm->Write( aBinaryTagData10Atom.GetData(), aBinaryTagData10Atom.Tell() );
+ }
+ }
+/*
if ( mbUseNewAnimations )
{
SvMemoryStream amsofbtAnimGroup;
@@ -1605,6 +1740,7 @@ sal_Bool PPTWriter::ImplCreateSlide( sal_uInt32 nPageNum )
}
}
}
+*/
mpPptEscherEx->CloseContainer(); // EPP_Slide
return TRUE;
};
@@ -1722,18 +1858,6 @@ void PPTWriter::ImplWriteBackground( ::com::sun::star::uno::Reference< ::com::su
mpPptEscherEx->CloseContainer(); // ESCHER_SpContainer
}
-void PPTWriter::ImplWriteCString( SvStream& rSt, const String& rString, sal_uInt32 nInstance )
-{
- sal_uInt32 i, nLen = rString.Len();
- if ( nLen )
- {
- rSt << (sal_uInt32)( ( nInstance << 4 ) | ( EPP_CString << 16 ) )
- << (sal_uInt32)( nLen << 1 );
- for ( i = 0; i < nLen; i++ )
- rSt << rString.GetChar( (sal_uInt16)i );
- }
-}
-
void PPTWriter::ImplWriteVBA( SvMemoryStream* pVBA )
{
if ( pVBA )
diff --git a/sd/source/filter/eppt/eppt.hxx b/sd/source/filter/eppt/eppt.hxx
index 8bf1b84bcd07..84b64e33157c 100644
--- a/sd/source/filter/eppt/eppt.hxx
+++ b/sd/source/filter/eppt/eppt.hxx
@@ -775,6 +775,9 @@ class PPTWriter : public GroupTable, public PropValue, public PPTExBulletProvide
sal_uInt32 ImplDocumentListContainer( SvStream* pOutStrm = NULL );
sal_uInt32 ImplMasterSlideListContainer( SvStream* pOutStrm = NULL );
+ public:
+ static void WriteCString( SvStream&, const String&, sal_uInt32 nInstance = 0 );
+
protected:
sal_Bool ImplCreateDocumentSummaryInformation( sal_uInt32 nCnvrtFlags );
@@ -835,7 +838,6 @@ class PPTWriter : public GroupTable, public PropValue, public PPTExBulletProvide
Rectangle ImplMapRectangle( const ::com::sun::star::awt::Rectangle& );
sal_Bool ImplCloseDocument(); // die font-, hyper-, Soundliste wird geschrieben ..
- void ImplWriteCString( SvStream&, const String&, sal_uInt32 nInstance = 0 );
public:
PPTWriter( SvStorageRef& rSvStorage,
diff --git a/sd/source/filter/eppt/epptdef.hxx b/sd/source/filter/eppt/epptdef.hxx
index 788b668e14ba..f0b4460f9db0 100644
--- a/sd/source/filter/eppt/epptdef.hxx
+++ b/sd/source/filter/eppt/epptdef.hxx
@@ -214,6 +214,9 @@
#define EPP_GscalingAtom 10001
#define EPP_GrColorAtom 10002
#define EPP_GLPointAtom 10003
+#define EPP_Comment10 12000
+#define EPP_CommentAtom10 12001
+
#define EPP_PLACEHOLDER_NONE 0 // 0 None
#define EPP_PLACEHOLDER_MASTERTITLE 1 // 1 Master title
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 55f7f2064815..75e5a4ba3227 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -4605,11 +4605,11 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
}
}
if ( aControlName.Len() )
- ImplWriteCString( *mpExEmbed, aControlName, 1 );
+ PPTWriter::WriteCString( *mpExEmbed, aControlName, 1 );
if ( aOleIdentifier.Len() )
- ImplWriteCString( *mpExEmbed, aOleIdentifier, 2 );
+ PPTWriter::WriteCString( *mpExEmbed, aOleIdentifier, 2 );
if ( aUserName.Len() )
- ImplWriteCString( *mpExEmbed, aUserName, 3 );
+ PPTWriter::WriteCString( *mpExEmbed, aUserName, 3 );
}
nSize = mpExEmbed->Tell() - nOldPos;
mpExEmbed->Seek( nOldPos - 4 );
@@ -5094,9 +5094,9 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
<< (sal_uInt32)0
<< (sal_uInt32)0x0012b600;
-// ImplWriteCString( *mpExEmbed, "Photo Editor Photo", 1 );
-// ImplWriteCString( *mpExEmbed, "MSPhotoEd.3", 2 );
-// ImplWriteCString( *mpExEmbed, "Microsoft Photo Editor 3.0 Photo", 3 );
+// PPTWriter::WriteCString( *mpExEmbed, "Photo Editor Photo", 1 );
+// PPTWriter::WriteCString( *mpExEmbed, "MSPhotoEd.3", 2 );
+// PPTWriter::WriteCString( *mpExEmbed, "Microsoft Photo Editor 3.0 Photo", 3 );
nSize = mpExEmbed->Tell() - nOldPos;
mpExEmbed->Seek( nOldPos - 4 );
@@ -5573,6 +5573,18 @@ void PPTWriter::ImplCreateCellBorder( const CellBorder* pCellBorder, sal_Int32 n
}
}
+void PPTWriter::WriteCString( SvStream& rSt, const String& rString, sal_uInt32 nInstance )
+{
+ sal_uInt32 i, nLen = rString.Len();
+ if ( nLen )
+ {
+ rSt << (sal_uInt32)( ( nInstance << 4 ) | ( EPP_CString << 16 ) )
+ << (sal_uInt32)( nLen << 1 );
+ for ( i = 0; i < nLen; i++ )
+ rSt << rString.GetChar( (sal_uInt16)i );
+ }
+}
+
void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, EscherSolverContainer& aSolverContainer,
EscherPropertyContainer& aPropOpt )
{
diff --git a/sd/source/filter/eppt/makefile.mk b/sd/source/filter/eppt/makefile.mk
index 66571bf649bf..3b968073f0ce 100644
--- a/sd/source/filter/eppt/makefile.mk
+++ b/sd/source/filter/eppt/makefile.mk
@@ -51,29 +51,6 @@ SLOFILES = $(SLO)$/eppt.obj \
$(SLO)$/pptexanimations.obj \
$(SLO)$/pptexsoundcollection.obj
-SHL1TARGET = emp$(DLLPOSTFIX)
-SHL1IMPLIB = eppt
-SHL1VERSIONMAP=exports.map
-SHL1DEF = $(MISC)$/$(SHL1TARGET).def
-SHL1LIBS = $(SLB)$/eppt.lib
-
-DEF1NAME=$(SHL1TARGET)
-
-SHL1STDLIBS = $(SVXLIB) \
- $(SFX2LIB) \
- $(SVTOOLLIB) \
- $(SOTLIB) \
- $(GOODIESLIB) \
- $(VCLLIB) \
- $(SOTLIB) \
- $(UNOTOOLSLIB) \
- $(TOOLSLIB) \
- $(UCBHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB) \
- $(COMPHELPERLIB) \
- $(I18NISOLANGLIB)
-
# --- Targets --------------------------------------------------------------
.INCLUDE : target.mk
diff --git a/sd/source/filter/makefile.mk b/sd/source/filter/makefile.mk
index 5183c471c59c..969893af6863 100644
--- a/sd/source/filter/makefile.mk
+++ b/sd/source/filter/makefile.mk
@@ -48,8 +48,6 @@ CDEFS+= -DDBG_ANIM_LOG
SLOFILES =\
$(SLO)$/sdfilter.obj \
- $(SLO)$/pptin.obj \
- $(SLO)$/propread.obj \
$(SLO)$/sdpptwrp.obj
EXCEPTIONSFILES= \
diff --git a/sd/source/filter/ppt/makefile.mk b/sd/source/filter/ppt/makefile.mk
index 2587edf33c17..a0a55b4e977b 100644
--- a/sd/source/filter/ppt/makefile.mk
+++ b/sd/source/filter/ppt/makefile.mk
@@ -33,6 +33,7 @@ PRJ=..$/..$/..
PRJNAME=sd
TARGET=ppt
ENABLE_EXCEPTIONS=TRUE
+VISIBILITY_HIDDEN=TRUE
# --- Settings -----------------------------------------------------
@@ -48,8 +49,10 @@ CDEFS+= -DDBG_ANIM_LOG
# --- Files --------------------------------------------------------
SLOFILES = \
- $(SLO)$/pptinanimations.obj\
- $(SLO)$/pptatom.obj\
+ $(SLO)$/propread.obj \
+ $(SLO)$/pptin.obj \
+ $(SLO)$/pptinanimations.obj \
+ $(SLO)$/pptatom.obj \
$(SLO)$/ppt97animations.obj
# --- Targets --------------------------------------------------------------
diff --git a/sd/source/filter/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 740c6df9f7c7..b13935699b0f 100644
--- a/sd/source/filter/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -33,14 +33,10 @@
#include <svx/numitem.hxx>
-#ifndef _UNOTOOLS_UCBSTREAMHELPER_HXX
#include <unotools/ucbstreamhelper.hxx>
-#endif
#include <vcl/wrkwin.hxx>
-#ifndef _SVXIDS_HRC
-#include <svx/svxids.hrc>
-#endif
#include <svtools/urihelper.hxx>
+#include <svx/svxids.hrc>
#include <svx/svdfppt.hxx>
#include <svx/svditer.hxx>
#include <sfx2/docfile.hxx>
@@ -81,22 +77,18 @@
#include <svx/numitem.hxx>
#include <svtools/itempool.hxx>
#include <svx/fhgtitem.hxx>
-#ifndef _SVX_SVDOPAGE
#include <svx/svdopage.hxx>
-#endif
#include <svx/svdomedia.hxx>
#include <svx/svdogrp.hxx>
-#include <propread.hxx>
+#include "propread.hxx"
#include <cusshow.hxx>
#include <vcl/bmpacc.hxx>
-#include "../ui/inc/DrawDocShell.hxx"
-#include <../ui/inc/FrameView.hxx>
-#include <../ui/inc/optsitem.hxx>
+#include "../../ui/inc/DrawDocShell.hxx"
+#include "../../ui/inc/FrameView.hxx"
+#include "../../ui/inc/optsitem.hxx"
-#ifndef _OFA_FLTRCFG_HXX
#include <svtools/fltrcfg.hxx>
-#endif
#include <sfx2/progress.hxx>
#include <unotools/localfilehelper.hxx>
#include <svx/editstat.hxx>
@@ -104,8 +96,8 @@
#include <sfx2/docfac.hxx>
#define MAX_USER_MOVE 2
-#include <ppt/pptinanimations.hxx>
-#include <ppt/ppt97animations.hxx>
+#include "pptinanimations.hxx"
+#include "ppt97animations.hxx"
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
@@ -157,7 +149,7 @@ SdPPTImport::SdPPTImport( SdDrawDocument* pDocument, SvStream& rDocStream, SvSto
if( pDocument )
{
// iterate over all styles
- SdStyleSheetPool* pStyleSheetPool = dynamic_cast< SdStyleSheetPool* >( pDocument->GetStyleSheetPool() );
+ SdStyleSheetPool* pStyleSheetPool = pDocument->GetSdStyleSheetPool();
sal_uInt32 nStyles = pStyleSheetPool ? pStyleSheetPool->GetStyles().size() : 0;
for (sal_uInt32 nStyle = 0; nStyle < nStyles; nStyle++)
@@ -521,22 +513,6 @@ sal_Bool ImplSdPPTImport::Import()
pHyperlink->aConvSubString.Append( mpDoc->CreatePageNumValue( (USHORT)nPageNumber + 1 ) );
}
}
- else // searching for "FIRST" or "LAST" page
- {
- for ( nToken = 0; nToken < nTokenCount; nToken++ )
- {
- if ( aStringAry[ nToken ] == "FIRST" )
- {
- pHyperlink->aConvSubString = String( RTL_CONSTASCII_USTRINGPARAM( "action?jump=firstslide" ) );
- break;
- }
- else if ( aStringAry[ nToken ] == "LAST" )
- {
- pHyperlink->aConvSubString = String( RTL_CONSTASCII_USTRINGPARAM( "action?jump=lastslide" ) );
- break;
- }
- }
- }
}
aHyperList.Insert( pHyperlink, LIST_APPEND );
}
@@ -2615,13 +2591,13 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
// Animationseffekte des Objektes lesen
if ( pObj )
{
- // further setup placeholder objects
- if( pObj->ISA(SdrPageObj) && pData )
- {
- const ProcessData* pProcessData=(const ProcessData*)pData;
- if( pProcessData->pPage )
- pProcessData->pPage->InsertPresObj( pObj, PRESOBJ_PAGE );
- }
+ // further setup placeholder objects
+ if( pObj->ISA(SdrPageObj) && pData )
+ {
+ const ProcessData* pProcessData=(const ProcessData*)pData;
+ if( pProcessData->pPage )
+ pProcessData->pPage->InsertPresObj( pObj, PRESOBJ_PAGE );
+ }
BOOL bInhabitanceChecked = FALSE;
BOOL bAnimationInfoFound = FALSE;
@@ -2764,3 +2740,24 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
return pObj;
}
+// ---------------------
+// - exported function -
+// ---------------------
+
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL ImportPPT( const ::rtl::OUString& rConfigPath,
+ uno::Sequence< beans::PropertyValue >* pConfigData,
+ SdDrawDocument* pDocument, SvStream& rDocStream, SvStorage& rStorage, SfxMedium& rMedium )
+{
+ sal_Bool bRet = sal_False;
+
+ MSFilterTracer aTracer( rConfigPath, pConfigData );
+ aTracer.StartTracing();
+
+ SdPPTImport* pImport = new SdPPTImport( pDocument, rDocStream, rStorage, rMedium, &aTracer );
+ bRet = pImport->Import();
+
+ aTracer.EndTracing();
+ delete pImport;
+
+ return bRet;
+}
diff --git a/sd/source/filter/pptin.hxx b/sd/source/filter/ppt/pptin.hxx
index 59d59eece151..59d59eece151 100644
--- a/sd/source/filter/pptin.hxx
+++ b/sd/source/filter/ppt/pptin.hxx
diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index 930650396cdb..1dabd27800d8 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -75,7 +75,7 @@
#include <svx/editobj.hxx>
#include <pptinanimations.hxx>
#include <pptatom.hxx>
-#include "../pptin.hxx"
+#include "pptin.hxx"
#include <algorithm>
using ::std::map;
diff --git a/sd/source/filter/propread.cxx b/sd/source/filter/ppt/propread.cxx
index e6c12afe805e..e6c12afe805e 100644
--- a/sd/source/filter/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
diff --git a/sd/source/filter/propread.hxx b/sd/source/filter/ppt/propread.hxx
index 93f7d29f947d..93f7d29f947d 100644
--- a/sd/source/filter/propread.hxx
+++ b/sd/source/filter/ppt/propread.hxx
diff --git a/sd/source/filter/sdfilter.cxx b/sd/source/filter/sdfilter.cxx
index e56f24ca6a14..3507a71526cf 100644
--- a/sd/source/filter/sdfilter.cxx
+++ b/sd/source/filter/sdfilter.cxx
@@ -32,10 +32,10 @@
#include "precompiled_sd.hxx"
#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
+#include <memory>
+
#include <tools/debug.hxx>
-#include <osl/file.hxx>
#include <osl/module.hxx>
-#include <svtools/pathoptions.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/progress.hxx>
@@ -90,22 +90,13 @@ SdFilter::~SdFilter()
// -----------------------------------------------------------------------------
+extern "C" { static void SAL_CALL thisModule() {} }
+
::osl::Module* SdFilter::OpenLibrary( const ::rtl::OUString& rLibraryName ) const
{
- ::rtl::OUString aDest;
- ::rtl::OUString aNormalizedPath;
- ::osl::Module* pRet;
-
- if ( ::osl::FileBase::getFileURLFromSystemPath( SvtPathOptions().GetModulePath(), aDest ) != ::osl::FileBase::E_None )
- aDest = SvtPathOptions().GetModulePath();
- aDest += ::rtl::OUString( sal_Unicode( '/' ) );
- aDest += ::rtl::OUString( ImplGetFullLibraryName( rLibraryName ) );
- ::osl::FileBase::getSystemPathFromFileURL( aDest, aNormalizedPath );
-
- if( !( pRet = new ::osl::Module( aNormalizedPath ) )->is() )
- delete pRet, pRet = NULL;
-
- return pRet;
+ std::auto_ptr< osl::Module > mod(new osl::Module);
+ return mod->loadRelative(&thisModule, ImplGetFullLibraryName(rLibraryName))
+ ? mod.release() : 0;
}
// -----------------------------------------------------------------------------
diff --git a/sd/source/filter/sdpptwrp.cxx b/sd/source/filter/sdpptwrp.cxx
index 01e38996d2c2..8c1674dbf789 100644
--- a/sd/source/filter/sdpptwrp.cxx
+++ b/sd/source/filter/sdpptwrp.cxx
@@ -40,7 +40,7 @@
#include <svtools/fltrcfg.hxx>
#include "sdpptwrp.hxx"
-#include "pptin.hxx"
+#include "ppt/pptin.hxx"
#include "drawdoc.hxx"
#include <tools/urlobj.hxx>
#include <svx/msfiltertracer.hxx>
@@ -60,6 +60,9 @@ typedef BOOL ( __LOADONCALLAPI *ExportPPT )( SvStorageRef&,
Reference< XStatusIndicator > &,
SvMemoryStream*, sal_uInt32 nCnvrtFlags );
+typedef sal_Bool ( SAL_CALL *ImportPPT )( const ::rtl::OUString&, Sequence< PropertyValue >*,
+ SdDrawDocument*, SvStream&, SvStorage&, SfxMedium& );
+
// ---------------
// - SdPPTFilter -
// ---------------
@@ -111,16 +114,18 @@ sal_Bool SdPPTFilter::Import()
mrMedium.SetError( ERRCODE_SVX_READ_FILTER_PPOINT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
else
{
- MSFilterTracer aTracer( aTraceConfigPath, &aConfigData );
- aTracer.StartTracing();
-
- SdPPTImport* pImport = new SdPPTImport( &mrDocument, *pDocStream, *pStorage, mrMedium, &aTracer );
- if ( ( bRet = pImport->Import() ) == sal_False )
- mrMedium.SetError( SVSTREAM_WRONGVERSION, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
+ ::osl::Module* pLibrary = OpenLibrary( mrMedium.GetFilter()->GetUserData() );
+ if ( pLibrary )
+ {
+ ImportPPT PPTImport = reinterpret_cast< ImportPPT >( pLibrary->getFunctionSymbol( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ImportPPT" ) ) ) );
+ if ( PPTImport )
+ bRet = PPTImport( aTraceConfigPath, &aConfigData, &mrDocument, *pDocStream, *pStorage, mrMedium );
- aTracer.EndTracing();
- delete pImport;
+ if ( !bRet )
+ mrMedium.SetError( SVSTREAM_WRONGVERSION, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
+ }
}
+
delete pDocStream;
}
}
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index f07ba9974001..6f9e0d7b71da 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -265,6 +265,24 @@ sal_Int32 ReadThroughComponent(
}
catch( xml::sax::SAXParseException& r )
{
+ // sax parser sends wrapped exceptions,
+ // try to find the original one
+ xml::sax::SAXException aSaxEx = *(xml::sax::SAXException*)(&r);
+ sal_Bool bTryChild = sal_True;
+
+ while( bTryChild )
+ {
+ xml::sax::SAXException aTmp;
+ if ( aSaxEx.WrappedException >>= aTmp )
+ aSaxEx = aTmp;
+ else
+ bTryChild = sal_False;
+ }
+
+ packages::zip::ZipIOException aBrokenPackage;
+ if ( aSaxEx.WrappedException >>= aBrokenPackage )
+ return ERRCODE_IO_BROKENPACKAGE;
+
if( bEncrypted )
return ERRCODE_SFX_WRONGPASSWORD;
@@ -295,7 +313,10 @@ sal_Int32 ReadThroughComponent(
}
catch( xml::sax::SAXException& r )
{
- (void)r;
+ packages::zip::ZipIOException aBrokenPackage;
+ if ( r.WrappedException >>= aBrokenPackage )
+ return ERRCODE_IO_BROKENPACKAGE;
+
if( bEncrypted )
return ERRCODE_SFX_WRONGPASSWORD;
diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
index 0d16030074db..38350f246bf1 100644
--- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
+++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
@@ -33,6 +33,7 @@
#include "AccessibleDrawDocumentView.hxx"
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/drawing/XDrawView.hpp>
+#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/frame/XController.hpp>
@@ -73,12 +74,15 @@
#include "sdresid.hxx"
#include <vos/mutex.hxx>
-using namespace ::rtl;
+using ::rtl::OUString;
using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::accessibility;
class SfxViewFrame;
+#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
+
namespace accessibility {
@@ -93,6 +97,7 @@ AccessibleDrawDocumentView::AccessibleDrawDocumentView (
mpChildrenManager (NULL)
{
OSL_TRACE ("AccessibleDrawDocumentView");
+ UpdateAccessibleName();
}
@@ -310,6 +315,9 @@ void SAL_CALL
{
OSL_TRACE (" current page changed");
+ // Update the accessible name to reflect the current slide.
+ UpdateAccessibleName();
+
// The current page changed. Update the children manager accordingly.
uno::Reference<drawing::XDrawView> xView (mxController, uno::UNO_QUERY);
if (xView.is() && mpChildrenManager!=NULL)
@@ -701,4 +709,46 @@ void SAL_CALL AccessibleDrawDocumentView::disposing (void)
+void AccessibleDrawDocumentView::UpdateAccessibleName (void)
+{
+ OUString sNewName (CreateAccessibleName());
+ sNewName += A2S(": ");
+
+ // Add the number of the current slide.
+ uno::Reference<drawing::XDrawView> xView (mxController, uno::UNO_QUERY);
+ if (xView.is())
+ {
+ uno::Reference<beans::XPropertySet> xProperties (xView->getCurrentPage(), UNO_QUERY);
+ if (xProperties.is())
+ try
+ {
+ sal_Int16 nPageNumber (0);
+ if (xProperties->getPropertyValue(A2S("Number")) >>= nPageNumber)
+ {
+ sNewName += OUString::valueOf(sal_Int32(nPageNumber));
+ }
+ }
+ catch (beans::UnknownPropertyException&)
+ {
+ }
+ }
+
+ // Add the number of pages/slides.
+ Reference<drawing::XDrawPagesSupplier> xPagesSupplier (mxModel, UNO_QUERY);
+ if (xPagesSupplier.is())
+ {
+ Reference<container::XIndexAccess> xPages (xPagesSupplier->getDrawPages(), UNO_QUERY);
+ if (xPages.is())
+ {
+ sNewName += A2S(" / ");
+ sNewName += OUString::valueOf(xPages->getCount());
+ }
+ }
+
+ SetAccessibleName (sNewName, AutomaticallyCreated);
+}
+
+
+
+
} // end of namespace accessibility
diff --git a/sd/source/ui/accessibility/AccessiblePageShape.cxx b/sd/source/ui/accessibility/AccessiblePageShape.cxx
index 6ff2266ff017..051b5090983f 100644
--- a/sd/source/ui/accessibility/AccessiblePageShape.cxx
+++ b/sd/source/ui/accessibility/AccessiblePageShape.cxx
@@ -47,8 +47,12 @@
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::accessibility;
using ::com::sun::star::uno::Reference;
+using ::rtl::OUString;
+
+#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
namespace accessibility {
@@ -342,7 +346,22 @@ void AccessiblePageShape::dispose (void)
AccessiblePageShape::CreateAccessibleName (void)
throw (::com::sun::star::uno::RuntimeException)
{
- return CreateAccessibleBaseName();
+ Reference<beans::XPropertySet> xPageProperties (mxPage, UNO_QUERY);
+
+ // Get name of the current slide.
+ OUString sCurrentSlideName;
+ try
+ {
+ if (xPageProperties.is())
+ {
+ xPageProperties->getPropertyValue(A2S("LinkDisplayName")) >>= sCurrentSlideName;
+ }
+ }
+ catch (beans::UnknownPropertyException&)
+ {
+ }
+
+ return CreateAccessibleBaseName()+A2S(": ")+sCurrentSlideName;
}
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
new file mode 100644
index 000000000000..bbc9bbd539f3
--- /dev/null
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -0,0 +1,1276 @@
+/*************************************************************************
+ *
+ * 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: AnnotationManagerImpl.cxx,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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sd.hxx"
+
+#include "sddll.hxx"
+
+//#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/beans/XMultiPropertyStates.hpp>
+#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/geometry/RealPoint2D.hpp>
+#include <com/sun/star/text/XText.hpp>
+#include <com/sun/star/document/XEventBroadcaster.hpp>
+
+#include <vcl/menu.hxx>
+#include <vcl/msgbox.hxx>
+
+#include <svtools/style.hxx>
+#include <svtools/itempool.hxx>
+#include <svtools/useroptions.hxx>
+#include <svtools/syslocale.hxx>
+#include <svtools/saveopt.hxx>
+
+#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 <sfx2/objface.hxx>
+#include <sfx2/imagemgr.hxx>
+
+#include <svx/editeng.hxx>
+#include <svx/eeitem.hxx>
+#include <svx/fontitem.hxx>
+#include <svx/fhgtitem.hxx>
+#include <svx/outlobj.hxx>
+#include <svx/postitem.hxx>
+#include <svx/wghtitem.hxx>
+#include <svx/udlnitem.hxx>
+#include <svx/crsditem.hxx>
+
+#include <svx/svdetc.hxx>
+
+#include "annotationmanager.hxx"
+#include "annotationmanagerimpl.hxx"
+#include "annotationwindow.hxx"
+#include "annotations.hrc"
+
+#include "ToolBarManager.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 "textapi.hxx"
+#include "optsitem.hxx"
+
+#define C2U(x) OUString( RTL_CONSTASCII_USTRINGPARAM( x ) )
+using ::rtl::OUString;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::geometry;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::view;
+using namespace ::com::sun::star::style;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::ui;
+using namespace ::com::sun::star::task;
+using namespace ::com::sun::star::office;
+
+namespace sd {
+
+// --------------------------------------------------------------------
+
+extern TextApiObject* getTextApiObject( const Reference< XAnnotation >& xAnnotation );
+
+// --------------------------------------------------------------------
+
+SfxItemPool* GetAnnotationPool()
+{
+ static SfxItemPool* mpAnnotationPool = 0;
+ if( mpAnnotationPool == 0 )
+ {
+ mpAnnotationPool = EditEngine::CreatePool( sal_False );
+ mpAnnotationPool->SetPoolDefaultItem(SvxFontHeightItem(423,100,EE_CHAR_FONTHEIGHT));
+
+ Font aAppFont( Application::GetSettings().GetStyleSettings().GetAppFont() );
+ String EMPTYSTRING;
+ mpAnnotationPool->SetPoolDefaultItem(SvxFontItem(aAppFont.GetFamily(),aAppFont.GetName(), EMPTYSTRING,PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO));
+ }
+
+ return mpAnnotationPool;
+}
+
+// --------------------------------------------------------------------
+
+static SfxBindings* getBindings( ViewShellBase& rBase )
+{
+ if( rBase.GetMainViewShell().get() && rBase.GetMainViewShell()->GetViewFrame() )
+ return &rBase.GetMainViewShell()->GetViewFrame()->GetBindings();
+ else
+ return 0;
+}
+
+// --------------------------------------------------------------------
+
+static SfxDispatcher* getDispatcher( ViewShellBase& rBase )
+{
+ if( rBase.GetMainViewShell().get() && rBase.GetMainViewShell()->GetViewFrame() )
+ return rBase.GetMainViewShell()->GetViewFrame()->GetDispatcher();
+ else
+ return 0;
+}
+
+com::sun::star::util::DateTime getCurrentDateTime()
+{
+ TimeValue osltime;
+ osl_getSystemTime( &osltime );
+ oslDateTime osldt;
+ osl_getDateTimeFromTimeValue( &osltime, &osldt );
+ return com::sun::star::util::DateTime( 0, osldt.Seconds, osldt.Minutes, osldt.Hours, osldt.Day, osldt.Month, osldt.Year );
+}
+
+OUString getAnnotationDateTimeString( const Reference< XAnnotation >& xAnnotation )
+{
+ OUString sRet;
+ if( xAnnotation.is() )
+ {
+ const LocaleDataWrapper& rLocalData = SvtSysLocale().GetLocaleData();
+
+ com::sun::star::util::DateTime aDateTime( xAnnotation->getDateTime() );
+
+ Date aDate = Date( aDateTime.Day, aDateTime.Month, aDateTime.Year );
+ if (aDate==Date())
+ sRet = sRet + String(SdResId(STR_ANNOTATION_TODAY));
+ else
+ if (aDate == Date(Date()-1))
+ sRet = sRet + String(SdResId(STR_ANNOTATION_YESTERDAY));
+ else
+ if (aDate.IsValid() )
+ sRet = sRet + rLocalData.getDate(aDate);
+
+ Time aTime( aDateTime.Hours, aDateTime.Minutes, aDateTime.Seconds, aDateTime.HundredthSeconds );
+ if(aTime.GetTime() != 0)
+ sRet = sRet + rtl::OUString::createFromAscii(" ") + rLocalData.getTime( aTime,false );
+ }
+ return sRet;
+}
+
+// --------------------------------------------------------------------
+
+AnnotationManagerImpl::AnnotationManagerImpl( ViewShellBase& rViewShellBase )
+: AnnotationManagerImplBase( m_aMutex )
+, mrBase( rViewShellBase )
+, mpDoc( rViewShellBase.GetDocument() )
+, mbShowAnnotations( true )
+, mnUpdateTagsEvent( 0 )
+{
+ SdOptions* pOptions = SD_MOD()->GetSdOptions(mpDoc->GetDocumentType());
+ if( pOptions )
+ mbShowAnnotations = pOptions->IsPreviewTransitions() == sal_True;
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::init()
+{
+ // get current controller and initialize listeners
+ try
+ {
+ addListener();
+ mxView = Reference< XDrawView >::query(mrBase.GetController());
+ }
+ catch( Exception& e )
+ {
+ (void)e;
+ DBG_ERROR( "sd::AnnotationManagerImpl::AnnotationManagerImpl(), Exception caught!" );
+ }
+
+ try
+ {
+ Reference<XEventBroadcaster> xModel (mrBase.GetDocShell()->GetModel(), UNO_QUERY_THROW );
+ Reference<XEventListener> xListener( this );
+ xModel->addEventListener( xListener );
+ }
+ catch( Exception& )
+ {
+ }
+}
+
+// --------------------------------------------------------------------
+
+// WeakComponentImplHelper1
+void SAL_CALL AnnotationManagerImpl::disposing ()
+{
+ try
+ {
+ Reference<XEventBroadcaster> xModel (mrBase.GetDocShell()->GetModel(), UNO_QUERY_THROW );
+ Reference<XEventListener> xListener( this );
+ xModel->removeEventListener( xListener );
+ }
+ catch( Exception& )
+ {
+ }
+
+ removeListener();
+ DisposeTags();
+
+ if( mnUpdateTagsEvent )
+ {
+ Application::RemoveUserEvent( mnUpdateTagsEvent );
+ mnUpdateTagsEvent = 0;
+ }
+
+ mxView.clear();
+ mxCurrentPage.clear();
+}
+
+// --------------------------------------------------------------------
+
+// XEventListener
+void SAL_CALL AnnotationManagerImpl::notifyEvent( const ::com::sun::star::document::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException)
+{
+ if( aEvent.EventName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OnAnnotationInserted") ) ||
+ aEvent.EventName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OnAnnotationRemoved") ) ||
+ aEvent.EventName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OnAnnotationChanged" )) )
+ {
+ UpdateTags();
+ }
+}
+
+void SAL_CALL AnnotationManagerImpl::disposing( const ::com::sun::star::lang::EventObject& /*Source*/ ) throw (::com::sun::star::uno::RuntimeException)
+{
+}
+
+void AnnotationManagerImpl::ShowAnnotations( bool bShow )
+{
+ // enforce show annotations if a new annotation is inserted
+ if( mbShowAnnotations != bShow )
+ {
+ mbShowAnnotations = bShow;
+
+ SdOptions* pOptions = SD_MOD()->GetSdOptions(mpDoc->GetDocumentType());
+ if( pOptions )
+ pOptions->SetShowComments( mbShowAnnotations ? sal_True : sal_False );
+
+ UpdateTags();
+ }
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::ExecuteAnnotation(SfxRequest& rReq )
+{
+ switch( rReq.GetSlot() )
+ {
+ case SID_INSERT_POSTIT:
+ ExecuteInsertAnnotation( rReq );
+ break;
+ case SID_DELETE_POSTIT:
+ case SID_DELETEALL_POSTIT:
+ case SID_DELETEALLBYAUTHOR_POSTIT:
+ ExecuteDeleteAnnotation( rReq );
+ break;
+ case SID_PREVIOUS_POSTIT:
+ case SID_NEXT_POSTIT:
+ SelectNextAnnotation( rReq.GetSlot() == SID_NEXT_POSTIT );
+ break;
+ case SID_REPLYTO_POSTIT:
+ ExecuteReplyToAnnotation( rReq );
+ break;
+ case SID_SHOW_POSTIT:
+ ShowAnnotations( !mbShowAnnotations );
+ break;
+ }
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::ExecuteInsertAnnotation(SfxRequest& /*rReq*/)
+{
+ ShowAnnotations(true);
+ InsertAnnotation();
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::ExecuteDeleteAnnotation(SfxRequest& rReq)
+{
+ ShowAnnotations( true );
+
+ const SfxItemSet* pArgs = rReq.GetArgs();
+
+ switch( rReq.GetSlot() )
+ {
+ case SID_DELETEALL_POSTIT:
+ DeleteAllAnnotations();
+ break;
+ case SID_DELETEALLBYAUTHOR_POSTIT:
+ if( pArgs )
+ {
+ const SfxPoolItem* pPoolItem = NULL;
+ if( SFX_ITEM_SET == pArgs->GetItemState( SID_DELETE_POSTIT, TRUE, &pPoolItem ) )
+ {
+ OUString sAuthor( (( const SfxStringItem* ) pPoolItem )->GetValue() );
+ DeleteAnnotationsByAuthor( sAuthor );
+ }
+ }
+ break;
+ case SID_DELETE_POSTIT:
+ {
+ Reference< XAnnotation > xAnnotation;
+
+ if( rReq.GetSlot() == SID_DELETE_POSTIT )
+ {
+ if( pArgs )
+ {
+ const SfxPoolItem* pPoolItem = NULL;
+ if( SFX_ITEM_SET == pArgs->GetItemState( SID_DELETE_POSTIT, TRUE, &pPoolItem ) )
+ ( ( const SfxUnoAnyItem* ) pPoolItem )->GetValue() >>= xAnnotation;
+ }
+ }
+
+ if( !xAnnotation.is() )
+ GetSelectedAnnotation( xAnnotation );
+
+ DeleteAnnotation( xAnnotation );
+ }
+ break;
+ }
+
+ UpdateTags();
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::InsertAnnotation()
+{
+ SdPage* pPage = GetCurrentPage();
+ if( pPage )
+ {
+ if( mpDoc->IsUndoEnabled() )
+ mpDoc->BegUndo( String( SdResId( STR_ANNOTATION_UNDO_INSERT ) ) );
+
+ // find free space for new annotation
+ int y = 0, x = 0;
+
+ AnnotationVector aAnnotations( pPage->getAnnotations() );
+ if( !aAnnotations.empty() )
+ {
+ const int page_width = pPage->GetSize().Width();
+ const int width = 1000;
+ const int height = 800;
+ Rectangle aTagRect;
+
+ while( true )
+ {
+ Rectangle aNewRect( x, y, x + width - 1, y + height - 1 );
+ bool bFree = true;
+
+ for( AnnotationVector::iterator iter = aAnnotations.begin(); iter != aAnnotations.end(); iter++ )
+ {
+ RealPoint2D aPoint( (*iter)->getPosition() );
+ aTagRect.nLeft = sal::static_int_cast< long >( aPoint.X * 100.0 );
+ aTagRect.nTop = sal::static_int_cast< long >( aPoint.Y * 100.0 );
+ aTagRect.nRight = aTagRect.nLeft + width - 1;
+ aTagRect.nBottom = aTagRect.nTop + height - 1;
+
+ if( aNewRect.IsOver( aTagRect ) )
+ {
+ bFree = false;
+ break;
+ }
+ }
+
+ if( bFree == false)
+ {
+ x += width;
+ if( x > page_width )
+ {
+ x = 0;
+ y += height;
+ }
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+
+ Reference< XAnnotation > xAnnotation;
+ pPage->createAnnotation( xAnnotation );
+
+ // set current author to new annotation
+ SvtUserOptions aUserOptions;
+ xAnnotation->setAuthor( aUserOptions.GetFullName() );
+
+ // set current time to new annotation
+ xAnnotation->setDateTime( getCurrentDateTime() );
+
+ // set position
+ RealPoint2D aPos( ((double)x) / 100.0, ((double)y) / 100.0 );
+ xAnnotation->setPosition( aPos );
+
+ if( mpDoc->IsUndoEnabled() )
+ mpDoc->EndUndo();
+
+ UpdateTags(true);
+ SelectAnnotation( xAnnotation, true );
+ }
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest& rReq )
+{
+ Reference< XAnnotation > xAnnotation;
+ const SfxItemSet* pArgs = rReq.GetArgs();
+ if( pArgs )
+ {
+ const SfxPoolItem* pPoolItem = NULL;
+ if( SFX_ITEM_SET == pArgs->GetItemState( rReq.GetSlot(), TRUE, &pPoolItem ) )
+ ( ( const SfxUnoAnyItem* ) pPoolItem )->GetValue() >>= xAnnotation;
+ }
+
+
+ TextApiObject* pTextApi = getTextApiObject( xAnnotation );
+ if( pTextApi )
+ {
+ std::auto_ptr< ::Outliner > pOutliner( new ::Outliner(GetAnnotationPool(),OUTLINERMODE_TEXTOBJECT) );
+
+ mpDoc->SetCalcFieldValueHdl( pOutliner.get() );
+ pOutliner->SetUpdateMode( TRUE );
+
+ String aStr(SdResId(STR_ANNOTATION_REPLY));
+ OUString sAuthor( xAnnotation->getAuthor() );
+ if( sAuthor.getLength() == 0 )
+ sAuthor = String( SdResId( STR_ANNOTATION_NOAUTHOR ) );
+
+ aStr.SearchAndReplaceAscii("%1", sAuthor);
+
+ aStr.Append( String(RTL_CONSTASCII_USTRINGPARAM(" (") ) );
+ aStr.Append( String( getAnnotationDateTimeString( xAnnotation ) ) );
+ aStr.Append( String(RTL_CONSTASCII_USTRINGPARAM("): \"") ) );
+
+ String sQuote( pTextApi->GetText() );
+
+ if( sQuote.Len() == 0 )
+ sQuote = String( RTL_CONSTASCII_USTRINGPARAM( "..." ) );
+ aStr.Append( sQuote );
+ aStr.Append( String(RTL_CONSTASCII_USTRINGPARAM("\"\n") ) );
+
+ USHORT nParaCount = aStr.GetTokenCount( '\n' );
+ for( USHORT nPara = 0; nPara < nParaCount; nPara++ )
+ pOutliner->Insert( aStr.GetToken( nPara, '\n' ), LIST_APPEND, -1 );
+
+ if( pOutliner->GetParagraphCount() > 1 )
+ {
+ SfxItemSet aAnswerSet( pOutliner->GetEmptyItemSet() );
+ aAnswerSet.Put(SvxPostureItem(ITALIC_NORMAL,EE_CHAR_ITALIC));
+
+ ESelection aSel;
+ aSel.nEndPara = (USHORT)pOutliner->GetParagraphCount()-2;
+ aSel.nEndPos = pOutliner->GetText( pOutliner->GetParagraph( aSel.nEndPara ) ).Len();
+
+ pOutliner->QuickSetAttribs( aAnswerSet, aSel );
+ }
+
+ std::auto_ptr< OutlinerParaObject > pOPO( pOutliner->CreateParaObject() );
+ pTextApi->SetText( *pOPO.get() );
+
+ SvtUserOptions aUserOptions;
+ xAnnotation->setAuthor( aUserOptions.GetFullName() );
+
+ // set current time to reply
+ xAnnotation->setDateTime( getCurrentDateTime() );
+
+ UpdateTags(true);
+ SelectAnnotation( xAnnotation, true );
+ }
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::DeleteAnnotation( Reference< XAnnotation > xAnnotation )
+{
+ SdPage* pPage = GetCurrentPage();
+
+ if( xAnnotation.is() && pPage )
+ {
+ if( mpDoc->IsUndoEnabled() )
+ mpDoc->BegUndo( String( SdResId( STR_ANNOTATION_UNDO_DELETE ) ) );
+
+ pPage->removeAnnotation( xAnnotation );
+
+ if( mpDoc->IsUndoEnabled() )
+ mpDoc->EndUndo();
+
+ UpdateTags();
+ }
+}
+
+void AnnotationManagerImpl::DeleteAnnotationsByAuthor( const rtl::OUString& sAuthor )
+{
+ if( mpDoc->IsUndoEnabled() )
+ mpDoc->BegUndo( String( SdResId( STR_ANNOTATION_UNDO_DELETE ) ) );
+
+ SdPage* pPage = 0;
+ do
+ {
+ pPage = GetNextPage( pPage, true );
+
+ if( pPage && !pPage->getAnnotations().empty() )
+ {
+ AnnotationVector aAnnotations( pPage->getAnnotations() );
+ for( AnnotationVector::iterator iter = aAnnotations.begin(); iter != aAnnotations.end(); iter++ )
+ {
+ Reference< XAnnotation > xAnnotation( *iter );
+ if( xAnnotation->getAuthor() == sAuthor )
+ {
+ if( mxSelectedAnnotation == xAnnotation )
+ mxSelectedAnnotation.clear();
+ pPage->removeAnnotation( xAnnotation );
+ }
+ }
+ }
+ } while( pPage );
+
+ if( mpDoc->IsUndoEnabled() )
+ mpDoc->EndUndo();
+}
+
+void AnnotationManagerImpl::DeleteAllAnnotations()
+{
+ if( mpDoc->IsUndoEnabled() )
+ mpDoc->BegUndo( String( SdResId( STR_ANNOTATION_UNDO_DELETE ) ) );
+
+ SdPage* pPage = 0;
+ do
+ {
+ pPage = GetNextPage( pPage, true );
+
+ if( pPage && !pPage->getAnnotations().empty() )
+ {
+
+ AnnotationVector aAnnotations( pPage->getAnnotations() );
+ for( AnnotationVector::iterator iter = aAnnotations.begin(); iter != aAnnotations.end(); iter++ )
+ {
+ pPage->removeAnnotation( (*iter) );
+ }
+ }
+ }
+ while( pPage );
+
+ mxSelectedAnnotation.clear();
+
+ if( mpDoc->IsUndoEnabled() )
+ mpDoc->EndUndo();
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::GetAnnotationState(SfxItemSet& rSet)
+{
+ SdPage* pCurrentPage = GetCurrentPage();
+
+ const bool bReadOnly = mrBase.GetDocShell()->IsReadOnly();
+ const bool bWrongPageKind = (pCurrentPage == 0) || (pCurrentPage->GetPageKind() != PK_STANDARD);
+
+ const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() );
+
+ if( bReadOnly || bWrongPageKind || (nCurrentODFVersion != SvtSaveOptions::ODFVER_LATEST) )
+ rSet.DisableItem( SID_INSERT_POSTIT );
+
+ rSet.Put(SfxBoolItem(SID_SHOW_POSTIT, mbShowAnnotations));
+
+ Reference< XAnnotation > xAnnotation;
+ GetSelectedAnnotation( xAnnotation );
+
+ if( !xAnnotation.is() || bReadOnly )
+ rSet.DisableItem( SID_DELETE_POSTIT );
+
+ SdPage* pPage = 0;
+
+ bool bHasAnnotations = false;
+ do
+ {
+ pPage = GetNextPage( pPage, true );
+
+ if( pPage && !pPage->getAnnotations().empty() )
+ bHasAnnotations = true;
+ }
+ while( pPage && !bHasAnnotations );
+
+ if( !bHasAnnotations || bReadOnly )
+ {
+ rSet.DisableItem( SID_DELETEALL_POSTIT );
+ }
+
+ if( bWrongPageKind || !bHasAnnotations )
+ {
+ rSet.DisableItem( SID_PREVIOUS_POSTIT );
+ rSet.DisableItem( SID_NEXT_POSTIT );
+ }
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::SelectNextAnnotation(bool bForeward)
+{
+ ShowAnnotations( true );
+
+ Reference< XAnnotation > xCurrent;
+ GetSelectedAnnotation( xCurrent );
+ SdPage* pPage = GetCurrentPage();
+ if( !pPage )
+ return;
+
+ AnnotationVector aAnnotations( pPage->getAnnotations() );
+
+ if( bForeward )
+ {
+ if( xCurrent.is() )
+ {
+ for( AnnotationVector::iterator iter = aAnnotations.begin(); iter != aAnnotations.end(); iter++ )
+ {
+ if( (*iter) == xCurrent )
+ {
+ iter++;
+ if( iter != aAnnotations.end() )
+ {
+ SelectAnnotation( (*iter) );
+ return;
+ }
+ break;
+ }
+ }
+ }
+ else if( !aAnnotations.empty() )
+ {
+ SelectAnnotation( *(aAnnotations.begin()) );
+ return;
+ }
+ }
+ else
+ {
+ if( xCurrent.is() )
+ {
+ for( AnnotationVector::iterator iter = aAnnotations.begin(); iter != aAnnotations.end(); iter++ )
+ {
+ if( (*iter) == xCurrent )
+ {
+ if( iter != aAnnotations.begin() )
+ {
+ iter--;
+ SelectAnnotation( (*iter) );
+ return;
+
+ }
+ break;
+ }
+ }
+ }
+ else if( !aAnnotations.empty() )
+ {
+ AnnotationVector::iterator iter( aAnnotations.end() );
+ SelectAnnotation( *(--iter) );
+ return;
+ }
+ }
+
+ mxSelectedAnnotation.clear();
+ do
+ {
+ do
+ {
+ pPage = GetNextPage( pPage, bForeward );
+
+ if( pPage && !pPage->getAnnotations().empty() )
+ {
+ // switch to next/previous slide with annotations
+ ::boost::shared_ptr<DrawViewShell> pDrawViewShell(::boost::dynamic_pointer_cast<DrawViewShell>(mrBase.GetMainViewShell()));
+ if (pDrawViewShell.get() != NULL)
+ {
+ pDrawViewShell->ChangeEditMode(pPage->IsMasterPage() ? EM_MASTERPAGE : EM_PAGE, FALSE);
+ pDrawViewShell->SwitchPage((pPage->GetPageNum() - 1) >> 1);
+
+ SfxDispatcher* pDispatcher = getDispatcher( mrBase );
+ if( pDispatcher )
+ pDispatcher->Execute( bForeward ? SID_NEXT_POSTIT : SID_PREVIOUS_POSTIT );
+
+ return;
+ }
+ }
+ }
+ while( pPage );
+
+ // The question text depends on the search direction.
+ bool bImpress = mpDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS;
+ sal_uInt16 nStringId;
+ if(bForeward)
+ nStringId = bImpress ? STR_ANNOTATION_WRAP_FORWARD : STR_ANNOTATION_WRAP_FORWARD_DRAW;
+ else
+ nStringId = bImpress ? STR_ANNOTATION_WRAP_BACKWARD : STR_ANNOTATION_WRAP_BACKWARD_DRAW;
+
+ // Pop up question box that asks the user whether to wrap arround.
+ // The dialog is made modal with respect to the whole application.
+ QueryBox aQuestionBox (
+ NULL,
+ WB_YES_NO | WB_DEF_YES,
+ String(SdResId(nStringId)));
+ aQuestionBox.SetImage (QueryBox::GetStandardImage());
+ USHORT nBoxResult = aQuestionBox.Execute();
+ if(nBoxResult != BUTTONID_YES)
+ break;
+ }
+ while( true );
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::onTagSelected( AnnotationTag& rTag )
+{
+ mxSelectedAnnotation = rTag.GetAnnotation();
+ invalidateSlots();
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::onTagDeselected( AnnotationTag& rTag )
+{
+ if( rTag.GetAnnotation() == mxSelectedAnnotation )
+ {
+ mxSelectedAnnotation.clear();
+ invalidateSlots();
+ }
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::SelectAnnotation( ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > xAnnotation, bool bEdit /* = FALSE */ )
+{
+ mxSelectedAnnotation = xAnnotation;
+
+ for( AnnotationTagVector::iterator iter( maTagVector.begin() ); iter != maTagVector.end(); iter++ )
+ {
+ if( (*iter)->GetAnnotation() == xAnnotation )
+ {
+ SmartTagReference xTag( (*iter).get() );
+ mrBase.GetMainViewShell()->GetView()->getSmartTags().select( xTag );
+ (*iter)->OpenPopup( bEdit );
+ break;
+ }
+ }
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::GetSelectedAnnotation( ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation >& xAnnotation )
+{
+ xAnnotation = mxSelectedAnnotation;
+}
+
+void AnnotationManagerImpl::invalidateSlots()
+{
+ SfxBindings* pBindings = getBindings( mrBase );
+ if( pBindings )
+ {
+ pBindings->Invalidate( SID_INSERT_POSTIT );
+ pBindings->Invalidate( SID_DELETE_POSTIT );
+ pBindings->Invalidate( SID_DELETEALL_POSTIT );
+ pBindings->Invalidate( SID_PREVIOUS_POSTIT );
+ pBindings->Invalidate( SID_NEXT_POSTIT );
+ pBindings->Invalidate( SID_UNDO );
+ pBindings->Invalidate( SID_REDO );
+ }
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::onSelectionChanged()
+{
+ if( mxView.is() && mrBase.GetDrawView() ) try
+ {
+ Reference< XAnnotationAccess > xPage( mxView->getCurrentPage(), UNO_QUERY );
+
+ if( xPage != mxCurrentPage )
+ {
+ mxCurrentPage = xPage;
+
+ UpdateTags(true);
+ }
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR( "sd::AnnotationManagerImpl::onSelectionChanged(), exception caught!" );
+ }
+}
+
+void AnnotationManagerImpl::UpdateTags( bool bSynchron )
+{
+ if( bSynchron )
+ {
+ if( mnUpdateTagsEvent )
+ Application::RemoveUserEvent( mnUpdateTagsEvent );
+
+ UpdateTagsHdl(0);
+ }
+ else
+ {
+ if( !mnUpdateTagsEvent && mxView.is() )
+ mnUpdateTagsEvent = Application::PostUserEvent( LINK( this, AnnotationManagerImpl, UpdateTagsHdl ) );
+ }
+}
+
+IMPL_LINK(AnnotationManagerImpl,UpdateTagsHdl, void *, EMPTYARG)
+{
+ mnUpdateTagsEvent = 0;
+ DisposeTags();
+
+ if( mbShowAnnotations )
+ CreateTags();
+
+ if( mrBase.GetDrawView() )
+ static_cast< ::sd::View* >( mrBase.GetDrawView() )->updateHandles();
+
+ invalidateSlots();
+
+ return 0;
+}
+
+void AnnotationManagerImpl::CreateTags()
+{
+
+ if( mxCurrentPage.is() && mpDoc ) try
+ {
+ int nIndex = 1;
+ maFont = Application::GetSettings().GetStyleSettings().GetAppFont();
+
+ rtl::Reference< AnnotationTag > xSelectedTag;
+
+ Reference< XAnnotationEnumeration > xEnum( mxCurrentPage->createAnnotationEnumeration() );
+ while( xEnum->hasMoreElements() )
+ {
+ Reference< XAnnotation > xAnnotation( xEnum->nextElement() );
+ Color aColor( GetColorLight( mpDoc->GetAnnotationAuthorIndex( xAnnotation->getAuthor() ) ) );
+ rtl::Reference< AnnotationTag > xTag( new AnnotationTag( *this, *mrBase.GetMainViewShell()->GetView(), xAnnotation, aColor, nIndex++, maFont ) );
+ maTagVector.push_back(xTag);
+
+ if( xAnnotation == mxSelectedAnnotation )
+ {
+ xSelectedTag = xTag;
+ }
+ }
+
+ if( xSelectedTag.is() )
+ {
+ SmartTagReference xTag( xSelectedTag.get() );
+ mrBase.GetMainViewShell()->GetView()->getSmartTags().select( xTag );
+ }
+ else
+ {
+ // no tag, no selection!
+ mxSelectedAnnotation.clear();
+ }
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR( "sd::AnnotationManagerImpl::onSelectionChanged(), exception caught!" );
+ }
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::DisposeTags()
+{
+ if( !maTagVector.empty() )
+ {
+ AnnotationTagVector::iterator iter = maTagVector.begin();
+ do
+ {
+ (*iter++)->Dispose();
+ }
+ while( iter != maTagVector.end() );
+
+ maTagVector.clear();
+ }
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::addListener()
+{
+ Link aLink( LINK(this,AnnotationManagerImpl,EventMultiplexerListener) );
+ mrBase.GetEventMultiplexer()->AddEventListener (
+ aLink,
+ tools::EventMultiplexerEvent::EID_EDIT_VIEW_SELECTION
+ | tools::EventMultiplexerEvent::EID_CURRENT_PAGE
+ | tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED
+ | tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED);
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationManagerImpl::removeListener()
+{
+ Link aLink( LINK(this,AnnotationManagerImpl,EventMultiplexerListener) );
+ mrBase.GetEventMultiplexer()->RemoveEventListener( aLink );
+}
+
+// --------------------------------------------------------------------
+
+IMPL_LINK(AnnotationManagerImpl,EventMultiplexerListener,
+ tools::EventMultiplexerEvent*,pEvent)
+{
+ switch (pEvent->meEventId)
+ {
+ case tools::EventMultiplexerEvent::EID_CURRENT_PAGE:
+ case tools::EventMultiplexerEvent::EID_EDIT_VIEW_SELECTION:
+ onSelectionChanged();
+ break;
+
+ case tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED:
+ mxView = Reference<XDrawView>();
+ onSelectionChanged();
+ break;
+
+ case tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED:
+ mxView = Reference<XDrawView>::query( mrBase.GetController() );
+ onSelectionChanged();
+ break;
+ }
+ return 0;
+}
+
+OUString AnnotationManagerImpl::GetHelpText( ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation >& xAnnotation )
+{
+ OUString sRet;
+ if( xAnnotation.is() )
+ {
+ OUString sAuthor( xAnnotation->getAuthor() );
+ if( sAuthor.getLength() != 0 )
+ {
+ sRet += sAuthor;
+ }
+ sRet += OUString( RTL_CONSTASCII_USTRINGPARAM( " [" ) );
+
+ sRet += getAnnotationDateTimeString( xAnnotation );
+ sRet += OUString( RTL_CONSTASCII_USTRINGPARAM( "]\n" ) );
+
+ Reference< XText > xText( xAnnotation->getTextRange() );
+ if( xText.is() )
+ sRet += xText->getString();
+ }
+
+ return sRet;
+}
+
+
+void AnnotationManagerImpl::ExecuteAnnotationContextMenu( Reference< XAnnotation > xAnnotation, ::Window* pParent, const Rectangle& rContextRect, bool bButtonMenu /* = false */ )
+{
+ SfxDispatcher* pDispatcher( getDispatcher( mrBase ) );
+ if( !pDispatcher )
+ return;
+
+ const bool bReadOnly = mrBase.GetDocShell()->IsReadOnly();
+
+ AnnotationWindow* pAnnotationWindow = bButtonMenu ? 0 : dynamic_cast< AnnotationWindow* >( pParent );
+
+ if( bReadOnly && !pAnnotationWindow )
+ return;
+
+ std::auto_ptr< PopupMenu > pMenu( new PopupMenu( SdResId( pAnnotationWindow ? RID_ANNOTATION_CONTEXTMENU : RID_ANNOTATION_TAG_CONTEXTMENU ) ) );
+
+ SvtUserOptions aUserOptions;
+ OUString sCurrentAuthor( aUserOptions.GetFullName() );
+ OUString sAuthor( xAnnotation->getAuthor() );
+
+ String aStr( pMenu->GetItemText( SID_DELETEALLBYAUTHOR_POSTIT ) ), aReplace( sAuthor );
+ if( aReplace.Len() == 0 )
+ aReplace = String( SdResId( STR_ANNOTATION_NOAUTHOR ) );
+ aStr.SearchAndReplaceAscii("%1", aReplace);
+ pMenu->SetItemText( SID_DELETEALLBYAUTHOR_POSTIT, aStr );
+ pMenu->EnableItem( SID_REPLYTO_POSTIT, (sAuthor != sCurrentAuthor) && !bReadOnly );
+ pMenu->EnableItem( SID_DELETE_POSTIT, (xAnnotation.is() && !bReadOnly) ? TRUE : FALSE );
+ pMenu->EnableItem( SID_DELETEALLBYAUTHOR_POSTIT, !bReadOnly );
+ pMenu->EnableItem( SID_DELETEALL_POSTIT, !bReadOnly );
+
+ if( pAnnotationWindow )
+ {
+ if( pAnnotationWindow->IsProtected() || bReadOnly )
+ {
+ pMenu->EnableItem( SID_ATTR_CHAR_WEIGHT, FALSE );
+ pMenu->EnableItem( SID_ATTR_CHAR_POSTURE, FALSE );
+ pMenu->EnableItem( SID_ATTR_CHAR_UNDERLINE, FALSE );
+ pMenu->EnableItem( SID_ATTR_CHAR_STRIKEOUT, FALSE );
+ pMenu->EnableItem( SID_PASTE, FALSE );
+ }
+ else
+ {
+ SfxItemSet aSet(pAnnotationWindow->getView()->GetAttribs());
+
+ if ( aSet.GetItemState( EE_CHAR_WEIGHT ) == SFX_ITEM_ON )
+ {
+ if( ((const SvxWeightItem&)aSet.Get( EE_CHAR_WEIGHT )).GetWeight() == WEIGHT_BOLD )
+ pMenu->CheckItem( SID_ATTR_CHAR_WEIGHT );
+ }
+
+ if ( aSet.GetItemState( EE_CHAR_ITALIC ) == SFX_ITEM_ON )
+ {
+ if( ((const SvxPostureItem&)aSet.Get( EE_CHAR_ITALIC )).GetPosture() != ITALIC_NONE )
+ pMenu->CheckItem( SID_ATTR_CHAR_POSTURE );
+
+ }
+ if ( aSet.GetItemState( EE_CHAR_UNDERLINE ) == SFX_ITEM_ON )
+ {
+ if( ((const SvxUnderlineItem&)aSet.Get( EE_CHAR_UNDERLINE )).GetLineStyle() != UNDERLINE_NONE )
+ pMenu->CheckItem( SID_ATTR_CHAR_UNDERLINE );
+ }
+
+ if ( aSet.GetItemState( EE_CHAR_STRIKEOUT ) == SFX_ITEM_ON )
+ {
+ if( ((const SvxCrossedOutItem&)aSet.Get( EE_CHAR_STRIKEOUT )).GetStrikeout() != STRIKEOUT_NONE )
+ pMenu->CheckItem( SID_ATTR_CHAR_STRIKEOUT );
+ }
+ TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pAnnotationWindow ) );
+ pMenu->EnableItem( SID_PASTE, aDataHelper.GetFormatCount() != 0 );
+ }
+
+ pMenu->EnableItem( SID_COPY, pAnnotationWindow->getView()->HasSelection() );
+ }
+
+ USHORT nId = 0;
+
+ // set slot images
+ Reference< ::com::sun::star::frame::XFrame > xFrame( mrBase.GetMainViewShell()->GetViewFrame()->GetFrame()->GetFrameInterface() );
+ if( xFrame.is() )
+ {
+ const bool bHighContrast = Application::GetSettings().GetStyleSettings().GetHighContrastMode();
+ for( USHORT nPos = 0; nPos < pMenu->GetItemCount(); nPos++ )
+ {
+ nId = pMenu->GetItemId( nPos );
+ if( pMenu->IsItemEnabled( nId ) )
+ {
+ OUString sSlotURL( RTL_CONSTASCII_USTRINGPARAM( "slot:" ));
+ sSlotURL += OUString::valueOf( sal_Int32( nId ));
+
+ Image aImage( GetImage( xFrame, sSlotURL, false, bHighContrast ) );
+ if( !!aImage )
+ pMenu->SetItemImage( nId, aImage );
+ }
+ }
+ }
+
+ nId = pMenu->Execute( pParent, rContextRect, POPUPMENU_EXECUTE_DOWN );
+ switch( nId )
+ {
+ case SID_REPLYTO_POSTIT:
+ {
+ const SfxUnoAnyItem aItem( SID_REPLYTO_POSTIT, Any( xAnnotation ) );
+ pDispatcher->Execute( SID_REPLYTO_POSTIT, SFX_CALLMODE_ASYNCHRON, &aItem, 0 );
+ break;
+ }
+ case SID_DELETE_POSTIT:
+ {
+ const SfxUnoAnyItem aItem( SID_DELETE_POSTIT, Any( xAnnotation ) );
+ pDispatcher->Execute( SID_DELETE_POSTIT, SFX_CALLMODE_ASYNCHRON, &aItem, 0 );
+ break;
+ }
+ case SID_DELETEALLBYAUTHOR_POSTIT:
+ {
+ const SfxStringItem aItem( SID_DELETEALLBYAUTHOR_POSTIT, sAuthor );
+ pDispatcher->Execute( SID_DELETEALLBYAUTHOR_POSTIT, SFX_CALLMODE_ASYNCHRON, &aItem, 0 );
+ break;
+ }
+ case SID_DELETEALL_POSTIT:
+ pDispatcher->Execute( SID_DELETEALL_POSTIT );
+ break;
+ case SID_COPY:
+ case SID_PASTE:
+ case SID_ATTR_CHAR_WEIGHT:
+ case SID_ATTR_CHAR_POSTURE:
+ case SID_ATTR_CHAR_UNDERLINE:
+ case SID_ATTR_CHAR_STRIKEOUT:
+ if( pAnnotationWindow )
+ pAnnotationWindow->ExecuteSlot( nId );
+ break;
+ }
+}
+
+// ====================================================================
+
+Color AnnotationManagerImpl::GetColor(sal_uInt16 aAuthorIndex)
+{
+ if (!Application::GetSettings().GetStyleSettings().GetHighContrastMode())
+ {
+ static const Color aArrayNormal[] = {
+ COL_AUTHOR1_NORMAL, COL_AUTHOR2_NORMAL, COL_AUTHOR3_NORMAL,
+ COL_AUTHOR4_NORMAL, COL_AUTHOR5_NORMAL, COL_AUTHOR6_NORMAL,
+ COL_AUTHOR7_NORMAL, COL_AUTHOR8_NORMAL, COL_AUTHOR9_NORMAL };
+
+ return Color( aArrayNormal[ aAuthorIndex % (sizeof( aArrayNormal )/ sizeof( aArrayNormal[0] ))]);
+ }
+ else
+ return Color(COL_WHITE);
+}
+
+Color AnnotationManagerImpl::GetColorLight(sal_uInt16 aAuthorIndex)
+{
+ if (!Application::GetSettings().GetStyleSettings().GetHighContrastMode())
+ {
+ static const Color aArrayLight[] = {
+ COL_AUTHOR1_LIGHT, COL_AUTHOR2_LIGHT, COL_AUTHOR3_LIGHT,
+ COL_AUTHOR4_LIGHT, COL_AUTHOR5_LIGHT, COL_AUTHOR6_LIGHT,
+ COL_AUTHOR7_LIGHT, COL_AUTHOR8_LIGHT, COL_AUTHOR9_LIGHT };
+
+ return Color( aArrayLight[ aAuthorIndex % (sizeof( aArrayLight )/ sizeof( aArrayLight[0] ))]);
+ }
+ else
+ return Color(COL_WHITE);
+}
+
+Color AnnotationManagerImpl::GetColorDark(sal_uInt16 aAuthorIndex)
+{
+ if (!Application::GetSettings().GetStyleSettings().GetHighContrastMode())
+ {
+ static const Color aArrayAnkor[] = {
+ COL_AUTHOR1_DARK, COL_AUTHOR2_DARK, COL_AUTHOR3_DARK,
+ COL_AUTHOR4_DARK, COL_AUTHOR5_DARK, COL_AUTHOR6_DARK,
+ COL_AUTHOR7_DARK, COL_AUTHOR8_DARK, COL_AUTHOR9_DARK };
+
+ return Color( aArrayAnkor[ aAuthorIndex % (sizeof( aArrayAnkor ) / sizeof( aArrayAnkor[0] ))]);
+ }
+ else
+ return Color(COL_WHITE);
+}
+
+SdPage* AnnotationManagerImpl::GetNextPage( SdPage* pPage, bool bForeward )
+{
+ if( pPage == 0 )
+ return bForeward ? GetFirstPage() : GetLastPage();
+
+ sal_uInt16 nPageNum = (pPage->GetPageNum() - 1) >> 1;
+
+ // first all non master pages
+ if( !pPage->IsMasterPage() )
+ {
+ if( bForeward )
+ {
+ if( nPageNum >= mpDoc->GetSdPageCount(PK_STANDARD)-1 )
+ {
+ // we reached end of draw pages, start with master pages (skip handout master for draw)
+ return mpDoc->GetMasterSdPage( (mpDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS) ? 0 : 1, PK_STANDARD );
+ }
+ nPageNum++;
+ }
+ else
+ {
+ if( nPageNum == 0 )
+ return 0; // we are already on the first draw page, finished
+
+ nPageNum--;
+ }
+ return mpDoc->GetSdPage(nPageNum, PK_STANDARD);
+ }
+ else
+ {
+ if( bForeward )
+ {
+ if( nPageNum >= mpDoc->GetMasterSdPageCount(PK_STANDARD)-1 )
+ {
+ return 0; // we reached the end, there is nothing more to see here
+ }
+ nPageNum++;
+ }
+ else
+ {
+ if( nPageNum == (mpDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS) ? 0 : 1 )
+ {
+ // we reached beginning of master pages, start with end if pages
+ return mpDoc->GetSdPage( mpDoc->GetSdPageCount(PK_STANDARD)-1, PK_STANDARD );
+ }
+
+ nPageNum--;
+ }
+ return mpDoc->GetMasterSdPage(nPageNum,PK_STANDARD);
+ }
+}
+
+SdPage* AnnotationManagerImpl::GetFirstPage()
+{
+ // return first drawing page
+ return mpDoc->GetSdPage(0, PK_STANDARD );
+}
+
+SdPage* AnnotationManagerImpl::GetLastPage()
+{
+ return mpDoc->GetMasterSdPage( mpDoc->GetMasterSdPageCount(PK_STANDARD) - 1, PK_STANDARD );
+}
+
+SdPage* AnnotationManagerImpl::GetCurrentPage()
+{
+/*
+ ::boost::shared_ptr<DrawViewShell> pDrawViewShell(::boost::dynamic_pointer_cast<DrawViewShell>(mrBase.GetMainViewShell()));
+ if (pDrawViewShell.get() != NULL)
+ return pDrawViewShell->GetActualPage();
+*/
+ return mrBase.GetMainViewShell()->getCurrentPage();
+}
+
+// ====================================================================
+
+AnnotationManager::AnnotationManager( ViewShellBase& rViewShellBase )
+: mxImpl( new AnnotationManagerImpl( rViewShellBase ) )
+{
+ mxImpl->init();
+}
+
+AnnotationManager::~AnnotationManager()
+{
+ mxImpl->dispose();
+}
+
+void AnnotationManager::ExecuteAnnotation(SfxRequest& rRequest)
+{
+ mxImpl->ExecuteAnnotation( rRequest );
+}
+
+void AnnotationManager::GetAnnotationState(SfxItemSet& rItemSet)
+{
+ mxImpl->GetAnnotationState(rItemSet);
+}
+
+}
diff --git a/sd/source/ui/annotations/annotationmanagerimpl.hxx b/sd/source/ui/annotations/annotationmanagerimpl.hxx
new file mode 100755
index 000000000000..9f2c48e875d3
--- /dev/null
+++ b/sd/source/ui/annotations/annotationmanagerimpl.hxx
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * 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: AnnotationPanel.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_ANNOTATIONMANAGER_IMPL_HXX
+#define _SD_ANNOTATIONMANAGER_IMPL_HXX
+
+#include <com/sun/star/document/XEventListener.hpp>
+#include <com/sun/star/office/XAnnotationAccess.hpp>
+
+#include <rtl/ustring.hxx>
+
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/compbase1.hxx>
+
+#include "ViewShellBase.hxx"
+
+#include "annotationtag.hxx"
+
+class SfxRequest;
+
+namespace sd
+{
+
+typedef std::vector< rtl::Reference< AnnotationTag > > AnnotationTagVector;
+
+namespace tools {
+class EventMultiplexerEvent;
+}
+
+typedef ::cppu::WeakComponentImplHelper1 <
+ com::sun::star::document::XEventListener
+ > AnnotationManagerImplBase;
+
+class AnnotationManagerImpl : private ::cppu::BaseMutex, public AnnotationManagerImplBase
+{
+public:
+ AnnotationManagerImpl( ViewShellBase& rViewShellBase );
+
+ void init();
+
+ // WeakComponentImplHelper1
+ virtual void SAL_CALL disposing ();
+
+ // XEventListener
+ virtual void SAL_CALL notifyEvent( const ::com::sun::star::document::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ //
+ void ExecuteAnnotation (SfxRequest& rRequest);
+ void GetAnnotationState (SfxItemSet& rItemSet);
+
+ void ExecuteInsertAnnotation(SfxRequest& rReq);
+ void ExecuteDeleteAnnotation(SfxRequest& rReq);
+ void ExecuteReplyToAnnotation(SfxRequest& rReq);
+
+ void SelectNextAnnotation(bool bForeward);
+
+ void SelectAnnotation( ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > xAnnotation, bool bEdit = FALSE );
+ void GetSelectedAnnotation( ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation >& xAnnotation );
+
+ void InsertAnnotation();
+ void DeleteAnnotation( ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > xAnnotation );
+ void DeleteAnnotationsByAuthor( const rtl::OUString& sAuthor );
+ void DeleteAllAnnotations();
+
+ void ExecuteAnnotationContextMenu( ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > xAnnotation, ::Window* pParent, const Rectangle& rContextRect, bool bButtonMenu = false );
+
+ Color GetColorDark(sal_uInt16 aAuthorIndex);
+ Color GetColorLight(sal_uInt16 aAuthorIndex);
+ Color GetColor(sal_uInt16 aAuthorIndex);
+
+
+ // callbacks
+ void onTagSelected( AnnotationTag& rTag );
+ void onTagDeselected( AnnotationTag& rTag );
+
+ void onSelectionChanged();
+
+ rtl::OUString GetHelpText( ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation >& xAnnotation );
+
+ void addListener();
+ void removeListener();
+
+ void invalidateSlots();
+
+ DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent*);
+ DECL_LINK(UpdateTagsHdl, void *);
+
+ void UpdateTags(bool bSynchron = false);
+ void CreateTags();
+ void DisposeTags();
+
+ SdPage* GetNextPage( SdPage* pPage, bool bForeward );
+ SdPage* GetFirstPage();
+ SdPage* GetLastPage();
+
+ SdPage* GetCurrentPage();
+
+ SdDrawDocument* GetDoc() { return mpDoc; }
+
+ void ShowAnnotations(bool bShow);
+
+private:
+ ViewShellBase& mrBase;
+ SdDrawDocument* mpDoc;
+
+ AnnotationTagVector maTagVector;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView > mxView;
+ ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotationAccess > mxCurrentPage;
+ ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > mxSelectedAnnotation;
+
+ bool mbShowAnnotations;
+ ULONG mnUpdateTagsEvent;
+ Font maFont;
+};
+
+}
+
+#endif // _SD_ANNOTATIONMANAGER_IMPL_HXX
diff --git a/sd/source/ui/annotations/annotations.hrc b/sd/source/ui/annotations/annotations.hrc
new file mode 100644
index 000000000000..0688fb0fa195
--- /dev/null
+++ b/sd/source/ui/annotations/annotations.hrc
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * 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: TableDesignPane.hrc,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_ANNOTATIONPANE_HRC
+#define _SD_ANNOTATIONPANE_HRC
+
+#include "glob.hrc"
+
+// strings
+#define STR_ANNOTATION_TODAY (RID_ANNOTATIONS_START+1)
+#define STR_ANNOTATION_YESTERDAY (RID_ANNOTATIONS_START+2)
+#define STR_ANNOTATION_NOAUTHOR (RID_ANNOTATIONS_START+3)
+#define STR_ANNOTATION_WRAP_FORWARD (RID_ANNOTATIONS_START+4)
+#define STR_ANNOTATION_WRAP_BACKWARD (RID_ANNOTATIONS_START+5)
+#define STR_ANNOTATION_WRAP_FORWARD_DRAW (RID_ANNOTATIONS_START+6)
+#define STR_ANNOTATION_WRAP_BACKWARD_DRAW (RID_ANNOTATIONS_START+7)
+#define STR_ANNOTATION_UNDO_INSERT (RID_ANNOTATIONS_START+8)
+#define STR_ANNOTATION_UNDO_DELETE (RID_ANNOTATIONS_START+9)
+#define STR_ANNOTATION_UNDO_MOVE (RID_ANNOTATIONS_START+10)
+#define STR_ANNOTATION_UNDO_EDIT (RID_ANNOTATIONS_START+11)
+#define STR_ANNOTATION_UNDO_REPLY (RID_ANNOTATIONS_START+12)
+#define STR_ANNOTATION_REPLY (RID_ANNOTATIONS_START+13)
+
+// menus
+#define RID_ANNOTATION_CONTEXTMENU (RID_ANNOTATIONS_START+0)
+#define RID_ANNOTATION_TAG_CONTEXTMENU (RID_ANNOTATIONS_START+1)
+
+#define BTN_NEW 1
+#define BTN_DELETE 2
+#define BTN_NEXT 3
+#define BTN_PREV 4
+
+#define TBX_TOOLBAR 1
+#define FT_AUTHOR 1
+#define ED_AUTHOR 2
+#define FT_DATE 3
+#define ED_DATE 4
+
+#define CT_TEXT 5
+
+#endif // _SD_ANNOTATIONPANE_HRC
diff --git a/sd/source/ui/annotations/annotations.src b/sd/source/ui/annotations/annotations.src
new file mode 100644
index 000000000000..ab6311425fc7
--- /dev/null
+++ b/sd/source/ui/annotations/annotations.src
@@ -0,0 +1,212 @@
+/*************************************************************************
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#include "annotations.hrc"
+#include "glob.hrc"
+#include <svx/svxids.hrc>
+
+Menu RID_ANNOTATION_CONTEXTMENU
+{
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = SID_REPLYTO_POSTIT;
+ HelpID = SID_REPLYTO_POSTIT ;
+ Text [ en-US ] = "~Reply";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_ATTR_CHAR_WEIGHT;
+ HelpID = SID_ATTR_CHAR_WEIGHT ;
+ Text [ en-US ] = "~Bold";
+ };
+ MenuItem
+ {
+ Identifier = SID_ATTR_CHAR_POSTURE;
+ HelpID = SID_ATTR_CHAR_POSTURE;
+ Text [ en-US ] = "~Italic";
+ };
+ MenuItem
+ {
+ Identifier = SID_ATTR_CHAR_UNDERLINE;
+ HelpID = SID_ATTR_CHAR_UNDERLINE;
+ Text [ en-US ] = "~Underline";
+ };
+ MenuItem
+ {
+ Identifier = SID_ATTR_CHAR_STRIKEOUT;
+ HelpID = SID_ATTR_CHAR_STRIKEOUT;
+ Text [ en-US ] = "~Strikethrough";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_COPY ;
+ HelpID = SID_COPY ;
+ Text [ en-US ] = "~Copy" ;
+ };
+ MenuItem
+ {
+ Identifier = SID_PASTE ;
+ HelpID = SID_PASTE ;
+ Text [ en-US ] = "~Paste" ;
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_DELETE_POSTIT ;
+ HelpID = SID_DELETE_POSTIT;
+ Text [ en-US ] = "~Delete Comment" ;
+ };
+ MenuItem
+ {
+ Identifier = SID_DELETEALLBYAUTHOR_POSTIT ;
+ HelpID = SID_DELETEALLBYAUTHOR_POSTIT;
+ Text [ en-US ] = "Delete All Comments b~y %1" ;
+ };
+ MenuItem
+ {
+ Identifier = SID_DELETEALL_POSTIT;
+ HelpID = SID_DELETEALL_POSTIT;
+ Text [ en-US ] = "Delete ~All Comments" ;
+ };
+ };
+};
+
+Menu RID_ANNOTATION_TAG_CONTEXTMENU
+{
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = SID_REPLYTO_POSTIT;
+ HelpID = SID_REPLYTO_POSTIT;
+ Text [ en-US ] = "~Reply";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_DELETE_POSTIT ;
+ HelpID = SID_DELETE_POSTIT ;
+ Text [ en-US ] = "~Delete Comment" ;
+ };
+ MenuItem
+ {
+ Identifier = SID_DELETEALLBYAUTHOR_POSTIT ;
+ HelpID = SID_DELETEALLBYAUTHOR_POSTIT ;
+ Text [ en-US ] = "Delete All Comments ~by %1" ;
+ };
+ MenuItem
+ {
+ Identifier = SID_DELETEALL_POSTIT;
+ HelpID = SID_DELETEALL_POSTIT;
+ Text [ en-US ] = "Delete ~All Comments" ;
+ };
+ };
+};
+
+String STR_ANNOTATION_TODAY
+{
+ Text [ en-US ] = "Today," ;
+};
+
+String STR_ANNOTATION_YESTERDAY
+{
+ Text [ en-US ] = "Yesterday," ;
+};
+
+String STR_ANNOTATION_NOAUTHOR
+{
+ Text [ en-US ] = "(no author)" ;
+};
+
+String STR_ANNOTATION_WRAP_FORWARD
+{
+ Text [ en-US ] = "%PRODUCTNAME Impress reached the end of the presentation. Do you want to continue at the beginning?";
+};
+
+String STR_ANNOTATION_WRAP_BACKWARD
+{
+ Text [ en-US ] = "%PRODUCTNAME Impress reached the beginning of the presentation. Do you want to continue at the end?";
+};
+
+String STR_ANNOTATION_WRAP_FORWARD_DRAW
+{
+ Text [ en-US ] = "%PRODUCTNAME Draw reached the end of the document. Do you want to continue at the beginning?";
+};
+
+String STR_ANNOTATION_WRAP_BACKWARD_DRAW
+{
+ Text [ en-US ] = "%PRODUCTNAME Draw reached the beginning of the document. Do you want to continue at the end?";
+};
+
+String STR_ANNOTATION_UNDO_INSERT
+{
+ Text [ en-US ] = "Insert Comment";
+};
+
+String STR_ANNOTATION_UNDO_DELETE
+{
+ Text [ en-US ] = "Delete Comment(s)";
+};
+
+String STR_ANNOTATION_UNDO_MOVE
+{
+ Text [ en-US ] = "Move Comment";
+};
+
+String STR_ANNOTATION_UNDO_EDIT
+{
+ Text [ en-US ] = "Edit Comment";
+};
+
+String STR_ANNOTATION_UNDO_REPLY
+{
+ Text [ en-US ] = "Reply to Comment";
+};
+
+String STR_ANNOTATION_REPLY
+{
+ Text [ en-US ] = "Reply to %1" ;
+};
diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx
new file mode 100644
index 000000000000..d2b9b7b56b7d
--- /dev/null
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -0,0 +1,793 @@
+/*************************************************************************
+ *
+ * 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: motionpathtag.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/util/XChangesNotifier.hpp>
+
+#include <vcl/help.hxx>
+#include <vcl/svapp.hxx>
+
+#include <sfx2/viewfrm.hxx>
+#include <sfx2/dispatch.hxx>
+
+#include <svx/sdr/overlay/overlaymanager.hxx>
+#include <svx/sdr/overlay/overlayanimatedbitmapex.hxx>
+#include <svx/sdr/overlay/overlaybitmapex.hxx>
+#include <svx/svdpagv.hxx>
+#include <svx/sdrpagewindow.hxx>
+#include <svx/sdrpaintwindow.hxx>
+#include <svx/svddrgmt.hxx>
+
+#include "View.hxx"
+#include "sdresid.hxx"
+#include "annotations.hrc"
+#include "annotationmanagerimpl.hxx"
+#include "annotationwindow.hxx"
+#include "annotationtag.hxx"
+#include "sdpage.hxx"
+#include "ViewShell.hxx"
+#include "app.hrc"
+#include "Window.hxx"
+#include "drawdoc.hxx"
+
+using ::rtl::OUString;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+//using namespace ::com::sun::star::util;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::office;
+using namespace ::com::sun::star::geometry;
+
+namespace sd
+{
+
+const sal_uInt32 SMART_TAG_HDL_NUM = SAL_MAX_UINT32;
+static const int DRGPIX = 2; // Drag MinMove in Pixel
+
+// --------------------------------------------------------------------
+
+static OUString getInitials( const OUString& rName )
+{
+ OUString sInitials;
+
+ const sal_Unicode * pStr = rName.getStr();
+ sal_Int32 nLength = rName.getLength();
+
+ while( nLength )
+ {
+ // skip whitespace
+ while( nLength && (*pStr <= ' ') )
+ {
+ nLength--; pStr++;
+ }
+
+ // take letter
+ if( nLength )
+ {
+ sInitials += OUString( *pStr );
+ nLength--; pStr++;
+ }
+
+ // skip letters until whitespace
+ while( nLength && (*pStr > ' ') )
+ {
+ nLength--; pStr++;
+ }
+ }
+
+ return sInitials;
+}
+
+// --------------------------------------------------------------------
+
+// --------------------------------------------------------------------
+
+class AnnotationDragMove : public SdrDragMove
+{
+public:
+ AnnotationDragMove(SdrDragView& rNewView, const rtl::Reference <AnnotationTag >& xTag);
+ virtual bool BeginSdrDrag();
+ virtual bool EndSdrDrag(bool bCopy);
+ virtual void MoveSdrDrag(const Point& rNoSnapPnt);
+ virtual void CancelSdrDrag();
+
+private:
+ rtl::Reference <AnnotationTag > mxTag;
+ Point maOrigin;
+};
+
+AnnotationDragMove::AnnotationDragMove(SdrDragView& rNewView, const rtl::Reference <AnnotationTag >& xTag)
+: SdrDragMove(rNewView)
+, mxTag( xTag )
+{
+}
+
+bool AnnotationDragMove::BeginSdrDrag()
+{
+ DragStat().Ref1()=GetDragHdl()->GetPos();
+ DragStat().SetShown(!DragStat().IsShown());
+
+ maOrigin = GetDragHdl()->GetPos();
+ DragStat().SetActionRect(Rectangle(maOrigin,maOrigin));
+
+ return true;
+}
+
+void AnnotationDragMove::MoveSdrDrag(const Point& rNoSnapPnt)
+{
+ Point aPnt(rNoSnapPnt);
+
+ if (DragStat().CheckMinMoved(rNoSnapPnt))
+ {
+ if (aPnt!=DragStat().GetNow())
+ {
+ Hide();
+ DragStat().NextMove(aPnt);
+ GetDragHdl()->SetPos( maOrigin + Point( DragStat().GetDX(), DragStat().GetDY() ) );
+ Show();
+ DragStat().SetActionRect(Rectangle(aPnt,aPnt));
+ }
+ }
+}
+
+bool AnnotationDragMove::EndSdrDrag(bool /*bCopy*/)
+{
+ Hide();
+ if( mxTag.is() )
+ mxTag->Move( DragStat().GetDX(), DragStat().GetDY() );
+ return TRUE;
+}
+
+void AnnotationDragMove::CancelSdrDrag()
+{
+ Hide();
+}
+
+// --------------------------------------------------------------------
+
+class AnnotationHdl : public SmartHdl
+{
+public:
+ AnnotationHdl( const SmartTagReference& xTag, const Reference< XAnnotation >& xAnnotation, const Point& rPnt );
+ virtual ~AnnotationHdl();
+ virtual void CreateB2dIAObject();
+ virtual BOOL IsFocusHdl() const;
+ virtual Pointer GetSdrDragPointer() const;
+ virtual bool isMarkable() const;
+
+
+private:
+ Reference< XAnnotation > mxAnnotation;
+ rtl::Reference< AnnotationTag > mxTag;
+};
+
+// --------------------------------------------------------------------
+
+AnnotationHdl::AnnotationHdl( const SmartTagReference& xTag, const Reference< XAnnotation >& xAnnotation, const Point& rPnt )
+: SmartHdl( xTag, rPnt )
+, mxAnnotation( xAnnotation )
+, mxTag( dynamic_cast< AnnotationTag* >( xTag.get() ) )
+{
+}
+
+// --------------------------------------------------------------------
+
+AnnotationHdl::~AnnotationHdl()
+{
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationHdl::CreateB2dIAObject()
+{
+ // first throw away old one
+ GetRidOfIAObject();
+
+ if( mxAnnotation.is() )
+ {
+ 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( mxTag->CreateAnnotationBitmap(mxTag->isSelected()) );
+ BitmapEx aBitmapEx2;
+ if( bFocused )
+ aBitmapEx2 = mxTag->CreateAnnotationBitmap(!mxTag->isSelected() );
+
+ 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 SdrPageViewWinRec& rPageViewWinRec = rPageViewWinList[b];
+ const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
+
+ SdrPaintWindow& rPaintWindow = rPageWindow.GetPaintWindow();
+ if(rPaintWindow.OutputToWindow() && rPageWindow.GetOverlayManager() )
+ {
+ ::sdr::overlay::OverlayObject* pOverlayObject = 0;
+
+ // animate focused handles
+ if(bFocused)
+ {
+ const sal_uInt32 nBlinkTime = sal::static_int_cast<sal_uInt32>(rStyleSettings.GetCursorBlinkTime());
+
+ pOverlayObject = new ::sdr::overlay::OverlayAnimatedBitmapEx(aPosition, aBitmapEx, aBitmapEx2, nBlinkTime, 0, 0, 0, 0 );
+/*
+ (UINT16)(aBitmapEx.GetSizePixel().Width() - 1) >> 1,
+ (UINT16)(aBitmapEx.GetSizePixel().Height() - 1) >> 1,
+ (UINT16)(aBitmapEx2.GetSizePixel().Width() - 1) >> 1,
+ (UINT16)(aBitmapEx2.GetSizePixel().Height() - 1) >> 1);
+*/
+ }
+ else
+ {
+ pOverlayObject = new ::sdr::overlay::OverlayBitmapEx( aPosition, aBitmapEx, 0, 0 );
+ }
+
+ rPageWindow.GetOverlayManager()->add(*pOverlayObject);
+ maOverlayGroup.append(*pOverlayObject);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+// --------------------------------------------------------------------
+
+BOOL AnnotationHdl::IsFocusHdl() const
+{
+ return TRUE;
+}
+
+// --------------------------------------------------------------------
+
+bool AnnotationHdl::isMarkable() const
+{
+ return false;
+}
+
+// --------------------------------------------------------------------
+
+Pointer AnnotationHdl::GetSdrDragPointer() const
+{
+ PointerStyle eStyle = POINTER_NOTALLOWED;
+ if( mxTag.is() )
+ {
+ if( mxTag->isSelected() )
+ {
+ eStyle = POINTER_MOVE;
+ }
+ else
+ {
+ eStyle = POINTER_ARROW;
+
+ }
+ }
+ return Pointer( eStyle );
+}
+
+// ====================================================================
+
+AnnotationTag::AnnotationTag( AnnotationManagerImpl& rManager, ::sd::View& rView, const Reference< XAnnotation >& xAnnotation, Color& rColor, int nIndex, const Font& rFont )
+: SmartTag( rView )
+, mrManager( rManager )
+, mxAnnotation( xAnnotation )
+, maColor( rColor )
+, mnIndex( nIndex )
+, mrFont( rFont )
+, mnClosePopupEvent( 0 )
+, mpListenWindow( 0 )
+{
+}
+
+// --------------------------------------------------------------------
+
+AnnotationTag::~AnnotationTag()
+{
+ DBG_ASSERT( !mxAnnotation.is(), "sd::AnnotationTag::~AnnotationTag(), dispose me first!" );
+ Dispose();
+}
+
+// --------------------------------------------------------------------
+
+/** returns true if the AnnotationTag handled the event. */
+bool AnnotationTag::MouseButtonDown( const MouseEvent& rMEvt, SmartHdl& /*rHdl*/ )
+{
+ if( !mxAnnotation.is() )
+ return false;
+
+ bool bRet = false;
+ if( !isSelected() )
+ {
+ SmartTagReference xTag( this );
+ mrView.getSmartTags().select( xTag );
+ bRet = true;
+ }
+ /*
+ if( rMEvt.IsLeft() && (rMEvt.GetClicks() == 2) )
+ {
+ // double click;
+ return true;
+ }
+ else */
+ if( rMEvt.IsLeft() && !rMEvt.IsRight() )
+ {
+ Window* pWindow = mrView.GetViewShell()->GetActiveWindow();
+ if( pWindow )
+ {
+ maMouseDownPos = pWindow->PixelToLogic( rMEvt.GetPosPixel() );
+
+ if( mpListenWindow )
+ mpListenWindow->RemoveEventListener( LINK(this, AnnotationTag, WindowEventHandler));
+
+ mpListenWindow = pWindow;
+ mpListenWindow->AddEventListener( LINK(this, AnnotationTag, WindowEventHandler));
+ }
+
+ bRet = true;
+ }
+
+ return bRet;
+}
+
+// --------------------------------------------------------------------
+
+/** returns true if the SmartTag consumes this event. */
+bool AnnotationTag::KeyInput( const KeyEvent& rKEvt )
+{
+ if( !mxAnnotation.is() )
+ return false;
+
+ USHORT nCode = rKEvt.GetKeyCode().GetCode();
+ switch( nCode )
+ {
+ case KEY_DELETE:
+ mrManager.DeleteAnnotation( mxAnnotation );
+ return true;
+
+ case KEY_DOWN:
+ case KEY_UP:
+ case KEY_LEFT:
+ case KEY_RIGHT:
+ return OnMove( rKEvt );
+
+ case KEY_ESCAPE:
+ {
+ SmartTagReference xThis( this );
+ mrView.getSmartTags().deselect();
+ return true;
+ }
+
+ case KEY_TAB:
+ mrManager.SelectNextAnnotation(!rKEvt.GetKeyCode().IsShift());
+ return true;
+
+ case KEY_RETURN:
+ case KEY_SPACE:
+ OpenPopup( true );
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+/** returns true if the SmartTag consumes this event. */
+bool AnnotationTag::RequestHelp( const HelpEvent& /*rHEvt*/ )
+{
+/*
+ ::Window* pWindow = mrView.GetViewShell()->GetActiveWindow();
+ if( mxAnnotation.is() && pWindow )
+ {
+ OUString aHelpText( mrManager.GetHelpText( mxAnnotation ) );
+
+ RealPoint2D aPosition( mxAnnotation->getPosition() );
+ Point aPos( pWindow->LogicToPixel( Point( static_cast<long>(aPosition.X * 100.0), static_cast<long>(aPosition.Y * 100.0) ) ) );
+
+ Rectangle aRect( aPos, maSize );
+
+ if (Help::IsBalloonHelpEnabled())
+ Help::ShowBalloon( pWindow, aPos, aRect, aHelpText);
+ else if (Help::IsQuickHelpEnabled())
+ Help::ShowQuickHelp( pWindow, aRect, aHelpText);
+
+ return true;
+ }
+*/
+ return false;
+}
+
+/** returns true if the SmartTag consumes this event. */
+bool AnnotationTag::Command( const CommandEvent& rCEvt )
+{
+ if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+ {
+ ::Window* pWindow = mrView.GetViewShell()->GetActiveWindow();
+ if( pWindow )
+ {
+ Rectangle aContextRect(rCEvt.GetMousePosPixel(),Size(1,1));
+ mrManager.ExecuteAnnotationContextMenu( mxAnnotation, pWindow, aContextRect );
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void AnnotationTag::Move( int nDX, int nDY )
+{
+ if( mxAnnotation.is() )
+ {
+ if( mrManager.GetDoc()->IsUndoEnabled() )
+ mrManager.GetDoc()->BegUndo( String( SdResId( STR_ANNOTATION_UNDO_MOVE ) ) );
+
+ RealPoint2D aPosition( mxAnnotation->getPosition() );
+ aPosition.X += (double)nDX / 100.0;
+ aPosition.Y += (double)nDY / 100.0;
+ mxAnnotation->setPosition( aPosition );
+
+ if( mrManager.GetDoc()->IsUndoEnabled() )
+ mrManager.GetDoc()->EndUndo();
+
+ mrView.updateHandles();
+ }
+}
+
+bool AnnotationTag::OnMove( const KeyEvent& rKEvt )
+{
+ long nX = 0;
+ long nY = 0;
+
+ switch( rKEvt.GetKeyCode().GetCode() )
+ {
+ case KEY_UP: nY = -1; break;
+ case KEY_DOWN: nY = 1; break;
+ case KEY_LEFT: nX = -1; break;
+ case KEY_RIGHT: nX = 1; break;
+ default: break;
+ }
+
+ if(rKEvt.GetKeyCode().IsMod2())
+ {
+ OutputDevice* pOut = mrView.GetViewShell()->GetActiveWindow();
+ Size aLogicSizeOnePixel = (pOut) ? pOut->PixelToLogic(Size(1,1)) : Size(100, 100);
+ nX *= aLogicSizeOnePixel.Width();
+ nY *= aLogicSizeOnePixel.Height();
+ }
+ else
+ {
+ // old, fixed move distance
+ nX *= 100;
+ nY *= 100;
+ }
+
+ if( nX || nY )
+ {
+ // move the annotation
+ Move( nX, nY );
+ }
+
+ return true;
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationTag::CheckPossibilities()
+{
+}
+
+// --------------------------------------------------------------------
+
+ULONG AnnotationTag::GetMarkablePointCount() const
+{
+ return 0;
+}
+
+// --------------------------------------------------------------------
+
+ULONG AnnotationTag::GetMarkedPointCount() const
+{
+ return 0;
+}
+
+// --------------------------------------------------------------------
+
+BOOL AnnotationTag::MarkPoint(SdrHdl& /*rHdl*/, BOOL /*bUnmark*/ )
+{
+ BOOL bRet=FALSE;
+ return bRet;
+}
+
+// --------------------------------------------------------------------
+
+BOOL AnnotationTag::MarkPoints(const Rectangle* /*pRect*/, BOOL /*bUnmark*/ )
+{
+ BOOL bChgd=FALSE;
+ return bChgd;
+}
+
+// --------------------------------------------------------------------
+
+bool AnnotationTag::getContext( SdrViewContext& /*rContext*/ )
+{
+ return false;
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationTag::addCustomHandles( SdrHdlList& rHandlerList )
+{
+ if( mxAnnotation.is() )
+ {
+ SmartTagReference xThis( this );
+ Point aPoint;
+ AnnotationHdl* pHdl = new AnnotationHdl( xThis, mxAnnotation, aPoint );
+ pHdl->SetObjHdlNum( SMART_TAG_HDL_NUM );
+ pHdl->SetPageView( mrView.GetSdrPageView() );
+
+ RealPoint2D aPosition( mxAnnotation->getPosition() );
+ Point aBasePos( static_cast<long>(aPosition.X * 100.0), static_cast<long>(aPosition.Y * 100.0) );
+ pHdl->SetPos( aBasePos );
+
+ rHandlerList.AddHdl( pHdl );
+ }
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationTag::disposing()
+{
+ if( mpListenWindow )
+ {
+ mpListenWindow->RemoveEventListener( LINK(this, AnnotationTag, WindowEventHandler));
+ }
+
+ if( mnClosePopupEvent )
+ {
+ Application::RemoveUserEvent( mnClosePopupEvent );
+ mnClosePopupEvent = 0;
+ }
+
+ mxAnnotation.clear();
+ ClosePopup();
+ SmartTag::disposing();
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationTag::select()
+{
+ SmartTag::select();
+
+ mrManager.onTagSelected( *this );
+
+ Window* pWindow = mrView.GetViewShell()->GetActiveWindow();
+ if( pWindow )
+ {
+ RealPoint2D aPosition( mxAnnotation->getPosition() );
+ Point aPos( static_cast<long>(aPosition.X * 100.0), static_cast<long>(aPosition.Y * 100.0) );
+
+ Rectangle aVisRect( aPos, pWindow->PixelToLogic(maSize) );
+ mrView.MakeVisible(aVisRect, *pWindow);
+ }
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationTag::deselect()
+{
+ SmartTag::deselect();
+
+ ClosePopup();
+
+ mrManager.onTagDeselected( *this );
+}
+
+// --------------------------------------------------------------------
+
+BitmapEx AnnotationTag::CreateAnnotationBitmap( bool bSelected )
+{
+ VirtualDevice aVDev;
+
+ OUString sAuthor( getInitials( mxAnnotation->getAuthor() ) );
+ sAuthor += OUString( sal_Unicode( ' ' ) );
+ sAuthor += OUString::valueOf( (sal_Int32)mnIndex );
+
+ aVDev.SetFont( mrFont );
+
+ const int BORDER_X = 4; // pixels
+ const int BORDER_Y = 4; // pixels
+
+ maSize = Size( aVDev.GetTextWidth( sAuthor ) + 2*BORDER_X, aVDev.GetTextHeight() + 2*BORDER_Y );
+ aVDev.SetOutputSizePixel( maSize, FALSE );
+
+ Color aBorderColor( maColor );
+
+ if( bSelected )
+ {
+ aBorderColor.Invert();
+ }
+ else
+ {
+ if( maColor.IsDark() )
+ {
+ aBorderColor.IncreaseLuminance( 32 );
+ }
+ else
+ {
+ aBorderColor.DecreaseLuminance( 32 );
+ }
+ }
+
+ Point aPos;
+ Rectangle aBorderRect( aPos, maSize );
+ aVDev.SetLineColor(aBorderColor);
+ aVDev.SetFillColor(maColor);
+ aVDev.DrawRect( aBorderRect );
+
+ aVDev.SetTextColor( maColor.IsDark() ? COL_WHITE : COL_BLACK );
+ aVDev.DrawText( Point( BORDER_X, BORDER_Y ), sAuthor );
+
+ return aVDev.GetBitmapEx( aPos, maSize );
+}
+
+void AnnotationTag::OpenPopup( bool bEdit )
+{
+ if( !mxAnnotation.is() )
+ return;
+
+ if( !mpAnnotationWindow.get() )
+ {
+ ::Window* pWindow = dynamic_cast< ::Window* >( getView().GetFirstOutputDevice() );
+ if( pWindow )
+ {
+ RealPoint2D aPosition( mxAnnotation->getPosition() );
+ Point aPos( pWindow->OutputToScreenPixel( pWindow->LogicToPixel( Point( static_cast<long>(aPosition.X * 100.0), static_cast<long>(aPosition.Y * 100.0) ) ) ) );
+
+ aPos.X() += 4; // magic!
+ aPos.Y() += 1;
+
+ Rectangle aRect( aPos, maSize );
+
+ mpAnnotationWindow.reset( new AnnotationWindow( mrManager, mrView.GetDocSh(), pWindow->GetWindow(WINDOW_FRAME) ) );
+ mpAnnotationWindow->InitControls();
+ mpAnnotationWindow->setAnnotation(mxAnnotation);
+
+ USHORT nArrangeIndex = 0;
+ Point aPopupPos( FloatingWindow::CalcFloatingPosition( mpAnnotationWindow.get(), aRect, FLOATWIN_POPUPMODE_RIGHT, nArrangeIndex ) );
+ Size aPopupSize( 320, 240 );
+
+ mpAnnotationWindow->SetPosSizePixel( aPopupPos, aPopupSize );
+ mpAnnotationWindow->DoResize();
+
+ mpAnnotationWindow->Show();
+ mpAnnotationWindow->GrabFocus();
+ mpAnnotationWindow->AddEventListener( LINK(this, AnnotationTag, WindowEventHandler));
+ }
+ }
+
+ if( bEdit && mpAnnotationWindow.get() )
+ mpAnnotationWindow->StartEdit();
+}
+
+void AnnotationTag::ClosePopup()
+{
+ if( mpAnnotationWindow.get() )
+ {
+ mpAnnotationWindow->RemoveEventListener( LINK(this, AnnotationTag, WindowEventHandler));
+ mpAnnotationWindow->Deactivate();
+ mpAnnotationWindow.reset();
+ }
+}
+
+IMPL_LINK(AnnotationTag, WindowEventHandler, VclWindowEvent*, pEvent)
+{
+ if( pEvent != NULL )
+ {
+ ::Window* pWindow = pEvent->GetWindow();
+
+ if( pWindow )
+ {
+ if( pWindow == mpAnnotationWindow.get() )
+ {
+ if( pEvent->GetId() == VCLEVENT_WINDOW_DEACTIVATE )
+ {
+ if( mnClosePopupEvent )
+ Application::RemoveUserEvent( mnClosePopupEvent );
+
+ mnClosePopupEvent = Application::PostUserEvent( LINK( this, AnnotationTag, ClosePopupHdl ) );
+ }
+ }
+ else if( pWindow == mpListenWindow )
+ {
+ switch( pEvent->GetId() )
+ {
+ case VCLEVENT_WINDOW_MOUSEBUTTONUP:
+ {
+ // if we stop pressing the button without a mouse move we open the popup
+ mpListenWindow->RemoveEventListener( LINK(this, AnnotationTag, WindowEventHandler));
+ mpListenWindow = 0;
+ if( mpAnnotationWindow.get() == 0 )
+ OpenPopup(false);
+ }
+ break;
+ case VCLEVENT_WINDOW_MOUSEMOVE:
+ {
+ // if we move the mouse after a button down we wan't to start draging
+ mpListenWindow->RemoveEventListener( LINK(this, AnnotationTag, WindowEventHandler));
+ mpListenWindow = 0;
+
+ SdrHdl* pHdl = mrView.PickHandle(maMouseDownPos);
+ if( pHdl )
+ {
+ mrView.BrkAction();
+ const USHORT nDrgLog = (USHORT)pWindow->PixelToLogic(Size(DRGPIX,0)).Width();
+
+ rtl::Reference< AnnotationTag > xTag( this );
+
+ SdrDragMethod* pDragMethod = new AnnotationDragMove( mrView, xTag );
+ mrView.BegDragObj(maMouseDownPos, NULL, pHdl, nDrgLog, pDragMethod );
+ }
+ }
+ break;
+ case VCLEVENT_OBJECT_DYING:
+ mpListenWindow = 0;
+ break;
+ }
+ }
+ }
+ }
+ return TRUE;
+}
+
+IMPL_LINK( AnnotationTag, ClosePopupHdl, void *, EMPTYARG )
+{
+ mnClosePopupEvent = 0;
+ ClosePopup();
+ return 0;
+}
+
+} // end of namespace sd
+
diff --git a/sd/source/ui/annotations/annotationtag.hxx b/sd/source/ui/annotations/annotationtag.hxx
new file mode 100644
index 000000000000..cd21f363011f
--- /dev/null
+++ b/sd/source/ui/annotations/annotationtag.hxx
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * 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: motionpathtag.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_ANNOTATIONTAG_HXX_
+#define _SD_ANNOTATIONTAG_HXX_
+
+#include <com/sun/star/office/XAnnotation.hpp>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include "smarttag.hxx"
+
+namespace css = ::com::sun::star;
+
+namespace sd {
+
+class View;
+class AnnotationManagerImpl;
+class AnnotationWindow;
+
+class AnnotationTag : public SmartTag
+{
+public:
+ AnnotationTag( AnnotationManagerImpl& rManager, ::sd::View& rView, const css::uno::Reference< css::office::XAnnotation >& xAnnotation, Color& rColor, int nIndex, const Font& rFont );
+ virtual ~AnnotationTag();
+
+ /** 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 );
+
+ /** returns true if the SmartTag consumes this event. */
+ virtual bool Command( const CommandEvent& rCEvt );
+
+ // callbacks from sdr view
+ virtual ULONG GetMarkablePointCount() const;
+ virtual ULONG GetMarkedPointCount() const;
+ virtual BOOL MarkPoint(SdrHdl& rHdl, BOOL bUnmark=FALSE);
+ virtual void CheckPossibilities();
+ virtual BOOL MarkPoints(const Rectangle* pRect, BOOL bUnmark);
+
+ void Move( int nDX, int nDY );
+ bool OnMove( const KeyEvent& rKEvt );
+
+ // ---
+
+ BitmapEx CreateAnnotationBitmap(bool);
+
+ css::uno::Reference< css::office::XAnnotation > GetAnnotation() const { return mxAnnotation; }
+
+ void OpenPopup( bool bEdit );
+ void ClosePopup();
+
+protected:
+ virtual void addCustomHandles( SdrHdlList& rHandlerList );
+ virtual bool getContext( SdrViewContext& rContext );
+ virtual void disposing();
+ virtual void select();
+ virtual void deselect();
+
+ DECL_LINK( WindowEventHandler, VclWindowEvent* );
+ DECL_LINK( ClosePopupHdl, void* );
+
+private:
+ AnnotationManagerImpl& mrManager;
+ css::uno::Reference< css::office::XAnnotation > mxAnnotation;
+ std::auto_ptr<AnnotationWindow> mpAnnotationWindow;
+ Color maColor;
+ int mnIndex;
+ const Font& mrFont;
+ Size maSize;
+ ULONG mnClosePopupEvent;
+ ::Window* mpListenWindow;
+ Point maMouseDownPos;
+};
+
+} // end of namespace sd
+
+#endif // _SD_ANNOTATIONTAG_HXX_
+
diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx
new file mode 100644
index 000000000000..ae3c65a2b4d5
--- /dev/null
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -0,0 +1,849 @@
+/************************************************************************* *
+ *
+ * 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: postit.cxx,v $
+ * $Revision: 1.8.42.11 $
+ *
+ * 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 "precompiled_sd.hxx"
+
+#include <svx/fontitem.hxx>
+#include <svx/eeitem.hxx>
+#include <svx/fhgtitem.hxx>
+#include <svx/bulitem.hxx>
+#include <svx/udlnitem.hxx>
+#include <svx/shdditem.hxx>
+#include <svx/flditem.hxx>
+#include <svx/frmdir.hxx>
+#include <svx/frmdiritem.hxx>
+#include <svx/langitem.hxx>
+#include <svx/adjitem.hxx>
+#include <svx/editview.hxx>
+#include <svx/svdview.hxx>
+#include <svx/sdrpaintwindow.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
+#include <svx/editstat.hxx> //EditEngine flags
+#include <svx/outliner.hxx>
+#include <svx/editeng.hxx>
+#include <svx/editobj.hxx>
+#include <svx/unolingu.hxx>
+#include <svx/outlobj.hxx>
+#include <svx/postitem.hxx>
+#include <svx/wghtitem.hxx>
+#include <svx/udlnitem.hxx>
+#include <svx/crsditem.hxx>
+
+#include <svtools/langtab.hxx>
+#include <svtools/slstitm.hxx>
+#include <svtools/securityoptions.hxx>
+#include <svtools/useroptions.hxx>
+#include <svtools/languageoptions.hxx>
+#include <svtools/zforlist.hxx>
+#include <svtools/svmedit.hxx>
+
+#include <linguistic/lngprops.hxx>
+
+#include <sfx2/request.hxx>
+#include <sfx2/viewfrm.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/mnumgr.hxx>
+
+#include <vcl/vclenum.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/help.hxx>
+#include <vcl/scrbar.hxx>
+#include <vcl/button.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/gradient.hxx>
+#include <vcl/salbtype.hxx> // FRound
+#include <vcl/cursor.hxx>
+
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/tuple/b2dtuple.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+
+#include "annotations.hrc"
+#include "annotationwindow.hxx"
+#include "annotationmanagerimpl.hxx"
+
+#include "DrawDocShell.hxx"
+#include "ViewShell.hxx"
+#include "drawdoc.hxx"
+#include "View.hxx"
+#include "textapi.hxx"
+#include "sdresid.hxx"
+
+using rtl::OUString;
+using namespace ::sd;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::office;
+using namespace ::com::sun::star::text;
+
+#define METABUTTON_WIDTH 16
+#define METABUTTON_HEIGHT 18
+#define METABUTTON_AREA_WIDTH 30
+#define POSTIT_META_HEIGHT (sal_Int32) 30
+
+#define EMPTYSTRING rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(""))
+
+namespace sd {
+
+extern OUString getAnnotationDateTimeString( const Reference< XAnnotation >& xAnnotation );
+extern SfxItemPool* GetAnnotationPool();
+extern com::sun::star::util::DateTime getCurrentDateTime();
+
+Color ColorFromAlphaColor(UINT8 aTransparency, Color &aFront, Color &aBack )
+{
+ return Color((UINT8)(aFront.GetRed() * aTransparency/(double)255 + aBack.GetRed() * (1-aTransparency/(double)255)),
+ (UINT8)(aFront.GetGreen() * aTransparency/(double)255 + aBack.GetGreen() * (1-aTransparency/(double)255)),
+ (UINT8)(aFront.GetBlue() * aTransparency/(double)255 + aBack.GetBlue() * (1-aTransparency/(double)255)));
+}
+
+/************ AnnotationTextWindow **********************************/
+
+AnnotationTextWindow::AnnotationTextWindow( AnnotationWindow* pParent, WinBits nBits )
+: Control(pParent, nBits)
+, mpOutlinerView(0)
+, mpAnnotationWindow( pParent )
+{
+}
+
+AnnotationTextWindow::~AnnotationTextWindow()
+{
+}
+
+void AnnotationTextWindow::Paint( const Rectangle& rRect)
+{
+ if ( !Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
+ {
+ DrawGradient(Rectangle(Point(0,0),PixelToLogic(GetSizePixel())),
+ Gradient(GRADIENT_LINEAR,mpAnnotationWindow->maColorLight,mpAnnotationWindow->maColor));
+ }
+
+ if( mpOutlinerView )
+ mpOutlinerView->Paint( rRect );
+}
+
+void AnnotationTextWindow::KeyInput( const KeyEvent& rKeyEvt )
+{
+ const KeyCode& rKeyCode = rKeyEvt.GetKeyCode();
+ USHORT nKey = rKeyCode.GetCode();
+
+ if ((rKeyCode.IsMod1() && rKeyCode.IsMod2()) && ((nKey == KEY_PAGEUP) || (nKey == KEY_PAGEDOWN)))
+ {
+ SfxDispatcher* pDispatcher = mpAnnotationWindow->DocShell()->GetViewShell()->GetViewFrame()->GetDispatcher();
+ if( pDispatcher )
+ pDispatcher->Execute( nKey == KEY_PAGEDOWN ? SID_NEXT_POSTIT : SID_PREVIOUS_POSTIT );
+ }
+ else if (nKey == KEY_INSERT)
+ {
+ if (!rKeyCode.IsMod1() && !rKeyCode.IsMod2())
+ mpAnnotationWindow->ToggleInsMode();
+ }
+ else
+ {
+ long aOldHeight = mpAnnotationWindow->GetPostItTextHeight();
+ bool bDone = false;
+
+ /// HACK: need to switch off processing of Undo/Redo in Outliner
+ if ( !( (nKey == KEY_Z || nKey == KEY_Y) && rKeyCode.IsMod1()) )
+ {
+ bool bIsProtected = mpAnnotationWindow->IsProtected();
+ if (!bIsProtected || (bIsProtected && !mpAnnotationWindow->Engine()->GetEditEngine().DoesKeyChangeText(rKeyEvt)) )
+
+ bDone = mpOutlinerView->PostKeyEvent( rKeyEvt );
+ }
+ if (bDone)
+ {
+ mpAnnotationWindow->ResizeIfNeccessary(aOldHeight,mpAnnotationWindow->GetPostItTextHeight());
+ }
+ else
+ {
+ Control::KeyInput(rKeyEvt);
+ }
+ }
+}
+
+void AnnotationTextWindow::MouseMove( const MouseEvent& rMEvt )
+{
+ if ( mpOutlinerView )
+ {
+ mpOutlinerView->MouseMove( rMEvt );
+ SetPointer( mpOutlinerView->GetPointer( rMEvt.GetPosPixel() ) );
+ }
+}
+
+void AnnotationTextWindow::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ GrabFocus();
+ if ( mpOutlinerView )
+ mpOutlinerView->MouseButtonDown( rMEvt );
+ // todo mpOutlinerView->DocView()->GetViewFrame()->GetBindings().InvalidateAll(FALSE);
+}
+
+void AnnotationTextWindow::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ if ( mpOutlinerView )
+ mpOutlinerView->MouseButtonUp( rMEvt );
+}
+
+void AnnotationTextWindow::Command( const CommandEvent& rCEvt )
+{
+ if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+ {
+ mpAnnotationWindow->Command(rCEvt);
+ }
+ else
+ {
+ if ( mpOutlinerView )
+ mpOutlinerView->Command( rCEvt );
+ else
+ Window::Command(rCEvt);
+ }
+}
+
+void AnnotationTextWindow::GetFocus()
+{
+ Window::GetFocus();
+}
+
+void AnnotationTextWindow::LoseFocus()
+{
+// if ( mpAnnotationWindow )
+// mpAnnotationWindow->UpdateAnnotation();
+
+ Window::LoseFocus();
+}
+
+XubString AnnotationTextWindow::GetSurroundingText() const
+{
+ if( mpOutlinerView )
+ {
+ EditEngine *aEditEngine = mpOutlinerView->GetEditView().GetEditEngine();
+ if( mpOutlinerView->HasSelection() )
+ return mpOutlinerView->GetSelected();
+ else
+ {
+ ESelection aSelection = mpOutlinerView->GetEditView().GetSelection();
+ XubString aStr = aEditEngine->GetText(aSelection.nStartPara);
+ return aStr;
+ }
+ }
+ else
+ return XubString::EmptyString();
+}
+
+Selection AnnotationTextWindow::GetSurroundingTextSelection() const
+{
+ if( mpOutlinerView )
+ {
+ if( mpOutlinerView->HasSelection() )
+ return Selection( 0, mpOutlinerView->GetSelected().Len() );
+ else
+ {
+ ESelection aSelection = mpOutlinerView->GetEditView().GetSelection();
+ return Selection( aSelection.nStartPos, aSelection.nEndPos );
+ }
+ }
+ else
+ return Selection( 0, 0 );
+}
+
+/************** AnnotationWindow***********************************++*/
+
+AnnotationWindow::AnnotationWindow( AnnotationManagerImpl& rManager, DrawDocShell* pDocShell, Window* pParent )
+: FloatingWindow(pParent, WB_SYSTEMWINDOW|WB_BORDER|WB_NEEDSFOCUS)
+, mrManager( rManager )
+, mpDocShell( pDocShell )
+, mpView( pDocShell->GetViewShell()->GetView() )
+, mpDoc( pDocShell->GetDoc() )
+, mpOutlinerView(0)
+, mpOutliner(0)
+, mpVScrollbar(0)
+, mbReadonly(pDocShell->IsReadOnly())
+, mbProtected(false)
+, mbMouseOverButton(false)
+, mpTextWindow(0)
+, mpMeta(0)
+{
+}
+
+AnnotationWindow::~AnnotationWindow()
+{
+ delete mpMeta;
+ delete mpOutlinerView;
+ delete mpOutliner;
+ delete mpVScrollbar;
+ delete mpTextWindow;
+}
+
+void AnnotationWindow::InitControls()
+{
+ // actual window which holds the user text
+ mpTextWindow = new AnnotationTextWindow(this, WB_NODIALOGCONTROL);
+ mpTextWindow->SetPointer(Pointer(POINTER_TEXT));
+
+ // window control for author and date
+ mpMeta = new MultiLineEdit(this,0);
+ mpMeta->SetReadOnly();
+ mpMeta->SetRightToLeft(Application::GetSettings().GetLayoutRTL());
+ mpMeta->AlwaysDisableInput(true);
+ mpMeta->SetCallHandlersOnInputDisabled(true);
+
+// mpMeta->AddEventListener( LINK( mpPostItTxt, PostItTxt, WindowEventListener ) );
+// AddEventListener( LINK( mpTextWindow, PostItTxt, WindowEventListener ) );
+
+ // we should leave this setting alone, but for this we need a better layout algo
+ // with variable meta size height
+ AllSettings aSettings = mpMeta->GetSettings();
+ StyleSettings aStyleSettings = aSettings.GetStyleSettings();
+ Font aFont = aStyleSettings.GetFieldFont();
+ aFont.SetHeight(8);
+ aStyleSettings.SetFieldFont(aFont);
+ aSettings.SetStyleSettings(aStyleSettings);
+ mpMeta->SetSettings(aSettings);
+
+ mpOutliner = new ::Outliner(GetAnnotationPool(),OUTLINERMODE_TEXTOBJECT);
+ Doc()->SetCalcFieldValueHdl( mpOutliner );
+ mpOutliner->SetUpdateMode( TRUE );
+ Rescale();
+
+ OutputDevice* pDev = Doc()->GetRefDevice();
+ if( pDev )
+ {
+ mpOutliner->SetRefDevice( pDev );
+ }
+
+ mpOutlinerView = new OutlinerView ( mpOutliner, mpTextWindow );
+ mpOutliner->InsertView(mpOutlinerView );
+ mpTextWindow->SetOutlinerView(mpOutlinerView);
+ mpOutlinerView->SetOutputArea( PixelToLogic( Rectangle(0,0,1,1) ) );
+
+// SfxItemSet item(DocShell()->GetPool());
+// item.Put(SvxFontHeightItem(352,100,EE_CHAR_FONTHEIGHT));
+// mpOutlinerView->SetAttribs(item);
+
+ // TODO: ??
+ EEHorizontalTextDirection aDefHoriTextDir = Application::GetSettings().GetLayoutRTL() ? EE_HTEXTDIR_R2L : EE_HTEXTDIR_L2R;
+ mpOutliner->SetDefaultHorizontalTextDirection( aDefHoriTextDir );
+
+ //create Scrollbars
+ mpVScrollbar = new ScrollBar(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG);
+ mpVScrollbar->EnableNativeWidget(false);
+ mpVScrollbar->EnableRTL( false );
+ mpVScrollbar->SetScrollHdl(LINK(this, AnnotationWindow, ScrollHdl));
+ mpVScrollbar->EnableDrag();
+// mpVScrollbar->AddEventListener( LINK( this, AnnotationWindow, WindowEventListener ) );
+
+ ULONG nCntrl = mpOutliner->GetControlWord();
+ nCntrl |= EE_CNTRL_PASTESPECIAL | EE_CNTRL_AUTOCORRECT | EV_CNTRL_AUTOSCROLL | EE_CNTRL_NOCOLORS;
+/*
+ if (pVOpt->IsFieldShadings())
+ nCntrl |= EE_CNTRL_MARKFIELDS;
+ else
+ nCntrl &= ~EE_CNTRL_MARKFIELDS;
+ if (pVOpt->IsOnlineSpell())
+ nCntrl |= EE_CNTRL_ONLINESPELLING;
+ else
+ nCntrl &= ~EE_CNTRL_ONLINESPELLING;
+*/
+ mpOutliner->SetControlWord(nCntrl);
+// mpOutliner->SetFlatMode( TRUE );
+
+ Engine()->SetModifyHdl( Link() );
+ Engine()->EnableUndo( FALSE );
+
+ Engine()->ClearModifyFlag();
+ Engine()->GetUndoManager().Clear();
+ Engine()->EnableUndo( TRUE );
+ Engine()->SetModifyHdl( LINK( this, AnnotationWindow, ModifyHdl ) );
+
+ Invalidate();
+
+ SetLanguage(GetLanguage());
+
+ mpMeta->Show();
+ mpVScrollbar->Show();
+ mpTextWindow->Show();
+}
+
+void AnnotationWindow::StartEdit()
+{
+ getView()->SetSelection(ESelection(0xFFFF,0xFFFF,0xFFFF,0xFFFF));
+ getView()->ShowCursor();
+}
+
+void AnnotationWindow::Rescale()
+{
+ MapMode aMode(MAP_100TH_MM);
+ aMode.SetOrigin( Point() );
+ //aMode.SetScaleX( aMode.GetScaleX() * Fraction( 8, 10 ) );
+ //aMode.SetScaleY( aMode.GetScaleY() * Fraction( 8, 10 ) );
+ mpOutliner->SetRefMapMode( aMode );
+ SetMapMode( aMode );
+ mpTextWindow->SetMapMode( aMode );
+ if ( mpMeta )
+ {
+ Font aFont( mpMeta->GetSettings().GetStyleSettings().GetFieldFont() );
+ sal_Int32 nHeight = aFont.GetHeight();
+ nHeight = nHeight * aMode.GetScaleY().GetNumerator() / aMode.GetScaleY().GetDenominator();
+ aFont.SetHeight( nHeight );
+ mpMeta->SetControlFont( aFont );
+ }
+}
+
+void AnnotationWindow::DoResize()
+{
+ unsigned long aWidth = GetSizePixel().Width();
+ long aHeight = GetSizePixel().Height() - POSTIT_META_HEIGHT;
+
+ mpOutliner->SetPaperSize( PixelToLogic( Size(aWidth,aHeight) ) ) ;
+ long aTextHeight = LogicToPixel( mpOutliner->CalcTextSize()).Height();
+
+ if( aTextHeight > aHeight )
+ { // we need vertical scrollbars and have to reduce the width
+ aWidth -= GetScrollbarWidth();
+ mpVScrollbar->Show();
+ }
+ else
+ {
+ mpVScrollbar->Hide();
+ }
+
+ mpTextWindow->SetPosSizePixel(0,0,aWidth, aHeight);
+
+ if( mbReadonly )
+ mpMeta->SetPosSizePixel(0,aHeight,GetSizePixel().Width(),POSTIT_META_HEIGHT);
+ else
+ mpMeta->SetPosSizePixel(0,aHeight,GetSizePixel().Width()-METABUTTON_AREA_WIDTH,POSTIT_META_HEIGHT);
+
+ mpOutliner->SetPaperSize( PixelToLogic( Size(aWidth,aHeight) ) ) ;
+ mpOutlinerView->SetOutputArea( PixelToLogic( Rectangle(0,0,aWidth,aHeight) ) );
+ if (!mpVScrollbar->IsVisible())
+ { // if we do not have a scrollbar anymore, we want to see the complete text
+ mpOutlinerView->SetVisArea( PixelToLogic( Rectangle(0,0,aWidth,aHeight) ) );
+ }
+ mpVScrollbar->SetPosSizePixel( 0 + aWidth, 0, GetScrollbarWidth(), aHeight );
+ mpVScrollbar->SetVisibleSize( PixelToLogic(Size(0,aHeight)).Height() );
+ mpVScrollbar->SetPageSize( PixelToLogic(Size(0,aHeight)).Height() * 8 / 10 );
+ mpVScrollbar->SetLineSize( mpOutliner->GetTextHeight() / 10 );
+ SetScrollbar();
+ mpVScrollbar->SetRange( Range(0, mpOutliner->GetTextHeight()));
+
+ Point aPos( mpMeta->GetPosPixel());
+ Point aBase( aPos.X() + aPos.X() + GetSizePixel().Width(), aPos.Y() );
+ Point aLeft = PixelToLogic( Point( aBase.X() - (METABUTTON_WIDTH+5), aBase.Y()+17 ) );
+ Point aRight = PixelToLogic( Point( aBase.X() - (METABUTTON_WIDTH-1), aBase.Y()+17 ) );
+ Point aBottom = PixelToLogic( Point( aBase.X() - (METABUTTON_WIDTH+2), aBase.Y()+20 ) );
+
+ maPopupTriangle.clear();
+ maPopupTriangle.append(basegfx::B2DPoint(aLeft.X(),aLeft.Y()));
+ maPopupTriangle.append(basegfx::B2DPoint(aRight.X(),aRight.Y()));
+ maPopupTriangle.append(basegfx::B2DPoint(aBottom.X(),aBottom.Y()));
+ maPopupTriangle.setClosed(true);
+ maRectMetaButton = PixelToLogic( Rectangle( Point(
+ aPos.X()+GetSizePixel().Width()-(METABUTTON_WIDTH+10),
+ aPos.Y()+5 ),
+ Size( METABUTTON_WIDTH, METABUTTON_HEIGHT ) ) );
+
+}
+
+void AnnotationWindow::SetSizePixel( const Size& rNewSize )
+{
+ Window::SetSizePixel(rNewSize);
+}
+
+void AnnotationWindow::SetScrollbar()
+{
+ mpVScrollbar->SetThumbPos( mpOutlinerView->GetVisArea().Top()+ mpOutlinerView->GetEditView().GetCursor()->GetOffsetY());
+}
+
+void AnnotationWindow::ResizeIfNeccessary(long aOldHeight, long aNewHeight)
+{
+ if (aOldHeight != aNewHeight)
+ {
+ DoResize();
+ Invalidate();
+ }
+ else
+ {
+ SetScrollbar();
+ }
+}
+
+void AnnotationWindow::SetReadonly(bool bSet)
+{
+ mbReadonly = bSet;
+ getView()->SetReadOnly(bSet);
+}
+
+void AnnotationWindow::SetLanguage(const SvxLanguageItem aNewItem)
+{
+ Engine()->SetModifyHdl( Link() );
+ ESelection aOld = getView()->GetSelection();
+
+ ESelection aNewSelection( 0, 0, (USHORT)Engine()->GetParagraphCount()-1, USHRT_MAX );
+ getView()->SetSelection( aNewSelection );
+ SfxItemSet aEditAttr(getView()->GetAttribs());
+ aEditAttr.Put(aNewItem);
+ getView()->SetAttribs( aEditAttr );
+
+ getView()->SetSelection(aOld);
+ Engine()->SetModifyHdl( LINK( this, AnnotationWindow, ModifyHdl ) );
+
+ Invalidate();
+}
+
+void AnnotationWindow::ToggleInsMode()
+{
+ if( mpOutlinerView )
+ {
+ SfxBindings &rBnd = mpDocShell->GetViewShell()->GetViewFrame()->GetBindings();
+ rBnd.Invalidate(SID_ATTR_INSERT);
+ rBnd.Update(SID_ATTR_INSERT);
+ }
+}
+
+long AnnotationWindow::GetPostItTextHeight()
+{
+ return mpOutliner ? LogicToPixel(mpOutliner->CalcTextSize()).Height() : 0;
+}
+
+IMPL_LINK(AnnotationWindow, ScrollHdl, ScrollBar*, pScroll)
+{
+ long nDiff = getView()->GetEditView().GetVisArea().Top() - pScroll->GetThumbPos();
+ getView()->Scroll( 0, nDiff );
+ return 0;
+}
+
+IMPL_LINK(AnnotationWindow, ModifyHdl, void*, EMPTYARG)
+{
+ return 0;
+}
+
+sal_Int32 AnnotationWindow::GetScrollbarWidth()
+{
+ return 16;
+// return mpView->GetWrtShell().GetViewOptions()->GetZoom() / 10;
+}
+
+SvxLanguageItem AnnotationWindow::GetLanguage(void)
+{
+ return SvxLanguageItem( Doc()->GetLanguage( EE_CHAR_LANGUAGE ), SID_ATTR_LANGUAGE );
+}
+
+// --------------------------------------------------------------------
+
+TextApiObject* getTextApiObject( const Reference< XAnnotation >& xAnnotation )
+{
+ if( xAnnotation.is() )
+ {
+ Reference< XText > xText( xAnnotation->getTextRange() );
+ return TextApiObject::getImplementation( xText );
+ }
+ return 0;
+}
+
+// --------------------------------------------------------------------
+
+void AnnotationWindow::setAnnotation( const Reference< XAnnotation >& xAnnotation, bool bGrabFocus )
+{
+ if( (xAnnotation != mxAnnotation) && xAnnotation.is() )
+ {
+ mxAnnotation = xAnnotation;
+
+ SetColor();
+
+ SvtUserOptions aUserOptions;
+ mbProtected = aUserOptions.GetFullName() != xAnnotation->getAuthor();
+
+ Engine()->Clear();
+ TextApiObject* pTextApi = getTextApiObject( mxAnnotation );
+
+ if( pTextApi )
+ {
+ std::auto_ptr< OutlinerParaObject > pOPO( pTextApi->CreateText() );
+ Engine()->SetText( *pOPO.get() );
+ }
+
+ Engine()->SetModifyHdl( LINK( this, AnnotationWindow, ModifyHdl ) );
+ Engine()->ClearModifyFlag();
+ Engine()->GetUndoManager().Clear();
+
+ Invalidate();
+
+ OUString sMeta( xAnnotation->getAuthor() );
+ OUString sDateTime( getAnnotationDateTimeString(xAnnotation) );
+
+ if( sDateTime.getLength() != 0 )
+ {
+ if( sMeta.getLength() != 0 )
+ sMeta += OUString( RTL_CONSTASCII_USTRINGPARAM( "\n" ) );
+
+ sMeta += sDateTime;
+ }
+ mpMeta->SetText(sMeta);
+
+ if( bGrabFocus )
+ GrabFocus();
+ }
+}
+
+void AnnotationWindow::SetColor()
+{
+ sal_uInt16 nAuthorIdx = mpDoc->GetAnnotationAuthorIndex( mxAnnotation->getAuthor() );
+
+ maColor = mrManager.GetColor( nAuthorIdx );
+ maColorDark = mrManager.GetColorDark( nAuthorIdx );
+ maColorLight = mrManager.GetColorLight( nAuthorIdx );
+
+ mpOutlinerView->SetBackgroundColor(maColor);
+
+ mpMeta->SetControlBackground(maColor);
+ AllSettings aSettings = mpMeta->GetSettings();
+ StyleSettings aStyleSettings = aSettings.GetStyleSettings();
+ aStyleSettings.SetFieldTextColor(maColorDark);
+ aSettings.SetStyleSettings(aStyleSettings);
+ mpMeta->SetSettings(aSettings);
+
+ AllSettings aSettings2 = mpVScrollbar->GetSettings();
+ StyleSettings aStyleSettings2 = aSettings2.GetStyleSettings();
+ aStyleSettings2.SetButtonTextColor(Color(0,0,0));
+ aStyleSettings2.SetCheckedColor(maColorLight); //hintergund
+ aStyleSettings2.SetShadowColor(maColorDark);
+ aStyleSettings2.SetFaceColor(maColor);
+ aSettings2.SetStyleSettings(aStyleSettings2);
+ mpVScrollbar->SetSettings(aSettings2);
+}
+
+void AnnotationWindow::Deactivate()
+{
+ Reference< XAnnotation > xAnnotation( mxAnnotation );
+/*
+ // check if text is empty
+ Paragraph* p1stPara=Engine()->GetParagraph( 0 );
+ ULONG nParaAnz=Engine()->GetParagraphCount();
+ if(p1stPara==NULL)
+ nParaAnz=0;
+
+ if(nParaAnz==1)
+ {
+ // if it is only one paragraph, check if that paragraph is empty
+ XubString aStr(Engine()->GetText(p1stPara));
+
+ if(!aStr.Len())
+ nParaAnz = 0;
+ }
+
+ if( nParaAnz == 0 )
+ {
+ // text is empty, delete postit
+ DeleteAnnotation( xAnnotation );
+ }
+ else
+*/
+ {
+ // write changed text back to annotation
+ if ( Engine()->IsModified() )
+ {
+ TextApiObject* pTextApi = getTextApiObject( xAnnotation );
+
+ if( pTextApi )
+ {
+ OutlinerParaObject* pOPO = Engine()->CreateParaObject();
+ if( pOPO )
+ {
+ if( mpDoc->IsUndoEnabled() )
+ mpDoc->BegUndo( String( SdResId( STR_ANNOTATION_UNDO_EDIT ) ) );
+
+ pTextApi->SetText( *pOPO );
+ delete pOPO;
+
+ // set current time to changed annotation
+ xAnnotation->setDateTime( getCurrentDateTime() );
+
+ if( mpDoc->IsUndoEnabled() )
+ mpDoc->EndUndo();
+
+ DocView()->GetDocSh()->SetModified(sal_True);
+ }
+
+ }
+ }
+ Engine()->ClearModifyFlag();
+ }
+
+ Engine()->GetUndoManager().Clear();
+}
+
+void AnnotationWindow::Paint( const Rectangle& rRect)
+{
+ FloatingWindow::Paint( rRect );
+
+ if(mpMeta->IsVisible() && !mbReadonly)
+ {
+ //draw left over space
+ if ( Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
+ SetFillColor(COL_BLACK);
+ else
+ SetFillColor(maColor);
+ SetLineColor();
+ DrawRect(PixelToLogic(Rectangle(Point(mpMeta->GetPosPixel().X()+mpMeta->GetSizePixel().Width(),mpMeta->GetPosPixel().Y()),Size(METABUTTON_AREA_WIDTH,mpMeta->GetSizePixel().Height()))));
+
+ if ( Application::GetSettings().GetStyleSettings().GetHighContrastMode())
+ {
+ //draw rect around button
+ SetFillColor(COL_BLACK);
+ SetLineColor(COL_WHITE);
+ }
+ else
+ {
+ //draw button
+ Gradient aGradient;
+ if (mbMouseOverButton)
+ aGradient = Gradient(GRADIENT_LINEAR,ColorFromAlphaColor(80,maColorDark,maColor),ColorFromAlphaColor(15,maColorDark,maColor));
+ else
+ aGradient = Gradient(GRADIENT_LINEAR,ColorFromAlphaColor(15,maColorDark,maColor),ColorFromAlphaColor(80,maColorDark,maColor));
+ DrawGradient(maRectMetaButton,aGradient);
+ //draw rect around button
+ SetFillColor();
+ SetLineColor(ColorFromAlphaColor(90,maColorDark,maColor));
+ }
+ DrawRect(maRectMetaButton);
+
+ //draw arrow
+ if ( Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
+ SetFillColor(COL_WHITE);
+ else
+ SetFillColor(COL_BLACK);
+ SetLineColor();
+ DrawPolygon(Polygon(maPopupTriangle));
+ }
+}
+
+void AnnotationWindow::MouseMove( const MouseEvent& rMEvt )
+{
+ if( !mbReadonly )
+ {
+ if (maRectMetaButton.IsInside(PixelToLogic(rMEvt.GetPosPixel())))
+ {
+ if (!mbMouseOverButton)
+ {
+ Invalidate(maRectMetaButton);
+ mbMouseOverButton = true;
+ }
+ }
+ else
+ {
+ if (mbMouseOverButton)
+ {
+ Invalidate(maRectMetaButton);
+ mbMouseOverButton = false;
+ }
+ }
+ }
+}
+
+void AnnotationWindow::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if (!mbReadonly && maRectMetaButton.IsInside(PixelToLogic(rMEvt.GetPosPixel())) && rMEvt.IsLeft())
+ {
+ // context menu
+ Rectangle aRect(LogicToPixel(maRectMetaButton.BottomLeft()),LogicToPixel(maRectMetaButton.BottomLeft()));
+ mrManager.ExecuteAnnotationContextMenu( mxAnnotation, (::Window*)this, aRect, true );
+ }
+}
+
+void AnnotationWindow::Command( const CommandEvent& rCEvt )
+{
+ if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+ {
+ mrManager.ExecuteAnnotationContextMenu( mxAnnotation, this, Rectangle(rCEvt.GetMousePosPixel(),Size(1,1)) );
+ }
+ else
+ {
+ FloatingWindow::Command(rCEvt);
+ }
+}
+
+void AnnotationWindow::GetFocus()
+{
+ if( mpTextWindow )
+ mpTextWindow->GrabFocus();
+ else
+ FloatingWindow::GetFocus();
+}
+
+void AnnotationWindow::ExecuteSlot( USHORT nSID )
+{
+ if( nSID == SID_COPY )
+ {
+ getView()->Copy();
+ }
+ else if( nSID == SID_PASTE )
+ {
+ getView()->PasteSpecial();
+ DoResize();
+ }
+ else
+ {
+ SfxItemSet aEditAttr(getView()->GetAttribs());
+ SfxItemSet aNewAttr(mpOutliner->GetEmptyItemSet());
+
+ switch( nSID )
+ {
+ case SID_ATTR_CHAR_WEIGHT:
+ {
+ FontWeight eFW = ( (const SvxWeightItem&) aEditAttr.Get( EE_CHAR_WEIGHT ) ).GetWeight();
+ aNewAttr.Put( SvxWeightItem( eFW == WEIGHT_NORMAL ? WEIGHT_BOLD : WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
+ }
+ break;
+ case SID_ATTR_CHAR_POSTURE:
+ {
+ FontItalic eFI = ( (const SvxPostureItem&) aEditAttr.Get( EE_CHAR_ITALIC ) ).GetPosture();
+ aNewAttr.Put( SvxPostureItem( eFI == ITALIC_NORMAL ? ITALIC_NONE : ITALIC_NORMAL, EE_CHAR_ITALIC ) );
+ }
+ break;
+ case SID_ATTR_CHAR_UNDERLINE:
+ {
+ FontUnderline eFU = ( (const SvxUnderlineItem&) aEditAttr. Get( EE_CHAR_UNDERLINE ) ).GetLineStyle();
+ aNewAttr.Put( SvxUnderlineItem( eFU == UNDERLINE_SINGLE ? UNDERLINE_NONE : UNDERLINE_SINGLE, EE_CHAR_UNDERLINE ) );
+ }
+ break;
+ case SID_ATTR_CHAR_STRIKEOUT:
+ {
+ FontStrikeout eFSO = ( ( (const SvxCrossedOutItem&) aEditAttr.Get( EE_CHAR_STRIKEOUT ) ).GetStrikeout() );
+ aNewAttr.Put( SvxCrossedOutItem( eFSO == STRIKEOUT_SINGLE ? STRIKEOUT_NONE : STRIKEOUT_SINGLE, EE_CHAR_STRIKEOUT ) );
+ }
+ break;
+ }
+ getView()->SetAttribs( aNewAttr );
+ }
+}
+
+}
diff --git a/sd/source/ui/annotations/annotationwindow.hxx b/sd/source/ui/annotations/annotationwindow.hxx
new file mode 100644
index 000000000000..bdfe36c4ebf2
--- /dev/null
+++ b/sd/source/ui/annotations/annotationwindow.hxx
@@ -0,0 +1,180 @@
+/*************************************************************************
+ *
+ * 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: postit.hxx,v $
+ *
+ * $Revision: 1.8.84.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.
+ *
+ ************************************************************************/
+
+#ifndef _ANNOTATIONWINDOW_HXX
+#define _ANNOTATIONWINDOW_HXX
+
+#include <com/sun/star/office/XAnnotation.hpp>
+
+#include <tools/datetime.hxx>
+#include <tools/date.hxx>
+
+#include <vcl/ctrl.hxx>
+#include <vcl/lineinfo.hxx>
+#include <vcl/floatwin.hxx>
+
+#include <basegfx/polygon/b2dpolygon.hxx>
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+#include <svx/editstat.hxx>
+
+class OutlinerView;
+class Outliner;
+class ScrollBar;
+class Edit;
+class MultiLineEdit;
+class PopupMenu;
+class SvxLanguageItem;
+class OutlinerParaObject;
+class SdDrawDocument;
+
+namespace sd {
+
+class AnnotationManagerImpl;
+class AnnotationWindow;
+class DrawDocShell;
+class View;
+
+class AnnotationTextWindow : public Control
+{
+private:
+ OutlinerView* mpOutlinerView;
+ AnnotationWindow* mpAnnotationWindow;
+
+protected:
+ virtual void Paint( const Rectangle& rRect);
+ virtual void KeyInput( const KeyEvent& rKeyEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void LoseFocus();
+
+public:
+ AnnotationTextWindow( AnnotationWindow* pParent, WinBits nBits );
+ ~AnnotationTextWindow();
+
+ void SetOutlinerView( OutlinerView* pOutlinerView ) { mpOutlinerView = pOutlinerView; }
+
+ virtual XubString GetSurroundingText() const;
+ virtual Selection GetSurroundingTextSelection() const;
+
+ virtual void GetFocus();
+};
+
+
+class AnnotationWindow : public FloatingWindow
+{
+ private:
+ AnnotationManagerImpl& mrManager;
+ DrawDocShell* mpDocShell;
+ View* mpView;
+ SdDrawDocument* mpDoc;
+
+ OutlinerView* mpOutlinerView;
+ Outliner* mpOutliner;
+ ScrollBar* mpVScrollbar;
+ ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > mxAnnotation;
+ bool mbReadonly;
+ bool mbProtected;
+ bool mbMouseOverButton;
+ AnnotationTextWindow* mpTextWindow;
+ MultiLineEdit* mpMeta;
+ Rectangle maRectMetaButton;
+ basegfx::B2DPolygon maPopupTriangle;
+
+ protected:
+ void SetSizePixel( const Size& rNewSize );
+
+ DECL_LINK(ModifyHdl, void*);
+ DECL_LINK(ScrollHdl, ScrollBar*);
+
+ public:
+ AnnotationWindow( AnnotationManagerImpl& rManager, DrawDocShell* pDocShell, ::Window* pParent );
+ virtual ~AnnotationWindow();
+
+ void StartEdit();
+
+ virtual SvxLanguageItem GetLanguage(void);
+
+ void setAnnotation( const ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation >& xAnnotation, bool bGrabFocus = false );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation >& getAnnotation() const { return mxAnnotation; }
+
+ void ExecuteSlot( USHORT nSID );
+
+ ScrollBar* Scrollbar() { return mpVScrollbar;}
+
+ DrawDocShell* DocShell() { return mpDocShell; }
+ OutlinerView* getView() { return mpOutlinerView; }
+ sd::View* DocView() { return mpView; }
+ Outliner* Engine() { return mpOutliner; }
+ SdDrawDocument* Doc() { return mpDoc; }
+
+ long GetPostItTextHeight();
+
+ void InitControls();
+ void HidePostIt();
+ void DoResize();
+ void ResizeIfNeccessary(long aOldHeight, long aNewHeight);
+ void SetScrollbar();
+
+ void Rescale();
+
+ void SetReadonly(bool bSet);
+ bool IsReadOnly() { return mbReadonly;}
+
+ bool IsProtected() { return mbProtected; }
+
+ void SetLanguage(const SvxLanguageItem aNewItem);
+
+ sal_Int32 GetScrollbarWidth();
+
+ void ToggleInsMode();
+
+ DECL_LINK( OnlineSpellCallback, SpellCallbackInfo*);
+
+ virtual void Deactivate();
+ virtual void Paint( const Rectangle& rRect);
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void GetFocus();
+
+ void SetColor();
+
+ Color maColor;
+ Color maColorDark;
+ Color maColorLight;
+};
+
+} // namespace sd
+
+#endif
diff --git a/sd/source/ui/annotations/makefile.mk b/sd/source/ui/annotations/makefile.mk
new file mode 100644
index 000000000000..f457474c6990
--- /dev/null
+++ b/sd/source/ui/annotations/makefile.mk
@@ -0,0 +1,60 @@
+#*************************************************************************
+#
+# 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: makefile.mk,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.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PROJECTPCH=sd
+PROJECTPCHSOURCE=$(PRJ)$/util$/sd
+PRJNAME=sd
+TARGET=uiannotations
+ENABLE_EXCEPTIONS=TRUE
+AUTOSEG=true
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+
+# --- Files --------------------------------------------------------
+
+SRS1NAME=$(TARGET)
+SRC1FILES =\
+ annotations.src
+
+SLOFILES = \
+ $(SLO)$/annotationwindow.obj \
+ $(SLO)$/annotationtag.obj \
+ $(SLO)$/annotationmanager.obj
+
+
+# --- Tagets -------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/sd/source/ui/app/app.src b/sd/source/ui/app/app.src
index 02ae0e937828..957cd6c25f53 100644
--- a/sd/source/ui/app/app.src
+++ b/sd/source/ui/app/app.src
@@ -36,31 +36,3 @@
#include "misc.hxx"
#include <svx/svxids.hrc>
-//
-// Acceleratorn
-//
-
-// Impress
-#include "accel.src"
-
-// Draw (Graphic)
-#undef SD_ACCELERATOR
-#define SD_ACCELERATOR RID_GRAPHIC_DEFAULTACCEL
-#include "accel.src"
-
-//
-// Menu
-//
-
-// Menu (Impress)
-#include "menu.src"
-#include "menuportal.src"
-
-// Menu (Draw (Graphic))
-#undef SD_MENU
-#define SD_MENU RID_GRAPHIC_DEFAULTMENU
-#undef SD_MENU_PORTAL
-#define SD_MENU_PORTAL RID_GRAPHIC_PORTALMENU
-
-#include "menu.src"
-#include "menuportal.src"
diff --git a/sd/source/ui/app/makefile.mk b/sd/source/ui/app/makefile.mk
index f9db62ee70df..82a6177a9e95 100644
--- a/sd/source/ui/app/makefile.mk
+++ b/sd/source/ui/app/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# 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
@@ -106,7 +106,7 @@ $(INCCOM)$/sddll0.hxx: makefile.mk
.ENDIF # "$(USE_SHELL)"!="4nt"
.ENDIF # "$(GUI)"=="UNX"
-LOCALIZE_ME = tbxids_tmpl.src menuids2_tmpl.src accel_tmpl.src menu_tmpl.src menuids_tmpl.src menuids4_tmpl.src popup2_tmpl.src toolbox2_tmpl.src accelids_tmpl.src menuportal_tmpl.src menuids3_tmpl.src
+LOCALIZE_ME = tbxids_tmpl.src menuids2_tmpl.src menu_tmpl.src menuids_tmpl.src menuids4_tmpl.src popup2_tmpl.src toolbox2_tmpl.src menuportal_tmpl.src menuids3_tmpl.src
.INCLUDE : target.mk
diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx
index 122d0263164f..673e00477d46 100644
--- a/sd/source/ui/app/optsitem.cxx
+++ b/sd/source/ui/app/optsitem.cxx
@@ -527,6 +527,7 @@ SdOptionsMisc::SdOptionsMisc( USHORT nConfigId, BOOL bUseConfig ) :
// #90356#
bShowUndoDeleteWarning( TRUE ),
bSlideshowRespectZOrder( TRUE ),
+ bShowComments( TRUE ),
bPreviewNewEffects( TRUE ),
bPreviewChangedEffects( FALSE ),
bPreviewTransitions( TRUE ),
@@ -569,6 +570,7 @@ void SdOptionsMisc::SetDefaults()
SetPreviewChangedEffects(false);
SetPreviewTransitions(true);
SetDisplay(0);
+ SetShowComments(true);
}
// -----------------------------------------------------------------------------
@@ -601,8 +603,8 @@ BOOL SdOptionsMisc::operator==( const SdOptionsMisc& rOpt ) const
IsPreviewNewEffects() == rOpt.IsPreviewNewEffects() &&
IsPreviewChangedEffects() == rOpt.IsPreviewChangedEffects() &&
IsPreviewTransitions() == rOpt.IsPreviewTransitions() &&
- GetDisplay() == rOpt.GetDisplay()
-
+ GetDisplay() == rOpt.GetDisplay() &&
+ IsShowComments() == rOpt.IsShowComments()
);
}
@@ -630,6 +632,8 @@ void SdOptionsMisc::GetPropNameArray( const char**& ppNames, ULONG& rCount ) con
"Compatibility/PrinterIndependentLayout",
+ "ShowComments",
+
// just for impress
"NewDoc/AutoPilot",
"Start/CurrentPage",
@@ -645,9 +649,7 @@ void SdOptionsMisc::GetPropNameArray( const char**& ppNames, ULONG& rCount ) con
"Display"
};
- // #90356# rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 15 : 12 );
- // #97016# rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 16 : 12 );
- rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 24 : 15 );
+ rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 25 : 16 );
ppNames = aPropNames;
}
@@ -672,33 +674,35 @@ BOOL SdOptionsMisc::ReadData( const Any* pValues )
if( pValues[13].hasValue() ) SetDefaultObjectSizeHeight( *(sal_uInt32*) pValues[ 13 ].getValue() );
if( pValues[14].hasValue() ) SetPrinterIndependentLayout( *(sal_uInt16*) pValues[ 14 ].getValue() );
+ if( pValues[15].hasValue() ) SetShowComments( *(sal_Bool*) pValues[ 11 ].getValue() );
+
// just for Impress
if( GetConfigId() == SDCFG_IMPRESS )
{
- if( pValues[15].hasValue() )
- SetStartWithTemplate( *(sal_Bool*) pValues[ 15 ].getValue() );
if( pValues[16].hasValue() )
- SetStartWithActualPage( *(sal_Bool*) pValues[ 16 ].getValue() );
+ SetStartWithTemplate( *(sal_Bool*) pValues[ 16 ].getValue() );
if( pValues[17].hasValue() )
- SetSummationOfParagraphs( *(sal_Bool*) pValues[ 17 ].getValue() );
- // #90356#
+ SetStartWithActualPage( *(sal_Bool*) pValues[ 17 ].getValue() );
if( pValues[18].hasValue() )
- SetShowUndoDeleteWarning( *(sal_Bool*) pValues[ 18 ].getValue() );
-
+ SetSummationOfParagraphs( *(sal_Bool*) pValues[ 18 ].getValue() );
+ // #90356#
if( pValues[19].hasValue() )
- SetSlideshowRespectZOrder(*(sal_Bool*) pValues[ 19 ].getValue());
+ SetShowUndoDeleteWarning( *(sal_Bool*) pValues[ 19 ].getValue() );
if( pValues[20].hasValue() )
- SetPreviewNewEffects(*(sal_Bool*) pValues[ 20 ].getValue());
+ SetSlideshowRespectZOrder(*(sal_Bool*) pValues[ 20 ].getValue());
if( pValues[21].hasValue() )
- SetPreviewChangedEffects(*(sal_Bool*) pValues[ 21 ].getValue());
+ SetPreviewNewEffects(*(sal_Bool*) pValues[ 21 ].getValue());
if( pValues[22].hasValue() )
- SetPreviewTransitions(*(sal_Bool*) pValues[ 22 ].getValue());
+ SetPreviewChangedEffects(*(sal_Bool*) pValues[ 22 ].getValue());
if( pValues[23].hasValue() )
- SetDisplay(*(sal_Int32*) pValues[ 23 ].getValue());
+ SetPreviewTransitions(*(sal_Bool*) pValues[ 23 ].getValue());
+
+ if( pValues[24].hasValue() )
+ SetDisplay(*(sal_Int32*) pValues[ 24 ].getValue());
}
return TRUE;
@@ -725,22 +729,23 @@ BOOL SdOptionsMisc::WriteData( Any* pValues ) const
pValues[ 12 ] <<= GetDefaultObjectSizeWidth();
pValues[ 13 ] <<= GetDefaultObjectSizeHeight();
pValues[ 14 ] <<= GetPrinterIndependentLayout();
+ pValues[ 15 ] <<= (sal_Bool)IsShowComments();
// just for Impress
if( GetConfigId() == SDCFG_IMPRESS )
{
- pValues[ 15 ] <<= IsStartWithTemplate();
- pValues[ 16 ] <<= IsStartWithActualPage();
- pValues[ 17 ] <<= IsSummationOfParagraphs();
+ pValues[ 16 ] <<= IsStartWithTemplate();
+ pValues[ 17 ] <<= IsStartWithActualPage();
+ pValues[ 18 ] <<= IsSummationOfParagraphs();
// #90356#
- pValues[ 18 ] <<= IsShowUndoDeleteWarning();
- pValues[ 19 ] <<= IsSlideshowRespectZOrder();
+ pValues[ 19 ] <<= IsShowUndoDeleteWarning();
+ pValues[ 20 ] <<= IsSlideshowRespectZOrder();
- pValues[ 20 ] <<= IsPreviewNewEffects();
- pValues[ 21 ] <<= IsPreviewChangedEffects();
- pValues[ 22 ] <<= IsPreviewTransitions();
+ pValues[ 21 ] <<= IsPreviewNewEffects();
+ pValues[ 22 ] <<= IsPreviewChangedEffects();
+ pValues[ 23 ] <<= IsPreviewTransitions();
- pValues[ 23 ] <<= GetDisplay();
+ pValues[ 24 ] <<= GetDisplay();
}
return TRUE;
diff --git a/sd/source/ui/app/res_bmp.src b/sd/source/ui/app/res_bmp.src
index 11c711376f2a..4796be585d1e 100644
--- a/sd/source/ui/app/res_bmp.src
+++ b/sd/source/ui/app/res_bmp.src
@@ -554,3 +554,11 @@ Bitmap BMP_FADE_EFFECT_INDICATOR_H
{
File = "fade_effect_indicator_hc.bmp";
};
+Bitmap BMP_COMMENTS_INDICATOR
+{
+ File = "comments_indicator.bmp";
+};
+Bitmap BMP_COMMENTS_INDICATOR_H
+{
+ File = "comments_indicator_hc.bmp";
+}; \ No newline at end of file
diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx
index 45ff6cf52d7e..f7e74a481740 100644
--- a/sd/source/ui/app/sdmod.cxx
+++ b/sd/source/ui/app/sdmod.cxx
@@ -131,6 +131,11 @@ SdModule::SdModule(SfxObjectFactory* pFact1, SfxObjectFactory* pFact2 )
SdModule::~SdModule()
{
+ // Mark the module in the global AppData structure as deleted.
+ SdModule** ppShellPointer = (SdModule**)GetAppData(SHL_DRAW);
+ if (ppShellPointer != NULL)
+ (*ppShellPointer) = NULL;
+
delete pSearchItem;
if( pNumberFormatter )
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index 54a0ba111927..f22af4ad2887 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -481,6 +481,9 @@ void SdTransferable::AddSupportedFormats()
sal_Bool SdTransferable::GetData( const DataFlavor& rFlavor )
{
+ if (SD_MOD()==NULL)
+ return sal_False;
+
sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor );
sal_Bool bOK = sal_False;
diff --git a/sd/source/ui/app/strings.src b/sd/source/ui/app/strings.src
index 364fe567f990..696e92940b9f 100644
--- a/sd/source/ui/app/strings.src
+++ b/sd/source/ui/app/strings.src
@@ -1269,5 +1269,7 @@ String STR_SET_BACKGROUND_PICTURE
{
Text [ en-US ] = "Set Background Picture for Slide ..." ;
};
-
-
+String RID_ANNOTATIONS_START
+{
+ Text [ en-US ] = "Comments";
+};
diff --git a/sd/source/ui/dlg/ins_paste.cxx b/sd/source/ui/dlg/ins_paste.cxx
index 422acbec4a73..9f2c3bf0b6b6 100644
--- a/sd/source/ui/dlg/ins_paste.cxx
+++ b/sd/source/ui/dlg/ins_paste.cxx
@@ -31,10 +31,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sd.hxx"
-#ifdef SD_DLLIMPLEMENTATION
-#undef SD_DLLIMPLEMENTATION
-#endif
-
#include "ins_paste.hrc"
#include "ins_paste.hxx"
diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx
index c3375ed67c2c..748d34a94c6c 100644
--- a/sd/source/ui/dlg/prltempl.cxx
+++ b/sd/source/ui/dlg/prltempl.cxx
@@ -171,6 +171,10 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell* pDocSh,
AddTabPage( RID_SVXPAGE_CHAR_EFFECTS );
AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );
AddTabPage( RID_SVXPAGE_TEXTATTR );
+ AddTabPage( RID_SVXPAGE_PICK_BULLET );
+ AddTabPage( RID_SVXPAGE_PICK_SINGLE_NUM );
+ AddTabPage( RID_SVXPAGE_PICK_BMP );
+ AddTabPage( RID_SVXPAGE_NUM_OPTIONS );
AddTabPage( RID_SVXPAGE_TABULATOR );
}
break;
diff --git a/sd/source/ui/dlg/prltempl.src b/sd/source/ui/dlg/prltempl.src
index 800b5558c5ad..49b8e67a613c 100644
--- a/sd/source/ui/dlg/prltempl.src
+++ b/sd/source/ui/dlg/prltempl.src
@@ -92,6 +92,30 @@ TabDialog TAB_PRES_LAYOUT_TEMPLATE
PageResID = RID_SVXPAGE_TEXTATTR ;
Text [ en-US ] = "Text" ;
};
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_PICK_BULLET ;
+ PageResID = RID_SVXPAGE_PICK_BULLET ;
+ Text [ en-US ] = "Bullets" ;
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_PICK_SINGLE_NUM ;
+ PageResID = RID_SVXPAGE_PICK_SINGLE_NUM ;
+ Text [ en-US ] = "Numbering type" ;
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_PICK_BMP ;
+ PageResID = RID_SVXPAGE_PICK_BMP ;
+ Text [ en-US ] = "Graphics" ;
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_NUM_OPTIONS ;
+ PageResID = RID_SVXPAGE_NUM_OPTIONS ;
+ Text [ en-US ] = "Customize" ;
+ };
PageItem
{
Identifier = RID_SVXPAGE_ALIGN_PARAGRAPH ;
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 09f2b1b09c5b..9d335b859e31 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -86,7 +86,13 @@ public:
};
-BOOL SdPageObjsTLB::bIsInDrag = FALSE;
+BOOL SD_DLLPRIVATE SdPageObjsTLB::bIsInDrag = FALSE;
+
+BOOL SdPageObjsTLB::IsInDrag()
+{
+ return bIsInDrag;
+}
+
sal_uInt32 SdPageObjsTLB::SdPageObjsTransferable::mnListBoxDropFormatId = SAL_MAX_UINT32;
// -----------------------------------------
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
index f66c1d130564..f9381d08a219 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -118,9 +118,6 @@ namespace sd {
GraphicFilter* GetGrfFilter();
-SfxProgress* DrawDocShell::mpSpecialProgress = NULL;
-Link* DrawDocShell::mpSpecialProgressHdl = NULL;
-
/*************************************************************************
|*
|* SFX-Slotmaps und -Definitionen
@@ -526,7 +523,6 @@ void DrawDocShell::ApplySlotFilter() const
}
}
-
void DrawDocShell::SetModified( BOOL bSet /* = TRUE */ )
{
SfxObjectShell::SetModified( bSet );
diff --git a/sd/source/ui/framework/configuration/ConfigurationController.cxx b/sd/source/ui/framework/configuration/ConfigurationController.cxx
index 731b9d6963c0..ef7fd4cdbf00 100644
--- a/sd/source/ui/framework/configuration/ConfigurationController.cxx
+++ b/sd/source/ui/framework/configuration/ConfigurationController.cxx
@@ -59,7 +59,7 @@ using rtl::OUString;
using ::sd::framework::FrameworkHelper;
#undef VERBOSE
-//#define VERBOSE 3
+#define VERBOSE 3
namespace sd { namespace framework {
diff --git a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx
index 5721f483595f..e2aab7316937 100644
--- a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx
+++ b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx
@@ -49,7 +49,7 @@ using ::rtl::OUString;
using ::std::vector;
#undef VERBOSE
-//#define VERBOSE 2
+#define VERBOSE 2
namespace {
static const sal_Int32 snShortTimeout (100);
diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx b/sd/source/ui/framework/factories/FullScreenPane.cxx
index 18a2503c23ab..b6029400ff63 100644
--- a/sd/source/ui/framework/factories/FullScreenPane.cxx
+++ b/sd/source/ui/framework/factories/FullScreenPane.cxx
@@ -36,10 +36,13 @@
#include <cppcanvas/vclfactory.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/topfrm.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/dialog.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/util/URL.hpp>
using namespace ::com::sun::star;
@@ -47,6 +50,8 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing::framework;
using ::rtl::OUString;
+#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
+
namespace sd { namespace framework {
FullScreenPane::FullScreenPane (
@@ -55,8 +60,13 @@ FullScreenPane::FullScreenPane (
const ::Window* pViewShellWindow)
: FrameWindowPane(rxPaneId,NULL),
mxComponentContext(rxComponentContext),
- mpWorkWindow(new WorkWindow(NULL, 0))
+ mpWorkWindow(NULL)
{
+ ::Window* pParent = NULL;
+ mpWorkWindow.reset(new WorkWindow(
+ pParent,
+ 0)); // For debugging (non-fullscreen) use WB_BORDER | WB_MOVEABLE | WB_SIZEABLE));
+
if ( ! rxPaneId.is())
throw lang::IllegalArgumentException();
@@ -68,10 +78,18 @@ FullScreenPane::FullScreenPane (
// Create a new top-leve window that is displayed full screen.
mpWorkWindow->ShowFullScreenMode(TRUE, nScreenNumber);
+ // For debugging (non-fullscreen) use mpWorkWindow->SetScreenNumber(nScreenNumber);
mpWorkWindow->SetMenuBarMode(MENUBAR_MODE_HIDE);
mpWorkWindow->SetBorderStyle(WINDOW_BORDER_REMOVEBORDER);
mpWorkWindow->SetBackground(Wallpaper());
- mpWorkWindow->Show();
+ // Don't show the window right now in order to allow the setting of an
+ // accessibility object: accessibility objects are typically
+ // requested by AT-tools when the window is shown. Chaning it
+ // afterwards may or may not work.
+
+ // Add resize listener at the work window.
+ Link aWindowEventHandler (LINK(this, FullScreenPane, WindowEventHandler));
+ mpWorkWindow->AddEventListener(aWindowEventHandler);
// Set title and icon of the new window to those of the current window
// of the view shell.
@@ -87,7 +105,6 @@ FullScreenPane::FullScreenPane (
// completely.
mpWindow = new ::Window(mpWorkWindow.get());
mpWindow->SetPosSizePixel(Point(0,0), mpWorkWindow->GetSizePixel());
- mpWindow->Show();
mpWindow->SetBackground(Wallpaper());
mxWindow = VCLUnoHelper::GetInterface(mpWindow);
@@ -115,7 +132,13 @@ void SAL_CALL FullScreenPane::disposing (void)
delete mpWindow;
}
- mpWorkWindow.reset();
+ if (mpWorkWindow.get() != NULL)
+ {
+ Link aWindowEventHandler (LINK(this, FullScreenPane, WindowEventHandler));
+ mpWorkWindow->RemoveEventListener(aWindowEventHandler);
+ mpWorkWindow.reset();
+ }
+
FrameWindowPane::disposing();
}
@@ -123,8 +146,99 @@ void SAL_CALL FullScreenPane::disposing (void)
+//----- XPane -----------------------------------------------------------------
+
+sal_Bool SAL_CALL FullScreenPane::isVisible (void)
+ throw (RuntimeException)
+{
+ ThrowIfDisposed();
+
+ if (mpWindow != NULL)
+ return mpWindow->IsReallyVisible();
+ else
+ return false;
+}
+
+
+
+
+void SAL_CALL FullScreenPane::setVisible (const sal_Bool bIsVisible)
+ throw (RuntimeException)
+{
+ ThrowIfDisposed();
+
+ if (mpWindow != NULL)
+ mpWindow->Show(bIsVisible);
+ if (mpWorkWindow != NULL)
+ mpWorkWindow->Show(bIsVisible);
+}
+
+
+
+
+Reference<accessibility::XAccessible> SAL_CALL FullScreenPane::getAccessible (void)
+ throw (RuntimeException)
+{
+ ThrowIfDisposed();
+
+ if (mpWorkWindow != NULL)
+ return mpWorkWindow->GetAccessible(FALSE);
+ else
+ return NULL;
+}
+
+
+
+
+void SAL_CALL FullScreenPane::setAccessible (
+ const Reference<accessibility::XAccessible>& rxAccessible)
+ throw (RuntimeException)
+{
+ ThrowIfDisposed();
+
+ if (mpWindow != NULL)
+ {
+ Reference<lang::XInitialization> xInitializable (rxAccessible, UNO_QUERY);
+ if (xInitializable.is())
+ {
+ ::Window* pParentWindow = mpWindow->GetParent();
+ Reference<accessibility::XAccessible> xAccessibleParent;
+ if (pParentWindow != NULL)
+ xAccessibleParent = pParentWindow->GetAccessible();
+ Sequence<Any> aArguments (1);
+ aArguments[0] = Any(xAccessibleParent);
+ xInitializable->initialize(aArguments);
+ }
+ GetWindow()->SetAccessible(rxAccessible);
+ }
+}
+
+
+
+
//-----------------------------------------------------------------------------
+IMPL_LINK(FullScreenPane, WindowEventHandler, VclWindowEvent*, pEvent)
+{
+ switch (pEvent->GetId())
+ {
+ case VCLEVENT_WINDOW_RESIZE:
+ GetWindow()->SetPosPixel(Point(0,0));
+ GetWindow()->SetSizePixel(Size(
+ mpWorkWindow->GetSizePixel().Width(),
+ mpWorkWindow->GetSizePixel().Height()));
+ break;
+
+ case VCLEVENT_OBJECT_DYING:
+ mpWorkWindow.reset();
+ break;
+ }
+ return 1;
+}
+
+
+
+
Reference<rendering::XCanvas> FullScreenPane::CreateCanvas (void)
throw (RuntimeException)
{
diff --git a/sd/source/ui/framework/factories/FullScreenPane.hxx b/sd/source/ui/framework/factories/FullScreenPane.hxx
index 685e14e5ea5b..5001970684bf 100644
--- a/sd/source/ui/framework/factories/FullScreenPane.hxx
+++ b/sd/source/ui/framework/factories/FullScreenPane.hxx
@@ -35,6 +35,7 @@
#include "FrameWindowPane.hxx"
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <vcl/vclevent.hxx>
#include <boost/scoped_ptr.hpp>
namespace css = ::com::sun::star;
@@ -69,6 +70,26 @@ public:
virtual void SAL_CALL disposing (void);
+ //----- XPane -------------------------------------------------------------
+
+ virtual sal_Bool SAL_CALL isVisible (void)
+ throw (cssu::RuntimeException);
+
+ virtual void SAL_CALL setVisible (sal_Bool bIsVisible)
+ throw (cssu::RuntimeException);
+
+ virtual cssu::Reference<css::accessibility::XAccessible> SAL_CALL getAccessible (void)
+ throw (cssu::RuntimeException);
+
+ virtual void SAL_CALL setAccessible (
+ const cssu::Reference<css::accessibility::XAccessible>& rxAccessible)
+ throw (cssu::RuntimeException);
+
+
+ //-------------------------------------------------------------------------
+
+ DECL_LINK(WindowEventHandler, VclWindowEvent*);
+
protected:
virtual ::com::sun::star::uno::Reference<com::sun::star::rendering::XCanvas>
CreateCanvas (void)
diff --git a/sd/source/ui/framework/factories/Pane.cxx b/sd/source/ui/framework/factories/Pane.cxx
index 1e3ee987b03f..80af83dd4f74 100644
--- a/sd/source/ui/framework/factories/Pane.cxx
+++ b/sd/source/ui/framework/factories/Pane.cxx
@@ -117,6 +117,63 @@ Reference<rendering::XCanvas> SAL_CALL Pane::getCanvas (void)
+//----- XPane2 ----------------------------------------------------------------
+
+sal_Bool SAL_CALL Pane::isVisible (void)
+ throw (RuntimeException)
+{
+ ThrowIfDisposed();
+
+ const ::Window* pWindow = GetWindow();
+ if (pWindow != NULL)
+ return pWindow->IsVisible();
+ else
+ return false;
+}
+
+
+
+
+void SAL_CALL Pane::setVisible (sal_Bool bIsVisible)
+ throw (RuntimeException)
+{
+ ThrowIfDisposed();
+
+ ::Window* pWindow = GetWindow();
+ if (pWindow != NULL)
+ pWindow->Show(bIsVisible);
+}
+
+
+
+
+Reference<accessibility::XAccessible> SAL_CALL Pane::getAccessible (void)
+ throw (RuntimeException)
+{
+ ThrowIfDisposed();
+ ::Window* pWindow = GetWindow();
+ if (pWindow != NULL)
+ return pWindow->GetAccessible(FALSE);
+ else
+ return NULL;
+}
+
+
+
+
+void SAL_CALL Pane::setAccessible (
+ const Reference<accessibility::XAccessible>& rxAccessible)
+ throw (RuntimeException)
+{
+ ThrowIfDisposed();
+ ::Window* pWindow = GetWindow();
+ if (pWindow != NULL)
+ pWindow->SetAccessible(rxAccessible);
+}
+
+
+
+
//----- XResource -------------------------------------------------------------
Reference<XResourceId> SAL_CALL Pane::getResourceId (void)
diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx
index 3a9cb6c0714e..c6b8f9feaab2 100644
--- a/sd/source/ui/func/fupoor.cxx
+++ b/sd/source/ui/func/fupoor.cxx
@@ -506,6 +506,9 @@ BOOL FuPoor::KeyInput(const KeyEvent& rKEvt)
case KEY_PAGEUP:
{
+ if( rKEvt.GetKeyCode().IsMod1() && rKEvt.GetKeyCode().IsMod2() )
+ break;
+
if(mpViewShell->ISA(DrawViewShell) && !bSlideShow)
{
// The page-up key switches layers or pages depending on the
@@ -551,6 +554,8 @@ BOOL FuPoor::KeyInput(const KeyEvent& rKEvt)
case KEY_PAGEDOWN:
{
+ if( rKEvt.GetKeyCode().IsMod1() && rKEvt.GetKeyCode().IsMod2() )
+ break;
if(mpViewShell->ISA(DrawViewShell) && !bSlideShow)
{
// The page-down key switches layers or pages depending on the
diff --git a/sd/source/ui/func/smarttag.cxx b/sd/source/ui/func/smarttag.cxx
index c958a398bcf9..ecd2c7a685f6 100644
--- a/sd/source/ui/func/smarttag.cxx
+++ b/sd/source/ui/func/smarttag.cxx
@@ -68,6 +68,18 @@ bool SmartTag::KeyInput( const KeyEvent& /*rKEvt*/ )
return false;
}
+/** returns true if the SmartTag consumes this event. */
+bool SmartTag::RequestHelp( const HelpEvent& /*rHEvt*/ )
+{
+ return false;
+}
+
+/** returns true if the SmartTag consumes this event. */
+bool SmartTag::Command( const CommandEvent& /*rCEvt*/ )
+{
+ return false;
+}
+
// --------------------------------------------------------------------
void SmartTag::addCustomHandles( SdrHdlList& /*rHandlerList*/ )
@@ -162,6 +174,7 @@ SmartTagSet::~SmartTagSet()
void SmartTagSet::add( const SmartTagReference& xTag )
{
maSet.insert( xTag );
+ mrView.InvalidateAllWin();
}
// --------------------------------------------------------------------
@@ -171,6 +184,7 @@ void SmartTagSet::remove( const SmartTagReference& xTag )
std::set< SmartTagReference >::iterator aIter( maSet.find( xTag ) );
if( aIter != maSet.end() )
maSet.erase( aIter );
+ mrView.InvalidateAllWin();
}
// --------------------------------------------------------------------
@@ -181,6 +195,7 @@ void SmartTagSet::Dispose()
aSet.swap( maSet );
for( std::set< SmartTagReference >::iterator aIter( aSet.begin() ); aIter != aSet.end(); )
(*aIter++)->Dispose();
+ mrView.InvalidateAllWin();
}
// --------------------------------------------------------------------
@@ -247,8 +262,72 @@ bool SmartTagSet::KeyInput( const KeyEvent& rKEvt )
{
if( mxSelectedTag.is() )
return mxSelectedTag->KeyInput( rKEvt );
+ else if( rKEvt.GetKeyCode().GetCode() == KEY_SPACE )
+ {
+ SmartHdl* pSmartHdl = dynamic_cast< SmartHdl* >( mrView.GetHdlList().GetFocusHdl() );
+ if( pSmartHdl )
+ {
+ const_cast< SdrHdlList& >( mrView.GetHdlList() ).ResetFocusHdl();
+ SmartTagReference xTag( pSmartHdl->getTag() );
+ select( xTag );
+ return true;
+ }
+ }
+
+
+ return false;
+}
+
+// --------------------------------------------------------------------
+
+bool SmartTagSet::RequestHelp( const HelpEvent& rHEvt )
+{
+ Point aMDPos( mrView.GetViewShell()->GetActiveWindow()->PixelToLogic( rHEvt.GetMousePosPixel() ) );
+ SdrHdl* pHdl = mrView.PickHandle(aMDPos);
+
+ if( pHdl )
+ {
+ // if a smart tag handle is hit, foreward event to its smart tag
+ SmartHdl* pSmartHdl = dynamic_cast< SmartHdl* >( pHdl );
+ if(pSmartHdl && pSmartHdl->getTag().is() )
+ {
+ SmartTagReference xTag( pSmartHdl->getTag() );
+ return xTag->RequestHelp( rHEvt );
+ }
+ }
+
+ return false;
+}
+
+// --------------------------------------------------------------------
+
+/** returns true if the SmartTag consumes this event. */
+bool SmartTagSet::Command( const CommandEvent& rCEvt )
+{
+ if( rCEvt.IsMouseEvent() )
+ {
+ Point aMDPos( mrView.GetViewShell()->GetActiveWindow()->PixelToLogic( rCEvt.GetMousePosPixel() ) );
+ SdrHdl* pHdl = mrView.PickHandle(aMDPos);
+
+ if( pHdl )
+ {
+ // if a smart tag handle is hit, foreward event to its smart tag
+ SmartHdl* pSmartHdl = dynamic_cast< SmartHdl* >( pHdl );
+ if(pSmartHdl && pSmartHdl->getTag().is() )
+ {
+ SmartTagReference xTag( pSmartHdl->getTag() );
+ return xTag->Command( rCEvt );
+ }
+ }
+ }
else
- return false;
+ {
+ if( mxSelectedTag.is() )
+ return mxSelectedTag->Command( rCEvt );
+
+ }
+
+ return false;
}
// --------------------------------------------------------------------
diff --git a/sd/source/ui/inc/AccessibleDrawDocumentView.hxx b/sd/source/ui/inc/AccessibleDrawDocumentView.hxx
index fc0ce20cd710..74aef069d7f5 100644
--- a/sd/source/ui/inc/AccessibleDrawDocumentView.hxx
+++ b/sd/source/ui/inc/AccessibleDrawDocumentView.hxx
@@ -166,6 +166,9 @@ protected:
virtual void Deactivated (void);
virtual void impl_dispose (void);
+
+private:
+ void UpdateAccessibleName (void);
};
} // end of namespace accessibility
diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx
index e6d9aacc3398..fb2d83ba4be9 100644
--- a/sd/source/ui/inc/DrawDocShell.hxx
+++ b/sd/source/ui/inc/DrawDocShell.hxx
@@ -164,11 +164,6 @@ public:
UINT16 GetStyleFamily() const { return mnStyleFamily; }
void SetStyleFamily( UINT16 nSF ) { mnStyleFamily = nSF; }
- BOOL HasSpecialProgress() const { return ( mpSpecialProgress != NULL && mpSpecialProgressHdl != NULL ); }
- void ReleaseSpecialProgress() { mpSpecialProgress = NULL; mpSpecialProgressHdl = NULL; }
- void SetSpecialProgress( SfxProgress* _pProgress, Link* pLink ) { mpSpecialProgress = _pProgress; mpSpecialProgressHdl = pLink; }
- SfxProgress* GetSpecialProgress() { return( HasSpecialProgress() ? mpSpecialProgress : NULL ); }
-
sal_Bool IsNewDocument() const;
/** executes the SID_OPENDOC slot to let the framework open a document
@@ -235,9 +230,6 @@ protected:
BOOL mbOwnPrinter;
BOOL mbNewDocument;
- static SfxProgress* mpSpecialProgress;
- static Link* mpSpecialProgressHdl;
-
bool mbOwnDocument; // if true, we own mpDoc and will delete it in our d'tor
void Construct(bool bClipboard);
virtual void InPlaceActivate( BOOL bActive );
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index d85b09d6ab07..b9a3e062955b 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -59,6 +59,7 @@ class DrawView;
class LayerTabBar;
class Ruler;
class SdUnoDrawView;
+class AnnotationManager;
#define CHECK_RANGE(nMin, nValue, nMax) ((nValue >= nMin) && (nValue <= nMax))
@@ -231,6 +232,9 @@ public:
void AttrExec (SfxRequest& rReq);
void AttrState (SfxItemSet& rSet);
+ void ExecuteAnnotation (SfxRequest& rRequest);
+ void GetAnnotationState (SfxItemSet& rItemSet);
+
void StartRulerDrag (
const Ruler& rRuler,
const MouseEvent& rMEvt);
@@ -391,7 +395,6 @@ protected:
static BOOL mbPipette;
-
DECL_LINK( ClipboardChanged, TransferableDataHelper* );
DECL_LINK( CloseHdl, Timer* pTimer );
DECL_LINK( TabSplitHdl, TabBar * );
@@ -494,6 +497,8 @@ private:
const Point& rMouseLocation);
using ViewShell::Notify;
+
+ ::std::auto_ptr< AnnotationManager > mpAnnotationManager;
};
diff --git a/sd/source/ui/inc/EventMultiplexer.hxx b/sd/source/ui/inc/EventMultiplexer.hxx
index fb0504f0da21..79e33452959c 100644
--- a/sd/source/ui/inc/EventMultiplexer.hxx
+++ b/sd/source/ui/inc/EventMultiplexer.hxx
@@ -92,9 +92,10 @@ public:
*/
static const EventId EID_PANE_MANAGER_DYING = 0x00000100;
- /** The edit mode of the ViewShell in the center pane has been modified.
+ /** Edit mode was (or is being) switched to normal mode. Find
+ EID_EDIT_MODE_MASTER below.
*/
- static const EventId EID_EDIT_MODE = 0x00000200;
+ static const EventId EID_EDIT_MODE_NORMAL = 0x00000200;
/** One or more pages have been inserted into or deleted from the model.
*/
@@ -134,6 +135,10 @@ public:
*/
static const EventId EID_CONFIGURATION_UPDATED = 0x00040000;
+ /** Edit mode was (or is being) switched to master mode.
+ */
+ static const EventId EID_EDIT_MODE_MASTER = 0x00080000;
+
const ViewShellBase& mrBase;
EventId meEventId;
const void* mpUserData;
diff --git a/sd/source/ui/inc/FrameView.hxx b/sd/source/ui/inc/FrameView.hxx
index a7b883b039b5..d458efbd79c6 100644
--- a/sd/source/ui/inc/FrameView.hxx
+++ b/sd/source/ui/inc/FrameView.hxx
@@ -49,7 +49,7 @@ class FrameView
: public SdrView
{
public:
- FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView = NULL );
+ SD_DLLPUBLIC FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView = NULL );
FrameView(const FrameView& rFrameView);
virtual ~FrameView();
@@ -106,7 +106,7 @@ public:
/** can be used to get the page kind that was selected on last save of this document */
PageKind GetPageKindOnLoad() const { return mePageKindOnLoad; }
- void SetSelectedPage (USHORT nPage);
+ SD_DLLPUBLIC void SetSelectedPage (USHORT nPage);
USHORT GetSelectedPage () const;
/** is used in FrameView::ReadUserDataSequence() only to store the
@@ -116,7 +116,7 @@ public:
/** can be used to get the page that was selected on last save of this document */
USHORT GetSelectedPageOnLoad () const { return mnSelectedPageOnLoad; }
- void SetViewShEditMode(EditMode eMode, PageKind eKind);
+ SD_DLLPUBLIC void SetViewShEditMode(EditMode eMode, PageKind eKind);
EditMode GetViewShEditMode (PageKind eKind);
/** Remember the edit mode of the main view shell at the time when the
diff --git a/sd/source/ui/inc/annotationmanager.hxx b/sd/source/ui/inc/annotationmanager.hxx
new file mode 100755
index 000000000000..4659b2add63f
--- /dev/null
+++ b/sd/source/ui/inc/annotationmanager.hxx
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * 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: AnnotationManager.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_ANNOTATIONMANAGER_HXX
+#define _SD_ANNOTATIONMANAGER_HXX
+
+#include <com/sun/star/office/XAnnotationAccess.hpp>
+#include <memory>
+
+#include <rtl/ref.hxx>
+
+namespace sd
+{
+
+class ViewShellBase;
+class AnnotationManagerImpl;
+
+// --------------------------------------------------------------------
+
+class AnnotationManager
+{
+public:
+ AnnotationManager( ViewShellBase& rViewShellBase );
+ ~AnnotationManager();
+
+ void ExecuteAnnotation (SfxRequest& rRequest);
+ void GetAnnotationState (SfxItemSet& rItemSet);
+
+private:
+ ::rtl::Reference< AnnotationManagerImpl > mxImpl;
+};
+
+}
+
+#endif // _SD_ANNOTATIONMANAGER_HXX
diff --git a/sd/source/ui/inc/framework/Pane.hxx b/sd/source/ui/inc/framework/Pane.hxx
index b8a015859885..f9f2a14e2846 100644
--- a/sd/source/ui/inc/framework/Pane.hxx
+++ b/sd/source/ui/inc/framework/Pane.hxx
@@ -34,19 +34,24 @@
#include "MutexOwner.hxx"
#include <com/sun/star/drawing/framework/XPane.hpp>
+#include <com/sun/star/drawing/framework/XPane2.hpp>
#include <com/sun/star/drawing/framework/TabBarButton.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <cppuhelper/compbase2.hxx>
+#include <cppuhelper/compbase3.hxx>
#include <tools/link.hxx>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
class Window;
+namespace css = ::com::sun::star;
+namespace cssu = ::com::sun::star::uno;
+
namespace {
-typedef ::cppu::WeakComponentImplHelper2 <
+typedef ::cppu::WeakComponentImplHelper3 <
::com::sun::star::drawing::framework::XPane,
+ ::com::sun::star::drawing::framework::XPane2,
::com::sun::star::lang::XUnoTunnel
> PaneInterfaceBase;
@@ -96,22 +101,39 @@ public:
*/
virtual ::Window* GetWindow (void);
- // XPane
+
+ //----- XPane -------------------------------------------------------------
/** For a UNO API based implementation of a view this may the most
important method of this class because the view is only interested
in the window of the pane.
*/
- virtual ::com::sun::star::uno::Reference<com::sun::star::awt::XWindow>
+ virtual cssu::Reference<css::awt::XWindow>
SAL_CALL getWindow (void)
- throw (::com::sun::star::uno::RuntimeException);
+ throw (cssu::RuntimeException);
- virtual ::com::sun::star::uno::Reference<com::sun::star::rendering::XCanvas>
+ virtual cssu::Reference<css::rendering::XCanvas>
SAL_CALL getCanvas (void)
- throw (::com::sun::star::uno::RuntimeException);
+ throw (cssu::RuntimeException);
+
+ //----- XPane2 -------------------------------------------------------------
- // XResource
+ virtual sal_Bool SAL_CALL isVisible (void)
+ throw (cssu::RuntimeException);
+
+ virtual void SAL_CALL setVisible (sal_Bool bIsVisible)
+ throw (cssu::RuntimeException);
+
+ virtual cssu::Reference<css::accessibility::XAccessible> SAL_CALL getAccessible (void)
+ throw (cssu::RuntimeException);
+
+ virtual void SAL_CALL setAccessible (
+ const cssu::Reference<css::accessibility::XAccessible>& rxAccessible)
+ throw (cssu::RuntimeException);
+
+
+ //----- XResource ---------------------------------------------------------
virtual ::com::sun::star::uno::Reference<com::sun::star::drawing::framework::XResourceId>
SAL_CALL getResourceId (void)
@@ -124,11 +146,12 @@ public:
throw (com::sun::star::uno::RuntimeException);
- // XUnoTunnel
+ //----- XUnoTunnel --------------------------------------------------------
virtual sal_Int64 SAL_CALL getSomething (const com::sun::star::uno::Sequence<sal_Int8>& rId)
throw (com::sun::star::uno::RuntimeException);
+
protected:
::com::sun::star::uno::Reference<com::sun::star::drawing::framework::XResourceId> mxPaneId;
::Window* mpWindow;
diff --git a/sd/source/ui/inc/ins_paste.hxx b/sd/source/ui/inc/ins_paste.hxx
index c9545cc80866..e12533de0ab3 100644
--- a/sd/source/ui/inc/ins_paste.hxx
+++ b/sd/source/ui/inc/ins_paste.hxx
@@ -31,18 +31,10 @@
#ifndef _SD_INS_PASTE_HXX_
#define _SD_INS_PASTE_HXX_
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _DIALOG_HXX //autogen
#include <vcl/dialog.hxx>
-#endif
-#ifndef _SD_SDRESID_HXX
#include "sdresid.hxx"
-#endif
// --------------------
// - SdInsertPasteDlg -
diff --git a/sd/source/ui/inc/optsitem.hxx b/sd/source/ui/inc/optsitem.hxx
index bd7ed5529a74..a67c91948617 100644
--- a/sd/source/ui/inc/optsitem.hxx
+++ b/sd/source/ui/inc/optsitem.hxx
@@ -276,6 +276,7 @@ private:
BOOL bShowUndoDeleteWarning : 1; // Misc/ShowUndoDeleteWarning
// #i75315#
BOOL bSlideshowRespectZOrder : 1; // Misc/SlideshowRespectZOrder
+ BOOL bShowComments : 1; // Misc/ShowComments
sal_Bool bPreviewNewEffects;
sal_Bool bPreviewChangedEffects;
@@ -320,6 +321,7 @@ public:
BOOL IsSolidDragging() const { Init(); return (BOOL) bSolidDragging; }
BOOL IsSolidMarkHdl() const { Init(); return (BOOL) bSolidMarkHdl; }
BOOL IsSummationOfParagraphs() const { Init(); return bSummationOfParagraphs != 0; };
+
/** Return the currently selected printer independent layout mode.
@return
Returns 1 for printer independent layout enabled and 0 when it
@@ -372,6 +374,9 @@ public:
void SetPreviewNewEffects( sal_Bool bOn ) { if( bPreviewNewEffects != bOn ) { OptionsChanged(); bPreviewNewEffects = bOn; } }
void SetPreviewChangedEffects( sal_Bool bOn ) { if( bPreviewChangedEffects != bOn ) { OptionsChanged(); bPreviewChangedEffects = bOn; } }
void SetPreviewTransitions( sal_Bool bOn ) { if( bPreviewTransitions != bOn ) { OptionsChanged(); bPreviewTransitions = bOn; } }
+
+ BOOL IsShowComments() const { Init(); return bShowComments; }
+ void SetShowComments( BOOL bShow ) { if( bShowComments != bShow ) { OptionsChanged(); bShowComments = bShow; } }
};
// -----------------------------------------------------------------------------
diff --git a/sd/source/ui/inc/res_bmp.hrc b/sd/source/ui/inc/res_bmp.hrc
index 19834c60ace6..0dd5451c1f45 100644
--- a/sd/source/ui/inc/res_bmp.hrc
+++ b/sd/source/ui/inc/res_bmp.hrc
@@ -237,6 +237,9 @@
#define BMP_FOIL_27 RID_SD_START+336
#define BMP_FOIL_27_H RID_SD_START+337
+#define BMP_COMMENTS_INDICATOR RID_SD_START+338
+#define BMP_COMMENTS_INDICATOR_H RID_SD_START+339
+
// -----------------------------------------------------------------------------
#define IMG_PIPETTE_H RID_APP_START+21
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index 551a6e15ae70..4fc2c12ad71b 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -71,7 +71,7 @@ class SD_DLLPUBLIC SdPageObjsTLB : public SvTreeListBox
{
private:
- static BOOL bIsInDrag; // static, falls der Navigator im ExecuteDrag geloescht wird
+ static BOOL SD_DLLPRIVATE bIsInDrag; // static, falls der Navigator im ExecuteDrag geloescht wird
public:
@@ -219,7 +219,7 @@ public:
BOOL IsLinkableSelected() const { return mbLinkableSelected; }
- static BOOL IsInDrag() { return bIsInDrag; }
+ static BOOL IsInDrag();
using SvLBox::ExecuteDrop;
private:
diff --git a/sd/source/ui/inc/smarttag.hxx b/sd/source/ui/inc/smarttag.hxx
index a1d217d92a10..feaa0fa27fd8 100644
--- a/sd/source/ui/inc/smarttag.hxx
+++ b/sd/source/ui/inc/smarttag.hxx
@@ -67,6 +67,12 @@ public:
/** 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 );
+
+ /** returns true if the SmartTag consumes this event. */
+ virtual bool Command( const CommandEvent& rCEvt );
+
/** returns true if this smart tag is currently selected */
bool isSelected() const;
@@ -119,6 +125,12 @@ public:
/** returns true if a SmartTag consumes this event. */
bool KeyInput( const KeyEvent& rKEvt );
+ /** returns true if a SmartTag consumes this event. */
+ bool RequestHelp( const HelpEvent& rHEvt );
+
+ /** returns true if a SmartTag consumes this event. */
+ bool Command( const CommandEvent& rCEvt );
+
/** disposes all smart tags and clears the set */
void Dispose();
diff --git a/sd/source/ui/inc/taskpane/TitleBar.hxx b/sd/source/ui/inc/taskpane/TitleBar.hxx
index b1a3f04b4a71..f80242e412a2 100644
--- a/sd/source/ui/inc/taskpane/TitleBar.hxx
+++ b/sd/source/ui/inc/taskpane/TitleBar.hxx
@@ -92,6 +92,7 @@ public:
virtual void Paint (const Rectangle& rBoundingBox);
virtual bool Expand (bool bFlag = true);
virtual bool IsExpanded (void) const;
+ virtual void SetEnabledState(bool bFlag);
void SetFocus (bool bFlag);
diff --git a/sd/source/ui/inc/taskpane/TitledControl.hxx b/sd/source/ui/inc/taskpane/TitledControl.hxx
index 2ebb8e87f3ce..e0974b864b96 100644
--- a/sd/source/ui/inc/taskpane/TitledControl.hxx
+++ b/sd/source/ui/inc/taskpane/TitledControl.hxx
@@ -135,6 +135,8 @@ public:
*/
virtual bool IsExpandable (void) const;
+ virtual void SetEnabledState(bool bFlag);
+
/** Ownership of the given data remains with the caller. The data
is thus not destroyed when the destructor of this class is
called.
diff --git a/sd/source/ui/notes/EditWindow.cxx b/sd/source/ui/notes/EditWindow.cxx
index 020eada42533..f86e9a358cbc 100755
--- a/sd/source/ui/notes/EditWindow.cxx
+++ b/sd/source/ui/notes/EditWindow.cxx
@@ -34,6 +34,8 @@
#include "EditWindow.hxx"
#include "sdmod.hxx"
+#include <i18npool/mslangid.hxx>
+#include <com/sun/star/i18n/ScriptType.hpp>
#include <svx/editeng.hxx>
#include <svx/editview.hxx>
#include <vcl/scrbar.hxx>
@@ -174,9 +176,9 @@ EditEngine* EditWindow::CreateEditEngine (void)
{ LANGUAGE_ARABIC_SAUDI_ARABIA, LANGUAGE_NONE,
DEFAULTFONT_CTL_TEXT, EE_CHAR_FONTINFO_CTL }
};
- aTable[0].nLang = aOpt.nDefaultLanguage;
- aTable[1].nLang = aOpt.nDefaultLanguage_CJK;
- aTable[2].nLang = aOpt.nDefaultLanguage_CTL;
+ aTable[0].nLang = MsLangId::resolveSystemLanguageByScriptType(aOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN);
+ aTable[1].nLang = MsLangId::resolveSystemLanguageByScriptType(aOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN);
+ aTable[2].nLang = MsLangId::resolveSystemLanguageByScriptType(aOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX);
//
for (int i = 0; i < 3; ++i)
{
diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx
index 86864169a607..0317b7530e5c 100644
--- a/sd/source/ui/presenter/PresenterTextView.cxx
+++ b/sd/source/ui/presenter/PresenterTextView.cxx
@@ -33,6 +33,7 @@
#include "PresenterTextView.hxx"
+#include <i18npool/mslangid.hxx>
#include <cppcanvas/vclfactory.hxx>
#include <svtools/itempool.hxx>
#include <svtools/itemset.hxx>
@@ -52,6 +53,8 @@
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
#include <com/sun/star/util/Color.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -381,9 +384,9 @@ EditEngine* PresenterTextView::Implementation::CreateEditEngine (void)
{ LANGUAGE_ARABIC_SAUDI_ARABIA, LANGUAGE_NONE,
DEFAULTFONT_CTL_TEXT, EE_CHAR_FONTINFO_CTL }
};
- aTable[0].nLang = aOpt.nDefaultLanguage;
- aTable[1].nLang = aOpt.nDefaultLanguage_CJK;
- aTable[2].nLang = aOpt.nDefaultLanguage_CTL;
+ aTable[0].nLang = MsLangId::resolveSystemLanguageByScriptType(aOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN);
+ aTable[1].nLang = MsLangId::resolveSystemLanguageByScriptType(aOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN);
+ aTable[2].nLang = MsLangId::resolveSystemLanguageByScriptType(aOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX);
//
for (int i = 0; i < 3; ++i)
{
diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
index 9b31cb17e5aa..f355ada7089f 100644
--- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
+++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
@@ -603,11 +603,8 @@ IMPL_LINK(SlideSorterController, WindowEventHandler, VclWindowEvent*, pEvent)
break;
case VCLEVENT_WINDOW_GETFOCUS:
- // Show focus but only when the focus was not set to the
- // window as a result of a mouse click.
if (pActiveWindow != NULL && pWindow == pActiveWindow)
- if (pWindow->GetPointerState().mnState==0)
- GetFocusManager().ShowFocus();
+ GetFocusManager().ShowFocus();
break;
case VCLEVENT_WINDOW_LOSEFOCUS:
diff --git a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx
index a03e7c91718d..009a24910d5a 100644
--- a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx
@@ -205,6 +205,9 @@ void FocusManager::FocusPage (sal_Int32 nPageIndex)
FocusHider aHider (*this);
mnPageIndex = nPageIndex;
}
+
+ if (HasFocus() && !IsFocusShowing())
+ ShowFocus();
}
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
index f1d3162ca034..2eac8b757780 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx
@@ -292,6 +292,8 @@ void SelectionManager::SelectionHasChanged (const bool bMakeSelectionVisible)
pViewShell->Invalidate (SID_SUMMARY_PAGE);
pViewShell->Invalidate(SID_SHOW_SLIDE);
pViewShell->Invalidate(SID_HIDE_SLIDE);
+ pViewShell->Invalidate(SID_DELETE_PAGE);
+ pViewShell->Invalidate(SID_DELETE_MASTER_PAGE);
// StatusBar
pViewShell->Invalidate (SID_STATUS_PAGE);
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index a9a4d6b2d385..ba8dbb278ca4 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -703,13 +703,13 @@ void SlotManager::GetClipboardState ( SfxItemSet& rSet)
SdTransferable* pTransferClip = SD_MOD()->pTransferClip;
if (rSet.GetItemState(SID_PASTE) == SFX_ITEM_AVAILABLE
- || rSet.GetItemState(SID_PASTE2) == SFX_ITEM_AVAILABLE)
+ || rSet.GetItemState(SID_PASTE_SPECIAL) == SFX_ITEM_AVAILABLE)
{
// Keine eigenen Clipboard-Daten?
if ( !pTransferClip || !pTransferClip->GetDocShell() )
{
rSet.DisableItem(SID_PASTE);
- rSet.DisableItem(SID_PASTE2);
+ rSet.DisableItem(SID_PASTE_SPECIAL);
}
else
{
@@ -739,7 +739,7 @@ void SlotManager::GetClipboardState ( SfxItemSet& rSet)
if ( ! bIsPastingSupported)
{
rSet.DisableItem(SID_PASTE);
- rSet.DisableItem(SID_PASTE2);
+ rSet.DisableItem(SID_PASTE_SPECIAL);
}
}
}
@@ -748,7 +748,7 @@ void SlotManager::GetClipboardState ( SfxItemSet& rSet)
// Cut, copy and paste of master pages is not yet implemented properly
if (rSet.GetItemState(SID_COPY) == SFX_ITEM_AVAILABLE
|| rSet.GetItemState(SID_PASTE) == SFX_ITEM_AVAILABLE
- || rSet.GetItemState(SID_PASTE2) == SFX_ITEM_AVAILABLE
+ || rSet.GetItemState(SID_PASTE_SPECIAL) == SFX_ITEM_AVAILABLE
|| rSet.GetItemState(SID_CUT) == SFX_ITEM_AVAILABLE)
{
if (mrSlideSorter.GetModel().GetEditMode() == EM_MASTERPAGE)
@@ -759,8 +759,8 @@ void SlotManager::GetClipboardState ( SfxItemSet& rSet)
rSet.DisableItem(SID_COPY);
if (rSet.GetItemState(SID_PASTE) == SFX_ITEM_AVAILABLE)
rSet.DisableItem(SID_PASTE);
- if (rSet.GetItemState(SID_PASTE2) == SFX_ITEM_AVAILABLE)
- rSet.DisableItem(SID_PASTE2);
+ if (rSet.GetItemState(SID_PASTE_SPECIAL) == SFX_ITEM_AVAILABLE)
+ rSet.DisableItem(SID_PASTE_SPECIAL);
}
}
diff --git a/sd/source/ui/slidesorter/shell/SlideSorter.cxx b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
index 770e50832a68..9d0dbae862fa 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorter.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
@@ -194,14 +194,6 @@ void SlideSorter::Init (void)
// Set view pointer of base class.
SetupControls(pParentWindow);
- // For accessibility we have to shortly hide the content window.
- // This triggers the construction of a new accessibility object for
- // the new view shell. (One is created earlier while the construtor
- // of the base class is executed. At that time the correct
- // accessibility object can not be constructed.)
- pWindow->Hide();
- pWindow->Show();
-
mbIsValid = true;
}
}
diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
index 952198795764..0a04a236511c 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
@@ -185,6 +185,18 @@ void SlideSorterViewShell::Initialize (void)
mpVerticalScrollBar,
mpScrollBarBox);
mpView = &mpSlideSorter->GetView();
+
+ // For accessibility we have to shortly hide the content window.
+ // This triggers the construction of a new accessibility object for
+ // the new view shell. (One is created earlier while the construtor
+ // of the base class is executed. At that time the correct
+ // accessibility object can not be constructed.)
+ ::Window* pWindow = mpSlideSorter->GetActiveWindow();
+ if (pWindow != NULL)
+ {
+ pWindow->Hide();
+ pWindow->Show();
+ }
}
diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
index ff3ddff0897f..3cd696e4bb26 100644
--- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx
+++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
@@ -108,8 +108,6 @@ SlideSorterView::SlideSorterView (SlideSorter& rSlideSorter)
maModelBorder(),
meOrientation(VERTICAL)
{
- maPageModel.GetItemPool().FreezeIdRanges();
-
// Hide the page that contains the page objects.
SetPageVisible (FALSE);
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx
index 92a0abb72762..3e0d61064bdf 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx
@@ -520,6 +520,7 @@ class SdPageObjectFocusPrimitive : public SdPageObjectBasePrimitive
private:
/// Gap between border of page object and inside of focus rectangle.
static const sal_Int32 mnFocusIndicatorOffset;
+ const bool mbContrastToSelected;
protected:
// method which is to be used to implement the local decomposition of a 2D primitive.
@@ -527,7 +528,7 @@ protected:
public:
// constructor and destructor
- SdPageObjectFocusPrimitive(const basegfx::B2DRange& rRange);
+ SdPageObjectFocusPrimitive(const basegfx::B2DRange& rRange, const bool bContrast);
~SdPageObjectFocusPrimitive();
// provide unique ID
@@ -556,19 +557,26 @@ Primitive2DSequence SdPageObjectFocusPrimitive::createLocalDecomposition(const d
// create polygon
const basegfx::B2DPolygon aIndicatorPolygon(basegfx::tools::createPolygonFromRect(aFocusIndicatorRange));
- // white rectangle
+ const StyleSettings& rStyleSettings(Application::GetSettings().GetStyleSettings());
+
+ // "background" rectangle
+ const Color aBackgroundColor(mbContrastToSelected ? rStyleSettings.GetMenuHighlightColor() : rStyleSettings.GetWindowColor());
xRetval[0] = Primitive2DReference(
new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aIndicatorPolygon, Color(COL_WHITE).getBColor()));
// dotted black rectangle with same geometry
::std::vector< double > aDotDashArray;
- aDotDashArray.push_back(aDiscretePixel.getX());
- aDotDashArray.push_back(aDiscretePixel.getX());
+ const sal_Int32 nFocusIndicatorWidth (3);
+ aDotDashArray.push_back(nFocusIndicatorWidth *aDiscretePixel.getX());
+ aDotDashArray.push_back(nFocusIndicatorWidth * aDiscretePixel.getX());
// prepare line and stroke attributes
- const drawinglayer::attribute::LineAttribute aLineAttribute(Color(COL_BLACK).getBColor());
- const drawinglayer::attribute::StrokeAttribute aStrokeAttribute(aDotDashArray, 2.0 * aDiscretePixel.getX());
+ const Color aLineColor(mbContrastToSelected ? rStyleSettings.GetMenuHighlightTextColor() : rStyleSettings.GetWindowTextColor());
+ const drawinglayer::attribute::LineAttribute aLineAttribute(aLineColor.getBColor());
+ const drawinglayer::attribute::StrokeAttribute aStrokeAttribute(
+ aDotDashArray, 2.0 * nFocusIndicatorWidth * aDiscretePixel.getX());
+
xRetval[1] = Primitive2DReference(
new drawinglayer::primitive2d::PolygonStrokePrimitive2D(aIndicatorPolygon, aLineAttribute, aStrokeAttribute));
@@ -576,8 +584,9 @@ Primitive2DSequence SdPageObjectFocusPrimitive::createLocalDecomposition(const d
return xRetval;
}
-SdPageObjectFocusPrimitive::SdPageObjectFocusPrimitive(const basegfx::B2DRange& rRange)
-: SdPageObjectBasePrimitive(rRange)
+SdPageObjectFocusPrimitive::SdPageObjectFocusPrimitive(const basegfx::B2DRange& rRange, const bool bContrast)
+ : SdPageObjectBasePrimitive(rRange),
+ mbContrastToSelected(bContrast)
{
}
@@ -596,12 +605,16 @@ private:
/// Size of width and height of the fade effect indicator in pixels.
static const sal_Int32 mnFadeEffectIndicatorOffset;
+ /// Size of width and height of the comments indicator in pixels.
+ static const sal_Int32 mnCommentsIndicatorOffset;
+
/// Gap between border of page object and number rectangle.
static const sal_Int32 mnPageNumberOffset;
- /// the FadeEffect bitmap. Static since it is usable outside this primitive
+ /// the indicator bitmaps. Static since it is usable outside this primitive
/// for size comparisons
static BitmapEx* mpFadeEffectIconBitmap;
+ static BitmapEx* mpCommentsIconBitmap;
/// page name, number and needed infos
String maPageName;
@@ -611,10 +624,12 @@ private:
// bitfield
bool mbShowFadeEffectIcon : 1;
+ bool mbShowCommentsIcon : 1;
bool mbExcluded : 1;
// private helpers
const BitmapEx& getFadeEffectIconBitmap() const;
+ const BitmapEx& getCommentsIconBitmap() const;
protected:
// method which is to be used to implement the local decomposition of a 2D primitive.
@@ -629,6 +644,7 @@ public:
const Font& rPageNameFont,
const Size& rPageNumberAreaModelSize,
bool bShowFadeEffectIcon,
+ bool bShowCommentsIcon,
bool bExcluded);
~SdPageObjectFadeNameNumberPrimitive();
@@ -638,6 +654,7 @@ public:
const Font& getPageNameFont() const { return maPageNameFont; }
const Size& getPageNumberAreaModelSize() const { return maPageNumberAreaModelSize; }
bool getShowFadeEffectIcon() const { return mbShowFadeEffectIcon; }
+ bool getShowCommentsIcon() const { return mbShowCommentsIcon; }
bool getExcluded() const { return mbExcluded; }
// compare operator
@@ -666,6 +683,24 @@ const BitmapEx& SdPageObjectFadeNameNumberPrimitive::getFadeEffectIconBitmap() c
return *mpFadeEffectIconBitmap;
}
+const sal_Int32 SdPageObjectFadeNameNumberPrimitive::mnCommentsIndicatorOffset(9);
+BitmapEx* SdPageObjectFadeNameNumberPrimitive::mpCommentsIconBitmap = 0;
+
+const BitmapEx& SdPageObjectFadeNameNumberPrimitive::getCommentsIconBitmap() const
+{
+ if(mpCommentsIconBitmap == NULL)
+ {
+ // prepare CommentsIconBitmap on demand
+ const sal_uInt16 nIconId(Application::GetSettings().GetStyleSettings().GetHighContrastMode()
+ ? BMP_COMMENTS_INDICATOR_H
+ : BMP_COMMENTS_INDICATOR);
+ const BitmapEx aCommentsIconBitmap(IconCache::Instance().GetIcon(nIconId).GetBitmapEx());
+ const_cast< SdPageObjectFadeNameNumberPrimitive* >(this)->mpCommentsIconBitmap = new BitmapEx(aCommentsIconBitmap);
+ }
+
+ return *mpCommentsIconBitmap;
+}
+
Primitive2DSequence SdPageObjectFadeNameNumberPrimitive::createLocalDecomposition(const drawinglayer::geometry::ViewInformation2D& rViewInformation) const
{
const xub_StrLen nTextLength(getPageName().Len());
@@ -691,15 +726,13 @@ Primitive2DSequence SdPageObjectFadeNameNumberPrimitive::createLocalDecompositio
aTextLayouter.setFont(getPageNameFont());
// get font attributes
- ::basegfx::B2DVector aTextSizeAttribute;
- const drawinglayer::primitive2d::FontAttributes aFontAttributes(drawinglayer::primitive2d::getFontAttributesFromVclFont(
- aTextSizeAttribute,
- getPageNameFont(),
- false,
- false));
-
- // prepare DXTextArray (can be empty one)
- const ::std::vector< double > aDXArray;
+ basegfx::B2DVector aTextSizeAttribute;
+ const drawinglayer::primitive2d::FontAttributes aFontAttributes(
+ drawinglayer::primitive2d::getFontAttributesFromVclFont(
+ aTextSizeAttribute,
+ getPageNameFont(),
+ false,
+ false));
// prepare locale; this may need some more information in the future
const ::com::sun::star::lang::Locale aLocale;
@@ -783,16 +816,27 @@ Primitive2DSequence SdPageObjectFadeNameNumberPrimitive::createLocalDecompositio
}
// fill text matrix
- ::basegfx::B2DHomMatrix aTextMatrix;
+ basegfx::B2DHomMatrix aTextMatrix;
- aTextMatrix.set(0L, 0L, aTextSizeAttribute.getX());
- aTextMatrix.set(1L, 1L, aTextSizeAttribute.getY());
- aTextMatrix.set(0L, 2L, fStartX);
- aTextMatrix.set(1L, 2L, fStartY);
+ aTextMatrix.set(0, 0, aTextSizeAttribute.getX());
+ aTextMatrix.set(1, 1, aTextSizeAttribute.getY());
+ aTextMatrix.set(0, 2, fStartX);
+ aTextMatrix.set(1, 2, fStartY);
+
+ // prepare DXTextArray (can be empty one)
+ const ::std::vector< double > aDXArray;
// create Text primitive and add to target
- xRetval[nInsert++] = Primitive2DReference(new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
- aTextMatrix, aPageName, 0, aPageName.Len(), aDXArray, aFontAttributes, aLocale, aFontColor));
+ xRetval[nInsert++] = Primitive2DReference(
+ new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
+ aTextMatrix,
+ aPageName,
+ 0,
+ aPageName.Len(),
+ aDXArray,
+ aFontAttributes,
+ aLocale,
+ aFontColor));
}
{
@@ -813,16 +857,27 @@ Primitive2DSequence SdPageObjectFadeNameNumberPrimitive::createLocalDecompositio
const double fStartY(aNumberRange.getMinY() + fTextHeight + aDiscretePixel.getX());
// fill text matrix
- ::basegfx::B2DHomMatrix aTextMatrix;
+ basegfx::B2DHomMatrix aTextMatrix;
+
+ aTextMatrix.set(0, 0, aTextSizeAttribute.getX());
+ aTextMatrix.set(1, 1, aTextSizeAttribute.getY());
+ aTextMatrix.set(0, 2, fStartX);
+ aTextMatrix.set(1, 2, fStartY);
- aTextMatrix.set(0L, 0L, aTextSizeAttribute.getX());
- aTextMatrix.set(1L, 1L, aTextSizeAttribute.getY());
- aTextMatrix.set(0L, 2L, fStartX);
- aTextMatrix.set(1L, 2L, fStartY);
+ // prepare DXTextArray (can be empty one)
+ const ::std::vector< double > aDXArray;
// create Text primitive
- xRetval[nInsert++] = Primitive2DReference(new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
- aTextMatrix, aPageNumber, 0, nNumberLen, aDXArray, aFontAttributes, aLocale, aFontColor));
+ xRetval[nInsert++] = Primitive2DReference(
+ new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
+ aTextMatrix,
+ aPageNumber,
+ 0,
+ nNumberLen,
+ aDXArray,
+ aFontAttributes,
+ aLocale,
+ aFontColor));
if(getExcluded())
{
@@ -851,6 +906,7 @@ SdPageObjectFadeNameNumberPrimitive::SdPageObjectFadeNameNumberPrimitive(
const Font& rPageNameFont,
const Size& rPageNumberAreaModelSize,
bool bShowFadeEffectIcon,
+ bool bShowCommentsIcon,
bool bExcluded)
: SdPageObjectBasePrimitive(rRange),
maPageName(rPageName),
@@ -858,6 +914,7 @@ SdPageObjectFadeNameNumberPrimitive::SdPageObjectFadeNameNumberPrimitive(
maPageNameFont(rPageNameFont),
maPageNumberAreaModelSize(rPageNumberAreaModelSize),
mbShowFadeEffectIcon(bShowFadeEffectIcon),
+ mbShowCommentsIcon(bShowCommentsIcon),
mbExcluded(bExcluded)
{
}
@@ -965,6 +1022,7 @@ Primitive2DSequence PageObjectViewObjectContact::createPrimitive2DSequence(const
sal_uInt32 nPageNumber(0);
Size aPageNumberAreaModelSize;
bool bShowFadeEffectIcon(false);
+ bool bShowCommentsIcon(false);
bool bExcluded(false);
if(GetPage())
@@ -977,6 +1035,8 @@ Primitive2DSequence PageObjectViewObjectContact::createPrimitive2DSequence(const
bShowFadeEffectIcon = true;
}
+ bShowCommentsIcon = !pPage->getAnnotations().empty();
+
// prepare PageName, PageNumber, font and AreaModelSize
aPageName = pPage->GetName();
aPageNameFont = *FontProvider::Instance().GetFont(*pDevice);
@@ -1030,6 +1090,7 @@ Primitive2DSequence PageObjectViewObjectContact::createPrimitive2DSequence(const
aPageNameFont,
aPageNumberAreaModelSize,
bShowFadeEffectIcon,
+ bShowCommentsIcon,
bExcluded));
}
@@ -1042,7 +1103,7 @@ Primitive2DSequence PageObjectViewObjectContact::createPrimitive2DSequence(const
if(bCreateFocused)
{
// add focus indicator if used
- xRetval[nInsert++] = Primitive2DReference(new SdPageObjectFocusPrimitive(aInnerRange));
+ xRetval[nInsert++] = Primitive2DReference(new SdPageObjectFocusPrimitive(aInnerRange, bCreateSelected));
}
return xRetval;
diff --git a/sd/source/ui/toolpanel/LayoutMenu.cxx b/sd/source/ui/toolpanel/LayoutMenu.cxx
index 11b8cbe6f8de..7a39f1c42f15 100644
--- a/sd/source/ui/toolpanel/LayoutMenu.cxx
+++ b/sd/source/ui/toolpanel/LayoutMenu.cxx
@@ -63,6 +63,7 @@
#include <vcl/image.hxx>
#include <svtools/languageoptions.hxx>
#include <sfx2/app.hxx>
+#include "taskpane/TitledControl.hxx"
#include <sfx2/dispatch.hxx>
#include <sfx2/request.hxx>
#include <comphelper/processfactory.hxx>
@@ -259,7 +260,9 @@ LayoutMenu::LayoutMenu (
| ::sd::tools::EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION
| ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED
| ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED
- | ::sd::tools::EventMultiplexerEvent::EID_CONFIGURATION_UPDATED);
+ | ::sd::tools::EventMultiplexerEvent::EID_CONFIGURATION_UPDATED
+ | ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL
+ | ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER);
SetSmartHelpId(SmartId(HID_SD_TASK_PANE_PREVIEW_LAYOUTS));
SetAccessibleName(SdResId(STR_TASKPANEL_LAYOUT_MENU_TITLE));
@@ -418,6 +421,74 @@ bool LayoutMenu::IsResizable (void)
+void LayoutMenu::UpdateEnabledState (const MasterMode eMode)
+{
+ bool bIsEnabled (false);
+
+ ::boost::shared_ptr<ViewShell> pMainViewShell (mrBase.GetMainViewShell());
+ if (pMainViewShell)
+ {
+ switch (pMainViewShell->GetShellType())
+ {
+ case ViewShell::ST_NONE:
+ case ViewShell::ST_OUTLINE:
+ case ViewShell::ST_PRESENTATION:
+ case ViewShell::ST_TASK_PANE:
+ // The complete task pane is disabled for these values or
+ // not even visible. Disabling the LayoutMenu would be
+ // logical but unnecessary. The main disadvantage is that
+ // after re-enabling it (typically) another panel is
+ // expanded.
+ bIsEnabled = true;
+ break;
+
+ case ViewShell::ST_DRAW:
+ case ViewShell::ST_IMPRESS:
+ {
+ switch (eMode)
+ {
+ case MM_UNKNOWN:
+ {
+ ::boost::shared_ptr<DrawViewShell> pDrawViewShell (
+ ::boost::dynamic_pointer_cast<DrawViewShell>(pMainViewShell));
+ if (pDrawViewShell)
+ bIsEnabled = pDrawViewShell->GetEditMode() != EM_MASTERPAGE;
+ break;
+ }
+ case MM_NORMAL:
+ bIsEnabled = true;
+ break;
+
+ case MM_MASTER:
+ bIsEnabled = false;
+ break;
+ }
+ break;
+ }
+
+ case ViewShell::ST_HANDOUT:
+ case ViewShell::ST_NOTES:
+ case ViewShell::ST_SLIDE_SORTER:
+ default:
+ bIsEnabled = true;
+ break;
+ }
+
+ TreeNode* pParentNode = GetParentNode();
+ if (pParentNode != NULL)
+ {
+ TitledControl* pGrandParentNode
+ = dynamic_cast<TitledControl*>(pParentNode->GetParentNode());
+ if (pGrandParentNode != NULL)
+ pGrandParentNode->SetEnabledState(bIsEnabled);
+ }
+
+ }
+}
+
+
+
+
::Window* LayoutMenu::GetWindow (void)
{
return this;
@@ -907,12 +978,14 @@ void LayoutMenu::UpdateSelection (void)
// Find the entry of the menu for to the layout.
USHORT nItemCount (GetItemCount());
for (USHORT nId=1; nId<=nItemCount; nId++)
+ {
if (*static_cast<AutoLayout*>(GetItemData(nId)) == aLayout)
{
SelectItem(nId);
bItemSelected = true;
break;
}
+ }
}
while (false);
@@ -935,6 +1008,7 @@ IMPL_LINK(LayoutMenu, EventMultiplexerListener, ::sd::tools::EventMultiplexerEve
case ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED:
mbIsMainViewChangePending = true;
+ UpdateEnabledState(MM_UNKNOWN);
break;
case ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED:
@@ -949,6 +1023,14 @@ IMPL_LINK(LayoutMenu, EventMultiplexerListener, ::sd::tools::EventMultiplexerEve
}
break;
+ case ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL:
+ UpdateEnabledState(MM_NORMAL);
+ break;
+
+ case ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER:
+ UpdateEnabledState(MM_MASTER);
+ break;
+
default:
/* Ignored */
break;
diff --git a/sd/source/ui/toolpanel/LayoutMenu.hxx b/sd/source/ui/toolpanel/LayoutMenu.hxx
index 58901e0e7a86..3551d3853a8a 100644
--- a/sd/source/ui/toolpanel/LayoutMenu.hxx
+++ b/sd/source/ui/toolpanel/LayoutMenu.hxx
@@ -131,6 +131,18 @@ public:
void Execute (SfxRequest& rRequest);
void GetState (SfxItemSet& rItemSet);
+ /** The LayoutMenu does not support some main views. In this case the
+ LayoutMenu is disabled. This state is updated in this method.
+ @param eMode
+ On some occasions the edit mode is being switched when this
+ method is called can not (yet) be reliably detected. Luckily,
+ in these cases the new value is provided by some broadcaster.
+ On other occasions the edit mode is not modified and is also not
+ provided. Therefore the Unknown value.
+ */
+ enum MasterMode { MM_NORMAL, MM_MASTER, MM_UNKNOWN };
+ void UpdateEnabledState (const MasterMode eMode);
+
/** Call this method when the set of displayed layouts is not up-to-date
anymore. It will re-assemple this set according to the current
settings.
diff --git a/sd/source/ui/toolpanel/TaskPaneShellManager.cxx b/sd/source/ui/toolpanel/TaskPaneShellManager.cxx
index 53ca3cbe2d2e..6400a51bf44a 100644
--- a/sd/source/ui/toolpanel/TaskPaneShellManager.cxx
+++ b/sd/source/ui/toolpanel/TaskPaneShellManager.cxx
@@ -79,8 +79,18 @@ void TaskPaneShellManager::ReleaseShell (SfxShell* )
// Nothing to do.
}
+// hack for annotation panel, better fix?
+void TaskPaneShellManager_AddSubShell ( TaskPaneShellManager* pManager, sal_Int32 nId, SfxShell* pShell, ::Window* pWindow )
+{
+ if( pManager != NULL )
+ pManager->AddSubShell( (ShellId)nId, pShell, pWindow );
+}
-
+void TaskPaneShellManager_RemoveSubShell ( TaskPaneShellManager* pManager, const SfxShell* pShell)
+{
+ if( pManager != NULL )
+ pManager->RemoveSubShell( pShell );
+}
void TaskPaneShellManager::AddSubShell (
ShellId nId,
diff --git a/sd/source/ui/toolpanel/TaskPaneViewShell.cxx b/sd/source/ui/toolpanel/TaskPaneViewShell.cxx
index 556fe2f1282f..2d1475ca980c 100644
--- a/sd/source/ui/toolpanel/TaskPaneViewShell.cxx
+++ b/sd/source/ui/toolpanel/TaskPaneViewShell.cxx
@@ -107,7 +107,6 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using ::sd::framework::FrameworkHelper;
-
namespace sd { namespace toolpanel {
SFX_IMPL_INTERFACE(TaskPaneViewShell, SfxShell, SdResId(STR_TASKPANEVIEWSHELL))
diff --git a/sd/source/ui/toolpanel/TitleBar.cxx b/sd/source/ui/toolpanel/TitleBar.cxx
index ff08770bf1a5..c4dd6537c9ce 100644
--- a/sd/source/ui/toolpanel/TitleBar.cxx
+++ b/sd/source/ui/toolpanel/TitleBar.cxx
@@ -216,6 +216,14 @@ bool TitleBar::IsExpanded (void) const
}
+void TitleBar::SetEnabledState(bool bFlag)
+{
+ if(bFlag)
+ Enable();
+ else
+ Disable();
+ Invalidate ();
+}
void TitleBar::SetFocus (bool bFlag)
@@ -454,15 +462,21 @@ void TitleBar::PaintText (const Rectangle& rTextBox)
USHORT TitleBar::GetTextStyle (void)
{
- return TEXT_DRAW_LEFT
- | TEXT_DRAW_TOP
- | TEXT_DRAW_MULTILINE
- | TEXT_DRAW_WORDBREAK;
+ if(IsEnabled())
+ {
+ return TEXT_DRAW_LEFT
+ | TEXT_DRAW_TOP
+ | TEXT_DRAW_MULTILINE
+ | TEXT_DRAW_WORDBREAK;
+ }
+ else
+ {
+ return TEXT_DRAW_DISABLE;
+ }
}
-
void TitleBar::PaintBackground (const Rectangle& rTitleBarBox)
{
// Fill a slightly rounded rectangle.
diff --git a/sd/source/ui/toolpanel/TitledControl.cxx b/sd/source/ui/toolpanel/TitledControl.cxx
index 14c7c5004e91..2c2e791eb018 100644
--- a/sd/source/ui/toolpanel/TitledControl.cxx
+++ b/sd/source/ui/toolpanel/TitledControl.cxx
@@ -292,7 +292,7 @@ bool TitledControl::Expand (bool bExpanded)
{
bool bExpansionStateChanged (false);
- if (IsExpandable())
+ if (IsExpandable() && IsEnabled())
{
if (GetTitleBar()->IsExpanded() != bExpanded)
bExpansionStateChanged |= GetTitleBar()->Expand (bExpanded);
@@ -338,6 +338,27 @@ bool TitledControl::IsExpanded (void) const
return false;
}
+void TitledControl::SetEnabledState(bool bFlag)
+{
+ if (!bFlag)
+ {
+ GetParentNode()->GetControlContainer().SetExpansionState (
+ this,
+ ControlContainer::ES_COLLAPSE);
+ Disable();
+ }
+ else
+ {
+/*
+ GetParentNode()->GetControlContainer().SetExpansionState (
+ this,
+ ControlContainer::ES_EXPAND);
+*/
+ Enable();
+ }
+
+ GetTitleBar()->SetEnabledState(bFlag);
+}
@@ -406,7 +427,8 @@ IMPL_LINK(TitledControl, WindowEventListener,
switch (pWindowEvent->GetId())
{
case VCLEVENT_WINDOW_MOUSEBUTTONUP:
- (*mpClickHandler)(*this);
+ if (IsEnabled())
+ (*mpClickHandler)(*this);
break;
}
}
diff --git a/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx b/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx
index 25cb015d2d1d..b647d3e732c7 100644
--- a/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx
+++ b/sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector.cxx
@@ -74,7 +74,8 @@ CurrentMasterPagesSelector::CurrentMasterPagesSelector (
Link aLink (LINK(this,CurrentMasterPagesSelector,EventMultiplexerListener));
rBase.GetEventMultiplexer()->AddEventListener(aLink,
sd::tools::EventMultiplexerEvent::EID_CURRENT_PAGE
- | sd::tools::EventMultiplexerEvent::EID_EDIT_MODE
+ | sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL
+ | sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER
| sd::tools::EventMultiplexerEvent::EID_PAGE_ORDER
| sd::tools::EventMultiplexerEvent::EID_SHAPE_CHANGED
| sd::tools::EventMultiplexerEvent::EID_SHAPE_INSERTED
@@ -282,7 +283,8 @@ IMPL_LINK(CurrentMasterPagesSelector,EventMultiplexerListener,
switch (pEvent->meEventId)
{
case sd::tools::EventMultiplexerEvent::EID_CURRENT_PAGE:
- case sd::tools::EventMultiplexerEvent::EID_EDIT_MODE:
+ case sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL:
+ case sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER:
case sd::tools::EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION:
UpdateSelection();
break;
diff --git a/sd/source/ui/toolpanel/controls/makefile.mk b/sd/source/ui/toolpanel/controls/makefile.mk
index 4741144ca6ff..3664e852f0c5 100644
--- a/sd/source/ui/toolpanel/controls/makefile.mk
+++ b/sd/source/ui/toolpanel/controls/makefile.mk
@@ -66,7 +66,6 @@ SLOFILES = \
$(SLO)$/TableDesignPanel.obj \
$(SLO)$/AnimationSchemesPanel.obj
-
# --- Tagets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/sd/source/ui/tools/EventMultiplexer.cxx b/sd/source/ui/tools/EventMultiplexer.cxx
index 5fccaf55fed0..3b9b113bf288 100644
--- a/sd/source/ui/tools/EventMultiplexer.cxx
+++ b/sd/source/ui/tools/EventMultiplexer.cxx
@@ -570,7 +570,12 @@ void SAL_CALL EventMultiplexer::Implementation::propertyChange (
}
else if (rEvent.PropertyName.equals(msEditModePropertyName))
{
- CallListeners(EventMultiplexerEvent::EID_EDIT_MODE);
+ bool bIsMasterPageMode (false);
+ rEvent.NewValue >>= bIsMasterPageMode;
+ if (bIsMasterPageMode)
+ CallListeners(EventMultiplexerEvent::EID_EDIT_MODE_MASTER);
+ else
+ CallListeners(EventMultiplexerEvent::EID_EDIT_MODE_NORMAL);
}
}
@@ -783,8 +788,9 @@ void EventMultiplexer::Implementation::CallListeners (
void EventMultiplexer::Implementation::CallListeners (EventMultiplexerEvent& rEvent)
{
- ListenerList::const_iterator iListener (maListeners.begin());
- ListenerList::const_iterator iListenerEnd (maListeners.end());
+ ListenerList aCopyListeners( maListeners );
+ ListenerList::iterator iListener (aCopyListeners.begin());
+ ListenerList::const_iterator iListenerEnd (aCopyListeners.end());
for (; iListener!=iListenerEnd; ++iListener)
{
if ((iListener->second && rEvent.meEventId) != 0)
diff --git a/sd/source/ui/unoidl/randomnode.cxx b/sd/source/ui/unoidl/randomnode.cxx
index d3b0525baa19..a08c5853c390 100644
--- a/sd/source/ui/unoidl/randomnode.cxx
+++ b/sd/source/ui/unoidl/randomnode.cxx
@@ -171,7 +171,7 @@ static const sal_Char* pSN2 = "com.sun.star.comp.sd.RandomAnimationNode";
// --------------------------------------------------------------------
-Reference< XInterface > RandomAnimationNode_createInstance( sal_Int16 nPresetClass )
+SD_DLLPUBLIC Reference< XInterface > RandomAnimationNode_createInstance( sal_Int16 nPresetClass )
{
Reference< XInterface > xInt( static_cast<XWeak*>( new RandomAnimationNode( nPresetClass ) ) );
return xInt;
diff --git a/sd/source/ui/unoidl/sddetect.cxx b/sd/source/ui/unoidl/sddetect.cxx
index 106b64f2a5c5..71000d263cd7 100644
--- a/sd/source/ui/unoidl/sddetect.cxx
+++ b/sd/source/ui/unoidl/sddetect.cxx
@@ -244,7 +244,7 @@ SdFilterDetect::~SdFilterDetect()
{
// PowerPoint needs to be detected via StreamName, all other storage based formats are our own and can
// be detected by the ClipboardId, so except for the PPT filter all filters must have a ClipboardId set
- uno::Reference < embed::XStorage > xStorage = aMedium.GetStorage();
+ uno::Reference < embed::XStorage > xStorage = aMedium.GetStorage( sal_False );
//TODO/LATER: move error handling to central place! (maybe even complete own filters)
if ( aMedium.GetLastStorageCreationState() != ERRCODE_NONE )
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index c24a4f241dcc..2e753fd859d1 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -3028,3 +3028,14 @@ void NotifyDocumentEvent( SdDrawDocument* pDocument, const rtl::OUString& rEvent
xModel->notifyEvent(aEvent );
}
}
+
+void NotifyDocumentEvent( SdDrawDocument* pDocument, const rtl::OUString& rEventName, const uno::Reference< uno::XInterface >& xSource )
+{
+ rtl::Reference< SdXImpressDocument > xModel( SdXImpressDocument::GetModel( pDocument ) );
+
+ if( xModel.is() )
+ {
+ ::com::sun::star::document::EventObject aEvent( xSource, rEventName );
+ xModel->notifyEvent(aEvent );
+ }
+}
diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx
index 21b12f9913a6..a1a8a4f4dabb 100644
--- a/sd/source/ui/unoidl/unoobj.cxx
+++ b/sd/source/ui/unoidl/unoobj.cxx
@@ -1007,6 +1007,9 @@ sal_Bool SdXShape::IsEmptyPresObj() const throw()
if( pParaObj )
{
delete pParaObj;
+ }
+ else
+ {
return sal_True;
}
}
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 4a01c995544b..a252e2302b59 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -106,6 +106,12 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::office;
+
+namespace sd {
+extern Reference< XAnnotation > createAnnotation( const Reference< XComponentContext >& xContext, SdPage* );
+extern Reference< XAnnotationEnumeration > createAnnotationEnumeration( const sd::AnnotationVector& );
+}
/* this are the ids for page properties */
enum WID_PAGE
@@ -519,6 +525,10 @@ Any SAL_CALL SdGenericDrawPage::queryInterface( const uno::Type & rType )
else QUERYINT( drawing::XShapeCombiner );
else QUERYINT( drawing::XShapeBinder );
else QUERYINT( beans::XMultiPropertySet );
+ else if( rType == ITYPE( office::XAnnotationAccess ) )
+ {
+ return Any( Reference< office::XAnnotationAccess >( this ) );
+ }
else if( rType == ITYPE( XAnimationNodeSupplier ) )
{
if( mbIsImpressDocument )
@@ -2036,7 +2046,7 @@ Sequence< uno::Type > SAL_CALL SdDrawPage::getTypes() throw(uno::RuntimeExceptio
// Collect the types of this class.
::std::vector<uno::Type> aTypes;
- aTypes.reserve(11);
+ aTypes.reserve(13);
aTypes.push_back(ITYPE(drawing::XDrawPage));
aTypes.push_back(ITYPE(beans::XPropertySet));
aTypes.push_back(ITYPE(container::XNamed));
@@ -2046,6 +2056,7 @@ Sequence< uno::Type > SAL_CALL SdDrawPage::getTypes() throw(uno::RuntimeExceptio
aTypes.push_back(ITYPE(document::XLinkTargetSupplier));
aTypes.push_back(ITYPE( drawing::XShapeCombiner ));
aTypes.push_back(ITYPE( drawing::XShapeBinder ));
+ aTypes.push_back(ITYPE( office::XAnnotationAccess ));
aTypes.push_back(ITYPE( beans::XMultiPropertySet ));
if( bPresPage )
aTypes.push_back(ITYPE(presentation::XPresentationPage));
@@ -2526,6 +2537,27 @@ void SdDrawPage::setBackground( const Any& rValue )
// pPage->SendRepaintBroadcast();
}
+// XAnnotationAccess:
+Reference< XAnnotation > SAL_CALL SdGenericDrawPage::createAndInsertAnnotation() throw (RuntimeException)
+{
+ if( !GetPage() )
+ throw DisposedException();
+
+ Reference< XAnnotation > xRet;
+ GetPage()->createAnnotation(xRet);
+ return xRet;
+}
+
+void SAL_CALL SdGenericDrawPage::removeAnnotation(const Reference< XAnnotation > & annotation) throw (RuntimeException, IllegalArgumentException)
+{
+ GetPage()->removeAnnotation(annotation);
+}
+
+Reference< XAnnotationEnumeration > SAL_CALL SdGenericDrawPage::createAnnotationEnumeration() throw (RuntimeException)
+{
+ return ::sd::createAnnotationEnumeration( GetPage()->getAnnotations() );
+}
+
void SdDrawPage::getBackground( Any& rValue ) throw()
{
SdrObject* pObj = GetPage()->GetBackgroundObj();
@@ -2698,7 +2730,7 @@ Sequence< uno::Type > SAL_CALL SdMasterPage::getTypes() throw(uno::RuntimeExcept
// Collect the types of this class.
::std::vector<uno::Type> aTypes;
- aTypes.reserve(10);
+ aTypes.reserve(12);
aTypes.push_back(ITYPE(drawing::XDrawPage));
aTypes.push_back(ITYPE(beans::XPropertySet));
aTypes.push_back(ITYPE(container::XNamed));
@@ -2707,6 +2739,7 @@ Sequence< uno::Type > SAL_CALL SdMasterPage::getTypes() throw(uno::RuntimeExcept
aTypes.push_back(ITYPE(document::XLinkTargetSupplier));
aTypes.push_back(ITYPE( drawing::XShapeCombiner ));
aTypes.push_back(ITYPE( drawing::XShapeBinder ));
+ aTypes.push_back(ITYPE( office::XAnnotationAccess ));
aTypes.push_back(ITYPE( beans::XMultiPropertySet ));
if( bPresPage )
aTypes.push_back(ITYPE(presentation::XPresentationPage));
diff --git a/sd/source/ui/unoidl/unopage.hxx b/sd/source/ui/unoidl/unopage.hxx
index c9d3aec46df5..a1d9e0436e98 100644
--- a/sd/source/ui/unoidl/unopage.hxx
+++ b/sd/source/ui/unoidl/unopage.hxx
@@ -37,6 +37,8 @@
#include <com/sun/star/presentation/XPresentationPage.hpp>
#include <com/sun/star/animations/XAnimationNodeSupplier.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include <com/sun/star/office/XAnnotationAccess.hpp>
+
#include <svtools/itemprop.hxx>
#ifndef _SVX_UNOPAGE_HXX
@@ -69,6 +71,7 @@ class SdGenericDrawPage : public SvxFmDrawPage,
public ::com::sun::star::beans::XPropertySet,
public ::com::sun::star::beans::XMultiPropertySet,
public ::com::sun::star::animations::XAnimationNodeSupplier,
+ public ::com::sun::star::office::XAnnotationAccess,
public ::com::sun::star::document::XLinkTargetSupplier
{
private:
@@ -158,6 +161,11 @@ public:
// XAnimationNodeSupplier
virtual ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > SAL_CALL getAnimationNode( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XAnnotationAccess:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > SAL_CALL createAndInsertAnnotation() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeAnnotation(const ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > & annotation) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotationEnumeration > SAL_CALL createAnnotationEnumeration() throw (::com::sun::star::uno::RuntimeException);
};
/***********************************************************************
diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx
index 560354909185..0808221582f1 100644
--- a/sd/source/ui/unoidl/unopback.cxx
+++ b/sd/source/ui/unoidl/unopback.cxx
@@ -194,10 +194,8 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet )
setPropertyValue( aPropertyName, *pAny );
}
}
- else
- setPropertyValue( aIt->sName, *pAny );
- }
++aIt;
+ }
}
}
diff --git a/sd/source/ui/view/GraphicObjectBar.cxx b/sd/source/ui/view/GraphicObjectBar.cxx
index d67d431b9d1f..9e34bc4e3f39 100644
--- a/sd/source/ui/view/GraphicObjectBar.cxx
+++ b/sd/source/ui/view/GraphicObjectBar.cxx
@@ -173,8 +173,10 @@ void GraphicObjectBar::ExecuteFilter( SfxRequest& rReq )
aStr.Append( String( SdResId( STR_UNDO_GRAFFILTER ) ) );
mpView->BegUndo( aStr );
pFilteredObj->SetGraphicObject( aFilterObj );
- mpView->ReplaceObjectAtView( pObj, *pPageView, pFilteredObj );
- mpView->EndUndo();
+ ::sd::View* const pView = mpView;
+ pView->ReplaceObjectAtView( pObj, *pPageView, pFilteredObj );
+ pView->EndUndo();
+ return;
}
}
}
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 8f0ac9f21c1d..3093df257cb9 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -501,32 +501,7 @@ void ViewShellBase::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
}
break;
- case SFX_EVENT_CREATEDOC:
- // mpPaneManager->InitPanes();
- break;
-
- case SFX_EVENT_ACTIVATEDOC:
- break;
-
- case SFX_EVENT_STARTAPP:
- case SFX_EVENT_CLOSEAPP:
- case SFX_EVENT_CLOSEDOC:
- case SFX_EVENT_SAVEDOC:
- case SFX_EVENT_SAVEASDOC:
- case SFX_EVENT_DEACTIVATEDOC:
- case SFX_EVENT_PRINTDOC:
- case SFX_EVENT_ONERROR:
- case SFX_EVENT_LOADFINISHED:
- case SFX_EVENT_SAVEFINISHED:
- case SFX_EVENT_MODIFYCHANGED:
- case SFX_EVENT_PREPARECLOSEDOC:
- case SFX_EVENT_NEWMESSAGE:
- case SFX_EVENT_TOGGLEFULLSCREENMODE:
- case SFX_EVENT_SAVEDOCDONE:
- case SFX_EVENT_SAVEASDOCDONE:
- case SFX_EVENT_MOUSEOVER_OBJECT:
- case SFX_EVENT_MOUSECLICK_OBJECT:
- case SFX_EVENT_MOUSEOUT_OBJECT:
+ default:
break;
}
}
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 556154136152..2077a852f960 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -165,8 +165,6 @@ void DrawViewShell::Deactivate(BOOL bIsMDIActivate)
void DrawViewShell::SelectionHasChanged (void)
{
- // Um die Performance zu steigern wird jetzt die komplette
- // Shell invalidiert statt alle Slots einzeln
Invalidate();
//Update3DWindow(); // 3D-Controller
@@ -492,6 +490,8 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
Invalidate( SID_PAGEMODE );
Invalidate( SID_LAYERMODE );
Invalidate( SID_MASTERPAGE );
+ Invalidate( SID_DELETE_MASTER_PAGE );
+ Invalidate( SID_DELETE_PAGE );
Invalidate( SID_SLIDE_MASTERPAGE );
Invalidate( SID_TITLE_MASTERPAGE );
Invalidate( SID_NOTES_MASTERPAGE );
@@ -1229,7 +1229,11 @@ BOOL DrawViewShell::SwitchPage(USHORT nSelectedPage)
SfxBindings& rBindings = GetViewFrame()->GetBindings();
rBindings.Invalidate(SID_NAVIGATOR_PAGENAME, TRUE, FALSE);
rBindings.Invalidate(SID_STATUS_PAGE, TRUE, FALSE);
+ rBindings.Invalidate(SID_DELETE_MASTER_PAGE, TRUE, FALSE);
+ rBindings.Invalidate(SID_DELETE_PAGE, TRUE, FALSE);
UpdatePreview( mpActualPage );
+
+ mpDrawView->AdjustMarkHdl();
}
return (bOK);
@@ -1356,6 +1360,7 @@ void DrawViewShell::ResetActualLayer()
pLayerBar->SetCurPageId(nActiveLayer + 1);
GetViewFrame()->GetBindings().Invalidate( SID_MODIFYLAYER );
+ GetViewFrame()->GetBindings().Invalidate( SID_DELETE_LAYER );
}
}
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index d63c30101063..85706fb9cbb6 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -502,6 +502,9 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
if ( !IsInputLocked() )
{
+ if( GetView() &&GetView()->getSmartTags().Command(rCEvt) )
+ return;
+
const bool bNativeShow (SlideShow::IsRunning(GetViewShellBase()));
if( rCEvt.GetCommand() == COMMAND_PASTESELECTION && !bNativeShow )
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index bbdb31adf460..983033be7b8c 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -210,7 +210,7 @@ IMPL_LINK( DrawViewShell, ClipboardChanged, TransferableDataHelper*, pDataHelper
SfxBindings& rBindings = GetViewFrame()->GetBindings();
rBindings.Invalidate( SID_PASTE );
- rBindings.Invalidate( SID_PASTE2 );
+ rBindings.Invalidate( SID_PASTE_SPECIAL );
rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
}
return 0;
@@ -570,7 +570,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
// clipboard (paste)
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_PASTE ) ||
- SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_PASTE2 ) ||
+ SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_PASTE_SPECIAL ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CLIPBOARD_FORMAT_ITEMS ) )
{
if ( !mpClipEvtLstnr )
@@ -596,7 +596,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
if( !mbPastePossible )
{
rSet.DisableItem( SID_PASTE );
- rSet.DisableItem( SID_PASTE2 );
+ rSet.DisableItem( SID_PASTE_SPECIAL );
rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS );
}
else if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CLIPBOARD_FORMAT_ITEMS ) )
@@ -1017,7 +1017,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
SD_MOD()->GetWaterCan() )
{
rSet.DisableItem( SID_PASTE );
- rSet.DisableItem( SID_PASTE2 );
+ rSet.DisableItem( SID_PASTE_SPECIAL );
rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS );
rSet.DisableItem( SID_INSERT_FLD_DATE_FIX );
@@ -1328,6 +1328,8 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
}
}
+ // #i102735# discussed with CL: removed for performance reasons
+ #if 0
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_INSERT_SOUND ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_INSERT_VIDEO ) )
{
@@ -1340,6 +1342,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
if (!SvxPluginFileDlg::IsAvailable (SID_INSERT_VIDEO))
rSet.DisableItem (SID_INSERT_VIDEO);
}
+ #endif
///////////////////////////////////////////////////////////////////////
// Menuoption: Change->Convert->To Bitmap, Change->Convert->To Metafile
diff --git a/sd/source/ui/view/drviews8.cxx b/sd/source/ui/view/drviews8.cxx
index d2ea0daf06b7..047c1f90f3d5 100644
--- a/sd/source/ui/view/drviews8.cxx
+++ b/sd/source/ui/view/drviews8.cxx
@@ -167,7 +167,7 @@ void DrawViewShell::FuTemp01(SfxRequest& rReq)
}
break;
- case SID_PASTE2:
+ case SID_PASTE_SPECIAL:
{
SetCurrentFunction( FuInsertClipboard::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
Cancel();
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 4641752afe5c..3c396db7207d 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -83,6 +83,7 @@
#include "SdUnoDrawView.hxx"
#include "slideshow.hxx"
#include "ToolBarManager.hxx"
+#include "annotationmanager.hxx"
using namespace ::rtl;
using namespace ::com::sun::star;
@@ -138,15 +139,10 @@ void SAL_CALL ScannerEventListener::disposing( const ::com::sun::star::lang::Eve
|*
\************************************************************************/
-DrawViewShell::DrawViewShell (
- SfxViewFrame* pFrame,
- ViewShellBase& rViewShellBase,
- ::Window* pParentWindow,
- PageKind ePageKind,
- FrameView* pFrameViewArgument)
- : ViewShell (pFrame, pParentWindow, rViewShellBase),
- maTabControl(this, pParentWindow),
- mbIsInSwitchPage(false)
+DrawViewShell::DrawViewShell( SfxViewFrame* pFrame, ViewShellBase& rViewShellBase, ::Window* pParentWindow, PageKind ePageKind, FrameView* pFrameViewArgument )
+: ViewShell (pFrame, pParentWindow, rViewShellBase)
+, maTabControl(this, pParentWindow)
+, mbIsInSwitchPage(false)
{
if (pFrameViewArgument != NULL)
mpFrameView = pFrameViewArgument;
@@ -161,13 +157,10 @@ DrawViewShell::DrawViewShell (
|*
\************************************************************************/
-DrawViewShell::DrawViewShell (
- SfxViewFrame* pFrame,
- ::Window* pParentWindow,
- const DrawViewShell& rShell)
- : ViewShell(pFrame, pParentWindow, rShell),
- maTabControl(this, pParentWindow),
- mbIsInSwitchPage(false)
+DrawViewShell::DrawViewShell( SfxViewFrame* pFrame, ::Window* pParentWindow, const DrawViewShell& rShell )
+: ViewShell(pFrame, pParentWindow, rShell)
+, maTabControl(this, pParentWindow)
+, mbIsInSwitchPage(false)
{
mpFrameView = new FrameView(GetDoc());
Construct (GetDocSh(), PK_STANDARD);
@@ -181,6 +174,8 @@ DrawViewShell::DrawViewShell (
DrawViewShell::~DrawViewShell()
{
+ mpAnnotationManager.release();
+
OSL_ASSERT (GetViewShell()!=NULL);
if( mxScannerListener.is() )
@@ -422,6 +417,8 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
::com::sun::star::uno::UNO_QUERY );
}
}
+
+ mpAnnotationManager.reset( new AnnotationManager( GetViewShellBase() ) );
}
@@ -859,5 +856,19 @@ void DrawViewShell::Notify (SfxBroadcaster&, const SfxHint& rHint)
}
+void DrawViewShell::ExecuteAnnotation (SfxRequest& rRequest)
+{
+ if( mpAnnotationManager.get() )
+ mpAnnotationManager->ExecuteAnnotation( rRequest );
+}
+
+// --------------------------------------------------------------------
+
+void DrawViewShell::GetAnnotationState (SfxItemSet& rItemSet )
+{
+ if( mpAnnotationManager.get() )
+ mpAnnotationManager->GetAnnotationState( rItemSet );
+}
+
} // end of namespace sd
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index d4f921d369dc..d14f6ed9dc34 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -793,7 +793,7 @@ IMPL_LINK( OutlineViewShell, ClipboardChanged, TransferableDataHelper*, pDataHel
SfxBindings& rBindings = GetViewFrame()->GetBindings();
rBindings.Invalidate( SID_PASTE );
- rBindings.Invalidate( SID_PASTE2 );
+ rBindings.Invalidate( SID_PASTE_SPECIAL );
rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
}
return 0;
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 9a63afc03479..020f2a1ffec5 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -443,20 +443,21 @@ drawinglayer::primitive2d::Primitive2DSequence ViewRedirector::createRedirectedP
// get font attributes; use normally scaled font
const basegfx::BColor aFontColor(aRGBColor);
Font aVclFont;
- basegfx::B2DVector aSize;
+ basegfx::B2DVector aTextSizeAttribute;
aVclFont.SetHeight( 500 );
- const drawinglayer::primitive2d::FontAttributes aFontAttributes(drawinglayer::primitive2d::getFontAttributesFromVclFont(
- aSize,
- aVclFont,
- false,
- false));
+ const drawinglayer::primitive2d::FontAttributes aFontAttributes(
+ drawinglayer::primitive2d::getFontAttributesFromVclFont(
+ aTextSizeAttribute,
+ aVclFont,
+ false,
+ false));
// fill text matrix
basegfx::B2DHomMatrix aTextMatrix;
- aTextMatrix.scale(aSize.getX(), aSize.getY());
+ aTextMatrix.scale(aTextSizeAttribute.getX(), aTextSizeAttribute.getY());
aTextMatrix.shearX(fShearX);
aTextMatrix.rotate(fRotate);
aTextMatrix.translate(fPosX, fPosY);
@@ -468,15 +469,16 @@ drawinglayer::primitive2d::Primitive2DSequence ViewRedirector::createRedirectedP
const ::com::sun::star::lang::Locale aLocale;
// create primitive and add
- const drawinglayer::primitive2d::Primitive2DReference xRef(new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
- aTextMatrix,
- aObjectString,
- 0,
- nTextLength,
- aDXArray,
- aFontAttributes,
- aLocale,
- aFontColor));
+ const drawinglayer::primitive2d::Primitive2DReference xRef(
+ new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
+ aTextMatrix,
+ aObjectString,
+ 0,
+ nTextLength,
+ aDXArray,
+ aFontAttributes,
+ aLocale,
+ aFontColor));
drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xRef);
}
}
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index 4b2fd76f7bea..0349388577eb 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -798,7 +798,10 @@ BOOL ViewShell::RequestHelp(const HelpEvent& rHEvt, ::sd::Window*)
if (rHEvt.GetMode())
{
- if(HasCurrentFunction())
+ if( GetView() )
+ bReturn = GetView()->getSmartTags().RequestHelp(rHEvt);
+
+ if(!bReturn && HasCurrentFunction())
{
bReturn = GetCurrentFunction()->RequestHelp(rHEvt);
}
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index c179385f1c2e..208d5426c8bd 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -665,9 +665,18 @@ void ViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONT );
GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
}
- else if(HasCurrentFunction())
+ else
{
- GetCurrentFunction()->Command(rCEvt);
+ bool bConsumed = false;
+ if( GetView() )
+ {
+ bConsumed = GetView()->getSmartTags().Command(rCEvt);
+ }
+
+ if( !bConsumed && HasCurrentFunction())
+ {
+ GetCurrentFunction()->Command(rCEvt);
+ }
}
}
}
diff --git a/sd/uiconfig/sdraw/accelerator/de/default.xml b/sd/uiconfig/sdraw/accelerator/de/default.xml
deleted file mode 100644
index aeb60003de1c..000000000000
--- a/sd/uiconfig/sdraw/accelerator/de/default.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
- <accel:item accel:code="KEY_Q" accel:mod1="true" xlink:href=".uno:Quit"/>
- <accel:item accel:code="KEY_N" accel:shift="true" accel:mod1="true" xlink:href=".uno:NewDoc"/>
- <accel:item accel:code="KEY_O" accel:mod1="true" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_OPEN" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_P" accel:mod1="true" xlink:href=".uno:Print"/>
- <accel:item accel:code="KEY_S" accel:mod1="true" xlink:href=".uno:Save"/>
- <accel:item accel:code="KEY_F11" xlink:href=".uno:DesignerDialog"/>
- <accel:item accel:code="KEY_F11" accel:mod1="true" xlink:href=".uno:StyleCatalog"/>
- <accel:item accel:code="KEY_Y" accel:mod1="true" xlink:href=".uno:Redo"/>
- <accel:item accel:code="KEY_Z" accel:mod1="true" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_BACKSPACE" accel:mod2="true" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_UNDO" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_REPEAT" xlink:href=".uno:Repeat"/>
- <accel:item accel:code="KEY_X" accel:mod1="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_DELETE" accel:shift="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_CUT" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_C" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_INSERT" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_COPY" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_V" accel:mod1="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_INSERT" accel:shift="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_PASTE" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_DELETE" xlink:href=".uno:Delete"/>
- <accel:item accel:code="KEY_F2" xlink:href=".uno:Text"/>
- <accel:item accel:code="KEY_K" accel:shift="true" accel:mod1="true" xlink:href=".uno:Italic"/>
- <accel:item accel:code="KEY_F" accel:shift="true" accel:mod1="true" xlink:href=".uno:Bold"/>
- <accel:item accel:code="KEY_U" accel:shift="true" accel:mod1="true" xlink:href=".uno:Underline"/>
- <accel:item accel:code="KEY_L" accel:mod1="true" xlink:href=".uno:LeftPara"/>
- <accel:item accel:code="KEY_R" accel:mod1="true" xlink:href=".uno:RightPara"/>
- <accel:item accel:code="KEY_E" accel:mod1="true" xlink:href=".uno:CenterPara"/>
- <accel:item accel:code="KEY_B" accel:mod1="true" xlink:href=".uno:JustifyPara"/>
- <accel:item accel:code="KEY_1" accel:mod1="true" xlink:href=".uno:SpacePara1"/>
- <accel:item accel:code="KEY_5" accel:mod1="true" xlink:href=".uno:SpacePara15"/>
- <accel:item accel:code="KEY_2" accel:mod1="true" xlink:href=".uno:SpacePara2"/>
- <accel:item accel:code="KEY_F4" xlink:href=".uno:TransformDialog"/>
- <accel:item accel:code="KEY_F8" xlink:href=".uno:ToggleObjectBezierMode"/>
- <accel:item accel:code="KEY_F7" xlink:href=".uno:SpellDialog"/>
- <accel:item accel:code="KEY_F7" accel:mod1="true" xlink:href=".uno:Thesaurus"/>
- <accel:item accel:code="KEY_ADD" accel:shift="true" accel:mod1="true" xlink:href=".uno:BringToFront"/>
- <accel:item accel:code="KEY_SUBTRACT" accel:shift="true" accel:mod1="true" xlink:href=".uno:SendToBack"/>
- <accel:item accel:code="KEY_H" accel:mod1="true" xlink:href=".uno:SuperScript"/>
- <accel:item accel:code="KEY_T" accel:mod1="true" xlink:href=".uno:SubScript"/>
- <accel:item accel:code="KEY_F5" xlink:href=".uno:Navigator"/>
- <accel:item accel:code="KEY_F8" accel:shift="true" accel:mod1="true" xlink:href=".uno:TextFitToSize"/>
- <accel:item accel:code="KEY_G" accel:shift="true" accel:mod1="true" xlink:href=".uno:FormatGroup"/>
- <accel:item accel:code="KEY_G" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:FormatUngroup"/>
- <accel:item accel:code="KEY_9" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:ShowItemBrowser"/>
- <accel:item accel:code="KEY_V" accel:shift="true" accel:mod1="true" xlink:href=".uno:PasteClipboard"/>
- <accel:item accel:code="KEY_F3" accel:shift="true" xlink:href=".uno:CopyObjects"/>
- <accel:item accel:code="KEY_P" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:PixelMode"/>
- <accel:item accel:code="KEY_C" accel:shift="true" accel:mod1="true" xlink:href=".uno:Combine"/>
- <accel:item accel:code="KEY_ADD" accel:mod1="true" xlink:href=".uno:Forward"/>
- <accel:item accel:code="KEY_SUBTRACT" accel:mod1="true" xlink:href=".uno:Backward"/>
- <accel:item accel:code="KEY_A" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:AnimationMode"/>
- <accel:item accel:code="KEY_C" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:Dismantle"/>
- <accel:item accel:code="KEY_F3" xlink:href=".uno:EnterGroup"/>
- <accel:item accel:code="KEY_F3" accel:mod1="true" xlink:href=".uno:LeaveGroup"/>
- <accel:item accel:code="KEY_M" accel:mod1="true" xlink:href=".uno:ResetAttributes"/>
- <accel:item accel:code="KEY_SPACE" accel:shift="true" accel:mod1="true" xlink:href=".uno:InsertNonBreakingSpace"/>
- <accel:item accel:code="KEY_DIVIDE" accel:mod1="true" xlink:href=".uno:InsertZWSP"/>
-</accel:acceleratorlist>
diff --git a/sd/uiconfig/sdraw/accelerator/en-GB/default.xml b/sd/uiconfig/sdraw/accelerator/en-GB/default.xml
deleted file mode 100644
index 3219cbbc1f02..000000000000
--- a/sd/uiconfig/sdraw/accelerator/en-GB/default.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
- <accel:item accel:code="KEY_Q" accel:mod1="true" xlink:href=".uno:Quit"/>
- <accel:item accel:code="KEY_N" accel:shift="true" accel:mod1="true" xlink:href=".uno:NewDoc"/>
- <accel:item accel:code="KEY_O" accel:mod1="true" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_OPEN" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_P" accel:mod1="true" xlink:href=".uno:Print"/>
- <accel:item accel:code="KEY_S" accel:mod1="true" xlink:href=".uno:Save"/>
- <accel:item accel:code="KEY_F11" xlink:href=".uno:DesignerDialog"/>
- <accel:item accel:code="KEY_F11" accel:mod1="true" xlink:href=".uno:StyleCatalog"/>
- <accel:item accel:code="KEY_Y" accel:mod1="true" xlink:href=".uno:Redo"/>
- <accel:item accel:code="KEY_Z" accel:mod1="true" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_BACKSPACE" accel:mod2="true" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_UNDO" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_REPEAT" xlink:href=".uno:Repeat"/>
- <accel:item accel:code="KEY_X" accel:mod1="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_DELETE" accel:shift="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_CUT" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_C" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_INSERT" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_COPY" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_V" accel:mod1="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_INSERT" accel:shift="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_PASTE" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_DELETE" xlink:href=".uno:Delete"/>
- <accel:item accel:code="KEY_F2" xlink:href=".uno:Text"/>
- <accel:item accel:code="KEY_I" accel:mod1="true" xlink:href=".uno:Italic"/>
- <accel:item accel:code="KEY_B" accel:mod1="true" xlink:href=".uno:Bold"/>
- <accel:item accel:code="KEY_U" accel:mod1="true" xlink:href=".uno:Underline"/>
- <accel:item accel:code="KEY_L" accel:mod1="true" xlink:href=".uno:LeftPara"/>
- <accel:item accel:code="KEY_R" accel:mod1="true" xlink:href=".uno:RightPara"/>
- <accel:item accel:code="KEY_E" accel:mod1="true" xlink:href=".uno:CenterPara"/>
- <accel:item accel:code="KEY_J" accel:mod1="true" xlink:href=".uno:JustifyPara"/>
- <accel:item accel:code="KEY_1" accel:mod1="true" xlink:href=".uno:SpacePara1"/>
- <accel:item accel:code="KEY_5" accel:mod1="true" xlink:href=".uno:SpacePara15"/>
- <accel:item accel:code="KEY_2" accel:mod1="true" xlink:href=".uno:SpacePara2"/>
- <accel:item accel:code="KEY_F4" xlink:href=".uno:TransformDialog"/>
- <accel:item accel:code="KEY_F8" xlink:href=".uno:ToggleObjectBezierMode"/>
- <accel:item accel:code="KEY_F7" xlink:href=".uno:SpellDialog"/>
- <accel:item accel:code="KEY_F7" accel:mod1="true" xlink:href=".uno:Thesaurus"/>
- <accel:item accel:code="KEY_ADD" accel:shift="true" accel:mod1="true" xlink:href=".uno:BringToFront"/>
- <accel:item accel:code="KEY_SUBTRACT" accel:shift="true" accel:mod1="true" xlink:href=".uno:SendToBack"/>
- <accel:item accel:code="KEY_P" accel:shift="true" accel:mod1="true" xlink:href=".uno:SuperScript"/>
- <accel:item accel:code="KEY_B" accel:shift="true" accel:mod1="true" xlink:href=".uno:SubScript"/>
- <accel:item accel:code="KEY_F5" xlink:href=".uno:Navigator"/>
- <accel:item accel:code="KEY_F8" accel:shift="true" accel:mod1="true" xlink:href=".uno:TextFitToSize"/>
- <accel:item accel:code="KEY_G" accel:shift="true" accel:mod1="true" xlink:href=".uno:FormatGroup"/>
- <accel:item accel:code="KEY_G" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:FormatUngroup"/>
- <accel:item accel:code="KEY_9" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:ShowItemBrowser"/>
- <accel:item accel:code="KEY_V" accel:shift="true" accel:mod1="true" xlink:href=".uno:PasteClipboard"/>
- <accel:item accel:code="KEY_F3" accel:shift="true" xlink:href=".uno:CopyObjects"/>
- <accel:item accel:code="KEY_P" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:PixelMode"/>
- <accel:item accel:code="KEY_K" accel:shift="true" accel:mod1="true" xlink:href=".uno:Combine"/>
- <accel:item accel:code="KEY_ADD" accel:mod1="true" xlink:href=".uno:Forward"/>
- <accel:item accel:code="KEY_SUBTRACT" accel:mod1="true" xlink:href=".uno:Backward"/>
- <accel:item accel:code="KEY_A" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:AnimationMode"/>
- <accel:item accel:code="KEY_K" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:Dismantle"/>
- <accel:item accel:code="KEY_F3" xlink:href=".uno:EnterGroup"/>
- <accel:item accel:code="KEY_F3" accel:mod1="true" xlink:href=".uno:LeaveGroup"/>
- <accel:item accel:code="KEY_M" accel:mod1="true" xlink:href=".uno:ResetAttributes"/>
- <accel:item accel:code="KEY_SPACE" accel:shift="true" accel:mod1="true" xlink:href=".uno:InsertNonBreakingSpace"/>
- <accel:item accel:code="KEY_DIVIDE" accel:mod1="true" xlink:href=".uno:InsertZWSP"/>
-</accel:acceleratorlist>
diff --git a/sd/uiconfig/sdraw/accelerator/en-US/default.xml b/sd/uiconfig/sdraw/accelerator/en-US/default.xml
deleted file mode 100644
index 3219cbbc1f02..000000000000
--- a/sd/uiconfig/sdraw/accelerator/en-US/default.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
- <accel:item accel:code="KEY_Q" accel:mod1="true" xlink:href=".uno:Quit"/>
- <accel:item accel:code="KEY_N" accel:shift="true" accel:mod1="true" xlink:href=".uno:NewDoc"/>
- <accel:item accel:code="KEY_O" accel:mod1="true" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_OPEN" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_P" accel:mod1="true" xlink:href=".uno:Print"/>
- <accel:item accel:code="KEY_S" accel:mod1="true" xlink:href=".uno:Save"/>
- <accel:item accel:code="KEY_F11" xlink:href=".uno:DesignerDialog"/>
- <accel:item accel:code="KEY_F11" accel:mod1="true" xlink:href=".uno:StyleCatalog"/>
- <accel:item accel:code="KEY_Y" accel:mod1="true" xlink:href=".uno:Redo"/>
- <accel:item accel:code="KEY_Z" accel:mod1="true" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_BACKSPACE" accel:mod2="true" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_UNDO" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_REPEAT" xlink:href=".uno:Repeat"/>
- <accel:item accel:code="KEY_X" accel:mod1="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_DELETE" accel:shift="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_CUT" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_C" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_INSERT" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_COPY" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_V" accel:mod1="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_INSERT" accel:shift="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_PASTE" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_DELETE" xlink:href=".uno:Delete"/>
- <accel:item accel:code="KEY_F2" xlink:href=".uno:Text"/>
- <accel:item accel:code="KEY_I" accel:mod1="true" xlink:href=".uno:Italic"/>
- <accel:item accel:code="KEY_B" accel:mod1="true" xlink:href=".uno:Bold"/>
- <accel:item accel:code="KEY_U" accel:mod1="true" xlink:href=".uno:Underline"/>
- <accel:item accel:code="KEY_L" accel:mod1="true" xlink:href=".uno:LeftPara"/>
- <accel:item accel:code="KEY_R" accel:mod1="true" xlink:href=".uno:RightPara"/>
- <accel:item accel:code="KEY_E" accel:mod1="true" xlink:href=".uno:CenterPara"/>
- <accel:item accel:code="KEY_J" accel:mod1="true" xlink:href=".uno:JustifyPara"/>
- <accel:item accel:code="KEY_1" accel:mod1="true" xlink:href=".uno:SpacePara1"/>
- <accel:item accel:code="KEY_5" accel:mod1="true" xlink:href=".uno:SpacePara15"/>
- <accel:item accel:code="KEY_2" accel:mod1="true" xlink:href=".uno:SpacePara2"/>
- <accel:item accel:code="KEY_F4" xlink:href=".uno:TransformDialog"/>
- <accel:item accel:code="KEY_F8" xlink:href=".uno:ToggleObjectBezierMode"/>
- <accel:item accel:code="KEY_F7" xlink:href=".uno:SpellDialog"/>
- <accel:item accel:code="KEY_F7" accel:mod1="true" xlink:href=".uno:Thesaurus"/>
- <accel:item accel:code="KEY_ADD" accel:shift="true" accel:mod1="true" xlink:href=".uno:BringToFront"/>
- <accel:item accel:code="KEY_SUBTRACT" accel:shift="true" accel:mod1="true" xlink:href=".uno:SendToBack"/>
- <accel:item accel:code="KEY_P" accel:shift="true" accel:mod1="true" xlink:href=".uno:SuperScript"/>
- <accel:item accel:code="KEY_B" accel:shift="true" accel:mod1="true" xlink:href=".uno:SubScript"/>
- <accel:item accel:code="KEY_F5" xlink:href=".uno:Navigator"/>
- <accel:item accel:code="KEY_F8" accel:shift="true" accel:mod1="true" xlink:href=".uno:TextFitToSize"/>
- <accel:item accel:code="KEY_G" accel:shift="true" accel:mod1="true" xlink:href=".uno:FormatGroup"/>
- <accel:item accel:code="KEY_G" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:FormatUngroup"/>
- <accel:item accel:code="KEY_9" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:ShowItemBrowser"/>
- <accel:item accel:code="KEY_V" accel:shift="true" accel:mod1="true" xlink:href=".uno:PasteClipboard"/>
- <accel:item accel:code="KEY_F3" accel:shift="true" xlink:href=".uno:CopyObjects"/>
- <accel:item accel:code="KEY_P" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:PixelMode"/>
- <accel:item accel:code="KEY_K" accel:shift="true" accel:mod1="true" xlink:href=".uno:Combine"/>
- <accel:item accel:code="KEY_ADD" accel:mod1="true" xlink:href=".uno:Forward"/>
- <accel:item accel:code="KEY_SUBTRACT" accel:mod1="true" xlink:href=".uno:Backward"/>
- <accel:item accel:code="KEY_A" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:AnimationMode"/>
- <accel:item accel:code="KEY_K" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:Dismantle"/>
- <accel:item accel:code="KEY_F3" xlink:href=".uno:EnterGroup"/>
- <accel:item accel:code="KEY_F3" accel:mod1="true" xlink:href=".uno:LeaveGroup"/>
- <accel:item accel:code="KEY_M" accel:mod1="true" xlink:href=".uno:ResetAttributes"/>
- <accel:item accel:code="KEY_SPACE" accel:shift="true" accel:mod1="true" xlink:href=".uno:InsertNonBreakingSpace"/>
- <accel:item accel:code="KEY_DIVIDE" accel:mod1="true" xlink:href=".uno:InsertZWSP"/>
-</accel:acceleratorlist>
diff --git a/sd/uiconfig/sdraw/accelerator/es/default.xml b/sd/uiconfig/sdraw/accelerator/es/default.xml
deleted file mode 100644
index ae40f1ae35d6..000000000000
--- a/sd/uiconfig/sdraw/accelerator/es/default.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
- <accel:item accel:code="KEY_Q" accel:mod1="true" xlink:href=".uno:Quit"/>
- <accel:item accel:code="KEY_N" accel:shift="true" accel:mod1="true" xlink:href=".uno:NewDoc"/>
- <accel:item accel:code="KEY_A" accel:mod1="true" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_OPEN" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_P" accel:mod1="true" xlink:href=".uno:Print"/>
- <accel:item accel:code="KEY_G" accel:mod1="true" xlink:href=".uno:Save"/>
- <accel:item accel:code="KEY_F11" xlink:href=".uno:DesignerDialog"/>
- <accel:item accel:code="KEY_F11" accel:mod1="true" xlink:href=".uno:StyleCatalog"/>
- <accel:item accel:code="KEY_Y" accel:mod1="true" xlink:href=".uno:Redo"/>
- <accel:item accel:code="KEY_Z" accel:mod1="true" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_BACKSPACE" accel:mod2="true" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_UNDO" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_REPEAT" xlink:href=".uno:Repeat"/>
- <accel:item accel:code="KEY_X" accel:mod1="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_DELETE" accel:shift="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_CUT" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_C" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_INSERT" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_COPY" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_V" accel:mod1="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_INSERT" accel:shift="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_PASTE" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_DELETE" xlink:href=".uno:Delete"/>
- <accel:item accel:code="KEY_F2" xlink:href=".uno:Text"/>
- <accel:item accel:code="KEY_K" accel:mod1="true" xlink:href=".uno:Italic"/>
- <accel:item accel:code="KEY_N" accel:mod1="true" xlink:href=".uno:Bold"/>
- <accel:item accel:code="KEY_S" accel:mod1="true" xlink:href=".uno:Underline"/>
- <accel:item accel:code="KEY_L" accel:mod1="true" xlink:href=".uno:LeftPara"/>
- <accel:item accel:code="KEY_R" accel:mod1="true" xlink:href=".uno:RightPara"/>
- <accel:item accel:code="KEY_T" accel:mod1="true" xlink:href=".uno:CenterPara"/>
- <accel:item accel:code="KEY_J" accel:mod1="true" xlink:href=".uno:JustifyPara"/>
- <accel:item accel:code="KEY_1" accel:mod1="true" xlink:href=".uno:SpacePara1"/>
- <accel:item accel:code="KEY_5" accel:mod1="true" xlink:href=".uno:SpacePara15"/>
- <accel:item accel:code="KEY_2" accel:mod1="true" xlink:href=".uno:SpacePara2"/>
- <accel:item accel:code="KEY_F4" xlink:href=".uno:TransformDialog"/>
- <accel:item accel:code="KEY_F8" xlink:href=".uno:ToggleObjectBezierMode"/>
- <accel:item accel:code="KEY_F7" xlink:href=".uno:SpellDialog"/>
- <accel:item accel:code="KEY_F7" accel:mod1="true" xlink:href=".uno:Thesaurus"/>
- <accel:item accel:code="KEY_ADD" accel:shift="true" accel:mod1="true" xlink:href=".uno:BringToFront"/>
- <accel:item accel:code="KEY_SUBTRACT" accel:shift="true" accel:mod1="true" xlink:href=".uno:SendToBack"/>
- <accel:item accel:code="KEY_P" accel:shift="true" accel:mod1="true" xlink:href=".uno:SuperScript"/>
- <accel:item accel:code="KEY_B" accel:shift="true" accel:mod1="true" xlink:href=".uno:SubScript"/>
- <accel:item accel:code="KEY_F5" xlink:href=".uno:Navigator"/>
- <accel:item accel:code="KEY_F8" accel:shift="true" accel:mod1="true" xlink:href=".uno:TextFitToSize"/>
- <accel:item accel:code="KEY_G" accel:shift="true" accel:mod1="true" xlink:href=".uno:FormatGroup"/>
- <accel:item accel:code="KEY_G" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:FormatUngroup"/>
- <accel:item accel:code="KEY_9" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:ShowItemBrowser"/>
- <accel:item accel:code="KEY_V" accel:shift="true" accel:mod1="true" xlink:href=".uno:PasteClipboard"/>
- <accel:item accel:code="KEY_F3" accel:shift="true" xlink:href=".uno:CopyObjects"/>
- <accel:item accel:code="KEY_P" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:PixelMode"/>
- <accel:item accel:code="KEY_K" accel:shift="true" accel:mod1="true" xlink:href=".uno:Combine"/>
- <accel:item accel:code="KEY_ADD" accel:mod1="true" xlink:href=".uno:Forward"/>
- <accel:item accel:code="KEY_SUBTRACT" accel:mod1="true" xlink:href=".uno:Backward"/>
- <accel:item accel:code="KEY_A" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:AnimationMode"/>
- <accel:item accel:code="KEY_K" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:Dismantle"/>
- <accel:item accel:code="KEY_F3" xlink:href=".uno:EnterGroup"/>
- <accel:item accel:code="KEY_F3" accel:mod1="true" xlink:href=".uno:LeaveGroup"/>
- <accel:item accel:code="KEY_M" accel:mod1="true" xlink:href=".uno:ResetAttributes"/>
- <accel:item accel:code="KEY_SPACE" accel:shift="true" accel:mod1="true" xlink:href=".uno:InsertNonBreakingSpace"/>
- <accel:item accel:code="KEY_DIVIDE" accel:mod1="true" xlink:href=".uno:InsertZWSP"/>
-</accel:acceleratorlist>
diff --git a/sd/uiconfig/sdraw/accelerator/fr/default.xml b/sd/uiconfig/sdraw/accelerator/fr/default.xml
deleted file mode 100644
index b231ba598b7a..000000000000
--- a/sd/uiconfig/sdraw/accelerator/fr/default.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
- <accel:item accel:code="KEY_Q" accel:mod1="true" xlink:href=".uno:Quit"/>
- <accel:item accel:code="KEY_N" accel:shift="true" accel:mod1="true" xlink:href=".uno:NewDoc"/>
- <accel:item accel:code="KEY_O" accel:mod1="true" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_OPEN" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_P" accel:mod1="true" xlink:href=".uno:Print"/>
- <accel:item accel:code="KEY_S" accel:mod1="true" xlink:href=".uno:Save"/>
- <accel:item accel:code="KEY_F11" xlink:href=".uno:DesignerDialog"/>
- <accel:item accel:code="KEY_F11" accel:mod1="true" xlink:href=".uno:StyleCatalog"/>
- <accel:item accel:code="KEY_Y" accel:mod1="true" xlink:href=".uno:Redo"/>
- <accel:item accel:code="KEY_Z" accel:mod1="true" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_BACKSPACE" accel:mod2="true" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_UNDO" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_REPEAT" xlink:href=".uno:Repeat"/>
- <accel:item accel:code="KEY_X" accel:mod1="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_DELETE" accel:shift="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_CUT" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_C" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_INSERT" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_COPY" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_V" accel:mod1="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_INSERT" accel:shift="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_PASTE" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_DELETE" xlink:href=".uno:Delete"/>
- <accel:item accel:code="KEY_F2" xlink:href=".uno:Text"/>
- <accel:item accel:code="KEY_I" accel:mod1="true" xlink:href=".uno:Italic"/>
- <accel:item accel:code="KEY_G" accel:mod1="true" xlink:href=".uno:Bold"/>
- <accel:item accel:code="KEY_U" accel:mod1="true" xlink:href=".uno:Underline"/>
- <accel:item accel:code="KEY_L" accel:mod1="true" xlink:href=".uno:LeftPara"/>
- <accel:item accel:code="KEY_R" accel:mod1="true" xlink:href=".uno:RightPara"/>
- <accel:item accel:code="KEY_E" accel:mod1="true" xlink:href=".uno:CenterPara"/>
- <accel:item accel:code="KEY_J" accel:mod1="true" xlink:href=".uno:JustifyPara"/>
- <accel:item accel:code="KEY_1" accel:mod1="true" xlink:href=".uno:SpacePara1"/>
- <accel:item accel:code="KEY_5" accel:mod1="true" xlink:href=".uno:SpacePara15"/>
- <accel:item accel:code="KEY_2" accel:mod1="true" xlink:href=".uno:SpacePara2"/>
- <accel:item accel:code="KEY_F4" xlink:href=".uno:TransformDialog"/>
- <accel:item accel:code="KEY_F8" xlink:href=".uno:ToggleObjectBezierMode"/>
- <accel:item accel:code="KEY_F7" xlink:href=".uno:SpellDialog"/>
- <accel:item accel:code="KEY_F7" accel:mod1="true" xlink:href=".uno:Thesaurus"/>
- <accel:item accel:code="KEY_ADD" accel:shift="true" accel:mod1="true" xlink:href=".uno:BringToFront"/>
- <accel:item accel:code="KEY_SUBTRACT" accel:shift="true" accel:mod1="true" xlink:href=".uno:SendToBack"/>
- <accel:item accel:code="KEY_P" accel:shift="true" accel:mod1="true" xlink:href=".uno:SuperScript"/>
- <accel:item accel:code="KEY_B" accel:shift="true" accel:mod1="true" xlink:href=".uno:SubScript"/>
- <accel:item accel:code="KEY_F5" xlink:href=".uno:Navigator"/>
- <accel:item accel:code="KEY_F8" accel:shift="true" accel:mod1="true" xlink:href=".uno:TextFitToSize"/>
- <accel:item accel:code="KEY_G" accel:shift="true" accel:mod1="true" xlink:href=".uno:FormatGroup"/>
- <accel:item accel:code="KEY_G" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:FormatUngroup"/>
- <accel:item accel:code="KEY_9" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:ShowItemBrowser"/>
- <accel:item accel:code="KEY_V" accel:shift="true" accel:mod1="true" xlink:href=".uno:PasteClipboard"/>
- <accel:item accel:code="KEY_F3" accel:shift="true" xlink:href=".uno:CopyObjects"/>
- <accel:item accel:code="KEY_P" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:PixelMode"/>
- <accel:item accel:code="KEY_K" accel:shift="true" accel:mod1="true" xlink:href=".uno:Combine"/>
- <accel:item accel:code="KEY_ADD" accel:mod1="true" xlink:href=".uno:Forward"/>
- <accel:item accel:code="KEY_SUBTRACT" accel:mod1="true" xlink:href=".uno:Backward"/>
- <accel:item accel:code="KEY_A" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:AnimationMode"/>
- <accel:item accel:code="KEY_K" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:Dismantle"/>
- <accel:item accel:code="KEY_F3" xlink:href=".uno:EnterGroup"/>
- <accel:item accel:code="KEY_F3" accel:mod1="true" xlink:href=".uno:LeaveGroup"/>
- <accel:item accel:code="KEY_M" accel:mod1="true" xlink:href=".uno:ResetAttributes"/>
- <accel:item accel:code="KEY_SPACE" accel:shift="true" accel:mod1="true" xlink:href=".uno:InsertNonBreakingSpace"/>
- <accel:item accel:code="KEY_DIVIDE" accel:mod1="true" xlink:href=".uno:InsertZWSP"/>
-</accel:acceleratorlist>
diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml
index e34baec0f29c..9e5d927b263e 100644
--- a/sd/uiconfig/sdraw/menubar/menubar.xml
+++ b/sd/uiconfig/sdraw/menubar/menubar.xml
@@ -52,7 +52,7 @@
<menu:menuitem menu:id=".uno:Cut"/>
<menu:menuitem menu:id=".uno:Copy"/>
<menu:menuitem menu:id=".uno:Paste"/>
- <menu:menuitem menu:id=".uno:PasteClipboard"/>
+ <menu:menuitem menu:id=".uno:PasteSpecial"/>
<menu:menuitem menu:id=".uno:SelectAll"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:SearchDialog"/>
@@ -105,7 +105,8 @@
<menu:menuitem menu:id=".uno:HelplinesFront"/>
</menu:menupopup>
</menu:menu>
- <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ShowAnnotations"/>
+ <menu:menuseparator/>
<menu:menuitem menu:id=".uno:Navigator"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:Zoom"/>
@@ -130,8 +131,9 @@
<menu:menuitem menu:id=".uno:InsertFileField"/>
</menu:menupopup>
</menu:menu>
- <menu:menuitem menu:id=".uno:InsertSymbol"/>
- <menu:menu menu:id=".uno:FormattingMarkMenu">
+ <menu:menuitem menu:id=".uno:InsertAnnotation"/>
+ <menu:menuitem menu:id=".uno:InsertSymbol"/>
+ <menu:menu menu:id=".uno:FormattingMarkMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertNonBreakingSpace"/>
<menu:menuitem menu:id=".uno:InsertHardHyphen"/>
diff --git a/sd/uiconfig/sdraw/toolbar/commentsbar.xml b/sd/uiconfig/sdraw/toolbar/commentsbar.xml
new file mode 100644
index 000000000000..07c42d262758
--- /dev/null
+++ b/sd/uiconfig/sdraw/toolbar/commentsbar.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!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:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:InsertAnnotation" toolbar:helpid="helpid:26276"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:PreviousAnnotation" toolbar:helpid="helpid:11095"/>
+ <toolbar:toolbaritem xlink:href=".uno:NextAnnotation" toolbar:helpid="helpid:11094"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:DeleteAnnotation" toolbar:helpid="helpid:11093"/>
+ <toolbar:toolbaritem xlink:href=".uno:DeleteAllAnnotation" toolbar:helpid="helpid:11096"/>
+</toolbar:toolbar> \ No newline at end of file
diff --git a/sd/uiconfig/simpress/accelerator/de/default.xml b/sd/uiconfig/simpress/accelerator/de/default.xml
deleted file mode 100644
index bd9b3b4cdf4c..000000000000
--- a/sd/uiconfig/simpress/accelerator/de/default.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
- <accel:item accel:code="KEY_K" accel:shift="true" accel:mod1="true" xlink:href=".uno:Italic"/>
- <accel:item accel:code="KEY_F" accel:shift="true" accel:mod1="true" xlink:href=".uno:Bold"/>
- <accel:item accel:code="KEY_U" accel:shift="true" accel:mod1="true" xlink:href=".uno:Underline"/>
- <accel:item accel:code="KEY_B" accel:mod1="true" xlink:href=".uno:JustifyPara"/>
- <accel:item accel:code="KEY_H" accel:mod1="true" xlink:href=".uno:SuperScript"/>
- <accel:item accel:code="KEY_T" accel:mod1="true" xlink:href=".uno:SubScript"/>
- <accel:item accel:code="KEY_C" accel:shift="true" accel:mod1="true" xlink:href=".uno:Combine"/>
- <accel:item accel:code="KEY_C" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:Dismantle"/>
-</accel:acceleratorlist>
diff --git a/sd/uiconfig/simpress/accelerator/default.xml b/sd/uiconfig/simpress/accelerator/default.xml
deleted file mode 100644
index 045a72517ae5..000000000000
--- a/sd/uiconfig/simpress/accelerator/default.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
- <accel:item accel:code="KEY_Q" accel:mod1="true" xlink:href=".uno:Quit"/>
- <accel:item accel:code="KEY_N" accel:shift="true" accel:mod1="true" xlink:href=".uno:NewDoc"/>
- <accel:item accel:code="KEY_O" accel:mod1="true" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_OPEN" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_P" accel:mod1="true" xlink:href=".uno:Print"/>
- <accel:item accel:code="KEY_S" accel:mod1="true" xlink:href=".uno:Save"/>
- <accel:item accel:code="KEY_F11" xlink:href=".uno:DesignerDialog"/>
- <accel:item accel:code="KEY_F11" accel:mod1="true" xlink:href=".uno:StyleCatalog"/>
- <accel:item accel:code="KEY_Y" accel:mod1="true" xlink:href=".uno:Redo"/>
- <accel:item accel:code="KEY_Z" accel:mod1="true" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_BACKSPACE" accel:mod2="true" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_UNDO" xlink:href=".uno:Undo"/>
- <accel:item accel:code="KEY_REPEAT" xlink:href=".uno:Repeat"/>
- <accel:item accel:code="KEY_X" accel:mod1="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_DELETE" accel:shift="true" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_CUT" xlink:href=".uno:Cut"/>
- <accel:item accel:code="KEY_C" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_INSERT" accel:mod1="true" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_COPY" xlink:href=".uno:Copy"/>
- <accel:item accel:code="KEY_V" accel:mod1="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_INSERT" accel:shift="true" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_PASTE" xlink:href=".uno:Paste"/>
- <accel:item accel:code="KEY_DELETE" xlink:href=".uno:Delete"/>
- <accel:item accel:code="KEY_F2" xlink:href=".uno:Text"/>
- <accel:item accel:code="KEY_I" accel:mod1="true" xlink:href=".uno:Italic"/>
- <accel:item accel:code="KEY_B" accel:mod1="true" xlink:href=".uno:Bold"/>
- <accel:item accel:code="KEY_U" accel:mod1="true" xlink:href=".uno:Underline"/>
- <accel:item accel:code="KEY_L" accel:mod1="true" xlink:href=".uno:LeftPara"/>
- <accel:item accel:code="KEY_R" accel:mod1="true" xlink:href=".uno:RightPara"/>
- <accel:item accel:code="KEY_E" accel:mod1="true" xlink:href=".uno:CenterPara"/>
- <accel:item accel:code="KEY_J" accel:mod1="true" xlink:href=".uno:JustifyPara"/>
- <accel:item accel:code="KEY_1" accel:mod1="true" xlink:href=".uno:SpacePara1"/>
- <accel:item accel:code="KEY_5" accel:mod1="true" xlink:href=".uno:SpacePara15"/>
- <accel:item accel:code="KEY_2" accel:mod1="true" xlink:href=".uno:SpacePara2"/>
- <accel:item accel:code="KEY_F4" xlink:href=".uno:TransformDialog"/>
- <accel:item accel:code="KEY_F8" xlink:href=".uno:ToggleObjectBezierMode"/>
- <accel:item accel:code="KEY_F7" xlink:href=".uno:SpellDialog"/>
- <accel:item accel:code="KEY_F7" accel:mod1="true" xlink:href=".uno:Thesaurus"/>
- <accel:item accel:code="KEY_ADD" accel:shift="true" accel:mod1="true" xlink:href=".uno:BringToFront"/>
- <accel:item accel:code="KEY_SUBTRACT" accel:shift="true" accel:mod1="true" xlink:href=".uno:SendToBack"/>
- <accel:item accel:code="KEY_P" accel:shift="true" accel:mod1="true" xlink:href=".uno:SuperScript"/>
- <accel:item accel:code="KEY_B" accel:shift="true" accel:mod1="true" xlink:href=".uno:SubScript"/>
- <accel:item accel:code="KEY_F5" accel:shift="true" accel:mod1="true" xlink:href=".uno:Navigator"/>
- <accel:item accel:code="KEY_F5" accel:shift="true" xlink:href=".uno:RestoreEditingView"/>
- <accel:item accel:code="KEY_F5" xlink:href=".uno:Presentation"/>
- <accel:item accel:code="KEY_F2" accel:mod1="true" xlink:href=".uno:Presentation"/>
- <accel:item accel:code="KEY_F9" xlink:href=".uno:Presentation"/>
- <accel:item accel:code="KEY_F8" accel:shift="true" accel:mod1="true" xlink:href=".uno:TextFitToSize"/>
- <accel:item accel:code="KEY_G" accel:shift="true" accel:mod1="true" xlink:href=".uno:FormatGroup"/>
- <accel:item accel:code="KEY_G" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:FormatUngroup"/>
- <accel:item accel:code="KEY_9" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:ShowItemBrowser"/>
- <accel:item accel:code="KEY_V" accel:shift="true" accel:mod1="true" xlink:href=".uno:PasteClipboard"/>
- <accel:item accel:code="KEY_F3" accel:shift="true" xlink:href=".uno:CopyObjects"/>
- <accel:item accel:code="KEY_P" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:PixelMode"/>
- <accel:item accel:code="KEY_K" accel:shift="true" accel:mod1="true" xlink:href=".uno:Combine"/>
- <accel:item accel:code="KEY_ADD" accel:mod1="true" xlink:href=".uno:Forward"/>
- <accel:item accel:code="KEY_SUBTRACT" accel:mod1="true" xlink:href=".uno:Backward"/>
- <accel:item accel:code="KEY_A" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:AnimationMode"/>
- <accel:item accel:code="KEY_K" accel:shift="true" accel:mod1="true" accel:mod2="true" xlink:href=".uno:Dismantle"/>
- <accel:item accel:code="KEY_F3" xlink:href=".uno:EnterGroup"/>
- <accel:item accel:code="KEY_F3" accel:mod1="true" xlink:href=".uno:LeaveGroup"/>
- <accel:item accel:code="KEY_M" accel:mod1="true" xlink:href=".uno:ResetAttributes"/>
- <accel:item accel:code="KEY_SPACE" accel:shift="true" accel:mod1="true" xlink:href=".uno:InsertNonBreakingSpace"/>
- <accel:item accel:code="KEY_DIVIDE" accel:mod1="true" xlink:href=".uno:InsertZWSP"/>
- <accel:item accel:code="KEY_UP" accel:shift="true" accel:mod2="true" xlink:href=".uno:OutlineUp"/>
- <accel:item accel:code="KEY_DOWN" accel:shift="true" accel:mod2="true" xlink:href=".uno:OutlineDown"/>
- <accel:item accel:code="KEY_LEFT" accel:shift="true" accel:mod2="true" xlink:href=".uno:OutlineLeft"/>
- <accel:item accel:code="KEY_RIGHT" accel:shift="true" accel:mod2="true" xlink:href=".uno:OutlineRight"/>
-</accel:acceleratorlist>
diff --git a/sd/uiconfig/simpress/accelerator/es/default.xml b/sd/uiconfig/simpress/accelerator/es/default.xml
deleted file mode 100644
index 07a116472c7d..000000000000
--- a/sd/uiconfig/simpress/accelerator/es/default.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
- <accel:item accel:code="KEY_A" accel:mod1="true" xlink:href=".uno:Open"/>
- <accel:item accel:code="KEY_G" accel:mod1="true" xlink:href=".uno:Save"/>
- <accel:item accel:code="KEY_K" accel:mod1="true" xlink:href=".uno:Italic"/>
- <accel:item accel:code="KEY_N" accel:mod1="true" xlink:href=".uno:Bold"/>
- <accel:item accel:code="KEY_S" accel:mod1="true" xlink:href=".uno:Underline"/>
- <accel:item accel:code="KEY_T" accel:mod1="true" xlink:href=".uno:CenterPara"/>
-</accel:acceleratorlist>
diff --git a/sd/uiconfig/simpress/accelerator/fr/default.xml b/sd/uiconfig/simpress/accelerator/fr/default.xml
deleted file mode 100644
index 28a99ac3ce09..000000000000
--- a/sd/uiconfig/simpress/accelerator/fr/default.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
- <accel:item accel:code="KEY_G" accel:mod1="true" xlink:href=".uno:Bold"/>
-</accel:acceleratorlist>
diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml
index ece53ad4c918..c1dacd33e0c0 100644
--- a/sd/uiconfig/simpress/menubar/menubar.xml
+++ b/sd/uiconfig/simpress/menubar/menubar.xml
@@ -54,7 +54,7 @@
<menu:menuitem menu:id=".uno:Cut"/>
<menu:menuitem menu:id=".uno:Copy"/>
<menu:menuitem menu:id=".uno:Paste"/>
- <menu:menuitem menu:id=".uno:PasteClipboard"/>
+ <menu:menuitem menu:id=".uno:PasteSpecial"/>
<menu:menuitem menu:id=".uno:SelectAll"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:SearchDialog"/>
@@ -119,7 +119,8 @@
<menu:menuitem menu:id=".uno:HelplinesFront"/>
</menu:menupopup>
</menu:menu>
- <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ShowAnnotations"/>
+ <menu:menuseparator/>
<menu:menuitem menu:id=".uno:Navigator"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:HeaderAndFooter"/>
@@ -147,7 +148,8 @@
<menu:menuitem menu:id=".uno:InsertFileField"/>
</menu:menupopup>
</menu:menu>
- <menu:menuitem menu:id=".uno:InsertSymbol"/>
+ <menu:menuitem menu:id=".uno:InsertAnnotation"/>
+ <menu:menuitem menu:id=".uno:InsertSymbol"/>
<menu:menu menu:id=".uno:FormattingMarkMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertNonBreakingSpace"/>
@@ -282,7 +284,7 @@
<menu:menuitem menu:id=".uno:CustomShowDialog"/>
</menu:menupopup>
</menu:menu>
- <menu:menu menu:id=".uno:WindowList">
+ <menu:menu menu:id=".uno:WindowList">
<menu:menupopup>
<menu:menuitem menu:id=".uno:NewWindow"/>
<menu:menuitem menu:id=".uno:CloseWin"/>
diff --git a/sd/uiconfig/simpress/toolbar/commentsbar.xml b/sd/uiconfig/simpress/toolbar/commentsbar.xml
new file mode 100644
index 000000000000..07c42d262758
--- /dev/null
+++ b/sd/uiconfig/simpress/toolbar/commentsbar.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!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:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:InsertAnnotation" toolbar:helpid="helpid:26276"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:PreviousAnnotation" toolbar:helpid="helpid:11095"/>
+ <toolbar:toolbaritem xlink:href=".uno:NextAnnotation" toolbar:helpid="helpid:11094"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:DeleteAnnotation" toolbar:helpid="helpid:11093"/>
+ <toolbar:toolbaritem xlink:href=".uno:DeleteAllAnnotation" toolbar:helpid="helpid:11096"/>
+</toolbar:toolbar> \ No newline at end of file
diff --git a/sd/util/hidother.src b/sd/util/hidother.src
index b6f427e9488a..898079e5c762 100644
--- a/sd/util/hidother.src
+++ b/sd/util/hidother.src
@@ -143,6 +143,7 @@ hidspecial HID_SD_ALL_MASTERS { HelpId = HID_SD_ALL_MASTERS; };
hidspecial HID_SD_SLIDE_LAYOUTS { HelpId = HID_SD_SLIDE_LAYOUTS; };
hidspecial HID_SD_CUSTOM_ANIMATIONS { HelpId = HID_SD_CUSTOM_ANIMATIONS; };
hidspecial HID_SD_SLIDE_TRANSITIONS { HelpId = HID_SD_SLIDE_TRANSITIONS; };
+hidspecial HID_SD_ANNOTATIONS { HelpId = HID_SD_ANNOTATIONS; };
hidspecial HID_SD_CUSTOMANIMATIONPANE_PB_ADD_EFFECT { HelpId = HID_SD_CUSTOMANIMATIONPANE_PB_ADD_EFFECT; };
hidspecial HID_SD_CUSTOMANIMATIONPANE_PB_CHANGE_EFFECT { HelpId = HID_SD_CUSTOMANIMATIONPANE_PB_CHANGE_EFFECT; };
@@ -204,3 +205,5 @@ hidspecial HID_SD_RULER_HORIZONTAL { HelpId = HID_S
hidspecial HID_SD_RULER_VERTICAL { HelpId = HID_SD_RULER_VERTICAL; };
hidspecial HID_SD_TABLE_DESIGN { HelpId = HID_SD_TABLE_DESIGN; };
+hidspecial HID_SD_ANNOTATIONS { HelpId = HID_SD_ANNOTATIONS; };
+
diff --git a/sd/util/makefile.mk b/sd/util/makefile.mk
index 55c59f22aa13..9413519faf60 100644
--- a/sd/util/makefile.mk
+++ b/sd/util/makefile.mk
@@ -56,6 +56,7 @@ RESLIB1SRSFILES=\
$(SRS)$/slideshow.srs \
$(SRS)$/uitable.srs \
$(SRS)$/view.srs \
+ $(SRS)$/uiannotations.srs \
$(SOLARCOMMONRESDIR)$/sfx.srs
# --- StarDraw DLL
@@ -66,6 +67,7 @@ SHL1IMPLIB= sdi
# dynamic libraries
SHL1STDLIBS+= \
+ $(SVXCORELIB) \
$(SVXLIB) \
$(SFXLIB) \
$(BASICLIB) \
@@ -119,10 +121,13 @@ LIB3FILES= \
$(SLB)$/dlg.lib \
$(SLB)$/core.lib \
$(SLB)$/undo.lib \
+ $(SLB)$/annotations.lib \
+ $(SLB)$/text.lib \
$(SLB)$/helper.lib \
$(SLB)$/xml.lib \
$(SLB)$/cgm.lib \
$(SLB)$/uitable.lib \
+ $(SLB)$/uiannotations.lib\
$(SLB)$/grf.lib
LIB5TARGET=$(SLB)$/sdraw3_2.lib
@@ -130,7 +135,6 @@ LIB5FILES= \
$(SLB)$/html.lib \
$(SLB)$/filter.lib \
$(SLB)$/unoidl.lib \
- $(SLB)$/ppt.lib \
$(SLB)$/animui.lib \
$(SLB)$/accessibility.lib \
$(SLB)$/toolpanel.lib \
@@ -162,7 +166,7 @@ DEF2NAME= $(SHL2TARGET)
SHL2STDLIBS= \
$(SFX2LIB) \
- $(SVXLIB) \
+ $(SVXCORELIB) \
$(SVTOOLLIB) \
$(SVLLIB) \
$(VCLLIB) \
@@ -194,6 +198,7 @@ LIB4FILES= \
SHL4STDLIBS= \
$(ISDLIB) \
+ $(SVXCORELIB) \
$(SVXLIB) \
$(SFXLIB) \
$(BASEGFXLIB) \
@@ -228,10 +233,40 @@ SHL4OBJS += $(SLO)$/pchname.obj \
# $(ISDLIB) is build in SHL1TARGET
.IF "$(GUI)" == "UNX"
SHL4DEPN=$(SHL1TARGETN)
+SHL5DEPN=$(SHL1TARGETN)
.ELSE
SHL4DEPN=$(SHL1IMPLIBN)
+SHL5DEPN=$(SHL1IMPLIBN)
.ENDIF
+# ppt import/export library
+SHL5TARGET = sdfilt$(DLLPOSTFIX)
+SHL5IMPLIB = sdfilti
+SHL5VERSIONMAP= sdfilt.map
+SHL5DEF = $(MISC)$/$(SHL5TARGET).def
+SHL5LIBS = $(SLB)$/ppt.lib $(SLB)$/eppt.lib
+
+DEF5NAME=$(SHL5TARGET)
+
+SHL5STDLIBS = $(ISDLIB) \
+ $(SVXCORELIB) \
+ $(SVXMSFILTERLIB) \
+ $(SFX2LIB) \
+ $(SVTOOLLIB) \
+ $(SOTLIB) \
+ $(GOODIESLIB) \
+ $(VCLLIB) \
+ $(SVLLIB) \
+ $(SOTLIB) \
+ $(UNOTOOLSLIB) \
+ $(TOOLSLIB) \
+ $(UCBHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(SALLIB) \
+ $(COMPHELPERLIB) \
+ $(I18NISOLANGLIB)
+
# --- Targets -------------------------------------------------------------
.INCLUDE : target.mk
diff --git a/sd/source/filter/eppt/exports.map b/sd/util/sdfilt.map
index 4a57b5069353..ac6b782f3145 100644
--- a/sd/source/filter/eppt/exports.map
+++ b/sd/util/sdfilt.map
@@ -1,6 +1,7 @@
PPTEXPORTER_1_0 {
global:
ExportPPT;
+ ImportPPT;
local:
*;
diff --git a/slideshow/source/engine/OGLTrans/makefile.mk b/slideshow/source/engine/OGLTrans/makefile.mk
index 2062b8c7d4c5..6353b2da58fb 100644
--- a/slideshow/source/engine/OGLTrans/makefile.mk
+++ b/slideshow/source/engine/OGLTrans/makefile.mk
@@ -61,7 +61,6 @@ SHL1TARGET=$(TARGET).uno
.IF "$(GUI)"=="UNX"
.IF "$(GUIBASE)"=="aqua"
SHL1STDLIBS= $(SALLIB) $(VCLLIB) $(CPPULIB) $(CPPUHELPERLIB) $(COMPHELPERLIB) $(CANVASTOOLSLIB)
- OBJCXXFLAGS=-x objective-c++ -fobjc-exceptions
CFLAGSCXX+=$(OBJCXXFLAGS)
.ELSE
SHL1STDLIBS= $(SALLIB) $(VCLLIB) $(CPPULIB) $(CPPUHELPERLIB) $(COMPHELPERLIB) $(CANVASTOOLSLIB) -lGL -lGLU -lX11
diff --git a/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx b/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx
index cced9fa3f83f..683fe7bd9707 100644
--- a/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx
+++ b/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx
@@ -34,11 +34,11 @@
#include <canvas/debug.hxx>
#include <canvas/verbosetrace.hxx>
+#include "delayevent.hxx"
#include "eventqueue.hxx"
#include "usereventqueue.hxx"
#include "sequentialtimecontainer.hxx"
#include "tools.hxx"
-#include "delayevent.hxx"
#include <boost/bind.hpp>
#include <algorithm>
@@ -63,7 +63,7 @@ void SequentialTimeContainer::activate_st()
{
// deactivate ASAP:
scheduleDeactivationEvent(
- makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ) ) );
+ makeEvent( boost::bind< void >( boost::mem_fn( &AnimationNode::deactivate ), getSelf() ) ) );
}
else // use default
scheduleDeactivationEvent();
@@ -89,7 +89,7 @@ void SequentialTimeContainer::skipEffect(
// empty all events ignoring timings => until next effect
getContext().mrEventQueue.forceEmpty();
getContext().mrEventQueue.addEventForNextRound(
- makeEvent( boost::bind(&AnimationNode::deactivate, pChildNode) ) );
+ makeEvent( boost::bind<void>( boost::mem_fn( &AnimationNode::deactivate ), pChildNode ) ) );
}
else
OSL_ENSURE( false, "unknown notifier!" );
diff --git a/slideshow/source/engine/makefile.mk b/slideshow/source/engine/makefile.mk
index ba00e028b9ff..b064ad7b94cb 100644
--- a/slideshow/source/engine/makefile.mk
+++ b/slideshow/source/engine/makefile.mk
@@ -43,6 +43,8 @@ ENABLE_EXCEPTIONS=TRUE
# --- Common ----------------------------------------------------------
+ENVCFLAGS += -DBOOST_SPIRIT_USE_OLD_NAMESPACE
+
.IF "$(OS)"=="SOLARIS"
.IF "$(CCNUMVER)"=="00050009"
# SunStudio12: anachronism warning in boost code (smilfunctionparser.cxx)
diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx
index ac0f256324d7..d8dc7931add1 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -1668,7 +1668,7 @@ void SlideShowImpl::notifySlideAnimationsEnded()
// schedule a slide end event, with automatic mode's
// delay
aNotificationEvents = makeInterruptableDelay(
- boost::bind( &SlideShowImpl::notifySlideEnded, this ),
+ boost::bind<void>( boost::mem_fn(&SlideShowImpl::notifySlideEnded), this ),
maEventMultiplexer.getAutomaticTimeout() );
}
else
@@ -1693,7 +1693,7 @@ void SlideShowImpl::notifySlideAnimationsEnded()
bHasAutomaticNextSlide )
{
aNotificationEvents = makeInterruptableDelay(
- boost::bind( &SlideShowImpl::notifySlideEnded, this ),
+ boost::bind<void>( boost::mem_fn(&SlideShowImpl::notifySlideEnded), this ),
nAutomaticNextSlideTimeout);
// TODO(F2): Provide a mechanism to let the user override
@@ -1709,8 +1709,8 @@ void SlideShowImpl::notifySlideAnimationsEnded()
// generate interruptable event here, there's no
// timeout involved.
aNotificationEvents.mpImmediateEvent =
- makeEvent( boost::bind(
- &SlideShowImpl::notifySlideEnded, this ) );
+ makeEvent( boost::bind<void>(
+ boost::mem_fn(&SlideShowImpl::notifySlideEnded), this ) );
}
}
diff --git a/slideshow/source/engine/smilfunctionparser.cxx b/slideshow/source/engine/smilfunctionparser.cxx
index 04e0368ff6d7..3ae24d87b9a8 100644
--- a/slideshow/source/engine/smilfunctionparser.cxx
+++ b/slideshow/source/engine/smilfunctionparser.cxx
@@ -55,7 +55,7 @@
#include <typeinfo>
#define BOOST_SPIRIT_DEBUG
#endif
-#include <boost/spirit/core.hpp>
+#include <boost/spirit/include/classic_core.hpp>
#if OSL_DEBUG_LEVEL > 0
#include <iostream>
diff --git a/slideshow/source/inc/delayevent.hxx b/slideshow/source/inc/delayevent.hxx
index 29ef713f6550..10960e395feb 100644
--- a/slideshow/source/inc/delayevent.hxx
+++ b/slideshow/source/inc/delayevent.hxx
@@ -30,12 +30,10 @@
#ifndef INCLUDED_SLIDESHOW_DELAYEVENT_HXX
#define INCLUDED_SLIDESHOW_DELAYEVENT_HXX
+#include <boost/function.hpp>
+
#include "event.hxx"
#include <boost/noncopyable.hpp>
-#include <boost/function.hpp>
-#if defined(VERBOSE) && defined(DBG_UTIL)
-#include "boost/current_function.hpp"
-#endif
namespace slideshow {
namespace internal {