summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-09-13 15:26:41 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-09-15 11:55:28 +0000
commit74844277cc2194c9e43f5bd7a6f78a9603da32f3 (patch)
tree71fe0efd482ee745fb203481447ddbec44d4a769 /sw
parentf78ad80e5562567e8612269b8bed1283bafb6198 (diff)
disable generation of ole previews in ODF format until after load
so the user update links dialog can control their generation SdrEmbedObjectLink becomes exposed to calc so it can detect if the link dialog needs to be used to update ole links. Change-Id: Id1dd7ea17342140eab9307d546528747e3a98090 Reviewed-on: https://gerrit.libreoffice.org/28879 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/DocumentLinksAdministrationManager.cxx21
-rw-r--r--sw/source/uibase/app/docshini.cxx5
2 files changed, 18 insertions, 8 deletions
diff --git a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
index ea88e9a81753..0949aa77d582 100644
--- a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
+++ b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
@@ -201,12 +201,6 @@ void DocumentLinksAdministrationManager::UpdateLinks()
{
if (!m_rDoc.GetDocShell())
return;
- sal_uInt16 nLinkMode = m_rDoc.GetDocumentSettingManager().getLinkUpdateMode(true);
- sal_uInt16 nUpdateDocMode = m_rDoc.GetDocShell()->GetUpdateDocMode();
- if (nLinkMode == NEVER && nUpdateDocMode != document::UpdateDocMode::FULL_UPDATE)
- return;
- if (GetLinkManager().GetLinks().empty())
- return;
SfxObjectCreateMode eMode = m_rDoc.GetDocShell()->GetCreateMode();
if (eMode == SfxObjectCreateMode::INTERNAL)
return;
@@ -216,6 +210,12 @@ void DocumentLinksAdministrationManager::UpdateLinks()
return;
if (m_rDoc.GetDocShell()->IsPreview())
return;
+ if (GetLinkManager().GetLinks().empty())
+ return;
+ sal_uInt16 nLinkMode = m_rDoc.GetDocumentSettingManager().getLinkUpdateMode(true);
+ sal_uInt16 nUpdateDocMode = m_rDoc.GetDocShell()->GetUpdateDocMode();
+ if (nLinkMode == NEVER && nUpdateDocMode != document::UpdateDocMode::FULL_UPDATE)
+ return;
bool bAskUpdate = nLinkMode == MANUAL;
bool bUpdate = true;
@@ -234,14 +234,21 @@ void DocumentLinksAdministrationManager::UpdateLinks()
bAskUpdate = true;
}
}
- if( bUpdate )
+ comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = m_rDoc.GetDocShell()->getEmbeddedObjectContainer();
+ if (bUpdate)
{
+ rEmbeddedObjectContainer.setUserAllowsLinkUpdate(true);
+
SfxMedium* pMedium = m_rDoc.GetDocShell()->GetMedium();
SfxFrame* pFrame = pMedium ? pMedium->GetLoadTargetFrame() : nullptr;
vcl::Window* pDlgParent = pFrame ? &pFrame->GetWindow() : nullptr;
GetLinkManager().UpdateAllLinks( bAskUpdate, true, false, pDlgParent );
}
+ else
+ {
+ rEmbeddedObjectContainer.setUserAllowsLinkUpdate(false);
+ }
}
bool DocumentLinksAdministrationManager::GetData( const OUString& rItem, const OUString& rMimeType,
diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx
index 5cb5c5c88dba..51955a3b4c3a 100644
--- a/sw/source/uibase/app/docshini.cxx
+++ b/sw/source/uibase/app/docshini.cxx
@@ -500,8 +500,11 @@ bool SwDocShell::Load( SfxMedium& rMedium )
m_pDoc->getIDocumentDrawModelAccess().GetDrawModel()->SetAnchoredTextOverflowLegacy(true);
}
- if( SfxObjectShell::Load( rMedium ))
+ if (SfxObjectShell::Load(rMedium))
{
+ comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = getEmbeddedObjectContainer();
+ rEmbeddedObjectContainer.setUserAllowsLinkUpdate(false);
+
SAL_INFO( "sw.ui", "after SfxInPlaceObject::Load" );
if (m_pDoc) // for last version!!
RemoveLink(); // release the existing