diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2019-01-29 23:02:22 +0300 |
---|---|---|
committer | Muhammet Kara <muhammet.kara@collabora.com> | 2019-01-31 23:55:09 +0100 |
commit | 51af3179cf972809d6495c7d58033e069f647bbf (patch) | |
tree | 57e50481a7cb83a54892ab73891151bbf498ec95 /sfx2/source | |
parent | fb95d74f9f2583259e5dea55bd83b2d6a7d98c19 (diff) |
Support bitmap PDF export for Redaction
* Add a new parameter IsRedactMode (SID_IS_REDACT_MODE) to .uno:ExportDirectToPDF
* Make sure the new param makes it into PDFExport as part of FilterData
* Hijack the metafile before being sent to ImplExportPage(), convert to bitmap, and replace the original
* Add a new entry to GenericCommands.xcu to make our button with param visible
* Nitpick: For things to be included in the bitmap conversion,
they need to be added to the metafile before the conversion
in PDFExport::ExportSelection(). Things added after that point
(inside ImplExportPage() for example) will not be bitmapped/pixelized
Change-Id: Iec7020917da920a968ea969b98e53f17eadaa275
Reviewed-on: https://gerrit.libreoffice.org/67108
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/appl/appuno.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 5fbb3094d0d2..0de7be3c144c 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -109,6 +109,7 @@ SfxFormalArgument const aFormalArgs[] = { { reinterpret_cast<SfxType*>(&aSfxBoolItem_Impl), "NoFileSync", SID_NO_FILE_SYNC }, { reinterpret_cast<SfxType*>(&aSfxBoolItem_Impl), "NoThumbnail", SID_NO_THUMBNAIL }, { reinterpret_cast<SfxType*>(&aSfxBoolItem_Impl), "NoEmbDataSet", SID_NO_EMBEDDED_DS }, + { reinterpret_cast<SfxType*>(&aSfxBoolItem_Impl), "IsRedactMode", SID_IS_REDACT_MODE }, }; static sal_uInt16 nMediaArgsCount = SAL_N_ELEMENTS(aFormalArgs); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index e83ff19c3186..b21a8012d8c9 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2361,6 +2361,7 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium ) bool bHasStream = false; bool bHasBaseURL = false; bool bHasFilterName = false; + bool bIsRedactMode = false; sal_Int32 i; sal_Int32 nEnd = aOldArgs.getLength(); @@ -2379,6 +2380,10 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium ) bHasFilterName = true; } + // FIXME: Handle this inside TransformItems() + if (pItems->GetItemState(SID_IS_REDACT_MODE) == SfxItemState::SET) + bIsRedactMode = true; + if ( !bHasOutputStream ) { aArgs.realloc ( ++nEnd ); @@ -2408,6 +2413,13 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium ) aArgs[nEnd-1].Value <<= aFilterName; } + if (bIsRedactMode) + { + aArgs.realloc( ++nEnd ); + aArgs[nEnd-1].Name = "IsRedactMode"; + aArgs[nEnd-1].Value <<= bIsRedactMode; + } + return xFilter->filter( aArgs ); }catch(...) {} |