summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdobj.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-12-08 22:28:09 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-12-08 23:23:33 -0500
commit1f1aee5fbd034c5f7c967e19631b6507408ec00f (patch)
tree8efa1dff1452b4b92d82b97dec081bf16e065d9e /svx/source/svdraw/svdobj.cxx
parent822b3482414fe9be0e271727d58581a1df1d3b83 (diff)
Move these to Impl and remove boost::optional include.
Change-Id: I394d164c4d3f26d906204e2ed89efeef597ba810
Diffstat (limited to 'svx/source/svdraw/svdobj.cxx')
-rw-r--r--svx/source/svdraw/svdobj.cxx66
1 files changed, 60 insertions, 6 deletions
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 15797950adda..025903a67bf4 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);