36#include <osl/diagnose.h>
46 OSL_ENSURE( !
m_pPostItShell,
"m_pPostItShell should already have been deleted" );
70 m_pPostItShell->GetDoc()->getIDocumentDeviceAccess().setPrinter(
nullptr,
false,
false );
94 OSL_FAIL(
"error: there should be no ViewOptionAdjust active when calling this function" );
118 bool const bIsPDFExport)
120 if (!pDocShell || !pOpt)
127 bool bWeb =
dynamic_cast<const SwWebDocShell*
>( pDocShell) !=
nullptr;
157 sal_uInt16 nCurrentPage,
163 m_rDefaultPrintData( rDefaultPrintData )
178 const int nRTLOpts = bRTL ? 1 : 0;
179 const int nNumProps = nRTLOpts + (bWeb ? 15 : 19);
185 m_aUIProperties[nIdx++].Value <<= OUString(
"modules/swriter/ui/printeroptions.ui");
189 OUString aAppGroupname(
SwResId( STR_PRINTOPTUI_PRODUCTNAME) );
199 ".HelpID:vcl:PrintDialog:PrintPageBackground:CheckBox",
200 "PrintPageBackground",
206 ".HelpID:vcl:PrintDialog:PrintPicturesAndObjects:CheckBox",
207 "PrintPicturesAndObjects",
214 ".HelpID:vcl:PrintDialog:PrintHiddenText:CheckBox",
221 ".HelpID:vcl:PrintDialog:PrintTextPlaceholder:CheckBox",
222 "PrintTextPlaceholder",
229 ".HelpID:vcl:PrintDialog:PrintControls:CheckBox",
239 ".HelpID:vcl:PrintDialog:PrintBlackFonts:CheckBox",
251 ".HelpID:vcl:PrintDialog:PrintEmptyPages:CheckBox",
261 ".HelpID:vcl:PrintDialog:PrintPaperFromSetup:CheckBox",
262 "PrintPaperFromSetup",
271 SwResId( STR_PRINTOPTUI_PAGES_TEXT ),
276 static constexpr OUStringLiteral aPrintRangeName(
u"PrintContent" );
277 uno::Sequence< OUString > aChoices{
SwResId( STR_PRINTOPTUI_PRINTALLPAGES ),
278 SwResId( STR_PRINTOPTUI_PRINTPAGES ),
279 SwResId( STR_PRINTOPTUI_PRINTSELECTION ) };
280 uno::Sequence< sal_Bool > aChoicesDisabled{
false,
false, !bHasSelection };
281 uno::Sequence< OUString > aHelpIds{
".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0",
282 ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1",
283 ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" };
284 uno::Sequence< OUString > aWidgetIds{
"rbAllPages",
"rbRangePages",
"rbRangeSelection" };
286 aHelpIds, aPrintRangeName,
288 bHasSelection ? 2 : 0,
294 ".HelpID:vcl:PrintDialog:PageRange:Edit",
296 OUString::number( nCurrentPage ) ,
302 uno::Sequence<OUString>(),
304 uno::Sequence<OUString>(),
306 uno::Sequence< sal_Bool >(),
311 aChoices = {
SwResId( STR_PRINTOPTUI_NONE),
312 SwResId( STR_PRINTOPTUI_COMMENTS_ONLY),
313 SwResId( STR_PRINTOPTUI_PLACE_END),
314 SwResId( STR_PRINTOPTUI_PLACE_PAGE),
315 SwResId( STR_PRINTOPTUI_PLACE_MARGINS) };
316 aHelpIds = {
".HelpID:vcl:PrintDialog:PrintAnnotationMode:FixedText",
317 ".HelpID:vcl:PrintDialog:PrintAnnotationMode:ListBox" };
321 SwResId( STR_PRINTOPTUI_COMMENTS),
323 "PrintAnnotationMode",
325 bHasPostIts ?
static_cast<sal_uInt16
>(nPrintPostIts) : 0,
326 uno::Sequence< sal_Bool >(),
335 static constexpr OUStringLiteral aBrochurePropertyName(
u"PrintProspect" );
337 ".HelpID:vcl:PrintDialog:PrintProspect:CheckBox",
338 aBrochurePropertyName,
345 uno::Sequence< OUString > aBRTLChoices{
SwResId( STR_PRINTOPTUI_LEFT_SCRIPT),
346 SwResId( STR_PRINTOPTUI_RIGHT_SCRIPT) };
348 uno::Sequence<OUString> aBRTLHelpIds {
".HelpID:vcl:PrintDialog:PrintProspectRTL:ListBox" };
360 uno::Sequence< sal_Bool >(),
364 assert(nIdx == nNumProps);
380 bool bRes = nEOPages != 1;
391 bool bRes = nEOPages != 2;
400 bool bRes = bIsPDFExport ?
411 bool bRes =
getBoolValue(
"PrintPicturesAndObjects",
true );
421 bool bRes =
getBoolValue(
"PrintPicturesAndObjects",
true );
430 uno::Reference< awt::XDevice > xRenderDevice;
432 aVal >>= xRenderDevice;
435 if (xRenderDevice.is())
static bool IsCTLFontEnabled()
OUString GetModuleName(EModule eModule) const
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
SwPostItMode GetPrintPostIts() const
bool m_bPrintEmptyPages
Print empty pages.
bool m_bPrintTextPlaceholder
bool IsPrintBlackFont() const
bool IsPrintProspect() const
void SetRenderData(const SwRenderData *pData)
bool IsPrintControl() const
bool IsPrintTextPlaceholder() const
bool IsPaperFromSetup() const
bool m_bPrintPageBackground
bool IsPrintProspectRTL() const
bool IsPrintEmptyPages() const
bool IsPrintGraphic() const
SwPostItMode m_nPrintPostIts
bool IsPrintPageBackground() const
bool IsPrintHiddenText() const
virtual ~SwPrintUIOptions()
bool IsPrintLeftPages() const
bool processPropertiesAndCheckFormat(const css::uno::Sequence< css::beans::PropertyValue > &i_rNewProp)
SwPrintUIOptions(sal_uInt16 nCurrentPage, bool bWeb, bool bSwSrcView, bool bHasSelection, bool bHasPostIts, const SwPrintData &rDefaultPrintData)
bool IsPrintGraphics() const
bool IsPrintRightPages() const
bool IsPrintEmptyPages(bool bIsPDFExport) const
bool IsPrintFormControls() const
bool IsPrintHiddenText() const
bool IsPrintProspect() const
bool IsPrintDrawings() const
bool IsPrintTextPlaceholders() const
SwPostItMode GetPrintPostItsType() const
bool IsPaperFromSetup() const
VclPtr< OutputDevice > m_pLast
bool IsPrintPageBackground() const
bool IsPrintWithBlackTextColor() const
bool IsPrintProspectRTL() const
void ViewOptionAdjust(SwPrintData const *const pPrtOptions, bool setShowPlaceHoldersInPDF)
bool HasPostItData() const
std::unique_ptr< SetGetExpFields > m_pPostItFields
an array of "SetGetExpField *" sorted by page and line numbers
void ViewOptionAdjustStop()
void ViewOptionAdjustStart(SwViewShell &rSh, const SwViewOption &rViewOptions)
void CreatePostItData(SwDoc &rDoc, const SwViewOption *pViewOpt, OutputDevice *pOutDev)
std::unique_ptr< SwPrintData > m_pPrtOptions
void SetTempDocShell(SfxObjectShellLock const &)
std::unique_ptr< SwViewShell > m_pPostItShell
this contains a SwDoc with the post-it content
void MakeSwPrtOptions(SwDocShell const *const pDocShell, SwPrintUIOptions const *const pOpt, bool const bIsPDFExport)
bool NeedNewViewOptionAdjust(const SwViewShell &) const
void ViewOptionAdjustCrashPreventionKludge()
std::unique_ptr< SwViewOptionAdjust_Impl > m_pViewOptionAdjust
the view options to be applied for printing
SfxObjectShellLock m_xTempDocShell
temp print document – must live longer than m_pViewOptionAdjust! also this is a Lock and not a Ref be...
void SetOnlineSpell(bool b)
const VclPtr< OutputDevice > & GetOutputDevice() const
reference_type * get() const
static css::uno::Any setGroupControlOpt(const OUString &i_rID, const OUString &i_rTitle, const OUString &i_rHelpId)
bool getBoolValue(const OUString &i_rPropertyName, bool i_bDefault) const
static css::uno::Any setChoiceRadiosControlOpt(const css::uno::Sequence< OUString > &i_rIDs, const OUString &i_rTitle, const css::uno::Sequence< OUString > &i_rHelpId, const OUString &i_rProperty, const css::uno::Sequence< OUString > &i_rChoices, sal_Int32 i_nValue, const css::uno::Sequence< sal_Bool > &i_rDisabledChoices=css::uno::Sequence< sal_Bool >(), const UIControlOptions &i_rControlOptions=UIControlOptions())
std::vector< css::beans::PropertyValue > m_aUIProperties
sal_Int64 getIntValue(const OUString &i_rPropertyName, sal_Int64 i_nDefault) const
static css::uno::Any setBoolControlOpt(const OUString &i_rID, const OUString &i_rTitle, const OUString &i_rHelpId, const OUString &i_rProperty, bool i_bValue, const UIControlOptions &i_rControlOptions=UIControlOptions())
static css::uno::Any setSubgroupControlOpt(const OUString &i_rID, const OUString &i_rTitle, const OUString &i_rHelpId, const UIControlOptions &i_rControlOptions=UIControlOptions())
css::uno::Any getValue(const OUString &i_rPropertyName) const
static css::uno::Any setChoiceListControlOpt(const OUString &i_rID, const OUString &i_rTitle, const css::uno::Sequence< OUString > &i_rHelpId, const OUString &i_rProperty, const css::uno::Sequence< OUString > &i_rChoices, sal_Int32 i_nValue, const css::uno::Sequence< sal_Bool > &i_rDisabledChoices=css::uno::Sequence< sal_Bool >(), const UIControlOptions &i_rControlOptions=UIControlOptions())
bool processProperties(const css::uno::Sequence< css::beans::PropertyValue > &i_rNewProp)
static css::uno::Any setEditControlOpt(const OUString &i_rID, const OUString &i_rTitle, const OUString &i_rHelpId, const OUString &i_rProperty, const OUString &i_rValue, const UIControlOptions &i_rControlOptions)
bool sw_GetPostIts(const IDocumentFieldsAccess &rIDFA, SetGetExpFields *pSrtLst)
void InitPrintOptionsFromApplication(SwPrintData &o_rData, bool const bWeb)
SwPostItMode
this must match the definitions in css::text::NotePrintMode
OUString SwResId(TranslateId aId)