diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-09-09 11:45:13 +0200 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-09-09 11:45:13 +0200 |
commit | e7c6e5d2c248cfb935c91882a3a1e64fea7550b4 (patch) | |
tree | d2f45902cbd12ac6b651e486687130e01272d79f /xmloff/source/draw | |
parent | 2484e4f7faa1f052ff48d2192ffb5931a71faa8f (diff) | |
parent | d1886d07b439e7197f731c9d98c0b2ec31c62faa (diff) |
merge commit to DEV300_m57
Diffstat (limited to 'xmloff/source/draw')
-rw-r--r-- | xmloff/source/draw/sdpropls.cxx | 29 | ||||
-rw-r--r-- | xmloff/source/draw/sdpropls.hxx | 2 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport2.cxx | 25 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport4.cxx | 26 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 19 |
6 files changed, 78 insertions, 26 deletions
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx index 60b921ea8aaa..dcdfdbaa05d2 100644 --- a/xmloff/source/draw/sdpropls.cxx +++ b/xmloff/source/draw/sdpropls.cxx @@ -268,7 +268,7 @@ const XMLPropertyMapEntry aXMLSDProperties[] = GMAP( "ControlDataStyle", XML_NAMESPACE_STYLE,XML_DATA_STYLE_NAME, XML_TYPE_STRING|MID_FLAG_NO_PROPERTY_EXPORT|MID_FLAG_SPECIAL_ITEM, CTF_SD_CONTROL_SHAPE_DATA_STYLE ), GMAP( "ControlTextEmphasis", XML_NAMESPACE_STYLE,XML_TEXT_EMPHASIZE, XML_TYPE_CONTROL_TEXT_EMPHASIZE, 0 ), GMAP( "ImageScaleMode", XML_NAMESPACE_STYLE,XML_REPEAT, XML_SD_TYPE_IMAGE_SCALE_MODE|MID_FLAG_MULTI_PROPERTY, 0 ), - GMAP( "ControlWritingMode", XML_NAMESPACE_STYLE,XML_WRITING_MODE, XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT|MID_FLAG_MULTI_PROPERTY, 0 ), + GMAP( "ControlWritingMode", XML_NAMESPACE_STYLE,XML_WRITING_MODE, XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT|MID_FLAG_MULTI_PROPERTY, CTF_CONTROLWRITINGMODE ), // special entries for floating frames GMAP( "FrameIsAutoScroll", XML_NAMESPACE_DRAW, XML_FRAME_DISPLAY_SCROLLBAR, XML_TYPE_BOOL|MID_FLAG_MULTI_PROPERTY, CTF_FRAME_DISPLAY_SCROLLBAR ), @@ -1230,6 +1230,10 @@ void XMLShapeExportPropertyMapper::ContextFilter( XMLPropertyState* pClip11State = NULL; XMLPropertyState* pClipState = NULL; + XMLPropertyState* pShapeWritingMode = NULL; + XMLPropertyState* pTextWritingMode = NULL; + XMLPropertyState* pControlWritingMode = NULL; + // filter properties for( std::vector< XMLPropertyState >::iterator aIter = rProperties.begin(); aIter != rProperties.end(); @@ -1261,14 +1265,24 @@ void XMLShapeExportPropertyMapper::ContextFilter( break; case CTF_WRITINGMODE: { + pShapeWritingMode = property; text::WritingMode eWritingMode; if( property->maValue >>= eWritingMode ) { if( text::WritingMode_LR_TB == eWritingMode ) + { property->mnIndex = -1; + pShapeWritingMode = 0; + } } } break; + case CTF_CONTROLWRITINGMODE: + pControlWritingMode = property; + break; + case CTF_TEXTWRITINGMODE: + pTextWritingMode = property; + break; case CTF_REPEAT_OFFSET_X: pRepeatOffsetX = property; break; @@ -1353,6 +1367,19 @@ void XMLShapeExportPropertyMapper::ContextFilter( } } + // check for duplicate writing mode + if( pShapeWritingMode && (pTextWritingMode || pControlWritingMode) ) + { + if( pTextWritingMode ) + pTextWritingMode->mnIndex = -1; + if( pControlWritingMode ) + pControlWritingMode->mnIndex = -1; + } + else if( pTextWritingMode && pControlWritingMode ) + { + pControlWritingMode->mnIndex = -1; + } + // do not export visual area for internal ole objects if( pOLEIsInternal ) { diff --git a/xmloff/source/draw/sdpropls.hxx b/xmloff/source/draw/sdpropls.hxx index bf27e669f1ca..eed5eee69b51 100644 --- a/xmloff/source/draw/sdpropls.hxx +++ b/xmloff/source/draw/sdpropls.hxx @@ -142,7 +142,7 @@ extern const XMLPropertyMapEntry aXMLSDPresPageProps_onlyHeadersFooter[]; ////////////////////////////////////////////////////////////////////////////// #define CTF_NUMBERINGRULES 1000 -//#define CTF_NUMBERINGRULES_NAME 1001 +#define CTF_CONTROLWRITINGMODE 1001 #define CTF_WRITINGMODE 1002 #define CTF_REPEAT_OFFSET_X 1003 #define CTF_REPEAT_OFFSET_Y 1004 diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 0b6c7dd170e7..3a0e01631f28 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -1213,7 +1213,8 @@ const rtl::Reference< XMLTableExport >& XMLShapeExport::GetShapeTableExport() if( !mxShapeTableExport.is() ) { rtl::Reference< XMLPropertyHandlerFactory > xFactory( new XMLSdPropHdlFactory( mrExport.GetModel(), mrExport ) ); - rtl::Reference< XMLPropertySetMapper > xPropertySetMapper( new XMLShapePropertySetMapper( xFactory.get() ) ); + UniReference < XMLPropertySetMapper > xMapper( new XMLShapePropertySetMapper( xFactory.get() ) ); + rtl::Reference< SvXMLExportPropertyMapper > xPropertySetMapper( new XMLShapeExportPropertyMapper( xMapper, (XMLTextListAutoStylePool*)&mrExport.GetTextParagraphExport()->GetListAutoStylePool(), mrExport ) ); mxShapeTableExport = new XMLTableExport( mrExport, xPropertySetMapper, xFactory ); } diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx index a7bb8bd7fcec..b2e81d333fba 100644 --- a/xmloff/source/draw/shapeexport2.cxx +++ b/xmloff/source/draw/shapeexport2.cxx @@ -49,6 +49,7 @@ #endif #include "sdpropls.hxx" #include <tools/debug.hxx> +#include <tools/urlobj.hxx> #include <rtl/ustrbuf.hxx> #include <xmloff/xmlexp.hxx> #include <xmloff/xmluconv.hxx> @@ -1166,8 +1167,30 @@ void XMLShapeExport::ImpExportGraphicObjectShape( OUString aStreamURL; OUString aStr; + xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicStreamURL"))) >>= aStreamURL; xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicURL"))) >>= sImageURL; - aStr = mrExport.AddEmbeddedGraphicObject( sImageURL ); + + OUString aResolveURL( sImageURL ); + const rtl::OUString sPackageURL( RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.Package:") ); + + // sj: trying to preserve the filename + if ( aStreamURL.match( sPackageURL, 0 ) ) + { + rtl::OUString sRequestedName( aStreamURL.copy( sPackageURL.getLength(), aStreamURL.getLength() - sPackageURL.getLength() ) ); + sal_Int32 nLastIndex = sRequestedName.lastIndexOf( '/' ) + 1; + if ( ( nLastIndex > 0 ) && ( nLastIndex < sRequestedName.getLength() ) ) + sRequestedName = sRequestedName.copy( nLastIndex, sRequestedName.getLength() - nLastIndex ); + nLastIndex = sRequestedName.lastIndexOf( '.' ); + if ( nLastIndex >= 0 ) + sRequestedName = sRequestedName.copy( 0, nLastIndex ); + if ( sRequestedName.getLength() ) + { + aResolveURL = aResolveURL.concat( OUString(RTL_CONSTASCII_USTRINGPARAM("?requestedName="))); + aResolveURL = aResolveURL.concat( sRequestedName ); + } + } + + aStr = mrExport.AddEmbeddedGraphicObject( aResolveURL ); mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, aStr ); if( aStr.getLength() ) diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx index d38bb3761868..e2e804eefb43 100644 --- a/xmloff/source/draw/shapeexport4.cxx +++ b/xmloff/source/draw/shapeexport4.cxx @@ -1130,21 +1130,21 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape { mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TEMPLATE_NAME, sTemplate ); - const XMLPropertyMapEntry* pEntry = &aXMLTableShapeAttributes[0]; - - while( pEntry->msApiName ) try + for( const XMLPropertyMapEntry* pEntry = &aXMLTableShapeAttributes[0]; pEntry->msApiName; pEntry++ ) { - sal_Bool bBool = sal_False; - const OUString sAPIPropertyName( OUString(pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US ) ); + try + { + sal_Bool bBool = sal_False; + const OUString sAPIPropertyName( OUString(pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US ) ); - xPropSet->getPropertyValue( sAPIPropertyName ) >>= bBool; - if( bBool ) - mrExport.AddAttribute(pEntry->mnNameSpace, pEntry->meXMLName, XML_TRUE ); - pEntry++; - } - catch( uno::Exception& ) - { - DBG_ERROR("XMLShapeExport::ImpExportTableShape(), exception caught!"); + xPropSet->getPropertyValue( sAPIPropertyName ) >>= bBool; + if( bBool ) + mrExport.AddAttribute(pEntry->mnNameSpace, pEntry->meXMLName, XML_TRUE ); + } + catch( uno::Exception& ) + { + DBG_ERROR("XMLShapeExport::ImpExportTableShape(), exception caught!"); + } } } } diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 27ca5c4beafe..65aad96bad86 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -3584,16 +3584,17 @@ void SdXMLTableShapeContext::StartElement( const ::com::sun::star::uno::Referenc } const XMLPropertyMapEntry* pEntry = &aXMLTableShapeAttributes[0]; - int i = 0; - while( pEntry->msApiName && (i < 6) ) try - { - const OUString sAPIPropertyName( OUString(pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US ) ); - xProps->setPropertyValue( sAPIPropertyName, Any( maTemplateStylesUsed[i++] ) ); - pEntry++; - } - catch( Exception& ) + for( int i = 0; pEntry->msApiName && (i < 6); i++, pEntry++ ) { - DBG_ERROR("SdXMLTableShapeContext::StartElement(), exception caught!"); + try + { + const OUString sAPIPropertyName( OUString(pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US ) ); + xProps->setPropertyValue( sAPIPropertyName, Any( maTemplateStylesUsed[i] ) ); + } + catch( Exception& ) + { + DBG_ERROR("SdXMLTableShapeContext::StartElement(), exception caught!"); + } } } |