summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2017-09-01 00:04:09 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-09-05 16:09:06 +0200
commita897c5ed86c6d8981305bf725e83c76e4e3a36d0 (patch)
tree138df502db98ac6b5a14ffc5dfbc7e0ab1309fc2 /sfx2
parentada87712ebc00b547e29fe31052e56f3495ea226 (diff)
tdf#109202: pass arg of --convert-images-to to (f)odt filter
Tunelling 1 piece of information through 20 layers of abstraction Advanced tunelling all the way to sfx2 Exhausted beyond recognition arrived to [Flat]ODF filter Change-Id: I0597c20c28f5cf8e2c60c4398622b36bda83abd0 Reviewed-on: https://gerrit.libreoffice.org/41777 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appuno.cxx18
-rw-r--r--sfx2/source/doc/docfile.cxx6
2 files changed, 24 insertions, 0 deletions
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 352dbcfb5511..8739f8f656a0 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -162,6 +162,7 @@ static char const sEncryptionData[] = "EncryptionData";
static char const sFailOnWarning[] = "FailOnWarning";
static char const sDocumentService[] = "DocumentService";
static char const sFilterProvider[] = "FilterProvider";
+static char const sImageFilter[] = "ImageFilter";
static bool isMediaDescriptor( sal_uInt16 nSlotId )
{
@@ -733,6 +734,14 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
if (bOK)
rSet.Put( SfxStringItem( SID_FILE_FILTEROPTIONS, sVal ) );
}
+ else if ( aName == sImageFilter )
+ {
+ OUString sVal;
+ bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty());
+ DBG_ASSERT( bOK, "invalid type or value for FilterFlags" );
+ if (bOK)
+ rSet.Put( SfxStringItem( SID_CONVERT_IMAGES, sVal ) );
+ }
else if ( aName == sMacroExecMode )
{
sal_Int16 nVal =-1;
@@ -1055,6 +1064,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
nAdditional++;
if (rSet.HasItem(SID_FILTER_PROVIDER))
++nAdditional;
+ if ( rSet.GetItemState( SID_CONVERT_IMAGES ) == SfxItemState::SET )
+ nAdditional++;
// consider additional arguments
nProps += nAdditional;
@@ -1196,6 +1207,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
continue;
if (nId == SID_FILTER_PROVIDER)
continue;
+ if ( nId == SID_CONVERT_IMAGES )
+ continue;
// used only internally
if ( nId == SID_SAVETO )
@@ -1597,6 +1610,11 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
pValue[nActProp].Name = sFilterProvider;
pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue();
}
+ if (rSet.HasItem(SID_CONVERT_IMAGES, &pItem))
+ {
+ pValue[nActProp].Name = sImageFilter;
+ pValue[nActProp++].Value <<= static_cast<const SfxStringItem*>(pItem)->GetValue();
+ }
}
rArgs = aSequ;
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 7930427925cf..f37a6c62746d 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -473,6 +473,12 @@ bool SfxMedium::IsSkipImages()
return pSkipImagesItem && pSkipImagesItem->GetValue() == "SkipImages";
}
+OUString SfxMedium::GetConvertImagesFilter()
+{
+ const SfxStringItem* pConvertItem = GetItemSet()->GetItem<SfxStringItem>(SID_CONVERT_IMAGES);
+ return ( pConvertItem ? pConvertItem->GetValue() : OUString() );
+}
+
SvStream* SfxMedium::GetInStream()
{
if ( pImpl->m_pInStream )