diff options
author | Kurt Zenker <kz@openoffice.org> | 2009-09-11 10:21:51 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2009-09-11 10:21:51 +0000 |
commit | 5f4f7fb1531ed52fa9cda9be690ecca162c3fb19 (patch) | |
tree | 38e926e827df018a94479fc5ded7bdd69aa97acc | |
parent | df78782330c6cd207d0a0768275fc8bee3caced0 (diff) |
CWS-TOOLING: integrate CWS notes10
2009-08-24 07:25:57 +0200 mod r275287 : 2009-07-26 02:38:32 +0200 mod r274343 : #i#i103645#
2009-07-26 02:01:53 +0200 mod r274342 : #i103645#
2009-07-26 01:52:42 +0200 mod r274341 : #i103490#
2009-07-22 08:31:48 +0200 mod r274215 : #i103373#
2009-07-15 00:55:11 +0200 mod r273987 : #i101419#
2009-07-14 07:07:55 +0200 mod r273956 : #i101419#
2009-07-14 07:07:43 +0200 mod r273955 : #i101419#
2009-07-14 07:02:10 +0200 mod r273954 : changes from notes9
2009-07-14 06:14:25 +0200 mod r273953 : #i103476#
-rw-r--r-- | sw/inc/PostItMgr.hxx | 15 | ||||
-rw-r--r-- | sw/inc/fmtfld.hxx | 6 | ||||
-rw-r--r-- | sw/inc/postit.hxx | 10 | ||||
-rw-r--r-- | sw/inc/redline.hxx | 8 | ||||
-rw-r--r-- | sw/source/core/fields/postithelper.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/view/vprint.cxx | 7 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/docvw/PostItMgr.cxx | 65 | ||||
-rw-r--r-- | sw/source/ui/docvw/postit.cxx | 156 | ||||
-rw-r--r-- | sw/source/ui/misc/redlndlg.src | 2 | ||||
-rwxr-xr-x | sw/source/ui/shells/annotsh.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/shells/drwtxtsh.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/shells/shells.src | 6 | ||||
-rw-r--r-- | sw/source/ui/shells/textfld.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/utlui/content.cxx | 15 | ||||
-rw-r--r-- | sw/source/ui/wrtsh/select.cxx | 1 |
17 files changed, 171 insertions, 151 deletions
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index 88251c0576cd..e01041edafcd 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -177,12 +177,11 @@ class SwPostItMgr: public SfxListener bool HasScrollbars() const; void Focus(SfxBroadcaster& rBC); - sal_Int32 GetInitialAnchorDistance() const; - sal_Int32 GetScrollSize() const; - sal_Int32 GetSpaceBetween() const; + sal_Int32 GetInitialAnchorDistance() const; + sal_Int32 GetScrollSize() const; + sal_Int32 GetSpaceBetween() const; void SetReadOnlyState(); - DECL_LINK( CalcHdl, void*); - + DECL_LINK( CalcHdl, void*); protected: public: @@ -263,6 +262,12 @@ class SwPostItMgr: public SfxListener sal_uInt16 Replace(SvxSearchItem* pItem); 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(); }; #endif + + + + diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx index 496df5c56a1c..2ca982e80c0b 100644 --- a/sw/inc/fmtfld.hxx +++ b/sw/inc/fmtfld.hxx @@ -39,6 +39,7 @@ class SwField; class SwTxtFld; +class SwView; // ATT_FLD *********************************** class SW_DLLPUBLIC SwFmtFld : public SfxPoolItem, public SwClient, public SfxBroadcaster @@ -103,16 +104,19 @@ class SW_DLLPUBLIC SwFmtFldHint : public SfxHint const SwFmtFld* pFld; sal_Int16 nWhich; + const SwView* pView; public: - SwFmtFldHint( const SwFmtFld* p, sal_Int16 n ) + SwFmtFldHint( const SwFmtFld* p, sal_Int16 n, const SwView* pV = 0) : pFld(p) , nWhich(n) + , pView(pV) {} TYPEINFO(); const SwFmtFld* GetField() const { return pFld; } sal_Int16 Which() const { return nWhich; } + const SwView* GetView() const { return pView; } }; #endif diff --git a/sw/inc/postit.hxx b/sw/inc/postit.hxx index 4930ac67c9bf..5ddf9c1458fb 100644 --- a/sw/inc/postit.hxx +++ b/sw/inc/postit.hxx @@ -181,8 +181,6 @@ class PostItTxt : public Window virtual void DataChanged( const DataChangedEvent& aData); virtual void LoseFocus(); virtual void RequestHelp(const HelpEvent &rEvt); - - // reconversion /*i94374*/ virtual XubString GetSurroundingText() const; virtual Selection GetSurroundingTextSelection() const; @@ -229,6 +227,7 @@ class SwMarginWin : public Window long mPageBorder; SwPostItBits nFlags; bool mbMouseOverButton; + protected: bool mbReadonly; PopupMenu* mpButtonPopup; @@ -241,7 +240,8 @@ class SwMarginWin : public Window virtual void Paint( const Rectangle& rRect); virtual void GetFocus(); - void SetSizePixel( const Size& rNewSize ); + void SetSizePixel( const Size& rNewSize ); + SfxItemSet DefaultItem(); DECL_LINK(ModifyHdl, void*); DECL_LINK(ScrollHdl, ScrollBar*); @@ -289,8 +289,8 @@ class SwMarginWin : public Window void ExecuteCommand(USHORT nSlot); void InitControls(); - void HidePostIt(); - void DoResize(); + void HidePostIt(); + void DoResize(); void ResizeIfNeccessary(long aOldHeight, long aNewHeight); void SetScrollbar(); diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx index 871c9f477f9a..ebf6e8cd9325 100644 --- a/sw/inc/redline.hxx +++ b/sw/inc/redline.hxx @@ -42,6 +42,7 @@ #include <svtools/smplhint.hxx> class SfxItemSet; +class SwView; class SwRedlineExtraData { @@ -297,16 +298,19 @@ class SW_DLLPUBLIC SwRedlineHint : public SfxHint const SwRedline* pRedline; sal_Int16 nWhich; + const SwView* pView; public: - SwRedlineHint( const SwRedline* p, sal_Int16 n ) + SwRedlineHint( const SwRedline* p, sal_Int16 n, const SwView* pV = 0) : pRedline(p) , nWhich(n) - {} + , pView(pV) + {} TYPEINFO(); const SwRedline* GetRedline() const { return pRedline; } sal_Int16 Which() const { return nWhich; } + const SwView* GetView() const { return pView; } }; diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx index dda7cec0e439..596a390cd2ae 100644 --- a/sw/source/core/fields/postithelper.cxx +++ b/sw/source/core/fields/postithelper.cxx @@ -64,8 +64,9 @@ SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos( std::vector< SwLa if( !pTxtFrm->IsFollow() ) { pTxtFrm = ((SwTxtFrm*)pTxtFrm)->GetFrmAtPos( rPos ); - SwPageFrm *pPage = pTxtFrm ? pTxtFrm->FindPageFrm() : 0; - if( pPage ) + SwPageFrm *pPage = pTxtFrm ? pTxtFrm->FindPageFrm() : 0; + // #i103490# + if ( pPage && !pPage->IsInvalid() && !pPage->IsInvalidFly() ) { SwLayoutInfo aInfo; pTxtFrm->GetCharRect( aInfo.mPosition, rPos, 0 ); diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index dddcd1152fd8..2c25ffbad82a 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -2230,12 +2230,12 @@ void ViewShell::ApplyViewOptions( const SwViewOption &rOpt ) { SwViewOption aOpt( *pSh->GetViewOptions() ); aOpt.SetFldName( rOpt.IsFldName() ); - aOpt.SetShowHiddenField( rOpt.IsShowHiddenField() ); + aOpt.SetShowHiddenField( rOpt.IsShowHiddenField() ); aOpt.SetShowHiddenPara( rOpt.IsShowHiddenPara() ); - aOpt.SetShowHiddenChar( rOpt.IsShowHiddenChar() ); - aOpt.SetViewLayoutBookMode( rOpt.IsViewLayoutBookMode() ); - aOpt.SetViewLayoutColumns( rOpt.GetViewLayoutColumns() ); - + aOpt.SetShowHiddenChar( rOpt.IsShowHiddenChar() ); + aOpt.SetViewLayoutBookMode( rOpt.IsViewLayoutBookMode() ); + aOpt.SetViewLayoutColumns( rOpt.GetViewLayoutColumns() ); + aOpt.SetPostIts(rOpt.IsPostIts()); if ( !(aOpt == *pSh->GetViewOptions()) ) pSh->ImplApplyViewOptions( aOpt ); pSh = (ViewShell*)pSh->GetNext(); diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index 4a92f76f60fd..4a021e03c3b4 100644 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -1,4 +1,5 @@ -/************************************************************************* +/************************************************************************** + * * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -1517,7 +1518,9 @@ BOOL ViewShell::IsAnyFieldInDoc() const { const SwFmtFld* pFmtFld = (SwFmtFld*)pItem; const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld(); - if( pTxtFld && pTxtFld->GetTxtNode().GetNodes().IsDocNodes() ) + //#i101026# mod: do not include postits in field check + const SwField* pFld = pFmtFld->GetFld(); + if( pTxtFld && pTxtFld->GetTxtNode().GetNodes().IsDocNodes() && (pFld->Which() != RES_POSTITFLD)) return TRUE; } return FALSE; diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index c7c627a12271..53587bca451c 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2416,9 +2416,7 @@ void WW8Export::SectionBreaksAndFrames( const SwTxtNode& rNode ) void MSWordExportBase::WriteText() { #ifdef DEBUG -//!! does not compile with debug=t -> unresolved external (dbg_out), -//!! sommeone who knows what he wants to get should fix this -// ::std::clog << "<WriteText>" << ::std::endl; + ::std::clog << "<WriteText>" << ::std::endl; // ::std::clog << dbg_out(pCurPam->GetDoc()->GetNodes()) << ::std::endl; #endif diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx index 7a63ad665aef..75b24153573e 100644 --- a/sw/source/ui/docvw/PostItMgr.cxx +++ b/sw/source/ui/docvw/PostItMgr.cxx @@ -74,6 +74,7 @@ #include <svtools/langtab.hxx> #include <svtools/smplhint.hxx> +#include <svx/svdview.hxx> #include <svx/eeitem.hxx> #include <svx/langitem.hxx> #include <svx/outliner.hxx> @@ -153,6 +154,14 @@ SwPostItMgr::SwPostItMgr(SwView* pView) mbWaitingForCalcRects = true; mnEventId = Application::PostUserEvent( LINK( this, SwPostItMgr, CalcHdl), 0 ); } + + //#i# + if (HasNotes() && !mpWrtShell->GetViewOptions()->IsPostIts()) + { + SfxRequest aRequest(mpView->GetViewFrame(),FN_VIEW_NOTES); + mpView->ExecViewOptions(aRequest); + } + } SwPostItMgr::~SwPostItMgr() @@ -307,8 +316,9 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) /* else if ( rHint.IsA(TYPE(SwRedlineHint) ) ) { - SwRedline* pRedline = const_cast<SwRedline*>(((SwRedlineHint&)rHint).GetRedline()); - switch ( ((SwRedlineHint&)rHint).Which() ) + const SwRedlineHint rRedlineHint = static_cast<const SwRedlineHint&>(rHint); + SwRedline* pRedline = const_cast<SwRedline*>(rRedlineHint.GetRedline()); + switch ( rRedlineHint.Which() ) { case SWREDLINE_INSERTED : { @@ -325,7 +335,8 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } case SWREDLINE_FOCUS: { - Focus(rBC); + if (rRedlineHint.GetView()== mpView) + Focus(rBC); break; } } @@ -333,8 +344,9 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) */ else if ( rHint.IsA(TYPE(SwFmtFldHint) ) ) { - SwFmtFld* pFld = const_cast <SwFmtFld*>( ((SwFmtFldHint&)rHint).GetField() ); - switch ( ((SwFmtFldHint&)rHint).Which() ) + const SwFmtFldHint& rFmtHint = static_cast<const SwFmtFldHint&>(rHint); + SwFmtFld* pFld = const_cast <SwFmtFld*>( rFmtHint.GetField() ); + switch ( rFmtHint.Which() ) { case SWFMTFLD_INSERTED : { @@ -351,9 +363,10 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) if (bEmpty && !mvPostItFlds.empty()) PrepareView(true); } - else { + else + { DBG_ERROR( "Inserted field not in document!" ); - } + } break; } case SWFMTFLD_REMOVED: @@ -371,18 +384,22 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } case SWFMTFLD_FOCUS: { - Focus(rBC); + if (rFmtHint.GetView()== mpView) + Focus(rBC); break; } case SWFMTFLD_CHANGED: { - SwFmtFld* pFmtFld = dynamic_cast<SwFmtFld*>(&rBC); + SwFmtFld* pFmtFld = dynamic_cast<SwFmtFld*>(&rBC); for(std::list<SwMarginItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) { - if ( pFmtFld == (*i)->GetBroadCaster() ) + if ( pFmtFld == (*i)->GetBroadCaster() ) { if ((*i)->pPostIt) + { (*i)->pPostIt->SetPostItText(); + mbLayout = true; + } break; } } @@ -390,10 +407,10 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } case SWFMTFLD_LANGUAGE: { - SwFmtFld* pFmtFld = dynamic_cast<SwFmtFld*>(&rBC); + SwFmtFld* pFmtFld = dynamic_cast<SwFmtFld*>(&rBC); for(std::list<SwMarginItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) { - if ( pFmtFld == (*i)->GetBroadCaster() ) + if ( pFmtFld == (*i)->GetBroadCaster() ) { if ((*i)->pPostIt) { @@ -1914,3 +1931,27 @@ sal_uInt16 SwPostItMgr::SearchReplace(const SwFmtFld &pFld, const ::com::sun::st } return aResult; } + +void SwPostItMgr::AssureStdModeAtShell() +{ + //#i103373# #i103645# + // deselect any drawing or frame and leave editing mode + SdrView* pSdrView = mpWrtShell->GetDrawView(); + if ( pSdrView && pSdrView->IsTextEdit() ) + { + sal_Bool bLockView = mpWrtShell->IsViewLocked(); + mpWrtShell->LockView( sal_True ); + mpWrtShell->EndTextEdit(); + mpWrtShell->LockView( bLockView ); + } + + if( mpWrtShell->IsSelFrmMode() || mpWrtShell->IsObjSelected()) + { + mpWrtShell->UnSelectFrm(); + mpWrtShell->LeaveSelFrmMode(); + mpWrtShell->EnterStdMode(); + + mpWrtShell->DrawSelChanged(); + mpView->StopShellTimer(); + } +} diff --git a/sw/source/ui/docvw/postit.cxx b/sw/source/ui/docvw/postit.cxx index a9809e07e496..a3e33ebda7da 100644 --- a/sw/source/ui/docvw/postit.cxx +++ b/sw/source/ui/docvw/postit.cxx @@ -91,6 +91,7 @@ #include <vcl/svapp.hxx> #include <vcl/gradient.hxx> #include <vcl/salbtype.hxx> // FRound +#include <vcl/msgbox.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/tuple/b2dtuple.hxx> @@ -269,6 +270,8 @@ void PostItTxt::KeyInput( const KeyEvent& rKeyEvt ) bool bIsProtected = mpMarginWin->IsProtected(); if (!bIsProtected || (bIsProtected && !mpMarginWin->Engine()->GetEditEngine().DoesKeyChangeText(rKeyEvt)) ) bDone = mpOutlinerView->PostKeyEvent( rKeyEvt ); + else + InfoBox( this, SW_RES( MSG_READONLY_CONTENT )).Execute(); } if (bDone) mpMarginWin->ResizeIfNeccessary(aOldHeight,mpMarginWin->GetPostItTextHeight()); @@ -436,33 +439,6 @@ void PostItTxt::Command( const CommandEvent& rCEvt ) mpMarginWin->DocView()->HandleWheelCommands(rCEvt); } } - else if (rCEvt.GetCommand() == COMMAND_SELECTIONCHANGE) - { - if ( mpOutlinerView ) - { - const CommandSelectionChangeData *pData = rCEvt.GetSelectionChangeData(); - ESelection aSelection = mpOutlinerView->GetEditView().GetSelection(); - aSelection.nStartPos = sal::static_int_cast<sal_uInt16, ULONG>(pData->GetStart()); - aSelection.nEndPos = sal::static_int_cast<sal_uInt16, ULONG>(pData->GetEnd()); - mpOutlinerView->GetEditView().SetSelection(aSelection); - } - } - else if (rCEvt.GetCommand() == COMMAND_PREPARERECONVERSION) - { - if ( mpOutlinerView && mpOutlinerView->HasSelection() ) - { - EditEngine *aEditEngine = mpOutlinerView->GetEditView().GetEditEngine(); - ESelection aSelection = mpOutlinerView->GetEditView().GetSelection(); - aSelection.Adjust(); - if( aSelection.nStartPara != aSelection.nEndPara ) - { - xub_StrLen aParaLen = aEditEngine->GetTextLen( aSelection.nStartPara ); - aSelection.nEndPara = aSelection.nStartPara; - aSelection.nEndPos = aParaLen; - mpOutlinerView->GetEditView().SetSelection( aSelection ); - } - } - } else { if ( mpOutlinerView ) @@ -477,40 +453,6 @@ void PostItTxt::DataChanged( const DataChangedEvent& aData) Window::DataChanged( aData ); } -XubString PostItTxt::GetSurroundingText() const -{ - if( mpOutlinerView ) - { - EditEngine *aEditEngine = mpOutlinerView->GetEditView().GetEditEngine(); - if( mpOutlinerView->HasSelection() ) - return mpOutlinerView->GetSelected(); - else - { - ESelection aSelection = mpOutlinerView->GetEditView().GetSelection(); - XubString aStr = aEditEngine->GetText(aSelection.nStartPara); - return aStr; - } - } - else - return XubString::EmptyString(); -} - -Selection PostItTxt::GetSurroundingTextSelection() const -{ - if( mpOutlinerView ) - { - if( mpOutlinerView->HasSelection() ) - return Selection( 0, mpOutlinerView->GetSelected().Len() ); - else - { - ESelection aSelection = mpOutlinerView->GetEditView().GetSelection(); - return Selection( aSelection.nStartPos, aSelection.nEndPos ); - } - } - else - return Selection( 0, 0 ); -} - IMPL_LINK( PostItTxt, WindowEventListener, VclSimpleEvent*, pWinEvent ) { if ( pWinEvent && pWinEvent->ISA( VclWindowEvent ) ) @@ -549,6 +491,22 @@ IMPL_LINK( PostItTxt, WindowEventListener, VclSimpleEvent*, pWinEvent ) return sal_True; } +XubString PostItTxt::GetSurroundingText() const +{ + if( mpOutlinerView ) + return mpOutlinerView->GetSurroundingText(); + else + return XubString::EmptyString(); +} + +Selection PostItTxt::GetSurroundingTextSelection() const +{ + if( mpOutlinerView ) + return mpOutlinerView->GetSurroundingTextSelection(); + else + return Selection( 0, 0 ); +} + /************** SwMarginWin***********************************++*/ SwMarginWin::SwMarginWin(Window* pParent, WinBits nBits,SwPostItMgr* aMgr,SwPostItBits aBits) : Window(pParent, nBits), @@ -735,6 +693,15 @@ void SwMarginWin::ShowAnkorOnly(const Point &aPoint) mpShadow->setVisible(false); } +SfxItemSet SwMarginWin::DefaultItem() +{ + SfxItemSet aItem( mpView->GetDocShell()->GetPool() ); + aItem.Put(SvxFontHeightItem(200,100,EE_CHAR_FONTHEIGHT)); + aItem.Put(SvxFontItem(FAMILY_SWISS,GetSettings().GetStyleSettings().GetFieldFont().GetName(), + EMPTYSTRING,PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO)); + return aItem; +} + void SwMarginWin::InitControls() { // actual window which holds the user text @@ -779,11 +746,7 @@ void SwMarginWin::InitControls() mpPostItTxt->SetTextView(mpOutlinerView); mpOutlinerView->SetOutputArea( PixelToLogic( Rectangle(0,0,1,1) ) ); - SfxItemSet item(aShell->GetPool()); - item.Put(SvxFontHeightItem(200,100,EE_CHAR_FONTHEIGHT)); - item.Put(SvxFontItem(FAMILY_SWISS,GetSettings().GetStyleSettings().GetFieldFont().GetName(), - EMPTYSTRING,PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO)); - mpOutlinerView->SetAttribs(item); + mpOutlinerView->SetAttribs(DefaultItem()); // TODO: ?? EEHorizontalTextDirection aDefHoriTextDir = Application::GetSettings().GetLayoutRTL() ? EE_HTEXTDIR_R2L : EE_HTEXTDIR_L2R; @@ -965,7 +928,7 @@ void SwMarginWin::SetPosAndSize() { mpAnkor->SetAnkorState(AS_ALL); SwMarginWin* pWin = GetTopReplyNote(); - if (IsFollow() && pWin ) + if (pWin) pWin->Ankor()->SetAnkorState(AS_END); } } @@ -973,9 +936,9 @@ void SwMarginWin::SetPosAndSize() void SwMarginWin::DoResize() { - long aTextHeight = LogicToPixel( mpOutliner->CalcTextSize()).Height(); - unsigned long aWidth = GetSizePixel().Width(); - long aHeight = GetSizePixel().Height(); + long aTextHeight = LogicToPixel( mpOutliner->CalcTextSize()).Height(); + long aHeight = GetSizePixel().Height(); + unsigned long aWidth = GetSizePixel().Width(); if (mbMeta) { @@ -999,7 +962,6 @@ void SwMarginWin::DoResize() mpVScrollbar->Hide(); } - mpPostItTxt->SetPosSizePixel(0, 0, aWidth, aHeight); mpMeta->SetPosSizePixel(0,aHeight,GetSizePixel().Width()-GetMetaButtonAreaWidth(),GetMetaHeight()); mpOutliner->SetPaperSize( PixelToLogic( Size(aWidth,aHeight) ) ) ; mpOutlinerView->SetOutputArea( PixelToLogic( Rectangle(0,0,aWidth,aHeight) ) ); @@ -1007,11 +969,21 @@ void SwMarginWin::DoResize() { // if we do not have a scrollbar anymore, we want to see the complete text mpOutlinerView->SetVisArea( PixelToLogic( Rectangle(0,0,aWidth,aHeight) ) ); } - mpVScrollbar->SetPosSizePixel( aWidth, 0, GetScrollbarWidth(), aHeight ); + + if (!Application::GetSettings().GetLayoutRTL()) + { + mpPostItTxt->SetPosSizePixel(0, 0, aWidth, aHeight); + mpVScrollbar->SetPosSizePixel( aWidth, 0, GetScrollbarWidth(), aHeight); + } + else + { + mpPostItTxt->SetPosSizePixel((aTextHeight > aHeight) && !IsPreview() ? GetScrollbarWidth() : 0 , 0, aWidth, aHeight); + mpVScrollbar->SetPosSizePixel( 0, 0, GetScrollbarWidth(), aHeight); + } + mpVScrollbar->SetVisibleSize( PixelToLogic(Size(0,aHeight)).Height() ); mpVScrollbar->SetPageSize( PixelToLogic(Size(0,aHeight)).Height() * 8 / 10 ); mpVScrollbar->SetLineSize( mpOutliner->GetTextHeight() / 10 ); - //mpVScrollbar->SetThumbPos( mpOutlinerView->GetVisArea().Top()+ mpOutlinerView->GetEditView().GetCursor()->GetOffsetY()); SetScrollbar(); mpVScrollbar->SetRange( Range(0, mpOutliner->GetTextHeight())); @@ -1025,10 +997,6 @@ void SwMarginWin::DoResize() Point aRight = PixelToLogic( Point( aBase.X() - (METABUTTON_WIDTH-1)*fx.GetNumerator()/fx.GetDenominator(), aBase.Y()+17*fy.GetNumerator()/fy.GetDenominator() ) ); Point aBottom = PixelToLogic( Point( aBase.X() - (METABUTTON_WIDTH+2)*fx.GetNumerator()/fx.GetDenominator(), aBase.Y()+20*fy.GetNumerator()/fy.GetDenominator() ) ); - //Point aLeft = PixelToLogic(Point(mpMeta->GetPosPixel().X()+mpMeta->GetPosPixel().X()+GetSizePixel().Width()-(GetMetaButtonWidth()+10)+5,mpMeta->GetPosPixel().Y()+17)); - //Point aRight = PixelToLogic(Point(mpMeta->GetPosPixel().X()+mpMeta->GetPosPixel().X()+GetSizePixel().Width()-(GetMetaButtonWidth()+10)+11,mpMeta->GetPosPixel().Y()+17)); - //Point aBottom = PixelToLogic(Point(mpMeta->GetPosPixel().X()+mpMeta->GetPosPixel().X()+GetSizePixel().Width()-(GetMetaButtonWidth()+10)+8,mpMeta->GetPosPixel().Y()+20)); - aPopupTriangle.clear(); aPopupTriangle.append(basegfx::B2DPoint(aLeft.X(),aLeft.Y())); aPopupTriangle.append(basegfx::B2DPoint(aRight.X(),aRight.Y())); @@ -1220,6 +1188,8 @@ void SwMarginWin::HideNote() void SwMarginWin::ActivatePostIt() { + mpMgr->AssureStdModeAtShell(); + mpOutliner->ClearModifyFlag(); mpOutliner->GetUndoManager().Clear(); @@ -1280,6 +1250,8 @@ void SwMarginWin::ToggleInsMode() void SwMarginWin::ExecuteCommand(USHORT nSlot) { + mpMgr->AssureStdModeAtShell(); + switch (nSlot) { case FN_POSTIT: @@ -1444,9 +1416,7 @@ void SwMarginWin::ResetAttributes() { mpOutlinerView->RemoveAttribsKeepLanguages(TRUE); mpOutliner->RemoveFields(TRUE); - SfxItemSet aSet( mpView->GetDocShell()->GetPool() ); - aSet.Put(SvxFontHeightItem(200,100,EE_CHAR_FONTHEIGHT)); - mpOutlinerView->SetAttribs(aSet); + mpOutlinerView->SetAttribs(DefaultItem()); } sal_Int32 SwMarginWin::GetScrollbarWidth() @@ -1504,7 +1474,7 @@ void SwMarginWin::SetViewState(ShadowState bState) { mpAnkor->SetAnkorState(AS_ALL); SwMarginWin* pWin = GetTopReplyNote(); - if (IsFollow() && pWin) + if (pWin) pWin->Ankor()->SetAnkorState(AS_END); mpAnkor->setLineSolid(true); } @@ -1567,7 +1537,7 @@ bool SwMarginWin::IsAnyStackParentVisible() SwMarginWin* SwMarginWin::GetTopReplyNote() { SwMarginWin* pTopNote = 0; - SwMarginWin* pMarginWin = mpMgr->GetNextPostIt(KEY_PAGEUP, this); + SwMarginWin* pMarginWin = IsFollow() ? mpMgr->GetNextPostIt(KEY_PAGEUP, this) : 0; while (pMarginWin) { pTopNote = pMarginWin; @@ -1627,11 +1597,7 @@ void SwPostIt::SetPostItText() else { Engine()->Clear(); - SfxItemSet item( DocView()->GetDocShell()->GetPool() ); - item.Put(SvxFontHeightItem(200,100,EE_CHAR_FONTHEIGHT)); - item.Put(SvxFontItem(FAMILY_SWISS,GetSettings().GetStyleSettings().GetFieldFont().GetName(), - EMPTYSTRING,PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO)); - View()->SetAttribs(item); + View()->SetAttribs(DefaultItem()); View()->InsertText(mpFld->GetPar2(),false); } @@ -1654,8 +1620,10 @@ void SwPostIt::UpdateData() mpFld->SetTextObject(Engine()->CreateParaObject()); DocView()->GetDocShell()->GetDoc()->AppendUndo(new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true)); delete pOldField; - // so we get a new layout of notes (ankor position is still the same and we would otherwise not get one) + // so we get a new layout of notes (anchor position is still the same and we would otherwise not get one) Mgr()->SetLayout(); + // #i98686# if we have several views, all notes should update their text + mpFmtFld->Broadcast(SwFmtFldHint( 0, SWFMTFLD_CHANGED)); DocView()->GetDocShell()->SetModified(); } Engine()->ClearModifyFlag(); @@ -1818,11 +1786,7 @@ void SwPostIt::InitAnswer(OutlinerParaObject* pText) //remove all attributes and reset our standard ones View()->GetEditView().RemoveAttribsKeepLanguages(true); - SfxItemSet aNormalSet( DocView()->GetDocShell()->GetPool() ); - aNormalSet.Put(SvxFontHeightItem(200,100,EE_CHAR_FONTHEIGHT)); - aNormalSet.Put(SvxFontItem(FAMILY_SWISS,GetSettings().GetStyleSettings().GetFieldFont().GetName(), - EMPTYSTRING,PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO)); - View()->SetAttribs(aNormalSet); + View()->SetAttribs(DefaultItem()); // lets insert an undo step so the initial text can be easily deleted // but do not use UpdateData() directly, would set modified state again and reentrance into Mgr Engine()->SetModifyHdl( Link() ); @@ -1895,11 +1859,7 @@ void SwRedComment::SetPostItText() Engine()->EnableUndo( FALSE ); Engine()->Clear(); - SfxItemSet item( DocView()->GetDocShell()->GetPool() ); - item.Put(SvxFontHeightItem(200,100,EE_CHAR_FONTHEIGHT)); - item.Put(SvxFontItem(FAMILY_SWISS,GetSettings().GetStyleSettings().GetFieldFont().GetName(), - EMPTYSTRING,PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO)); - View()->SetAttribs(item); + View()->SetAttribs(DefaultItem()); View()->InsertText(pRedline->GetComment(),false); Engine()->ClearModifyFlag(); diff --git a/sw/source/ui/misc/redlndlg.src b/sw/source/ui/misc/redlndlg.src index 81bc3e6fad93..e653f7e546a4 100644 --- a/sw/source/ui/misc/redlndlg.src +++ b/sw/source/ui/misc/redlndlg.src @@ -64,7 +64,7 @@ ModalDialog DLG_MOD_REDLINE_ACCEPT { HelpID = HID_REDLINE_AUTOFMT_ACCEPT ; REDLNDLG - Text [ en-US ] = "Accept or Reject AutoFormat Changes"; + Text [ en-US ] = "Accept or Reject AutoCorrect Changes"; }; Menu MN_REDLINE_POPUP diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx index 054220be6707..9bfc00b21660 100755 --- a/sw/source/ui/shells/annotsh.cxx +++ b/sw/source/ui/shells/annotsh.cxx @@ -347,7 +347,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) case SID_INSERT_ZWSP : cIns = CHAR_ZWSP ; break; case SID_INSERT_ZWNBSP: cIns = CHAR_ZWNBSP; break; } - pOLV->InsertText( String(cIns), TRUE ); + pOLV->InsertText( String(cIns)); rReq.Done(); break; } @@ -1595,7 +1595,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) aFontSet.Set( aOldSet ); // String einfuegen - pOLV->InsertText( sSym, TRUE ); + pOLV->InsertText( sSym); // attributieren (Font setzen) SfxItemSet aSetFont( *aFontSet.GetPool(), aFontSet.GetRanges() ); diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx index 99a2bf71bca7..85b9fa48447b 100644 --- a/sw/source/ui/shells/drwtxtsh.cxx +++ b/sw/source/ui/shells/drwtxtsh.cxx @@ -514,7 +514,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq) case SID_INSERT_ZWSP : cIns = CHAR_ZWSP ; break; case SID_INSERT_ZWNBSP: cIns = CHAR_ZWNBSP; break; } - pOLV->InsertText( String(cIns), TRUE ); + pOLV->InsertText( String(cIns)); rReq.Done(); } break; @@ -856,7 +856,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) aFontSet.Set( aOldSet ); // String einfuegen - pOLV->InsertText( sSym, TRUE ); + pOLV->InsertText( sSym ); // attributieren (Font setzen) SfxItemSet aFontAttribSet( *aFontSet.GetPool(), aFontSet.GetRanges() ); diff --git a/sw/source/ui/shells/shells.src b/sw/source/ui/shells/shells.src index 9036f05fd983..8a5a29046bd6 100644 --- a/sw/source/ui/shells/shells.src +++ b/sw/source/ui/shells/shells.src @@ -98,7 +98,7 @@ String STR_REDLINE_DELETED }; String STR_REDLINE_AUTOFMT { - Text [ en-US ] = "AutoFormat"; + Text [ en-US ] = "AutoCorrect"; Text [ x-comment ] = " "; }; String STR_REDLINE_FORMATED @@ -118,12 +118,12 @@ String STR_REDLINE_FMTCOLLSET }; String STR_REDLINE_TITLE { - Text [ en-US ] = "AutoFormat"; + Text [ en-US ] = "AutoCorrect"; Text [ x-comment ] = " "; }; String STR_REDLINE_MSG { - Text [ en-US ] = "AutoFormat completed.\nYou can accept or reject all changes,\nor accept or reject particular changes."; + Text [ en-US ] = "AutoCorrect completed.\nYou can accept or reject all changes,\nor accept or reject particular changes."; Text [ x-comment ] = " "; }; String STR_REDLINE_ACCEPT_ALL diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx index 599be5f1f1e1..0dedb918aaf5 100644 --- a/sw/source/ui/shells/textfld.cxx +++ b/sw/source/ui/shells/textfld.cxx @@ -382,7 +382,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) SwFmtFld* pSwFmtFld = static_cast<SwFmtFld*>(pFirst); if ( pSwFmtFld->GetFld() == pPostIt ) { - pSwFmtFld->Broadcast( SwFmtFldHint( 0, SWFMTFLD_FOCUS ) ); + pSwFmtFld->Broadcast( SwFmtFldHint( 0, SWFMTFLD_FOCUS, &GetView() ) ); break; } pFirst = aIter++; @@ -402,7 +402,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) sComment = pRedline->GetComment(); if ( sComment == String(rtl::OUString::createFromAscii("")) ) GetView().GetDocShell()->Broadcast(SwRedlineHint(pRedline,SWREDLINE_INSERTED)); - const_cast<SwRedline*>(pRedline)->Broadcast(SwRedlineHint(pRedline,SWREDLINE_FOCUS)); + const_cast<SwRedline*>(pRedline)->Broadcast(SwRedlineHint(pRedline,SWREDLINE_FOCUS,&GetView())); } */ diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx index ce02579370a9..e86270c55e12 100644 --- a/sw/source/ui/utlui/content.cxx +++ b/sw/source/ui/utlui/content.cxx @@ -906,16 +906,17 @@ SwContentTree::SwContentTree(Window* pParent, const ResId& rResId) : sRename(SW_RES(ST_RENAME)), sReadonlyIdx(SW_RES(ST_READONLY_IDX)), sInvisible(SW_RES(ST_INVISIBLE)), - sPostItShow(SW_RES(ST_POSTIT_SHOW)), - sPostItHide(SW_RES(ST_POSTIT_HIDE)), - sPostItDelete(SW_RES(ST_POSTIT_DELETE)), + + sPostItShow(SW_RES(ST_POSTIT_SHOW)), + sPostItHide(SW_RES(ST_POSTIT_HIDE)), + sPostItDelete(SW_RES(ST_POSTIT_DELETE)), pHiddenShell(0), - pActiveShell(0), - pConfig(SW_MOD()->GetNavigationConfig()), + pActiveShell(0), + pConfig(SW_MOD()->GetNavigationConfig()), nActiveBlock(0), - nHiddenBlock(0), + nHiddenBlock(0), nRootType(USHRT_MAX), nLastSelType(USHRT_MAX), @@ -2929,6 +2930,7 @@ void SwContentTree::EditEntry(SvLBoxEntry* pEntry, sal_uInt8 nMode) break; case CONTENT_TYPE_POSTIT: + pActiveShell->GetView().GetPostItMgr()->AssureStdModeAtShell(); if(nMode == EDIT_MODE_DELETE) { if (((SwPostItContent*)pCnt)->IsPostIt()) @@ -3097,6 +3099,7 @@ void SwContentTree::GotoContent(SwContent* pCnt) } break; case CONTENT_TYPE_POSTIT: + pActiveShell->GetView().GetPostItMgr()->AssureStdModeAtShell(); if (((SwPostItContent*)pCnt)->IsPostIt()) pActiveShell->GotoFld(*((SwPostItContent*)pCnt)->GetPostIt()); else diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx index 5ed81c942ea4..89b0635815d6 100644 --- a/sw/source/ui/wrtsh/select.cxx +++ b/sw/source/ui/wrtsh/select.cxx @@ -336,6 +336,7 @@ void SwWrtShell::UnSelectFrm() // Rahmenselektion aufheben mit garantiert ungueltiger Position Point aPt(LONG_MIN, LONG_MIN); SelectObj(aPt, 0); + GetView().LeaveDrawCreate(); SwTransferable::ClearSelection( *this ); } |