diff options
author | Oliver Bolte <obo@openoffice.org> | 2009-02-13 14:09:50 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2009-02-13 14:09:50 +0000 |
commit | 77425ec2efd55198a2a5a0326eb8876d093e028d (patch) | |
tree | 91fdb1690b11fa0298fd1cc7f9d7a4d5e8e400ec | |
parent | e9b345a8adcd96ed9d217457a5938f1421becce2 (diff) |
CWS-TOOLING: integrate CWS notes8
2009-01-23 17:44:41 +0100 mba r266842 : #i98275#: start speller before setting text
2009-01-23 10:19:47 +0100 mod r266776 : minor cleanup
2009-01-22 16:45:38 +0100 mod r266742 : no looping through notes while saving
2009-01-22 16:40:55 +0100 mod r266741 : #i98055#
2009-01-22 15:56:27 +0100 os r266731 : #98358# dummy strings now hidden
2009-01-22 09:31:16 +0100 mod r266713 : correct hiding and layout order
2009-01-22 09:21:23 +0100 mod r266712 : need a speller
2009-01-21 17:21:33 +0100 mod r266691 : notes config
2009-01-21 17:18:23 +0100 mod r266690 : fix for editing states
2009-01-21 17:18:14 +0100 mod r266689 : fix for editing states
2009-01-20 14:15:16 +0100 mod r266578 : undo fix, mba will fix it by importing the props
2009-01-20 00:36:01 +0100 mod r266537 : do not show ankor of top reply note if we are still inside a note inside the same stack
2009-01-20 00:33:48 +0100 mod r266536 : fix typo which does not need to be translated
2009-01-20 00:17:19 +0100 mod r266535 : correct replacment of reply text
2009-01-19 23:36:12 +0100 mod r266534 : #i97693#
2009-01-19 23:32:26 +0100 mod r266533 : #i97380#
2009-01-19 23:30:05 +0100 mod r266532 : #i97380#
2009-01-19 23:21:35 +0100 mod r266531 : #i97299#
-rw-r--r-- | starmath/source/commands.src | 2 | ||||
-rw-r--r-- | sw/inc/PostItMgr.hxx | 56 | ||||
-rw-r--r-- | sw/inc/postit.hxx | 10 | ||||
-rw-r--r-- | sw/source/core/doc/doclay.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/dialog/SwSpellDialogChildWindow.cxx | 1 | ||||
-rw-r--r-- | sw/source/ui/docvw/PostItMgr.cxx | 211 | ||||
-rw-r--r-- | sw/source/ui/docvw/postit.cxx | 69 | ||||
-rw-r--r-- | sw/source/ui/inc/swmn_tmpl.hrc | 3 | ||||
-rwxr-xr-x | sw/source/ui/shells/annotsh.cxx | 9 | ||||
-rw-r--r-- | sw/source/ui/uiview/view0.cxx | 6 |
10 files changed, 186 insertions, 187 deletions
diff --git a/starmath/source/commands.src b/starmath/source/commands.src index f4b9326fe0..d9f8d61c15 100644 --- a/starmath/source/commands.src +++ b/starmath/source/commands.src @@ -1187,7 +1187,7 @@ Menu RID_COMMANDMENU { Identifier = RID_SLRPARENTX; HelpId = HID_SMA_SLRPARENTX; - Text = "left ( x rigth )"; + Text = "left ( x right )"; }; MenuItem { diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index 726346f47f..d2e26cb908 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -39,7 +39,7 @@ #include <tools/string.hxx> #include <tools/link.hxx> #include <swrect.hxx> - +#include <unotools/configitem.hxx> #include <com/sun/star/util/SearchOptions.hpp> class SwWrtShell; @@ -66,6 +66,11 @@ class SwMarginItem; #define COL_NOTES_SIDEPANE_ARROW_DISABLED RGB_COLORDATA(172,168,153) typedef std::list<SwMarginItem*> SwMarginItem_list; +typedef std::list<SwMarginItem*>::iterator SwMarginItem_iterator; + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using ::rtl::OUString; struct SwPostItPageItem { @@ -96,7 +101,43 @@ struct FieldShadowState } }; -typedef std::list<SwMarginItem*>::iterator SwMarginItem_iterator; +class SwNoteProps: public utl::ConfigItem +{ + private: + bool bIsShowAnkor; + public: + SwNoteProps() : ConfigItem(::rtl::OUString::createFromAscii("Office.Writer/Notes")), bIsShowAnkor(false) + { + const Sequence<OUString>& rNames = GetPropertyNames(); + Sequence<Any> aValues = GetProperties(rNames); + const Any* pValues = aValues.getConstArray(); + DBG_ASSERT(aValues.getLength() == rNames.getLength(), "GetProperties failed"); + if (aValues.getLength()) + pValues[0]>>=bIsShowAnkor; + } + + bool IsShowAnkor() + { + return bIsShowAnkor; + } + Sequence<OUString>& GetPropertyNames() + { + static Sequence<OUString> aNames; + if(!aNames.getLength()) + { + static const char* aPropNames[] = + { + "ShowAnkor" + }; + const int nCount = sizeof(aPropNames)/sizeof(const char*); + aNames.realloc(nCount); + OUString* pNames = aNames.getArray(); + for(int i = 0; i < nCount; i++) + pNames[i] = OUString::createFromAscii(aPropNames[i]); + } + return aNames; + } +}; class SwPostItMgr: public SfxListener { @@ -116,6 +157,7 @@ class SwPostItMgr: public SfxListener bool mbDeleteNote; FieldShadowState mShadowState; OutlinerParaObject* mpAnswer; + bool mpIsShowAnkor; typedef std::list<SwMarginWin*>::iterator SwMarginWin_iterator; @@ -128,9 +170,9 @@ class SwPostItMgr: public SfxListener bool ScrollbarHit(const unsigned long aPage,const Point &aPoint); bool LayoutByPage(std::list<SwMarginWin*> &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; + 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; @@ -161,6 +203,7 @@ class SwPostItMgr: public SfxListener bool ShowScrollbar(const unsigned long aPage) const; bool HasNotes() const ; bool ShowNotes() const; + bool IsShowAnkor() { return mpIsShowAnkor;} unsigned long GetSidebarWidth(bool bPx = false) const; unsigned long GetSidebarBorderWidth(bool bPx = false) const; unsigned long GetNoteWidth(); @@ -212,9 +255,10 @@ class SwPostItMgr: public SfxListener void RegisterAnswer(OutlinerParaObject* pAnswer) { mpAnswer = pAnswer;} OutlinerParaObject* IsAnswer() {return mpAnswer;} + void CheckMetaText(); + void StartSpelling(); sal_uInt16 Replace(SvxSearchItem* pItem); - void StartSearchAndReplace(const SvxSearchItem& rSearchItem); 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); }; diff --git a/sw/inc/postit.hxx b/sw/inc/postit.hxx index 82d5b008ea..186b7ecb29 100644 --- a/sw/inc/postit.hxx +++ b/sw/inc/postit.hxx @@ -63,7 +63,7 @@ class OutlinerParaObject; #define ANKORLINE_WIDTH 1 -enum AnkorState {AS_ALL, AS_START, AS_END}; +enum AnkorState {AS_ALL, AS_START, AS_END,AS_TRI}; class SwPostItAnkor: public sdr::overlay::OverlayObjectWithBasePosition { @@ -244,7 +244,6 @@ class SwMarginWin : public Window PopupMenu* mpButtonPopup; bool mbIsFollow; Rectangle mRectMetaButton; - virtual void CheckMetaText(); virtual void DataChanged( const DataChangedEvent& aEvent); virtual void LoseFocus(); virtual void MouseButtonDown( const MouseEvent& rMEvt ); @@ -252,7 +251,6 @@ class SwMarginWin : public Window virtual void Paint( const Rectangle& rRect); virtual void GetFocus(); - void SetPosAndSize(); void SetSizePixel( const Size& rNewSize ); DECL_LINK(ModifyHdl, void*); @@ -265,9 +263,11 @@ class SwMarginWin : public Window virtual ~SwMarginWin(); void SetSize( const Size& rNewSize ); - void SetPosSizePixelRect( long nX, long nY,long nWidth, long nHeight,const SwRect &aRect,const long PageBorder); + 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;} diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index b50d207a54..0093812a32 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -104,10 +104,8 @@ #include <ftnidx.hxx> #include <ftninfo.hxx> #include <pagedesc.hxx> - -#ifndef _COMCORE_HRC +#include <PostItMgr.hxx> #include <comcore.hrc> // STR-ResId's -#endif // #i11176# #include <unoframe.hxx> @@ -1864,7 +1862,7 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer ) if (bIsOnlineSpell && bIsAutoGrammar) StartGrammarChecking( *this, *GetRootFrm() ); } - + sal_uInt16 nFldUpdFlag; if( GetRootFrm()->IsIdleFormat() ) GetRootFrm()->GetCurrShell()->LayoutIdle(); diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx index 20cbc9c759..0a64eb2087 100644 --- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx @@ -204,6 +204,7 @@ SfxChildWinInfo SwSpellDialogChildWindow::GetInfo (void) const /*-- 09.09.2003 10:39:40--------------------------------------------------- + -----------------------------------------------------------------------*/ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void) { diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx index 4dd46501a9..1e5eb8788b 100644 --- a/sw/source/ui/docvw/PostItMgr.cxx +++ b/sw/source/ui/docvw/PostItMgr.cxx @@ -58,6 +58,7 @@ #include <undobj.hxx> #include <tools/color.hxx> +#include <swmodule.hxx> #include <docvw.hrc> #include "cmdid.h" @@ -133,6 +134,12 @@ SwPostItMgr::SwPostItMgr(SwView* pView) if(!mpView->GetDrawView() ) mpView->GetWrtShell().MakeDrawView(); + SwNoteProps aProps; + mpIsShowAnkor = aProps.IsShowAnkor(); + + //make sure we get the colour yellow always, even if not the first one of comments or redlining + SW_MOD()->GetRedlineAuthor(); + // collect all PostIts and redline comments that exist after loading the document // don't check for existance for any of them, don't focus them AddPostIts(false,false); @@ -141,7 +148,7 @@ SwPostItMgr::SwPostItMgr(SwView* pView) */ // we want to receive stuff like SFX_HINT_DOCCHANGED StartListening(*mpView->GetDocShell()); - if (!mvPostItFlds.empty() && ShowNotes()) + if (!mvPostItFlds.empty()) { mbWaitingForCalcRects = true; mnEventId = Application::PostUserEvent( LINK( this, SwPostItMgr, CalcHdl), 0 ); @@ -171,6 +178,8 @@ void SwPostItMgr::CheckForRemovedPostIts() { SwMarginItem* p = (*it); mvPostItFlds.remove(*it); + if (GetActivePostIt() == p->pPostIt) + SetActivePostIt(0); if (p->pPostIt) delete p->pPostIt; delete p; @@ -243,7 +252,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) sal_uInt32 nId = ((SfxEventHint&)rHint).GetEventId(); if ( nId == SW_EVENT_LAYOUT_FINISHED ) { - if ( !mbWaitingForCalcRects && ShowNotes() && !mvPostItFlds.empty()) + if ( !mbWaitingForCalcRects && !mvPostItFlds.empty()) { mbWaitingForCalcRects = true; mnEventId = Application::PostUserEvent( LINK( this, SwPostItMgr, CalcHdl), 0 ); @@ -269,7 +278,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { if ( mpView->GetDocShell() == &rBC ) { - if ( !mbWaitingForCalcRects && ShowNotes() && !mvPostItFlds.empty()) + if ( !mbWaitingForCalcRects && !mvPostItFlds.empty()) { mbWaitingForCalcRects = true; mnEventId = Application::PostUserEvent( LINK( this, SwPostItMgr, CalcHdl), 0 ); @@ -436,9 +445,6 @@ void SwPostItMgr::Focus(SfxBroadcaster& rBC) bool SwPostItMgr::CalcRects() { - if (!ShowNotes()) - return false; - if ( mnEventId ) { // if CalcRects() was forced and an event is still pending: remove it @@ -466,8 +472,7 @@ bool SwPostItMgr::CalcRects() SwRect aOldRect(pItem->mPos); SwPostItHelper::SwLayoutStatus eOldStatus = pItem->mLayoutStatus; std::vector< SwLayoutInfo > aInfo; - //pItem->mLayoutStatus = SwPostItHelper::getLayoutInfos( aInfo, pItem->pFmtFld->GetTxtFld() ); - SwPosition aPosition = pItem->GetPosition(); + SwPosition aPosition = pItem->GetPosition(); pItem->mLayoutStatus = SwPostItHelper::getLayoutInfos( aInfo, aPosition ); if( aInfo.size() ) { @@ -588,8 +593,7 @@ void SwPostItMgr::LayoutPostIts() if ( !mvPostItFlds.empty() && !mbWaitingForCalcRects ) { mbLayouting = true; - if (ShowNotes()) - { + //loop over all pages and do the layout // - create SwPostIt if neccessary // - place SwPostIts on their initial position @@ -631,7 +635,7 @@ void SwPostItMgr::LayoutPostIts() long aPostItHeight = 0; if (!pPostIt) { - pPostIt = (*i)->GetMarginWindow(static_cast<Window*>(&mpView->GetEditWin()),WINDOW_CONTROL,this,0); + pPostIt = (*i)->GetMarginWindow(static_cast<Window*>(&mpView->GetEditWin()),WINDOW_CONTROL|WB_NODIALOGCONTROL,this,0); pPostIt->InitControls(); pPostIt->SetReadonly(mbReadOnly); pItem->pPostIt = pPostIt; @@ -644,7 +648,7 @@ void SwPostItMgr::LayoutPostIts() } } - if (pItem->pPostIt->ISA(SwPostIt)) + if (pItem->pPostIt->ISA(SwPostIt)) { static_cast<SwPostIt*>(pPostIt)->SetChangeTracking(pItem->mLayoutStatus,GetColorAnkor(pItem->mRedlineAuthor)); } @@ -656,7 +660,7 @@ void SwPostItMgr::LayoutPostIts() if (pItem->bFocus) { mbLayout = true; - pPostIt->GrabFocus(); + pPostIt->GrabFocus(); pItem->bFocus = false; } // only the visible postits are used for the final layout @@ -670,10 +674,13 @@ void SwPostItMgr::LayoutPostIts() } } - if (aVisiblePostItList.size()>0) + if ((aVisiblePostItList.size()>0) && ShowNotes()) { bool bOldScrollbar = mPages[n]->bScrollbar; - mPages[n]->bScrollbar = LayoutByPage(aVisiblePostItList, mPages[n]->mPageRect.SVRect(), lNeededHeight); + if (ShowNotes()) + mPages[n]->bScrollbar = LayoutByPage(aVisiblePostItList, mPages[n]->mPageRect.SVRect(), lNeededHeight); + else + mPages[n]->bScrollbar = false; if (!mPages[n]->bScrollbar) { mPages[n]->lOffset = 0; @@ -689,9 +696,9 @@ void SwPostItMgr::LayoutPostIts() bUpdate = (bOldScrollbar != mPages[n]->bScrollbar) || bUpdate; const long aSidebarheight = mPages[n]->bScrollbar ? mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height() : 0; /* - TODO - - enlarge all notes till GetNextBorder(), as we resized to average value before - */ + TODO + - enlarge all notes till GetNextBorder(), as we resized to average value before + */ //lets hide the ones which overlap the page for(SwMarginWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; i++) { @@ -723,16 +730,26 @@ void SwPostItMgr::LayoutPostIts() DBG_ASSERT(mPages[n]->bScrollbar,"SwPostItMgr::LayoutByPage(): note overlaps, but bScrollbar is not true"); } } + // do some magic so we really see the focused note for(SwMarginWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; i++) { - if ((*i)->HasChildPathFocus()) + if ((*i)->HasChildPathFocus()) { MakeVisible((*i),n+1); break; } } } + else + { + for(SwMarginWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; i++) + (*i)->SetPosAndSize(); + + bool bOldScrollbar = mPages[n]->bScrollbar; + mPages[n]->bScrollbar = false; + bUpdate = (bOldScrollbar != mPages[n]->bScrollbar) || bUpdate; + } aVisiblePostItList.clear(); } else @@ -741,39 +758,40 @@ void SwPostItMgr::LayoutPostIts() mPages[n]->bScrollbar = false; } } - - // notes scrollbar is otherwise not drawn correctly for some cases - // scrollbar area is enough - if (bUpdate) - mpEditWin->Invalidate(); - } - else - { // we do not want to see the notes anymore -> Options-Writer-View-Notes - bool bRepair = false; - for(SwMarginItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) - { - SwMarginItem* pItem = (*i); - if ( !pItem->UseElement() ) + + if (!ShowNotes()) + { // we do not want to see the notes anymore -> Options-Writer-View-Notes + bool bRepair = false; + for(SwMarginItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) { - DBG_ERROR("PostIt is not in doc!"); - bRepair = true; - continue; - } - - if ((*i)->pPostIt) - { - (*i)->pPostIt->HideNote(); - if ((*i)->pPostIt->HasChildPathFocus()) + SwMarginItem* pItem = (*i); + if ( !pItem->UseElement() ) + { + DBG_ERROR("PostIt is not in doc!"); + bRepair = true; + continue; + } + + if ((*i)->pPostIt) { - SetActivePostIt(0); - (*i)->pPostIt->GrabFocusToDocument(); + (*i)->pPostIt->HideNote(); + if ((*i)->pPostIt->HasChildPathFocus()) + { + SetActivePostIt(0); + (*i)->pPostIt->GrabFocusToDocument(); + } } } + + if ( bRepair ) + CheckForRemovedPostIts(); } + - if ( bRepair ) - CheckForRemovedPostIts(); - } + // notes scrollbar is otherwise not drawn correctly for some cases + // scrollbar area is enough + if (bUpdate) + mpEditWin->Invalidate(); mbLayouting = false; } } @@ -1148,7 +1166,8 @@ void SwPostItMgr::RemoveMarginWin() for(std::list<SwMarginItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) { EndListening( *((*i)->GetBroadCaster()) ); - delete (*i)->pPostIt; + if ((*i)->pPostIt) + delete (*i)->pPostIt; delete (*i); } mvPostItFlds.clear(); @@ -1841,101 +1860,12 @@ void SwPostItMgr::SetReadOnlyState() (*i)->pPostIt->SetReadonly( mbReadOnly ); } -void SwPostItMgr::StartSearchAndReplace(const SvxSearchItem& rSearchItem) +void SwPostItMgr::CheckMetaText() { - for(std::list<SwMarginItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) - if ( (*i)->pPostIt ) - { - ESelection aOldSelection = (*i)->pPostIt->View()->GetSelection(); - (*i)->pPostIt->View()->SetSelection(ESelection(0,0,0,0)); - if (!(*i)->pPostIt->View()->StartSearchAndReplace( rSearchItem )) - (*i)->pPostIt->View()->SetSelection(aOldSelection); - /* if ((*i)->pPostIt->View()->StartSearchAndReplace( rSearchItem )) - (*i)->pPostIt->GrabFocus(); - return; - */ - } - - /* - 673 BOOL bFromStart, - 674 BOOL bApi, - 675 BOOL bRecursive) - 676 { - 677 ExtTextView* pTextView = aEditWin.GetTextView(); - 678 TextSelection aSel; - 679 TextPaM aPaM; - 680 - 681 BOOL bForward = !rSearchItem.GetBackward(); - 682 BOOL bAtStart = pTextView->GetSelection() == TextSelection( aPaM, aPaM ); - 683 - 684 if( !bForward ) - 685 aPaM = TextPaM( (ULONG)-1, (USHORT)-1 ); - 686 - 687 if( bFromStart ) - 688 { - 689 aSel = pTextView->GetSelection(); - 690 pTextView->SetSelection( TextSelection( aPaM, aPaM )); - 691 } - 692 - 693 SearchOptions aSearchOpt( rSearchItem.GetSearchOptions() ); - 694 aSearchOpt.Locale = SvxCreateLocale( - 695 static_cast< LanguageType >( GetAppLanguage() ) ); - 696 - 697 USHORT nFound; - 698 BOOL bAll = FALSE; - 699 switch( rSearchItem.GetCommand() ) - 700 { - 701 case SVX_SEARCHCMD_FIND: - 702 case SVX_SEARCHCMD_FIND_ALL: - 703 nFound = pTextView->Search( aSearchOpt, bForward ); - 704 break; - 705 - 706 case SVX_SEARCHCMD_REPLACE_ALL: bAll = TRUE; - 707 case SVX_SEARCHCMD_REPLACE: - 708 nFound = pTextView->Replace( aSearchOpt, bAll, bForward ); - 709 break; - 710 - 711 default: - 712 nFound = 0; - 713 } - 714 - 715 if( !nFound ) - 716 { - 717 BOOL bNotFoundMessage = FALSE; - 718 if(!bRecursive) - 719 { - 720 if(!bFromStart) - 721 { - 722 bNotFoundMessage = bAtStart; - 723 } - 724 else - 725 { - 726 bNotFoundMessage = TRUE; - 727 pTextView->SetSelection( aSel ); - 728 } - 729 } - 730 else if(bAtStart) - 731 { - 732 bNotFoundMessage = TRUE; - 733 } - 734 - 735 - 736 if(!bApi) - 737 if(bNotFoundMessage) - 738 { - 739 InfoBox( 0, SW_RES(MSG_NOT_FOUND)).Execute(); - 740 } - 741 else if(!bRecursive && RET_YES == - 742 QueryBox(0, SW_RES( bForward ? MSG_SEARCH_END - 743 : MSG_SEARCH_START)).Execute()) - 744 { - 745 pTextView->SetSelection( TextSelection( aPaM, aPaM ) ); - 746 StartSearchAndReplace( rSearchItem, FALSE, FALSE, TRUE ); - 747 } - 748 } - 749 return nFound; + for(std::list<SwMarginItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + if ( (*i)->pPostIt ) + (*i)->pPostIt->CheckMetaText(); - */ } sal_uInt16 SwPostItMgr::Replace(SvxSearchItem* pItem) @@ -1947,7 +1877,6 @@ sal_uInt16 SwPostItMgr::Replace(SvxSearchItem* pItem) return aResult; } - sal_uInt16 SwPostItMgr::FinishSearchReplace(const ::com::sun::star::util::SearchOptions& rSearchOptions, bool bSrchForward) { SwMarginWin* pWin = GetActivePostIt(); diff --git a/sw/source/ui/docvw/postit.cxx b/sw/source/ui/docvw/postit.cxx index 014c8ee3e2..54b7dfe94d 100644 --- a/sw/source/ui/docvw/postit.cxx +++ b/sw/source/ui/docvw/postit.cxx @@ -720,6 +720,7 @@ void SwMarginWin::ShowAnkorOnly(const Point &aPoint) { mpAnkor->SetSixthPosition(basegfx::B2DPoint(aPoint.X(),aPoint.Y())); mpAnkor->SetSeventhPosition(basegfx::B2DPoint(aPoint.X(),aPoint.Y())); + mpAnkor->SetAnkorState(AS_ALL); mpAnkor->setVisible(true); } if (mpShadow) @@ -729,7 +730,7 @@ void SwMarginWin::ShowAnkorOnly(const Point &aPoint) void SwMarginWin::InitControls() { // actual window which holds the user text - mpPostItTxt = new PostItTxt(this, 0); + mpPostItTxt = new PostItTxt(this, WB_NODIALOGCONTROL); mpPostItTxt->SetPointer(Pointer(POINTER_TEXT)); // window control for author and date @@ -807,9 +808,10 @@ void SwMarginWin::InitControls() CheckMetaText(); SetPopup(); - SetPostItText(); SetLanguage(GetLanguage()); View()->StartSpeller(); + SetPostItText(); + Engine()->CompleteOnlineSpelling(); mpMeta->Show(); mpVScrollbar->Show(); @@ -915,7 +917,8 @@ void SwMarginWin::SetPosAndSize() basegfx::B2DPoint( aLineStart.X(),aLineStart.Y()), basegfx::B2DPoint( aLineEnd.X(),aLineEnd.Y()) , mColorAnkor,LineInfo(LINE_DASH,ANKORLINE_WIDTH*15), false); mpAnkor->SetHeight(mAnkorRect.Height()); - mpAnkor->setVisible(false); + mpAnkor->setVisible(true); + mpAnkor->SetAnkorState(AS_TRI); if (HasChildPathFocus()) mpAnkor->SetLineInfo(LineInfo(LINE_SOLID,ANKORLINE_WIDTH*15)); pOverlayManager->add(*mpAnkor); @@ -938,16 +941,20 @@ void SwMarginWin::SetPosAndSize() Point aEnd = EditWin()->PixelToLogic(GetPosPixel()+Point(GetSizePixel().Width()-1,GetSizePixel().Height())); mpShadow->SetPosition(basegfx::B2DPoint(aStart.X(),aStart.Y()), basegfx::B2DPoint(aEnd.X(),aEnd.Y())); } - if (IsFollow() && !HasChildPathFocus()) - { - mpAnkor->SetAnkorState(AS_END); - } - else + + if (mpMgr->ShowNotes()) { - mpAnkor->SetAnkorState(AS_ALL); - SwMarginWin* pWin = GetTopReplyNote(); - if (IsFollow() && pWin ) - pWin->Ankor()->SetAnkorState(AS_END); + if (IsFollow() && !HasChildPathFocus()) + { + mpAnkor->SetAnkorState(AS_END); + } + else + { + mpAnkor->SetAnkorState(AS_ALL); + SwMarginWin* pWin = GetTopReplyNote(); + if (IsFollow() && pWin ) + pWin->Ankor()->SetAnkorState(AS_END); + } } } @@ -1187,8 +1194,13 @@ void SwMarginWin::HideNote() { if (IsVisible()) Window::Hide(); - if (mpAnkor && mpAnkor->isVisible()) - mpAnkor->setVisible(false); + if (mpAnkor) + { + if (mpMgr->IsShowAnkor()) + mpAnkor->SetAnkorState(AS_TRI); + else + mpAnkor->setVisible(false); + } if (mpShadow && mpShadow->isVisible()) mpShadow->setVisible(false); } @@ -1504,9 +1516,14 @@ void SwMarginWin::SetViewState(ShadowState bState) // if there is no visible parent note, we want to see the complete anchor ?? //if (IsAnyStackParentVisible()) mpAnkor->SetAnkorState(AS_END); - SwMarginWin* pWin = GetTopReplyNote(); - if (pWin) - pWin->Ankor()->SetAnkorState(AS_ALL); + SwMarginWin* pTopWinSelf = GetTopReplyNote(); + SwMarginWin* pTopWinActive = mpMgr->GetActivePostIt() ? mpMgr->GetActivePostIt()->GetTopReplyNote() : 0; + if (pTopWinSelf && (pTopWinSelf!=pTopWinActive)) + { + if (pTopWinSelf!=mpMgr->GetActivePostIt()) + pTopWinSelf->Ankor()->SetLineInfo(LineInfo(LINE_DASH,ANKORLINE_WIDTH*15)); + pTopWinSelf->Ankor()->SetAnkorState(AS_ALL); + } } mpAnkor->SetLineInfo(LineInfo(LINE_DASH,ANKORLINE_WIDTH*15)); } @@ -1546,10 +1563,6 @@ SwMarginWin* SwMarginWin::GetTopReplyNote() return pTopNote; } -void SwMarginWin::SetPostItText() -{ -} - void SwMarginWin::SwitchToFieldPos() { if ( Mgr()->GetActivePostIt() == this ) @@ -1768,8 +1781,11 @@ void SwPostIt::InitAnswer(OutlinerParaObject* pText) //collect our old meta data SwMarginWin* pWin = Mgr()->GetNextPostIt(KEY_PAGEUP, this); const LocaleDataWrapper& rLocalData = SvtSysLocale().GetLocaleData(); - String aText = String((SW_RES(STR_REPLY))); - aText.Append(String(pWin->GetAuthor() + rtl::OUString::createFromAscii(" (") + + String aText = String(SW_RES(STR_REPLY)); + SwRewriter aRewriter; + aRewriter.AddRule(UNDO_ARG1, pWin->GetAuthor()); + aText = aRewriter.Apply(aText); + aText.Append(String(rtl::OUString::createFromAscii(" (") + String(rLocalData.getDate( pWin->GetDate())) + rtl::OUString::createFromAscii(", ") + String(rLocalData.getTime( pWin->GetTime(),false)) + rtl::OUString::createFromAscii("): \""))); View()->InsertText(aText,false); @@ -2105,6 +2121,13 @@ void SwPostItAnkor::implDrawGeometry(OutputDevice& rOutputDevice, Color aColor, switch (mAnkorState) { + case AS_TRI: + { + rOutputDevice.SetLineColor(); + rOutputDevice.SetFillColor(aColor); + rOutputDevice.DrawPolygon(Polygon(aTri)); + break; + } case AS_ALL: { rOutputDevice.SetLineColor(); diff --git a/sw/source/ui/inc/swmn_tmpl.hrc b/sw/source/ui/inc/swmn_tmpl.hrc index 248ddd8478..f7753db76e 100644 --- a/sw/source/ui/inc/swmn_tmpl.hrc +++ b/sw/source/ui/inc/swmn_tmpl.hrc @@ -242,7 +242,8 @@ location: <project>/uiconfig/[swriter|sweb|sglobal]/menubar/menubar.xml Identifier = FN_REDLINE_REJECT_DIRECT ; \ HelpID = FN_REDLINE_REJECT_DIRECT ; \ Text [ en-US ] = "Reject Change" ; \ - }; + }; \ + SEPARATOR ; #define _MN_EDIT_BIB_ENTRY_DLG \ MenuItem \ { \ diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx index b2c8846429..2b4e3457c6 100755 --- a/sw/source/ui/shells/annotsh.cxx +++ b/sw/source/ui/shells/annotsh.cxx @@ -1092,11 +1092,12 @@ void SwAnnotationShell::GetNoteState(SfxItemSet &rSet) break; } - if ( (pPostItMgr->GetActivePostIt()->IsProtected()) && - //if ( (pPostItMgr->GetActivePostIt()->GetStatus()==SwPostItHelper::DELETED) && - ( (nSlotId==FN_DELETE_NOTE) || (nSlotId==FN_REPLY) ) ) + if (pPostItMgr->GetActivePostIt()) + { + if ( (pPostItMgr->GetActivePostIt()->IsProtected()) && + ( (nSlotId==FN_DELETE_NOTE) || (nSlotId==FN_REPLY) ) ) rSet.DisableItem( nWhich ); - + } nWhich = aIter.NextWhich(); } } diff --git a/sw/source/ui/uiview/view0.cxx b/sw/source/ui/uiview/view0.cxx index bda4cefac5..b0cb318924 100644 --- a/sw/source/ui/uiview/view0.cxx +++ b/sw/source/ui/uiview/view0.cxx @@ -399,13 +399,15 @@ void SwView::ExecViewOptions(SfxRequest &rReq) pOpt->SetCrossHair( bFlag ); break; - case FN_VIEW_NOTES: + case FN_VIEW_NOTES: if ( STATE_TOGGLE == eState ) bFlag = !pOpt->IsPostIts(); GetPostItMgr()->SetLayout(); pOpt->SetPostIts( bFlag ); - break; + if (pOpt->IsPostIts()) + GetPostItMgr()->CheckMetaText(); + break; case FN_VIEW_HIDDEN_PARA: if ( STATE_TOGGLE == eState ) |