diff options
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/sdpropls.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/text/txtexppr.cxx | 36 | ||||
-rw-r--r-- | xmloff/source/text/txtprhdl.cxx | 39 | ||||
-rw-r--r-- | xmloff/source/text/txtprmap.cxx | 29 |
4 files changed, 99 insertions, 11 deletions
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx index 542d3ffd7eab..9a400972ed4b 100644 --- a/xmloff/source/draw/sdpropls.cxx +++ b/xmloff/source/draw/sdpropls.cxx @@ -392,7 +392,7 @@ static SvXMLEnumMapEntry const aXML_LineCap_EnumMap[] = { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const aXML_FillStyle_EnumMap[] = +SvXMLEnumMapEntry aXML_FillStyle_EnumMap[] = { { XML_NONE, drawing::FillStyle_NONE }, { XML_SOLID, drawing::FillStyle_SOLID }, @@ -489,7 +489,7 @@ SvXMLEnumMapEntry const aXML_ConnectionKind_EnumMap[] = { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const aXML_BitmapMode_EnumMap[] = +SvXMLEnumMapEntry aXML_BitmapMode_EnumMap[] = { { XML_REPEAT, drawing::BitmapMode_REPEAT }, { XML_STRETCH, drawing::BitmapMode_STRETCH }, @@ -538,7 +538,7 @@ static SvXMLEnumMapEntry const aXML_TexMode_EnumMap[] = { XML_TOKEN_INVALID, 0 } }; -static SvXMLEnumMapEntry const aXML_RefPoint_EnumMap[] = +SvXMLEnumMapEntry aXML_RefPoint_EnumMap[] = { { XML_TOP_LEFT, drawing::RectanglePoint_LEFT_TOP }, { XML_TOP, drawing::RectanglePoint_MIDDLE_TOP }, diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx index 114319d4c18c..3cffbe180bb4 100644 --- a/xmloff/source/text/txtexppr.cxx +++ b/xmloff/source/text/txtexppr.cxx @@ -653,6 +653,10 @@ void XMLTextExportPropertySetMapper::ContextFilter( XMLPropertyState* pAllParaMargin = NULL; XMLPropertyState* pAllMargin = NULL; + //UUUU + XMLPropertyState* pRepeatOffsetX = NULL; + XMLPropertyState* pRepeatOffsetY = NULL; + sal_Bool bNeedsAnchor = sal_False; for( ::std::vector< XMLPropertyState >::iterator aIter = rProperties.begin(); @@ -789,9 +793,41 @@ void XMLTextExportPropertySetMapper::ContextFilter( case CTF_PARAMARGINALL_REL: pAllParaMarginRel = propertie; break; case CTF_PARAMARGINALL: pAllParaMargin = propertie; break; case CTF_MARGINALL: pAllMargin = propertie; break; + + //UUUU + case CTF_SW_REPEAT_OFFSET_X: + pRepeatOffsetX = propertie; + break; + + //UUUU + case CTF_SW_REPEAT_OFFSET_Y: + pRepeatOffsetY = propertie; + break; + + //UUUU + case CTF_SW_FILLGRADIENTNAME: + case CTF_SW_FILLHATCHNAME: + case CTF_SW_FILLBITMAPNAME: + case CTF_SW_FILLTRANSNAME: + { + OUString aStr; + if( (propertie->maValue >>= aStr) && 0 == aStr.getLength() ) + propertie->mnIndex = -1; + } + break; } } + //UUUU + if( pRepeatOffsetX && pRepeatOffsetY ) + { + sal_Int32 nOffset = 0; + if( ( pRepeatOffsetX->maValue >>= nOffset ) && ( nOffset == 0 ) ) + pRepeatOffsetX->mnIndex = -1; + else + pRepeatOffsetY->mnIndex = -1; + } + if( pFontNameState ) ContextFontFilter( bEnableFoFontFamily, pFontNameState, pFontFamilyNameState, pFontStyleNameState, pFontFamilyState, diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index 86ba23d758df..2e60acef7ef9 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -52,6 +52,8 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::style; using namespace ::com::sun::star::text; using namespace ::xmloff::token; +//UUUU +using namespace ::com::sun::star::drawing; static SvXMLEnumMapEntry const pXML_HoriPos_Enum[] = { @@ -1222,6 +1224,18 @@ public: ~XMLTextPropertyHandlerFactory_Impl(); }; +//UUUU +#include <xmloff/EnumPropertyHdl.hxx> +#include <com/sun/star/drawing/FillStyle.hpp> +#include "XMLFillBitmapSizePropertyHandler.hxx" +#include "XMLBitmapLogicalSizePropertyHandler.hxx" +#include <com/sun/star/drawing/RectanglePoint.hpp> +#include <com/sun/star/drawing/BitmapMode.hpp> +#include "XMLBitmapRepeatOffsetPropertyHandler.hxx" +extern SvXMLEnumMapEntry aXML_FillStyle_EnumMap[]; +extern SvXMLEnumMapEntry aXML_RefPoint_EnumMap[]; +extern SvXMLEnumMapEntry aXML_BitmapMode_EnumMap[]; + const XMLPropertyHandler *XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler ( sal_Int32 nType ) const { @@ -1390,12 +1404,31 @@ const XMLPropertyHandler *XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler case XML_TYPE_TEXT_NUMBER8_ONE_BASED: pHdl = new XMLNumber8OneBasedHdl(); break; - case XML_TYPE_FILLSTYLE: - pHdl = new XMLConstantsPropertyHandler( pXML_FillStyle_Enum, XML_TOKEN_INVALID ); - break; case XML_TYPE_VERTICAL_ALIGN: pHdl = new XMLConstantsPropertyHandler( pXML_VerticalAlign_Enum, XML_TOKEN_INVALID ); break; + + //UUUU + case XML_SW_TYPE_FILLSTYLE: + pHdl = new XMLEnumPropertyHdl( aXML_FillStyle_EnumMap, ::getCppuType((const FillStyle*)0) ); + break; + case XML_SW_TYPE_FILLBITMAPSIZE: + pHdl = new XMLFillBitmapSizePropertyHandler(); + break; + case XML_SW_TYPE_LOGICAL_SIZE: + pHdl = new XMLBitmapLogicalSizePropertyHandler(); + break; + case XML_SW_TYPE_BITMAP_REFPOINT: + pHdl = new XMLEnumPropertyHdl( aXML_RefPoint_EnumMap, getCppuType((const RectanglePoint*)0) ); + break; + case XML_SW_TYPE_BITMAP_MODE: + pHdl = new XMLEnumPropertyHdl( aXML_BitmapMode_EnumMap, getCppuType((const BitmapMode*)0) ); + break; + case XML_SW_TYPE_BITMAPREPOFFSETX: + case XML_SW_TYPE_BITMAPREPOFFSETY: + pHdl = new XMLBitmapRepeatOffsetPropertyHandler(XML_SW_TYPE_BITMAPREPOFFSETX == nType); + break; + } return pHdl; diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index b96a433defb7..175b70727181 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -77,6 +77,9 @@ using namespace ::xmloff::token; #define M_END() \ { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010, false } +//UUUU +#define _MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_010, false } +#define GMAP(name,prefix,token,type,context) _MAP(name,prefix,token,static_cast<sal_Int32>(type|XML_TYPE_PROP_GRAPHIC),context) XMLPropertyMapEntry aXMLParaPropMap[] = { @@ -687,11 +690,27 @@ XMLPropertyMapEntry aXMLFramePropMap[] = MG_E( "BackGraphicFilter",STYLE, FILTER_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_FILTER ), MG_E( "BackGraphicURL", STYLE, BACKGROUND_IMAGE, MID_FLAG_ELEMENT_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_URL ), - // RES_FILL_STYLE - MG_E( "FillStyle", DRAW, FILL, XML_TYPE_FILLSTYLE, 0 ), - - // RES_FILL_GRADIENT - MG_E( "FillGradientName", DRAW, FILL_GRADIENT_NAME, XML_TYPE_STYLENAME, 0 ), + //UUUU fill attributes + GMAP( "FillStyle", XML_NAMESPACE_DRAW, XML_FILL, XML_SW_TYPE_FILLSTYLE, 0 ), + GMAP( "FillColor", XML_NAMESPACE_DRAW, XML_FILL_COLOR, XML_TYPE_COLOR, 0 ), + GMAP( "FillColor2", XML_NAMESPACE_DRAW, XML_SECONDARY_FILL_COLOR, XML_TYPE_COLOR, 0 ), + GMAP( "FillGradientName", XML_NAMESPACE_DRAW, XML_FILL_GRADIENT_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_SW_FILLGRADIENTNAME ), + GMAP( "FillGradientStepCount", XML_NAMESPACE_DRAW, XML_GRADIENT_STEP_COUNT, XML_TYPE_NUMBER16, 0 ), + GMAP( "FillHatchName", XML_NAMESPACE_DRAW, XML_FILL_HATCH_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_SW_FILLHATCHNAME ), + GMAP( "FillBackground", XML_NAMESPACE_DRAW, XML_FILL_HATCH_SOLID, XML_TYPE_BOOL, 0 ), + GMAP( "FillBitmapName", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_SW_FILLBITMAPNAME ), + GMAP( "FillTransparence", XML_NAMESPACE_DRAW, XML_OPACITY, XML_TYPE_NEG_PERCENT16|MID_FLAG_MULTI_PROPERTY, 0 ), // exists in SW, too + GMAP( "FillTransparenceGradientName", XML_NAMESPACE_DRAW, XML_OPACITY_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_SW_FILLTRANSNAME ), + GMAP( "FillBitmapSizeX", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH, XML_SW_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, 0 ), + GMAP( "FillBitmapLogicalSize", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH, XML_SW_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, 0 ), + GMAP( "FillBitmapSizeY", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT, XML_SW_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, 0 ), + GMAP( "FillBitmapLogicalSize", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT, XML_SW_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, 0 ), + GMAP( "FillBitmapMode", XML_NAMESPACE_STYLE,XML_REPEAT, XML_SW_TYPE_BITMAP_MODE|MID_FLAG_MULTI_PROPERTY, 0 ), + GMAP( "FillBitmapPositionOffsetX", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT_X, XML_TYPE_PERCENT, 0 ), + GMAP( "FillBitmapPositionOffsetY", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT_Y, XML_TYPE_PERCENT, 0 ), + GMAP( "FillBitmapRectanglePoint", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT, XML_SW_TYPE_BITMAP_REFPOINT, 0 ), + GMAP( "FillBitmapOffsetX", XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET, XML_SW_TYPE_BITMAPREPOFFSETX|MID_FLAG_MULTI_PROPERTY, CTF_SW_REPEAT_OFFSET_X ), + GMAP( "FillBitmapOffsetY", XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET, XML_SW_TYPE_BITMAPREPOFFSETY|MID_FLAG_MULTI_PROPERTY, CTF_SW_REPEAT_OFFSET_Y ), // RES_BOX MG_ED( "LeftBorder", STYLE, BORDER_LINE_WIDTH, XML_TYPE_BORDER_WIDTH, CTF_ALLBORDERWIDTH ), |