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_cui.hxx" 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include "cfgutil.hxx" 32*cdf0e10cSrcweir 33*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 34*cdf0e10cSrcweir #include <com/sun/star/frame/XDispatchInformationProvider.hpp> 35*cdf0e10cSrcweir #include <com/sun/star/uno/RuntimeException.hpp> 36*cdf0e10cSrcweir #include <com/sun/star/script/provider/XScriptProviderSupplier.hpp> 37*cdf0e10cSrcweir #include <com/sun/star/script/provider/XScriptProvider.hpp> 38*cdf0e10cSrcweir #include <com/sun/star/script/browse/XBrowseNode.hpp> 39*cdf0e10cSrcweir #include <com/sun/star/script/browse/BrowseNodeTypes.hpp> 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir #include <com/sun/star/script/browse/XBrowseNodeFactory.hpp> 42*cdf0e10cSrcweir #include <com/sun/star/script/browse/BrowseNodeFactoryViewTypes.hpp> 43*cdf0e10cSrcweir #include <com/sun/star/frame/XModuleManager.hpp> 44*cdf0e10cSrcweir #include <com/sun/star/frame/XDesktop.hpp> 45*cdf0e10cSrcweir #include <com/sun/star/container/XEnumerationAccess.hpp> 46*cdf0e10cSrcweir #include <com/sun/star/container/XEnumeration.hpp> 47*cdf0e10cSrcweir #include <com/sun/star/document/XDocumentInfoSupplier.hpp> 48*cdf0e10cSrcweir #include <com/sun/star/document/XScriptInvocationContext.hpp> 49*cdf0e10cSrcweir #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir #include "acccfg.hrc" 52*cdf0e10cSrcweir #include "helpid.hrc" 53*cdf0e10cSrcweir #include <basic/sbx.hxx> 54*cdf0e10cSrcweir #include <basic/basicmanagerrepository.hxx> 55*cdf0e10cSrcweir #include <basic/sbstar.hxx> 56*cdf0e10cSrcweir #include <basic/sbxmeth.hxx> 57*cdf0e10cSrcweir #include <basic/sbmod.hxx> 58*cdf0e10cSrcweir #include <basic/basmgr.hxx> 59*cdf0e10cSrcweir #include <tools/urlobj.hxx> 60*cdf0e10cSrcweir #include "cuires.hrc" 61*cdf0e10cSrcweir #include <sfx2/app.hxx> 62*cdf0e10cSrcweir #include <sfx2/minfitem.hxx> 63*cdf0e10cSrcweir #include <unotools/processfactory.hxx> 64*cdf0e10cSrcweir #include <comphelper/documentinfo.hxx> 65*cdf0e10cSrcweir #include <svtools/imagemgr.hxx> 66*cdf0e10cSrcweir #include <rtl/ustrbuf.hxx> 67*cdf0e10cSrcweir #include <comphelper/sequenceashashmap.hxx> 68*cdf0e10cSrcweir #include <unotools/configmgr.hxx> 69*cdf0e10cSrcweir #include "dialmgr.hxx" 70*cdf0e10cSrcweir #include <svl/stritem.hxx> 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir #define _SVSTDARR_STRINGSDTOR 73*cdf0e10cSrcweir #include <svl/svstdarr.hxx> 74*cdf0e10cSrcweir 75*cdf0e10cSrcweir using namespace ::com::sun::star; 76*cdf0e10cSrcweir using namespace ::com::sun::star::uno; 77*cdf0e10cSrcweir using namespace ::com::sun::star::script; 78*cdf0e10cSrcweir using namespace ::com::sun::star::frame; 79*cdf0e10cSrcweir using namespace ::com::sun::star::document; 80*cdf0e10cSrcweir namespace css = ::com::sun::star; 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir static ::rtl::OUString SERVICE_UICATEGORYDESCRIPTION = ::rtl::OUString::createFromAscii("com.sun.star.ui.UICategoryDescription" ); 83*cdf0e10cSrcweir static ::rtl::OUString SERVICE_UICMDDESCRIPTION = ::rtl::OUString::createFromAscii("com.sun.star.frame.UICommandDescription"); 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir SfxStylesInfo_Impl::SfxStylesInfo_Impl() 86*cdf0e10cSrcweir {} 87*cdf0e10cSrcweir 88*cdf0e10cSrcweir void SfxStylesInfo_Impl::setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel) 89*cdf0e10cSrcweir { 90*cdf0e10cSrcweir m_xDoc = xModel; 91*cdf0e10cSrcweir } 92*cdf0e10cSrcweir 93*cdf0e10cSrcweir static ::rtl::OUString FAMILY_CHARACTERSTYLE = ::rtl::OUString::createFromAscii("CharacterStyles"); 94*cdf0e10cSrcweir static ::rtl::OUString FAMILY_PARAGRAPHSTYLE = ::rtl::OUString::createFromAscii("ParagraphStyles"); 95*cdf0e10cSrcweir static ::rtl::OUString FAMILY_FRAMESTYLE = ::rtl::OUString::createFromAscii("FrameStyles" ); 96*cdf0e10cSrcweir static ::rtl::OUString FAMILY_PAGESTYLE = ::rtl::OUString::createFromAscii("PageStyles" ); 97*cdf0e10cSrcweir static ::rtl::OUString FAMILY_NUMBERINGSTYLE = ::rtl::OUString::createFromAscii("NumberingStyles"); 98*cdf0e10cSrcweir 99*cdf0e10cSrcweir static ::rtl::OUString CMDURL_SPART = ::rtl::OUString::createFromAscii(".uno:StyleApply?Style:string="); 100*cdf0e10cSrcweir static ::rtl::OUString CMDURL_FPART2 = ::rtl::OUString::createFromAscii("&FamilyName:string="); 101*cdf0e10cSrcweir 102*cdf0e10cSrcweir static ::rtl::OUString CMDURL_STYLEPROT_ONLY = ::rtl::OUString::createFromAscii(".uno:StyleApply?"); 103*cdf0e10cSrcweir static ::rtl::OUString CMDURL_SPART_ONLY = ::rtl::OUString::createFromAscii("Style:string="); 104*cdf0e10cSrcweir static ::rtl::OUString CMDURL_FPART_ONLY = ::rtl::OUString::createFromAscii("FamilyName:string="); 105*cdf0e10cSrcweir 106*cdf0e10cSrcweir static ::rtl::OUString STYLEPROP_UINAME = ::rtl::OUString::createFromAscii("DisplayName"); 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir ::rtl::OUString SfxStylesInfo_Impl::generateCommand(const ::rtl::OUString& sFamily, const ::rtl::OUString& sStyle) 109*cdf0e10cSrcweir { 110*cdf0e10cSrcweir ::rtl::OUStringBuffer sCommand(1024); 111*cdf0e10cSrcweir sCommand.append(CMDURL_SPART ); 112*cdf0e10cSrcweir sCommand.append(sStyle ); 113*cdf0e10cSrcweir sCommand.append(CMDURL_FPART2); 114*cdf0e10cSrcweir sCommand.append(sFamily ); 115*cdf0e10cSrcweir return sCommand.makeStringAndClear(); 116*cdf0e10cSrcweir } 117*cdf0e10cSrcweir 118*cdf0e10cSrcweir sal_Bool SfxStylesInfo_Impl::parseStyleCommand(SfxStyleInfo_Impl& aStyle) 119*cdf0e10cSrcweir { 120*cdf0e10cSrcweir static sal_Int32 LEN_STYLEPROT = CMDURL_STYLEPROT_ONLY.getLength(); 121*cdf0e10cSrcweir static sal_Int32 LEN_SPART = CMDURL_SPART_ONLY.getLength(); 122*cdf0e10cSrcweir static sal_Int32 LEN_FPART = CMDURL_FPART_ONLY.getLength(); 123*cdf0e10cSrcweir 124*cdf0e10cSrcweir if (aStyle.sCommand.indexOf(CMDURL_STYLEPROT_ONLY, 0) != 0) 125*cdf0e10cSrcweir return sal_False; 126*cdf0e10cSrcweir 127*cdf0e10cSrcweir aStyle.sFamily = ::rtl::OUString(); 128*cdf0e10cSrcweir aStyle.sStyle = ::rtl::OUString(); 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir sal_Int32 nCmdLen = aStyle.sCommand.getLength(); 131*cdf0e10cSrcweir ::rtl::OUString sCmdArgs = aStyle.sCommand.copy(LEN_STYLEPROT, nCmdLen-LEN_STYLEPROT); 132*cdf0e10cSrcweir sal_Int32 i = sCmdArgs.indexOf('&'); 133*cdf0e10cSrcweir if (i<0) 134*cdf0e10cSrcweir return sal_False; 135*cdf0e10cSrcweir 136*cdf0e10cSrcweir ::rtl::OUString sArg = sCmdArgs.copy(0, i); 137*cdf0e10cSrcweir if (sArg.indexOf(CMDURL_SPART_ONLY) == 0) 138*cdf0e10cSrcweir aStyle.sStyle = sArg.copy(LEN_SPART, sArg.getLength()-LEN_SPART); 139*cdf0e10cSrcweir else 140*cdf0e10cSrcweir if (sArg.indexOf(CMDURL_FPART_ONLY) == 0) 141*cdf0e10cSrcweir aStyle.sFamily = sArg.copy(LEN_FPART, sArg.getLength()-LEN_FPART); 142*cdf0e10cSrcweir 143*cdf0e10cSrcweir sArg = sCmdArgs.copy(i+1, sCmdArgs.getLength()-i-1); 144*cdf0e10cSrcweir if (sArg.indexOf(CMDURL_SPART_ONLY) == 0) 145*cdf0e10cSrcweir aStyle.sStyle = sArg.copy(LEN_SPART, sArg.getLength()-LEN_SPART); 146*cdf0e10cSrcweir else 147*cdf0e10cSrcweir if (sArg.indexOf(CMDURL_FPART_ONLY) == 0) 148*cdf0e10cSrcweir aStyle.sFamily = sArg.copy(LEN_FPART, sArg.getLength()-LEN_FPART); 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir if (aStyle.sFamily.getLength() && aStyle.sStyle.getLength()) 151*cdf0e10cSrcweir return sal_True; 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir return sal_False; 154*cdf0e10cSrcweir } 155*cdf0e10cSrcweir 156*cdf0e10cSrcweir void SfxStylesInfo_Impl::getLabel4Style(SfxStyleInfo_Impl& aStyle) 157*cdf0e10cSrcweir { 158*cdf0e10cSrcweir try 159*cdf0e10cSrcweir { 160*cdf0e10cSrcweir css::uno::Reference< css::style::XStyleFamiliesSupplier > xModel(m_xDoc, css::uno::UNO_QUERY); 161*cdf0e10cSrcweir 162*cdf0e10cSrcweir css::uno::Reference< css::container::XNameAccess > xFamilies; 163*cdf0e10cSrcweir if (xModel.is()) 164*cdf0e10cSrcweir xFamilies = xModel->getStyleFamilies(); 165*cdf0e10cSrcweir 166*cdf0e10cSrcweir css::uno::Reference< css::container::XNameAccess > xStyleSet; 167*cdf0e10cSrcweir if (xFamilies.is()) 168*cdf0e10cSrcweir xFamilies->getByName(aStyle.sFamily) >>= xStyleSet; 169*cdf0e10cSrcweir 170*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xStyle; 171*cdf0e10cSrcweir if (xStyleSet.is()) 172*cdf0e10cSrcweir xStyleSet->getByName(aStyle.sStyle) >>= xStyle; 173*cdf0e10cSrcweir 174*cdf0e10cSrcweir aStyle.sLabel = ::rtl::OUString(); 175*cdf0e10cSrcweir if (xStyle.is()) 176*cdf0e10cSrcweir xStyle->getPropertyValue(STYLEPROP_UINAME) >>= aStyle.sLabel; 177*cdf0e10cSrcweir } 178*cdf0e10cSrcweir catch(const css::uno::RuntimeException& exRun) 179*cdf0e10cSrcweir { throw exRun; } 180*cdf0e10cSrcweir catch(const css::uno::Exception&) 181*cdf0e10cSrcweir { aStyle.sLabel = ::rtl::OUString(); } 182*cdf0e10cSrcweir 183*cdf0e10cSrcweir if (!aStyle.sLabel.getLength()) 184*cdf0e10cSrcweir { 185*cdf0e10cSrcweir aStyle.sLabel = aStyle.sCommand; 186*cdf0e10cSrcweir /* 187*cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 188*cdf0e10cSrcweir ::rtl::OUStringBuffer sMsg(256); 189*cdf0e10cSrcweir sMsg.appendAscii("There is no UIName for the style command \""); 190*cdf0e10cSrcweir sMsg.append (aStyle.sCommand ); 191*cdf0e10cSrcweir sMsg.appendAscii("\". The UI will be invalid then ..." ); 192*cdf0e10cSrcweir OSL_ENSURE(sal_False, ::rtl::OUStringToOString(sMsg.makeStringAndClear(), RTL_TEXTENCODING_UTF8).getStr()); 193*cdf0e10cSrcweir #endif 194*cdf0e10cSrcweir */ 195*cdf0e10cSrcweir } 196*cdf0e10cSrcweir } 197*cdf0e10cSrcweir 198*cdf0e10cSrcweir ::std::vector< SfxStyleInfo_Impl > SfxStylesInfo_Impl::getStyleFamilies() 199*cdf0e10cSrcweir { 200*cdf0e10cSrcweir // Its an optional interface! 201*cdf0e10cSrcweir css::uno::Reference< css::style::XStyleFamiliesSupplier > xModel(m_xDoc, css::uno::UNO_QUERY); 202*cdf0e10cSrcweir if (!xModel.is()) 203*cdf0e10cSrcweir return ::std::vector< SfxStyleInfo_Impl >(); 204*cdf0e10cSrcweir 205*cdf0e10cSrcweir css::uno::Reference< css::container::XNameAccess > xCont = xModel->getStyleFamilies(); 206*cdf0e10cSrcweir css::uno::Sequence< ::rtl::OUString > lFamilyNames = xCont->getElementNames(); 207*cdf0e10cSrcweir ::std::vector< SfxStyleInfo_Impl > lFamilies; 208*cdf0e10cSrcweir sal_Int32 c = lFamilyNames.getLength(); 209*cdf0e10cSrcweir sal_Int32 i = 0; 210*cdf0e10cSrcweir for(i=0; i<c; ++i) 211*cdf0e10cSrcweir { 212*cdf0e10cSrcweir SfxStyleInfo_Impl aFamilyInfo; 213*cdf0e10cSrcweir aFamilyInfo.sFamily = lFamilyNames[i]; 214*cdf0e10cSrcweir 215*cdf0e10cSrcweir try 216*cdf0e10cSrcweir { 217*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xFamilyInfo; 218*cdf0e10cSrcweir xCont->getByName(aFamilyInfo.sFamily) >>= xFamilyInfo; 219*cdf0e10cSrcweir if (!xFamilyInfo.is()) 220*cdf0e10cSrcweir { 221*cdf0e10cSrcweir // TODO_AS currently there is no support for an UIName property .. use internal family name instead 222*cdf0e10cSrcweir aFamilyInfo.sLabel = aFamilyInfo.sFamily; 223*cdf0e10cSrcweir } 224*cdf0e10cSrcweir else 225*cdf0e10cSrcweir xFamilyInfo->getPropertyValue(STYLEPROP_UINAME) >>= aFamilyInfo.sLabel; 226*cdf0e10cSrcweir } 227*cdf0e10cSrcweir catch(const css::uno::RuntimeException& exRun) 228*cdf0e10cSrcweir { throw exRun; } 229*cdf0e10cSrcweir catch(const css::uno::Exception&) 230*cdf0e10cSrcweir { return ::std::vector< SfxStyleInfo_Impl >(); } 231*cdf0e10cSrcweir 232*cdf0e10cSrcweir lFamilies.push_back(aFamilyInfo); 233*cdf0e10cSrcweir } 234*cdf0e10cSrcweir 235*cdf0e10cSrcweir return lFamilies; 236*cdf0e10cSrcweir } 237*cdf0e10cSrcweir 238*cdf0e10cSrcweir ::std::vector< SfxStyleInfo_Impl > SfxStylesInfo_Impl::getStyles(const ::rtl::OUString& sFamily) 239*cdf0e10cSrcweir { 240*cdf0e10cSrcweir static ::rtl::OUString PROP_UINAME = ::rtl::OUString::createFromAscii("DisplayName"); 241*cdf0e10cSrcweir 242*cdf0e10cSrcweir css::uno::Sequence< ::rtl::OUString > lStyleNames; 243*cdf0e10cSrcweir css::uno::Reference< css::style::XStyleFamiliesSupplier > xModel(m_xDoc, css::uno::UNO_QUERY_THROW); 244*cdf0e10cSrcweir css::uno::Reference< css::container::XNameAccess > xFamilies = xModel->getStyleFamilies(); 245*cdf0e10cSrcweir css::uno::Reference< css::container::XNameAccess > xStyleSet; 246*cdf0e10cSrcweir try 247*cdf0e10cSrcweir { 248*cdf0e10cSrcweir xFamilies->getByName(sFamily) >>= xStyleSet; 249*cdf0e10cSrcweir lStyleNames = xStyleSet->getElementNames(); 250*cdf0e10cSrcweir } 251*cdf0e10cSrcweir catch(const css::uno::RuntimeException& exRun) 252*cdf0e10cSrcweir { throw exRun; } 253*cdf0e10cSrcweir catch(const css::uno::Exception&) 254*cdf0e10cSrcweir { return ::std::vector< SfxStyleInfo_Impl >(); } 255*cdf0e10cSrcweir 256*cdf0e10cSrcweir ::std::vector< SfxStyleInfo_Impl > lStyles; 257*cdf0e10cSrcweir sal_Int32 c = lStyleNames.getLength(); 258*cdf0e10cSrcweir sal_Int32 i = 0; 259*cdf0e10cSrcweir for (i=0; i<c; ++i) 260*cdf0e10cSrcweir { 261*cdf0e10cSrcweir SfxStyleInfo_Impl aStyleInfo; 262*cdf0e10cSrcweir aStyleInfo.sFamily = sFamily; 263*cdf0e10cSrcweir aStyleInfo.sStyle = lStyleNames[i]; 264*cdf0e10cSrcweir aStyleInfo.sCommand = SfxStylesInfo_Impl::generateCommand(aStyleInfo.sFamily, aStyleInfo.sStyle); 265*cdf0e10cSrcweir 266*cdf0e10cSrcweir try 267*cdf0e10cSrcweir { 268*cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > xStyle; 269*cdf0e10cSrcweir xStyleSet->getByName(aStyleInfo.sStyle) >>= xStyle; 270*cdf0e10cSrcweir if (!xStyle.is()) 271*cdf0e10cSrcweir continue; 272*cdf0e10cSrcweir xStyle->getPropertyValue(PROP_UINAME) >>= aStyleInfo.sLabel; 273*cdf0e10cSrcweir } 274*cdf0e10cSrcweir catch(const css::uno::RuntimeException& exRun) 275*cdf0e10cSrcweir { throw exRun; } 276*cdf0e10cSrcweir catch(const css::uno::Exception&) 277*cdf0e10cSrcweir { continue; } 278*cdf0e10cSrcweir 279*cdf0e10cSrcweir lStyles.push_back(aStyleInfo); 280*cdf0e10cSrcweir } 281*cdf0e10cSrcweir return lStyles; 282*cdf0e10cSrcweir } 283*cdf0e10cSrcweir SV_IMPL_PTRARR(SfxGroupInfoArr_Impl, SfxGroupInfoPtr); 284*cdf0e10cSrcweir SfxConfigFunctionListBox_Impl::SfxConfigFunctionListBox_Impl( Window* pParent, const ResId& rResId) 285*cdf0e10cSrcweir : SvTreeListBox( pParent, rResId ) 286*cdf0e10cSrcweir , pCurEntry( 0 ) 287*cdf0e10cSrcweir , pStylesInfo( 0 ) 288*cdf0e10cSrcweir { 289*cdf0e10cSrcweir SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT ); 290*cdf0e10cSrcweir GetModel()->SetSortMode( SortAscending ); 291*cdf0e10cSrcweir 292*cdf0e10cSrcweir // Timer f"ur die BallonHelp 293*cdf0e10cSrcweir aTimer.SetTimeout( 200 ); 294*cdf0e10cSrcweir aTimer.SetTimeoutHdl( 295*cdf0e10cSrcweir LINK( this, SfxConfigFunctionListBox_Impl, TimerHdl ) ); 296*cdf0e10cSrcweir } 297*cdf0e10cSrcweir 298*cdf0e10cSrcweir SfxConfigFunctionListBox_Impl::~SfxConfigFunctionListBox_Impl() 299*cdf0e10cSrcweir { 300*cdf0e10cSrcweir ClearAll(); 301*cdf0e10cSrcweir } 302*cdf0e10cSrcweir 303*cdf0e10cSrcweir void SfxConfigFunctionListBox_Impl::MouseMove( const MouseEvent& ) 304*cdf0e10cSrcweir { 305*cdf0e10cSrcweir /* --> PB 2004-12-01 #i37000# - no own help text needed any longer 306*cdf0e10cSrcweir Point aMousePos = rMEvt.GetPosPixel(); 307*cdf0e10cSrcweir pCurEntry = GetCurEntry(); 308*cdf0e10cSrcweir 309*cdf0e10cSrcweir if ( pCurEntry && GetEntry( aMousePos ) == pCurEntry ) 310*cdf0e10cSrcweir aTimer.Start(); 311*cdf0e10cSrcweir else 312*cdf0e10cSrcweir { 313*cdf0e10cSrcweir Help::ShowBalloon( this, aMousePos, String() ); 314*cdf0e10cSrcweir aTimer.Stop(); 315*cdf0e10cSrcweir } 316*cdf0e10cSrcweir */ 317*cdf0e10cSrcweir } 318*cdf0e10cSrcweir 319*cdf0e10cSrcweir 320*cdf0e10cSrcweir IMPL_LINK( SfxConfigFunctionListBox_Impl, TimerHdl, Timer*, pTimer) 321*cdf0e10cSrcweir /* Beschreibung 322*cdf0e10cSrcweir Timer-Handler f"ur die Einblendung eines Hilfetextes. Wenn nach Ablauf des Timers 323*cdf0e10cSrcweir der Mauszeiger immer noch auf dem aktuell selektierten Eintrag steht, wird der 324*cdf0e10cSrcweir Helptext des Entries als Balloon-Help eingeblendet. 325*cdf0e10cSrcweir */ 326*cdf0e10cSrcweir { 327*cdf0e10cSrcweir (void)pTimer; // unused 328*cdf0e10cSrcweir /* --> PB 2004-12-01 #i37000# - no own help text needed any longer 329*cdf0e10cSrcweir aTimer.Stop(); 330*cdf0e10cSrcweir Point aMousePos = GetPointerPosPixel(); 331*cdf0e10cSrcweir SvLBoxEntry *pEntry = GetCurEntry(); 332*cdf0e10cSrcweir if ( pEntry && GetEntry( aMousePos ) == pEntry && pCurEntry == pEntry ) 333*cdf0e10cSrcweir { 334*cdf0e10cSrcweir String sHelpText = GetHelpText( pEntry ); 335*cdf0e10cSrcweir Help::ShowBalloon( this, OutputToScreenPixel( aMousePos ), sHelpText ); 336*cdf0e10cSrcweir } 337*cdf0e10cSrcweir */ 338*cdf0e10cSrcweir return 0L; 339*cdf0e10cSrcweir } 340*cdf0e10cSrcweir 341*cdf0e10cSrcweir void SfxConfigFunctionListBox_Impl::ClearAll() 342*cdf0e10cSrcweir /* Beschreibung 343*cdf0e10cSrcweir L"oscht alle Eintr"age in der FunctionListBox, alle UserDaten und alle evtl. 344*cdf0e10cSrcweir vorhandenen MacroInfos. 345*cdf0e10cSrcweir */ 346*cdf0e10cSrcweir { 347*cdf0e10cSrcweir sal_uInt16 nCount = aArr.Count(); 348*cdf0e10cSrcweir for ( sal_uInt16 i=0; i<nCount; i++ ) 349*cdf0e10cSrcweir { 350*cdf0e10cSrcweir SfxGroupInfo_Impl *pData = aArr[i]; 351*cdf0e10cSrcweir 352*cdf0e10cSrcweir if ( pData->nKind == SFX_CFGFUNCTION_SCRIPT ) 353*cdf0e10cSrcweir { 354*cdf0e10cSrcweir String* pScriptURI = (String*)pData->pObject; 355*cdf0e10cSrcweir delete pScriptURI; 356*cdf0e10cSrcweir } 357*cdf0e10cSrcweir 358*cdf0e10cSrcweir if ( pData->nKind == SFX_CFGGROUP_SCRIPTCONTAINER 359*cdf0e10cSrcweir ) 360*cdf0e10cSrcweir { 361*cdf0e10cSrcweir XInterface* xi = static_cast<XInterface *>(pData->pObject); 362*cdf0e10cSrcweir if (xi != NULL) 363*cdf0e10cSrcweir { 364*cdf0e10cSrcweir xi->release(); 365*cdf0e10cSrcweir } 366*cdf0e10cSrcweir } 367*cdf0e10cSrcweir 368*cdf0e10cSrcweir delete pData; 369*cdf0e10cSrcweir } 370*cdf0e10cSrcweir 371*cdf0e10cSrcweir aArr.Remove( 0, nCount ); 372*cdf0e10cSrcweir Clear(); 373*cdf0e10cSrcweir } 374*cdf0e10cSrcweir 375*cdf0e10cSrcweir String SfxConfigFunctionListBox_Impl::GetSelectedScriptURI() 376*cdf0e10cSrcweir { 377*cdf0e10cSrcweir SvLBoxEntry *pEntry = FirstSelected(); 378*cdf0e10cSrcweir if ( pEntry ) 379*cdf0e10cSrcweir { 380*cdf0e10cSrcweir SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData(); 381*cdf0e10cSrcweir if ( pData && ( pData->nKind == SFX_CFGFUNCTION_SCRIPT ) ) 382*cdf0e10cSrcweir return *(String*)pData->pObject; 383*cdf0e10cSrcweir } 384*cdf0e10cSrcweir return String(); 385*cdf0e10cSrcweir } 386*cdf0e10cSrcweir 387*cdf0e10cSrcweir String SfxConfigFunctionListBox_Impl::GetCurCommand() 388*cdf0e10cSrcweir { 389*cdf0e10cSrcweir SvLBoxEntry *pEntry = FirstSelected(); 390*cdf0e10cSrcweir if (!pEntry) 391*cdf0e10cSrcweir return String(); 392*cdf0e10cSrcweir SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData(); 393*cdf0e10cSrcweir if (!pData) 394*cdf0e10cSrcweir return String(); 395*cdf0e10cSrcweir return pData->sCommand; 396*cdf0e10cSrcweir } 397*cdf0e10cSrcweir 398*cdf0e10cSrcweir String SfxConfigFunctionListBox_Impl::GetCurLabel() 399*cdf0e10cSrcweir { 400*cdf0e10cSrcweir SvLBoxEntry *pEntry = FirstSelected(); 401*cdf0e10cSrcweir if (!pEntry) 402*cdf0e10cSrcweir return String(); 403*cdf0e10cSrcweir SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData(); 404*cdf0e10cSrcweir if (!pData) 405*cdf0e10cSrcweir return String(); 406*cdf0e10cSrcweir if (pData->sLabel.Len()) 407*cdf0e10cSrcweir return pData->sLabel; 408*cdf0e10cSrcweir return pData->sCommand; 409*cdf0e10cSrcweir } 410*cdf0e10cSrcweir 411*cdf0e10cSrcweir void SfxConfigFunctionListBox_Impl::FunctionSelected() 412*cdf0e10cSrcweir /* Beschreibung 413*cdf0e10cSrcweir Setzt die Balloonhelp zur"uck, da diese immer den Helptext des selektierten 414*cdf0e10cSrcweir Entry anzeigen soll. 415*cdf0e10cSrcweir */ 416*cdf0e10cSrcweir { 417*cdf0e10cSrcweir /* --> PB 2004-12-01 #i37000# - no own help text needed any longer 418*cdf0e10cSrcweir Help::ShowBalloon( this, Point(), String() ); 419*cdf0e10cSrcweir */ 420*cdf0e10cSrcweir } 421*cdf0e10cSrcweir 422*cdf0e10cSrcweir void SfxConfigFunctionListBox_Impl::SetStylesInfo(SfxStylesInfo_Impl* pStyles) 423*cdf0e10cSrcweir { 424*cdf0e10cSrcweir pStylesInfo = pStyles; 425*cdf0e10cSrcweir } 426*cdf0e10cSrcweir 427*cdf0e10cSrcweir struct SvxConfigGroupBoxResource_Impl : public Resource 428*cdf0e10cSrcweir { 429*cdf0e10cSrcweir Image m_hdImage; 430*cdf0e10cSrcweir Image m_hdImage_hc; 431*cdf0e10cSrcweir Image m_libImage; 432*cdf0e10cSrcweir Image m_libImage_hc; 433*cdf0e10cSrcweir Image m_macImage; 434*cdf0e10cSrcweir Image m_macImage_hc; 435*cdf0e10cSrcweir Image m_docImage; 436*cdf0e10cSrcweir Image m_docImage_hc; 437*cdf0e10cSrcweir ::rtl::OUString m_sMyMacros; 438*cdf0e10cSrcweir ::rtl::OUString m_sProdMacros; 439*cdf0e10cSrcweir String m_sMacros; 440*cdf0e10cSrcweir String m_sDlgMacros; 441*cdf0e10cSrcweir String m_aHumanAppName; 442*cdf0e10cSrcweir String m_aStrGroupStyles; 443*cdf0e10cSrcweir Image m_collapsedImage; 444*cdf0e10cSrcweir Image m_collapsedImage_hc; 445*cdf0e10cSrcweir Image m_expandedImage; 446*cdf0e10cSrcweir Image m_expandedImage_hc; 447*cdf0e10cSrcweir 448*cdf0e10cSrcweir SvxConfigGroupBoxResource_Impl(); 449*cdf0e10cSrcweir }; 450*cdf0e10cSrcweir 451*cdf0e10cSrcweir SvxConfigGroupBoxResource_Impl::SvxConfigGroupBoxResource_Impl() : 452*cdf0e10cSrcweir Resource(CUI_RES(RID_SVXPAGE_CONFIGGROUPBOX)), 453*cdf0e10cSrcweir m_hdImage(CUI_RES(IMG_HARDDISK)), 454*cdf0e10cSrcweir m_hdImage_hc(CUI_RES(IMG_HARDDISK_HC)), 455*cdf0e10cSrcweir m_libImage(CUI_RES(IMG_LIB)), 456*cdf0e10cSrcweir m_libImage_hc(CUI_RES(IMG_LIB_HC)), 457*cdf0e10cSrcweir m_macImage(CUI_RES(IMG_MACRO)), 458*cdf0e10cSrcweir m_macImage_hc(CUI_RES(IMG_MACRO_HC)), 459*cdf0e10cSrcweir m_docImage(CUI_RES(IMG_DOC)), 460*cdf0e10cSrcweir m_docImage_hc(CUI_RES(IMG_DOC_HC)), 461*cdf0e10cSrcweir m_sMyMacros(String(CUI_RES(STR_MYMACROS))), 462*cdf0e10cSrcweir m_sProdMacros(String(CUI_RES(STR_PRODMACROS))), 463*cdf0e10cSrcweir m_sMacros(String(CUI_RES(STR_BASICMACROS))), 464*cdf0e10cSrcweir m_sDlgMacros(String(CUI_RES(STR_DLG_MACROS))), 465*cdf0e10cSrcweir m_aHumanAppName(String(CUI_RES(STR_HUMAN_APPNAME))), 466*cdf0e10cSrcweir m_aStrGroupStyles(String(CUI_RES(STR_GROUP_STYLES))), 467*cdf0e10cSrcweir m_collapsedImage(CUI_RES(BMP_COLLAPSED)), 468*cdf0e10cSrcweir m_collapsedImage_hc(CUI_RES(BMP_COLLAPSED_HC)), 469*cdf0e10cSrcweir m_expandedImage(CUI_RES(BMP_EXPANDED)), 470*cdf0e10cSrcweir m_expandedImage_hc(CUI_RES(BMP_EXPANDED_HC)) 471*cdf0e10cSrcweir { 472*cdf0e10cSrcweir FreeResource(); 473*cdf0e10cSrcweir } 474*cdf0e10cSrcweir 475*cdf0e10cSrcweir SfxConfigGroupListBox_Impl::SfxConfigGroupListBox_Impl( 476*cdf0e10cSrcweir Window* pParent, const ResId& rResId, sal_uLong nConfigMode ) 477*cdf0e10cSrcweir : SvTreeListBox( pParent, rResId ) 478*cdf0e10cSrcweir , pImp(new SvxConfigGroupBoxResource_Impl()), pFunctionListBox(0), nMode( nConfigMode ), pStylesInfo(0) 479*cdf0e10cSrcweir { 480*cdf0e10cSrcweir SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT ); 481*cdf0e10cSrcweir SetNodeBitmaps( pImp->m_collapsedImage, pImp->m_expandedImage, BMP_COLOR_NORMAL ); 482*cdf0e10cSrcweir SetNodeBitmaps( pImp->m_collapsedImage_hc, pImp->m_expandedImage_hc, BMP_COLOR_HIGHCONTRAST ); 483*cdf0e10cSrcweir } 484*cdf0e10cSrcweir 485*cdf0e10cSrcweir 486*cdf0e10cSrcweir SfxConfigGroupListBox_Impl::~SfxConfigGroupListBox_Impl() 487*cdf0e10cSrcweir { 488*cdf0e10cSrcweir ClearAll(); 489*cdf0e10cSrcweir } 490*cdf0e10cSrcweir 491*cdf0e10cSrcweir void SfxConfigGroupListBox_Impl::ClearAll() 492*cdf0e10cSrcweir { 493*cdf0e10cSrcweir sal_uInt16 nCount = aArr.Count(); 494*cdf0e10cSrcweir for ( sal_uInt16 i=0; i<nCount; i++ ) 495*cdf0e10cSrcweir { 496*cdf0e10cSrcweir SfxGroupInfo_Impl *pData = aArr[i]; 497*cdf0e10cSrcweir if ( pData->nKind == SFX_CFGGROUP_SCRIPTCONTAINER 498*cdf0e10cSrcweir ) 499*cdf0e10cSrcweir { 500*cdf0e10cSrcweir XInterface* xi = static_cast<XInterface *>(pData->pObject); 501*cdf0e10cSrcweir if (xi != NULL) 502*cdf0e10cSrcweir { 503*cdf0e10cSrcweir xi->release(); 504*cdf0e10cSrcweir } 505*cdf0e10cSrcweir } 506*cdf0e10cSrcweir delete pData; 507*cdf0e10cSrcweir } 508*cdf0e10cSrcweir 509*cdf0e10cSrcweir aArr.Remove( 0, nCount ); 510*cdf0e10cSrcweir Clear(); 511*cdf0e10cSrcweir } 512*cdf0e10cSrcweir 513*cdf0e10cSrcweir void SfxConfigGroupListBox_Impl::SetStylesInfo(SfxStylesInfo_Impl* pStyles) 514*cdf0e10cSrcweir { 515*cdf0e10cSrcweir pStylesInfo = pStyles; 516*cdf0e10cSrcweir } 517*cdf0e10cSrcweir 518*cdf0e10cSrcweir String SfxConfigGroupListBox_Impl::GetGroup() 519*cdf0e10cSrcweir /* Beschreibung 520*cdf0e10cSrcweir Gibt den Namen der selektierten Funktionsgruppe bzw. des selektierten 521*cdf0e10cSrcweir Basics zur"uck. 522*cdf0e10cSrcweir */ 523*cdf0e10cSrcweir { 524*cdf0e10cSrcweir SvLBoxEntry *pEntry = FirstSelected(); 525*cdf0e10cSrcweir while ( pEntry ) 526*cdf0e10cSrcweir { 527*cdf0e10cSrcweir SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData(); 528*cdf0e10cSrcweir if ( pInfo->nKind == SFX_CFGGROUP_FUNCTION ) 529*cdf0e10cSrcweir return GetEntryText( pEntry ); 530*cdf0e10cSrcweir 531*cdf0e10cSrcweir pEntry = GetParent( pEntry ); 532*cdf0e10cSrcweir } 533*cdf0e10cSrcweir 534*cdf0e10cSrcweir return String(); 535*cdf0e10cSrcweir } 536*cdf0e10cSrcweir 537*cdf0e10cSrcweir //----------------------------------------------- 538*cdf0e10cSrcweir void SfxConfigGroupListBox_Impl::InitModule() 539*cdf0e10cSrcweir { 540*cdf0e10cSrcweir try 541*cdf0e10cSrcweir { 542*cdf0e10cSrcweir css::uno::Reference< css::frame::XDispatchInformationProvider > xProvider(m_xFrame, css::uno::UNO_QUERY_THROW); 543*cdf0e10cSrcweir css::uno::Sequence< sal_Int16 > lGroups = xProvider->getSupportedCommandGroups(); 544*cdf0e10cSrcweir sal_Int32 c1 = lGroups.getLength(); 545*cdf0e10cSrcweir sal_Int32 i1 = 0; 546*cdf0e10cSrcweir 547*cdf0e10cSrcweir for (i1=0; i1<c1; ++i1) 548*cdf0e10cSrcweir { 549*cdf0e10cSrcweir sal_Int16& rGroupID = lGroups[i1]; 550*cdf0e10cSrcweir ::rtl::OUString sGroupID = ::rtl::OUString::valueOf((sal_Int32)rGroupID); 551*cdf0e10cSrcweir ::rtl::OUString sGroupName ; 552*cdf0e10cSrcweir 553*cdf0e10cSrcweir try 554*cdf0e10cSrcweir { 555*cdf0e10cSrcweir m_xModuleCategoryInfo->getByName(sGroupID) >>= sGroupName; 556*cdf0e10cSrcweir if (!sGroupName.getLength()) 557*cdf0e10cSrcweir continue; 558*cdf0e10cSrcweir } 559*cdf0e10cSrcweir catch(const css::container::NoSuchElementException&) 560*cdf0e10cSrcweir { continue; } 561*cdf0e10cSrcweir 562*cdf0e10cSrcweir SvLBoxEntry* pEntry = InsertEntry(sGroupName, NULL); 563*cdf0e10cSrcweir SfxGroupInfo_Impl* pInfo = new SfxGroupInfo_Impl(SFX_CFGGROUP_FUNCTION, rGroupID); 564*cdf0e10cSrcweir pEntry->SetUserData(pInfo); 565*cdf0e10cSrcweir } 566*cdf0e10cSrcweir } 567*cdf0e10cSrcweir catch(const css::uno::RuntimeException& exRun) 568*cdf0e10cSrcweir { throw exRun; } 569*cdf0e10cSrcweir catch(const css::uno::Exception&) 570*cdf0e10cSrcweir {} 571*cdf0e10cSrcweir } 572*cdf0e10cSrcweir 573*cdf0e10cSrcweir //----------------------------------------------- 574*cdf0e10cSrcweir void SfxConfigGroupListBox_Impl::InitBasic() 575*cdf0e10cSrcweir { 576*cdf0e10cSrcweir } 577*cdf0e10cSrcweir 578*cdf0e10cSrcweir //----------------------------------------------- 579*cdf0e10cSrcweir void SfxConfigGroupListBox_Impl::InitStyles() 580*cdf0e10cSrcweir { 581*cdf0e10cSrcweir } 582*cdf0e10cSrcweir 583*cdf0e10cSrcweir //----------------------------------------------- 584*cdf0e10cSrcweir namespace 585*cdf0e10cSrcweir { 586*cdf0e10cSrcweir //........................................... 587*cdf0e10cSrcweir /** examines a component whether it supports XEmbeddedScripts, or provides access to such a 588*cdf0e10cSrcweir component by implementing XScriptInvocationContext. 589*cdf0e10cSrcweir @return 590*cdf0e10cSrcweir the model which supports the embedded scripts, or <NULL/> if it cannot find such a 591*cdf0e10cSrcweir model 592*cdf0e10cSrcweir */ 593*cdf0e10cSrcweir static Reference< XModel > lcl_getDocumentWithScripts_throw( const Reference< XInterface >& _rxComponent ) 594*cdf0e10cSrcweir { 595*cdf0e10cSrcweir Reference< XEmbeddedScripts > xScripts( _rxComponent, UNO_QUERY ); 596*cdf0e10cSrcweir if ( !xScripts.is() ) 597*cdf0e10cSrcweir { 598*cdf0e10cSrcweir Reference< XScriptInvocationContext > xContext( _rxComponent, UNO_QUERY ); 599*cdf0e10cSrcweir if ( xContext.is() ) 600*cdf0e10cSrcweir xScripts.set( xContext->getScriptContainer(), UNO_QUERY ); 601*cdf0e10cSrcweir } 602*cdf0e10cSrcweir 603*cdf0e10cSrcweir return Reference< XModel >( xScripts, UNO_QUERY ); 604*cdf0e10cSrcweir } 605*cdf0e10cSrcweir 606*cdf0e10cSrcweir //........................................... 607*cdf0e10cSrcweir static Reference< XModel > lcl_getScriptableDocument_nothrow( const Reference< XFrame >& _rxFrame ) 608*cdf0e10cSrcweir { 609*cdf0e10cSrcweir Reference< XModel > xDocument; 610*cdf0e10cSrcweir 611*cdf0e10cSrcweir // examine our associated frame 612*cdf0e10cSrcweir try 613*cdf0e10cSrcweir { 614*cdf0e10cSrcweir OSL_ENSURE( _rxFrame.is(), "lcl_getScriptableDocument_nothrow: you need to pass a frame to this dialog/tab page!" ); 615*cdf0e10cSrcweir if ( _rxFrame.is() ) 616*cdf0e10cSrcweir { 617*cdf0e10cSrcweir // first try the model in the frame 618*cdf0e10cSrcweir Reference< XController > xController( _rxFrame->getController(), UNO_SET_THROW ); 619*cdf0e10cSrcweir xDocument = lcl_getDocumentWithScripts_throw( xController->getModel() ); 620*cdf0e10cSrcweir 621*cdf0e10cSrcweir if ( !xDocument.is() ) 622*cdf0e10cSrcweir { 623*cdf0e10cSrcweir // if there is no suitable document in the frame, try the controller 624*cdf0e10cSrcweir xDocument = lcl_getDocumentWithScripts_throw( _rxFrame->getController() ); 625*cdf0e10cSrcweir } 626*cdf0e10cSrcweir } 627*cdf0e10cSrcweir } 628*cdf0e10cSrcweir catch( const Exception& ) 629*cdf0e10cSrcweir { 630*cdf0e10cSrcweir //DBG_UNHANDLED_EXCEPTION(); 631*cdf0e10cSrcweir } 632*cdf0e10cSrcweir 633*cdf0e10cSrcweir return xDocument; 634*cdf0e10cSrcweir } 635*cdf0e10cSrcweir } 636*cdf0e10cSrcweir 637*cdf0e10cSrcweir //----------------------------------------------- 638*cdf0e10cSrcweir void SfxConfigGroupListBox_Impl::Init(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR , 639*cdf0e10cSrcweir const css::uno::Reference< css::frame::XFrame >& xFrame , 640*cdf0e10cSrcweir const ::rtl::OUString& sModuleLongName) 641*cdf0e10cSrcweir { 642*cdf0e10cSrcweir SetUpdateMode(sal_False); 643*cdf0e10cSrcweir ClearAll(); // Remove all old entries from treelist box 644*cdf0e10cSrcweir 645*cdf0e10cSrcweir m_xFrame = xFrame; 646*cdf0e10cSrcweir if ( xSMGR.is()) 647*cdf0e10cSrcweir { 648*cdf0e10cSrcweir m_xSMGR = xSMGR; 649*cdf0e10cSrcweir m_sModuleLongName = sModuleLongName; 650*cdf0e10cSrcweir 651*cdf0e10cSrcweir m_xGlobalCategoryInfo = css::uno::Reference< css::container::XNameAccess >(m_xSMGR->createInstance(SERVICE_UICATEGORYDESCRIPTION), css::uno::UNO_QUERY_THROW); 652*cdf0e10cSrcweir m_xModuleCategoryInfo = css::uno::Reference< css::container::XNameAccess >(m_xGlobalCategoryInfo->getByName(m_sModuleLongName) , css::uno::UNO_QUERY_THROW); 653*cdf0e10cSrcweir m_xUICmdDescription = css::uno::Reference< css::container::XNameAccess >(m_xSMGR->createInstance(SERVICE_UICMDDESCRIPTION) , css::uno::UNO_QUERY_THROW); 654*cdf0e10cSrcweir 655*cdf0e10cSrcweir InitModule(); 656*cdf0e10cSrcweir InitBasic(); 657*cdf0e10cSrcweir InitStyles(); 658*cdf0e10cSrcweir } 659*cdf0e10cSrcweir 660*cdf0e10cSrcweir OSL_TRACE("** ** About to initialise SF Scripts"); 661*cdf0e10cSrcweir // Add Scripting Framework entries 662*cdf0e10cSrcweir Reference< browse::XBrowseNode > rootNode; 663*cdf0e10cSrcweir Reference< XComponentContext > xCtx; 664*cdf0e10cSrcweir try 665*cdf0e10cSrcweir { 666*cdf0e10cSrcweir Reference < beans::XPropertySet > xProps( 667*cdf0e10cSrcweir ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW ); 668*cdf0e10cSrcweir xCtx.set( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY_THROW ); 669*cdf0e10cSrcweir Reference< browse::XBrowseNodeFactory > xFac( xCtx->getValueByName( 670*cdf0e10cSrcweir ::rtl::OUString::createFromAscii( "/singletons/com.sun.star.script.browse.theBrowseNodeFactory") ), UNO_QUERY_THROW ); 671*cdf0e10cSrcweir rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROSELECTOR ) ); 672*cdf0e10cSrcweir //rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROORGANIZER ) ); 673*cdf0e10cSrcweir } 674*cdf0e10cSrcweir catch( Exception& e ) 675*cdf0e10cSrcweir { 676*cdf0e10cSrcweir OSL_TRACE(" Caught some exception whilst retrieving browse nodes from factory... Exception: %s", 677*cdf0e10cSrcweir ::rtl::OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).pData->buffer ); 678*cdf0e10cSrcweir // TODO exception handling 679*cdf0e10cSrcweir } 680*cdf0e10cSrcweir 681*cdf0e10cSrcweir 682*cdf0e10cSrcweir if ( rootNode.is() ) 683*cdf0e10cSrcweir { 684*cdf0e10cSrcweir if ( nMode ) 685*cdf0e10cSrcweir { 686*cdf0e10cSrcweir //We call acquire on the XBrowseNode so that it does not 687*cdf0e10cSrcweir //get autodestructed and become invalid when accessed later. 688*cdf0e10cSrcweir rootNode->acquire(); 689*cdf0e10cSrcweir 690*cdf0e10cSrcweir SfxGroupInfo_Impl *pInfo = 691*cdf0e10cSrcweir new SfxGroupInfo_Impl( SFX_CFGGROUP_SCRIPTCONTAINER, 0, 692*cdf0e10cSrcweir static_cast<void *>(rootNode.get())); 693*cdf0e10cSrcweir 694*cdf0e10cSrcweir String aTitle(pImp->m_sDlgMacros); 695*cdf0e10cSrcweir SvLBoxEntry *pNewEntry = InsertEntry( aTitle, NULL ); 696*cdf0e10cSrcweir pNewEntry->SetUserData( pInfo ); 697*cdf0e10cSrcweir pNewEntry->EnableChildsOnDemand( sal_True ); 698*cdf0e10cSrcweir aArr.Insert( pInfo, aArr.Count() ); 699*cdf0e10cSrcweir } 700*cdf0e10cSrcweir else 701*cdf0e10cSrcweir { 702*cdf0e10cSrcweir //We are only showing scripts not slot APIs so skip 703*cdf0e10cSrcweir //Root node and show location nodes 704*cdf0e10cSrcweir try { 705*cdf0e10cSrcweir if ( rootNode->hasChildNodes() ) 706*cdf0e10cSrcweir { 707*cdf0e10cSrcweir Sequence< Reference< browse::XBrowseNode > > children = 708*cdf0e10cSrcweir rootNode->getChildNodes(); 709*cdf0e10cSrcweir sal_Bool bIsRootNode = sal_False; 710*cdf0e10cSrcweir 711*cdf0e10cSrcweir ::rtl::OUString user = ::rtl::OUString::createFromAscii("user"); 712*cdf0e10cSrcweir ::rtl::OUString share = ::rtl::OUString::createFromAscii("share"); 713*cdf0e10cSrcweir if ( rootNode->getName().equals(::rtl::OUString::createFromAscii("Root") )) 714*cdf0e10cSrcweir { 715*cdf0e10cSrcweir bIsRootNode = sal_True; 716*cdf0e10cSrcweir } 717*cdf0e10cSrcweir 718*cdf0e10cSrcweir //To mimic current starbasic behaviour we 719*cdf0e10cSrcweir //need to make sure that only the current document 720*cdf0e10cSrcweir //is displayed in the config tree. Tests below 721*cdf0e10cSrcweir //set the bDisplay flag to FALSE if the current 722*cdf0e10cSrcweir //node is a first level child of the Root and is NOT 723*cdf0e10cSrcweir //either the current document, user or share 724*cdf0e10cSrcweir ::rtl::OUString currentDocTitle; 725*cdf0e10cSrcweir Reference< XModel > xDocument( lcl_getScriptableDocument_nothrow( m_xFrame ) ); 726*cdf0e10cSrcweir if ( xDocument.is() ) 727*cdf0e10cSrcweir { 728*cdf0e10cSrcweir currentDocTitle = ::comphelper::DocumentInfo::getDocumentTitle( xDocument ); 729*cdf0e10cSrcweir } 730*cdf0e10cSrcweir 731*cdf0e10cSrcweir for ( sal_Int32 n = 0; n < children.getLength(); n++ ) 732*cdf0e10cSrcweir { 733*cdf0e10cSrcweir Reference< browse::XBrowseNode >& theChild = children[n]; 734*cdf0e10cSrcweir sal_Bool bDisplay = sal_True; 735*cdf0e10cSrcweir ::rtl::OUString uiName = theChild->getName(); 736*cdf0e10cSrcweir if ( bIsRootNode ) 737*cdf0e10cSrcweir { 738*cdf0e10cSrcweir if ( ! ((theChild->getName().equals( user ) || theChild->getName().equals( share ) || 739*cdf0e10cSrcweir theChild->getName().equals( currentDocTitle ) ) ) ) 740*cdf0e10cSrcweir { 741*cdf0e10cSrcweir bDisplay=sal_False; 742*cdf0e10cSrcweir } 743*cdf0e10cSrcweir else 744*cdf0e10cSrcweir { 745*cdf0e10cSrcweir if ( uiName.equals( user ) ) 746*cdf0e10cSrcweir { 747*cdf0e10cSrcweir uiName = pImp->m_sMyMacros; 748*cdf0e10cSrcweir } 749*cdf0e10cSrcweir else if ( uiName.equals( share ) ) 750*cdf0e10cSrcweir { 751*cdf0e10cSrcweir uiName = pImp->m_sProdMacros; 752*cdf0e10cSrcweir } 753*cdf0e10cSrcweir } 754*cdf0e10cSrcweir } 755*cdf0e10cSrcweir if (children[n]->getType() != browse::BrowseNodeTypes::SCRIPT && bDisplay ) 756*cdf0e10cSrcweir { 757*cdf0e10cSrcweir 758*cdf0e10cSrcweir // We call acquire on the XBrowseNode so that it does not 759*cdf0e10cSrcweir // get autodestructed and become invalid when accessed later. 760*cdf0e10cSrcweir theChild->acquire(); 761*cdf0e10cSrcweir 762*cdf0e10cSrcweir SfxGroupInfo_Impl* pInfo = 763*cdf0e10cSrcweir new SfxGroupInfo_Impl(SFX_CFGGROUP_SCRIPTCONTAINER, 764*cdf0e10cSrcweir 0, static_cast<void *>( theChild.get())); 765*cdf0e10cSrcweir 766*cdf0e10cSrcweir Image aImage = GetImage( theChild, xCtx, bIsRootNode,BMP_COLOR_NORMAL ); 767*cdf0e10cSrcweir SvLBoxEntry* pNewEntry = 768*cdf0e10cSrcweir InsertEntry( uiName, NULL); 769*cdf0e10cSrcweir SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL); 770*cdf0e10cSrcweir SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL); 771*cdf0e10cSrcweir aImage = GetImage( theChild, xCtx, bIsRootNode,BMP_COLOR_HIGHCONTRAST ); 772*cdf0e10cSrcweir SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST); 773*cdf0e10cSrcweir SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST); 774*cdf0e10cSrcweir 775*cdf0e10cSrcweir pNewEntry->SetUserData( pInfo ); 776*cdf0e10cSrcweir aArr.Insert( pInfo, aArr.Count() ); 777*cdf0e10cSrcweir 778*cdf0e10cSrcweir if ( children[n]->hasChildNodes() ) 779*cdf0e10cSrcweir { 780*cdf0e10cSrcweir Sequence< Reference< browse::XBrowseNode > > grandchildren = 781*cdf0e10cSrcweir children[n]->getChildNodes(); 782*cdf0e10cSrcweir 783*cdf0e10cSrcweir for ( sal_Int32 m = 0; m < grandchildren.getLength(); m++ ) 784*cdf0e10cSrcweir { 785*cdf0e10cSrcweir if ( grandchildren[m]->getType() == browse::BrowseNodeTypes::CONTAINER ) 786*cdf0e10cSrcweir { 787*cdf0e10cSrcweir pNewEntry->EnableChildsOnDemand( sal_True ); 788*cdf0e10cSrcweir m = grandchildren.getLength(); 789*cdf0e10cSrcweir } 790*cdf0e10cSrcweir } 791*cdf0e10cSrcweir } 792*cdf0e10cSrcweir } 793*cdf0e10cSrcweir } 794*cdf0e10cSrcweir } 795*cdf0e10cSrcweir } 796*cdf0e10cSrcweir catch (RuntimeException&) { 797*cdf0e10cSrcweir // do nothing, the entry will not be displayed in the UI 798*cdf0e10cSrcweir } 799*cdf0e10cSrcweir } 800*cdf0e10cSrcweir } 801*cdf0e10cSrcweir 802*cdf0e10cSrcweir // add styles 803*cdf0e10cSrcweir if ( m_xSMGR.is() ) 804*cdf0e10cSrcweir { 805*cdf0e10cSrcweir String sStyle( pImp->m_aStrGroupStyles ); 806*cdf0e10cSrcweir SvLBoxEntry *pEntry = InsertEntry( sStyle, 0 ); 807*cdf0e10cSrcweir SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_STYLES, 0, 0 ); // TODO last parameter should contain user data 808*cdf0e10cSrcweir aArr.Insert( pInfo, aArr.Count() ); 809*cdf0e10cSrcweir pEntry->SetUserData( pInfo ); 810*cdf0e10cSrcweir pEntry->EnableChildsOnDemand( sal_True ); 811*cdf0e10cSrcweir } 812*cdf0e10cSrcweir 813*cdf0e10cSrcweir MakeVisible( GetEntry( 0,0 ) ); 814*cdf0e10cSrcweir SetUpdateMode( sal_True ); 815*cdf0e10cSrcweir } 816*cdf0e10cSrcweir Image SfxConfigGroupListBox_Impl::GetImage( Reference< browse::XBrowseNode > node, Reference< XComponentContext > xCtx, bool bIsRootNode, bool bHighContrast ) 817*cdf0e10cSrcweir { 818*cdf0e10cSrcweir Image aImage; 819*cdf0e10cSrcweir if ( bIsRootNode ) 820*cdf0e10cSrcweir { 821*cdf0e10cSrcweir ::rtl::OUString user = ::rtl::OUString::createFromAscii("user"); 822*cdf0e10cSrcweir ::rtl::OUString share = ::rtl::OUString::createFromAscii("share"); 823*cdf0e10cSrcweir if (node->getName().equals( user ) || node->getName().equals(share ) ) 824*cdf0e10cSrcweir { 825*cdf0e10cSrcweir if( bHighContrast == BMP_COLOR_NORMAL ) 826*cdf0e10cSrcweir aImage = pImp->m_hdImage; 827*cdf0e10cSrcweir else 828*cdf0e10cSrcweir aImage = pImp->m_hdImage_hc; 829*cdf0e10cSrcweir } 830*cdf0e10cSrcweir else 831*cdf0e10cSrcweir { 832*cdf0e10cSrcweir ::rtl::OUString factoryURL; 833*cdf0e10cSrcweir ::rtl::OUString nodeName = node->getName(); 834*cdf0e10cSrcweir Reference<XInterface> xDocumentModel = getDocumentModel(xCtx, nodeName ); 835*cdf0e10cSrcweir if ( xDocumentModel.is() ) 836*cdf0e10cSrcweir { 837*cdf0e10cSrcweir Reference< ::com::sun::star::frame::XModuleManager > 838*cdf0e10cSrcweir xModuleManager( 839*cdf0e10cSrcweir xCtx->getServiceManager() 840*cdf0e10cSrcweir ->createInstanceWithContext( 841*cdf0e10cSrcweir ::rtl::OUString::createFromAscii("" // xxx todo 842*cdf0e10cSrcweir "com.sun.star.frame.ModuleManager"), 843*cdf0e10cSrcweir xCtx ), 844*cdf0e10cSrcweir UNO_QUERY_THROW ); 845*cdf0e10cSrcweir Reference<container::XNameAccess> xModuleConfig( 846*cdf0e10cSrcweir xModuleManager, UNO_QUERY_THROW ); 847*cdf0e10cSrcweir // get the long name of the document: 848*cdf0e10cSrcweir ::rtl::OUString appModule( xModuleManager->identify( 849*cdf0e10cSrcweir xDocumentModel ) ); 850*cdf0e10cSrcweir Sequence<beans::PropertyValue> moduleDescr; 851*cdf0e10cSrcweir Any aAny = xModuleConfig->getByName(appModule); 852*cdf0e10cSrcweir if( sal_True != ( aAny >>= moduleDescr ) ) 853*cdf0e10cSrcweir { 854*cdf0e10cSrcweir throw RuntimeException(::rtl::OUString::createFromAscii("SFTreeListBox::Init: failed to get PropertyValue"), Reference< XInterface >()); 855*cdf0e10cSrcweir } 856*cdf0e10cSrcweir beans::PropertyValue const * pmoduleDescr = 857*cdf0e10cSrcweir moduleDescr.getConstArray(); 858*cdf0e10cSrcweir for ( sal_Int32 pos = moduleDescr.getLength(); pos--; ) 859*cdf0e10cSrcweir { 860*cdf0e10cSrcweir if (pmoduleDescr[ pos ].Name.equalsAsciiL( 861*cdf0e10cSrcweir RTL_CONSTASCII_STRINGPARAM( 862*cdf0e10cSrcweir "ooSetupFactoryEmptyDocumentURL") )) 863*cdf0e10cSrcweir { 864*cdf0e10cSrcweir pmoduleDescr[ pos ].Value >>= factoryURL; 865*cdf0e10cSrcweir OSL_TRACE("factory url for doc images is %s", 866*cdf0e10cSrcweir ::rtl::OUStringToOString( factoryURL , RTL_TEXTENCODING_ASCII_US ).pData->buffer ); 867*cdf0e10cSrcweir break; 868*cdf0e10cSrcweir } 869*cdf0e10cSrcweir } 870*cdf0e10cSrcweir } 871*cdf0e10cSrcweir if( factoryURL.getLength() > 0 ) 872*cdf0e10cSrcweir { 873*cdf0e10cSrcweir if( bHighContrast == BMP_COLOR_NORMAL ) 874*cdf0e10cSrcweir aImage = SvFileInformationManager::GetFileImage( 875*cdf0e10cSrcweir INetURLObject(factoryURL), false, 876*cdf0e10cSrcweir BMP_COLOR_NORMAL ); 877*cdf0e10cSrcweir else 878*cdf0e10cSrcweir aImage = SvFileInformationManager::GetFileImage( 879*cdf0e10cSrcweir INetURLObject(factoryURL), false, 880*cdf0e10cSrcweir BMP_COLOR_HIGHCONTRAST ); 881*cdf0e10cSrcweir } 882*cdf0e10cSrcweir else 883*cdf0e10cSrcweir { 884*cdf0e10cSrcweir if( bHighContrast == BMP_COLOR_NORMAL ) 885*cdf0e10cSrcweir aImage = pImp->m_docImage; 886*cdf0e10cSrcweir else 887*cdf0e10cSrcweir aImage = pImp->m_docImage_hc; 888*cdf0e10cSrcweir } 889*cdf0e10cSrcweir } 890*cdf0e10cSrcweir } 891*cdf0e10cSrcweir else 892*cdf0e10cSrcweir { 893*cdf0e10cSrcweir if( node->getType() == browse::BrowseNodeTypes::SCRIPT ) 894*cdf0e10cSrcweir { 895*cdf0e10cSrcweir if( bHighContrast == BMP_COLOR_NORMAL ) 896*cdf0e10cSrcweir aImage = pImp->m_macImage; 897*cdf0e10cSrcweir else 898*cdf0e10cSrcweir aImage = pImp->m_macImage_hc; 899*cdf0e10cSrcweir } 900*cdf0e10cSrcweir else 901*cdf0e10cSrcweir { 902*cdf0e10cSrcweir if( bHighContrast == BMP_COLOR_NORMAL ) 903*cdf0e10cSrcweir aImage = pImp->m_libImage; 904*cdf0e10cSrcweir else 905*cdf0e10cSrcweir aImage = pImp->m_libImage_hc; 906*cdf0e10cSrcweir } 907*cdf0e10cSrcweir } 908*cdf0e10cSrcweir return aImage; 909*cdf0e10cSrcweir } 910*cdf0e10cSrcweir 911*cdf0e10cSrcweir Reference< XInterface > 912*cdf0e10cSrcweir SfxConfigGroupListBox_Impl::getDocumentModel( Reference< XComponentContext >& xCtx, ::rtl::OUString& docName ) 913*cdf0e10cSrcweir { 914*cdf0e10cSrcweir Reference< XInterface > xModel; 915*cdf0e10cSrcweir Reference< lang::XMultiComponentFactory > mcf = 916*cdf0e10cSrcweir xCtx->getServiceManager(); 917*cdf0e10cSrcweir Reference< frame::XDesktop > desktop ( 918*cdf0e10cSrcweir mcf->createInstanceWithContext( 919*cdf0e10cSrcweir ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), xCtx ), 920*cdf0e10cSrcweir UNO_QUERY ); 921*cdf0e10cSrcweir 922*cdf0e10cSrcweir Reference< container::XEnumerationAccess > componentsAccess = 923*cdf0e10cSrcweir desktop->getComponents(); 924*cdf0e10cSrcweir Reference< container::XEnumeration > components = 925*cdf0e10cSrcweir componentsAccess->createEnumeration(); 926*cdf0e10cSrcweir while (components->hasMoreElements()) 927*cdf0e10cSrcweir { 928*cdf0e10cSrcweir Reference< frame::XModel > model( 929*cdf0e10cSrcweir components->nextElement(), UNO_QUERY ); 930*cdf0e10cSrcweir if ( model.is() ) 931*cdf0e10cSrcweir { 932*cdf0e10cSrcweir ::rtl::OUString sTdocUrl = 933*cdf0e10cSrcweir ::comphelper::DocumentInfo::getDocumentTitle( model ); 934*cdf0e10cSrcweir if( sTdocUrl.equals( docName ) ) 935*cdf0e10cSrcweir { 936*cdf0e10cSrcweir xModel = model; 937*cdf0e10cSrcweir break; 938*cdf0e10cSrcweir } 939*cdf0e10cSrcweir } 940*cdf0e10cSrcweir } 941*cdf0e10cSrcweir return xModel; 942*cdf0e10cSrcweir } 943*cdf0e10cSrcweir 944*cdf0e10cSrcweir //----------------------------------------------- 945*cdf0e10cSrcweir ::rtl::OUString SfxConfigGroupListBox_Impl::MapCommand2UIName(const ::rtl::OUString& sCommand) 946*cdf0e10cSrcweir { 947*cdf0e10cSrcweir ::rtl::OUString sUIName; 948*cdf0e10cSrcweir try 949*cdf0e10cSrcweir { 950*cdf0e10cSrcweir css::uno::Reference< css::container::XNameAccess > xModuleConf; 951*cdf0e10cSrcweir m_xUICmdDescription->getByName(m_sModuleLongName) >>= xModuleConf; 952*cdf0e10cSrcweir if (xModuleConf.is()) 953*cdf0e10cSrcweir { 954*cdf0e10cSrcweir ::comphelper::SequenceAsHashMap lProps(xModuleConf->getByName(sCommand)); 955*cdf0e10cSrcweir sUIName = lProps.getUnpackedValueOrDefault(::rtl::OUString::createFromAscii("Name"), ::rtl::OUString()); 956*cdf0e10cSrcweir } 957*cdf0e10cSrcweir } 958*cdf0e10cSrcweir catch(const css::uno::RuntimeException& exRun) 959*cdf0e10cSrcweir { throw exRun; } 960*cdf0e10cSrcweir catch(css::uno::Exception&) 961*cdf0e10cSrcweir { sUIName = ::rtl::OUString(); } 962*cdf0e10cSrcweir 963*cdf0e10cSrcweir // fallback for missing UINames !? 964*cdf0e10cSrcweir if (!sUIName.getLength()) 965*cdf0e10cSrcweir { 966*cdf0e10cSrcweir sUIName = sCommand; 967*cdf0e10cSrcweir /* 968*cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 969*cdf0e10cSrcweir ::rtl::OUStringBuffer sMsg(256); 970*cdf0e10cSrcweir sMsg.appendAscii("There is no UIName for the internal command \""); 971*cdf0e10cSrcweir sMsg.append (sCommand ); 972*cdf0e10cSrcweir sMsg.appendAscii("\". The UI will be invalid then ..." ); 973*cdf0e10cSrcweir OSL_ENSURE(sal_False, ::rtl::OUStringToOString(sMsg.makeStringAndClear(), RTL_TEXTENCODING_UTF8).getStr()); 974*cdf0e10cSrcweir #endif 975*cdf0e10cSrcweir */ 976*cdf0e10cSrcweir } 977*cdf0e10cSrcweir 978*cdf0e10cSrcweir return sUIName; 979*cdf0e10cSrcweir } 980*cdf0e10cSrcweir 981*cdf0e10cSrcweir //----------------------------------------------- 982*cdf0e10cSrcweir void SfxConfigGroupListBox_Impl::GroupSelected() 983*cdf0e10cSrcweir /* Beschreibung 984*cdf0e10cSrcweir Eine Funktionsgruppe oder eine Basicmodul wurde selektiert. Alle Funktionen bzw. 985*cdf0e10cSrcweir Macros werden in der Functionlistbox anzeigt. 986*cdf0e10cSrcweir */ 987*cdf0e10cSrcweir { 988*cdf0e10cSrcweir SvLBoxEntry *pEntry = FirstSelected(); 989*cdf0e10cSrcweir SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData(); 990*cdf0e10cSrcweir pFunctionListBox->SetUpdateMode(sal_False); 991*cdf0e10cSrcweir pFunctionListBox->ClearAll(); 992*cdf0e10cSrcweir if ( pInfo->nKind != SFX_CFGGROUP_FUNCTION && 993*cdf0e10cSrcweir pInfo->nKind != SFX_CFGGROUP_SCRIPTCONTAINER && 994*cdf0e10cSrcweir pInfo->nKind != SFX_CFGGROUP_STYLES ) 995*cdf0e10cSrcweir { 996*cdf0e10cSrcweir pFunctionListBox->SetUpdateMode(sal_True); 997*cdf0e10cSrcweir return; 998*cdf0e10cSrcweir } 999*cdf0e10cSrcweir 1000*cdf0e10cSrcweir switch ( pInfo->nKind ) 1001*cdf0e10cSrcweir { 1002*cdf0e10cSrcweir case SFX_CFGGROUP_FUNCTION : 1003*cdf0e10cSrcweir { 1004*cdf0e10cSrcweir sal_uInt16 nGroup = pInfo->nUniqueID; 1005*cdf0e10cSrcweir css::uno::Reference< css::frame::XDispatchInformationProvider > xProvider (m_xFrame, css::uno::UNO_QUERY_THROW); 1006*cdf0e10cSrcweir css::uno::Sequence< css::frame::DispatchInformation > lCommands = xProvider->getConfigurableDispatchInformation(nGroup); 1007*cdf0e10cSrcweir sal_Int32 c = lCommands.getLength(); 1008*cdf0e10cSrcweir sal_Int32 i = 0; 1009*cdf0e10cSrcweir 1010*cdf0e10cSrcweir for (i=0; i<c; ++i) 1011*cdf0e10cSrcweir { 1012*cdf0e10cSrcweir const css::frame::DispatchInformation& rInfo = lCommands[i]; 1013*cdf0e10cSrcweir ::rtl::OUString sUIName = MapCommand2UIName(rInfo.Command); 1014*cdf0e10cSrcweir SvLBoxEntry* pFuncEntry = pFunctionListBox->InsertEntry(sUIName, NULL); 1015*cdf0e10cSrcweir SfxGroupInfo_Impl* pGrpInfo = new SfxGroupInfo_Impl(SFX_CFGFUNCTION_SLOT, 0); 1016*cdf0e10cSrcweir pGrpInfo->sCommand = rInfo.Command; 1017*cdf0e10cSrcweir pGrpInfo->sLabel = sUIName; 1018*cdf0e10cSrcweir pFuncEntry->SetUserData(pGrpInfo); 1019*cdf0e10cSrcweir } 1020*cdf0e10cSrcweir 1021*cdf0e10cSrcweir break; 1022*cdf0e10cSrcweir } 1023*cdf0e10cSrcweir 1024*cdf0e10cSrcweir case SFX_CFGGROUP_SCRIPTCONTAINER: 1025*cdf0e10cSrcweir { 1026*cdf0e10cSrcweir if ( !GetChildCount( pEntry ) ) 1027*cdf0e10cSrcweir { 1028*cdf0e10cSrcweir Reference< browse::XBrowseNode > rootNode( 1029*cdf0e10cSrcweir reinterpret_cast< browse::XBrowseNode* >( pInfo->pObject ) ) ; 1030*cdf0e10cSrcweir 1031*cdf0e10cSrcweir try { 1032*cdf0e10cSrcweir if ( rootNode->hasChildNodes() ) 1033*cdf0e10cSrcweir { 1034*cdf0e10cSrcweir Sequence< Reference< browse::XBrowseNode > > children = 1035*cdf0e10cSrcweir rootNode->getChildNodes(); 1036*cdf0e10cSrcweir 1037*cdf0e10cSrcweir for ( sal_Int32 n = 0; n < children.getLength(); n++ ) 1038*cdf0e10cSrcweir { 1039*cdf0e10cSrcweir if (children[n]->getType() == browse::BrowseNodeTypes::SCRIPT) 1040*cdf0e10cSrcweir { 1041*cdf0e10cSrcweir ::rtl::OUString uri; 1042*cdf0e10cSrcweir 1043*cdf0e10cSrcweir Reference < beans::XPropertySet >xPropSet( children[n], UNO_QUERY ); 1044*cdf0e10cSrcweir if (!xPropSet.is()) 1045*cdf0e10cSrcweir { 1046*cdf0e10cSrcweir continue; 1047*cdf0e10cSrcweir } 1048*cdf0e10cSrcweir 1049*cdf0e10cSrcweir Any value = 1050*cdf0e10cSrcweir xPropSet->getPropertyValue( String::CreateFromAscii( "URI" ) ); 1051*cdf0e10cSrcweir value >>= uri; 1052*cdf0e10cSrcweir 1053*cdf0e10cSrcweir String* pScriptURI = new String( uri ); 1054*cdf0e10cSrcweir SfxGroupInfo_Impl* pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGFUNCTION_SCRIPT, 0, pScriptURI ); 1055*cdf0e10cSrcweir 1056*cdf0e10cSrcweir Image aImage = GetImage( children[n], Reference< XComponentContext >(), sal_False, BMP_COLOR_NORMAL ); 1057*cdf0e10cSrcweir SvLBoxEntry* pNewEntry = 1058*cdf0e10cSrcweir pFunctionListBox->InsertEntry( children[n]->getName(), NULL ); 1059*cdf0e10cSrcweir pFunctionListBox->SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL); 1060*cdf0e10cSrcweir pFunctionListBox->SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL); 1061*cdf0e10cSrcweir aImage = GetImage( children[n], Reference< XComponentContext >(), sal_False, BMP_COLOR_HIGHCONTRAST ); 1062*cdf0e10cSrcweir pFunctionListBox->SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST); 1063*cdf0e10cSrcweir pFunctionListBox->SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST); 1064*cdf0e10cSrcweir 1065*cdf0e10cSrcweir pGrpInfo->sCommand = uri; 1066*cdf0e10cSrcweir pGrpInfo->sLabel = children[n]->getName(); 1067*cdf0e10cSrcweir pNewEntry->SetUserData( pGrpInfo ); 1068*cdf0e10cSrcweir 1069*cdf0e10cSrcweir pFunctionListBox->aArr.Insert( 1070*cdf0e10cSrcweir pGrpInfo, pFunctionListBox->aArr.Count() ); 1071*cdf0e10cSrcweir 1072*cdf0e10cSrcweir } 1073*cdf0e10cSrcweir } 1074*cdf0e10cSrcweir } 1075*cdf0e10cSrcweir } 1076*cdf0e10cSrcweir catch (RuntimeException&) { 1077*cdf0e10cSrcweir // do nothing, the entry will not be displayed in the UI 1078*cdf0e10cSrcweir } 1079*cdf0e10cSrcweir } 1080*cdf0e10cSrcweir break; 1081*cdf0e10cSrcweir } 1082*cdf0e10cSrcweir 1083*cdf0e10cSrcweir case SFX_CFGGROUP_STYLES : 1084*cdf0e10cSrcweir { 1085*cdf0e10cSrcweir SfxStyleInfo_Impl* pFamily = (SfxStyleInfo_Impl*)(pInfo->pObject); 1086*cdf0e10cSrcweir if (pFamily) 1087*cdf0e10cSrcweir { 1088*cdf0e10cSrcweir const ::std::vector< SfxStyleInfo_Impl > lStyles = pStylesInfo->getStyles(pFamily->sFamily); 1089*cdf0e10cSrcweir ::std::vector< SfxStyleInfo_Impl >::const_iterator pIt; 1090*cdf0e10cSrcweir for ( pIt = lStyles.begin(); 1091*cdf0e10cSrcweir pIt != lStyles.end() ; 1092*cdf0e10cSrcweir ++pIt ) 1093*cdf0e10cSrcweir { 1094*cdf0e10cSrcweir SfxStyleInfo_Impl* pStyle = new SfxStyleInfo_Impl(*pIt); 1095*cdf0e10cSrcweir SvLBoxEntry* pFuncEntry = pFunctionListBox->InsertEntry( pStyle->sLabel, NULL ); 1096*cdf0e10cSrcweir SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_STYLES, 0, pStyle ); 1097*cdf0e10cSrcweir pFunctionListBox->aArr.Insert( pGrpInfo, pFunctionListBox->aArr.Count() ); 1098*cdf0e10cSrcweir pGrpInfo->sCommand = pStyle->sCommand; 1099*cdf0e10cSrcweir pGrpInfo->sLabel = pStyle->sLabel; 1100*cdf0e10cSrcweir pFuncEntry->SetUserData( pGrpInfo ); 1101*cdf0e10cSrcweir } 1102*cdf0e10cSrcweir } 1103*cdf0e10cSrcweir break; 1104*cdf0e10cSrcweir } 1105*cdf0e10cSrcweir 1106*cdf0e10cSrcweir default: 1107*cdf0e10cSrcweir return; 1108*cdf0e10cSrcweir } 1109*cdf0e10cSrcweir 1110*cdf0e10cSrcweir if ( pFunctionListBox->GetEntryCount() ) 1111*cdf0e10cSrcweir pFunctionListBox->Select( pFunctionListBox->GetEntry( 0, 0 ) ); 1112*cdf0e10cSrcweir 1113*cdf0e10cSrcweir pFunctionListBox->SetUpdateMode(sal_True); 1114*cdf0e10cSrcweir } 1115*cdf0e10cSrcweir 1116*cdf0e10cSrcweir sal_Bool SfxConfigGroupListBox_Impl::Expand( SvLBoxEntry* pParent ) 1117*cdf0e10cSrcweir { 1118*cdf0e10cSrcweir sal_Bool bRet = SvTreeListBox::Expand( pParent ); 1119*cdf0e10cSrcweir if ( bRet ) 1120*cdf0e10cSrcweir { 1121*cdf0e10cSrcweir // Wieviele Entries k"onnen angezeigt werden ? 1122*cdf0e10cSrcweir sal_uLong nEntries = GetOutputSizePixel().Height() / GetEntryHeight(); 1123*cdf0e10cSrcweir 1124*cdf0e10cSrcweir // Wieviele Kinder sollen angezeigt werden ? 1125*cdf0e10cSrcweir sal_uLong nChildCount = GetVisibleChildCount( pParent ); 1126*cdf0e10cSrcweir 1127*cdf0e10cSrcweir // Passen alle Kinder und der parent gleichzeitig in die View ? 1128*cdf0e10cSrcweir if ( nChildCount+1 > nEntries ) 1129*cdf0e10cSrcweir { 1130*cdf0e10cSrcweir // Wenn nicht, wenigstens parent ganz nach oben schieben 1131*cdf0e10cSrcweir MakeVisible( pParent, sal_True ); 1132*cdf0e10cSrcweir } 1133*cdf0e10cSrcweir else 1134*cdf0e10cSrcweir { 1135*cdf0e10cSrcweir // An welcher relativen ViewPosition steht der aufzuklappende parent 1136*cdf0e10cSrcweir SvLBoxEntry *pEntry = GetFirstEntryInView(); 1137*cdf0e10cSrcweir sal_uLong nParentPos = 0; 1138*cdf0e10cSrcweir while ( pEntry && pEntry != pParent ) 1139*cdf0e10cSrcweir { 1140*cdf0e10cSrcweir nParentPos++; 1141*cdf0e10cSrcweir pEntry = GetNextEntryInView( pEntry ); 1142*cdf0e10cSrcweir } 1143*cdf0e10cSrcweir 1144*cdf0e10cSrcweir // Ist unter dem parent noch genug Platz f"ur alle Kinder ? 1145*cdf0e10cSrcweir if ( nParentPos + nChildCount + 1 > nEntries ) 1146*cdf0e10cSrcweir ScrollOutputArea( (short)( nEntries - ( nParentPos + nChildCount + 1 ) ) ); 1147*cdf0e10cSrcweir } 1148*cdf0e10cSrcweir } 1149*cdf0e10cSrcweir 1150*cdf0e10cSrcweir return bRet; 1151*cdf0e10cSrcweir } 1152*cdf0e10cSrcweir 1153*cdf0e10cSrcweir void SfxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry ) 1154*cdf0e10cSrcweir /* Beschreibung 1155*cdf0e10cSrcweir Ein Basic oder eine Bibliothek werden ge"offnet 1156*cdf0e10cSrcweir */ 1157*cdf0e10cSrcweir { 1158*cdf0e10cSrcweir SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData(); 1159*cdf0e10cSrcweir pInfo->bWasOpened = sal_True; 1160*cdf0e10cSrcweir switch ( pInfo->nKind ) 1161*cdf0e10cSrcweir { 1162*cdf0e10cSrcweir case SFX_CFGGROUP_SCRIPTCONTAINER: 1163*cdf0e10cSrcweir { 1164*cdf0e10cSrcweir if ( !GetChildCount( pEntry ) ) 1165*cdf0e10cSrcweir { 1166*cdf0e10cSrcweir Reference< browse::XBrowseNode > rootNode( 1167*cdf0e10cSrcweir reinterpret_cast< browse::XBrowseNode* >( pInfo->pObject ) ) ; 1168*cdf0e10cSrcweir 1169*cdf0e10cSrcweir try { 1170*cdf0e10cSrcweir if ( rootNode->hasChildNodes() ) 1171*cdf0e10cSrcweir { 1172*cdf0e10cSrcweir Sequence< Reference< browse::XBrowseNode > > children = 1173*cdf0e10cSrcweir rootNode->getChildNodes(); 1174*cdf0e10cSrcweir sal_Bool bIsRootNode = sal_False; 1175*cdf0e10cSrcweir 1176*cdf0e10cSrcweir ::rtl::OUString user = ::rtl::OUString::createFromAscii("user"); 1177*cdf0e10cSrcweir ::rtl::OUString share = ::rtl::OUString::createFromAscii("share"); 1178*cdf0e10cSrcweir if ( rootNode->getName().equals(::rtl::OUString::createFromAscii("Root") )) 1179*cdf0e10cSrcweir { 1180*cdf0e10cSrcweir bIsRootNode = sal_True; 1181*cdf0e10cSrcweir } 1182*cdf0e10cSrcweir 1183*cdf0e10cSrcweir /* To mimic current starbasic behaviour we 1184*cdf0e10cSrcweir need to make sure that only the current document 1185*cdf0e10cSrcweir is displayed in the config tree. Tests below 1186*cdf0e10cSrcweir set the bDisplay flag to sal_False if the current 1187*cdf0e10cSrcweir node is a first level child of the Root and is NOT 1188*cdf0e10cSrcweir either the current document, user or share */ 1189*cdf0e10cSrcweir ::rtl::OUString currentDocTitle; 1190*cdf0e10cSrcweir Reference< XModel > xDocument( lcl_getScriptableDocument_nothrow( m_xFrame ) ); 1191*cdf0e10cSrcweir if ( xDocument.is() ) 1192*cdf0e10cSrcweir { 1193*cdf0e10cSrcweir currentDocTitle = ::comphelper::DocumentInfo::getDocumentTitle( xDocument ); 1194*cdf0e10cSrcweir } 1195*cdf0e10cSrcweir 1196*cdf0e10cSrcweir sal_Int32 nLen = children.getLength(); 1197*cdf0e10cSrcweir for ( sal_Int32 n = 0; n < nLen; n++ ) 1198*cdf0e10cSrcweir { 1199*cdf0e10cSrcweir Reference< browse::XBrowseNode >& theChild = children[n]; 1200*cdf0e10cSrcweir ::rtl::OUString aName( theChild->getName() ); 1201*cdf0e10cSrcweir sal_Bool bDisplay = sal_True; 1202*cdf0e10cSrcweir if ( bIsRootNode ) 1203*cdf0e10cSrcweir { 1204*cdf0e10cSrcweir if ( !( (aName.equals(user) || aName.equals(share) || aName.equals(currentDocTitle) ) ) ) 1205*cdf0e10cSrcweir bDisplay=sal_False; 1206*cdf0e10cSrcweir } 1207*cdf0e10cSrcweir if ( children[n].is() && children[n]->getType() != browse::BrowseNodeTypes::SCRIPT && bDisplay ) 1208*cdf0e10cSrcweir { 1209*cdf0e10cSrcweir 1210*cdf0e10cSrcweir /* 1211*cdf0e10cSrcweir We call acquire on the XBrowseNode so that it does not 1212*cdf0e10cSrcweir get autodestructed and become invalid when accessed later. 1213*cdf0e10cSrcweir */ 1214*cdf0e10cSrcweir theChild->acquire(); 1215*cdf0e10cSrcweir 1216*cdf0e10cSrcweir SfxGroupInfo_Impl* pGrpInfo = 1217*cdf0e10cSrcweir new SfxGroupInfo_Impl(SFX_CFGGROUP_SCRIPTCONTAINER, 1218*cdf0e10cSrcweir 0, static_cast<void *>( theChild.get())); 1219*cdf0e10cSrcweir 1220*cdf0e10cSrcweir Image aImage = GetImage( theChild, Reference< XComponentContext >(), sal_False, BMP_COLOR_NORMAL ); 1221*cdf0e10cSrcweir SvLBoxEntry* pNewEntry = 1222*cdf0e10cSrcweir InsertEntry( theChild->getName(), pEntry ); 1223*cdf0e10cSrcweir SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL); 1224*cdf0e10cSrcweir SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_NORMAL); 1225*cdf0e10cSrcweir aImage = GetImage( theChild, Reference< XComponentContext >(), sal_False, BMP_COLOR_HIGHCONTRAST ); 1226*cdf0e10cSrcweir SetExpandedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST); 1227*cdf0e10cSrcweir SetCollapsedEntryBmp(pNewEntry, aImage, BMP_COLOR_HIGHCONTRAST); 1228*cdf0e10cSrcweir 1229*cdf0e10cSrcweir pNewEntry->SetUserData( pGrpInfo ); 1230*cdf0e10cSrcweir aArr.Insert( pGrpInfo, aArr.Count() ); 1231*cdf0e10cSrcweir 1232*cdf0e10cSrcweir if ( children[n]->hasChildNodes() ) 1233*cdf0e10cSrcweir { 1234*cdf0e10cSrcweir Sequence< Reference< browse::XBrowseNode > > grandchildren = 1235*cdf0e10cSrcweir children[n]->getChildNodes(); 1236*cdf0e10cSrcweir 1237*cdf0e10cSrcweir for ( sal_Int32 m = 0; m < grandchildren.getLength(); m++ ) 1238*cdf0e10cSrcweir { 1239*cdf0e10cSrcweir if ( grandchildren[m]->getType() == browse::BrowseNodeTypes::CONTAINER ) 1240*cdf0e10cSrcweir { 1241*cdf0e10cSrcweir pNewEntry->EnableChildsOnDemand( sal_True ); 1242*cdf0e10cSrcweir m = grandchildren.getLength(); 1243*cdf0e10cSrcweir } 1244*cdf0e10cSrcweir } 1245*cdf0e10cSrcweir } 1246*cdf0e10cSrcweir } 1247*cdf0e10cSrcweir } 1248*cdf0e10cSrcweir } 1249*cdf0e10cSrcweir } 1250*cdf0e10cSrcweir catch (RuntimeException&) { 1251*cdf0e10cSrcweir // do nothing, the entry will not be displayed in the UI 1252*cdf0e10cSrcweir } 1253*cdf0e10cSrcweir } 1254*cdf0e10cSrcweir break; 1255*cdf0e10cSrcweir } 1256*cdf0e10cSrcweir 1257*cdf0e10cSrcweir case SFX_CFGGROUP_STYLES: 1258*cdf0e10cSrcweir { 1259*cdf0e10cSrcweir if ( !GetChildCount( pEntry ) ) 1260*cdf0e10cSrcweir { 1261*cdf0e10cSrcweir const ::std::vector< SfxStyleInfo_Impl > lStyleFamilies = pStylesInfo->getStyleFamilies(); 1262*cdf0e10cSrcweir ::std::vector< SfxStyleInfo_Impl >::const_iterator pIt; 1263*cdf0e10cSrcweir for ( pIt = lStyleFamilies.begin(); 1264*cdf0e10cSrcweir pIt != lStyleFamilies.end() ; 1265*cdf0e10cSrcweir ++pIt ) 1266*cdf0e10cSrcweir { 1267*cdf0e10cSrcweir SfxStyleInfo_Impl* pFamily = new SfxStyleInfo_Impl(*pIt); 1268*cdf0e10cSrcweir SvLBoxEntry* pStyleEntry = InsertEntry( pFamily->sLabel, pEntry ); 1269*cdf0e10cSrcweir SfxGroupInfo_Impl *pGrpInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_STYLES, 0, pFamily ); 1270*cdf0e10cSrcweir aArr.Insert( pGrpInfo, aArr.Count() ); 1271*cdf0e10cSrcweir pStyleEntry->SetUserData( pGrpInfo ); 1272*cdf0e10cSrcweir pStyleEntry->EnableChildsOnDemand( sal_False ); 1273*cdf0e10cSrcweir } 1274*cdf0e10cSrcweir } 1275*cdf0e10cSrcweir break; 1276*cdf0e10cSrcweir } 1277*cdf0e10cSrcweir 1278*cdf0e10cSrcweir default: 1279*cdf0e10cSrcweir DBG_ERROR( "Falscher Gruppentyp!" ); 1280*cdf0e10cSrcweir break; 1281*cdf0e10cSrcweir } 1282*cdf0e10cSrcweir } 1283*cdf0e10cSrcweir 1284*cdf0e10cSrcweir void SfxConfigGroupListBox_Impl::SelectMacro( const SfxMacroInfoItem *pItem ) 1285*cdf0e10cSrcweir { 1286*cdf0e10cSrcweir SelectMacro( pItem->GetBasicManager()->GetName(), 1287*cdf0e10cSrcweir pItem->GetQualifiedName() ); 1288*cdf0e10cSrcweir } 1289*cdf0e10cSrcweir 1290*cdf0e10cSrcweir void SfxConfigGroupListBox_Impl::SelectMacro( const String& rBasic, 1291*cdf0e10cSrcweir const String& rMacro ) 1292*cdf0e10cSrcweir { 1293*cdf0e10cSrcweir String aBasicName( rBasic ); 1294*cdf0e10cSrcweir aBasicName += ' '; 1295*cdf0e10cSrcweir aBasicName += pImp->m_sMacros; 1296*cdf0e10cSrcweir String aLib, aModule, aMethod; 1297*cdf0e10cSrcweir sal_uInt16 nCount = rMacro.GetTokenCount('.'); 1298*cdf0e10cSrcweir aMethod = rMacro.GetToken( nCount-1, '.' ); 1299*cdf0e10cSrcweir if ( nCount > 2 ) 1300*cdf0e10cSrcweir { 1301*cdf0e10cSrcweir aLib = rMacro.GetToken( 0, '.' ); 1302*cdf0e10cSrcweir aModule = rMacro.GetToken( nCount-2, '.' ); 1303*cdf0e10cSrcweir } 1304*cdf0e10cSrcweir 1305*cdf0e10cSrcweir SvLBoxEntry *pEntry = FirstChild(0); 1306*cdf0e10cSrcweir while ( pEntry ) 1307*cdf0e10cSrcweir { 1308*cdf0e10cSrcweir String aEntryBas = GetEntryText( pEntry ); 1309*cdf0e10cSrcweir if ( aEntryBas == aBasicName ) 1310*cdf0e10cSrcweir { 1311*cdf0e10cSrcweir Expand( pEntry ); 1312*cdf0e10cSrcweir SvLBoxEntry *pLib = FirstChild( pEntry ); 1313*cdf0e10cSrcweir while ( pLib ) 1314*cdf0e10cSrcweir { 1315*cdf0e10cSrcweir String aEntryLib = GetEntryText( pLib ); 1316*cdf0e10cSrcweir if ( aEntryLib == aLib ) 1317*cdf0e10cSrcweir { 1318*cdf0e10cSrcweir Expand( pLib ); 1319*cdf0e10cSrcweir SvLBoxEntry *pMod = FirstChild( pLib ); 1320*cdf0e10cSrcweir while ( pMod ) 1321*cdf0e10cSrcweir { 1322*cdf0e10cSrcweir String aEntryMod = GetEntryText( pMod ); 1323*cdf0e10cSrcweir if ( aEntryMod == aModule ) 1324*cdf0e10cSrcweir { 1325*cdf0e10cSrcweir Expand( pMod ); 1326*cdf0e10cSrcweir MakeVisible( pMod ); 1327*cdf0e10cSrcweir Select( pMod ); 1328*cdf0e10cSrcweir SvLBoxEntry *pMethod = pFunctionListBox->First(); 1329*cdf0e10cSrcweir while ( pMethod ) 1330*cdf0e10cSrcweir { 1331*cdf0e10cSrcweir String aEntryMethod = GetEntryText( pMethod ); 1332*cdf0e10cSrcweir if ( aEntryMethod == aMethod ) 1333*cdf0e10cSrcweir { 1334*cdf0e10cSrcweir pFunctionListBox->Select( pMethod ); 1335*cdf0e10cSrcweir pFunctionListBox->MakeVisible( pMethod ); 1336*cdf0e10cSrcweir return; 1337*cdf0e10cSrcweir } 1338*cdf0e10cSrcweir pMethod = pFunctionListBox->Next( pMethod ); 1339*cdf0e10cSrcweir } 1340*cdf0e10cSrcweir } 1341*cdf0e10cSrcweir pMod = NextSibling( pMod ); 1342*cdf0e10cSrcweir } 1343*cdf0e10cSrcweir } 1344*cdf0e10cSrcweir pLib = NextSibling( pLib ); 1345*cdf0e10cSrcweir } 1346*cdf0e10cSrcweir } 1347*cdf0e10cSrcweir pEntry = NextSibling( pEntry ); 1348*cdf0e10cSrcweir } 1349*cdf0e10cSrcweir } 1350