customshapeproperties.cxx (ca5ec200) customshapeproperties.cxx (d742e3ec)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 31 unchanged lines hidden (view full) ---

40using namespace ::com::sun::star::graphic;
41using namespace ::com::sun::star::drawing;
42
43namespace oox { namespace drawingml {
44
45CustomShapeProperties::CustomShapeProperties()
46: mbMirroredX ( sal_False )
47, mbMirroredY ( sal_False )
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 31 unchanged lines hidden (view full) ---

40using namespace ::com::sun::star::graphic;
41using namespace ::com::sun::star::drawing;
42
43namespace oox { namespace drawingml {
44
45CustomShapeProperties::CustomShapeProperties()
46: mbMirroredX ( sal_False )
47, mbMirroredY ( sal_False )
48, mnTextRotation(0) // #119920# Add missing extra text rotation
48{
49}
50CustomShapeProperties::~CustomShapeProperties()
51{
52}
53
54sal_Int32 CustomShapeProperties::SetCustomShapeGuideValue( std::vector< CustomShapeGuide >& rGuideList, const CustomShapeGuide& rGuide )
55{

--- 33 unchanged lines hidden (view full) ---

89{
90 if ( maShapePresetType.getLength() )
91 {
92 //const uno::Reference < drawing::XShape > xShape( xPropSet, UNO_QUERY );
93 Reference< drawing::XEnhancedCustomShapeDefaulter > xDefaulter( xShape, UNO_QUERY );
94 if( xDefaulter.is() )
95 xDefaulter->createCustomShapeDefaults( maShapePresetType );
96
49{
50}
51CustomShapeProperties::~CustomShapeProperties()
52{
53}
54
55sal_Int32 CustomShapeProperties::SetCustomShapeGuideValue( std::vector< CustomShapeGuide >& rGuideList, const CustomShapeGuide& rGuide )
56{

--- 33 unchanged lines hidden (view full) ---

90{
91 if ( maShapePresetType.getLength() )
92 {
93 //const uno::Reference < drawing::XShape > xShape( xPropSet, UNO_QUERY );
94 Reference< drawing::XEnhancedCustomShapeDefaulter > xDefaulter( xShape, UNO_QUERY );
95 if( xDefaulter.is() )
96 xDefaulter->createCustomShapeDefaults( maShapePresetType );
97
97 if ( maAdjustmentGuideList.size() )
98 PropertyMap aPropertyMap;
99
100 aPropertyMap[ PROP_MirroredX ] <<= Any( mbMirroredX );
101 aPropertyMap[ PROP_MirroredY ] <<= Any( mbMirroredY );
102
103 if(mnTextRotation)
104 {
105 // #119920# Handle missing text rotation
106 aPropertyMap[ PROP_TextRotateAngle ] <<= Any(mnTextRotation);
107 }
108
109 // converting the vector to a sequence
110 Sequence< PropertyValue > aSeq = aPropertyMap.makePropertyValueSequence();
111 PropertySet aPropSet( xPropSet );
112 aPropSet.setProperty( PROP_CustomShapeGeometry, aSeq );
113
114 if ( maAdjustmentGuideList.size() )
98 {
99 const OUString sType = CREATE_OUSTRING( "Type" );
100 const OUString sCustomShapeGeometry( RTL_CONSTASCII_USTRINGPARAM( "CustomShapeGeometry" ) );
101 uno::Any aGeoPropSet = xPropSet->getPropertyValue( sCustomShapeGeometry );
102 uno::Sequence< beans::PropertyValue > aGeoPropSeq;
103 if ( aGeoPropSet >>= aGeoPropSeq )
104 {
105 sal_Int32 i, nCount = aGeoPropSeq.getLength();

--- 35 unchanged lines hidden (view full) ---

141 }
142 else
143 {
144 sal_uInt32 i;
145 PropertyMap aPropertyMap;
146 aPropertyMap[ PROP_Type ] <<= CREATE_OUSTRING( "non-primitive" );
147 aPropertyMap[ PROP_MirroredX ] <<= Any( mbMirroredX );
148 aPropertyMap[ PROP_MirroredY ] <<= Any( mbMirroredY );
115 {
116 const OUString sType = CREATE_OUSTRING( "Type" );
117 const OUString sCustomShapeGeometry( RTL_CONSTASCII_USTRINGPARAM( "CustomShapeGeometry" ) );
118 uno::Any aGeoPropSet = xPropSet->getPropertyValue( sCustomShapeGeometry );
119 uno::Sequence< beans::PropertyValue > aGeoPropSeq;
120 if ( aGeoPropSet >>= aGeoPropSeq )
121 {
122 sal_Int32 i, nCount = aGeoPropSeq.getLength();

--- 35 unchanged lines hidden (view full) ---

158 }
159 else
160 {
161 sal_uInt32 i;
162 PropertyMap aPropertyMap;
163 aPropertyMap[ PROP_Type ] <<= CREATE_OUSTRING( "non-primitive" );
164 aPropertyMap[ PROP_MirroredX ] <<= Any( mbMirroredX );
165 aPropertyMap[ PROP_MirroredY ] <<= Any( mbMirroredY );
166
167 if(mnTextRotation)
168 {
169 aPropertyMap[ PROP_TextRotation ] <<= Any(mnTextRotation);
170 }
171
149 awt::Size aSize( xShape->getSize() );
150 awt::Rectangle aViewBox( 0, 0, aSize.Width * 360, aSize.Height * 360 );
151 if ( maPath2DList.size() )
152 { // TODO: each polygon may have its own size, but I think it is rather been used
153 // so we are only taking care of the first
154 if ( maPath2DList[ 0 ].w )
155 aViewBox.Width = static_cast< sal_Int32 >( maPath2DList[ 0 ].w );
156 if ( maPath2DList[ 0 ].h )

--- 108 unchanged lines hidden ---
172 awt::Size aSize( xShape->getSize() );
173 awt::Rectangle aViewBox( 0, 0, aSize.Width * 360, aSize.Height * 360 );
174 if ( maPath2DList.size() )
175 { // TODO: each polygon may have its own size, but I think it is rather been used
176 // so we are only taking care of the first
177 if ( maPath2DList[ 0 ].w )
178 aViewBox.Width = static_cast< sal_Int32 >( maPath2DList[ 0 ].w );
179 if ( maPath2DList[ 0 ].h )

--- 108 unchanged lines hidden ---