/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
void ViewContactOfPageBackground::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const
{ // We have only the page information, not the view information. Use the // svtools::DOCCOLOR color for initialisation const svtools::ColorConfig aColorConfig; const Color aInitColor(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor); const basegfx::BColor aRGBColor(aInitColor.getBColor()); const drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::BackgroundColorPrimitive2D(aRGBColor));
// We have only the page information, not the view information. Use the // svtools::FONTCOLOR color for initialisation const svtools::ColorConfig aColorConfig; const Color aShadowColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor()); const drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
basegfx::B2DPolyPolygon(aPageShadowPolygon),
aRGBShadowColor));
void ViewContactOfMasterPage::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const
{ // this class is used when the page is a MasterPage and is responsible to // create a visualisation for the MPBGO, if exists. This needs to be suppressed // when a SdrPage which uses a MasterPage creates it's output. Suppression // is done in the corresponding VOC since DisplayInfo data is needed const SdrPage& rPage = getPage();
if(rPage.IsMasterPage())
{ if(0 == rPage.GetPageNum())
{ // #i98063# // filter MasterPage 0 since it's the HandoutPage. Thus, it's a // MasterPage, but has no MPBGO, so there is nothing to do here.
} else
{
drawinglayer::attribute::SdrFillAttribute aFill;
// #i110846# Suppress SdrPage FillStyle for MasterPages without StyleSheets, // else the PoolDefault (XFILL_COLOR and Blue8) will be used. Normally, all // MasterPages should have a StyleSheet exactly for this reason, but historically // e.g. the Notes MasterPage has no StyleSheet set (and there maybe others). if(rPage.getSdrPageProperties().GetStyleSheet())
{ // create page fill attributes with correct properties
aFill = drawinglayer::primitive2d::createNewSdrFillAttribute(
rPage.getSdrPageProperties().GetItemSet());
}
if(!aFill.isDefault())
{ // direct model data is the page size, get and use it const basegfx::B2DRange aOuterRange(
0, 0, rPage.GetWidth(), rPage.GetHeight()); const basegfx::B2DRange aInnerRange(
rPage.GetLeftBorder(), rPage.GetUpperBorder(),
rPage.GetWidth() - rPage.GetRightBorder(), rPage.GetHeight() - rPage.GetLowerBorder()); boolconst isFullSize(rPage.IsBackgroundFullSize()); const basegfx::B2DPolygon aFillPolygon(
basegfx::utils::createPolygonFromRect(isFullSize ? aOuterRange : aInnerRange)); const drawinglayer::primitive2d::Primitive2DReference xReference(
drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
basegfx::B2DPolyPolygon(aFillPolygon),
aFill,
drawinglayer::attribute::FillGradientAttribute()));
// We have only the page information, not the view information. Use the // svtools::DOCCOLOR color for initialisation const svtools::ColorConfig aColorConfig; const Color aPageFillColor(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
// Changed to 0x949599 for renaissance, before svtools::FONTCOLOR was used. // Added old case as fallback for HighContrast.
basegfx::BColor aRGBBorderColor(0x94 / double(0xff), 0x95 / double(0xff), 0x99 / double(0xff));
if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
{ const svtools::ColorConfig aColorConfig; const Color aBorderColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor);
aRGBBorderColor = aBorderColor.getBColor();
}
if(rPage.getPageBorderOnlyLeftRight())
{ // #i93597# for Report Designer, the page border shall be only displayed right and left, // but not top and bottom. Create simplified geometry.
basegfx::B2DPolygon aLeft, aRight;
// We have only the page information, not the view information. Use the // svtools::FONTCOLOR or svtools::DOCBOUNDARIES color for initialisation const svtools::ColorConfig aColorConfig;
Color aBorderColor;
void ViewContactOfGrid::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&) const
{ // We have only the page information, not the view information and thus no grid settings. Create empty // default. For the view-dependent implementation, see ViewObjectContactOfPageGrid::createPrimitive2DSequence
}
void ViewContactOfHelplines::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&) const
{ // We have only the page information, not the view information and thus no helplines. Create empty // default. For the view-dependent implementation, see ViewObjectContactOfPageHelplines::createPrimitive2DSequence
}
// Access to possible sub-hierarchy
sal_uInt32 ViewContactOfSdrPage::GetObjectCount() const
{ // Fixed count of content. It contains PageBackground (Wiese), PageShadow, PageFill, // then - depending on if the page has a MasterPage - either MasterPage Hierarchy // or MPBGO. Also OuterPageBorder, InnerPageBorder, PageHierarchy and two pairs of Grid and // Helplines (for front and back) which internally are visible or not depending on the current // front/back setting for those. return 11;
}
ViewContact& ViewContactOfSdrPage::GetViewContact(sal_uInt32 nIndex) const
{ switch(nIndex)
{ case 0: returnconst_cast<ViewContactOfPageBackground&>(maViewContactOfPageBackground); case 1: returnconst_cast<ViewContactOfPageShadow&>(maViewContactOfPageShadow); case 2: returnconst_cast<ViewContactOfPageFill&>(maViewContactOfPageFill); case 3:
{ const SdrPage& rPage = GetSdrPage();
if(rPage.TRG_HasMasterPage())
{ return rPage.TRG_GetMasterPageDescriptorViewContact();
} else
{ returnconst_cast<ViewContactOfMasterPage&>(maViewContactOfMasterPage);
}
} case 4: returnconst_cast<ViewContactOfOuterPageBorder&>(maViewContactOfOuterPageBorder); case 5: returnconst_cast<ViewContactOfInnerPageBorder&>(maViewContactOfInnerPageBorder); case 6: returnconst_cast<ViewContactOfGrid&>(maViewContactOfGridBack); case 7: returnconst_cast<ViewContactOfHelplines&>(maViewContactOfHelplinesBack); case 8: returnconst_cast<ViewContactOfPageHierarchy&>(maViewContactOfPageHierarchy); case 9: returnconst_cast<ViewContactOfGrid&>(maViewContactOfGridFront); case 10: returnconst_cast<ViewContactOfHelplines&>(maViewContactOfHelplinesFront); default: assert(false);returnconst_cast<ViewContactOfHelplines&>(maViewContactOfHelplinesFront);
}
}
// React on changes of the object of this ViewContact void ViewContactOfSdrPage::ActionChanged()
{ // call parent
ViewContact::ActionChanged();
// apply to local viewContacts, they all rely on page information. Exception // is the sub hierarchy; this will not be influenced by the change
maViewContactOfPageBackground.ActionChanged();
maViewContactOfPageShadow.ActionChanged();
maViewContactOfPageFill.ActionChanged();
void ViewContactOfSdrPage::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const
{ // collect all sub-sequences including sub hierarchy.
maViewContactOfPageBackground.getViewIndependentPrimitive2DContainer(rVisitor);
maViewContactOfPageShadow.getViewIndependentPrimitive2DContainer(rVisitor);
maViewContactOfPageFill.getViewIndependentPrimitive2DContainer(rVisitor);
// Only add front versions of grid and helplines since no visibility test is done, // so adding the back incarnations is not necessary. This makes the Front // visualisation the default when no visibility tests are done.
// Since we have no view here, no grid and helpline definitions are available currently. The used // methods at ViewContactOfHelplines and ViewContactOfGrid return only empty sequences and // do not need to be called ATM. This may change later if grid or helpline info gets // model data (it should not). Keeping the lines commented to hold this hint.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.