diff options
author | Muhammet Kara <muhammet.kara@collabora.com> | 2019-01-29 23:02:22 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2019-03-27 21:42:48 +0100 |
commit | e4f9c34a1b21674289d42bea1e4a3b94879bc731 (patch) | |
tree | d071ba3222d4e5f5ba5bf8d4f9e588a1e34d8251 /sfx2 | |
parent | 54087433e7495a7fa74661e5bfebac95b5648598 (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>
Reviewed-on: https://gerrit.libreoffice.org/69833
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/sdi/sfx.sdi | 3 | ||||
-rw-r--r-- | sfx2/source/appl/appuno.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 12 |
3 files changed, 15 insertions, 1 deletions
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 240cb0be10f0..47586b60e464 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -4727,7 +4727,8 @@ SfxVoidItem ExportToPDF SID_EXPORTDOCASPDF ] SfxVoidItem ExportDirectToPDF SID_DIRECTEXPORTDOCASPDF -(SfxStringItem URL SID_FILE_NAME, SfxStringItem FilterName SID_FILTER_NAME) +(SfxStringItem URL SID_FILE_NAME, SfxStringItem FilterName SID_FILTER_NAME, + SfxBoolItem IsRedactMode SID_IS_REDACT_MODE) [ AutoUpdate = FALSE, FastCall = FALSE, diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index bed21cc2b91b..16dc5ed207c6 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -106,6 +106,7 @@ SfxFormalArgument const aFormalArgs[] = { { reinterpret_cast<SfxType*>(&aSfxInt16Item_Impl), "Version", SID_VERSION }, { reinterpret_cast<SfxType*>(&aSfxBoolItem_Impl), "SaveACopy", SID_SAVEACOPYITEM }, { reinterpret_cast<SfxType*>(&aSfxBoolItem_Impl), "NoFileSync", SID_NO_FILE_SYNC }, + { 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 79b85e480508..c776ff944957 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2380,6 +2380,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(); @@ -2398,6 +2399,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 ); @@ -2427,6 +2432,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(const uno::Exception&) {} |