37#include <osl/diagnose.h>
47 if(&(
a->GetPaintWindow()) == &rPaintWindow)
60 const SdrPaintWindow& rPaintWindow( pPageWindow->GetOriginalPaintWindow() ? *pPageWindow->GetOriginalPaintWindow() : pPageWindow->GetPaintWindow() );
63 return pPageWindow.get();
74 if(&(pPageWindow->GetPaintWindow().GetOutputDevice()) == &rOutDev)
76 return pPageWindow.get();
93 mpPreparedPageWindow(nullptr)
135 [&rPaintWindow](
const std::unique_ptr<SdrPageWindow>& rpWindow) {
136 return &(rpWindow->GetPaintWindow()) == &rPaintWindow;
144 css::uno::Reference< css::awt::XControlContainer > xReturn;
228 std::unique_ptr<SdrPageWindow> pTempPageWindow;
233 pTempPageWindow.reset(
new SdrPageWindow(*
this, rPaintWindow));
234 pPageWindow = pTempPageWindow.get();
265 pKnownTarget->
RedrawLayer(&nID, pRedirector, pPageFrame);
282 bool bUseRect(
false);
297 auto pPreviousWindow = pPreparedTarget->
patchPaintWindow(aTemporaryPaintWindow);
299 const ::comphelper::ScopeGuard aGuard(
300 [&pPreviousWindow, &pPreparedTarget]() { pPreparedTarget->
unpatchPaintWindow(pPreviousWindow); } );
302 pPreparedTarget->
RedrawLayer(&nID, pRedirector, pPageFrame);
306 OSL_FAIL(
"SdrPageView::DrawLayer: Creating temporary SdrPageWindow (ObjectContact), this should never be needed (!)");
311 SdrPageWindow aTemporaryPageWindow(*
this, aTemporaryPaintWindow);
325 aTemporaryPageWindow.
RedrawLayer(&nID, pRedirector,
nullptr);
364 if (nx1==0) { nx1=ny1; nx2=ny2; }
365 if (ny1==0) { ny1=nx1; ny2=nx2; }
380 if (nScreenWdt>=1600)
385 else if (nScreenWdt>=1024)
397 bool bHoriSolid=nx2<aMinDotDist.
Width();
398 bool bVertSolid=ny2<aMinDotDist.
Height();
403 while (nx1<aMinLinDist.
Width())
408 if (nTgl==1) nx1=nVal0*5;
412 nTgl++;
if (nTgl>=3) nTgl=0;
416 while (ny1<aMinLinDist.
Height())
421 if (nTgl==1) ny1=nVal0*5;
430 bool bHoriFine=nx2<nx1;
431 bool bVertFine=ny2<ny1;
432 bool bHoriLines=bHoriSolid || bHoriFine || !bVertFine;
433 bool bVertLines=bVertSolid || bVertFine;
459 sal_uInt16 nGridPaintCnt=1;
460 if (pFrames!=
nullptr) nGridPaintCnt=pFrames->
GetCount();
461 for (sal_uInt16 nGridPaintNum=0; nGridPaintNum<nGridPaintCnt; nGridPaintNum++) {
462 if (pFrames!=
nullptr) {
477 if (x1<rRect.
Left() -nX1Pix) x1=rRect.
Left() -nX1Pix;
478 if (x2>rRect.
Right() +nX1Pix) x2=rRect.
Right() +nX1Pix;
479 if (y1<rRect.
Top() -nY1Pix) y1=rRect.
Top() -nY1Pix;
484 while (xBigOrg>=x1) xBigOrg-=nx1;
485 while (xBigOrg<x1) xBigOrg+=nx1;
487 while (xFinOrg>=x1) xFinOrg-=nx2;
488 while (xFinOrg<x1) xFinOrg+=nx2;
491 while (yBigOrg>=y1) yBigOrg-=ny1;
492 while (yBigOrg<y1) yBigOrg+=ny1;
494 while (yFinOrg>=y1) yFinOrg-=ny2;
495 while (yFinOrg<y1) yFinOrg+=ny2;
497 if( x1 <= x2 && y1 <= y2 )
501 DrawGridFlags nGridFlags = ( bHoriSolid ? DrawGridFlags::HorzLines : DrawGridFlags::Dots );
502 sal_uInt16 nSteps = sal_uInt16(nx1 / nx2);
503 sal_uInt32 nRestPerStepMul1000 = nSteps ? ( ((nx1 * 1000)/ nSteps) - (nx2 * 1000) ) : 0;
504 sal_uInt32 nStepOffset = 0;
505 sal_uInt16 nPointOffset = 0;
507 for(sal_uInt16
a=0;
a<nSteps;
a++)
512 Size( nx1, ny1 ), nGridFlags );
515 nStepOffset += nRestPerStepMul1000;
516 while(nStepOffset >= 1000)
526 DrawGridFlags nGridFlags = ( bVertSolid ? DrawGridFlags::VertLines : DrawGridFlags::Dots );
527 sal_uInt16 nSteps = sal_uInt16(ny1 / ny2);
528 sal_uInt32 nRestPerStepMul1000 = nSteps ? ( ((ny1 * 1000L)/ nSteps) - (ny2 * 1000L) ) : 0;
529 sal_uInt32 nStepOffset = 0;
530 sal_uInt16 nPointOffset = 0;
532 for(sal_uInt16
a=0;
a<nSteps;
a++)
537 Size( nx1, ny1 ), nGridFlags );
540 nStepOffset += nRestPerStepMul1000;
541 while(nStepOffset >= 1000)
578 if (!rName.isEmpty())
601 if (
auto pObjGroup =
dynamic_cast<const SdrObjGroup*
>(pObj))
605 SdrObjList* pObjList = pObjGroup->GetSubList();
687 bool bNeedRedraw =
true;
689 switch (rNewHelpLine.
GetKind()) {
738 const bool bGlueInvalidate(
GetView().ImpIsGlueVisible());
802 if (
GetView().GetSdrPageView())
835 if (
GetView().GetSdrPageView())
851 while (pGrp!=
nullptr) {
862 while(
nullptr != pGrp &&
void EnableMapMode(bool bEnable=true)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
Size GetOutputSizePixel() const
void DrawGrid(const tools::Rectangle &rRect, const Size &rDist, DrawGridFlags nFlags)
const Color & GetLineColor() const
bool IsMapModeEnabled() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
void Insert(const SdrHelpLine &rHL)
sal_uInt16 GetCount() const
void Delete(sal_uInt16 nPos)
const Point & GetPos() const
SdrHelpLineKind GetKind() const
tools::Rectangle GetBoundRect(const OutputDevice &rOut) const
SdrLayerID GetLayerID(const OUString &rName) const
bool IsSet(SdrLayerID a) const
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
virtual SdrObjList * GetSubList() const
SdrObjList * getParentSdrObjListFromSdrObject() const
bool IsGroupObject() const
SdrPage * getSdrPageFromSdrObject() const
SdrObject * getParentSdrObjectFromSdrObject() const
bool IsMarkProtect() const
virtual SdrLayerID GetLayer() const
sal_uInt16 GetCount() const
for the snap-to-grid in Writer
const tools::Rectangle & GetUserArea() const
const tools::Rectangle & GetPaperRect() const
void SetDesignMode(bool _bDesignMode) const
Sets all elements in the view which support a design and an alive mode into the given mode.
void SetLayer(const OUString &rName, SdrLayerIDSet &rBS, bool bJa)
sal_uInt16 GetEnteredLevel() const
Determine, how deep we descended (0 = Root(Page))
const SdrPageWindow * FindPatchedPageWindow(const OutputDevice &rOutDev) const
Finds the page window whose PaintWindow belongs to the given output device In opposite to FindPageWin...
bool IsObjMarkable(SdrObject const *pObj) const
At least one member must be visible for the Group object and it must not be locked.
SdrHelpLineList aHelpLines
SdrPageWindow * mpPreparedPageWindow
tools::Rectangle GetPageRect() const
void DrawLayer(SdrLayerID nID, OutputDevice *pGivenTarget, sdr::contact::ViewObjectContactRedirector *pRedirector=nullptr, const tools::Rectangle &rRect=tools::Rectangle(), basegfx::B2IRectangle const *pPageFrame=nullptr)
bool IsReadOnly() const
PV represents a RefPage or a SubList of a RefObj, or the Model is ReadOnly.
void ModelHasChanged()
Is called by PaintView, when modal changes have finished.
SdrObjList * GetObjList() const
Return current List.
void SetPageOrigin(const Point &rOrg)
void setPreparedPageWindow(SdrPageWindow *pKnownTarget)
Write access to mpPreparedPageWindow.
sal_uInt32 PageWindowCount() const
void DrawPageViewGrid(OutputDevice &rOut, const tools::Rectangle &rRect, Color aColor=COL_BLACK)
void InvalidateAllWin()
Invalidates the Page's whole area.
void LeaveAllGroup()
Leave all object groups we entered previously.
void RemovePaintWindowFromPageView(SdrPaintWindow &rPaintWindow)
SdrObject * GetCurrentGroup() const
Return current Group.
void DeleteHelpLine(sal_uInt16 nNum)
void ImpInvalidateHelpLineArea(sal_uInt16 nNum) const
void SetCurrentGroupAndList(SdrObject *pNewGroup, SdrObjList *pNewList)
Set current Group and List.
void AddPaintWindowToPageView(SdrPaintWindow &rPaintWindow)
std::vector< std::unique_ptr< SdrPageWindow > > maPageWindows
void SetApplicationDocumentColor(Color aDocumentColor)
void CheckCurrentGroup()
Let's see if the current Group (pCurrentGroup) is still inserted.
SdrPage * GetPage() const
void PrePaint()
PrePaint call forwarded from app windows.
css::uno::Reference< css::awt::XControlContainer > GetControlContainer(const OutputDevice &_rDevice) const
Looks up the control container belonging to given output device.
SdrObjList * pCurrentList
SdrPageWindow * GetPageWindow(sal_uInt32 nIndex) const
bool IsLayer(const OUString &rName, const SdrLayerIDSet &rBS) const
SdrPageView(SdrPage *pPage1, SdrView &rNewView)
void SetHelpLine(sal_uInt16 nNum, const SdrHelpLine &rNewHelpLine)
SdrPageWindow * FindPageWindow(const SdrPaintWindow &rPaintWindow) const
SdrObject * pCurrentGroup
void LeaveOneGroup()
Leave an object group we entered previously.
void SetHelpLines(const SdrHelpLineList &rHLL)
void CompleteRedraw(SdrPaintWindow &rPaintWindow, const vcl::Region &rReg, sdr::contact::ViewObjectContactRedirector *pRedirector)
bool EnterGroup(SdrObject *pObj)
Entering (editing) an object group After that, we have direct access to all member objects of the gro...
void SetApplicationBackgroundColor(Color aBackgroundColor)
void InsertHelpLine(const SdrHelpLine &rHL)
void unpatchPaintWindow(SdrPaintWindow *pPreviousPaintWindow)
SdrPaintWindow * patchPaintWindow(SdrPaintWindow &rPaintWindow)
css::uno::Reference< css::awt::XControlContainer > const & GetControlContainer(bool _bCreateIfNecessary=true) const
void PrepareRedraw(const vcl::Region &rReg)
void SetDesignMode(bool _bDesignMode) const
sets all elements in the view which support a design and an alive mode into the given mode
SdrPaintWindow & GetPaintWindow() const
void RedrawLayer(const SdrLayerID *pId, sdr::contact::ViewObjectContactRedirector *pRedirector, basegfx::B2IRectangle const *)
void RedrawAll(sdr::contact::ViewObjectContactRedirector *pRedirector)
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
const SdrLayerAdmin & GetLayerAdmin() const
changing the layers does not set the modified-flag!
virtual const SdrPageGridFrameList * GetGridFrameList(const SdrPageView *pPV, const tools::Rectangle *pRect) const
for snap-to-grid in Writer, also for AlignObjects if 1 object is marked if pRect !...
sal_Int32 GetUpperBorder() const
sal_Int32 GetRightBorder() const
sal_Int32 GetLeftBorder() const
sal_Int32 GetLowerBorder() const
tools::Long GetHeight() const
tools::Long GetWidth() const
SdrPaintWindow * GetPaintWindow(sal_uInt32 nIndex) const
sal_uInt32 PaintWindowCount() const
bool ImpIsGlueVisible() const
void GlueInvalidate() const
const vcl::Region & GetRedrawRegion() const
OutputDevice & GetOutputDevice() const
bool OutputToWindow() const
void SetRedrawRegion(const vcl::Region &rNew)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
void Intersect(const tools::Rectangle &rRegion)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr SdrLayerID SDRLAYER_NOTFOUND(-1)