summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-01-29 10:55:42 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-01-29 11:50:43 +0100
commit6dc71a690a8282d028419a662b5bb72ac97a951b (patch)
tree05c0a3ee195c17573fb8a64e8aeb68a0e21f73e0
parenta64c6c448dcc47c58cb839cc97b7bfc941b784fc (diff)
swpagerelsize: add an eHeightPercentRelation member to SwFmtFrmSize
This is the doc model part, height. Change-Id: I99eb4cadc2bd5f2025bc1b8793d4eede5b106d72
-rw-r--r--sw/inc/fmtfsize.hxx3
-rw-r--r--sw/inc/unomid.h1
-rw-r--r--sw/source/core/layout/atrfrm.cxx16
3 files changed, 18 insertions, 2 deletions
diff --git a/sw/inc/fmtfsize.hxx b/sw/inc/fmtfsize.hxx
index 2b1622ea30fa..d9af054ca311 100644
--- a/sw/inc/fmtfsize.hxx
+++ b/sw/inc/fmtfsize.hxx
@@ -46,6 +46,7 @@ class SW_DLLPUBLIC SwFmtFrmSize: public SfxPoolItem
sal_uInt8 nWidthPercent;
sal_Int16 eWidthPercentRelation;
sal_uInt8 nHeightPercent;
+ sal_Int16 eHeightPercentRelation;
// For tables: width can be given in percent.
@@ -91,9 +92,11 @@ public:
void SetWidth ( const SwTwips nNew ) { aSize.Width() = nNew; }
sal_uInt8 GetHeightPercent() const{ return nHeightPercent; }
+ sal_Int16 GetHeightPercentRelation() const { return eHeightPercentRelation; }
sal_uInt8 GetWidthPercent() const { return nWidthPercent; }
sal_Int16 GetWidthPercentRelation() const { return eWidthPercentRelation; }
void SetHeightPercent( sal_uInt8 n ) { nHeightPercent = n; }
+ void SetHeightPercentRelation ( sal_Int16 n ) { eHeightPercentRelation = n; }
void SetWidthPercent ( sal_uInt8 n ) { nWidthPercent = n; }
void SetWidthPercentRelation ( sal_Int16 n ) { eWidthPercentRelation = n; }
};
diff --git a/sw/inc/unomid.h b/sw/inc/unomid.h
index 56956fb5ec3f..11d14c96664f 100644
--- a/sw/inc/unomid.h
+++ b/sw/inc/unomid.h
@@ -85,6 +85,7 @@
#define MID_FRMSIZE_IS_SYNC_HEIGHT_TO_WIDTH 13
#define MID_FRMSIZE_WIDTH_TYPE 14
#define MID_FRMSIZE_REL_WIDTH_RELATION 15
+#define MID_FRMSIZE_REL_HEIGHT_RELATION 16
#define MID_COLUMNS 0
#define MID_COLUMN_SEPARATOR_LINE 1
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 038a4a18459a..e8cbaadcd27d 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -176,7 +176,7 @@ SwFmtFrmSize::SwFmtFrmSize( SwFrmSize eSize, SwTwips nWidth, SwTwips nHeight )
eFrmHeightType( eSize ),
eFrmWidthType( ATT_FIX_SIZE )
{
- nWidthPercent = eWidthPercentRelation = nHeightPercent = 0;
+ nWidthPercent = eWidthPercentRelation = nHeightPercent = eHeightPercentRelation = 0;
}
SwFmtFrmSize& SwFmtFrmSize::operator=( const SwFmtFrmSize& rCpy )
@@ -185,6 +185,7 @@ SwFmtFrmSize& SwFmtFrmSize::operator=( const SwFmtFrmSize& rCpy )
eFrmHeightType = rCpy.GetHeightSizeType();
eFrmWidthType = rCpy.GetWidthSizeType();
nHeightPercent = rCpy.GetHeightPercent();
+ eHeightPercentRelation = rCpy.GetHeightPercentRelation();
nWidthPercent = rCpy.GetWidthPercent();
eWidthPercentRelation = rCpy.GetWidthPercentRelation();
return *this;
@@ -198,7 +199,8 @@ bool SwFmtFrmSize::operator==( const SfxPoolItem& rAttr ) const
aSize == ((SwFmtFrmSize&)rAttr).GetSize()&&
nWidthPercent == ((SwFmtFrmSize&)rAttr).GetWidthPercent() &&
eWidthPercentRelation == ((SwFmtFrmSize&)rAttr).GetWidthPercentRelation() &&
- nHeightPercent == ((SwFmtFrmSize&)rAttr).GetHeightPercent() );
+ nHeightPercent == ((SwFmtFrmSize&)rAttr).GetHeightPercent() &&
+ eHeightPercentRelation == ((SwFmtFrmSize&)rAttr).GetHeightPercentRelation() );
}
SfxPoolItem* SwFmtFrmSize::Clone( SfxItemPool* ) const
@@ -223,6 +225,9 @@ bool SwFmtFrmSize::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
case MID_FRMSIZE_REL_HEIGHT:
rVal <<= (sal_Int16)(GetHeightPercent() != 0xFF ? GetHeightPercent() : 0);
break;
+ case MID_FRMSIZE_REL_HEIGHT_RELATION:
+ rVal <<= GetHeightPercentRelation();
+ break;
case MID_FRMSIZE_REL_WIDTH:
rVal <<= (sal_Int16)(GetWidthPercent() != 0xFF ? GetWidthPercent() : 0);
break;
@@ -304,6 +309,13 @@ bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
bRet = false;
}
break;
+ case MID_FRMSIZE_REL_HEIGHT_RELATION:
+ {
+ sal_Int16 eSet = 0;
+ rVal >>= eSet;
+ SetHeightPercentRelation(eSet);
+ }
+ break;
case MID_FRMSIZE_REL_WIDTH:
{
sal_Int16 nSet = 0;