diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-12-22 13:20:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-12-22 17:17:30 +0100 |
commit | b9b2ab0f9f1ad91bba899068d2be7fc7767f41c9 (patch) | |
tree | 5bc6300d20e49609a85efc5aaedce00c3747478c /sfx2/source/doc | |
parent | de6ccf060cc85a6ea154989bcc254e37854aa07b (diff) |
Revert "unused SID command in sfx2"
This reverts commit 08f4ecd5823c420bb7157c238460d50f1f1f9791.
Change-Id: I93c4e44de73ce62b4cad7e3c6c56943dafaaebb4
Reviewed-on: https://gerrit.libreoffice.org/46966
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 61 |
1 files changed, 59 insertions, 2 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 4304a659c111..50fa6bc2b5f1 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -244,8 +244,16 @@ void SfxObjectShell::PrintExec_Impl(SfxRequest &rReq) } -void SfxObjectShell::PrintState_Impl(SfxItemSet &/*rSet*/) +void SfxObjectShell::PrintState_Impl(SfxItemSet &rSet) { + bool bPrinting = false; + SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this ); + if ( pFrame ) + { + SfxPrinter *pPrinter = pFrame->GetViewShell()->GetPrinter(); + bPrinting = pPrinter && pPrinter->IsPrinting(); + } + rSet.Put( SfxBoolItem( SID_PRINTOUT, bPrinting ) ); } bool SfxObjectShell::APISaveAs_Impl(const OUString& aFileName, SfxItemSet& rItemSet) @@ -1103,6 +1111,14 @@ void SfxObjectShell::ExecProps_Impl(SfxRequest &rReq) case SID_DOCINFO_COMMENTS : getDocProperties()->setDescription( static_cast<const SfxStringItem&>(rReq.GetArgs()->Get(rReq.GetSlot())).GetValue() ); break; + + case SID_DOCINFO_KEYWORDS : + { + const OUString aStr = static_cast<const SfxStringItem&>(rReq.GetArgs()->Get(rReq.GetSlot())).GetValue(); + getDocProperties()->setKeywords( + ::comphelper::string::convertCommaSeparated(aStr) ); + break; + } } } @@ -1128,6 +1144,19 @@ void SfxObjectShell::StateProps_Impl(SfxItemSet &rSet) break; } + case SID_DOCINFO_KEYWORDS : + { + rSet.Put( SfxStringItem( nSID, ::comphelper::string:: + convertCommaSeparated(getDocProperties()->getKeywords())) ); + break; + } + + case SID_DOCPATH: + { + OSL_FAIL( "Not supported anymore!" ); + break; + } + case SID_DOCFULLNAME: { rSet.Put( SfxStringItem( SID_DOCFULLNAME, GetTitle(SFX_TITLE_FULLNAME) ) ); @@ -1146,16 +1175,44 @@ void SfxObjectShell::StateProps_Impl(SfxItemSet &rSet) break; } + case SID_DOC_SAVED: + { + rSet.Put( SfxBoolItem( SID_DOC_SAVED, !IsModified() ) ); + break; + } + + case SID_CLOSING: + { + rSet.Put( SfxBoolItem( SID_CLOSING, false ) ); + break; + } + case SID_DOC_LOADING: rSet.Put( SfxBoolItem( nSID, ! ( pImpl->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT ) ) ); break; + + case SID_IMG_LOADING: + rSet.Put( SfxBoolItem( nSID, ! ( pImpl->nLoadedFlags & SfxLoadedFlags::IMAGES ) ) ); + break; } } } -void SfxObjectShell::ExecView_Impl(SfxRequest & /*rReq*/) +void SfxObjectShell::ExecView_Impl(SfxRequest &rReq) { + switch ( rReq.GetSlot() ) + { + case SID_ACTIVATE: + { + SfxViewFrame *pFrame = SfxViewFrame::GetFirst( this ); + if ( pFrame ) + pFrame->GetFrame().Appear(); + rReq.SetReturnValue( SfxObjectItem( 0, pFrame ) ); + rReq.Done(); + break; + } + } } |