summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-09-26 13:10:31 +0200
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-09-27 09:23:20 +0200
commitd4474dd0411d7de29ce42e181c97cbf032bf57ea (patch)
tree2c2751e078cf04da2991437d12e3ae8f09652f28 /svx/source/svdraw
parent0f581ab761cefde208e576661850b57f2846fdb4 (diff)
sw: implement page-relative size for drawing objects and import them from docx
Change-Id: I98b5c53d4860278e3646324ca045114e37b4cf61
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/svdoashp.cxx4
-rw-r--r--svx/source/svdraw/svdobj.cxx7
-rw-r--r--svx/source/svdraw/svdogrp.cxx6
-rw-r--r--svx/source/svdraw/svdovirt.cxx4
4 files changed, 13 insertions, 8 deletions
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index dab7b9feaf62..4236d4bab00d 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -1534,9 +1534,9 @@ void SdrObjCustomShape::NbcMove( const Size& rSiz )
mpLastShadowGeometry->NbcMove( rSiz );
}
}
-void SdrObjCustomShape::Resize( const Point& rRef, const Fraction& xFact, const Fraction& yFact )
+void SdrObjCustomShape::Resize( const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative )
{
- SdrTextObj::Resize( rRef, xFact, yFact );
+ SdrTextObj::Resize( rRef, xFact, yFact, bUnsetRelative );
}
void SdrObjCustomShape::NbcResize( const Point& rRef, const Fraction& rxFact, const Fraction& ryFact )
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 9cc99b17bbed..d0206fd9933a 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1556,9 +1556,14 @@ void SdrObject::Move(const Size& rSiz)
}
}
-void SdrObject::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
+void SdrObject::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative)
{
if (xFact.GetNumerator()!=xFact.GetDenominator() || yFact.GetNumerator()!=yFact.GetDenominator()) {
+ if (bUnsetRelative)
+ {
+ mnRelativeWidth.reset( );
+ mnRelativeHeight.reset( );
+ }
Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
NbcResize(rRef,xFact,yFact);
SetChanged();
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index bf8552521be6..6bf8ba187a5d 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -584,7 +584,7 @@ void SdrObjGroup::Move(const Size& rSiz)
}
-void SdrObjGroup::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
+void SdrObjGroup::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative)
{
if (xFact.GetNumerator()!=xFact.GetDenominator() || yFact.GetNumerator()!=yFact.GetDenominator()) {
bool bXMirr=(xFact.GetNumerator()<0) != (xFact.GetDenominator()<0);
@@ -611,11 +611,11 @@ void SdrObjGroup::Resize(const Point& rRef, const Fraction& xFact, const Fractio
sal_uIntPtr i;
for (i=0; i<nObjAnz; i++) {
SdrObject* pObj=pOL->GetObj(i);
- if (pObj->IsEdgeObj()) pObj->Resize(rRef,xFact,yFact);
+ if (pObj->IsEdgeObj()) pObj->Resize(rRef,xFact,yFact,bUnsetRelative);
}
for (i=0; i<nObjAnz; i++) {
SdrObject* pObj=pOL->GetObj(i);
- if (!pObj->IsEdgeObj()) pObj->Resize(rRef,xFact,yFact);
+ if (!pObj->IsEdgeObj()) pObj->Resize(rRef,xFact,yFact,bUnsetRelative);
}
} else {
ResizeRect(aOutRect,rRef,xFact,yFact);
diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx
index 3534ff43eb7d..0452a168423c 100644
--- a/svx/source/svdraw/svdovirt.cxx
+++ b/svx/source/svdraw/svdovirt.cxx
@@ -412,11 +412,11 @@ void SdrVirtObj::Move(const Size& rSiz)
}
}
-void SdrVirtObj::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
+void SdrVirtObj::Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative)
{
if (xFact.GetNumerator()!=xFact.GetDenominator() || yFact.GetNumerator()!=yFact.GetDenominator()) {
Rectangle aBoundRect0; if (pUserCall!=NULL) aBoundRect0=GetLastBoundRect();
- rRefObj.Resize(rRef-aAnchor,xFact,yFact);
+ rRefObj.Resize(rRef-aAnchor,xFact,yFact, bUnsetRelative);
SetRectsDirty();
SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0);
}