24#include <drawview.hxx>
58 virtual void createRedirectedPrimitive2DSequence(
70 mpDocShellOfView(nullptr),
86 const sal_Int32 nWidth)
91 const double nAspectRatio (
92 double(aPageModelSize.
Width()) /
double(aPageModelSize.
Height()));
94 const sal_Int32 nHeight (sal::static_int_cast<sal_Int32>(
95 (nWidth - 2*nFrameWidth) / nAspectRatio + 2*nFrameWidth + 0.5));
108 const bool bObeyHighContrastMode,
109 const bool bDisplayPresentationObjects)
113 if (pPage !=
nullptr)
117 if (
Initialize(pPage, aPixelSize, bObeyHighContrastMode))
119 PaintPage(pPage, bDisplayPresentationObjects);
131 catch (
const css::uno::Exception&)
141 const Size& rPreviewPixelSize,
142 const OUString& rSubstitutionText)
152 const bool bUseContrast (
167 Point(nFrameWidth,nFrameWidth),aMapMode));
171 const ::tools::Rectangle aPaintRectangle (
190 catch (
const css::uno::Exception&)
200 const Size& rPixelSize,
201 const bool bObeyHighContrastMode)
219 bool bUseContrast (bObeyHighContrastMode
234 mpView->ShowSdrPage(pNonConstPage);
240 if (pPageView ==
nullptr)
248 Color aApplicationDocumentColor;
262 rOutliner.SetBackgroundColor(aApplicationDocumentColor);
272 const bool bDisplayPresentationObjects)
284 nSavedControlWord = pOutliner->GetControlWord();
285 pOutliner->SetControlWord(nSavedControlWord & ~EEControlBits::ONLINESPELLING);
289 std::unique_ptr<ViewRedirector> pRedirector;
290 if ( ! bDisplayPresentationObjects)
291 pRedirector.reset(
new ViewRedirector());
297 catch (
const css::uno::Exception&)
303 if (pOutliner !=
nullptr)
304 pOutliner->SetControlWord(nSavedControlWord);
309 if (rSubstitutionText.isEmpty())
325 DrawTextFlags::Center
326 | DrawTextFlags::VCenter
327 | DrawTextFlags::MultiLine
328 | DrawTextFlags::WordBreak;
353 const Size& rFramePixelSize)
401 mpView->SetPreviewRenderer(
true);
402 mpView->SetPageVisible(
false);
403 mpView->SetPageBorderVisible();
404 mpView->SetBordVisible(
false);
405 mpView->SetGridVisible(
false);
406 mpView->SetHlplVisible(
false);
407 mpView->SetGlueVisible(
false);
420 GetHighContrastMode();
427 if (aSize.
Width() <= 0)
448 aScaledBitmap.
Scale (aPreviewSize, BmpScaleFlag::BestQuality);
467 if (rHint.
GetId() == SfxHintId::Dying)
482ViewRedirector::ViewRedirector()
486void ViewRedirector::createRedirectedPrimitive2DSequence(
493 if (pObject==
nullptr ||
pObject->getSdrPageFromSdrObject() ==
nullptr)
503 const bool bDoCreateGeometry (
pObject->getSdrPageFromSdrObject()->checkVisibility( rOriginal, rDisplayInfo,
true));
505 if ( ! bDoCreateGeometry
506 && (
pObject->GetObjInventor() != SdrInventor::Default ||
pObject->GetObjIdentifier() != SdrObjKind::Page))
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
const Size & GetSizePixel() const
void SetOrigin(const Point &rOrigin)
void SetScaleY(const Fraction &rScaleY)
void SetMapUnit(MapUnit eUnit)
void SetScaleX(const Fraction &rScaleX)
SAL_DLLPRIVATE LanguageType GetLanguage(const sal_uInt16 nId) const
SAL_DLLPRIVATE::sd::DrawDocShell * GetDocSh() const
SdrOutliner & GetDrawOutliner(const SdrTextObj *pObj=nullptr) const
void SetApplicationDocumentColor(Color aDocumentColor)
const Color & GetApplicationDocumentColor() const
sal_uInt16 GetPageNum() const
bool IsMasterPage() const
SdrModel & getSdrModelFromSdrPage() const
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
reference_type * get() const
SdDrawDocument * GetDoc()
Derivative of sd::View; contains also a pointer to the document.
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
static const int snSubstitutionTextSize
void ProvideView(DrawDocShell *pDocShell)
When mpView is empty then create a new view and initialize it.
Image RenderSubstitution(const Size &rPreviewPixelSize, const OUString &sSubstitutionText)
Render an image that contains the given substitution text instead of a slide preview.
virtual ~PreviewRenderer() override
::std::unique_ptr< DrawView > mpView
Image ScaleBitmap(const BitmapEx &rBitmap, int nWidth)
Scale the given bitmap by keeping its aspect ratio to the desired width.
ScopedVclPtr< VirtualDevice > mpPreviewDevice
Image RenderPage(const SdPage *pPage, const sal_Int32 nWidth)
Render a page with the given pixel size.
static const int snFrameWidth
void SetupOutputSize(const SdPage &rPage, const Size &rPixelSize)
Set up the map mode so that the given page is renderer into a bitmap with the specified width.
DrawDocShell * mpDocShellOfView
void PaintPage(const SdPage *pPage, const bool bDisplayPresentationObjects)
bool Initialize(const SdPage *pPage, const Size &rPixelSize, const bool bObeyHighContrastMode)
void PaintSubstitutionText(const OUString &rSubstitutionText)
PreviewRenderer(const bool bPaintFrame=true)
Create a new preview renderer that takes some of its initial values from the given output device.
void SetFontHeight(tools::Long nHeight)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define DBG_UNHANDLED_EXCEPTION(...)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
EmbeddedObjectRef * pObject
const DrawModeFlags OUTPUT_DRAWMODE_CONTRAST
const DrawModeFlags OUTPUT_DRAWMODE_COLOR