diff options
author | Armin Le Grand <alg@apache.org> | 2014-06-02 15:00:50 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-07-01 13:30:09 +0200 |
commit | 7d9bb549d498d6beed2c4050c402d09643febdfa (patch) | |
tree | 2caf67e36c9ccd058268b003cf2bc39b9b102b53 /xmloff | |
parent | writerfilter/source: change directory dependencies to .../ooxml/.dir (diff) | |
download | core-7d9bb549d498d6beed2c4050c402d09643febdfa.tar.gz core-7d9bb549d498d6beed2c4050c402d09643febdfa.zip |
Related: #i124638# Second step of DrawingLayer FillAttributes...
for Writer objects, now added support for Paragraph and PageStyle (including
Header and Footer) for direct attributes and style attributes
(cherry picked from commit cc25c58f7052827bfebdc9fbeec668c8fa29ed1b)
Conflicts:
cui/source/factory/dlgfact.cxx
cui/source/factory/dlgfact.hxx
cui/source/inc/bbdlg.hxx
cui/source/inc/cuires.hrc
cui/source/tabpages/bbdlg.cxx
cui/source/tabpages/bbdlg.src
cui/source/tabpages/page.cxx
cui/source/tabpages/tparea.cxx
include/svx/pagectrl.hxx
include/svx/svxdlg.hxx
include/svx/svxids.hrc
include/xmloff/PageMasterStyleMap.hxx
include/xmloff/prstylei.hxx
include/xmloff/txtprmap.hxx
svx/Package_inc.mk
svx/inc/svx/hdft.hxx
svx/source/dialog/hdft.cxx
svx/source/dialog/pagectrl.cxx
svx/source/tbxctrls/tbxcolorupdate.cxx
svx/source/unodraw/unobrushitemhelper.cxx
sw/Library_sw.mk
sw/inc/fillattributes.hxx
sw/inc/format.hxx
sw/inc/frmatr.hxx
sw/inc/frmfmt.hxx
sw/inc/hintids.hxx
sw/inc/hints.hxx
sw/inc/ndtxt.hxx
sw/inc/node.hxx
sw/inc/swunohelper.hxx
sw/inc/unobrushitemhelper.hxx
sw/inc/unoprnms.hxx
sw/source/core/attr/format.cxx
sw/source/core/attr/hints.cxx
sw/source/core/doc/docdesc.cxx
sw/source/core/doc/docdraw.cxx
sw/source/core/doc/docfmt.cxx
sw/source/core/doc/docnew.cxx
sw/source/core/doc/docredln.cxx
sw/source/core/doc/poolfmt.cxx
sw/source/core/doc/visiturl.cxx
sw/source/core/docnode/node.cxx
sw/source/core/inc/frame.hxx
sw/source/core/inc/frmtool.hxx
sw/source/core/inc/rolbck.hxx
sw/source/core/layout/atrfrm.cxx
sw/source/core/layout/fillattributes.cxx
sw/source/core/layout/findfrm.cxx
sw/source/core/layout/paintfrm.cxx
sw/source/core/txtnode/ndtxt.cxx
sw/source/core/txtnode/thints.cxx
sw/source/core/txtnode/txtedt.cxx
sw/source/core/undo/rolbck.cxx
sw/source/core/unocore/swunohelper.cxx
sw/source/core/unocore/unoframe.cxx
sw/source/core/unocore/unomap.cxx
sw/source/core/unocore/unoparagraph.cxx
sw/source/core/unocore/unoprnms.cxx
sw/source/core/unocore/unostyle.cxx
sw/source/ui/chrdlg/paradlg.src
sw/source/ui/chrdlg/pardlg.cxx
sw/source/ui/fmtui/tmpdlg.cxx
sw/source/ui/fmtui/tmpdlg.src
sw/source/uibase/app/docst.cxx
sw/source/uibase/app/docstyle.cxx
sw/source/uibase/frmdlg/colex.cxx
sw/source/uibase/shells/basesh.cxx
sw/source/uibase/shells/textsh1.cxx
sw/source/uibase/uiview/viewstat.cxx
sw/source/uibase/utlui/uitool.cxx
xmloff/inc/PageMasterImportContext.hxx
xmloff/inc/xmloff/XMLShapeStyleContext.hxx
xmloff/source/draw/XMLShapeStyleContext.cxx
xmloff/source/draw/sdpropls.hxx
xmloff/source/style/PageMasterExportPropMapper.cxx
xmloff/source/style/PageMasterImportContext.cxx
xmloff/source/style/PageMasterPropHdlFactory.cxx
xmloff/source/style/PageMasterStyleMap.cxx
xmloff/source/style/prstylei.cxx
xmloff/source/text/txtexppr.cxx
xmloff/source/text/txtprhdl.cxx
xmloff/source/text/txtprmap.cxx
xmloff/source/text/txtstyli.cxx
Conflicts:
svx/source/dialog/hdft.cxx
sw/source/core/doc/visiturl.cxx
sw/source/core/txtnode/thints.cxx
sw/source/core/txtnode/txtatr2.cxx
sw/source/core/unocore/unostyle.cxx
Change-Id: I7e8779db6c0cbd1e242b63eab888f468f2de509a
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/PageMasterImportContext.hxx | 5 | ||||
-rw-r--r-- | xmloff/inc/xmlsdtypes.hxx | 204 | ||||
-rw-r--r-- | xmloff/source/draw/XMLShapeStyleContext.cxx | 72 | ||||
-rw-r--r-- | xmloff/source/draw/sdpropls.hxx | 156 | ||||
-rw-r--r-- | xmloff/source/style/PageMasterExportPropMapper.cxx | 116 | ||||
-rw-r--r-- | xmloff/source/style/PageMasterImportContext.cxx | 155 | ||||
-rw-r--r-- | xmloff/source/style/PageMasterPropHdlFactory.cxx | 44 | ||||
-rw-r--r-- | xmloff/source/style/PageMasterStyleMap.cxx | 324 | ||||
-rw-r--r-- | xmloff/source/style/prstylei.cxx | 257 | ||||
-rw-r--r-- | xmloff/source/style/xmlimppr.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/style/xmlprmap.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/text/txtexppr.cxx | 16 | ||||
-rw-r--r-- | xmloff/source/text/txtprhdl.cxx | 33 | ||||
-rw-r--r-- | xmloff/source/text/txtprmap.cxx | 41 | ||||
-rw-r--r-- | xmloff/source/text/txtstyli.cxx | 214 |
15 files changed, 1196 insertions, 445 deletions
diff --git a/xmloff/inc/PageMasterImportContext.hxx b/xmloff/inc/PageMasterImportContext.hxx index bf9306d27110..876773da9499 100644 --- a/xmloff/inc/PageMasterImportContext.hxx +++ b/xmloff/inc/PageMasterImportContext.hxx @@ -25,7 +25,12 @@ class PageStyleContext : public XMLPropStyleContext { +private: OUString sPageUsage; + + //UUUU + bool m_bIsFillStyleAlreadyConverted : 1; + protected: virtual void SetAttribute( sal_uInt16 nPrefixKey, diff --git a/xmloff/inc/xmlsdtypes.hxx b/xmloff/inc/xmlsdtypes.hxx new file mode 100644 index 000000000000..fb13d9f1e77b --- /dev/null +++ b/xmloff/inc/xmlsdtypes.hxx @@ -0,0 +1,204 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _XMLSDTYPES_HXX +#define _XMLSDTYPES_HXX + +//#include <xmloff/xmlnume.hxx> +//#include <xmloff/maptype.hxx> +#include <xmloff/xmltypes.hxx> +//#include <xmloff/xmlement.hxx> +//#include <xmloff/prhdlfac.hxx> +//#include <xmloff/xmlprmap.hxx> +//#include "xmloff/XMLTextListAutoStylePool.hxx" +//#include <xmloff/xmlexppr.hxx> + +////////////////////////////////////////////////////////////////////////////// +// types of own properties + +#define XML_SD_TYPE_STROKE (XML_SD_TYPES_START + 0) +#define XML_SD_TYPE_PRESPAGE_TYPE (XML_SD_TYPES_START + 1) +#define XML_SD_TYPE_PRESPAGE_STYLE (XML_SD_TYPES_START + 2) +#define XML_SD_TYPE_PRESPAGE_SPEED (XML_SD_TYPES_START + 3) +#define XML_SD_TYPE_PRESPAGE_DURATION (XML_SD_TYPES_START + 4) +#define XML_SD_TYPE_PRESPAGE_VISIBILITY (XML_SD_TYPES_START + 5) +#define XML_SD_TYPE_MARKER (XML_SD_TYPES_START + 6 ) +#define XML_SD_TYPE_OPACITY (XML_SD_TYPES_START + 7 ) +#define XML_SD_TYPE_LINEJOIN (XML_SD_TYPES_START + 8 ) +#define XML_SD_TYPE_FILLSTYLE (XML_SD_TYPES_START + 9 ) +#define XML_SD_TYPE_GRADIENT (XML_SD_TYPES_START + 10 ) +#define XML_SD_TYPE_GRADIENT_STEPCOUNT (XML_SD_TYPES_START + 11 ) +#define XML_SD_TYPE_SHADOW (XML_SD_TYPES_START + 12 ) +#define XML_SD_TYPE_TEXT_CROSSEDOUT (XML_SD_TYPES_START + 13 ) +#define XML_SD_TYPE_NUMBULLET (XML_SD_TYPES_START + 14 ) +#define XML_SD_TYPE_WRITINGMODE (XML_SD_TYPES_START + 15 ) +#define XML_SD_TYPE_BITMAP_MODE (XML_SD_TYPES_START + 16 ) +#define XML_SD_TYPE_BITMAPREPOFFSETX (XML_SD_TYPES_START + 17 ) +#define XML_SD_TYPE_BITMAPREPOFFSETY (XML_SD_TYPES_START + 18 ) +#define XML_SD_TYPE_FILLBITMAPSIZE (XML_SD_TYPES_START + 19 ) +#define XML_SD_TYPE_LOGICAL_SIZE (XML_SD_TYPES_START + 20 ) +#define XML_SD_TYPE_BITMAP_REFPOINT (XML_SD_TYPES_START + 21 ) +#define XML_SD_TYPE_PRESPAGE_BACKSIZE (XML_SD_TYPES_START + 22 ) +#define XML_TYPE_TEXT_ANIMATION_BLINKING (XML_SD_TYPES_START + 23 ) +#define XML_TYPE_TEXT_ANIMATION_STEPS (XML_SD_TYPES_START + 24 ) +#define XML_SD_TYPE_TEXT_ALIGN (XML_SD_TYPES_START + 25 ) +#define XML_SD_TYPE_VERTICAL_ALIGN (XML_SD_TYPES_START + 26 ) +#define XML_SD_TYPE_FITTOSIZE (XML_SD_TYPES_START + 27 ) +#define XML_SD_TYPE_MEASURE_HALIGN (XML_SD_TYPES_START + 28 ) +#define XML_SD_TYPE_MEASURE_VALIGN (XML_SD_TYPES_START + 29 ) +#define XML_SD_TYPE_MEASURE_UNIT (XML_SD_TYPES_START + 30 ) +#define XML_SD_TYPE_MEASURE_PLACING (XML_SD_TYPES_START + 31 ) +#define XML_SD_TYPE_CONTROL_BORDER (XML_SD_TYPES_START + 32 ) +#define XML_SD_TYPE_CONTROL_BORDER_COLOR (XML_SD_TYPES_START + 33 ) +#define XML_SD_TYPE_IMAGE_SCALE_MODE (XML_SD_TYPES_START + 34 ) +#define XML_SD_TYPE_LINECAP (XML_SD_TYPES_START + 35 ) + +////////////////////////////////////////////////////////////////////////////// +// 3D property types +#define XML_SD_TYPE_BACKFACE_CULLING (XML_SD_TYPES_START + 40 ) +#define XML_SD_TYPE_NORMALS_KIND (XML_SD_TYPES_START + 41 ) +#define XML_SD_TYPE_NORMALS_DIRECTION (XML_SD_TYPES_START + 42 ) +#define XML_SD_TYPE_TEX_GENERATION_MODE_X (XML_SD_TYPES_START + 43 ) +#define XML_SD_TYPE_TEX_GENERATION_MODE_Y (XML_SD_TYPES_START + 44 ) +#define XML_SD_TYPE_TEX_KIND (XML_SD_TYPES_START + 45 ) +#define XML_SD_TYPE_TEX_MODE (XML_SD_TYPES_START + 46 ) + +////////////////////////////////////////////////////////////////////////////// +// #FontWork# types +#define XML_SD_TYPE_FONTWORK_STYLE (XML_SD_TYPES_START + 47 ) +#define XML_SD_TYPE_FONTWORK_ADJUST (XML_SD_TYPES_START + 48 ) +#define XML_SD_TYPE_FONTWORK_SHADOW (XML_SD_TYPES_START + 49 ) +#define XML_SD_TYPE_FONTWORK_FORM (XML_SD_TYPES_START + 50 ) + +////////////////////////////////////////////////////////////////////////////// +// Caption types +#define XML_SD_TYPE_CAPTION_ANGLE_TYPE (XML_SD_TYPES_START + 60 ) +#define XML_SD_TYPE_CAPTION_IS_ESC_REL (XML_SD_TYPES_START + 61 ) +#define XML_SD_TYPE_CAPTION_ESC_REL (XML_SD_TYPES_START + 62 ) +#define XML_SD_TYPE_CAPTION_ESC_ABS (XML_SD_TYPES_START + 63 ) +#define XML_SD_TYPE_CAPTION_ESC_DIR (XML_SD_TYPES_START + 64 ) +#define XML_SD_TYPE_CAPTION_TYPE (XML_SD_TYPES_START + 65 ) + +////////////////////////////////////////////////////////////////////////////// +// header & footer types +#define XML_SD_TYPE_DATETIMEUPDATE (XML_SD_TYPES_START + 70 ) +#define XML_SD_TYPE_DATETIME_FORMAT (XML_SD_TYPES_START + 71 ) + +////////////////////////////////////////////////////////////////////////////// +// new types for merged style:protect attribute +#define XML_SD_TYPE_MOVE_PROTECT (XML_SD_TYPES_START + 72 ) +#define XML_SD_TYPE_SIZE_PROTECT (XML_SD_TYPES_START + 73 ) + +////////////////////////////////////////////////////////////////////////////// +// new type for style:mirror attribute +#define XML_TYPE_SD_MIRROR (XML_SD_TYPES_START + 74 ) + +////////////////////////////////////////////////////////////////////////////// +// new smil transition types for pages +#define XML_SD_TYPE_TRANSITION_TYPE (XML_SD_TYPES_START + 75 ) +#define XML_SD_TYPE_TRANSTIION_SUBTYPE (XML_SD_TYPES_START + 76 ) +#define XML_SD_TYPE_TRANSTIION_DIRECTION (XML_SD_TYPES_START + 77 ) +#define XML_SD_TYPE_HEADER_FOOTER_VISIBILITY_TYPE (XML_SD_TYPES_START + 78 ) + +////////////////////////////////////////////////////////////////////////////// + +#define CTF_NUMBERINGRULES 1000 +#define CTF_CONTROLWRITINGMODE 1001 +#define CTF_WRITINGMODE 1002 +#define CTF_REPEAT_OFFSET_X 1003 +#define CTF_REPEAT_OFFSET_Y 1004 +#define CTF_PAGE_SOUND_URL 1005 +#define CTF_PAGE_VISIBLE 1006 +#define CTF_PAGE_TRANS_TYPE 1007 +#define CTF_PAGE_TRANS_STYLE 1008 +#define CTF_PAGE_TRANS_SPEED 1009 +#define CTF_PAGE_TRANS_DURATION 1010 +#define CTF_PAGE_BACKSIZE 1011 +#define CTF_DASHNAME 1012 +#define CTF_LINESTARTNAME 1013 +#define CTF_LINEENDNAME 1014 +#define CTF_FILLGRADIENTNAME 1015 +#define CTF_FILLHATCHNAME 1016 +#define CTF_FILLBITMAPNAME 1017 +#define CTF_FILLTRANSNAME 1018 +#define CTF_TEXTANIMATION_BLINKING 1019 +#define CTF_TEXTANIMATION_KIND 1020 + +#define CTF_PAGE_TRANSITION_TYPE 1021 +#define CTF_PAGE_TRANSITION_SUBTYPE 1022 +#define CTF_PAGE_TRANSITION_DIRECTION 1023 +#define CTF_PAGE_TRANSITION_FADECOLOR 1024 + +////////////////////////////////////////////////////////////////////////////// +// #FontWork# +#define CTF_FONTWORK_STYLE 1021 +#define CTF_FONTWORK_ADJUST 1022 +#define CTF_FONTWORK_DISTANCE 1023 +#define CTF_FONTWORK_START 1024 +#define CTF_FONTWORK_MIRROR 1025 +#define CTF_FONTWORK_OUTLINE 1026 +#define CTF_FONTWORK_SHADOW 1027 +#define CTF_FONTWORK_SHADOWCOLOR 1028 +#define CTF_FONTWORK_SHADOWOFFSETX 1029 +#define CTF_FONTWORK_SHADOWOFFSETY 1030 +#define CTF_FONTWORK_FORM 1031 +#define CTF_FONTWORK_HIDEFORM 1032 +#define CTF_FONTWORK_SHADOWTRANSPARENCE 1033 + +////////////////////////////////////////////////////////////////////////////// +// OLE part 1 +#define CTF_SD_OLE_VIS_AREA_IMPORT_LEFT 1040 +#define CTF_SD_OLE_VIS_AREA_IMPORT_TOP 1041 +#define CTF_SD_OLE_VIS_AREA_IMPORT_WIDTH 1042 +#define CTF_SD_OLE_VIS_AREA_IMPORT_HEIGHT 1043 +#define CTF_SD_OLE_ISINTERNAL 1044 + +#define CTF_SD_MOVE_PROTECT 1045 +#define CTF_SD_SIZE_PROTECT 1046 + +////////////////////////////////////////////////////////////////////////////// +// caption +#define CTF_CAPTION_ISESCREL 1047 +#define CTF_CAPTION_ESCREL 1048 +#define CTF_CAPTION_ESCABS 1049 + +////////////////////////////////////////////////////////////////////////////// +// header&footer +#define CTF_HEADER_VISIBLE 1050 +#define CTF_FOOTER_VISIBLE 1051 +#define CTF_PAGE_NUMBER_VISIBLE 1052 +#define CTF_DATE_TIME_VISIBLE 1053 +#define CTF_HEADER_TEXT 1054 +#define CTF_FOOTER_TEXT 1055 +#define CTF_DATE_TIME_TEXT 1056 +#define CTF_DATE_TIME_FORMAT 1057 +#define CTF_DATE_TIME_UPDATE 1058 + +////////////////////////////////////////////////////////////////////////////// +// OLE part 2 +#define CTF_SD_OLE_ASPECT 1059 +#define CTF_SD_OLE_VIS_AREA_EXPORT_LEFT 1060 +#define CTF_SD_OLE_VIS_AREA_EXPORT_TOP 1061 +#define CTF_SD_OLE_VIS_AREA_EXPORT_WIDTH 1062 +#define CTF_SD_OLE_VIS_AREA_EXPORT_HEIGHT 1063 + +////////////////////////////////////////////////////////////////////////////// + +#endif // _XMLSDTYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/draw/XMLShapeStyleContext.cxx b/xmloff/source/draw/XMLShapeStyleContext.cxx index fad397572064..5ee61370ebff 100644 --- a/xmloff/source/draw/XMLShapeStyleContext.cxx +++ b/xmloff/source/draw/XMLShapeStyleContext.cxx @@ -54,7 +54,7 @@ XMLShapeStyleContext::XMLShapeStyleContext( sal_uInt16 nFamily) : XMLPropStyleContext(rImport, nPrfx, rLName, xAttrList, rStyles, nFamily ), m_bIsNumRuleAlreadyConverted( false ), - m_bIsFillStyleAlreadyConverted( false ) //UUUU + m_bIsFillStyleAlreadyConverted(false) //UUUU { } @@ -186,77 +186,15 @@ void XMLShapeStyleContext::FillPropertySet( const Reference< beans::XPropertySet } } + //UUUU need to filter out old fill definitions when the new ones are used. The new + // ones are used when a FillStyle is defined if(!m_bIsFillStyleAlreadyConverted && GetProperties().size()) { - const UniReference< XMLPropertySetMapper >&rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper(); - ::std::vector< XMLPropertyState >& rProperties = GetProperties(); - ::std::vector< XMLPropertyState >::iterator a; - FillStyle eFS(FillStyle_NONE); static ::rtl::OUString s_FillStyle(RTL_CONSTASCII_USTRINGPARAM("FillStyle")); - // try to find a FillStyle entry and a value from it - for(a = rProperties.begin(); a != rProperties.end(); ++a) + if(doNewDrawingLayerFillStyleDefinitionsExist(s_FillStyle)) { - if(a->mnIndex != -1) - { - const OUString& rPropName = rMapper->GetEntryAPIName(a->mnIndex); - - if(rPropName == s_FillStyle) - { - if(a->maValue >>= eFS) - { - // okay, type was good, eFS is set - } - else - { - // also try an int (see XFillStyleItem::PutValue) - sal_Int32 nFS = 0; - - if(a->maValue >>= nFS) - { - eFS = (FillStyle)nFS; - } - } - - // exit loop, we found out what we needed to know - break; - } - } - } - - if(FillStyle_NONE != eFS) - { - //UUUU a FillStyle was found, thus the new [XATTR_FILL_FIRST .. XATTR_FILL_LAST] - // description for the Fill definitions is used. All formally used props based - // on RES_BACKGROUND need to be deleted to get no conflicts between the two - // sets of properties; old files will keep these and adapt accordingly - static ::rtl::OUString s_BackColorRGB(RTL_CONSTASCII_USTRINGPARAM("BackColorRGB")); - static ::rtl::OUString s_BackTransparent(RTL_CONSTASCII_USTRINGPARAM("BackTransparent")); - static ::rtl::OUString s_BackColorTransparency(RTL_CONSTASCII_USTRINGPARAM("BackColorTransparency")); - static ::rtl::OUString s_BackGraphicURL(RTL_CONSTASCII_USTRINGPARAM("BackGraphicURL")); - static ::rtl::OUString s_BackGraphicFilter(RTL_CONSTASCII_USTRINGPARAM("BackGraphicFilter")); - static ::rtl::OUString s_BackGraphicLocation(RTL_CONSTASCII_USTRINGPARAM("BackGraphicLocation")); - static ::rtl::OUString s_BackGraphicTransparency(RTL_CONSTASCII_USTRINGPARAM("BackGraphicTransparency")); - - for(a = rProperties.begin(); a != rProperties.end(); ++a) - { - if(a->mnIndex != -1) - { - const OUString& rPropName = rMapper->GetEntryAPIName(a->mnIndex); - - if(s_BackColorRGB == rPropName - || s_BackTransparent == rPropName - || s_BackColorTransparency == rPropName - || s_BackGraphicURL == rPropName - || s_BackGraphicFilter == rPropName - || s_BackGraphicLocation == rPropName - || s_BackGraphicTransparency== rPropName) - { - // mark entry as inactive - a->mnIndex = -1; - } - } - } + deactivateOldFillStyleDefinitions(getStandardSet()); } m_bIsFillStyleAlreadyConverted = true; diff --git a/xmloff/source/draw/sdpropls.hxx b/xmloff/source/draw/sdpropls.hxx index 7f0247f2d508..d784a2f4c5c3 100644 --- a/xmloff/source/draw/sdpropls.hxx +++ b/xmloff/source/draw/sdpropls.hxx @@ -28,6 +28,7 @@ #include <xmloff/prhdlfac.hxx> #include <xmloff/xmlprmap.hxx> #include <xmloff/xmlexppr.hxx> +#include <xmlsdtypes.hxx> // entry list for graphic properties @@ -38,161 +39,6 @@ extern const XMLPropertyMapEntry aXMLSDProperties[]; extern const XMLPropertyMapEntry aXMLSDPresPageProps[]; extern const XMLPropertyMapEntry aXMLSDPresPageProps_onlyHeadersFooter[]; -// types of own properties - -#define XML_SD_TYPE_STROKE (XML_SD_TYPES_START + 0) -#define XML_SD_TYPE_PRESPAGE_TYPE (XML_SD_TYPES_START + 1) -#define XML_SD_TYPE_PRESPAGE_STYLE (XML_SD_TYPES_START + 2) -#define XML_SD_TYPE_PRESPAGE_SPEED (XML_SD_TYPES_START + 3) -#define XML_SD_TYPE_PRESPAGE_DURATION (XML_SD_TYPES_START + 4) -#define XML_SD_TYPE_PRESPAGE_VISIBILITY (XML_SD_TYPES_START + 5) -#define XML_SD_TYPE_MARKER (XML_SD_TYPES_START + 6 ) -#define XML_SD_TYPE_OPACITY (XML_SD_TYPES_START + 7 ) -#define XML_SD_TYPE_LINEJOIN (XML_SD_TYPES_START + 8 ) -#define XML_SD_TYPE_FILLSTYLE (XML_SD_TYPES_START + 9 ) -#define XML_SD_TYPE_GRADIENT (XML_SD_TYPES_START + 10 ) -#define XML_SD_TYPE_GRADIENT_STEPCOUNT (XML_SD_TYPES_START + 11 ) -#define XML_SD_TYPE_SHADOW (XML_SD_TYPES_START + 12 ) -#define XML_SD_TYPE_TEXT_CROSSEDOUT (XML_SD_TYPES_START + 13 ) -#define XML_SD_TYPE_NUMBULLET (XML_SD_TYPES_START + 14 ) -#define XML_SD_TYPE_WRITINGMODE (XML_SD_TYPES_START + 15 ) -#define XML_SD_TYPE_BITMAP_MODE (XML_SD_TYPES_START + 16 ) -#define XML_SD_TYPE_BITMAPREPOFFSETX (XML_SD_TYPES_START + 17 ) -#define XML_SD_TYPE_BITMAPREPOFFSETY (XML_SD_TYPES_START + 18 ) -#define XML_SD_TYPE_FILLBITMAPSIZE (XML_SD_TYPES_START + 19 ) -#define XML_SD_TYPE_LOGICAL_SIZE (XML_SD_TYPES_START + 20 ) -#define XML_SD_TYPE_BITMAP_REFPOINT (XML_SD_TYPES_START + 21 ) -#define XML_SD_TYPE_PRESPAGE_BACKSIZE (XML_SD_TYPES_START + 22 ) -#define XML_TYPE_TEXT_ANIMATION_BLINKING (XML_SD_TYPES_START + 23 ) -#define XML_TYPE_TEXT_ANIMATION_STEPS (XML_SD_TYPES_START + 24 ) -#define XML_SD_TYPE_TEXT_ALIGN (XML_SD_TYPES_START + 25 ) -#define XML_SD_TYPE_VERTICAL_ALIGN (XML_SD_TYPES_START + 26 ) -#define XML_SD_TYPE_FITTOSIZE (XML_SD_TYPES_START + 27 ) -#define XML_SD_TYPE_MEASURE_HALIGN (XML_SD_TYPES_START + 28 ) -#define XML_SD_TYPE_MEASURE_VALIGN (XML_SD_TYPES_START + 29 ) -#define XML_SD_TYPE_MEASURE_UNIT (XML_SD_TYPES_START + 30 ) -#define XML_SD_TYPE_MEASURE_PLACING (XML_SD_TYPES_START + 31 ) -#define XML_SD_TYPE_CONTROL_BORDER (XML_SD_TYPES_START + 32 ) -#define XML_SD_TYPE_CONTROL_BORDER_COLOR (XML_SD_TYPES_START + 33 ) -#define XML_SD_TYPE_IMAGE_SCALE_MODE (XML_SD_TYPES_START + 34 ) -#define XML_SD_TYPE_LINECAP (XML_SD_TYPES_START + 35 ) - -// 3D property types -#define XML_SD_TYPE_BACKFACE_CULLING (XML_SD_TYPES_START + 40 ) -#define XML_SD_TYPE_NORMALS_KIND (XML_SD_TYPES_START + 41 ) -#define XML_SD_TYPE_NORMALS_DIRECTION (XML_SD_TYPES_START + 42 ) -#define XML_SD_TYPE_TEX_GENERATION_MODE_X (XML_SD_TYPES_START + 43 ) -#define XML_SD_TYPE_TEX_GENERATION_MODE_Y (XML_SD_TYPES_START + 44 ) -#define XML_SD_TYPE_TEX_KIND (XML_SD_TYPES_START + 45 ) -#define XML_SD_TYPE_TEX_MODE (XML_SD_TYPES_START + 46 ) - -// #FontWork# types -#define XML_SD_TYPE_FONTWORK_STYLE (XML_SD_TYPES_START + 47 ) -#define XML_SD_TYPE_FONTWORK_ADJUST (XML_SD_TYPES_START + 48 ) -#define XML_SD_TYPE_FONTWORK_SHADOW (XML_SD_TYPES_START + 49 ) -#define XML_SD_TYPE_FONTWORK_FORM (XML_SD_TYPES_START + 50 ) - -// Caption types -#define XML_SD_TYPE_CAPTION_ANGLE_TYPE (XML_SD_TYPES_START + 60 ) -#define XML_SD_TYPE_CAPTION_IS_ESC_REL (XML_SD_TYPES_START + 61 ) -#define XML_SD_TYPE_CAPTION_ESC_REL (XML_SD_TYPES_START + 62 ) -#define XML_SD_TYPE_CAPTION_ESC_ABS (XML_SD_TYPES_START + 63 ) -#define XML_SD_TYPE_CAPTION_ESC_DIR (XML_SD_TYPES_START + 64 ) -#define XML_SD_TYPE_CAPTION_TYPE (XML_SD_TYPES_START + 65 ) - -// header & footer types -#define XML_SD_TYPE_DATETIMEUPDATE (XML_SD_TYPES_START + 70 ) -#define XML_SD_TYPE_DATETIME_FORMAT (XML_SD_TYPES_START + 71 ) - -// new types for merged style:protect attribute -#define XML_SD_TYPE_MOVE_PROTECT (XML_SD_TYPES_START + 72 ) -#define XML_SD_TYPE_SIZE_PROTECT (XML_SD_TYPES_START + 73 ) - -// new type for style:mirror attribute -#define XML_TYPE_SD_MIRROR (XML_SD_TYPES_START + 74 ) - -// new smil transition types for pages -#define XML_SD_TYPE_TRANSITION_TYPE (XML_SD_TYPES_START + 75 ) -#define XML_SD_TYPE_TRANSTIION_SUBTYPE (XML_SD_TYPES_START + 76 ) -#define XML_SD_TYPE_TRANSTIION_DIRECTION (XML_SD_TYPES_START + 77 ) - -#define XML_SD_TYPE_HEADER_FOOTER_VISIBILITY_TYPE (XML_SD_TYPES_START + 78 ) - -#define CTF_NUMBERINGRULES 1000 -#define CTF_CONTROLWRITINGMODE 1001 -#define CTF_WRITINGMODE 1002 -#define CTF_REPEAT_OFFSET_X 1003 -#define CTF_REPEAT_OFFSET_Y 1004 -#define CTF_PAGE_SOUND_URL 1005 -#define CTF_PAGE_VISIBLE 1006 -#define CTF_PAGE_TRANS_TYPE 1007 -#define CTF_PAGE_TRANS_STYLE 1008 -#define CTF_PAGE_TRANS_SPEED 1009 -#define CTF_PAGE_TRANS_DURATION 1010 -#define CTF_PAGE_BACKSIZE 1011 -#define CTF_DASHNAME 1012 -#define CTF_LINESTARTNAME 1013 -#define CTF_LINEENDNAME 1014 -#define CTF_FILLGRADIENTNAME 1015 -#define CTF_FILLHATCHNAME 1016 -#define CTF_FILLBITMAPNAME 1017 -#define CTF_FILLTRANSNAME 1018 -#define CTF_TEXTANIMATION_BLINKING 1019 -#define CTF_TEXTANIMATION_KIND 1020 - -#define CTF_PAGE_TRANSITION_TYPE 1021 -#define CTF_PAGE_TRANSITION_SUBTYPE 1022 -#define CTF_PAGE_TRANSITION_DIRECTION 1023 -#define CTF_PAGE_TRANSITION_FADECOLOR 1024 - -// #FontWork# -#define CTF_FONTWORK_STYLE 1021 -#define CTF_FONTWORK_ADJUST 1022 -#define CTF_FONTWORK_DISTANCE 1023 -#define CTF_FONTWORK_START 1024 -#define CTF_FONTWORK_MIRROR 1025 -#define CTF_FONTWORK_OUTLINE 1026 -#define CTF_FONTWORK_SHADOW 1027 -#define CTF_FONTWORK_SHADOWCOLOR 1028 -#define CTF_FONTWORK_SHADOWOFFSETX 1029 -#define CTF_FONTWORK_SHADOWOFFSETY 1030 -#define CTF_FONTWORK_FORM 1031 -#define CTF_FONTWORK_HIDEFORM 1032 -#define CTF_FONTWORK_SHADOWTRANSPARENCE 1033 - -// OLE part 1 -#define CTF_SD_OLE_VIS_AREA_IMPORT_LEFT 1040 -#define CTF_SD_OLE_VIS_AREA_IMPORT_TOP 1041 -#define CTF_SD_OLE_VIS_AREA_IMPORT_WIDTH 1042 -#define CTF_SD_OLE_VIS_AREA_IMPORT_HEIGHT 1043 -#define CTF_SD_OLE_ISINTERNAL 1044 - -#define CTF_SD_MOVE_PROTECT 1045 -#define CTF_SD_SIZE_PROTECT 1046 - -// caption -#define CTF_CAPTION_ISESCREL 1047 -#define CTF_CAPTION_ESCREL 1048 -#define CTF_CAPTION_ESCABS 1049 - -// header&footer -#define CTF_HEADER_VISIBLE 1050 -#define CTF_FOOTER_VISIBLE 1051 -#define CTF_PAGE_NUMBER_VISIBLE 1052 -#define CTF_DATE_TIME_VISIBLE 1053 -#define CTF_HEADER_TEXT 1054 -#define CTF_FOOTER_TEXT 1055 -#define CTF_DATE_TIME_TEXT 1056 -#define CTF_DATE_TIME_FORMAT 1057 -#define CTF_DATE_TIME_UPDATE 1058 - -// OLE part 2 -#define CTF_SD_OLE_ASPECT 1059 -#define CTF_SD_OLE_VIS_AREA_EXPORT_LEFT 1060 -#define CTF_SD_OLE_VIS_AREA_EXPORT_TOP 1061 -#define CTF_SD_OLE_VIS_AREA_EXPORT_WIDTH 1062 -#define CTF_SD_OLE_VIS_AREA_EXPORT_HEIGHT 1063 - // enum maps for attributes extern SvXMLEnumMapEntry const aXML_ConnectionKind_EnumMap[]; diff --git a/xmloff/source/style/PageMasterExportPropMapper.cxx b/xmloff/source/style/PageMasterExportPropMapper.cxx index b8b2ada6dcb3..17a9522a817d 100644 --- a/xmloff/source/style/PageMasterExportPropMapper.cxx +++ b/xmloff/source/style/PageMasterExportPropMapper.cxx @@ -26,6 +26,9 @@ #include <rtl/ustrbuf.hxx> #include <comphelper/extract.hxx> +//UUUU +#include <xmloff/txtprmap.hxx> + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -332,6 +335,14 @@ void XMLPageMasterExportPropMapper::ContextFilter( XMLPropertyState* pPrint = NULL; + //UUUU + XMLPropertyState* pRepeatOffsetX = NULL; + XMLPropertyState* pRepeatOffsetY = NULL; + XMLPropertyState* pHeaderRepeatOffsetX = NULL; + XMLPropertyState* pHeaderRepeatOffsetY = NULL; + XMLPropertyState* pFooterRepeatOffsetX = NULL; + XMLPropertyState* pFooterRepeatOffsetY = NULL; + UniReference < XMLPropertySetMapper > aPropMapper(getPropertySetMapper()); for( ::std::vector< XMLPropertyState >::iterator aIter = rPropState.begin(); aIter != rPropState.end(); ++aIter ) @@ -390,7 +401,64 @@ void XMLPageMasterExportPropMapper::ContextFilter( case CTP_PM_GRID_BASE_WIDTH: pPMGridBaseWidth = pProp; break; case CTP_PM_GRID_SNAP_TO_CHARS: pPMGridSnapToChars = pProp; break; case CTP_PM_GRID_SNAP_TO: pPMGridSnapTo = pProp; break; + + //UUUU + case CTF_PM_REPEAT_OFFSET_X: + pRepeatOffsetX = pProp; + break; + + //UUUU + case CTF_PM_REPEAT_OFFSET_Y: + pRepeatOffsetY = pProp; + break; + + //UUUU + case CTF_PM_HEADERREPEAT_OFFSET_X: + pHeaderRepeatOffsetX = pProp; + break; + + //UUUU + case CTF_PM_HEADERREPEAT_OFFSET_Y: + pHeaderRepeatOffsetY = pProp; + break; + + //UUUU + case CTF_PM_FOOTERREPEAT_OFFSET_X: + pFooterRepeatOffsetX = pProp; + break; + + //UUUU + case CTF_PM_FOOTERREPEAT_OFFSET_Y: + pFooterRepeatOffsetY = pProp; + break; + + //UUUU Sort out empty entries + case CTF_PM_FILLGRADIENTNAME: + case CTF_PM_FILLHATCHNAME: + case CTF_PM_FILLBITMAPNAME: + case CTF_PM_FILLTRANSNAME: + + case CTF_PM_HEADERFILLGRADIENTNAME: + case CTF_PM_HEADERFILLHATCHNAME: + case CTF_PM_HEADERFILLBITMAPNAME: + case CTF_PM_HEADERFILLTRANSNAME: + + case CTF_PM_FOOTERFILLGRADIENTNAME: + case CTF_PM_FOOTERFILLHATCHNAME: + case CTF_PM_FOOTERFILLBITMAPNAME: + case CTF_PM_FOOTERFILLTRANSNAME: + { + rtl::OUString aStr; + + if( (pProp->maValue >>= aStr) && 0 == aStr.getLength() ) + { + pProp->mnIndex = -1; + } + + break; + } } + if (nPrintId == CTF_PM_PRINTMASK) { pPrint = pProp; @@ -398,6 +466,54 @@ void XMLPageMasterExportPropMapper::ContextFilter( } } + //UUUU These entries need to be reduced to a single one for XML export. + // Both would be exported as 'draw:tile-repeat-offset' following a percent + // value and a 'vertical' or 'horizontal' tag as mark. If both would be active + // and both would be exported this would create an XML error (same property twice) + if(pRepeatOffsetX && pRepeatOffsetY) + { + sal_Int32 nOffset(0); + + if((pRepeatOffsetX->maValue >>= nOffset) && (!nOffset)) + { + pRepeatOffsetX->mnIndex = -1; + } + else + { + pRepeatOffsetY->mnIndex = -1; + } + } + + //UUUU Same as above for Header + if(pHeaderRepeatOffsetX && pHeaderRepeatOffsetY) + { + sal_Int32 nOffset(0); + + if((pHeaderRepeatOffsetX->maValue >>= nOffset) && (!nOffset)) + { + pHeaderRepeatOffsetX->mnIndex = -1; + } + else + { + pHeaderRepeatOffsetY->mnIndex = -1; + } + } + + //UUUU Same as above for Footer + if(pFooterRepeatOffsetX && pFooterRepeatOffsetY) + { + sal_Int32 nOffset(0); + + if((pFooterRepeatOffsetX->maValue >>= nOffset) && (!nOffset)) + { + pFooterRepeatOffsetX->mnIndex = -1; + } + else + { + pFooterRepeatOffsetY->mnIndex = -1; + } + } + if( pPMStandardMode && !getBOOL(pPMStandardMode->maValue) ) { lcl_RemoveState(pPMStandardMode); diff --git a/xmloff/source/style/PageMasterImportContext.cxx b/xmloff/source/style/PageMasterImportContext.cxx index c2589eb07a5b..a88d204462ef 100644 --- a/xmloff/source/style/PageMasterImportContext.cxx +++ b/xmloff/source/style/PageMasterImportContext.cxx @@ -28,11 +28,19 @@ #include <xmloff/PageMasterStyleMap.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +//UUUU +#include <xmlsdtypes.hxx> +#include <com/sun/star/beans/XPropertySetInfo.hpp> +#include <xmloff/xmlerror.hxx> + using namespace ::com::sun::star; using namespace ::xmloff::token; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; +//UUUU +using namespace ::com::sun::star::beans; + void PageStyleContext::SetAttribute( sal_uInt16 nPrefixKey, const OUString& rLocalName, const OUString& rValue ) @@ -56,7 +64,8 @@ PageStyleContext::PageStyleContext( SvXMLImport& rImport, SvXMLStylesContext& rStyles, bool bDefaultStyle) : XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, XML_STYLE_FAMILY_PAGE_MASTER, bDefaultStyle), - sPageUsage() + sPageUsage(), + m_bIsFillStyleAlreadyConverted(false) //UUUU { } @@ -153,10 +162,148 @@ SvXMLImportContext *PageStyleContext::CreateChildContext( return pContext; } -void PageStyleContext::FillPropertySet( - const uno::Reference<beans::XPropertySet > & rPropSet ) +void PageStyleContext::FillPropertySet(const uno::Reference<beans::XPropertySet > & rPropSet) { - XMLPropStyleContext::FillPropertySet(rPropSet); + //UUUU need to filter out old fill definitions when the new ones are used. The new + // ones are used when a FillStyle is defined + if(!m_bIsFillStyleAlreadyConverted && GetProperties().size()) + { + static ::rtl::OUString s_FillStyle(RTL_CONSTASCII_USTRINGPARAM("FillStyle")); + static ::rtl::OUString s_HeaderFillStyle(RTL_CONSTASCII_USTRINGPARAM("HeaderFillStyle")); + static ::rtl::OUString s_FooterFillStyle(RTL_CONSTASCII_USTRINGPARAM("FooterFillStyle")); + + if(doNewDrawingLayerFillStyleDefinitionsExist(s_FillStyle)) + { + deactivateOldFillStyleDefinitions(getStandardSet()); + } + + if(doNewDrawingLayerFillStyleDefinitionsExist(s_HeaderFillStyle)) + { + deactivateOldFillStyleDefinitions(getHeaderSet()); + } + + if(doNewDrawingLayerFillStyleDefinitionsExist(s_FooterFillStyle)) + { + deactivateOldFillStyleDefinitions(getFooterSet()); + } + + m_bIsFillStyleAlreadyConverted = true; + } + + //UUUU do not use XMLPropStyleContext::FillPropertySet, we need to handle this ourselves since + // we have properties which use the MID_FLAG_NO_PROPERTY_IMPORT flag since they need some special + // handling + UniReference < SvXMLImportPropertyMapper > xImpPrMap = GetStyles()->GetImportPropertyMapper(GetFamily()); + + if(xImpPrMap.is()) + { + // properties that need special handling because they need the used name to be translated first + struct _ContextID_Index_Pair aContextIDs[] = + { + { CTF_PM_FILLGRADIENTNAME, -1 }, + { CTF_PM_FILLTRANSNAME, -1 }, + { CTF_PM_FILLHATCHNAME, -1 }, + { CTF_PM_FILLBITMAPNAME, -1 }, + + // also need to special handling for header entries + { CTF_PM_HEADERFILLGRADIENTNAME, -1 }, + { CTF_PM_HEADERFILLTRANSNAME, -1 }, + { CTF_PM_HEADERFILLHATCHNAME, -1 }, + { CTF_PM_HEADERFILLBITMAPNAME, -1 }, + + // also need to special handling for footer entries + { CTF_PM_FOOTERFILLGRADIENTNAME, -1 }, + { CTF_PM_FOOTERFILLTRANSNAME, -1 }, + { CTF_PM_FOOTERFILLHATCHNAME, -1 }, + { CTF_PM_FOOTERFILLBITMAPNAME, -1 }, + + {-1, -1} + }; + + // the style families associated with the same index modulo 4 + static sal_uInt16 aFamilies[] = + { + XML_STYLE_FAMILY_SD_GRADIENT_ID, + XML_STYLE_FAMILY_SD_GRADIENT_ID, + XML_STYLE_FAMILY_SD_HATCH_ID, + XML_STYLE_FAMILY_SD_FILL_IMAGE_ID + }; + + //UUUU Fill PropertySet, but let it handle special properties not itself + xImpPrMap->FillPropertySet(GetProperties(), rPropSet, aContextIDs); + + // get property set mapper + const UniReference< XMLPropertySetMapper >& rMapper = xImpPrMap->getPropertySetMapper(); + Reference< XPropertySetInfo > xInfo; + + //UUUU handle special attributes which have MID_FLAG_NO_PROPERTY_IMPORT set + for(sal_uInt16 i = 0; aContextIDs[i].nContextID != -1; i++) + { + sal_Int32 nIndex = aContextIDs[i].nIndex; + + if(nIndex != -1) + { + switch(aContextIDs[i].nContextID) + { + case CTF_PM_FILLGRADIENTNAME: + case CTF_PM_FILLTRANSNAME: + case CTF_PM_FILLHATCHNAME: + case CTF_PM_FILLBITMAPNAME: + + case CTF_PM_HEADERFILLGRADIENTNAME: + case CTF_PM_HEADERFILLTRANSNAME: + case CTF_PM_HEADERFILLHATCHNAME: + case CTF_PM_HEADERFILLBITMAPNAME: + + case CTF_PM_FOOTERFILLGRADIENTNAME: + case CTF_PM_FOOTERFILLTRANSNAME: + case CTF_PM_FOOTERFILLHATCHNAME: + case CTF_PM_FOOTERFILLBITMAPNAME: + { + struct XMLPropertyState& rState = GetProperties()[nIndex]; + rtl::OUString sStyleName; + rState.maValue >>= sStyleName; + + //UUUU translate the used name from ODF intern to the name used in the Model + sStyleName = GetImport().GetStyleDisplayName(aFamilies[i%4], sStyleName); + + try + { + // set property + const rtl::OUString& rPropertyName = rMapper->GetEntryAPIName(rState.mnIndex); + + if(!xInfo.is()) + { + xInfo = rPropSet->getPropertySetInfo(); + } + + if(xInfo->hasPropertyByName(rPropertyName)) + { + rPropSet->setPropertyValue(rPropertyName,Any(sStyleName)); + } + } + catch(::com::sun::star::lang::IllegalArgumentException& e) + { + Sequence< rtl::OUString > aSeq(1); + aSeq[0] = sStyleName; + GetImport().SetError( + XMLERROR_STYLE_PROP_VALUE | XMLERROR_FLAG_WARNING, + aSeq,e.Message,NULL); + } + break; + } + } + } + } + } + else + { + OSL_ENSURE(xImpPrMap.is(), "Got no SvXMLImportPropertyMapper (!)"); + } + + //UUUU old code, replaced by above stuff + // XMLPropStyleContext::FillPropertySet(rPropSet); + if (!sPageUsage.isEmpty()) { uno::Any aPageUsage; diff --git a/xmloff/source/style/PageMasterPropHdlFactory.cxx b/xmloff/source/style/PageMasterPropHdlFactory.cxx index 337103586c07..a90132e1e639 100644 --- a/xmloff/source/style/PageMasterPropHdlFactory.cxx +++ b/xmloff/source/style/PageMasterPropHdlFactory.cxx @@ -28,8 +28,24 @@ #include <xmloff/PageMasterStyleMap.hxx> #include <com/sun/star/text/TextGridMode.hpp> +//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" + using namespace ::xmloff::token; using namespace ::com::sun::star; +//UUUU +using namespace ::com::sun::star::drawing; + +//UUUU +extern SvXMLEnumMapEntry aXML_FillStyle_EnumMap[]; +extern SvXMLEnumMapEntry aXML_RefPoint_EnumMap[]; +extern SvXMLEnumMapEntry aXML_BitmapMode_EnumMap[]; static SvXMLEnumMapEntry const aXML_TextGridMode_ConstantMap[] = { @@ -118,6 +134,34 @@ const XMLPropertyHandler* XMLPageMasterPropHdlFactory::GetPropertyHandler( sal_I pHdl = new XMLConstantsPropertyHandler( aXML_TextGridMode_ConstantMap, XML_NONE ); 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; + + //UUUU + default: + { + OSL_ENSURE(false, "XMLPropertyHandler missing (!)"); + break; + } } if( pHdl ) diff --git a/xmloff/source/style/PageMasterStyleMap.cxx b/xmloff/source/style/PageMasterStyleMap.cxx index 1fe2c173e426..92c6ee68fde9 100644 --- a/xmloff/source/style/PageMasterStyleMap.cxx +++ b/xmloff/source/style/PageMasterStyleMap.cxx @@ -21,6 +21,9 @@ #include <xmloff/xmlnmspe.hxx> #include <xmloff/xmltoken.hxx> +//UUUU +#include <xmloff/txtprmap.hxx> + using namespace ::xmloff::token; #define MAP(name,prefix,token,type,context,version) { name, sizeof(name)-1, prefix, token, type, context, version, false } @@ -33,61 +36,65 @@ using namespace ::xmloff::token; const XMLPropertyMapEntry aXMLPageMasterStyleMap[] = { -// page master - PLMAP( "PageStyleLayout", XML_NAMESPACE_STYLE, XML_PAGE_USAGE, XML_PM_TYPE_PAGESTYLELAYOUT | MID_FLAG_SPECIAL_ITEM, CTF_PM_PAGEUSAGE ), - PLMAP( "Width", XML_NAMESPACE_FO, XML_PAGE_WIDTH, XML_TYPE_MEASURE, 0 ), - PLMAP( "Height", XML_NAMESPACE_FO, XML_PAGE_HEIGHT, XML_TYPE_MEASURE, 0 ), - PLMAP( "NumberingType", XML_NAMESPACE_STYLE, XML_NUM_FORMAT, XML_PM_TYPE_NUMFORMAT | MID_FLAG_MERGE_PROPERTY, 0 ), - PLMAP( "NumberingType", XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC, XML_PM_TYPE_NUMLETTERSYNC, 0 ), - PLMAP( "PrinterPaperTray", XML_NAMESPACE_STYLE, XML_PAPER_TRAY_NAME, XML_TYPE_STRING | MID_FLAG_PROPERTY_MAY_EXCEPT, 0 ), - PLMAP( "IsLandscape", XML_NAMESPACE_STYLE, XML_PRINT_ORIENTATION, XML_PM_TYPE_PRINTORIENTATION, 0 ), - PLMAP( "TopMargin", XML_NAMESPACE_FO, XML_MARGIN, XML_TYPE_MEASURE, CTF_PM_MARGINALL ), - PLMAP( "TopMargin", XML_NAMESPACE_FO, XML_MARGIN_TOP, XML_TYPE_MEASURE, CTF_PM_MARGINTOP ), - PLMAP( "BottomMargin", XML_NAMESPACE_FO, XML_MARGIN_BOTTOM, XML_TYPE_MEASURE, CTF_PM_MARGINBOTTOM ), - PLMAP( "LeftMargin", XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_MEASURE, CTF_PM_MARGINLEFT ), - PLMAP( "RightMargin", XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_MEASURE, CTF_PM_MARGINRIGHT ), - PLMAP( "TopBorder", XML_NAMESPACE_FO, XML_BORDER, XML_TYPE_BORDER, CTF_PM_BORDERALL ), - PLMAP( "TopBorder", XML_NAMESPACE_FO, XML_BORDER_TOP, XML_TYPE_BORDER, CTF_PM_BORDERTOP ), - PLMAP( "BottomBorder", XML_NAMESPACE_FO, XML_BORDER_BOTTOM, XML_TYPE_BORDER, CTF_PM_BORDERBOTTOM ), - PLMAP( "LeftBorder", XML_NAMESPACE_FO, XML_BORDER_LEFT, XML_TYPE_BORDER, CTF_PM_BORDERLEFT ), - PLMAP( "RightBorder", XML_NAMESPACE_FO, XML_BORDER_RIGHT, XML_TYPE_BORDER, CTF_PM_BORDERRIGHT ), - PLMAP( "TopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH, XML_TYPE_BORDER_WIDTH, CTF_PM_BORDERWIDTHALL ), - PLMAP( "TopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_TOP, XML_TYPE_BORDER_WIDTH, CTF_PM_BORDERWIDTHTOP ), - PLMAP( "BottomBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_BOTTOM, XML_TYPE_BORDER_WIDTH, CTF_PM_BORDERWIDTHBOTTOM ), - PLMAP( "LeftBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_LEFT, XML_TYPE_BORDER_WIDTH, CTF_PM_BORDERWIDTHLEFT ), - PLMAP( "RightBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_RIGHT, XML_TYPE_BORDER_WIDTH, CTF_PM_BORDERWIDTHRIGHT ), - PLMAP( "TopBorderDistance", XML_NAMESPACE_FO, XML_PADDING, XML_TYPE_MEASURE, CTF_PM_PADDINGALL ), - PLMAP( "TopBorderDistance", XML_NAMESPACE_FO, XML_PADDING_TOP, XML_TYPE_MEASURE, CTF_PM_PADDINGTOP ), - PLMAP( "BottomBorderDistance", XML_NAMESPACE_FO, XML_PADDING_BOTTOM, XML_TYPE_MEASURE, CTF_PM_PADDINGBOTTOM ), - PLMAP( "LeftBorderDistance", XML_NAMESPACE_FO, XML_PADDING_LEFT, XML_TYPE_MEASURE, CTF_PM_PADDINGLEFT ), - PLMAP( "RightBorderDistance", XML_NAMESPACE_FO, XML_PADDING_RIGHT, XML_TYPE_MEASURE, CTF_PM_PADDINGRIGHT ), - PLMAP( "ShadowFormat", XML_NAMESPACE_STYLE, XML_SHADOW, XML_TYPE_TEXT_SHADOW, 0 ), - PLMAP( "BackColor", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT | MID_FLAG_MULTI_PROPERTY, 0 ), - PLMAP( "BackTransparent", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT | MID_FLAG_MERGE_ATTRIBUTE, 0 ), - PLMAP( "BackGraphicLocation", XML_NAMESPACE_STYLE, XML_POSITION, XML_TYPE_BUILDIN_CMP_ONLY | MID_FLAG_SPECIAL_ITEM, CTF_PM_GRAPHICPOSITION ), - PLMAP( "BackGraphicFilter", XML_NAMESPACE_STYLE, XML_FILTER_NAME, XML_TYPE_STRING | MID_FLAG_SPECIAL_ITEM, CTF_PM_GRAPHICFILTER ), - PLMAP( "BackGraphicURL", XML_NAMESPACE_STYLE, XML_BACKGROUND_IMAGE, XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, CTF_PM_GRAPHICURL ), - PLMAP( "PrintAnnotations", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTANNOTATIONS | MID_FLAG_MULTI_PROPERTY, CTF_PM_PRINT_ANNOTATIONS ), - PLMAP( "PrintCharts", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTCHARTS | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_CHARTS ), - PLMAP( "PrintDrawing", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTDRAWING | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_DRAWING ), - PLMAP( "PrintFormulas", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTFORMULAS | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_FORMULAS ), - PLMAP( "PrintGrid", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTGRID | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_GRID ), - PLMAP( "PrintHeaders", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTHEADERS | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_HEADERS ), - PLMAP( "PrintObjects", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTOBJECTS | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_OBJECTS ), - PLMAP( "PrintZeroValues", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTZEROVALUES | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_ZEROVALUES ), - PLMAP( "PrintDownFirst", XML_NAMESPACE_STYLE, XML_PRINT_PAGE_ORDER, XML_PM_TYPE_PRINTPAGEORDER, 0 ), - PLMAP( "FirstPageNumber", XML_NAMESPACE_STYLE, XML_FIRST_PAGE_NUMBER, XML_PM_TYPE_FIRSTPAGENUMBER, 0 ), - PLMAP( "PageScale", XML_NAMESPACE_STYLE, XML_SCALE_TO, XML_TYPE_PERCENT16, CTF_PM_SCALETO ), - PLMAP( "ScaleToPages", XML_NAMESPACE_STYLE, XML_SCALE_TO_PAGES, XML_TYPE_NUMBER16, CTF_PM_SCALETOPAGES ), - PLMAP( "ScaleToPagesX", XML_NAMESPACE_STYLE, XML_SCALE_TO_X, XML_TYPE_NUMBER16, CTF_PM_SCALETOX ), - PLMAP( "ScaleToPagesY", XML_NAMESPACE_STYLE, XML_SCALE_TO_Y, XML_TYPE_NUMBER16, CTF_PM_SCALETOY ), + ////////////////////////////////////////////////////////////////////////// + //UUUU Section for 'page-layout-properties' + + // page master + PLMAP( "PageStyleLayout", XML_NAMESPACE_STYLE, XML_PAGE_USAGE, XML_PM_TYPE_PAGESTYLELAYOUT | MID_FLAG_SPECIAL_ITEM, CTF_PM_PAGEUSAGE ), + PLMAP( "Width", XML_NAMESPACE_FO, XML_PAGE_WIDTH, XML_TYPE_MEASURE, 0 ), + PLMAP( "Height", XML_NAMESPACE_FO, XML_PAGE_HEIGHT, XML_TYPE_MEASURE, 0 ), + PLMAP( "NumberingType", XML_NAMESPACE_STYLE, XML_NUM_FORMAT, XML_PM_TYPE_NUMFORMAT | MID_FLAG_MERGE_PROPERTY, 0 ), + PLMAP( "NumberingType", XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC, XML_PM_TYPE_NUMLETTERSYNC, 0 ), + PLMAP( "PrinterPaperTray", XML_NAMESPACE_STYLE, XML_PAPER_TRAY_NAME, XML_TYPE_STRING | MID_FLAG_PROPERTY_MAY_EXCEPT, 0 ), + PLMAP( "IsLandscape", XML_NAMESPACE_STYLE, XML_PRINT_ORIENTATION, XML_PM_TYPE_PRINTORIENTATION, 0 ), + PLMAP( "TopMargin", XML_NAMESPACE_FO, XML_MARGIN, XML_TYPE_MEASURE, CTF_PM_MARGINALL ), + PLMAP( "TopMargin", XML_NAMESPACE_FO, XML_MARGIN_TOP, XML_TYPE_MEASURE, CTF_PM_MARGINTOP ), + PLMAP( "BottomMargin", XML_NAMESPACE_FO, XML_MARGIN_BOTTOM, XML_TYPE_MEASURE, CTF_PM_MARGINBOTTOM ), + PLMAP( "LeftMargin", XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_MEASURE, CTF_PM_MARGINLEFT ), + PLMAP( "RightMargin", XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_MEASURE, CTF_PM_MARGINRIGHT ), + PLMAP( "TopBorder", XML_NAMESPACE_FO, XML_BORDER, XML_TYPE_BORDER, CTF_PM_BORDERALL ), + PLMAP( "TopBorder", XML_NAMESPACE_FO, XML_BORDER_TOP, XML_TYPE_BORDER, CTF_PM_BORDERTOP ), + PLMAP( "BottomBorder", XML_NAMESPACE_FO, XML_BORDER_BOTTOM, XML_TYPE_BORDER, CTF_PM_BORDERBOTTOM ), + PLMAP( "LeftBorder", XML_NAMESPACE_FO, XML_BORDER_LEFT, XML_TYPE_BORDER, CTF_PM_BORDERLEFT ), + PLMAP( "RightBorder", XML_NAMESPACE_FO, XML_BORDER_RIGHT, XML_TYPE_BORDER, CTF_PM_BORDERRIGHT ), + PLMAP( "TopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH, XML_TYPE_BORDER_WIDTH, CTF_PM_BORDERWIDTHALL ), + PLMAP( "TopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_TOP, XML_TYPE_BORDER_WIDTH, CTF_PM_BORDERWIDTHTOP ), + PLMAP( "BottomBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_BOTTOM, XML_TYPE_BORDER_WIDTH, CTF_PM_BORDERWIDTHBOTTOM ), + PLMAP( "LeftBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_LEFT, XML_TYPE_BORDER_WIDTH, CTF_PM_BORDERWIDTHLEFT ), + PLMAP( "RightBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_RIGHT, XML_TYPE_BORDER_WIDTH, CTF_PM_BORDERWIDTHRIGHT ), + PLMAP( "TopBorderDistance", XML_NAMESPACE_FO, XML_PADDING, XML_TYPE_MEASURE, CTF_PM_PADDINGALL ), + PLMAP( "TopBorderDistance", XML_NAMESPACE_FO, XML_PADDING_TOP, XML_TYPE_MEASURE, CTF_PM_PADDINGTOP ), + PLMAP( "BottomBorderDistance", XML_NAMESPACE_FO, XML_PADDING_BOTTOM, XML_TYPE_MEASURE, CTF_PM_PADDINGBOTTOM ), + PLMAP( "LeftBorderDistance", XML_NAMESPACE_FO, XML_PADDING_LEFT, XML_TYPE_MEASURE, CTF_PM_PADDINGLEFT ), + PLMAP( "RightBorderDistance", XML_NAMESPACE_FO, XML_PADDING_RIGHT, XML_TYPE_MEASURE, CTF_PM_PADDINGRIGHT ), + PLMAP( "ShadowFormat", XML_NAMESPACE_STYLE, XML_SHADOW, XML_TYPE_TEXT_SHADOW, 0 ), + PLMAP( "BackColor", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT | MID_FLAG_MULTI_PROPERTY, 0 ), + PLMAP( "BackTransparent", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT | MID_FLAG_MERGE_ATTRIBUTE, 0 ), + PLMAP( "BackGraphicLocation", XML_NAMESPACE_STYLE, XML_POSITION, XML_TYPE_BUILDIN_CMP_ONLY | MID_FLAG_SPECIAL_ITEM, CTF_PM_GRAPHICPOSITION ), + PLMAP( "BackGraphicFilter", XML_NAMESPACE_STYLE, XML_FILTER_NAME, XML_TYPE_STRING | MID_FLAG_SPECIAL_ITEM, CTF_PM_GRAPHICFILTER ), + PLMAP( "BackGraphicURL", XML_NAMESPACE_STYLE, XML_BACKGROUND_IMAGE, XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, CTF_PM_GRAPHICURL ), + PLMAP( "PrintAnnotations", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTANNOTATIONS | MID_FLAG_MULTI_PROPERTY, CTF_PM_PRINT_ANNOTATIONS ), + PLMAP( "PrintCharts", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTCHARTS | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_CHARTS ), + PLMAP( "PrintDrawing", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTDRAWING | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_DRAWING ), + PLMAP( "PrintFormulas", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTFORMULAS | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_FORMULAS ), + PLMAP( "PrintGrid", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTGRID | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_GRID ), + PLMAP( "PrintHeaders", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTHEADERS | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_HEADERS ), + PLMAP( "PrintObjects", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTOBJECTS | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_OBJECTS ), + PLMAP( "PrintZeroValues", XML_NAMESPACE_STYLE, XML_PRINT, XML_PM_TYPE_PRINTZEROVALUES | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_PRINT_ZEROVALUES ), + PLMAP( "PrintDownFirst", XML_NAMESPACE_STYLE, XML_PRINT_PAGE_ORDER, XML_PM_TYPE_PRINTPAGEORDER, 0 ), + PLMAP( "FirstPageNumber", XML_NAMESPACE_STYLE, XML_FIRST_PAGE_NUMBER, XML_PM_TYPE_FIRSTPAGENUMBER, 0 ), + PLMAP( "PageScale", XML_NAMESPACE_STYLE, XML_SCALE_TO, XML_TYPE_PERCENT16, CTF_PM_SCALETO ), + PLMAP( "ScaleToPages", XML_NAMESPACE_STYLE, XML_SCALE_TO_PAGES, XML_TYPE_NUMBER16, CTF_PM_SCALETOPAGES ), + PLMAP( "ScaleToPagesX", XML_NAMESPACE_STYLE, XML_SCALE_TO_X, XML_TYPE_NUMBER16, CTF_PM_SCALETOX ), + PLMAP( "ScaleToPagesY", XML_NAMESPACE_STYLE, XML_SCALE_TO_Y, XML_TYPE_NUMBER16, CTF_PM_SCALETOY ), PLMAP( "CenterHorizontally", XML_NAMESPACE_STYLE, XML_TABLE_CENTERING, XML_PM_TYPE_CENTER_HORIZONTAL | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, 0 ), - PLMAP( "CenterVertically", XML_NAMESPACE_STYLE, XML_TABLE_CENTERING, XML_PM_TYPE_CENTER_VERTICAL | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, 0 ), - PLMAP( "TextColumns", XML_NAMESPACE_STYLE, XML_COLUMNS, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_COLUMNS, CTF_PM_TEXTCOLUMNS ), - PLMAP( "RegisterModeActive", XML_NAMESPACE_STYLE, XML_REGISTER_TRUE, XML_TYPE_BOOL, 0 ), - PLMAP( "RegisterParagraphStyle", XML_NAMESPACE_STYLE, XML_REGISTER_TRUTH_REF_STYLE_NAME, XML_TYPE_STYLENAME| MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_PM_REGISTER_STYLE ), + PLMAP( "CenterVertically", XML_NAMESPACE_STYLE, XML_TABLE_CENTERING, XML_PM_TYPE_CENTER_VERTICAL | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, 0 ), + PLMAP( "TextColumns", XML_NAMESPACE_STYLE, XML_COLUMNS, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_COLUMNS, CTF_PM_TEXTCOLUMNS ), + PLMAP( "RegisterModeActive", XML_NAMESPACE_STYLE, XML_REGISTER_TRUE, XML_TYPE_BOOL, 0 ), + PLMAP( "RegisterParagraphStyle", XML_NAMESPACE_STYLE, XML_REGISTER_TRUTH_REF_STYLE_NAME, XML_TYPE_STYLENAME| MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_PM_REGISTER_STYLE ), PLMAP( "WritingMode", XML_NAMESPACE_STYLE, XML_WRITING_MODE, XML_TYPE_TEXT_WRITING_MODE, 0 ), + // Index 53: Grid definitions PLMAP( "GridColor", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_COLOR, XML_TYPE_COLOR, 0 ), PLMAP( "GridLines", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_LINES, XML_TYPE_NUMBER16, 0 ), PLMAP( "GridBaseHeight", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_BASE_HEIGHT, XML_TYPE_MEASURE, 0 ), @@ -103,81 +110,158 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] = //export as a default attribute PLMAP_12( "StandardPageMode", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_STANDARD_MODE, XML_TYPE_BOOL|MID_FLAG_DEFAULT_ITEM_EXPORT, CTF_PM_STANDARD_MODE ), - PLMAP( "UserDefinedAttributes", XML_NAMESPACE_TEXT, XML_XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ), + PLMAP( "UserDefinedAttributes", XML_NAMESPACE_TEXT, XML_XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ), + + //UUUUIndex 65: fill attributes; use PLMAP macro here instead of GMAP, tis list is ordered and it's order is used + // to decide in which section in ODF to export the contained stuff (the PageMasterStyle creates several XML + // sections, for Page, Header and Footer). The needed order seems to rely not on filtering, but using sections + // based on the order used in this list. + // Also need own defines for the used context flags (e.g. CTF_PM_FILLGRADIENTNAME instead of + // CTF_FILLGRADIENTNAME) since these are used to *filter* up to which entry the attributes belong to the + // 'page-layout-properties' section (!), see SvXMLAutoStylePoolP_Impl::exportXML, look for XML_STYLE_FAMILY_PAGE_MASTER + PLMAP( "FillStyle", XML_NAMESPACE_DRAW, XML_FILL, XML_SW_TYPE_FILLSTYLE, 0 ), + PLMAP( "FillColor", XML_NAMESPACE_DRAW, XML_FILL_COLOR, XML_TYPE_COLOR, 0 ), + PLMAP( "FillColor2", XML_NAMESPACE_DRAW, XML_SECONDARY_FILL_COLOR, XML_TYPE_COLOR, 0 ), + PLMAP( "FillGradientName", XML_NAMESPACE_DRAW, XML_FILL_GRADIENT_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_PM_FILLGRADIENTNAME ), + PLMAP( "FillGradientStepCount", XML_NAMESPACE_DRAW, XML_GRADIENT_STEP_COUNT, XML_TYPE_NUMBER16, 0 ), + PLMAP( "FillHatchName", XML_NAMESPACE_DRAW, XML_FILL_HATCH_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_PM_FILLHATCHNAME ), + PLMAP( "FillBackground", XML_NAMESPACE_DRAW, XML_FILL_HATCH_SOLID, XML_TYPE_BOOL, 0 ), + PLMAP( "FillBitmapName", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_PM_FILLBITMAPNAME ), + PLMAP( "FillTransparence", XML_NAMESPACE_DRAW, XML_OPACITY, XML_TYPE_NEG_PERCENT16|MID_FLAG_MULTI_PROPERTY, 0 ), // exists in SW, too + PLMAP( "FillTransparenceGradientName", XML_NAMESPACE_DRAW, XML_OPACITY_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_PM_FILLTRANSNAME ), + PLMAP( "FillBitmapSizeX", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH, XML_SW_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, 0 ), + PLMAP( "FillBitmapLogicalSize", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH, XML_SW_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, 0 ), + PLMAP( "FillBitmapSizeY", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT, XML_SW_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, 0 ), + PLMAP( "FillBitmapLogicalSize", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT, XML_SW_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, 0 ), + PLMAP( "FillBitmapMode", XML_NAMESPACE_STYLE, XML_REPEAT, XML_SW_TYPE_BITMAP_MODE|MID_FLAG_MULTI_PROPERTY, 0 ), + PLMAP( "FillBitmapPositionOffsetX", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT_X, XML_TYPE_PERCENT, 0 ), + PLMAP( "FillBitmapPositionOffsetY", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT_Y, XML_TYPE_PERCENT, 0 ), + PLMAP( "FillBitmapRectanglePoint", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT, XML_SW_TYPE_BITMAP_REFPOINT, 0 ), + PLMAP( "FillBitmapOffsetX", XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET, XML_SW_TYPE_BITMAPREPOFFSETX|MID_FLAG_MULTI_PROPERTY, CTF_PM_REPEAT_OFFSET_X ), + PLMAP( "FillBitmapOffsetY", XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET, XML_SW_TYPE_BITMAPREPOFFSETY|MID_FLAG_MULTI_PROPERTY, CTF_PM_REPEAT_OFFSET_Y ), -// footnote + // Index 85: footnote PLMAP( "FootnoteHeight", XML_NAMESPACE_STYLE, XML_FOOTNOTE_MAX_HEIGHT, XML_TYPE_MEASURE, CTF_PM_FTN_HEIGHT ), - PLMAP( "FootnoteLineAdjust", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_TEXT_HORIZONTAL_ADJUST|MID_FLAG_SPECIAL_ITEM, CTF_PM_FTN_LINE_ADJUST ), - PLMAP( "FootnoteLineColor", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_COLOR|MID_FLAG_SPECIAL_ITEM, CTF_PM_FTN_LINE_COLOR ), - PLMAP( "FootnoteLineDistance", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_MEASURE|MID_FLAG_SPECIAL_ITEM,CTF_PM_FTN_DISTANCE ), + PLMAP( "FootnoteLineAdjust", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_TEXT_HORIZONTAL_ADJUST|MID_FLAG_SPECIAL_ITEM, CTF_PM_FTN_LINE_ADJUST ), + PLMAP( "FootnoteLineColor", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_COLOR|MID_FLAG_SPECIAL_ITEM, CTF_PM_FTN_LINE_COLOR ), + PLMAP( "FootnoteLineDistance", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_MEASURE|MID_FLAG_SPECIAL_ITEM,CTF_PM_FTN_DISTANCE ), PLMAP( "FootnoteLineRelativeWidth", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_PERCENT8|MID_FLAG_SPECIAL_ITEM, CTF_PM_FTN_LINE_WIDTH ), - PLMAP( "FootnoteLineTextDistance", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_MEASURE|MID_FLAG_SPECIAL_ITEM, CTF_PM_FTN_LINE_DISTANCE ), - PLMAP( "FootnoteLineWeight", XML_NAMESPACE_STYLE, XML_FOOTNOTE_SEP, XML_TYPE_MEASURE16|MID_FLAG_ELEMENT_ITEM, CTF_PM_FTN_LINE_WEIGHT ), - PLMAP( "FootnoteLineStyle", XML_NAMESPACE_STYLE, XML_EMPTY, XML_TYPE_STRING|MID_FLAG_ELEMENT_ITEM, CTF_PM_FTN_LINE_STYLE ), - -// header - HFMAP( "HeaderHeight", XML_NAMESPACE_SVG, XML_HEIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERHEIGHT ), - HFMAP( "HeaderHeight", XML_NAMESPACE_FO, XML_MIN_HEIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERMINHEIGHT ), - HFMAP( "HeaderIsDynamicHeight", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_BOOL, CTF_PM_HEADERDYNAMIC ), - HFMAP( "HeaderLeftMargin", XML_NAMESPACE_FO, XML_MARGIN, XML_TYPE_MEASURE, CTF_PM_HEADERMARGINALL ), - HFMAP( "HeaderLeftMargin", XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_MEASURE, CTF_PM_HEADERMARGINLEFT ), - HFMAP( "HeaderRightMargin", XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERMARGINRIGHT ), - HFMAP( "HeaderBodyDistance", XML_NAMESPACE_FO, XML_MARGIN_BOTTOM, XML_TYPE_MEASURE, CTF_PM_HEADERMARGINBOTTOM ), - HFMAP( "HeaderTopBorder", XML_NAMESPACE_FO, XML_BORDER, XML_TYPE_BORDER, CTF_PM_HEADERBORDERALL ), - HFMAP( "HeaderTopBorder", XML_NAMESPACE_FO, XML_BORDER_TOP, XML_TYPE_BORDER, CTF_PM_HEADERBORDERTOP ), - HFMAP( "HeaderBottomBorder", XML_NAMESPACE_FO, XML_BORDER_BOTTOM, XML_TYPE_BORDER, CTF_PM_HEADERBORDERBOTTOM ), - HFMAP( "HeaderLeftBorder", XML_NAMESPACE_FO, XML_BORDER_LEFT, XML_TYPE_BORDER, CTF_PM_HEADERBORDERLEFT ), - HFMAP( "HeaderRightBorder", XML_NAMESPACE_FO, XML_BORDER_RIGHT, XML_TYPE_BORDER, CTF_PM_HEADERBORDERRIGHT ), - HFMAP( "HeaderTopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH, XML_TYPE_BORDER_WIDTH, CTF_PM_HEADERBORDERWIDTHALL ), - HFMAP( "HeaderTopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_TOP, XML_TYPE_BORDER_WIDTH, CTF_PM_HEADERBORDERWIDTHTOP ), - HFMAP( "HeaderBottomBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_BOTTOM, XML_TYPE_BORDER_WIDTH, CTF_PM_HEADERBORDERWIDTHBOTTOM ), - HFMAP( "HeaderLeftBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_LEFT, XML_TYPE_BORDER_WIDTH, CTF_PM_HEADERBORDERWIDTHLEFT ), - HFMAP( "HeaderRightBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_RIGHT, XML_TYPE_BORDER_WIDTH, CTF_PM_HEADERBORDERWIDTHRIGHT ), - HFMAP( "HeaderTopBorderDistance", XML_NAMESPACE_FO, XML_PADDING, XML_TYPE_MEASURE, CTF_PM_HEADERPADDINGALL ), - HFMAP( "HeaderTopBorderDistance", XML_NAMESPACE_FO, XML_PADDING_TOP, XML_TYPE_MEASURE, CTF_PM_HEADERPADDINGTOP ), - HFMAP( "HeaderBottomBorderDistance", XML_NAMESPACE_FO, XML_PADDING_BOTTOM, XML_TYPE_MEASURE, CTF_PM_HEADERPADDINGBOTTOM ), - HFMAP( "HeaderLeftBorderDistance", XML_NAMESPACE_FO, XML_PADDING_LEFT, XML_TYPE_MEASURE, CTF_PM_HEADERPADDINGLEFT ), - HFMAP( "HeaderRightBorderDistance", XML_NAMESPACE_FO, XML_PADDING_RIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERPADDINGRIGHT ), - HFMAP( "HeaderShadowFormat", XML_NAMESPACE_STYLE, XML_SHADOW, XML_TYPE_TEXT_SHADOW, CTF_PM_HEADERFLAG ), - HFMAP( "HeaderBackColor", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT | MID_FLAG_MULTI_PROPERTY, CTF_PM_HEADERFLAG ), - HFMAP( "HeaderBackTransparent", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_HEADERFLAG ), - HFMAP( "HeaderBackGraphicLocation", XML_NAMESPACE_STYLE, XML_POSITION, XML_TYPE_BUILDIN_CMP_ONLY | MID_FLAG_SPECIAL_ITEM, CTF_PM_HEADERGRAPHICPOSITION ), - HFMAP( "HeaderBackGraphicFilter", XML_NAMESPACE_STYLE, XML_FILTER_NAME, XML_TYPE_STRING | MID_FLAG_SPECIAL_ITEM, CTF_PM_HEADERGRAPHICFILTER ), - HFMAP( "HeaderBackGraphicURL", XML_NAMESPACE_STYLE, XML_BACKGROUND_IMAGE, XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, CTF_PM_HEADERGRAPHICURL ), + PLMAP( "FootnoteLineTextDistance", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_MEASURE|MID_FLAG_SPECIAL_ITEM, CTF_PM_FTN_LINE_DISTANCE ), + PLMAP( "FootnoteLineWeight", XML_NAMESPACE_STYLE, XML_FOOTNOTE_SEP, XML_TYPE_MEASURE16|MID_FLAG_ELEMENT_ITEM, CTF_PM_FTN_LINE_WEIGHT ), + + ////////////////////////////////////////////////////////////////////////// + //UUUUIndex 92: Section for 'header-style' own section, all members *have* to use CTF_PM_HEADERFLAG in the context entry (the 5th one) + HFMAP( "HeaderHeight", XML_NAMESPACE_SVG, XML_HEIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERHEIGHT ), + HFMAP( "HeaderHeight", XML_NAMESPACE_FO, XML_MIN_HEIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERMINHEIGHT ), + HFMAP( "HeaderIsDynamicHeight", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_BOOL, CTF_PM_HEADERDYNAMIC ), + HFMAP( "HeaderLeftMargin", XML_NAMESPACE_FO, XML_MARGIN, XML_TYPE_MEASURE, CTF_PM_HEADERMARGINALL ), + HFMAP( "HeaderLeftMargin", XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_MEASURE, CTF_PM_HEADERMARGINLEFT ), + HFMAP( "HeaderRightMargin", XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERMARGINRIGHT ), + HFMAP( "HeaderBodyDistance", XML_NAMESPACE_FO, XML_MARGIN_BOTTOM, XML_TYPE_MEASURE, CTF_PM_HEADERMARGINBOTTOM ), + HFMAP( "HeaderTopBorder", XML_NAMESPACE_FO, XML_BORDER, XML_TYPE_BORDER, CTF_PM_HEADERBORDERALL ), + HFMAP( "HeaderTopBorder", XML_NAMESPACE_FO, XML_BORDER_TOP, XML_TYPE_BORDER, CTF_PM_HEADERBORDERTOP ), + HFMAP( "HeaderBottomBorder", XML_NAMESPACE_FO, XML_BORDER_BOTTOM, XML_TYPE_BORDER, CTF_PM_HEADERBORDERBOTTOM ), + HFMAP( "HeaderLeftBorder", XML_NAMESPACE_FO, XML_BORDER_LEFT, XML_TYPE_BORDER, CTF_PM_HEADERBORDERLEFT ), + HFMAP( "HeaderRightBorder", XML_NAMESPACE_FO, XML_BORDER_RIGHT, XML_TYPE_BORDER, CTF_PM_HEADERBORDERRIGHT ), + HFMAP( "HeaderTopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH, XML_TYPE_BORDER_WIDTH, CTF_PM_HEADERBORDERWIDTHALL ), + HFMAP( "HeaderTopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_TOP, XML_TYPE_BORDER_WIDTH, CTF_PM_HEADERBORDERWIDTHTOP ), + HFMAP( "HeaderBottomBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_BOTTOM, XML_TYPE_BORDER_WIDTH, CTF_PM_HEADERBORDERWIDTHBOTTOM ), + HFMAP( "HeaderLeftBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_LEFT, XML_TYPE_BORDER_WIDTH, CTF_PM_HEADERBORDERWIDTHLEFT ), + HFMAP( "HeaderRightBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_RIGHT, XML_TYPE_BORDER_WIDTH, CTF_PM_HEADERBORDERWIDTHRIGHT ), + HFMAP( "HeaderTopBorderDistance", XML_NAMESPACE_FO, XML_PADDING, XML_TYPE_MEASURE, CTF_PM_HEADERPADDINGALL ), + HFMAP( "HeaderTopBorderDistance", XML_NAMESPACE_FO, XML_PADDING_TOP, XML_TYPE_MEASURE, CTF_PM_HEADERPADDINGTOP ), + HFMAP( "HeaderBottomBorderDistance", XML_NAMESPACE_FO, XML_PADDING_BOTTOM, XML_TYPE_MEASURE, CTF_PM_HEADERPADDINGBOTTOM ), + HFMAP( "HeaderLeftBorderDistance", XML_NAMESPACE_FO, XML_PADDING_LEFT, XML_TYPE_MEASURE, CTF_PM_HEADERPADDINGLEFT ), + HFMAP( "HeaderRightBorderDistance", XML_NAMESPACE_FO, XML_PADDING_RIGHT, XML_TYPE_MEASURE, CTF_PM_HEADERPADDINGRIGHT ), + HFMAP( "HeaderShadowFormat", XML_NAMESPACE_STYLE, XML_SHADOW, XML_TYPE_TEXT_SHADOW, CTF_PM_HEADERFLAG ), + HFMAP( "HeaderBackColor", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT | MID_FLAG_MULTI_PROPERTY, CTF_PM_HEADERFLAG ), + HFMAP( "HeaderBackTransparent", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_HEADERFLAG ), + HFMAP( "HeaderBackGraphicLocation", XML_NAMESPACE_STYLE, XML_POSITION, XML_TYPE_BUILDIN_CMP_ONLY | MID_FLAG_SPECIAL_ITEM, CTF_PM_HEADERGRAPHICPOSITION ), + HFMAP( "HeaderBackGraphicFilter", XML_NAMESPACE_STYLE, XML_FILTER_NAME, XML_TYPE_STRING | MID_FLAG_SPECIAL_ITEM, CTF_PM_HEADERGRAPHICFILTER ), + HFMAP( "HeaderBackGraphicURL", XML_NAMESPACE_STYLE, XML_BACKGROUND_IMAGE, XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, CTF_PM_HEADERGRAPHICURL ), HFMAP( "HeaderDynamicSpacing", XML_NAMESPACE_STYLE, XML_DYNAMIC_SPACING, XML_TYPE_BOOL, CTF_PM_HEADERFLAG ), -// footer - HFMAP( "FooterHeight", XML_NAMESPACE_SVG, XML_HEIGHT, XML_TYPE_MEASURE, CTF_PM_FOOTERHEIGHT ), - HFMAP( "FooterHeight", XML_NAMESPACE_FO, XML_MIN_HEIGHT, XML_TYPE_MEASURE, CTF_PM_FOOTERMINHEIGHT ), - HFMAP( "FooterIsDynamicHeight", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_BOOL, CTF_PM_FOOTERDYNAMIC ), - HFMAP( "FooterLeftMargin", XML_NAMESPACE_FO, XML_MARGIN, XML_TYPE_MEASURE, CTF_PM_FOOTERMARGINALL ), - HFMAP( "FooterLeftMargin", XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_MEASURE, CTF_PM_FOOTERMARGINLEFT ), - HFMAP( "FooterRightMargin", XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_MEASURE, CTF_PM_FOOTERMARGINRIGHT ), - HFMAP( "FooterBodyDistance", XML_NAMESPACE_FO, XML_MARGIN_TOP, XML_TYPE_MEASURE, CTF_PM_FOOTERMARGINTOP ), - HFMAP( "FooterTopBorder", XML_NAMESPACE_FO, XML_BORDER, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERALL ), - HFMAP( "FooterTopBorder", XML_NAMESPACE_FO, XML_BORDER_TOP, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERTOP ), - HFMAP( "FooterBottomBorder", XML_NAMESPACE_FO, XML_BORDER_BOTTOM, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERBOTTOM ), - HFMAP( "FooterLeftBorder", XML_NAMESPACE_FO, XML_BORDER_LEFT, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERLEFT ), - HFMAP( "FooterRightBorder", XML_NAMESPACE_FO, XML_BORDER_RIGHT, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERRIGHT ), - HFMAP( "FooterTopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH, XML_TYPE_BORDER_WIDTH, CTF_PM_FOOTERBORDERWIDTHALL ), - HFMAP( "FooterTopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_TOP, XML_TYPE_BORDER_WIDTH, CTF_PM_FOOTERBORDERWIDTHTOP ), - HFMAP( "FooterBottomBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_BOTTOM, XML_TYPE_BORDER_WIDTH, CTF_PM_FOOTERBORDERWIDTHBOTTOM ), - HFMAP( "FooterLeftBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_LEFT, XML_TYPE_BORDER_WIDTH, CTF_PM_FOOTERBORDERWIDTHLEFT ), - HFMAP( "FooterRightBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_RIGHT, XML_TYPE_BORDER_WIDTH, CTF_PM_FOOTERBORDERWIDTHRIGHT ), - HFMAP( "FooterTopBorderDistance", XML_NAMESPACE_FO, XML_PADDING, XML_TYPE_MEASURE, CTF_PM_FOOTERPADDINGALL ), - HFMAP( "FooterTopBorderDistance", XML_NAMESPACE_FO, XML_PADDING_TOP, XML_TYPE_MEASURE, CTF_PM_FOOTERPADDINGTOP ), - HFMAP( "FooterBottomBorderDistance", XML_NAMESPACE_FO, XML_PADDING_BOTTOM, XML_TYPE_MEASURE, CTF_PM_FOOTERPADDINGBOTTOM ), - HFMAP( "FooterLeftBorderDistance", XML_NAMESPACE_FO, XML_PADDING_LEFT, XML_TYPE_MEASURE, CTF_PM_FOOTERPADDINGLEFT ), - HFMAP( "FooterRightBorderDistance", XML_NAMESPACE_FO, XML_PADDING_RIGHT, XML_TYPE_MEASURE, CTF_PM_FOOTERPADDINGRIGHT ), - HFMAP( "FooterShadowFormat", XML_NAMESPACE_STYLE, XML_SHADOW, XML_TYPE_TEXT_SHADOW, CTF_PM_FOOTERFLAG ), - HFMAP( "FooterBackColor", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT | MID_FLAG_MULTI_PROPERTY, CTF_PM_FOOTERFLAG ), - HFMAP( "FooterBackTransparent", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_FOOTERFLAG ), - HFMAP( "FooterBackGraphicLocation", XML_NAMESPACE_STYLE, XML_POSITION, XML_TYPE_BUILDIN_CMP_ONLY | MID_FLAG_SPECIAL_ITEM, CTF_PM_FOOTERGRAPHICPOSITION ), - HFMAP( "FooterBackGraphicFilter", XML_NAMESPACE_STYLE, XML_FILTER_NAME, XML_TYPE_STRING | MID_FLAG_SPECIAL_ITEM, CTF_PM_FOOTERGRAPHICFILTER ), - HFMAP( "FooterBackGraphicURL", XML_NAMESPACE_STYLE, XML_BACKGROUND_IMAGE, XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, CTF_PM_FOOTERGRAPHICURL ), + //UUUUIndex 121: Header DrawingLayer FillAttributes + // Use HFMAP to get XML_TYPE_PROP_HEADER_FOOTER ORed to the 4th entry + // Names have to begin with 'Header', all 5th entries need to be ORed with the CTF_PM_HEADERFLAG + HFMAP( "HeaderFillStyle", XML_NAMESPACE_DRAW, XML_FILL, XML_SW_TYPE_FILLSTYLE, CTF_PM_HEADERFLAG ), + HFMAP( "HeaderFillColor", XML_NAMESPACE_DRAW, XML_FILL_COLOR, XML_TYPE_COLOR, CTF_PM_HEADERFLAG ), + HFMAP( "HeaderFillColor2", XML_NAMESPACE_DRAW, XML_SECONDARY_FILL_COLOR, XML_TYPE_COLOR, CTF_PM_HEADERFLAG ), + HFMAP( "HeaderFillGradientName", XML_NAMESPACE_DRAW, XML_FILL_GRADIENT_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_PM_HEADERFILLGRADIENTNAME ), + HFMAP( "HeaderFillGradientStepCount", XML_NAMESPACE_DRAW, XML_GRADIENT_STEP_COUNT, XML_TYPE_NUMBER16, CTF_PM_HEADERFLAG ), + HFMAP( "HeaderFillHatchName", XML_NAMESPACE_DRAW, XML_FILL_HATCH_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_PM_HEADERFILLHATCHNAME ), + HFMAP( "HeaderFillBackground", XML_NAMESPACE_DRAW, XML_FILL_HATCH_SOLID, XML_TYPE_BOOL, CTF_PM_HEADERFLAG ), + HFMAP( "HeaderFillBitmapName", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_PM_HEADERFILLBITMAPNAME ), + HFMAP( "HeaderFillTransparence", XML_NAMESPACE_DRAW, XML_OPACITY, XML_TYPE_NEG_PERCENT16|MID_FLAG_MULTI_PROPERTY, CTF_PM_HEADERFLAG ), // exists in SW, too + HFMAP( "HeaderFillTransparenceGradientName", XML_NAMESPACE_DRAW, XML_OPACITY_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_PM_HEADERFILLTRANSNAME ), + HFMAP( "HeaderFillBitmapSizeX", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH, XML_SW_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, CTF_PM_HEADERFLAG ), + HFMAP( "HeaderFillBitmapLogicalSize", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH, XML_SW_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, CTF_PM_HEADERFLAG ), + HFMAP( "HeaderFillBitmapSizeY", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT, XML_SW_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, CTF_PM_HEADERFLAG ), + HFMAP( "HeaderFillBitmapLogicalSize", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT, XML_SW_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, CTF_PM_HEADERFLAG ), + HFMAP( "HeaderFillBitmapMode", XML_NAMESPACE_STYLE, XML_REPEAT, XML_SW_TYPE_BITMAP_MODE|MID_FLAG_MULTI_PROPERTY, CTF_PM_HEADERFLAG ), + HFMAP( "HeaderFillBitmapPositionOffsetX", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT_X, XML_TYPE_PERCENT, CTF_PM_HEADERFLAG ), + HFMAP( "HeaderFillBitmapPositionOffsetY", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT_Y, XML_TYPE_PERCENT, CTF_PM_HEADERFLAG ), + HFMAP( "HeaderFillBitmapRectanglePoint", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT, XML_SW_TYPE_BITMAP_REFPOINT, CTF_PM_HEADERFLAG ), + HFMAP( "HeaderFillBitmapOffsetX", XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET, XML_SW_TYPE_BITMAPREPOFFSETX|MID_FLAG_MULTI_PROPERTY, CTF_PM_HEADERREPEAT_OFFSET_X ), + HFMAP( "HeaderFillBitmapOffsetY", XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET, XML_SW_TYPE_BITMAPREPOFFSETY|MID_FLAG_MULTI_PROPERTY, CTF_PM_HEADERREPEAT_OFFSET_Y ), + + ////////////////////////////////////////////////////////////////////////// + //UUUUIndex 141: Section for 'footer-style' own section, all members *have* to use CTF_PM_FOOTERFLAG in the context entry (the 5th one) + HFMAP( "FooterHeight", XML_NAMESPACE_SVG, XML_HEIGHT, XML_TYPE_MEASURE, CTF_PM_FOOTERHEIGHT ), + HFMAP( "FooterHeight", XML_NAMESPACE_FO, XML_MIN_HEIGHT, XML_TYPE_MEASURE, CTF_PM_FOOTERMINHEIGHT ), + HFMAP( "FooterIsDynamicHeight", XML_NAMESPACE_STYLE, XML__EMPTY, XML_TYPE_BOOL, CTF_PM_FOOTERDYNAMIC ), + HFMAP( "FooterLeftMargin", XML_NAMESPACE_FO, XML_MARGIN, XML_TYPE_MEASURE, CTF_PM_FOOTERMARGINALL ), + HFMAP( "FooterLeftMargin", XML_NAMESPACE_FO, XML_MARGIN_LEFT, XML_TYPE_MEASURE, CTF_PM_FOOTERMARGINLEFT ), + HFMAP( "FooterRightMargin", XML_NAMESPACE_FO, XML_MARGIN_RIGHT, XML_TYPE_MEASURE, CTF_PM_FOOTERMARGINRIGHT ), + HFMAP( "FooterBodyDistance", XML_NAMESPACE_FO, XML_MARGIN_TOP, XML_TYPE_MEASURE, CTF_PM_FOOTERMARGINTOP ), + HFMAP( "FooterTopBorder", XML_NAMESPACE_FO, XML_BORDER, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERALL ), + HFMAP( "FooterTopBorder", XML_NAMESPACE_FO, XML_BORDER_TOP, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERTOP ), + HFMAP( "FooterBottomBorder", XML_NAMESPACE_FO, XML_BORDER_BOTTOM, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERBOTTOM ), + HFMAP( "FooterLeftBorder", XML_NAMESPACE_FO, XML_BORDER_LEFT, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERLEFT ), + HFMAP( "FooterRightBorder", XML_NAMESPACE_FO, XML_BORDER_RIGHT, XML_TYPE_BORDER, CTF_PM_FOOTERBORDERRIGHT ), + HFMAP( "FooterTopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH, XML_TYPE_BORDER_WIDTH, CTF_PM_FOOTERBORDERWIDTHALL ), + HFMAP( "FooterTopBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_TOP, XML_TYPE_BORDER_WIDTH, CTF_PM_FOOTERBORDERWIDTHTOP ), + HFMAP( "FooterBottomBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_BOTTOM, XML_TYPE_BORDER_WIDTH, CTF_PM_FOOTERBORDERWIDTHBOTTOM ), + HFMAP( "FooterLeftBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_LEFT, XML_TYPE_BORDER_WIDTH, CTF_PM_FOOTERBORDERWIDTHLEFT ), + HFMAP( "FooterRightBorder", XML_NAMESPACE_STYLE, XML_BORDER_LINE_WIDTH_RIGHT, XML_TYPE_BORDER_WIDTH, CTF_PM_FOOTERBORDERWIDTHRIGHT ), + HFMAP( "FooterTopBorderDistance", XML_NAMESPACE_FO, XML_PADDING, XML_TYPE_MEASURE, CTF_PM_FOOTERPADDINGALL ), + HFMAP( "FooterTopBorderDistance", XML_NAMESPACE_FO, XML_PADDING_TOP, XML_TYPE_MEASURE, CTF_PM_FOOTERPADDINGTOP ), + HFMAP( "FooterBottomBorderDistance", XML_NAMESPACE_FO, XML_PADDING_BOTTOM, XML_TYPE_MEASURE, CTF_PM_FOOTERPADDINGBOTTOM ), + HFMAP( "FooterLeftBorderDistance", XML_NAMESPACE_FO, XML_PADDING_LEFT, XML_TYPE_MEASURE, CTF_PM_FOOTERPADDINGLEFT ), + HFMAP( "FooterRightBorderDistance", XML_NAMESPACE_FO, XML_PADDING_RIGHT, XML_TYPE_MEASURE, CTF_PM_FOOTERPADDINGRIGHT ), + HFMAP( "FooterShadowFormat", XML_NAMESPACE_STYLE, XML_SHADOW, XML_TYPE_TEXT_SHADOW, CTF_PM_FOOTERFLAG ), + HFMAP( "FooterBackColor", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT | MID_FLAG_MULTI_PROPERTY, CTF_PM_FOOTERFLAG ), + HFMAP( "FooterBackTransparent", XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT | MID_FLAG_MERGE_ATTRIBUTE, CTF_PM_FOOTERFLAG ), + HFMAP( "FooterBackGraphicLocation", XML_NAMESPACE_STYLE, XML_POSITION, XML_TYPE_BUILDIN_CMP_ONLY | MID_FLAG_SPECIAL_ITEM, CTF_PM_FOOTERGRAPHICPOSITION ), + HFMAP( "FooterBackGraphicFilter", XML_NAMESPACE_STYLE, XML_FILTER_NAME, XML_TYPE_STRING | MID_FLAG_SPECIAL_ITEM, CTF_PM_FOOTERGRAPHICFILTER ), + HFMAP( "FooterBackGraphicURL", XML_NAMESPACE_STYLE, XML_BACKGROUND_IMAGE, XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, CTF_PM_FOOTERGRAPHICURL ), HFMAP( "FooterDynamicSpacing", XML_NAMESPACE_STYLE, XML_DYNAMIC_SPACING, XML_TYPE_BOOL, CTF_PM_FOOTERFLAG ), - { 0L, 0, 0, XML_EMPTY, 0, 0, SvtSaveOptions::ODFVER_010, false } + //UUUUIndex 170: Footer DrawingLayer FillAttributes + // Use HFMAP to get XML_TYPE_PROP_HEADER_FOOTER ORed to the 4th entry + // Names have to begin with 'Footer', all 5th entries need to be ORed with the CTF_PM_FOOTERFLAG + HFMAP( "FooterFillStyle", XML_NAMESPACE_DRAW, XML_FILL, XML_SW_TYPE_FILLSTYLE, CTF_PM_FOOTERFLAG ), + HFMAP( "FooterFillColor", XML_NAMESPACE_DRAW, XML_FILL_COLOR, XML_TYPE_COLOR, CTF_PM_FOOTERFLAG ), + HFMAP( "FooterFillColor2", XML_NAMESPACE_DRAW, XML_SECONDARY_FILL_COLOR, XML_TYPE_COLOR, CTF_PM_FOOTERFLAG ), + HFMAP( "FooterFillGradientName", XML_NAMESPACE_DRAW, XML_FILL_GRADIENT_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_PM_FOOTERFILLGRADIENTNAME ), + HFMAP( "FooterFillGradientStepCount", XML_NAMESPACE_DRAW, XML_GRADIENT_STEP_COUNT, XML_TYPE_NUMBER16, CTF_PM_FOOTERFLAG ), + HFMAP( "FooterFillHatchName", XML_NAMESPACE_DRAW, XML_FILL_HATCH_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_PM_FOOTERFILLHATCHNAME ), + HFMAP( "FooterFillBackground", XML_NAMESPACE_DRAW, XML_FILL_HATCH_SOLID, XML_TYPE_BOOL, CTF_PM_FOOTERFLAG ), + HFMAP( "FooterFillBitmapName", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_PM_FOOTERFILLBITMAPNAME ), + HFMAP( "FooterFillTransparence", XML_NAMESPACE_DRAW, XML_OPACITY, XML_TYPE_NEG_PERCENT16|MID_FLAG_MULTI_PROPERTY, CTF_PM_FOOTERFLAG ), // exists in SW, too + HFMAP( "FooterFillTransparenceGradientName", XML_NAMESPACE_DRAW, XML_OPACITY_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_PM_FOOTERFILLTRANSNAME ), + HFMAP( "FooterFillBitmapSizeX", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH, XML_SW_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, CTF_PM_FOOTERFLAG ), + HFMAP( "FooterFillBitmapLogicalSize", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH, XML_SW_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, CTF_PM_FOOTERFLAG ), + HFMAP( "FooterFillBitmapSizeY", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT, XML_SW_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, CTF_PM_FOOTERFLAG ), + HFMAP( "FooterFillBitmapLogicalSize", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT, XML_SW_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, CTF_PM_FOOTERFLAG ), + HFMAP( "FooterFillBitmapMode", XML_NAMESPACE_STYLE, XML_REPEAT, XML_SW_TYPE_BITMAP_MODE|MID_FLAG_MULTI_PROPERTY, CTF_PM_FOOTERFLAG ), + HFMAP( "FooterFillBitmapPositionOffsetX", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT_X, XML_TYPE_PERCENT, CTF_PM_FOOTERFLAG ), + HFMAP( "FooterFillBitmapPositionOffsetY", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT_Y, XML_TYPE_PERCENT, CTF_PM_FOOTERFLAG ), + HFMAP( "FooterFillBitmapRectanglePoint", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT, XML_SW_TYPE_BITMAP_REFPOINT, CTF_PM_FOOTERFLAG ), + HFMAP( "FooterFillBitmapOffsetX", XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET, XML_SW_TYPE_BITMAPREPOFFSETX|MID_FLAG_MULTI_PROPERTY, CTF_PM_FOOTERREPEAT_OFFSET_X ), + HFMAP( "FooterFillBitmapOffsetY", XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET, XML_SW_TYPE_BITMAPREPOFFSETY|MID_FLAG_MULTI_PROPERTY, CTF_PM_FOOTERREPEAT_OFFSET_Y ), + + { 0L, 0, 0, XML_EMPTY, 0, 0, SvtSaveOptions::ODFVER_010, false } // index 190 }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index 7b98643f5420..828b4a45f31b 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -30,11 +30,12 @@ #include <com/sun/star/beans/XMultiPropertyStates.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <xmloff/xmlimp.hxx> - #include <xmloff/prstylei.hxx> #include <xmloff/attrlist.hxx> #include <xmloff/xmlerror.hxx> +//UUUU +#include <com/sun/star/drawing/FillStyle.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -45,6 +46,8 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; using namespace ::xmloff::token; +//UUUU +using namespace com::sun::star::drawing; void XMLPropStyleContext::SetAttribute( sal_uInt16 nPrefixKey, const OUString& rLocalName, @@ -62,6 +65,12 @@ void XMLPropStyleContext::SetAttribute( sal_uInt16 nPrefixKey, TYPEINIT1( XMLPropStyleContext, SvXMLStyleContext ); +//UUUU +OldFillStyleDefinitionSet XMLPropStyleContext::maStandardSet; +OldFillStyleDefinitionSet XMLPropStyleContext::maHeaderSet; +OldFillStyleDefinitionSet XMLPropStyleContext::maFooterSet; +OldFillStyleDefinitionSet XMLPropStyleContext::maParaSet; + XMLPropStyleContext::XMLPropStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList > & xAttrList, @@ -78,6 +87,74 @@ XMLPropStyleContext::~XMLPropStyleContext() { } +const OldFillStyleDefinitionSet& XMLPropStyleContext::getStandardSet() +{ + if(maStandardSet.empty()) + { + maStandardSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BackColorRGB"))); + maStandardSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BackTransparent"))); + maStandardSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BackColorTransparency"))); + maStandardSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BackGraphicURL"))); + maStandardSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BackGraphicFilter"))); + maStandardSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BackGraphicLocation"))); + maStandardSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BackGraphicTransparency"))); + } + + return maStandardSet; +} + +const OldFillStyleDefinitionSet& XMLPropStyleContext::getHeaderSet() +{ + if(maHeaderSet.empty()) + { + maHeaderSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HeaderBackColorRGB"))); + maHeaderSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HeaderBackTransparent"))); + maHeaderSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HeaderBackColorTransparency"))); + maHeaderSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HeaderBackGraphicURL"))); + maHeaderSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HeaderBackGraphicFilter"))); + maHeaderSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HeaderBackGraphicLocation"))); + maHeaderSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HeaderBackGraphicTransparency"))); + } + + return maHeaderSet; +} + +const OldFillStyleDefinitionSet& XMLPropStyleContext::getFooterSet() +{ + if(maFooterSet.empty()) + { + maFooterSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FooterBackColorRGB"))); + maFooterSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FooterBackTransparent"))); + maFooterSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FooterBackColorTransparency"))); + maFooterSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FooterBackGraphicURL"))); + maFooterSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FooterBackGraphicFilter"))); + maFooterSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FooterBackGraphicLocation"))); + maFooterSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FooterBackGraphicTransparency"))); + } + + return maFooterSet; +} + +const OldFillStyleDefinitionSet& XMLPropStyleContext::getParaSet() +{ + if(maParaSet.empty()) + { + // Caution: here it is *not* 'ParaBackColorRGB' as it should be, but indeed + // 'ParaBackColor' is used, see aXMLParaPropMap definition (line 313) + maParaSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParaBackColor"))); + maParaSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParaBackTransparent"))); + maParaSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParaBackGraphicLocation"))); + maParaSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParaBackGraphicFilter"))); + maParaSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParaBackGraphicURL"))); + + // These are not used in aXMLParaPropMap definition, thus not needed here + // maParaSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParaBackColorTransparency"))); + // maParaSet.insert(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParaBackGraphicTransparency"))); + } + + return maParaSet; +} + SvXMLImportContext *XMLPropStyleContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, @@ -172,16 +249,45 @@ typedef ::std::set < OUString > PropertyNameSet; void XMLPropStyleContext::CreateAndInsert( bool bOverwrite ) { - if( ((SvXMLStylesContext *)&mxStyles)->IsAutomaticStyle() + SvXMLStylesContext* pSvXMLStylesContext = static_cast< SvXMLStylesContext* >(&mxStyles); + UniReference < SvXMLImportPropertyMapper > xImpPrMap = pSvXMLStylesContext->GetImportPropertyMapper(GetFamily()); + OSL_ENSURE(xImpPrMap.is(), "There is no import prop mapper"); + + //UUUU need to filter out old fill definitions when the new ones are used. The new + // ones are used when a FillStyle is defined + const bool bTakeCareOfDrawingLayerFillStyle(xImpPrMap.is() && GetFamily() == XML_STYLE_FAMILY_TEXT_PARAGRAPH); + bool bDrawingLayerFillStylesUsed(false); + + if(bTakeCareOfDrawingLayerFillStyle) + { + // check if new FillStyles are used and if so mark old ones with -1 + static ::rtl::OUString s_FillStyle(RTL_CONSTASCII_USTRINGPARAM("FillStyle")); + + if(doNewDrawingLayerFillStyleDefinitionsExist(s_FillStyle)) + { + deactivateOldFillStyleDefinitions(getParaSet()); + bDrawingLayerFillStylesUsed = true; + } + } + + if( pSvXMLStylesContext->IsAutomaticStyle() && ( GetFamily() == XML_STYLE_FAMILY_TEXT_TEXT || GetFamily() == XML_STYLE_FAMILY_TEXT_PARAGRAPH ) ) { - Reference < XAutoStyleFamily > xAutoFamily = - ((SvXMLStylesContext *)&mxStyles)->GetAutoStyles( GetFamily() ); + //UUUU Need to translate StyleName from temp MapNames to names + // used in already imported items (already exist in the pool). This + // is required for AutomaticStyles since these do *not* use FillPropertySet + // and thus just trigger CheckSpecialContext in XMLTextStyleContext::FillPropertySet + // (which may be double action anyways). The mechanism there to use _ContextID_Index_Pair + // is not working for AutomaticStyles and is already too late, too (this + // method is already called before XMLTextStyleContext::FillPropertySet gets called) + if(bDrawingLayerFillStylesUsed) + { + translateNameBasedDrawingLayerFillStyleDefinitionsToStyleDisplayNames(); + } + + Reference < XAutoStyleFamily > xAutoFamily = pSvXMLStylesContext->GetAutoStyles( GetFamily() ); if( !xAutoFamily.is() ) return; - UniReference < SvXMLImportPropertyMapper > xImpPrMap = - ((SvXMLStylesContext *)&mxStyles)->GetImportPropertyMapper( GetFamily() ); - DBG_ASSERT( xImpPrMap.is(), "There is no import prop mapper" ); if( xImpPrMap.is() ) { Sequence< PropertyValue > aValues; @@ -230,8 +336,7 @@ void XMLPropStyleContext::CreateAndInsert( bool bOverwrite ) if( rName.isEmpty() || IsDefaultStyle() ) return; - Reference < XNameContainer > xFamilies = - ((SvXMLStylesContext *)&mxStyles)->GetStylesContainer( GetFamily() ); + Reference < XNameContainer > xFamilies = pSvXMLStylesContext->GetStylesContainer( GetFamily() ); if( !xFamilies.is() ) return; @@ -271,10 +376,6 @@ void XMLPropStyleContext::CreateAndInsert( bool bOverwrite ) Reference< XPropertyState > xPropState( xPropSet, uno::UNO_QUERY ); UniReference < XMLPropertySetMapper > xPrMap; - UniReference < SvXMLImportPropertyMapper > xImpPrMap = - ((SvXMLStylesContext *)&mxStyles)->GetImportPropertyMapper( - GetFamily() ); - DBG_ASSERT( xImpPrMap.is(), "There is the import prop mapper" ); if( xImpPrMap.is() ) xPrMap = xImpPrMap->getPropertySetMapper(); if( xPrMap.is() ) @@ -408,5 +509,135 @@ void XMLPropStyleContext::Finish( bool bOverwrite ) } } +//UUUU +bool XMLPropStyleContext::doNewDrawingLayerFillStyleDefinitionsExist( + const OUString& rFillStyleTag) const +{ + if(maProperties.size() && rFillStyleTag.getLength()) + { + const UniReference< XMLPropertySetMapper >& rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper(); + + if(rMapper.is()) + { + for(::std::vector< XMLPropertyState >::const_iterator a = maProperties.begin(); a != maProperties.end(); a++) + { + if(a->mnIndex != -1) + { + const OUString& rPropName = rMapper->GetEntryAPIName(a->mnIndex); + + if(rPropName == rFillStyleTag) + { + FillStyle eFillStyle(FillStyle_NONE); + + if(a->maValue >>= eFillStyle) + { + // okay, type was good, FillStyle is set + } + else + { + // also try an int (see XFillStyleItem::PutValue) + sal_Int32 nFillStyle(0); + + if(a->maValue >>= nFillStyle) + { + eFillStyle = static_cast< FillStyle >(nFillStyle); + } + } + + // we found the entry, check it + return FillStyle_NONE != eFillStyle; + } + } + } + } + } + + return false; +} + +//UUUU +bool XMLPropStyleContext::deactivateOldFillStyleDefinitions( + const OldFillStyleDefinitionSet& rHashSetOfTags) +{ + bool bRetval(false); + + if(!rHashSetOfTags.empty() && maProperties.size()) + { + const UniReference< XMLPropertySetMapper >& rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper(); + + if(rMapper.is()) + { + for(::std::vector< XMLPropertyState >::iterator a = maProperties.begin(); a != maProperties.end(); a++) + { + if(a->mnIndex != -1) + { + const OUString& rPropName = rMapper->GetEntryAPIName(a->mnIndex); + + if(rHashSetOfTags.find(rPropName) != rHashSetOfTags.end()) + { + // mark entry as inactive + a->mnIndex = -1; + bRetval = true; + } + } + } + } + } + + return bRetval; +} + +//UUUU +bool XMLPropStyleContext::translateNameBasedDrawingLayerFillStyleDefinitionsToStyleDisplayNames() +{ + bool bRetval(false); + + if(maProperties.size()) + { + const UniReference< XMLPropertySetMapper >& rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper(); + + if(rMapper.is()) + { + static OUString s_FillGradientName(RTL_CONSTASCII_USTRINGPARAM("FillGradientName")); + static OUString s_FillHatchName(RTL_CONSTASCII_USTRINGPARAM("FillHatchName")); + static OUString s_FillBitmapName(RTL_CONSTASCII_USTRINGPARAM("FillBitmapName")); + static OUString s_FillTransparenceGradientName(RTL_CONSTASCII_USTRINGPARAM("FillTransparenceGradientName")); + + for(::std::vector< XMLPropertyState >::iterator a = maProperties.begin(); a != maProperties.end(); a++) + { + if(a->mnIndex != -1) + { + const OUString& rPropName = rMapper->GetEntryAPIName(a->mnIndex); + sal_uInt16 aStyleFamily(0); + + if(rPropName == s_FillGradientName || rPropName == s_FillTransparenceGradientName) + { + aStyleFamily = XML_STYLE_FAMILY_SD_GRADIENT_ID; + } + else if(rPropName == s_FillHatchName) + { + aStyleFamily = XML_STYLE_FAMILY_SD_HATCH_ID; + } + else if(rPropName == s_FillBitmapName) + { + aStyleFamily = XML_STYLE_FAMILY_SD_FILL_IMAGE_ID; + } + + if(aStyleFamily) + { + OUString sStyleName; + + a->maValue >>= sStyleName; + sStyleName = GetImport().GetStyleDisplayName( aStyleFamily, sStyleName ); + a->maValue <<= sStyleName; + bRetval = true; + } + } + } + } + } + + return bRetval; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx index 118ad7c62633..6be3360e402c 100644 --- a/xmloff/source/style/xmlimppr.cxx +++ b/xmloff/source/style/xmlimppr.cxx @@ -311,7 +311,7 @@ void SvXMLImportPropertyMapper::importXML( } } } - while( ( nIndex >= 0 ) && (( nFlags & MID_FLAG_MULTI_PROPERTY ) != 0 ) ); + while( ( nIndex >= 0 && nIndex + 1 < nEndIdx ) && (( nFlags & MID_FLAG_MULTI_PROPERTY ) != 0 ) ); } finished( rProperties, nStartIdx, nEndIdx ); diff --git a/xmloff/source/style/xmlprmap.cxx b/xmloff/source/style/xmlprmap.cxx index bf3f9f0358f2..08f6a346dfcc 100644 --- a/xmloff/source/style/xmlprmap.cxx +++ b/xmloff/source/style/xmlprmap.cxx @@ -171,7 +171,7 @@ sal_Int32 XMLPropertySetMapper::GetEntryIndex( sal_Int32 nEntries = GetEntryCount(); sal_Int32 nIndex= nStartAt == - 1? 0 : nStartAt+1; - if ( nEntries ) + if ( nEntries && nIndex < nEntries ) { do { diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx index 1c7ac7ef8248..0cd2bb72f0e1 100644 --- a/xmloff/source/text/txtexppr.cxx +++ b/xmloff/source/text/txtexppr.cxx @@ -26,13 +26,13 @@ #include <com/sun/star/text/TextContentAnchorType.hpp> #include <com/sun/star/awt/FontUnderline.hpp> #include <com/sun/star/text/XChapterNumberingSupplier.hpp> - #include <tools/debug.hxx> - #include <xmloff/txtprmap.hxx> #include <xmloff/xmlexp.hxx> #include "XMLSectionFootnoteConfigExport.hxx" +//UUUU +#include <xmlsdtypes.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -795,20 +795,20 @@ void XMLTextExportPropertySetMapper::ContextFilter( case CTF_MARGINALL: pAllMargin = propertie; break; //UUUU - case CTF_SW_REPEAT_OFFSET_X: + case CTF_REPEAT_OFFSET_X: pRepeatOffsetX = propertie; break; //UUUU - case CTF_SW_REPEAT_OFFSET_Y: + case CTF_REPEAT_OFFSET_Y: pRepeatOffsetY = propertie; break; //UUUU - case CTF_SW_FILLGRADIENTNAME: - case CTF_SW_FILLHATCHNAME: - case CTF_SW_FILLBITMAPNAME: - case CTF_SW_FILLTRANSNAME: + case CTF_FILLGRADIENTNAME: + case CTF_FILLHATCHNAME: + case CTF_FILLBITMAPNAME: + case CTF_FILLTRANSNAME: { OUString aStr; if( (propertie->maValue >>= aStr) && 0 == aStr.getLength() ) diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index 224f35ebffbd..ed63824e6d6e 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -46,14 +46,29 @@ #include <com/sun/star/text/WrapInfluenceOnPosition.hpp> #include <com/sun/star/drawing/TextVerticalAdjust.hpp> +//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" + using namespace ::com::sun::star; 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; +//UUUU +extern SvXMLEnumMapEntry aXML_FillStyle_EnumMap[]; +extern SvXMLEnumMapEntry aXML_RefPoint_EnumMap[]; +extern SvXMLEnumMapEntry aXML_BitmapMode_EnumMap[]; + static SvXMLEnumMapEntry const pXML_HoriPos_Enum[] = { { XML_FROM_LEFT, HoriOrientation::NONE }, @@ -1213,18 +1228,6 @@ 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 { @@ -1418,6 +1421,12 @@ const XMLPropertyHandler *XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler pHdl = new XMLBitmapRepeatOffsetPropertyHandler(XML_SW_TYPE_BITMAPREPOFFSETX == nType); break; + //UUUU + default: + { + OSL_ENSURE(false, "XMLPropertyHandler missing (!)"); + break; + } } return pHdl; diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index dba9a4f0f455..e0b617e31fda 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -17,15 +17,15 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include <xmloff/txtprmap.hxx> - #include <tools/debug.hxx> - #include <xmloff/xmlnmspe.hxx> #include <xmloff/xmltoken.hxx> #include "txtprhdl.hxx" +//UUUU +#include <xmlsdtypes.hxx> + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::xmloff::token; @@ -343,6 +343,29 @@ XMLPropertyMapEntry aXMLParaPropMap[] = MP_E( "ParaBackGraphicLocation", STYLE, POSITION, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BUILDIN_CMP_ONLY, CTF_BACKGROUND_POS ), MP_E( "ParaBackGraphicFilter",STYLE, FILTER_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_FILTER ), MP_E( "ParaBackGraphicURL", STYLE, BACKGROUND_IMAGE, MID_FLAG_ELEMENT_ITEM|XML_TYPE_STRING, CTF_BACKGROUND_URL ), + + //UUUU fill attributes for paragraph backgrounds + 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_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_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_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_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_REPEAT_OFFSET_X ), + GMAP( "FillBitmapOffsetY", XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET, XML_SW_TYPE_BITMAPREPOFFSETY|MID_FLAG_MULTI_PROPERTY, CTF_REPEAT_OFFSET_Y ), + // RES_BOX MP_E( "LeftBorder", STYLE, BORDER_LINE_WIDTH, XML_TYPE_BORDER_WIDTH, CTF_ALLBORDERWIDTH ), MP_E( "LeftBorder", STYLE, BORDER_LINE_WIDTH_LEFT, XML_TYPE_BORDER_WIDTH, CTF_LEFTBORDERWIDTH ), @@ -694,13 +717,13 @@ XMLPropertyMapEntry aXMLFramePropMap[] = 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( "FillGradientName", XML_NAMESPACE_DRAW, XML_FILL_GRADIENT_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_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( "FillHatchName", XML_NAMESPACE_DRAW, XML_FILL_HATCH_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_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( "FillBitmapName", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_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( "FillTransparenceGradientName", XML_NAMESPACE_DRAW, XML_OPACITY_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_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 ), @@ -709,8 +732,8 @@ XMLPropertyMapEntry aXMLFramePropMap[] = 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 ), + GMAP( "FillBitmapOffsetX", XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET, XML_SW_TYPE_BITMAPREPOFFSETX|MID_FLAG_MULTI_PROPERTY, CTF_REPEAT_OFFSET_X ), + GMAP( "FillBitmapOffsetY", XML_NAMESPACE_DRAW, XML_TILE_REPEAT_OFFSET, XML_SW_TYPE_BITMAPREPOFFSETY|MID_FLAG_MULTI_PROPERTY, CTF_REPEAT_OFFSET_Y ), // RES_BOX MG_ED( "LeftBorder", STYLE, BORDER_LINE_WIDTH, XML_TYPE_BORDER_WIDTH, CTF_ALLBORDERWIDTH ), diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index 47b8d0f44da5..b6db59197d95 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -48,6 +48,10 @@ #include <utility> #include <vector> +//UUUU +#include <xmlsdtypes.hxx> +#include <xmloff/xmlerror.hxx> + using namespace ::std; using namespace ::com::sun::star; @@ -397,22 +401,19 @@ void XMLTextStyleContext::FillPropertySet( // catch the combined characters attribute // imitate XMLPropStyleContext::FillPropertySet(...) - UniReference < SvXMLImportPropertyMapper > xImpPrMap = - ((SvXMLStylesContext *)GetStyles())->GetImportPropertyMapper(GetFamily()); - DBG_ASSERT( xImpPrMap.is(), "Where is the import prop mapper?" ); - if( xImpPrMap.is() ) - { + SvXMLStylesContext* pSvXMLStylesContext = static_cast< SvXMLStylesContext* >(GetStyles()); + UniReference < SvXMLImportPropertyMapper > xImpPrMap = pSvXMLStylesContext->GetImportPropertyMapper(GetFamily()); + DBG_ASSERT(xImpPrMap.is(),"Where is the import prop mapper?"); + if(xImpPrMap.is()) + { // imitate SvXMLImportPropertyMapper::FillPropertySet(...) - // The reason for this is that we have no other way to // efficiently intercept the value of combined characters. To // get that value, we could iterate through the map once more, // but instead we chose to insert the code into this // iteration. I haven't been able to come up with a much more // intelligent solution. - - struct _ContextID_Index_Pair aContextIDs[] = { { CTF_COMBINED_CHARACTERS_FIELD, -1 }, @@ -422,28 +423,56 @@ void XMLTextStyleContext::FillPropertySet( { CTF_FONTFAMILYNAME, -1 }, { CTF_FONTFAMILYNAME_CJK, -1 }, { CTF_FONTFAMILYNAME_CTL, -1 }, + + //UUU need special handling for DrawingLayer FillStyle names + { CTF_FILLGRADIENTNAME, -1 }, + { CTF_FILLTRANSNAME, -1 }, + { CTF_FILLHATCHNAME, -1 }, + { CTF_FILLBITMAPNAME, -1 }, + { -1, -1 } }; - // get property set info - Reference< XPropertySetInfo > xInfo( rPropSet->getPropertySetInfo(), UNO_SET_THROW ); + // the style families associated with the same index modulo 4 + static sal_uInt16 aFamilies[] = + { + XML_STYLE_FAMILY_SD_GRADIENT_ID, + XML_STYLE_FAMILY_SD_GRADIENT_ID, + XML_STYLE_FAMILY_SD_HATCH_ID, + XML_STYLE_FAMILY_SD_FILL_IMAGE_ID + }; + // get property set info + Reference< XPropertySetInfo > xInfo; + UniReference< XMLPropertySetMapper > rPropMapper; bool bAutomatic = false; - if( ((SvXMLStylesContext *)GetStyles())->IsAutomaticStyle() && - ( GetFamily() == XML_STYLE_FAMILY_TEXT_TEXT || GetFamily() == XML_STYLE_FAMILY_TEXT_PARAGRAPH ) ) + + if(pSvXMLStylesContext->IsAutomaticStyle() && + (XML_STYLE_FAMILY_TEXT_TEXT == GetFamily() || XML_STYLE_FAMILY_TEXT_PARAGRAPH == GetFamily())) { bAutomatic = true; + if( !GetAutoName().isEmpty() ) { OUString sAutoProp = ( GetFamily() == XML_STYLE_FAMILY_TEXT_TEXT ) ? OUString( "CharAutoStyleName" ): OUString( "ParaAutoStyleName" ); + try { + if(!xInfo.is()) + { + xInfo = rPropSet->getPropertySetInfo(); + } + if ( xInfo->hasPropertyByName( sAutoProp ) ) + { rPropSet->setPropertyValue( sAutoProp, makeAny(GetAutoName()) ); + } else + { bAutomatic = false; + } } catch( const RuntimeException& ) { throw; } catch( const Exception& ) @@ -453,13 +482,19 @@ void XMLTextStyleContext::FillPropertySet( } } } + if( bAutomatic ) + { xImpPrMap->CheckSpecialContext( GetProperties(), rPropSet, aContextIDs ); + } else + { xImpPrMap->FillPropertySet( GetProperties(), rPropSet, aContextIDs ); + } - // have we found a combined characters sal_Int32 nIndex = aContextIDs[0].nIndex; + + // have we found a combined characters if ( nIndex != -1 ) { Any& rAny = GetProperties()[nIndex].maValue; @@ -472,71 +507,140 @@ void XMLTextStyleContext::FillPropertySet( // value; if we didn't find one, we'll set to false, the file // format default. // border-model: same - if( IsDefaultStyle() && GetFamily() == XML_STYLE_FAMILY_TABLE_ROW ) + if(IsDefaultStyle() && XML_STYLE_FAMILY_TABLE_ROW == GetFamily()) { - OUString sIsSplitAllowed( "IsSplitAllowed" ); - DBG_ASSERT( rPropSet->getPropertySetInfo()->hasPropertyByName( sIsSplitAllowed ), - "property missing?" ); - rPropSet->setPropertyValue( sIsSplitAllowed, - (aContextIDs[1].nIndex == -1) - ? makeAny( false ) - : GetProperties()[aContextIDs[1].nIndex].maValue ); + OUString sIsSplitAllowed("IsSplitAllowed"); + DBG_ASSERT( rPropSet->getPropertySetInfo()->hasPropertyByName( sIsSplitAllowed ), "property missing?" ); + rPropSet->setPropertyValue( + sIsSplitAllowed, + (aContextIDs[1].nIndex == -1) ? makeAny( false ) : GetProperties()[aContextIDs[1].nIndex].maValue ); } - if( IsDefaultStyle() && GetFamily() == XML_STYLE_FAMILY_TABLE_TABLE ) + if(XML_STYLE_FAMILY_TABLE_TABLE == IsDefaultStyle() && GetFamily()) { OUString sCollapsingBorders("CollapsingBorders"); - DBG_ASSERT( rPropSet->getPropertySetInfo()->hasPropertyByName( sCollapsingBorders ), - "property missing?" ); - rPropSet->setPropertyValue( sCollapsingBorders, + DBG_ASSERT( rPropSet->getPropertySetInfo()->hasPropertyByName( sCollapsingBorders ), "property missing?" ); + rPropSet->setPropertyValue( + sCollapsingBorders, (aContextIDs[2].nIndex == -1) ? makeAny( false ) : GetProperties()[aContextIDs[2].nIndex].maValue ); } - // check for StarBats and StarMath fonts - - // iterate over aContextIDs entries 3..6 - for ( sal_Int32 i = 3; i < 7; i++ ) + // iterate over aContextIDs entries, start with 3, prev ones are already used above + for(sal_uInt16 i(3); aContextIDs[i].nContextID != -1; i++) { nIndex = aContextIDs[i].nIndex; + if ( nIndex != -1 ) { // Found! struct XMLPropertyState& rState = GetProperties()[nIndex]; - Any rAny = rState.maValue; - sal_Int32 nMapperIndex = rState.mnIndex; - - // Now check for font name in rState and set corrected value, - // if necessary. - OUString sFontName; - rAny >>= sFontName; - if ( !sFontName.isEmpty() ) + + switch(aContextIDs[i].nContextID) { - if ( sFontName.equalsIgnoreAsciiCase( "StarBats" ) || - sFontName.equalsIgnoreAsciiCase( "StarMath" ) ) + case CTF_FILLGRADIENTNAME: + case CTF_FILLTRANSNAME: + case CTF_FILLHATCHNAME: + case CTF_FILLBITMAPNAME: { - // construct new value - sFontName = "StarSymbol"; - Any aAny( rAny ); - aAny <<= sFontName; - - // get property set mapper - UniReference<XMLPropertySetMapper> rPropMapper = - xImpPrMap->getPropertySetMapper(); - - // set property - OUString rPropertyName( - rPropMapper->GetEntryAPIName(nMapperIndex) ); - if ( xInfo->hasPropertyByName( rPropertyName ) ) + // DrawingLayer FillStyle nameŽneeds to be mapped to DisplayName + rtl::OUString sStyleName; + rState.maValue >>= sStyleName; + + //UUUU translate the used name from ODF intern to the name used in the Model + sStyleName = GetImport().GetStyleDisplayName(aFamilies[i - 7], sStyleName); + + if(bAutomatic) + { + // in this case the rPropSet got not really filled since above the call to + // CheckSpecialContext was used and not FillPropertySet, thus the below call to + // setPropertyValue can fail/will not be useful (e.g. when the rPropSet + // is a SwXTextCursor). + // This happens for AutoStyles which are already filled in XMLPropStyleContext::CreateAndInsert, + // thus the whole mechanism based on _ContextID_Index_Pair will not work + // in that case. Thus the slots which need to be converted already get + // converted there (its called first) and not here (see + // translateNameBasedDrawingLayerFillStyleDefinitionsToStyleDisplayNames) + // For convenience, still Write back the corrected value to the XMLPropertyState entry + rState.maValue <<= sStyleName; + break; + } + + // Still needed if it's not an AutomaticStyle (!) + try + { + if(!rPropMapper.is()) + { + rPropMapper = xImpPrMap->getPropertySetMapper(); + } + + // set property + const rtl::OUString& rPropertyName = rPropMapper->GetEntryAPIName(rState.mnIndex); + + if(!xInfo.is()) + { + xInfo = rPropSet->getPropertySetInfo(); + } + + if(xInfo->hasPropertyByName(rPropertyName)) + { + rPropSet->setPropertyValue(rPropertyName,Any(sStyleName)); + } + } + catch(::com::sun::star::lang::IllegalArgumentException& e) + { + Sequence< rtl::OUString > aSeq(1); + aSeq[0] = sStyleName; + GetImport().SetError(XMLERROR_STYLE_PROP_VALUE | XMLERROR_FLAG_WARNING, aSeq, e.Message, NULL); + } + break; + } + default: + { + // check for StarBats and StarMath fonts + Any rAny = rState.maValue; + sal_Int32 nMapperIndex = rState.mnIndex; + + // Now check for font name in rState and set corrected value, + // if necessary. + OUString sFontName; + rAny >>= sFontName; + + if ( !sFontName.isEmpty() ) { - rPropSet->setPropertyValue( rPropertyName, aAny ); + if ( sFontName.equalsIgnoreAsciiCase( "StarBats" ) || + sFontName.equalsIgnoreAsciiCase( "StarMath" ) ) + { + // construct new value + sFontName = "StarSymbol"; + Any aAny(rAny); + aAny <<= sFontName; + + if(!rPropMapper.is()) + { + rPropMapper = xImpPrMap->getPropertySetMapper(); + } + + // set property + OUString rPropertyName(rPropMapper->GetEntryAPIName(nMapperIndex)); + + if(!xInfo.is()) + { + xInfo = rPropSet->getPropertySetInfo(); + } + + if(xInfo->hasPropertyByName(rPropertyName)) + { + rPropSet->setPropertyValue(rPropertyName,aAny); + } + } + // else: "normal" style name -> no correction is necessary } + // else: no style name found -> illegal value -> ignore } - // else: "normal" style name -> no correction is necessary } - // else: no style name found -> illegal value -> ignore } } } |