diff options
Diffstat (limited to 'sfx2/source/view')
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 9 |
3 files changed, 14 insertions, 17 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 885023465120..bbfb37e5291d 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -308,8 +308,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) if( !pSh || !pSh->HasName() || !(pSh->Get_Impl()->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT )) break; - SfxViewShell* pViewSh = GetViewShell(); - if (pViewSh && pViewSh->isEditDocLocked()) + if (pSh->isEditDocLocked()) break; // Only change read-only UI and remove info bar when we succeed @@ -331,9 +330,12 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) m_pFrame->RemoveInfoBar("readonly"); if (m_pMed) { + bool const isEnableSetModified(m_pSh->IsEnableSetModified()); + m_pSh->EnableSetModified(false); // tdf#116066: DoSaveCompleted should be called after SetReadOnlyUI m_pSh->DoSaveCompleted(m_pMed); m_pSh->Broadcast(SfxHint(SfxHintId::ModeChanged)); + m_pSh->EnableSetModified(isEnableSetModified); } } } @@ -929,7 +931,7 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet ) const SfxShell *pFSh; if ( !pSh->HasName() || !( pSh->Get_Impl()->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT ) || - (GetViewShell() && GetViewShell()->isEditDocLocked()) || + (pSh->isEditDocLocked()) || ( pSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED && ( !(pVSh = pSh->GetViewShell()) || !(pFSh = pVSh->GetFormShell()) || @@ -1351,7 +1353,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) } bool showEditDocumentButton = true; - if (m_xObjSh->GetViewShell() && m_xObjSh->GetViewShell()->isEditDocLocked()) + if (m_xObjSh->isEditDocLocked()) showEditDocumentButton = false; if (showEditDocumentButton) diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index b67267a61b53..f9cd9c005c39 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -616,10 +616,14 @@ void SfxViewShell::StartPrint( const uno::Sequence < beans::PropertyValue >& rPr )); pImpl->m_xPrinterController = xNewController; - SfxObjectShell *pObjShell = GetObjectShell(); - xNewController->setValue( "JobName", - makeAny( pObjShell->GetTitle(1) ) ); - xNewController->setPrinterModified( mbPrinterSettingsModified ); + // When no JobName was specified via com::sun::star::view::PrintOptions::JobName , + // use the document title as default job name + css::beans::PropertyValue* pJobNameVal = xNewController->getValue("JobName"); + if (!pJobNameVal) + { + xNewController->setValue("JobName", Any(GetObjectShell()->GetTitle(1))); + xNewController->setPrinterModified(mbPrinterSettingsModified); + } } void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rProps, bool bIsAPI, bool bIsDirect ) diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 80cd8a122d07..cb7925efa907 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1776,15 +1776,6 @@ bool SfxViewShell::isPrintLocked() return aArgs.getOrDefault("LockPrint", false); } -bool SfxViewShell::isEditDocLocked() -{ - Reference<XModel> xModel = GetCurrentDocument(); - if (!xModel.is()) - return false; - comphelper::NamedValueCollection aArgs(xModel->getArgs()); - return aArgs.getOrDefault("LockEditDoc", false); -} - bool SfxViewShell::isSaveLocked() { Reference<XModel> xModel = GetCurrentDocument(); |