diff options
Diffstat (limited to 'xmloff/source/draw/ximpcustomshape.cxx')
-rw-r--r-- | xmloff/source/draw/ximpcustomshape.cxx | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index c0808153cc47..c593cab5cafa 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,7 +57,7 @@ #include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp> #include <com/sun/star/drawing/ProjectionMode.hpp> -#include <hash_map> +#include <boost/unordered_map.hpp> using namespace ::com::sun::star; using namespace ::xmloff::token; @@ -86,7 +87,7 @@ const SvXMLEnumMapEntry aXML_GluePointEnumMap[] = void GetBool( std::vector< com::sun::star::beans::PropertyValue >& rDest, const rtl::OUString& rValue, const EnhancedCustomShapeTokenEnum eDestProp ) { - sal_Bool bAttrBool; + bool bAttrBool; if ( SvXMLUnitConverter::convertBool( bAttrBool, rValue ) ) { beans::PropertyValue aProp; @@ -316,10 +317,10 @@ sal_Bool GetNextParameter( com::sun::star::drawing::EnhancedCustomShapeParameter if ( bNumberRequired ) { sal_Int32 nStartIndex = nIndex; + sal_Int32 nEIndex = 0; // index of "E" in double - sal_Bool bM = sal_False; // set if the value is negative sal_Bool bE = sal_False; // set if a double is including a "E" statement - sal_Bool bEM = sal_False; // set if a double is including a "E-"statement + sal_Bool bENum = sal_False; // there is at least one number after "E" sal_Bool bDot = sal_False; // set if there is a dot included sal_Bool bEnd = sal_False; // set for each value that can not be part of a double/integer @@ -347,11 +348,16 @@ sal_Bool GetNextParameter( com::sun::star::drawing::EnhancedCustomShapeParameter else { if ( nStartIndex == nIndex ) - bM = sal_True; + bValid = sal_True; else if ( bE ) - bEM = sal_True; - else - bValid = sal_False; + { + if ( nEIndex + 1 == nIndex ) + bValid = sal_True; + else if ( bENum ) + bEnd = sal_True; + else + bValid = sal_False; + } } } break; @@ -364,7 +370,10 @@ sal_Bool GetNextParameter( com::sun::star::drawing::EnhancedCustomShapeParameter else { if ( !bE ) + { bE = sal_True; + nEIndex = nIndex; + } else bEnd = sal_True; } @@ -380,6 +389,10 @@ sal_Bool GetNextParameter( com::sun::star::drawing::EnhancedCustomShapeParameter case '7' : case '8' : case '9' : + { + if ( bE && ! bENum ) + bENum = sal_True; + } break; default: bEnd = sal_True; @@ -882,7 +895,7 @@ void XMLEnhancedCustomShapeContext::StartElement( const uno::Reference< xml::sax double fFactor = SvXMLExportHelper::GetConversionFactor( aUnitStr, MAP_100TH_MM, eSrcUnit ); if ( ( fFactor != 1.0 ) && ( fFactor != 0.0 ) ) { - double fDepth; + double fDepth(0.0); if ( rDepth.Value >>= fDepth ) { fDepth /= fFactor; @@ -1132,7 +1145,7 @@ void SdXMLCustomShapePropertyMerge( std::vector< com::sun::star::beans::Property } } -typedef std::hash_map< rtl::OUString, sal_Int32, rtl::OUStringHash, OUStringEqFunc> EquationHashMap; +typedef boost::unordered_map< rtl::OUString, sal_Int32, rtl::OUStringHash, OUStringEqFunc> EquationHashMap; /* if rPara.Type is from type EnhancedCustomShapeParameterType::EQUATION, the name of the equation will be converted from rtl::OUString to index */ @@ -1164,7 +1177,7 @@ void XMLEnhancedCustomShapeContext::EndElement() while( aEquationNameIter != aEquationNameEnd ) { (*pH)[ *aEquationNameIter ] = (sal_Int32)( aEquationNameIter - maEquationNames.begin() ); - aEquationNameIter++; + ++aEquationNameIter; } // resolve equation @@ -1195,7 +1208,7 @@ void XMLEnhancedCustomShapeContext::EndElement() } } while( nIndexOf != -1 ); - aEquationIter++; + ++aEquationIter; } // Path @@ -1236,7 +1249,7 @@ void XMLEnhancedCustomShapeContext::EndElement() default: break; } - aPathIter++; + ++aPathIter; } std::vector< beans::PropertyValues >::iterator aHandleIter = maHandles.begin(); std::vector< beans::PropertyValues >::iterator aHandleEnd = maHandles.end(); @@ -1273,7 +1286,7 @@ void XMLEnhancedCustomShapeContext::EndElement() } pValues++; } - aHandleIter++; + ++aHandleIter; } delete pH; } @@ -1382,3 +1395,5 @@ SvXMLImportContext* XMLEnhancedCustomShapeContext::CreateChildContext( sal_uInt1 } return SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |