summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2004-12-23 09:10:53 +0000
committerVladimir Glazounov <vg@openoffice.org>2004-12-23 09:10:53 +0000
commit239be0a5770951d57754214d23f45a123112dd38 (patch)
treead0156dd6a77925193b0b04ffa49aa0a277bfa57 /sw/source
parentcc592ebea31f2d24e9254fe843595e0529875302 (diff)
INTEGRATION: CWS swqbugfixes10 (1.60.4); FILE MERGED
2004/12/07 09:24:30 od 1.60.4.2: RESYNC: (1.60-1.61); FILE MERGED 2004/11/29 14:24:08 od 1.60.4.1: #i35007# - no adjustment of position attributes on set of transformation. - correct handling of position of as-character anchored objects.
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/unocore/unodraw.cxx70
1 files changed, 52 insertions, 18 deletions
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index aafaf295c194..6c0fc23cddd2 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unodraw.cxx,v $
*
- * $Revision: 1.61 $
+ * $Revision: 1.62 $
*
- * last change: $Author: rt $ $Date: 2004-11-26 13:26:51 $
+ * last change: $Author: vg $ $Date: 2004-12-23 10:10:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -59,7 +59,6 @@
*
************************************************************************/
-
#pragma hdrstop
#include <swtypes.hxx>
@@ -187,6 +186,11 @@
#ifndef _FMTWRAPINFLUENCEONOBJPOS_HXX
#include <fmtwrapinfluenceonobjpos.hxx>
#endif
+// --> OD 2004-11-10 #i35007#
+#ifndef _COM_SUN_STAR_TEXT_TEXTCONTENTANCHORTYPE_HPP
+#include <com/sun/star/text/TextContentAnchorType.hpp>
+#endif
+// <--
using namespace ::com::sun::star;
@@ -1367,23 +1371,28 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
}
else
xPrSet->setPropertyValue(rPropertyName, aValue);
- // --> OD 2004-07-28 #i31698# - additionally adjust the position
- // properties of the shape, if the transformation is set and
- // the shape isn't a group member.
- if ( rPropertyName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation"))) &&
- !_GetTopGroupObj() )
- {
- drawing::HomogenMatrix3 aMatrix;
- aValue >>= aMatrix;
- awt::Point aNewPos( basegfx::fround( aMatrix.Line1.Column3 ),
- basegfx::fround( aMatrix.Line2.Column3 ) );
- _AdjustPositionProperties( aNewPos );
- }
- // <--
+ // --> OD 2004-11-11 #i35007# - adjustment of the position
+ // attributes, if the transformation is set, causes wrong alignments
+ // and is no longer needed.
+ // The position attributes are set, if the drawing object is added
+ // to the draw page - see <SwXDrawPage::add(..)> - and on its first
+ // positioning - see <SwAnchoredDrawObject::MakeObjPos().
+// // --> OD 2004-07-28 #i31698# - additionally adjust the position
+// // properties of the shape, if the transformation is set and
+// // the shape isn't a group member.
+// if ( rPropertyName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation"))) &&
+// !_GetTopGroupObj() )
+// {
+// drawing::HomogenMatrix3 aMatrix;
+// aValue >>= aMatrix;
+// awt::Point aNewPos( basegfx::fround( aMatrix.Line1.Column3 ),
+// basegfx::fround( aMatrix.Line2.Column3 ) );
+// _AdjustPositionProperties( aNewPos );
+// }
// --> OD 2004-08-05 #i31698# - restore object position, if caption
// point is set.
- else if ( rPropertyName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CaptionPoint"))) &&
- getShapeType().equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CaptionShape"))) )
+ if ( rPropertyName.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CaptionPoint"))) &&
+ getShapeType().equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CaptionShape"))) )
{
setPosition( aKeepedPosition );
}
@@ -2350,6 +2359,20 @@ awt::Point SwXShape::_GetAttrPosition()
}
}
// <--
+ // --> OD 2004-11-10 #i35007# - If drawing object is anchored as-character,
+ // it's x-position isn't sensible. Thus, return the x-position as zero in this case.
+ text::TextContentAnchorType eAnchorType =
+ text::TextContentAnchorType_AT_PARAGRAPH;
+ {
+ rtl::OUString sAnchorType( RTL_CONSTASCII_USTRINGPARAM( "AnchorType" ) );
+ uno::Any aAny = getPropertyValue( sAnchorType );
+ aAny >>= eAnchorType;
+ }
+ if ( eAnchorType == text::TextContentAnchorType_AS_CHARACTER )
+ {
+ aAttrPos.X = 0;
+ }
+ // <--
return aAttrPos;
}
@@ -2474,6 +2497,17 @@ drawing::HomogenMatrix3 SwXShape::_ConvertTransformationToLayoutDir(
void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition )
{
// handle x-position
+ // --> OD 2004-11-10 #i35007# - no handling of x-position, if drawing
+ // object is anchored as-character, because it doesn't make sense.
+ text::TextContentAnchorType eAnchorType =
+ text::TextContentAnchorType_AT_PARAGRAPH;
+ {
+ rtl::OUString sAnchorType( RTL_CONSTASCII_USTRINGPARAM( "AnchorType" ) );
+ uno::Any aAny = getPropertyValue( sAnchorType );
+ aAny >>= eAnchorType;
+ }
+ if ( eAnchorType != text::TextContentAnchorType_AS_CHARACTER )
+ // <--
{
// determine current x-postion
rtl::OUString aHoriPosPropStr( RTL_CONSTASCII_USTRINGPARAM("HoriOrientPosition") );