diff options
Diffstat (limited to 'sw/source/ui/shells')
-rwxr-xr-x | sw/source/ui/shells/annotsh.cxx | 16 | ||||
-rw-r--r-- | sw/source/ui/shells/basesh.cxx | 14 | ||||
-rw-r--r-- | sw/source/ui/shells/drwtxtex.cxx | 13 | ||||
-rw-r--r-- | sw/source/ui/shells/drwtxtsh.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/shells/frmsh.cxx | 69 | ||||
-rw-r--r-- | sw/source/ui/shells/grfsh.cxx | 20 | ||||
-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/shells/textsh.cxx | 11 | ||||
-rw-r--r-- | sw/source/ui/shells/textsh1.cxx | 33 |
10 files changed, 149 insertions, 42 deletions
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx index 054220be6707..1a34e2972956 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; } @@ -799,16 +799,18 @@ void SwAnnotationShell::ExecClpbrd(SfxRequest &rReq) switch (nSlot) { case SID_CUT: - pOLV->Cut(); + if ( (pPostItMgr->GetActivePostIt()->GetStatus()!=SwPostItHelper::DELETED) && pOLV->HasSelection() ) + pOLV->Cut(); break; case SID_COPY: - pOLV->Copy(); + if( pOLV->HasSelection() ) + pOLV->Copy(); break; case SID_PASTE: if (pPostItMgr->GetActivePostIt()->GetStatus()!=SwPostItHelper::DELETED) pOLV->Paste(); break; - case FN_PASTESPECIAL: + case SID_PASTE_SPECIAL: { if (pPostItMgr->GetActivePostIt()->GetStatus()!=SwPostItHelper::DELETED) { @@ -886,7 +888,7 @@ void SwAnnotationShell::StateClpbrd(SfxItemSet &rSet) break; } case SID_PASTE: - case FN_PASTESPECIAL: + case SID_PASTE_SPECIAL: { if( !bPastePossible ) rSet.DisableItem( nWhich ); @@ -1380,6 +1382,8 @@ void SwAnnotationShell::ExecUndo(SfxRequest &rReq) } } + rView.GetViewFrame()->GetBindings().InvalidateAll(sal_False); + if (rView.GetPostItMgr()->GetActivePostIt()) rView.GetPostItMgr()->GetActivePostIt()->ResizeIfNeccessary(aOldHeight,rView.GetPostItMgr()->GetActivePostIt()->GetPostItTextHeight()); } @@ -1595,7 +1599,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/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 0c17c85dd301..9f5ee6195e81 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -301,11 +301,9 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq) if ( rSh.HasSelection() ) { SwTransferable* pTransfer = new SwTransferable( rSh ); -/*??*/ uno::Reference< - datatransfer::XTransferable > xRef( - pTransfer ); +/*??*/ uno::Reference< datatransfer::XTransferable > xRef( pTransfer ); - if ( nId == SID_CUT ) + if ( nId == SID_CUT && !rSh.IsSelObjProtected(FLYPROTECT_CONTENT|FLYPROTECT_PARENT) ) pTransfer->Cut(); else { @@ -405,7 +403,7 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq) } break; - case FN_PASTESPECIAL: + case SID_PASTE_SPECIAL: { TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( @@ -481,10 +479,10 @@ void SwBaseShell::StateClpbrd(SfxItemSet &rSet) rSet.DisableItem( SID_PASTE ); break; - case FN_PASTESPECIAL: + case SID_PASTE_SPECIAL: if( !GetView().IsPasteSpecialAllowed() ) { - rSet.DisableItem( FN_PASTESPECIAL ); + rSet.DisableItem( SID_PASTE_SPECIAL ); rSet.DisableItem( SID_PASTE_UNFORMATTED ); } break; @@ -539,6 +537,8 @@ void SwBaseShell::ExecUndo(SfxRequest &rReq) default: DBG_ERROR("falscher Dispatcher"); } + + GetView().GetViewFrame()->GetBindings().InvalidateAll(sal_False); } /*-------------------------------------------------------------------- diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx index d56cb88e9db8..11874ca5b151 100644 --- a/sw/source/ui/shells/drwtxtex.cxx +++ b/sw/source/ui/shells/drwtxtex.cxx @@ -828,15 +828,20 @@ void SwDrawTextShell::ExecClpbrd(SfxRequest &rReq) return; OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView(); + + ESelection aSel(pOLV->GetSelection()); + const sal_Bool bCopy = (aSel.nStartPara != aSel.nEndPara) || (aSel.nStartPos != aSel.nEndPos); sal_uInt16 nId = rReq.GetSlot(); switch( nId ) { case SID_CUT: - pOLV->Cut(); + if (bCopy) + pOLV->Cut(); return; case SID_COPY: - pOLV->Copy(); + if (bCopy) + pOLV->Copy(); return; case SID_PASTE: @@ -888,8 +893,8 @@ void SwDrawTextShell::StateClpbrd(SfxItemSet &rSet) } break; - case FN_PASTESPECIAL: - rSet.DisableItem( FN_PASTESPECIAL ); + case SID_PASTE_SPECIAL: + rSet.DisableItem( SID_PASTE_SPECIAL ); break; // --> OD 2008-06-20 #151110# case SID_CLIPBOARD_FORMAT_ITEMS: diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx index 99a2bf71bca7..9f1d49ebe067 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; @@ -640,6 +640,7 @@ void SwDrawTextShell::ExecUndo(SfxRequest &rReq) pUndoManager->Redo(0); } bCallBase = FALSE; + GetView().GetViewFrame()->GetBindings().InvalidateAll(sal_False); } break; } @@ -856,7 +857,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/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx index 3f61bab9a20e..f7957a66077a 100644 --- a/sw/source/ui/shells/frmsh.cxx +++ b/sw/source/ui/shells/frmsh.cxx @@ -50,6 +50,10 @@ #include <sfx2/request.hxx> #include <sfx2/objface.hxx> #include <svx/hlnkitem.hxx> +// --> OD 2009-07-07 #i73249# +#include <svx/svdview.hxx> +#include <vcl/msgbox.hxx> +// <-- #include <fmturl.hxx> @@ -82,6 +86,9 @@ #include <shells.hrc> #include "swabstdlg.hxx" #include "misc.hrc" +// --> OD 2009-07-14 #i73249# +#include <svx/dialogs.hrc> +// <-- using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -414,8 +421,13 @@ void SwFrameShell::Execute(SfxRequest &rReq) } aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell()))); aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName())); - if(nSel & nsSelectionType::SEL_OLE) - aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText())); + if( nSel & nsSelectionType::SEL_OLE ) + { + // --> OD 2009-07-13 #i73249# +// aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText())); + aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) ); + // <-- + } const SwRect &rPg = rSh.GetAnyCurRect(RECT_PAGE); SwFmtFrmSize aFrmSize(ATT_VAR_SIZE, rPg.Width(), rPg.Height()); @@ -472,7 +484,10 @@ void SwFrameShell::Execute(SfxRequest &rReq) } if (SFX_ITEM_SET == pOutSet->GetItemState(FN_SET_FRM_ALT_NAME, TRUE, &pItem)) { - rSh.SetAlternateText(((const SfxStringItem*)pItem)->GetValue()); + // --> OD 2009-07-13 #i73249# +// rSh.SetAlternateText(((const SfxStringItem*)pItem)->GetValue()); + rSh.SetObjTitle(((const SfxStringItem*)pItem)->GetValue()); + // <-- } // Vorlagen-AutoUpdate SwFrmFmt* pFmt = rSh.GetCurFrmFmt(); @@ -587,6 +602,40 @@ void SwFrameShell::Execute(SfxRequest &rReq) rReq.SetReturnValue(SfxBoolItem(nSlot, bMirror)); } break; + // --> OD 2009-07-14 #i73249# + case FN_TITLE_DESCRIPTION_SHAPE: + { + bUpdateMgr = FALSE; + SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList(); + if ( pSdrView && + pSdrView->GetMarkedObjectCount() == 1 ) + { + String aDescription(rSh.GetObjDescription()); + String aTitle(rSh.GetObjTitle()); + + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + OSL_ENSURE(pFact, "Dialogdiet fail!"); + AbstractSvxObjectTitleDescDialog* pDlg = + pFact->CreateSvxObjectTitleDescDialog( NULL, + aTitle, + aDescription, + RID_SVXDLG_OBJECT_TITLE_DESC ); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); + + if ( pDlg->Execute() == RET_OK ) + { + pDlg->GetDescription(aDescription); + pDlg->GetTitle(aTitle); + + rSh.SetObjDescription(aDescription); + rSh.SetObjTitle(aTitle); + } + + delete pDlg; + } + } + break; + // <-- default: ASSERT( !this, "falscher Dispatcher" ); return; @@ -822,6 +871,20 @@ void SwFrameShell::GetState(SfxItemSet& rSet) rSet.DisableItem( nWhich ); } break; + // --> OD 2009-07-07 #i73249# + case FN_TITLE_DESCRIPTION_SHAPE: + { + SwWrtShell &rWrtSh = GetShell(); + SdrView* pSdrView = rWrtSh.GetDrawViewWithValidMarkList(); + if ( !pSdrView || + pSdrView->GetMarkedObjectCount() != 1 ) + { + rSet.DisableItem( nWhich ); + } + + } + break; + // <-- default: /* do nothing */; break; diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx index 62a3af2f6f28..7203d9c91ebb 100644 --- a/sw/source/ui/shells/grfsh.cxx +++ b/sw/source/ui/shells/grfsh.cxx @@ -154,8 +154,13 @@ void SwGrfShell::Execute(SfxRequest &rReq) aSet.Put( aFrmSize ); aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName())); - if(nSlot == FN_FORMAT_GRAFIC_DLG) - aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText())); + if ( nSlot == FN_FORMAT_GRAFIC_DLG ) + { + // --> OD 2009-07-13 #i73249# +// aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText())); + aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) ); + // <-- + } pRect = &rSh.GetAnyCurRect(RECT_PAGE_PRT); aFrmSize.SetWidth( pRect->Width() ); @@ -324,10 +329,15 @@ void SwGrfShell::Execute(SfxRequest &rReq) sFilterNm, 0 ); } } - if( SFX_ITEM_SET == pSet->GetItemState( + if ( SFX_ITEM_SET == pSet->GetItemState( FN_SET_FRM_ALT_NAME, TRUE, &pItem )) - rSh.SetAlternateText( - ((const SfxStringItem*)pItem)->GetValue() ); + { + // --> OD 2009-07-13 #i73249# +// rSh.SetAlternateText( +// ((const SfxStringItem*)pItem)->GetValue() ); + rSh.SetObjTitle( ((const SfxStringItem*)pItem)->GetValue() ); + // <-- + } SfxItemSet aGrfSet( rSh.GetAttrPool(), RES_GRFATR_BEGIN, RES_GRFATR_END-1 ); 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/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx index 742e93b646c2..7e38c1297d0b 100644 --- a/sw/source/ui/shells/textsh.cxx +++ b/sw/source/ui/shells/textsh.cxx @@ -819,7 +819,11 @@ void SwTextShell::StateInsert( SfxItemSet &rSet ) rSh.Push(); const BOOL bCrsrInHidden = rSh.SelectHiddenRange(); - rSh.Pop(FALSE); + // --> OD 2009-08-05 #i103839#, #b6855246# + // Do not call method <SwCrsrShell::Pop(..)> with 1st parameter = <FALSE> + // in order to avoid that the view jumps to the visible cursor. + rSh.Pop(); + // <-- while ( nWhich ) { @@ -827,8 +831,11 @@ void SwTextShell::StateInsert( SfxItemSet &rSet ) { case SID_INSERT_SOUND: case SID_INSERT_VIDEO: + /*!SvxPluginFileDlg::IsAvailable( nWhich ) || + + discussed with mba: for performance reasons we skip the IsAvailable call here + */ if ( GetShell().IsSelFrmMode() || - !SvxPluginFileDlg::IsAvailable( nWhich ) || SFX_CREATE_MODE_EMBEDDED == eCreateMode || bCrsrInHidden ) { rSet.DisableItem( nWhich ); diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index 8928a505dd87..977dc77c98d3 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -488,9 +488,10 @@ void SwTextShell::Execute(SfxRequest &rReq) RES_CHRATR_CJK_LANGUAGE + 1, RES_CHRATR_CTL_LANGUAGE - 1, RES_CHRATR_CTL_LANGUAGE + 1, RES_CHRATR_END-1, RES_PARATR_BEGIN, RES_PARATR_END-1, - RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, - RES_TXTATR_CJK_RUBY, RES_TXTATR_UNKNOWN_CONTAINER, + RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, + RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY, + RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, 0 }; @@ -1044,7 +1045,14 @@ void SwTextShell::Execute(SfxRequest &rReq) // --> OD 2008-03-18 #refactorlists# String sContinuedListId; const SwNumRule* pRule = - rWrtSh.SearchNumRule( FALSE, TRUE, FALSE, -1, sContinuedListId ); + rWrtSh.SearchNumRule( false, true, false, -1, sContinuedListId ); + // --> OD 2009-08-26 #i86492# + // Search also for bullet list + if ( !pRule ) + { + pRule = rWrtSh.SearchNumRule( false, false, false, -1, sContinuedListId ); + } + // <-- if ( pRule ) { rWrtSh.SetCurNumRule( *pRule, false, sContinuedListId ); @@ -1623,14 +1631,23 @@ void SwTextShell::GetState( SfxItemSet &rSet ) break; case FN_NUM_CONTINUE: { - if ( rSh.GetCurNumRule() ) - rSet.DisableItem(nWhich); - else + // --> OD 2009-08-26 #i86492# + // Allow continuation of previous list, even if at current cursor + // a list is active. +// if ( rSh.GetCurNumRule() ) +// rSet.DisableItem(nWhich); +// else + // <-- { - // --> OD 2008-03-18 #refactorlists# + // --> OD 2009-08-26 #i86492# + // Search also for bullet list String aDummy; const SwNumRule* pRule = - rSh.SearchNumRule( FALSE, TRUE, FALSE, -1, aDummy ); + rSh.SearchNumRule( false, true, false, -1, aDummy ); + if ( !pRule ) + { + pRule = rSh.SearchNumRule( false, false, false, -1, aDummy ); + } // <-- if ( !pRule ) rSet.DisableItem(nWhich); |