1efeef26fSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3efeef26fSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4efeef26fSAndrew Rist * or more contributor license agreements. See the NOTICE file 5efeef26fSAndrew Rist * distributed with this work for additional information 6efeef26fSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7efeef26fSAndrew Rist * to you under the Apache License, Version 2.0 (the 8efeef26fSAndrew Rist * "License"); you may not use this file except in compliance 9efeef26fSAndrew Rist * with the License. You may obtain a copy of the License at 10efeef26fSAndrew Rist * 11efeef26fSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12efeef26fSAndrew Rist * 13efeef26fSAndrew Rist * Unless required by applicable law or agreed to in writing, 14efeef26fSAndrew Rist * software distributed under the License is distributed on an 15efeef26fSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16efeef26fSAndrew Rist * KIND, either express or implied. See the License for the 17efeef26fSAndrew Rist * specific language governing permissions and limitations 18efeef26fSAndrew Rist * under the License. 19efeef26fSAndrew Rist * 20efeef26fSAndrew Rist *************************************************************/ 21efeef26fSAndrew Rist 22efeef26fSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_sw.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <sot/factory.hxx> 28cdf0e10cSrcweir #include <hintids.hxx> 29cdf0e10cSrcweir #include <svl/urihelper.hxx> 30cdf0e10cSrcweir #include <svl/languageoptions.hxx> 31cdf0e10cSrcweir 32cdf0e10cSrcweir #include <svx/svxids.hrc> 33cdf0e10cSrcweir #include <sfx2/linkmgr.hxx> 34cdf0e10cSrcweir #include <svx/htmlmode.hxx> 35cdf0e10cSrcweir #include <svx/imapdlg.hxx> 36cdf0e10cSrcweir #include <sfx2/dispatch.hxx> 37cdf0e10cSrcweir #include <sfx2/docfile.hxx> 38cdf0e10cSrcweir #include <sfx2/viewfrm.hxx> 39cdf0e10cSrcweir #include <sfx2/request.hxx> 40cdf0e10cSrcweir #include <svl/whiter.hxx> 41cdf0e10cSrcweir #include <svl/visitem.hxx> 42cdf0e10cSrcweir #include <sfx2/objitem.hxx> 43cdf0e10cSrcweir #include <svtools/filter.hxx> 44cdf0e10cSrcweir #include <svx/gallery.hxx> 45cdf0e10cSrcweir #include <editeng/langitem.hxx> 46cdf0e10cSrcweir #include <svx/clipfmtitem.hxx> 47cdf0e10cSrcweir #include <svx/contdlg.hxx> 48cdf0e10cSrcweir #include <vcl/graph.hxx> 49cdf0e10cSrcweir #include <svl/slstitm.hxx> 50cdf0e10cSrcweir #include <vcl/msgbox.hxx> 51cdf0e10cSrcweir #include <svl/ptitem.hxx> 52cdf0e10cSrcweir #include <svl/itemiter.hxx> 53cdf0e10cSrcweir #include <svl/stritem.hxx> 54cdf0e10cSrcweir #include <editeng/colritem.hxx> 55cdf0e10cSrcweir #include <editeng/shaditem.hxx> 56cdf0e10cSrcweir #include <editeng/boxitem.hxx> 57cdf0e10cSrcweir #include <svl/srchitem.hxx> 58cdf0e10cSrcweir #include <editeng/ulspitem.hxx> 59cdf0e10cSrcweir #include <editeng/lrspitem.hxx> 60cdf0e10cSrcweir #include <editeng/brshitem.hxx> 61cdf0e10cSrcweir #include <editeng/opaqitem.hxx> 62cdf0e10cSrcweir #include <editeng/sizeitem.hxx> 63cdf0e10cSrcweir #include <svx/flagsdef.hxx> 64cdf0e10cSrcweir #include <editeng/scripttypeitem.hxx> 65cdf0e10cSrcweir #include <sfx2/objface.hxx> 66cdf0e10cSrcweir #include <fmturl.hxx> 67cdf0e10cSrcweir #include <fmthdft.hxx> 68cdf0e10cSrcweir #include <fmtclds.hxx> 69cdf0e10cSrcweir #include <docsh.hxx> 70cdf0e10cSrcweir #include <wrtsh.hxx> 71cdf0e10cSrcweir #include <view.hxx> 72cdf0e10cSrcweir #include <swmodule.hxx> 73cdf0e10cSrcweir #include <swundo.hxx> 74cdf0e10cSrcweir #include <fldbas.hxx> 75cdf0e10cSrcweir #include <uitool.hxx> 76cdf0e10cSrcweir #include <basesh.hxx> 77cdf0e10cSrcweir #include <viewopt.hxx> 78cdf0e10cSrcweir #include <fontcfg.hxx> 79cdf0e10cSrcweir #include <docstat.hxx> 80cdf0e10cSrcweir #include <usrfld.hxx> 81cdf0e10cSrcweir #include <expfld.hxx> 82cdf0e10cSrcweir #include <fldmgr.hxx> 83cdf0e10cSrcweir #include <frmmgr.hxx> 84cdf0e10cSrcweir #include <tablemgr.hxx> 85cdf0e10cSrcweir #include <mdiexp.hxx> 86cdf0e10cSrcweir #include <swdtflvr.hxx> 87cdf0e10cSrcweir #include <pagedesc.hxx> 88cdf0e10cSrcweir #include <convert.hxx> 89cdf0e10cSrcweir #include <fmtcol.hxx> 90cdf0e10cSrcweir #include <edtwin.hxx> 91cdf0e10cSrcweir #include <tblafmt.hxx> 92cdf0e10cSrcweir #include <caption.hxx> 93cdf0e10cSrcweir #include <swwait.hxx> 94cdf0e10cSrcweir #include <cmdid.h> 95cdf0e10cSrcweir #include <globals.hrc> 96cdf0e10cSrcweir #include <shells.hrc> 97cdf0e10cSrcweir #include <statstr.hrc> 98cdf0e10cSrcweir #include <globals.h> 99cdf0e10cSrcweir #include <unotxdoc.hxx> 100cdf0e10cSrcweir #include <crsskip.hxx> 101cdf0e10cSrcweir #include <fmtinfmt.hxx> 102cdf0e10cSrcweir #include <doc.hxx> 103cdf0e10cSrcweir 104cdf0e10cSrcweir #include "swabstdlg.hxx" 105cdf0e10cSrcweir #include "dialog.hrc" 106cdf0e10cSrcweir #include "fldui.hrc" 107cdf0e10cSrcweir #include "table.hrc" 108cdf0e10cSrcweir #include <modcfg.hxx> 109cdf0e10cSrcweir #include <instable.hxx> 110cdf0e10cSrcweir #include <svx/fmshell.hxx> // for FN_XFORMS_DESIGN_MODE 111cdf0e10cSrcweir #include <SwRewriter.hxx> 112cdf0e10cSrcweir #include <comcore.hrc> 113cdf0e10cSrcweir 114cdf0e10cSrcweir #include <unomid.h> 115cdf0e10cSrcweir 116cdf0e10cSrcweir FlyMode SwBaseShell::eFrameMode = FLY_DRAG_END; 117cdf0e10cSrcweir 118cdf0e10cSrcweir 119cdf0e10cSrcweir //Fuer die Erkennung der Id, die variable von Gallery mit SID_GALLERY_BG_BRUSH 120cdf0e10cSrcweir //ankommt. 121cdf0e10cSrcweir static sal_uInt8 nParagraphPos; 122cdf0e10cSrcweir static sal_uInt8 nGraphicPos; 123cdf0e10cSrcweir static sal_uInt8 nOlePos; 124cdf0e10cSrcweir static sal_uInt8 nFramePos; 125cdf0e10cSrcweir static sal_uInt8 nTablePos; 126cdf0e10cSrcweir static sal_uInt8 nTableRowPos; 127cdf0e10cSrcweir static sal_uInt8 nTableCellPos; 128cdf0e10cSrcweir static sal_uInt8 nPagePos; 129cdf0e10cSrcweir static sal_uInt8 nHeaderPos; 130cdf0e10cSrcweir static sal_uInt8 nFooterPos; 131cdf0e10cSrcweir 132cdf0e10cSrcweir #define SwBaseShell 133cdf0e10cSrcweir #define Shadow 134cdf0e10cSrcweir #include <sfx2/msg.hxx> 135cdf0e10cSrcweir #include "swslots.hxx" 136cdf0e10cSrcweir 137cdf0e10cSrcweir #define SWCONTOURDLG(rView) ( (SvxContourDlg*) ( rView.GetViewFrame()->GetChildWindow( \ 138cdf0e10cSrcweir SvxContourDlgChildWindow::GetChildWindowId() )-> \ 139cdf0e10cSrcweir GetWindow() ) ) 140cdf0e10cSrcweir 141cdf0e10cSrcweir #define SWIMAPDLG(rView) ( (SvxIMapDlg*) ( rView.GetViewFrame()->GetChildWindow( \ 142cdf0e10cSrcweir SvxIMapDlgChildWindow::GetChildWindowId() )-> \ 143cdf0e10cSrcweir GetWindow() ) ) 144cdf0e10cSrcweir 145cdf0e10cSrcweir 146cdf0e10cSrcweir using namespace ::com::sun::star; 147cdf0e10cSrcweir using namespace ::com::sun::star::uno; 148cdf0e10cSrcweir using namespace ::com::sun::star::frame; 149cdf0e10cSrcweir using namespace ::com::sun::star::lang; 150cdf0e10cSrcweir 151cdf0e10cSrcweir 152cdf0e10cSrcweir SFX_IMPL_INTERFACE(SwBaseShell, SfxShell, SW_RES(0)) 153cdf0e10cSrcweir { 154cdf0e10cSrcweir SFX_CHILDWINDOW_REGISTRATION(SvxIMapDlgChildWindow::GetChildWindowId()); 155cdf0e10cSrcweir SFX_CHILDWINDOW_REGISTRATION(SvxContourDlgChildWindow::GetChildWindowId()); 156cdf0e10cSrcweir } 157cdf0e10cSrcweir 158cdf0e10cSrcweir TYPEINIT1(SwBaseShell,SfxShell) 159cdf0e10cSrcweir 160cdf0e10cSrcweir /*-------------------------------------------------------------------- 161cdf0e10cSrcweir Beschreibung: statics 162cdf0e10cSrcweir --------------------------------------------------------------------*/ 163cdf0e10cSrcweir 164cdf0e10cSrcweir 165cdf0e10cSrcweir void lcl_UpdateIMapDlg( SwWrtShell& rSh ) 166cdf0e10cSrcweir { 167cdf0e10cSrcweir Graphic aGrf( rSh.GetIMapGraphic() ); 168cdf0e10cSrcweir GraphicType nGrfType = aGrf.GetType(); 169cdf0e10cSrcweir void* pEditObj = GRAPHIC_NONE != nGrfType && GRAPHIC_DEFAULT != nGrfType 170cdf0e10cSrcweir ? rSh.GetIMapInventor() : 0; 171cdf0e10cSrcweir TargetList* pList = new TargetList; 172cdf0e10cSrcweir rSh.GetView().GetViewFrame()->GetTopFrame().GetTargetList(*pList); 173cdf0e10cSrcweir 174cdf0e10cSrcweir SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); 175cdf0e10cSrcweir rSh.GetFlyFrmAttr( aSet ); 176cdf0e10cSrcweir const SwFmtURL &rURL = (SwFmtURL&)aSet.Get( RES_URL ); 177cdf0e10cSrcweir SvxIMapDlgChildWindow::UpdateIMapDlg( 178cdf0e10cSrcweir aGrf, rURL.GetMap(), pList, pEditObj ); 179cdf0e10cSrcweir 180cdf0e10cSrcweir sal_uInt16 nCount = (sal_uInt16)pList->Count(); 181cdf0e10cSrcweir if(nCount) 182cdf0e10cSrcweir for( sal_uInt16 i = nCount; i; i-- ) 183cdf0e10cSrcweir { 184cdf0e10cSrcweir delete pList->GetObject(i-1); 185cdf0e10cSrcweir } 186cdf0e10cSrcweir delete pList; 187cdf0e10cSrcweir } 188cdf0e10cSrcweir 189cdf0e10cSrcweir 190cdf0e10cSrcweir sal_Bool lcl_UpdateContourDlg( SwWrtShell &rSh, int nSel ) 191cdf0e10cSrcweir { 192cdf0e10cSrcweir Graphic aGraf( rSh.GetIMapGraphic() ); 193cdf0e10cSrcweir GraphicType nGrfType = aGraf.GetType(); 194cdf0e10cSrcweir sal_Bool bRet = GRAPHIC_NONE != nGrfType && GRAPHIC_DEFAULT != nGrfType; 195cdf0e10cSrcweir if( bRet ) 196cdf0e10cSrcweir { 197cdf0e10cSrcweir String aGrfName; 198cdf0e10cSrcweir if ( nSel & nsSelectionType::SEL_GRF ) 199cdf0e10cSrcweir rSh.GetGrfNms( &aGrfName, 0 ); 200cdf0e10cSrcweir 201cdf0e10cSrcweir SvxContourDlg *pDlg = SWCONTOURDLG(rSh.GetView()); 202cdf0e10cSrcweir pDlg->Update( aGraf, aGrfName.Len() > 0, 203cdf0e10cSrcweir rSh.GetGraphicPolygon(), rSh.GetIMapInventor() ); 204cdf0e10cSrcweir } 205cdf0e10cSrcweir return bRet; 206cdf0e10cSrcweir } 207cdf0e10cSrcweir 208cdf0e10cSrcweir /*-------------------------------------------------------------------- 209cdf0e10cSrcweir Beschreibung: loeschen 210cdf0e10cSrcweir --------------------------------------------------------------------*/ 211cdf0e10cSrcweir 212cdf0e10cSrcweir void SwBaseShell::ExecDelete(SfxRequest &rReq) 213cdf0e10cSrcweir { 214cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 215cdf0e10cSrcweir SwEditWin& rTmpEditWin = GetView().GetEditWin(); 216cdf0e10cSrcweir switch(rReq.GetSlot()) 217cdf0e10cSrcweir { 218cdf0e10cSrcweir case SID_DELETE: 219cdf0e10cSrcweir rSh.DelRight(); 220cdf0e10cSrcweir break; 221cdf0e10cSrcweir 222cdf0e10cSrcweir case FN_BACKSPACE: 223cdf0e10cSrcweir 224cdf0e10cSrcweir if( rSh.IsNoNum() ) 225cdf0e10cSrcweir { 226cdf0e10cSrcweir rSh.SttCrsrMove(); 227cdf0e10cSrcweir sal_Bool bLeft = rSh.Left( CRSR_SKIP_CHARS, sal_True, 1, sal_False ); 228cdf0e10cSrcweir if( bLeft ) 229cdf0e10cSrcweir { 230cdf0e10cSrcweir // JP 28.03.96: ein Backspace im Absatz ohne Nummer wird zum Delete 231cdf0e10cSrcweir //rSh.SwapPam(); 232cdf0e10cSrcweir //rSh.DelRight( sal_False ); 233cdf0e10cSrcweir 234cdf0e10cSrcweir rSh.DelLeft(); 235cdf0e10cSrcweir } 236cdf0e10cSrcweir else 237cdf0e10cSrcweir // JP 15.07.96: wenns nicht mehr nach vorne geht, die 238cdf0e10cSrcweir // Numerierung aufheben. Z.B. am Doc-/ 239cdf0e10cSrcweir // Rahmen-/Tabellen-/Bereichs-Anfang 240cdf0e10cSrcweir rSh.DelNumRules(); 241cdf0e10cSrcweir 242cdf0e10cSrcweir rSh.EndCrsrMove(); 243cdf0e10cSrcweir break; 244cdf0e10cSrcweir } 245cdf0e10cSrcweir 246cdf0e10cSrcweir // ansonsten DelLeft rufen 247cdf0e10cSrcweir case FN_SHIFT_BACKSPACE: 248cdf0e10cSrcweir rSh.DelLeft(); 249cdf0e10cSrcweir break; 250cdf0e10cSrcweir default: 251cdf0e10cSrcweir DBG_ERROR("falscher Dispatcher"); 252cdf0e10cSrcweir return; 253cdf0e10cSrcweir } 254cdf0e10cSrcweir rReq.Done(); 255cdf0e10cSrcweir 256cdf0e10cSrcweir //#i42732# - notify the edit window that from now on we do not use the input language 257cdf0e10cSrcweir rTmpEditWin.SetUseInputLanguage( sal_False ); 258cdf0e10cSrcweir } 259cdf0e10cSrcweir 260cdf0e10cSrcweir /*-------------------------------------------------------------------- 261cdf0e10cSrcweir Beschreibung: 262cdf0e10cSrcweir --------------------------------------------------------------------*/ 263cdf0e10cSrcweir 264cdf0e10cSrcweir void SwBaseShell::ExecClpbrd(SfxRequest &rReq) 265cdf0e10cSrcweir { 266cdf0e10cSrcweir //Achtung: Suizid gefaehrdet! Nach Paste, Paste special kann der die 267cdf0e10cSrcweir //Shell zerstoert sein. 268cdf0e10cSrcweir 269cdf0e10cSrcweir 270cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 271cdf0e10cSrcweir sal_uInt16 nId = rReq.GetSlot(); 272cdf0e10cSrcweir sal_Bool bIgnore = sal_False; 273cdf0e10cSrcweir switch( nId ) 274cdf0e10cSrcweir { 275cdf0e10cSrcweir case SID_CUT: 276cdf0e10cSrcweir case SID_COPY: 277cdf0e10cSrcweir rView.GetEditWin().FlushInBuffer(); 278cdf0e10cSrcweir if ( rSh.HasSelection() ) 279cdf0e10cSrcweir { 280cdf0e10cSrcweir SwTransferable* pTransfer = new SwTransferable( rSh ); 281cdf0e10cSrcweir /*??*/ uno::Reference< datatransfer::XTransferable > xRef( pTransfer ); 282cdf0e10cSrcweir 283cdf0e10cSrcweir if ( nId == SID_CUT && !rSh.IsSelObjProtected(FLYPROTECT_CONTENT|FLYPROTECT_PARENT) ) 284cdf0e10cSrcweir pTransfer->Cut(); 285cdf0e10cSrcweir else 286cdf0e10cSrcweir { 287cdf0e10cSrcweir const sal_Bool bLockedView = rSh.IsViewLocked(); 288cdf0e10cSrcweir rSh.LockView( sal_True ); //lock visible section 289cdf0e10cSrcweir pTransfer->Copy(); 290cdf0e10cSrcweir rSh.LockView( bLockedView ); 291cdf0e10cSrcweir } 292cdf0e10cSrcweir break; 293cdf0e10cSrcweir } 294cdf0e10cSrcweir return; 295cdf0e10cSrcweir 296cdf0e10cSrcweir case SID_PASTE: 297cdf0e10cSrcweir { 298cdf0e10cSrcweir TransferableDataHelper aDataHelper( 299cdf0e10cSrcweir TransferableDataHelper::CreateFromSystemClipboard( 300cdf0e10cSrcweir &rSh.GetView().GetEditWin() ) ); 301cdf0e10cSrcweir 302cdf0e10cSrcweir if( aDataHelper.GetXTransferable().is() && 303cdf0e10cSrcweir SwTransferable::IsPaste( rSh, aDataHelper )) 304cdf0e10cSrcweir { 305cdf0e10cSrcweir // temp. Variablen, da die Shell nach dem Paste schon 306cdf0e10cSrcweir // zerstoert sein kann 307cdf0e10cSrcweir SwView* pView = &rView; 308cdf0e10cSrcweir SwTransferable::Paste( rSh, aDataHelper ); 309cdf0e10cSrcweir if( rSh.IsFrmSelected() || rSh.IsObjSelected() ) 310cdf0e10cSrcweir rSh.EnterSelFrmMode(); 311cdf0e10cSrcweir pView->AttrChangedNotify( &rSh ); 312cdf0e10cSrcweir } 313cdf0e10cSrcweir else 314cdf0e10cSrcweir return; 315cdf0e10cSrcweir } 316cdf0e10cSrcweir break; 317cdf0e10cSrcweir 318cdf0e10cSrcweir case SID_CLIPBOARD_FORMAT_ITEMS: 319cdf0e10cSrcweir { 320cdf0e10cSrcweir const SfxItemSet* pArgs = rReq.GetArgs(); 321cdf0e10cSrcweir const SfxPoolItem* pFmt; 322cdf0e10cSrcweir if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nId, sal_False, &pFmt ) ) 323cdf0e10cSrcweir { 324cdf0e10cSrcweir TransferableDataHelper aDataHelper( 325cdf0e10cSrcweir TransferableDataHelper::CreateFromSystemClipboard( 326cdf0e10cSrcweir &rSh.GetView().GetEditWin()) ); 327cdf0e10cSrcweir if( aDataHelper.GetXTransferable().is() 328cdf0e10cSrcweir /*&& SwTransferable::IsPaste( rSh, aDataHelper )*/ ) 329cdf0e10cSrcweir { 330cdf0e10cSrcweir // temp. Variablen, da die Shell nach dem Paste schon 331cdf0e10cSrcweir // zerstoert sein kann 332cdf0e10cSrcweir SwView* pView = &rView; 333cdf0e10cSrcweir 334cdf0e10cSrcweir SwTransferable::PasteFormat( rSh, aDataHelper, 335cdf0e10cSrcweir ((SfxUInt32Item*)pFmt)->GetValue() ); 336cdf0e10cSrcweir 337cdf0e10cSrcweir //Done() has to be called before the shell has been removed 338cdf0e10cSrcweir rReq.Done(); 339cdf0e10cSrcweir bIgnore = sal_True; 340cdf0e10cSrcweir if( rSh.IsFrmSelected() || rSh.IsObjSelected()) 341cdf0e10cSrcweir rSh.EnterSelFrmMode(); 342cdf0e10cSrcweir pView->AttrChangedNotify( &rSh ); 343cdf0e10cSrcweir } 344cdf0e10cSrcweir } 345cdf0e10cSrcweir } 346cdf0e10cSrcweir break; 347cdf0e10cSrcweir 348cdf0e10cSrcweir case SID_PASTE_UNFORMATTED: 349cdf0e10cSrcweir { 350cdf0e10cSrcweir TransferableDataHelper aDataHelper( 351cdf0e10cSrcweir TransferableDataHelper::CreateFromSystemClipboard( 352cdf0e10cSrcweir &rSh.GetView().GetEditWin()) ); 353cdf0e10cSrcweir if( aDataHelper.GetXTransferable().is() && 354cdf0e10cSrcweir SwTransferable::IsPaste( rSh, aDataHelper )) 355cdf0e10cSrcweir { 356cdf0e10cSrcweir // temp. Variablen, da die Shell nach dem Paste schon 357cdf0e10cSrcweir // zerstoert sein kann 358cdf0e10cSrcweir SwView* pView = &rView; 359cdf0e10cSrcweir rReq.Ignore(); 360cdf0e10cSrcweir bIgnore = sal_True; 361cdf0e10cSrcweir int nRet = SwTransferable::PasteUnformatted( rSh, aDataHelper ); 362cdf0e10cSrcweir if(nRet)// && rReq.IsRecording() ) 363cdf0e10cSrcweir { 364cdf0e10cSrcweir SfxViewFrame* pViewFrame = pView->GetViewFrame(); 365cdf0e10cSrcweir uno::Reference< frame::XDispatchRecorder > xRecorder = 366cdf0e10cSrcweir pViewFrame->GetBindings().GetRecorder(); 367cdf0e10cSrcweir if(xRecorder.is()) { 368cdf0e10cSrcweir SfxRequest aReq( pViewFrame, SID_CLIPBOARD_FORMAT_ITEMS ); 369cdf0e10cSrcweir aReq.AppendItem( SfxUInt32Item( SID_CLIPBOARD_FORMAT_ITEMS, SOT_FORMAT_STRING ) ); 370cdf0e10cSrcweir aReq.Done(); 371cdf0e10cSrcweir } 372cdf0e10cSrcweir } 373cdf0e10cSrcweir 374cdf0e10cSrcweir if (rSh.IsFrmSelected() || rSh.IsObjSelected()) 375cdf0e10cSrcweir rSh.EnterSelFrmMode(); 376cdf0e10cSrcweir pView->AttrChangedNotify( &rSh ); 377cdf0e10cSrcweir } 378cdf0e10cSrcweir else 379cdf0e10cSrcweir return; 380cdf0e10cSrcweir } 381cdf0e10cSrcweir break; 382cdf0e10cSrcweir 383cdf0e10cSrcweir case SID_PASTE_SPECIAL: 384cdf0e10cSrcweir { 385cdf0e10cSrcweir TransferableDataHelper aDataHelper( 386cdf0e10cSrcweir TransferableDataHelper::CreateFromSystemClipboard( 387cdf0e10cSrcweir &rSh.GetView().GetEditWin()) ); 388cdf0e10cSrcweir if( aDataHelper.GetXTransferable().is() && 389cdf0e10cSrcweir SwTransferable::IsPaste( rSh, aDataHelper )) 390cdf0e10cSrcweir { 391cdf0e10cSrcweir // temp. Variablen, da die Shell nach dem Paste schon 392cdf0e10cSrcweir // zerstoert sein kann 393cdf0e10cSrcweir SwView* pView = &rView; 394cdf0e10cSrcweir sal_uLong nFormatId = 0; 395cdf0e10cSrcweir rReq.Ignore(); 396cdf0e10cSrcweir bIgnore = sal_True; 397cdf0e10cSrcweir int nRet = SwTransferable::PasteSpecial( rSh, aDataHelper, nFormatId ); 398cdf0e10cSrcweir if(nRet)// && rReq.IsRecording() ) 399cdf0e10cSrcweir { 400cdf0e10cSrcweir SfxViewFrame* pViewFrame = pView->GetViewFrame(); 401cdf0e10cSrcweir uno::Reference< frame::XDispatchRecorder > xRecorder = 402cdf0e10cSrcweir pViewFrame->GetBindings().GetRecorder(); 403cdf0e10cSrcweir if(xRecorder.is()) { 404cdf0e10cSrcweir SfxRequest aReq( pViewFrame, SID_CLIPBOARD_FORMAT_ITEMS ); 405cdf0e10cSrcweir aReq.AppendItem( SfxUInt32Item( SID_CLIPBOARD_FORMAT_ITEMS, nFormatId ) ); 406cdf0e10cSrcweir aReq.Done(); 407cdf0e10cSrcweir } 408cdf0e10cSrcweir } 409cdf0e10cSrcweir 410cdf0e10cSrcweir if (rSh.IsFrmSelected() || rSh.IsObjSelected()) 411cdf0e10cSrcweir rSh.EnterSelFrmMode(); 412cdf0e10cSrcweir pView->AttrChangedNotify( &rSh ); 413cdf0e10cSrcweir } 414cdf0e10cSrcweir else 415cdf0e10cSrcweir return; 416cdf0e10cSrcweir } 417cdf0e10cSrcweir break; 418cdf0e10cSrcweir default: 419cdf0e10cSrcweir DBG_ERROR("falscher Dispatcher"); 420cdf0e10cSrcweir return; 421cdf0e10cSrcweir } 422cdf0e10cSrcweir if(!bIgnore) 423cdf0e10cSrcweir rReq.Done(); 424cdf0e10cSrcweir } 425cdf0e10cSrcweir 426cdf0e10cSrcweir /*-------------------------------------------------------------------- 427cdf0e10cSrcweir Beschreibung: ClipBoard-Status 428cdf0e10cSrcweir --------------------------------------------------------------------*/ 429cdf0e10cSrcweir 430cdf0e10cSrcweir void SwBaseShell::StateClpbrd(SfxItemSet &rSet) 431cdf0e10cSrcweir { 432cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 433cdf0e10cSrcweir SfxWhichIter aIter(rSet); 434cdf0e10cSrcweir 435cdf0e10cSrcweir const sal_Bool bCopy = rSh.HasSelection(); 436cdf0e10cSrcweir 437cdf0e10cSrcweir sal_uInt16 nWhich = aIter.FirstWhich(); 438cdf0e10cSrcweir 439cdf0e10cSrcweir while(nWhich) 440cdf0e10cSrcweir { 441cdf0e10cSrcweir switch(nWhich) 442cdf0e10cSrcweir { 443cdf0e10cSrcweir case SID_CUT: 444cdf0e10cSrcweir if( 0 != rSh.IsSelObjProtected(FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) ) 445cdf0e10cSrcweir { 446cdf0e10cSrcweir rSet.DisableItem( nWhich ); 447cdf0e10cSrcweir break; 448cdf0e10cSrcweir } 449cdf0e10cSrcweir case SID_COPY: 450cdf0e10cSrcweir if( !bCopy ) 451cdf0e10cSrcweir rSet.DisableItem( nWhich ); 452cdf0e10cSrcweir break; 453cdf0e10cSrcweir 454cdf0e10cSrcweir case SID_PASTE: 455cdf0e10cSrcweir if( !GetView().IsPasteAllowed() ) 456cdf0e10cSrcweir rSet.DisableItem( SID_PASTE ); 457cdf0e10cSrcweir break; 458cdf0e10cSrcweir 459cdf0e10cSrcweir case SID_PASTE_SPECIAL: 460cdf0e10cSrcweir if( !GetView().IsPasteSpecialAllowed() ) 461cdf0e10cSrcweir { 462cdf0e10cSrcweir rSet.DisableItem( SID_PASTE_SPECIAL ); 463cdf0e10cSrcweir rSet.DisableItem( SID_PASTE_UNFORMATTED ); 464cdf0e10cSrcweir } 465cdf0e10cSrcweir break; 466cdf0e10cSrcweir 467cdf0e10cSrcweir case SID_CLIPBOARD_FORMAT_ITEMS: 468cdf0e10cSrcweir { 469cdf0e10cSrcweir TransferableDataHelper aDataHelper( 470cdf0e10cSrcweir TransferableDataHelper::CreateFromSystemClipboard( 471cdf0e10cSrcweir &rSh.GetView().GetEditWin()) ); 472cdf0e10cSrcweir 473cdf0e10cSrcweir SvxClipboardFmtItem aFmtItem( nWhich ); 474cdf0e10cSrcweir SwTransferable::FillClipFmtItem( rSh, aDataHelper, aFmtItem ); 475cdf0e10cSrcweir rSet.Put( aFmtItem ); 476cdf0e10cSrcweir } 477cdf0e10cSrcweir break; 478cdf0e10cSrcweir } 479cdf0e10cSrcweir nWhich = aIter.NextWhich(); 480cdf0e10cSrcweir } 481cdf0e10cSrcweir } 482cdf0e10cSrcweir 483cdf0e10cSrcweir /*-------------------------------------------------------------------- 484cdf0e10cSrcweir Beschreibung: Undo ausfuehren 485cdf0e10cSrcweir --------------------------------------------------------------------*/ 486cdf0e10cSrcweir 487cdf0e10cSrcweir void SwBaseShell::ExecUndo(SfxRequest &rReq) 488cdf0e10cSrcweir { 489cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 490cdf0e10cSrcweir 491cdf0e10cSrcweir sal_uInt16 nId = rReq.GetSlot(), nCnt = 1; 492cdf0e10cSrcweir const SfxItemSet* pArgs = rReq.GetArgs(); 493cdf0e10cSrcweir const SfxPoolItem* pItem; 494cdf0e10cSrcweir if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nId, sal_False, &pItem )) 495cdf0e10cSrcweir nCnt = ((SfxUInt16Item*)pItem)->GetValue(); 496cdf0e10cSrcweir 497cdf0e10cSrcweir // #i106349#: save pointer: undo/redo may delete the shell, i.e., this! 498cdf0e10cSrcweir SfxViewFrame *const pViewFrame( GetView().GetViewFrame() ); 499cdf0e10cSrcweir 500cdf0e10cSrcweir switch( nId ) 501cdf0e10cSrcweir { 502cdf0e10cSrcweir case SID_UNDO: 503cdf0e10cSrcweir rSh.LockPaint(); 504cdf0e10cSrcweir rSh.Do( SwWrtShell::UNDO, nCnt ); 505cdf0e10cSrcweir rSh.UnlockPaint(); 506cdf0e10cSrcweir break; 507cdf0e10cSrcweir 508cdf0e10cSrcweir case SID_REDO: 509cdf0e10cSrcweir rSh.LockPaint(); 510cdf0e10cSrcweir rSh.Do( SwWrtShell::REDO, nCnt ); 511cdf0e10cSrcweir rSh.UnlockPaint(); 512cdf0e10cSrcweir break; 513cdf0e10cSrcweir 514cdf0e10cSrcweir case SID_REPEAT: 515cdf0e10cSrcweir rSh.Do( SwWrtShell::REPEAT ); 516cdf0e10cSrcweir break; 517cdf0e10cSrcweir default: 518cdf0e10cSrcweir DBG_ERROR("falscher Dispatcher"); 519cdf0e10cSrcweir } 520cdf0e10cSrcweir 521cdf0e10cSrcweir if (pViewFrame) { pViewFrame->GetBindings().InvalidateAll(sal_False); } 522cdf0e10cSrcweir } 523cdf0e10cSrcweir 524cdf0e10cSrcweir /*-------------------------------------------------------------------- 525cdf0e10cSrcweir Beschreibung: Zustand Undo 526cdf0e10cSrcweir --------------------------------------------------------------------*/ 527cdf0e10cSrcweir 528cdf0e10cSrcweir void SwBaseShell::StateUndo(SfxItemSet &rSet) 529cdf0e10cSrcweir { 530cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 531cdf0e10cSrcweir SfxWhichIter aIter(rSet); 532cdf0e10cSrcweir sal_uInt16 nWhich = aIter.FirstWhich(); 533cdf0e10cSrcweir while(nWhich) 534cdf0e10cSrcweir { 535cdf0e10cSrcweir switch(nWhich) 536cdf0e10cSrcweir { 537cdf0e10cSrcweir case SID_UNDO: 538cdf0e10cSrcweir { 539cdf0e10cSrcweir if (rSh.GetLastUndoInfo(0, 0)) 540cdf0e10cSrcweir { 541cdf0e10cSrcweir rSet.Put( SfxStringItem(nWhich, 542cdf0e10cSrcweir rSh.GetDoString(SwWrtShell::UNDO))); 543cdf0e10cSrcweir } 544cdf0e10cSrcweir else 545cdf0e10cSrcweir rSet.DisableItem(nWhich); 546cdf0e10cSrcweir break; 547cdf0e10cSrcweir } 548cdf0e10cSrcweir case SID_REDO: 549cdf0e10cSrcweir { 550cdf0e10cSrcweir if (rSh.GetFirstRedoInfo(0)) 551cdf0e10cSrcweir { 552cdf0e10cSrcweir rSet.Put(SfxStringItem(nWhich, 553cdf0e10cSrcweir rSh.GetDoString(SwWrtShell::REDO))); 554cdf0e10cSrcweir } 555cdf0e10cSrcweir else 556cdf0e10cSrcweir rSet.DisableItem(nWhich); 557cdf0e10cSrcweir break; 558cdf0e10cSrcweir } 559cdf0e10cSrcweir case SID_REPEAT: 560cdf0e10cSrcweir { // Repeat nur moeglich wenn kein REDO moeglich - UI-Restriktion 561cdf0e10cSrcweir if ((!rSh.GetFirstRedoInfo(0)) && 562cdf0e10cSrcweir !rSh.IsSelFrmMode() && 563cdf0e10cSrcweir (UNDO_EMPTY != rSh.GetRepeatInfo(0))) 564cdf0e10cSrcweir { 565cdf0e10cSrcweir rSet.Put(SfxStringItem(nWhich, rSh.GetRepeatString())); 566cdf0e10cSrcweir } 567cdf0e10cSrcweir else 568cdf0e10cSrcweir rSet.DisableItem(nWhich); 569cdf0e10cSrcweir break; 570cdf0e10cSrcweir } 571cdf0e10cSrcweir 572cdf0e10cSrcweir case SID_GETUNDOSTRINGS: 573cdf0e10cSrcweir if (rSh.GetLastUndoInfo(0, 0)) 574cdf0e10cSrcweir { 575cdf0e10cSrcweir SfxStringListItem aStrLst( nWhich ); 576cdf0e10cSrcweir rSh.GetDoStrings( SwWrtShell::UNDO, aStrLst ); 577cdf0e10cSrcweir rSet.Put( aStrLst ); 578cdf0e10cSrcweir } 579cdf0e10cSrcweir else 580cdf0e10cSrcweir rSet.DisableItem( nWhich ); 581cdf0e10cSrcweir break; 582cdf0e10cSrcweir 583cdf0e10cSrcweir case SID_GETREDOSTRINGS: 584cdf0e10cSrcweir if (rSh.GetFirstRedoInfo(0)) 585cdf0e10cSrcweir { 586cdf0e10cSrcweir SfxStringListItem aStrLst( nWhich ); 587cdf0e10cSrcweir rSh.GetDoStrings( SwWrtShell::REDO, aStrLst ); 588cdf0e10cSrcweir rSet.Put( aStrLst ); 589cdf0e10cSrcweir } 590cdf0e10cSrcweir else 591cdf0e10cSrcweir rSet.DisableItem( nWhich ); 592cdf0e10cSrcweir break; 593cdf0e10cSrcweir } 594cdf0e10cSrcweir nWhich = aIter.NextWhich(); 595cdf0e10cSrcweir } 596cdf0e10cSrcweir } 597cdf0e10cSrcweir 598cdf0e10cSrcweir /*-------------------------------------------------------------------- 599cdf0e10cSrcweir Beschreibung: Slot-Id auswerten bzw. Dispatchen 600cdf0e10cSrcweir --------------------------------------------------------------------*/ 601cdf0e10cSrcweir 602cdf0e10cSrcweir void SwBaseShell::Execute(SfxRequest &rReq) 603cdf0e10cSrcweir { 604cdf0e10cSrcweir const SfxPoolItem *pItem; 605cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 606cdf0e10cSrcweir const SfxItemSet* pArgs = rReq.GetArgs(); 607cdf0e10cSrcweir sal_Bool bMore = sal_False; 608cdf0e10cSrcweir 609cdf0e10cSrcweir sal_uInt16 nSlot = rReq.GetSlot(); 610cdf0e10cSrcweir switch(nSlot) 611cdf0e10cSrcweir { 612cdf0e10cSrcweir case FN_REPAGINATE: 613cdf0e10cSrcweir { 614cdf0e10cSrcweir Reference < XModel > xModel = GetView().GetDocShell()->GetModel(); 615cdf0e10cSrcweir Reference < XUnoTunnel > xDocTunnel ( xModel, UNO_QUERY ); 616cdf0e10cSrcweir SwXTextDocument *pDoc = reinterpret_cast < SwXTextDocument * > ( xDocTunnel->getSomething ( SwXTextDocument::getUnoTunnelId() ) ); 617cdf0e10cSrcweir pDoc->notifyRefreshListeners(); 618cdf0e10cSrcweir rSh.CalcLayout(); 619cdf0e10cSrcweir } 620cdf0e10cSrcweir break; 621cdf0e10cSrcweir case FN_UPDATE_FIELDS: 622cdf0e10cSrcweir { 623cdf0e10cSrcweir SwDocStat aDocStat; 624cdf0e10cSrcweir rSh.UpdateDocStat(aDocStat); 625cdf0e10cSrcweir rSh.EndAllTblBoxEdit(); 626cdf0e10cSrcweir rSh.ViewShell::UpdateFlds(sal_True); 627cdf0e10cSrcweir 628cdf0e10cSrcweir if( rSh.IsCrsrInTbl() ) 629cdf0e10cSrcweir { 630cdf0e10cSrcweir if( !rSh.IsTblComplexForChart() ) 631cdf0e10cSrcweir SwTableFUNC( &rSh, sal_False).UpdateChart(); 632cdf0e10cSrcweir rSh.ClearTblBoxCntnt(); 633cdf0e10cSrcweir rSh.SaveTblBoxCntnt(); 634cdf0e10cSrcweir } 635cdf0e10cSrcweir } 636cdf0e10cSrcweir break; 637cdf0e10cSrcweir case FN_UPDATE_CHARTS: 638cdf0e10cSrcweir { 639cdf0e10cSrcweir SwWait aWait( *rView.GetDocShell(), sal_True ); 640cdf0e10cSrcweir rSh.UpdateAllCharts(); 641cdf0e10cSrcweir } 642cdf0e10cSrcweir break; 643cdf0e10cSrcweir 644cdf0e10cSrcweir case FN_UPDATE_ALL: 645cdf0e10cSrcweir { 646cdf0e10cSrcweir SwView& rTempView = GetView(); 647cdf0e10cSrcweir rSh.EnterStdMode(); 648cdf0e10cSrcweir if( rSh.GetLinkManager().GetLinks().Count() ) 649cdf0e10cSrcweir { 650cdf0e10cSrcweir rSh.StartAllAction(); 651cdf0e10cSrcweir rSh.GetLinkManager().UpdateAllLinks( sal_False, sal_True, sal_True ); 652cdf0e10cSrcweir rSh.EndAllAction(); 653cdf0e10cSrcweir } 654cdf0e10cSrcweir SfxDispatcher &rDis = *rTempView.GetViewFrame()->GetDispatcher(); 655cdf0e10cSrcweir rDis.Execute( FN_UPDATE_FIELDS ); 656cdf0e10cSrcweir rDis.Execute( FN_UPDATE_TOX ); 657cdf0e10cSrcweir rDis.Execute( FN_UPDATE_CHARTS ); 658cdf0e10cSrcweir rSh.CalcLayout(); 659cdf0e10cSrcweir } 660cdf0e10cSrcweir break; 661cdf0e10cSrcweir 662cdf0e10cSrcweir case FN_UPDATE_INPUTFIELDS: 663cdf0e10cSrcweir rSh.UpdateInputFlds(NULL, sal_False); 664cdf0e10cSrcweir break; 665cdf0e10cSrcweir case FN_PREV_BOOKMARK: 666cdf0e10cSrcweir rReq.SetReturnValue(SfxBoolItem( nSlot, rSh.GoPrevBookmark())); 667cdf0e10cSrcweir break; 668cdf0e10cSrcweir case FN_NEXT_BOOKMARK: 669cdf0e10cSrcweir rReq.SetReturnValue(SfxBoolItem( nSlot, rSh.GoNextBookmark())); 670cdf0e10cSrcweir break; 671cdf0e10cSrcweir 672cdf0e10cSrcweir case FN_GOTO_NEXT_MARK: 673cdf0e10cSrcweir case FN_GOTO_PREV_MARK: 674cdf0e10cSrcweir { 675cdf0e10cSrcweir SwFldMgr aFldMgr; 676cdf0e10cSrcweir SwFieldType* pFldType = aFldMgr.GetFldType(RES_JUMPEDITFLD); 677cdf0e10cSrcweir 678cdf0e10cSrcweir if (pFldType) 679cdf0e10cSrcweir { 680cdf0e10cSrcweir if (rSh.IsSelFrmMode()) 681cdf0e10cSrcweir { 682cdf0e10cSrcweir rSh.UnSelectFrm(); 683cdf0e10cSrcweir rSh.LeaveSelFrmMode(); 684cdf0e10cSrcweir } 685cdf0e10cSrcweir 686cdf0e10cSrcweir if (rSh.HasMark()) 687cdf0e10cSrcweir { 688cdf0e10cSrcweir MV_KONTEXT(&rSh); 689cdf0e10cSrcweir if (rSh.IsCrsrPtAtEnd()) 690cdf0e10cSrcweir rSh.SwapPam(); 691cdf0e10cSrcweir rSh.ClearMark(); 692cdf0e10cSrcweir rSh.EndSelect(); 693cdf0e10cSrcweir } 694cdf0e10cSrcweir sal_Bool bRet = rSh.MoveFldType(pFldType, nSlot == FN_GOTO_NEXT_MARK); 695cdf0e10cSrcweir SwField* pCurField = bRet ? rSh.GetCurFld() : 0; 696cdf0e10cSrcweir if (pCurField) 697cdf0e10cSrcweir rSh.ClickToField(*pCurField); 698cdf0e10cSrcweir rReq.SetReturnValue(SfxBoolItem( nSlot, bRet)); 699cdf0e10cSrcweir } 700cdf0e10cSrcweir } 701cdf0e10cSrcweir break; 702cdf0e10cSrcweir 703cdf0e10cSrcweir case FN_START_DOC_DIRECT: 704cdf0e10cSrcweir case FN_END_DOC_DIRECT: 705cdf0e10cSrcweir { 706cdf0e10cSrcweir if (rSh.IsSelFrmMode()) 707cdf0e10cSrcweir { 708cdf0e10cSrcweir rSh.UnSelectFrm(); 709cdf0e10cSrcweir rSh.LeaveSelFrmMode(); 710cdf0e10cSrcweir } 711cdf0e10cSrcweir rSh.EnterStdMode(); 712cdf0e10cSrcweir nSlot == FN_START_DOC_DIRECT ? 713cdf0e10cSrcweir rSh.SttEndDoc(sal_True) : 714cdf0e10cSrcweir rSh.SttEndDoc(sal_False); 715cdf0e10cSrcweir } 716cdf0e10cSrcweir break; 717cdf0e10cSrcweir case FN_GOTO_PREV_OBJ: 718cdf0e10cSrcweir case FN_GOTO_NEXT_OBJ: 719cdf0e10cSrcweir { 720cdf0e10cSrcweir sal_Bool bSuccess = rSh.GotoObj( 721cdf0e10cSrcweir nSlot == FN_GOTO_NEXT_OBJ ? sal_True : sal_False); 722cdf0e10cSrcweir rReq.SetReturnValue(SfxBoolItem(nSlot, bSuccess)); 723cdf0e10cSrcweir if (bSuccess && !rSh.IsSelFrmMode()) 724cdf0e10cSrcweir { 725cdf0e10cSrcweir rSh.HideCrsr(); 726cdf0e10cSrcweir rSh.EnterSelFrmMode(); 727cdf0e10cSrcweir GetView().AttrChangedNotify( &rSh ); 728cdf0e10cSrcweir } 729cdf0e10cSrcweir } 730cdf0e10cSrcweir break; 731cdf0e10cSrcweir case SID_GALLERY_FORMATS: 732cdf0e10cSrcweir { 733cdf0e10cSrcweir const int nSelType = rSh.GetSelectionType(); 734cdf0e10cSrcweir if(SFX_ITEM_SET == pArgs->GetItemState( nSlot, sal_True, &pItem)) 735cdf0e10cSrcweir { 736cdf0e10cSrcweir GalleryExplorer* pGal = 0; 737cdf0e10cSrcweir if ( (!rSh.IsSelFrmMode() || nSelType & nsSelectionType::SEL_GRF) && 738cdf0e10cSrcweir 0!= (pGal = SVX_GALLERY())&& 739cdf0e10cSrcweir 0 != (SGA_FORMAT_GRAPHIC & ((SfxUInt32Item*)pItem)->GetValue())) 740cdf0e10cSrcweir { 741cdf0e10cSrcweir SwWait aWait( *rView.GetDocShell(), sal_True ); 742cdf0e10cSrcweir 743cdf0e10cSrcweir String aGrfName, aFltName; 744cdf0e10cSrcweir const Graphic aGrf( pGal->GetGraphic() ); 745cdf0e10cSrcweir 746cdf0e10cSrcweir if( pGal->IsLinkage() ) 747cdf0e10cSrcweir { 748cdf0e10cSrcweir // Verknuepft 749cdf0e10cSrcweir aGrfName = pGal->GetURL().GetMainURL(INetURLObject::NO_DECODE); 750cdf0e10cSrcweir aFltName = pGal->GetFilterName(); 751cdf0e10cSrcweir } 752cdf0e10cSrcweir 753cdf0e10cSrcweir if ( nSelType & nsSelectionType::SEL_GRF ) 754cdf0e10cSrcweir rSh.ReRead( aGrfName, aFltName, &aGrf ); 755cdf0e10cSrcweir else 756cdf0e10cSrcweir rSh.Insert( aGrfName, aFltName, aGrf ); 757cdf0e10cSrcweir 758cdf0e10cSrcweir GetView().GetEditWin().GrabFocus(); 759cdf0e10cSrcweir } 760cdf0e10cSrcweir else if(!rSh.IsSelFrmMode() && SGA_FORMAT_SOUND & ((SfxUInt32Item*)pItem)->GetValue()) 761cdf0e10cSrcweir { 762cdf0e10cSrcweir const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, pGal->GetURL().GetMainURL( INetURLObject::NO_DECODE ) ); 763cdf0e10cSrcweir GetView().GetViewFrame()->GetDispatcher()->Execute( SID_INSERT_AVMEDIA, SFX_CALLMODE_SYNCHRON, &aMediaURLItem, 0L ); 764cdf0e10cSrcweir /* 765cdf0e10cSrcweir String sURL( pGal->GetURL().GetMainURL( INetURLObject::NO_DECODE ) ); 766cdf0e10cSrcweir String sLabel( pGal->GetURL().getBase() ); 767cdf0e10cSrcweir String sTarget; // empty string! 768cdf0e10cSrcweir 769cdf0e10cSrcweir bool bIsHTMLMode = 770cdf0e10cSrcweir 0 == ( HTMLMODE_ON & 771cdf0e10cSrcweir ::GetHtmlMode( GetView().GetDocShell() ) ); 772cdf0e10cSrcweir 773cdf0e10cSrcweir // in Writer, we insert a button which plays the 774cdf0e10cSrcweir // sound. In Writer/Web, we just insert a (text) link. 775cdf0e10cSrcweir if( bIsHTMLMode ) 776cdf0e10cSrcweir InsertURLButton( sURL, sTarget, sLabel ); 777cdf0e10cSrcweir else 778cdf0e10cSrcweir rSh.InsertURL( SwFmtINetFmt( sURL, sTarget ), sLabel ); 779cdf0e10cSrcweir */ 780cdf0e10cSrcweir } 781cdf0e10cSrcweir } 782cdf0e10cSrcweir } 783cdf0e10cSrcweir break; 784cdf0e10cSrcweir case FN_PAGE_STYLE_SET_COLS: 785cdf0e10cSrcweir { 786cdf0e10cSrcweir if (pArgs) 787cdf0e10cSrcweir { 788cdf0e10cSrcweir // aktuellen PageDescriptor ermitteln und damit den Set fuellen 789cdf0e10cSrcweir const sal_uInt16 nCurIdx = rSh.GetCurPageDesc(); 790cdf0e10cSrcweir SwPageDesc aPageDesc(rSh.GetPageDesc(nCurIdx)); 791cdf0e10cSrcweir 792cdf0e10cSrcweir SwFrmFmt &rFmt = aPageDesc.GetMaster(); 793cdf0e10cSrcweir 794cdf0e10cSrcweir SwFmtCol aFmtCol = rFmt.GetCol(); 795cdf0e10cSrcweir 796cdf0e10cSrcweir sal_uInt16 nCount; 797cdf0e10cSrcweir if(SFX_ITEM_SET == pArgs->GetItemState(nSlot)) 798cdf0e10cSrcweir nCount = ((SfxUInt16Item &)pArgs->Get(nSlot)).GetValue(); 799cdf0e10cSrcweir else 800cdf0e10cSrcweir nCount = ((SfxUInt16Item &)pArgs->Get(SID_ATTR_COLUMNS)).GetValue(); 801cdf0e10cSrcweir sal_uInt16 nGutterWidth = DEF_GUTTER_WIDTH; 802cdf0e10cSrcweir 803cdf0e10cSrcweir aFmtCol.Init(nCount ? nCount : 1, nGutterWidth, USHRT_MAX); 804cdf0e10cSrcweir aFmtCol.SetWishWidth(USHRT_MAX); 805cdf0e10cSrcweir aFmtCol.SetGutterWidth(nGutterWidth, USHRT_MAX); 806cdf0e10cSrcweir 807cdf0e10cSrcweir rFmt.SetFmtAttr(aFmtCol); 808cdf0e10cSrcweir 809cdf0e10cSrcweir rSh.ChgPageDesc(nCurIdx, aPageDesc); 810cdf0e10cSrcweir } 811cdf0e10cSrcweir else 812cdf0e10cSrcweir GetView().GetViewFrame()->GetDispatcher()->Execute(FN_FORMAT_PAGE_COLUMN_DLG, sal_False); 813cdf0e10cSrcweir } 814cdf0e10cSrcweir break; 815cdf0e10cSrcweir case FN_CONVERT_TABLE_TO_TEXT: 816cdf0e10cSrcweir case FN_CONVERT_TEXT_TO_TABLE: 817cdf0e10cSrcweir case FN_CONVERT_TEXT_TABLE: 818cdf0e10cSrcweir { 819cdf0e10cSrcweir sal_Unicode cDelim = 0; 820cdf0e10cSrcweir bool bToTable = false; 821cdf0e10cSrcweir if( nSlot == FN_CONVERT_TEXT_TO_TABLE || 822cdf0e10cSrcweir ( nSlot == FN_CONVERT_TEXT_TABLE && 0 == rSh.GetTableFmt() )) 823cdf0e10cSrcweir bToTable = true; 824cdf0e10cSrcweir SwInsertTableOptions aInsTblOpts( tabopts::ALL_TBL_INS_ATTR, 1 ); 825cdf0e10cSrcweir SwTableAutoFmt* pTAFmt = 0; 826cdf0e10cSrcweir SwTableAutoFmtTbl* pAutoFmtTbl = 0; 827cdf0e10cSrcweir bool bDeleteFormat = true; 828cdf0e10cSrcweir if(pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_PARAM_1, sal_True, &pItem)) 829cdf0e10cSrcweir { 830cdf0e10cSrcweir aInsTblOpts.mnInsMode = 0; 831cdf0e10cSrcweir //Delimiter 832cdf0e10cSrcweir String sDelim = static_cast< const SfxStringItem* >(pItem)->GetValue(); 833cdf0e10cSrcweir if(sDelim.Len()) 834cdf0e10cSrcweir cDelim = sDelim.GetChar(0); 835cdf0e10cSrcweir //AutoFormat 836cdf0e10cSrcweir if(SFX_ITEM_SET == pArgs->GetItemState( FN_PARAM_2, sal_True, &pItem)) 837cdf0e10cSrcweir { 838cdf0e10cSrcweir String sAutoFmt = static_cast< const SfxStringItem* >(pItem)->GetValue(); 839cdf0e10cSrcweir 840cdf0e10cSrcweir pAutoFmtTbl = new SwTableAutoFmtTbl; 841cdf0e10cSrcweir pAutoFmtTbl->Load(); 842cdf0e10cSrcweir 843cdf0e10cSrcweir for( sal_uInt16 i = 0, nCount = pAutoFmtTbl->Count(); i < nCount; i++ ) 844cdf0e10cSrcweir { 845cdf0e10cSrcweir SwTableAutoFmt* pFmt = (*pAutoFmtTbl)[ i ]; 846cdf0e10cSrcweir if( pFmt->GetName() == sAutoFmt ) 847cdf0e10cSrcweir { 848cdf0e10cSrcweir pTAFmt = pFmt; 849cdf0e10cSrcweir bDeleteFormat = false; 850cdf0e10cSrcweir break; 851cdf0e10cSrcweir } 852cdf0e10cSrcweir } 853cdf0e10cSrcweir } 854cdf0e10cSrcweir //WithHeader 855cdf0e10cSrcweir if(SFX_ITEM_SET == pArgs->GetItemState( FN_PARAM_3, sal_True, &pItem) && 856cdf0e10cSrcweir static_cast< const SfxBoolItem* >(pItem)->GetValue()) 857cdf0e10cSrcweir aInsTblOpts.mnInsMode |= tabopts::HEADLINE; 858cdf0e10cSrcweir // RepeatHeaderLines 859cdf0e10cSrcweir if(SFX_ITEM_SET == pArgs->GetItemState( FN_PARAM_4, sal_True, &pItem)) 860cdf0e10cSrcweir aInsTblOpts.mnRowsToRepeat = 861cdf0e10cSrcweir (sal_uInt16)static_cast< const SfxInt16Item* >(pItem)->GetValue(); 862cdf0e10cSrcweir //WithBorder 863cdf0e10cSrcweir if(SFX_ITEM_SET == pArgs->GetItemState( FN_PARAM_5, sal_True, &pItem) && 864cdf0e10cSrcweir static_cast< const SfxBoolItem* >(pItem)->GetValue()) 865cdf0e10cSrcweir aInsTblOpts.mnInsMode |= tabopts::DEFAULT_BORDER; 866cdf0e10cSrcweir //DontSplitTable 867cdf0e10cSrcweir if(SFX_ITEM_SET == pArgs->GetItemState( FN_PARAM_6, sal_True, &pItem) && 868cdf0e10cSrcweir !static_cast< const SfxBoolItem* >(pItem)->GetValue() ) 869cdf0e10cSrcweir aInsTblOpts.mnInsMode |= tabopts::SPLIT_LAYOUT; 870cdf0e10cSrcweir } 871cdf0e10cSrcweir else 872cdf0e10cSrcweir { 873cdf0e10cSrcweir SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); 874cdf0e10cSrcweir DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); 875cdf0e10cSrcweir 876cdf0e10cSrcweir AbstractSwConvertTableDlg* pDlg = pFact->CreateSwConvertTableDlg( 877cdf0e10cSrcweir GetView(),DLG_CONV_TEXT_TABLE , bToTable); 878cdf0e10cSrcweir DBG_ASSERT(pDlg, "Dialogdiet fail!"); 879cdf0e10cSrcweir if( RET_OK == pDlg->Execute() ) 880cdf0e10cSrcweir { 881cdf0e10cSrcweir pDlg->GetValues( cDelim, aInsTblOpts, pTAFmt ); 882cdf0e10cSrcweir 883cdf0e10cSrcweir } 884cdf0e10cSrcweir delete pDlg; 885cdf0e10cSrcweir } 886cdf0e10cSrcweir 887cdf0e10cSrcweir if( cDelim ) 888cdf0e10cSrcweir { 889cdf0e10cSrcweir //Shellwechsel! 890cdf0e10cSrcweir SwView& rSaveView = rView; 891cdf0e10cSrcweir sal_Bool bInserted = sal_False; 892cdf0e10cSrcweir //recording: 893cdf0e10cSrcweir 894cdf0e10cSrcweir SfxViewFrame* pViewFrame = GetView().GetViewFrame(); 895cdf0e10cSrcweir if( SfxRequest::HasMacroRecorder(pViewFrame) ) 896cdf0e10cSrcweir { 897cdf0e10cSrcweir SfxRequest aReq( pViewFrame, nSlot); 898cdf0e10cSrcweir aReq.AppendItem( SfxStringItem( FN_PARAM_1, String(cDelim) )); 899cdf0e10cSrcweir if(bToTable) 900cdf0e10cSrcweir { 901cdf0e10cSrcweir if(pTAFmt) 902cdf0e10cSrcweir aReq.AppendItem( SfxStringItem( FN_PARAM_2, pTAFmt->GetName())); 903cdf0e10cSrcweir aReq.AppendItem( SfxBoolItem ( FN_PARAM_3, 0 != (aInsTblOpts.mnInsMode & tabopts::HEADLINE))); 904cdf0e10cSrcweir aReq.AppendItem( SfxInt16Item( FN_PARAM_4, (short)aInsTblOpts.mnRowsToRepeat )); 905cdf0e10cSrcweir aReq.AppendItem( SfxBoolItem ( FN_PARAM_5, 0 != (aInsTblOpts.mnInsMode & tabopts::DEFAULT_BORDER) )); 906cdf0e10cSrcweir aReq.AppendItem( SfxBoolItem ( FN_PARAM_6, !(aInsTblOpts.mnInsMode & tabopts::SPLIT_LAYOUT))); 907cdf0e10cSrcweir } 908cdf0e10cSrcweir aReq.Done(); 909cdf0e10cSrcweir } 910cdf0e10cSrcweir 911cdf0e10cSrcweir if( !bToTable ) 912cdf0e10cSrcweir rSh.TableToText( cDelim ); 913cdf0e10cSrcweir else 914cdf0e10cSrcweir { 915cdf0e10cSrcweir bInserted = rSh.TextToTable( aInsTblOpts, cDelim, text::HoriOrientation::FULL, pTAFmt ); 916cdf0e10cSrcweir } 917cdf0e10cSrcweir rSh.EnterStdMode(); 918cdf0e10cSrcweir 919cdf0e10cSrcweir if( bInserted ) 920cdf0e10cSrcweir rSaveView.AutoCaption( TABLE_CAP ); 921cdf0e10cSrcweir } 922cdf0e10cSrcweir if(bDeleteFormat) 923cdf0e10cSrcweir delete pTAFmt; 924cdf0e10cSrcweir delete pAutoFmtTbl; 925cdf0e10cSrcweir } 926cdf0e10cSrcweir break; 927cdf0e10cSrcweir case SID_STYLE_WATERCAN: 928cdf0e10cSrcweir case SID_STYLE_UPDATE_BY_EXAMPLE: 929cdf0e10cSrcweir case SID_STYLE_NEW_BY_EXAMPLE: 930cdf0e10cSrcweir case SID_STYLE_APPLY: 931cdf0e10cSrcweir { 932cdf0e10cSrcweir ShellModes eMode = GetView().GetShellMode(); 933cdf0e10cSrcweir if ( SHELL_MODE_DRAW != eMode && 934cdf0e10cSrcweir SHELL_MODE_DRAW_CTRL != eMode && 935cdf0e10cSrcweir SHELL_MODE_DRAW_FORM != eMode && 936cdf0e10cSrcweir SHELL_MODE_DRAWTEXT != eMode && 937cdf0e10cSrcweir SHELL_MODE_BEZIER != eMode ) 938cdf0e10cSrcweir { 939cdf0e10cSrcweir // oj #107754# 940cdf0e10cSrcweir if ( SID_STYLE_WATERCAN == nSlot ) 941cdf0e10cSrcweir { 942cdf0e10cSrcweir const sal_Bool bLockedView = rSh.IsViewLocked(); 943cdf0e10cSrcweir rSh.LockView( sal_True ); //lock visible section 944cdf0e10cSrcweir 945cdf0e10cSrcweir GetView().GetDocShell()->ExecStyleSheet(rReq); 946cdf0e10cSrcweir 947cdf0e10cSrcweir rSh.LockView( bLockedView ); 948cdf0e10cSrcweir } 949cdf0e10cSrcweir else 950cdf0e10cSrcweir // wird von der DocShell aufgezeichnet 951cdf0e10cSrcweir GetView().GetDocShell()->ExecStyleSheet(rReq); 952cdf0e10cSrcweir } 953cdf0e10cSrcweir } 954cdf0e10cSrcweir break; 955cdf0e10cSrcweir case FN_ESCAPE: 956cdf0e10cSrcweir GetView().ExecuteSlot(rReq); 957cdf0e10cSrcweir break; 958cdf0e10cSrcweir case SID_IMAP: 959cdf0e10cSrcweir { 960cdf0e10cSrcweir sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId(); 961cdf0e10cSrcweir 962cdf0e10cSrcweir SfxViewFrame* pVFrame = GetView().GetViewFrame(); 963cdf0e10cSrcweir pVFrame->ToggleChildWindow( nId ); 964cdf0e10cSrcweir pVFrame->GetBindings().Invalidate( SID_IMAP ); 965cdf0e10cSrcweir 966cdf0e10cSrcweir if ( pVFrame->HasChildWindow( nId ) && rSh.IsFrmSelected() ) 967cdf0e10cSrcweir lcl_UpdateIMapDlg( rSh ); 968cdf0e10cSrcweir } 969cdf0e10cSrcweir break; 970cdf0e10cSrcweir case SID_IMAP_EXEC: 971cdf0e10cSrcweir { 972cdf0e10cSrcweir SvxIMapDlg* pDlg = SWIMAPDLG(GetView()); 973cdf0e10cSrcweir 974cdf0e10cSrcweir // Kontrolle, ob Zuweisung ueberhaupt sinnvoll/erlaubt 975cdf0e10cSrcweir if ( rSh.IsFrmSelected() && 976cdf0e10cSrcweir pDlg->GetEditingObject() == rSh.GetIMapInventor() ) 977cdf0e10cSrcweir { 978cdf0e10cSrcweir SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); 979cdf0e10cSrcweir rSh.GetFlyFrmAttr( aSet ); 980cdf0e10cSrcweir SwFmtURL aURL( (SwFmtURL&)aSet.Get( RES_URL ) ); 981cdf0e10cSrcweir aURL.SetMap( &pDlg->GetImageMap() ); 982cdf0e10cSrcweir aSet.Put( aURL ); 983cdf0e10cSrcweir rSh.SetFlyFrmAttr( aSet ); 984cdf0e10cSrcweir } 985cdf0e10cSrcweir } 986cdf0e10cSrcweir break; 987cdf0e10cSrcweir case SID_CONTOUR_DLG: 988cdf0e10cSrcweir { 989cdf0e10cSrcweir sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId(); 990cdf0e10cSrcweir 991cdf0e10cSrcweir SfxViewFrame* pVFrame = GetView().GetViewFrame(); 992cdf0e10cSrcweir pVFrame->ToggleChildWindow( nId ); 993cdf0e10cSrcweir pVFrame->GetBindings().Invalidate( SID_CONTOUR_DLG ); 994cdf0e10cSrcweir 995cdf0e10cSrcweir int nSel = rSh.GetSelectionType(); 996cdf0e10cSrcweir if ( pVFrame->HasChildWindow( nId ) && 997cdf0e10cSrcweir (nSel & (nsSelectionType::SEL_GRF|nsSelectionType::SEL_OLE)) ) 998cdf0e10cSrcweir { 999cdf0e10cSrcweir lcl_UpdateContourDlg( rSh, nSel ); 1000cdf0e10cSrcweir } 1001cdf0e10cSrcweir } 1002cdf0e10cSrcweir break; 1003cdf0e10cSrcweir case SID_CONTOUR_EXEC: 1004cdf0e10cSrcweir { 1005cdf0e10cSrcweir SvxContourDlg *pDlg = SWCONTOURDLG(GetView()); 1006cdf0e10cSrcweir 1007cdf0e10cSrcweir // Kontrolle, ob Zuweisung ueberhaupt sinnvoll/erlaubt 1008cdf0e10cSrcweir int nSel = rSh.GetSelectionType(); 1009cdf0e10cSrcweir if ( nSel & (nsSelectionType::SEL_GRF|nsSelectionType::SEL_OLE) ) 1010cdf0e10cSrcweir { 1011cdf0e10cSrcweir if ( pDlg->GetEditingObject() == rSh.GetIMapInventor() ) 1012cdf0e10cSrcweir { 1013cdf0e10cSrcweir rSh.StartAction(); 1014cdf0e10cSrcweir SfxItemSet aSet( rSh.GetAttrPool(), RES_SURROUND, RES_SURROUND); 1015cdf0e10cSrcweir rSh.GetFlyFrmAttr( aSet ); 1016cdf0e10cSrcweir SwFmtSurround aSur( (SwFmtSurround&)aSet.Get( RES_SURROUND ) ); 1017cdf0e10cSrcweir if ( !aSur.IsContour() ) 1018cdf0e10cSrcweir { 1019cdf0e10cSrcweir aSur.SetContour( sal_True ); 1020cdf0e10cSrcweir if ( aSur.GetSurround() == SURROUND_NONE ) 1021cdf0e10cSrcweir aSur.SetSurround( SURROUND_PARALLEL ); 1022cdf0e10cSrcweir aSet.Put( aSur ); 1023cdf0e10cSrcweir rSh.SetFlyFrmAttr( aSet ); 1024cdf0e10cSrcweir } 1025cdf0e10cSrcweir const PolyPolygon aPoly( pDlg->GetPolyPolygon() ); 1026cdf0e10cSrcweir rSh.SetGraphicPolygon( &aPoly ); 1027cdf0e10cSrcweir if ( pDlg->IsGraphicChanged() ) 1028cdf0e10cSrcweir rSh.ReRead( aEmptyStr, aEmptyStr, &pDlg->GetGraphic()); 1029cdf0e10cSrcweir rSh.EndAction(); 1030cdf0e10cSrcweir } 1031cdf0e10cSrcweir } 1032cdf0e10cSrcweir } 1033cdf0e10cSrcweir break; 1034cdf0e10cSrcweir case FN_FRAME_TO_ANCHOR: 1035cdf0e10cSrcweir { 1036cdf0e10cSrcweir rSh.GotoFlyAnchor(); 1037cdf0e10cSrcweir rSh.EnterStdMode(); 1038cdf0e10cSrcweir rSh.CallChgLnk(); 1039cdf0e10cSrcweir } 1040cdf0e10cSrcweir break; 1041cdf0e10cSrcweir case FN_TOOL_ANKER: 1042cdf0e10cSrcweir break; 1043cdf0e10cSrcweir case FN_TOOL_ANKER_PAGE: 1044cdf0e10cSrcweir case FN_TOOL_ANKER_PARAGRAPH: 1045cdf0e10cSrcweir case FN_TOOL_ANKER_CHAR: 1046cdf0e10cSrcweir case FN_TOOL_ANKER_AT_CHAR: 1047cdf0e10cSrcweir case FN_TOOL_ANKER_FRAME: 1048cdf0e10cSrcweir { 1049cdf0e10cSrcweir RndStdIds eSet = nSlot == FN_TOOL_ANKER_PAGE 1050cdf0e10cSrcweir ? FLY_AT_PAGE 1051cdf0e10cSrcweir : nSlot == FN_TOOL_ANKER_PARAGRAPH 1052cdf0e10cSrcweir ? FLY_AT_PARA 1053cdf0e10cSrcweir : nSlot == FN_TOOL_ANKER_FRAME 1054cdf0e10cSrcweir ? FLY_AT_FLY 1055cdf0e10cSrcweir : nSlot == FN_TOOL_ANKER_CHAR 1056cdf0e10cSrcweir ? FLY_AS_CHAR 1057cdf0e10cSrcweir : FLY_AT_CHAR; 1058cdf0e10cSrcweir rSh.StartUndo(); 1059cdf0e10cSrcweir if( rSh.IsObjSelected() ) 1060cdf0e10cSrcweir rSh.ChgAnchor( eSet ); 1061cdf0e10cSrcweir else if( rSh.IsFrmSelected() ) 1062cdf0e10cSrcweir { 1063cdf0e10cSrcweir // Der Set beinhaltet auch VERT/HORI_ORIENT, da in FEShell:: 1064cdf0e10cSrcweir // SetFlyFrmAttr/SetFlyFrmAnchor ggf. als Folge des Umankerns 1065cdf0e10cSrcweir // die Ausrichtungen veraendert werden sollen. 1066cdf0e10cSrcweir SfxItemSet aSet( GetPool(), RES_VERT_ORIENT, RES_ANCHOR ); 1067cdf0e10cSrcweir SwFmtAnchor aAnc( eSet, rSh.GetPhyPageNum() ); 1068cdf0e10cSrcweir aSet.Put( aAnc ); 1069cdf0e10cSrcweir rSh.SetFlyFrmAttr(aSet); 1070cdf0e10cSrcweir } 1071cdf0e10cSrcweir 1072cdf0e10cSrcweir // if new anchor is 'as char' and it is a Math object and the usual 1073cdf0e10cSrcweir // pre-conditions are met then align the formula to the baseline of the text 1074cdf0e10cSrcweir const uno::Reference < embed::XEmbeddedObject > xObj( rSh.GetOleRef() ); 1075cdf0e10cSrcweir const bool bDoMathBaselineAlignment = xObj.is() && SotExchange::IsMath( xObj->getClassID() ) 1076cdf0e10cSrcweir && FLY_AS_CHAR == eSet && rSh.GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ); 1077cdf0e10cSrcweir if (bDoMathBaselineAlignment) 1078cdf0e10cSrcweir rSh.AlignFormulaToBaseline( xObj ); 1079cdf0e10cSrcweir 1080cdf0e10cSrcweir sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell()); 1081cdf0e10cSrcweir if( nHtmlMode ) 1082cdf0e10cSrcweir { 1083cdf0e10cSrcweir SfxItemSet aSet(GetPool(), RES_SURROUND, RES_HORI_ORIENT); 1084cdf0e10cSrcweir rSh.GetFlyFrmAttr(aSet); 1085cdf0e10cSrcweir 1086cdf0e10cSrcweir const SwFmtSurround& rSurround = (const SwFmtSurround&)aSet.Get(RES_SURROUND); 1087cdf0e10cSrcweir const SwFmtVertOrient& rVert = (const SwFmtVertOrient&)aSet.Get(RES_VERT_ORIENT); 1088cdf0e10cSrcweir const SwFmtHoriOrient& rHori = (const SwFmtHoriOrient&)aSet.Get(RES_HORI_ORIENT); 1089cdf0e10cSrcweir sal_Int16 eVOrient = rVert.GetVertOrient(); 1090cdf0e10cSrcweir sal_Int16 eHOrient = rHori.GetHoriOrient(); 1091cdf0e10cSrcweir SwSurround eSurround = rSurround.GetSurround(); 1092cdf0e10cSrcweir 1093cdf0e10cSrcweir switch( eSet ) 1094cdf0e10cSrcweir { 1095cdf0e10cSrcweir case FLY_AT_FLY: 1096cdf0e10cSrcweir case FLY_AT_PAGE: 1097cdf0e10cSrcweir 1098cdf0e10cSrcweir //Durchlauf, links oder von links, oben, von oben 1099cdf0e10cSrcweir if(eSurround != SURROUND_THROUGHT) 1100cdf0e10cSrcweir aSet.Put(SwFmtSurround(SURROUND_THROUGHT)); 1101cdf0e10cSrcweir 1102cdf0e10cSrcweir if( eVOrient != text::VertOrientation::TOP && eVOrient != text::VertOrientation::NONE) 1103cdf0e10cSrcweir aSet.Put(SwFmtVertOrient(0, text::VertOrientation::TOP)); 1104cdf0e10cSrcweir 1105cdf0e10cSrcweir if(eHOrient != text::HoriOrientation::NONE || eHOrient != text::HoriOrientation::LEFT) 1106cdf0e10cSrcweir aSet.Put(SwFmtHoriOrient(0, text::HoriOrientation::LEFT)); 1107cdf0e10cSrcweir break; 1108cdf0e10cSrcweir 1109cdf0e10cSrcweir case FLY_AT_PARA: 1110cdf0e10cSrcweir //links, von links, rechts, oben, kein Uml, li+re Umlauf, 1111cdf0e10cSrcweir if(eSurround != SURROUND_LEFT || eSurround != SURROUND_RIGHT) 1112cdf0e10cSrcweir aSet.Put(SwFmtSurround(SURROUND_LEFT)); 1113cdf0e10cSrcweir 1114cdf0e10cSrcweir if( eVOrient != text::VertOrientation::TOP) 1115cdf0e10cSrcweir aSet.Put(SwFmtVertOrient(0, text::VertOrientation::TOP)); 1116cdf0e10cSrcweir 1117cdf0e10cSrcweir if(eHOrient != text::HoriOrientation::NONE || eHOrient != text::HoriOrientation::LEFT || eHOrient != text::HoriOrientation::RIGHT) 1118cdf0e10cSrcweir aSet.Put(SwFmtHoriOrient(0, text::HoriOrientation::LEFT)); 1119cdf0e10cSrcweir break; 1120cdf0e10cSrcweir 1121cdf0e10cSrcweir case FLY_AT_CHAR: 1122cdf0e10cSrcweir //links, von links, rechts, oben, Durchlauf 1123cdf0e10cSrcweir if(eSurround != SURROUND_THROUGHT) 1124cdf0e10cSrcweir aSet.Put(SwFmtSurround(SURROUND_THROUGHT)); 1125cdf0e10cSrcweir 1126cdf0e10cSrcweir if( eVOrient != text::VertOrientation::TOP) 1127cdf0e10cSrcweir aSet.Put(SwFmtVertOrient(0, text::VertOrientation::TOP)); 1128cdf0e10cSrcweir 1129cdf0e10cSrcweir if(eHOrient != text::HoriOrientation::NONE || eHOrient != text::HoriOrientation::LEFT || eHOrient != text::HoriOrientation::RIGHT) 1130cdf0e10cSrcweir aSet.Put(SwFmtHoriOrient(0, text::HoriOrientation::LEFT)); 1131cdf0e10cSrcweir break; 1132cdf0e10cSrcweir 1133cdf0e10cSrcweir default: 1134cdf0e10cSrcweir ; 1135cdf0e10cSrcweir } 1136cdf0e10cSrcweir 1137cdf0e10cSrcweir if( aSet.Count() ) 1138cdf0e10cSrcweir rSh.SetFlyFrmAttr( aSet ); 1139cdf0e10cSrcweir } 1140cdf0e10cSrcweir rSh.EndUndo(); 1141cdf0e10cSrcweir 1142cdf0e10cSrcweir GetView().GetViewFrame()->GetBindings().Invalidate( FN_TOOL_ANKER ); 1143cdf0e10cSrcweir } 1144cdf0e10cSrcweir break; 1145cdf0e10cSrcweir 1146cdf0e10cSrcweir case FN_FRAME_NOWRAP: 1147cdf0e10cSrcweir case FN_FRAME_WRAP: 1148cdf0e10cSrcweir case FN_FRAME_WRAP_IDEAL: 1149cdf0e10cSrcweir case FN_FRAME_WRAPTHRU: 1150cdf0e10cSrcweir case FN_FRAME_WRAPTHRU_TRANSP: 1151cdf0e10cSrcweir case FN_FRAME_WRAP_CONTOUR: 1152cdf0e10cSrcweir case FN_WRAP_ANCHOR_ONLY: 1153cdf0e10cSrcweir case FN_FRAME_WRAP_LEFT: 1154cdf0e10cSrcweir case FN_FRAME_WRAP_RIGHT: 1155cdf0e10cSrcweir SetWrapMode( nSlot ); 1156cdf0e10cSrcweir break; 1157cdf0e10cSrcweir 1158cdf0e10cSrcweir case FN_UPDATE_ALL_LINKS: 1159cdf0e10cSrcweir { 1160cdf0e10cSrcweir if( rSh.GetLinkManager().GetLinks().Count() ) 1161cdf0e10cSrcweir { 1162cdf0e10cSrcweir sal_Bool bUpdateGrf = sal_False, bCallErrHdl = sal_False; 1163cdf0e10cSrcweir rSh.EnterStdMode(); 1164cdf0e10cSrcweir rSh.StartAllAction(); 1165cdf0e10cSrcweir rSh.GetLinkManager().UpdateAllLinks( sal_False, bCallErrHdl, bUpdateGrf ); 1166cdf0e10cSrcweir rSh.EndAllAction(); 1167cdf0e10cSrcweir } 1168cdf0e10cSrcweir } 1169cdf0e10cSrcweir break; 1170cdf0e10cSrcweir 1171cdf0e10cSrcweir case FN_XFORMS_DESIGN_MODE: 1172cdf0e10cSrcweir if( pArgs != NULL 1173cdf0e10cSrcweir && pArgs->GetItemState( nSlot, sal_True, &pItem ) == SFX_ITEM_SET 1174cdf0e10cSrcweir && pItem != NULL 1175cdf0e10cSrcweir && pItem->ISA( SfxBoolItem ) ) 1176cdf0e10cSrcweir { 1177cdf0e10cSrcweir sal_Bool bDesignMode = 1178cdf0e10cSrcweir static_cast<const SfxBoolItem*>( pItem )->GetValue(); 1179cdf0e10cSrcweir 1180cdf0e10cSrcweir // set form design mode 1181cdf0e10cSrcweir DBG_ASSERT( GetView().GetFormShell() != NULL, "form shell?" ); 1182cdf0e10cSrcweir SfxRequest aReq( GetView().GetViewFrame(), SID_FM_DESIGN_MODE ); 1183cdf0e10cSrcweir aReq.AppendItem( SfxBoolItem( SID_FM_DESIGN_MODE, bDesignMode ) ); 1184cdf0e10cSrcweir GetView().GetFormShell()->Execute( aReq ); 1185cdf0e10cSrcweir aReq.Done(); 1186cdf0e10cSrcweir 1187cdf0e10cSrcweir // also set suitable view options 1188cdf0e10cSrcweir SwViewOption aViewOption = *rSh.GetViewOptions(); 1189cdf0e10cSrcweir aViewOption.SetFormView( ! bDesignMode ); 1190cdf0e10cSrcweir rSh.ApplyViewOptions( aViewOption ); 1191cdf0e10cSrcweir } 1192cdf0e10cSrcweir break; 1193cdf0e10cSrcweir 1194cdf0e10cSrcweir default: 1195cdf0e10cSrcweir bMore = sal_True; 1196cdf0e10cSrcweir } 1197cdf0e10cSrcweir if(bMore && pArgs) 1198cdf0e10cSrcweir { 1199cdf0e10cSrcweir pItem = 0; 1200cdf0e10cSrcweir pArgs->GetItemState(GetPool().GetWhich(nSlot), sal_False, &pItem); 1201cdf0e10cSrcweir if(pItem) 1202cdf0e10cSrcweir switch(nSlot) 1203cdf0e10cSrcweir { 1204cdf0e10cSrcweir case SID_ATTR_BRUSH: 1205cdf0e10cSrcweir case SID_ATTR_BORDER_SHADOW: 1206cdf0e10cSrcweir case RES_SHADOW: 1207cdf0e10cSrcweir { 1208cdf0e10cSrcweir rSh.StartAllAction(); 1209cdf0e10cSrcweir SfxItemSet aSet( rSh.GetAttrPool(), 1210cdf0e10cSrcweir RES_SHADOW, RES_SHADOW, 1211cdf0e10cSrcweir RES_BACKGROUND, RES_BACKGROUND, 0 ); 1212cdf0e10cSrcweir 1213cdf0e10cSrcweir aSet.Put(*pItem); 1214cdf0e10cSrcweir // Tabellenzelle(n) selektiert? 1215cdf0e10cSrcweir if ( rSh.IsTableMode() ) 1216cdf0e10cSrcweir { 1217cdf0e10cSrcweir SwFrmFmt *pFmt = rSh.GetTableFmt(); 1218cdf0e10cSrcweir pFmt->SetFmtAttr( *pItem ); 1219cdf0e10cSrcweir } 1220cdf0e10cSrcweir else if ( rSh.IsFrmSelected() ) 1221cdf0e10cSrcweir { 1222cdf0e10cSrcweir // Umrandungsattribute ueber Frame-Manager setzen 1223cdf0e10cSrcweir SwFlyFrmAttrMgr aMgr( sal_False, &rSh, FRMMGR_TYPE_NONE ); 1224cdf0e10cSrcweir aMgr.SetAttrSet( *pArgs ); 1225cdf0e10cSrcweir aMgr.UpdateFlyFrm(); 1226cdf0e10cSrcweir } 1227cdf0e10cSrcweir else 1228cdf0e10cSrcweir { 1229cdf0e10cSrcweir rSh.SetAttr( *pArgs ); 1230cdf0e10cSrcweir } 1231cdf0e10cSrcweir rSh.EndAllAction(); 1232cdf0e10cSrcweir } 1233cdf0e10cSrcweir break; 1234cdf0e10cSrcweir case FN_PAGE_STYLE_SET_LR_MARGIN: 1235cdf0e10cSrcweir case FN_PAGE_STYLE_SET_UL_MARGIN: 1236cdf0e10cSrcweir case FN_PAGE_STYLE_SET_NUMBER_FORMAT: 1237cdf0e10cSrcweir case FN_PAGE_STYLE_SET_PAPER_SIZE: 1238cdf0e10cSrcweir case FN_PAGE_STYLE_SET_PAPER_BIN: 1239cdf0e10cSrcweir { 1240cdf0e10cSrcweir DBG_ERROR("not implemented"); 1241cdf0e10cSrcweir } 1242cdf0e10cSrcweir break; 1243cdf0e10cSrcweir 1244cdf0e10cSrcweir case SID_ATTR_BORDER_OUTER: 1245cdf0e10cSrcweir { 1246cdf0e10cSrcweir // Tabellenzelle(n) selektiert? 1247cdf0e10cSrcweir if ( rSh.IsTableMode() ) 1248cdf0e10cSrcweir { 1249cdf0e10cSrcweir // Umrandungattribute Get/SetTabBorders() setzen 1250cdf0e10cSrcweir rSh.SetTabBorders(*pArgs); 1251cdf0e10cSrcweir } 1252cdf0e10cSrcweir else if ( rSh.IsFrmSelected() ) 1253cdf0e10cSrcweir { 1254cdf0e10cSrcweir // Umrandungsattribute ueber Frame-Manager setzen 1255cdf0e10cSrcweir SwFlyFrmAttrMgr aMgr( sal_False, &rSh, FRMMGR_TYPE_NONE ); 1256cdf0e10cSrcweir aMgr.SetAttrSet(*pArgs); 1257cdf0e10cSrcweir aMgr.UpdateFlyFrm(); 1258cdf0e10cSrcweir } 1259cdf0e10cSrcweir else 1260cdf0e10cSrcweir { 1261cdf0e10cSrcweir // Umrandungsattribute ganz normal ueber Shell setzen 1262cdf0e10cSrcweir rSh.SetAttr( *pItem ); 1263cdf0e10cSrcweir } 1264cdf0e10cSrcweir } 1265cdf0e10cSrcweir break; 1266cdf0e10cSrcweir default: 1267cdf0e10cSrcweir DBG_ERROR("falscher Dispatcher"); 1268cdf0e10cSrcweir } 1269cdf0e10cSrcweir 1270cdf0e10cSrcweir } 1271cdf0e10cSrcweir } 1272cdf0e10cSrcweir 1273cdf0e10cSrcweir /* -----------------14.04.99 15:10------------------- 1274cdf0e10cSrcweir * Hier wird der State fuer SID_IMAP / SID_CONTOUR behandelt, 1275cdf0e10cSrcweir * wenn die Grafik ausgeswappt ist 1276cdf0e10cSrcweir * --------------------------------------------------*/ 1277cdf0e10cSrcweir IMPL_LINK(SwBaseShell, GraphicArrivedHdl, SwCrsrShell* , EMPTYARG ) 1278cdf0e10cSrcweir { 1279cdf0e10cSrcweir sal_uInt16 nGrfType; 1280cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 1281cdf0e10cSrcweir if( CNT_GRF == rSh.SwEditShell::GetCntType() && 1282cdf0e10cSrcweir GRAPHIC_NONE != ( nGrfType = rSh.GetGraphicType() ) && 1283cdf0e10cSrcweir aGrfUpdateSlots.Count() ) 1284cdf0e10cSrcweir { 1285cdf0e10cSrcweir sal_Bool bProtect = 0 != rSh.IsSelObjProtected(FLYPROTECT_CONTENT|FLYPROTECT_PARENT); 1286cdf0e10cSrcweir SfxViewFrame* pVFrame = GetView().GetViewFrame(); 1287cdf0e10cSrcweir sal_uInt16 nSlot; 1288cdf0e10cSrcweir for( sal_uInt16 n = 0; n < aGrfUpdateSlots.Count(); ++n ) 1289cdf0e10cSrcweir { 1290cdf0e10cSrcweir sal_Bool bSetState = sal_False; 1291cdf0e10cSrcweir sal_Bool bState = sal_False; 1292cdf0e10cSrcweir switch( nSlot = aGrfUpdateSlots[ n ] ) 1293cdf0e10cSrcweir { 1294cdf0e10cSrcweir case SID_IMAP: 1295cdf0e10cSrcweir case SID_IMAP_EXEC: 1296cdf0e10cSrcweir { 1297cdf0e10cSrcweir sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId(); 1298cdf0e10cSrcweir SvxIMapDlg *pDlg = pVFrame->HasChildWindow( nId ) ? 1299cdf0e10cSrcweir (SvxIMapDlg*) ( pVFrame->GetChildWindow( nId ) 1300cdf0e10cSrcweir ->GetWindow()) : 0; 1301cdf0e10cSrcweir 1302cdf0e10cSrcweir if( pDlg && ( SID_IMAP_EXEC == nSlot || 1303cdf0e10cSrcweir ( SID_IMAP == nSlot && !bProtect)) && 1304cdf0e10cSrcweir pDlg->GetEditingObject() != rSh.GetIMapInventor()) 1305cdf0e10cSrcweir lcl_UpdateIMapDlg( rSh ); 1306cdf0e10cSrcweir 1307cdf0e10cSrcweir if( !bProtect && SID_IMAP == nSlot ) 1308cdf0e10cSrcweir bSetState = sal_True, bState = 0 != pDlg; 1309cdf0e10cSrcweir } 1310cdf0e10cSrcweir break; 1311cdf0e10cSrcweir 1312cdf0e10cSrcweir case SID_CONTOUR_DLG: 1313cdf0e10cSrcweir if( !bProtect ) 1314cdf0e10cSrcweir { 1315cdf0e10cSrcweir sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId(); 1316cdf0e10cSrcweir SvxIMapDlg *pDlg = pVFrame->HasChildWindow( nId ) ? 1317cdf0e10cSrcweir (SvxIMapDlg*) ( pVFrame->GetChildWindow( nId ) 1318cdf0e10cSrcweir ->GetWindow()) : 0; 1319cdf0e10cSrcweir if( pDlg && pDlg->GetEditingObject() != 1320cdf0e10cSrcweir rSh.GetIMapInventor() ) 1321cdf0e10cSrcweir lcl_UpdateContourDlg( rSh, nsSelectionType::SEL_GRF ); 1322cdf0e10cSrcweir 1323cdf0e10cSrcweir bSetState = sal_True; 1324cdf0e10cSrcweir bState = 0 != pDlg; 1325cdf0e10cSrcweir } 1326cdf0e10cSrcweir break; 1327cdf0e10cSrcweir 1328cdf0e10cSrcweir case FN_FRAME_WRAP_CONTOUR: 1329cdf0e10cSrcweir if( !bProtect ) 1330cdf0e10cSrcweir { 1331cdf0e10cSrcweir SfxItemSet aSet(GetPool(), RES_SURROUND, RES_SURROUND); 1332cdf0e10cSrcweir rSh.GetFlyFrmAttr(aSet); 1333cdf0e10cSrcweir const SwFmtSurround& rWrap = (const SwFmtSurround&)aSet.Get(RES_SURROUND); 1334cdf0e10cSrcweir bSetState = sal_True; 1335cdf0e10cSrcweir bState = rWrap.IsContour(); 1336cdf0e10cSrcweir } 1337cdf0e10cSrcweir break; 1338cdf0e10cSrcweir 1339cdf0e10cSrcweir case SID_GRFFILTER: 1340cdf0e10cSrcweir case SID_GRFFILTER_INVERT: 1341cdf0e10cSrcweir case SID_GRFFILTER_SMOOTH: 1342cdf0e10cSrcweir case SID_GRFFILTER_SHARPEN: 1343cdf0e10cSrcweir case SID_GRFFILTER_REMOVENOISE: 1344cdf0e10cSrcweir case SID_GRFFILTER_SOBEL: 1345cdf0e10cSrcweir case SID_GRFFILTER_MOSAIC: 1346cdf0e10cSrcweir case SID_GRFFILTER_EMBOSS: 1347cdf0e10cSrcweir case SID_GRFFILTER_POSTER: 1348cdf0e10cSrcweir case SID_GRFFILTER_POPART: 1349cdf0e10cSrcweir case SID_GRFFILTER_SEPIA: 1350cdf0e10cSrcweir case SID_GRFFILTER_SOLARIZE: 1351cdf0e10cSrcweir bSetState = bState = GRAPHIC_BITMAP == nGrfType; 1352cdf0e10cSrcweir break; 1353cdf0e10cSrcweir } 1354cdf0e10cSrcweir 1355cdf0e10cSrcweir if( bSetState ) 1356cdf0e10cSrcweir { 1357cdf0e10cSrcweir SfxBoolItem aBool( nSlot, bState ); 1358cdf0e10cSrcweir if( pGetStateSet ) 1359cdf0e10cSrcweir pGetStateSet->Put( aBool ); 1360cdf0e10cSrcweir else 1361cdf0e10cSrcweir pVFrame->GetBindings().SetState( aBool ); 1362cdf0e10cSrcweir } 1363cdf0e10cSrcweir } 1364cdf0e10cSrcweir aGrfUpdateSlots.RemoveAt( 0, aGrfUpdateSlots.Count() ); 1365cdf0e10cSrcweir } 1366cdf0e10cSrcweir return 0; 1367cdf0e10cSrcweir } 1368cdf0e10cSrcweir 1369cdf0e10cSrcweir void SwBaseShell::GetState( SfxItemSet &rSet ) 1370cdf0e10cSrcweir { 1371cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 1372cdf0e10cSrcweir SfxViewFrame* pVFrame = GetView().GetViewFrame(); 1373cdf0e10cSrcweir SfxWhichIter aIter( rSet ); 1374cdf0e10cSrcweir sal_uInt16 nWhich = aIter.FirstWhich(); 1375cdf0e10cSrcweir pGetStateSet = &rSet; 1376cdf0e10cSrcweir while ( nWhich ) 1377cdf0e10cSrcweir { 1378cdf0e10cSrcweir switch ( nWhich ) 1379cdf0e10cSrcweir { 1380cdf0e10cSrcweir case SID_GALLERY_FORMATS: 1381cdf0e10cSrcweir if ( rSh.IsObjSelected() || 1382cdf0e10cSrcweir (rSh.IsSelFrmMode() && 1383cdf0e10cSrcweir !(rSh.GetSelectionType() & nsSelectionType::SEL_GRF)) ) 1384cdf0e10cSrcweir rSet.DisableItem( nWhich ); 1385cdf0e10cSrcweir break; 1386cdf0e10cSrcweir case SID_GALLERY_ENABLE_ADDCOPY: 1387cdf0e10cSrcweir // #108230# allow copy from gallery in Writer AND Writer/Web! 1388cdf0e10cSrcweir rSet.Put( SfxBoolItem( SID_GALLERY_ENABLE_ADDCOPY, sal_True ) ); 1389cdf0e10cSrcweir break; 1390cdf0e10cSrcweir case FN_EDIT_REGION: 1391cdf0e10cSrcweir if( !rSh.IsAnySectionInDoc() ) 1392cdf0e10cSrcweir rSet.DisableItem(nWhich); 1393cdf0e10cSrcweir break; 1394cdf0e10cSrcweir 1395cdf0e10cSrcweir case FN_INSERT_REGION: 1396cdf0e10cSrcweir if( rSh.IsSelFrmMode() || 1397cdf0e10cSrcweir !rSh.IsInsRegionAvailable() ) 1398cdf0e10cSrcweir rSet.DisableItem( nWhich ); 1399cdf0e10cSrcweir break; 1400cdf0e10cSrcweir case FN_CONVERT_TABLE_TO_TEXT: 1401cdf0e10cSrcweir { 1402cdf0e10cSrcweir sal_uInt16 eFrmType = rSh.GetFrmType(0,sal_True); 1403cdf0e10cSrcweir if( (eFrmType & FRMTYPE_FOOTNOTE) || 1404cdf0e10cSrcweir !rSh.GetTableFmt() ) 1405cdf0e10cSrcweir rSet.DisableItem( nWhich ); 1406cdf0e10cSrcweir } 1407cdf0e10cSrcweir break; 1408cdf0e10cSrcweir case FN_CONVERT_TEXT_TO_TABLE: 1409cdf0e10cSrcweir { 1410cdf0e10cSrcweir sal_uInt16 eFrmType = rSh.GetFrmType(0,sal_True); 1411cdf0e10cSrcweir if( (eFrmType & FRMTYPE_FOOTNOTE) || 1412cdf0e10cSrcweir !rSh.IsTextToTableAvailable() ) 1413cdf0e10cSrcweir rSet.DisableItem( nWhich ); 1414cdf0e10cSrcweir } 1415cdf0e10cSrcweir break; 1416cdf0e10cSrcweir case FN_CONVERT_TEXT_TABLE: 1417cdf0e10cSrcweir { 1418cdf0e10cSrcweir sal_uInt16 eFrmType = rSh.GetFrmType(0,sal_True); 1419cdf0e10cSrcweir if( (eFrmType & FRMTYPE_FOOTNOTE) || 1420cdf0e10cSrcweir (!rSh.GetTableFmt() && !rSh.IsTextToTableAvailable() ) ) 1421cdf0e10cSrcweir rSet.DisableItem( nWhich ); 1422cdf0e10cSrcweir } 1423cdf0e10cSrcweir break; 1424cdf0e10cSrcweir case RES_SHADOW: 1425cdf0e10cSrcweir { 1426cdf0e10cSrcweir SfxItemSet aSet( rSh.GetAttrPool(), 1427cdf0e10cSrcweir RES_SHADOW, RES_SHADOW ); 1428cdf0e10cSrcweir 1429cdf0e10cSrcweir // Tabellenzelle(n) selektiert? 1430cdf0e10cSrcweir if ( rSh.IsTableMode() ) 1431cdf0e10cSrcweir { 1432cdf0e10cSrcweir SwFrmFmt *pFmt = rSh.GetTableFmt(); 1433cdf0e10cSrcweir aSet.Put(pFmt->GetFmtAttr( nWhich, sal_True )); 1434cdf0e10cSrcweir } 1435cdf0e10cSrcweir else if( rSh.IsFrmSelected() ) 1436cdf0e10cSrcweir { 1437cdf0e10cSrcweir SwFlyFrmAttrMgr aMgr( sal_False, &rSh, FRMMGR_TYPE_NONE ); 1438cdf0e10cSrcweir aSet.Put( aMgr.GetAttrSet() ); 1439cdf0e10cSrcweir } 1440cdf0e10cSrcweir else 1441cdf0e10cSrcweir rSh.GetCurAttr( aSet ); 1442cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 1443cdf0e10cSrcweir 1444cdf0e10cSrcweir const SvxShadowItem& rShItem = (const SvxShadowItem&)aSet.Get(nWhich); 1445cdf0e10cSrcweir rSet.Put(rShItem); 1446cdf0e10cSrcweir #else 1447cdf0e10cSrcweir rSet.Put((const SvxShadowItem&)aSet.Get(nWhich)); 1448cdf0e10cSrcweir #endif 1449cdf0e10cSrcweir } 1450cdf0e10cSrcweir break; 1451cdf0e10cSrcweir case SID_IMAP: 1452cdf0e10cSrcweir { 1453cdf0e10cSrcweir // --> OD 2006-11-08 #i59688# 1454cdf0e10cSrcweir // improve efficiency: 1455cdf0e10cSrcweir // If selected object is protected, item has to disabled. 1456cdf0e10cSrcweir const sal_Bool bProtect = 0 != rSh.IsSelObjProtected(FLYPROTECT_CONTENT|FLYPROTECT_PARENT); 1457cdf0e10cSrcweir if ( bProtect ) 1458cdf0e10cSrcweir { 1459cdf0e10cSrcweir rSet.DisableItem( nWhich ); 1460cdf0e10cSrcweir } 1461cdf0e10cSrcweir else 1462cdf0e10cSrcweir { 1463cdf0e10cSrcweir const sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId(); 1464cdf0e10cSrcweir const sal_Bool bHas = pVFrame->HasChildWindow( nId ); 1465cdf0e10cSrcweir const sal_Bool bFrmSel = rSh.IsFrmSelected(); 1466cdf0e10cSrcweir const sal_Bool bIsGraphicSelection = 1467cdf0e10cSrcweir rSh.GetSelectionType() == nsSelectionType::SEL_GRF; 1468cdf0e10cSrcweir 1469cdf0e10cSrcweir // --> OD 2006-11-08 #i59688# 1470cdf0e10cSrcweir // avoid unnecessary loading of selected graphic. 1471cdf0e10cSrcweir // The graphic is only needed, if the dialog is open. 1472cdf0e10cSrcweir //wenn die Grafik ausgeswappt ist, dann muss der 1473cdf0e10cSrcweir //Status asynchron ermittelt werden 1474cdf0e10cSrcweir //bis dahin wird der Slot disabled 1475cdf0e10cSrcweir if ( bHas && bIsGraphicSelection && rSh.IsGrfSwapOut( sal_True ) ) 1476cdf0e10cSrcweir { 1477cdf0e10cSrcweir if( AddGrfUpdateSlot( nWhich )) 1478cdf0e10cSrcweir rSh.GetGraphic(sal_False); // start the loading 1479cdf0e10cSrcweir } 1480cdf0e10cSrcweir else 1481cdf0e10cSrcweir { 1482cdf0e10cSrcweir if ( !bHas && 1483cdf0e10cSrcweir ( !bFrmSel || 1484cdf0e10cSrcweir ( bIsGraphicSelection && 1485cdf0e10cSrcweir rSh.GetGraphicType() == GRAPHIC_NONE ) ) ) 1486cdf0e10cSrcweir { 1487cdf0e10cSrcweir rSet.DisableItem( nWhich ); 1488cdf0e10cSrcweir } 1489cdf0e10cSrcweir else 1490cdf0e10cSrcweir { 1491cdf0e10cSrcweir SfxBoolItem aBool(nWhich, bHas); 1492cdf0e10cSrcweir if ( bHas && bFrmSel ) 1493cdf0e10cSrcweir lcl_UpdateIMapDlg( rSh ); 1494cdf0e10cSrcweir rSet.Put(aBool); 1495cdf0e10cSrcweir } 1496cdf0e10cSrcweir } 1497cdf0e10cSrcweir // <-- 1498cdf0e10cSrcweir } 1499cdf0e10cSrcweir // <-- 1500cdf0e10cSrcweir } 1501cdf0e10cSrcweir break; 1502cdf0e10cSrcweir case SID_IMAP_EXEC: 1503cdf0e10cSrcweir { 1504cdf0e10cSrcweir sal_Bool bDisable = sal_False; 1505cdf0e10cSrcweir if( !rSh.IsFrmSelected()) 1506cdf0e10cSrcweir bDisable = sal_True; 1507cdf0e10cSrcweir sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId(); 1508cdf0e10cSrcweir if(!bDisable && pVFrame->HasChildWindow( nId )) 1509cdf0e10cSrcweir { 1510cdf0e10cSrcweir if(rSh.GetSelectionType() == nsSelectionType::SEL_GRF 1511cdf0e10cSrcweir && rSh.IsGrfSwapOut(sal_True)) 1512cdf0e10cSrcweir { 1513cdf0e10cSrcweir if( AddGrfUpdateSlot( nWhich )) 1514cdf0e10cSrcweir rSh.GetGraphic(sal_False); // start the loading 1515cdf0e10cSrcweir } 1516cdf0e10cSrcweir else 1517cdf0e10cSrcweir { 1518cdf0e10cSrcweir SvxIMapDlg *pDlg = SWIMAPDLG(GetView()); 1519cdf0e10cSrcweir if( pDlg->GetEditingObject() != rSh.GetIMapInventor() ) 1520cdf0e10cSrcweir lcl_UpdateIMapDlg( rSh ); 1521cdf0e10cSrcweir } 1522cdf0e10cSrcweir } 1523cdf0e10cSrcweir rSet.Put(SfxBoolItem(nWhich, bDisable)); 1524cdf0e10cSrcweir } 1525cdf0e10cSrcweir break; 1526cdf0e10cSrcweir case FN_BACKSPACE: 1527cdf0e10cSrcweir case SID_DELETE: 1528cdf0e10cSrcweir if (rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0) 1529cdf0e10cSrcweir rSet.DisableItem( nWhich ); 1530cdf0e10cSrcweir break; 1531cdf0e10cSrcweir case SID_CONTOUR_DLG: 1532cdf0e10cSrcweir { 1533cdf0e10cSrcweir sal_Bool bParentCntProt = 0 != rSh.IsSelObjProtected(FLYPROTECT_CONTENT|FLYPROTECT_PARENT ); 1534cdf0e10cSrcweir 1535cdf0e10cSrcweir if( bParentCntProt || 0 != (HTMLMODE_ON & ::GetHtmlMode( 1536cdf0e10cSrcweir GetView().GetDocShell() )) ) 1537cdf0e10cSrcweir rSet.DisableItem( nWhich ); 1538cdf0e10cSrcweir else 1539cdf0e10cSrcweir { 1540cdf0e10cSrcweir sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId(); 1541cdf0e10cSrcweir sal_Bool bHas = GetView().GetViewFrame()->HasChildWindow( nId ); 1542cdf0e10cSrcweir int nSel = rSh.GetSelectionType(); 1543cdf0e10cSrcweir sal_Bool bOk = 0 != (nSel & (nsSelectionType::SEL_GRF|nsSelectionType::SEL_OLE)); 1544cdf0e10cSrcweir 1545cdf0e10cSrcweir sal_Bool bDisable = sal_False; 1546cdf0e10cSrcweir if( !bHas && !bOk ) 1547cdf0e10cSrcweir bDisable = sal_True; 1548cdf0e10cSrcweir // --> OD 2006-11-08 #i59688# 1549cdf0e10cSrcweir // avoid unnecessary loading of selected graphic. 1550cdf0e10cSrcweir // The graphic is only needed, if the dialog is open. 1551cdf0e10cSrcweir // wenn die Grafik ausgeswappt ist, dann muss der Status 1552cdf0e10cSrcweir // asynchron ermittelt werden bis dahin wird der Slot 1553cdf0e10cSrcweir // disabled 1554cdf0e10cSrcweir else if ( bHas && (nSel & nsSelectionType::SEL_GRF) && 1555cdf0e10cSrcweir rSh.IsGrfSwapOut(sal_True) ) 1556cdf0e10cSrcweir { 1557cdf0e10cSrcweir if( AddGrfUpdateSlot( nWhich )) 1558cdf0e10cSrcweir rSh.GetGraphic(sal_False); // start the loading 1559cdf0e10cSrcweir // --> OD 2007-07-04 #i75481# 1560cdf0e10cSrcweir bDisable = sal_True; 1561cdf0e10cSrcweir // <-- 1562cdf0e10cSrcweir } 1563cdf0e10cSrcweir else if( bHas && bOk ) 1564cdf0e10cSrcweir bDisable = !lcl_UpdateContourDlg( rSh, nSel ); 1565cdf0e10cSrcweir else if( bOk ) 1566cdf0e10cSrcweir { 1567cdf0e10cSrcweir // --> OD 2007-07-04 #i75481# 1568cdf0e10cSrcweir // apply fix #i59688# only for selected graphics 1569cdf0e10cSrcweir if ( nSel & nsSelectionType::SEL_GRF ) 1570cdf0e10cSrcweir bDisable = GRAPHIC_NONE == rSh.GetGraphicType(); 1571cdf0e10cSrcweir else 1572cdf0e10cSrcweir bDisable = GRAPHIC_NONE == rSh.GetIMapGraphic().GetType(); 1573cdf0e10cSrcweir // <-- 1574cdf0e10cSrcweir } 1575cdf0e10cSrcweir // <-- 1576cdf0e10cSrcweir 1577cdf0e10cSrcweir if( bDisable ) 1578cdf0e10cSrcweir rSet.DisableItem( nWhich ); 1579cdf0e10cSrcweir else 1580cdf0e10cSrcweir rSet.Put( SfxBoolItem(nWhich, bHas) ); 1581cdf0e10cSrcweir } 1582cdf0e10cSrcweir } 1583cdf0e10cSrcweir break; 1584cdf0e10cSrcweir case SID_CONTOUR_EXEC: 1585cdf0e10cSrcweir { 1586cdf0e10cSrcweir sal_Bool bDisable = sal_False; 1587cdf0e10cSrcweir int nSel = rSh.GetSelectionType(); 1588cdf0e10cSrcweir if( !(nSel & (nsSelectionType::SEL_GRF|nsSelectionType::SEL_OLE)) ) 1589cdf0e10cSrcweir bDisable = sal_True; 1590cdf0e10cSrcweir sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId(); 1591cdf0e10cSrcweir if( !bDisable && GetView().GetViewFrame()->HasChildWindow( nId )) 1592cdf0e10cSrcweir { 1593cdf0e10cSrcweir SvxContourDlg *pDlg = SWCONTOURDLG(GetView()); 1594cdf0e10cSrcweir if( pDlg->GetEditingObject() != rSh.GetIMapInventor() ) 1595cdf0e10cSrcweir bDisable = sal_True; 1596cdf0e10cSrcweir } 1597cdf0e10cSrcweir rSet.Put(SfxBoolItem(nWhich, bDisable)); 1598cdf0e10cSrcweir } 1599cdf0e10cSrcweir break; 1600cdf0e10cSrcweir 1601cdf0e10cSrcweir case FN_TOOL_ANKER: 1602cdf0e10cSrcweir case FN_TOOL_ANKER_PAGE: 1603cdf0e10cSrcweir case FN_TOOL_ANKER_PARAGRAPH: 1604cdf0e10cSrcweir case FN_TOOL_ANKER_CHAR: 1605cdf0e10cSrcweir case FN_TOOL_ANKER_AT_CHAR: 1606cdf0e10cSrcweir case FN_TOOL_ANKER_FRAME: 1607cdf0e10cSrcweir { 1608cdf0e10cSrcweir sal_Bool bObj = 0 != rSh.IsObjSelected(); 1609cdf0e10cSrcweir sal_Bool bParentCntProt = rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0; 1610cdf0e10cSrcweir 1611cdf0e10cSrcweir if( !bParentCntProt && (bObj || rSh.IsFrmSelected())) 1612cdf0e10cSrcweir { 1613cdf0e10cSrcweir SfxItemSet aSet(GetPool(), RES_ANCHOR, RES_ANCHOR); 1614cdf0e10cSrcweir if(bObj) 1615cdf0e10cSrcweir rSh.GetObjAttr(aSet); 1616cdf0e10cSrcweir else 1617cdf0e10cSrcweir rSh.GetFlyFrmAttr(aSet); 1618cdf0e10cSrcweir RndStdIds eSet = ((SwFmtAnchor&)aSet.Get(RES_ANCHOR)).GetAnchorId(); 1619cdf0e10cSrcweir const sal_Bool bSet = 1620cdf0e10cSrcweir ((nWhich == FN_TOOL_ANKER_PAGE) && 1621cdf0e10cSrcweir (eSet == FLY_AT_PAGE)) 1622cdf0e10cSrcweir || ((nWhich == FN_TOOL_ANKER_PARAGRAPH) && 1623cdf0e10cSrcweir (eSet == FLY_AT_PARA)) 1624cdf0e10cSrcweir || ((nWhich == FN_TOOL_ANKER_FRAME) && 1625cdf0e10cSrcweir (eSet == FLY_AT_FLY)) 1626cdf0e10cSrcweir || ((nWhich == FN_TOOL_ANKER_AT_CHAR) && 1627cdf0e10cSrcweir (eSet == FLY_AT_CHAR)) 1628cdf0e10cSrcweir || ((nWhich == FN_TOOL_ANKER_CHAR) && 1629cdf0e10cSrcweir (eSet == FLY_AS_CHAR)); 1630cdf0e10cSrcweir if(nWhich != FN_TOOL_ANKER) 1631cdf0e10cSrcweir { 1632cdf0e10cSrcweir sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell()); 1633cdf0e10cSrcweir if( ( nWhich == FN_TOOL_ANKER_PAGE && 1634cdf0e10cSrcweir ((HTMLMODE_ON & nHtmlMode) && (0 == (nHtmlMode & HTMLMODE_SOME_ABS_POS)))) || 1635cdf0e10cSrcweir ( nWhich == FN_TOOL_ANKER_FRAME && !rSh.IsFlyInFly() ) ) 1636cdf0e10cSrcweir rSet.DisableItem(nWhich); 1637cdf0e10cSrcweir else 1638cdf0e10cSrcweir rSet.Put(SfxBoolItem(nWhich, bSet)); 1639cdf0e10cSrcweir } 1640cdf0e10cSrcweir else 1641cdf0e10cSrcweir { 1642cdf0e10cSrcweir sal_uInt16 nSlotId = 0; 1643cdf0e10cSrcweir 1644cdf0e10cSrcweir switch (eSet) 1645cdf0e10cSrcweir { 1646cdf0e10cSrcweir case FLY_AT_PAGE: 1647cdf0e10cSrcweir nSlotId = FN_TOOL_ANKER_PAGE; 1648cdf0e10cSrcweir break; 1649cdf0e10cSrcweir case FLY_AT_PARA: 1650cdf0e10cSrcweir nSlotId = FN_TOOL_ANKER_PARAGRAPH; 1651cdf0e10cSrcweir break; 1652cdf0e10cSrcweir case FLY_AS_CHAR: 1653cdf0e10cSrcweir nSlotId = FN_TOOL_ANKER_CHAR; 1654cdf0e10cSrcweir break; 1655cdf0e10cSrcweir case FLY_AT_CHAR: 1656cdf0e10cSrcweir nSlotId = FN_TOOL_ANKER_AT_CHAR; 1657cdf0e10cSrcweir break; 1658cdf0e10cSrcweir case FLY_AT_FLY: 1659cdf0e10cSrcweir nSlotId = FN_TOOL_ANKER_FRAME; 1660cdf0e10cSrcweir break; 1661cdf0e10cSrcweir default: 1662cdf0e10cSrcweir ; 1663cdf0e10cSrcweir } 1664cdf0e10cSrcweir rSet.Put(SfxUInt16Item(nWhich, nSlotId)); 1665cdf0e10cSrcweir } 1666cdf0e10cSrcweir } 1667cdf0e10cSrcweir else 1668cdf0e10cSrcweir rSet.DisableItem( nWhich ); 1669cdf0e10cSrcweir } 1670cdf0e10cSrcweir break; 1671cdf0e10cSrcweir case FN_FRAME_NOWRAP: 1672cdf0e10cSrcweir case FN_FRAME_WRAP: 1673cdf0e10cSrcweir case FN_FRAME_WRAP_IDEAL: 1674cdf0e10cSrcweir case FN_FRAME_WRAPTHRU: 1675cdf0e10cSrcweir case FN_FRAME_WRAPTHRU_TRANSP: 1676cdf0e10cSrcweir case FN_FRAME_WRAP_CONTOUR: 1677cdf0e10cSrcweir case FN_WRAP_ANCHOR_ONLY: 1678cdf0e10cSrcweir case FN_FRAME_WRAP_LEFT: 1679cdf0e10cSrcweir case FN_FRAME_WRAP_RIGHT: 1680cdf0e10cSrcweir { 1681cdf0e10cSrcweir sal_Bool bObj = 0 != rSh.IsObjSelected(); 1682cdf0e10cSrcweir sal_Bool bParentCntProt = rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0; 1683cdf0e10cSrcweir 1684cdf0e10cSrcweir if( !bParentCntProt && (bObj || rSh.IsFrmSelected())) 1685cdf0e10cSrcweir { 1686cdf0e10cSrcweir SfxItemSet aSet(GetPool(), RES_OPAQUE, RES_ANCHOR); 1687cdf0e10cSrcweir int nAnchorType; 1688cdf0e10cSrcweir if(bObj) 1689cdf0e10cSrcweir { 1690cdf0e10cSrcweir rSh.GetObjAttr(aSet); 1691cdf0e10cSrcweir nAnchorType = rSh.GetAnchorId(); 1692cdf0e10cSrcweir } 1693cdf0e10cSrcweir else 1694cdf0e10cSrcweir { 1695cdf0e10cSrcweir rSh.GetFlyFrmAttr(aSet); 1696cdf0e10cSrcweir nAnchorType = ((SwFmtAnchor&)aSet.Get(RES_ANCHOR)).GetAnchorId(); 1697cdf0e10cSrcweir } 1698cdf0e10cSrcweir const SwFmtSurround& rWrap = (const SwFmtSurround&)aSet.Get(RES_SURROUND); 1699cdf0e10cSrcweir 1700cdf0e10cSrcweir const SvxOpaqueItem& rOpaque = (const SvxOpaqueItem&)aSet.Get(RES_OPAQUE); 1701cdf0e10cSrcweir sal_Bool bOpaque = rOpaque.GetValue(); 1702cdf0e10cSrcweir SwSurround nSurround = rWrap.GetSurround(); 1703cdf0e10cSrcweir sal_Bool bSet = sal_False; 1704cdf0e10cSrcweir 1705cdf0e10cSrcweir bool bDisable = 1706cdf0e10cSrcweir (nAnchorType == - 1) || (nAnchorType == FLY_AS_CHAR); 1707cdf0e10cSrcweir const bool bHtmlMode = 1708cdf0e10cSrcweir 0 != ::GetHtmlMode(GetView().GetDocShell()); 1709cdf0e10cSrcweir 1710cdf0e10cSrcweir switch( nWhich ) 1711cdf0e10cSrcweir { 1712cdf0e10cSrcweir case FN_FRAME_NOWRAP: 1713cdf0e10cSrcweir bDisable |= 1714cdf0e10cSrcweir ( (nAnchorType != FLY_AT_PARA) 1715cdf0e10cSrcweir && (nAnchorType != FLY_AT_CHAR) 1716cdf0e10cSrcweir && (nAnchorType != FLY_AT_PAGE)); 1717cdf0e10cSrcweir bSet = nSurround == SURROUND_NONE; 1718cdf0e10cSrcweir break; 1719cdf0e10cSrcweir case FN_FRAME_WRAP: 1720cdf0e10cSrcweir bDisable |= bHtmlMode; 1721cdf0e10cSrcweir bSet = nSurround == SURROUND_PARALLEL; 1722cdf0e10cSrcweir break; 1723cdf0e10cSrcweir case FN_FRAME_WRAP_IDEAL: 1724cdf0e10cSrcweir bDisable |= bHtmlMode; 1725cdf0e10cSrcweir bSet = nSurround == SURROUND_IDEAL; 1726cdf0e10cSrcweir break; 1727cdf0e10cSrcweir case FN_FRAME_WRAPTHRU: 1728cdf0e10cSrcweir bDisable |= (bHtmlMode || 1729cdf0e10cSrcweir ( (nAnchorType != FLY_AT_PARA) 1730cdf0e10cSrcweir && (nAnchorType != FLY_AT_CHAR) 1731cdf0e10cSrcweir && (nAnchorType != FLY_AT_PAGE))); 1732cdf0e10cSrcweir if(bObj) 1733cdf0e10cSrcweir bSet = nSurround == SURROUND_THROUGHT && rSh.GetLayerId(); 1734cdf0e10cSrcweir else 1735cdf0e10cSrcweir bSet = nSurround == SURROUND_THROUGHT && bOpaque; 1736cdf0e10cSrcweir break; 1737cdf0e10cSrcweir case FN_FRAME_WRAPTHRU_TRANSP: 1738cdf0e10cSrcweir bDisable |= bHtmlMode; 1739cdf0e10cSrcweir if(bObj) 1740cdf0e10cSrcweir bSet = nSurround == SURROUND_THROUGHT && !rSh.GetLayerId(); 1741cdf0e10cSrcweir else 1742cdf0e10cSrcweir bSet = nSurround == SURROUND_THROUGHT && !bOpaque; 1743cdf0e10cSrcweir break; 1744cdf0e10cSrcweir case FN_FRAME_WRAP_CONTOUR: 1745cdf0e10cSrcweir bDisable |= bHtmlMode; 1746cdf0e10cSrcweir //no contour available whenn no wrap or wrap through is set 1747cdf0e10cSrcweir bDisable |= (nSurround == SURROUND_NONE || nSurround == SURROUND_THROUGHT); 1748cdf0e10cSrcweir bSet = rWrap.IsContour(); 1749cdf0e10cSrcweir if( !bDisable ) 1750cdf0e10cSrcweir { 1751cdf0e10cSrcweir int nSel = rSh.GetSelectionType(); 1752cdf0e10cSrcweir if( (nSel & nsSelectionType::SEL_GRF) && 1753cdf0e10cSrcweir rSh.IsGrfSwapOut(sal_True)) 1754cdf0e10cSrcweir { 1755cdf0e10cSrcweir if( AddGrfUpdateSlot( nWhich )) 1756cdf0e10cSrcweir rSh.GetGraphic(sal_False); // start the loading 1757cdf0e10cSrcweir } 1758cdf0e10cSrcweir else if( rSh.IsFrmSelected() ) 1759cdf0e10cSrcweir { 1760cdf0e10cSrcweir // #i102253# applied patch from OD (see task) 1761cdf0e10cSrcweir bDisable = 1762cdf0e10cSrcweir nSel & nsSelectionType::SEL_FRM || 1763cdf0e10cSrcweir GRAPHIC_NONE == rSh.GetIMapGraphic().GetType(); 1764cdf0e10cSrcweir } 1765cdf0e10cSrcweir } 1766cdf0e10cSrcweir bSet = bDisable ? sal_False : rWrap.IsContour(); 1767cdf0e10cSrcweir 1768cdf0e10cSrcweir break; 1769cdf0e10cSrcweir case FN_WRAP_ANCHOR_ONLY: 1770cdf0e10cSrcweir bDisable |= (bHtmlMode || 1771cdf0e10cSrcweir (nAnchorType != FLY_AT_PARA)); 1772cdf0e10cSrcweir bSet = rWrap.IsAnchorOnly(); 1773cdf0e10cSrcweir break; 1774cdf0e10cSrcweir case FN_FRAME_WRAP_LEFT: 1775cdf0e10cSrcweir bSet = nSurround == SURROUND_LEFT; 1776cdf0e10cSrcweir break; 1777cdf0e10cSrcweir case FN_FRAME_WRAP_RIGHT: 1778cdf0e10cSrcweir bSet = nSurround == SURROUND_RIGHT; 1779cdf0e10cSrcweir break; 1780cdf0e10cSrcweir } 1781cdf0e10cSrcweir 1782cdf0e10cSrcweir if(bDisable) 1783cdf0e10cSrcweir rSet.DisableItem(nWhich); 1784cdf0e10cSrcweir else 1785cdf0e10cSrcweir rSet.Put(SfxBoolItem(nWhich, bSet)); 1786cdf0e10cSrcweir } 1787cdf0e10cSrcweir else 1788cdf0e10cSrcweir rSet.DisableItem(nWhich); 1789cdf0e10cSrcweir } 1790cdf0e10cSrcweir break; 1791cdf0e10cSrcweir case FN_UPDATE_CHARTS: 1792cdf0e10cSrcweir if( !rSh.HasCharts() ) 1793cdf0e10cSrcweir rSet.DisableItem( nWhich ); 1794cdf0e10cSrcweir break; 1795cdf0e10cSrcweir case FN_UPDATE_ALL_LINKS: 1796cdf0e10cSrcweir if ( !rSh.GetLinkManager().GetLinks().Count() ) 1797cdf0e10cSrcweir rSet.DisableItem(nWhich); 1798cdf0e10cSrcweir break; 1799cdf0e10cSrcweir case FN_XFORMS_DESIGN_MODE: 1800cdf0e10cSrcweir // enable if in XForms document 1801cdf0e10cSrcweir if( rSh.GetDoc()->isXForms() ) 1802cdf0e10cSrcweir { 1803cdf0e10cSrcweir // determine current state from view options 1804cdf0e10cSrcweir sal_Bool bValue = ! rSh.GetViewOptions()->IsFormView(); 1805cdf0e10cSrcweir rSet.Put( SfxBoolItem( nWhich, bValue ) ); 1806cdf0e10cSrcweir } 1807cdf0e10cSrcweir else 1808cdf0e10cSrcweir rSet.Put( SfxVisibilityItem( nWhich, sal_False ) ); 1809cdf0e10cSrcweir break; 1810cdf0e10cSrcweir } 1811cdf0e10cSrcweir nWhich = aIter.NextWhich(); 1812cdf0e10cSrcweir } 1813cdf0e10cSrcweir pGetStateSet = 0; 1814cdf0e10cSrcweir } 1815cdf0e10cSrcweir 1816cdf0e10cSrcweir /*-------------------------------------------------------------------- 1817cdf0e10cSrcweir Beschreibung: Slots mit dieser Statusmethode disablen 1818cdf0e10cSrcweir --------------------------------------------------------------------*/ 1819cdf0e10cSrcweir 1820cdf0e10cSrcweir 1821cdf0e10cSrcweir void SwBaseShell::StateDisableItems( SfxItemSet &rSet ) 1822cdf0e10cSrcweir { 1823cdf0e10cSrcweir SfxWhichIter aIter(rSet); 1824cdf0e10cSrcweir sal_uInt16 nWhich = aIter.FirstWhich(); 1825cdf0e10cSrcweir 1826cdf0e10cSrcweir while (nWhich) 1827cdf0e10cSrcweir { 1828cdf0e10cSrcweir rSet.DisableItem( nWhich ); 1829cdf0e10cSrcweir nWhich = aIter.NextWhich(); 1830cdf0e10cSrcweir } 1831cdf0e10cSrcweir } 1832cdf0e10cSrcweir 1833cdf0e10cSrcweir /*-------------------------------------------------------------------- 1834cdf0e10cSrcweir Beschreibung: Slots mit dieser Statusmethode disablen 1835cdf0e10cSrcweir --------------------------------------------------------------------*/ 1836cdf0e10cSrcweir 1837cdf0e10cSrcweir 1838cdf0e10cSrcweir void SwBaseShell::StateStyle( SfxItemSet &rSet ) 1839cdf0e10cSrcweir { 1840cdf0e10cSrcweir sal_Bool bParentCntProt = GetShell().IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0; 1841cdf0e10cSrcweir ShellModes eMode = GetView().GetShellMode(); 1842cdf0e10cSrcweir 1843cdf0e10cSrcweir if ( bParentCntProt || 1844cdf0e10cSrcweir SHELL_MODE_DRAW == eMode || 1845cdf0e10cSrcweir SHELL_MODE_DRAW_CTRL == eMode || 1846cdf0e10cSrcweir SHELL_MODE_DRAW_FORM == eMode || 1847cdf0e10cSrcweir SHELL_MODE_DRAWTEXT == eMode || 1848cdf0e10cSrcweir SHELL_MODE_BEZIER == eMode ) 1849cdf0e10cSrcweir { 1850cdf0e10cSrcweir SfxWhichIter aIter( rSet ); 1851cdf0e10cSrcweir sal_uInt16 nWhich = aIter.FirstWhich(); 1852cdf0e10cSrcweir while ( nWhich ) 1853cdf0e10cSrcweir { 1854cdf0e10cSrcweir rSet.DisableItem( nWhich ); 1855cdf0e10cSrcweir nWhich = aIter.NextWhich(); 1856cdf0e10cSrcweir } 1857cdf0e10cSrcweir } 1858cdf0e10cSrcweir else 1859cdf0e10cSrcweir GetView().GetDocShell()->StateStyleSheet(rSet, &GetShell()); 1860cdf0e10cSrcweir } 1861cdf0e10cSrcweir 1862cdf0e10cSrcweir /*-------------------------------------------------------------------- 1863cdf0e10cSrcweir Beschreibung: 1864cdf0e10cSrcweir --------------------------------------------------------------------*/ 1865cdf0e10cSrcweir 1866cdf0e10cSrcweir 1867cdf0e10cSrcweir void SwBaseShell::SetWrapMode( sal_uInt16 nSlot ) 1868cdf0e10cSrcweir { 1869cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 1870cdf0e10cSrcweir sal_Bool bObj = 0 != rSh.IsObjSelected(); 1871cdf0e10cSrcweir if( bObj || rSh.IsFrmSelected()) 1872cdf0e10cSrcweir { 1873cdf0e10cSrcweir SfxItemSet aSet(GetPool(), RES_OPAQUE, RES_SURROUND); 1874cdf0e10cSrcweir if(bObj) 1875cdf0e10cSrcweir rSh.GetObjAttr(aSet); 1876cdf0e10cSrcweir else 1877cdf0e10cSrcweir rSh.GetFlyFrmAttr(aSet); 1878cdf0e10cSrcweir SwFmtSurround aWrap( (SwFmtSurround&)aSet.Get(RES_SURROUND) ); 1879cdf0e10cSrcweir SwSurround nOldSurround(aWrap.GetSurround()); 1880cdf0e10cSrcweir SwSurround nSurround = SURROUND_PARALLEL; 1881cdf0e10cSrcweir 1882cdf0e10cSrcweir switch (nSlot) 1883cdf0e10cSrcweir { 1884cdf0e10cSrcweir case FN_FRAME_NOWRAP: 1885cdf0e10cSrcweir nSurround = SURROUND_NONE; 1886cdf0e10cSrcweir if (aWrap.IsContour()) 1887cdf0e10cSrcweir aWrap.SetContour(sal_False); 1888cdf0e10cSrcweir break; 1889cdf0e10cSrcweir case FN_FRAME_WRAP_IDEAL: 1890cdf0e10cSrcweir nSurround = SURROUND_IDEAL; 1891cdf0e10cSrcweir break; 1892cdf0e10cSrcweir case FN_WRAP_ANCHOR_ONLY: 1893cdf0e10cSrcweir aWrap.SetAnchorOnly(!aWrap.IsAnchorOnly()); 1894cdf0e10cSrcweir // --> OD 2006-06-02 #b6432130# 1895cdf0e10cSrcweir // keep previous wrapping 1896cdf0e10cSrcweir // --> OD 2006-09-21 #138144# - adjust fix #b6432130# 1897cdf0e10cSrcweir // switch to wrap SURROUND_PARALLEL, if previous wrap is SURROUND_NONE 1898cdf0e10cSrcweir if ( nOldSurround != SURROUND_NONE ) 1899cdf0e10cSrcweir { 1900cdf0e10cSrcweir nSurround = nOldSurround; 1901cdf0e10cSrcweir } 1902cdf0e10cSrcweir // <-- 1903cdf0e10cSrcweir break; 1904cdf0e10cSrcweir case FN_FRAME_WRAP_CONTOUR: 1905cdf0e10cSrcweir aWrap.SetContour(!aWrap.IsContour()); 1906cdf0e10cSrcweir if (nSurround == SURROUND_THROUGHT) 1907cdf0e10cSrcweir nSurround = SURROUND_PARALLEL; 1908cdf0e10cSrcweir break; 1909cdf0e10cSrcweir case FN_FRAME_WRAPTHRU_TRANSP: 1910cdf0e10cSrcweir if (aWrap.IsContour()) 1911cdf0e10cSrcweir aWrap.SetContour(sal_False); 1912cdf0e10cSrcweir // kein break!!! 1913cdf0e10cSrcweir case FN_FRAME_WRAPTHRU: 1914cdf0e10cSrcweir nSurround = SURROUND_THROUGHT; 1915cdf0e10cSrcweir break; 1916cdf0e10cSrcweir 1917cdf0e10cSrcweir case FN_FRAME_WRAP_LEFT: 1918cdf0e10cSrcweir nSurround = SURROUND_LEFT; 1919cdf0e10cSrcweir break; 1920cdf0e10cSrcweir 1921cdf0e10cSrcweir case FN_FRAME_WRAP_RIGHT: 1922cdf0e10cSrcweir nSurround = SURROUND_RIGHT; 1923cdf0e10cSrcweir break; 1924cdf0e10cSrcweir 1925cdf0e10cSrcweir default: 1926cdf0e10cSrcweir break; 1927cdf0e10cSrcweir } 1928cdf0e10cSrcweir aWrap.SetSurround(nSurround); 1929cdf0e10cSrcweir 1930cdf0e10cSrcweir if (nSlot != FN_FRAME_WRAP_CONTOUR) 1931cdf0e10cSrcweir { 1932cdf0e10cSrcweir // Konturumfluss bei Draw-Objekten defaulten 1933cdf0e10cSrcweir if (bObj && nOldSurround != nSurround && 1934cdf0e10cSrcweir (nOldSurround == SURROUND_NONE || nOldSurround == SURROUND_THROUGHT)) 1935cdf0e10cSrcweir { 1936cdf0e10cSrcweir aWrap.SetContour(sal_True); 1937cdf0e10cSrcweir } 1938cdf0e10cSrcweir } 1939cdf0e10cSrcweir 1940cdf0e10cSrcweir aSet.Put( aWrap ); 1941cdf0e10cSrcweir aSet.Put(SvxOpaqueItem(RES_OPAQUE, nSlot != FN_FRAME_WRAPTHRU_TRANSP)); 1942cdf0e10cSrcweir if(bObj) 1943cdf0e10cSrcweir { 1944cdf0e10cSrcweir rSh.SetObjAttr(aSet); 1945cdf0e10cSrcweir if (nSlot != FN_FRAME_WRAPTHRU_TRANSP) 1946cdf0e10cSrcweir rSh.SelectionToHeaven(); 1947cdf0e10cSrcweir else 1948cdf0e10cSrcweir rSh.SelectionToHell(); 1949cdf0e10cSrcweir } 1950cdf0e10cSrcweir else 1951cdf0e10cSrcweir rSh.SetFlyFrmAttr(aSet); 1952cdf0e10cSrcweir } 1953cdf0e10cSrcweir } 1954cdf0e10cSrcweir 1955cdf0e10cSrcweir /*-------------------------------------------------------------------- 1956cdf0e10cSrcweir Beschreibung: Update der Statuszeile erzwingen 1957cdf0e10cSrcweir --------------------------------------------------------------------*/ 1958cdf0e10cSrcweir 1959cdf0e10cSrcweir void SwBaseShell::SetFrmMode(FlyMode eMode, SwWrtShell *pSh ) 1960cdf0e10cSrcweir { 1961cdf0e10cSrcweir eFrameMode = eMode; 1962cdf0e10cSrcweir SfxBindings &rBnd = pSh->GetView().GetViewFrame()->GetBindings(); 1963cdf0e10cSrcweir 1964cdf0e10cSrcweir if( eMode == FLY_DRAG || 1965cdf0e10cSrcweir (pSh && (pSh->IsFrmSelected() || pSh->IsObjSelected())) ) 1966cdf0e10cSrcweir { 1967cdf0e10cSrcweir const SfxPointItem aTmp1( SID_ATTR_POSITION, pSh->GetAnchorObjDiff()); 1968cdf0e10cSrcweir const SvxSizeItem aTmp2( SID_ATTR_SIZE, pSh->GetObjSize()); 1969cdf0e10cSrcweir rBnd.SetState( aTmp1 ); 1970cdf0e10cSrcweir rBnd.SetState( aTmp2 ); 1971cdf0e10cSrcweir } 1972cdf0e10cSrcweir else if( eMode == FLY_DRAG_END ) 1973cdf0e10cSrcweir { 1974cdf0e10cSrcweir static sal_uInt16 __READONLY_DATA aInval[] = 1975cdf0e10cSrcweir { 1976cdf0e10cSrcweir SID_ATTR_POSITION, SID_ATTR_SIZE, 0 1977cdf0e10cSrcweir }; 1978cdf0e10cSrcweir rBnd.Invalidate(aInval); 1979cdf0e10cSrcweir } 1980cdf0e10cSrcweir } 1981cdf0e10cSrcweir 1982cdf0e10cSrcweir /*-------------------------------------------------------------------- 1983cdf0e10cSrcweir Beschreibung: Ctor 1984cdf0e10cSrcweir --------------------------------------------------------------------*/ 1985cdf0e10cSrcweir 1986cdf0e10cSrcweir SwBaseShell::SwBaseShell(SwView& rVw) : 1987cdf0e10cSrcweir SfxShell( &rVw ), 1988cdf0e10cSrcweir rView(rVw), 1989cdf0e10cSrcweir pGetStateSet(0) 1990cdf0e10cSrcweir { 1991cdf0e10cSrcweir SwWrtShell& rWrtSh = rView.GetWrtShell(); 1992cdf0e10cSrcweir 1993cdf0e10cSrcweir SetPool(&rWrtSh.GetAttrPool()); 1994cdf0e10cSrcweir SetName(C2S("Base")); 1995cdf0e10cSrcweir rWrtSh.SetGrfArrivedLnk( LINK( this, SwBaseShell, GraphicArrivedHdl)); 1996cdf0e10cSrcweir } 1997cdf0e10cSrcweir 1998cdf0e10cSrcweir 1999cdf0e10cSrcweir SwBaseShell::~SwBaseShell() 2000cdf0e10cSrcweir { 2001cdf0e10cSrcweir if( rView.GetCurShell() == this ) 2002cdf0e10cSrcweir rView.ResetSubShell(); 2003cdf0e10cSrcweir 2004cdf0e10cSrcweir Link aTmp( LINK( this, SwBaseShell, GraphicArrivedHdl)); 2005cdf0e10cSrcweir if( aTmp == rView.GetWrtShell().GetGrfArrivedLnk() ) 2006cdf0e10cSrcweir rView.GetWrtShell().SetGrfArrivedLnk( Link() ); 2007cdf0e10cSrcweir } 2008cdf0e10cSrcweir 2009cdf0e10cSrcweir /*-------------------------------------------------------------------- 2010cdf0e10cSrcweir Beschreibung: 2011cdf0e10cSrcweir --------------------------------------------------------------------*/ 2012cdf0e10cSrcweir 2013cdf0e10cSrcweir void SwBaseShell::ExecTxtCtrl( SfxRequest& rReq ) 2014cdf0e10cSrcweir { 2015cdf0e10cSrcweir const SfxItemSet *pArgs = rReq.GetArgs(); 2016cdf0e10cSrcweir 2017cdf0e10cSrcweir if( pArgs) 2018cdf0e10cSrcweir { 2019cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 2020cdf0e10cSrcweir SvxScriptSetItem* pSSetItem = 0; 2021cdf0e10cSrcweir sal_uInt16 nSlot = rReq.GetSlot(); 2022cdf0e10cSrcweir SfxItemPool& rPool = rSh.GetAttrPool(); 2023cdf0e10cSrcweir sal_uInt16 nWhich = rPool.GetWhich( nSlot ); 2024cdf0e10cSrcweir sal_uInt16 nScripts = SCRIPTTYPE_LATIN | SCRIPTTYPE_ASIAN | SCRIPTTYPE_COMPLEX; 2025cdf0e10cSrcweir SfxItemSet aHeightSet( GetPool(), RES_CHRATR_FONTSIZE, RES_CHRATR_FONTSIZE, 2026cdf0e10cSrcweir RES_CHRATR_CJK_FONTSIZE, RES_CHRATR_CJK_FONTSIZE, 2027cdf0e10cSrcweir RES_CHRATR_CTL_FONTSIZE, RES_CHRATR_CTL_FONTSIZE, 2028cdf0e10cSrcweir 0L); 2029cdf0e10cSrcweir 2030cdf0e10cSrcweir switch( nSlot ) 2031cdf0e10cSrcweir { 2032cdf0e10cSrcweir case SID_ATTR_CHAR_FONT: 2033cdf0e10cSrcweir { 2034cdf0e10cSrcweir nScripts = rSh.GetScriptType(); 2035cdf0e10cSrcweir // #i42732# input language should be preferred over 2036cdf0e10cSrcweir // current cursor position to detect script type 2037cdf0e10cSrcweir if(!rSh.HasSelection()) 2038cdf0e10cSrcweir { 2039cdf0e10cSrcweir LanguageType nInputLang = GetView().GetEditWin().GetInputLanguage(); 2040cdf0e10cSrcweir if(nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM) 2041cdf0e10cSrcweir nScripts = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang ); 2042cdf0e10cSrcweir } 2043cdf0e10cSrcweir } 2044cdf0e10cSrcweir case SID_ATTR_CHAR_POSTURE: 2045cdf0e10cSrcweir case SID_ATTR_CHAR_WEIGHT: 2046cdf0e10cSrcweir { 2047cdf0e10cSrcweir pSSetItem = new SvxScriptSetItem( nSlot, rPool ); 2048cdf0e10cSrcweir pSSetItem->PutItemForScriptType( nScripts, pArgs->Get( nWhich )); 2049cdf0e10cSrcweir pArgs = &pSSetItem->GetItemSet(); 2050cdf0e10cSrcweir } 2051cdf0e10cSrcweir break; 2052cdf0e10cSrcweir case SID_ATTR_CHAR_FONTHEIGHT: 2053cdf0e10cSrcweir { 2054cdf0e10cSrcweir if(rSh.HasSelection()) 2055cdf0e10cSrcweir { 2056cdf0e10cSrcweir pSSetItem = new SvxScriptSetItem( nSlot, rPool ); 2057cdf0e10cSrcweir pSSetItem->PutItemForScriptType( nScripts, pArgs->Get( nWhich )); 2058cdf0e10cSrcweir pArgs = &pSSetItem->GetItemSet(); 2059cdf0e10cSrcweir } 2060cdf0e10cSrcweir else 2061cdf0e10cSrcweir { 2062cdf0e10cSrcweir nScripts = rSh.GetScriptType(); 2063cdf0e10cSrcweir LanguageType nInputLang = GetView().GetEditWin().GetInputLanguage(); 2064cdf0e10cSrcweir if(nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM) 2065cdf0e10cSrcweir nScripts = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang ); 2066cdf0e10cSrcweir sal_uInt32 nHeight = static_cast< const SvxFontHeightItem& >(pArgs->Get( nWhich )).GetHeight(); 2067cdf0e10cSrcweir SwStdFontConfig* pStdFont = SW_MOD()->GetStdFontConfig(); 2068cdf0e10cSrcweir 2069cdf0e10cSrcweir SfxItemSet aLangSet( GetPool(), RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE, 2070cdf0e10cSrcweir RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, 2071cdf0e10cSrcweir RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE, 2072cdf0e10cSrcweir 0L); 2073cdf0e10cSrcweir rSh.GetCurAttr( aLangSet ); 2074cdf0e10cSrcweir 2075cdf0e10cSrcweir sal_Int32 nWesternSize = 2076cdf0e10cSrcweir pStdFont->GetFontHeight(FONT_STANDARD, FONT_GROUP_DEFAULT, 2077cdf0e10cSrcweir static_cast<const SvxLanguageItem&>(aLangSet.Get( RES_CHRATR_LANGUAGE)).GetLanguage()); 2078cdf0e10cSrcweir sal_Int32 nCJKSize = 2079cdf0e10cSrcweir pStdFont->GetFontHeight(FONT_STANDARD, FONT_GROUP_CJK, 2080cdf0e10cSrcweir static_cast<const SvxLanguageItem&>(aLangSet.Get( RES_CHRATR_CJK_LANGUAGE)).GetLanguage()); 2081cdf0e10cSrcweir sal_Int32 nCTLSize = 2082cdf0e10cSrcweir pStdFont->GetFontHeight(FONT_STANDARD, FONT_GROUP_CTL, 2083cdf0e10cSrcweir static_cast<const SvxLanguageItem&>(aLangSet.Get( RES_CHRATR_CTL_LANGUAGE)).GetLanguage()); 2084cdf0e10cSrcweir 2085cdf0e10cSrcweir switch(nScripts) 2086cdf0e10cSrcweir { 2087cdf0e10cSrcweir case SCRIPTTYPE_LATIN: 2088cdf0e10cSrcweir nCJKSize = nHeight * nCJKSize / nWesternSize; 2089cdf0e10cSrcweir nCTLSize = nHeight * nCTLSize / nWesternSize; 2090cdf0e10cSrcweir nWesternSize = (sal_Int32) nHeight; 2091cdf0e10cSrcweir break; 2092cdf0e10cSrcweir case SCRIPTTYPE_ASIAN: 2093cdf0e10cSrcweir nCTLSize = nHeight* nCTLSize / nCJKSize; 2094cdf0e10cSrcweir nWesternSize = nHeight * nWesternSize / nCJKSize; 2095cdf0e10cSrcweir nCJKSize = (sal_Int32) nHeight; 2096cdf0e10cSrcweir break; 2097cdf0e10cSrcweir case SCRIPTTYPE_COMPLEX: 2098cdf0e10cSrcweir nCJKSize = nHeight * nCJKSize / nCTLSize; 2099cdf0e10cSrcweir nWesternSize = nHeight * nWesternSize / nCTLSize; 2100cdf0e10cSrcweir nCTLSize = (sal_Int32) nHeight; 2101cdf0e10cSrcweir break; 2102cdf0e10cSrcweir } 2103cdf0e10cSrcweir aHeightSet.Put( SvxFontHeightItem( (sal_uInt32)nWesternSize, 100, RES_CHRATR_FONTSIZE )); 2104cdf0e10cSrcweir aHeightSet.Put( SvxFontHeightItem( (sal_uInt32)nCJKSize, 100, RES_CHRATR_CJK_FONTSIZE )); 2105cdf0e10cSrcweir aHeightSet.Put( SvxFontHeightItem( (sal_uInt32)nCTLSize, 100, RES_CHRATR_CTL_FONTSIZE )); 2106cdf0e10cSrcweir pArgs = &aHeightSet; 2107cdf0e10cSrcweir } 2108cdf0e10cSrcweir } 2109cdf0e10cSrcweir break; 2110cdf0e10cSrcweir } 2111cdf0e10cSrcweir 2112cdf0e10cSrcweir if( pArgs ) 2113cdf0e10cSrcweir { 2114cdf0e10cSrcweir bool bAuto = false; 2115cdf0e10cSrcweir if ( !isCHRATR(nWhich) || 2116cdf0e10cSrcweir ( rSh.HasSelection() && rSh.IsSelFullPara() ) ) 2117cdf0e10cSrcweir { 2118cdf0e10cSrcweir SwTxtFmtColl * pColl = rSh.GetCurTxtFmtColl(); 2119cdf0e10cSrcweir if ( pColl && pColl->IsAutoUpdateFmt() ) 2120cdf0e10cSrcweir { 2121cdf0e10cSrcweir rSh.AutoUpdatePara( pColl, *pArgs ); 2122cdf0e10cSrcweir bAuto = true; 2123cdf0e10cSrcweir } 2124cdf0e10cSrcweir } 2125cdf0e10cSrcweir 2126cdf0e10cSrcweir if (!bAuto) 2127cdf0e10cSrcweir { 2128cdf0e10cSrcweir rSh.SetAttr( *pArgs ); 2129cdf0e10cSrcweir } 2130cdf0e10cSrcweir } 2131cdf0e10cSrcweir delete pSSetItem; 2132cdf0e10cSrcweir } 2133cdf0e10cSrcweir else 2134cdf0e10cSrcweir GetView().GetViewFrame()->GetDispatcher()->Execute( SID_CHAR_DLG, sal_False); 2135cdf0e10cSrcweir rReq.Done(); 2136cdf0e10cSrcweir } 2137cdf0e10cSrcweir 2138cdf0e10cSrcweir /*-------------------------------------------------------------------- 2139cdf0e10cSrcweir Beschreibung: 2140cdf0e10cSrcweir --------------------------------------------------------------------*/ 2141cdf0e10cSrcweir 2142cdf0e10cSrcweir void SwBaseShell::GetTxtCtrlState( SfxItemSet& rSet ) 2143cdf0e10cSrcweir { 2144cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 2145cdf0e10cSrcweir rSh.GetCurAttr( rSet ); 2146cdf0e10cSrcweir } 2147cdf0e10cSrcweir 2148cdf0e10cSrcweir void SwBaseShell::GetTxtFontCtrlState( SfxItemSet& rSet ) 2149cdf0e10cSrcweir { 2150cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 2151cdf0e10cSrcweir sal_Bool bFirst = sal_True; 2152cdf0e10cSrcweir SfxItemSet* pFntCoreSet = 0; 2153cdf0e10cSrcweir sal_uInt16 nScriptType = SCRIPTTYPE_LATIN; 2154cdf0e10cSrcweir SfxWhichIter aIter( rSet ); 2155cdf0e10cSrcweir sal_uInt16 nWhich = aIter.FirstWhich(); 2156cdf0e10cSrcweir while( nWhich ) 2157cdf0e10cSrcweir { 2158cdf0e10cSrcweir switch( nWhich ) 2159cdf0e10cSrcweir { 2160cdf0e10cSrcweir case RES_CHRATR_FONT: 2161cdf0e10cSrcweir case RES_CHRATR_FONTSIZE: 2162cdf0e10cSrcweir case RES_CHRATR_WEIGHT: 2163cdf0e10cSrcweir case RES_CHRATR_POSTURE: 2164cdf0e10cSrcweir { 2165cdf0e10cSrcweir if( !pFntCoreSet ) 2166cdf0e10cSrcweir { 2167cdf0e10cSrcweir pFntCoreSet = new SfxItemSet( *rSet.GetPool(), 2168cdf0e10cSrcweir RES_CHRATR_BEGIN, RES_CHRATR_END-1 ); 2169cdf0e10cSrcweir rSh.GetCurAttr( *pFntCoreSet ); 2170cdf0e10cSrcweir nScriptType = rSh.GetScriptType(); 2171cdf0e10cSrcweir // #i42732# input language should be preferred over 2172cdf0e10cSrcweir // current cursor position to detect script type 2173cdf0e10cSrcweir SwEditWin& rEditWin = GetView().GetEditWin(); 2174cdf0e10cSrcweir if( rEditWin.IsUseInputLanguage() ) 2175cdf0e10cSrcweir { 2176cdf0e10cSrcweir if(!rSh.HasSelection() && ( 2177cdf0e10cSrcweir nWhich == RES_CHRATR_FONT || 2178cdf0e10cSrcweir nWhich == RES_CHRATR_FONTSIZE )) 2179cdf0e10cSrcweir { 2180cdf0e10cSrcweir LanguageType nInputLang = rEditWin.GetInputLanguage(); 2181cdf0e10cSrcweir if(nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM) 2182cdf0e10cSrcweir nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang ); 2183cdf0e10cSrcweir } 2184cdf0e10cSrcweir } 2185cdf0e10cSrcweir } 2186cdf0e10cSrcweir SfxItemPool& rPool = *rSet.GetPool(); 2187cdf0e10cSrcweir SvxScriptSetItem aSetItem( rPool.GetSlotId( nWhich ), rPool ); 2188cdf0e10cSrcweir aSetItem.GetItemSet().Put( *pFntCoreSet, sal_False ); 2189cdf0e10cSrcweir const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScriptType ); 2190cdf0e10cSrcweir if( pI ) 2191cdf0e10cSrcweir rSet.Put( *pI, nWhich ); 2192cdf0e10cSrcweir else 2193cdf0e10cSrcweir rSet.InvalidateItem( nWhich ); 2194cdf0e10cSrcweir //set input context of the SwEditWin according to the selected font and script type 2195cdf0e10cSrcweir if(RES_CHRATR_FONT == nWhich) 2196cdf0e10cSrcweir { 2197cdf0e10cSrcweir Font aFont; 2198cdf0e10cSrcweir if(pI && pI->ISA(SvxFontItem)) 2199cdf0e10cSrcweir { 2200cdf0e10cSrcweir aFont.SetName( ((const SvxFontItem*)pI)->GetFamilyName()); 2201cdf0e10cSrcweir aFont.SetStyleName(((const SvxFontItem*)pI)->GetStyleName()); 2202cdf0e10cSrcweir aFont.SetFamily(((const SvxFontItem*)pI)->GetFamily()); 2203cdf0e10cSrcweir aFont.SetPitch(((const SvxFontItem*)pI)->GetPitch()); 2204cdf0e10cSrcweir aFont.SetCharSet(((const SvxFontItem*)pI)->GetCharSet()); 2205cdf0e10cSrcweir } 2206cdf0e10cSrcweir 2207cdf0e10cSrcweir sal_Bool bVertical = rSh.IsInVerticalText(); 2208cdf0e10cSrcweir aFont.SetOrientation(bVertical ? 2700 : 0); 2209cdf0e10cSrcweir aFont.SetVertical(bVertical); 2210cdf0e10cSrcweir GetView().GetEditWin().SetInputContext( InputContext( aFont, INPUTCONTEXT_TEXT | 2211cdf0e10cSrcweir INPUTCONTEXT_EXTTEXTINPUT ) ); 2212cdf0e10cSrcweir } 2213cdf0e10cSrcweir } 2214cdf0e10cSrcweir break; 2215cdf0e10cSrcweir 2216cdf0e10cSrcweir default: 2217cdf0e10cSrcweir if( bFirst ) 2218cdf0e10cSrcweir { 2219cdf0e10cSrcweir rSh.GetCurAttr( rSet ); 2220cdf0e10cSrcweir bFirst = sal_False; 2221cdf0e10cSrcweir } 2222cdf0e10cSrcweir } 2223cdf0e10cSrcweir nWhich = aIter.NextWhich(); 2224cdf0e10cSrcweir } 2225cdf0e10cSrcweir delete pFntCoreSet; 2226cdf0e10cSrcweir } 2227cdf0e10cSrcweir 2228cdf0e10cSrcweir /*-------------------------------------------------------------------- 2229cdf0e10cSrcweir Beschreibung: 2230cdf0e10cSrcweir --------------------------------------------------------------------*/ 2231cdf0e10cSrcweir 2232cdf0e10cSrcweir void SwBaseShell::GetBckColState(SfxItemSet &rSet) 2233cdf0e10cSrcweir { 2234cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 2235cdf0e10cSrcweir SfxWhichIter aIter( rSet ); 2236cdf0e10cSrcweir sal_uInt16 nWhich = aIter.FirstWhich(); 2237cdf0e10cSrcweir int nSelType = rSh.GetSelectionType(); 2238cdf0e10cSrcweir 2239cdf0e10cSrcweir // if ( nSelType & nsSelectionType::SEL_GRF || 2240cdf0e10cSrcweir if( nSelType & nsSelectionType::SEL_OLE ) 2241cdf0e10cSrcweir { 2242cdf0e10cSrcweir rSet.DisableItem( SID_BACKGROUND_COLOR ); 2243cdf0e10cSrcweir return; 2244cdf0e10cSrcweir } 2245cdf0e10cSrcweir 2246cdf0e10cSrcweir if ( nSelType & nsSelectionType::SEL_FRM ) 2247cdf0e10cSrcweir { 2248cdf0e10cSrcweir sal_Bool bParentCntProt = rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0; 2249cdf0e10cSrcweir if (bParentCntProt) 2250cdf0e10cSrcweir { 2251cdf0e10cSrcweir rSet.DisableItem( SID_BACKGROUND_COLOR ); 2252cdf0e10cSrcweir return; 2253cdf0e10cSrcweir } 2254cdf0e10cSrcweir } 2255cdf0e10cSrcweir 2256cdf0e10cSrcweir SvxBrushItem aBrushItem( RES_BACKGROUND ); 2257cdf0e10cSrcweir 2258cdf0e10cSrcweir if( nsSelectionType::SEL_TBL_CELLS & nSelType ) 2259cdf0e10cSrcweir rSh.GetBoxBackground( aBrushItem ); 2260cdf0e10cSrcweir else 2261cdf0e10cSrcweir { 2262cdf0e10cSrcweir SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND); 2263cdf0e10cSrcweir if( nSelType & nsSelectionType::SEL_GRF || nsSelectionType::SEL_FRM & nSelType ) 2264cdf0e10cSrcweir rSh.GetFlyFrmAttr( aCoreSet ); 2265cdf0e10cSrcweir else 2266cdf0e10cSrcweir rSh.GetCurAttr( aCoreSet ); 2267cdf0e10cSrcweir aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND); 2268cdf0e10cSrcweir } 2269cdf0e10cSrcweir 2270cdf0e10cSrcweir while ( nWhich ) 2271cdf0e10cSrcweir { 2272cdf0e10cSrcweir switch(nWhich) 2273cdf0e10cSrcweir { 2274cdf0e10cSrcweir case SID_BACKGROUND_COLOR : 2275cdf0e10cSrcweir { 2276cdf0e10cSrcweir SvxColorItem aColorItem(aBrushItem.GetColor(), SID_BACKGROUND_COLOR); 2277cdf0e10cSrcweir rSet.Put( aColorItem, SID_BACKGROUND_COLOR ); 2278cdf0e10cSrcweir } 2279cdf0e10cSrcweir break; 2280cdf0e10cSrcweir case SID_ATTR_BRUSH: 2281cdf0e10cSrcweir case RES_BACKGROUND: 2282cdf0e10cSrcweir rSet.Put( aBrushItem, GetPool().GetWhich(nWhich) ); 2283cdf0e10cSrcweir break; 2284cdf0e10cSrcweir } 2285cdf0e10cSrcweir nWhich = aIter.NextWhich(); 2286cdf0e10cSrcweir } 2287cdf0e10cSrcweir } 2288cdf0e10cSrcweir 2289cdf0e10cSrcweir /*-------------------------------------------------------------------- 2290cdf0e10cSrcweir Beschreibung: 2291cdf0e10cSrcweir --------------------------------------------------------------------*/ 2292cdf0e10cSrcweir 2293cdf0e10cSrcweir void SwBaseShell::ExecBckCol(SfxRequest& rReq) 2294cdf0e10cSrcweir { 2295cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 2296cdf0e10cSrcweir int nSelType = rSh.GetSelectionType(); 2297cdf0e10cSrcweir if ( nSelType & nsSelectionType::SEL_OLE ) 2298cdf0e10cSrcweir { 2299cdf0e10cSrcweir return; 2300cdf0e10cSrcweir } 2301cdf0e10cSrcweir 2302cdf0e10cSrcweir const SfxItemSet* pArgs = rReq.GetArgs(); 2303cdf0e10cSrcweir sal_uInt16 nSlot = rReq.GetSlot(); 2304cdf0e10cSrcweir if( !pArgs && nSlot != SID_BACKGROUND_COLOR) 2305cdf0e10cSrcweir return ; 2306cdf0e10cSrcweir 2307cdf0e10cSrcweir SvxBrushItem aBrushItem( RES_BACKGROUND ); 2308cdf0e10cSrcweir 2309cdf0e10cSrcweir if( nsSelectionType::SEL_TBL_CELLS & nSelType ) 2310cdf0e10cSrcweir { 2311cdf0e10cSrcweir rSh.GetBoxBackground( aBrushItem ); 2312cdf0e10cSrcweir } 2313cdf0e10cSrcweir else 2314cdf0e10cSrcweir { 2315cdf0e10cSrcweir SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND); 2316cdf0e10cSrcweir if( (nsSelectionType::SEL_FRM & nSelType) || (nsSelectionType::SEL_GRF & nSelType) ) 2317cdf0e10cSrcweir rSh.GetFlyFrmAttr( aCoreSet ); 2318cdf0e10cSrcweir else 2319cdf0e10cSrcweir rSh.GetCurAttr( aCoreSet ); 2320cdf0e10cSrcweir aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND); 2321cdf0e10cSrcweir } 2322cdf0e10cSrcweir 2323cdf0e10cSrcweir // sal_Bool bMsgOk = sal_False; 2324cdf0e10cSrcweir 2325cdf0e10cSrcweir switch (nSlot) 2326cdf0e10cSrcweir { 2327cdf0e10cSrcweir // RES_BACKGROUND (=SID_ATTR_BRUSH) muss ueber zwei IDs 2328cdf0e10cSrcweir // gesetzt werden: 2329cdf0e10cSrcweir case SID_BACKGROUND_COLOR: 2330cdf0e10cSrcweir { 2331cdf0e10cSrcweir aBrushItem.SetGraphicPos(GPOS_NONE); 2332cdf0e10cSrcweir 2333cdf0e10cSrcweir //Brush &rBrush = aBrushItem.GetBrush(); 2334cdf0e10cSrcweir if(pArgs) 2335cdf0e10cSrcweir { 2336cdf0e10cSrcweir const SvxColorItem& rNewColorItem = (const SvxColorItem&) 2337cdf0e10cSrcweir pArgs->Get(SID_BACKGROUND_COLOR); 2338cdf0e10cSrcweir const Color& rNewColor = rNewColorItem.GetValue(); 2339cdf0e10cSrcweir aBrushItem.SetColor( rNewColor ); 2340cdf0e10cSrcweir GetView().GetViewFrame()->GetBindings().SetState(rNewColorItem); 2341cdf0e10cSrcweir } 2342cdf0e10cSrcweir else 2343cdf0e10cSrcweir { 2344cdf0e10cSrcweir aBrushItem.SetColor( COL_TRANSPARENT ); 2345cdf0e10cSrcweir rReq.AppendItem( SvxColorItem( Color( COL_TRANSPARENT ), nSlot ) ); 2346cdf0e10cSrcweir } 2347cdf0e10cSrcweir } 2348cdf0e10cSrcweir break; 2349cdf0e10cSrcweir 2350cdf0e10cSrcweir case SID_ATTR_BRUSH: 2351cdf0e10cSrcweir case RES_BACKGROUND: 2352cdf0e10cSrcweir { 2353cdf0e10cSrcweir const SvxBrushItem& rNewBrushItem = (const SvxBrushItem&) 2354cdf0e10cSrcweir pArgs->Get( GetPool().GetWhich(nSlot) ); 2355cdf0e10cSrcweir aBrushItem = rNewBrushItem; 2356cdf0e10cSrcweir } 2357cdf0e10cSrcweir break; 2358cdf0e10cSrcweir default: 2359cdf0e10cSrcweir // bMsgOk = sal_False; 2360cdf0e10cSrcweir rReq.Ignore(); 2361cdf0e10cSrcweir DBG_ERROR( "Unbekannte Message bei ExecuteAttr!" ); 2362cdf0e10cSrcweir return; 2363cdf0e10cSrcweir } 2364cdf0e10cSrcweir 2365cdf0e10cSrcweir if( nsSelectionType::SEL_TBL_CELLS & nSelType ) 2366cdf0e10cSrcweir { 2367cdf0e10cSrcweir rSh.SetBoxBackground( aBrushItem ); 2368cdf0e10cSrcweir } 2369cdf0e10cSrcweir else if( (nsSelectionType::SEL_FRM & nSelType) || 2370cdf0e10cSrcweir (nsSelectionType::SEL_GRF & nSelType) ) 2371cdf0e10cSrcweir { 2372cdf0e10cSrcweir SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND); 2373cdf0e10cSrcweir aCoreSet.Put( aBrushItem ); 2374cdf0e10cSrcweir // Vorlagen-AutoUpdate 2375cdf0e10cSrcweir SwFrmFmt* pFmt = rSh.GetCurFrmFmt(); 2376cdf0e10cSrcweir if(pFmt && pFmt->IsAutoUpdateFmt()) 2377cdf0e10cSrcweir rSh.AutoUpdateFrame( pFmt, aCoreSet); 2378cdf0e10cSrcweir else 2379cdf0e10cSrcweir rSh.SetFlyFrmAttr( aCoreSet ); 2380cdf0e10cSrcweir } 2381cdf0e10cSrcweir else 2382cdf0e10cSrcweir { 2383cdf0e10cSrcweir SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl(); 2384cdf0e10cSrcweir if( pColl && pColl->IsAutoUpdateFmt()) 2385cdf0e10cSrcweir { 2386cdf0e10cSrcweir SfxItemSet aSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND ); 2387cdf0e10cSrcweir aSet.Put(aBrushItem); 2388cdf0e10cSrcweir rSh.AutoUpdatePara( pColl, aSet); 2389cdf0e10cSrcweir } 2390cdf0e10cSrcweir else 2391cdf0e10cSrcweir rSh.SetAttr( aBrushItem ); 2392cdf0e10cSrcweir } 2393cdf0e10cSrcweir 2394cdf0e10cSrcweir rReq.Done(); 2395cdf0e10cSrcweir } 2396cdf0e10cSrcweir 2397cdf0e10cSrcweir /*-------------------------------------------------------------------- 2398cdf0e10cSrcweir Beschreibung: 2399cdf0e10cSrcweir --------------------------------------------------------------------*/ 2400cdf0e10cSrcweir 2401cdf0e10cSrcweir 2402cdf0e10cSrcweir void SwBaseShell::GetBorderState(SfxItemSet &rSet) 2403cdf0e10cSrcweir { 2404cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 2405cdf0e10cSrcweir // Tabellenzelle(n) selektiert? 2406cdf0e10cSrcweir sal_Bool bPrepare = sal_True; 2407cdf0e10cSrcweir sal_Bool bTableMode = rSh.IsTableMode(); 2408cdf0e10cSrcweir if ( bTableMode ) 2409cdf0e10cSrcweir { 2410cdf0e10cSrcweir SfxItemSet aCoreSet( GetPool(), 2411cdf0e10cSrcweir RES_BOX, RES_BOX, 2412cdf0e10cSrcweir SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, 0 ); 2413cdf0e10cSrcweir SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); 2414cdf0e10cSrcweir aCoreSet.Put( aBoxInfo ); 2415cdf0e10cSrcweir rSh.GetTabBorders( aCoreSet ); 2416cdf0e10cSrcweir rSet.Put( aCoreSet ); 2417cdf0e10cSrcweir } 2418cdf0e10cSrcweir else if ( rSh.IsFrmSelected() ) 2419cdf0e10cSrcweir { 2420cdf0e10cSrcweir SwFlyFrmAttrMgr aMgr( sal_False, &rSh, FRMMGR_TYPE_NONE ); 2421cdf0e10cSrcweir rSet.Put( aMgr.GetAttrSet() ); 2422cdf0e10cSrcweir bPrepare = sal_False; 2423cdf0e10cSrcweir } 2424cdf0e10cSrcweir else 2425cdf0e10cSrcweir // Umrandungsattribute ganz normal ueber Shell holen 2426cdf0e10cSrcweir rSh.GetCurAttr( rSet ); 2427cdf0e10cSrcweir if ( bPrepare ) 2428cdf0e10cSrcweir ::PrepareBoxInfo( rSet, rSh ); 2429cdf0e10cSrcweir // switch the border toolbox controller mode 2430cdf0e10cSrcweir rSet.Put( SfxBoolItem( SID_BORDER_REDUCED_MODE, !bTableMode )); 2431cdf0e10cSrcweir } 2432cdf0e10cSrcweir 2433cdf0e10cSrcweir /*-------------------------------------------------------------------- 2434cdf0e10cSrcweir Beschreibung: 2435cdf0e10cSrcweir --------------------------------------------------------------------*/ 2436cdf0e10cSrcweir 2437cdf0e10cSrcweir 2438cdf0e10cSrcweir void SwBaseShell::ExecDlg(SfxRequest &rReq) 2439cdf0e10cSrcweir { 2440cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 2441cdf0e10cSrcweir Window *pMDI = &GetView().GetViewFrame()->GetWindow(); 2442cdf0e10cSrcweir //Damit aus dem Basic keine Dialoge fuer Hintergrund-Views aufgerufen werden: 2443cdf0e10cSrcweir sal_Bool bBackground = (&GetView() != GetActiveView()); 2444cdf0e10cSrcweir const SfxPoolItem* pItem = 0; 2445cdf0e10cSrcweir const SfxItemSet* pArgs = rReq.GetArgs(); 2446cdf0e10cSrcweir 2447cdf0e10cSrcweir sal_uInt16 nSlot = rReq.GetSlot(); 2448cdf0e10cSrcweir const SfxItemSet* pOutSet = 0; 2449cdf0e10cSrcweir bool bDone = false; 2450cdf0e10cSrcweir if(pArgs) 2451cdf0e10cSrcweir pArgs->GetItemState( GetPool().GetWhich(nSlot), sal_False, &pItem ); 2452cdf0e10cSrcweir 2453*ff0525f2SOliver-Rainer Wittmann switch ( nSlot ) 2454*ff0525f2SOliver-Rainer Wittmann { 2455*ff0525f2SOliver-Rainer Wittmann case FN_FORMAT_PAGE_DLG: 2456*ff0525f2SOliver-Rainer Wittmann case FN_FORMAT_PAGE_COLUMN_DLG: 2457*ff0525f2SOliver-Rainer Wittmann case FN_FORMAT_PAGE_SETTING_DLG: 2458*ff0525f2SOliver-Rainer Wittmann { 2459*ff0525f2SOliver-Rainer Wittmann if( !bBackground ) 2460*ff0525f2SOliver-Rainer Wittmann { 2461*ff0525f2SOliver-Rainer Wittmann const sal_uInt16 nCurIdx = rSh.GetCurPageDesc(); 2462*ff0525f2SOliver-Rainer Wittmann const SwPageDesc& rPageDesc = rSh.GetPageDesc( nCurIdx ); 2463*ff0525f2SOliver-Rainer Wittmann //temp. View, weil die Shell nach dem Dialog nicht mehr gueltig sein muss 2464*ff0525f2SOliver-Rainer Wittmann //z.B. Kopfzeile ausschalten 2465cdf0e10cSrcweir SwView& rTempView = GetView(); 2466*ff0525f2SOliver-Rainer Wittmann rTempView.GetDocShell()->FormatPage( 2467*ff0525f2SOliver-Rainer Wittmann rPageDesc.GetName(), 2468*ff0525f2SOliver-Rainer Wittmann nSlot, 2469*ff0525f2SOliver-Rainer Wittmann rSh ); 2470cdf0e10cSrcweir rTempView.InvalidateRulerPos(); 2471*ff0525f2SOliver-Rainer Wittmann } 2472*ff0525f2SOliver-Rainer Wittmann } 2473*ff0525f2SOliver-Rainer Wittmann break; 2474*ff0525f2SOliver-Rainer Wittmann case FN_FORMAT_BORDER_DLG: 2475cdf0e10cSrcweir { 2476cdf0e10cSrcweir SfxItemSet aSet( rSh.GetAttrPool(), 2477cdf0e10cSrcweir RES_BOX , RES_SHADOW, 2478cdf0e10cSrcweir SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, 2479cdf0e10cSrcweir 0 ); 2480cdf0e10cSrcweir SfxAbstractDialog * pDlg = 0; 2481cdf0e10cSrcweir // Tabellenzelle(n) selektiert? 2482cdf0e10cSrcweir if ( rSh.IsTableMode() ) 2483cdf0e10cSrcweir { 2484cdf0e10cSrcweir // Umrandungattribute Get/SetTabBorders() setzen 2485cdf0e10cSrcweir ::PrepareBoxInfo( aSet, rSh ); 2486cdf0e10cSrcweir rSh.GetTabBorders( aSet ); 2487cdf0e10cSrcweir SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); 2488cdf0e10cSrcweir DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); 2489cdf0e10cSrcweir 2490cdf0e10cSrcweir pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_TABLE, RC_DLG_SWBORDERDLG ); 2491cdf0e10cSrcweir DBG_ASSERT(pDlg, "Dialogdiet fail!"); 2492cdf0e10cSrcweir if ( pDlg->Execute() == RET_OK ) 2493cdf0e10cSrcweir { 2494cdf0e10cSrcweir rSh.SetTabBorders( *pDlg->GetOutputItemSet() ); 2495cdf0e10cSrcweir pOutSet = pDlg->GetOutputItemSet(); 2496cdf0e10cSrcweir } 2497cdf0e10cSrcweir } 2498cdf0e10cSrcweir else if ( rSh.IsFrmSelected() ) 2499cdf0e10cSrcweir { 2500cdf0e10cSrcweir // Umrandungsattribute ueber Frame-Manager setzen 2501cdf0e10cSrcweir SwFlyFrmAttrMgr aMgr( sal_False, &rSh, FRMMGR_TYPE_NONE ); 2502cdf0e10cSrcweir aSet.Put( aMgr.GetAttrSet() ); 2503cdf0e10cSrcweir 2504cdf0e10cSrcweir SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); 2505cdf0e10cSrcweir DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); 2506cdf0e10cSrcweir 2507cdf0e10cSrcweir pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_FRAME, RC_DLG_SWBORDERDLG ); 2508cdf0e10cSrcweir DBG_ASSERT(pDlg, "Dialogdiet fail!"); 2509cdf0e10cSrcweir if ( pDlg->Execute() == RET_OK ) 2510cdf0e10cSrcweir { 2511cdf0e10cSrcweir aMgr.SetAttrSet( *pDlg->GetOutputItemSet() ); 2512cdf0e10cSrcweir aMgr.UpdateFlyFrm(); 2513cdf0e10cSrcweir pOutSet = pDlg->GetOutputItemSet(); 2514cdf0e10cSrcweir } 2515cdf0e10cSrcweir } 2516cdf0e10cSrcweir else 2517cdf0e10cSrcweir { 2518cdf0e10cSrcweir // Umrandungsattribute ganz normal ueber Shell setzen 2519cdf0e10cSrcweir rSh.GetCurAttr( aSet ); 2520cdf0e10cSrcweir ::PrepareBoxInfo( aSet, rSh ); 2521cdf0e10cSrcweir 2522cdf0e10cSrcweir SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); 2523cdf0e10cSrcweir DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); 2524cdf0e10cSrcweir 2525cdf0e10cSrcweir pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_PARA, RC_DLG_SWBORDERDLG ); 2526cdf0e10cSrcweir DBG_ASSERT(pDlg, "Dialogdiet fail!"); 2527cdf0e10cSrcweir if ( pDlg->Execute() == RET_OK ) 2528cdf0e10cSrcweir { 2529cdf0e10cSrcweir rSh.SetAttr( *pDlg->GetOutputItemSet() ); 2530cdf0e10cSrcweir pOutSet = pDlg->GetOutputItemSet(); 2531cdf0e10cSrcweir } 2532cdf0e10cSrcweir } 2533cdf0e10cSrcweir if(pOutSet) 2534cdf0e10cSrcweir { 2535cdf0e10cSrcweir rReq.Done(*pOutSet); 2536cdf0e10cSrcweir bDone = true; 2537cdf0e10cSrcweir } 2538cdf0e10cSrcweir delete pDlg; 2539cdf0e10cSrcweir } 2540cdf0e10cSrcweir break; 2541cdf0e10cSrcweir case FN_FORMAT_BACKGROUND_DLG: 2542cdf0e10cSrcweir { 2543cdf0e10cSrcweir SfxItemSet aSet( rSh.GetAttrPool(), 2544cdf0e10cSrcweir RES_BACKGROUND, RES_BACKGROUND ); 2545cdf0e10cSrcweir 2546cdf0e10cSrcweir SfxAbstractDialog * pDlg = 0; 2547cdf0e10cSrcweir SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); 2548cdf0e10cSrcweir DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); 2549cdf0e10cSrcweir 2550cdf0e10cSrcweir 2551cdf0e10cSrcweir // Tabellenzelle(n) selektiert? 2552cdf0e10cSrcweir if ( rSh.IsTableMode() ) 2553cdf0e10cSrcweir { 2554cdf0e10cSrcweir //Hintergrundattribute der Tabelle holen und in den Set packen 2555cdf0e10cSrcweir SvxBrushItem aBrush(RES_BACKGROUND); 2556cdf0e10cSrcweir rSh.GetBoxBackground( aBrush ); 2557cdf0e10cSrcweir pDlg = pFact->CreateSfxDialog( pMDI, aSet, 2558cdf0e10cSrcweir rView.GetViewFrame()->GetFrame().GetFrameInterface(), 2559cdf0e10cSrcweir RC_SWDLG_BACKGROUND ); 2560cdf0e10cSrcweir DBG_ASSERT(pDlg, "Dialogdiet fail!"); 2561cdf0e10cSrcweir aSet.Put( aBrush ); 2562cdf0e10cSrcweir if ( pDlg->Execute() == RET_OK ) 2563cdf0e10cSrcweir { 2564cdf0e10cSrcweir //aBrush = (SvxBrushItem) pDlg->GetOutputItemSet()->Get( RES_BACKGROUND ); 2565cdf0e10cSrcweir 2566cdf0e10cSrcweir rSh.SetBoxBackground( (SvxBrushItem&) 2567cdf0e10cSrcweir pDlg->GetOutputItemSet()->Get( RES_BACKGROUND )); 2568cdf0e10cSrcweir pOutSet = pDlg->GetOutputItemSet(); 2569cdf0e10cSrcweir } 2570cdf0e10cSrcweir } 2571cdf0e10cSrcweir else if ( rSh.IsFrmSelected() ) 2572cdf0e10cSrcweir { 2573cdf0e10cSrcweir 2574cdf0e10cSrcweir rSh.GetFlyFrmAttr( aSet ); 2575cdf0e10cSrcweir 2576cdf0e10cSrcweir pDlg = pFact->CreateSfxDialog( pMDI, aSet, 2577cdf0e10cSrcweir rView.GetViewFrame()->GetFrame().GetFrameInterface(), 2578cdf0e10cSrcweir RC_SWDLG_BACKGROUND ); 2579cdf0e10cSrcweir DBG_ASSERT(pDlg, "Dialogdiet fail!"); 2580cdf0e10cSrcweir if ( pDlg->Execute() == RET_OK ) 2581cdf0e10cSrcweir { 2582cdf0e10cSrcweir rSh.SetFlyFrmAttr((SfxItemSet &) *pDlg->GetOutputItemSet() ); 2583cdf0e10cSrcweir pOutSet = pDlg->GetOutputItemSet(); 2584cdf0e10cSrcweir } 2585cdf0e10cSrcweir } 2586cdf0e10cSrcweir else 2587cdf0e10cSrcweir { 2588cdf0e10cSrcweir // Umrandungsattribute ganz normal ueber Shell setzen 2589cdf0e10cSrcweir rSh.GetCurAttr( aSet ); 2590cdf0e10cSrcweir 2591cdf0e10cSrcweir pDlg = pFact->CreateSfxDialog( pMDI, aSet, 2592cdf0e10cSrcweir rView.GetViewFrame()->GetFrame().GetFrameInterface(), 2593cdf0e10cSrcweir RC_SWDLG_BACKGROUND ); 2594cdf0e10cSrcweir DBG_ASSERT(pDlg, "Dialogdiet fail!"); 2595cdf0e10cSrcweir if ( pDlg->Execute() == RET_OK ) 2596cdf0e10cSrcweir { 2597cdf0e10cSrcweir rSh.SetAttr( *pDlg->GetOutputItemSet() ); 2598cdf0e10cSrcweir pOutSet = pDlg->GetOutputItemSet(); 2599cdf0e10cSrcweir } 2600cdf0e10cSrcweir } 2601cdf0e10cSrcweir if(pOutSet) 2602cdf0e10cSrcweir { 2603cdf0e10cSrcweir rReq.Done(*pOutSet); 2604cdf0e10cSrcweir bDone = true; 2605cdf0e10cSrcweir } 2606cdf0e10cSrcweir delete pDlg; 2607cdf0e10cSrcweir 2608cdf0e10cSrcweir } 2609cdf0e10cSrcweir break; 2610cdf0e10cSrcweir default:DBG_ERROR("falscher Dispatcher (basesh.cxx)"); 2611cdf0e10cSrcweir } 2612cdf0e10cSrcweir if(!bDone) 2613cdf0e10cSrcweir rReq.Done(); 2614cdf0e10cSrcweir } 2615cdf0e10cSrcweir 2616cdf0e10cSrcweir // ---------------------------------------------------------------------------- 2617cdf0e10cSrcweir 2618cdf0e10cSrcweir 2619cdf0e10cSrcweir SwWrtShell& SwBaseShell::GetShell() 2620cdf0e10cSrcweir { 2621cdf0e10cSrcweir return rView.GetWrtShell(); 2622cdf0e10cSrcweir } 2623cdf0e10cSrcweir 2624cdf0e10cSrcweir // ---------------------------------------------------------------------------- 2625cdf0e10cSrcweir 2626cdf0e10cSrcweir SwWrtShell* SwBaseShell::GetShellPtr() 2627cdf0e10cSrcweir { 2628cdf0e10cSrcweir return rView.GetWrtShellPtr(); 2629cdf0e10cSrcweir } 2630cdf0e10cSrcweir 2631cdf0e10cSrcweir // ---------------------------------------------------------------------------- 2632cdf0e10cSrcweir 2633cdf0e10cSrcweir void SwBaseShell::InsertTable( SfxRequest& _rRequest ) 2634cdf0e10cSrcweir { 2635cdf0e10cSrcweir const SfxItemSet* pArgs = _rRequest.GetArgs(); 2636cdf0e10cSrcweir SwWrtShell& rSh = GetShell(); 2637cdf0e10cSrcweir 2638cdf0e10cSrcweir if ( !( rSh.GetFrmType( 0, sal_True ) & FRMTYPE_FOOTNOTE ) ) 2639cdf0e10cSrcweir { 2640cdf0e10cSrcweir SwView &rTempView = GetView(); // Da GetView() nach Shellwechsel nicht mehr geht 2641cdf0e10cSrcweir sal_Bool bHTMLMode = 0 != (::GetHtmlMode(rTempView.GetDocShell())&HTMLMODE_ON); 2642cdf0e10cSrcweir sal_Bool bCallEndUndo = sal_False; 2643cdf0e10cSrcweir 2644cdf0e10cSrcweir if( !pArgs && rSh.IsSelection() && !rSh.IsInClickToEdit() && 2645cdf0e10cSrcweir !rSh.IsTableMode() ) 2646cdf0e10cSrcweir { 2647cdf0e10cSrcweir const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); 2648cdf0e10cSrcweir SwInsertTableOptions aInsTblOpts = pModOpt->GetInsTblFlags(bHTMLMode); 2649cdf0e10cSrcweir 2650cdf0e10cSrcweir rSh.StartUndo(UNDO_INSTABLE); 2651cdf0e10cSrcweir bCallEndUndo = sal_True; 2652cdf0e10cSrcweir 2653cdf0e10cSrcweir sal_Bool bInserted = rSh.TextToTable( aInsTblOpts, '\t', text::HoriOrientation::FULL ); 2654cdf0e10cSrcweir rSh.EnterStdMode(); 2655cdf0e10cSrcweir if (bInserted) 2656cdf0e10cSrcweir rTempView.AutoCaption(TABLE_CAP); 2657cdf0e10cSrcweir _rRequest.Done(); 2658cdf0e10cSrcweir } 2659cdf0e10cSrcweir else 2660cdf0e10cSrcweir { 2661cdf0e10cSrcweir sal_uInt16 nCols = 0; 2662cdf0e10cSrcweir sal_uInt16 nRows = 0; 2663cdf0e10cSrcweir SwInsertTableOptions aInsTblOpts( tabopts::ALL_TBL_INS_ATTR, 1 ); 2664cdf0e10cSrcweir String aTableName, aAutoName; 2665cdf0e10cSrcweir SwTableAutoFmt* pTAFmt = 0; 2666cdf0e10cSrcweir 2667cdf0e10cSrcweir if( pArgs && pArgs->Count() >= 2 ) 2668cdf0e10cSrcweir { 2669cdf0e10cSrcweir SFX_REQUEST_ARG( _rRequest, pName, SfxStringItem, FN_INSERT_TABLE, sal_False ); 2670cdf0e10cSrcweir SFX_REQUEST_ARG( _rRequest, pCols, SfxUInt16Item, SID_ATTR_TABLE_COLUMN, sal_False ); 2671cdf0e10cSrcweir SFX_REQUEST_ARG( _rRequest, pRows, SfxUInt16Item, SID_ATTR_TABLE_ROW, sal_False ); 2672cdf0e10cSrcweir SFX_REQUEST_ARG( _rRequest, pFlags, SfxInt32Item, FN_PARAM_1, sal_False ); 2673cdf0e10cSrcweir SFX_REQUEST_ARG( _rRequest, pAuto, SfxStringItem, FN_PARAM_2, sal_False ); 2674cdf0e10cSrcweir 2675cdf0e10cSrcweir if ( pName ) 2676cdf0e10cSrcweir aTableName = pName->GetValue(); 2677cdf0e10cSrcweir if ( pCols ) 2678cdf0e10cSrcweir nCols = pCols->GetValue(); 2679cdf0e10cSrcweir if ( pRows ) 2680cdf0e10cSrcweir nRows = pRows->GetValue(); 2681cdf0e10cSrcweir if ( pAuto ) 2682cdf0e10cSrcweir { 2683cdf0e10cSrcweir aAutoName = pAuto->GetValue(); 2684cdf0e10cSrcweir if ( aAutoName.Len() ) 2685cdf0e10cSrcweir { 2686cdf0e10cSrcweir SwTableAutoFmtTbl aTableTbl; 2687cdf0e10cSrcweir aTableTbl.Load(); 2688cdf0e10cSrcweir for ( sal_uInt16 n=0; n<aTableTbl.Count(); n++ ) 2689cdf0e10cSrcweir { 2690cdf0e10cSrcweir if ( aTableTbl[n]->GetName() == aAutoName ) 2691cdf0e10cSrcweir { 2692cdf0e10cSrcweir pTAFmt = new SwTableAutoFmt( *aTableTbl[n] ); 2693cdf0e10cSrcweir break; 2694cdf0e10cSrcweir } 2695cdf0e10cSrcweir } 2696cdf0e10cSrcweir } 2697cdf0e10cSrcweir } 2698cdf0e10cSrcweir 2699cdf0e10cSrcweir if ( pFlags ) 2700cdf0e10cSrcweir aInsTblOpts.mnInsMode = (sal_uInt16) pFlags->GetValue(); 2701cdf0e10cSrcweir else 2702cdf0e10cSrcweir { 2703cdf0e10cSrcweir const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); 2704cdf0e10cSrcweir aInsTblOpts = pModOpt->GetInsTblFlags(bHTMLMode); 2705cdf0e10cSrcweir } 2706cdf0e10cSrcweir } 2707cdf0e10cSrcweir 2708cdf0e10cSrcweir if( !nCols || !nRows ) 2709cdf0e10cSrcweir { 2710cdf0e10cSrcweir SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); 2711cdf0e10cSrcweir DBG_ASSERT(pFact, "Dialogdiet fail!"); 2712cdf0e10cSrcweir AbstractInsTableDlg* pDlg = pFact->CreateInsTableDlg( DLG_INSERT_TABLE, rTempView ); 2713cdf0e10cSrcweir DBG_ASSERT(pDlg, "Dialogdiet fail!"); 2714cdf0e10cSrcweir if( RET_OK == pDlg->Execute() ) 2715cdf0e10cSrcweir { 2716cdf0e10cSrcweir pDlg->GetValues( aTableName, nRows, nCols, aInsTblOpts, aAutoName, pTAFmt ); 2717cdf0e10cSrcweir } 2718cdf0e10cSrcweir else 2719cdf0e10cSrcweir _rRequest.Ignore(); 2720cdf0e10cSrcweir delete pDlg; 2721cdf0e10cSrcweir } 2722cdf0e10cSrcweir 2723cdf0e10cSrcweir if( nCols && nRows ) 2724cdf0e10cSrcweir { 2725cdf0e10cSrcweir // record before shell change 2726cdf0e10cSrcweir _rRequest.AppendItem( SfxStringItem( FN_INSERT_TABLE, aTableName ) ); 2727cdf0e10cSrcweir if ( aAutoName.Len() ) 2728cdf0e10cSrcweir _rRequest.AppendItem( SfxStringItem( FN_PARAM_2, aAutoName ) ); 2729cdf0e10cSrcweir _rRequest.AppendItem( SfxUInt16Item( SID_ATTR_TABLE_COLUMN, nCols ) ); 2730cdf0e10cSrcweir _rRequest.AppendItem( SfxUInt16Item( SID_ATTR_TABLE_ROW, nRows ) ); 2731cdf0e10cSrcweir _rRequest.AppendItem( SfxInt32Item( FN_PARAM_1, (sal_Int32) aInsTblOpts.mnInsMode ) ); 2732cdf0e10cSrcweir _rRequest.Done(); 2733cdf0e10cSrcweir 2734cdf0e10cSrcweir rSh.StartUndo(UNDO_INSTABLE); 2735cdf0e10cSrcweir bCallEndUndo = sal_True; 2736cdf0e10cSrcweir 2737cdf0e10cSrcweir rSh.StartAllAction(); 2738cdf0e10cSrcweir if( rSh.HasSelection() ) 2739cdf0e10cSrcweir rSh.DelRight(); 2740cdf0e10cSrcweir 2741cdf0e10cSrcweir rSh.InsertTable( aInsTblOpts, nRows, nCols, text::HoriOrientation::FULL, pTAFmt ); 2742cdf0e10cSrcweir rSh.MoveTable( fnTablePrev, fnTableStart ); 2743cdf0e10cSrcweir 2744cdf0e10cSrcweir if( aTableName.Len() && !rSh.GetTblStyle( aTableName ) ) 2745cdf0e10cSrcweir rSh.GetTableFmt()->SetName( aTableName ); 2746cdf0e10cSrcweir 2747cdf0e10cSrcweir rSh.EndAllAction(); 2748cdf0e10cSrcweir rTempView.AutoCaption(TABLE_CAP); 2749cdf0e10cSrcweir } 2750cdf0e10cSrcweir delete pTAFmt; 2751cdf0e10cSrcweir } 2752cdf0e10cSrcweir 2753cdf0e10cSrcweir if( bCallEndUndo ) 2754cdf0e10cSrcweir { 2755cdf0e10cSrcweir SwRewriter aRewriter; 2756cdf0e10cSrcweir 2757cdf0e10cSrcweir if (rSh.GetTableFmt()) 2758cdf0e10cSrcweir { 2759cdf0e10cSrcweir aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_START_QUOTE)); 2760cdf0e10cSrcweir aRewriter.AddRule(UNDO_ARG2, rSh.GetTableFmt()->GetName()); 2761cdf0e10cSrcweir aRewriter.AddRule(UNDO_ARG3, SW_RES(STR_END_QUOTE)); 2762cdf0e10cSrcweir 2763cdf0e10cSrcweir } 2764cdf0e10cSrcweir rSh.EndUndo(UNDO_INSTABLE, &aRewriter); // wegen moegl. Shellwechsel 2765cdf0e10cSrcweir } 2766cdf0e10cSrcweir } 2767cdf0e10cSrcweir } 2768cdf0e10cSrcweir 2769cdf0e10cSrcweir // ---------------------------------------------------------------------------- 2770cdf0e10cSrcweir 2771cdf0e10cSrcweir void SwBaseShell::GetGalleryState( SfxItemSet &rSet ) 2772cdf0e10cSrcweir { 2773cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 2774cdf0e10cSrcweir SfxWhichIter aIter( rSet ); 2775cdf0e10cSrcweir sal_uInt16 nWhich = aIter.FirstWhich(); 2776cdf0e10cSrcweir switch ( nWhich ) 2777cdf0e10cSrcweir { 2778cdf0e10cSrcweir case SID_GALLERY_BG_BRUSH: 2779cdf0e10cSrcweir { 2780cdf0e10cSrcweir int nSel = rSh.GetSelectionType(); 2781cdf0e10cSrcweir SfxStringListItem aLst( nWhich ); 2782cdf0e10cSrcweir List *pLst = aLst.GetList(); 2783cdf0e10cSrcweir nParagraphPos = nGraphicPos = nOlePos = nFramePos = nTablePos = 2784cdf0e10cSrcweir nTableRowPos = nTableCellPos = nPagePos = 2785cdf0e10cSrcweir nHeaderPos = nFooterPos = 0; 2786cdf0e10cSrcweir sal_uInt8 nPos = 1; 2787cdf0e10cSrcweir pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_PAGE ), pLst->Count() ); 2788cdf0e10cSrcweir nPagePos = nPos++; 2789cdf0e10cSrcweir sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell()); 2790cdf0e10cSrcweir sal_Bool bHtmlMode = 0 != (nHtmlMode & HTMLMODE_ON); 2791cdf0e10cSrcweir 2792cdf0e10cSrcweir if ( (!bHtmlMode || (nHtmlMode & HTMLMODE_FULL_STYLES)) && 2793cdf0e10cSrcweir (nSel & nsSelectionType::SEL_TXT) ) 2794cdf0e10cSrcweir { 2795cdf0e10cSrcweir pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_PARAGRAPH ), pLst->Count() ); 2796cdf0e10cSrcweir nParagraphPos = nPos++; 2797cdf0e10cSrcweir } 2798cdf0e10cSrcweir if ( (!bHtmlMode || (nHtmlMode & HTMLMODE_SOME_STYLES)) && 2799cdf0e10cSrcweir nSel & (nsSelectionType::SEL_TBL|nsSelectionType::SEL_TBL_CELLS) ) 2800cdf0e10cSrcweir { 2801cdf0e10cSrcweir pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_TABLE ), pLst->Count() ); 2802cdf0e10cSrcweir nTablePos = nPos++; 2803cdf0e10cSrcweir 2804cdf0e10cSrcweir if(!bHtmlMode) 2805cdf0e10cSrcweir { 2806cdf0e10cSrcweir pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_TABLE_ROW ), pLst->Count() ); 2807cdf0e10cSrcweir nTableRowPos = nPos++; 2808cdf0e10cSrcweir } 2809cdf0e10cSrcweir 2810cdf0e10cSrcweir pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_TABLE_CELL), pLst->Count() ); 2811cdf0e10cSrcweir nTableCellPos = nPos++; 2812cdf0e10cSrcweir } 2813cdf0e10cSrcweir if(!bHtmlMode) 2814cdf0e10cSrcweir { 2815cdf0e10cSrcweir if ( nSel & nsSelectionType::SEL_FRM ) 2816cdf0e10cSrcweir { 2817cdf0e10cSrcweir pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_FRAME ), pLst->Count() ); 2818cdf0e10cSrcweir nFramePos = nPos++; 2819cdf0e10cSrcweir } 2820cdf0e10cSrcweir if ( nSel & nsSelectionType::SEL_GRF ) 2821cdf0e10cSrcweir { 2822cdf0e10cSrcweir pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_GRAPHIC ), pLst->Count() ); 2823cdf0e10cSrcweir nGraphicPos = nPos++; 2824cdf0e10cSrcweir } 2825cdf0e10cSrcweir if ( nSel & nsSelectionType::SEL_OLE ) 2826cdf0e10cSrcweir { 2827cdf0e10cSrcweir pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_OLE ), pLst->Count() ); 2828cdf0e10cSrcweir nOlePos = nPos++; 2829cdf0e10cSrcweir } 2830cdf0e10cSrcweir const sal_uInt16 nType = rSh.GetFrmType(0,sal_True); 2831cdf0e10cSrcweir if ( nType & FRMTYPE_HEADER ) 2832cdf0e10cSrcweir { 2833cdf0e10cSrcweir pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_HEADER ), pLst->Count() ); 2834cdf0e10cSrcweir nHeaderPos = nPos++; 2835cdf0e10cSrcweir } 2836cdf0e10cSrcweir if ( nType & FRMTYPE_FOOTER ) 2837cdf0e10cSrcweir { 2838cdf0e10cSrcweir pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_FOOTER ), pLst->Count() ); 2839cdf0e10cSrcweir nFooterPos = nPos; 2840cdf0e10cSrcweir } 2841cdf0e10cSrcweir } 2842cdf0e10cSrcweir if ( pLst->Count() ) 2843cdf0e10cSrcweir rSet.Put( aLst ); 2844cdf0e10cSrcweir else 2845cdf0e10cSrcweir rSet.DisableItem( nWhich ); 2846cdf0e10cSrcweir break; 2847cdf0e10cSrcweir } 2848cdf0e10cSrcweir } 2849cdf0e10cSrcweir } 2850cdf0e10cSrcweir 2851cdf0e10cSrcweir 2852cdf0e10cSrcweir void SwBaseShell::ExecuteGallery(SfxRequest &rReq) 2853cdf0e10cSrcweir { 2854cdf0e10cSrcweir SwWrtShell &rSh = GetShell(); 2855cdf0e10cSrcweir rSh.StartAction(); 2856cdf0e10cSrcweir const SfxItemSet* pArgs = rReq.GetArgs(); 2857cdf0e10cSrcweir sal_uInt16 nSlot = rReq.GetSlot(); 2858cdf0e10cSrcweir switch(nSlot) 2859cdf0e10cSrcweir { 2860cdf0e10cSrcweir case SID_GALLERY_BG_BRUSH: 2861cdf0e10cSrcweir { 2862cdf0e10cSrcweir int nSel = rSh.GetSelectionType(); 2863cdf0e10cSrcweir if ( nSel & nsSelectionType::SEL_DRW_TXT ) 2864cdf0e10cSrcweir break; 2865cdf0e10cSrcweir 2866cdf0e10cSrcweir sal_uInt8 nPos = (sal_uInt8)((SfxUInt16Item &)pArgs->Get(SID_GALLERY_BG_POS)).GetValue(); 2867cdf0e10cSrcweir ++nPos; 2868cdf0e10cSrcweir 2869cdf0e10cSrcweir SvxBrushItem aBrush( (SvxBrushItem&)pArgs->Get(SID_GALLERY_BG_BRUSH)); 2870cdf0e10cSrcweir aBrush.SetWhich( RES_BACKGROUND ); 2871cdf0e10cSrcweir if ( nPos == nParagraphPos ) 2872cdf0e10cSrcweir rSh.SetAttr( aBrush ); 2873cdf0e10cSrcweir else if ( nPos == nTablePos ) 2874cdf0e10cSrcweir rSh.SetTabBackground( aBrush ); 2875cdf0e10cSrcweir else if ( nPos == nTableRowPos ) 2876cdf0e10cSrcweir rSh.SetRowBackground( aBrush ); 2877cdf0e10cSrcweir else if ( nPos == nTableCellPos ) 2878cdf0e10cSrcweir rSh.SetBoxBackground( aBrush ); 2879cdf0e10cSrcweir else if ( nPos == nFramePos || nPos == nGraphicPos || nPos == nOlePos ) 2880cdf0e10cSrcweir { 2881cdf0e10cSrcweir SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND); 2882cdf0e10cSrcweir aCoreSet.Put( aBrush ); 2883cdf0e10cSrcweir rSh.SetFlyFrmAttr( aCoreSet ); 2884cdf0e10cSrcweir } 2885cdf0e10cSrcweir else if ( nPos == nPagePos || nPos == nHeaderPos || nPos == nFooterPos ) 2886cdf0e10cSrcweir { 2887cdf0e10cSrcweir sal_uInt16 nDesc = rSh.GetCurPageDesc(); 2888cdf0e10cSrcweir SwPageDesc aDesc( rSh.GetPageDesc( nDesc ) ); 2889cdf0e10cSrcweir if ( nPos == nPagePos ) 2890cdf0e10cSrcweir aDesc.GetMaster().SetFmtAttr( aBrush ); 2891cdf0e10cSrcweir else if ( nPos == nHeaderPos ) 2892cdf0e10cSrcweir { 2893cdf0e10cSrcweir SwFmtHeader aHead( aDesc.GetMaster().GetHeader() ); 2894cdf0e10cSrcweir aHead.GetHeaderFmt()->SetFmtAttr( aBrush ); 2895cdf0e10cSrcweir aDesc.GetMaster().SetFmtAttr( aHead ); 2896cdf0e10cSrcweir } 2897cdf0e10cSrcweir else if ( nPos == nFooterPos ) 2898cdf0e10cSrcweir { 2899cdf0e10cSrcweir SwFmtFooter aFoot( aDesc.GetMaster().GetFooter() ); 2900cdf0e10cSrcweir aFoot.GetFooterFmt()->SetFmtAttr( aBrush ); 2901cdf0e10cSrcweir aDesc.GetMaster().SetFmtAttr( aFoot ); 2902cdf0e10cSrcweir } 2903cdf0e10cSrcweir rSh.ChgPageDesc( nDesc, aDesc ); 2904cdf0e10cSrcweir } 2905cdf0e10cSrcweir break; 2906cdf0e10cSrcweir } 2907cdf0e10cSrcweir } 2908cdf0e10cSrcweir rSh.EndAction(); 2909cdf0e10cSrcweir rReq.Done(); 2910cdf0e10cSrcweir } 2911cdf0e10cSrcweir 2912cdf0e10cSrcweir void SwBaseShell::ExecField( SfxRequest& rReq ) 2913cdf0e10cSrcweir { 2914cdf0e10cSrcweir sal_uInt16 nSlot = rReq.GetSlot(); 2915cdf0e10cSrcweir switch( nSlot ) 2916cdf0e10cSrcweir { 2917cdf0e10cSrcweir case FN_CHANGE_DBFIELD: 2918cdf0e10cSrcweir { 2919cdf0e10cSrcweir SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); 2920cdf0e10cSrcweir DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); 2921cdf0e10cSrcweir 2922cdf0e10cSrcweir VclAbstractDialog* pDlg = pFact->CreateSwChangeDBDlg(GetView(), DLG_CHANGE_DB ); 2923cdf0e10cSrcweir DBG_ASSERT(pDlg, "Dialogdiet fail!"); 2924cdf0e10cSrcweir pDlg->Execute(); 2925cdf0e10cSrcweir delete pDlg; 2926cdf0e10cSrcweir } 2927cdf0e10cSrcweir break; 2928cdf0e10cSrcweir default: 2929cdf0e10cSrcweir ASSERT(sal_False, falscher Dispatcher); 2930cdf0e10cSrcweir } 2931cdf0e10cSrcweir } 2932cdf0e10cSrcweir 2933