diff options
Diffstat (limited to 'xmloff')
75 files changed, 1518 insertions, 629 deletions
diff --git a/xmloff/inc/PageMasterImportContext.hxx b/xmloff/inc/PageMasterImportContext.hxx index 092fdaa90b79..a1dcb818b898 100644 --- a/xmloff/inc/PageMasterImportContext.hxx +++ b/xmloff/inc/PageMasterImportContext.hxx @@ -29,7 +29,12 @@ class PageStyleContext : public XMLPropStyleContext { - ::rtl::OUString sPageUsage; +private: + ::rtl::OUString sPageUsage; + + //UUUU + bool m_bIsFillStyleAlreadyConverted : 1; + protected: virtual void SetAttribute( sal_uInt16 nPrefixKey, diff --git a/xmloff/inc/txtflde.hxx b/xmloff/inc/txtflde.hxx index 1b75d3bed822..9768e7b5181c 100644 --- a/xmloff/inc/txtflde.hxx +++ b/xmloff/inc/txtflde.hxx @@ -282,7 +282,7 @@ protected: sal_Bool bOmitEmpty = sal_False, /// omit attribute, if value is empty sal_uInt16 nPrefix = XML_NAMESPACE_TEXT); /// attribute name prefix - /// export a string attribute taht gets a QName value + /// export a string attribute that gets a QName value void ProcessString( enum ::xmloff::token::XMLTokenEnum eXmlName, /// attribute token (namespace text) sal_uInt16 nValuePrefix, diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx index 17bc07260329..cf35c3e696f6 100644 --- a/xmloff/inc/txtfldi.hxx +++ b/xmloff/inc/txtfldi.hxx @@ -604,7 +604,7 @@ public: }; -/** import docinfo fields with only fixed atribute */ +/** import docinfo fields with only fixed attribute */ class XMLSimpleDocInfoImportContext : public XMLTextFieldImportContext { const ::rtl::OUString sPropertyFixed; @@ -1201,7 +1201,7 @@ protected: virtual void ProcessAttribute( sal_uInt16 nAttrToken, const ::rtl::OUString& sAttrValue ); - /// no atributes -> empty method + /// no attributes -> empty method virtual void PrepareField( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> & xPropertySet); @@ -1232,7 +1232,7 @@ protected: virtual void ProcessAttribute( sal_uInt16 nAttrToken, const ::rtl::OUString& sAttrValue ); - /// no atributes -> empty method + /// no attributes -> empty method virtual void PrepareField( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> & xPropertySet); diff --git a/xmloff/inc/xmloff/PageMasterStyleMap.hxx b/xmloff/inc/xmloff/PageMasterStyleMap.hxx index 381dad2aa77a..e93e5677e36c 100644 --- a/xmloff/inc/xmloff/PageMasterStyleMap.hxx +++ b/xmloff/inc/xmloff/PageMasterStyleMap.hxx @@ -90,6 +90,17 @@ #define CTF_PM_GRAPHICFILTER (XML_PM_CTF_START + 0x0033) #define CTF_PM_GRAPHICURL (XML_PM_CTF_START + 0x0034) +//UUUUNeed own entries for PageMasterStyleMap since these get *filtered* +// at export time using CTF_PM_FLAGMASK and XML_PM_CTF_START as detector +// to find the first entry for header/footer (!), see +// SvXMLAutoStylePoolP_Impl::exportXML, look for XML_STYLE_FAMILY_PAGE_MASTER +#define CTF_PM_REPEAT_OFFSET_X (XML_PM_CTF_START + 0x0035) +#define CTF_PM_REPEAT_OFFSET_Y (XML_PM_CTF_START + 0x0036) +#define CTF_PM_FILLGRADIENTNAME (XML_PM_CTF_START + 0x0037) +#define CTF_PM_FILLHATCHNAME (XML_PM_CTF_START + 0x0038) +#define CTF_PM_FILLBITMAPNAME (XML_PM_CTF_START + 0x0039) +#define CTF_PM_FILLTRANSNAME (XML_PM_CTF_START + 0x0040) + #define CTF_PM_SCALETO (XML_PM_CTF_START + 0x0051) // calc specific #define CTF_PM_SCALETOPAGES (XML_PM_CTF_START + 0x0052) #define CTF_PM_SCALETOX (XML_PM_CTF_START + 0x0053) @@ -125,6 +136,14 @@ #define CTF_PM_HEADERMARGINLEFT (CTF_PM_HEADERFLAG|CTF_PM_MARGINLEFT) #define CTF_PM_HEADERMARGINRIGHT (CTF_PM_HEADERFLAG|CTF_PM_MARGINRIGHT) +//UUUUNeed own entries for PageMasterStyleMap ORed with the CTF_PM_HEADERFLAG +#define CTF_PM_HEADERREPEAT_OFFSET_X (CTF_PM_HEADERFLAG|CTF_PM_REPEAT_OFFSET_X) +#define CTF_PM_HEADERREPEAT_OFFSET_Y (CTF_PM_HEADERFLAG|CTF_PM_REPEAT_OFFSET_Y) +#define CTF_PM_HEADERFILLGRADIENTNAME (CTF_PM_HEADERFLAG|CTF_PM_FILLGRADIENTNAME) +#define CTF_PM_HEADERFILLHATCHNAME (CTF_PM_HEADERFLAG|CTF_PM_FILLHATCHNAME) +#define CTF_PM_HEADERFILLBITMAPNAME (CTF_PM_HEADERFLAG|CTF_PM_FILLBITMAPNAME) +#define CTF_PM_HEADERFILLTRANSNAME (CTF_PM_HEADERFLAG|CTF_PM_FILLTRANSNAME) + // footer #define CTF_PM_FOOTERBORDERALL (CTF_PM_FOOTERFLAG|CTF_PM_BORDERALL) #define CTF_PM_FOOTERBORDERTOP (CTF_PM_FOOTERFLAG|CTF_PM_BORDERTOP) @@ -153,6 +172,14 @@ #define CTF_PM_FOOTERMARGINLEFT (CTF_PM_FOOTERFLAG|CTF_PM_MARGINLEFT) #define CTF_PM_FOOTERMARGINRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_MARGINRIGHT) +//UUUUNeed own entries for PageMasterStyleMap ORed with the CTF_PM_FOOTERFLAG +#define CTF_PM_FOOTERREPEAT_OFFSET_X (CTF_PM_FOOTERFLAG|CTF_PM_REPEAT_OFFSET_X) +#define CTF_PM_FOOTERREPEAT_OFFSET_Y (CTF_PM_FOOTERFLAG|CTF_PM_REPEAT_OFFSET_Y) +#define CTF_PM_FOOTERFILLGRADIENTNAME (CTF_PM_FOOTERFLAG|CTF_PM_FILLGRADIENTNAME) +#define CTF_PM_FOOTERFILLHATCHNAME (CTF_PM_FOOTERFLAG|CTF_PM_FILLHATCHNAME) +#define CTF_PM_FOOTERFILLBITMAPNAME (CTF_PM_FOOTERFLAG|CTF_PM_FILLBITMAPNAME) +#define CTF_PM_FOOTERFILLTRANSNAME (CTF_PM_FOOTERFLAG|CTF_PM_FILLTRANSNAME) + #define CTF_PM_FTN_HEIGTH (XML_PM_CTF_START + 0x0060) #define CTF_PM_FTN_LINE_WEIGTH (XML_PM_CTF_START + 0x0061) #define CTF_PM_FTN_LINE_COLOR (XML_PM_CTF_START + 0x0062) diff --git a/xmloff/inc/xmloff/XMLEventsImportContext.hxx b/xmloff/inc/xmloff/XMLEventsImportContext.hxx index 400bce12efd1..3361acf34373 100644 --- a/xmloff/inc/xmloff/XMLEventsImportContext.hxx +++ b/xmloff/inc/xmloff/XMLEventsImportContext.hxx @@ -52,7 +52,7 @@ typedef ::std::vector< EventNameValuesPair > EventsVector; /** * Import <script:events> element. * - * The import context usually sets the events immediatly at the event + * The import context usually sets the events immediately at the event * XNameReplace. If none was given on construction, it operates in * delayed mode: All events are collected and may then be set * with the setEvents() method. diff --git a/xmloff/inc/xmloff/XMLShapeStyleContext.hxx b/xmloff/inc/xmloff/XMLShapeStyleContext.hxx index 6265d8ff3cdf..1e5530fb4de8 100644 --- a/xmloff/inc/xmloff/XMLShapeStyleContext.hxx +++ b/xmloff/inc/xmloff/XMLShapeStyleContext.hxx @@ -41,6 +41,9 @@ protected: ::rtl::OUString m_sListStyleName; sal_Bool m_bIsNumRuleAlreadyConverted; + //UUUU + bool m_bIsFillStyleAlreadyConverted : 1; + protected: virtual void SetAttribute( sal_uInt16 nPrefixKey, const ::rtl::OUString& rLocalName, diff --git a/xmloff/inc/xmloff/maptype.hxx b/xmloff/inc/xmloff/maptype.hxx index 658defc49ed7..280f97a9e0f1 100644 --- a/xmloff/inc/xmloff/maptype.hxx +++ b/xmloff/inc/xmloff/maptype.hxx @@ -38,7 +38,7 @@ struct XMLPropertyMapEntry { const sal_Char* msApiName; /// Property-Name sal_Int32 nApiNameLength; /// length of property name - sal_uInt16 mnNameSpace; /** declares the Namespace in wich this + sal_uInt16 mnNameSpace; /** declares the Namespace in which this property exists */ enum ::xmloff::token::XMLTokenEnum meXMLName; /// XML-Name sal_Int32 mnType; /** Bit 0..23 : XML-Type of its value diff --git a/xmloff/inc/xmloff/prstylei.hxx b/xmloff/inc/xmloff/prstylei.hxx index ce4321644d24..6c2acbad149f 100644 --- a/xmloff/inc/xmloff/prstylei.hxx +++ b/xmloff/inc/xmloff/prstylei.hxx @@ -27,12 +27,11 @@ #include "xmloff/dllapi.h" #include "sal/types.h" #include <com/sun/star/style/XStyle.hpp> -#ifndef __SGI_STL_VECTOR #include <vector> -#endif -#ifndef _XMLOFF_XMLSTYLE_HXX_ #include <xmloff/xmlstyle.hxx> -#endif + +//UUUU +#include <hash_set> struct XMLPropertyState; class SvXMLStylesContext; @@ -41,19 +40,53 @@ namespace com { namespace sun { namespace star { namespace beans { class XPropertySet; } } } } +//UUUU +typedef std::hash_set< rtl::OUString, rtl::OUStringHash > OldFillStyleDefinitionSet; + class XMLOFF_DLLPUBLIC XMLPropStyleContext : public SvXMLStyleContext { +private: const ::rtl::OUString msIsPhysical; const ::rtl::OUString msFollowStyle; ::std::vector< XMLPropertyState > maProperties; ::com::sun::star::uno::Reference < ::com::sun::star::style::XStyle > mxStyle; SvXMLImportContextRef mxStyles; + //UUUU + static OldFillStyleDefinitionSet maStandardSet; + static OldFillStyleDefinitionSet maHeaderSet; + static OldFillStyleDefinitionSet maFooterSet; + static OldFillStyleDefinitionSet maParaSet; + SAL_DLLPRIVATE XMLPropStyleContext(XMLPropStyleContext &); // not defined SAL_DLLPRIVATE void operator =(XMLPropStyleContext &); // not defined protected: + //UUUU Helper to check if the local maProperties contzains the given + // FillStyle tag and if the FillStyle there is different from FillStyle_NONE + bool doNewDrawingLayerFillStyleDefinitionsExist( + const ::rtl::OUString& rFillStyleTag) const; + + //UUUU Helper which will deactivate all old fill definitions (identified by + // the given OldFillStyleDefinitionSet) in the local maProperties. Deactivation + // is done setting theindex to -1. It returns true when actually old fill + // definitions existed and were deactivated + bool deactivateOldFillStyleDefinitions( + const OldFillStyleDefinitionSet& rHashSetOfTags); + + //UUUU Helper to translate new DrawingLayer FillStyle values which are name-based + // from ODF internal name to style display names which can be found in the current + // document model (using NameOrIndex Items). The change is executed on the internal + // maProperties. The return value is true when actually names were changed + bool translateNameBasedDrawingLayerFillStyleDefinitionsToStyleDisplayNames(); + + //UUUU provider for often used sets + const OldFillStyleDefinitionSet& getStandardSet(); + const OldFillStyleDefinitionSet& getHeaderSet(); + const OldFillStyleDefinitionSet& getFooterSet(); + const OldFillStyleDefinitionSet& getParaSet(); + virtual void SetAttribute( sal_uInt16 nPrefixKey, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue ); diff --git a/xmloff/inc/xmloff/shapeexport.hxx b/xmloff/inc/xmloff/shapeexport.hxx index 7b2659eccbe9..4b4973351e48 100644 --- a/xmloff/inc/xmloff/shapeexport.hxx +++ b/xmloff/inc/xmloff/shapeexport.hxx @@ -281,7 +281,7 @@ public: /** initializes some internal structures for fast access to the given XShapes collection <p>This method has to be called before you use exportShape or collectShapeAutoStyles. - It is automaticly called if you use collectShapesAutoStyles and exportShapes. + It is automatically called if you use collectShapesAutoStyles and exportShapes. @see collectShapeAutoStyles @see exportShape diff --git a/xmloff/inc/xmloff/txtparae.hxx b/xmloff/inc/xmloff/txtparae.hxx index d25a597df431..bac8a769f1f2 100644 --- a/xmloff/inc/xmloff/txtparae.hxx +++ b/xmloff/inc/xmloff/txtparae.hxx @@ -570,7 +570,7 @@ public: /// Record tracked changes for this particular XText /// (empty reference stop recording) /// This should be used if tracked changes for e.g. footers are to - /// be exported seperately via the exportTrackedChanges(sal_Bool, + /// be exported separately via the exportTrackedChanges(sal_Bool, /// Reference<XText>) method. void recordTrackedChangesForXText( const ::com::sun::star::uno::Reference < diff --git a/xmloff/inc/xmloff/txtprmap.hxx b/xmloff/inc/xmloff/txtprmap.hxx index 4f7f862d5d21..45f40e033dff 100644 --- a/xmloff/inc/xmloff/txtprmap.hxx +++ b/xmloff/inc/xmloff/txtprmap.hxx @@ -182,14 +182,6 @@ #define CTF_MARGINTOP (XML_TEXT_CTF_START + 151) #define CTF_MARGINBOTTOM (XML_TEXT_CTF_START + 152) -//UUUU -#define CTF_SW_REPEAT_OFFSET_X (XML_TEXT_CTF_START + 153) -#define CTF_SW_REPEAT_OFFSET_Y (XML_TEXT_CTF_START + 154) -#define CTF_SW_FILLGRADIENTNAME (XML_TEXT_CTF_START + 155) -#define CTF_SW_FILLHATCHNAME (XML_TEXT_CTF_START + 156) -#define CTF_SW_FILLBITMAPNAME (XML_TEXT_CTF_START + 157) -#define CTF_SW_FILLTRANSNAME (XML_TEXT_CTF_START + 158) - #define TEXT_PROP_MAP_TEXT 0 #define TEXT_PROP_MAP_PARA 1 #define TEXT_PROP_MAP_FRAME 2 diff --git a/xmloff/inc/xmloff/uniref.hxx b/xmloff/inc/xmloff/uniref.hxx index b076f3262e48..d8847db2db38 100644 --- a/xmloff/inc/xmloff/uniref.hxx +++ b/xmloff/inc/xmloff/uniref.hxx @@ -31,9 +31,9 @@ /** * An instance of this class holds a pointer to an object. The lifetime of - * the object is controled by the instance. The constructor calls + * the object is controlled by the instance. The constructor calls * acquire() and the destructor calls release(). - * You could delive your class from the baseclass UniRefBase wich implements + * You could delive your class from the baseclass UniRefBase which implements * the methods acquire and release, yet. */ template< class T > class UniReference @@ -201,7 +201,7 @@ inline sal_Bool UniReference< T >::is() const } /** * Return true if both interfaces refer to the same object. The operation can be - * much more expensive than a pointer comparision.<BR> + * much more expensive than a pointer comparison.<BR> * * @param rRef another interface reference */ @@ -212,7 +212,7 @@ inline sal_Bool UniReference< T >::operator == ( const UniReference & rRef ) con } /** * Return true if both interfaces does not refer to the same object. The operation can be - * much more expensive than a pointer comparision.<BR> + * much more expensive than a pointer comparison.<BR> * * @param rRef another interface reference */ diff --git a/xmloff/inc/xmloff/xmlexp.hxx b/xmloff/inc/xmloff/xmlexp.hxx index 162b2c451f76..7127a8316293 100644 --- a/xmloff/inc/xmloff/xmlexp.hxx +++ b/xmloff/inc/xmloff/xmlexp.hxx @@ -531,7 +531,7 @@ public: void IgnorableWhitespace(); /** - * Record an error condition that occured during export. The + * Record an error condition that occurred during export. The * behavior of SetError can be modified using the error flag * constants. */ diff --git a/xmloff/inc/xmloff/xmlimp.hxx b/xmloff/inc/xmloff/xmlimp.hxx index 73d9f8016c1a..5468c46d078a 100644 --- a/xmloff/inc/xmloff/xmlimp.hxx +++ b/xmloff/inc/xmloff/xmlimp.hxx @@ -357,7 +357,7 @@ public: ::rtl::OUString GetODFVersion() const; /** - * Record an error condition that occured during import. The + * Record an error condition that occurred during import. The * behavior of SetError can be modified using the error flag * constants. */ diff --git a/xmloff/inc/xmloff/xmlmultiimagehelper.hxx b/xmloff/inc/xmloff/xmlmultiimagehelper.hxx index 6058afdcfb10..7d0c5c22a323 100644 --- a/xmloff/inc/xmloff/xmlmultiimagehelper.hxx +++ b/xmloff/inc/xmloff/xmlmultiimagehelper.hxx @@ -42,7 +42,7 @@ public: multiImageImportHelper(); virtual ~multiImageImportHelper(); - /// solve multiple imported images. The most valuable one is choosen, + /// solve multiple imported images. The most valuable one is chosen, /// see imlementation for evtl. changing weights and/or adding filetypes. /// returns the winner of the contest (which can be 0 when no candidates) const SvXMLImportContext* solveMultipleImages(); diff --git a/xmloff/inc/xmloff/xmlprmap.hxx b/xmloff/inc/xmloff/xmlprmap.hxx index 4c2ed19e6cd0..c4fce054256c 100644 --- a/xmloff/inc/xmloff/xmlprmap.hxx +++ b/xmloff/inc/xmloff/xmlprmap.hxx @@ -154,7 +154,7 @@ public: sal_uInt32 nPropType, sal_Int32 nStartAt = -1 ) const; - /** Retrieves a PropertyHandler for that property wich placed at nIndex in the XMLPropertyMapEntry-array */ + /** Retrieves a PropertyHandler for that property which placed at nIndex in the XMLPropertyMapEntry-array */ const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nIndex ) const { DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)aMapEntries.size() ), "illegal access to invalid entry!" ); diff --git a/xmloff/inc/xmloff/xmltypes.hxx b/xmloff/inc/xmloff/xmltypes.hxx index 2a8fbc48b0bd..ab8d99114b94 100644 --- a/xmloff/inc/xmloff/xmltypes.hxx +++ b/xmloff/inc/xmloff/xmltypes.hxx @@ -68,8 +68,8 @@ #define MID_FLAG_MERGE_PROPERTY 0x01000000 // Export only: If an xml attribute with the same name has been exported -// already, supply its value to teh exportXML call and delete the existing -// atribute afterwards. +// already, supply its value to the exportXML call and delete the existing +// attribute afterwards. #define MID_FLAG_MERGE_ATTRIBUTE 0x00800000 // Import and Export: The property in question must exist. No call to diff --git a/xmloff/inc/xmloff/xmluconv.hxx b/xmloff/inc/xmloff/xmluconv.hxx index 822c242eb0b6..03bc062e6634 100644 --- a/xmloff/inc/xmloff/xmluconv.hxx +++ b/xmloff/inc/xmloff/xmluconv.hxx @@ -334,7 +334,7 @@ public: the string. See <arg>nSecondsFraction</arg> @param pSecondsFraction - recieves fractions of whole seconds, in milliseconds. May be <NULL/> + receives fractions of whole seconds, in milliseconds. May be <NULL/> This parameter is necessary since neither <type>Time</type> nor <type scope="com::sun::star::util">Time</type> have a sufficient resolution to transport milliseconds. @see http://www.w3.org/TR/xmlschema-2/#duration diff --git a/xmloff/inc/xmlsdtypes.hxx b/xmloff/inc/xmlsdtypes.hxx new file mode 100755 index 000000000000..d38495b03789 --- /dev/null +++ b/xmloff/inc/xmlsdtypes.hxx @@ -0,0 +1,208 @@ +/************************************************************** + * + * 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 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#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 + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/xmloff/source/chart/MultiPropertySetHandler.hxx b/xmloff/source/chart/MultiPropertySetHandler.hxx index aa1aa881a4c6..aa8588656414 100644 --- a/xmloff/source/chart/MultiPropertySetHandler.hxx +++ b/xmloff/source/chart/MultiPropertySetHandler.hxx @@ -132,7 +132,7 @@ public: /** @descr Create a handler of the property set of the given object. @param xObject A reference to any of the object's interfaces. - not neccessarily XPropertySet or XMultiPropertySet. It + not necessarily XPropertySet or XMultiPropertySet. It is casted later to one of the two of them. */ MultiPropertySetHandler (::com::sun::star::uno::Reference< diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx index 0d7f0c75ea95..14625d460f8b 100644 --- a/xmloff/source/chart/PropertyMap.hxx +++ b/xmloff/source/chart/PropertyMap.hxx @@ -201,7 +201,7 @@ const XMLPropertyMapEntry aXMLChartPropMap[] = MAP_SPECIAL( "TextRotation", STYLE, XML_ROTATION_ANGLE, XML_TYPE_NUMBER, XML_SCH_CONTEXT_SPECIAL_TEXT_ROTATION ), // convert 1/100th degrees to degrees MAP_ENTRY( "StackedText", STYLE, XML_DIRECTION, XML_SCH_TYPE_TEXT_ORIENTATION ), - // for compatability to pre 6.0beta documents + // for compatibility to pre 6.0beta documents // MAP_SPECIAL( "SymbolBitmapURL", CHART, XML_SYMBOL_IMAGE_NAME, XML_TYPE_STRING, XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE_NAME ), MAP_ENTRY( "ChartUserDefinedAttributes", TEXT, XML_XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM ), diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 1dec96c39cf1..da46621569d8 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -1567,7 +1567,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& if( mxAdditionalShapes.is()) { // can't call exportShapes with all shapes because the - // initialisation happend with the complete draw page and not + // initialisation happened with the complete draw page and not // the XShapes object used here. Thus the shapes have to be // exported one by one UniReference< XMLShapeExport > rShapeExport = mrExport.GetShapeExport(); @@ -1622,7 +1622,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& } // can't call collectShapesAutoStyles with all shapes because - // the initialisation happend with the complete draw page and + // the initialisation happened with the complete draw page and // not the XShapes object used here. Thus the shapes have to be // exported one by one UniReference< XMLShapeExport > rShapeExport = mrExport.GetShapeExport(); diff --git a/xmloff/source/core/xmlerror.cxx b/xmloff/source/core/xmlerror.cxx index 1a0e6a2b3c3a..69bd20b4db6d 100644 --- a/xmloff/source/core/xmlerror.cxx +++ b/xmloff/source/core/xmlerror.cxx @@ -69,8 +69,8 @@ public: OUString sExceptionMessage;/// message of original exception (if available) // XLocator information: - sal_Int32 nRow; /// row number where error occured (or -1 for unknown) - sal_Int32 nColumn; /// column number where error occured (or -1) + sal_Int32 nRow; /// row number where error occurred (or -1 for unknown) + sal_Int32 nColumn; /// column number where error occurred (or -1) OUString sPublicId; /// public identifier OUString sSystemId; /// public identifier @@ -125,7 +125,7 @@ void XMLErrors::AddRecord( OUStringBuffer sMessage; - sMessage.appendAscii( "An error or a warning has occured during XML import/export!\n" ); + sMessage.appendAscii( "An error or a warning has occurred during XML import/export!\n" ); // ID & flags sMessage.appendAscii( "Error-Id: 0x"); diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 3f48d7dba30e..9112166bd076 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -946,7 +946,7 @@ sal_Bool SAL_CALL SvXMLExport::filter( const uno::Sequence< beans::PropertyValue aSeq, e.Message, NULL ); } - // return true only if no error occured + // return true only if no error occurred return (GetErrorFlags() & (ERROR_DO_NOTHING|ERROR_ERROR_OCCURED)) == 0; } diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index eec0db8acd73..ec535890ebb3 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -828,7 +828,7 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName, pContext->AddRef(); - // Remeber old namespace map. + // Remember old namespace map. if( pRewindMap ) pContext->SetRewindMap( pRewindMap ); diff --git a/xmloff/source/draw/XMLShapeStyleContext.cxx b/xmloff/source/draw/XMLShapeStyleContext.cxx index 86366a2933f4..757214b3503e 100644 --- a/xmloff/source/draw/XMLShapeStyleContext.cxx +++ b/xmloff/source/draw/XMLShapeStyleContext.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/drawing/XControlShape.hpp> #include "com/sun/star/beans/XPropertySetInfo.hpp" #include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <com/sun/star/drawing/FillStyle.hpp> #include <xmloff/xmlimp.hxx> #include <xmloff/xmlnumi.hxx> #include <xmloff/xmlnmspe.hxx> @@ -46,6 +47,7 @@ using ::rtl::OUStringBuffer; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::drawing; using ::xmloff::token::IsXMLToken; using ::xmloff::token::XML_TEXT_PROPERTIES; using ::xmloff::token::XML_GRAPHIC_PROPERTIES; @@ -61,7 +63,8 @@ XMLShapeStyleContext::XMLShapeStyleContext( SvXMLStylesContext& rStyles, sal_uInt16 nFamily) : XMLPropStyleContext(rImport, nPrfx, rLName, xAttrList, rStyles, nFamily ), - m_bIsNumRuleAlreadyConverted( sal_False ) + m_bIsNumRuleAlreadyConverted( sal_False ), + m_bIsFillStyleAlreadyConverted(false) //UUUU { } @@ -193,6 +196,20 @@ 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()) + { + static ::rtl::OUString s_FillStyle(RTL_CONSTASCII_USTRINGPARAM("FillStyle")); + + if(doNewDrawingLayerFillStyleDefinitionsExist(s_FillStyle)) + { + deactivateOldFillStyleDefinitions(getStandardSet()); + } + + m_bIsFillStyleAlreadyConverted = true; + } + struct _ContextID_Index_Pair aContextIDs[] = { { CTF_DASHNAME , -1 }, diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx index aaeba1449c90..4a3866077613 100644 --- a/xmloff/source/draw/eventimp.cxx +++ b/xmloff/source/draw/eventimp.cxx @@ -457,7 +457,7 @@ void SdXMLEventContext::EndElement() pProperties++; // ClickAction_BOOKMARK and ClickAction_DOCUMENT share the same xml event - // so check here if its realy a bookmark or maybe a document + // so check here if its really a bookmark or maybe a document if( meClickAction == ClickAction_BOOKMARK ) { if( msBookmark.compareToAscii( "#", 1 ) != 0 ) diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx index 3bb2b72071fd..bcad2025bbea 100644 --- a/xmloff/source/draw/sdpropls.cxx +++ b/xmloff/source/draw/sdpropls.cxx @@ -123,12 +123,11 @@ const XMLPropertyMapEntry aXMLSDProperties[] = 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_SD_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, 0 ), + 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_SD_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, 0 ), GMAP( "FillBitmapLogicalSize", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_WIDTH, XML_SD_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, 0 ), - GMAP( "FillBitmapSizeY", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT, XML_SD_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, 0 ), + GMAP( "FillBitmapSizeY", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT, XML_SD_TYPE_FILLBITMAPSIZE|MID_FLAG_MULTI_PROPERTY, 0 ), GMAP( "FillBitmapLogicalSize", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_HEIGHT, XML_SD_TYPE_LOGICAL_SIZE|MID_FLAG_MULTI_PROPERTY, 0 ), GMAP( "FillBitmapMode", XML_NAMESPACE_STYLE,XML_REPEAT, XML_SD_TYPE_BITMAP_MODE|MID_FLAG_MULTI_PROPERTY, 0 ), GMAP( "FillBitmapPositionOffsetX", XML_NAMESPACE_DRAW, XML_FILL_IMAGE_REF_POINT_X, XML_TYPE_PERCENT, 0 ), diff --git a/xmloff/source/draw/sdpropls.hxx b/xmloff/source/draw/sdpropls.hxx index b5befc3d1161..2bc469a4500f 100644 --- a/xmloff/source/draw/sdpropls.hxx +++ b/xmloff/source/draw/sdpropls.hxx @@ -19,8 +19,6 @@ * *************************************************************/ - - #ifndef _SDPROPLS_HXX #define _SDPROPLS_HXX @@ -33,6 +31,7 @@ #include <xmloff/xmlprmap.hxx> #include "xmloff/XMLTextListAutoStylePool.hxx" #include <xmloff/xmlexppr.hxx> +#include <xmlsdtypes.hxx> ////////////////////////////////////////////////////////////////////////////// // entry list for graphic properties @@ -46,176 +45,6 @@ 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 aXML_ConnectionKind_EnumMap[]; diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index c23db9de22b5..b754a46feaa6 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -897,7 +897,7 @@ sal_Bool SdXMLExport::ImpPrepAutoLayoutInfo(const Reference<XDrawPage>& xPage, O } } - // create entry and look for existance + // create entry and look for existence ImpXMLAutoLayoutInfo* pNew = new ImpXMLAutoLayoutInfo(nType, pInfo); sal_Bool bDidExist(sal_False); diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx index 593bddf3cc31..e76c226f3803 100644 --- a/xmloff/source/draw/shapeexport2.cxx +++ b/xmloff/source/draw/shapeexport2.cxx @@ -674,7 +674,7 @@ void XMLShapeExport::ImpExportGroupShape( const uno::Reference< drawing::XShape ImpExportEvents( xShape ); ImpExportGluePoints( xShape ); - // #89764# if export of position is supressed for group shape, + // #89764# if export of position is suppressed for group shape, // positions of contained objects should be written relative to // the upper left edge of the group. awt::Point aUpperLeft; @@ -1065,37 +1065,38 @@ void XMLShapeExport::ImpExportPolygonShape( void XMLShapeExport::ImpExportGraphicObjectShape( const uno::Reference< drawing::XShape >& xShape, - XmlShapeType eShapeType, sal_Int32 nFeatures, awt::Point* pRefPoint) + XmlShapeType eShapeType, + sal_Int32 nFeatures, + awt::Point* pRefPoint ) { - const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY); - if(xPropSet.is()) + const uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY ); + if ( xPropSet.is() ) { sal_Bool bIsEmptyPresObj = sal_False; uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() ); // Transformation - ImpExportNewTrans(xPropSet, nFeatures, pRefPoint); + ImpExportNewTrans( xPropSet, nFeatures, pRefPoint ); OUString sImageURL; - if(eShapeType == XmlShapeTypePresGraphicObjectShape) - bIsEmptyPresObj = ImpExportPresentationAttributes( xPropSet, GetXMLToken(XML_PRESENTATION_GRAPHIC) ); + if ( eShapeType == XmlShapeTypePresGraphicObjectShape ) + bIsEmptyPresObj = ImpExportPresentationAttributes( xPropSet, GetXMLToken( XML_PRESENTATION_GRAPHIC ) ); - sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210# - SvXMLElementExport aElem( mrExport, XML_NAMESPACE_DRAW, - XML_FRAME, bCreateNewline, sal_True ); + sal_Bool bCreateNewline( ( nFeatures & SEF_EXPORT_NO_WS ) == 0 ); // #86116#/#92210# + SvXMLElementExport aElem( mrExport, XML_NAMESPACE_DRAW, XML_FRAME, bCreateNewline, sal_True ); const bool bSaveBackwardsCompatible = ( mrExport.getExportFlags() & EXPORT_SAVEBACKWARDCOMPATIBLE ); - if( !bIsEmptyPresObj || bSaveBackwardsCompatible ) + if ( !bIsEmptyPresObj || bSaveBackwardsCompatible ) { - if( !bIsEmptyPresObj ) + if ( !bIsEmptyPresObj ) { OUString aReplacementUrl; xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("ReplacementGraphicURL"))) >>= aReplacementUrl; // If there is no url, then then graphic is empty - if(aReplacementUrl.getLength()) + if ( aReplacementUrl.getLength() ) { const OUString aStr = mrExport.AddEmbeddedGraphicObject(aReplacementUrl); @@ -1115,15 +1116,13 @@ void XMLShapeExport::ImpExportGraphicObjectShape( } OUString aStreamURL; - OUString aStr; - - xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicStreamURL"))) >>= aStreamURL; - xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicURL"))) >>= sImageURL; + xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "GraphicStreamURL" ) ) ) >>= aStreamURL; + xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ) ) >>= sImageURL; OUString aResolveURL( sImageURL ); - const rtl::OUString sPackageURL( RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.Package:") ); + const rtl::OUString sPackageURL( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.Package:" ) ); - // sj: trying to preserve the filename + // sj: trying to preserve the filename if ( aStreamURL.match( sPackageURL, 0 ) ) { rtl::OUString sRequestedName( aStreamURL.copy( sPackageURL.getLength(), aStreamURL.getLength() - sPackageURL.getLength() ) ); @@ -1135,50 +1134,54 @@ void XMLShapeExport::ImpExportGraphicObjectShape( sRequestedName = sRequestedName.copy( 0, nLastIndex ); if ( sRequestedName.getLength() ) { - aResolveURL = aResolveURL.concat( OUString(RTL_CONSTASCII_USTRINGPARAM("?requestedName="))); + aResolveURL = aResolveURL.concat( OUString( RTL_CONSTASCII_USTRINGPARAM( "?requestedName=" ) ) ); aResolveURL = aResolveURL.concat( sRequestedName ); } } - aStr = mrExport.AddEmbeddedGraphicObject( aResolveURL ); - mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, aStr ); + const OUString aStr = mrExport.AddEmbeddedGraphicObject( aResolveURL ); + mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aStr ); - if( aStr.getLength() ) + if ( !aStr.isEmpty() ) { - if( aStr[ 0 ] == '#' ) + aStreamURL = sPackageURL; + if ( aStr[0] == '#' ) { - aStreamURL = sPackageURL; aStreamURL = aStreamURL.concat( aStr.copy( 1, aStr.getLength() - 1 ) ); } + else + { + aStreamURL = aStreamURL.concat( aStr ); + } // update stream URL for load on demand uno::Any aAny; aAny <<= aStreamURL; - xPropSet->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("GraphicStreamURL")), aAny ); + xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "GraphicStreamURL" ) ), aAny ); - mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); - mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED ); - mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD ); + mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); + mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED ); + mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD ); } } else { OUString aStr; - mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, aStr ); - mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); - mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED ); - mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD ); + mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aStr ); + mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); + mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED ); + mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD ); } { - SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, XML_IMAGE, sal_True, sal_True); + SvXMLElementExport aOBJ( mrExport, XML_NAMESPACE_DRAW, XML_IMAGE, sal_True, sal_True ); - if( sImageURL.getLength() ) + if ( sImageURL.getLength() ) { // optional office:binary-data mrExport.AddEmbeddedGraphicObjectAsBase64( sImageURL ); } - if( !bIsEmptyPresObj ) + if ( !bIsEmptyPresObj ) ImpExportText( xShape ); } } @@ -1578,7 +1581,7 @@ void XMLShapeExport::ImpExportOLE2Shape( if ( bInternal ) { - // OOo internal links have no storage persistance, URL is stored in the XML file + // OOo internal links have no storage persistence, URL is stored in the XML file // the result LinkURL is empty in case the object is not a link xPropSet->getPropertyValue( OUString::createFromAscii( "LinkURL" ) ) >>= sURL; } diff --git a/xmloff/source/draw/shapeexport3.cxx b/xmloff/source/draw/shapeexport3.cxx index 9e1c99efe0e3..f9e071e35885 100644 --- a/xmloff/source/draw/shapeexport3.cxx +++ b/xmloff/source/draw/shapeexport3.cxx @@ -81,7 +81,7 @@ void XMLShapeExport::ImpExport3DSceneShape( const uno::Reference< drawing::XShap // write 3DSceneLights export3DLamps( xPropSet ); - // #89764# if export of position is supressed for group shape, + // #89764# if export of position is suppressed for group shape, // positions of contained objects should be written relative to // the upper left edge of the group. awt::Point aUpperLeft; diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index c563b44da81f..eb7ed554b5ba 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -887,7 +887,7 @@ void XMLEnhancedCustomShapeContext::StartElement( const uno::Reference< xml::sax // entries for CustomShapes. To allow for a better ODF user experience, just correct this // here by getting the real object scale from the already set transformation from the xShape. // Hopefully LO will fix that bug (but this will still leave the files with the error), but - // even when not this will do no harm as long noone uses this state explicitely for some + // even when not this will do no harm as long no one uses this state explicitely for some // purpose (e.g. to really have CustomShapes without content, but unlikely). // When they do fix this they will need this fix anyways to read their own misformed ODF files // again, so I guess it will be taken, too... diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index f13ed31db6a1..23d83eb22423 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -1937,7 +1937,7 @@ namespace xmloff //--------------------------------------------------------------------- void OColumnWrapperImport::StartElement(const Reference< sax::XAttributeList >& _rxAttrList) { - OSL_ENSURE(!m_xOwnAttributes.is(), "OColumnWrapperImport::StartElement: aready have the cloned list!"); + OSL_ENSURE(!m_xOwnAttributes.is(), "OColumnWrapperImport::StartElement: already have the cloned list!"); // clone the attributes Reference< XCloneable > xCloneList(_rxAttrList, UNO_QUERY); diff --git a/xmloff/source/forms/eventimport.hxx b/xmloff/source/forms/eventimport.hxx index bf2285309274..76a9a545ab49 100644 --- a/xmloff/source/forms/eventimport.hxx +++ b/xmloff/source/forms/eventimport.hxx @@ -63,7 +63,7 @@ namespace xmloff OPropertySetCompare, // compare method MapPropertySet2ScriptSequence); // class name // usually an event attacher manager will need to collect all script events registered, 'cause - // the _real_ XEventAttacherManager handles it's events by index, but out indicies are not fixed + // the _real_ XEventAttacherManager handles it's events by index, but out indices are not fixed // until _all_ controls have been inserted. MapPropertySet2ScriptSequence m_aEvents; diff --git a/xmloff/source/forms/formcellbinding.hxx b/xmloff/source/forms/formcellbinding.hxx index 4974a3b54ceb..06d2a98f4b5e 100644 --- a/xmloff/source/forms/formcellbinding.hxx +++ b/xmloff/source/forms/formcellbinding.hxx @@ -254,7 +254,7 @@ namespace xmloff the AddressConversion service @return - <TRUE/> if any only if the conversion was successfull + <TRUE/> if any only if the conversion was successful @see com::sun::star::table::CellAddressConversion @see com::sun::star::table::CellRangeAddressConversion diff --git a/xmloff/source/forms/layerexport.cxx b/xmloff/source/forms/layerexport.cxx index 481cc6582d1e..b7fe010d847a 100644 --- a/xmloff/source/forms/layerexport.cxx +++ b/xmloff/source/forms/layerexport.cxx @@ -387,7 +387,7 @@ namespace xmloff // (This behaviour of examineForms is a performance optimization, to not force // the page to create a forms container just to see that it's empty.) - // So, in such a case, seekPage is considered to be successfull, too, though the + // So, in such a case, seekPage is considered to be successful, too, though the // page was not yet known Reference< XFormsSupplier2 > xFormsSupp( _rxDrawPage, UNO_QUERY ); if ( xFormsSupp.is() && !xFormsSupp->hasForms() ) diff --git a/xmloff/source/forms/layerexport.hxx b/xmloff/source/forms/layerexport.hxx index 46e19257ff3a..088a3a49e7d9 100644 --- a/xmloff/source/forms/layerexport.hxx +++ b/xmloff/source/forms/layerexport.hxx @@ -103,7 +103,7 @@ namespace xmloff MapPropertySet2Map m_aReferringControls; // for a given page (iter->first), and a given control (iter->second->first), this is the comma-separated - // lists of ids of the controls refering to the control given. + // lists of ids of the controls referring to the control given. MapPropertySet2Map::iterator m_aCurrentPageIds; diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx index 6eca48512cb2..342e84504c8e 100644 --- a/xmloff/source/forms/propertyexport.cxx +++ b/xmloff/source/forms/propertyexport.cxx @@ -284,7 +284,7 @@ namespace xmloff const ::rtl::OUString& _rPropertyName, const sal_Int8 _nBooleanAttributeFlags) { DBG_CHECK_PROPERTY_NO_TYPE( _rPropertyName ); - // no check of the property value type: this method is allowed to be called with any interger properties + // no check of the property value type: this method is allowed to be called with any integer properties // (e.g. sal_Int32, sal_uInt16 etc) sal_Bool bDefault = (BOOLATTR_DEFAULT_TRUE == (BOOLATTR_DEFAULT_MASK & _nBooleanAttributeFlags)); diff --git a/xmloff/source/forms/propertyexport.hxx b/xmloff/source/forms/propertyexport.hxx index f7a99388900c..43be20ff9fce 100644 --- a/xmloff/source/forms/propertyexport.hxx +++ b/xmloff/source/forms/propertyexport.hxx @@ -44,7 +44,7 @@ namespace xmloff #define BOOLATTR_DEFAULT_MASK 0x03 #define BOOLATTR_INVERSE_SEMANTICS 0x04 - // if sal_True, indicates that the semantic of the property refered by <arg>_pPropertyName</arg> + // if sal_True, indicates that the semantic of the property referred by <arg>_pPropertyName</arg> // is inverse to the semantic of the XML attribute.<br/> // I.e. if the property value is <TRUE/>, <FALSE/> has to be written and vice versa. // <p>Be careful with <arg>_bDefault</arg> and <arg>_bInverseSemantics</arg>: if <arg>_bInverseSemantics</arg> @@ -251,7 +251,7 @@ namespace xmloff /** add an arbitrary attribute extracted from an arbitrary property to the export context - <p>The current value of the property specified wiht <arg>_pPropertyName</arg> is taken and converted + <p>The current value of the property specified with <arg>_pPropertyName</arg> is taken and converted into a string, no matter what type it has. (Okay, there are the usual limitations: We know Date, Datetime, double, integer ... to name just a few).</p> @@ -280,13 +280,13 @@ namespace xmloff /** exports a property value, which is a string sequence, as attribute <p>The elements of the string sequence given are quoted and concatenated, with the characters used for - this to be choosen by the caller</p> + this to be chosen by the caller</p> <p>If you use the quote character, no check (except assertions) is made if one of the list items - containes the quote character</p> + contains the quote character</p> <p>If you don't use the quote character, no check (except assertions) is made if one of the list items - containes the separator character (which would be deadly when reimporting the string)</p> + contains the separator character (which would be deadly when reimporting the string)</p> @param _nNamespaceKey the key of the namespace to use for the attribute name. Is used with the namespace map diff --git a/xmloff/source/meta/xmlversion.cxx b/xmloff/source/meta/xmlversion.cxx index e41d3583830b..6bc1caadae62 100644 --- a/xmloff/source/meta/xmlversion.cxx +++ b/xmloff/source/meta/xmlversion.cxx @@ -387,7 +387,7 @@ void SAL_CALL XMLVersionListPersistence::store( const uno::Reference< embed::XSt if ( !xVerStream.is() ) throw uno::RuntimeException(); -//REMOVE // SetSize should not be neccessary because OpenStream( WRITE|TRUNC ) should already +//REMOVE // SetSize should not be necessary because OpenStream( WRITE|TRUNC ) should already //REMOVE // have set the size to zero //REMOVE // xVerStream->SetSize ( 0L ); //REMOVE xVerStream->SetBufferSize( 16*1024 ); diff --git a/xmloff/source/style/PageMasterExportPropMapper.cxx b/xmloff/source/style/PageMasterExportPropMapper.cxx index 199cb4bffb9d..ed7a74cc5c91 100644 --- a/xmloff/source/style/PageMasterExportPropMapper.cxx +++ b/xmloff/source/style/PageMasterExportPropMapper.cxx @@ -19,10 +19,9 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include "PageMasterExportPropMapper.hxx" #include <xmloff/xmltoken.hxx> #include <comphelper/types.hxx> @@ -32,13 +31,15 @@ #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; using namespace ::comphelper; using namespace ::xmloff::token; - //______________________________________________________________________________ inline sal_Bool lcl_HasSameLineWidth( const table::BorderLine& rLine1, const table::BorderLine& rLine2 ) @@ -339,6 +340,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 ) @@ -396,7 +405,64 @@ void XMLPageMasterExportPropMapper::ContextFilter( case CTF_PM_STANDARD_MODE: pPMStandardMode = pProp; break; case CTP_PM_GRID_BASE_WIDTH: pPMGridBaseWidth = pProp; break; case CTP_PM_GRID_SNAP_TO_CHARS: pPMGridSnapToChars = 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; @@ -404,6 +470,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 2d553e973d1e..e4f2e5a838b5 100644 --- a/xmloff/source/style/PageMasterImportContext.cxx +++ b/xmloff/source/style/PageMasterImportContext.cxx @@ -19,34 +19,33 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" - #include "PageMasterImportContext.hxx" #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> #include "PageMasterPropHdl.hxx" #include "PagePropertySetContext.hxx" -#ifndef _XMLOFF_PAGEPHEADERFOOTERCONTEXT_HXX #include "PageHeaderFooterContext.hxx" -#endif -#ifndef _XMLOFF_PAGEMASTERPROPMAPPER_HXX #include "PageMasterPropMapper.hxx" -#endif #include "PageMasterImportPropMapper.hxx" -#ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX #include <xmloff/PageMasterStyleMap.hxx> -#endif #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 rtl::OUString& rLocalName, const rtl::OUString& rValue ) @@ -68,7 +67,8 @@ PageStyleContext::PageStyleContext( SvXMLImport& rImport, SvXMLStylesContext& rStyles, sal_Bool bDefaultStyle) : XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, XML_STYLE_FAMILY_PAGE_MASTER, bDefaultStyle), - sPageUsage() + sPageUsage(), + m_bIsFillStyleAlreadyConverted(false) //UUUU { } @@ -165,10 +165,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.getLength()) { uno::Any aPageUsage; @@ -193,3 +331,4 @@ void PageStyleContext::SetDefaults( ) } } +//eof diff --git a/xmloff/source/style/PageMasterPropHdlFactory.cxx b/xmloff/source/style/PageMasterPropHdlFactory.cxx index 12613bd098f7..edc4fdd99d48 100644 --- a/xmloff/source/style/PageMasterPropHdlFactory.cxx +++ b/xmloff/source/style/PageMasterPropHdlFactory.cxx @@ -19,32 +19,41 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include "PageMasterPropHdlFactory.hxx" #include <xmloff/xmltypes.hxx> #include <xmloff/xmltoken.hxx> #include "xmlbahdl.hxx" #include <xmloff/NamedBoolPropertyHdl.hxx> -#ifndef _XMLOFF_XMLTEXTCOLUMNSPPROPERTYHANDLER_HXX #include "XMLTextColumnsPropertyHandler.hxx" -#endif #include <xmloff/XMLConstantsPropertyHandler.hxx> #include "PageMasterPropHdl.hxx" -#ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX #include <xmloff/PageMasterStyleMap.hxx> -#endif #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 ::rtl::OUString; using ::rtl::OUStringBuffer; 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[]; SvXMLEnumMapEntry aXML_TextGridMode_ConstantMap[] = { @@ -135,6 +144,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 e49e65994286..2aa7440ad40c 100644 --- a/xmloff/source/style/PageMasterStyleMap.cxx +++ b/xmloff/source/style/PageMasterStyleMap.cxx @@ -19,83 +19,88 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" #include <xmloff/PageMasterStyleMap.hxx> - #include <xmloff/xmlnmspe.hxx> #include <xmloff/xmltoken.hxx> +//UUUU +#include <xmloff/txtprmap.hxx> + using namespace ::xmloff::token; #define _MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, static_cast<sal_Int32>(type), context, SvtSaveOptions::ODFVER_010 } -#define PLMAP(name,prefix,token,type,context) \ - _MAP(name,prefix,token,type|XML_TYPE_PROP_PAGE_LAYOUT,context) -#define HFMAP(name,prefix,token,type,context) \ - _MAP(name,prefix,token,type|XML_TYPE_PROP_HEADER_FOOTER,context) +#define PLMAP(name,prefix,token,type,context) _MAP(name,prefix,token,type|XML_TYPE_PROP_PAGE_LAYOUT,context) +#define HFMAP(name,prefix,token,type,context) _MAP(name,prefix,token,type|XML_TYPE_PROP_HEADER_FOOTER,context) + +//UUUU +#define GMAP(name,prefix,token,type,context) _MAP(name,prefix,token,static_cast<sal_Int32>(type|XML_TYPE_PROP_GRAPHIC),context) //______________________________________________________________________________ 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 ), @@ -111,79 +116,158 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] = //export as a default attribute PLMAP( "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_HEIGTH ), - 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_WEIGTH ), - -// 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_WEIGTH ), + + ////////////////////////////////////////////////////////////////////////// + //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 } + //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 } // index 190 }; +//eof diff --git a/xmloff/source/style/impastp4.cxx b/xmloff/source/style/impastp4.cxx index 448829d255a6..809e5c7d3d8b 100644 --- a/xmloff/source/style/impastp4.cxx +++ b/xmloff/source/style/impastp4.cxx @@ -388,7 +388,7 @@ void SvXMLAutoStylePoolP_Impl::exportXML( { ///////////////////////////////////////////////////////////////////////////////////// // create, initialize and fill helper-structure (SvXMLAutoStylePoolProperties_Impl) - // wich contains a parent-name and a SvXMLAutoStylePoolProperties_Impl + // which contains a parent-name and a SvXMLAutoStylePoolProperties_Impl // const SvXMLAutoStylePoolParentsP_Impl *pParents = pFamily->mpParentList; diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index 274010432412..d8c8f0f063c7 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -19,12 +19,9 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" - #include <tools/debug.hxx> #ifndef __SGI_STL_SET #include <set> @@ -40,13 +37,13 @@ #include <com/sun/star/beans/XMultiPropertyStates.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <xmloff/xmlimp.hxx> - -#ifndef _XMLOFF_PRSTYLEI_HXX #include <xmloff/prstylei.hxx> -#endif #include <xmloff/attrlist.hxx> #include "xmloff/xmlerror.hxx" +//UUUU +#include <com/sun/star/drawing/FillStyle.hpp> + using ::rtl::OUString; using ::rtl::OUStringBuffer; @@ -59,6 +56,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, @@ -74,15 +73,25 @@ void XMLPropStyleContext::SetAttribute( sal_uInt16 nPrefixKey, } } -XMLPropStyleContext::XMLPropStyleContext( SvXMLImport& rImport, - sal_uInt16 nPrfx, const OUString& rLName, - const Reference< XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily, - sal_Bool bDefault ) -: SvXMLStyleContext( rImport, nPrfx, rLName, xAttrList, nFamily, bDefault ) -, msIsPhysical( RTL_CONSTASCII_USTRINGPARAM( "IsPhysical" ) ) -, msFollowStyle( RTL_CONSTASCII_USTRINGPARAM( "FollowStyle" ) ) -, mxStyles( &rStyles ) + +//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, + SvXMLStylesContext& rStyles, + sal_uInt16 nFamily, + sal_Bool bDefault) +: SvXMLStyleContext(rImport, nPrfx, rLName, xAttrList, nFamily, bDefault), + msIsPhysical(RTL_CONSTASCII_USTRINGPARAM("IsPhysical")), + msFollowStyle(RTL_CONSTASCII_USTRINGPARAM("FollowStyle")), + mxStyles(&rStyles) { } @@ -90,6 +99,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, @@ -184,16 +261,45 @@ typedef ::std::set < OUString, ::comphelper::UStringLess > PropertyNameSet; void XMLPropStyleContext::CreateAndInsert( sal_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; @@ -242,8 +348,7 @@ void XMLPropStyleContext::CreateAndInsert( sal_Bool bOverwrite ) if( 0 == rName.getLength() || IsDefaultStyle() ) return; - Reference < XNameContainer > xFamilies = - ((SvXMLStylesContext *)&mxStyles)->GetStylesContainer( GetFamily() ); + Reference < XNameContainer > xFamilies = pSvXMLStylesContext->GetStylesContainer( GetFamily() ); if( !xFamilies.is() ) return; @@ -282,10 +387,6 @@ void XMLPropStyleContext::CreateAndInsert( sal_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() ) @@ -414,3 +515,135 @@ void XMLPropStyleContext::Finish( sal_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; +} + +//eof diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx index bb47f293ccfc..a27c2076c7b9 100644 --- a/xmloff/source/style/styleexp.cxx +++ b/xmloff/source/style/styleexp.cxx @@ -520,7 +520,7 @@ void XMLStyleExport::exportStyleFamily( Reference< XPropertySet > xPropSet( xStyle, UNO_QUERY ); Reference< XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() ); - // styles that aren't existing realy are ignored. + // styles that aren't existing really are ignored. if( xPropSetInfo->hasPropertyByName( sIsPhysical ) ) { Any aAny( xPropSet->getPropertyValue( sIsPhysical ) ); diff --git a/xmloff/source/style/xmlaustp.cxx b/xmloff/source/style/xmlaustp.cxx index cffb23851bf2..6c133c8aca4b 100644 --- a/xmloff/source/style/xmlaustp.cxx +++ b/xmloff/source/style/xmlaustp.cxx @@ -119,7 +119,7 @@ void SvXMLAutoStylePoolP::exportStyleAttributes( if (bFoundControlShapeDataStyle) { DBG_ERROR("SvXMLAutoStylePoolP::exportStyleAttributes: found two properties with the ControlShapeDataStyle context id!"); - // already added the attribute for the first occurence + // already added the attribute for the first occurrence break; } @@ -134,7 +134,7 @@ void SvXMLAutoStylePoolP::exportStyleAttributes( if (bFoundNumberingRulesName) { DBG_ERROR("SvXMLAutoStylePoolP::exportStyleAttributes: found two properties with the numbering rules name context id!"); - // already added the attribute for the first occurence + // already added the attribute for the first occurrence break; } diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index da1a1991e5bb..3e8a8e039e19 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -277,7 +277,7 @@ void FilterPropertiesInfo_Impl::AddProperty( aPropInfos.push_back(FilterPropertyInfo_Impl(rApiName, nIndex)); nCount++; - OSL_ENSURE( !pApiNames, "perfomance warning: API names already retrieved" ); + OSL_ENSURE( !pApiNames, "performance warning: API names already retrieved" ); if( pApiNames ) { delete pApiNames; diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx index 342057c67972..2c31d549ff52 100644 --- a/xmloff/source/style/xmlimppr.cxx +++ b/xmloff/source/style/xmlimppr.cxx @@ -333,7 +333,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/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index cc1a43ba7dfc..88f5d741ea76 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -1724,7 +1724,7 @@ void SvXMLNumFmtExport::Export( sal_Bool bIsAutoStyle ) DBG_ASSERT((pFormat->GetType() & NUMBERFORMAT_DEFINED) != 0, "a not user defined numberformat found"); // user-defined and used formats are exported ExportFormat_Impl( *pFormat, nKey ); - // if it is a user-defined Format it will be added else nothing will hapen + // if it is a user-defined Format it will be added else nothing will happen pUsedList->SetUsed(nKey); } diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index ccf25b67851e..581718d27ca4 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -842,7 +842,7 @@ void lcl_EnquoteIfNecessary( rtl::OUStringBuffer& rContent, const SvXMLNumFormat else if ( rParent.GetType() == XML_TOK_STYLES_PERCENTAGE_STYLE && nLength > 1 ) { // the percent character in percentage styles must be left out of quoting - // (one occurence is enough even if there are several percent characters in the string) + // (one occurrence is enough even if there are several percent characters in the string) rtl::OUString aString( rContent.getStr() ); sal_Int32 nPos = aString.indexOf( (sal_Unicode) '%' ); diff --git a/xmloff/source/style/xmlprmap.cxx b/xmloff/source/style/xmlprmap.cxx index 8029249f09cd..3c284f2495a4 100644 --- a/xmloff/source/style/xmlprmap.cxx +++ b/xmloff/source/style/xmlprmap.cxx @@ -172,7 +172,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/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx index f790049cf709..056939f9fcf4 100644 --- a/xmloff/source/table/XMLTableExport.cxx +++ b/xmloff/source/table/XMLTableExport.cxx @@ -268,7 +268,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) Reference< XCellRange > xCellRange( xPropSet, UNO_QUERY_THROW ); for ( sal_Int32 nColumn = 0; nColumn < nColumnCount; ++nColumn ) { - // get current cell, remarks row index is 0, because we get the range for each row seperate + // get current cell, remarks row index is 0, because we get the range for each row separate Reference< XPropertySet > xCellSet( xCellRange->getCellByPosition(nColumn, 0), UNO_QUERY_THROW ); // get style @@ -369,7 +369,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) for ( sal_Int32 columnIndex = 0; columnIndex < columnCount; columnIndex++ ) { - // get current cell, remarks row index is 0, because we get the range for each row seperate + // get current cell, remarks row index is 0, because we get the range for each row separate Reference< XCell > xCell( xCellRange->getCellByPosition(columnIndex, 0), UNO_QUERY_THROW ); // use XMergeableCell interface from offapi diff --git a/xmloff/source/text/XMLChangedRegionImportContext.hxx b/xmloff/source/text/XMLChangedRegionImportContext.hxx index f0187433f92d..bcbad9a40f35 100644 --- a/xmloff/source/text/XMLChangedRegionImportContext.hxx +++ b/xmloff/source/text/XMLChangedRegionImportContext.hxx @@ -47,7 +47,7 @@ class XMLChangedRegionImportContext : public SvXMLImportContext const ::rtl::OUString sEmpty; /// if we replace the current XTextCursor/XText by the ones for - /// the redline, we remeber the old cursor here. + /// the redline, we remember the old cursor here. ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor> xOldCursor; diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index 3414d6ca0008..aded76027671 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -891,7 +891,7 @@ void XMLSectionExport::ExportBaseIndexSource( aAny = xLevelTemplates->getByIndex(i); aAny >>= aTemplateSequence; - // export the sequence (abort export if an error occured; #91214#) + // export the sequence (abort export if an error occurred; #91214#) sal_Bool bResult = ExportIndexTemplate(eType, i, rPropertySet, aTemplateSequence); if ( !bResult ) diff --git a/xmloff/source/text/XMLSectionImportContext.cxx b/xmloff/source/text/XMLSectionImportContext.cxx index 0b9b4a212fe1..9e19388d23a6 100644 --- a/xmloff/source/text/XMLSectionImportContext.cxx +++ b/xmloff/source/text/XMLSectionImportContext.cxx @@ -179,7 +179,7 @@ void XMLSectionImportContext::StartElement( xPropSet->setPropertyValue( sIsVisible, aAny ); // #97450# hidden sections must be hidden on reload - // For backwards compatibilty, set flag only if it is + // For backwards compatibility, set flag only if it is // present if( bIsCurrentlyVisibleOK ) { diff --git a/xmloff/source/text/XMLSectionImportContext.hxx b/xmloff/source/text/XMLSectionImportContext.hxx index fd0adcdba3dd..f66fd4c3a8e9 100644 --- a/xmloff/source/text/XMLSectionImportContext.hxx +++ b/xmloff/source/text/XMLSectionImportContext.hxx @@ -45,7 +45,7 @@ class XMLTextImportHelper; */ class XMLSectionImportContext : public SvXMLImportContext { - /// start position; ranges aquired via getStart(),getEnd() don't move + /// start position; ranges acquired via getStart(),getEnd() don't move ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange> xStartRange; diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index 327342282e57..11f83480592d 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -542,7 +542,7 @@ void XMLTextFrameContext_Impl::Create( sal_Bool /*bHRefOrBase64*/ ) } else { - // it should be an own OOo link that has no storage persistance + // it should be an own OOo link that has no storage persistence xPropSet = GetImport().GetTextImport() ->createAndInsertOOoLink( GetImport(), sURL, diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx index 9f59cd8a5e92..a9b7144097c3 100644 --- a/xmloff/source/text/txtexppr.cxx +++ b/xmloff/source/text/txtexppr.cxx @@ -19,13 +19,10 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" #include "txtexppr.hxx" - #include <com/sun/star/table/BorderLine.hpp> #include <com/sun/star/text/SizeType.hpp> #include <com/sun/star/text/WrapTextMode.hpp> @@ -34,13 +31,14 @@ #include <com/sun/star/awt/FontPitch.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 ::rtl::OUString; using ::rtl::OUStringBuffer; @@ -464,7 +462,9 @@ void XMLTextExportPropertySetMapper::ContextFilter( XMLPropertyState* pClip11State = NULL; XMLPropertyState* pClipState = NULL; + // filter fo:margin XMLPropertyState* pAllParaMargin = NULL; + XMLPropertyState* pAllParaMarginRel = NULL; XMLPropertyState* pAllMargin = NULL; //UUUU @@ -588,23 +588,24 @@ void XMLTextExportPropertySetMapper::ContextFilter( case CTF_TEXT_CLIP11: pClip11State = propertie; break; case CTF_TEXT_CLIP: pClipState = propertie; break; case CTF_PARAMARGINALL: pAllParaMargin = propertie; break; + case CTF_PARAMARGINALL_REL: pAllParaMarginRel = propertie; break; 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() ) @@ -677,6 +678,11 @@ void XMLTextExportPropertySetMapper::ContextFilter( pAllParaMargin->mnIndex = -1; // just export individual attributes... pAllParaMargin->maValue.clear(); } + if (pAllParaMarginRel) + { + pAllParaMarginRel->mnIndex = -1; // just export individual attributes... + pAllParaMarginRel->maValue.clear(); + } if (pAllMargin) { pAllMargin->mnIndex = -1; // just export individual attributes... diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 26aaf1e0205c..2cc05815454e 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -752,7 +752,7 @@ sal_Bool XMLTextFieldExport::IsStringField( case FIELD_ID_DRAW_FOOTER: case FIELD_ID_DRAW_DATE_TIME: default: - DBG_ERROR("unkown field type/field has no content"); + DBG_ERROR("unknown field type/field has no content"); return sal_True; // invalid info; string in case of doubt } } @@ -971,7 +971,7 @@ void XMLTextFieldExport::ExportFieldAutoStyle( case FIELD_ID_UNKNOWN: default: - DBG_ERROR("unkown field type!"); + DBG_ERROR("unknown field type!"); // ignore -> no format for unkowns break; } @@ -1869,7 +1869,7 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_UNKNOWN: default: - DBG_ERROR("unkown field type encountered!"); + DBG_ERROR("unknown field type encountered!"); // always export content GetExport().Characters(sPresentation); } @@ -2973,8 +2973,8 @@ enum XMLTokenEnum XMLTextFieldExport::MapPlaceholderType(sal_uInt16 nType) break; default: - // unkown placeholder: XML_TEXT - DBG_ERROR("unkown placeholder type"); + // unknown placeholder: XML_TEXT + DBG_ERROR("unknown placeholder type"); } return eType; @@ -3115,7 +3115,7 @@ enum XMLTokenEnum XMLTextFieldExport::MapChapterDisplayFormat(sal_Int16 nFormat) eName = XML_PLAIN_NUMBER; break; default: - DBG_ERROR("unkown chapter display format"); + DBG_ERROR("unknown chapter display format"); eName = XML_TOKEN_INVALID; break; } @@ -3225,7 +3225,7 @@ enum XMLTokenEnum XMLTextFieldExport::MapReferenceSource(sal_Int16 nType) eElement = XML_NOTE_REF; break; default: - DBG_ERROR("unkown reference source"); + DBG_ERROR("unknown reference source"); break; } diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index 21d1370c5911..aff9cbd2e141 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -711,7 +711,7 @@ void XMLSenderFieldImportContext::ProcessAttribute( sal_Bool bRet = GetImport().GetMM100UnitConverter(). convertBool(bVal, sAttrValue); - // set bFixed if successfull + // set bFixed if successful if (bRet) { bFixed = bVal; } @@ -1372,7 +1372,7 @@ SvXMLImportContext* XMLDatabaseFieldImportContext::CreateChildContext( } } - // we call ProcessAttribute in order to set bValid appropriatly + // we call ProcessAttribute in order to set bValid appropriately ProcessAttribute( XML_TOKEN_INVALID, OUString() ); } @@ -2272,7 +2272,7 @@ void XMLFileNameImportContext::ProcessAttribute( break; } default: - ; // unkown attribute: ignore + ; // unknown attribute: ignore break; } } @@ -3075,7 +3075,7 @@ void XMLDdeFieldDeclImportContext::StartElement( UNO_QUERY); if( xFactory.is() ) { - /* #i6432# There might be multiple occurances of one DDE + /* #i6432# There might be multiple occurrences of one DDE declaration if it is used in more than one of header/footer/body. createInstance will throw an exception if we try to create the second, third, etc. instance of such a @@ -3690,13 +3690,17 @@ void XMLAnnotationImportContext::EndElement() uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); while (xFields->hasMoreElements()) { - uno::Reference<beans::XPropertySet> xCurrField(xFields->nextElement(), uno::UNO_QUERY); - OUString aFieldName; - xCurrField->getPropertyValue(sPropertyName) >>= aFieldName; - if ( aFieldName == aName ) + uno::Reference< beans::XPropertySet > xCurrField(xFields->nextElement(), uno::UNO_QUERY); + uno::Reference< beans::XPropertySetInfo > xCurrFieldPropInfo = xCurrField->getPropertySetInfo(); + if ( xCurrFieldPropInfo->hasPropertyByName( sPropertyName ) ) { - xPrevField.set( xCurrField, uno::UNO_QUERY ); - break; + OUString aFieldName; + xCurrField->getPropertyValue( sPropertyName ) >>= aFieldName; + if ( aFieldName == aName ) + { + xPrevField.set( xCurrField, uno::UNO_QUERY ); + break; + } } } } diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 9137d5f9d13d..ae9c547c2ca7 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -2094,7 +2094,7 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels ) const sal_Int32 nCount = m_pImpl->m_xChapterNumbering->getCount(); // --> OD 2009-11-13 #i106218# - // First collect all paragraph styles choosen for assignment to each + // First collect all paragraph styles chosen for assignment to each // list level of the outline style, then perform the intrinsic assignment. // Reason: The assignment of a certain paragraph style to a list level // of the outline style causes side effects on the children diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx index a748923e3091..b76f6e126cf4 100644 --- a/xmloff/source/text/txtimppr.cxx +++ b/xmloff/source/text/txtimppr.cxx @@ -312,9 +312,11 @@ void XMLTextImportPropertyMapper::finished( XMLPropertyState* pVertOrientRelAsChar = 0; XMLPropertyState* pBackTransparency = NULL; // transparency in % XMLPropertyState* pBackTransparent = NULL; // transparency as boolean + XMLPropertyState* pAllParaMargin = 0; XMLPropertyState* pParaMargins[4] = { 0, 0, 0, 0 }; ::std::auto_ptr<XMLPropertyState> pNewParaMargins[4]; + XMLPropertyState* pAllMargin = 0; XMLPropertyState* pMargins[4] = { 0, 0, 0, 0 }; ::std::auto_ptr<XMLPropertyState> pNewMargins[4]; @@ -385,21 +387,42 @@ void XMLTextImportPropertyMapper::finished( bHasAnyWidth = sal_True; break; case CTF_BACKGROUND_TRANSPARENCY: pBackTransparency = property; break; case CTF_BACKGROUND_TRANSPARENT: pBackTransparent = property; break; + case CTF_PARAMARGINALL: + pAllParaMargin = property; + break; case CTF_PARAMARGINALL_REL: - pAllParaMargin = property; break; + { + sal_uInt32 nValue; + property->maValue >>= nValue; + // treat fo:margin="100%" as it is not exisiting as the + // corresponding core attribute classes - <SvxULSpaceItem> and + // <SvxLRSpaceItem> - are not able to treat such a value correctly. + // The result will be the same as the values will be inherited + // from parent, when the no margin attribute is given. + if ( nValue != 100 ) + { + pAllParaMargin = property; + } + } + break; + case CTF_PARALEFTMARGIN: case CTF_PARALEFTMARGIN_REL: pParaMargins[XML_LINE_LEFT] = property; break; + case CTF_PARARIGHTMARGIN: case CTF_PARARIGHTMARGIN_REL: pParaMargins[XML_LINE_RIGHT] = property; break; + case CTF_PARATOPMARGIN: case CTF_PARATOPMARGIN_REL: pParaMargins[XML_LINE_TOP] = property; break; + case CTF_PARABOTTOMMARGIN: case CTF_PARABOTTOMMARGIN_REL: pParaMargins[XML_LINE_BOTTOM] = property; break; + case CTF_MARGINALL: pAllMargin = property; break; case CTF_MARGINLEFT: @@ -428,7 +451,8 @@ void XMLTextImportPropertyMapper::finished( for (sal_uInt16 i = 0; i < 4; i++) { - if (pAllParaMargin && !pParaMargins[i]) + if ( pAllParaMargin != NULL + && pParaMargins[i] == NULL ) { #ifdef DBG_UTIL sal_Int16 nTmp = getPropertySetMapper()->GetEntryContextId( @@ -437,9 +461,12 @@ void XMLTextImportPropertyMapper::finished( nTmp <= CTF_PARABOTTOMMARGIN_REL, "wrong property context id" ); #endif - pNewParaMargins[i].reset(new XMLPropertyState( - pAllParaMargin->mnIndex + (2*i) + 2, pAllParaMargin->maValue)); + // IMPORTANT NOTE: the index calculation depends on the right order in the property map + pNewParaMargins[i].reset( + new XMLPropertyState( pAllParaMargin->mnIndex + (2*i) + 2, + pAllParaMargin->maValue ) ); } + if (pAllMargin && !pMargins[i]) { #ifdef DBG_UTIL @@ -448,8 +475,10 @@ void XMLTextImportPropertyMapper::finished( OSL_ENSURE( nTmp >= CTF_MARGINLEFT && nTmp <= CTF_MARGINBOTTOM, "wrong property context id" ); #endif - pNewMargins[i].reset(new XMLPropertyState( - pAllMargin->mnIndex + i + 1, pAllMargin->maValue)); + // IMPORTANT NOTE: the index calculation depends on the right order in the property map + pNewMargins[i].reset( + new XMLPropertyState( pAllMargin->mnIndex + i + 1, + pAllMargin->maValue ) ); } if( pAllBorderDistance && !pBorderDistances[i] ) { diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index c57a6a4bbf88..2b07952c2fef 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -2169,7 +2169,7 @@ void XMLTextParagraphExport::exportParagraph( { // For the auto styles, the multi property set helper is only used // if hard attributes are existing. Therfor, it seems to be a better - // strategy to have the TextSection property seperate, because otherwise + // strategy to have the TextSection property separate, because otherwise // we always retrieve the style names even if they are not required. if( bAutoStyles ) { @@ -3381,7 +3381,7 @@ void XMLTextParagraphExport::exportText( const OUString& rText, } // If there are spaces left that have not been exported and the - // current chracter is not a space , the pending spaces have to be + // current character is not a space , the pending spaces have to be // exported now. if( nSpaceChars > 0 && !bCurrCharIsSpace ) { diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index ee90c6c03062..e970fdff492f 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -1034,9 +1034,9 @@ protected: Reference<beans::XPropertySet>& rPropSet); /** - * All marks can be created immediatly. Since we don't care about + * All marks can be created immediately. Since we don't care about * the element content, ProcessAttribute should set the properties - * immediatly. + * immediately. * * This method tolerates an empty PropertySet; subclasses however * are not expected to. @@ -2029,7 +2029,7 @@ XMLParaContext::~XMLParaContext() xTxtImport->FindOutlineStyleName( sStyleName, nOutlineLevel ); // set style and hard attributes at the previous paragraph - // --> OD 2007-07-25 #i73509# - add paramter <mbOutlineLevelAttrFound> + // --> OD 2007-07-25 #i73509# - add parameter <mbOutlineLevelAttrFound> sStyleName = xTxtImport->SetStyleAndAttrs( GetImport(), xAttrCursor, sStyleName, sal_True, diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index c5fb255679b5..378794319391 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -19,10 +19,9 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include <tools/debug.hxx> #include <rtl/ustrbuf.hxx> #include <tools/fontenum.hxx> @@ -44,30 +43,35 @@ #include "XMLAnchorTypePropHdl.hxx" #include <xmloff/XMLConstantsPropertyHandler.hxx> #include "XMLClipPropertyHandler.hxx" -#ifndef _XMLOFF_XMLTEXTCOLUMNSPPROPERTYHANDLER_HXX #include "XMLTextColumnsPropertyHandler.hxx" -#endif #include <xmloff/NamedBoolPropertyHdl.hxx> -#ifndef _XMLOFF_TXTPRHDL_HXX #include "txtprhdl.hxx" -#endif -// OD 2004-05-05 #i28701# #include <com/sun/star/text/WrapInfluenceOnPosition.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 ::rtl::OUString; using ::rtl::OUStringBuffer; -//using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::style; -//using namespace ::com::sun::star::container; -//using namespace ::com::sun::star::beans; 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[]; #define CONSTASCII_USTRINGPARAM_CMP(s) s, sizeof(s)-1 @@ -1271,18 +1275,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 { @@ -1456,27 +1448,33 @@ const XMLPropertyHandler *XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler pHdl = new XMLNumber8OneBasedHdl(); 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 + 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; + } } return pHdl; diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index 45b76975f6d3..3604f8980e2d 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -19,19 +19,18 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" #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; @@ -88,6 +87,31 @@ XMLPropertyMapEntry aXMLParaPropMap[] = { // RES_UNKNOWNATR_CONTAINER MP_E( "ParaUserDefinedAttributes", TEXT, XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ), + + //UUUU fill attributes for paragraph backgrounds + // #125045# moved to the front to be able to exclude these in lcl_txtprmap_getMap + // for TEXT_PROP_MAP_SHAPE_PARA to not have these double for Shapes (which already have these) + 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_LR_SPACE // !!! DO NOT REORDER THE MARGINS !!! MP_E( "ParaLeftMargin", FO, MARGIN, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARAMARGINALL ), @@ -257,7 +281,7 @@ XMLPropertyMapEntry aXMLParaPropMap[] = // RES_PARATR_WIDOWS MP_E( "ParaWidows", FO, WIDOWS, XML_TYPE_NUMBER8, 0 ), // RES_PARATR_TABSTOP - MP_ED( "ParaTabStops", STYLE, TAB_STOPS, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_TABSTOP, CTF_TABSTOP ), // this is not realy a string! + MP_ED( "ParaTabStops", STYLE, TAB_STOPS, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_TABSTOP, CTF_TABSTOP ), // this is not really a string! // RES_PARATR_HYPHENZONE MT_E( "ParaIsHyphenation", FO, HYPHENATE, XML_TYPE_BOOL, 0 ), MT_E( "ParaHyphenationMaxLeadingChars", FO, HYPHENATION_REMAIN_CHAR_COUNT, XML_TYPE_NUMBER16, 0 ), @@ -316,6 +340,7 @@ 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 ), + // 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 ), @@ -637,13 +662,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 ), @@ -652,8 +677,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 ), @@ -875,7 +900,11 @@ XMLPropertyMapEntry *lcl_txtprmap_getMap( sal_uInt16 nType ) pMap = aXMLTextPropMap; break; case TEXT_PROP_MAP_SHAPE_PARA: - pMap = &(aXMLParaPropMap[1]); + // #125045# use [21] instead of [1] for text props for Shapes, idices + // [1..20] contain the DrawingLayer FillStyle attributes corresponding to + // [XATTR_FILL_FIRST .. XATTR_FILL_LAST] and would be double since Shapes + // already contain these (usually in aXMLSDProperties) + pMap = &(aXMLParaPropMap[21]); OSL_ENSURE( pMap->meXMLName == XML_MARGIN, "shape para map changed" ); break; case TEXT_PROP_MAP_PARA: diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index 1d5e1233f2d9..89887932ec10 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -19,8 +19,6 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" @@ -35,7 +33,6 @@ #include "xmloff/xmltkmap.hxx" #include "xmloff/xmltoken.hxx" #include "xmloff/xmluconv.hxx" - #include <com/sun/star/beans/XMultiPropertySet.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/document/XEventsSupplier.hpp> @@ -43,7 +40,6 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/style/ParagraphStyleCategory.hpp> #include <com/sun/star/style/XStyle.hpp> - #include <tools/debug.hxx> #include <tools/diagnose_ex.h> @@ -53,6 +49,10 @@ #include <utility> #include <vector> +//UUUU +#include <xmlsdtypes.hxx> +#include <xmloff/xmlerror.hxx> + using ::rtl::OUString; using ::rtl::OUStringBuffer; @@ -422,22 +422,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 }, @@ -447,28 +444,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().getLength() ) { OUString sAutoProp = ( GetFamily() == XML_STYLE_FAMILY_TEXT_TEXT ) ? OUString( RTL_CONSTASCII_USTRINGPARAM("CharAutoStyleName") ): OUString( RTL_CONSTASCII_USTRINGPARAM("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& ) @@ -478,13 +503,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; @@ -497,77 +528,146 @@ 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 = - OUString( RTL_CONSTASCII_USTRINGPARAM( "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 = OUString( RTL_CONSTASCII_USTRINGPARAM( "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(IsDefaultStyle() && XML_STYLE_FAMILY_TABLE_TABLE == GetFamily()) { - OUString sCollapsingBorders( - OUString( RTL_CONSTASCII_USTRINGPARAM( "CollapsingBorders" ) ) ); - DBG_ASSERT( rPropSet->getPropertySetInfo()->hasPropertyByName( sCollapsingBorders ), - "property missing?" ); - rPropSet->setPropertyValue( sCollapsingBorders, + OUString sCollapsingBorders(OUString( RTL_CONSTASCII_USTRINGPARAM( "CollapsingBorders" ) ) ); + 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.getLength() > 0 ) + + switch(aContextIDs[i].nContextID) { - OUString sStarBats( RTL_CONSTASCII_USTRINGPARAM("StarBats" ) ); - OUString sStarMath( RTL_CONSTASCII_USTRINGPARAM("StarMath" ) ); - if ( sFontName.equalsIgnoreAsciiCase( sStarBats ) || - sFontName.equalsIgnoreAsciiCase( sStarMath ) ) + case CTF_FILLGRADIENTNAME: + case CTF_FILLTRANSNAME: + case CTF_FILLHATCHNAME: + case CTF_FILLBITMAPNAME: + { + // DrawingLayer FillStyle nameneeds 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: { - // construct new value - sFontName = OUString( - RTL_CONSTASCII_USTRINGPARAM("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 ) ) + // 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.getLength() > 0) { - rPropSet->setPropertyValue( rPropertyName, aAny ); + OUString sStarBats(RTL_CONSTASCII_USTRINGPARAM("StarBats")); + OUString sStarMath(RTL_CONSTASCII_USTRINGPARAM("StarMath")); + if(sFontName.equalsIgnoreAsciiCase(sStarBats) || + sFontName.equalsIgnoreAsciiCase(sStarMath)) + { + // construct new value + sFontName = OUString( + RTL_CONSTASCII_USTRINGPARAM("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 } } } } + +//eof diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx index 7a2e5c32b896..007a3c539966 100644 --- a/xmloff/source/text/txtvfldi.cxx +++ b/xmloff/source/text/txtvfldi.cxx @@ -917,7 +917,7 @@ XMLVariableDeclImportContext::XMLVariableDeclImportContext( break; } default: - DBG_ERROR("unkown varfield type"); + DBG_ERROR("unknown varfield type"); } // switch } // else: no field master found/constructed } // else: no sequence-decl @@ -977,7 +977,7 @@ sal_Bool XMLVariableDeclImportContext::FindFieldMaster( { OUString sNew; - // FIXME! cant find if name is taken already!!!! + // FIXME! can't find if name is taken already!!!! nCollisionCount++; OUStringBuffer aBuf; @@ -1002,7 +1002,7 @@ sal_Bool XMLVariableDeclImportContext::FindFieldMaster( // find new name that is not taken OUString sNew; - // FIXME! cant find if name is taken already!!!! + // FIXME! can't find if name is taken already!!!! nCollisionCount++; OUStringBuffer aBuf; diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx index 6a9bf7eaa60e..52cf26b8da85 100644 --- a/xmloff/source/transform/OOo2Oasis.cxx +++ b/xmloff/source/transform/OOo2Oasis.cxx @@ -719,7 +719,7 @@ static XMLTransformerActionInit aStyleRefActionTable[] = // OOO_SHAPE_ACTIONS // !!ATTENTION!! If you change something here, please also change -// aConnectorActionTable if apropriate +// aConnectorActionTable if appropriate static XMLTransformerActionInit aShapeActionTable[] = { ENTRY0( SVG, X, XML_ATACTION_INCH2IN ), diff --git a/xmloff/source/transform/Oasis2OOo.cxx b/xmloff/source/transform/Oasis2OOo.cxx index fefcd1127aa1..715ce5163983 100644 --- a/xmloff/source/transform/Oasis2OOo.cxx +++ b/xmloff/source/transform/Oasis2OOo.cxx @@ -729,7 +729,7 @@ static XMLTransformerActionInit aParaActionTable[] = }; // !!ATTENTION!! If you change something here, please also change -// aConnectorActionTable if apropriate +// aConnectorActionTable if appropriate static XMLTransformerActionInit aShapeActionTable[] = { ENTRY1( DRAW, STYLE_NAME, XML_ATACTION_DECODE_STYLE_NAME_REF, diff --git a/xmloff/source/transform/TransformerBase.cxx b/xmloff/source/transform/TransformerBase.cxx index 264671c54b32..90f2a9c351a8 100644 --- a/xmloff/source/transform/TransformerBase.cxx +++ b/xmloff/source/transform/TransformerBase.cxx @@ -321,7 +321,7 @@ void SAL_CALL XMLTransformerBase::startElement( const OUString& rName, if( !xContext.is() ) xContext = new XMLTransformerContext( *this, rName ); - // Remeber old namespace map. + // Remember old namespace map. if( pRewindMap ) xContext->SetRewindMap( pRewindMap ); diff --git a/xmloff/source/transform/TransformerBase.hxx b/xmloff/source/transform/TransformerBase.hxx index 5ceebe431c56..28e63883ae98 100644 --- a/xmloff/source/transform/TransformerBase.hxx +++ b/xmloff/source/transform/TransformerBase.hxx @@ -85,7 +85,7 @@ protected: // this method may return an empty reference when the transformer service // was created outside the xmloff environment. - // It is strictly forbiden to use this as a write access to the model! + // It is strictly forbidden to use this as a write access to the model! const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& getModel() const { return mxModel; } public: |