22#include <com/sun/star/frame/XModel.hpp>
23#include <com/sun/star/frame/XTitle.hpp>
47#define ShellClass_SwWebGlosDocShell
48#define ShellClass_SwGlosDocShell
72 if ( rReq.
GetSlot() != SID_SAVEDOC )
83 rSh.SfxObjectShell::GetInterface() ));
101 const OUString& rShortNm,
const OUString& rLongNm )
104 std::unique_ptr<SwTextBlocks> pBlock(
::GetGlossaries()->GetGroupDoc( rGroupName ));
106 SvxMacro aStart { OUString(), OUString() };
107 SvxMacro aEnd { OUString(), OUString() };
111 pGlosHdl->
GetMacros( rShortNm, aStart, aEnd, pBlock.get() );
115 pBlock->IsOnlyTextBlock( rShortNm ) );
117 if(aStart.HasMacro() || aEnd.HasMacro() )
121 pGlosHdl->
SetMacros( rShortNm, pStart, pEnd, pBlock.get() );
125 if( USHRT_MAX != nRet )
127 return nRet != USHRT_MAX;
200 std::unique_ptr<SwTextBlocks> pGroup =
GetGroupDoc( rGroup );
201 if (pGroup && pGroup->GetCount())
205 const OUString sLongName = pGroup->GetLongName(pGroup->GetIndex( rShortName ));
228 const OUString aDocTitle(
SwResId( STR_GLOSSARY ) +
" " + sLongName);
230 bool const bDoesUndo =
231 xDocSh->GetDoc()->GetIDocumentUndoRedo().DoesUndo();
232 xDocSh->GetDoc()->GetIDocumentUndoRedo().DoUndo(
false );
234 xDocSh->GetWrtShell()->InsertGlossary( *pGroup, rShortName );
235 if( !xDocSh->GetDoc()->getIDocumentDeviceAccess().getPrinter(
false ) )
240 SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
241 SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
243 ( xDocSh->GetDoc()->GetAttrPool() );
247 xDocSh->GetDoc()->getIDocumentDeviceAccess().setPrinter( pPrinter,
true,
true );
250 xDocSh->SetTitle( aDocTitle );
254 uno::Reference< frame::XTitle > xTitle( xDocSh->GetModel(), uno::UNO_QUERY_THROW );
255 xTitle->setTitle( aDocTitle );
257 catch (
const uno::Exception&)
261 xDocSh->GetDoc()->GetIDocumentUndoRedo().DoUndo( bDoesUndo );
262 xDocSh->GetDoc()->getIDocumentState().ResetModified();
virtual void ResetModified()=0
virtual bool IsModified() const =0
Changes of document?
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void DisableItem(sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
void SetReturnValue(const SfxPoolItem &)
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
static SfxViewFrame * LoadDocument(SfxObjectShell const &i_rDoc, SfxInterfaceId i_nViewId)
SfxFrame & GetFrame() const
static SfxViewFrame * LoadHiddenDocument(SfxObjectShell const &i_rDoc, SfxInterfaceId i_nViewId)
static SvxAutoCorrCfg & Get()
bool IsSaveRelFile() const
virtual bool Save() override
global IO.
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
virtual void SetModified(bool=true) override
SwDoc * GetDoc()
returns Doc. But be careful!
IDocumentState const & getIDocumentState() const
sal_uInt16 SaveGlossaryDoc(SwTextBlocks &rGlossary, const OUString &rName, const OUString &rShortName, bool bSaveRelFile, bool bOnlyText)
Save complete content of doc as glossary.
virtual bool Save() override
global IO.
void SetLongName(const OUString &rLongName)
virtual ~SwGlosDocShell() override
void SetShortName(const OUString &rShortName)
void GetState(SfxItemSet &)
SwGlosDocShell(bool bNewShow)
void SetGroupName(const OUString &rGroupName)
void Execute(SfxRequest &)
std::unique_ptr< SwTextBlocks > GetGroupDoc(const OUString &rName, bool bCreate=false)
SwDocShellRef EditGroupDoc(const OUString &rGrpName, const OUString &rShortName, bool bShow=true)
void SetMacros(const OUString &rName, const SvxMacro *pStart, const SvxMacro *pEnd, SwTextBlocks *pGlossary=nullptr)
void GetMacros(const OUString &rShortName, SvxMacro &rStart, SvxMacro &rEnd, SwTextBlocks *pGlossary=nullptr)
SwGlossaryHdl * GetGlosHdl()
void SetGroupName(const OUString &rGroupName)
virtual ~SwWebGlosDocShell() override
void Execute(SfxRequest &)
void GetState(SfxItemSet &)
void SetLongName(const OUString &rLongName)
virtual bool Save() override
global IO.
void SetShortName(const OUString &rShortName)
Used by the UI to modify the document model.
const SwView & GetView() const
static VclPtr< reference_type > Create(Arg &&... arg)
#define FN_PARAM_ADDPRINTER
SFX_IMPL_SUPERCLASS_INTERFACE(DrawDocShell, SfxObjectShell)
static void lcl_Execute(SwDocShell &rSh, SfxRequest &rReq)
static void lcl_GetState(SwDocShell &rSh, SfxItemSet &rSet)
static bool lcl_Save(SwWrtShell &rSh, const OUString &rGroupName, const OUString &rShortNm, const OUString &rLongNm)
SW_DLLPUBLIC SwGlossaries * GetGlossaries()
constexpr auto SFX_INTERFACE_SFXDOCSH
OUString SwResId(TranslateId aId)