/************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 3 * only, as published by the Free Software Foundation. * * OpenOffice.org is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License version 3 for more details * (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU Lesser General Public License * version 3 along with OpenOffice.org. If not, see * * for a copy of the LGPLv3 License. * ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" #include #include #include #include #include #include #include #include #include #include #include "viewopt.hxx" #include "cmdid.h" #include "view.hxx" #include "wrtsh.hxx" #include "swundo.hxx" // fuer Undo-Ids #include "textsh.hxx" #include "idxmrk.hxx" #include "cnttab.hxx" #include "toxmgr.hxx" #include "swabstdlg.hxx" #include #include // STATIC DATA ----------------------------------------------------------- void SwTextShell::ExecIdx(SfxRequest &rReq) { const SfxItemSet *pArgs = rReq.GetArgs(); const SfxPoolItem* pItem = 0; USHORT nSlot = rReq.GetSlot(); if(pArgs) pArgs->GetItemState(nSlot, FALSE, &pItem ); SfxViewFrame* pVFrame = GetView().GetViewFrame(); Window *pMDI = &pVFrame->GetWindow(); switch( nSlot ) { case FN_EDIT_AUTH_ENTRY_DLG : { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "Dialogdiet fail!"); VclAbstractDialog* pDlg = pFact->CreateVclAbstractDialog( pMDI, GetShell(), DLG_EDIT_AUTHMARK); DBG_ASSERT(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; } break; case FN_INSERT_AUTH_ENTRY_DLG: { // no BASIC support pVFrame->ToggleChildWindow(FN_INSERT_AUTH_ENTRY_DLG); Invalidate(rReq.GetSlot()); } break; case FN_INSERT_IDX_ENTRY_DLG: { pVFrame->ToggleChildWindow(FN_INSERT_IDX_ENTRY_DLG); Invalidate(rReq.GetSlot()); } break; case FN_EDIT_IDX_ENTRY_DLG: { SwTOXMgr aMgr(GetShellPtr()); USHORT nRet = RET_OK; if(aMgr.GetTOXMarkCount() > 1) { // Mehrere Marken, welche solls denn sein ? // SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "Dialogdiet fail!"); VclAbstractDialog* pMultDlg = pFact->CreateMultiTOXMarkDlg( DLG_MULTMRK, pMDI, aMgr); DBG_ASSERT(pMultDlg, "Dialogdiet fail!"); nRet = pMultDlg->Execute(); delete pMultDlg; } if( nRet == RET_OK) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "Dialogdiet fail!"); VclAbstractDialog* pDlg = pFact->CreateIndexMarkModalDlg( DLG_EDIT_IDXMARK, pMDI, GetShell(), aMgr.GetCurTOXMark() ); DBG_ASSERT(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; } break; } case FN_IDX_MARK_TO_IDX: { GetShell().GotoTOXMarkBase(); break; } case FN_INSERT_MULTI_TOX: { SfxItemSet aSet(GetPool(), RES_COL, RES_COL, RES_BACKGROUND, RES_BACKGROUND, RES_FRM_SIZE, RES_FRM_SIZE, SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, RES_LR_SPACE, RES_LR_SPACE, FN_PARAM_TOX_TYPE, FN_PARAM_TOX_TYPE, 0 ); SwWrtShell& rSh = GetShell(); SwRect aRect; rSh.CalcBoundRect(aRect, FLY_AS_CHAR); long nWidth = aRect.Width(); aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth)); // Hoehe=Breite fuer konsistentere Vorschau (analog zu Bereich bearbeiten) aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); const SwTOXBase* pCurTOX = 0; BOOL bGlobal = FALSE; if(pItem) { pCurTOX = (const SwTOXBase* )((SwPtrItem*)pItem)->GetValue(); bGlobal = TRUE; } else pCurTOX = rSh.GetCurTOX(); if(pCurTOX) { const SfxItemSet* pSet = pCurTOX->GetAttrSet(); if(pSet) aSet.Put(*pSet); } SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "Dialogdiet fail!"); AbstractMultiTOXTabDialog* pDlg = pFact->CreateMultiTOXTabDialog( DLG_MULTI_TOX, pMDI, aSet, rSh, (SwTOXBase* )pCurTOX, USHRT_MAX, bGlobal); DBG_ASSERT(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; } break; case FN_REMOVE_CUR_TOX: { SwWrtShell& rSh = GetShell(); const SwTOXBase* pBase = rSh.GetCurTOX(); DBG_ASSERT(pBase, "no TOXBase to remove"); if( pBase ) rSh.DeleteTOX(*pBase, TRUE); } break; default: ASSERT(!this, falscher Dispatcher); return; } } void SwTextShell::GetIdxState(SfxItemSet &rSet) { SwWrtShell& rSh = GetShell(); SfxViewFrame* pVFrame = GetView().GetViewFrame(); SwInsertIdxMarkWrapper *pIdxMrk = (SwInsertIdxMarkWrapper*) pVFrame->GetChildWindow(FN_INSERT_IDX_ENTRY_DLG); SfxChildWindow* pAuthMark = pVFrame->GetChildWindow(FN_INSERT_AUTH_ENTRY_DLG); const BOOL bHtmlMode = 0 != ::GetHtmlMode( GetView().GetDocShell() ); const SwTOXBase* pBase = 0; if( bHtmlMode || 0 != ( pBase = rSh.GetCurTOX()) ) { if( pBase ) { if(pBase->IsTOXBaseInReadonly()) { rSet.DisableItem( FN_INSERT_MULTI_TOX ); } } rSet.DisableItem( FN_EDIT_IDX_ENTRY_DLG ); rSet.DisableItem( FN_EDIT_AUTH_ENTRY_DLG ); if(!pIdxMrk) rSet.DisableItem( FN_INSERT_IDX_ENTRY_DLG ); else rSet.Put(SfxBoolItem(FN_INSERT_IDX_ENTRY_DLG, TRUE)); if(!pAuthMark) rSet.DisableItem( FN_INSERT_AUTH_ENTRY_DLG ); else rSet.Put(SfxBoolItem(FN_INSERT_AUTH_ENTRY_DLG, TRUE)); } else //if( SFX_ITEM_UNKNOWN != rSet.GetItemState( FN_EDIT_IDX_ENTRY_DLG )) { BOOL bEnableEdit = TRUE; BOOL bInReadonly = rSh.HasReadonlySel(); if( rSh.HasSelection() || bInReadonly) bEnableEdit = FALSE; else { SwTOXMarks aArr; rSh.GetCurTOXMarks( aArr ); if( !aArr.Count()) bEnableEdit = FALSE; } if(!bEnableEdit) rSet.DisableItem( FN_EDIT_IDX_ENTRY_DLG ); if(bInReadonly) { rSet.DisableItem(FN_INSERT_IDX_ENTRY_DLG); rSet.DisableItem( FN_INSERT_MULTI_TOX ); } else rSet.Put(SfxBoolItem(FN_INSERT_IDX_ENTRY_DLG, 0 != pIdxMrk)); SwField* pField = rSh.GetCurFld(); if(bInReadonly) rSet.DisableItem(FN_INSERT_AUTH_ENTRY_DLG); else rSet.Put(SfxBoolItem(FN_INSERT_AUTH_ENTRY_DLG, 0 != pAuthMark)); if( bInReadonly || !pField || pField->GetTyp()->Which() != RES_AUTHORITY) rSet.DisableItem(FN_EDIT_AUTH_ENTRY_DLG); rSet.DisableItem(FN_REMOVE_CUR_TOX); } } // ----------------------------------------------------------------------- n> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2017-07-20loplugin:constparams in xmloffNoel Grandin
2017-05-17tdf#100033: Frames with the same name are removedTamás Zolnai
2017-02-08loplugin:unusedenumconstants read-only constants in xmloffNoel Grandin
2017-02-03loplugin:unusedenumconstants in xmloffNoel Grandin
2017-02-03new loplugin:unusedenumconstantsNoel Grandin
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann
2016-08-30loplugin:countusersofdefaultparamsNoel Grandin
2016-07-07GSoC Writer Table Styles ImportJakub Trzebiatowski
2016-05-24Convert XMLTextType to scoped enumNoel Grandin
2016-02-25loplugin:unuseddefaultparams in xmloff/Noel Grandin
2016-01-08tdf#96480: ODF import: eliminate duplicate cross reference heading bookmarksMichael Stahl
2015-11-18xmloff: document potential pitfall with SvI18NMap usageMichael Stahl
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
2015-10-23com::sun::star->css in include/ucbhelper to include/xmlscriptNoel Grandin
2015-10-12Replace "SAL_DELETED_FUNCTION" with "= delete" in LIBO_INTERNAL_ONLY codeStephan Bergmann
2015-10-01remove old standalone Sun bug numbersNoel Grandin
2015-08-27Clean up sEmptyStephan Bergmann
2015-05-18Related tdf#88056: use better-fitting <text:page-name>Katarina Behrens
2015-04-22tdf#88056: Implement import of page title field from ODFKatarina Behrens
2015-04-07loplugin:staticmethodsNoel Grandin
2015-02-17boost->stdCaolán McNamara
2015-02-16boost::foo_ptr->std::foo_ptrCaolán McNamara
2014-11-11xmloff: XML_DROPDOWN should be XML_DROP_DOWNMichael Stahl
2014-07-02drop UniReference in favour of rtl::ReferenceNoel Grandin
2014-04-01Explicitly mark overriding destructors as "virtual"Stephan Bergmann
2014-03-31xmloff: sal_Bool->boolNoel Grandin
2014-03-13xmloff,vbahelper: prefer passing OUString and OString by referenceNoel Grandin
2013-12-05Get rid of comphelper::UStringLessStephan Bergmann
2013-11-09fdo#65108 inter-module includes <> include/xmloffNorbert Thiebaud
2013-10-23fixincludeguards.sh: include/xml*Thomas Arnhold
2013-07-10fix reading fonts from .odp using style::font-name (fdo#65338)Luboš Luňák
2013-04-25comments and code reformatMaxime de Roucy
2013-04-23execute move of global headersBjoern Michaelsen