summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-02-03 17:30:25 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-02-03 19:52:44 +0100
commit1188866c1f0eb087a7e9b09bd9628f9c916feb68 (patch)
treee7cbe58b258d439bd74424bdc7b4610dec88bed8 /sw
parent9480887ee8524411b13e6942a549370939608338 (diff)
swpagerelsize ui: fix width percent value
Change-Id: I6f5b937826ac37f5f8bdee26e139fd6ca1e9a925
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/fesh.hxx3
-rw-r--r--sw/source/core/frmedt/fews.cxx12
-rw-r--r--sw/source/ui/frmdlg/frmmgr.cxx4
3 files changed, 15 insertions, 4 deletions
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 7877ac996622..57b58baef5ef 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -300,7 +300,8 @@ public:
const bool _bFollowTextFlow = false,
bool _bMirror = false,
Point* _opRef = NULL,
- Size* _opPercent = NULL ) const;
+ Size* _opPercent = NULL,
+ const SwFmtFrmSize* pFmtFrmSize = 0 ) const;
/// Set size of draw objects.
void SetObjRect( const SwRect& rRect );
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index a7f32a457f3a..5853f416fde1 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -36,6 +36,7 @@
#include <fmtpdsc.hxx>
#include <fmtsrnd.hxx>
#include <fmtcntnt.hxx>
+#include <fmtfsize.hxx>
#include <tabfrm.hxx>
#include <cellfrm.hxx>
#include <flyfrms.hxx>
@@ -709,7 +710,8 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
const bool _bFollowTextFlow,
bool _bMirror,
Point* _opRef,
- Size* _opPercent ) const
+ Size* _opPercent,
+ const SwFmtFrmSize* pFmtFrmSize) const
{
const SwFrm* pFrm;
const SwFlyFrm* pFly;
@@ -870,7 +872,13 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
pFrm : pFrm->GetUpper();
SWRECTFN( pUpper );
if ( _opPercent )
- *_opPercent = pUpper->Prt().SSize();
+ {
+ if (pFmtFrmSize && pFmtFrmSize->GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME)
+ // If the size is relative from page, then full size should be counted from the page frame.
+ *_opPercent = pPage->Frm().SSize();
+ else
+ *_opPercent = pUpper->Prt().SSize();
+ }
bRTL = pFrm->IsRightToLeft();
if ( bRTL )
diff --git a/sw/source/ui/frmdlg/frmmgr.cxx b/sw/source/ui/frmdlg/frmmgr.cxx
index 21ebf5502eb6..ab4085cd19bd 100644
--- a/sw/source/ui/frmdlg/frmmgr.cxx
+++ b/sw/source/ui/frmdlg/frmmgr.cxx
@@ -269,12 +269,14 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal,
// OD 18.09.2003 #i18732# - adjustment for allowing vertical position
// aligned to page for fly frame anchored to paragraph or to character.
const RndStdIds eAnchorType = static_cast<RndStdIds >(rVal.nAnchorType);
+ const SwFmtFrmSize& rSize = (const SwFmtFrmSize&)aSet.Get(RES_FRM_SIZE);
pOwnSh->CalcBoundRect( aBoundRect, eAnchorType,
rVal.nHRelOrient,
rVal.nVRelOrient,
pToCharCntntPos,
rVal.bFollowTextFlow,
- rVal.bMirror, NULL, &rVal.aPercentSize);
+ rVal.bMirror, NULL, &rVal.aPercentSize,
+ &rSize);
if (bOnlyPercentRefValue)
return;