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 
33 namespace sdr::contact
34 {
36  {
37  return *(new ViewObjectContactOfMasterPageDescriptor(rObjectContact, *this));
38  }
39 
41  {
45 
46  if(pCorrectProperties)
47  {
48  // create page fill attributes when correct properties were identified
50  }
51 
52  if(!aFill.isDefault())
53  {
54  // direct model data is the page size, get and use it
55  const SdrPage& rOwnerPage = GetMasterPageDescriptor().GetOwnerPage();
56  const basegfx::B2DRange aInnerRange(
57  rOwnerPage.GetLeftBorder(), rOwnerPage.GetUpperBorder(),
58  rOwnerPage.GetWidth() - rOwnerPage.GetRightBorder(),
59  rOwnerPage.GetHeight() - rOwnerPage.GetLowerBorder());
60  const basegfx::B2DPolygon aInnerPolgon(basegfx::utils::createPolygonFromRect(aInnerRange));
63  basegfx::B2DPolyPolygon(aInnerPolgon),
64  aFill,
66 
68  }
69 
70  return xRetval;
71  }
72 
73  // basic constructor
75  : ViewContact(),
76  mrMasterPageDescriptor(rDescriptor)
77  {
78  }
79 
80  // The destructor.
82  {
83  }
84 
86  {
88  }
89 
91  {
93  }
94 
96  {
98  }
99 
100 } // end of namespace
101 
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 GetHeight() const
Definition: svdpage.cxx:1393
attribute::SdrFillAttribute createNewSdrFillAttribute(const SfxItemSet &rSet)
virtual ViewContact & GetViewContact(sal_uInt32 nIndex) const override
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:758
sal_Int32 GetRightBorder() const
Definition: svdpage.cxx:1478
size_t GetObjCount() const
Definition: svdpage.cxx:752
sal_Int32 GetLowerBorder() const
Definition: svdpage.cxx:1483
sal_Int32 GetLeftBorder() const
Definition: svdpage.cxx:1468
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:245
virtual ViewObjectContact & CreateObjectSpecificViewObjectContact(ObjectContact &rObjectContact) override
const SdrPageProperties * getCorrectSdrPageProperties() const
sal_Int32 GetUpperBorder() const
Definition: svdpage.cxx:1473
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
const SfxItemSet & GetItemSet() const
Definition: svdpage.hxx:334
virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override
css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference
const sdr::contact::ViewContact & GetViewContact() const
Definition: svdpage.cxx:1100
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:365
sal_Int32 GetWidth() const
Definition: svdpage.cxx:1367
ViewContactOfMasterPageDescriptor(sdr::MasterPageDescriptor &rDescriptor)
Primitive2DReference createPolyPolygonFillPrimitive(const basegfx::B2DPolyPolygon &rPolyPolygon, const attribute::SdrFillAttribute &rFill, const attribute::FillGradientAttribute &rFillGradient)