35#include <osl/diagnose.h>
45 OSL_ENSURE( !
m_pPostItShell,
"m_pPostItShell should already have been deleted" );
69 m_pPostItShell->GetDoc()->getIDocumentDeviceAccess().setPrinter(
nullptr,
false,
false );
93 OSL_FAIL(
"error: there should be no ViewOptionAdjust active when calling this function" );
117 bool const bIsPDFExport)
119 if (!pDocShell || !pOpt)
126 bool bWeb =
dynamic_cast<const SwWebDocShell*
>( pDocShell) !=
nullptr;
156 sal_uInt16 nCurrentPage,
162 m_rDefaultPrintData( rDefaultPrintData )
177 const int nRTLOpts = bRTL ? 1 : 0;
178 const int nNumProps = nRTLOpts + (bWeb ? 15 : 19);
184 m_aUIProperties[nIdx++].Value <<= OUString(
"modules/swriter/ui/printeroptions.ui");
188 OUString aAppGroupname(
SwResId( STR_PRINTOPTUI_PRODUCTNAME) );
198 ".HelpID:vcl:PrintDialog:PrintPageBackground:CheckBox",
199 "PrintPageBackground",
205 ".HelpID:vcl:PrintDialog:PrintPicturesAndObjects:CheckBox",
206 "PrintPicturesAndObjects",
213 ".HelpID:vcl:PrintDialog:PrintHiddenText:CheckBox",
220 ".HelpID:vcl:PrintDialog:PrintTextPlaceholder:CheckBox",
221 "PrintTextPlaceholder",
228 ".HelpID:vcl:PrintDialog:PrintControls:CheckBox",
238 ".HelpID:vcl:PrintDialog:PrintBlackFonts:CheckBox",
250 ".HelpID:vcl:PrintDialog:PrintEmptyPages:CheckBox",
260 ".HelpID:vcl:PrintDialog:PrintPaperFromSetup:CheckBox",
261 "PrintPaperFromSetup",
270 SwResId( STR_PRINTOPTUI_PAGES_TEXT ),
275 static const OUStringLiteral aPrintRangeName(
u"PrintContent" );
276 uno::Sequence< OUString > aChoices{
SwResId( STR_PRINTOPTUI_PRINTALLPAGES ),
277 SwResId( STR_PRINTOPTUI_PRINTPAGES ),
278 SwResId( STR_PRINTOPTUI_PRINTSELECTION ) };
279 uno::Sequence< sal_Bool > aChoicesDisabled{
false,
false, !bHasSelection };
280 uno::Sequence< OUString > aHelpIds{
".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0",
281 ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1",
282 ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" };
283 uno::Sequence< OUString > aWidgetIds{
"rbAllPages",
"rbRangePages",
"rbRangeSelection" };
285 aHelpIds, aPrintRangeName,
287 bHasSelection ? 2 : 0,
293 ".HelpID:vcl:PrintDialog:PageRange:Edit",
295 OUString::number( nCurrentPage ) ,
301 uno::Sequence<OUString>(),
303 uno::Sequence<OUString>(),
305 uno::Sequence< sal_Bool >(),
310 aChoices = {
SwResId( STR_PRINTOPTUI_NONE),
311 SwResId( STR_PRINTOPTUI_COMMENTS_ONLY),
312 SwResId( STR_PRINTOPTUI_PLACE_END),
313 SwResId( STR_PRINTOPTUI_PLACE_PAGE),
314 SwResId( STR_PRINTOPTUI_PLACE_MARGINS) };
315 aHelpIds = {
".HelpID:vcl:PrintDialog:PrintAnnotationMode:FixedText",
316 ".HelpID:vcl:PrintDialog:PrintAnnotationMode:ListBox" };
320 SwResId( STR_PRINTOPTUI_COMMENTS),
322 "PrintAnnotationMode",
324 bHasPostIts ?
static_cast<sal_uInt16
>(nPrintPostIts) : 0,
325 uno::Sequence< sal_Bool >(),
334 static const OUStringLiteral aBrochurePropertyName(
u"PrintProspect" );
336 ".HelpID:vcl:PrintDialog:PrintProspect:CheckBox",
337 aBrochurePropertyName,
344 uno::Sequence< OUString > aBRTLChoices{
SwResId( STR_PRINTOPTUI_LEFT_SCRIPT),
345 SwResId( STR_PRINTOPTUI_RIGHT_SCRIPT) };
347 uno::Sequence<OUString> aBRTLHelpIds {
".HelpID:vcl:PrintDialog:PrintProspectRTL:ListBox" };
359 uno::Sequence< sal_Bool >(),
363 assert(nIdx == nNumProps);
379 bool bRes = nEOPages != 1;
390 bool bRes = nEOPages != 2;
399 bool bRes = bIsPDFExport ?
410 bool bRes =
getBoolValue(
"PrintPicturesAndObjects",
true );
420 bool bRes =
getBoolValue(
"PrintPicturesAndObjects",
true );
429 uno::Reference< awt::XDevice > xRenderDevice;
431 aVal >>= xRenderDevice;
434 if (xRenderDevice.is())
bool IsCTLFontEnabled() const
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)