summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/objstor.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/doc/objstor.cxx')
-rw-r--r--sfx2/source/doc/objstor.cxx25
1 files changed, 24 insertions, 1 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 49d90e54c599..8d101e8aac04 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -774,7 +774,15 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
}
else
{
- bOk = ConvertFrom(*pMedium);
+ if (tools::isEmptyFileUrl(pMedium->GetName()))
+ {
+ // The import filter would fail with empty input.
+ bOk = true;
+ }
+ else
+ {
+ bOk = ConvertFrom(*pMedium);
+ }
InitOwnModel_Impl();
}
}
@@ -2423,6 +2431,7 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
bool bHasBaseURL = false;
bool bHasFilterName = false;
bool bIsRedactMode = false;
+ bool bIsPreview = false;
sal_Int32 nEnd = aOldArgs.getLength();
for ( sal_Int32 i = 0; i < nEnd; i++ )
@@ -2440,6 +2449,13 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
bHasFilterName = true;
}
+ const css::uno::Sequence<css::beans::PropertyValue>& rMediumArgs = rMedium.GetArgs();
+ for ( sal_Int32 i = 0; i < rMediumArgs.getLength(); i++ )
+ {
+ if( rMediumArgs[i].Name == "IsPreview" )
+ rMediumArgs[i].Value >>= bIsPreview;
+ }
+
// FIXME: Handle this inside TransformItems()
if (pItems->GetItemState(SID_IS_REDACT_MODE) == SfxItemState::SET)
bIsRedactMode = true;
@@ -2480,6 +2496,13 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
aArgs[nEnd-1].Value <<= bIsRedactMode;
}
+ if (bIsPreview)
+ {
+ aArgs.realloc( ++nEnd );
+ aArgs[nEnd-1].Name = "IsPreview";
+ aArgs[nEnd-1].Value <<= bIsPreview;
+ }
+
return xFilter->filter( aArgs );
}catch(...)
{}