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_sw.hxx" 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir #include <hintids.hxx> 33*cdf0e10cSrcweir #include <sot/clsids.hxx> 34*cdf0e10cSrcweir #include <tools/stream.hxx> 35*cdf0e10cSrcweir #include <vcl/svapp.hxx> 36*cdf0e10cSrcweir #include <svl/mailenum.hxx> 37*cdf0e10cSrcweir #ifndef _SVX_SVXIDS_HRC //autogen 38*cdf0e10cSrcweir #include <svx/svxids.hrc> 39*cdf0e10cSrcweir #endif 40*cdf0e10cSrcweir #include <editeng/svxenum.hxx> 41*cdf0e10cSrcweir #include <tools/debug.hxx> 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir #include <tools/globname.hxx> 44*cdf0e10cSrcweir #include <swtypes.hxx> 45*cdf0e10cSrcweir #include <itabenum.hxx> 46*cdf0e10cSrcweir #ifndef _MODCFG_HXX 47*cdf0e10cSrcweir #include <modcfg.hxx> 48*cdf0e10cSrcweir #endif 49*cdf0e10cSrcweir #include <fldupde.hxx> 50*cdf0e10cSrcweir #include <unotools/syslocaleoptions.hxx> 51*cdf0e10cSrcweir #include <caption.hxx> 52*cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx> 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir #include <unomid.h> 55*cdf0e10cSrcweir 56*cdf0e10cSrcweir using namespace utl; 57*cdf0e10cSrcweir using rtl::OUString; 58*cdf0e10cSrcweir using namespace com::sun::star::uno; 59*cdf0e10cSrcweir 60*cdf0e10cSrcweir #define GLOB_NAME_CALC 0 61*cdf0e10cSrcweir #define GLOB_NAME_IMPRESS 1 62*cdf0e10cSrcweir #define GLOB_NAME_DRAW 2 63*cdf0e10cSrcweir #define GLOB_NAME_MATH 3 64*cdf0e10cSrcweir #define GLOB_NAME_CHART 4 65*cdf0e10cSrcweir 66*cdf0e10cSrcweir SV_IMPL_PTRARR_SORT(InsCapOptArr, InsCaptionOptPtr) 67*cdf0e10cSrcweir /* -----------------03.11.98 13:46------------------- 68*cdf0e10cSrcweir * 69*cdf0e10cSrcweir * --------------------------------------------------*/ 70*cdf0e10cSrcweir InsCaptionOpt* InsCaptionOptArr::Find(const SwCapObjType eType, const SvGlobalName *pOleId) const 71*cdf0e10cSrcweir { 72*cdf0e10cSrcweir for (sal_uInt16 i = 0; i < Count(); i++ ) 73*cdf0e10cSrcweir { 74*cdf0e10cSrcweir InsCaptionOpt* pObj = GetObject(i); 75*cdf0e10cSrcweir if (pObj->GetObjType() == eType && 76*cdf0e10cSrcweir (eType != OLE_CAP || 77*cdf0e10cSrcweir (pOleId && 78*cdf0e10cSrcweir pObj->GetOleId() == *pOleId))) 79*cdf0e10cSrcweir return pObj; 80*cdf0e10cSrcweir } 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir return 0; 83*cdf0e10cSrcweir } 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir /* -----------------03.11.98 15:05------------------- 86*cdf0e10cSrcweir * 87*cdf0e10cSrcweir * --------------------------------------------------*/ 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir const InsCaptionOpt* SwModuleOptions::GetCapOption( 90*cdf0e10cSrcweir sal_Bool bHTML, const SwCapObjType eType, const SvGlobalName *pOleId) 91*cdf0e10cSrcweir { 92*cdf0e10cSrcweir if(bHTML) 93*cdf0e10cSrcweir { 94*cdf0e10cSrcweir DBG_ERROR("no caption option in sw/web!"); 95*cdf0e10cSrcweir return 0; 96*cdf0e10cSrcweir } 97*cdf0e10cSrcweir else 98*cdf0e10cSrcweir { 99*cdf0e10cSrcweir sal_Bool bFound = sal_False; 100*cdf0e10cSrcweir if(eType == OLE_CAP && pOleId) 101*cdf0e10cSrcweir { 102*cdf0e10cSrcweir for( sal_uInt16 nId = 0; nId <= GLOB_NAME_CHART && !bFound; nId++) 103*cdf0e10cSrcweir bFound = *pOleId == aInsertConfig.aGlobalNames[nId ]; 104*cdf0e10cSrcweir if(!bFound) 105*cdf0e10cSrcweir return aInsertConfig.pOLEMiscOpt; 106*cdf0e10cSrcweir } 107*cdf0e10cSrcweir return aInsertConfig.pCapOptions->Find(eType, pOleId); 108*cdf0e10cSrcweir } 109*cdf0e10cSrcweir } 110*cdf0e10cSrcweir 111*cdf0e10cSrcweir /* -----------------03.11.98 15:05------------------- 112*cdf0e10cSrcweir * 113*cdf0e10cSrcweir * --------------------------------------------------*/ 114*cdf0e10cSrcweir 115*cdf0e10cSrcweir sal_Bool SwModuleOptions::SetCapOption(sal_Bool bHTML, const InsCaptionOpt* pOpt) 116*cdf0e10cSrcweir { 117*cdf0e10cSrcweir sal_Bool bRet = sal_False; 118*cdf0e10cSrcweir 119*cdf0e10cSrcweir if(bHTML) 120*cdf0e10cSrcweir { 121*cdf0e10cSrcweir DBG_ERROR("no caption option in sw/web!"); 122*cdf0e10cSrcweir } 123*cdf0e10cSrcweir else if (pOpt) 124*cdf0e10cSrcweir { 125*cdf0e10cSrcweir sal_Bool bFound = sal_False; 126*cdf0e10cSrcweir if(pOpt->GetObjType() == OLE_CAP && &pOpt->GetOleId()) 127*cdf0e10cSrcweir { 128*cdf0e10cSrcweir for( sal_uInt16 nId = 0; nId <= GLOB_NAME_CHART; nId++) 129*cdf0e10cSrcweir bFound = pOpt->GetOleId() == aInsertConfig.aGlobalNames[nId ]; 130*cdf0e10cSrcweir if(!bFound) 131*cdf0e10cSrcweir { 132*cdf0e10cSrcweir if(aInsertConfig.pOLEMiscOpt) 133*cdf0e10cSrcweir *aInsertConfig.pOLEMiscOpt = *pOpt; 134*cdf0e10cSrcweir else 135*cdf0e10cSrcweir aInsertConfig.pOLEMiscOpt = new InsCaptionOpt(*pOpt); 136*cdf0e10cSrcweir } 137*cdf0e10cSrcweir } 138*cdf0e10cSrcweir 139*cdf0e10cSrcweir InsCaptionOptArr& rArr = *aInsertConfig.pCapOptions; 140*cdf0e10cSrcweir InsCaptionOpt *pObj = rArr.Find(pOpt->GetObjType(), &pOpt->GetOleId()); 141*cdf0e10cSrcweir 142*cdf0e10cSrcweir if (pObj) 143*cdf0e10cSrcweir { 144*cdf0e10cSrcweir *pObj = *pOpt; 145*cdf0e10cSrcweir } 146*cdf0e10cSrcweir else 147*cdf0e10cSrcweir rArr.Insert(new InsCaptionOpt(*pOpt)); 148*cdf0e10cSrcweir 149*cdf0e10cSrcweir aInsertConfig.SetModified(); 150*cdf0e10cSrcweir bRet = sal_True; 151*cdf0e10cSrcweir } 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir return bRet; 154*cdf0e10cSrcweir } 155*cdf0e10cSrcweir /*-----------------13.01.97 12.44------------------- 156*cdf0e10cSrcweir 157*cdf0e10cSrcweir --------------------------------------------------*/ 158*cdf0e10cSrcweir SwModuleOptions::SwModuleOptions() : 159*cdf0e10cSrcweir aInsertConfig(sal_False), 160*cdf0e10cSrcweir aWebInsertConfig(sal_True), 161*cdf0e10cSrcweir aTableConfig(sal_False), 162*cdf0e10cSrcweir aWebTableConfig(sal_True), 163*cdf0e10cSrcweir bHideFieldTips(sal_False) 164*cdf0e10cSrcweir { 165*cdf0e10cSrcweir } 166*cdf0e10cSrcweir /* -----------------------------19.01.01 12:26-------------------------------- 167*cdf0e10cSrcweir 168*cdf0e10cSrcweir ---------------------------------------------------------------------------*/ 169*cdf0e10cSrcweir String SwModuleOptions::ConvertWordDelimiter(const String& rDelim, sal_Bool bFromUI) 170*cdf0e10cSrcweir { 171*cdf0e10cSrcweir String sReturn; 172*cdf0e10cSrcweir if(bFromUI) 173*cdf0e10cSrcweir { 174*cdf0e10cSrcweir String sChar; 175*cdf0e10cSrcweir 176*cdf0e10cSrcweir xub_StrLen i = 0; 177*cdf0e10cSrcweir sal_Unicode c; 178*cdf0e10cSrcweir 179*cdf0e10cSrcweir while (i < rDelim.Len()) 180*cdf0e10cSrcweir { 181*cdf0e10cSrcweir c = rDelim.GetChar(i++); 182*cdf0e10cSrcweir 183*cdf0e10cSrcweir if (c == '\\') 184*cdf0e10cSrcweir { 185*cdf0e10cSrcweir c = rDelim.GetChar(i++); 186*cdf0e10cSrcweir 187*cdf0e10cSrcweir switch (c) 188*cdf0e10cSrcweir { 189*cdf0e10cSrcweir case 'n': sReturn += '\n'; break; 190*cdf0e10cSrcweir case 't': sReturn += '\t'; break; 191*cdf0e10cSrcweir case '\\': sReturn += '\\'; break; 192*cdf0e10cSrcweir 193*cdf0e10cSrcweir case 'x': 194*cdf0e10cSrcweir { 195*cdf0e10cSrcweir sal_Unicode nVal, nChar; 196*cdf0e10cSrcweir sal_Bool bValidData = sal_True; 197*cdf0e10cSrcweir xub_StrLen n; 198*cdf0e10cSrcweir for( n = 0, nChar = 0; n < 2 && i < rDelim.Len(); ++n, ++i ) 199*cdf0e10cSrcweir { 200*cdf0e10cSrcweir if( ((nVal = rDelim.GetChar( i )) >= '0') && ( nVal <= '9') ) 201*cdf0e10cSrcweir nVal -= '0'; 202*cdf0e10cSrcweir else if( (nVal >= 'A') && (nVal <= 'F') ) 203*cdf0e10cSrcweir nVal -= 'A' - 10; 204*cdf0e10cSrcweir else if( (nVal >= 'a') && (nVal <= 'f') ) 205*cdf0e10cSrcweir nVal -= 'a' - 10; 206*cdf0e10cSrcweir else 207*cdf0e10cSrcweir { 208*cdf0e10cSrcweir DBG_ERROR( "ungueltiger Hex-Wert" ); 209*cdf0e10cSrcweir bValidData = sal_False; 210*cdf0e10cSrcweir break; 211*cdf0e10cSrcweir } 212*cdf0e10cSrcweir 213*cdf0e10cSrcweir (nChar <<= 4 ); 214*cdf0e10cSrcweir nChar = nChar + nVal; 215*cdf0e10cSrcweir } 216*cdf0e10cSrcweir if( bValidData ) 217*cdf0e10cSrcweir sReturn += nChar; 218*cdf0e10cSrcweir break; 219*cdf0e10cSrcweir } 220*cdf0e10cSrcweir 221*cdf0e10cSrcweir default: // Unbekannt, daher nur Backslash einfuegen 222*cdf0e10cSrcweir sReturn += '\\'; 223*cdf0e10cSrcweir i--; 224*cdf0e10cSrcweir break; 225*cdf0e10cSrcweir } 226*cdf0e10cSrcweir } 227*cdf0e10cSrcweir else 228*cdf0e10cSrcweir sReturn += c; 229*cdf0e10cSrcweir } 230*cdf0e10cSrcweir } 231*cdf0e10cSrcweir else 232*cdf0e10cSrcweir { 233*cdf0e10cSrcweir for (xub_StrLen i = 0; i < rDelim.Len(); i++) 234*cdf0e10cSrcweir { 235*cdf0e10cSrcweir sal_Unicode c = rDelim.GetChar(i); 236*cdf0e10cSrcweir 237*cdf0e10cSrcweir switch (c) 238*cdf0e10cSrcweir { 239*cdf0e10cSrcweir case '\n': sReturn.AppendAscii(RTL_CONSTASCII_STRINGPARAM("\\n")); break; 240*cdf0e10cSrcweir case '\t': sReturn.AppendAscii(RTL_CONSTASCII_STRINGPARAM("\\t")); break; 241*cdf0e10cSrcweir case '\\': sReturn.AppendAscii(RTL_CONSTASCII_STRINGPARAM("\\\\")); break; 242*cdf0e10cSrcweir 243*cdf0e10cSrcweir default: 244*cdf0e10cSrcweir if( c <= 0x1f || c >= 0x7f ) 245*cdf0e10cSrcweir { 246*cdf0e10cSrcweir sReturn.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "\\x" )) 247*cdf0e10cSrcweir += String::CreateFromInt32( c, 16 ); 248*cdf0e10cSrcweir } 249*cdf0e10cSrcweir else 250*cdf0e10cSrcweir sReturn += c; 251*cdf0e10cSrcweir } 252*cdf0e10cSrcweir } 253*cdf0e10cSrcweir } 254*cdf0e10cSrcweir return sReturn; 255*cdf0e10cSrcweir } 256*cdf0e10cSrcweir /* -----------------------------10.10.00 16:22-------------------------------- 257*cdf0e10cSrcweir 258*cdf0e10cSrcweir ---------------------------------------------------------------------------*/ 259*cdf0e10cSrcweir const Sequence<OUString>& SwRevisionConfig::GetPropertyNames() 260*cdf0e10cSrcweir { 261*cdf0e10cSrcweir static Sequence<OUString> aNames; 262*cdf0e10cSrcweir if(!aNames.getLength()) 263*cdf0e10cSrcweir { 264*cdf0e10cSrcweir const int nCount = 8; 265*cdf0e10cSrcweir aNames.realloc(nCount); 266*cdf0e10cSrcweir static const char* aPropNames[] = 267*cdf0e10cSrcweir { 268*cdf0e10cSrcweir "TextDisplay/Insert/Attribute", // 0 269*cdf0e10cSrcweir "TextDisplay/Insert/Color", // 1 270*cdf0e10cSrcweir "TextDisplay/Delete/Attribute", // 2 271*cdf0e10cSrcweir "TextDisplay/Delete/Color", // 3 272*cdf0e10cSrcweir "TextDisplay/ChangedAttribute/Attribute", // 4 273*cdf0e10cSrcweir "TextDisplay/ChangedAttribute/Color", // 5 274*cdf0e10cSrcweir "LinesChanged/Mark", // 6 275*cdf0e10cSrcweir "LinesChanged/Color" // 7 276*cdf0e10cSrcweir }; 277*cdf0e10cSrcweir OUString* pNames = aNames.getArray(); 278*cdf0e10cSrcweir for(int i = 0; i < nCount; i++) 279*cdf0e10cSrcweir pNames[i] = OUString::createFromAscii(aPropNames[i]); 280*cdf0e10cSrcweir } 281*cdf0e10cSrcweir return aNames; 282*cdf0e10cSrcweir } 283*cdf0e10cSrcweir /*-- 10.10.00 16:22:22--------------------------------------------------- 284*cdf0e10cSrcweir 285*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 286*cdf0e10cSrcweir SwRevisionConfig::SwRevisionConfig() : 287*cdf0e10cSrcweir ConfigItem(C2U("Office.Writer/Revision"), 288*cdf0e10cSrcweir CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE) 289*cdf0e10cSrcweir { 290*cdf0e10cSrcweir aInsertAttr.nItemId = SID_ATTR_CHAR_UNDERLINE; 291*cdf0e10cSrcweir aInsertAttr.nAttr = UNDERLINE_SINGLE; 292*cdf0e10cSrcweir aInsertAttr.nColor = COL_TRANSPARENT; 293*cdf0e10cSrcweir aDeletedAttr.nItemId = SID_ATTR_CHAR_STRIKEOUT; 294*cdf0e10cSrcweir aDeletedAttr.nAttr = STRIKEOUT_SINGLE; 295*cdf0e10cSrcweir aDeletedAttr.nColor = COL_TRANSPARENT; 296*cdf0e10cSrcweir aFormatAttr.nItemId = SID_ATTR_CHAR_WEIGHT; 297*cdf0e10cSrcweir aFormatAttr.nAttr = WEIGHT_BOLD; 298*cdf0e10cSrcweir aFormatAttr.nColor = COL_BLACK; 299*cdf0e10cSrcweir 300*cdf0e10cSrcweir Load(); 301*cdf0e10cSrcweir } 302*cdf0e10cSrcweir /*-- 10.10.00 16:22:23--------------------------------------------------- 303*cdf0e10cSrcweir 304*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 305*cdf0e10cSrcweir SwRevisionConfig::~SwRevisionConfig() 306*cdf0e10cSrcweir { 307*cdf0e10cSrcweir } 308*cdf0e10cSrcweir /*-- 10.10.00 16:22:56--------------------------------------------------- 309*cdf0e10cSrcweir 310*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 311*cdf0e10cSrcweir sal_Int32 lcl_ConvertAttrToCfg(const AuthorCharAttr& rAttr) 312*cdf0e10cSrcweir { 313*cdf0e10cSrcweir sal_Int32 nRet = 0; 314*cdf0e10cSrcweir switch(rAttr.nItemId) 315*cdf0e10cSrcweir { 316*cdf0e10cSrcweir case SID_ATTR_CHAR_WEIGHT: nRet = 1; break; 317*cdf0e10cSrcweir case SID_ATTR_CHAR_POSTURE: nRet = 2; break; 318*cdf0e10cSrcweir case SID_ATTR_CHAR_UNDERLINE: nRet = UNDERLINE_SINGLE == rAttr.nAttr ? 3 : 4; break; 319*cdf0e10cSrcweir case SID_ATTR_CHAR_STRIKEOUT: nRet = 3; break; 320*cdf0e10cSrcweir case SID_ATTR_CHAR_CASEMAP: 321*cdf0e10cSrcweir { 322*cdf0e10cSrcweir switch(rAttr.nAttr) 323*cdf0e10cSrcweir { 324*cdf0e10cSrcweir case SVX_CASEMAP_VERSALIEN : nRet = 5;break; 325*cdf0e10cSrcweir case SVX_CASEMAP_GEMEINE : nRet = 6;break; 326*cdf0e10cSrcweir case SVX_CASEMAP_KAPITAELCHEN: nRet = 7;break; 327*cdf0e10cSrcweir case SVX_CASEMAP_TITEL : nRet = 8;break; 328*cdf0e10cSrcweir } 329*cdf0e10cSrcweir } 330*cdf0e10cSrcweir break; 331*cdf0e10cSrcweir case SID_ATTR_BRUSH : nRet = 9; break; 332*cdf0e10cSrcweir } 333*cdf0e10cSrcweir return nRet; 334*cdf0e10cSrcweir } 335*cdf0e10cSrcweir //----------------------------------------------------------------------------- 336*cdf0e10cSrcweir void SwRevisionConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} 337*cdf0e10cSrcweir 338*cdf0e10cSrcweir void SwRevisionConfig::Commit() 339*cdf0e10cSrcweir { 340*cdf0e10cSrcweir const Sequence<OUString>& aNames = GetPropertyNames(); 341*cdf0e10cSrcweir Sequence<Any> aValues(aNames.getLength()); 342*cdf0e10cSrcweir Any* pValues = aValues.getArray(); 343*cdf0e10cSrcweir 344*cdf0e10cSrcweir for(int nProp = 0; nProp < aNames.getLength(); nProp++) 345*cdf0e10cSrcweir { 346*cdf0e10cSrcweir sal_Int32 nVal = -1; 347*cdf0e10cSrcweir switch(nProp) 348*cdf0e10cSrcweir { 349*cdf0e10cSrcweir case 0 : nVal = lcl_ConvertAttrToCfg(aInsertAttr); break; 350*cdf0e10cSrcweir case 1 : nVal = aInsertAttr.nColor ; break; 351*cdf0e10cSrcweir case 2 : nVal = lcl_ConvertAttrToCfg(aDeletedAttr); break; 352*cdf0e10cSrcweir case 3 : nVal = aDeletedAttr.nColor ; break; 353*cdf0e10cSrcweir case 4 : nVal = lcl_ConvertAttrToCfg(aFormatAttr); break; 354*cdf0e10cSrcweir case 5 : nVal = aFormatAttr.nColor ; break; 355*cdf0e10cSrcweir case 6 : nVal = nMarkAlign ; break; 356*cdf0e10cSrcweir case 7 : nVal = aMarkColor.GetColor(); break; 357*cdf0e10cSrcweir } 358*cdf0e10cSrcweir pValues[nProp] <<= nVal; 359*cdf0e10cSrcweir } 360*cdf0e10cSrcweir PutProperties(aNames, aValues); 361*cdf0e10cSrcweir } 362*cdf0e10cSrcweir /*-- 10.10.00 16:22:56--------------------------------------------------- 363*cdf0e10cSrcweir 364*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 365*cdf0e10cSrcweir void lcl_ConvertCfgToAttr(sal_Int32 nVal, AuthorCharAttr& rAttr, sal_Bool bDelete = sal_False) 366*cdf0e10cSrcweir { 367*cdf0e10cSrcweir rAttr.nItemId = rAttr.nAttr = 0; 368*cdf0e10cSrcweir switch(nVal) 369*cdf0e10cSrcweir { 370*cdf0e10cSrcweir case 1: rAttr.nItemId = SID_ATTR_CHAR_WEIGHT; rAttr.nAttr = WEIGHT_BOLD ; break; 371*cdf0e10cSrcweir case 2: rAttr.nItemId = SID_ATTR_CHAR_POSTURE; rAttr.nAttr = ITALIC_NORMAL ; break; 372*cdf0e10cSrcweir case 3: if(bDelete) 373*cdf0e10cSrcweir { 374*cdf0e10cSrcweir rAttr.nItemId = SID_ATTR_CHAR_STRIKEOUT; 375*cdf0e10cSrcweir rAttr.nAttr = STRIKEOUT_SINGLE; 376*cdf0e10cSrcweir } 377*cdf0e10cSrcweir else 378*cdf0e10cSrcweir { 379*cdf0e10cSrcweir rAttr.nItemId = SID_ATTR_CHAR_UNDERLINE; 380*cdf0e10cSrcweir rAttr.nAttr = UNDERLINE_SINGLE; 381*cdf0e10cSrcweir } 382*cdf0e10cSrcweir break; 383*cdf0e10cSrcweir case 4: rAttr.nItemId = SID_ATTR_CHAR_UNDERLINE;rAttr.nAttr = UNDERLINE_DOUBLE ; break; 384*cdf0e10cSrcweir case 5: rAttr.nItemId = SID_ATTR_CHAR_CASEMAP; rAttr.nAttr = SVX_CASEMAP_VERSALIEN ; break; 385*cdf0e10cSrcweir case 6: rAttr.nItemId = SID_ATTR_CHAR_CASEMAP; rAttr.nAttr = SVX_CASEMAP_GEMEINE ; break; 386*cdf0e10cSrcweir case 7: rAttr.nItemId = SID_ATTR_CHAR_CASEMAP; rAttr.nAttr = SVX_CASEMAP_KAPITAELCHEN ; break; 387*cdf0e10cSrcweir case 8: rAttr.nItemId = SID_ATTR_CHAR_CASEMAP; rAttr.nAttr = SVX_CASEMAP_TITEL ; break; 388*cdf0e10cSrcweir case 9: rAttr.nItemId = SID_ATTR_BRUSH; break; 389*cdf0e10cSrcweir } 390*cdf0e10cSrcweir } 391*cdf0e10cSrcweir void SwRevisionConfig::Load() 392*cdf0e10cSrcweir { 393*cdf0e10cSrcweir const Sequence<OUString>& aNames = GetPropertyNames(); 394*cdf0e10cSrcweir Sequence<Any> aValues = GetProperties(aNames); 395*cdf0e10cSrcweir const Any* pValues = aValues.getConstArray(); 396*cdf0e10cSrcweir DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); 397*cdf0e10cSrcweir if(aValues.getLength() == aNames.getLength()) 398*cdf0e10cSrcweir { 399*cdf0e10cSrcweir for(int nProp = 0; nProp < aNames.getLength(); nProp++) 400*cdf0e10cSrcweir { 401*cdf0e10cSrcweir if(pValues[nProp].hasValue()) 402*cdf0e10cSrcweir { 403*cdf0e10cSrcweir sal_Int32 nVal = 0; 404*cdf0e10cSrcweir pValues[nProp] >>= nVal; 405*cdf0e10cSrcweir switch(nProp) 406*cdf0e10cSrcweir { 407*cdf0e10cSrcweir case 0 : lcl_ConvertCfgToAttr(nVal, aInsertAttr); break; 408*cdf0e10cSrcweir case 1 : aInsertAttr.nColor = nVal; break; 409*cdf0e10cSrcweir case 2 : lcl_ConvertCfgToAttr(nVal, aDeletedAttr, sal_True); break; 410*cdf0e10cSrcweir case 3 : aDeletedAttr.nColor = nVal; break; 411*cdf0e10cSrcweir case 4 : lcl_ConvertCfgToAttr(nVal, aFormatAttr); break; 412*cdf0e10cSrcweir case 5 : aFormatAttr.nColor = nVal; break; 413*cdf0e10cSrcweir case 6 : nMarkAlign = sal::static_int_cast< sal_uInt16, sal_Int32>(nVal); break; 414*cdf0e10cSrcweir case 7 : aMarkColor.SetColor(nVal); break; 415*cdf0e10cSrcweir } 416*cdf0e10cSrcweir } 417*cdf0e10cSrcweir } 418*cdf0e10cSrcweir } 419*cdf0e10cSrcweir } 420*cdf0e10cSrcweir /* -----------------------------10.10.00 16:22-------------------------------- 421*cdf0e10cSrcweir 422*cdf0e10cSrcweir ---------------------------------------------------------------------------*/ 423*cdf0e10cSrcweir enum InsertConfigProp 424*cdf0e10cSrcweir { 425*cdf0e10cSrcweir INS_PROP_TABLE_HEADER = 0, 426*cdf0e10cSrcweir INS_PROP_TABLE_REPEATHEADER, // 1 427*cdf0e10cSrcweir INS_PROP_TABLE_BORDER, // 2 428*cdf0e10cSrcweir INS_PROP_TABLE_SPLIT, // 3 from here not in writer/web 429*cdf0e10cSrcweir INS_PROP_CAP_AUTOMATIC, // 4 430*cdf0e10cSrcweir INS_PROP_CAP_CAPTIONORDERNUMBERINGFIRST, // 5 431*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_TABLE_ENABLE, // 6 432*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_TABLE_CATEGORY, // 7 433*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_TABLE_NUMBERING, // 8 434*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_TABLE_NUMBERINGSEPARATOR, // 9 435*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_TABLE_CAPTIONTEXT, //10 436*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_TABLE_DELIMITER, //11 437*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_TABLE_LEVEL, //12 438*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_TABLE_POSITION, //13 439*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_TABLE_CHARACTERSTYLE, //14 440*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FRAME_ENABLE, //15 441*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FRAME_CATEGORY, //16 442*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FRAME_NUMBERING, //17 443*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FRAME_NUMBERINGSEPARATOR, //18 444*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FRAME_CAPTIONTEXT, //19 445*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FRAME_DELIMITER, //20 446*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FRAME_LEVEL, //21 447*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FRAME_POSITION, //22 448*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FRAME_CHARACTERSTYLE, //23 449*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_GRAPHIC_ENABLE, //24 450*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_GRAPHIC_CATEGORY, //25 451*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_GRAPHIC_NUMBERING, //26 452*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_GRAPHIC_NUMBERINGSEPARATOR, //27 453*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_GRAPHIC_CAPTIONTEXT, //28 454*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_GRAPHIC_DELIMITER, //29 455*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_GRAPHIC_LEVEL, //30 456*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_GRAPHIC_POSITION, //31 457*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_GRAPHIC_CHARACTERSTYLE, //32 458*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_GRAPHIC_APPLYATTRIBUTES, //33 459*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CALC_ENABLE, //34 460*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CALC_CATEGORY, //35 461*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CALC_NUMBERING, //36 462*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CALC_NUMBERINGSEPARATOR, //37 463*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CALC_CAPTIONTEXT, //38 464*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CALC_DELIMITER, //39 465*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CALC_LEVEL, //40 466*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CALC_POSITION, //41 467*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CALC_CHARACTERSTYLE, //42 468*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CALC_APPLYATTRIBUTES, //43 469*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_IMPRESS_ENABLE, //44 470*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_IMPRESS_CATEGORY, //45 471*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_IMPRESS_NUMBERING, //46 472*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_IMPRESS_NUMBERINGSEPARATOR, //47 473*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_IMPRESS_CAPTIONTEXT, //48 474*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_IMPRESS_DELIMITER, //49 475*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_IMPRESS_LEVEL, //50 476*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_IMPRESS_POSITION, //51 477*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_IMPRESS_CHARACTERSTYLE, //52 478*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_IMPRESS_APPLYATTRIBUTES, //53 479*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CHART_ENABLE, //54 480*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CHART_CATEGORY, //55 481*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CHART_NUMBERING, //56 482*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CHART_NUMBERINGSEPARATOR, //57 483*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CHART_CAPTIONTEXT, //58 484*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CHART_DELIMITER, //59 485*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CHART_LEVEL, //60 486*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CHART_POSITION, //61 487*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CHART_CHARACTERSTYLE, //62 488*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_CHART_APPLYATTRIBUTES, //63 489*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FORMULA_ENABLE, //64 490*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FORMULA_CATEGORY, //65 491*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FORMULA_NUMBERING, //66 492*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FORMULA_NUMBERINGSEPARATOR, //67 493*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FORMULA_CAPTIONTEXT, //68 494*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FORMULA_DELIMITER, //69 495*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FORMULA_LEVEL, //70 496*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FORMULA_POSITION, //71 497*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FORMULA_CHARACTERSTYLE, //72 498*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_FORMULA_APPLYATTRIBUTES, //73 499*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_DRAW_ENABLE, //74 500*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_DRAW_CATEGORY, //75 501*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_DRAW_NUMBERING, //76 502*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_DRAW_NUMBERINGSEPARATOR, //77 503*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_DRAW_CAPTIONTEXT, //78 504*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_DRAW_DELIMITER, //79 505*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_DRAW_LEVEL, //80 506*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_DRAW_POSITION, //81 507*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_DRAW_CHARACTERSTYLE, //82 508*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_DRAW_APPLYATTRIBUTES, //83 509*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_OLEMISC_ENABLE, //84 510*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_OLEMISC_CATEGORY, //85 511*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_OLEMISC_NUMBERING, //86 512*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_OLEMISC_NUMBERINGSEPARATOR, //87 513*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_OLEMISC_CAPTIONTEXT, //88 514*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_OLEMISC_DELIMITER, //89 515*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_OLEMISC_LEVEL, //90 516*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_OLEMISC_POSITION, //91 517*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_OLEMISC_CHARACTERSTYLE, //92 518*cdf0e10cSrcweir INS_PROP_CAP_OBJECT_OLEMISC_APPLYATTRIBUTES //93 519*cdf0e10cSrcweir }; 520*cdf0e10cSrcweir const Sequence<OUString>& SwInsertConfig::GetPropertyNames() 521*cdf0e10cSrcweir { 522*cdf0e10cSrcweir static Sequence<OUString> aNames; 523*cdf0e10cSrcweir static Sequence<OUString> aWebNames; 524*cdf0e10cSrcweir if(!aNames.getLength()) 525*cdf0e10cSrcweir { 526*cdf0e10cSrcweir static const char* aPropNames[] = 527*cdf0e10cSrcweir { 528*cdf0e10cSrcweir "Table/Header", // 0 529*cdf0e10cSrcweir "Table/RepeatHeader", // 1 530*cdf0e10cSrcweir "Table/Border", // 2 531*cdf0e10cSrcweir "Table/Split", // 3 from here not in writer/web 532*cdf0e10cSrcweir "Caption/Automatic", // 4 533*cdf0e10cSrcweir "Caption/CaptionOrderNumberingFirst", // 5 534*cdf0e10cSrcweir "Caption/WriterObject/Table/Enable", // 6 535*cdf0e10cSrcweir "Caption/WriterObject/Table/Settings/Category", // 7 536*cdf0e10cSrcweir "Caption/WriterObject/Table/Settings/Numbering", // 8 537*cdf0e10cSrcweir "Caption/WriterObject/Table/Settings/NumberingSeparator", // 9 538*cdf0e10cSrcweir "Caption/WriterObject/Table/Settings/CaptionText", //10 539*cdf0e10cSrcweir "Caption/WriterObject/Table/Settings/Delimiter", //11 540*cdf0e10cSrcweir "Caption/WriterObject/Table/Settings/Level", //12 541*cdf0e10cSrcweir "Caption/WriterObject/Table/Settings/Position", //13 542*cdf0e10cSrcweir "Caption/WriterObject/Table/Settings/CharacterStyle", //14 543*cdf0e10cSrcweir "Caption/WriterObject/Frame/Enable", //15 544*cdf0e10cSrcweir "Caption/WriterObject/Frame/Settings/Category", //16 545*cdf0e10cSrcweir "Caption/WriterObject/Frame/Settings/Numbering", //17 546*cdf0e10cSrcweir "Caption/WriterObject/Frame/Settings/NumberingSeparator", //18 547*cdf0e10cSrcweir "Caption/WriterObject/Frame/Settings/CaptionText", //19 548*cdf0e10cSrcweir "Caption/WriterObject/Frame/Settings/Delimiter", //20 549*cdf0e10cSrcweir "Caption/WriterObject/Frame/Settings/Level", //21 550*cdf0e10cSrcweir "Caption/WriterObject/Frame/Settings/Position", //22 551*cdf0e10cSrcweir "Caption/WriterObject/Frame/Settings/CharacterStyle", //23 552*cdf0e10cSrcweir "Caption/WriterObject/Graphic/Enable", //24 553*cdf0e10cSrcweir "Caption/WriterObject/Graphic/Settings/Category", //25 554*cdf0e10cSrcweir "Caption/WriterObject/Graphic/Settings/Numbering", //26 555*cdf0e10cSrcweir "Caption/WriterObject/Graphic/Settings/NumberingSeparator", //27 556*cdf0e10cSrcweir "Caption/WriterObject/Graphic/Settings/CaptionText", //28 557*cdf0e10cSrcweir "Caption/WriterObject/Graphic/Settings/Delimiter", //29 558*cdf0e10cSrcweir "Caption/WriterObject/Graphic/Settings/Level", //30 559*cdf0e10cSrcweir "Caption/WriterObject/Graphic/Settings/Position", //31 560*cdf0e10cSrcweir "Caption/WriterObject/Graphic/Settings/CharacterStyle", //32 561*cdf0e10cSrcweir "Caption/WriterObject/Graphic/Settings/ApplyAttributes", //33 562*cdf0e10cSrcweir "Caption/OfficeObject/Calc/Enable", //34 563*cdf0e10cSrcweir "Caption/OfficeObject/Calc/Settings/Category", //35 564*cdf0e10cSrcweir "Caption/OfficeObject/Calc/Settings/Numbering", //36 565*cdf0e10cSrcweir "Caption/OfficeObject/Calc/Settings/NumberingSeparator", //37 566*cdf0e10cSrcweir "Caption/OfficeObject/Calc/Settings/CaptionText", //38 567*cdf0e10cSrcweir "Caption/OfficeObject/Calc/Settings/Delimiter", //39 568*cdf0e10cSrcweir "Caption/OfficeObject/Calc/Settings/Level", //40 569*cdf0e10cSrcweir "Caption/OfficeObject/Calc/Settings/Position", //41 570*cdf0e10cSrcweir "Caption/OfficeObject/Calc/Settings/CharacterStyle", //42 571*cdf0e10cSrcweir "Caption/OfficeObject/Calc/Settings/ApplyAttributes", //43 572*cdf0e10cSrcweir "Caption/OfficeObject/Impress/Enable", //44 573*cdf0e10cSrcweir "Caption/OfficeObject/Impress/Settings/Category", //45 574*cdf0e10cSrcweir "Caption/OfficeObject/Impress/Settings/Numbering", //46 575*cdf0e10cSrcweir "Caption/OfficeObject/Impress/Settings/NumberingSeparator", //47 576*cdf0e10cSrcweir "Caption/OfficeObject/Impress/Settings/CaptionText", //48 577*cdf0e10cSrcweir "Caption/OfficeObject/Impress/Settings/Delimiter", //49 578*cdf0e10cSrcweir "Caption/OfficeObject/Impress/Settings/Level", //50 579*cdf0e10cSrcweir "Caption/OfficeObject/Impress/Settings/Position", //51 580*cdf0e10cSrcweir "Caption/OfficeObject/Impress/Settings/CharacterStyle", //52 581*cdf0e10cSrcweir "Caption/OfficeObject/Impress/Settings/ApplyAttributes", //53 582*cdf0e10cSrcweir "Caption/OfficeObject/Chart/Enable", //54 583*cdf0e10cSrcweir "Caption/OfficeObject/Chart/Settings/Category", //55 584*cdf0e10cSrcweir "Caption/OfficeObject/Chart/Settings/Numbering", //56 585*cdf0e10cSrcweir "Caption/OfficeObject/Chart/Settings/NumberingSeparator", //57 586*cdf0e10cSrcweir "Caption/OfficeObject/Chart/Settings/CaptionText", //58 587*cdf0e10cSrcweir "Caption/OfficeObject/Chart/Settings/Delimiter", //59 588*cdf0e10cSrcweir "Caption/OfficeObject/Chart/Settings/Level", //60 589*cdf0e10cSrcweir "Caption/OfficeObject/Chart/Settings/Position", //61 590*cdf0e10cSrcweir "Caption/OfficeObject/Chart/Settings/CharacterStyle", //62 591*cdf0e10cSrcweir "Caption/OfficeObject/Chart/Settings/ApplyAttributes", //63 592*cdf0e10cSrcweir "Caption/OfficeObject/Formula/Enable", //64 593*cdf0e10cSrcweir "Caption/OfficeObject/Formula/Settings/Category", //65 594*cdf0e10cSrcweir "Caption/OfficeObject/Formula/Settings/Numbering", //66 595*cdf0e10cSrcweir "Caption/OfficeObject/Formula/Settings/NumberingSeparator", //67 596*cdf0e10cSrcweir "Caption/OfficeObject/Formula/Settings/CaptionText", //68 597*cdf0e10cSrcweir "Caption/OfficeObject/Formula/Settings/Delimiter", //69 598*cdf0e10cSrcweir "Caption/OfficeObject/Formula/Settings/Level", //70 599*cdf0e10cSrcweir "Caption/OfficeObject/Formula/Settings/Position", //71 600*cdf0e10cSrcweir "Caption/OfficeObject/Formula/Settings/CharacterStyle", //72 601*cdf0e10cSrcweir "Caption/OfficeObject/Formula/Settings/ApplyAttributes", //73 602*cdf0e10cSrcweir "Caption/OfficeObject/Draw/Enable", //74 603*cdf0e10cSrcweir "Caption/OfficeObject/Draw/Settings/Category", //75 604*cdf0e10cSrcweir "Caption/OfficeObject/Draw/Settings/Numbering", //76 605*cdf0e10cSrcweir "Caption/OfficeObject/Draw/Settings/NumberingSeparator", //77 606*cdf0e10cSrcweir "Caption/OfficeObject/Draw/Settings/CaptionText", //78 607*cdf0e10cSrcweir "Caption/OfficeObject/Draw/Settings/Delimiter", //79 608*cdf0e10cSrcweir "Caption/OfficeObject/Draw/Settings/Level", //80 609*cdf0e10cSrcweir "Caption/OfficeObject/Draw/Settings/Position", //81 610*cdf0e10cSrcweir "Caption/OfficeObject/Draw/Settings/CharacterStyle", //82 611*cdf0e10cSrcweir "Caption/OfficeObject/Draw/Settings/ApplyAttributes", //83 612*cdf0e10cSrcweir "Caption/OfficeObject/OLEMisc/Enable", //84 613*cdf0e10cSrcweir "Caption/OfficeObject/OLEMisc/Settings/Category", //85 614*cdf0e10cSrcweir "Caption/OfficeObject/OLEMisc/Settings/Numbering", //86 615*cdf0e10cSrcweir "Caption/OfficeObject/OLEMisc/Settings/NumberingSeparator", //87 616*cdf0e10cSrcweir "Caption/OfficeObject/OLEMisc/Settings/CaptionText", //88 617*cdf0e10cSrcweir "Caption/OfficeObject/OLEMisc/Settings/Delimiter", //89 618*cdf0e10cSrcweir "Caption/OfficeObject/OLEMisc/Settings/Level", //90 619*cdf0e10cSrcweir "Caption/OfficeObject/OLEMisc/Settings/Position", //91 620*cdf0e10cSrcweir "Caption/OfficeObject/OLEMisc/Settings/CharacterStyle", //92 621*cdf0e10cSrcweir "Caption/OfficeObject/OLEMisc/Settings/ApplyAttributes" //93 622*cdf0e10cSrcweir }; 623*cdf0e10cSrcweir const int nCount = INS_PROP_CAP_OBJECT_OLEMISC_APPLYATTRIBUTES + 1; 624*cdf0e10cSrcweir const int nWebCount = INS_PROP_TABLE_BORDER + 1; 625*cdf0e10cSrcweir aNames.realloc(nCount); 626*cdf0e10cSrcweir aWebNames.realloc(nWebCount); 627*cdf0e10cSrcweir OUString* pNames = aNames.getArray(); 628*cdf0e10cSrcweir OUString* pWebNames = aWebNames.getArray(); 629*cdf0e10cSrcweir int i; 630*cdf0e10cSrcweir for(i = 0; i < nCount; i++) 631*cdf0e10cSrcweir pNames[i] = C2U(aPropNames[i]); 632*cdf0e10cSrcweir for(i = 0; i < nWebCount; i++) 633*cdf0e10cSrcweir pWebNames[i] = C2U(aPropNames[i]); 634*cdf0e10cSrcweir } 635*cdf0e10cSrcweir return bIsWeb ? aWebNames : aNames; 636*cdf0e10cSrcweir } 637*cdf0e10cSrcweir /*-- 10.10.00 16:22:22--------------------------------------------------- 638*cdf0e10cSrcweir 639*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 640*cdf0e10cSrcweir SwInsertConfig::SwInsertConfig(sal_Bool bWeb) : 641*cdf0e10cSrcweir ConfigItem(bWeb ? C2U("Office.WriterWeb/Insert") : C2U("Office.Writer/Insert"), 642*cdf0e10cSrcweir CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE), 643*cdf0e10cSrcweir pCapOptions(0), 644*cdf0e10cSrcweir pOLEMiscOpt(0), 645*cdf0e10cSrcweir bInsWithCaption( sal_False ), 646*cdf0e10cSrcweir bCaptionOrderNumberingFirst( sal_False ), 647*cdf0e10cSrcweir aInsTblOpts(0,0), 648*cdf0e10cSrcweir bIsWeb(bWeb) 649*cdf0e10cSrcweir { 650*cdf0e10cSrcweir aGlobalNames[GLOB_NAME_CALC ] = SvGlobalName(SO3_SC_CLASSID); 651*cdf0e10cSrcweir aGlobalNames[GLOB_NAME_IMPRESS] = SvGlobalName(SO3_SIMPRESS_CLASSID); 652*cdf0e10cSrcweir aGlobalNames[GLOB_NAME_DRAW ] = SvGlobalName(SO3_SDRAW_CLASSID); 653*cdf0e10cSrcweir aGlobalNames[GLOB_NAME_MATH ] = SvGlobalName(SO3_SM_CLASSID); 654*cdf0e10cSrcweir aGlobalNames[GLOB_NAME_CHART ] = SvGlobalName(SO3_SCH_CLASSID); 655*cdf0e10cSrcweir if(!bIsWeb) 656*cdf0e10cSrcweir pCapOptions = new InsCaptionOptArr; 657*cdf0e10cSrcweir 658*cdf0e10cSrcweir Load(); 659*cdf0e10cSrcweir } 660*cdf0e10cSrcweir /*-- 10.10.00 16:22:23--------------------------------------------------- 661*cdf0e10cSrcweir 662*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 663*cdf0e10cSrcweir SwInsertConfig::~SwInsertConfig() 664*cdf0e10cSrcweir { 665*cdf0e10cSrcweir delete pCapOptions; 666*cdf0e10cSrcweir delete pOLEMiscOpt; 667*cdf0e10cSrcweir } 668*cdf0e10cSrcweir /*-- 10.10.00 16:22:56--------------------------------------------------- 669*cdf0e10cSrcweir 670*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 671*cdf0e10cSrcweir void lcl_WriteOpt(const InsCaptionOpt& rOpt, Any* pValues, sal_Int32 nProp, sal_Int32 nOffset) 672*cdf0e10cSrcweir { 673*cdf0e10cSrcweir switch(nOffset) 674*cdf0e10cSrcweir { 675*cdf0e10cSrcweir case 0: 676*cdf0e10cSrcweir { 677*cdf0e10cSrcweir sal_Bool bTemp = rOpt.UseCaption(); 678*cdf0e10cSrcweir pValues[nProp].setValue(&bTemp, ::getBooleanCppuType()); 679*cdf0e10cSrcweir } 680*cdf0e10cSrcweir break;//Enable 681*cdf0e10cSrcweir case 1: pValues[nProp] <<= OUString(rOpt.GetCategory()); break;//Category 682*cdf0e10cSrcweir case 2: pValues[nProp] <<= (sal_Int32)rOpt.GetNumType(); break;//Numbering", 683*cdf0e10cSrcweir case 3: pValues[nProp] <<= rOpt.GetNumSeparator(); break;//NumberingSeparator", 684*cdf0e10cSrcweir case 4: pValues[nProp] <<= OUString(rOpt.GetCaption()); break;//CaptionText", 685*cdf0e10cSrcweir case 5: pValues[nProp] <<= OUString(rOpt.GetSeparator());break;//Delimiter", 686*cdf0e10cSrcweir case 6: pValues[nProp] <<= (sal_Int32)rOpt.GetLevel(); break;//Level", 687*cdf0e10cSrcweir case 7: pValues[nProp] <<= (sal_Int32)rOpt.GetPos(); break;//Position", 688*cdf0e10cSrcweir case 8: pValues[nProp] <<= (::rtl::OUString&)rOpt.GetCharacterStyle(); break; //CharacterStyle 689*cdf0e10cSrcweir case 9: pValues[nProp] <<= rOpt.CopyAttributes(); break; //ApplyAttributes 690*cdf0e10cSrcweir } 691*cdf0e10cSrcweir } 692*cdf0e10cSrcweir //----------------------------------------------------------------------------- 693*cdf0e10cSrcweir void SwInsertConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} 694*cdf0e10cSrcweir 695*cdf0e10cSrcweir void SwInsertConfig::Commit() 696*cdf0e10cSrcweir { 697*cdf0e10cSrcweir const Sequence<OUString>& aNames = GetPropertyNames(); 698*cdf0e10cSrcweir Sequence<Any> aValues(aNames.getLength()); 699*cdf0e10cSrcweir Any* pValues = aValues.getArray(); 700*cdf0e10cSrcweir 701*cdf0e10cSrcweir const Type& rType = ::getBooleanCppuType(); 702*cdf0e10cSrcweir for(int nProp = 0; nProp < aNames.getLength(); nProp++) 703*cdf0e10cSrcweir { 704*cdf0e10cSrcweir const InsCaptionOpt* pWriterTableOpt = 0; 705*cdf0e10cSrcweir const InsCaptionOpt* pWriterFrameOpt = 0; 706*cdf0e10cSrcweir const InsCaptionOpt* pWriterGraphicOpt = 0; 707*cdf0e10cSrcweir const InsCaptionOpt* pOLECalcOpt = 0; 708*cdf0e10cSrcweir const InsCaptionOpt* pOLEImpressOpt = 0; 709*cdf0e10cSrcweir const InsCaptionOpt* pOLEChartOpt = 0; 710*cdf0e10cSrcweir const InsCaptionOpt* pOLEFormulaOpt = 0; 711*cdf0e10cSrcweir const InsCaptionOpt* pOLEDrawOpt = 0; 712*cdf0e10cSrcweir if(pCapOptions) 713*cdf0e10cSrcweir { 714*cdf0e10cSrcweir pWriterTableOpt = pCapOptions->Find(TABLE_CAP, 0); 715*cdf0e10cSrcweir pWriterFrameOpt = pCapOptions->Find(FRAME_CAP, 0); 716*cdf0e10cSrcweir pWriterGraphicOpt = pCapOptions->Find(GRAPHIC_CAP, 0); 717*cdf0e10cSrcweir pOLECalcOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_CALC]); 718*cdf0e10cSrcweir pOLEImpressOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_IMPRESS]); 719*cdf0e10cSrcweir pOLEDrawOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_DRAW ]); 720*cdf0e10cSrcweir pOLEFormulaOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_MATH ]); 721*cdf0e10cSrcweir pOLEChartOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_CHART ]); 722*cdf0e10cSrcweir } 723*cdf0e10cSrcweir switch(nProp) 724*cdf0e10cSrcweir { 725*cdf0e10cSrcweir case INS_PROP_TABLE_HEADER: 726*cdf0e10cSrcweir { 727*cdf0e10cSrcweir sal_Bool bVal = 0 !=(aInsTblOpts.mnInsMode & tabopts::HEADLINE); pValues[nProp].setValue(&bVal, rType); 728*cdf0e10cSrcweir } 729*cdf0e10cSrcweir break;//"Table/Header", 730*cdf0e10cSrcweir case INS_PROP_TABLE_REPEATHEADER: 731*cdf0e10cSrcweir { 732*cdf0e10cSrcweir sal_Bool bVal = (aInsTblOpts.mnRowsToRepeat>0); pValues[nProp].setValue(&bVal, rType); 733*cdf0e10cSrcweir } 734*cdf0e10cSrcweir break;//"Table/RepeatHeader", 735*cdf0e10cSrcweir case INS_PROP_TABLE_BORDER: 736*cdf0e10cSrcweir { 737*cdf0e10cSrcweir sal_Bool bVal = 0 !=(aInsTblOpts.mnInsMode & tabopts::DEFAULT_BORDER ); pValues[nProp].setValue(&bVal, rType); 738*cdf0e10cSrcweir } 739*cdf0e10cSrcweir break;//"Table/Border", 740*cdf0e10cSrcweir case INS_PROP_TABLE_SPLIT: 741*cdf0e10cSrcweir { 742*cdf0e10cSrcweir sal_Bool bVal = 0 !=(aInsTblOpts.mnInsMode & tabopts::SPLIT_LAYOUT); pValues[nProp].setValue(&bVal, rType); 743*cdf0e10cSrcweir } 744*cdf0e10cSrcweir break;//"Table/Split", 745*cdf0e10cSrcweir case INS_PROP_CAP_AUTOMATIC: pValues[nProp].setValue(&bInsWithCaption, rType);break;//"Caption/Automatic", 746*cdf0e10cSrcweir case INS_PROP_CAP_CAPTIONORDERNUMBERINGFIRST: 747*cdf0e10cSrcweir pValues[nProp] <<= bCaptionOrderNumberingFirst; 748*cdf0e10cSrcweir break;//"Caption/CaptionOrderNumberingFirst" 749*cdf0e10cSrcweir 750*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_ENABLE: 751*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_CATEGORY: 752*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_NUMBERING: 753*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_NUMBERINGSEPARATOR: 754*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_CAPTIONTEXT: 755*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_DELIMITER: 756*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_LEVEL: 757*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_POSITION: 758*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_CHARACTERSTYLE: 759*cdf0e10cSrcweir if(pWriterTableOpt) 760*cdf0e10cSrcweir lcl_WriteOpt(*pWriterTableOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_TABLE_ENABLE); 761*cdf0e10cSrcweir break; 762*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_ENABLE: 763*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_CATEGORY: 764*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_NUMBERING: 765*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_NUMBERINGSEPARATOR: 766*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_CAPTIONTEXT: 767*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_DELIMITER: 768*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_LEVEL: 769*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_POSITION: 770*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_CHARACTERSTYLE: 771*cdf0e10cSrcweir if(pWriterFrameOpt) 772*cdf0e10cSrcweir lcl_WriteOpt(*pWriterFrameOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_FRAME_ENABLE); 773*cdf0e10cSrcweir break; 774*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_ENABLE: 775*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_CATEGORY: 776*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_NUMBERING: 777*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_NUMBERINGSEPARATOR: 778*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_CAPTIONTEXT: 779*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_DELIMITER: 780*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_LEVEL: 781*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_POSITION: 782*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_CHARACTERSTYLE: 783*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_APPLYATTRIBUTES: 784*cdf0e10cSrcweir if(pWriterGraphicOpt) 785*cdf0e10cSrcweir lcl_WriteOpt(*pWriterGraphicOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_GRAPHIC_ENABLE); 786*cdf0e10cSrcweir break; 787*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_ENABLE: 788*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_CATEGORY: 789*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_NUMBERING: 790*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_NUMBERINGSEPARATOR: 791*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_CAPTIONTEXT: 792*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_DELIMITER: 793*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_LEVEL: 794*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_POSITION: 795*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_CHARACTERSTYLE: 796*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_APPLYATTRIBUTES: 797*cdf0e10cSrcweir if(pOLECalcOpt) 798*cdf0e10cSrcweir lcl_WriteOpt(*pOLECalcOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_CALC_ENABLE); 799*cdf0e10cSrcweir break; 800*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_ENABLE: 801*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_CATEGORY: 802*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_NUMBERING: 803*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_NUMBERINGSEPARATOR: 804*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_CAPTIONTEXT: 805*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_DELIMITER: 806*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_LEVEL: 807*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_POSITION: 808*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_CHARACTERSTYLE: 809*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_APPLYATTRIBUTES: 810*cdf0e10cSrcweir if(pOLEImpressOpt) 811*cdf0e10cSrcweir lcl_WriteOpt(*pOLEImpressOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_IMPRESS_ENABLE); 812*cdf0e10cSrcweir break; 813*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_ENABLE: 814*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_CATEGORY: 815*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_NUMBERING: 816*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_NUMBERINGSEPARATOR: 817*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_CAPTIONTEXT: 818*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_DELIMITER: 819*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_LEVEL: 820*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_POSITION: 821*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_CHARACTERSTYLE: 822*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_APPLYATTRIBUTES: 823*cdf0e10cSrcweir if(pOLEChartOpt) 824*cdf0e10cSrcweir lcl_WriteOpt(*pOLEChartOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_CHART_ENABLE); 825*cdf0e10cSrcweir break; 826*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_ENABLE: 827*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_CATEGORY: 828*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_NUMBERING: 829*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_NUMBERINGSEPARATOR: 830*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_CAPTIONTEXT: 831*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_DELIMITER: 832*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_LEVEL: 833*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_POSITION: 834*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_CHARACTERSTYLE: 835*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_APPLYATTRIBUTES: 836*cdf0e10cSrcweir if(pOLEFormulaOpt) 837*cdf0e10cSrcweir lcl_WriteOpt(*pOLEFormulaOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_FORMULA_ENABLE); 838*cdf0e10cSrcweir break; 839*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_ENABLE: 840*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_CATEGORY: 841*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_NUMBERING: 842*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_NUMBERINGSEPARATOR: 843*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_CAPTIONTEXT: 844*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_DELIMITER: 845*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_LEVEL: 846*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_POSITION: 847*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_CHARACTERSTYLE: 848*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_APPLYATTRIBUTES: 849*cdf0e10cSrcweir if(pOLEDrawOpt) 850*cdf0e10cSrcweir lcl_WriteOpt(*pOLEDrawOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_DRAW_ENABLE); 851*cdf0e10cSrcweir break; 852*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_ENABLE: 853*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_CATEGORY: 854*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_NUMBERING: 855*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_NUMBERINGSEPARATOR: 856*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_CAPTIONTEXT: 857*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_DELIMITER: 858*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_LEVEL: 859*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_POSITION: 860*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_CHARACTERSTYLE: 861*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_APPLYATTRIBUTES: 862*cdf0e10cSrcweir if(pOLEMiscOpt) 863*cdf0e10cSrcweir lcl_WriteOpt(*pOLEMiscOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_OLEMISC_ENABLE); 864*cdf0e10cSrcweir break; 865*cdf0e10cSrcweir 866*cdf0e10cSrcweir } 867*cdf0e10cSrcweir } 868*cdf0e10cSrcweir PutProperties(aNames, aValues); 869*cdf0e10cSrcweir } 870*cdf0e10cSrcweir /*-- 10.10.00 16:22:56--------------------------------------------------- 871*cdf0e10cSrcweir 872*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 873*cdf0e10cSrcweir void lcl_ReadOpt(InsCaptionOpt& rOpt, const Any* pValues, sal_Int32 nProp, sal_Int32 nOffset) 874*cdf0e10cSrcweir { 875*cdf0e10cSrcweir switch(nOffset) 876*cdf0e10cSrcweir { 877*cdf0e10cSrcweir case 0: 878*cdf0e10cSrcweir rOpt.UseCaption() = *(sal_Bool*)pValues[nProp].getValue(); 879*cdf0e10cSrcweir break;//Enable 880*cdf0e10cSrcweir case 1: 881*cdf0e10cSrcweir { 882*cdf0e10cSrcweir OUString sTemp; pValues[nProp] >>= sTemp; 883*cdf0e10cSrcweir rOpt.SetCategory(sTemp); 884*cdf0e10cSrcweir } 885*cdf0e10cSrcweir break;//Category 886*cdf0e10cSrcweir case 2: 887*cdf0e10cSrcweir { 888*cdf0e10cSrcweir sal_Int32 nTemp = 0; 889*cdf0e10cSrcweir pValues[nProp] >>= nTemp; 890*cdf0e10cSrcweir rOpt.SetNumType(sal::static_int_cast< sal_uInt16, sal_Int32>(nTemp)); 891*cdf0e10cSrcweir } 892*cdf0e10cSrcweir break;//Numbering", 893*cdf0e10cSrcweir case 3: 894*cdf0e10cSrcweir { 895*cdf0e10cSrcweir OUString sTemp; pValues[nProp] >>= sTemp; 896*cdf0e10cSrcweir rOpt.SetNumSeparator(sTemp); 897*cdf0e10cSrcweir } 898*cdf0e10cSrcweir break;//NumberingSeparator", 899*cdf0e10cSrcweir case 4: 900*cdf0e10cSrcweir { 901*cdf0e10cSrcweir OUString sTemp; pValues[nProp] >>= sTemp; 902*cdf0e10cSrcweir rOpt.SetCaption(sTemp); 903*cdf0e10cSrcweir } 904*cdf0e10cSrcweir break;//CaptionText", 905*cdf0e10cSrcweir case 5: 906*cdf0e10cSrcweir { 907*cdf0e10cSrcweir OUString sTemp; 908*cdf0e10cSrcweir if(pValues[nProp] >>= sTemp) 909*cdf0e10cSrcweir rOpt.SetSeparator(sTemp); 910*cdf0e10cSrcweir } 911*cdf0e10cSrcweir break;//Delimiter", 912*cdf0e10cSrcweir case 6: 913*cdf0e10cSrcweir { 914*cdf0e10cSrcweir sal_Int32 nTemp = 0; 915*cdf0e10cSrcweir pValues[nProp] >>= nTemp; 916*cdf0e10cSrcweir rOpt.SetLevel(sal::static_int_cast< sal_uInt16, sal_Int32>(nTemp)); 917*cdf0e10cSrcweir } 918*cdf0e10cSrcweir break;//Level", 919*cdf0e10cSrcweir case 7: 920*cdf0e10cSrcweir { 921*cdf0e10cSrcweir sal_Int32 nTemp = 0; 922*cdf0e10cSrcweir pValues[nProp] >>= nTemp; 923*cdf0e10cSrcweir rOpt.SetPos(sal::static_int_cast< sal_uInt16, sal_Int32>(nTemp)); 924*cdf0e10cSrcweir } 925*cdf0e10cSrcweir break;//Position", 926*cdf0e10cSrcweir case 8 : //CharacterStyle 927*cdf0e10cSrcweir { 928*cdf0e10cSrcweir ::rtl::OUString sTemp; pValues[nProp] >>= sTemp; 929*cdf0e10cSrcweir rOpt.SetCharacterStyle( sTemp ); 930*cdf0e10cSrcweir } 931*cdf0e10cSrcweir break; 932*cdf0e10cSrcweir case 9 : //ApplyAttributes 933*cdf0e10cSrcweir { 934*cdf0e10cSrcweir pValues[nProp] >>= rOpt.CopyAttributes(); 935*cdf0e10cSrcweir } 936*cdf0e10cSrcweir break; 937*cdf0e10cSrcweir } 938*cdf0e10cSrcweir } 939*cdf0e10cSrcweir //----------------------------------------------------------------------------- 940*cdf0e10cSrcweir void SwInsertConfig::Load() 941*cdf0e10cSrcweir { 942*cdf0e10cSrcweir const Sequence<OUString>& aNames = GetPropertyNames(); 943*cdf0e10cSrcweir Sequence<Any> aValues = GetProperties(aNames); 944*cdf0e10cSrcweir const Any* pValues = aValues.getConstArray(); 945*cdf0e10cSrcweir DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); 946*cdf0e10cSrcweir if(aValues.getLength() == aNames.getLength()) 947*cdf0e10cSrcweir { 948*cdf0e10cSrcweir InsCaptionOpt* pWriterTableOpt = 0; 949*cdf0e10cSrcweir InsCaptionOpt* pWriterFrameOpt = 0; 950*cdf0e10cSrcweir InsCaptionOpt* pWriterGraphicOpt = 0; 951*cdf0e10cSrcweir InsCaptionOpt* pOLECalcOpt = 0; 952*cdf0e10cSrcweir InsCaptionOpt* pOLEImpressOpt = 0; 953*cdf0e10cSrcweir InsCaptionOpt* pOLEChartOpt = 0; 954*cdf0e10cSrcweir InsCaptionOpt* pOLEFormulaOpt = 0; 955*cdf0e10cSrcweir InsCaptionOpt* pOLEDrawOpt = 0; 956*cdf0e10cSrcweir if(pCapOptions) 957*cdf0e10cSrcweir { 958*cdf0e10cSrcweir pWriterTableOpt = pCapOptions->Find(TABLE_CAP, 0); 959*cdf0e10cSrcweir pWriterFrameOpt = pCapOptions->Find(FRAME_CAP, 0); 960*cdf0e10cSrcweir pWriterGraphicOpt = pCapOptions->Find(GRAPHIC_CAP, 0); 961*cdf0e10cSrcweir pOLECalcOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_CALC]); 962*cdf0e10cSrcweir pOLEImpressOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_IMPRESS]); 963*cdf0e10cSrcweir pOLEDrawOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_DRAW ]); 964*cdf0e10cSrcweir pOLEFormulaOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_MATH ]); 965*cdf0e10cSrcweir pOLEChartOpt = pCapOptions->Find(OLE_CAP, &aGlobalNames[GLOB_NAME_CHART ]); 966*cdf0e10cSrcweir } 967*cdf0e10cSrcweir else if(!bIsWeb) 968*cdf0e10cSrcweir return; 969*cdf0e10cSrcweir 970*cdf0e10cSrcweir sal_uInt16 nInsTblFlags = 0; 971*cdf0e10cSrcweir for(int nProp = 0; nProp < aNames.getLength(); nProp++) 972*cdf0e10cSrcweir { 973*cdf0e10cSrcweir if(pValues[nProp].hasValue()) 974*cdf0e10cSrcweir { 975*cdf0e10cSrcweir sal_Bool bBool = nProp < INS_PROP_CAP_OBJECT_TABLE_ENABLE ? *(sal_Bool*)pValues[nProp].getValue() : sal_False; 976*cdf0e10cSrcweir switch(nProp) 977*cdf0e10cSrcweir { 978*cdf0e10cSrcweir case INS_PROP_TABLE_HEADER: 979*cdf0e10cSrcweir { 980*cdf0e10cSrcweir if(bBool) 981*cdf0e10cSrcweir nInsTblFlags|= tabopts::HEADLINE; 982*cdf0e10cSrcweir } 983*cdf0e10cSrcweir break;//"Table/Header", 984*cdf0e10cSrcweir case INS_PROP_TABLE_REPEATHEADER: 985*cdf0e10cSrcweir { 986*cdf0e10cSrcweir aInsTblOpts.mnRowsToRepeat = bBool? 1 : 0; 987*cdf0e10cSrcweir 988*cdf0e10cSrcweir } 989*cdf0e10cSrcweir break;//"Table/RepeatHeader", 990*cdf0e10cSrcweir case INS_PROP_TABLE_BORDER: 991*cdf0e10cSrcweir { 992*cdf0e10cSrcweir if(bBool) 993*cdf0e10cSrcweir nInsTblFlags|= tabopts::DEFAULT_BORDER; 994*cdf0e10cSrcweir } 995*cdf0e10cSrcweir break;//"Table/Border", 996*cdf0e10cSrcweir case INS_PROP_TABLE_SPLIT: 997*cdf0e10cSrcweir { 998*cdf0e10cSrcweir if(bBool) 999*cdf0e10cSrcweir nInsTblFlags|= tabopts::SPLIT_LAYOUT; 1000*cdf0e10cSrcweir } 1001*cdf0e10cSrcweir break;//"Table/Split", 1002*cdf0e10cSrcweir case INS_PROP_CAP_AUTOMATIC: 1003*cdf0e10cSrcweir bInsWithCaption = bBool; 1004*cdf0e10cSrcweir break; 1005*cdf0e10cSrcweir case INS_PROP_CAP_CAPTIONORDERNUMBERINGFIRST: bCaptionOrderNumberingFirst = bBool; break; 1006*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_ENABLE: 1007*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_CATEGORY: 1008*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_NUMBERING: 1009*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_NUMBERINGSEPARATOR: 1010*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_CAPTIONTEXT: 1011*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_DELIMITER: 1012*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_LEVEL: 1013*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_POSITION: 1014*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_TABLE_CHARACTERSTYLE: 1015*cdf0e10cSrcweir if(!pWriterTableOpt) 1016*cdf0e10cSrcweir { 1017*cdf0e10cSrcweir pWriterTableOpt = new InsCaptionOpt(TABLE_CAP); 1018*cdf0e10cSrcweir pCapOptions->Insert(pWriterTableOpt); 1019*cdf0e10cSrcweir } 1020*cdf0e10cSrcweir lcl_ReadOpt(*pWriterTableOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_TABLE_ENABLE); 1021*cdf0e10cSrcweir break; 1022*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_ENABLE: 1023*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_CATEGORY: 1024*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_NUMBERING: 1025*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_NUMBERINGSEPARATOR: 1026*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_CAPTIONTEXT: 1027*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_DELIMITER: 1028*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_LEVEL: 1029*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_POSITION: 1030*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FRAME_CHARACTERSTYLE: 1031*cdf0e10cSrcweir if(!pWriterFrameOpt) 1032*cdf0e10cSrcweir { 1033*cdf0e10cSrcweir pWriterFrameOpt = new InsCaptionOpt(FRAME_CAP); 1034*cdf0e10cSrcweir pCapOptions->Insert(pWriterFrameOpt); 1035*cdf0e10cSrcweir } 1036*cdf0e10cSrcweir lcl_ReadOpt(*pWriterFrameOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_FRAME_ENABLE); 1037*cdf0e10cSrcweir break; 1038*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_ENABLE: 1039*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_CATEGORY: 1040*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_NUMBERING: 1041*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_NUMBERINGSEPARATOR: 1042*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_CAPTIONTEXT: 1043*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_DELIMITER: 1044*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_LEVEL: 1045*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_POSITION: 1046*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_CHARACTERSTYLE: 1047*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_GRAPHIC_APPLYATTRIBUTES: 1048*cdf0e10cSrcweir if(!pWriterGraphicOpt) 1049*cdf0e10cSrcweir { 1050*cdf0e10cSrcweir pWriterGraphicOpt = new InsCaptionOpt(GRAPHIC_CAP); 1051*cdf0e10cSrcweir pCapOptions->Insert(pWriterGraphicOpt); 1052*cdf0e10cSrcweir } 1053*cdf0e10cSrcweir lcl_ReadOpt(*pWriterGraphicOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_GRAPHIC_ENABLE); 1054*cdf0e10cSrcweir break; 1055*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_ENABLE: 1056*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_CATEGORY: 1057*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_NUMBERING: 1058*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_NUMBERINGSEPARATOR: 1059*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_CAPTIONTEXT: 1060*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_DELIMITER: 1061*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_LEVEL: 1062*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_POSITION: 1063*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_CHARACTERSTYLE: 1064*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CALC_APPLYATTRIBUTES: 1065*cdf0e10cSrcweir if(!pOLECalcOpt) 1066*cdf0e10cSrcweir { 1067*cdf0e10cSrcweir pOLECalcOpt = new InsCaptionOpt(OLE_CAP, &aGlobalNames[GLOB_NAME_CALC]); 1068*cdf0e10cSrcweir pCapOptions->Insert(pOLECalcOpt); 1069*cdf0e10cSrcweir } 1070*cdf0e10cSrcweir lcl_ReadOpt(*pOLECalcOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_CALC_ENABLE); 1071*cdf0e10cSrcweir break; 1072*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_ENABLE: 1073*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_CATEGORY: 1074*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_NUMBERING: 1075*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_NUMBERINGSEPARATOR: 1076*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_CAPTIONTEXT: 1077*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_DELIMITER: 1078*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_LEVEL: 1079*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_POSITION: 1080*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_CHARACTERSTYLE: 1081*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_IMPRESS_APPLYATTRIBUTES: 1082*cdf0e10cSrcweir if(!pOLEImpressOpt) 1083*cdf0e10cSrcweir { 1084*cdf0e10cSrcweir pOLEImpressOpt = new InsCaptionOpt(OLE_CAP, &aGlobalNames[GLOB_NAME_IMPRESS]); 1085*cdf0e10cSrcweir pCapOptions->Insert(pOLEImpressOpt); 1086*cdf0e10cSrcweir } 1087*cdf0e10cSrcweir lcl_ReadOpt(*pOLEImpressOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_IMPRESS_ENABLE); 1088*cdf0e10cSrcweir break; 1089*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_ENABLE: 1090*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_CATEGORY: 1091*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_NUMBERING: 1092*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_NUMBERINGSEPARATOR: 1093*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_CAPTIONTEXT: 1094*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_DELIMITER: 1095*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_LEVEL: 1096*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_POSITION: 1097*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_CHARACTERSTYLE: 1098*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_CHART_APPLYATTRIBUTES: 1099*cdf0e10cSrcweir if(!pOLEChartOpt) 1100*cdf0e10cSrcweir { 1101*cdf0e10cSrcweir pOLEChartOpt = new InsCaptionOpt(OLE_CAP, &aGlobalNames[GLOB_NAME_CHART]); 1102*cdf0e10cSrcweir pCapOptions->Insert(pOLEChartOpt); 1103*cdf0e10cSrcweir } 1104*cdf0e10cSrcweir lcl_ReadOpt(*pOLEChartOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_CHART_ENABLE); 1105*cdf0e10cSrcweir break; 1106*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_ENABLE: 1107*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_CATEGORY: 1108*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_NUMBERING: 1109*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_NUMBERINGSEPARATOR: 1110*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_CAPTIONTEXT: 1111*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_DELIMITER: 1112*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_LEVEL: 1113*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_POSITION: 1114*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_CHARACTERSTYLE: 1115*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_FORMULA_APPLYATTRIBUTES: 1116*cdf0e10cSrcweir if(!pOLEFormulaOpt) 1117*cdf0e10cSrcweir { 1118*cdf0e10cSrcweir pOLEFormulaOpt = new InsCaptionOpt(OLE_CAP, &aGlobalNames[GLOB_NAME_MATH]); 1119*cdf0e10cSrcweir pCapOptions->Insert(pOLEFormulaOpt); 1120*cdf0e10cSrcweir } 1121*cdf0e10cSrcweir lcl_ReadOpt(*pOLEFormulaOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_FORMULA_ENABLE); 1122*cdf0e10cSrcweir break; 1123*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_ENABLE: 1124*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_CATEGORY: 1125*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_NUMBERING: 1126*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_NUMBERINGSEPARATOR: 1127*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_CAPTIONTEXT: 1128*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_DELIMITER: 1129*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_LEVEL: 1130*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_POSITION: 1131*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_CHARACTERSTYLE: 1132*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_DRAW_APPLYATTRIBUTES: 1133*cdf0e10cSrcweir if(!pOLEDrawOpt) 1134*cdf0e10cSrcweir { 1135*cdf0e10cSrcweir pOLEDrawOpt = new InsCaptionOpt(OLE_CAP, &aGlobalNames[GLOB_NAME_DRAW]); 1136*cdf0e10cSrcweir pCapOptions->Insert(pOLEDrawOpt); 1137*cdf0e10cSrcweir } 1138*cdf0e10cSrcweir lcl_ReadOpt(*pOLEDrawOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_DRAW_ENABLE); 1139*cdf0e10cSrcweir break; 1140*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_ENABLE: 1141*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_CATEGORY: 1142*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_NUMBERING: 1143*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_NUMBERINGSEPARATOR: 1144*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_CAPTIONTEXT: 1145*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_DELIMITER: 1146*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_LEVEL: 1147*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_POSITION: 1148*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_CHARACTERSTYLE: 1149*cdf0e10cSrcweir case INS_PROP_CAP_OBJECT_OLEMISC_APPLYATTRIBUTES: 1150*cdf0e10cSrcweir if(!pOLEMiscOpt) 1151*cdf0e10cSrcweir { 1152*cdf0e10cSrcweir pOLEMiscOpt = new InsCaptionOpt(OLE_CAP); 1153*cdf0e10cSrcweir } 1154*cdf0e10cSrcweir lcl_ReadOpt(*pOLEMiscOpt, pValues, nProp, nProp - INS_PROP_CAP_OBJECT_OLEMISC_ENABLE); 1155*cdf0e10cSrcweir break; 1156*cdf0e10cSrcweir } 1157*cdf0e10cSrcweir } 1158*cdf0e10cSrcweir else if(nProp == INS_PROP_CAP_CAPTIONORDERNUMBERINGFIRST) 1159*cdf0e10cSrcweir { 1160*cdf0e10cSrcweir //#i61007# initialize caption order, right now only HUNGARIAN seems to need a different order 1161*cdf0e10cSrcweir SvtSysLocaleOptions aSysLocaleOptions; 1162*cdf0e10cSrcweir OUString sLang = aSysLocaleOptions.GetLocaleConfigString(); 1163*cdf0e10cSrcweir bCaptionOrderNumberingFirst = ( sLang.getLength() && sLang.matchAsciiL( "hu", 2 )) ? sal_True : sal_False; 1164*cdf0e10cSrcweir } 1165*cdf0e10cSrcweir 1166*cdf0e10cSrcweir } 1167*cdf0e10cSrcweir aInsTblOpts.mnInsMode = nInsTblFlags; 1168*cdf0e10cSrcweir } 1169*cdf0e10cSrcweir } 1170*cdf0e10cSrcweir /* -----------------------------10.10.00 16:22-------------------------------- 1171*cdf0e10cSrcweir 1172*cdf0e10cSrcweir ---------------------------------------------------------------------------*/ 1173*cdf0e10cSrcweir const Sequence<OUString>& SwTableConfig::GetPropertyNames() 1174*cdf0e10cSrcweir { 1175*cdf0e10cSrcweir const int nCount = 8; 1176*cdf0e10cSrcweir static Sequence<OUString> aNames(nCount); 1177*cdf0e10cSrcweir static const char* aPropNames[] = 1178*cdf0e10cSrcweir { 1179*cdf0e10cSrcweir "Shift/Row", // 0 1180*cdf0e10cSrcweir "Shift/Column", // 1 1181*cdf0e10cSrcweir "Insert/Row", // 2 1182*cdf0e10cSrcweir "Insert/Column", // 3 1183*cdf0e10cSrcweir "Change/Effect", // 4 1184*cdf0e10cSrcweir "Input/NumberRecognition", // 5 1185*cdf0e10cSrcweir "Input/NumberFormatRecognition",// 6 1186*cdf0e10cSrcweir "Input/Alignment" // 7 1187*cdf0e10cSrcweir }; 1188*cdf0e10cSrcweir OUString* pNames = aNames.getArray(); 1189*cdf0e10cSrcweir for(int i = 0; i < nCount; i++) 1190*cdf0e10cSrcweir pNames[i] = OUString::createFromAscii(aPropNames[i]); 1191*cdf0e10cSrcweir return aNames; 1192*cdf0e10cSrcweir } 1193*cdf0e10cSrcweir /*-- 10.10.00 16:22:22--------------------------------------------------- 1194*cdf0e10cSrcweir 1195*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 1196*cdf0e10cSrcweir SwTableConfig::SwTableConfig(sal_Bool bWeb) : 1197*cdf0e10cSrcweir ConfigItem(bWeb ? C2U("Office.WriterWeb/Table") : C2U("Office.Writer/Table"), 1198*cdf0e10cSrcweir CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE) 1199*cdf0e10cSrcweir { 1200*cdf0e10cSrcweir Load(); 1201*cdf0e10cSrcweir } 1202*cdf0e10cSrcweir /*-- 10.10.00 16:22:23--------------------------------------------------- 1203*cdf0e10cSrcweir 1204*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 1205*cdf0e10cSrcweir SwTableConfig::~SwTableConfig() 1206*cdf0e10cSrcweir { 1207*cdf0e10cSrcweir } 1208*cdf0e10cSrcweir /*-- 10.10.00 16:22:56--------------------------------------------------- 1209*cdf0e10cSrcweir 1210*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 1211*cdf0e10cSrcweir void SwTableConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} 1212*cdf0e10cSrcweir 1213*cdf0e10cSrcweir void SwTableConfig::Commit() 1214*cdf0e10cSrcweir { 1215*cdf0e10cSrcweir const Sequence<OUString>& aNames = GetPropertyNames(); 1216*cdf0e10cSrcweir Sequence<Any> aValues(aNames.getLength()); 1217*cdf0e10cSrcweir Any* pValues = aValues.getArray(); 1218*cdf0e10cSrcweir 1219*cdf0e10cSrcweir const Type& rType = ::getBooleanCppuType(); 1220*cdf0e10cSrcweir for(int nProp = 0; nProp < aNames.getLength(); nProp++) 1221*cdf0e10cSrcweir { 1222*cdf0e10cSrcweir switch(nProp) 1223*cdf0e10cSrcweir { 1224*cdf0e10cSrcweir case 0 : pValues[nProp] <<= (sal_Int32)TWIP_TO_MM100_UNSIGNED(nTblHMove); break; //"Shift/Row", 1225*cdf0e10cSrcweir case 1 : pValues[nProp] <<= (sal_Int32)TWIP_TO_MM100_UNSIGNED(nTblVMove); break; //"Shift/Column", 1226*cdf0e10cSrcweir case 2 : pValues[nProp] <<= (sal_Int32)TWIP_TO_MM100_UNSIGNED(nTblHInsert); break; //"Insert/Row", 1227*cdf0e10cSrcweir case 3 : pValues[nProp] <<= (sal_Int32)TWIP_TO_MM100_UNSIGNED(nTblVInsert); break; //"Insert/Column", 1228*cdf0e10cSrcweir case 4 : pValues[nProp] <<= (sal_Int32)eTblChgMode; break; //"Change/Effect", 1229*cdf0e10cSrcweir case 5 : pValues[nProp].setValue(&bInsTblFormatNum, rType); break; //"Input/NumberRecognition", 1230*cdf0e10cSrcweir case 6 : pValues[nProp].setValue(&bInsTblChangeNumFormat, rType); break; //"Input/NumberFormatRecognition", 1231*cdf0e10cSrcweir case 7 : pValues[nProp].setValue(&bInsTblAlignNum, rType); break; //"Input/Alignment" 1232*cdf0e10cSrcweir } 1233*cdf0e10cSrcweir } 1234*cdf0e10cSrcweir PutProperties(aNames, aValues); 1235*cdf0e10cSrcweir } 1236*cdf0e10cSrcweir /*-- 10.10.00 16:22:56--------------------------------------------------- 1237*cdf0e10cSrcweir 1238*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 1239*cdf0e10cSrcweir void SwTableConfig::Load() 1240*cdf0e10cSrcweir { 1241*cdf0e10cSrcweir const Sequence<OUString>& aNames = GetPropertyNames(); 1242*cdf0e10cSrcweir Sequence<Any> aValues = GetProperties(aNames); 1243*cdf0e10cSrcweir const Any* pValues = aValues.getConstArray(); 1244*cdf0e10cSrcweir DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); 1245*cdf0e10cSrcweir if(aValues.getLength() == aNames.getLength()) 1246*cdf0e10cSrcweir { 1247*cdf0e10cSrcweir for(int nProp = 0; nProp < aNames.getLength(); nProp++) 1248*cdf0e10cSrcweir { 1249*cdf0e10cSrcweir if(pValues[nProp].hasValue()) 1250*cdf0e10cSrcweir { 1251*cdf0e10cSrcweir sal_Int32 nTemp = 0; 1252*cdf0e10cSrcweir switch(nProp) 1253*cdf0e10cSrcweir { 1254*cdf0e10cSrcweir case 0 : pValues[nProp] >>= nTemp; nTblHMove = (sal_uInt16)MM100_TO_TWIP(nTemp); break; //"Shift/Row", 1255*cdf0e10cSrcweir case 1 : pValues[nProp] >>= nTemp; nTblVMove = (sal_uInt16)MM100_TO_TWIP(nTemp); break; //"Shift/Column", 1256*cdf0e10cSrcweir case 2 : pValues[nProp] >>= nTemp; nTblHInsert = (sal_uInt16)MM100_TO_TWIP(nTemp); break; //"Insert/Row", 1257*cdf0e10cSrcweir case 3 : pValues[nProp] >>= nTemp; nTblVInsert = (sal_uInt16)MM100_TO_TWIP(nTemp); break; //"Insert/Column", 1258*cdf0e10cSrcweir case 4 : pValues[nProp] >>= nTemp; eTblChgMode = (TblChgMode)nTemp; break; //"Change/Effect", 1259*cdf0e10cSrcweir case 5 : bInsTblFormatNum = *(sal_Bool*)pValues[nProp].getValue(); break; //"Input/NumberRecognition", 1260*cdf0e10cSrcweir case 6 : bInsTblChangeNumFormat = *(sal_Bool*)pValues[nProp].getValue(); break; //"Input/NumberFormatRecognition", 1261*cdf0e10cSrcweir case 7 : bInsTblAlignNum = *(sal_Bool*)pValues[nProp].getValue(); break; //"Input/Alignment" 1262*cdf0e10cSrcweir } 1263*cdf0e10cSrcweir } 1264*cdf0e10cSrcweir } 1265*cdf0e10cSrcweir } 1266*cdf0e10cSrcweir } 1267*cdf0e10cSrcweir /*-- 18.01.01 17:02:47--------------------------------------------------- 1268*cdf0e10cSrcweir 1269*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 1270*cdf0e10cSrcweir SwMiscConfig::SwMiscConfig() : 1271*cdf0e10cSrcweir ConfigItem(C2U("Office.Writer"), 1272*cdf0e10cSrcweir CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE), 1273*cdf0e10cSrcweir bDefaultFontsInCurrDocOnly(sal_False), 1274*cdf0e10cSrcweir bShowIndexPreview(sal_False), 1275*cdf0e10cSrcweir bGrfToGalleryAsLnk(sal_True), 1276*cdf0e10cSrcweir bNumAlignSize(sal_True), 1277*cdf0e10cSrcweir bSinglePrintJob(sal_False), 1278*cdf0e10cSrcweir bIsNameFromColumn(sal_True), 1279*cdf0e10cSrcweir bAskForMailMergeInPrint(sal_True), 1280*cdf0e10cSrcweir nMailingFormats(0) 1281*cdf0e10cSrcweir { 1282*cdf0e10cSrcweir Load(); 1283*cdf0e10cSrcweir } 1284*cdf0e10cSrcweir /*-- 18.01.01 17:02:47--------------------------------------------------- 1285*cdf0e10cSrcweir 1286*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 1287*cdf0e10cSrcweir SwMiscConfig::~SwMiscConfig() 1288*cdf0e10cSrcweir { 1289*cdf0e10cSrcweir } 1290*cdf0e10cSrcweir /*-- 18.01.01 17:02:47--------------------------------------------------- 1291*cdf0e10cSrcweir 1292*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 1293*cdf0e10cSrcweir const Sequence<OUString>& SwMiscConfig::GetPropertyNames() 1294*cdf0e10cSrcweir { 1295*cdf0e10cSrcweir static Sequence<OUString> aNames; 1296*cdf0e10cSrcweir if(!aNames.getLength()) 1297*cdf0e10cSrcweir { 1298*cdf0e10cSrcweir const int nCount = 12; 1299*cdf0e10cSrcweir aNames.realloc(nCount); 1300*cdf0e10cSrcweir static const char* aPropNames[] = 1301*cdf0e10cSrcweir { 1302*cdf0e10cSrcweir "Statistics/WordNumber/Delimiter", // 0 1303*cdf0e10cSrcweir "DefaultFont/Document", // 1 1304*cdf0e10cSrcweir "Index/ShowPreview", // 2 1305*cdf0e10cSrcweir "Misc/GraphicToGalleryAsLink", // 3 1306*cdf0e10cSrcweir "Numbering/Graphic/KeepRatio", // 4 1307*cdf0e10cSrcweir "FormLetter/PrintOutput/SinglePrintJobs", // 5 1308*cdf0e10cSrcweir "FormLetter/MailingOutput/Format", // 6 1309*cdf0e10cSrcweir "FormLetter/FileOutput/FileName/FromDatabaseField", // 7 1310*cdf0e10cSrcweir "FormLetter/FileOutput/Path", // 8 1311*cdf0e10cSrcweir "FormLetter/FileOutput/FileName/FromManualSetting", // 9 1312*cdf0e10cSrcweir "FormLetter/FileOutput/FileName/Generation",//10 1313*cdf0e10cSrcweir "FormLetter/PrintOutput/AskForMerge" //11 1314*cdf0e10cSrcweir }; 1315*cdf0e10cSrcweir OUString* pNames = aNames.getArray(); 1316*cdf0e10cSrcweir for(int i = 0; i < nCount; i++) 1317*cdf0e10cSrcweir pNames[i] = C2U(aPropNames[i]); 1318*cdf0e10cSrcweir } 1319*cdf0e10cSrcweir return aNames; 1320*cdf0e10cSrcweir } 1321*cdf0e10cSrcweir /*-- 18.01.01 17:02:47--------------------------------------------------- 1322*cdf0e10cSrcweir 1323*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 1324*cdf0e10cSrcweir void SwMiscConfig::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} 1325*cdf0e10cSrcweir 1326*cdf0e10cSrcweir void SwMiscConfig::Commit() 1327*cdf0e10cSrcweir { 1328*cdf0e10cSrcweir const Sequence<OUString>& aNames = GetPropertyNames(); 1329*cdf0e10cSrcweir Sequence<Any> aValues(aNames.getLength()); 1330*cdf0e10cSrcweir Any* pValues = aValues.getArray(); 1331*cdf0e10cSrcweir 1332*cdf0e10cSrcweir const Type& rType = ::getBooleanCppuType(); 1333*cdf0e10cSrcweir for(int nProp = 0; nProp < aNames.getLength(); nProp++) 1334*cdf0e10cSrcweir { 1335*cdf0e10cSrcweir switch(nProp) 1336*cdf0e10cSrcweir { 1337*cdf0e10cSrcweir case 0 : 1338*cdf0e10cSrcweir pValues[nProp] <<= OUString( 1339*cdf0e10cSrcweir SwModuleOptions::ConvertWordDelimiter(sWordDelimiter, sal_False)); 1340*cdf0e10cSrcweir break; 1341*cdf0e10cSrcweir case 1 : pValues[nProp].setValue(&bDefaultFontsInCurrDocOnly, rType); break; 1342*cdf0e10cSrcweir case 2 : pValues[nProp].setValue(&bShowIndexPreview, rType) ; break; 1343*cdf0e10cSrcweir case 3 : pValues[nProp].setValue(&bGrfToGalleryAsLnk, rType); break; 1344*cdf0e10cSrcweir case 4 : pValues[nProp].setValue(&bNumAlignSize, rType); break; 1345*cdf0e10cSrcweir case 5 : pValues[nProp].setValue(&bSinglePrintJob, rType); break; 1346*cdf0e10cSrcweir case 6 : pValues[nProp] <<= nMailingFormats; break; 1347*cdf0e10cSrcweir case 7 : pValues[nProp] <<= OUString(sNameFromColumn); break; 1348*cdf0e10cSrcweir case 8 : pValues[nProp] <<= OUString(sMailingPath); break; 1349*cdf0e10cSrcweir case 9 : pValues[nProp] <<= OUString(sMailName); break; 1350*cdf0e10cSrcweir case 10: pValues[nProp].setValue(&bIsNameFromColumn, rType);break; 1351*cdf0e10cSrcweir case 11: pValues[nProp] <<= bAskForMailMergeInPrint; break; 1352*cdf0e10cSrcweir } 1353*cdf0e10cSrcweir } 1354*cdf0e10cSrcweir PutProperties(aNames, aValues); 1355*cdf0e10cSrcweir } 1356*cdf0e10cSrcweir /*-- 18.01.01 17:02:48--------------------------------------------------- 1357*cdf0e10cSrcweir 1358*cdf0e10cSrcweir -----------------------------------------------------------------------*/ 1359*cdf0e10cSrcweir void SwMiscConfig::Load() 1360*cdf0e10cSrcweir { 1361*cdf0e10cSrcweir const Sequence<OUString>& aNames = GetPropertyNames(); 1362*cdf0e10cSrcweir Sequence<Any> aValues = GetProperties(aNames); 1363*cdf0e10cSrcweir const Any* pValues = aValues.getConstArray(); 1364*cdf0e10cSrcweir DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); 1365*cdf0e10cSrcweir if(aValues.getLength() == aNames.getLength()) 1366*cdf0e10cSrcweir { 1367*cdf0e10cSrcweir OUString sTmp; 1368*cdf0e10cSrcweir for(int nProp = 0; nProp < aNames.getLength(); nProp++) 1369*cdf0e10cSrcweir { 1370*cdf0e10cSrcweir if(pValues[nProp].hasValue()) 1371*cdf0e10cSrcweir { 1372*cdf0e10cSrcweir switch(nProp) 1373*cdf0e10cSrcweir { 1374*cdf0e10cSrcweir case 0 : pValues[nProp] >>= sTmp; 1375*cdf0e10cSrcweir sWordDelimiter = SwModuleOptions::ConvertWordDelimiter(sTmp, sal_True); 1376*cdf0e10cSrcweir break; 1377*cdf0e10cSrcweir case 1 : bDefaultFontsInCurrDocOnly = *(sal_Bool*)pValues[nProp].getValue(); break; 1378*cdf0e10cSrcweir case 2 : bShowIndexPreview = *(sal_Bool*)pValues[nProp].getValue(); break; 1379*cdf0e10cSrcweir case 3 : bGrfToGalleryAsLnk = *(sal_Bool*)pValues[nProp].getValue(); break; 1380*cdf0e10cSrcweir case 4 : bNumAlignSize = *(sal_Bool*)pValues[nProp].getValue(); break; 1381*cdf0e10cSrcweir case 5 : bSinglePrintJob = *(sal_Bool*)pValues[nProp].getValue(); break; 1382*cdf0e10cSrcweir case 6 : pValues[nProp] >>= nMailingFormats; ; break; 1383*cdf0e10cSrcweir case 7 : pValues[nProp] >>= sTmp; sNameFromColumn = sTmp; break; 1384*cdf0e10cSrcweir case 8 : pValues[nProp] >>= sTmp; sMailingPath = sTmp; break; 1385*cdf0e10cSrcweir case 9 : pValues[nProp] >>= sTmp; sMailName = sTmp; break; 1386*cdf0e10cSrcweir case 10: bIsNameFromColumn = *(sal_Bool*)pValues[nProp].getValue(); break; 1387*cdf0e10cSrcweir case 11: pValues[nProp] >>= bAskForMailMergeInPrint; break; 1388*cdf0e10cSrcweir } 1389*cdf0e10cSrcweir } 1390*cdf0e10cSrcweir } 1391*cdf0e10cSrcweir } 1392*cdf0e10cSrcweir } 1393