1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 29*cdf0e10cSrcweir #include "precompiled_xmloff.hxx" 30*cdf0e10cSrcweir #include <tools/debug.hxx> 31*cdf0e10cSrcweir #include <rtl/ustrbuf.hxx> 32*cdf0e10cSrcweir #include <tools/fontenum.hxx> 33*cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx> 34*cdf0e10cSrcweir #include <com/sun/star/style/DropCapFormat.hpp> 35*cdf0e10cSrcweir #include <com/sun/star/text/FontRelief.hpp> 36*cdf0e10cSrcweir #include <com/sun/star/text/WrapTextMode.hpp> 37*cdf0e10cSrcweir #include <com/sun/star/text/XTextColumns.hpp> 38*cdf0e10cSrcweir #include <com/sun/star/text/TextColumn.hpp> 39*cdf0e10cSrcweir #include <com/sun/star/text/RelOrientation.hpp> 40*cdf0e10cSrcweir #include <com/sun/star/text/HoriOrientation.hpp> 41*cdf0e10cSrcweir #include <com/sun/star/text/VertOrientation.hpp> 42*cdf0e10cSrcweir #include <com/sun/star/text/RubyAdjust.hpp> 43*cdf0e10cSrcweir #include <com/sun/star/text/FontEmphasis.hpp> 44*cdf0e10cSrcweir #include <com/sun/star/text/ParagraphVertAlign.hpp> 45*cdf0e10cSrcweir #include <xmloff/xmltypes.hxx> 46*cdf0e10cSrcweir #include <xmloff/xmluconv.hxx> 47*cdf0e10cSrcweir #include <xmloff/xmltoken.hxx> 48*cdf0e10cSrcweir #include "XMLAnchorTypePropHdl.hxx" 49*cdf0e10cSrcweir #include <xmloff/XMLConstantsPropertyHandler.hxx> 50*cdf0e10cSrcweir #include "XMLClipPropertyHandler.hxx" 51*cdf0e10cSrcweir #ifndef _XMLOFF_XMLTEXTCOLUMNSPPROPERTYHANDLER_HXX 52*cdf0e10cSrcweir #include "XMLTextColumnsPropertyHandler.hxx" 53*cdf0e10cSrcweir #endif 54*cdf0e10cSrcweir #include <xmloff/NamedBoolPropertyHdl.hxx> 55*cdf0e10cSrcweir #ifndef _XMLOFF_TXTPRHDL_HXX 56*cdf0e10cSrcweir #include "txtprhdl.hxx" 57*cdf0e10cSrcweir #endif 58*cdf0e10cSrcweir // OD 2004-05-05 #i28701# 59*cdf0e10cSrcweir #include <com/sun/star/text/WrapInfluenceOnPosition.hpp> 60*cdf0e10cSrcweir 61*cdf0e10cSrcweir 62*cdf0e10cSrcweir using ::rtl::OUString; 63*cdf0e10cSrcweir using ::rtl::OUStringBuffer; 64*cdf0e10cSrcweir 65*cdf0e10cSrcweir //using namespace ::com::sun::star; 66*cdf0e10cSrcweir using namespace ::com::sun::star::uno; 67*cdf0e10cSrcweir using namespace ::com::sun::star::style; 68*cdf0e10cSrcweir //using namespace ::com::sun::star::container; 69*cdf0e10cSrcweir //using namespace ::com::sun::star::beans; 70*cdf0e10cSrcweir using namespace ::com::sun::star::text; 71*cdf0e10cSrcweir using namespace ::xmloff::token; 72*cdf0e10cSrcweir 73*cdf0e10cSrcweir 74*cdf0e10cSrcweir #define CONSTASCII_USTRINGPARAM_CMP(s) s, sizeof(s)-1 75*cdf0e10cSrcweir 76*cdf0e10cSrcweir // --------------------------------------------------------------------------- 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_HoriPos_Enum[] = 79*cdf0e10cSrcweir { 80*cdf0e10cSrcweir { XML_FROM_LEFT, HoriOrientation::NONE }, 81*cdf0e10cSrcweir { XML_FROM_INSIDE, HoriOrientation::NONE }, // import only 82*cdf0e10cSrcweir { XML_LEFT, HoriOrientation::LEFT }, 83*cdf0e10cSrcweir { XML_INSIDE, HoriOrientation::LEFT }, // import only 84*cdf0e10cSrcweir { XML_CENTER, HoriOrientation::CENTER }, 85*cdf0e10cSrcweir { XML_RIGHT, HoriOrientation::RIGHT }, 86*cdf0e10cSrcweir { XML_OUTSIDE, HoriOrientation::RIGHT }, // import only 87*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 88*cdf0e10cSrcweir }; 89*cdf0e10cSrcweir 90*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_HoriPosMirrored_Enum[] = 91*cdf0e10cSrcweir { 92*cdf0e10cSrcweir { XML_FROM_INSIDE, HoriOrientation::NONE }, 93*cdf0e10cSrcweir { XML_INSIDE, HoriOrientation::LEFT }, 94*cdf0e10cSrcweir { XML_CENTER, HoriOrientation::CENTER }, 95*cdf0e10cSrcweir { XML_OUTSIDE, HoriOrientation::RIGHT }, 96*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 97*cdf0e10cSrcweir }; 98*cdf0e10cSrcweir 99*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_HoriRel_Enum[] = 100*cdf0e10cSrcweir { 101*cdf0e10cSrcweir { XML_PARAGRAPH, RelOrientation::FRAME }, 102*cdf0e10cSrcweir { XML_PARAGRAPH_CONTENT, RelOrientation::PRINT_AREA }, 103*cdf0e10cSrcweir { XML_PAGE, RelOrientation::PAGE_FRAME }, 104*cdf0e10cSrcweir { XML_PAGE_CONTENT, RelOrientation::PAGE_PRINT_AREA }, 105*cdf0e10cSrcweir { XML_PARAGRAPH_START_MARGIN, RelOrientation::FRAME_LEFT }, 106*cdf0e10cSrcweir { XML_PARAGRAPH_END_MARGIN, RelOrientation::FRAME_RIGHT }, 107*cdf0e10cSrcweir { XML_PAGE_START_MARGIN, RelOrientation::PAGE_LEFT }, 108*cdf0e10cSrcweir { XML_PAGE_END_MARGIN, RelOrientation::PAGE_RIGHT }, 109*cdf0e10cSrcweir { XML_CHAR, RelOrientation::CHAR }, 110*cdf0e10cSrcweir { XML_FRAME, RelOrientation::FRAME }, // import only 111*cdf0e10cSrcweir { XML_FRAME_CONTENT, RelOrientation::PRINT_AREA }, // import only 112*cdf0e10cSrcweir { XML_FRAME_START_MARGIN, RelOrientation::FRAME_LEFT }, // import only 113*cdf0e10cSrcweir { XML_FRAME_END_MARGIN, RelOrientation::FRAME_RIGHT }, // import only 114*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 115*cdf0e10cSrcweir }; 116*cdf0e10cSrcweir 117*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_HoriRelFrame_Enum[] = 118*cdf0e10cSrcweir { 119*cdf0e10cSrcweir { XML_FRAME, RelOrientation::FRAME }, 120*cdf0e10cSrcweir { XML_FRAME_CONTENT, RelOrientation::PRINT_AREA }, 121*cdf0e10cSrcweir { XML_PAGE, RelOrientation::PAGE_FRAME }, 122*cdf0e10cSrcweir { XML_PAGE_CONTENT, RelOrientation::PAGE_PRINT_AREA }, 123*cdf0e10cSrcweir { XML_FRAME_START_MARGIN, RelOrientation::FRAME_LEFT }, 124*cdf0e10cSrcweir { XML_FRAME_END_MARGIN, RelOrientation::FRAME_RIGHT }, 125*cdf0e10cSrcweir { XML_PAGE_START_MARGIN, RelOrientation::PAGE_LEFT }, 126*cdf0e10cSrcweir { XML_PAGE_END_MARGIN, RelOrientation::PAGE_RIGHT }, 127*cdf0e10cSrcweir { XML_CHAR, RelOrientation::CHAR }, 128*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 129*cdf0e10cSrcweir }; 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_HoriMirror_Enum[] = 132*cdf0e10cSrcweir { 133*cdf0e10cSrcweir { XML_FROM_LEFT, sal_False }, 134*cdf0e10cSrcweir { XML_FROM_INSIDE, sal_True }, 135*cdf0e10cSrcweir { XML_LEFT, sal_False }, 136*cdf0e10cSrcweir { XML_INSIDE, sal_True }, 137*cdf0e10cSrcweir { XML_CENTER, sal_False }, 138*cdf0e10cSrcweir { XML_RIGHT, sal_False }, 139*cdf0e10cSrcweir { XML_OUTSIDE, sal_True }, 140*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 141*cdf0e10cSrcweir }; 142*cdf0e10cSrcweir 143*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_VertPos_Enum[] = 144*cdf0e10cSrcweir { 145*cdf0e10cSrcweir { XML_FROM_TOP, VertOrientation::NONE }, 146*cdf0e10cSrcweir { XML_TOP, VertOrientation::TOP }, 147*cdf0e10cSrcweir { XML_TOP, VertOrientation::CHAR_TOP }, // export only 148*cdf0e10cSrcweir { XML_TOP, VertOrientation::LINE_TOP }, // export only 149*cdf0e10cSrcweir { XML_MIDDLE, VertOrientation::CENTER }, 150*cdf0e10cSrcweir { XML_MIDDLE, VertOrientation::CHAR_CENTER }, // export only 151*cdf0e10cSrcweir { XML_MIDDLE, VertOrientation::LINE_CENTER }, // export only 152*cdf0e10cSrcweir { XML_BOTTOM, VertOrientation::BOTTOM }, 153*cdf0e10cSrcweir { XML_BOTTOM, VertOrientation::CHAR_BOTTOM }, // export only 154*cdf0e10cSrcweir { XML_BOTTOM, VertOrientation::LINE_BOTTOM }, // export only 155*cdf0e10cSrcweir { XML_BELOW, VertOrientation::CHAR_BOTTOM }, // import only 156*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 157*cdf0e10cSrcweir }; 158*cdf0e10cSrcweir 159*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_VertPosAtChar_Enum[] = 160*cdf0e10cSrcweir { 161*cdf0e10cSrcweir { XML_FROM_TOP, VertOrientation::NONE }, 162*cdf0e10cSrcweir { XML_TOP, VertOrientation::TOP }, 163*cdf0e10cSrcweir { XML_TOP, VertOrientation::CHAR_TOP }, // export only 164*cdf0e10cSrcweir { XML_TOP, VertOrientation::LINE_TOP }, // export only 165*cdf0e10cSrcweir { XML_MIDDLE, VertOrientation::CENTER }, 166*cdf0e10cSrcweir { XML_MIDDLE, VertOrientation::CHAR_CENTER }, // export only 167*cdf0e10cSrcweir { XML_MIDDLE, VertOrientation::LINE_CENTER }, // export only 168*cdf0e10cSrcweir { XML_BOTTOM, VertOrientation::BOTTOM }, 169*cdf0e10cSrcweir { XML_BELOW, VertOrientation::CHAR_BOTTOM }, // export only 170*cdf0e10cSrcweir { XML_BOTTOM, VertOrientation::LINE_BOTTOM }, // export only 171*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 172*cdf0e10cSrcweir }; 173*cdf0e10cSrcweir 174*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_VertRel_Enum[] = 175*cdf0e10cSrcweir { 176*cdf0e10cSrcweir { XML_PARAGRAPH, RelOrientation::FRAME }, 177*cdf0e10cSrcweir { XML_PARAGRAPH_CONTENT, RelOrientation::PRINT_AREA }, 178*cdf0e10cSrcweir { XML_CHAR, RelOrientation::CHAR }, 179*cdf0e10cSrcweir // DVO, OD 17.09.2003 #i18732# - allow vertical alignment at page 180*cdf0e10cSrcweir { XML_PAGE, RelOrientation::PAGE_FRAME }, 181*cdf0e10cSrcweir { XML_PAGE_CONTENT, RelOrientation::PAGE_PRINT_AREA }, 182*cdf0e10cSrcweir { XML_FRAME, RelOrientation::FRAME }, // import only 183*cdf0e10cSrcweir { XML_FRAME_CONTENT, RelOrientation::PRINT_AREA }, // import only 184*cdf0e10cSrcweir // OD 13.11.2003 #i22341# - new vertical alignment at top of line 185*cdf0e10cSrcweir { XML_LINE, RelOrientation::TEXT_LINE }, 186*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 187*cdf0e10cSrcweir }; 188*cdf0e10cSrcweir 189*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_VertRelPage_Enum[] = 190*cdf0e10cSrcweir { 191*cdf0e10cSrcweir { XML_PAGE, RelOrientation::FRAME }, 192*cdf0e10cSrcweir { XML_PAGE_CONTENT, RelOrientation::PRINT_AREA }, 193*cdf0e10cSrcweir { XML_PAGE, RelOrientation::PAGE_FRAME }, 194*cdf0e10cSrcweir { XML_PAGE_CONTENT, RelOrientation::PAGE_PRINT_AREA }, 195*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 196*cdf0e10cSrcweir }; 197*cdf0e10cSrcweir 198*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_VertRelFrame_Enum[] = 199*cdf0e10cSrcweir { 200*cdf0e10cSrcweir { XML_FRAME, RelOrientation::FRAME }, 201*cdf0e10cSrcweir { XML_FRAME_CONTENT, RelOrientation::PRINT_AREA }, 202*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 203*cdf0e10cSrcweir }; 204*cdf0e10cSrcweir 205*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_VertRelAsChar_Enum[] = 206*cdf0e10cSrcweir { 207*cdf0e10cSrcweir { XML_BASELINE, VertOrientation::TOP }, 208*cdf0e10cSrcweir { XML_BASELINE, VertOrientation::CENTER }, // export only 209*cdf0e10cSrcweir { XML_BASELINE, VertOrientation::BOTTOM }, // export only 210*cdf0e10cSrcweir { XML_TEXT, VertOrientation::CHAR_TOP }, 211*cdf0e10cSrcweir { XML_TEXT, VertOrientation::CHAR_CENTER }, // export only 212*cdf0e10cSrcweir { XML_TEXT, VertOrientation::CHAR_BOTTOM }, // export only 213*cdf0e10cSrcweir { XML_LINE, VertOrientation::LINE_TOP }, 214*cdf0e10cSrcweir { XML_LINE, VertOrientation::LINE_CENTER }, // export only 215*cdf0e10cSrcweir { XML_LINE, VertOrientation::LINE_BOTTOM }, // export only 216*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 217*cdf0e10cSrcweir }; 218*cdf0e10cSrcweir 219*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_RubyAdjust_Enum[] = 220*cdf0e10cSrcweir { 221*cdf0e10cSrcweir { XML_LEFT, RubyAdjust_LEFT }, 222*cdf0e10cSrcweir { XML_CENTER, RubyAdjust_CENTER }, 223*cdf0e10cSrcweir { XML_RIGHT, RubyAdjust_RIGHT }, 224*cdf0e10cSrcweir { XML_DISTRIBUTE_LETTER, RubyAdjust_BLOCK }, 225*cdf0e10cSrcweir { XML_DISTRIBUTE_SPACE, RubyAdjust_INDENT_BLOCK }, 226*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 227*cdf0e10cSrcweir }; 228*cdf0e10cSrcweir 229*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_FontRelief_Enum[] = 230*cdf0e10cSrcweir { 231*cdf0e10cSrcweir { XML_NONE, FontRelief::NONE }, 232*cdf0e10cSrcweir { XML_ENGRAVED, FontRelief::ENGRAVED }, 233*cdf0e10cSrcweir { XML_EMBOSSED, FontRelief::EMBOSSED }, 234*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 235*cdf0e10cSrcweir }; 236*cdf0e10cSrcweir 237*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_VerticalAlign_Enum[] = 238*cdf0e10cSrcweir { 239*cdf0e10cSrcweir { XML_TOP, ParagraphVertAlign::TOP }, 240*cdf0e10cSrcweir { XML_MIDDLE, ParagraphVertAlign::CENTER }, 241*cdf0e10cSrcweir { XML_BOTTOM, ParagraphVertAlign::BOTTOM }, 242*cdf0e10cSrcweir { XML_BASELINE, ParagraphVertAlign::BASELINE }, 243*cdf0e10cSrcweir { XML_AUTO, ParagraphVertAlign::AUTOMATIC }, 244*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 245*cdf0e10cSrcweir }; 246*cdf0e10cSrcweir 247*cdf0e10cSrcweir // OD 2004-05-05 #i28701# 248*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_WrapInfluenceOnPosition_Enum[] = 249*cdf0e10cSrcweir { 250*cdf0e10cSrcweir // --> OD 2004-10-18 #i35017# - tokens have been renamed and 251*cdf0e10cSrcweir // <XML_ITERATIVE> has been added 252*cdf0e10cSrcweir { XML_ONCE_SUCCESSIVE, WrapInfluenceOnPosition::ONCE_SUCCESSIVE }, 253*cdf0e10cSrcweir { XML_ONCE_CONCURRENT, WrapInfluenceOnPosition::ONCE_CONCURRENT }, 254*cdf0e10cSrcweir { XML_ITERATIVE, WrapInfluenceOnPosition::ITERATIVE }, 255*cdf0e10cSrcweir // <-- 256*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 257*cdf0e10cSrcweir }; 258*cdf0e10cSrcweir 259*cdf0e10cSrcweir // --------------------------------------------------------------------------- 260*cdf0e10cSrcweir 261*cdf0e10cSrcweir class XMLDropCapPropHdl_Impl : public XMLPropertyHandler 262*cdf0e10cSrcweir { 263*cdf0e10cSrcweir public: 264*cdf0e10cSrcweir virtual ~XMLDropCapPropHdl_Impl (); 265*cdf0e10cSrcweir 266*cdf0e10cSrcweir virtual bool equals( 267*cdf0e10cSrcweir const ::com::sun::star::uno::Any& r1, 268*cdf0e10cSrcweir const ::com::sun::star::uno::Any& r2 ) const; 269*cdf0e10cSrcweir 270*cdf0e10cSrcweir /// TabStops will be imported/exported as XML-Elements. So the Import/Export-work must be done at another place. 271*cdf0e10cSrcweir virtual sal_Bool importXML( 272*cdf0e10cSrcweir const ::rtl::OUString& rStrImpValue, 273*cdf0e10cSrcweir ::com::sun::star::uno::Any& rValue, 274*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 275*cdf0e10cSrcweir virtual sal_Bool exportXML( 276*cdf0e10cSrcweir ::rtl::OUString& rStrExpValue, 277*cdf0e10cSrcweir const ::com::sun::star::uno::Any& rValue, 278*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 279*cdf0e10cSrcweir }; 280*cdf0e10cSrcweir 281*cdf0e10cSrcweir XMLDropCapPropHdl_Impl::~XMLDropCapPropHdl_Impl () 282*cdf0e10cSrcweir { 283*cdf0e10cSrcweir } 284*cdf0e10cSrcweir 285*cdf0e10cSrcweir bool XMLDropCapPropHdl_Impl::equals( 286*cdf0e10cSrcweir const Any& r1, 287*cdf0e10cSrcweir const Any& r2 ) const 288*cdf0e10cSrcweir { 289*cdf0e10cSrcweir DropCapFormat aFormat1, aFormat2; 290*cdf0e10cSrcweir r1 >>= aFormat1; 291*cdf0e10cSrcweir r2 >>= aFormat2; 292*cdf0e10cSrcweir 293*cdf0e10cSrcweir return (aFormat1.Lines <=1 && aFormat2.Lines <=1) || 294*cdf0e10cSrcweir (aFormat1.Lines == aFormat2.Lines && 295*cdf0e10cSrcweir aFormat1.Count == aFormat2.Count && 296*cdf0e10cSrcweir aFormat1.Distance == aFormat2.Distance); 297*cdf0e10cSrcweir } 298*cdf0e10cSrcweir 299*cdf0e10cSrcweir sal_Bool XMLDropCapPropHdl_Impl::importXML( 300*cdf0e10cSrcweir const OUString&, 301*cdf0e10cSrcweir Any&, 302*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 303*cdf0e10cSrcweir { 304*cdf0e10cSrcweir DBG_ASSERT( !this, "drop caps are an element import property" ); 305*cdf0e10cSrcweir return sal_False; 306*cdf0e10cSrcweir } 307*cdf0e10cSrcweir 308*cdf0e10cSrcweir sal_Bool XMLDropCapPropHdl_Impl::exportXML( 309*cdf0e10cSrcweir OUString&, 310*cdf0e10cSrcweir const Any&, 311*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 312*cdf0e10cSrcweir { 313*cdf0e10cSrcweir DBG_ASSERT( !this, "drop caps are an element export property" ); 314*cdf0e10cSrcweir return sal_False; 315*cdf0e10cSrcweir } 316*cdf0e10cSrcweir 317*cdf0e10cSrcweir // --------------------------------------------------------------------------- 318*cdf0e10cSrcweir 319*cdf0e10cSrcweir class XMLOpaquePropHdl_Impl : public XMLPropertyHandler 320*cdf0e10cSrcweir { 321*cdf0e10cSrcweir public: 322*cdf0e10cSrcweir virtual ~XMLOpaquePropHdl_Impl (); 323*cdf0e10cSrcweir 324*cdf0e10cSrcweir virtual sal_Bool importXML( 325*cdf0e10cSrcweir const ::rtl::OUString& rStrImpValue, 326*cdf0e10cSrcweir ::com::sun::star::uno::Any& rValue, 327*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 328*cdf0e10cSrcweir virtual sal_Bool exportXML( 329*cdf0e10cSrcweir ::rtl::OUString& rStrExpValue, 330*cdf0e10cSrcweir const ::com::sun::star::uno::Any& rValue, 331*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 332*cdf0e10cSrcweir }; 333*cdf0e10cSrcweir 334*cdf0e10cSrcweir sal_Bool XMLOpaquePropHdl_Impl::importXML( 335*cdf0e10cSrcweir const OUString& rStrImpValue, 336*cdf0e10cSrcweir Any& rValue, 337*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 338*cdf0e10cSrcweir { 339*cdf0e10cSrcweir sal_Bool bRet = sal_True; 340*cdf0e10cSrcweir sal_Bool bVal = sal_False; 341*cdf0e10cSrcweir if( IsXMLToken( rStrImpValue, XML_FOREGROUND ) ) 342*cdf0e10cSrcweir bVal = sal_True; 343*cdf0e10cSrcweir else if( !IsXMLToken( rStrImpValue, XML_BACKGROUND ) ) 344*cdf0e10cSrcweir bRet = sal_False; 345*cdf0e10cSrcweir 346*cdf0e10cSrcweir if( bRet ) 347*cdf0e10cSrcweir rValue.setValue( &bVal, ::getBooleanCppuType() ); 348*cdf0e10cSrcweir 349*cdf0e10cSrcweir return bRet; 350*cdf0e10cSrcweir } 351*cdf0e10cSrcweir 352*cdf0e10cSrcweir sal_Bool XMLOpaquePropHdl_Impl::exportXML( 353*cdf0e10cSrcweir OUString& rStrExpValue, 354*cdf0e10cSrcweir const Any& rValue, 355*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 356*cdf0e10cSrcweir { 357*cdf0e10cSrcweir if( *(sal_Bool *)rValue.getValue() ) 358*cdf0e10cSrcweir rStrExpValue = GetXMLToken( XML_FOREGROUND ); 359*cdf0e10cSrcweir else 360*cdf0e10cSrcweir rStrExpValue = GetXMLToken( XML_BACKGROUND ); 361*cdf0e10cSrcweir 362*cdf0e10cSrcweir return sal_True; 363*cdf0e10cSrcweir } 364*cdf0e10cSrcweir 365*cdf0e10cSrcweir XMLOpaquePropHdl_Impl::~XMLOpaquePropHdl_Impl () 366*cdf0e10cSrcweir { 367*cdf0e10cSrcweir } 368*cdf0e10cSrcweir 369*cdf0e10cSrcweir // --------------------------------------------------------------------------- 370*cdf0e10cSrcweir 371*cdf0e10cSrcweir class XMLContourModePropHdl_Impl : public XMLPropertyHandler 372*cdf0e10cSrcweir { 373*cdf0e10cSrcweir public: 374*cdf0e10cSrcweir virtual ~XMLContourModePropHdl_Impl (); 375*cdf0e10cSrcweir 376*cdf0e10cSrcweir virtual sal_Bool importXML( 377*cdf0e10cSrcweir const ::rtl::OUString& rStrImpValue, 378*cdf0e10cSrcweir ::com::sun::star::uno::Any& rValue, 379*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 380*cdf0e10cSrcweir virtual sal_Bool exportXML( 381*cdf0e10cSrcweir ::rtl::OUString& rStrExpValue, 382*cdf0e10cSrcweir const ::com::sun::star::uno::Any& rValue, 383*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 384*cdf0e10cSrcweir }; 385*cdf0e10cSrcweir 386*cdf0e10cSrcweir sal_Bool XMLContourModePropHdl_Impl::importXML( 387*cdf0e10cSrcweir const OUString& rStrImpValue, 388*cdf0e10cSrcweir Any& rValue, 389*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 390*cdf0e10cSrcweir { 391*cdf0e10cSrcweir sal_Bool bRet = sal_True; 392*cdf0e10cSrcweir sal_Bool bVal = sal_False; 393*cdf0e10cSrcweir if( IsXMLToken( rStrImpValue, XML_OUTSIDE ) ) 394*cdf0e10cSrcweir bVal = sal_True; 395*cdf0e10cSrcweir else if( ! IsXMLToken( rStrImpValue, XML_FULL ) ) 396*cdf0e10cSrcweir bRet = sal_False; 397*cdf0e10cSrcweir 398*cdf0e10cSrcweir if( bRet ) 399*cdf0e10cSrcweir rValue.setValue( &bVal, ::getBooleanCppuType() ); 400*cdf0e10cSrcweir 401*cdf0e10cSrcweir return bRet; 402*cdf0e10cSrcweir } 403*cdf0e10cSrcweir 404*cdf0e10cSrcweir sal_Bool XMLContourModePropHdl_Impl::exportXML( 405*cdf0e10cSrcweir OUString& rStrExpValue, 406*cdf0e10cSrcweir const Any& rValue, 407*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 408*cdf0e10cSrcweir { 409*cdf0e10cSrcweir if( *(sal_Bool *)rValue.getValue() ) 410*cdf0e10cSrcweir rStrExpValue = GetXMLToken( XML_OUTSIDE ); 411*cdf0e10cSrcweir else 412*cdf0e10cSrcweir rStrExpValue = GetXMLToken( XML_FULL ); 413*cdf0e10cSrcweir 414*cdf0e10cSrcweir return sal_True; 415*cdf0e10cSrcweir } 416*cdf0e10cSrcweir 417*cdf0e10cSrcweir XMLContourModePropHdl_Impl::~XMLContourModePropHdl_Impl() 418*cdf0e10cSrcweir { 419*cdf0e10cSrcweir } 420*cdf0e10cSrcweir 421*cdf0e10cSrcweir // --------------------------------------------------------------------------- 422*cdf0e10cSrcweir 423*cdf0e10cSrcweir class XMLParagraphOnlyPropHdl_Impl : public XMLPropertyHandler 424*cdf0e10cSrcweir { 425*cdf0e10cSrcweir public: 426*cdf0e10cSrcweir virtual ~XMLParagraphOnlyPropHdl_Impl (); 427*cdf0e10cSrcweir 428*cdf0e10cSrcweir virtual sal_Bool importXML( 429*cdf0e10cSrcweir const ::rtl::OUString& rStrImpValue, 430*cdf0e10cSrcweir ::com::sun::star::uno::Any& rValue, 431*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 432*cdf0e10cSrcweir virtual sal_Bool exportXML( 433*cdf0e10cSrcweir ::rtl::OUString& rStrExpValue, 434*cdf0e10cSrcweir const ::com::sun::star::uno::Any& rValue, 435*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 436*cdf0e10cSrcweir }; 437*cdf0e10cSrcweir 438*cdf0e10cSrcweir sal_Bool XMLParagraphOnlyPropHdl_Impl::importXML( 439*cdf0e10cSrcweir const OUString& rStrImpValue, 440*cdf0e10cSrcweir Any& rValue, 441*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 442*cdf0e10cSrcweir { 443*cdf0e10cSrcweir sal_Bool bRet = sal_True; 444*cdf0e10cSrcweir sal_Bool bVal = sal_False; 445*cdf0e10cSrcweir 446*cdf0e10cSrcweir if( ! IsXMLToken( rStrImpValue, XML_NO_LIMIT ) ) 447*cdf0e10cSrcweir { 448*cdf0e10cSrcweir sal_Int32 nValue = 0; 449*cdf0e10cSrcweir bRet = SvXMLUnitConverter::convertNumber( nValue, rStrImpValue ); 450*cdf0e10cSrcweir bVal = 1 == nValue; 451*cdf0e10cSrcweir } 452*cdf0e10cSrcweir 453*cdf0e10cSrcweir if( bRet ) 454*cdf0e10cSrcweir rValue.setValue( &bVal, ::getBooleanCppuType() ); 455*cdf0e10cSrcweir 456*cdf0e10cSrcweir return bRet; 457*cdf0e10cSrcweir } 458*cdf0e10cSrcweir 459*cdf0e10cSrcweir sal_Bool XMLParagraphOnlyPropHdl_Impl::exportXML( 460*cdf0e10cSrcweir OUString& rStrExpValue, 461*cdf0e10cSrcweir const Any& rValue, 462*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 463*cdf0e10cSrcweir { 464*cdf0e10cSrcweir if( *(sal_Bool *)rValue.getValue() ) 465*cdf0e10cSrcweir rStrExpValue = GetXMLToken( XML_1 ); 466*cdf0e10cSrcweir else 467*cdf0e10cSrcweir rStrExpValue = GetXMLToken( XML_NO_LIMIT ); 468*cdf0e10cSrcweir 469*cdf0e10cSrcweir return sal_True; 470*cdf0e10cSrcweir } 471*cdf0e10cSrcweir 472*cdf0e10cSrcweir XMLParagraphOnlyPropHdl_Impl::~XMLParagraphOnlyPropHdl_Impl() 473*cdf0e10cSrcweir { 474*cdf0e10cSrcweir } 475*cdf0e10cSrcweir 476*cdf0e10cSrcweir // --------------------------------------------------------------------------- 477*cdf0e10cSrcweir 478*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_Wrap_Enum[] = 479*cdf0e10cSrcweir { 480*cdf0e10cSrcweir { XML_NONE, WrapTextMode_NONE }, 481*cdf0e10cSrcweir { XML_RUN_THROUGH, WrapTextMode_THROUGHT }, 482*cdf0e10cSrcweir { XML_PARALLEL, WrapTextMode_PARALLEL }, 483*cdf0e10cSrcweir { XML_DYNAMIC, WrapTextMode_DYNAMIC }, 484*cdf0e10cSrcweir { XML_LEFT, WrapTextMode_LEFT }, 485*cdf0e10cSrcweir { XML_RIGHT, WrapTextMode_RIGHT }, 486*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 487*cdf0e10cSrcweir }; 488*cdf0e10cSrcweir 489*cdf0e10cSrcweir class XMLWrapPropHdl_Impl : public XMLPropertyHandler 490*cdf0e10cSrcweir { 491*cdf0e10cSrcweir public: 492*cdf0e10cSrcweir virtual ~XMLWrapPropHdl_Impl (); 493*cdf0e10cSrcweir 494*cdf0e10cSrcweir virtual sal_Bool importXML( 495*cdf0e10cSrcweir const ::rtl::OUString& rStrImpValue, 496*cdf0e10cSrcweir ::com::sun::star::uno::Any& rValue, 497*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 498*cdf0e10cSrcweir virtual sal_Bool exportXML( 499*cdf0e10cSrcweir ::rtl::OUString& rStrExpValue, 500*cdf0e10cSrcweir const ::com::sun::star::uno::Any& rValue, 501*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 502*cdf0e10cSrcweir }; 503*cdf0e10cSrcweir 504*cdf0e10cSrcweir sal_Bool XMLWrapPropHdl_Impl::importXML( 505*cdf0e10cSrcweir const OUString& rStrImpValue, 506*cdf0e10cSrcweir Any& rValue, 507*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 508*cdf0e10cSrcweir { 509*cdf0e10cSrcweir sal_uInt16 nWrap; 510*cdf0e10cSrcweir sal_Bool bRet = SvXMLUnitConverter::convertEnum( nWrap, rStrImpValue, 511*cdf0e10cSrcweir pXML_Wrap_Enum ); 512*cdf0e10cSrcweir 513*cdf0e10cSrcweir if( bRet ) 514*cdf0e10cSrcweir rValue <<= (WrapTextMode)nWrap; 515*cdf0e10cSrcweir 516*cdf0e10cSrcweir return bRet; 517*cdf0e10cSrcweir } 518*cdf0e10cSrcweir 519*cdf0e10cSrcweir sal_Bool XMLWrapPropHdl_Impl::exportXML( 520*cdf0e10cSrcweir OUString& rStrExpValue, 521*cdf0e10cSrcweir const Any& rValue, 522*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 523*cdf0e10cSrcweir { 524*cdf0e10cSrcweir OUStringBuffer aOut; 525*cdf0e10cSrcweir WrapTextMode eVal; 526*cdf0e10cSrcweir 527*cdf0e10cSrcweir rValue >>= eVal; 528*cdf0e10cSrcweir 529*cdf0e10cSrcweir sal_Bool bRet = SvXMLUnitConverter::convertEnum( aOut, eVal, pXML_Wrap_Enum, XML_NONE ); 530*cdf0e10cSrcweir 531*cdf0e10cSrcweir rStrExpValue = aOut.makeStringAndClear(); 532*cdf0e10cSrcweir 533*cdf0e10cSrcweir return bRet; 534*cdf0e10cSrcweir } 535*cdf0e10cSrcweir 536*cdf0e10cSrcweir XMLWrapPropHdl_Impl::~XMLWrapPropHdl_Impl () 537*cdf0e10cSrcweir { 538*cdf0e10cSrcweir } 539*cdf0e10cSrcweir 540*cdf0e10cSrcweir // --------------------------------------------------------------------------- 541*cdf0e10cSrcweir 542*cdf0e10cSrcweir class XMLFrameProtectPropHdl_Impl : public XMLPropertyHandler 543*cdf0e10cSrcweir { 544*cdf0e10cSrcweir const OUString sVal; 545*cdf0e10cSrcweir public: 546*cdf0e10cSrcweir XMLFrameProtectPropHdl_Impl( enum XMLTokenEnum eVal ) : 547*cdf0e10cSrcweir sVal( GetXMLToken(eVal) ) {} 548*cdf0e10cSrcweir virtual ~XMLFrameProtectPropHdl_Impl (); 549*cdf0e10cSrcweir 550*cdf0e10cSrcweir virtual sal_Bool importXML( 551*cdf0e10cSrcweir const ::rtl::OUString& rStrImpValue, 552*cdf0e10cSrcweir ::com::sun::star::uno::Any& rValue, 553*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 554*cdf0e10cSrcweir virtual sal_Bool exportXML( 555*cdf0e10cSrcweir ::rtl::OUString& rStrExpValue, 556*cdf0e10cSrcweir const ::com::sun::star::uno::Any& rValue, 557*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 558*cdf0e10cSrcweir }; 559*cdf0e10cSrcweir 560*cdf0e10cSrcweir sal_Bool XMLFrameProtectPropHdl_Impl::importXML( 561*cdf0e10cSrcweir const OUString& rStrImpValue, 562*cdf0e10cSrcweir Any& rValue, 563*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 564*cdf0e10cSrcweir { 565*cdf0e10cSrcweir sal_Bool bRet = sal_True; 566*cdf0e10cSrcweir sal_Bool bVal = sal_False; 567*cdf0e10cSrcweir if( ! IsXMLToken( rStrImpValue, XML_NONE ) ) 568*cdf0e10cSrcweir { 569*cdf0e10cSrcweir bRet = sal_False; 570*cdf0e10cSrcweir SvXMLTokenEnumerator aTokenEnum( rStrImpValue ); 571*cdf0e10cSrcweir OUString aToken; 572*cdf0e10cSrcweir while( aTokenEnum.getNextToken( aToken ) ) 573*cdf0e10cSrcweir { 574*cdf0e10cSrcweir bRet = sal_True; 575*cdf0e10cSrcweir if( aToken == sVal ) 576*cdf0e10cSrcweir { 577*cdf0e10cSrcweir bVal = sal_True; 578*cdf0e10cSrcweir break; 579*cdf0e10cSrcweir } 580*cdf0e10cSrcweir } 581*cdf0e10cSrcweir } 582*cdf0e10cSrcweir 583*cdf0e10cSrcweir if( bRet ) 584*cdf0e10cSrcweir rValue.setValue( &bVal, ::getBooleanCppuType() ); 585*cdf0e10cSrcweir 586*cdf0e10cSrcweir return bRet; 587*cdf0e10cSrcweir } 588*cdf0e10cSrcweir 589*cdf0e10cSrcweir sal_Bool XMLFrameProtectPropHdl_Impl::exportXML( 590*cdf0e10cSrcweir OUString& rStrExpValue, 591*cdf0e10cSrcweir const Any& rValue, 592*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 593*cdf0e10cSrcweir { 594*cdf0e10cSrcweir if( *(sal_Bool *)rValue.getValue() ) 595*cdf0e10cSrcweir { 596*cdf0e10cSrcweir if( !rStrExpValue.getLength() || 597*cdf0e10cSrcweir IsXMLToken( rStrExpValue, XML_NONE ) ) 598*cdf0e10cSrcweir { 599*cdf0e10cSrcweir rStrExpValue = sVal; 600*cdf0e10cSrcweir } 601*cdf0e10cSrcweir else 602*cdf0e10cSrcweir { 603*cdf0e10cSrcweir OUStringBuffer aOut( rStrExpValue.getLength() + 1 + 604*cdf0e10cSrcweir sVal.getLength() ); 605*cdf0e10cSrcweir aOut.append( rStrExpValue ); 606*cdf0e10cSrcweir aOut.append( (sal_Unicode)' ' ); 607*cdf0e10cSrcweir aOut.append( sVal ); 608*cdf0e10cSrcweir rStrExpValue = aOut.makeStringAndClear(); 609*cdf0e10cSrcweir } 610*cdf0e10cSrcweir } 611*cdf0e10cSrcweir else if( !rStrExpValue.getLength() ) 612*cdf0e10cSrcweir { 613*cdf0e10cSrcweir rStrExpValue = GetXMLToken( XML_NONE ); 614*cdf0e10cSrcweir } 615*cdf0e10cSrcweir 616*cdf0e10cSrcweir return sal_True; 617*cdf0e10cSrcweir } 618*cdf0e10cSrcweir 619*cdf0e10cSrcweir XMLFrameProtectPropHdl_Impl::~XMLFrameProtectPropHdl_Impl() 620*cdf0e10cSrcweir { 621*cdf0e10cSrcweir } 622*cdf0e10cSrcweir 623*cdf0e10cSrcweir // --------------------------------------------------------------------------- 624*cdf0e10cSrcweir 625*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_Anchor_Enum[] = 626*cdf0e10cSrcweir { 627*cdf0e10cSrcweir { XML_CHAR, TextContentAnchorType_AT_CHARACTER }, 628*cdf0e10cSrcweir { XML_PAGE, TextContentAnchorType_AT_PAGE }, 629*cdf0e10cSrcweir { XML_FRAME, TextContentAnchorType_AT_FRAME }, 630*cdf0e10cSrcweir { XML_PARAGRAPH, TextContentAnchorType_AT_PARAGRAPH }, 631*cdf0e10cSrcweir { XML_AS_CHAR, TextContentAnchorType_AS_CHARACTER }, 632*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 633*cdf0e10cSrcweir }; 634*cdf0e10cSrcweir 635*cdf0e10cSrcweir 636*cdf0e10cSrcweir sal_Bool XMLAnchorTypePropHdl::importXML( 637*cdf0e10cSrcweir const OUString& rStrImpValue, 638*cdf0e10cSrcweir Any& rValue, 639*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 640*cdf0e10cSrcweir { 641*cdf0e10cSrcweir sal_uInt16 nAnchor; 642*cdf0e10cSrcweir sal_Bool bRet = SvXMLUnitConverter::convertEnum( nAnchor, rStrImpValue, 643*cdf0e10cSrcweir pXML_Anchor_Enum ); 644*cdf0e10cSrcweir 645*cdf0e10cSrcweir if( bRet ) 646*cdf0e10cSrcweir rValue <<= (TextContentAnchorType)nAnchor; 647*cdf0e10cSrcweir 648*cdf0e10cSrcweir return bRet; 649*cdf0e10cSrcweir } 650*cdf0e10cSrcweir 651*cdf0e10cSrcweir sal_Bool XMLAnchorTypePropHdl::exportXML( 652*cdf0e10cSrcweir OUString& rStrExpValue, 653*cdf0e10cSrcweir const Any& rValue, 654*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 655*cdf0e10cSrcweir { 656*cdf0e10cSrcweir OUStringBuffer aOut; 657*cdf0e10cSrcweir TextContentAnchorType eVal; 658*cdf0e10cSrcweir 659*cdf0e10cSrcweir rValue >>= eVal; 660*cdf0e10cSrcweir 661*cdf0e10cSrcweir sal_Bool bRet = SvXMLUnitConverter::convertEnum( aOut, eVal, pXML_Anchor_Enum, XML_PARAGRAPH ); 662*cdf0e10cSrcweir 663*cdf0e10cSrcweir rStrExpValue = aOut.makeStringAndClear(); 664*cdf0e10cSrcweir 665*cdf0e10cSrcweir return bRet; 666*cdf0e10cSrcweir } 667*cdf0e10cSrcweir 668*cdf0e10cSrcweir XMLAnchorTypePropHdl::~XMLAnchorTypePropHdl() 669*cdf0e10cSrcweir { 670*cdf0e10cSrcweir } 671*cdf0e10cSrcweir 672*cdf0e10cSrcweir sal_Bool XMLAnchorTypePropHdl::convert( const OUString& rStrImpValue, 673*cdf0e10cSrcweir TextContentAnchorType& rType ) 674*cdf0e10cSrcweir { 675*cdf0e10cSrcweir sal_uInt16 nAnchor; 676*cdf0e10cSrcweir sal_Bool bRet = SvXMLUnitConverter::convertEnum( nAnchor, rStrImpValue, 677*cdf0e10cSrcweir pXML_Anchor_Enum ); 678*cdf0e10cSrcweir if( bRet ) 679*cdf0e10cSrcweir rType = (TextContentAnchorType)nAnchor; 680*cdf0e10cSrcweir return bRet; 681*cdf0e10cSrcweir } 682*cdf0e10cSrcweir 683*cdf0e10cSrcweir // --------------------------------------------------------------------------- 684*cdf0e10cSrcweir 685*cdf0e10cSrcweir 686*cdf0e10cSrcweir XMLTextColumnsPropertyHandler::~XMLTextColumnsPropertyHandler () 687*cdf0e10cSrcweir { 688*cdf0e10cSrcweir } 689*cdf0e10cSrcweir 690*cdf0e10cSrcweir bool XMLTextColumnsPropertyHandler::equals( 691*cdf0e10cSrcweir const Any& r1, 692*cdf0e10cSrcweir const Any& r2 ) const 693*cdf0e10cSrcweir { 694*cdf0e10cSrcweir Reference < XTextColumns > xColumns1; 695*cdf0e10cSrcweir r1 >>= xColumns1; 696*cdf0e10cSrcweir 697*cdf0e10cSrcweir Reference < XTextColumns > xColumns2; 698*cdf0e10cSrcweir r2 >>= xColumns2; 699*cdf0e10cSrcweir 700*cdf0e10cSrcweir if( xColumns1->getColumnCount() != xColumns2->getColumnCount() || 701*cdf0e10cSrcweir xColumns1->getReferenceValue() != xColumns2->getReferenceValue() ) 702*cdf0e10cSrcweir return sal_False; 703*cdf0e10cSrcweir 704*cdf0e10cSrcweir Sequence < TextColumn > aColumns1 = xColumns1->getColumns(); 705*cdf0e10cSrcweir Sequence < TextColumn > aColumns2 = xColumns2->getColumns(); 706*cdf0e10cSrcweir sal_Int32 nCount = aColumns1.getLength(); 707*cdf0e10cSrcweir if( aColumns2.getLength() != nCount ) 708*cdf0e10cSrcweir return sal_False; 709*cdf0e10cSrcweir 710*cdf0e10cSrcweir const TextColumn *pColumns1 = aColumns1.getArray(); 711*cdf0e10cSrcweir const TextColumn *pColumns2 = aColumns2.getArray(); 712*cdf0e10cSrcweir 713*cdf0e10cSrcweir while( nCount-- ) 714*cdf0e10cSrcweir { 715*cdf0e10cSrcweir if( pColumns1->Width != pColumns2->Width || 716*cdf0e10cSrcweir pColumns1->LeftMargin != pColumns2->LeftMargin || 717*cdf0e10cSrcweir pColumns1->RightMargin != pColumns2->RightMargin ) 718*cdf0e10cSrcweir return sal_False; 719*cdf0e10cSrcweir 720*cdf0e10cSrcweir pColumns1++; 721*cdf0e10cSrcweir pColumns2++; 722*cdf0e10cSrcweir } 723*cdf0e10cSrcweir 724*cdf0e10cSrcweir return sal_True; 725*cdf0e10cSrcweir } 726*cdf0e10cSrcweir 727*cdf0e10cSrcweir sal_Bool XMLTextColumnsPropertyHandler::importXML( 728*cdf0e10cSrcweir const OUString&, 729*cdf0e10cSrcweir Any&, 730*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 731*cdf0e10cSrcweir { 732*cdf0e10cSrcweir DBG_ASSERT( !this, "columns are an element import property" ); 733*cdf0e10cSrcweir return sal_False; 734*cdf0e10cSrcweir } 735*cdf0e10cSrcweir 736*cdf0e10cSrcweir sal_Bool XMLTextColumnsPropertyHandler::exportXML( 737*cdf0e10cSrcweir OUString&, 738*cdf0e10cSrcweir const Any&, 739*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 740*cdf0e10cSrcweir { 741*cdf0e10cSrcweir DBG_ASSERT( !this, "columns are an element export property" ); 742*cdf0e10cSrcweir return sal_False; 743*cdf0e10cSrcweir } 744*cdf0e10cSrcweir 745*cdf0e10cSrcweir // --------------------------------------------------------------------------- 746*cdf0e10cSrcweir 747*cdf0e10cSrcweir class XMLHoriMirrorPropHdl_Impl : public XMLPropertyHandler 748*cdf0e10cSrcweir { 749*cdf0e10cSrcweir public: 750*cdf0e10cSrcweir virtual ~XMLHoriMirrorPropHdl_Impl (); 751*cdf0e10cSrcweir 752*cdf0e10cSrcweir virtual sal_Bool importXML( 753*cdf0e10cSrcweir const ::rtl::OUString& rStrImpValue, 754*cdf0e10cSrcweir ::com::sun::star::uno::Any& rValue, 755*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 756*cdf0e10cSrcweir virtual sal_Bool exportXML( 757*cdf0e10cSrcweir ::rtl::OUString& rStrExpValue, 758*cdf0e10cSrcweir const ::com::sun::star::uno::Any& rValue, 759*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 760*cdf0e10cSrcweir }; 761*cdf0e10cSrcweir 762*cdf0e10cSrcweir sal_Bool XMLHoriMirrorPropHdl_Impl::importXML( 763*cdf0e10cSrcweir const OUString& rStrImpValue, 764*cdf0e10cSrcweir Any& rValue, 765*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 766*cdf0e10cSrcweir { 767*cdf0e10cSrcweir sal_uInt16 nHoriMirror; 768*cdf0e10cSrcweir sal_Bool bRet = SvXMLUnitConverter::convertEnum( nHoriMirror, rStrImpValue, 769*cdf0e10cSrcweir pXML_HoriMirror_Enum ); 770*cdf0e10cSrcweir 771*cdf0e10cSrcweir if( bRet ) 772*cdf0e10cSrcweir { 773*cdf0e10cSrcweir sal_Bool bTmp = nHoriMirror != 0; 774*cdf0e10cSrcweir rValue.setValue( &bTmp, ::getBooleanCppuType() ); 775*cdf0e10cSrcweir } 776*cdf0e10cSrcweir 777*cdf0e10cSrcweir return bRet; 778*cdf0e10cSrcweir } 779*cdf0e10cSrcweir 780*cdf0e10cSrcweir sal_Bool XMLHoriMirrorPropHdl_Impl::exportXML( 781*cdf0e10cSrcweir OUString&, 782*cdf0e10cSrcweir const Any&, 783*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 784*cdf0e10cSrcweir { 785*cdf0e10cSrcweir DBG_ASSERT( !this, "HorMirror properyt shouldn't be exported" ); 786*cdf0e10cSrcweir 787*cdf0e10cSrcweir return sal_False; 788*cdf0e10cSrcweir } 789*cdf0e10cSrcweir 790*cdf0e10cSrcweir XMLHoriMirrorPropHdl_Impl::~XMLHoriMirrorPropHdl_Impl () 791*cdf0e10cSrcweir { 792*cdf0e10cSrcweir } 793*cdf0e10cSrcweir 794*cdf0e10cSrcweir // --------------------------------------------------------------------------- 795*cdf0e10cSrcweir 796*cdf0e10cSrcweir class XMLGrfMirrorPropHdl_Impl : public XMLPropertyHandler 797*cdf0e10cSrcweir { 798*cdf0e10cSrcweir const OUString sVal; 799*cdf0e10cSrcweir sal_Bool bHori; 800*cdf0e10cSrcweir 801*cdf0e10cSrcweir public: 802*cdf0e10cSrcweir XMLGrfMirrorPropHdl_Impl( enum XMLTokenEnum eVal, sal_Bool bH ) : 803*cdf0e10cSrcweir sVal( GetXMLToken( eVal ) ), 804*cdf0e10cSrcweir bHori( bH ) {} 805*cdf0e10cSrcweir virtual ~XMLGrfMirrorPropHdl_Impl (); 806*cdf0e10cSrcweir 807*cdf0e10cSrcweir virtual sal_Bool importXML( 808*cdf0e10cSrcweir const ::rtl::OUString& rStrImpValue, 809*cdf0e10cSrcweir ::com::sun::star::uno::Any& rValue, 810*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 811*cdf0e10cSrcweir virtual sal_Bool exportXML( 812*cdf0e10cSrcweir ::rtl::OUString& rStrExpValue, 813*cdf0e10cSrcweir const ::com::sun::star::uno::Any& rValue, 814*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 815*cdf0e10cSrcweir }; 816*cdf0e10cSrcweir 817*cdf0e10cSrcweir sal_Bool XMLGrfMirrorPropHdl_Impl::importXML( 818*cdf0e10cSrcweir const OUString& rStrImpValue, 819*cdf0e10cSrcweir Any& rValue, 820*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 821*cdf0e10cSrcweir { 822*cdf0e10cSrcweir sal_Bool bRet = sal_True; 823*cdf0e10cSrcweir sal_Bool bVal = sal_False; 824*cdf0e10cSrcweir if( ! IsXMLToken( rStrImpValue, XML_NONE ) ) 825*cdf0e10cSrcweir { 826*cdf0e10cSrcweir bRet = sal_False; 827*cdf0e10cSrcweir SvXMLTokenEnumerator aTokenEnum( rStrImpValue ); 828*cdf0e10cSrcweir OUString aToken; 829*cdf0e10cSrcweir while( aTokenEnum.getNextToken( aToken ) ) 830*cdf0e10cSrcweir { 831*cdf0e10cSrcweir bRet = sal_True; 832*cdf0e10cSrcweir if( aToken == sVal || 833*cdf0e10cSrcweir (bHori && IsXMLToken( aToken, XML_HORIZONTAL ) ) ) 834*cdf0e10cSrcweir { 835*cdf0e10cSrcweir bVal = sal_True; 836*cdf0e10cSrcweir break; 837*cdf0e10cSrcweir } 838*cdf0e10cSrcweir } 839*cdf0e10cSrcweir } 840*cdf0e10cSrcweir 841*cdf0e10cSrcweir if( bRet ) 842*cdf0e10cSrcweir rValue.setValue( &bVal, ::getBooleanCppuType() ); 843*cdf0e10cSrcweir 844*cdf0e10cSrcweir return bRet; 845*cdf0e10cSrcweir } 846*cdf0e10cSrcweir 847*cdf0e10cSrcweir sal_Bool XMLGrfMirrorPropHdl_Impl::exportXML( 848*cdf0e10cSrcweir OUString& rStrExpValue, 849*cdf0e10cSrcweir const Any& rValue, 850*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 851*cdf0e10cSrcweir { 852*cdf0e10cSrcweir if( *(sal_Bool *)rValue.getValue() ) 853*cdf0e10cSrcweir { 854*cdf0e10cSrcweir if( !rStrExpValue.getLength() || 855*cdf0e10cSrcweir IsXMLToken( rStrExpValue, XML_NONE ) ) 856*cdf0e10cSrcweir { 857*cdf0e10cSrcweir rStrExpValue = sVal; 858*cdf0e10cSrcweir } 859*cdf0e10cSrcweir else if( bHori && 860*cdf0e10cSrcweir // --> OD 2005-05-12 #i49139# 861*cdf0e10cSrcweir // XML_HORIZONTAL_ON_LEFT_PAGES and XML_HORIZONTAL_ON_RIGHT_PAGES 862*cdf0e10cSrcweir // are replaced by XML_HORIZONTAL_ON_EVEN and XML_HORIZONTAL_ON_ODD. 863*cdf0e10cSrcweir ( IsXMLToken( rStrExpValue, XML_HORIZONTAL_ON_EVEN ) || 864*cdf0e10cSrcweir IsXMLToken( rStrExpValue, XML_HORIZONTAL_ON_ODD ) )) 865*cdf0e10cSrcweir // <-- 866*cdf0e10cSrcweir { 867*cdf0e10cSrcweir rStrExpValue = GetXMLToken( XML_HORIZONTAL ); 868*cdf0e10cSrcweir } 869*cdf0e10cSrcweir else 870*cdf0e10cSrcweir { 871*cdf0e10cSrcweir OUStringBuffer aOut( rStrExpValue.getLength() + 1 + 872*cdf0e10cSrcweir sVal.getLength() ); 873*cdf0e10cSrcweir aOut.append( rStrExpValue ); 874*cdf0e10cSrcweir aOut.append( (sal_Unicode)' ' ); 875*cdf0e10cSrcweir aOut.append( sVal ); 876*cdf0e10cSrcweir rStrExpValue = aOut.makeStringAndClear(); 877*cdf0e10cSrcweir } 878*cdf0e10cSrcweir } 879*cdf0e10cSrcweir else if( !rStrExpValue.getLength() ) 880*cdf0e10cSrcweir { 881*cdf0e10cSrcweir rStrExpValue = GetXMLToken( XML_NONE ); 882*cdf0e10cSrcweir } 883*cdf0e10cSrcweir 884*cdf0e10cSrcweir return sal_True; 885*cdf0e10cSrcweir } 886*cdf0e10cSrcweir 887*cdf0e10cSrcweir XMLGrfMirrorPropHdl_Impl::~XMLGrfMirrorPropHdl_Impl() 888*cdf0e10cSrcweir { 889*cdf0e10cSrcweir } 890*cdf0e10cSrcweir 891*cdf0e10cSrcweir // --------------------------------------------------------------------------- 892*cdf0e10cSrcweir 893*cdf0e10cSrcweir SvXMLEnumMapEntry __READONLY_DATA pXML_Emphasize_Enum[] = 894*cdf0e10cSrcweir { 895*cdf0e10cSrcweir { XML_NONE, FontEmphasis::NONE }, 896*cdf0e10cSrcweir { XML_DOT, FontEmphasis::DOT_ABOVE }, 897*cdf0e10cSrcweir { XML_CIRCLE, FontEmphasis::CIRCLE_ABOVE }, 898*cdf0e10cSrcweir { XML_DISC, FontEmphasis::DISK_ABOVE }, 899*cdf0e10cSrcweir { XML_ACCENT, FontEmphasis::ACCENT_ABOVE }, 900*cdf0e10cSrcweir { XML_TOKEN_INVALID, 0 } 901*cdf0e10cSrcweir }; 902*cdf0e10cSrcweir class XMLTextEmphasizePropHdl_Impl : public XMLPropertyHandler 903*cdf0e10cSrcweir { 904*cdf0e10cSrcweir public: 905*cdf0e10cSrcweir XMLTextEmphasizePropHdl_Impl() {} 906*cdf0e10cSrcweir virtual ~XMLTextEmphasizePropHdl_Impl(); 907*cdf0e10cSrcweir 908*cdf0e10cSrcweir virtual sal_Bool importXML( 909*cdf0e10cSrcweir const ::rtl::OUString& rStrImpValue, 910*cdf0e10cSrcweir ::com::sun::star::uno::Any& rValue, 911*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 912*cdf0e10cSrcweir virtual sal_Bool exportXML( 913*cdf0e10cSrcweir ::rtl::OUString& rStrExpValue, 914*cdf0e10cSrcweir const ::com::sun::star::uno::Any& rValue, 915*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 916*cdf0e10cSrcweir }; 917*cdf0e10cSrcweir 918*cdf0e10cSrcweir sal_Bool XMLTextEmphasizePropHdl_Impl::importXML( 919*cdf0e10cSrcweir const OUString& rStrImpValue, 920*cdf0e10cSrcweir Any& rValue, 921*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 922*cdf0e10cSrcweir { 923*cdf0e10cSrcweir sal_Bool bRet = sal_True; 924*cdf0e10cSrcweir sal_uInt16 nVal = FontEmphasis::NONE; 925*cdf0e10cSrcweir sal_Bool bBelow = sal_False; 926*cdf0e10cSrcweir sal_Bool bHasPos = sal_False, bHasType = sal_False; 927*cdf0e10cSrcweir OUString aToken; 928*cdf0e10cSrcweir 929*cdf0e10cSrcweir SvXMLTokenEnumerator aTokenEnum( rStrImpValue ); 930*cdf0e10cSrcweir while( aTokenEnum.getNextToken( aToken ) ) 931*cdf0e10cSrcweir { 932*cdf0e10cSrcweir if( !bHasPos && IsXMLToken( aToken, XML_ABOVE ) ) 933*cdf0e10cSrcweir { 934*cdf0e10cSrcweir bBelow = sal_False; 935*cdf0e10cSrcweir bHasPos = sal_True; 936*cdf0e10cSrcweir } 937*cdf0e10cSrcweir else if( !bHasPos && IsXMLToken( aToken, XML_BELOW ) ) 938*cdf0e10cSrcweir { 939*cdf0e10cSrcweir bBelow = sal_True; 940*cdf0e10cSrcweir bHasPos = sal_True; 941*cdf0e10cSrcweir } 942*cdf0e10cSrcweir else if( !bHasType && 943*cdf0e10cSrcweir SvXMLUnitConverter::convertEnum( nVal, aToken, 944*cdf0e10cSrcweir pXML_Emphasize_Enum )) 945*cdf0e10cSrcweir { 946*cdf0e10cSrcweir bHasType = sal_True; 947*cdf0e10cSrcweir } 948*cdf0e10cSrcweir else 949*cdf0e10cSrcweir { 950*cdf0e10cSrcweir bRet = sal_False; 951*cdf0e10cSrcweir break; 952*cdf0e10cSrcweir } 953*cdf0e10cSrcweir } 954*cdf0e10cSrcweir 955*cdf0e10cSrcweir if( bRet ) 956*cdf0e10cSrcweir { 957*cdf0e10cSrcweir if( FontEmphasis::NONE != nVal && bBelow ) 958*cdf0e10cSrcweir nVal += 10; 959*cdf0e10cSrcweir rValue <<= (sal_Int16)nVal; 960*cdf0e10cSrcweir } 961*cdf0e10cSrcweir 962*cdf0e10cSrcweir return bRet; 963*cdf0e10cSrcweir } 964*cdf0e10cSrcweir 965*cdf0e10cSrcweir sal_Bool XMLTextEmphasizePropHdl_Impl::exportXML( 966*cdf0e10cSrcweir OUString& rStrExpValue, 967*cdf0e10cSrcweir const Any& rValue, 968*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 969*cdf0e10cSrcweir { 970*cdf0e10cSrcweir OUStringBuffer aOut( 15 ); 971*cdf0e10cSrcweir sal_Bool bRet = sal_True; 972*cdf0e10cSrcweir sal_Int16 nType = sal_Int16(); 973*cdf0e10cSrcweir if( rValue >>= nType ) 974*cdf0e10cSrcweir { 975*cdf0e10cSrcweir sal_Bool bBelow = sal_False; 976*cdf0e10cSrcweir if( nType > 10 ) 977*cdf0e10cSrcweir { 978*cdf0e10cSrcweir bBelow = sal_True; 979*cdf0e10cSrcweir nType -= 10; 980*cdf0e10cSrcweir } 981*cdf0e10cSrcweir bRet = SvXMLUnitConverter::convertEnum( aOut, nType, 982*cdf0e10cSrcweir pXML_Emphasize_Enum, 983*cdf0e10cSrcweir XML_DOT ); 984*cdf0e10cSrcweir if( bRet ) 985*cdf0e10cSrcweir { 986*cdf0e10cSrcweir if( nType != 0 ) 987*cdf0e10cSrcweir { 988*cdf0e10cSrcweir enum XMLTokenEnum ePos = bBelow ? XML_BELOW : XML_ABOVE; 989*cdf0e10cSrcweir aOut.append( (sal_Unicode)' ' ); 990*cdf0e10cSrcweir aOut.append( GetXMLToken(ePos) ); 991*cdf0e10cSrcweir } 992*cdf0e10cSrcweir rStrExpValue = aOut.makeStringAndClear(); 993*cdf0e10cSrcweir } 994*cdf0e10cSrcweir } 995*cdf0e10cSrcweir 996*cdf0e10cSrcweir return bRet; 997*cdf0e10cSrcweir } 998*cdf0e10cSrcweir 999*cdf0e10cSrcweir XMLTextEmphasizePropHdl_Impl::~XMLTextEmphasizePropHdl_Impl() 1000*cdf0e10cSrcweir { 1001*cdf0e10cSrcweir } 1002*cdf0e10cSrcweir 1003*cdf0e10cSrcweir 1004*cdf0e10cSrcweir // --------------------------------------------------------------------------- 1005*cdf0e10cSrcweir 1006*cdf0e10cSrcweir class XMLTextCombineCharPropHdl_Impl : public XMLPropertyHandler 1007*cdf0e10cSrcweir { 1008*cdf0e10cSrcweir public: 1009*cdf0e10cSrcweir XMLTextCombineCharPropHdl_Impl() {} 1010*cdf0e10cSrcweir virtual ~XMLTextCombineCharPropHdl_Impl(); 1011*cdf0e10cSrcweir 1012*cdf0e10cSrcweir virtual sal_Bool importXML( 1013*cdf0e10cSrcweir const ::rtl::OUString& rStrImpValue, 1014*cdf0e10cSrcweir ::com::sun::star::uno::Any& rValue, 1015*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 1016*cdf0e10cSrcweir virtual sal_Bool exportXML( 1017*cdf0e10cSrcweir ::rtl::OUString& rStrExpValue, 1018*cdf0e10cSrcweir const ::com::sun::star::uno::Any& rValue, 1019*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 1020*cdf0e10cSrcweir }; 1021*cdf0e10cSrcweir 1022*cdf0e10cSrcweir sal_Bool XMLTextCombineCharPropHdl_Impl::importXML( 1023*cdf0e10cSrcweir const OUString& rStrImpValue, 1024*cdf0e10cSrcweir Any& rValue, 1025*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 1026*cdf0e10cSrcweir { 1027*cdf0e10cSrcweir if( rStrImpValue.getLength() ) 1028*cdf0e10cSrcweir rValue <<= rStrImpValue.copy( 0, 1 ); 1029*cdf0e10cSrcweir else 1030*cdf0e10cSrcweir rValue <<= rStrImpValue; 1031*cdf0e10cSrcweir 1032*cdf0e10cSrcweir return sal_True; 1033*cdf0e10cSrcweir } 1034*cdf0e10cSrcweir 1035*cdf0e10cSrcweir sal_Bool XMLTextCombineCharPropHdl_Impl::exportXML( 1036*cdf0e10cSrcweir OUString& rStrExpValue, 1037*cdf0e10cSrcweir const Any& rValue, 1038*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 1039*cdf0e10cSrcweir { 1040*cdf0e10cSrcweir rValue >>= rStrExpValue; 1041*cdf0e10cSrcweir 1042*cdf0e10cSrcweir // #i114107# attribute of type "character": export only if length is 1 1043*cdf0e10cSrcweir return (1 == rStrExpValue.getLength()) ? sal_True : sal_False; 1044*cdf0e10cSrcweir } 1045*cdf0e10cSrcweir 1046*cdf0e10cSrcweir XMLTextCombineCharPropHdl_Impl::~XMLTextCombineCharPropHdl_Impl() 1047*cdf0e10cSrcweir { 1048*cdf0e10cSrcweir } 1049*cdf0e10cSrcweir 1050*cdf0e10cSrcweir // --------------------------------------------------------------------------- 1051*cdf0e10cSrcweir 1052*cdf0e10cSrcweir class XMLTextRelWidthHeightPropHdl_Impl : public XMLPropertyHandler 1053*cdf0e10cSrcweir { 1054*cdf0e10cSrcweir public: 1055*cdf0e10cSrcweir XMLTextRelWidthHeightPropHdl_Impl() {} 1056*cdf0e10cSrcweir virtual ~XMLTextRelWidthHeightPropHdl_Impl(); 1057*cdf0e10cSrcweir 1058*cdf0e10cSrcweir virtual sal_Bool importXML( 1059*cdf0e10cSrcweir const ::rtl::OUString& rStrImpValue, 1060*cdf0e10cSrcweir ::com::sun::star::uno::Any& rValue, 1061*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 1062*cdf0e10cSrcweir virtual sal_Bool exportXML( 1063*cdf0e10cSrcweir ::rtl::OUString& rStrExpValue, 1064*cdf0e10cSrcweir const ::com::sun::star::uno::Any& rValue, 1065*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 1066*cdf0e10cSrcweir }; 1067*cdf0e10cSrcweir 1068*cdf0e10cSrcweir sal_Bool XMLTextRelWidthHeightPropHdl_Impl::importXML( 1069*cdf0e10cSrcweir const OUString& rStrImpValue, 1070*cdf0e10cSrcweir Any& rValue, 1071*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 1072*cdf0e10cSrcweir { 1073*cdf0e10cSrcweir sal_Bool bRet; 1074*cdf0e10cSrcweir sal_Int32 nValue; 1075*cdf0e10cSrcweir bRet = SvXMLUnitConverter::convertPercent( nValue, rStrImpValue ); 1076*cdf0e10cSrcweir if( bRet ) 1077*cdf0e10cSrcweir rValue <<= (sal_Int16)nValue; 1078*cdf0e10cSrcweir 1079*cdf0e10cSrcweir return bRet; 1080*cdf0e10cSrcweir } 1081*cdf0e10cSrcweir 1082*cdf0e10cSrcweir sal_Bool XMLTextRelWidthHeightPropHdl_Impl::exportXML( 1083*cdf0e10cSrcweir OUString& rStrExpValue, 1084*cdf0e10cSrcweir const Any& rValue, 1085*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 1086*cdf0e10cSrcweir { 1087*cdf0e10cSrcweir sal_Bool bRet = sal_False; 1088*cdf0e10cSrcweir sal_Int16 nValue = sal_Int16(); 1089*cdf0e10cSrcweir if( (rValue >>= nValue) && nValue > 0 ) 1090*cdf0e10cSrcweir { 1091*cdf0e10cSrcweir OUStringBuffer aOut; 1092*cdf0e10cSrcweir SvXMLUnitConverter::convertPercent( aOut, nValue ); 1093*cdf0e10cSrcweir rStrExpValue = aOut.makeStringAndClear(); 1094*cdf0e10cSrcweir 1095*cdf0e10cSrcweir bRet = sal_True; 1096*cdf0e10cSrcweir } 1097*cdf0e10cSrcweir 1098*cdf0e10cSrcweir return bRet; 1099*cdf0e10cSrcweir } 1100*cdf0e10cSrcweir 1101*cdf0e10cSrcweir XMLTextRelWidthHeightPropHdl_Impl::~XMLTextRelWidthHeightPropHdl_Impl() 1102*cdf0e10cSrcweir { 1103*cdf0e10cSrcweir } 1104*cdf0e10cSrcweir 1105*cdf0e10cSrcweir // --------------------------------------------------------------------------- 1106*cdf0e10cSrcweir 1107*cdf0e10cSrcweir class XMLTextSyncWidthHeightPropHdl_Impl : public XMLPropertyHandler 1108*cdf0e10cSrcweir { 1109*cdf0e10cSrcweir const OUString sValue; 1110*cdf0e10cSrcweir 1111*cdf0e10cSrcweir public: 1112*cdf0e10cSrcweir XMLTextSyncWidthHeightPropHdl_Impl( enum XMLTokenEnum eValue ) : 1113*cdf0e10cSrcweir sValue( GetXMLToken(eValue) ) {} 1114*cdf0e10cSrcweir virtual ~XMLTextSyncWidthHeightPropHdl_Impl(); 1115*cdf0e10cSrcweir 1116*cdf0e10cSrcweir virtual sal_Bool importXML( 1117*cdf0e10cSrcweir const ::rtl::OUString& rStrImpValue, 1118*cdf0e10cSrcweir ::com::sun::star::uno::Any& rValue, 1119*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 1120*cdf0e10cSrcweir virtual sal_Bool exportXML( 1121*cdf0e10cSrcweir ::rtl::OUString& rStrExpValue, 1122*cdf0e10cSrcweir const ::com::sun::star::uno::Any& rValue, 1123*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 1124*cdf0e10cSrcweir }; 1125*cdf0e10cSrcweir 1126*cdf0e10cSrcweir sal_Bool XMLTextSyncWidthHeightPropHdl_Impl::importXML( 1127*cdf0e10cSrcweir const OUString& rStrImpValue, 1128*cdf0e10cSrcweir Any& rValue, 1129*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 1130*cdf0e10cSrcweir { 1131*cdf0e10cSrcweir sal_Bool bValue = (rStrImpValue == sValue ); 1132*cdf0e10cSrcweir rValue.setValue( &bValue, ::getBooleanCppuType() ); 1133*cdf0e10cSrcweir 1134*cdf0e10cSrcweir return sal_True; 1135*cdf0e10cSrcweir } 1136*cdf0e10cSrcweir 1137*cdf0e10cSrcweir sal_Bool XMLTextSyncWidthHeightPropHdl_Impl::exportXML( 1138*cdf0e10cSrcweir OUString& rStrExpValue, 1139*cdf0e10cSrcweir const Any& rValue, 1140*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 1141*cdf0e10cSrcweir { 1142*cdf0e10cSrcweir sal_Bool bRet = sal_False; 1143*cdf0e10cSrcweir if( *(sal_Bool *)rValue.getValue() ) 1144*cdf0e10cSrcweir { 1145*cdf0e10cSrcweir rStrExpValue = sValue; 1146*cdf0e10cSrcweir bRet = sal_True; 1147*cdf0e10cSrcweir } 1148*cdf0e10cSrcweir 1149*cdf0e10cSrcweir return bRet; 1150*cdf0e10cSrcweir } 1151*cdf0e10cSrcweir 1152*cdf0e10cSrcweir XMLTextSyncWidthHeightPropHdl_Impl::~XMLTextSyncWidthHeightPropHdl_Impl() 1153*cdf0e10cSrcweir { 1154*cdf0e10cSrcweir } 1155*cdf0e10cSrcweir 1156*cdf0e10cSrcweir // --------------------------------------------------------------------------- 1157*cdf0e10cSrcweir 1158*cdf0e10cSrcweir class XMLTextRotationAnglePropHdl_Impl : public XMLPropertyHandler 1159*cdf0e10cSrcweir { 1160*cdf0e10cSrcweir 1161*cdf0e10cSrcweir public: 1162*cdf0e10cSrcweir XMLTextRotationAnglePropHdl_Impl() {} 1163*cdf0e10cSrcweir virtual ~XMLTextRotationAnglePropHdl_Impl(); 1164*cdf0e10cSrcweir 1165*cdf0e10cSrcweir virtual sal_Bool importXML( 1166*cdf0e10cSrcweir const ::rtl::OUString& rStrImpValue, 1167*cdf0e10cSrcweir ::com::sun::star::uno::Any& rValue, 1168*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 1169*cdf0e10cSrcweir virtual sal_Bool exportXML( 1170*cdf0e10cSrcweir ::rtl::OUString& rStrExpValue, 1171*cdf0e10cSrcweir const ::com::sun::star::uno::Any& rValue, 1172*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 1173*cdf0e10cSrcweir }; 1174*cdf0e10cSrcweir 1175*cdf0e10cSrcweir sal_Bool XMLTextRotationAnglePropHdl_Impl::importXML( 1176*cdf0e10cSrcweir const OUString& rStrImpValue, 1177*cdf0e10cSrcweir Any& rValue, 1178*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 1179*cdf0e10cSrcweir { 1180*cdf0e10cSrcweir sal_Int32 nValue; 1181*cdf0e10cSrcweir sal_Bool bRet = SvXMLUnitConverter::convertNumber( nValue, rStrImpValue ); 1182*cdf0e10cSrcweir if( bRet ) 1183*cdf0e10cSrcweir { 1184*cdf0e10cSrcweir nValue = (nValue % 360 ); 1185*cdf0e10cSrcweir if( nValue < 0 ) 1186*cdf0e10cSrcweir nValue = 360 + nValue; 1187*cdf0e10cSrcweir sal_Int16 nAngle; 1188*cdf0e10cSrcweir if( nValue < 45 || nValue > 315 ) 1189*cdf0e10cSrcweir nAngle = 0; 1190*cdf0e10cSrcweir else if( nValue < 180 ) 1191*cdf0e10cSrcweir nAngle = 900; 1192*cdf0e10cSrcweir else /* if nValalue <= 315 ) */ 1193*cdf0e10cSrcweir nAngle = 2700; 1194*cdf0e10cSrcweir rValue <<= nAngle; 1195*cdf0e10cSrcweir } 1196*cdf0e10cSrcweir 1197*cdf0e10cSrcweir return bRet; 1198*cdf0e10cSrcweir } 1199*cdf0e10cSrcweir 1200*cdf0e10cSrcweir sal_Bool XMLTextRotationAnglePropHdl_Impl::exportXML( 1201*cdf0e10cSrcweir OUString& rStrExpValue, 1202*cdf0e10cSrcweir const Any& rValue, 1203*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 1204*cdf0e10cSrcweir { 1205*cdf0e10cSrcweir sal_Int16 nAngle = sal_Int16(); 1206*cdf0e10cSrcweir sal_Bool bRet = ( rValue >>= nAngle ); 1207*cdf0e10cSrcweir if( bRet ) 1208*cdf0e10cSrcweir { 1209*cdf0e10cSrcweir OUStringBuffer aOut; 1210*cdf0e10cSrcweir SvXMLUnitConverter::convertNumber( aOut, nAngle / 10 ); 1211*cdf0e10cSrcweir rStrExpValue = aOut.makeStringAndClear(); 1212*cdf0e10cSrcweir } 1213*cdf0e10cSrcweir OSL_ENSURE( bRet, "illegal rotation angle" ); 1214*cdf0e10cSrcweir 1215*cdf0e10cSrcweir return bRet; 1216*cdf0e10cSrcweir } 1217*cdf0e10cSrcweir 1218*cdf0e10cSrcweir XMLTextRotationAnglePropHdl_Impl::~XMLTextRotationAnglePropHdl_Impl() 1219*cdf0e10cSrcweir { 1220*cdf0e10cSrcweir } 1221*cdf0e10cSrcweir // --------------------------------------------------------------------------- 1222*cdf0e10cSrcweir class XMLNumber8OneBasedHdl : public XMLPropertyHandler 1223*cdf0e10cSrcweir { 1224*cdf0e10cSrcweir 1225*cdf0e10cSrcweir public: 1226*cdf0e10cSrcweir XMLNumber8OneBasedHdl() {} 1227*cdf0e10cSrcweir virtual ~XMLNumber8OneBasedHdl() {}; 1228*cdf0e10cSrcweir 1229*cdf0e10cSrcweir virtual sal_Bool importXML( 1230*cdf0e10cSrcweir const ::rtl::OUString& rStrImpValue, 1231*cdf0e10cSrcweir ::com::sun::star::uno::Any& rValue, 1232*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 1233*cdf0e10cSrcweir virtual sal_Bool exportXML( 1234*cdf0e10cSrcweir ::rtl::OUString& rStrExpValue, 1235*cdf0e10cSrcweir const ::com::sun::star::uno::Any& rValue, 1236*cdf0e10cSrcweir const SvXMLUnitConverter& ) const; 1237*cdf0e10cSrcweir }; 1238*cdf0e10cSrcweir 1239*cdf0e10cSrcweir sal_Bool XMLNumber8OneBasedHdl::importXML( 1240*cdf0e10cSrcweir const OUString& rStrImpValue, 1241*cdf0e10cSrcweir Any& rValue, 1242*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 1243*cdf0e10cSrcweir { 1244*cdf0e10cSrcweir sal_Int32 nValue = 0; 1245*cdf0e10cSrcweir sal_Bool bRet = SvXMLUnitConverter::convertNumber( nValue, rStrImpValue ); 1246*cdf0e10cSrcweir if( bRet ) 1247*cdf0e10cSrcweir rValue <<= static_cast<sal_Int8>( nValue - 1 ); 1248*cdf0e10cSrcweir return bRet; 1249*cdf0e10cSrcweir } 1250*cdf0e10cSrcweir 1251*cdf0e10cSrcweir sal_Bool XMLNumber8OneBasedHdl::exportXML( 1252*cdf0e10cSrcweir OUString& rStrExpValue, 1253*cdf0e10cSrcweir const Any& rValue, 1254*cdf0e10cSrcweir const SvXMLUnitConverter& ) const 1255*cdf0e10cSrcweir { 1256*cdf0e10cSrcweir sal_Int8 nValue = sal_Int8(); 1257*cdf0e10cSrcweir sal_Bool bRet = ( rValue >>= nValue ); 1258*cdf0e10cSrcweir if( bRet ) 1259*cdf0e10cSrcweir { 1260*cdf0e10cSrcweir OUStringBuffer aOut; 1261*cdf0e10cSrcweir SvXMLUnitConverter::convertNumber( aOut, nValue + 1 ); 1262*cdf0e10cSrcweir rStrExpValue = aOut.makeStringAndClear(); 1263*cdf0e10cSrcweir } 1264*cdf0e10cSrcweir return bRet; 1265*cdf0e10cSrcweir } 1266*cdf0e10cSrcweir // --------------------------------------------------------------------------- 1267*cdf0e10cSrcweir class XMLTextPropertyHandlerFactory_Impl 1268*cdf0e10cSrcweir { 1269*cdf0e10cSrcweir public: 1270*cdf0e10cSrcweir const XMLPropertyHandler *GetPropertyHandler( sal_Int32 nType ) const; 1271*cdf0e10cSrcweir 1272*cdf0e10cSrcweir XMLTextPropertyHandlerFactory_Impl(); 1273*cdf0e10cSrcweir ~XMLTextPropertyHandlerFactory_Impl(); 1274*cdf0e10cSrcweir }; 1275*cdf0e10cSrcweir 1276*cdf0e10cSrcweir const XMLPropertyHandler *XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler 1277*cdf0e10cSrcweir ( sal_Int32 nType ) const 1278*cdf0e10cSrcweir { 1279*cdf0e10cSrcweir const XMLPropertyHandler* pHdl = 0; 1280*cdf0e10cSrcweir switch( nType ) 1281*cdf0e10cSrcweir { 1282*cdf0e10cSrcweir case XML_TYPE_TEXT_DROPCAP: 1283*cdf0e10cSrcweir pHdl = new XMLDropCapPropHdl_Impl; 1284*cdf0e10cSrcweir break; 1285*cdf0e10cSrcweir case XML_TYPE_TEXT_WRAP: 1286*cdf0e10cSrcweir pHdl = new XMLWrapPropHdl_Impl; 1287*cdf0e10cSrcweir break; 1288*cdf0e10cSrcweir case XML_TYPE_TEXT_PARAGRAPH_ONLY: 1289*cdf0e10cSrcweir pHdl = new XMLParagraphOnlyPropHdl_Impl; 1290*cdf0e10cSrcweir break; 1291*cdf0e10cSrcweir case XML_TYPE_TEXT_WRAP_OUTSIDE: 1292*cdf0e10cSrcweir pHdl = new XMLContourModePropHdl_Impl; 1293*cdf0e10cSrcweir break; 1294*cdf0e10cSrcweir case XML_TYPE_TEXT_OPAQUE: 1295*cdf0e10cSrcweir pHdl = new XMLOpaquePropHdl_Impl; 1296*cdf0e10cSrcweir break; 1297*cdf0e10cSrcweir case XML_TYPE_TEXT_PROTECT_CONTENT: 1298*cdf0e10cSrcweir pHdl = new XMLFrameProtectPropHdl_Impl( XML_CONTENT ); 1299*cdf0e10cSrcweir break; 1300*cdf0e10cSrcweir case XML_TYPE_TEXT_PROTECT_SIZE: 1301*cdf0e10cSrcweir pHdl = new XMLFrameProtectPropHdl_Impl( XML_SIZE ); 1302*cdf0e10cSrcweir break; 1303*cdf0e10cSrcweir case XML_TYPE_TEXT_PROTECT_POSITION: 1304*cdf0e10cSrcweir pHdl = new XMLFrameProtectPropHdl_Impl( XML_POSITION ); 1305*cdf0e10cSrcweir break; 1306*cdf0e10cSrcweir case XML_TYPE_TEXT_ANCHOR_TYPE: 1307*cdf0e10cSrcweir pHdl = new XMLAnchorTypePropHdl; 1308*cdf0e10cSrcweir break; 1309*cdf0e10cSrcweir case XML_TYPE_TEXT_COLUMNS: 1310*cdf0e10cSrcweir pHdl = new XMLTextColumnsPropertyHandler; 1311*cdf0e10cSrcweir break; 1312*cdf0e10cSrcweir case XML_TYPE_TEXT_HORIZONTAL_POS: 1313*cdf0e10cSrcweir pHdl = new XMLConstantsPropertyHandler( pXML_HoriPos_Enum, XML_TOKEN_INVALID ); 1314*cdf0e10cSrcweir break; 1315*cdf0e10cSrcweir case XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED: 1316*cdf0e10cSrcweir pHdl = new XMLConstantsPropertyHandler( pXML_HoriPosMirrored_Enum, XML_TOKEN_INVALID ); 1317*cdf0e10cSrcweir break; 1318*cdf0e10cSrcweir case XML_TYPE_TEXT_HORIZONTAL_REL: 1319*cdf0e10cSrcweir pHdl = new XMLConstantsPropertyHandler( pXML_HoriRel_Enum, XML_TOKEN_INVALID ); 1320*cdf0e10cSrcweir break; 1321*cdf0e10cSrcweir case XML_TYPE_TEXT_HORIZONTAL_REL_FRAME: 1322*cdf0e10cSrcweir pHdl = new XMLConstantsPropertyHandler( pXML_HoriRelFrame_Enum, XML_TOKEN_INVALID ); 1323*cdf0e10cSrcweir break; 1324*cdf0e10cSrcweir case XML_TYPE_TEXT_HORIZONTAL_MIRROR: 1325*cdf0e10cSrcweir pHdl = new XMLHoriMirrorPropHdl_Impl; 1326*cdf0e10cSrcweir break; 1327*cdf0e10cSrcweir case XML_TYPE_TEXT_VERTICAL_POS: 1328*cdf0e10cSrcweir pHdl = new XMLConstantsPropertyHandler( pXML_VertPos_Enum, XML_TOKEN_INVALID ); 1329*cdf0e10cSrcweir break; 1330*cdf0e10cSrcweir case XML_TYPE_TEXT_VERTICAL_POS_AT_CHAR: 1331*cdf0e10cSrcweir pHdl = new XMLConstantsPropertyHandler( pXML_VertPosAtChar_Enum, XML_TOKEN_INVALID ); 1332*cdf0e10cSrcweir break; 1333*cdf0e10cSrcweir case XML_TYPE_TEXT_VERTICAL_REL: 1334*cdf0e10cSrcweir pHdl = new XMLConstantsPropertyHandler( pXML_VertRel_Enum, XML_TOKEN_INVALID ); 1335*cdf0e10cSrcweir break; 1336*cdf0e10cSrcweir case XML_TYPE_TEXT_VERTICAL_REL_PAGE: 1337*cdf0e10cSrcweir pHdl = new XMLConstantsPropertyHandler( pXML_VertRelPage_Enum, XML_TOKEN_INVALID ); 1338*cdf0e10cSrcweir break; 1339*cdf0e10cSrcweir case XML_TYPE_TEXT_VERTICAL_REL_FRAME: 1340*cdf0e10cSrcweir pHdl = new XMLConstantsPropertyHandler( pXML_VertRelFrame_Enum, XML_TOKEN_INVALID ); 1341*cdf0e10cSrcweir break; 1342*cdf0e10cSrcweir case XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR: 1343*cdf0e10cSrcweir pHdl = new XMLConstantsPropertyHandler( pXML_VertRelAsChar_Enum, XML_TOKEN_INVALID ); 1344*cdf0e10cSrcweir break; 1345*cdf0e10cSrcweir case XML_TYPE_TEXT_MIRROR_VERTICAL: 1346*cdf0e10cSrcweir pHdl = new XMLGrfMirrorPropHdl_Impl( XML_VERTICAL, sal_False ); 1347*cdf0e10cSrcweir break; 1348*cdf0e10cSrcweir case XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT: 1349*cdf0e10cSrcweir // --> OD 2005-05-12 #i49139# 1350*cdf0e10cSrcweir // XML_HORIZONTAL_ON_LEFT_PAGES is replaced by XML_HORIZONTAL_ON_EVEN. 1351*cdf0e10cSrcweir pHdl = new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_EVEN, sal_True ); 1352*cdf0e10cSrcweir // <-- 1353*cdf0e10cSrcweir break; 1354*cdf0e10cSrcweir case XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT: 1355*cdf0e10cSrcweir // --> OD 2005-05-12 #i49139# 1356*cdf0e10cSrcweir // XML_HORIZONTAL_ON_RIGHT_PAGES is replaced by XML_HORIZONTAL_ON_ODD. 1357*cdf0e10cSrcweir pHdl = new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_ODD, sal_True ); 1358*cdf0e10cSrcweir // <-- 1359*cdf0e10cSrcweir break; 1360*cdf0e10cSrcweir case XML_TYPE_TEXT_CLIP: 1361*cdf0e10cSrcweir pHdl = new XMLClipPropertyHandler( sal_False ); 1362*cdf0e10cSrcweir break; 1363*cdf0e10cSrcweir case XML_TYPE_TEXT_CLIP11: 1364*cdf0e10cSrcweir pHdl = new XMLClipPropertyHandler( sal_True ); 1365*cdf0e10cSrcweir break; 1366*cdf0e10cSrcweir case XML_TYPE_TEXT_EMPHASIZE: 1367*cdf0e10cSrcweir pHdl = new XMLTextEmphasizePropHdl_Impl; 1368*cdf0e10cSrcweir break; 1369*cdf0e10cSrcweir case XML_TYPE_TEXT_COMBINE: 1370*cdf0e10cSrcweir pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LINES ), 1371*cdf0e10cSrcweir GetXMLToken( XML_NONE ) ); 1372*cdf0e10cSrcweir break; 1373*cdf0e10cSrcweir case XML_TYPE_TEXT_COMBINE_CHARACTERS: 1374*cdf0e10cSrcweir pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LETTERS ), 1375*cdf0e10cSrcweir GetXMLToken( XML_NONE ) ); 1376*cdf0e10cSrcweir break; 1377*cdf0e10cSrcweir case XML_TYPE_TEXT_COMBINECHAR: 1378*cdf0e10cSrcweir pHdl = new XMLTextCombineCharPropHdl_Impl; 1379*cdf0e10cSrcweir break; 1380*cdf0e10cSrcweir case XML_TYPE_TEXT_AUTOSPACE: 1381*cdf0e10cSrcweir pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_IDEOGRAPH_ALPHA ), 1382*cdf0e10cSrcweir GetXMLToken( XML_NONE ) ); 1383*cdf0e10cSrcweir break; 1384*cdf0e10cSrcweir case XML_TYPE_TEXT_PUNCTUATION_WRAP: 1385*cdf0e10cSrcweir pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_HANGING ), 1386*cdf0e10cSrcweir GetXMLToken( XML_SIMPLE ) ); 1387*cdf0e10cSrcweir break; 1388*cdf0e10cSrcweir case XML_TYPE_TEXT_LINE_BREAK: 1389*cdf0e10cSrcweir pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_STRICT ), 1390*cdf0e10cSrcweir GetXMLToken( XML_NORMAL ) ); 1391*cdf0e10cSrcweir break; 1392*cdf0e10cSrcweir case XML_TYPE_TEXT_REL_WIDTH_HEIGHT: 1393*cdf0e10cSrcweir pHdl = new XMLTextRelWidthHeightPropHdl_Impl; 1394*cdf0e10cSrcweir break; 1395*cdf0e10cSrcweir case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT: 1396*cdf0e10cSrcweir pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE ); 1397*cdf0e10cSrcweir break; 1398*cdf0e10cSrcweir case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN: 1399*cdf0e10cSrcweir pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE_MIN ); 1400*cdf0e10cSrcweir break; 1401*cdf0e10cSrcweir case XML_TYPE_TEXT_RUBY_ADJUST: 1402*cdf0e10cSrcweir pHdl = new XMLConstantsPropertyHandler( pXML_RubyAdjust_Enum, XML_TOKEN_INVALID ); 1403*cdf0e10cSrcweir break; 1404*cdf0e10cSrcweir case XML_TYPE_TEXT_FONT_RELIEF: 1405*cdf0e10cSrcweir pHdl = new XMLConstantsPropertyHandler( pXML_FontRelief_Enum, XML_TOKEN_INVALID ); 1406*cdf0e10cSrcweir break; 1407*cdf0e10cSrcweir case XML_TYPE_TEXT_ROTATION_ANGLE: 1408*cdf0e10cSrcweir pHdl = new XMLTextRotationAnglePropHdl_Impl; 1409*cdf0e10cSrcweir break; 1410*cdf0e10cSrcweir case XML_TYPE_TEXT_ROTATION_SCALE: 1411*cdf0e10cSrcweir pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_FIXED ), 1412*cdf0e10cSrcweir GetXMLToken( XML_LINE_HEIGHT ) ); 1413*cdf0e10cSrcweir break; 1414*cdf0e10cSrcweir case XML_TYPE_TEXT_VERTICAL_ALIGN: 1415*cdf0e10cSrcweir pHdl = new XMLConstantsPropertyHandler( pXML_VerticalAlign_Enum, XML_TOKEN_INVALID ); 1416*cdf0e10cSrcweir break; 1417*cdf0e10cSrcweir case XML_TYPE_TEXT_RUBY_POSITION: 1418*cdf0e10cSrcweir pHdl = new XMLNamedBoolPropertyHdl( ::xmloff::token::XML_ABOVE, 1419*cdf0e10cSrcweir ::xmloff::token::XML_BELOW ); 1420*cdf0e10cSrcweir break; 1421*cdf0e10cSrcweir // OD 2004-05-05 #i28701# 1422*cdf0e10cSrcweir case XML_TYPE_WRAP_INFLUENCE_ON_POSITION: 1423*cdf0e10cSrcweir pHdl = new XMLConstantsPropertyHandler( pXML_WrapInfluenceOnPosition_Enum, 1424*cdf0e10cSrcweir XML_TOKEN_INVALID ); 1425*cdf0e10cSrcweir break; 1426*cdf0e10cSrcweir case XML_TYPE_BORDER_MODEL: 1427*cdf0e10cSrcweir pHdl = new XMLNamedBoolPropertyHdl( xmloff::token::XML_COLLAPSING, 1428*cdf0e10cSrcweir xmloff::token::XML_SEPARATING ); 1429*cdf0e10cSrcweir break; 1430*cdf0e10cSrcweir case XML_TYPE_TEXT_LINE_MODE: 1431*cdf0e10cSrcweir pHdl = new XMLNamedBoolPropertyHdl( 1432*cdf0e10cSrcweir ::xmloff::token::XML_SKIP_WHITE_SPACE, 1433*cdf0e10cSrcweir ::xmloff::token::XML_CONTINUOUS); 1434*cdf0e10cSrcweir break; 1435*cdf0e10cSrcweir case XML_TYPE_TEXT_KEEP: 1436*cdf0e10cSrcweir pHdl = new XMLNamedBoolPropertyHdl( 1437*cdf0e10cSrcweir ::xmloff::token::XML_ALWAYS, 1438*cdf0e10cSrcweir ::xmloff::token::XML_AUTO); 1439*cdf0e10cSrcweir break; 1440*cdf0e10cSrcweir case XML_TYPE_TEXT_NKEEP: 1441*cdf0e10cSrcweir pHdl = new XMLNamedBoolPropertyHdl( 1442*cdf0e10cSrcweir ::xmloff::token::XML_AUTO, 1443*cdf0e10cSrcweir ::xmloff::token::XML_ALWAYS); 1444*cdf0e10cSrcweir break; 1445*cdf0e10cSrcweir case XML_TYPE_TEXT_NUMBER8_ONE_BASED: 1446*cdf0e10cSrcweir pHdl = new XMLNumber8OneBasedHdl(); 1447*cdf0e10cSrcweir break; 1448*cdf0e10cSrcweir } 1449*cdf0e10cSrcweir 1450*cdf0e10cSrcweir return pHdl; 1451*cdf0e10cSrcweir } 1452*cdf0e10cSrcweir 1453*cdf0e10cSrcweir XMLTextPropertyHandlerFactory_Impl::XMLTextPropertyHandlerFactory_Impl() 1454*cdf0e10cSrcweir { 1455*cdf0e10cSrcweir } 1456*cdf0e10cSrcweir 1457*cdf0e10cSrcweir XMLTextPropertyHandlerFactory_Impl::~XMLTextPropertyHandlerFactory_Impl() 1458*cdf0e10cSrcweir { 1459*cdf0e10cSrcweir } 1460*cdf0e10cSrcweir 1461*cdf0e10cSrcweir // ---------------------------------------------------------------------------- 1462*cdf0e10cSrcweir 1463*cdf0e10cSrcweir XMLTextPropertyHandlerFactory::XMLTextPropertyHandlerFactory() : 1464*cdf0e10cSrcweir XMLPropertyHandlerFactory(), 1465*cdf0e10cSrcweir pImpl( new XMLTextPropertyHandlerFactory_Impl ) 1466*cdf0e10cSrcweir { 1467*cdf0e10cSrcweir } 1468*cdf0e10cSrcweir 1469*cdf0e10cSrcweir XMLTextPropertyHandlerFactory::~XMLTextPropertyHandlerFactory() 1470*cdf0e10cSrcweir { 1471*cdf0e10cSrcweir delete pImpl; 1472*cdf0e10cSrcweir } 1473*cdf0e10cSrcweir 1474*cdf0e10cSrcweir const XMLPropertyHandler *XMLTextPropertyHandlerFactory::GetPropertyHandler( 1475*cdf0e10cSrcweir sal_Int32 nType ) const 1476*cdf0e10cSrcweir { 1477*cdf0e10cSrcweir const XMLPropertyHandler *pHdl = 1478*cdf0e10cSrcweir XMLPropertyHandlerFactory::GetPropertyHandler( nType ); 1479*cdf0e10cSrcweir 1480*cdf0e10cSrcweir if( !pHdl ) 1481*cdf0e10cSrcweir { 1482*cdf0e10cSrcweir const XMLPropertyHandler *pNewHdl = pImpl->GetPropertyHandler( nType ); 1483*cdf0e10cSrcweir 1484*cdf0e10cSrcweir if( pNewHdl ) 1485*cdf0e10cSrcweir PutHdlCache( nType, pNewHdl ); 1486*cdf0e10cSrcweir 1487*cdf0e10cSrcweir pHdl = pNewHdl; 1488*cdf0e10cSrcweir } 1489*cdf0e10cSrcweir 1490*cdf0e10cSrcweir return pHdl; 1491*cdf0e10cSrcweir } 1492*cdf0e10cSrcweir 1493*cdf0e10cSrcweir 1494