summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-02-20 11:14:14 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-02-20 12:34:32 +0100
commitb0bf124360730e79366e1be73383d4639e608a4c (patch)
tree15abc06fa2f777c390d3b8c6bddcdde0164d9143
parentb74870f27557265e347f2e191a222f514d1b8c50 (diff)
SdrObject: add meRelativeWidth/HeightRelation
Similar to Writer TextBoxes, this member is supposed to store the "relation" (text::RelOrientation constants) of the relative width/height, so far the layout always assumed "relative to page". Change-Id: I5100745314e45ad322bff2b761e3722459aba014
-rw-r--r--include/svx/svdobj.hxx6
-rw-r--r--svx/source/svdraw/svdobj.cxx5
2 files changed, 11 insertions, 0 deletions
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index efc5a0e41fcc..611b365cf8f6 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -413,13 +413,19 @@ protected:
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; }
// 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 9999a4671c72..4a0d63c894ef 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -20,6 +20,7 @@
#include "sal/config.h"
#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/text/RelOrientation.hpp>
#include "svdconv.hxx"
@@ -437,6 +438,8 @@ 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)
@@ -1615,6 +1618,8 @@ void SdrObject::Resize(const Point& rRef, const Fraction& xFact, const Fraction&
if (bUnsetRelative)
{
mnRelativeWidth.reset( );
+ meRelativeWidthRelation = text::RelOrientation::PAGE_FRAME;
+ meRelativeHeightRelation = text::RelOrientation::PAGE_FRAME;
mnRelativeHeight.reset( );
}
Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();