Kaydet (Commit) 757b2438 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

tdf#118883 reinstate the try block to not throw on copy/paste

Seems the defnesive approach wasn't enough to ward against the
exception being thrown when creating a clipboard document when
copy/pasting between documents.

Change-Id: Iedcfbc6fe054b46fc26005b1ea0dbadbd21a08cb
Reviewed-on: https://gerrit.libreoffice.org/59121
Tested-by: Jenkins
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst 43b7aa51
...@@ -2716,13 +2716,17 @@ XMLFontAutoStylePool* SdXMLExport::CreateFontAutoStylePool() ...@@ -2716,13 +2716,17 @@ XMLFontAutoStylePool* SdXMLExport::CreateFontAutoStylePool()
if (getExportFlags() & SvXMLExportFlags::CONTENT) if (getExportFlags() & SvXMLExportFlags::CONTENT)
{ {
Reference< lang::XMultiServiceFactory > xFac( GetModel(), UNO_QUERY ); try
if( xFac.is() )
{ {
Reference<beans::XPropertySet> const xProps(xFac->createInstance("com.sun.star.document.Settings"), UNO_QUERY); Reference<lang::XMultiServiceFactory> xFactory(GetModel(), UNO_QUERY);
Reference<beans::XPropertySetInfo> const xInfo(xProps->getPropertySetInfo(), uno::UNO_QUERY); Reference<beans::XPropertySet> xProps;
Reference<beans::XPropertySetInfo> xInfo;
if (xProps.is() && xInfo.is())
if (xFactory.is())
xProps.set(xFactory->createInstance("com.sun.star.document.Settings"), UNO_QUERY);
if (xProps.is())
xInfo.set(xProps->getPropertySetInfo(), uno::UNO_QUERY);
if (xInfo.is() && xProps.is())
{ {
if (xInfo->hasPropertyByName("EmbedFonts")) if (xInfo->hasPropertyByName("EmbedFonts"))
xProps->getPropertyValue("EmbedFonts") >>= bEmbedFonts; xProps->getPropertyValue("EmbedFonts") >>= bEmbedFonts;
...@@ -2735,6 +2739,10 @@ XMLFontAutoStylePool* SdXMLExport::CreateFontAutoStylePool() ...@@ -2735,6 +2739,10 @@ XMLFontAutoStylePool* SdXMLExport::CreateFontAutoStylePool()
if (xInfo->hasPropertyByName("EmbedComplexScriptFonts")) if (xInfo->hasPropertyByName("EmbedComplexScriptFonts"))
xProps->getPropertyValue("EmbedComplexScriptFonts") >>= bEmbedComplexScript; xProps->getPropertyValue("EmbedComplexScriptFonts") >>= bEmbedComplexScript;
} }
} catch(...)
{
// clipboard document doesn't have shell so throws from getPropertyValue
// gallery elements may not support com.sun.star.document.Settings so throws from createInstance
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment