basctl/source/inc/dlgedfac.hxx | 1 include/svx/svdobj.hxx | 59 +++++++++------- reportdesign/source/ui/inc/dlgedfac.hxx | 1 sc/inc/userdat.hxx | 1 svx/source/svdraw/svdfmtf.hxx | 2 svx/source/svdraw/svdobj.cxx | 96 ++++++++++++++++++++++----- svx/source/table/tableundo.hxx | 1 sw/source/core/layout/anchoreddrawobject.cxx | 4 - 8 files changed, 120 insertions(+), 45 deletions(-)
New commits: commit 28c251e3cc374314dc19fd772148707b0c711454 Author: Kohei Yoshida <[email protected]> Date: Mon Dec 8 23:20:14 2014 -0500 Remove more unnecessary header includes and use forward declaration. Change-Id: I88d0fb0e7c20d4b1414516e3bd2f961811b2eb8c diff --git a/basctl/source/inc/dlgedfac.hxx b/basctl/source/inc/dlgedfac.hxx index d63dae8..6e8af7d 100644 --- a/basctl/source/inc/dlgedfac.hxx +++ b/basctl/source/inc/dlgedfac.hxx @@ -21,6 +21,7 @@ #define INCLUDED_BASCTL_SOURCE_INC_DLGEDFAC_HXX #include <svx/svdobj.hxx> +#include <tools/link.hxx> #include <com/sun/star/frame/XModel.hpp> namespace basctl diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 21789af..1502a4f 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -26,18 +26,13 @@ #include <rtl/ustring.hxx> #include <svl/lstner.hxx> #include <svl/poolitem.hxx> -#include <svx/svdsob.hxx> #include <svx/svdtypes.hxx> -#include <svx/svdglue.hxx> -#include <svx/xdash.hxx> -#include <svx/xpoly.hxx> #include <svx/xenum.hxx> #include <svx/svxdllapi.h> #include <svx/shapeproperty.hxx> #include <tools/weakbase.hxx> -#include <vcl/bitmapex.hxx> -#include <vcl/mapmod.hxx> -#include <vcl/timer.hxx> +#include <tools/mapunit.hxx> +#include <tools/gen.hxx> // forward declarations @@ -70,6 +65,19 @@ class SdrVirtObj; class SdrDragView; class SdrObjUserDataList; class SdrObjPlusData; +class SdrGluePoint; +class SdrGluePointList; +class SetOfByte; +class OutputDevice; +class Fraction; +class Link; + +namespace basegfx { + +class B2DPolyPolygon; +class B2DHomMatrix; + +} namespace sdr { diff --git a/reportdesign/source/ui/inc/dlgedfac.hxx b/reportdesign/source/ui/inc/dlgedfac.hxx index 1f3c146..864dd36 100644 --- a/reportdesign/source/ui/inc/dlgedfac.hxx +++ b/reportdesign/source/ui/inc/dlgedfac.hxx @@ -22,6 +22,7 @@ #include <svx/svdobj.hxx> +#include <tools/link.hxx> namespace rptui { diff --git a/sc/inc/userdat.hxx b/sc/inc/userdat.hxx index 6f13894..edfcf9b 100644 --- a/sc/inc/userdat.hxx +++ b/sc/inc/userdat.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SC_INC_USERDAT_HXX #include <svx/svdobj.hxx> +#include <tools/link.hxx> #include <svtools/imap.hxx> #include "global.hxx" #include "address.hxx" diff --git a/svx/source/svdraw/svdfmtf.hxx b/svx/source/svdraw/svdfmtf.hxx index 8663296..5494b1f 100644 --- a/svx/source/svdraw/svdfmtf.hxx +++ b/svx/source/svdraw/svdfmtf.hxx @@ -25,7 +25,7 @@ #include <vcl/metaact.hxx> #include <vcl/virdev.hxx> #include <svx/svdobj.hxx> - +#include <svx/xdash.hxx> // Forward Declarations diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 025903a..3ff4238 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -129,6 +129,8 @@ #include <svx/xlntrit.hxx> #include <svx/xlnwtit.hxx> #include <svx/xpoly.hxx> +#include <svx/svdglue.hxx> +#include <svx/svdsob.hxx> #include <rtl/strbuf.hxx> #include <svdoopengl.hxx> #include <svdobjplusdata.hxx> diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx index 60b958f..2baa1a6 100644 --- a/sw/source/core/layout/anchoreddrawobject.cxx +++ b/sw/source/core/layout/anchoreddrawobject.cxx @@ -641,7 +641,7 @@ const SwRect SwAnchoredDrawObject::GetObjBoundRect() const aPageRect = GetPageFrm()->Prt().SVRect(); else aPageRect = GetPageFrm( )->GetBoundRect( ).SVRect(); - nTargetWidth = aPageRect.GetWidth( ) * GetDrawObj( )->GetRelativeWidth( ).get( ); + nTargetWidth = aPageRect.GetWidth( ) * (*GetDrawObj( )->GetRelativeWidth()); } long nTargetHeight = aCurrObjRect.GetHeight( ); @@ -653,7 +653,7 @@ const SwRect SwAnchoredDrawObject::GetObjBoundRect() const aPageRect = GetPageFrm()->Prt().SVRect(); else aPageRect = GetPageFrm( )->GetBoundRect( ).SVRect(); - nTargetHeight = aPageRect.GetHeight( ) * GetDrawObj( )->GetRelativeHeight( ).get( ); + nTargetHeight = aPageRect.GetHeight( ) * (*GetDrawObj( )->GetRelativeHeight()); } if ( nTargetWidth != aCurrObjRect.GetWidth( ) || nTargetHeight != aCurrObjRect.GetHeight( ) ) commit 1f1aee5fbd034c5f7c967e19631b6507408ec00f Author: Kohei Yoshida <[email protected]> Date: Mon Dec 8 22:28:09 2014 -0500 Move these to Impl and remove boost::optional include. Change-Id: I394d164c4d3f26d906204e2ed89efeef597ba810 diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 02d98bc..21789af 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -39,8 +39,6 @@ #include <vcl/mapmod.hxx> #include <vcl/timer.hxx> -#include <boost/optional.hpp> - // forward declarations class SfxBroadcaster; @@ -358,20 +356,17 @@ protected: // global static ItemPool for not-yet-inserted items private: static SdrItemPool* mpGlobalItemPool; - boost::optional<double> mnRelativeWidth; - sal_Int16 meRelativeWidthRelation; - boost::optional<double> mnRelativeHeight; - sal_Int16 meRelativeHeightRelation; + public: static SdrItemPool& GetGlobalDrawObjectItemPool(); - void SetRelativeWidth( double nValue ) { mnRelativeWidth.reset( nValue ); } - void SetRelativeWidthRelation( sal_Int16 eValue ) { meRelativeWidthRelation = eValue; } - void SetRelativeHeight( double nValue ) { mnRelativeHeight.reset( nValue ); } - void SetRelativeHeightRelation( sal_Int16 eValue ) { meRelativeHeightRelation = eValue; } - boost::optional<double> GetRelativeWidth( ) const { return mnRelativeWidth; } - sal_Int16 GetRelativeWidthRelation() const { return meRelativeWidthRelation; } - boost::optional<double> GetRelativeHeight( ) const { return mnRelativeHeight; } - sal_Int16 GetRelativeHeightRelation() const { return meRelativeHeightRelation; } + void SetRelativeWidth( double nValue ); + void SetRelativeWidthRelation( sal_Int16 eValue ); + void SetRelativeHeight( double nValue ); + void SetRelativeHeightRelation( sal_Int16 eValue ); + const double* GetRelativeWidth() const; + sal_Int16 GetRelativeWidthRelation() const; + const double* GetRelativeHeight() const; + sal_Int16 GetRelativeHeightRelation() const; // evil calc grid/shape drawlayer syncing Point GetGridOffset() const { return aGridOffset; } void SetGridOffset( const Point& rGridOffset ){ aGridOffset = rGridOffset; } diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 1579795..025903a 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -135,6 +135,7 @@ #include <svdobjuserdatalist.hxx> #include <boost/scoped_ptr.hpp> +#include <boost/optional.hpp> #include <libxml/xmlwriter.h> using namespace ::com::sun::star; @@ -271,6 +272,15 @@ SdrObjTransformInfoRec::SdrObjTransformInfoRec() : struct SdrObject::Impl { sdr::ObjectUserVector maObjectUsers; + + boost::optional<double> mnRelativeWidth; + sal_Int16 meRelativeWidthRelation; + boost::optional<double> mnRelativeHeight; + sal_Int16 meRelativeHeightRelation; + + Impl() : + meRelativeWidthRelation(text::RelOrientation::PAGE_FRAME), + meRelativeHeightRelation(text::RelOrientation::PAGE_FRAME) {} }; @@ -360,8 +370,6 @@ SdrObject::SdrObject() : ,pGrabBagItem(NULL) ,mnNavigationPosition(SAL_MAX_UINT32) ,mnLayerID(0) - ,meRelativeWidthRelation(text::RelOrientation::PAGE_FRAME) - ,meRelativeHeightRelation(text::RelOrientation::PAGE_FRAME) ,mpSvxShape( NULL ) ,maWeakUnoShape() ,mbDoNotInsertIntoPageAutomatically(false) @@ -546,6 +554,52 @@ SdrItemPool& SdrObject::GetGlobalDrawObjectItemPool() return *mpGlobalItemPool; } +void SdrObject::SetRelativeWidth( double nValue ) +{ + mpImpl->mnRelativeWidth.reset( nValue ); +} + +void SdrObject::SetRelativeWidthRelation( sal_Int16 eValue ) +{ + mpImpl->meRelativeWidthRelation = eValue; +} + +void SdrObject::SetRelativeHeight( double nValue ) +{ + mpImpl->mnRelativeHeight.reset( nValue ); +} + +void SdrObject::SetRelativeHeightRelation( sal_Int16 eValue ) +{ + mpImpl->meRelativeHeightRelation = eValue; +} + +const double* SdrObject::GetRelativeWidth( ) const +{ + if (!mpImpl->mnRelativeWidth) + return NULL; + + return &mpImpl->mnRelativeWidth.get(); +} + +sal_Int16 SdrObject::GetRelativeWidthRelation() const +{ + return mpImpl->meRelativeWidthRelation; +} + +const double* SdrObject::GetRelativeHeight( ) const +{ + if (!mpImpl->mnRelativeHeight) + return NULL; + + return &mpImpl->mnRelativeHeight.get(); +} + +sal_Int16 SdrObject::GetRelativeHeightRelation() const +{ + return mpImpl->meRelativeHeightRelation; +} + SfxItemPool & SdrObject::GetObjectItemPool() const { if(pModel) @@ -1530,10 +1584,10 @@ void SdrObject::Resize(const Point& rRef, const Fraction& xFact, const Fraction& if (xFact.GetNumerator()!=xFact.GetDenominator() || yFact.GetNumerator()!=yFact.GetDenominator()) { if (bUnsetRelative) { - mnRelativeWidth.reset( ); - meRelativeWidthRelation = text::RelOrientation::PAGE_FRAME; - meRelativeHeightRelation = text::RelOrientation::PAGE_FRAME; - mnRelativeHeight.reset( ); + mpImpl->mnRelativeWidth.reset(); + mpImpl->meRelativeWidthRelation = text::RelOrientation::PAGE_FRAME; + mpImpl->meRelativeHeightRelation = text::RelOrientation::PAGE_FRAME; + mpImpl->mnRelativeHeight.reset(); } Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect(); NbcResize(rRef,xFact,yFact); commit 822b3482414fe9be0e271727d58581a1df1d3b83 Author: Kohei Yoshida <[email protected]> Date: Mon Dec 8 21:43:11 2014 -0500 Add Impl to SdrObject and hide ObjectUser member. SdrObject is quite large and we can't pimplize it in one go. Let's do it bit by bit. Change-Id: I40abe71799f6dcae90854dcc6979acc1d6ed7462 diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 9e54989..02d98bc 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -20,7 +20,6 @@ #ifndef INCLUDED_SVX_SVDOBJ_HXX #define INCLUDED_SVX_SVDOBJ_HXX -#include <memory> #include <typeinfo> #include <com/sun/star/uno/Any.hxx> #include <cppuhelper/weakref.hxx> @@ -33,7 +32,6 @@ #include <svx/xdash.hxx> #include <svx/xpoly.hxx> #include <svx/xenum.hxx> -#include <svx/sdrobjectuser.hxx> #include <svx/svxdllapi.h> #include <svx/shapeproperty.hxx> #include <tools/weakbase.hxx> @@ -80,8 +78,10 @@ namespace sdr namespace properties { class BaseProperties; - } // end of namespace properties -} // end of namespace sdr + } + + class ObjectUser; +} // #110094# namespace sdr @@ -262,10 +262,10 @@ class SvxShape; class SVX_DLLPUBLIC SdrObject: public SfxListener, public tools::WeakBase< SdrObject > { private: - SdrObject( const SdrObject& ); // disabled + struct Impl; + Impl* mpImpl; - // ObjectUser section - sdr::ObjectUserVector maObjectUsers; + SdrObject( const SdrObject& ); // disabled public: void AddObjectUser(sdr::ObjectUser& rNewUser); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index d8a1442..1579795 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <svx/svdobj.hxx> #include <config_features.h> #include "sal/config.h" @@ -66,6 +67,7 @@ #include <svx/sdr/contact/viewcontactofsdrobj.hxx> #include <sdr/properties/emptyproperties.hxx> #include <svx/sdrhittesthelper.hxx> +#include <svx/sdrobjectuser.hxx> #include <svx/sdrobjectfilter.hxx> #include <svx/svddrag.hxx> #include <svx/svdetc.hxx> @@ -73,7 +75,6 @@ #include <svx/svditer.hxx> #include <svx/svdmodel.hxx> #include <svx/svdoashp.hxx> -#include <svx/svdobj.hxx> #include <svx/svdocapt.hxx> #include <svx/svdocirc.hxx> #include <svx/svdoedge.hxx> @@ -267,6 +268,11 @@ SdrObjTransformInfoRec::SdrObjTransformInfoRec() : bCanConvToPathLineToArea(true), bCanConvToPolyLineToArea(true) {} +struct SdrObject::Impl +{ + sdr::ObjectUserVector maObjectUsers; +}; + // BaseProperties section @@ -291,15 +297,16 @@ sdr::properties::BaseProperties& SdrObject::GetProperties() const void SdrObject::AddObjectUser(sdr::ObjectUser& rNewUser) { - maObjectUsers.push_back(&rNewUser); + mpImpl->maObjectUsers.push_back(&rNewUser); } void SdrObject::RemoveObjectUser(sdr::ObjectUser& rOldUser) { - const ::sdr::ObjectUserVector::iterator aFindResult = ::std::find(maObjectUsers.begin(), maObjectUsers.end(), &rOldUser); - if(aFindResult != maObjectUsers.end()) + const sdr::ObjectUserVector::iterator aFindResult = + std::find(mpImpl->maObjectUsers.begin(), mpImpl->maObjectUsers.end(), &rOldUser); + if (aFindResult != mpImpl->maObjectUsers.end()) { - maObjectUsers.erase(aFindResult); + mpImpl->maObjectUsers.erase(aFindResult); } } @@ -340,8 +347,9 @@ void SdrObject::SetBoundRectDirty() TYPEINIT1(SdrObject,SfxListener); -SdrObject::SdrObject() - :mpProperties(0L) +SdrObject::SdrObject() : + mpImpl(new Impl), + mpProperties(0L) ,mpViewContact(0L) ,pObjList(NULL) ,pPage(NULL) @@ -387,7 +395,7 @@ SdrObject::SdrObject() SdrObject::~SdrObject() { // tell all the registered ObjectUsers that the page is in destruction - ::sdr::ObjectUserVector aListCopy(maObjectUsers.begin(), maObjectUsers.end()); + sdr::ObjectUserVector aListCopy(mpImpl->maObjectUsers.begin(), mpImpl->maObjectUsers.end()); for(::sdr::ObjectUserVector::iterator aIterator = aListCopy.begin(); aIterator != aListCopy.end(); ++aIterator) { sdr::ObjectUser* pObjectUser = *aIterator; @@ -397,7 +405,7 @@ SdrObject::~SdrObject() // Clear the vector. This means that user do not need to call RemoveObjectUser() // when they get called from ObjectInDestruction(). - maObjectUsers.clear(); + mpImpl->maObjectUsers.clear(); try { @@ -431,6 +439,8 @@ SdrObject::~SdrObject() delete mpViewContact; mpViewContact = 0L; } + + delete mpImpl; } void SdrObject::Free( SdrObject*& _rpObject ) diff --git a/svx/source/table/tableundo.hxx b/svx/source/table/tableundo.hxx index 1f7e24d..c9747cb 100644 --- a/svx/source/table/tableundo.hxx +++ b/svx/source/table/tableundo.hxx @@ -26,6 +26,7 @@ #include "svx/svdotable.hxx" #include "svx/svdobj.hxx" #include "svx/svdundo.hxx" +#include <svx/sdrobjectuser.hxx> #include "celltypes.hxx" commit ac732491868fd233c68b45fd358a811c9810dd7b Author: Kohei Yoshida <[email protected]> Date: Mon Dec 8 20:19:49 2014 -0500 Officially disable the copy c'tor of SdrObject. Change-Id: I5f4ccad5077427afd09668c93f56c0ecce5f6f5d diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 30c3961..9e54989 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -262,6 +262,8 @@ class SvxShape; class SVX_DLLPUBLIC SdrObject: public SfxListener, public tools::WeakBase< SdrObject > { private: + SdrObject( const SdrObject& ); // disabled + // ObjectUser section sdr::ObjectUserVector maObjectUsers; _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
