diff options
27 files changed, 147 insertions, 164 deletions
diff --git a/oox/inc/oox/export/utils.hxx b/oox/inc/oox/export/utils.hxx index 3bfa99310280..d24a13787437 100644 --- a/oox/inc/oox/export/utils.hxx +++ b/oox/inc/oox/export/utils.hxx @@ -49,14 +49,14 @@ // --------------------------------------------------------------------------------------------- -static inline sal_Int64 PPTtoEMU( INT32 nPPT ) +static inline sal_Int64 PPTtoEMU( sal_Int32 nPPT ) { return (sal_Int64)( (double)nPPT * 1587.5 ); } // --------------------------------------------------------------------------------------------- -static inline sal_Int64 MM100toEMU( INT32 nMM100 ) +static inline sal_Int64 MM100toEMU( sal_Int32 nMM100 ) { return (sal_Int64)nMM100 * 360; } diff --git a/oox/inc/oox/export/vmlexport.hxx b/oox/inc/oox/export/vmlexport.hxx index a5875826f597..f62ba1008ccf 100644 --- a/oox/inc/oox/export/vmlexport.hxx +++ b/oox/inc/oox/export/vmlexport.hxx @@ -92,13 +92,13 @@ protected: private: - virtual void OpenContainer( UINT16 nEscherContainer, int nRecInstance = 0 ); + virtual void OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance = 0 ); virtual void CloseContainer(); - virtual UINT32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 ); + virtual sal_uInt32 EnterGroup( const String& rShapeName, const Rectangle* pBoundRect = 0 ); virtual void LeaveGroup(); - virtual void AddShape( UINT32 nShapeType, UINT32 nShapeFlags, UINT32 nShapeId = 0 ); + virtual void AddShape( sal_uInt32 nShapeType, sal_uInt32 nShapeFlags, sal_uInt32 nShapeId = 0 ); private: /// Create an OString representing the id from a numerical id. diff --git a/oox/inc/oox/helper/containerhelper.hxx b/oox/inc/oox/helper/containerhelper.hxx index e2577313a11e..d7402905c92e 100644 --- a/oox/inc/oox/helper/containerhelper.hxx +++ b/oox/inc/oox/helper/containerhelper.hxx @@ -46,22 +46,6 @@ namespace com { namespace sun { namespace star { namespace oox { -// ============================================================================ - - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3, typename ParamType4 > - inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3, ParamType4 aParam4 ) const - { - forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3, aParam4 ) ); - } - /** Calls the passed member function of ObjType on every contained object, - automatically skips all elements that are empty references. */ - template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3, typename ParamType4 > - inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3, ParamType4 aParam4 ) const - { - forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3, aParam4 ) ); - } /** Template for a 2-dimensional array of objects. This class template provides a similar interface to the ::std::vector @@ -413,4 +397,4 @@ template< typename MatrixType > #endif -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/inc/oox/helper/refmap.hxx b/oox/inc/oox/helper/refmap.hxx index e833e1196c81..48e04efba61f 100755 --- a/oox/inc/oox/helper/refmap.hxx +++ b/oox/inc/oox/helper/refmap.hxx @@ -110,6 +110,16 @@ public: { forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3 ) ); } + + /** Calls the passed member function of ObjType on every contained object, + automatically skips all elements that are empty references. */ + template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3, typename ParamType4 > + inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3, ParamType4 aParam4 ) const + { + forEach( ::boost::bind( pFunc, _1, aParam1, aParam2, aParam3, aParam4 ) ); + } + + /** Calls the passed functor for every contained object. Passes the key as first argument and the object reference as second argument to rFunctor. */ template< typename FunctorType > diff --git a/oox/inc/oox/ole/vbacontrol.hxx b/oox/inc/oox/ole/vbacontrol.hxx index 11b2a0f78779..3c862a9b2046 100644 --- a/oox/inc/oox/ole/vbacontrol.hxx +++ b/oox/inc/oox/ole/vbacontrol.hxx @@ -197,11 +197,11 @@ public: /** Imports the form and its embedded controls, and inserts the form with all its controls into the passed dialog library. */ void importForm( - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel, - const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxDialogLib, - StorageBase& rVbaFormStrg, - const ::rtl::OUString& rModuleName, - rtl_TextEncoding eTextEnc ); + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel, + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxDialogLib, + StorageBase& rVbaFormStrg, + const ::rtl::OUString& rModuleName, + rtl_TextEncoding eTextEnc ); private: ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxCompContext; diff --git a/oox/inc/oox/ole/vbaproject.hxx b/oox/inc/oox/ole/vbaproject.hxx index 94af918b71e2..2d1b4fd60cf8 100644 --- a/oox/inc/oox/ole/vbaproject.hxx +++ b/oox/inc/oox/ole/vbaproject.hxx @@ -203,7 +203,6 @@ private: ::rtl::OUString maPrjName; /// Name of the VBA project. ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxOleOverridesSink; - ::rtl::OUString maPrjName; /// Name of the VBA project. }; // ============================================================================ diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx index a995dd506f4f..f328961df70d 100644 --- a/oox/source/core/contexthandler2.cxx +++ b/oox/source/core/contexthandler2.cxx @@ -112,7 +112,7 @@ void ContextHandler2Helper::implCharacters( const OUString& rChars ) { // #i76091# collect characters until new element starts or this element ends if( !mxContextStack->empty() ) - mxContextStack->back().maChars += rChars; + mxContextStack->back().maChars.append(rChars); } void ContextHandler2Helper::implEndElement( sal_Int32 nElement ) @@ -152,9 +152,10 @@ void ContextHandler2Helper::implEndRecord( sal_Int32 nRecId ) ElementInfo& ContextHandler2Helper::pushElementInfo( sal_Int32 nElement ) { - ContextInfo aInfo( nElement ); + mxContextStack->resize( mxContextStack->size() + 1 ); ElementInfo& rInfo = mxContextStack->back(); - return mxContextStack->back(); + rInfo.mnElement = nElement; + return rInfo; } void ContextHandler2Helper::popElementInfo() @@ -268,4 +269,4 @@ void ContextHandler2::onEndRecord() } // namespace core } // namespace oox -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx index 70d8f46fe2a8..a87d1eca8d3d 100644 --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -583,7 +583,7 @@ void FilterBase::setMediaDescriptor( const Sequence< PropertyValue >& rMediaDesc OUString sFilterName = mxImpl->maMediaDesc.getUnpackedValueOrDefault( CREATE_OUSTRING( "FilterName" ), OUString() ); try { - Reference< XNameAccess > xFilters( getGlobalFactory()->createInstance( + Reference< XNameAccess > xFilters( getServiceFactory()->createInstance( CREATE_OUSTRING( "com.sun.star.document.FilterFactory" ) ), UNO_QUERY_THROW ); Any aValues = xFilters->getByName( sFilterName ); Sequence<PropertyValue > aPropSeq; diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 0eb1eb898ad3..281320303d5f 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -46,6 +46,18 @@ #include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" #include "oox/helper/zipstorage.hxx" +#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> +#include <com/sun/star/document/XOOXMLDocumentPropertiesImporter.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <comphelper/processfactory.hxx> +#include <comphelper/mediadescriptor.hxx> +#include <oox/core/filterdetect.hxx> +#include <comphelper/storagehelper.hxx> +using ::com::sun::star::uno::XComponentContext; +using ::com::sun::star::document::XOOXMLDocumentPropertiesImporter; +using ::com::sun::star::document::XDocumentPropertiesSupplier; +using ::com::sun::star::beans::XPropertySet; +using ::com::sun::star::lang::XComponent; namespace oox { namespace core { @@ -69,19 +81,7 @@ using ::rtl::OUStringBuffer; using ::sax_fastparser::FSHelperPtr; using ::sax_fastparser::FastSerializerHelper; -#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> -#include <com/sun/star/document/XOOXMLDocumentPropertiesImporter.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <comphelper/processfactory.hxx> -#include <comphelper/mediadescriptor.hxx> -#include <oox/core/filterdetect.hxx> -#include <comphelper/storagehelper.hxx> -using ::com::sun::star::uno::XComponentContext; -using ::com::sun::star::document::XOOXMLDocumentPropertiesImporter; -using ::com::sun::star::document::XDocumentPropertiesSupplier; -using ::com::sun::star::beans::XPropertySet; -using ::com::sun::star::lang::XComponent; @@ -119,22 +119,6 @@ XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference< XComponentContext >& rxCo maBinSuffix( CREATE_OUSTRING( ".bin" ) ), maVmlSuffix( CREATE_OUSTRING( ".vml" ) ) { -static Reference< XComponentContext > lcl_getComponentContext(Reference< XMultiServiceFactory > aFactory) -{ - Reference< XComponentContext > xContext; - try - { - Reference< XPropertySet > xFactProp( aFactory, UNO_QUERY ); - if( xFactProp.is() ) - xFactProp->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext; - } - catch( Exception& ) - {} - - return xContext; -} - -// ============================================================================ // register XML namespaces maFastParser.registerNamespace( NMSP_xml ); maFastParser.registerNamespace( NMSP_packageRel ); @@ -159,6 +143,24 @@ static Reference< XComponentContext > lcl_getComponentContext(Reference< XMultiS maFastParser.registerNamespace( NMSP_xm ); } + +static Reference< XComponentContext > lcl_getComponentContext(Reference< XMultiServiceFactory > aFactory) +{ + Reference< XComponentContext > xContext; + try + { + Reference< XPropertySet > xFactProp( aFactory, UNO_QUERY ); + if( xFactProp.is() ) + xFactProp->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext; + } + catch( Exception& ) + {} + + return xContext; +} + +// ============================================================================ + // ============================================================================ XmlFilterBase::XmlFilterBase( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : @@ -177,13 +179,13 @@ XmlFilterBase::~XmlFilterBase() void XmlFilterBase::importDocumentProperties() throw() { - Reference< XMultiServiceFactory > xFactory( getGlobalFactory(), UNO_QUERY ); + Reference< XMultiServiceFactory > xFactory( getServiceFactory(), UNO_QUERY ); MediaDescriptor aMediaDesc( getMediaDescriptor() ); Reference< XInputStream > xInputStream; - ::oox::core::FilterDetect aDetector( xFactory ); + Reference< XComponentContext > xContext = lcl_getComponentContext(getServiceFactory()); + ::oox::core::FilterDetect aDetector( xContext ); xInputStream = aDetector.extractUnencryptedPackage( aMediaDesc ); Reference< XComponent > xModel( getModel(), UNO_QUERY ); - Reference< XComponentContext > xContext = lcl_getComponentContext(getGlobalFactory()); Reference< XStorage > xDocumentStorage ( ::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream( OFOPXML_STORAGE_FORMAT_STRING, xInputStream ) ); Reference< XInterface > xTemp = xContext->getServiceManager()->createInstanceWithContext( @@ -569,4 +571,4 @@ StorageRef XmlFilterBase::implCreateStorage( const Reference< XStream >& rxOutSt } // namespace core } // namespace oox -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/chartconverter.cxx b/oox/source/drawingml/chart/chartconverter.cxx index da8bf26527fa..2e7ea2814f7d 100644 --- a/oox/source/drawingml/chart/chartconverter.cxx +++ b/oox/source/drawingml/chart/chartconverter.cxx @@ -31,6 +31,8 @@ #include <com/sun/star/chart2/XChartDocument.hpp> #include "oox/drawingml/chart/chartspaceconverter.hxx" #include "oox/drawingml/chart/chartspacemodel.hxx" +#include "oox/helper/containerhelper.hxx" +#include "oox/core/xmlfilterbase.hxx" using ::oox::drawingml::chart::DataSequenceModel; using ::com::sun::star::uno::Any; @@ -67,7 +69,7 @@ static OUString lclGenerateApiString( const OUString& rString ) return OUStringBuffer().append( sal_Unicode( '"' ) ).append( aRetString ).append( sal_Unicode( '"' ) ).makeStringAndClear(); } -static OUString lclGenerateApiArray( const Matrix< Any >& rMatrix ) + static ::rtl::OUString lclGenerateApiArray( const Matrix< Any >& rMatrix ) { OSL_ENSURE( !rMatrix.empty(), "ChartConverter::lclGenerateApiArray - missing matrix values" ); OUStringBuffer aBuffer; @@ -79,7 +81,7 @@ static OUString lclGenerateApiArray( const Matrix< Any >& rMatrix ) for( Matrix< Any >::const_iterator aBeg = rMatrix.row_begin( nRow ), aIt = aBeg, aEnd = rMatrix.row_end( nRow ); aIt != aEnd; ++aIt ) { double fValue = 0.0; - OUString aString; + ::rtl::OUString aString; if( aIt != aBeg ) aBuffer.append( API_TOKEN_ARRAY_COLSEP ); if( *aIt >>= fValue ) @@ -134,7 +136,7 @@ Reference< XDataSequence > ChartConverter::createDataSequence( const Reference< Reference< XDataSequence > xDataSeq; if( rxDataProvider.is() ) { - OUString aRangeRep; + ::rtl::OUString aRangeRep; if( !rDataSeq.maData.empty() ) { // create a single-row array from constant source data @@ -167,4 +169,4 @@ Reference< XDataSequence > ChartConverter::createDataSequence( const Reference< } // namespace drawingml } // namespace oox -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/datasourcecontext.cxx b/oox/source/drawingml/chart/datasourcecontext.cxx index a34119a27a7f..087e6fd57abc 100644 --- a/oox/source/drawingml/chart/datasourcecontext.cxx +++ b/oox/source/drawingml/chart/datasourcecontext.cxx @@ -108,8 +108,8 @@ void DoubleSequenceContext::onCharacters( const OUString& rChars ) * be values. * TODO: NumberFormat conversion, remove the check then. */ - if( isPreviousElement( C_TOKEN( cat ), 4 ) || - isPreviousElement( C_TOKEN( xVal ), 4 ) ) + if( isParentElement( C_TOKEN( cat ), 4 ) || + isParentElement( C_TOKEN( xVal ), 4 ) ) mrModel.maData[ mnPtIndex ] <<= rChars; else mrModel.maData[ mnPtIndex ] <<= rChars.toDouble(); @@ -243,4 +243,4 @@ ContextHandlerRef DataSourceContext::onCreateContext( sal_Int32 nElement, const } // namespace drawingml } // namespace oox -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index d17fda3f23c8..dce3a82f542e 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -29,7 +29,7 @@ * ************************************************************************/ -#include "tokens.hxx" +#include <oox/token/tokens.hxx> #include "oox/core/xmlfilterbase.hxx" #include "oox/export/chartexport.hxx" #include "oox/export/utils.hxx" diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 8630ee0a8841..1be017262404 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -29,6 +29,7 @@ #include "oox/core/xmlfilterbase.hxx" #include "oox/export/drawingml.hxx" #include "oox/export/utils.hxx" +#include <oox/token/tokens.hxx> #include <cstdio> #include <com/sun/star/awt/CharSet.hpp> @@ -367,10 +368,10 @@ void DrawingML::WriteOutline( Reference< XPropertySet > rXPropSet ) sal_uInt32 nLineWidth = 0; sal_uInt32 nColor = 0; - sal_Bool bColorSet = FALSE; + sal_Bool bColorSet = sal_False; const char* cap = NULL; drawing::LineDash aLineDash; - sal_Bool bDashSet = FALSE; + sal_Bool bDashSet = sal_False; GET( nLineWidth, LineWidth ); @@ -378,7 +379,7 @@ void DrawingML::WriteOutline( Reference< XPropertySet > rXPropSet ) case drawing::LineStyle_DASH: if( GETA( LineDash ) ) { aLineDash = *(drawing::LineDash*) mAny.getValue(); - bDashSet = TRUE; + bDashSet = sal_True; if( aLineDash.Style == DashStyle_ROUND || aLineDash.Style == DashStyle_ROUNDRELATIVE ) cap = "rnd"; @@ -390,7 +391,7 @@ void DrawingML::WriteOutline( Reference< XPropertySet > rXPropSet ) default: if ( GETA( LineColor ) ) { nColor = *((sal_uInt32*) mAny.getValue()) & 0xffffff; - bColorSet = TRUE; + bColorSet = sal_True; } break; } @@ -879,7 +880,7 @@ const char* DrawingML::GetFieldType( ::com::sun::star::uno::Reference< ::com::su bIsField = sal_True; rXPropSet.set( rXTextField, UNO_QUERY ); if( rXPropSet.is() ) { - String aFieldKind( rXTextField->getPresentation( TRUE ) ); + String aFieldKind( rXTextField->getPresentation( sal_True ) ); DBG(printf ("field kind: %s\n", ST(aFieldKind) )); if( aFieldKind == S( "Page" ) ) { return "slidenum"; @@ -1221,7 +1222,7 @@ void DrawingML::WriteParagraph( Reference< XTextContent > rParagraph ) mpFS->startElementNS( XML_a, XML_p, FSEND ); - sal_Bool bPropertiesWritten = FALSE; + sal_Bool bPropertiesWritten = sal_False; while( enumeration->hasMoreElements() ) { Reference< XTextRange > run; Any any ( enumeration->nextElement() ); @@ -1229,7 +1230,7 @@ void DrawingML::WriteParagraph( Reference< XTextContent > rParagraph ) if (any >>= run) { if( !bPropertiesWritten ) { WriteParagraphProperties( rParagraph ); - bPropertiesWritten = TRUE; + bPropertiesWritten = sal_True; } WriteRun( run ); } @@ -1294,11 +1295,11 @@ void DrawingML::WriteText( Reference< XShape > rXShape ) else if( bVertical && eHorizontalAlignment == TextHorizontalAdjust_LEFT ) sVerticalAlignment = "b"; - sal_Bool bHasWrap = FALSE; - sal_Bool bWrap = FALSE; + sal_Bool bHasWrap = sal_False; + sal_Bool bWrap = sal_False; if( GETA( TextWordWrap ) ) { mAny >>= bWrap; - bHasWrap = TRUE; + bHasWrap = sal_True; //DBG(printf("wrap: %d\n", bWrap)); } @@ -1388,11 +1389,11 @@ void DrawingML::WritePolyPolygon( const PolyPolygon& rPolyPolygon ) mpFS->startElementNS( XML_a, XML_pathLst, FSEND ); - for( USHORT i = 0; i < rPolyPolygon.Count(); i ++ ) { + for( sal_uInt16 i = 0; i < rPolyPolygon.Count(); i ++ ) { const Polygon& rPoly = rPolyPolygon[ i ]; Rectangle aRect( rPoly.GetBoundRect() ); - sal_Bool bBezier = FALSE; + sal_Bool bBezier = sal_False; mpFS->startElementNS( XML_a, XML_path, XML_w, I64S( aRect.GetWidth() ), @@ -1411,13 +1412,13 @@ void DrawingML::WritePolyPolygon( const PolyPolygon& rPolyPolygon ) mpFS->endElementNS( XML_a, XML_moveTo ); } - for( USHORT j = 1; j < rPoly.GetSize(); j ++ ) + for( sal_uInt16 j = 1; j < rPoly.GetSize(); j ++ ) { enum PolyFlags flags = rPoly.GetFlags(j); if( flags == POLY_CONTROL && !bBezier ) { mpFS->startElementNS( XML_a, XML_cubicBezTo, FSEND ); - bBezier = TRUE; + bBezier = sal_True; } else if( flags == POLY_NORMAL && !bBezier ) mpFS->startElementNS( XML_a, XML_lnTo, FSEND ); @@ -1430,7 +1431,7 @@ void DrawingML::WritePolyPolygon( const PolyPolygon& rPolyPolygon ) if( ( flags == POLY_NORMAL || flags == POLY_SYMMTR ) && bBezier ) { mpFS->endElementNS( XML_a, XML_cubicBezTo ); - bBezier = FALSE; + bBezier = sal_False; } else if( flags == POLY_NORMAL && !bBezier ) mpFS->endElementNS( XML_a, XML_lnTo ); @@ -1471,12 +1472,12 @@ void DrawingML::WriteConnectorConnections( EscherConnectorListEntry& rConnectorE if( nStartID != -1 ) mpFS->singleElementNS( XML_a, XML_stCxn, XML_id, I32S( nStartID ), - XML_idx, I64S( rConnectorEntry.GetConnectorRule( TRUE ) ), + XML_idx, I64S( rConnectorEntry.GetConnectorRule( sal_True ) ), FSEND ); if( nEndID != -1 ) mpFS->singleElementNS( XML_a, XML_endCxn, XML_id, I32S( nEndID ), - XML_idx, I64S( rConnectorEntry.GetConnectorRule( FALSE ) ), + XML_idx, I64S( rConnectorEntry.GetConnectorRule( sal_False ) ), FSEND ); } diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 0c034c72526e..224b15068353 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -29,6 +29,7 @@ #include "oox/core/xmlfilterbase.hxx" #include "oox/export/shapes.hxx" #include "oox/export/utils.hxx" +#include <oox/token/tokens.hxx> #include <cstdio> #include <com/sun/star/awt/CharSet.hpp> @@ -476,12 +477,12 @@ ShapeExport& ShapeExport::WriteBezierShape( Reference< XShape > xShape, sal_Bool ShapeExport& ShapeExport::WriteClosedBezierShape( Reference< XShape > xShape ) { - return WriteBezierShape( xShape, TRUE ); + return WriteBezierShape( xShape, sal_True ); } ShapeExport& ShapeExport::WriteOpenBezierShape( Reference< XShape > xShape ) { - return WriteBezierShape( xShape, FALSE ); + return WriteBezierShape( xShape, sal_False ); } ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape ) @@ -491,7 +492,7 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape ) Reference< XPropertySet > rXPropSet( xShape, UNO_QUERY ); SdrObjCustomShape* pShape = (SdrObjCustomShape*) GetSdrObjectFromXShape( xShape ); sal_Bool bIsDefaultObject = EscherPropertyContainer::IsDefaultObject( pShape ); - sal_Bool bPredefinedHandlesUsed = TRUE; + sal_Bool bPredefinedHandlesUsed = sal_True; OUString sShapeType; sal_uInt32 nMirrorFlags = 0; MSO_SPT eShapeType = EscherPropertyContainer::GetCustomShapeType( xShape, nMirrorFlags, sShapeType ); @@ -514,7 +515,7 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape ) nAdjustmentValuesIndex = i; else if( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Handles" ) )) { if( !bIsDefaultObject ) - bPredefinedHandlesUsed = FALSE; + bPredefinedHandlesUsed = sal_False; // TODO: update nAdjustmentsWhichNeedsToBeConverted here } } @@ -717,13 +718,13 @@ ShapeExport& ShapeExport::WriteConnectorShape( Reference< XShape > xShape ) Rectangle aRect( Point( aStartPoint.X, aStartPoint.Y ), Point( aEndPoint.X, aEndPoint.Y ) ); if( aRect.getWidth() < 0 ) { - bFlipH = TRUE; + bFlipH = sal_True; aRect.setX( aEndPoint.X ); aRect.setWidth( aStartPoint.X - aEndPoint.X ); } if( aRect.getHeight() < 0 ) { - bFlipV = TRUE; + bFlipV = sal_True; aRect.setY( aEndPoint.Y ); aRect.setHeight( aStartPoint.Y - aEndPoint.Y ); } diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index 145319670f09..a0542542731f 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -28,7 +28,7 @@ #include <oox/export/vmlexport.hxx> -#include <tokens.hxx> +#include <oox/token/tokens.hxx> #include <rtl/strbuf.hxx> #include <rtl/ustring.hxx> @@ -83,7 +83,7 @@ VMLExport::~VMLExport() delete[] m_pShapeTypeWritten, m_pShapeTypeWritten = NULL; } -void VMLExport::OpenContainer( UINT16 nEscherContainer, int nRecInstance ) +void VMLExport::OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance ) { EscherEx::OpenContainer( nEscherContainer, nRecInstance ); @@ -127,7 +127,7 @@ void VMLExport::CloseContainer() EscherEx::CloseContainer(); } -UINT32 VMLExport::EnterGroup( const String& rShapeName, const Rectangle* pRect ) +sal_uInt32 VMLExport::EnterGroup( const String& rShapeName, const Rectangle* pRect ) { sal_uInt32 nShapeId = GenerateShapeId(); @@ -172,7 +172,7 @@ void VMLExport::LeaveGroup() m_pSerializer->endElementNS( XML_v, XML_group ); } -void VMLExport::AddShape( UINT32 nShapeType, UINT32 nShapeFlags, UINT32 nShapeId ) +void VMLExport::AddShape( sal_uInt32 nShapeType, sal_uInt32 nShapeFlags, sal_uInt32 nShapeId ) { m_nShapeType = nShapeType; m_nShapeFlags = nShapeFlags; diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx index 221799a41c53..e54b02919d4d 100644 --- a/oox/source/helper/propertymap.cxx +++ b/oox/source/helper/propertymap.cxx @@ -32,6 +32,8 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertySetInfo.hpp> #include <com/sun/star/container/XIndexReplace.hpp> +#include <com/sun/star/drawing/TextHorizontalAdjust.hpp> +#include <com/sun/star/drawing/TextVerticalAdjust.hpp> #include <cppuhelper/implbase2.hxx> #include <osl/mutex.hxx> #include "oox/token/propertynames.hxx" @@ -43,8 +45,6 @@ using ::com::sun::star::container::XIndexReplace; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; -#include <com/sun/star/drawing/TextHorizontalAdjust.hpp> -#include <com/sun/star/drawing/TextVerticalAdjust.hpp> using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::uno; using ::com::sun::star::drawing::TextHorizontalAdjust; @@ -349,4 +349,4 @@ void PropertyMap::dump() } // namespace oox -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/ole/vbacontrol.cxx b/oox/source/ole/vbacontrol.cxx index 5b4a6346397d..8fd6a2cd50e4 100644 --- a/oox/source/ole/vbacontrol.cxx +++ b/oox/source/ole/vbacontrol.cxx @@ -804,8 +804,10 @@ VbaUserForm::VbaUserForm( const Reference< XComponentContext >& rxContext, OSL_ENSURE( mxDocModel.is(), "VbaUserForm::VbaUserForm - missing document model" ); } -void VbaUserForm::importForm( const Reference< XNameContainer >& rxDialogLib, - StorageBase& rVbaFormStrg, const OUString& rModuleName, rtl_TextEncoding eTextEnc ) +void VbaUserForm::importForm( + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel, + const Reference< XNameContainer >& rxDialogLib, + StorageBase& rVbaFormStrg, const OUString& rModuleName, rtl_TextEncoding eTextEnc ) { OSL_ENSURE( rxDialogLib.is(), "VbaUserForm::importForm - missing dialog library" ); if( !mxCompContext.is() || !mxDocModel.is() || !rxDialogLib.is() ) @@ -874,7 +876,7 @@ void VbaUserForm::importForm( const Reference< XNameContainer >& rxDialogLib, if( convertProperties( xDialogModel, maConverter, 0 ) ) { // export the dialog to XML and insert it into the dialog library - Reference< XInputStreamProvider > xDialogSource( ::xmlscript::exportDialogModel( xDialogNC, xCompContext, rxDocModel ), UNO_SET_THROW ); + Reference< XInputStreamProvider > xDialogSource( ::xmlscript::exportDialogModel( xDialogNC, mxCompContext, rxDocModel ), UNO_SET_THROW ); OSL_ENSURE( !rxDialogLib->hasByName( aFormName ), "VbaUserForm::importForm - multiple dialogs with equal name" ); ContainerHelper::insertByName( rxDialogLib, aFormName, Any( xDialogSource ) ); } diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx index 992ae517b3da..803d0cea491d 100644 --- a/oox/source/ole/vbamodule.cxx +++ b/oox/source/ole/vbamodule.cxx @@ -213,13 +213,6 @@ void VbaModule::createEmptyModule( const Reference< XNameContainer >& rxBasicLib createModule( OUString(), rxBasicLib, rxDocObjectNA ); } -// private -------------------------------------------------------------------- -{ - createModule( OUString(), rxBasicLib, rxDocObjectNA ); -} - -void VbaModule::createEmptyModule( const Reference< XNameContainer >& rxBasicLib, const Reference< XNameAccess >& rxDocObjectNA ) const - OUString VbaModule::readSourceCode( StorageBase& rVbaStrg, const Reference< XNameContainer >& rxOleNameOverrides ) const { OUStringBuffer aSourceCode; diff --git a/oox/source/ppt/pptgraphicshapecontext.cxx b/oox/source/ppt/pptgraphicshapecontext.cxx index 81f3a7affe46..dd5820aa9925 100644 --- a/oox/source/ppt/pptgraphicshapecontext.cxx +++ b/oox/source/ppt/pptgraphicshapecontext.cxx @@ -37,13 +37,13 @@ #include "oox/ppt/pptshapepropertiescontext.hxx" #include "oox/ppt/slidepersist.hxx" #include "oox/drawingml/shapestylecontext.hxx" -#include "oox/core/namespaces.hxx" +#include "oox/token/namespaces.hxx" #include "oox/drawingml/fillpropertiesgroupcontext.hxx" #include "oox/drawingml/lineproperties.hxx" #include "oox/drawingml/drawingmltypes.hxx" #include "oox/drawingml/customshapegeometry.hxx" #include "oox/drawingml/textbodycontext.hxx" -#include "tokens.hxx" +#include <oox/token/tokens.hxx> using rtl::OUString; using namespace oox::core; @@ -119,11 +119,11 @@ Reference< XFastContextHandler > PPTGraphicShapeContext::createFastChildContext( // nvSpPr CT_ShapeNonVisual begin // case NMSP_PPT|XML_drElemPr: // break; - case NMSP_PPT|XML_cNvPr: + case PPT_TOKEN(cNvPr): mpShapePtr->setId( xAttribs->getOptionalValue( XML_id ) ); mpShapePtr->setName( xAttribs->getOptionalValue( XML_name ) ); break; - case NMSP_PPT|XML_ph: + case PPT_TOKEN(ph): { sal_Int32 nSubType( xAttribs->getOptionalValueToken( XML_type, XML_obj ) ); mpShapePtr->setSubType( nSubType ); @@ -210,15 +210,15 @@ Reference< XFastContextHandler > PPTGraphicShapeContext::createFastChildContext( } // nvSpPr CT_ShapeNonVisual end - case NMSP_PPT|XML_spPr: + case PPT_TOKEN(spPr): xRet = new PPTShapePropertiesContext( *this, *mpShapePtr ); break; - case NMSP_PPT|XML_style: + case PPT_TOKEN(style): xRet = new oox::drawingml::ShapeStyleContext( *this, *mpShapePtr ); break; - case NMSP_PPT|XML_txBody: + case PPT_TOKEN(txBody): { oox::drawingml::TextBodyPtr xTextBody( new oox::drawingml::TextBody ); mpShapePtr->setTextBody( xTextBody ); diff --git a/oox/source/token/namespacemap.cxx b/oox/source/token/namespacemap.cxx index a919876489b2..b64b4e179627 100755 --- a/oox/source/token/namespacemap.cxx +++ b/oox/source/token/namespacemap.cxx @@ -45,6 +45,7 @@ NamespaceMap::NamespaceMap() operator[]( pNamespaceUrl->mnId ) = ::rtl::OUString::createFromAscii( pNamespaceUrl->mpcUrl ); } +} // ============================================================================ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/vml/vmldrawingfragment.cxx b/oox/source/vml/vmldrawingfragment.cxx index 259db7e7b0c0..c81af66b2373 100644 --- a/oox/source/vml/vmldrawingfragment.cxx +++ b/oox/source/vml/vmldrawingfragment.cxx @@ -63,7 +63,7 @@ ContextHandlerRef DrawingFragment::onCreateContext( sal_Int32 nElement, const At { // DOCX filter handles plain shape elements with this fragment handler case VMLDRAWING_WORD: - if ( getNamespace( nElement ) == NMSP_VML ) + if ( getNamespace( nElement ) == NMSP_vml ) return ShapeContextBase::createShapeContext( *this, mrDrawing.getShapes(), nElement, rAttribs ); break; @@ -94,4 +94,4 @@ void DrawingFragment::finalizeImport() } // namespace vml } // namespace oox -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 233bc17d4005..d3cdd2f3625d 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -45,13 +45,13 @@ #include "oox/helper/graphichelper.hxx" #include "oox/helper/propertymap.hxx" #include "oox/helper/propertyset.hxx" -#include "oox/core/xmlfilterbase.hxx" #include "oox/ole/axcontrol.hxx" #include "oox/ole/axcontrolfragment.hxx" #include "oox/ole/oleobjecthelper.hxx" #include "oox/vml/vmldrawing.hxx" #include "oox/vml/vmlshapecontainer.hxx" #include "oox/vml/vmltextbox.hxx" +#include "oox/core/xmlfilterbase.hxx" #include "oox/helper/containerhelper.hxx" using ::com::sun::star::beans::XPropertySet; @@ -161,6 +161,8 @@ void lclSetXShapeRect( const Reference< XShape >& rxShape, const Rectangle& rSha } } } +} + } // namespace // ============================================================================ @@ -646,4 +648,4 @@ Reference< XShape > GroupShape::implConvertAndInsert( const Reference< XShapes > } // namespace vml } // namespace oox -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index 108e0b21f830..591fc2a91ce1 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -366,7 +366,7 @@ ShapeContext::ShapeContext( ContextHandler2Helper& rParent, ShapeBase& rShape, c ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) { // Custom shape in Writer with a textbox are transformed into a frame - if ( nElement == ( NMSP_VML + XML_textbox ) ) + if ( nElement == ( NMSP_vml + XML_textbox ) ) dynamic_cast<SimpleShape&>( mrShape ).setService( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextFrame")) ); @@ -413,13 +413,13 @@ ContextHandlerRef GroupShapeContext::onCreateContext( sal_Int32 nElement, const // ============================================================================ RectangleShapeContext::RectangleShapeContext( ContextHandler2Helper& rParent, const AttributeList& rAttribs, RectangleShape& rShape ) : - ShapeContext( rParent, rAttribs, rShape ) + ShapeContext( rParent, rShape, rAttribs ) { } ContextHandlerRef RectangleShapeContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) { - if ( nElement == ( NMSP_VML + XML_textbox ) ) + if ( nElement == ( NMSP_vml + XML_textbox ) ) dynamic_cast< SimpleShape &>( mrShape ).setService( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextFrame")) ); diff --git a/oox/source/xls/commentsbuffer.cxx b/oox/source/xls/commentsbuffer.cxx index 8217a0148a0b..34cc33476649 100644 --- a/oox/source/xls/commentsbuffer.cxx +++ b/oox/source/xls/commentsbuffer.cxx @@ -26,6 +26,9 @@ * ************************************************************************/ +#include <oox/token/properties.hxx> +#include <oox/token/tokens.hxx> + #include "oox/xls/commentsbuffer.hxx" #include <com/sun/star/sheet/XSheetAnnotationAnchor.hpp> @@ -36,7 +39,6 @@ #include "oox/vml/vmlshape.hxx" #include "oox/xls/addressconverter.hxx" #include "oox/xls/drawingfragment.hxx" -#include "properties.hxx" #include "svx/sdtaitm.hxx" #include "oox/xls/unitconverter.hxx" @@ -48,6 +50,17 @@ using ::com::sun::star::text::XTextRange; using ::com::sun::star::awt::Size; using ::com::sun::star::awt::Point; +namespace oox { +namespace xls { + +// ============================================================================ + +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::sheet; +using namespace ::com::sun::star::table; +using namespace ::com::sun::star::uno; + +using ::rtl::OUString; static sal_Int32 lcl_ToHorizAlign( sal_Int32 nAlign ) { @@ -81,18 +94,6 @@ static sal_Int32 lcl_ToVertAlign( sal_Int32 nAlign ) return SDRTEXTVERTADJUST_TOP; } -namespace oox { -namespace xls { - -// ============================================================================ - -using namespace ::com::sun::star::drawing; -using namespace ::com::sun::star::sheet; -using namespace ::com::sun::star::table; -using namespace ::com::sun::star::uno; - -using ::rtl::OUString; - // ============================================================================ CommentModel::CommentModel() : @@ -268,4 +269,4 @@ void CommentsBuffer::finalizeImport() } // namespace xls } // namespace oox -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/xls/commentsfragment.cxx b/oox/source/xls/commentsfragment.cxx index 169b45d6d83f..c26485f2b171 100644 --- a/oox/source/xls/commentsfragment.cxx +++ b/oox/source/xls/commentsfragment.cxx @@ -91,25 +91,6 @@ void CommentsFragment::onCharacters( const OUString& rChars ) void CommentsFragment::onEndElement() { - bool bFrom = false; - if( getPreviousElement() == XDR_TOKEN( from ) ) - bFrom = true; - switch( getCurrentElement() ) - { - case XDR_TOKEN( col ): - case XDR_TOKEN( colOff ): - case XDR_TOKEN( row ): - case XDR_TOKEN( rowOff ): - mxComment->importAnchor( bFrom, getCurrentElement(), rChars ); - break; - case XLS_TOKEN( comment ): - mxComment.reset(); - break; - } -} - -void CommentsFragment::onEndElement() -{ if( isCurrentElement( XLS_TOKEN( comment ) ) ) mxComment.reset(); } @@ -177,4 +158,4 @@ void CommentsFragment::importComment( SequenceInputStream& rStrm ) } // namespace xls } // namespace oox -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx index a774ee4fed92..47353a9cef44 100644 --- a/oox/source/xls/drawingfragment.cxx +++ b/oox/source/xls/drawingfragment.cxx @@ -46,6 +46,9 @@ #include "oox/xls/themebuffer.hxx" #include "oox/xls/unitconverter.hxx" +namespace oox { +namespace xls { + using ::rtl::OUString; // ============================================================================ @@ -1098,4 +1101,4 @@ void VmlDrawingFragment::finalizeImport() } // namespace xls } // namespace oox -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/xls/worksheethelper.cxx b/oox/source/xls/worksheethelper.cxx index d644b80c8a2b..e08e18982da7 100644 --- a/oox/source/xls/worksheethelper.cxx +++ b/oox/source/xls/worksheethelper.cxx @@ -45,7 +45,7 @@ #include <com/sun/star/sheet/XMultiFormulaTokens.hpp> #include <com/sun/star/sheet/XMultipleOperation.hpp> #include <com/sun/star/sheet/XSheetCellRangeContainer.hpp> -#include <com/sun/star/sheet/XSheetCondition.hpp> +#include <com/sun/star/sheet/XSheetCondition2.hpp> #include <com/sun/star/sheet/XSheetOutline.hpp> #include <com/sun/star/sheet/XSpreadsheet.hpp> #include <com/sun/star/table/XColumnRowRange.hpp> @@ -2290,4 +2290,4 @@ bool WorksheetHelperRoot::isValidSheet() const } // namespace xls } // namespace oox -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |