Files
libreoffice/svx/source/svdraw/svdoattr.cxx

166 lines
4.5 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patch contributed by Christian Lippka impress212: #i113063# patch: dubios self assign in svx/source/dialog/framelink.cxx http://svn.apache.org/viewvc?view=revision&revision=1167619 Patches contributed by Mathias Bauer gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 cws mba34issues01: #i117712#: fix several resource errors introduced by IAccessible2 implementation http://svn.apache.org/viewvc?view=revision&revision=1172343 cws mba34issues01: #i117719#: use correct resource ID http://svn.apache.org/viewvc?view=revision&revision=1172351 Patch contributed by Andre Fischer Do not add targets for junit tests when junit is disabled. http://svn.apache.org/viewvc?view=revision&revision=1241508 Patches contributed by Armin Le-Grand #118804# corrected GraphicExporter behaviour on shortcut when pixel graphic is requested http://svn.apache.org/viewvc?view=revision&revision=1240195 fix for #118525#: Using primitives for chart sub-geometry visualisation http://svn.apache.org/viewvc?view=revision&revision=1226879 #118485# - Styles for OLEs are not saved. http://svn.apache.org/viewvc?view=revision&revision=1182166 #118524: apply patch, followup fixes to 118485 http://svn.apache.org/viewvc?view=revision&revision=1186077 13f79535-47bb-0310-9956-ffa450edef68 Patch contributed by Regina Henschel linecap: Reintegrating finished LineCap feature http://svn.apache.org/viewvc?view=revision&revision=1232507 Patch contributed by Wang Lei (leiw) #i118760# split the first table cell vertically, then undo&redo, the Presentation app will crash http://svn.apache.org/viewvc?view=revision&revision=1301361 cleanup globlmn hacks, undo dependent fixmes.
2012-11-21 22:06:52 +00:00
/*
* 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 .
*/
2000-09-18 16:07:07 +00:00
#include <svx/svdoattr.hxx>
#include <svx/xpool.hxx>
#include <svx/svdmodel.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdattr.hxx>
#include <svx/svdpool.hxx>
#include <svx/svdotext.hxx>
#include <svx/svdocapt.hxx>
#include <svx/svdograf.hxx>
#include <svx/svdoole2.hxx>
#include <svx/svdorect.hxx>
#include <svx/svdocirc.hxx>
#include <svx/svdomeas.hxx>
#include <svl/smplhint.hxx>
#include <svl/itemiter.hxx>
#include <svx/xenum.hxx>
#include <svx/xlineit0.hxx>
#include <svx/xlnstwit.hxx>
#include <svx/xlnedwit.hxx>
#include <svx/xfillit0.hxx>
#include <svx/xflbmtit.hxx>
#include <svx/xtextit0.hxx>
#include <svx/xflbstit.hxx>
#include <svx/xflbtoxy.hxx>
#include <svx/xftshit.hxx>
2000-09-18 16:07:07 +00:00
#include <editeng/editdata.hxx>
#include <editeng/colritem.hxx>
#include "editeng/fontitem.hxx"
#include <editeng/fhgtitem.hxx>
2000-09-18 16:07:07 +00:00
#include <svx/xlnstcit.hxx>
#include <svx/xlnwtit.hxx>
#include <svl/style.hxx>
#include <svl/whiter.hxx>
#include <svx/xlnclit.hxx>
#include <svx/xflclit.hxx>
#include <svx/xlntrit.hxx>
#include <svx/xfltrit.hxx>
#include <svx/xlnedcit.hxx>
#include <editeng/adjustitem.hxx>
#include <svx/xflbckit.hxx>
#include <svx/xtable.hxx>
#include <svx/xbtmpit.hxx>
#include <svx/xlndsit.hxx>
#include <svx/xlnedit.hxx>
#include <svx/xflgrit.hxx>
#include <svx/xflftrit.hxx>
#include <svx/xflhtit.hxx>
#include <svx/xlnstit.hxx>
#include <sdr/properties/attributeproperties.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
2009-11-04 12:06:36 +01:00
#include "svx/xlinjoit.hxx"
using namespace com::sun::star;
2000-09-18 16:07:07 +00:00
sdr::properties::BaseProperties* SdrAttrObj::CreateObjectSpecificProperties()
2000-09-18 16:07:07 +00:00
{
return new sdr::properties::AttributeProperties(*this);
2000-09-18 16:07:07 +00:00
}
2000-09-18 16:07:07 +00:00
TYPEINIT1(SdrAttrObj,SdrObject);
SdrAttrObj::SdrAttrObj()
{
2000-09-18 16:07:07 +00:00
}
SdrAttrObj::~SdrAttrObj()
2000-09-18 16:07:07 +00:00
{
}
const Rectangle& SdrAttrObj::GetSnapRect() const
2000-09-18 16:07:07 +00:00
{
if(bSnapRectDirty)
{
const_cast<SdrAttrObj*>(this)->RecalcSnapRect();
const_cast<SdrAttrObj*>(this)->bSnapRectDirty = false;
2000-09-18 16:07:07 +00:00
}
2008-10-17 08:40:10 +00:00
return maSnapRect;
}
2000-09-18 16:07:07 +00:00
void SdrAttrObj::SetModel(SdrModel* pNewModel)
{
SdrModel* pOldModel = pModel;
// test for correct pool in ItemSet; move to new pool if necessary
if(pNewModel && &GetObjectItemPool() != &pNewModel->GetItemPool())
{
MigrateItemPool(&GetObjectItemPool(), &pNewModel->GetItemPool(), pNewModel);
}
// call parent
SdrObject::SetModel(pNewModel);
// modify properties
GetProperties().SetModel(pOldModel, pNewModel);
}
// syntactical sugar for ItemSet accesses
2000-09-18 16:07:07 +00:00
2010-12-11 23:23:07 +01:00
void SdrAttrObj::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
{
const SfxSimpleHint* pSimple = dynamic_cast<const SfxSimpleHint*>(&rHint);
bool bDataChg(pSimple && SFX_HINT_DATACHANGED == pSimple->GetId());
2000-09-18 16:07:07 +00:00
if(bDataChg)
{
Rectangle aBoundRect = GetLastBoundRect();
SetBoundRectDirty();
SetRectsDirty(true);
// This may have led to object change
SetChanged();
BroadcastObjectChange();
SendUserCall(SDRUSERCALL_CHGATTR, aBoundRect);
2000-09-18 16:07:07 +00:00
}
}
sal_Int32 SdrAttrObj::ImpGetLineWdt() const
2000-09-18 16:07:07 +00:00
{
sal_Int32 nRetval(0);
if(drawing::LineStyle_NONE != static_cast<const XLineStyleItem&>(GetObjectItem(XATTR_LINESTYLE)).GetValue())
{
nRetval = static_cast<const XLineWidthItem&>(GetObjectItem(XATTR_LINEWIDTH)).GetValue();
}
return nRetval;
2000-09-18 16:07:07 +00:00
}
bool SdrAttrObj::HasFill() const
{
return bClosedObj && static_cast<const XFillStyleItem&>(GetProperties().GetObjectItemSet().Get(XATTR_FILLSTYLE)).GetValue() != drawing::FillStyle_NONE;
}
bool SdrAttrObj::HasLine() const
{
return static_cast<const XLineStyleItem&>(GetProperties().GetObjectItemSet().Get(XATTR_LINESTYLE)).GetValue() != drawing::LineStyle_NONE;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */