Return-Path: X-Original-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3EB11D298 for ; Mon, 10 Sep 2012 08:14:40 +0000 (UTC) Received: (qmail 49671 invoked by uid 500); 10 Sep 2012 08:14:39 -0000 Delivered-To: apmail-incubator-ooo-commits-archive@incubator.apache.org Received: (qmail 49441 invoked by uid 500); 10 Sep 2012 08:14:37 -0000 Mailing-List: contact ooo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-commits@incubator.apache.org Received: (qmail 49415 invoked by uid 99); 10 Sep 2012 08:14:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Sep 2012 08:14:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Sep 2012 08:14:35 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 97C3623888FE; Mon, 10 Sep 2012 08:13:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1382685 - in /incubator/ooo/trunk/main/filter: inc/filter/msfilter/escherex.hxx source/msfilter/escherex.cxx Date: Mon, 10 Sep 2012 08:13:52 -0000 To: ooo-commits@incubator.apache.org From: lijiany@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120910081352.97C3623888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: lijiany Date: Mon Sep 10 08:13:52 2012 New Revision: 1382685 URL: http://svn.apache.org/viewvc?rev=1382685&view=rev Log: #119520# the right brace shape cannot display after save the sample .odt file to .doc file then reopen in aoo Reported by: louqle Patch by: Jianyuan Li Review by: sunying Modified: incubator/ooo/trunk/main/filter/inc/filter/msfilter/escherex.hxx incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx Modified: incubator/ooo/trunk/main/filter/inc/filter/msfilter/escherex.hxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/inc/filter/msfilter/escherex.hxx?rev=1382685&r1=1382684&r2=1382685&view=diff ============================================================================== --- incubator/ooo/trunk/main/filter/inc/filter/msfilter/escherex.hxx (original) +++ incubator/ooo/trunk/main/filter/inc/filter/msfilter/escherex.hxx Mon Sep 10 08:13:52 2012 @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include "filter/msfilter/msfilterdllapi.h" @@ -1240,6 +1241,8 @@ class MSFILTER_DLLPUBLIC EscherPropertyC // It activ only when at least a FillStyle or LineStyle is set. sal_Bool CreateShadowProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & ); + sal_Int32 GetValueForEnhancedCustomShapeParameter( const ::com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter, + const std::vector< sal_Int32 >& rEquationOrder, sal_Bool bAdjustTrans = sal_False ); // creates all necessary CustomShape properties, this includes also Text-, Shadow-, Fill-, and LineProperties void CreateCustomShapeProperties( const MSO_SPT eShapeType, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & ); sal_Bool IsFontWork() const; Modified: incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx?rev=1382685&r1=1382684&r2=1382685&view=diff ============================================================================== --- incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx (original) +++ incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx Mon Sep 10 08:13:52 2012 @@ -68,7 +68,6 @@ #include #include #include -#include #include #include #include @@ -2215,7 +2214,8 @@ sal_Bool EscherPropertyContainer::Create // --------------------------------------------------------------------------------------------- -sal_Int32 GetValueForEnhancedCustomShapeParameter( const com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter, const std::vector< sal_Int32 >& rEquationOrder ) +sal_Int32 EscherPropertyContainer::GetValueForEnhancedCustomShapeParameter( const ::com::sun::star::drawing::EnhancedCustomShapeParameter& rParameter, + const std::vector< sal_Int32 >& rEquationOrder, sal_Bool bAdjustTrans ) { sal_Int32 nValue = 0; if ( rParameter.Value.getValueTypeClass() == uno::TypeClass_DOUBLE ) @@ -2231,22 +2231,29 @@ sal_Int32 GetValueForEnhancedCustomShape { case com::sun::star::drawing::EnhancedCustomShapeParameterType::EQUATION : { - OSL_ASSERT(nValue < rEquationOrder.size()); - if ( nValue < rEquationOrder.size() ) + OSL_ASSERT((sal_uInt32)nValue < rEquationOrder.size()); + if ( (sal_uInt32)nValue < rEquationOrder.size() ) { nValue = (sal_uInt16)rEquationOrder[ nValue ]; nValue |= (sal_uInt32)0x80000000; } } break; - case com::sun::star::drawing::EnhancedCustomShapeParameterType::NORMAL : + case com::sun::star::drawing::EnhancedCustomShapeParameterType::ADJUSTMENT: { - + if(bAdjustTrans) + { + sal_uInt32 nAdjustValue = 0; + sal_Bool bGot = GetOpt((sal_uInt16)( DFF_Prop_adjustValue + nValue ), nAdjustValue); + if(bGot) nValue = (sal_Int32)nAdjustValue; + } } break; + case com::sun::star::drawing::EnhancedCustomShapeParameterType::NORMAL : + default: + break; /* not sure if it is allowed to set following values (but they are not yet used) - case com::sun::star::drawing::EnhancedCustomShapeParameterType::ADJUSTMENT : case com::sun::star::drawing::EnhancedCustomShapeParameterType::BOTTOM : case com::sun::star::drawing::EnhancedCustomShapeParameterType::RIGHT : case com::sun::star::drawing::EnhancedCustomShapeParameterType::TOP : @@ -2453,6 +2460,7 @@ void EscherPropertyContainer::CreateCust if ( aXPropSet.is() ) { SdrObjCustomShape* pCustoShape = (SdrObjCustomShape*)GetSdrObjectFromXShape( rXShape ); + if ( !pCustoShape ) return; const rtl::OUString sCustomShapeGeometry( RTL_CONSTASCII_USTRINGPARAM( "CustomShapeGeometry" ) ); uno::Any aGeoPropSet = aXPropSet->getPropertyValue( sCustomShapeGeometry ); uno::Sequence< beans::PropertyValue > aGeoPropSeq; @@ -2468,6 +2476,7 @@ void EscherPropertyContainer::CreateCust const rtl::OUString sAdjustmentValues ( RTL_CONSTASCII_USTRINGPARAM( "AdjustmentValues" ) ); const beans::PropertyValue* pAdjustmentValuesProp = NULL; + const beans::PropertyValue* pPathCoordinatesProp = NULL; sal_Int32 nAdjustmentsWhichNeedsToBeConverted = 0; uno::Sequence< beans::PropertyValues > aHandlesPropSeq; sal_Bool bPredefinedHandlesUsed = sal_True; @@ -2916,38 +2925,7 @@ void EscherPropertyContainer::CreateCust else if ( rrProp.Name.equals( sPathCoordinates ) ) { if ( !bIsDefaultObject ) - { - com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aCoordinates; - if ( rrProp.Value >>= aCoordinates ) - { - // creating the vertices - if ( (sal_uInt16)aCoordinates.getLength() ) - { - sal_uInt16 j, nElements = (sal_uInt16)aCoordinates.getLength(); - sal_uInt16 nElementSize = 8; - sal_uInt32 nStreamSize = nElementSize * nElements + 6; - SvMemoryStream aOut( nStreamSize ); - aOut << nElements - << nElements - << nElementSize; - for( j = 0; j < nElements; j++ ) - { - sal_Int32 X = GetValueForEnhancedCustomShapeParameter( aCoordinates[ j ].First, aEquationOrder ); - sal_Int32 Y = GetValueForEnhancedCustomShapeParameter( aCoordinates[ j ].Second, aEquationOrder ); - aOut << X - << Y; - } - sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ]; - memcpy( pBuf, aOut.GetData(), nStreamSize ); - AddOpt( DFF_Prop_pVertices, sal_True, nStreamSize - 6, pBuf, nStreamSize ); // -6 - } - else - { - sal_uInt8* pBuf = new sal_uInt8[ 1 ]; - AddOpt( DFF_Prop_pVertices, sal_True, 0, pBuf, 0 ); - } - } - } + pPathCoordinatesProp = &rrProp; } else if ( rrProp.Name.equals( sPathGluePoints ) ) { @@ -3592,6 +3570,39 @@ void EscherPropertyContainer::CreateCust AddOpt( (sal_uInt16)( DFF_Prop_adjustValue + k ), (sal_uInt32)nValue ); } } + if( pPathCoordinatesProp ) + { + com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeParameterPair > aCoordinates; + if ( pPathCoordinatesProp->Value >>= aCoordinates ) + { + // creating the vertices + if ( (sal_uInt16)aCoordinates.getLength() ) + { + sal_uInt16 j, nElements = (sal_uInt16)aCoordinates.getLength(); + sal_uInt16 nElementSize = 8; + sal_uInt32 nStreamSize = nElementSize * nElements + 6; + SvMemoryStream aOut( nStreamSize ); + aOut << nElements + << nElements + << nElementSize; + for( j = 0; j < nElements; j++ ) + { + sal_Int32 X = GetValueForEnhancedCustomShapeParameter( aCoordinates[ j ].First, aEquationOrder, sal_True ); + sal_Int32 Y = GetValueForEnhancedCustomShapeParameter( aCoordinates[ j ].Second, aEquationOrder, sal_True ); + aOut << X + << Y; + } + sal_uInt8* pBuf = new sal_uInt8[ nStreamSize ]; + memcpy( pBuf, aOut.GetData(), nStreamSize ); + AddOpt( DFF_Prop_pVertices, sal_True, nStreamSize - 6, pBuf, nStreamSize ); // -6 + } + else + { + sal_uInt8* pBuf = new sal_uInt8[ 1 ]; + AddOpt( DFF_Prop_pVertices, sal_True, 0, pBuf, 0 ); + } + } + } } } }