summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2009-02-06 14:32:50 +0000
committerKurt Zenker <kz@openoffice.org>2009-02-06 14:32:50 +0000
commit7bea4f052bdb2dd12baf7411a75b1de0d91afff9 (patch)
treee086dcaeb0bbb743552b4539378aabbd03db7aa8
parent0df4ab15c05ebcdc1d6277c8c7382c4edd8edc38 (diff)
CWS-TOOLING: integrate CWS sw31bf04_OOO310
2009-01-21 14:24:10 +0100 od r266670 : #i59051# correction of metric change for PolyPolygonBezier needed 2009-01-21 09:35:44 +0100 od r266632 : #i96062# adjustment of fix after rebasing 2009-01-21 09:34:56 +0100 od r266631 : #i94152# adjustment of fix after rebasing 2009-01-20 16:43:12 +0100 od r266596 : CWS-TOOLING: rebase CWS sw31bf04 to trunk@266428 (milestone: DEV300:m39) 2009-01-20 11:52:22 +0100 od r266561 : #i94152 method <SwDoc::SetOutlineNumRule(..)> - assure that at outline list style registered text node have the correct list level set 2009-01-20 10:43:53 +0100 od r266556 : #i93399# methods <SwNumRule::SetIndent(..)> and <SwNumRule::ChangeIndent(..)> - adjust also the list tab position, if a list tab stop is applied 2009-01-16 16:26:56 +0100 od r266432 : #i59051# adjust Writer's UNO-API for drawing objects - correct conversion of "StartPosition" and "EndPosition" - conversion of "PolyPolygonBezier" 2009-01-16 16:20:49 +0100 od r266430 : #i59051# - adjust UNO-API of connector shape -- convert "PolyPolygonBezier" to correct metric -- convert "StartPosition" and "EndPosition" in set-method before applying anchor position - adjust UNO-API of measure shape -- convert "StartPosition" and "EndPosition" to correct metric 2009-01-16 15:01:21 +0100 od r266419 : #i95698# method <SwFrm::GetPrevSctLeaf(..)> - only columns as previous section leaves for tables inside sections, which are inside another table. 2009-01-14 14:34:58 +0100 od r266304 : #i96092# method <HandleResetAttrAtTxtNode::~HandleResetAttrAtTxtNode()> - set list level to outline level, if needed. 2009-01-13 17:09:43 +0100 od r266238 : #i98037# method <SwWW8ImplReader::IsObjectLayoutInTableCell(..)> - adjust evaluation of WW8 attributes 2009-01-13 11:49:48 +0100 od r266203 : #i94187# method <SwTxtFormatter::NewTabPortion(..)> - correct consideration of compatibility option TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST 2009-01-13 11:48:45 +0100 od r266202 : #i94187# method <OutWW8_SwTxtNode(..)> - set list style directly at paragraph only in position and space mode LABEL_WIDTH_AND_POSITION 2009-01-12 12:22:58 +0100 od r266143 : #i70582# method <SwFlyAtCntFrm::SetAbsPos(..)> and local method <lcl_CalcDownDist(..)> - correct determination of anchor's frame top for object positioning.
-rw-r--r--svx/inc/svx/unoshape.hxx12
-rw-r--r--svx/source/unodraw/unoshape.cxx85
2 files changed, 93 insertions, 4 deletions
diff --git a/svx/inc/svx/unoshape.hxx b/svx/inc/svx/unoshape.hxx
index 22a3db74ec..9741878cb1 100644
--- a/svx/inc/svx/unoshape.hxx
+++ b/svx/inc/svx/unoshape.hxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -73,6 +73,12 @@ class SfxItemSet;
class SdrModel;
class SvxDrawPage;
class SvGlobalName;
+// --> OD 2009-01-16 #i59051#
+namespace basegfx
+ {
+ class B2DPolyPolygon;
+ } // end of namespace basegfx
+// <--
class SvxShapeMutex
{
@@ -132,6 +138,10 @@ protected:
// Umrechnungen fuer den Writer, der in TWIPS arbeitet
void ForceMetricToItemPoolMetric(Pair& rPoint) const throw();
void ForceMetricTo100th_mm(Pair& rPoint) const throw();
+ // --> OD 2009-01-16 #i59051#
+ void ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon) const throw();
+ void ForceMetricTo100th_mm(basegfx::B2DPolyPolygon& rPolyPolygon) const throw();
+ // <--
::com::sun::star::uno::Any GetAnyForItem( SfxItemSet& aSet, const SfxItemPropertyMap* pMap ) const;
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 55f01341d0..edf2f81559 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -551,6 +551,37 @@ void SvxShape::ForceMetricToItemPoolMetric(Pair& rPoint) const throw()
}
//----------------------------------------------------------------------
+// --> OD 2009-01-16 #i59051#
+void SvxShape::ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon) const throw()
+{
+ DBG_TESTSOLARMUTEX();
+ if(mpModel)
+ {
+ SfxMapUnit eMapUnit = mpModel->GetItemPool().GetMetric(0);
+ if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+ {
+ switch(eMapUnit)
+ {
+ case SFX_MAPUNIT_TWIP :
+ {
+ basegfx::B2DHomMatrix aTransform;
+ const double fMMToTWIPS(72.0 / 127.0);
+
+ aTransform.scale(fMMToTWIPS, fMMToTWIPS);
+ rPolyPolygon.transform(aTransform);
+ break;
+ }
+ default:
+ {
+ DBG_ERROR("Missing unit translation to PoolMetric!");
+ }
+ }
+ }
+ }
+}
+// <--
+
+//----------------------------------------------------------------------
void SvxShape::ForceMetricTo100th_mm(Pair& rPoint) const throw()
{
DBG_TESTSOLARMUTEX();
@@ -578,6 +609,37 @@ void SvxShape::ForceMetricTo100th_mm(Pair& rPoint) const throw()
}
//----------------------------------------------------------------------
+// --> OD 2009-01-16 #i59051#
+void SvxShape::ForceMetricTo100th_mm(basegfx::B2DPolyPolygon& rPolyPolygon) const throw()
+{
+ DBG_TESTSOLARMUTEX();
+ SfxMapUnit eMapUnit = SFX_MAPUNIT_100TH_MM;
+ if(mpModel)
+ {
+ eMapUnit = mpModel->GetItemPool().GetMetric(0);
+ if(eMapUnit != SFX_MAPUNIT_100TH_MM)
+ {
+ switch(eMapUnit)
+ {
+ case SFX_MAPUNIT_TWIP :
+ {
+ basegfx::B2DHomMatrix aTransform;
+ const double fTWIPSToMM(127.0 / 72.0);
+
+ aTransform.scale(fTWIPSToMM, fTWIPSToMM);
+ rPolyPolygon.transform(aTransform);
+ break;
+ }
+ default:
+ {
+ DBG_ERROR("Missing unit translation to 100th mm!");
+ }
+ }
+ }
+ }
+}
+// <--
+//----------------------------------------------------------------------
void SvxShape::ObtainSettingsFromPropertySet(SvxItemPropertySet& rPropSet) throw()
{
DBG_TESTSOLARMUTEX();
@@ -2420,10 +2482,15 @@ bool SvxShape::setPropertyValueImpl( const SfxItemPropertyMap* pProperty, const
if( rValue >>= aUnoPoint )
{
Point aPoint( aUnoPoint.X, aUnoPoint.Y );
+ // --> OD 2009-01-16 #i59051#
+ // perform metric change before applying anchor position,
+ // because the anchor position is in pool metric.
+ ForceMetricToItemPoolMetric( aPoint );
+ // <--
if( mpModel->IsWriter() )
aPoint += mpObj->GetAnchorPos();
- ForceMetricToItemPoolMetric( aPoint );
+// ForceMetricToItemPoolMetric( aPoint );
pEdgeObj->SetTailPoint( pProperty->nWID == OWN_ATTR_EDGE_START_POS, aPoint );
return true;
}
@@ -2447,6 +2514,9 @@ bool SvxShape::setPropertyValueImpl( const SfxItemPropertyMap* pProperty, const
if ( rValue >>= aPolyPoly )
{
basegfx::B2DPolyPolygon aNewPolyPolygon( SvxConvertPolyPolygonBezierToB2DPolyPolygon( &aPolyPoly ) );
+ // --> OD 2009-01-16 #i59051#
+ ForceMetricToItemPoolMetric( aNewPolyPolygon );
+ // <--
if( mpModel->IsWriter() )
{
Point aPoint( mpObj->GetAnchorPos() );
@@ -2471,6 +2541,9 @@ bool SvxShape::setPropertyValueImpl( const SfxItemPropertyMap* pProperty, const
if(pMeasureObj && ( rValue >>= aUnoPoint ) )
{
Point aPoint( aUnoPoint.X, aUnoPoint.Y );
+ // --> OD 2009-01-12 #i59051#
+ ForceMetricToItemPoolMetric( aPoint );
+ // <--
if( mpModel->IsWriter() )
aPoint += mpObj->GetAnchorPos();
@@ -2715,7 +2788,7 @@ bool SvxShape::getPropertyValueImpl( const SfxItemPropertyMap* pProperty, ::com:
basegfx::B2DPolyPolygon aNewPolyPolygon;
basegfx::B2DHomMatrix aNewHomogenMatrix;
mpObj->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
-
+
aVclPoint.X() -= basegfx::fround(aNewHomogenMatrix.get(0, 2));
aVclPoint.Y() -= basegfx::fround(aNewHomogenMatrix.get(1, 2));
@@ -2891,6 +2964,9 @@ bool SvxShape::getPropertyValueImpl( const SfxItemPropertyMap* pProperty, ::com:
aMatrix.translate( -aPoint.X(), -aPoint.Y() );
aPolyPoly.transform( aMatrix );
}
+ // --> OD 2009-01-16 #i59051#
+ ForceMetricTo100th_mm( aPolyPoly );
+ // <--
drawing::PolyPolygonBezierCoords aRetval;
SvxConvertB2DPolyPolygonToPolyPolygonBezier( aPolyPoly, aRetval);
rValue <<= aRetval;
@@ -2911,6 +2987,9 @@ bool SvxShape::getPropertyValueImpl( const SfxItemPropertyMap* pProperty, ::com:
if( mpModel->IsWriter() )
aPoint -= mpObj->GetAnchorPos();
+ // --> OD 2009-01-12 #i59051#
+ ForceMetricTo100th_mm( aPoint );
+ // <--
awt::Point aUnoPoint( aPoint.X(), aPoint.Y() );
rValue <<= aUnoPoint;