LibreOffice Module svx (master) 1
viewcontactofmasterpagedescriptor.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
22#include <svx/svdpage.hxx>
23#include <svx/svdobj.hxx>
31
32
33namespace sdr::contact
34{
36 {
37 return *(new ViewObjectContactOfMasterPageDescriptor(rObjectContact, *this));
38 }
39
41 {
44
45 if(pCorrectProperties)
46 {
47 // create page fill attributes when correct properties were identified
49 }
50
51 if(!aFill.isDefault())
52 {
53 // direct model data is the page size, get and use it
54 const SdrPage& rOwnerPage = GetMasterPageDescriptor().GetOwnerPage();
55 const basegfx::B2DRange aInnerRange(
56 rOwnerPage.GetLeftBorder(), rOwnerPage.GetUpperBorder(),
57 rOwnerPage.GetWidth() - rOwnerPage.GetRightBorder(),
58 rOwnerPage.GetHeight() - rOwnerPage.GetLowerBorder());
59 const basegfx::B2DRange aOuterRange(
60 0, 0, rOwnerPage.GetWidth(), rOwnerPage.GetHeight());
61 // ??? somehow only the master page's bit is used
62 bool const isFullSize(GetMasterPageDescriptor().GetUsedPage().IsBackgroundFullSize());
63 const basegfx::B2DPolygon aFillPolygon(
64 basegfx::utils::createPolygonFromRect(isFullSize ? aOuterRange : aInnerRange));
67 basegfx::B2DPolyPolygon(aFillPolygon),
68 aFill,
70
71 rVisitor.visit(xReference);
72 }
73 }
74
75 // basic constructor
77 : mrMasterPageDescriptor(rDescriptor)
78 {
79 }
80
81 // The destructor.
83 {
84 }
85
87 {
89 }
90
92 {
94 }
95
97 {
99 }
100
101} // end of namespace
102
103/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:785
size_t GetObjCount() const
Definition: svdpage.cxx:779
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:261
const SfxItemSet & GetItemSet() const
Definition: svdpage.hxx:342
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:379
const sdr::contact::ViewContact & GetViewContact() const
Definition: svdpage.cxx:1139
sal_Int32 GetUpperBorder() const
Definition: svdpage.cxx:1561
sal_Int32 GetRightBorder() const
Definition: svdpage.cxx:1566
sal_Int32 GetLeftBorder() const
Definition: svdpage.cxx:1556
sal_Int32 GetLowerBorder() const
Definition: svdpage.cxx:1571
tools::Long GetHeight() const
Definition: svdpage.cxx:1481
tools::Long GetWidth() const
Definition: svdpage.cxx:1455
virtual void visit(const Primitive2DReference &)=0
const SdrPageProperties * getCorrectSdrPageProperties() const
virtual ViewObjectContact & CreateObjectSpecificViewObjectContact(ObjectContact &rObjectContact) override
ViewContactOfMasterPageDescriptor(sdr::MasterPageDescriptor &rDescriptor)
virtual void createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor &rVisitor) const override
virtual ViewContact & GetViewContact(sal_uInt32 nIndex) const override
sal_Int32 nIndex
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
attribute::SdrFillAttribute createNewSdrFillAttribute(const SfxItemSet &rSet)
Primitive2DReference createPolyPolygonFillPrimitive(const basegfx::B2DPolyPolygon &rPolyPolygon, const attribute::SdrFillAttribute &rFill, const attribute::FillGradientAttribute &rFillGradient)