diff options
author | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2010-06-15 15:00:18 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2010-06-15 15:00:18 +0200 |
commit | 9a87cfcb9e4ee1454b07998ff1b1740360696dd6 (patch) | |
tree | 44c9ccf8aacb3d11b0a207a23bce063014b3ec65 /sw/inc | |
parent | 0c5ed170e71a13133cf8730fa3083d52bea07287 (diff) | |
parent | 7ff5c0b957249bcda3e0eb89d59cd95450151aa0 (diff) |
cbosdo03: merged with m82
Diffstat (limited to 'sw/inc')
39 files changed, 1007 insertions, 938 deletions
diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx new file mode 100644 index 0000000000..93b35694c8 --- /dev/null +++ b/sw/inc/AnnotationWin.hxx @@ -0,0 +1,83 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * + * $Revision: $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _ANNOTATIONWIN_HXX +#define _ANNOTATIONWIN_HXX + +#include <SidebarWin.hxx> + +class PopupMenu; +class OutlinerParaObject; + +namespace sw { namespace annotation { + +class SwAnnotationWin : public sw::sidebarwindows::SwSidebarWin +{ + public: + SwAnnotationWin( SwEditWin& rEditWin, + WinBits nBits, + SwPostItMgr& aMgr, + SwPostItBits aBits, + SwSidebarItem& rSidebarItem, + SwFmtFld* aField ); + virtual ~SwAnnotationWin(); + + virtual void UpdateData(); + virtual void SetPostItText(); + virtual void Delete(); + virtual void GotoPos(); + + virtual String GetAuthor(); + virtual Date GetDate(); + virtual Time GetTime(); + + virtual sal_uInt32 MoveCaret(); + + virtual bool CalcFollow(); + void InitAnswer(OutlinerParaObject* pText); + + virtual bool IsProtected(); + + protected: + virtual MenuButton* CreateMenuButton(); + + private: + virtual SvxLanguageItem GetLanguage(void); + sal_uInt32 CountFollowing(); + + SwFmtFld* mpFmtFld; + SwPostItField* mpFld; + PopupMenu* mpButtonPopup; + +}; + +} } // end of namespace sw::annotation +#endif diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index 85b73c05cf..c3d485142a 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,13 +39,14 @@ #include <unotools/options.hxx> #include <com/sun/star/util/SearchOptions.hpp> #include <com/sun/star/uno/Any.hxx> +#include <SidebarWindowsTypes.hxx> #include <svl/lstner.hxx> class SwWrtShell; class SwDoc; class SwView; class SwPostItField; -class SwFmtFld; +class SwFmtFld; class SwField; class SfxBroadcaster; class SfxHint; @@ -53,9 +54,16 @@ class SwEditWin; class Color; class SvxSearchItem; class SvxLanguageItem; -class SwPostIt; -class SwMarginWin; -class SwMarginItem; +namespace sw { namespace annotation { + class SwAnnotationWin; +}} +namespace sw { namespace sidebarwindows { + class SwSidebarWin; + class SwFrmSidebarWinContainer; +}} +class SwSidebarItem; +class SwFrm; +class Window; #define SORT_POS 1 #define SORT_AUTHOR 2 @@ -64,23 +72,20 @@ class SwMarginItem; #define COL_NOTES_SIDEPANE_ARROW_ENABLED RGB_COLORDATA(0,0,0) #define COL_NOTES_SIDEPANE_ARROW_DISABLED RGB_COLORDATA(172,168,153) -typedef std::list<SwMarginItem*> SwMarginItem_list; -typedef std::list<SwMarginItem*>::iterator SwMarginItem_iterator; +typedef std::list<SwSidebarItem*> SwSidebarItem_list; +typedef std::list<SwSidebarItem*>::iterator SwSidebarItem_iterator; -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; -using ::rtl::OUString; struct SwPostItPageItem { bool bScrollbar; - bool bMarginSide; + sw::sidebarwindows::SidebarPosition eSidebarPosition; long lOffset; SwRect mPageRect; - SwMarginItem_list* mList; + SwSidebarItem_list* mList; SwPostItPageItem(): bScrollbar(false),lOffset(0) { - mList = new SwMarginItem_list; + mList = new SwSidebarItem_list; } ~SwPostItPageItem() { @@ -102,26 +107,28 @@ struct FieldShadowState class SwNoteProps: public utl::ConfigItem { - private: - bool bIsShowAnkor; + private: + bool bIsShowAnchor; public: - SwNoteProps() : ConfigItem(::rtl::OUString::createFromAscii("Office.Writer/Notes")), bIsShowAnkor(false) + SwNoteProps() + : ConfigItem(::rtl::OUString::createFromAscii("Office.Writer/Notes")) + , bIsShowAnchor(false) { - const Sequence<OUString>& rNames = GetPropertyNames(); - Sequence<Any> aValues = GetProperties(rNames); - const Any* pValues = aValues.getConstArray(); + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rNames = GetPropertyNames(); + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aValues = GetProperties(rNames); + const ::com::sun::star::uno::Any* pValues = aValues.getConstArray(); DBG_ASSERT(aValues.getLength() == rNames.getLength(), "GetProperties failed"); if (aValues.getLength()) - pValues[0]>>=bIsShowAnkor; + pValues[0]>>=bIsShowAnchor; } - bool IsShowAnkor() + bool IsShowAnchor() { - return bIsShowAnkor; + return bIsShowAnchor; } - Sequence<OUString>& GetPropertyNames() + ::com::sun::star::uno::Sequence< ::rtl::OUString >& GetPropertyNames() { - static Sequence<OUString> aNames; + static ::com::sun::star::uno::Sequence< ::rtl::OUString > aNames; if(!aNames.getLength()) { static const char* aPropNames[] = @@ -130,9 +137,9 @@ class SwNoteProps: public utl::ConfigItem }; const int nCount = sizeof(aPropNames)/sizeof(const char*); aNames.realloc(nCount); - OUString* pNames = aNames.getArray(); + ::rtl::OUString* pNames = aNames.getArray(); for(int i = 0; i < nCount; i++) - pNames[i] = OUString::createFromAscii(aPropNames[i]); + pNames[i] = ::rtl::OUString::createFromAscii(aPropNames[i]); } return aNames; } @@ -147,11 +154,11 @@ class SwPostItMgr: public SfxListener SwView* mpView; SwWrtShell* mpWrtShell; SwEditWin* mpEditWin; - std::list< SwMarginItem*> mvPostItFlds; + std::list< SwSidebarItem*> mvPostItFlds; std::vector<SwPostItPageItem*> mPages; ULONG mnEventId; bool mbWaitingForCalcRects; - SwMarginWin* mpActivePostIt; + sw::sidebarwindows::SwSidebarWin* mpActivePostIt; bool mbLayout; long mbLayoutHeight; long mbLayouting; @@ -159,52 +166,62 @@ class SwPostItMgr: public SfxListener bool mbDeleteNote; FieldShadowState mShadowState; OutlinerParaObject* mpAnswer; - bool mpIsShowAnkor; + bool mbIsShowAnchor; + + // data structure to collect the <SwSidebarWin> instances for certain <SwFrm> instances. + sw::sidebarwindows::SwFrmSidebarWinContainer* mpFrmSidebarWinContainer; - typedef std::list<SwMarginWin*>::iterator SwMarginWin_iterator; + typedef std::list<sw::sidebarwindows::SwSidebarWin*>::iterator SwSidebarWin_iterator; void AddPostIts(bool bCheckExistance = true,bool bFocus = true); //void AddRedlineComments(bool bCheckExistance, bool bFocus); - void RemoveMarginWin(); + void RemoveSidebarWin(); void PreparePageContainer(); void Scroll(const long lScroll,const unsigned long aPage ); - void AutoScroll(const SwMarginWin* pPostIt,const unsigned long aPage ); + void AutoScroll(const sw::sidebarwindows::SwSidebarWin* pPostIt,const unsigned long aPage ); bool ScrollbarHit(const unsigned long aPage,const Point &aPoint); - bool LayoutByPage(std::list<SwMarginWin*> &aVisiblePostItList,const Rectangle aBorder,long lNeededHeight); + bool LayoutByPage( std::list<sw::sidebarwindows::SwSidebarWin*> &aVisiblePostItList, + const Rectangle aBorder, + long lNeededHeight); void CheckForRemovedPostIts(); bool ArrowEnabled(USHORT aDirection,unsigned long aPage) const; bool BorderOverPageBorder(unsigned long aPage) const; bool HasScrollbars() const; void Focus(SfxBroadcaster& rBC); - + sal_Int32 GetInitialAnchorDistance() const; sal_Int32 GetScrollSize() const; sal_Int32 GetSpaceBetween() const; void SetReadOnlyState(); DECL_LINK( CalcHdl, void*); - protected: + + sw::sidebarwindows::SwSidebarWin* GetSidebarWin(const SfxBroadcaster* pBroadcaster) const; + + void InsertItem( SfxBroadcaster* pItem, bool bCheckExistance, bool bFocus); + void RemoveItem( SfxBroadcaster* pBroadcast ); + + void Sort(const short aType); public: SwPostItMgr(SwView* aDoc); ~SwPostItMgr(); - typedef std::list< SwMarginItem* >::const_iterator const_iterator; + typedef std::list< SwSidebarItem* >::const_iterator const_iterator; const_iterator begin() const { return mvPostItFlds.begin(); } const_iterator end() const { return mvPostItFlds.end(); } - void InsertItem( SfxBroadcaster* pItem, bool bCheckExistance, bool bFocus); - void RemoveItem( SfxBroadcaster* pBroadcast ); void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); void LayoutPostIts(); bool CalcRects(); - void MakeVisible(const SwMarginWin* pPostIt,long aPage = -1); + void MakeVisible( const sw::sidebarwindows::SwSidebarWin* pPostIt, + long aPage = -1); bool ShowScrollbar(const unsigned long aPage) const; bool HasNotes() const ; bool ShowNotes() const; - bool IsShowAnkor() { return mpIsShowAnkor;} + bool IsShowAnchor() { return mbIsShowAnchor;} unsigned long GetSidebarWidth(bool bPx = false) const; unsigned long GetSidebarBorderWidth(bool bPx = false) const; unsigned long GetNoteWidth(); @@ -212,8 +229,6 @@ class SwPostItMgr: public SfxListener void PrepareView(bool bIgnoreCount = false); void CorrectPositions(); - - void Sort(const short aType); void SetLayout() { mbLayout = true; }; void Delete(String aAuthor); @@ -232,28 +247,35 @@ class SwPostItMgr: public SfxListener bool IsHit(const Point &aPointPixel); Color GetArrowColor(USHORT aDirection,unsigned long aPage) const; - SwMarginWin* GetNextPostIt(USHORT aDirection, SwMarginWin* aPostIt); + sw::annotation::SwAnnotationWin* GetAnnotationWin(const SwPostItField* pFld) const; + + sw::sidebarwindows::SwSidebarWin* GetNextPostIt( USHORT aDirection, + sw::sidebarwindows::SwSidebarWin* aPostIt); long GetNextBorder(); - SwMarginWin* GetActivePostIt() { return mpActivePostIt; } - void SetActivePostIt( SwMarginWin* p); + + sw::sidebarwindows::SwSidebarWin* GetActiveSidebarWin() { return mpActivePostIt; } + void SetActiveSidebarWin( sw::sidebarwindows::SwSidebarWin* p); + bool HasActiveSidebarWin() const; + bool HasActiveAnnotationWin() const; + void GrabFocusOnActiveSidebarWin(); + void UpdateDataOnActiveSidebarWin(); + void DeleteActiveSidebarWin(); + void HideActiveSidebarWin(); + void ToggleInsModeOnActiveSidebarWin(); + sal_Int32 GetMinimumSizeWithMeta() const; sal_Int32 GetSidebarScrollerHeight() const; - SwMarginWin* GetPostIt(const SfxBroadcaster* pBroadcaster) const; - SwMarginWin* GetPostIt(SfxBroadcaster* pBroadcaster) const; - SwPostIt* GetPostIt(const SwPostItField* pFld) const; - SwPostIt* GetPostIt(SwPostItField* pFld) const; - void SetShadowState(const SwPostItField* pFld,bool bCursor = true); void SetSpellChecking(); Color GetColorDark(sal_uInt16 aAuthorIndex); Color GetColorLight(sal_uInt16 aAuthorIndex); - Color GetColorAnkor(sal_uInt16 aAuthorIndex); + Color GetColorAnchor(sal_uInt16 aAuthorIndex); bool ShowPreview(const SwField* pFld,SwFmtFld*& pFmtFld) const; - + void RegisterAnswer(OutlinerParaObject* pAnswer) { mpAnswer = pAnswer;} OutlinerParaObject* IsAnswer() {return mpAnswer;} void CheckMetaText(); @@ -263,7 +285,18 @@ class SwPostItMgr: public SfxListener sal_uInt16 SearchReplace(const SwFmtFld &pFld, const ::com::sun::star::util::SearchOptions& rSearchOptions,bool bSrchForward); sal_uInt16 FinishSearchReplace(const ::com::sun::star::util::SearchOptions& rSearchOptions,bool bSrchForward); - void AssureStdModeAtShell(); + void AssureStdModeAtShell(); + + void ConnectSidebarWinToFrm( const SwFrm& rFrm, + const SwFmtFld& rFmtFld, + sw::sidebarwindows::SwSidebarWin& rSidebarWin ); + void DisconnectSidebarWinFromFrm( const SwFrm& rFrm, + sw::sidebarwindows::SwSidebarWin& rSidebarWin ); + bool HasFrmConnectedSidebarWins( const SwFrm& rFrm ); + Window* GetSidebarWinForFrmByIndex( const SwFrm& rFrm, + const sal_Int32 nIndex ); + void GetAllSidebarWinForFrm( const SwFrm& rFrm, + std::vector< Window* >* pChildren ); }; #endif diff --git a/sw/inc/SidebarWin.hxx b/sw/inc/SidebarWin.hxx new file mode 100644 index 0000000000..41decf8024 --- /dev/null +++ b/sw/inc/SidebarWin.hxx @@ -0,0 +1,272 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _SIDEBARWIN_HXX +#define _SIDEBARWIN_HXX + +#include <postithelper.hxx> +#include <SidebarWindowsTypes.hxx> + +#include <vcl/window.hxx> +#include <swrect.hxx> + +#include <tools/datetime.hxx> +#include <tools/date.hxx> + +#include <vcl/lineinfo.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <editeng/editstat.hxx> + +class SwPostItMgr; +class SwPostItField; +class OutlinerView; +class Outliner; +class ScrollBar; +class SwEditWin; +class SwView; +class Edit; +class MenuButton; +//class SwRedline; +class SwFrm; + + +namespace sw { namespace sidebarwindows { + +class SidebarTxtControl; +class AnchorOverlayObject; +class ShadowOverlayObject; + +typedef sal_Int64 SwPostItBits; + +#define PB_Preview ((SwPostItBits)0x00000001) + + +class SwSidebarWin : public Window +{ + public: + SwSidebarWin( SwEditWin& rEditWin, + WinBits nBits, + SwPostItMgr& aMgr, + SwPostItBits aBits, + SwSidebarItem& rSidebarItem ); + virtual ~SwSidebarWin(); + + void SetSize( const Size& rNewSize ); + void SetPosSizePixelRect( long nX, + long nY, + long nWidth, + long nHeight, + const SwRect &aRect, + const long PageBorder); + void SetPosAndSize(); + void TranslateTopPosition(const long aAmount); + virtual void CheckMetaText(); + + inline Point GetAnchorPos() { return mAnchorRect.Pos(); } + SwEditWin* EditWin(); + + inline OutlinerView* GetOutlinerView() { return mpOutlinerView;} + bool HasScrollbar() const; + bool IsScrollbarVisible() const; + inline ScrollBar* Scrollbar() { return mpVScrollbar; } + inline ::sw::sidebarwindows::AnchorOverlayObject* Anchor() { return mpAnchor;} + inline ::sw::sidebarwindows::ShadowOverlayObject* Shadow() { return mpShadow;} + + long GetPostItTextHeight(); + + void SwitchToPostIt(USHORT aDirection); + virtual void SwitchToFieldPos(); + + virtual sal_uInt32 MoveCaret() = 0; + + virtual void UpdateData() = 0; + virtual void SetPostItText() = 0; + virtual void Delete(); + virtual void GotoPos() = 0; + + virtual String GetAuthor() = 0; + virtual Date GetDate() = 0; + virtual Time GetTime() = 0; + + void ExecuteCommand(USHORT nSlot); + void InitControls(); + void HidePostIt(); + void DoResize(); + void ResizeIfNeccessary(long aOldHeight, long aNewHeight); + void SetScrollbar(); + + void SetVirtualPosSize( const Point& aPoint, const Size& aSize); + const Point VirtualPos() { return mPosSize.TopLeft(); } + const Size VirtualSize() { return mPosSize.GetSize(); } + + void ShowAnchorOnly(const Point &aPoint); + void ShowNote(); + void HideNote(); + + void ResetAttributes(); + + void SetSidebarPosition(sw::sidebarwindows::SidebarPosition eSidebarPosition); + void SetReadonly(BOOL bSet); + BOOL IsReadOnly() { return mbReadonly;} + bool IsPreview() { return nFlags & PB_Preview;} + + void SetColor(Color aColorDark,Color aColorLight, Color aColorAnchor); + const Color& ColorAnchor() { return mColorAnchor; } + const Color& ColorDark() { return mColorDark; } + const Color& ColorLight() { return mColorLight; } + void Rescale(); + + void SetViewState(::sw::sidebarwindows::ViewState bViewState); + + bool IsFollow() { return mbIsFollow; } + void SetFollow( bool bIsFollow) { mbIsFollow = bIsFollow; }; + virtual bool CalcFollow() = 0; + + + sal_Int32 GetMetaHeight(); + sal_Int32 GetMinimumSizeWithMeta(); + sal_Int32 GetMinimumSizeWithoutMeta(); + sal_Int32 GetMetaButtonAreaWidth(); + sal_Int32 GetScrollbarWidth(); + + void SetSpellChecking(); + + void ToggleInsMode(); + + virtual void ActivatePostIt(); + virtual void DeactivatePostIt(); + + void SetChangeTracking( const SwPostItHelper::SwLayoutStatus aStatus, + const Color& aColor); + SwPostItHelper::SwLayoutStatus GetLayoutStatus() { return mLayoutStatus; } + Color GetChangeColor() { return mChangeColor; } + + virtual bool IsProtected() {return mbReadonly;}; + + DECL_LINK( WindowEventListener, VclSimpleEvent* ); + inline const bool IsMouseOverSidebarWin() const { return mbMouseOver; } + + void SetLanguage(const SvxLanguageItem aNewItem); + + void ChangeSidebarItem( SwSidebarItem& rSidebarItem ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); + + protected: + virtual void DataChanged( const DataChangedEvent& aEvent); + virtual void LoseFocus(); + virtual void Paint( const Rectangle& rRect); + virtual void GetFocus(); + virtual MenuButton* CreateMenuButton() = 0; + + void SetSizePixel( const Size& rNewSize ); + SfxItemSet DefaultItem(); + + DECL_LINK(ModifyHdl, void*); + DECL_LINK(ScrollHdl, ScrollBar*); + DECL_LINK(DeleteHdl, void*); + + inline SwView& DocView() { return mrView;} + inline SwPostItMgr& Mgr() { return mrMgr; } + inline Outliner* Engine() { return mpOutliner;} + + private: + SwSidebarWin* GetTopReplyNote(); + + virtual SvxLanguageItem GetLanguage(void); + + SwPostItMgr& mrMgr; + SwView& mrView; + const SwPostItBits nFlags; + + ULONG mnEventId; + + OutlinerView* mpOutlinerView; + Outliner* mpOutliner; + + sw::sidebarwindows::SidebarTxtControl* mpSidebarTxtControl; + ScrollBar* mpVScrollbar; + Edit* mpMetadataAuthor; + Edit* mpMetadataDate; + MenuButton* mpMenuButton; + + sw::sidebarwindows::AnchorOverlayObject* mpAnchor; + sw::sidebarwindows::ShadowOverlayObject* mpShadow; + + Color mColorAnchor; + Color mColorDark; + Color mColorLight; + Color mChangeColor; + + sw::sidebarwindows::SidebarPosition meSidebarPosition; + + Rectangle mPosSize; + SwRect mAnchorRect; + long mPageBorder; + + bool mbMouseOver; + SwPostItHelper::SwLayoutStatus mLayoutStatus; + + bool mbReadonly; + bool mbIsFollow; + + SwSidebarItem& mrSidebarItem; + const SwFrm* mpAnchorFrm; +}; + +} } // eof namespace sw::sidebarwindows + + +// implementation for change tracking comments, fully functional, but not yet used +/* +class SwRedComment : public SwSidebarWin +{ + private: + SwRedline* pRedline; + + protected: + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + public: + SwRedComment( Window* pParent, WinBits nBits,SwPostItMgr* aMgr,SwPostItBits aBits,SwRedline* pRed); + virtual ~SwRedComment() {}; + + virtual void UpdateData(); + virtual void SetPostItText(); + virtual void Delete(); + virtual void GotoPos(); + virtual void SetPopup(); + virtual void ActivatePostIt(); + virtual void DeactivatePostIt(); + + virtual String GetAuthor(); + virtual Date GetDate(); + virtual Time GetTime(); + + virtual bool IsProtected(); +}; +*/ + +#endif diff --git a/sw/inc/SidebarWindowsTypes.hxx b/sw/inc/SidebarWindowsTypes.hxx new file mode 100644 index 0000000000..8b86f87edf --- /dev/null +++ b/sw/inc/SidebarWindowsTypes.hxx @@ -0,0 +1,53 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * + * $Revision: $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SIDEBARWINDOWSTYPES_HXX +#define _SIDEBARWINDOWSTYPES_HXX + +namespace sw { namespace sidebarwindows { + +enum ViewState +{ + VS_NORMAL, + VS_VIEW, + VS_EDIT +}; + +enum SidebarPosition +{ + SIDEBAR_LEFT, // sidebar on left side + SIDEBAR_RIGHT, // sidebar on right side + SIDEBAR_NONE // sidebar on neither side +}; + +} } // end of namespace sw::sidebarwindows + +#endif diff --git a/sw/inc/access.hrc b/sw/inc/access.hrc index f1215375fb..b6c6bb3008 100644 --- a/sw/inc/access.hrc +++ b/sw/inc/access.hrc @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -30,28 +30,29 @@ #include "rcid.hrc" -// --> OD 2004-09-27 #117970# - remove STR_ACCESS_PARAGRAPH_NAME, STR_ACCESS_HEADING_NAME -// STR_ACCESS_PARAGRAPH_DESC and STR_ACCESS_HEADING_DESC -#define STR_ACCESS_DOC_NAME (RC_ACCESS_BEGIN + 1) -#define STR_ACCESS_DOC_DESC (RC_ACCESS_BEGIN + 2) -#define STR_ACCESS_HEADING_WITH_NUM_DESC (RC_ACCESS_BEGIN + 3) -#define STR_ACCESS_HEADER_NAME (RC_ACCESS_BEGIN + 4) -#define STR_ACCESS_HEADER_DESC (RC_ACCESS_BEGIN + 5) -#define STR_ACCESS_FOOTER_NAME (RC_ACCESS_BEGIN + 6) -#define STR_ACCESS_FOOTER_DESC (RC_ACCESS_BEGIN + 7) +#define STR_ACCESS_DOC_NAME (RC_ACCESS_BEGIN + 1) +#define STR_ACCESS_DOC_DESC (RC_ACCESS_BEGIN + 2) +#define STR_ACCESS_HEADING_WITH_NUM_DESC (RC_ACCESS_BEGIN + 3) +#define STR_ACCESS_HEADER_NAME (RC_ACCESS_BEGIN + 4) +#define STR_ACCESS_HEADER_DESC (RC_ACCESS_BEGIN + 5) +#define STR_ACCESS_FOOTER_NAME (RC_ACCESS_BEGIN + 6) +#define STR_ACCESS_FOOTER_DESC (RC_ACCESS_BEGIN + 7) #define STR_ACCESS_FOOTNOTE_NAME (RC_ACCESS_BEGIN + 8) #define STR_ACCESS_FOOTNOTE_DESC (RC_ACCESS_BEGIN + 9) -#define STR_ACCESS_ENDNOTE_NAME (RC_ACCESS_BEGIN + 10) -#define STR_ACCESS_ENDNOTE_DESC (RC_ACCESS_BEGIN + 11) -#define STR_ACCESS_REPLACEMENT_POSTIT (RC_ACCESS_BEGIN + 12) -#define STR_ACCESS_REPLACEMENT_FRAME (RC_ACCESS_BEGIN + 13) -#define STR_ACCESS_REPLACEMENT_BULLET_GRAPHICS (RC_ACCESS_BEGIN + 14) +#define STR_ACCESS_ENDNOTE_NAME (RC_ACCESS_BEGIN + 10) +#define STR_ACCESS_ENDNOTE_DESC (RC_ACCESS_BEGIN + 11) +#define STR_ACCESS_REPLACEMENT_POSTIT (RC_ACCESS_BEGIN + 12) +#define STR_ACCESS_REPLACEMENT_FRAME (RC_ACCESS_BEGIN + 13) +#define STR_ACCESS_REPLACEMENT_BULLET_GRAPHICS (RC_ACCESS_BEGIN + 14) #define STR_ACCESS_TABLE_DESC (RC_ACCESS_BEGIN + 15) #define STR_ACCESS_PAGE_NAME (RC_ACCESS_BEGIN + 16) #define STR_ACCESS_PAGE_DESC (RC_ACCESS_BEGIN + 17) -// <-- +#define STR_ACCESS_ANNOTATION_AUTHOR_NAME (RC_ACCESS_BEGIN + 18) +#define STR_ACCESS_ANNOTATION_DATE_NAME (RC_ACCESS_BEGIN + 19) +#define STR_ACCESS_ANNOTATION_BUTTON_NAME (RC_ACCESS_BEGIN + 20) +#define STR_ACCESS_ANNOTATION_BUTTON_DESC (RC_ACCESS_BEGIN + 21) -#define ACCESS_ACT_END STR_ACCESS_PAGE_DESC +#define ACCESS_ACT_END STR_ACCESS_ANNOTATION_BUTTON_DESC #if ACCESS_ACT_END > RC_ACCESS_END #error Resource-Id Ueberlauf in #file, #line diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx index 5137cdbe34..38cc40fd80 100644 --- a/sw/inc/accmap.hxx +++ b/sw/inc/accmap.hxx @@ -33,14 +33,15 @@ #include <vos/mutex.hxx> #include <svx/IAccessibleViewForwarder.hxx> #include <svx/IAccessibleParent.hxx> -#include "viewsh.hxx" #include <tools/debug.hxx> #include <tools/fract.hxx> #include <vector> +class ViewShell; class Rectangle; class SwFrm; +class SwTxtFrm; class SwPageFrm; class SwAccessibleContext; class SwAccessibleContextMap_Impl; @@ -48,85 +49,17 @@ class SwAccessibleEventList_Impl; class SwAccessibleEventMap_Impl; class SwShapeList_Impl; class SdrObject; -namespace accessibility { class AccessibleShape; } +namespace accessibility { + class AccessibleShape; +} class SwAccessibleShapeMap_Impl; struct SwAccessibleEvent_Impl; -// --> OD 2005-12-13 #i27301# class SwAccessibleSelectedParas_Impl; -// <-- class SwRect; class MapMode; class SwAccPreviewData; -// OD 14.01.2003 #103492# -#ifndef _PREVWPAGE_HXX -#include <prevwpage.hxx> -#endif - -// helper class that stores preview data -class SwAccPreviewData -{ - typedef std::vector<Rectangle> Rectangles; - Rectangles maPreviewRects; - Rectangles maLogicRects; - - SwRect maVisArea; - Fraction maScale; - - const SwPageFrm *mpSelPage; - - /** adjust logic page retangle to its visible part - - OD 17.01.2003 #103492# - - @author OD - - @param _iorLogicPgSwRect - input/output parameter - reference to the logic page rectangle, which - has to be adjusted. - - @param _rPrevwPgSwRect - input parameter - constant reference to the corresponding preview page - rectangle; needed to determine the visible part of the logic page rectangle. - - @param _rPrevwWinSize - input paramter - constant reference to the preview window size in TWIP; - needed to determine the visible part of the logic page rectangle - */ - void AdjustLogicPgRectToVisibleArea( SwRect& _iorLogicPgSwRect, - const SwRect& _rPrevwPgSwRect, - const Size& _rPrevwWinSize ); - -public: - SwAccPreviewData(); - ~SwAccPreviewData(); - - // OD 14.01.2003 #103492# - complete re-factoring of method due to new - // page/print preview functionality. - void Update( const std::vector<PrevwPage*>& _rPrevwPages, - const Fraction& _rScale, - const SwPageFrm* _pSelectedPageFrm, - const Size& _rPrevwWinSize ); - - // OD 14.01.2003 #103492# - complete re-factoring of method due to new - // page/print preview functionality. - void InvalidateSelection( const SwPageFrm* _pSelectedPageFrm ); - - const SwRect& GetVisArea() const; - - MapMode GetMapModeForPreview( ) const; - - /** Adjust the MapMode so that the preview page appears at the - * proper position. rPoint identifies the page for which the - * MapMode should be adjusted. If bFromPreview is true, rPoint is - * a preview coordinate; else it's a document coordinate. */ - // OD 17.01.2003 #103492# - delete unused 3rd parameter. - void AdjustMapMode( MapMode& rMapMode, - const Point& rPoint ) const; - - inline const SwPageFrm *GetSelPage() const { return mpSelPage; } - - void DisposePage(const SwPageFrm *pPageFrm ); -}; +struct PrevwPage; +class Window; // real states for events #define ACC_STATE_EDITABLE 0x01 @@ -154,7 +87,7 @@ typedef sal_uInt16 tAccessibleStates; class SwAccessibleMap : public accessibility::IAccessibleViewForwarder, public accessibility::IAccessibleParent { - ::vos::OMutex maMutex; + mutable ::vos::OMutex maMutex; ::vos::OMutex maEventMutex; SwAccessibleContextMap_Impl *mpFrmMap; SwAccessibleShapeMap_Impl *mpShapeMap; @@ -246,14 +179,7 @@ public: return mpVSh; } - inline const SwRect& GetVisArea() const - { - DBG_ASSERT( !GetShell()->IsPreView() || (mpPreview != NULL), - "preview without preview data?" ); - return GetShell()->IsPreView() - ? mpPreview->GetVisArea() - : GetShell()->VisArea(); - } + const SwRect& GetVisArea() const; /** get size of a dedicated preview page @@ -274,10 +200,14 @@ public: void RemoveContext( const SdrObject *pObj ); // Dispose frame and its children if bRecursive is set - void Dispose( const SwFrm *pFrm, const SdrObject *pObj, - sal_Bool bRecursive=sal_False ); - - void InvalidatePosOrSize( const SwFrm *pFrm, const SdrObject *pObj, + void Dispose( const SwFrm* pFrm, + const SdrObject* pObj, + Window* pWindow, + sal_Bool bRecursive = sal_False ); + + void InvalidatePosOrSize( const SwFrm* pFrm, + const SdrObject* pObj, + Window* pWindow, const SwRect& rOldFrm ); void InvalidateContent( const SwFrm *pFrm ); @@ -333,6 +263,9 @@ public: */ void InvalidateTextSelectionOfAllParas(); + sal_Int32 GetChildIndex( const SwFrm& rParentFrm, + Window& rChild ) const; + // update preview data (and fire events if necessary) // OD 15.01.2003 #103492# - complete re-factoring of method due to new // page/print preview functionality. diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index cf5bcd55ba..894d622cad 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -717,7 +717,6 @@ Achtung: Ab sofort sind in diesem File keine C++-Kommentare (//) mehr --------------------------------------------------------------------*/ #define FN_LINE_NUMBERING_DLG (FN_EXTRA + 2 ) /* Zeilennumerierung */ -#define FN_THESAURUS_DLG (FN_EXTRA + 3 ) /* Thesaurus */ #define FN_HYPHENATE_OPT_DLG (FN_EXTRA + 5 ) /* Silbentrennung */ #define FN_ADD_UNKNOWN (FN_EXTRA + 6 ) /* Woerter lernen */ #define FN_DICTIONARY_DLG (FN_EXTRA + 8 ) /* Woerterbuecher */ @@ -907,6 +906,7 @@ Achtung: Ab sofort sind in diesem File keine C++-Kommentare (//) mehr #define FN_UNO_PARA_NUM_STRING (FN_EXTRA2 + 110) #define FN_UNO_TABLE_NAME (FN_EXTRA2 + 111) #define FN_UNO_META (FN_EXTRA2 + 112) +#define FN_UNO_NESTED_TEXT_CONTENT (FN_EXTRA2 + 113) /*-------------------------------------------------------------------- Bereich: Hilfe diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index d8683707b7..abd89896d6 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -27,6 +27,8 @@ #ifndef _CRSRSH_HXX #define _CRSRSH_HXX +#include <com/sun/star/i18n/WordType.hpp> + #include <tools/string.hxx> #include <tools/link.hxx> #include <tools/rtti.hxx> @@ -748,9 +750,9 @@ public: BOOL SelectWord( const Point* pPt = 0 ); // Position vom akt. Cursor erfragen - BOOL IsStartWord()const; - BOOL IsEndWord() const; - BOOL IsInWord() const; + BOOL IsStartWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES )const; + BOOL IsEndWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const; + BOOL IsInWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const; BOOL IsStartSentence() const; BOOL IsEndSentence() const; BOOL IsSttPara() const; diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 6e1f099cbd..cdddf74799 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -164,6 +164,7 @@ class SwRubyList; class SwRubyListEntry; class SwSectionFmt; class SwSectionFmts; +class SwSectionData; class SwSelBoxes; class SwSpzFrmFmts; class SwTOXBase; @@ -715,6 +716,7 @@ private: bool DeleteAndJoinImpl(SwPaM&, const bool); bool DeleteAndJoinWithRedlineImpl(SwPaM&, const bool unused = false); bool DeleteRangeImpl(SwPaM&, const bool unused = false); + bool DeleteRangeImplImpl(SwPaM &); bool ReplaceRangeImpl(SwPaM&, String const&, const bool); public: @@ -1803,8 +1805,9 @@ public: inline const Link& GetOle2Link() const {return aOle2Link;} // insert section (the ODF kind of section, not the nodesarray kind) - SwSection* InsertSwSection( const SwPaM& rRange, const SwSection& rNew, - const SfxItemSet* pAttr = 0, bool bUpdate = true); + SwSection * InsertSwSection(SwPaM const& rRange, SwSectionData &, + SwTOXBase const*const pTOXBase = 0, + SfxItemSet const*const pAttr = 0, bool const bUpdate = true); sal_uInt16 IsInsRegionAvailable( const SwPaM& rRange, const SwNode** ppSttNd = 0 ) const; SwSection* GetCurrSection( const SwPosition& rPos ) const; @@ -1812,7 +1815,8 @@ public: const SwSectionFmts& GetSections() const { return *pSectionFmtTbl; } SwSectionFmt *MakeSectionFmt( SwSectionFmt *pDerivedFrom ); void DelSectionFmt( SwSectionFmt *pFmt, sal_Bool bDelNodes = sal_False ); - void ChgSection( sal_uInt16 nSect, const SwSection&, const SfxItemSet* = 0, sal_Bool bPreventLinkUpdate = FALSE); + void UpdateSection(sal_uInt16 const nSect, SwSectionData &, + SfxItemSet const*const = 0, bool const bPreventLinkUpdate = false); String GetUniqueSectionName( const String* pChkStr = 0 ) const; /* @@@MAINTAINABILITY-HORROR@@@ diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index d64358d333..735520f908 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -89,6 +89,7 @@ class SwTable; class SwTextBlocks; // fuer GlossaryRW class SwFmtFtn; class SwSection; +class SwSectionData; class SwSectionFmt; class SwTOXMarks; class SwTOXBase; @@ -200,6 +201,7 @@ public: // change text to Upper/Lower/Hiragana/Katagana/... void TransliterateText( sal_uInt32 nType ); + void TransliterateText( const String& rModuleName ); // count words in current selection void CountWords( SwDocStat& rStat ) const; @@ -809,9 +811,8 @@ public: // gebe Liste aller Fussnoten und deren Anfangstexte USHORT GetSeqFtnList( SwSeqFldList& rList, bool bEndNotes = false ); - // SS fuer Bereiche - const SwSection* InsertSection( const SwSection& rNew, - const SfxItemSet* = 0 ); + SwSection const* InsertSection( + SwSectionData & rNewData, SfxItemSet const*const = 0 ); BOOL IsInsRegionAvailable() const; const SwSection* GetCurrSection() const; // liefert wie GetCurrSection() den aktuellen Bereich, allerdings geht diese Funktion @@ -825,7 +826,8 @@ public: USHORT GetSectionFmtPos( const SwSectionFmt& ) const; const SwSectionFmt& GetSectionFmt(USHORT nFmt) const; void DelSectionFmt( USHORT nFmt ); - void ChgSection( USHORT nSect, const SwSection&, const SfxItemSet* = 0 ); + void UpdateSection(sal_uInt16 const nSect, SwSectionData &, + SfxItemSet const*const = 0); BOOL IsAnySectionInDoc( BOOL bChkReadOnly = FALSE, BOOL bChkHidden = FALSE, BOOL BChkTOX = FALSE ) const; @@ -871,7 +873,7 @@ public: BOOL IsGlblDocSaveLinks() const; USHORT GetGlobalDocContent( SwGlblDocContents& rArr ) const; BOOL InsertGlobalDocContent( const SwGlblDocContent& rPos, - const SwSection& rNew ); + SwSectionData & rNew ); BOOL InsertGlobalDocContent( const SwGlblDocContent& rPos, const SwTOXBase& rTOX ); BOOL InsertGlobalDocContent( const SwGlblDocContent& rPos ); diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index b272292f82..90785a008c 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -63,6 +63,11 @@ class SwFrmFmt; struct SwSortOptions; class SdrMarkList; +namespace svx +{ + class ISdrObjectFilter; +} + // return values for GetFrmType() und GetSelFrmType(). //! values can be combined via logival or @@ -464,6 +469,7 @@ public: BOOL GetObjAttr( SfxItemSet &rSet ) const; BOOL SetObjAttr( const SfxItemSet &rSet ); + const SdrObject* GetBestObject( BOOL bNext, USHORT eType = GOTOOBJ_DRAW_ANY, BOOL bFlat = TRUE, const ::svx::ISdrObjectFilter* pFilter = NULL ); BOOL GotoObj( BOOL bNext, USHORT /*GOTOOBJ_...*/ eType = GOTOOBJ_DRAW_ANY); //Setzen vom DragMode (z.B. Rotate), tut nix bei Rahmenselektion. @@ -476,7 +482,7 @@ public: void EndTextEdit(); //Loescht ggf. das Objekt. //Ankertyp des selektierten Objektes, -1 bei Uneindeutigkeit oder - //Rahmenselektion; FLY_PAGE bzw. FLY_AT_CNTNT aus frmatr.hxx sonst. + //Rahmenselektion; FLY_AT_PAGE bzw. FLY_AT_PARA aus frmatr.hxx sonst. short GetAnchorId() const; //Erzeugen von DrawObjekten, beim Begin wird der Objekttyp mitgegeben. diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx index e7bea38aae..500a4f1b80 100644 --- a/sw/inc/fldbas.hxx +++ b/sw/inc/fldbas.hxx @@ -305,12 +305,17 @@ inline void SwFieldType::UpdateFlds() const class SW_DLLPUBLIC SwField { +private: + mutable String m_Cache; /// #i85766# cached expansion (for clipboard) USHORT nLang; // Immer ueber SetLanguage aendern! BOOL bIsAutomaticLanguage; sal_uInt32 nFormat; SwFieldType* pType; + virtual String Expand() const = 0; + virtual SwField* Copy() const = 0; + protected: void SetFormat(sal_uInt32 nSet) {nFormat = nSet;} @@ -325,12 +330,16 @@ public: // neuen Typ setzen (wird fuer das Kopieren zwischen Dokumenten benutzt) virtual SwFieldType* ChgTyp( SwFieldType* ); - // Expandierung fuer die Anzeige - virtual String Expand() const = 0; + /** expand the field. + @param bInClipboard field is in clipboard document? + @return the generated text (suitable for display) + */ + String ExpandField(bool const bInClipboard) const; // liefert den Namen oder den Inhalt virtual String GetCntnt(BOOL bName = FALSE) const; - virtual SwField* Copy() const = 0; + + SwField * CopyField() const; // ResId USHORT Which() const diff --git a/sw/inc/htmltbl.hxx b/sw/inc/htmltbl.hxx index 6b5544a9ae..4c3918a7e1 100644 --- a/sw/inc/htmltbl.hxx +++ b/sw/inc/htmltbl.hxx @@ -267,6 +267,7 @@ class SwHTMLTableLayout DECL_STATIC_LINK( SwHTMLTableLayout, DelayedResize_Impl, void* ); + static USHORT GetBrowseWidthByVisArea( const SwDoc& rDoc ); public: SwHTMLTableLayout( const SwTable *pSwTbl, @@ -348,7 +349,6 @@ public: // oder eine ViewShell vorhanden ist. Sonst wird 0 zurueckgegeben. // (Wird vom HTML-Filter benoetigt, da der nicht an das Layout kommt.) static USHORT GetBrowseWidth( const SwDoc& rDoc ); - static USHORT GetBrowseWidthByVisArea( const SwDoc& rDoc ); // Ermitteln der verfuegbaren Breite uber den Tabellen-Frame USHORT GetBrowseWidthByTabFrm( const SwTabFrm& rTabFrm ) const; diff --git a/sw/inc/index.hxx b/sw/inc/index.hxx index bf09e85b76..a4e60b30b1 100644 --- a/sw/inc/index.hxx +++ b/sw/inc/index.hxx @@ -63,7 +63,7 @@ class SW_DLLPUBLIC SwIndex void Remove(); // Ausketten public: - SwIndex( SwIndexReg * pReg, xub_StrLen nIdx = 0 ); + explicit SwIndex(SwIndexReg *const pReg, xub_StrLen const nIdx = 0); SwIndex( const SwIndex & ); SwIndex( const SwIndex &, short nDiff ); ~SwIndex() { Remove(); } diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx index a9e361cf73..82517d6942 100644 --- a/sw/inc/ndarr.hxx +++ b/sw/inc/ndarr.hxx @@ -25,19 +25,19 @@ * ************************************************************************/ -#ifndef _NDARR_HXX -#define _NDARR_HXX +#ifndef SW_NDARR_HXX +#define SW_NDARR_HXX + +#include <vector> #include <com/sun/star/embed/XEmbeddedObject.hpp> + #include <svl/svarray.hxx> +#include <svtools/embedhlp.hxx> -#ifndef _BPARR_HXX #include <bparr.hxx> -#endif #include <ndtyp.hxx> -#include <svtools/embedhlp.hxx> -#include <vector> class Graphic; class GraphicObject; @@ -55,8 +55,9 @@ class SwNodeRange; class SwOLENode; class SwOutlineNodes; class SwPaM; -class SwSection; +class SwSectionData; class SwSectionFmt; +class SwTOXBase; class SwSectionNode; class SwStartNode; class SwTableBoxFmt; @@ -316,12 +317,13 @@ public: USHORT nMode = 0, SwHistory* pHistory = 0 ); // fuege eine neue SwSection ein - SwSectionNode* InsertSection( const SwNodeIndex& rNdIdx, + SwSectionNode* InsertTextSection(SwNodeIndex const& rNdIdx, SwSectionFmt& rSectionFmt, - const SwSection&, - const SwNodeIndex* pEnde, - BOOL bInsAtStart = TRUE, - BOOL bCreateFrms = TRUE ); + SwSectionData const&, + SwTOXBase const*const pTOXBase, + SwNodeIndex const*const pEnde, + bool const bInsAtStart = true, + bool const bCreateFrms = true); // in welchem Doc steht das Nodes-Array ? SwDoc* GetDoc() { return pMyDoc; } diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index ad783f1235..c63efbe3dc 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -24,8 +24,8 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _NDTXT_HXX -#define _NDTXT_HXX +#ifndef SW_NDTXT_HXX +#define SW_NDTXT_HXX #include <cppuhelper/weakref.hxx> @@ -133,6 +133,8 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable // pointer to the list, to whose the text node is added to SwList* mpList; // <-- + /// #i111677# cached expansion (for clipboard) + ::std::auto_ptr< ::rtl::OUString > m_pNumStringCache; ::com::sun::star::uno::WeakReference< ::com::sun::star::text::XTextContent> m_wXParagraph; @@ -199,6 +201,8 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable inline void TryDeleteSwpHints(); + SW_DLLPRIVATE void impl_FmtToTxtAttr(const SfxItemSet& i_rAttrSet); + public: bool IsWordCountDirty() const; bool IsWrongDirty() const; @@ -363,14 +367,30 @@ public: BOOL DontExpandFmt( const SwIndex& rIdx, bool bFlag = true, BOOL bFmtToTxtAttributes = TRUE ); - // gebe das vorgegebene Attribut, welches an der TextPosition (rIdx) - // gesetzt ist zurueck. Gibt es keines, returne 0-Pointer - // gesetzt heisst: Start <= rIdx < End - // FIXME: this function does not seem to be well-defined for those - // hints of which several may cover a single position, like TOXMark, - // or CharFmt - SwTxtAttr *GetTxtAttr( const SwIndex& rIdx, USHORT nWhichHt, - BOOL bExpand = FALSE ) const; + enum GetTxtAttrMode { + DEFAULT, /// DEFAULT: (Start < nIndex <= End) + EXPAND, /// EXPAND : (Start <= nIndex < End) + PARENT, /// PARENT : (Start < nIndex < End) + }; + + /** get the innermost text attribute covering position nIndex. + @param nWhich only attribute with this id is returned. + @param eMode the predicate for matching (@see GetTxtAttrMode). + + ATTENTION: this function is not well-defined for those + hints of which several may cover a single position, like + RES_TXTATR_CHARFMT, RES_TXTATR_REFMARK, RES_TXTATR_TOXMARK + */ + SwTxtAttr *GetTxtAttrAt(xub_StrLen const nIndex, RES_TXTATR const nWhich, + enum GetTxtAttrMode const eMode = DEFAULT) const; + + /** get the innermost text attributes covering position nIndex. + @param nWhich only attributes with this id are returned. + @param eMode the predicate for matching (@see GetTxtAttrMode). + */ + ::std::vector<SwTxtAttr *> GetTxtAttrsAt(xub_StrLen const nIndex, + RES_TXTATR const nWhich, + enum GetTxtAttrMode const eMode = DEFAULT) const; /** get the text attribute at position nIndex which owns the dummy character CH_TXTATR_* at that position, if one exists. diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index 629145fa68..47f58ce3ca 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.hxx @@ -25,18 +25,23 @@ * ************************************************************************/ -#ifndef _NODE_HXX -#define _NODE_HXX +#ifndef SW_NODE_HXX +#define SW_NODE_HXX + +#include <vector> + +#include <boost/utility.hpp> +#include <boost/shared_ptr.hpp> #include <tools/mempool.hxx> #include <tools/gen.hxx> + #include "swdllapi.h" #include <ndarr.hxx> #include <ndtyp.hxx> #include <index.hxx> #include <fmtcol.hxx> -#include <boost/shared_ptr.hpp> -#include <vector> + // --------------------- // forward Deklarationen // --------------------- @@ -55,6 +60,7 @@ class SwOLENode; class SwRect; class SwSection; class SwSectionFmt; +class SwTOXBase; class SwSectionNode; class SwStartNode; class SwTabFrm; @@ -547,22 +553,24 @@ private: //--------- // SwSectionNode //--------- -class SwSectionNode : public SwStartNode +class SwSectionNode + : public SwStartNode + , private ::boost::noncopyable { friend class SwNodes; - SwSection* pSection; + +private: + ::std::auto_ptr<SwSection> const m_pSection; + protected: virtual ~SwSectionNode(); public: - SwSectionNode( const SwNodeIndex&, SwSectionFmt& rFmt ); + SwSectionNode(SwNodeIndex const&, + SwSectionFmt & rFmt, SwTOXBase const*const pTOXBase); - const SwSection& GetSection() const { return *pSection; } - SwSection& GetSection() { return *pSection; } - - // setze ein neues SectionObject. Erstmal nur gedacht fuer die - // neuen VerzeichnisSections. Der geht ueber in den Besitz des Nodes! - void SetNewSection( SwSection* pNewSection ); + const SwSection& GetSection() const { return *m_pSection; } + SwSection& GetSection() { return *m_pSection; } SwFrm *MakeFrm(); @@ -591,10 +599,6 @@ public: // _nicht_ in einem versteckten (Unter-)Bereich liegt BOOL IsCntntHidden() const; -private: - // privater Constructor, weil nie kopiert werden darf !! - SwSectionNode( const SwSection& rNode ); - SwSectionNode & operator= ( const SwSection& rNode ); }; diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx index 8495ddd9f3..5f27eabcc4 100644 --- a/sw/inc/pch/precompiled_sw.hxx +++ b/sw/inc/pch/precompiled_sw.hxx @@ -728,7 +728,7 @@ #include "editeng/eeitem.hxx" #include "filter/msfilter/escherex.hxx" #include "svx/extrusionbar.hxx" -#include "svx/extrusioncontrols.hxx" +#include "svx/extrusioncolorcontrol.hxx" #include "svx/fillctrl.hxx" #include "svx/flagsdef.hxx" #include "editeng/flstitem.hxx" diff --git a/sw/inc/postit.hxx b/sw/inc/postit.hxx deleted file mode 100644 index e5484741d9..0000000000 --- a/sw/inc/postit.hxx +++ /dev/null @@ -1,413 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * 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 _POSTIT_HXX -#define _POSTIT_HXX - -#include <postithelper.hxx> - -#include <vcl/window.hxx> -#include <swrect.hxx> -#include <svx/sdr/overlay/overlayobject.hxx> - -#include <tools/datetime.hxx> -#include <tools/date.hxx> - -#include <vcl/lineinfo.hxx> -#include <basegfx/polygon/b2dpolygon.hxx> -#include <editeng/editstat.hxx> - -class SwPostItMgr; -class SwPostItField; -class SwFmtFld; -class OutlinerView; -class Outliner; -class ScrollBar; -class SwEditWin; -class SwView; -class SwPostIt; -class Edit; -class MultiLineEdit; -class PopupMenu; -class SvxLanguageItem; -class SwRedline; -class OutlinerParaObject; - -#define ANKORLINE_WIDTH 1 - -enum AnkorState {AS_ALL, AS_START, AS_END,AS_TRI}; - -class SwPostItAnkor: public sdr::overlay::OverlayObjectWithBasePosition -{ - protected: - /* 6------------7 - 1 / - /4\ ---------------5 - 2 - 3 - */ - - basegfx::B2DPoint maSecondPosition; - basegfx::B2DPoint maThirdPosition; - basegfx::B2DPoint maFourthPosition; - basegfx::B2DPoint maFifthPosition; - basegfx::B2DPoint maSixthPosition; - basegfx::B2DPoint maSeventhPosition; - - // helpers to fill and reset geometry - void implEnsureGeometry(); - void implResetGeometry(); - - // geometry creation for OverlayObject - virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); - - private: - // object's geometry - basegfx::B2DPolygon maTriangle; - basegfx::B2DPolygon maLine; - basegfx::B2DPolygon maLineTop; - unsigned long mHeight; - AnkorState mAnkorState; - - // bitfield - unsigned mbShadowedEffect : 1; - unsigned mbLineSolid : 1; - - public: - SwPostItAnkor(const basegfx::B2DPoint& rBasePos, - const basegfx::B2DPoint& rSecondPos, - const basegfx::B2DPoint& rThirdPos, - const basegfx::B2DPoint& rFourthPos, - const basegfx::B2DPoint& rFifthPos, - const basegfx::B2DPoint& rSixthPos, - const basegfx::B2DPoint& rSeventhPos, - Color aBaseColor, - bool bShadowedEffect, - bool bLineSolid); - virtual ~SwPostItAnkor(); - - const basegfx::B2DPoint& GetSecondPosition() const { return maSecondPosition; } - const basegfx::B2DPoint& GetThirdPosition() const { return maThirdPosition; } - const basegfx::B2DPoint& GetFourthPosition() const { return maFourthPosition; } - const basegfx::B2DPoint& GetFifthPosition() const { return maFifthPosition; } - const basegfx::B2DPoint& GetSixthPosition() const { return maSixthPosition; } - const basegfx::B2DPoint& GetSeventhPosition() const { return maSeventhPosition; } - - void SetAllPosition(const basegfx::B2DPoint& rPoint1, const basegfx::B2DPoint& rPoint2, const basegfx::B2DPoint& rPoint3, - const basegfx::B2DPoint& rPoint4, const basegfx::B2DPoint& rPoint5, const basegfx::B2DPoint& rPoint6, const basegfx::B2DPoint& rPoint7); - void SetTriPosition(const basegfx::B2DPoint& rPoint1,const basegfx::B2DPoint& rPoint2,const basegfx::B2DPoint& rPoint3, - const basegfx::B2DPoint& rPoint4,const basegfx::B2DPoint& rPoint5); - void SetSixthPosition(const basegfx::B2DPoint& rNew); - void SetSeventhPosition(const basegfx::B2DPoint& rNew); - - bool getLineSolid() const { return mbLineSolid; } - void setLineSolid(bool bNew); - - void SetHeight(const unsigned long aHeight) {mHeight = aHeight;}; - - bool getShadowedEffect() const { return mbShadowedEffect; } - - void SetAnkorState(AnkorState aState); - AnkorState GetAnkorState() const {return mAnkorState;} -}; - -enum ShadowState {SS_NORMAL, SS_VIEW, SS_EDIT}; - -class SwPostItShadow: public sdr::overlay::OverlayObjectWithBasePosition -{ - protected: - // geometry creation for OverlayObject - virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); - - private: - basegfx::B2DPoint maSecondPosition; - ShadowState mShadowState; - - public: - SwPostItShadow(const basegfx::B2DPoint& rBasePos, const basegfx::B2DPoint& rSecondPosition, Color aBaseColor,ShadowState aState); - virtual ~SwPostItShadow(); - - void SetShadowState(ShadowState aState); - ShadowState GetShadowState() {return mShadowState;} - - const basegfx::B2DPoint& GetSecondPosition() const { return maSecondPosition; } - void SetSecondPosition(const basegfx::B2DPoint& rNew); - void SetPosition(const basegfx::B2DPoint& rPoint1,const basegfx::B2DPoint& rPoint2); -}; - -class PostItTxt : public Window -{ - private: - OutlinerView* mpOutlinerView; - SwMarginWin* mpMarginWin; - - bool mMouseOver; - BOOL mbShowPopup; - - 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 DataChanged( const DataChangedEvent& aData); - virtual void LoseFocus(); - virtual void RequestHelp(const HelpEvent &rEvt); - virtual XubString GetSurroundingText() const; - virtual Selection GetSurroundingTextSelection() const; - - DECL_LINK( Select, Menu* ); - - public: - PostItTxt(Window* pParent, WinBits nBits); - ~PostItTxt(); - - virtual void GetFocus(); - void SetTextView( OutlinerView* aEditView ) { mpOutlinerView = aEditView; } - - DECL_LINK( WindowEventListener, VclSimpleEvent* ); - DECL_LINK( OnlineSpellCallback, SpellCallbackInfo*); -}; - -typedef sal_Int64 SwPostItBits; - -#define PB_Preview ((SwPostItBits)0x00000001) - - -class SwMarginWin : public Window -{ - private: - ULONG mnEventId; - SwView* mpView; - sdr::overlay::OverlayManager* pOverlayManager; - OutlinerView* mpOutlinerView; - Outliner* mpOutliner; - PostItTxt* mpPostItTxt; - MultiLineEdit* mpMeta; - ScrollBar* mpVScrollbar; - SwPostItAnkor* mpAnkor; - SwPostItShadow* mpShadow; - SwPostItMgr* mpMgr; - bool mbMeta; - Color mColorAnkor; - Color mColorDark; - Color mColorLight; - basegfx::B2DPolygon aPopupTriangle; - bool mbMarginSide; - Rectangle mPosSize; - SwRect mAnkorRect; - long mPageBorder; - SwPostItBits nFlags; - bool mbMouseOverButton; - - protected: - bool mbReadonly; - PopupMenu* mpButtonPopup; - bool mbIsFollow; - Rectangle mRectMetaButton; - virtual void DataChanged( const DataChangedEvent& aEvent); - virtual void LoseFocus(); - virtual void MouseButtonDown( const MouseEvent& rMEvt ); - virtual void MouseMove( const MouseEvent& rMEvt ); - virtual void Paint( const Rectangle& rRect); - virtual void GetFocus(); - - void SetSizePixel( const Size& rNewSize ); - SfxItemSet DefaultItem(); - - DECL_LINK(ModifyHdl, void*); - DECL_LINK(ScrollHdl, ScrollBar*); - DECL_LINK(DeleteHdl, void*); - - public: - TYPEINFO(); - SwMarginWin( Window* pParent, WinBits nBits, SwPostItMgr* aMgr,SwPostItBits aBits); - virtual ~SwMarginWin(); - - void SetSize( const Size& rNewSize ); - void SetPosSizePixelRect( long nX, long nY,long nWidth, long nHeight,const SwRect &aRect,const long PageBorder); - void SetPosAndSize(); - void TranslateTopPosition(const long aAmount); - virtual void CheckMetaText(); - - PostItTxt* PostItText() { return mpPostItTxt;} - ScrollBar* Scrollbar() { return mpVScrollbar;} - SwPostItAnkor* Ankor() { return mpAnkor;} - SwPostItShadow* Shadow() { return mpShadow;} - OutlinerView* View() { return mpOutlinerView;} - SwView* DocView() { return mpView;} - Outliner* Engine() { return mpOutliner;} - SwPostItMgr* Mgr() { return mpMgr; } - - SwRect GetAnkorRect() { return mAnkorRect; } - SwEditWin* EditWin(); - - long GetPostItTextHeight(); - - void SwitchToPostIt(USHORT aDirection); - //void SwitchToPostIt(bool aDirection); - virtual void SwitchToFieldPos(); - virtual sal_uInt32 MoveCaret() { return 0;}; - - virtual void UpdateData() = 0; - virtual void SetPostItText() = 0; - virtual void Delete(); - virtual void GotoPos() = 0; - virtual void SetPopup() = 0; - - virtual String GetAuthor(); - virtual Date GetDate(); - virtual Time GetTime(); - - void ExecuteCommand(USHORT nSlot); - void InitControls(); - void HidePostIt(); - void DoResize(); - void ResizeIfNeccessary(long aOldHeight, long aNewHeight); - void SetScrollbar(); - - void SetVirtualPosSize( const Point& aPoint, const Size& aSize); - const Point VirtualPos() { return mPosSize.TopLeft(); } - const Size VirtualSize() { return mPosSize.GetSize(); } - - void ShowAnkorOnly(const Point &aPoint); - void ShowNote(); - void HideNote(); - - void ResetAttributes(); - - void SetMarginSide(bool aMarginSide); - void SetReadonly(BOOL bSet); - BOOL IsReadOnly() { return mbReadonly;} - bool IsPreview() { return nFlags & PB_Preview;} - - void SetLanguage(const SvxLanguageItem aNewItem); - virtual SvxLanguageItem GetLanguage(void); - - void SetColor(Color aColorDark,Color aColorLight, Color aColorAnkor); - Color ColorDark() { return mColorDark; } - Color ColorLight() { return mColorLight; } - void Rescale(); - - void SetViewState(ShadowState bState); - - bool IsFollow() { return mbIsFollow; } - void SetFollow( bool bIsFollow) { mbIsFollow = bIsFollow;}; - virtual bool CalcFollow(); - - SwMarginWin* GetTopReplyNote(); - bool IsAnyStackParentVisible(); - - sal_Int32 GetMetaHeight(); - sal_Int32 GetMinimumSizeWithMeta(); - sal_Int32 GetMinimumSizeWithoutMeta(); - sal_Int32 GetMetaButtonAreaWidth(); - sal_Int32 GetScrollbarWidth(); - - void SetSpellChecking(); - - void ToggleInsMode(); - - virtual void ActivatePostIt(); - virtual void DeactivatePostIt(); - - virtual SwPostItHelper::SwLayoutStatus GetStatus() { return SwPostItHelper::NONE; } - - virtual bool IsProtected() {return mbReadonly;}; -}; - -// implementation for change tracking comments, fully functional, but not yet used -/* -class SwRedComment : public SwMarginWin -{ - private: - SwRedline* pRedline; - - protected: - virtual void MouseButtonDown( const MouseEvent& rMEvt ); - public: - TYPEINFO(); - SwRedComment( Window* pParent, WinBits nBits,SwPostItMgr* aMgr,SwPostItBits aBits,SwRedline* pRed); - virtual ~SwRedComment() {}; - - virtual void UpdateData(); - virtual void SetPostItText(); - virtual void Delete(); - virtual void GotoPos(); - virtual void SetPopup(); - virtual void ActivatePostIt(); - virtual void DeactivatePostIt(); - - virtual String GetAuthor(); - virtual Date GetDate(); - virtual Time GetTime(); - - virtual bool IsProtected(); -}; -*/ -class SwPostIt : public SwMarginWin -{ - private: - SwFmtFld* mpFmtFld; - SwPostItField* mpFld; - SwPostItHelper::SwLayoutStatus mStatus; - Color mChangeColor; - - protected: - virtual void MouseButtonDown( const MouseEvent& rMEvt ); - - public: - TYPEINFO(); - SwPostIt( Window* pParent, WinBits nBits,SwFmtFld* aField,SwPostItMgr* aMgr,SwPostItBits aBits); - virtual ~SwPostIt() {}; - - virtual void UpdateData(); - virtual void SetPostItText(); - virtual void Delete(); - virtual void GotoPos(); - virtual void SetPopup(); - - virtual String GetAuthor(); - virtual Date GetDate(); - virtual Time GetTime(); - - virtual sal_uInt32 MoveCaret(); - - void SetChangeTracking(SwPostItHelper::SwLayoutStatus& aStatus,Color aColor); - virtual SwPostItHelper::SwLayoutStatus GetStatus() { return mStatus; } - Color GetChangeColor() { return mChangeColor; } - - sal_uInt32 CountFollowing(); - virtual bool CalcFollow(); - void InitAnswer(OutlinerParaObject* pText); - - virtual SvxLanguageItem GetLanguage(void); - - virtual bool IsProtected(); -}; - -#endif diff --git a/sw/inc/postithelper.hxx b/sw/inc/postithelper.hxx index 7ef25ede3c..560cdd143a 100644 --- a/sw/inc/postithelper.hxx +++ b/sw/inc/postithelper.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -32,14 +32,18 @@ #include <redline.hxx> #include <vector> #include <vcl/window.hxx> +#include <SidebarWindowsTypes.hxx> #include <svl/brdcst.hxx> class SwTxtFld; class SwRootFrm; class SwPostIt; class String; -class SwMarginWin; class SwPostItMgr; +class SwEditWin; +namespace sw { namespace sidebarwindows { + class SwSidebarWin; +} } struct SwPosition; @@ -47,12 +51,23 @@ typedef sal_Int64 SwPostItBits; struct SwLayoutInfo { + const SwFrm* mpAnchorFrm; SwRect mPosition; SwRect mPageFrame; SwRect mPagePrtArea; unsigned long mnPageNumber; - bool mbMarginSide; + sw::sidebarwindows::SidebarPosition meSidebarPosition; USHORT mRedlineAuthor; + + SwLayoutInfo() + : mpAnchorFrm(0) + , mPosition() + , mPageFrame() + , mPagePrtArea() + , mnPageNumber(1) + , meSidebarPosition(sw::sidebarwindows::SIDEBAR_NONE) + , mRedlineAuthor(0) + {} }; namespace SwPostItHelper @@ -69,71 +84,77 @@ namespace SwPostItHelper unsigned long getPageInfo( SwRect& rPageFrm, const SwRootFrm* , const Point& ); } -class SwMarginItem +class SwSidebarItem { public: - SwMarginWin* pPostIt; + sw::sidebarwindows::SwSidebarWin* pPostIt; bool bShow; bool bFocus; - bool bMarginSide; - SwRect mPos; - SwRect mFramePos; - SwRect mPagePos; - unsigned long mnPageNumber; + SwPostItHelper::SwLayoutStatus mLayoutStatus; - USHORT mRedlineAuthor; - SwMarginItem(bool aShow, bool aFocus) - : pPostIt(0), - bShow(aShow), - bFocus(aFocus), - bMarginSide(false), - mnPageNumber(1), - mLayoutStatus( SwPostItHelper::INVISIBLE ), - mRedlineAuthor(0) + SwLayoutInfo maLayoutInfo; + + SwSidebarItem( const bool aShow, + const bool aFocus) + : pPostIt(0) + , bShow(aShow) + , bFocus(aFocus) + , mLayoutStatus( SwPostItHelper::INVISIBLE ) + , maLayoutInfo() {} - virtual ~SwMarginItem(){} - virtual SwPosition GetPosition() = 0; + virtual ~SwSidebarItem(){} + virtual SwPosition GetAnchorPosition() const = 0; virtual bool UseElement() = 0; - virtual SwFmtFld* GetFmtFld() = 0; + virtual SwFmtFld* GetFmtFld() const = 0; virtual SfxBroadcaster* GetBroadCaster() const = 0; - virtual SwMarginWin* GetMarginWindow(Window* pParent, WinBits nBits,SwPostItMgr* aMgr,SwPostItBits aBits) = 0; + virtual sw::sidebarwindows::SwSidebarWin* GetSidebarWindow( SwEditWin& rEditWin, + WinBits nBits, + SwPostItMgr& aMgr, + SwPostItBits aBits) = 0; }; /* -class SwRedCommentItem: public SwMarginItem +class SwRedCommentItem: public SwSidebarItem { private: SwRedline* pRedline; public: - SwRedCommentItem( SwRedline* pRed, bool aShow, bool aFocus) - : SwMarginItem(aShow,aFocus), + SwRedCommentItem( SwRedline* pRed, bool aShow, bool aFocus) + : SwSidebarItem(aShow,aFocus), pRedline(pRed) {} virtual ~SwRedCommentItem() {} - virtual SwPosition GetPosition(); + virtual SwPosition GetAnchorPosition() const; virtual bool UseElement(); - virtual SwFmtFld* GetFmtFld() {return 0; } + virtual SwFmtFld* GetFmtFld() const {return 0; } virtual SfxBroadcaster* GetBroadCaster() const { return dynamic_cast<SfxBroadcaster *> (pRedline); } - virtual SwMarginWin* GetMarginWindow(Window* pParent, WinBits nBits,SwPostItMgr* aMgr,SwPostItBits aBits); + virtual sw::sidebarwindows::SwSidebarWin* GetSidebarWindow( SwEditWin& rEditWin, + WinBits nBits, + SwPostItMgr& aMgr, + SwPostItBits aBits); }; */ -class SwPostItItem: public SwMarginItem +class SwAnnotationItem: public SwSidebarItem { private: SwFmtFld* pFmtFld; public: - SwPostItItem( SwFmtFld* p, bool aShow, bool aFocus) - : SwMarginItem(aShow,aFocus) , - pFmtFld(p) - { - } - virtual ~SwPostItItem() {} - virtual SwPosition GetPosition(); + SwAnnotationItem( SwFmtFld* p, + const bool aShow, + const bool aFocus) + : SwSidebarItem( aShow, aFocus ) + , pFmtFld(p) + {} + virtual ~SwAnnotationItem() {} + virtual SwPosition GetAnchorPosition() const; virtual bool UseElement(); - virtual SwFmtFld* GetFmtFld() {return pFmtFld;} + virtual SwFmtFld* GetFmtFld() const {return pFmtFld;} virtual SfxBroadcaster* GetBroadCaster() const { return dynamic_cast<SfxBroadcaster *> (pFmtFld); } - virtual SwMarginWin* GetMarginWindow(Window* pParent, WinBits nBits,SwPostItMgr* aMgr,SwPostItBits aBits); + virtual sw::sidebarwindows::SwSidebarWin* GetSidebarWindow( SwEditWin& rEditWin, + WinBits nBits, + SwPostItMgr& aMgr, + SwPostItBits aBits); }; #endif // _POSTITHELPER_HXX diff --git a/sw/inc/rcid.hrc b/sw/inc/rcid.hrc index c5f7d7d6d0..e5cd3e1ace 100644 --- a/sw/inc/rcid.hrc +++ b/sw/inc/rcid.hrc @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -78,6 +78,7 @@ #define RC_UNDO (RC_BASE + 3750) #define RC_SMARTTAG (RC_BASE + 3950) // SMARTTAGS #define RC_UNOCORE (RC_BASE + 4050) +#define RC_ANNOTATION (RC_BASE + 4150) /*-------------------------------------------------------------------- Beschreibung: Bereiche ausspannen @@ -87,8 +88,6 @@ #define RC_APP_BEGIN RC_APP #define RC_APP_END (RC_APP_BEGIN + 199) - - // Dialog-Verzeichnis #define RC_DIALOG_BEGIN RC_DIALOG #define RC_DIALOG_END (RC_DIALOG_BEGIN + 99) @@ -97,6 +96,10 @@ #define RC_DOCVW_BEGIN RC_DOCVW #define RC_DOCVW_END (RC_DOCVW_BEGIN + 99) +// Annotation +#define RC_ANNOTATION_BEGIN RC_ANNOTATION +#define RC_ANNOTATION_END (RC_ANNOTATION_BEGIN + 99) + // SW/Web #define RC_WEB_BEGIN RC_WEB #define RC_WEB_END (RC_WEB_BEGIN + 199) diff --git a/sw/inc/rolbck.hxx b/sw/inc/rolbck.hxx index 05fa3f20bf..dacc5621d5 100644 --- a/sw/inc/rolbck.hxx +++ b/sw/inc/rolbck.hxx @@ -75,13 +75,6 @@ class SwCharFmt; #include <memory> -#ifdef DBG_UTIL -class Writer; -#define OUT_HSTR_HINT( name ) \ - friend Writer& OutUndo_Hstr_ ## name( Writer&, const SwHistoryHint& ); -#else -#define OUT_HSTR_HINT( name ) -#endif enum HISTORY_HINT { HSTRY_SETFMTHNT, @@ -126,7 +119,6 @@ public: virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); virtual String GetDescription() const; - OUT_HSTR_HINT(SetFmtHnt) }; class SwHistoryResetFmt : public SwHistoryHint @@ -140,7 +132,6 @@ public: // <-- virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); - OUT_HSTR_HINT(ResetFmtHnt) }; class SwHistorySetTxt : public SwHistoryHint @@ -155,12 +146,11 @@ public: virtual ~SwHistorySetTxt(); virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); - OUT_HSTR_HINT(SetTxtHnt) }; class SwHistorySetTxtFld : public SwHistoryHint { - //!! beware of the order for the declation of thje auto_ptrs. + //!! beware of the order for the declation of the auto_ptrs. //!! If they get destroyed in the wrong order sw may crash (namely mail-merge as well) ::std::auto_ptr<SwFieldType> m_pFldType; const ::std::auto_ptr<SwFmtFld> m_pFld; @@ -176,7 +166,6 @@ public: virtual String GetDescription() const; - OUT_HSTR_HINT(SetTxtFldHnt) }; class SwHistorySetRefMark : public SwHistoryHint @@ -190,7 +179,6 @@ public: SwHistorySetRefMark( SwTxtRefMark* pTxtHt, ULONG nNode ); virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); - OUT_HSTR_HINT(SetRefMarkHnt) }; class SwHistorySetTOXMark : public SwHistoryHint @@ -207,7 +195,6 @@ public: virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); int IsEqual( const SwTOXMark& rCmp ) const; - OUT_HSTR_HINT(SetToxMarkHnt) }; class SwHistoryResetTxt : public SwHistoryHint @@ -226,7 +213,6 @@ public: ULONG GetNode() const { return m_nNodeIndex; } xub_StrLen GetCntnt() const { return m_nStart; } - OUT_HSTR_HINT(ResetTxtHnt) }; class SwHistorySetFootnote : public SwHistoryHint @@ -245,7 +231,6 @@ public: virtual String GetDescription() const; - OUT_HSTR_HINT(SetFtnHnt) }; class SwHistoryChangeFmtColl : public SwHistoryHint @@ -258,7 +243,6 @@ public: SwHistoryChangeFmtColl( SwFmtColl* pColl, ULONG nNode, BYTE nNodeWhich ); virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); - OUT_HSTR_HINT(ChangeFmtColl) }; class SwHistoryTxtFlyCnt : public SwHistoryHint @@ -271,7 +255,6 @@ public: virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); SwUndoDelLayFmt* GetUDelLFmt() { return m_pUndo.get(); } - OUT_HSTR_HINT(FlyCnt) }; class SwHistoryBookmark : public SwHistoryHint @@ -284,7 +267,6 @@ class SwHistoryBookmark : public SwHistoryHint bool IsEqualBookmark(const ::sw::mark::IMark& rBkmk); const ::rtl::OUString& GetName() const; - OUT_HSTR_HINT(Bookmark) private: const ::rtl::OUString m_aName; @@ -312,7 +294,6 @@ public: const SvUShortsSort& rSetArr ); virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); - OUT_HSTR_HINT(SetAttrSet) }; @@ -333,7 +314,6 @@ public: ULONG GetNode() const { return m_nNodeIndex; } xub_StrLen GetCntnt() const { return m_nStart; } - OUT_HSTR_HINT(ResetAttrSet) }; class SwHistoryChangeFlyAnchor : public SwHistoryHint @@ -368,7 +348,6 @@ public: SwHistoryChangeCharFmt( const SfxItemSet& rSet, const String & sFmt); virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet ); - OUT_HSTR_HINT(SetAttrSet) }; diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx index 6d0622228b..f44f904f05 100644 --- a/sw/inc/section.hxx +++ b/sw/inc/section.hxx @@ -28,14 +28,16 @@ #ifndef _SECTION_HXX #define _SECTION_HXX +#include <boost/utility.hpp> #include <com/sun/star/uno/Sequence.h> -#include <sfx2/lnkbase.hxx> + #include <tools/rtti.hxx> -#ifndef _TOOLS_REF_HXX #include <tools/ref.hxx> -#endif #include <svl/svarray.hxx> +#include <sfx2/lnkbase.hxx> +#include <sfx2/Metadatable.hxx> + #include <frmfmt.hxx> @@ -77,61 +79,119 @@ enum LinkCreateType CREATE_UPDATE // Link connecten und updaten }; +class SW_DLLPUBLIC SwSectionData +{ +private: + SectionType m_eType; + + String m_sSectionName; + String m_sCondition; + String m_sLinkFileName; + String m_sLinkFilePassword; // JP 27.02.2001: must be changed to Sequence + ::com::sun::star::uno::Sequence <sal_Int8> m_Password; + + /// it seems this flag caches the current final "hidden" state + bool m_bHiddenFlag : 1; + /// flags that correspond to attributes in the format: + /// may have different value than format attribute: + /// format attr has value for this section, while flag is + /// effectively ORed with parent sections! + bool m_bProtectFlag : 1; + // --> FME 2004-06-22 #114856# edit in readonly sections + bool m_bEditInReadonlyFlag : 1; + // <-- + bool m_bHidden : 1; // all paragraphs hidden? + bool m_bCondHiddenFlag : 1; // Hiddenflag for condition + bool m_bConnectFlag : 1; // connected to server? + +public: + + SwSectionData(SectionType const eType, String const& rName); + explicit SwSectionData(SwSection const&); + SwSectionData(SwSectionData const&); + SwSectionData & operator=(SwSectionData const&); + bool operator==(SwSectionData const&) const; + + String const& GetSectionName() const { return m_sSectionName; } + void SetSectionName(String const& rName){ m_sSectionName = rName; } + SectionType GetType() const { return m_eType; } + void SetType(SectionType const eNew) { m_eType = eNew; } + + bool IsHidden() const { return m_bHidden; } + void SetHidden(bool const bFlag = true) { m_bHidden = bFlag; } + + bool IsHiddenFlag() const { return m_bHiddenFlag; } + SW_DLLPRIVATE void + SetHiddenFlag(bool const bFlag) { m_bHiddenFlag = bFlag; } + bool IsProtectFlag() const { return m_bProtectFlag; } + SW_DLLPRIVATE void + SetProtectFlag(bool const bFlag) { m_bProtectFlag = bFlag; } + // --> FME 2004-06-22 #114856# edit in readonly sections + bool IsEditInReadonlyFlag() const { return m_bEditInReadonlyFlag; } + void SetEditInReadonlyFlag(bool const bFlag) + { m_bEditInReadonlyFlag = bFlag; } + // <-- + + void SetCondHidden(bool const bFlag = true) { m_bCondHiddenFlag = bFlag; }; + bool IsCondHidden() const { return m_bCondHiddenFlag; } + + String const& GetCondition() const { return m_sCondition; } + void SetCondition(String const& rNew) { m_sCondition = rNew; } + + String const& GetLinkFileName() const { return m_sLinkFileName; }; + void SetLinkFileName(String const& rNew, String const* pPassWd = 0) + { + m_sLinkFileName = rNew; + if (pPassWd) { SetLinkFilePassword(*pPassWd); } + } + + String const& GetLinkFilePassword() const { return m_sLinkFilePassword; } + void SetLinkFilePassword(String const& rS) { m_sLinkFilePassword = rS; } -class SW_DLLPUBLIC SwSection : public SwClient + ::com::sun::star::uno::Sequence<sal_Int8> const& GetPassword() const + { return m_Password; } + void SetPassword(::com::sun::star::uno::Sequence<sal_Int8> const& rNew) + { m_Password = rNew; } + bool IsLinkType() const + { return (DDE_LINK_SECTION == m_eType) || (FILE_LINK_SECTION == m_eType); } + + bool IsConnectFlag() const { return m_bConnectFlag; } + void SetConnectFlag(bool const bFlag = true){ m_bConnectFlag = bFlag; } +}; + +class SW_DLLPUBLIC SwSection + : public SwClient + , private ::boost::noncopyable { // damit beim Anlegen/Loeschen von Frames das Flag richtig gepflegt wird! friend class SwSectionNode; // the "read CTOR" of SwSectionFrm have to change the Hiddenflag friend class SwSectionFrm; - String sSectionNm; - String sCondition; // erstmal, vielleicht auch mal ein Feld ?? - String sLinkFileName, - sLinkFilePassWd; // JP 27.02.2001: must later changed to Sequence - ::com::sun::star::uno::Sequence <sal_Int8> aPasswd; - - SwServerObjectRef refObj; // falls DataServer -> Pointer gesetzt - ::sfx2::SvBaseLinkRef refLink; - - SectionType eType; - - BOOL bProtectFlag : 1; // Flags fuer schnelle Abfragen, wird ueber - // Attribut im Format gesetzt - BOOL bHiddenFlag : 1; // Flag: Absaetze versteckt ? - // --> FME 2004-06-22 #114856# edit in readonly sections - BOOL bEditInReadonlyFlag : 1; - // <-- - BOOL bHidden : 1; // alle Absaetze nicht sichtbar ? - BOOL bCondHiddenFlag : 1; // Hiddenflag fuer die Bedingung ? - BOOL bConnectFlag : 1; // Flag: "Verbindung zum Server" vorhanden? - +private: + SwSectionData m_Data; - SW_DLLPRIVATE void _SetHiddenFlag( BOOL bHidden, BOOL bCondition ); - SW_DLLPRIVATE void _SetProtectFlag( BOOL bFlag ) { bProtectFlag = bFlag; } - /* SW_DLLPUBLIC */ BOOL _IsProtect() const; + SwServerObjectRef m_RefObj; // set if DataServer + ::sfx2::SvBaseLinkRef m_RefLink; - // --> FME 2004-06-22 #114856# edit in readonly sections - void _SetEditInReadonlyFlag( BOOL bFlag ) { bEditInReadonlyFlag = bFlag; } - BOOL _IsEditInReadonly() const; - // <-- + SW_DLLPRIVATE void ImplSetHiddenFlag( + bool const bHidden, bool const bCondition); public: TYPEINFO(); // rtti - SwSection( SectionType eType, const String& rName, - SwSectionFmt* pFmt = 0 ); - ~SwSection(); + SwSection(SectionType const eType, String const& rName, + SwSectionFmt & rFormat); + virtual ~SwSection(); - // kopiere nur die Daten der Section! - // Ableitung bleibt (beim Left) erhalten. - SwSection& operator=( const SwSection& ); - BOOL operator==( const SwSection& rCmp ) const; + bool DataEquals(SwSectionData const& rCmp) const; - const String& GetName() const { return sSectionNm; } - void SetName( const String& rName ) { sSectionNm = rName; } - SectionType GetType() const { return eType; } - void SetType( SectionType eNew ) { eType = eNew; } + void SetSectionData(SwSectionData const& rData); + + String const& GetSectionName() const { return m_Data.GetSectionName(); } + void SetSectionName(String const& rName){ m_Data.SetSectionName(rName); } + SectionType GetType() const { return m_Data.GetType(); } + void SetType(SectionType const eType) { return m_Data.SetType(eType); } SwSectionFmt* GetFmt() { return (SwSectionFmt*)pRegisteredIn; } SwSectionFmt* GetFmt() const { return (SwSectionFmt*)pRegisteredIn; } @@ -140,78 +200,76 @@ public: // setze die Hidden/Protected -> gesamten Baum updaten ! // (Attribute/Flags werden gesetzt/erfragt) - BOOL IsHidden() const { return bHidden; } - BOOL IsProtect() const { return GetFmt() ? _IsProtect() - : IsProtectFlag(); } - + bool IsHidden() const { return m_Data.IsHidden(); } + void SetHidden (bool const bFlag = true); + bool IsProtect() const; + void SetProtect(bool const bFlag = true); // --> FME 2004-06-22 #114856# edit in readonly sections - BOOL IsEditInReadonly()const { return GetFmt() ? _IsEditInReadonly() : IsEditInReadonlyFlag(); } - void SetEditInReadonly( BOOL bFlag = TRUE ); + bool IsEditInReadonly() const; + void SetEditInReadonly(bool const bFlag = true); // <-- - void SetHidden( BOOL bFlag = TRUE ); - void SetProtect( BOOL bFlag = TRUE ); - // erfrage die internen Flags (Zustand inklusive Parents nicht, was // aktuell an der Section gesetzt ist!!) - BOOL IsHiddenFlag() const { return bHiddenFlag; } - BOOL IsProtectFlag() const { return bProtectFlag; } + bool IsHiddenFlag() const { return m_Data.IsHiddenFlag(); } + bool IsProtectFlag() const { return m_Data.IsProtectFlag(); } // --> FME 2004-06-22 #114856# edit in readonly sections - BOOL IsEditInReadonlyFlag() const { return bEditInReadonlyFlag; } + bool IsEditInReadonlyFlag() const { return m_Data.IsEditInReadonlyFlag(); } // <-- - void SetCondHidden( BOOL bFlag = TRUE ); - BOOL IsCondHidden() const { return bCondHiddenFlag; } + void SetCondHidden(bool const bFlag = true); + bool IsCondHidden() const { return m_Data.IsCondHidden(); } // erfrage (auch ueber die Parents), ob diese Section versteckt sein soll. BOOL CalcHiddenFlag() const; inline SwSection* GetParent() const; - // setze/erfrage die Bedingung - const String& GetCondition() const { return sCondition; } - void SetCondition( const String& rNew ) { sCondition = rNew; } + String const& GetCondition() const { return m_Data.GetCondition(); } + void SetCondition(String const& rNew) { m_Data.SetCondition(rNew); } - // setze/erfrage den gelinkten FileNamen const String& GetLinkFileName() const; - void SetLinkFileName( const String& rNew, const String* pPassWd = 0 ); - // Passwort des gelinkten Files (nur waehrend der Laufzeit gueltig!) - const String& GetLinkFilePassWd() const { return sLinkFilePassWd; } - void SetLinkFilePassWd( const String& rS ) { sLinkFilePassWd = rS; } + void SetLinkFileName(String const& rNew, String const*const pPassWd = 0); + // password of linked file (only valid during runtime!) + String const& GetLinkFilePassword() const + { return m_Data.GetLinkFilePassword(); } + void SetLinkFilePassword(String const& rS) + { m_Data.SetLinkFilePassword(rS); } // get / set password of this section - const ::com::sun::star::uno::Sequence <sal_Int8>& - GetPasswd() const { return aPasswd; } - void SetPasswd( const ::com::sun::star::uno::Sequence <sal_Int8>& rNew ) - { aPasswd = rNew; } + ::com::sun::star::uno::Sequence<sal_Int8> const& GetPassword() const + { return m_Data.GetPassword(); } + void SetPassword(::com::sun::star::uno::Sequence <sal_Int8> const& rNew) + { m_Data.SetPassword(rNew); } // Daten Server-Methoden void SetRefObject( SwServerObject* pObj ); - const SwServerObject* GetObject() const { return &refObj; } - SwServerObject* GetObject() { return &refObj; } - BOOL IsServer() const { return refObj.Is(); } + const SwServerObject* GetObject() const { return & m_RefObj; } + SwServerObject* GetObject() { return & m_RefObj; } + bool IsServer() const { return m_RefObj.Is(); } // Methoden fuer gelinkte Bereiche - USHORT GetUpdateType() const { return refLink->GetUpdateMode(); } - void SetUpdateType( USHORT nType ) { refLink->SetUpdateMode( nType ); } + USHORT GetUpdateType() const { return m_RefLink->GetUpdateMode(); } + void SetUpdateType(USHORT const nType ) + { m_RefLink->SetUpdateMode(nType); } - BOOL IsConnected() const { return refLink.Is(); } - void UpdateNow() { refLink->Update(); } - void Disconnect() { refLink->Disconnect(); } + bool IsConnected() const { return m_RefLink.Is(); } + void UpdateNow() { m_RefLink->Update(); } + void Disconnect() { m_RefLink->Disconnect(); } - const ::sfx2::SvBaseLink& GetBaseLink() const { return *refLink; } - ::sfx2::SvBaseLink& GetBaseLink() { return *refLink; } + const ::sfx2::SvBaseLink& GetBaseLink() const { return *m_RefLink; } + ::sfx2::SvBaseLink& GetBaseLink() { return *m_RefLink; } void CreateLink( LinkCreateType eType ); void MakeChildLinksVisible( const SwSectionNode& rSectNd ); - BOOL IsLinkType() const - { return DDE_LINK_SECTION == eType || FILE_LINK_SECTION == eType; } + bool IsLinkType() const { return m_Data.IsLinkType(); } // Flags fuer UI - Verbindung geklappt? - BOOL IsConnectFlag() const { return bConnectFlag; } - void SetConnectFlag( BOOL bFlag = TRUE ) { bConnectFlag = bFlag; } + bool IsConnectFlag() const { return m_Data.IsConnectFlag(); } + void SetConnectFlag(bool const bFlag = true) + { m_Data.SetConnectFlag(bFlag); } // return the TOX base class if the section is a TOX section const SwTOXBase* GetTOXBase() const; @@ -219,16 +277,15 @@ public: // --> OD 2007-02-14 #b6521322# void BreakLink(); // <-- -private: - // privater Constructor, weil nie kopiert werden darf !! - SwSection( const SwSection& ); - // @@@ but copy assignment "SwSection & operator= ( const SwSection& )" is public? @@@ + }; enum SectionSort { SORTSECT_NOT, SORTSECT_NAME, SORTSECT_POS }; -class SW_DLLPUBLIC SwSectionFmt : public SwFrmFmt +class SW_DLLPUBLIC SwSectionFmt + : public SwFrmFmt + , public ::sfx2::Metadatable { friend class SwDoc; @@ -239,7 +296,6 @@ class SW_DLLPUBLIC SwSectionFmt : public SwFrmFmt ::com::sun::star::uno::WeakReference< ::com::sun::star::text::XTextSection> m_wXTextSection; - /* SW_DLLPUBLIC */ SwSection* _GetSection() const; SW_DLLPRIVATE void UpdateParent(); // Parent wurde veraendert protected: @@ -259,7 +315,7 @@ public: // erfrage vom Format Informationen virtual BOOL GetInfo( SfxPoolItem& ) const; - SwSection* GetSection() const { return (SwSection*)_GetSection(); } + SwSection* GetSection() const; inline SwSectionFmt* GetParent() const; inline SwSection* GetParentSection() const; @@ -274,9 +330,10 @@ public: // befindet. BOOL IsInNodesArr() const; - SwSectionNode* GetSectionNode( BOOL bAlways = FALSE ); - const SwSectionNode* GetSectionNode( BOOL bAlways = FALSE ) const - { return ((SwSectionFmt*)this)->GetSectionNode( bAlways ); } + SwSectionNode* GetSectionNode(bool const bEvenIfInUndo = false); + const SwSectionNode* GetSectionNode(bool const bEvenIfInUndo = false) const + { return const_cast<SwSectionFmt *>(this) + ->GetSectionNode(bEvenIfInUndo); } // ist die Section eine gueltige fuers GlobalDocument? const SwSection* GetGlobalDocSection() const; @@ -288,6 +345,14 @@ public: ::com::sun::star::text::XTextSection> const& xTextSection) { m_wXTextSection = xTextSection; } + // sfx2::Metadatable + virtual ::sfx2::IXmlIdRegistry& GetRegistry(); + virtual bool IsInClipboard() const; + virtual bool IsInUndo() const; + virtual bool IsInContent() const; + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::rdf::XMetadatable > MakeUnoObject(); + }; // -------------- inlines --------------------------------- @@ -314,7 +379,9 @@ inline SwSection* SwSectionFmt::GetParentSection() const SwSectionFmt* pParent = GetParent(); SwSection* pRet = 0; if( pParent ) - pRet = pParent->_GetSection(); + { + pRet = pParent->GetSection(); + } return pRet; } diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx index a31daa325a..643cd847c5 100644 --- a/sw/inc/shellio.hxx +++ b/sw/inc/shellio.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -24,8 +24,11 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _SHELLIO_HXX -#define _SHELLIO_HXX +#ifndef SW_SHELLIO_HXX +#define SW_SHELLIO_HXX + +#include <memory> +#include <boost/utility.hpp> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/embed/XStorage.hpp> @@ -431,7 +434,9 @@ extern BOOL SetHTMLTemplate( SwDoc &rDoc ); //Fuer Vorlagen aus HTML.vor laden s class IDocumentSettingAccess; class IDocumentStylePoolAccess; -class SW_DLLPUBLIC Writer : public SvRefBase +class SW_DLLPUBLIC Writer + : public SvRefBase + , private ::boost::noncopyable { SwAsciiOptions aAscOpts; String sBaseURL; @@ -439,10 +444,10 @@ class SW_DLLPUBLIC Writer : public SvRefBase void _AddFontItem( SfxItemPool& rPool, const SvxFontItem& rFont ); void _AddFontItems( SfxItemPool& rPool, USHORT nWhichId ); + ::std::auto_ptr<Writer_Impl> m_pImpl; + protected: - Writer_Impl* pImpl; - SvStream* pStrm; SwPaM* pOrigPam; // der letze zu bearbeitende Pam const String* pOrigFileName; @@ -534,12 +539,8 @@ public: inline SvStream& OutLong( long nVal ) { return OutLong( Strm(), nVal ); } inline SvStream& OutULong( ULONG nVal ) { return OutULong( Strm(), nVal ); } - void SetStrm( SvStream& rStrm ) { pStrm = &rStrm; } -#ifndef DBG_UTIL - SvStream& Strm() { return *pStrm; } -#else + void SetStream(SvStream *const pStream); SvStream& Strm(); -#endif void SetOrganizerMode( BOOL bSet ) { bOrganizerMode = bSet; } }; @@ -659,7 +660,7 @@ namespace SwReaderWriter { /// Return reader based on ReaderWriterEnum Reader* GetReader( ReaderWriterEnum eReader ); - + /// Return reader based on the name Reader* GetReader( const String& rFltName ); diff --git a/sw/inc/sw_primitivetypes2d.hxx b/sw/inc/sw_primitivetypes2d.hxx index 3d1ef30711..12e245791f 100644 --- a/sw/inc/sw_primitivetypes2d.hxx +++ b/sw/inc/sw_primitivetypes2d.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,9 +34,9 @@ ////////////////////////////////////////////////////////////////////////////// -#define PRIMITIVE2D_ID_SWVIRTFLYDRAWOBJPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SW| 0) -#define PRIMITIVE2D_ID_SWPOSTITANKORPRIMITIVE (PRIMITIVE2D_ID_RANGE_SW| 1) -#define PRIMITIVE2D_ID_SWPOSTITSHADOWPRIMITIVE (PRIMITIVE2D_ID_RANGE_SW| 2) +#define PRIMITIVE2D_ID_SWVIRTFLYDRAWOBJPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SW| 0) +#define PRIMITIVE2D_ID_SWSIDEBARANCHORPRIMITIVE (PRIMITIVE2D_ID_RANGE_SW| 1) +#define PRIMITIVE2D_ID_SWSIDEBARSHADOWPRIMITIVE (PRIMITIVE2D_ID_RANGE_SW| 2) ////////////////////////////////////////////////////////////////////////////// diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 0cd441e5d2..1c2198981a 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -73,7 +73,7 @@ class SwForm; struct CurTOXType; class SwTOXDescription; class SwTOXBase; -class SwSection; +class SwSectionData; struct SwDBData; class SwField; class Printer; @@ -194,7 +194,7 @@ public: class AbstractInsertSectionTabDialog : public VclAbstractDialog //add for SwInsertSectionTabDialog { public: - virtual void SetSection(const SwSection& rSect) = 0; + virtual void SetSectionData(SwSectionData const& rSect) = 0; }; class AbstractSwWordCountDialog : public VclAbstractDialog diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index a21d6cbf59..9294989817 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -26,7 +26,9 @@ ************************************************************************/ #ifndef _SWCRSR_HXX #define _SWCRSR_HXX + #include <com/sun/star/i18n/WordType.hpp> + #include <pam.hxx> #include <tblsel.hxx> #include <cshtyp.hxx> @@ -129,10 +131,10 @@ public: const SfxItemSet* rReplSet = 0 ); // UI versions - BOOL IsStartWord() const; - BOOL IsEndWord() const; + BOOL IsStartWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const; + BOOL IsEndWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const; + BOOL IsInWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const; BOOL IsStartEndSentence( bool bEnd ) const; - BOOL IsInWord() const; BOOL GoStartWord(); BOOL GoEndWord(); BOOL GoNextWord(); diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index 86f8e31d99..04812ae7d9 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -39,6 +39,8 @@ #include <node.hxx> // fuer StartNode->GetMyIndex #else class SwStartNode; +#include <memory> +#include <boost/noncopyable.hpp> #endif class Color; @@ -468,4 +470,21 @@ public: { return const_cast<SwTableBox*>(this)->FindEndOfRowSpan( rTable, nMaxStep ); } }; +class SwCellFrm; +class SW_DLLPUBLIC SwTableCellInfo : public ::boost::noncopyable +{ + struct Impl; + ::std::auto_ptr<Impl> m_pImpl; + + const SwCellFrm * getCellFrm() const ; + +public: + SwTableCellInfo(const SwTable * pTable); + ~SwTableCellInfo(); + + bool getNext(); + SwRect getRect() const; + const SwTableBox * getTableBox() const; +}; + #endif //_SWTABLE_HXX diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx index f9918e2c90..6ba1e25966 100644 --- a/sw/inc/txtfld.hxx +++ b/sw/inc/txtfld.hxx @@ -41,7 +41,8 @@ class SwTxtFld : public SwTxtAttr SwTxtNode * m_pTxtNode; public: - SwTxtFld( SwFmtFld& rAttr, xub_StrLen nStart ); + SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStart, + bool const bInClipboard); virtual ~SwTxtFld(); void CopyFld( SwTxtFld *pDest ) const; diff --git a/sw/inc/txtftn.hxx b/sw/inc/txtftn.hxx index e7fee60630..31051450e9 100644 --- a/sw/inc/txtftn.hxx +++ b/sw/inc/txtftn.hxx @@ -49,7 +49,7 @@ public: inline SwNodeIndex *GetStartNode() const { return m_pStartNode; } void SetStartNode( const SwNodeIndex *pNode, BOOL bDelNodes = TRUE ); void SetNumber( const USHORT nNumber, const String* = 0 ); - void CopyFtn( SwTxtFtn *pDest ) const; + void CopyFtn(SwTxtFtn & rDest, SwTxtNode & rDestNode) const; // get and set TxtNode pointer inline const SwTxtNode& GetTxtNode() const; diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index c3b04e2e1b..22baea043f 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -24,8 +24,18 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _UNDOBJ_HXX -#define _UNDOBJ_HXX +#ifndef SW_UNDOBJ_HXX +#define SW_UNDOBJ_HXX + +// --> OD 2006-11-01 #130889# +#include <vector> +// <-- +#include <memory> + +#include <boost/shared_ptr.hpp> + +#include <com/sun/star/uno/Sequence.h> + #include <tools/mempool.hxx> #ifndef _SVSTDARR_HXX #define _SVSTDARR_USHORTS @@ -36,23 +46,16 @@ #include <svl/svstdarr.hxx> #endif #include <svl/itemset.hxx> -#include <com/sun/star/uno/Sequence.h> + +#include <svx/svdundo.hxx> // #111827# + #include <numrule.hxx> #include <itabenum.hxx> #include <format.hxx> #include <SwRewriter.hxx> -#include <svx/svdundo.hxx> // #111827# - #include <swundo.hxx> - #include <IMark.hxx> #include <IDocumentContentOperations.hxx> -// --> OD 2006-11-01 #130889# -#include <vector> -// <-- - -#include <boost/shared_ptr.hpp> -#include <memory> class SwUndoIter; @@ -71,8 +74,9 @@ class SwTableBox; struct SwSortOptions; class SwFrmFmt; class SwHistoryBookmark; -class SwSection; +class SwSectionData; class SwSectionFmt; +class SwTOXBase; class SvxTabStopItem; class SwDDEFieldType; class Graphic; @@ -112,15 +116,6 @@ namespace utl { class TransliterationWrapper; } -#ifdef DBG_UTIL -class Writer; -class SwUndo; -#define OUT_UNDOBJ( name ) \ - friend Writer& OutUndo_ ## name( Writer&, const SwUndo& ); -#else -#define OUT_UNDOBJ( name ) -#endif - const String UNDO_ARG1("$1", RTL_TEXTENCODING_ASCII_US); const String UNDO_ARG2("$2", RTL_TEXTENCODING_ASCII_US); @@ -244,7 +239,6 @@ protected: public: SwUndoSaveCntnt(); ~SwUndoSaveCntnt(); - OUT_UNDOBJ( SaveCntnt ) }; @@ -271,7 +265,6 @@ public: const SwHistory* GetHistory() const { return pHistory; } SwHistory* GetHistory() { return pHistory; } - OUT_UNDOBJ( SaveSection ) }; @@ -320,7 +313,6 @@ public: // Setzen vom End-Undo-Offset geschieht im Doc::EndUndo USHORT GetEndOffset() const { return nEndOffset; } void SetEndOffset( USHORT n ) { nEndOffset = n; } - OUT_UNDOBJ( Start ) }; class SwUndoEnd: public SwUndo @@ -352,7 +344,6 @@ public: // Setzen vom Start-Undo-Offset geschieht im Doc::EndUndo void SetSttOffset(USHORT _nSttOffSet) { nSttOffset = _nSttOffSet; } USHORT GetSttOffset() const { return nSttOffset; } - OUT_UNDOBJ( End ) }; class SwUndoInsert: public SwUndo, private SwUndoSaveCntnt @@ -402,7 +393,6 @@ public: virtual SwRewriter GetRewriter() const; BOOL CanGrouping( const SwPosition&, sal_Unicode cIns ); - OUT_UNDOBJ( Insert ) DECL_FIXEDMEMPOOL_NEWDEL(SwUndoInsert) }; @@ -472,8 +462,6 @@ public: xub_StrLen ContentStart() const { return nSttCntnt; } BOOL IsDelFullPara() const { return bDelFullPara; } - OUT_UNDOBJ( Delete ) - DECL_FIXEDMEMPOOL_NEWDEL(SwUndoDelete) }; @@ -509,7 +497,6 @@ public: virtual SwRewriter GetRewriter() const; BOOL CanGrouping( SwDoc*, SwPosition&, sal_Unicode cIns ); - OUT_UNDOBJ( Overwrite ) }; @@ -528,7 +515,6 @@ public: virtual void Redo( SwUndoIter& ); virtual void Repeat( SwUndoIter& ); void SetTblFlag() { bTblFlag = TRUE; } - OUT_UNDOBJ( SplitNode ) }; @@ -567,7 +553,6 @@ public: void SetMoveRedlines( bool b ) { bMoveRedlines = b; } - OUT_UNDOBJ( Move ) }; @@ -593,7 +578,6 @@ public: SwHistory& GetHistory() { return *m_pHistory; } - OUT_UNDOBJ( InsAttr ) }; class SwUndoResetAttr : public SwUndo, private SwUndRng @@ -613,7 +597,6 @@ public: SwHistory& GetHistory() { return *m_pHistory; } - OUT_UNDOBJ( ResetAttr ) }; class SwUndoFmtAttr : public SwUndo @@ -659,8 +642,6 @@ public: virtual void Repeat( SwUndoIter& ); virtual SwRewriter GetRewriter() const; - OUT_UNDOBJ( InsFmtAttr ) - void PutAttr( const SfxPoolItem& rItem ); SwFmt* GetFmt( SwDoc& rDoc ); // checks if it is still in the Doc! }; @@ -757,7 +738,7 @@ public: virtual SwRewriter GetRewriter() const; SwHistory* GetHistory() { return pHistory; } - OUT_UNDOBJ( SetFmtColl ) + }; @@ -775,7 +756,6 @@ public: SwHistory& GetHistory() { return *m_pHistory; } - OUT_UNDOBJ( MoveLeftMargin ) }; // Basis-Klasse fuer Insert von Dokument, Glossaries und Kopieren @@ -801,21 +781,18 @@ public: // setze den Destination-Bereich nach dem Einlesen. void SetInsertRange( const SwPaM&, BOOL bScanFlys = TRUE, BOOL bSttWasTxtNd = TRUE ); - OUT_UNDOBJ( Inserts ) }; class SwUndoInsDoc : public SwUndoInserts { public: SwUndoInsDoc( const SwPaM& ); - OUT_UNDOBJ( InsDoc ) }; class SwUndoCpyDoc : public SwUndoInserts { public: SwUndoCpyDoc( const SwPaM& ); - OUT_UNDOBJ( Copy ) }; class SwUndoInsTbl : public SwUndo @@ -842,7 +819,6 @@ public: virtual SwRewriter GetRewriter() const; - OUT_UNDOBJ( InsTable ) }; class SwUndoTxtToTbl : public SwUndo, public SwUndRng @@ -867,7 +843,6 @@ public: SwHistory& GetHistory(); // wird ggfs. angelegt void AddFillBox( const SwTableBox& rBox ); - OUT_UNDOBJ( TextToTable ) }; class SwUndoTblToTxt : public SwUndo @@ -893,7 +868,6 @@ public: void SetRange( const SwNodeRange& ); void AddBoxPos( SwDoc& rDoc, ULONG nNdIdx, ULONG nEndIdx, xub_StrLen nCntntIdx = STRING_MAXLEN); - OUT_UNDOBJ( TableToText ) }; class SwUndoAttrTbl : public SwUndo @@ -906,7 +880,6 @@ public: virtual ~SwUndoAttrTbl(); virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); - OUT_UNDOBJ( SetTableAttr ) }; class SwUndoTblAutoFmt : public SwUndo @@ -924,7 +897,6 @@ public: virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); void SaveBoxCntnt( const SwTableBox& rBox ); - OUT_UNDOBJ( TableAutoFmt ) }; class SwUndoTblNdsChg : public SwUndo @@ -974,7 +946,6 @@ public: nRelDiff = (USHORT)nRelDif; } - OUT_UNDOBJ( TblNodesChg ) }; class SwUndoTblMerge : public SwUndo, private SwUndRng @@ -1000,7 +971,6 @@ public: void SaveCollection( const SwTableBox& rBox ); - OUT_UNDOBJ( TblMerge ) }; @@ -1028,7 +998,6 @@ public: void SetNumFmt( ULONG nNewNumFmtIdx, const double& rNewNumber ) { nFmtIdx = nNewNumFmtIdx; fNum = rNewNumber; } void SetBox( const SwTableBox& rBox ); - OUT_UNDOBJ( TblNumFmt ) }; class _UndoTblCpyTbl_Entries; @@ -1053,7 +1022,6 @@ public: BOOL IsEmpty() const; BOOL InsertRow( SwTable& rTbl, const SwSelBoxes& rBoxes, USHORT nCnt ); - OUT_UNDOBJ( TblCpyTbl ) }; class SwUndoCpyTbl : public SwUndo @@ -1067,7 +1035,6 @@ public: virtual void Redo( SwUndoIter& ); void SetTableSttIdx( ULONG nIdx ) { nTblNode = nIdx; } - OUT_UNDOBJ( CpyTbl ) }; class SwUndoSplitTbl : public SwUndo @@ -1146,7 +1113,6 @@ public: SwUndoDelBookmark( const ::sw::mark::IMark& ); virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); - OUT_UNDOBJ( DelBookmark ) }; class SwUndoInsBookmark : public SwUndoBookmark @@ -1155,7 +1121,6 @@ public: SwUndoInsBookmark( const ::sw::mark::IMark& ); virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); - OUT_UNDOBJ( InsBookmark ) }; @@ -1214,7 +1179,6 @@ public: void Insert( const String& rOrgPos, const String& rNewPos ); void Insert( ULONG nOrgPos, ULONG nNewPos ); - OUT_UNDOBJ( Sort ) }; @@ -1244,7 +1208,6 @@ public: virtual void Undo( SwUndoIter& ) = 0; virtual void Redo( SwUndoIter& ) = 0; - OUT_UNDOBJ( FlyBase ) }; class SwUndoInsLayFmt : public SwUndoFlyBase @@ -1261,7 +1224,6 @@ public: String GetComment() const; - OUT_UNDOBJ( InsLayFmt ) }; class SwUndoDelLayFmt : public SwUndoFlyBase @@ -1278,7 +1240,6 @@ public: virtual SwRewriter GetRewriter() const; - OUT_UNDOBJ( DelLayFmt ) }; @@ -1355,7 +1316,6 @@ public: BOOL IsFull() const { return ((USHRT_MAX / sizeof( void* )) - 50 ) < aArr.Count(); } - OUT_UNDOBJ( Replace ) }; @@ -1372,7 +1332,6 @@ public: virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); virtual void Repeat( SwUndoIter& ); - OUT_UNDOBJ( SwUndoTblHeadline ) }; @@ -1380,57 +1339,36 @@ public: class SwUndoInsSection : public SwUndo, private SwUndRng { - SwHistory* pHistory; - SwSection* pSection; - SwRedlineData* pRedlData; - SfxItemSet* pAttr; - ULONG nSectNodePos; - BOOL bSplitAtStt : 1; - BOOL bSplitAtEnd : 1; - BOOL bUpdateFtn : 1; +private: + const ::std::auto_ptr<SwSectionData> m_pSectionData; + const ::std::auto_ptr<SwTOXBase> m_pTOXBase; /// set iff section is TOX + const ::std::auto_ptr<SfxItemSet> m_pAttrSet; + ::std::auto_ptr<SwHistory> m_pHistory; + ::std::auto_ptr<SwRedlineData> m_pRedlData; + ULONG m_nSectionNodePos; + bool m_bSplitAtStart : 1; + bool m_bSplitAtEnd : 1; + bool m_bUpdateFtn : 1; void Join( SwDoc& rDoc, ULONG nNode ); public: - SwUndoInsSection( const SwPaM&, const SwSection&, - const SfxItemSet* pSet ); + SwUndoInsSection(SwPaM const&, SwSectionData const&, + SfxItemSet const*const pSet, SwTOXBase const*const pTOXBase); virtual ~SwUndoInsSection(); virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); virtual void Repeat( SwUndoIter& ); - OUT_UNDOBJ( SwUndoInsSection ) - void SetSectNdPos( ULONG nPos ) { nSectNodePos = nPos; } - void SaveSplitNode( SwTxtNode* pTxtNd, BOOL bAtStt ); - void SetUpdtFtnFlag( BOOL bFlag ) { bUpdateFtn = bFlag; } + void SetSectNdPos(ULONG const nPos) { m_nSectionNodePos = nPos; } + void SaveSplitNode(SwTxtNode *const pTxtNd, bool const bAtStart); + void SetUpdtFtnFlag(bool const bFlag) { m_bUpdateFtn = bFlag; } }; -class SwUndoDelSection : public SwUndo -{ - ULONG nSttNd, nEndNd; - SwSection* pSection; - SfxItemSet* pAttr; -public: - SwUndoDelSection( const SwSectionFmt& ); - virtual ~SwUndoDelSection(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - OUT_UNDOBJ( SwUndoDelSection ) -}; +SW_DLLPRIVATE SwUndo * MakeUndoDelSection(SwSectionFmt const&); + +SW_DLLPRIVATE SwUndo * MakeUndoUpdateSection(SwSectionFmt const&, bool const); -class SwUndoChgSection : public SwUndo -{ - ULONG nSttNd; - SwSection* pSection; - SfxItemSet* pAttr; - BOOL bOnlyAttrChgd; -public: - SwUndoChgSection( const SwSectionFmt&, BOOL bOnlyAttrChgd ); - virtual ~SwUndoChgSection(); - virtual void Undo( SwUndoIter& ); - virtual void Redo( SwUndoIter& ); - OUT_UNDOBJ( SwUndoChgSection ) -}; //------------ Undo von verschieben/stufen von Gliederung ---------------- @@ -1442,7 +1380,6 @@ public: virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); virtual void Repeat( SwUndoIter& ); - OUT_UNDOBJ( SwUndoOutlineLeftRight ) }; //-------------------------------------------------------------------- @@ -1458,7 +1395,6 @@ public: virtual ~SwUndoDefaultAttr(); virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); - OUT_UNDOBJ( DefaultAttr ) }; //-------------------------------------------------------------------- @@ -1490,7 +1426,6 @@ public: void SetLRSpaceEndPos(); - OUT_UNDOBJ( InsNum ) }; class SwUndoDelNum : public SwUndo, private SwUndRng @@ -1509,7 +1444,6 @@ public: void AddNode( const SwTxtNode& rNd, BOOL bResetLRSpace ); SwHistory* GetHistory() { return pHistory; } - OUT_UNDOBJ( DelNum ) }; class SwUndoMoveNum : public SwUndo, private SwUndRng @@ -1522,7 +1456,6 @@ public: virtual void Redo( SwUndoIter& ); virtual void Repeat( SwUndoIter& ); void SetStartNode( ULONG nValue ) { nNewStt = nValue; } - OUT_UNDOBJ( MoveNum ) }; class SwUndoNumUpDown : public SwUndo, private SwUndRng @@ -1533,7 +1466,6 @@ public: virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); virtual void Repeat( SwUndoIter& ); - OUT_UNDOBJ( NumUpDown ) }; class SwUndoNumOrNoNum : public SwUndo @@ -1547,7 +1479,6 @@ public: virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); virtual void Repeat( SwUndoIter& ); - OUT_UNDOBJ( NumOrNoNum ) }; class SwUndoNumRuleStart : public SwUndo @@ -1562,7 +1493,6 @@ public: virtual void Undo( SwUndoIter& ); virtual void Redo( SwUndoIter& ); virtual void Repeat( SwUndoIter& ); - OUT_UNDOBJ( NumRuleStart ) }; //-------------------------------------------------------------------- diff --git a/sw/inc/unocrsrhelper.hxx b/sw/inc/unocrsrhelper.hxx index 5af5df2e51..d163a11055 100644 --- a/sw/inc/unocrsrhelper.hxx +++ b/sw/inc/unocrsrhelper.hxx @@ -55,6 +55,9 @@ namespace com{ namespace sun{ namespace star{ namespace beans{ struct PropertyValue; } + namespace text { + class XTextContent; + } }}} /* -----------------03.12.98 12:16------------------- @@ -84,6 +87,10 @@ namespace SwUnoCursorHelper bool FillValue( USHORT nWhichId, USHORT nMemberId, const com::sun::star::uno::Any*& pAny ); }; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > + GetNestedTextContent(SwTxtNode & rTextNode, xub_StrLen const nIndex, + bool const bParent); + sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry , SwPaM& rPam , com::sun::star::uno::Any *pAny diff --git a/sw/inc/unoflatpara.hxx b/sw/inc/unoflatpara.hxx index 70cbf8b334..65877e6679 100644 --- a/sw/inc/unoflatpara.hxx +++ b/sw/inc/unoflatpara.hxx @@ -29,6 +29,7 @@ #define _UNOFLATPARA_HXX #include <cppuhelper/implbase1.hxx> +#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/text/XFlatParagraph.hpp> #include <com/sun/star/text/XFlatParagraphIterator.hpp> #include <calbck.hxx> @@ -51,9 +52,10 @@ class SwDoc; ******************************************************************************/ class SwXFlatParagraph: - public ::cppu::WeakImplHelper1 + public ::cppu::WeakImplHelper2 < - css::text::XFlatParagraph + css::text::XFlatParagraph, + css::lang::XUnoTunnel >, public SwXTextMarkup { @@ -85,6 +87,12 @@ public: const SwTxtNode* getTxtNode() const; + static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId(); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 >& rId) + throw (css::uno::RuntimeException); + private: SwXFlatParagraph( const SwXFlatParagraph & ); // not defined SwXFlatParagraph & operator = ( const SwXFlatParagraph & ); // not defined diff --git a/sw/inc/unoidx.hxx b/sw/inc/unoidx.hxx index a4feb762f5..cf22cce14e 100644 --- a/sw/inc/unoidx.hxx +++ b/sw/inc/unoidx.hxx @@ -36,6 +36,8 @@ #include <cppuhelper/implbase4.hxx> #include <cppuhelper/implbase5.hxx> +#include <sfx2/Metadatable.hxx> + #include <unocoll.hxx> #include <toxe.hxx> @@ -48,8 +50,9 @@ class SwTOXType; * * --------------------------------------------------*/ -typedef ::cppu::WeakImplHelper5 -< ::com::sun::star::lang::XUnoTunnel +typedef ::cppu::ImplInheritanceHelper5 +< ::sfx2::MetadatableMixin +, ::com::sun::star::lang::XUnoTunnel , ::com::sun::star::lang::XServiceInfo , ::com::sun::star::beans::XPropertySet , ::com::sun::star::container::XNamed @@ -81,6 +84,11 @@ public: ::com::sun::star::text::XDocumentIndex> CreateXDocumentIndex(SwDoc & rDoc, SwTOXBaseSection const& rSection); + // MetadatableMixin + virtual ::sfx2::Metadatable* GetCoreObject(); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > + GetModel(); + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); // XUnoTunnel diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 85e1c9728b..374753ba22 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -805,9 +805,8 @@ enum SwPropNameIds /* 0737 */ UNO_NAME_DESCRIPTION, // <-- /* 0738 */ UNO_NAME_META, // #i91565# -/* 0739 */ UNO_NAME_IS_TEMPLATE, -/* 0740 */ UNO_NAME_VBA_DOCOBJ, -/* 0741 */ SW_PROPNAME_END +/* 0739 */ UNO_NAME_NESTED_TEXT_CONTENT, // #i109601# +/* 0740 */ SW_PROPNAME_END }; diff --git a/sw/inc/unosection.hxx b/sw/inc/unosection.hxx index 849aafdf6b..cba4831a4f 100644 --- a/sw/inc/unosection.hxx +++ b/sw/inc/unosection.hxx @@ -39,6 +39,8 @@ #include <cppuhelper/implbase7.hxx> +#include <sfx2/Metadatable.hxx> + #include <unobaseclass.hxx> @@ -52,8 +54,9 @@ class SwSectionFmt; struct SwTextSectionProperties_Impl; -typedef ::cppu::WeakImplHelper7 -< ::com::sun::star::lang::XUnoTunnel +typedef ::cppu::ImplInheritanceHelper7 +< ::sfx2::MetadatableMixin +, ::com::sun::star::lang::XUnoTunnel , ::com::sun::star::lang::XServiceInfo , ::com::sun::star::beans::XPropertySet , ::com::sun::star::beans::XPropertyState @@ -84,6 +87,11 @@ public: CreateXTextSection(SwSectionFmt *const pFmt = 0, const bool bIndexHeader = false); + // MetadatableMixin + virtual ::sfx2::Metadatable* GetCoreObject(); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > + GetModel(); + static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); // XUnoTunnel diff --git a/sw/inc/unotextmarkup.hxx b/sw/inc/unotextmarkup.hxx index 33c497e79e..98bb3416d3 100644 --- a/sw/inc/unotextmarkup.hxx +++ b/sw/inc/unotextmarkup.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,7 +42,6 @@ namespace com { namespace sun { namespace star { namespace container { } } } } class SwTxtNode; -class SwWrongList; class SfxPoolItem; /** Implementation of the css::text::XTextMarkup interface diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index 823e81f1ae..1a43f3307a 100644..100755 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -41,7 +41,7 @@ class ViewShell; class SwDocShell; namespace svtools{ class ColorConfig;} -#define VIEWOPT_1_IDLE 0x00000001L +//#define VIEWOPT_1_IDLE 0x00000001L no longer used, see new member 'bIdle' #define VIEWOPT_1_TAB 0x00000002L #define VIEWOPT_1_BLANK 0x00000004L #define VIEWOPT_1_HARDBLANK 0x00000008L @@ -164,6 +164,7 @@ protected: BOOL bBookview : 1; // view mode for page preview BOOL mbViewLayoutBookMode : 1; // book view mode for edit view sal_Bool bShowPlaceHolderFields : 1; //only used in printing! + mutable bool bIdle; // Maszstab USHORT nZoom; // Angaben in Prozent @@ -202,9 +203,14 @@ public: ----------------------------------------------------------------------------*/ inline BOOL IsIdle() const - { return nCoreOptions & VIEWOPT_1_IDLE ? TRUE : FALSE; } - inline void SetIdle( BOOL b ) - { (b != 0) ? (nCoreOptions |= VIEWOPT_1_IDLE ) : ( nCoreOptions &= ~VIEWOPT_1_IDLE); } + { return bIdle; } + + // logically this is a const function since it does not modify the viewoptions + // but only effects idle formatting. Of course that member is already implement + // in the wrong place here... Also currently there are many const modifying casts in the code + // just to call this function on otherwise const objects. Thus declaring it as const now. + inline void SetIdle( BOOL b ) const + { bIdle = b; } inline BOOL IsTab(BOOL bHard = FALSE) const { return !bReadonly && (nCoreOptions & VIEWOPT_1_TAB) && diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 4ed3eab196..0744eb53ee 100755 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -77,19 +77,15 @@ struct ShellResource; class SwRegionRects; class SwFrm; class SvtAccessibilityOptions; -// OD 12.12.2002 #103492# class SwPagePreviewLayout; -// --> OD 2005-12-01 #i27138# class SwTxtFrm; -// <-- class BitmapEx; struct SwAccessibilityOptions; class Region; class SwPostItMgr; - -// #i74769# class SdrPaintWindow; +class SwAccessibleMap; namespace vcl { @@ -264,7 +260,7 @@ public: sal_Bool SmoothScroll( long lXDiff, long lYDiff, const Rectangle* );//Browser void EnableSmooth( sal_Bool b ) { bEnableSmooth = b; } - const SwRect &VisArea() const { return aVisArea; } + const SwRect& VisArea() const { return aVisArea; } //Es wird, wenn notwendig, soweit gescrollt, dass das //uebergebene Rect im sichtbaren Ausschnitt liegt. void MakeVisible( const SwRect & ); @@ -557,9 +553,11 @@ public: */ void InvalidateAccessibleParaTextSelection(); - /** invalidate attributes for paragraphs + /** invalidate attributes for paragraphs and paragraph's characters OD 2009-01-06 #i88069# + OD 2010-02-16 #i104008# - usage also for changes of the attributes of + paragraph's characters. @author OD @@ -568,6 +566,8 @@ public: */ void InvalidateAccessibleParaAttrs( const SwTxtFrm& rTxtFrm ); + SwAccessibleMap* GetAccessibleMap(); + ViewShell( ViewShell&, Window *pWin = 0, OutputDevice *pOut = 0, long nFlags = 0 ); ViewShell( SwDoc& rDoc, Window *pWin, |