diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-03-18 15:49:47 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-03-18 15:49:47 +0100 |
commit | 091e4aee3386f3bfee081dc8646494e0eb97f88a (patch) | |
tree | dd79298b4e8729ca7dc874274d4a33ea88fe107d /framework/source/services | |
parent | f0681adbf092e2b455db52535f2df882bc87343a (diff) | |
parent | 224bd63b3fa459baa0a6bb5cd03f5dc2ca475d82 (diff) |
Merge remote-tracking branch 'origin/integration/dev300_m101'
Conflicts:
avmedia/source/framework/mediacontrol.cxx
connectivity/source/commontools/DateConversion.cxx
desktop/source/deployment/registry/component/dp_component.cxx
editeng/inc/editeng/numitem.hxx
editeng/inc/editeng/txtrange.hxx
editeng/source/editeng/editobj.cxx
editeng/source/editeng/editview.cxx
editeng/source/editeng/eehtml.cxx
editeng/source/editeng/impedit3.cxx
editeng/source/editeng/impedit4.cxx
editeng/source/misc/txtrange.cxx
editeng/source/outliner/outlin2.cxx
editeng/source/outliner/outlvw.cxx
framework/source/layoutmanager/layoutmanager.cxx
linguistic/source/lngsvcmgr.hxx
sfx2/source/appl/app.cxx
sfx2/source/appl/app.src
sfx2/source/appl/appbas.cxx
sfx2/source/appl/appcfg.cxx
sfx2/source/appl/appdde.cxx
sfx2/source/appl/appmain.cxx
sfx2/source/appl/appopen.cxx
sfx2/source/appl/appquit.cxx
sfx2/source/appl/appserv.cxx
sfx2/source/appl/childwin.cxx
sfx2/source/appl/fileobj.cxx
sfx2/source/appl/fileobj.hxx
sfx2/source/appl/workwin.cxx
sfx2/source/control/dispatch.cxx
sfx2/source/control/macro.cxx
sfx2/source/control/objface.cxx
sfx2/source/control/request.cxx
sfx2/source/control/shell.cxx
sfx2/source/control/statcach.cxx
sfx2/source/dialog/dinfdlg.cxx
sfx2/source/dialog/dockwin.cxx
sfx2/source/dialog/mailmodel.cxx
sfx2/source/dialog/mailmodelapi.cxx
sfx2/source/dialog/mgetempl.cxx
sfx2/source/dialog/splitwin.cxx
sfx2/source/dialog/styledlg.cxx
sfx2/source/dialog/tabdlg.cxx
sfx2/source/dialog/templdlg.cxx
sfx2/source/dialog/tplcitem.cxx
sfx2/source/dialog/tplpitem.cxx
sfx2/source/doc/doctempl.cxx
sfx2/source/doc/docvor.cxx
sfx2/source/doc/new.cxx
sfx2/source/doc/objcont.cxx
sfx2/source/doc/objserv.cxx
sfx2/source/doc/objxtor.cxx
sfx2/source/inc/appdata.hxx
sfx2/source/inc/helpid.hrc
sfx2/source/inc/sfxlocal.hrc
sfx2/source/inc/statcach.hxx
sfx2/source/inc/templdgi.hxx
sfx2/source/inc/virtmenu.hxx
sfx2/source/inc/workwin.hxx
sfx2/source/menu/mnumgr.cxx
sfx2/source/menu/virtmenu.cxx
sfx2/source/statbar/stbitem.cxx
sfx2/source/view/frame.cxx
sfx2/source/view/frame2.cxx
sfx2/source/view/orgmgr.cxx
sfx2/source/view/printer.cxx
sfx2/source/view/prnmon.cxx
sfx2/source/view/sfxbasecontroller.cxx
sfx2/source/view/viewfrm.cxx
sfx2/source/view/viewfrm2.cxx
sfx2/source/view/viewprn.cxx
sfx2/source/view/viewsh.cxx
svx/inc/svx/svditer.hxx
svx/source/dialog/sdstring.src
svx/source/form/fmpage.cxx
svx/source/form/formcontroller.cxx
svx/source/svdraw/svdcrtv.cxx
svx/source/svdraw/svditer.cxx
svx/source/svdraw/svdview.cxx
xmloff/source/forms/elementimport.cxx
Diffstat (limited to 'framework/source/services')
21 files changed, 367 insertions, 1036 deletions
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index e4844db29528..ebc332ad8190 100644..100755 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -28,6 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_framework.hxx" + #include "services/autorecovery.hxx" #include <loadenv/loadenv.hxx> @@ -100,6 +101,8 @@ #include <tools/urlobj.hxx> +#include <fwkdllapi.h> + //_______________________________________________ // namespaces @@ -126,6 +129,7 @@ using ::com::sun::star::lang::XComponent; namespace fpf = ::framework::pattern::frame; + namespace framework { @@ -231,7 +235,7 @@ static const sal_Int32 GIVE_UP_RETRY = 1; // in // should be flushed an exception ... so the special error handler for this scenario is triggered // #define TRIGGER_FULL_DISC_CHECK -// force "return FALSE" for the method impl_enoughDiscSpace(). +// force "return sal_False" for the method impl_enoughDiscSpace(). // #define SIMULATE_FULL_DISC //----------------------------------------------- @@ -819,7 +823,7 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent else if (aEvent.EventName.equals(EVENT_ON_UNLOAD)) { - implts_deregisterDocument(xDocument, sal_True); // TRUE => stop listening for disposing() ! + implts_deregisterDocument(xDocument, sal_True); // sal_True => stop listening for disposing() ! } } @@ -914,7 +918,7 @@ void SAL_CALL AutoRecovery::disposing(const css::lang::EventObject& aEvent) css::uno::Reference< css::frame::XModel > xDocument(aEvent.Source, css::uno::UNO_QUERY); if (xDocument.is()) { - implts_deregisterDocument(xDocument, sal_False); // FALSE => dont call removeEventListener() .. because it's not needed here + implts_deregisterDocument(xDocument, sal_False); // sal_False => dont call removeEventListener() .. because it's not needed here return; } @@ -1470,7 +1474,7 @@ void AutoRecovery::implts_updateTimer() ) return; - ULONG nMilliSeconds = 0; + sal_uLong nMilliSeconds = 0; if (m_eTimerType == AutoRecovery::E_NORMAL_AUTOSAVE_INTERVALL) { nMilliSeconds = (m_nAutoSaveTimeIntervall*60000); // [min] => 60.000 ms @@ -1804,7 +1808,7 @@ void AutoRecovery::implts_deregisterDocument(const css::uno::Reference< css::fra AutoRecovery::st_impl_removeFile(aInfo.OldTempURL); AutoRecovery::st_impl_removeFile(aInfo.NewTempURL); - implts_flushConfigItem(aInfo, sal_True); // TRUE => remove it from config + implts_flushConfigItem(aInfo, sal_True); // sal_True => remove it from config } //----------------------------------------------- @@ -1845,7 +1849,7 @@ void AutoRecovery::implts_updateModifiedState(const css::uno::Reference< css::fr { AutoRecovery::TDocumentInfo& rInfo = *pIt; - // use TRUE as fallback ... so we recognize every document on EmergencySave/AutoRecovery! + // use sal_True as fallback ... so we recognize every document on EmergencySave/AutoRecovery! sal_Bool bModified = sal_True; css::uno::Reference< css::util::XModifiable > xModify(xDocument, css::uno::UNO_QUERY); if (xModify.is()) @@ -3195,7 +3199,7 @@ void AutoRecovery::implts_cleanUpWorkingEntry(const DispatchParams& aParams) AutoRecovery::st_impl_removeFile(rInfo.OldTempURL); AutoRecovery::st_impl_removeFile(rInfo.NewTempURL); - implts_flushConfigItem(rInfo, sal_True); // TRUE => remove it from xml config! + implts_flushConfigItem(rInfo, sal_True); // sal_True => remove it from xml config! m_lDocCache.erase(pIt); break; /// !!! pIt is not defined any longer ... further this function has finished it's work @@ -3276,7 +3280,7 @@ void SAL_CALL AutoRecovery::getFastPropertyValue(css::uno::Any& aValue , sal_Bool bRecoveryData = ((sal_Bool)(m_lDocCache.size()>0)); // exists session data ... => then we cant say, that these - // data are valid for recovery. So we have to return FALSE then! + // data are valid for recovery. So we have to return sal_False then! if (bSessionData) bRecoveryData = sal_False; diff --git a/framework/source/services/backingcomp.cxx b/framework/source/services/backingcomp.cxx index 89e5d514070d..199db043d46b 100644..100755 --- a/framework/source/services/backingcomp.cxx +++ b/framework/source/services/backingcomp.cxx @@ -38,7 +38,7 @@ #include <threadhelp/readguard.hxx> #include <threadhelp/writeguard.hxx> #include <classes/droptargetlistener.hxx> -#include <helper/acceleratorinfo.hxx> +#include <framework/acceleratorinfo.hxx> #include <targets.h> #include <properties.h> #include <services.h> @@ -501,7 +501,7 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f // disable full screen mode of the frame! if (pParent && pParent->IsFullScreenMode()) { - pParent->ShowFullScreenMode(FALSE); + pParent->ShowFullScreenMode(sal_False); pParent->SetMenuBarMode(MENUBAR_MODE_NORMAL); } @@ -623,10 +623,10 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL BackingComp::getFrame() UI user. @param bSuspend - If its set to TRUE this controller should be suspended. - FALSE will resuspend it. + If its set to sal_True this controller should be suspended. + sal_False will resuspend it. - @return TRUE if the request could be finished successfully; FALSE otherwise. + @return sal_True if the request could be finished successfully; sal_False otherwise. */ sal_Bool SAL_CALL BackingComp::suspend( /*IN*/ sal_Bool ) diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index 0398aaef8901..729b84481681 100644..100755 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -87,7 +87,7 @@ DecoToolBox::DecoToolBox( Window* pParent, WinBits nStyle ) : ToolBox( pParent, nStyle ) { SetBackground(); - SetPaintTransparent( TRUE ); + SetPaintTransparent( sal_True ); } void DecoToolBox::DataChanged( const DataChangedEvent& rDCEvt ) @@ -98,17 +98,17 @@ void DecoToolBox::DataChanged( const DataChangedEvent& rDCEvt ) { calcMinSize(); SetBackground(); - SetPaintTransparent( TRUE ); + SetPaintTransparent( sal_True ); } } void DecoToolBox::calcMinSize() { ToolBox aTbx( GetParent() ); - USHORT nItems = GetItemCount(); - for( USHORT i = 0; i < nItems; i++ ) + sal_uInt16 nItems = GetItemCount(); + for( sal_uInt16 i = 0; i < nItems; i++ ) { - USHORT nId = GetItemId( i ); + sal_uInt16 nId = GetItemId( i ); aTbx.InsertItem( nId, GetItemImage( nId ) ); } aTbx.SetOutStyle( TOOLBOX_STYLE_FLAT ); @@ -196,8 +196,8 @@ BackingWindow::BackingWindow( Window* i_pParent ) : // clean up resource stack FreeResource(); - maWelcome.SetPaintTransparent( TRUE ); - maProduct.SetPaintTransparent( TRUE ); + maWelcome.SetPaintTransparent( sal_True ); + maProduct.SetPaintTransparent( sal_True ); EnableChildTransparentMode(); SetStyle( GetStyle() | WB_DIALOGCONTROL ); @@ -229,15 +229,15 @@ BackingWindow::BackingWindow( Window* i_pParent ) : if( mxDesktop.is() ) mxDesktopDispatchProvider = Reference< XDispatchProvider >( mxDesktop, UNO_QUERY ); - maWriterButton.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:WriterButton" ) ) ) ); - maCalcButton.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:CalcButton" ) ) ) ); - maImpressButton.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:ImpressButton" ) ) ) ); - maDrawButton.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:DrawButton" ) ) ) ); - maDBButton.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:DBButton" ) ) ) ); - maMathButton.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:MathButton" ) ) ) ); - maTemplateButton.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:TemplateButton" ) ) ) ); - maOpenButton.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:OpenButton" ) ) ) ); - maToolbox.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:Toolbox" ) ) ) ); + maWriterButton.SetHelpId( ".HelpId:StartCenter:WriterButton" ); + maCalcButton.SetHelpId( ".HelpId:StartCenter:CalcButton" ); + maImpressButton.SetHelpId( ".HelpId:StartCenter:ImpressButton" ); + maDrawButton.SetHelpId( ".HelpId:StartCenter:DrawButton" ); + maDBButton.SetHelpId( ".HelpId:StartCenter:DBButton" ); + maMathButton.SetHelpId( ".HelpId:StartCenter:MathButton" ); + maTemplateButton.SetHelpId( ".HelpId:StartCenter:TemplateButton" ); + maOpenButton.SetHelpId( ".HelpId:StartCenter:OpenButton" ); + maToolbox.SetHelpId( ".HelpId:StartCenter:Toolbox" ); // init background initBackground(); @@ -384,7 +384,7 @@ void BackingWindow::prepareRecentFileMenu() aBuf.append( i+1 ); aBuf.appendAscii( ": " ); aBuf.append( aMenuTitle ); - mpRecentMenu->InsertItem( static_cast<USHORT>(i+1), aBuf.makeStringAndClear() ); + mpRecentMenu->InsertItem( static_cast<sal_uInt16>(i+1), aBuf.makeStringAndClear() ); } } else @@ -562,9 +562,9 @@ void BackingWindow::initControls() MenuBar* pMBar = pSysWin->GetMenuBar(); if( pMBar ) { - for( USHORT i = 0; i < pMBar->GetItemCount(); i++ ) + for( sal_uInt16 i = 0; i < pMBar->GetItemCount(); i++ ) { - USHORT nItemId = pMBar->GetItemId( i ); + sal_uInt16 nItemId = pMBar->GetItemId( i ); String aItemText( pMBar->GetItemText( nItemId ) ); if( aItemText.Len() ) aMnemns.RegisterMnemonic( aItemText ); @@ -675,11 +675,11 @@ void BackingWindow::layoutButton( { rtl::OUString aURL( i_pURL ? rtl::OUString::createFromAscii( i_pURL ) : rtl::OUString() ); // setup button - i_rBtn.SetPaintTransparent( TRUE ); + i_rBtn.SetPaintTransparent( sal_True ); i_rBtn.SetClickHdl( LINK( this, BackingWindow, ClickHdl ) ); if( i_pURL && (! i_rOpt.IsModuleInstalled( i_eMod ) || i_rURLS.find( aURL ) == i_rURLS.end()) ) { - i_rBtn.Enable( FALSE ); + i_rBtn.Enable( sal_False ); } // setup text @@ -1100,7 +1100,7 @@ void BackingWindow::dispatchURL( const rtl::OUString& i_rURL, if ( xDispatch.is() ) { ImplDelayedDispatch* pDisp = new ImplDelayedDispatch( xDispatch, aDispatchURL, i_rArgs ); - ULONG nEventId = 0; + sal_uLong nEventId = 0; if( ! Application::PostUserEvent( nEventId, Link( NULL, implDispatchDelayed ), pDisp ) ) delete pDisp; // event could not be posted for unknown reason, at least don't leak } diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx index 5eebccb80c5f..5eebccb80c5f 100644..100755 --- a/framework/source/services/backingwindow.hxx +++ b/framework/source/services/backingwindow.hxx diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index 1dfa1b4cca56..369394d008c7 100644..100755 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -96,6 +96,8 @@ #endif #include <comphelper/extract.hxx> +#include <fwkdllapi.h> + //_________________________________________________________________________________________________________________ // namespace //_________________________________________________________________________________________________________________ @@ -1527,7 +1529,7 @@ sal_Bool SAL_CALL Desktop::convertFastPropertyValue( css::uno::Any& aCon // Register transaction and reject wrong calls. TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); - // Initialize state with FALSE !!! + // Initialize state with sal_False !!! // (Handle can be invalid) sal_Bool bReturn = sal_False; diff --git a/framework/source/services/dispatchhelper.cxx b/framework/source/services/dispatchhelper.cxx index 629ebe735035..629ebe735035 100644..100755 --- a/framework/source/services/dispatchhelper.cxx +++ b/framework/source/services/dispatchhelper.cxx diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index e0caad6991eb..9534685b2363 100644..100755 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -41,11 +41,11 @@ #include <loadenv/loadenv.hxx> #include <helper/oframes.hxx> #include <helper/statusindicatorfactory.hxx> -#include <helper/titlehelper.hxx> +#include <framework/titlehelper.hxx> #include <classes/droptargetlistener.hxx> #include <classes/taskcreator.hxx> #include <loadenv/targethelper.hxx> -#include <classes/framelistanalyzer.hxx> +#include <framework/framelistanalyzer.hxx> #include <helper/dockingareadefaultacceptor.hxx> #include <dispatch/dispatchinformationprovider.hxx> #include <threadhelp/transactionguard.hxx> @@ -275,7 +275,7 @@ Frame::Frame( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFac , PropertySetHelper ( xFactory, &m_aLock, &m_aTransactionManager, - sal_False) // FALSE => dont release shared mutex on calling us! + sal_False) // sal_False => dont release shared mutex on calling us! , ::cppu::OWeakObject ( ) // init member , m_xFactory ( xFactory ) diff --git a/framework/source/services/fwk_services.src b/framework/source/services/fwk_services.src index d2368f9eacdc..d2368f9eacdc 100644..100755 --- a/framework/source/services/fwk_services.src +++ b/framework/source/services/fwk_services.src diff --git a/framework/source/services/license.cxx b/framework/source/services/license.cxx index 65363a5e29f2..629eb5047893 100644..100755 --- a/framework/source/services/license.cxx +++ b/framework/source/services/license.cxx @@ -228,7 +228,7 @@ static sal_Bool _parseDateTime(const ::rtl::OUString& aString, DateTime& aDateTi sal_Int32 nMinute = aTimeString.getToken(0, ':', nIndex).toInt32(); sal_Int32 nSecond = aTimeString.getToken(0, ':', nIndex).toInt32(); - Date tmpDate((USHORT)nDay, (USHORT)nMonth, (USHORT)nYear); + Date tmpDate((sal_uInt16)nDay, (sal_uInt16)nMonth, (sal_uInt16)nYear); Time tmpTime(nHour, nMinute, nSecond); DateTime tmpDateTime(tmpDate, tmpTime); if (aString.indexOf(aUTCString) < 0) @@ -423,7 +423,7 @@ LicenseDialog::LicenseDialog(const ::rtl::OUString & aLicensePath, ResMgr *pResM aArrow(this, ResId(IMG_ARROW, *pResMgr)), aStrAccept( ResId(LICENSE_ACCEPT, *pResMgr) ), aStrNotAccept( ResId(LICENSE_NOTACCEPT, *pResMgr) ), - bEndReached(FALSE) + bEndReached(sal_False) { FreeResource(); @@ -486,7 +486,7 @@ IMPL_LINK( LicenseDialog, PageDownHdl, PushButton *, EMPTYARG ) IMPL_LINK( LicenseDialog, EndReachedHdl, LicenseView *, EMPTYARG ) { - bEndReached = TRUE; + bEndReached = sal_True; EnableControls(); @@ -516,7 +516,7 @@ void LicenseDialog::EnableControls() { if( !bEndReached && ( aLicenseML.IsEndReached() || !aLicenseML.GetText().Len() ) ) - bEndReached = TRUE; + bEndReached = sal_True; if ( bEndReached ) { @@ -567,20 +567,20 @@ void LicenseView::ScrollDown( ScrollType eScroll ) pScroll->DoScrollAction( eScroll ); } -BOOL LicenseView::IsEndReached() const +sal_Bool LicenseView::IsEndReached() const { - BOOL bEndReached; + sal_Bool bEndReached; ExtTextView* pView = GetTextView(); ExtTextEngine* pEdit = GetTextEngine(); - ULONG nHeight = pEdit->GetTextHeight(); + sal_uLong nHeight = pEdit->GetTextHeight(); Size aOutSize = pView->GetWindow()->GetOutputSizePixel(); Point aBottom( 0, aOutSize.Height() ); - if ( (ULONG) pView->GetDocPos( aBottom ).Y() >= nHeight - 1 ) - bEndReached = TRUE; + if ( (sal_uLong) pView->GetDocPos( aBottom ).Y() >= nHeight - 1 ) + bEndReached = sal_True; else - bEndReached = FALSE; + bEndReached = sal_False; return bEndReached; } @@ -589,8 +589,8 @@ void LicenseView::Notify( SfxBroadcaster&, const SfxHint& rHint ) { if ( rHint.IsA( TYPE(TextHint) ) ) { - BOOL bLastVal = EndReached(); - ULONG nId = ((const TextHint&)rHint).GetId(); + sal_Bool bLastVal = EndReached(); + sal_uLong nId = ((const TextHint&)rHint).GetId(); if ( nId == TEXT_HINT_PARAINSERTED ) { diff --git a/framework/source/services/makefile.mk b/framework/source/services/makefile.mk deleted file mode 100644 index 2978d9aacf5e..000000000000 --- a/framework/source/services/makefile.mk +++ /dev/null @@ -1,64 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=..$/.. - -PRJNAME= framework -TARGET= fwk_services -USE_DEFFILE= TRUE -ENABLE_EXCEPTIONS= TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -# --- Generate ----------------------------------------------------- - -SLOFILES=\ - $(SLO)$/desktop.obj \ - $(SLO)$/frame.obj \ - $(SLO)$/urltransformer.obj \ - $(SLO)$/mediatypedetectionhelper.obj \ - $(SLO)$/substitutepathvars.obj \ - $(SLO)$/pathsettings.obj \ - $(SLO)$/backingcomp.obj \ - $(SLO)$/backingwindow.obj \ - $(SLO)$/dispatchhelper.obj \ - $(SLO)$/license.obj \ - $(SLO)$/modulemanager.obj \ - $(SLO)$/autorecovery.obj \ - $(SLO)$/sessionlistener.obj \ - $(SLO)$/taskcreatorsrv.obj \ - $(SLO)$/uriabbreviation.obj \ - $(SLO)$/tabwindowservice.obj - -SRS1NAME=$(TARGET) -SRC1FILES= fwk_services.src - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - diff --git a/framework/source/services/mediatypedetectionhelper.cxx b/framework/source/services/mediatypedetectionhelper.cxx index 390f49ef6631..390f49ef6631 100644..100755 --- a/framework/source/services/mediatypedetectionhelper.cxx +++ b/framework/source/services/mediatypedetectionhelper.cxx diff --git a/framework/source/services/menudocumenthandler.cxx b/framework/source/services/menudocumenthandler.cxx deleted file mode 100644 index 756fa482f97d..000000000000 --- a/framework/source/services/menudocumenthandler.cxx +++ /dev/null @@ -1,902 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_framework.hxx" - -#include <stdio.h> -#include <services/menudocumenthandler.hxx> -#include <classes/menuconfiguration.hxx> -#include <classes/addonmenu.hxx> - -#include <services/attributelist.hxx> - -#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> - - -using namespace ::rtl; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::xml::sax; - -const int ITEMID_START_VALUE = 1000; - -#define XMLNS_MENU "http://openoffice.org/2001/menu" -#define XMLNS_PREFIX "menu:" - -#define ELEMENT_MENUBAR "http://openoffice.org/2001/menu^menubar" -#define ELEMENT_MENU "http://openoffice.org/2001/menu^menu" -#define ELEMENT_MENUPOPUP "http://openoffice.org/2001/menu^menupopup" -#define ELEMENT_MENUITEM "http://openoffice.org/2001/menu^menuitem" -#define ELEMENT_MENUSEPARATOR "http://openoffice.org/2001/menu^menuseparator" - -#define ELEMENT_NS_MENUBAR "menu:menubar" -#define ELEMENT_NS_MENU "menu:menu" -#define ELEMENT_NS_MENUPOPUP "menu:menupopup" -#define ELEMENT_NS_MENUITEM "menu:menuitem" -#define ELEMENT_NS_MENUSEPARATOR "menu:menuseparator" - -#define ATTRIBUTE_ID "http://openoffice.org/2001/menu^id" -#define ATTRIBUTE_LABEL "http://openoffice.org/2001/menu^label" -#define ATTRIBUTE_HELPID "http://openoffice.org/2001/menu^helpid" -#define ATTRIBUTE_LINEBREAK "http://openoffice.org/2001/menu^linebreak" - -#define ATTRIBUTE_NS_ID "menu:id" -#define ATTRIBUTE_NS_LABEL "menu:label" -#define ATTRIBUTE_NS_HELPID "menu:helpid" -#define ATTRIBUTE_NS_LINEBREAK "menu:linebreak" - -#define ATTRIBUTE_XMLNS_MENU "xmlns:menu" - -#define ATTRIBUTE_TYPE_CDATA "CDATA" - -#define MENUBAR_DOCTYPE "<!DOCTYPE menu:menubar PUBLIC \"-//OpenOffice.org//DTD OfficeDocument 1.0//EN\" \"menubar.dtd\">" - - -// special popup menus (filled during runtime) must be saved as a menuitem!!! -// same as in menumanager.cxx - you have to change both files!!! -#define SID_SFX_START 5000 -#define SID_NEWDOCDIRECT (SID_SFX_START + 537) -#define SID_AUTOPILOTMENU (SID_SFX_START + 1381) -#define SID_FORMATMENU (SID_SFX_START + 780) - -const ::rtl::OUString aSlotProtocol( RTL_CONSTASCII_USTRINGPARAM( "slot:" )); -const ::rtl::OUString aSlotNewDocDirect( RTL_CONSTASCII_USTRINGPARAM( "slot:5537" )); -const ::rtl::OUString aSlotAutoPilot( RTL_CONSTASCII_USTRINGPARAM( "slot:6381" )); - -const ::rtl::OUString aSpecialFileMenu( RTL_CONSTASCII_USTRINGPARAM( "file" )); -const ::rtl::OUString aSpecialWindowMenu( RTL_CONSTASCII_USTRINGPARAM( "window" )); - -const ULONG MENU_SAVE_LABEL = 0x00000001; - -namespace framework -{ - -// ----------------------------------------------------------------------------- -// Base class implementation - -ReadMenuDocumentHandlerBase::ReadMenuDocumentHandlerBase() : - m_xLocator( 0 ), - m_xReader( 0 ) -{ -} - -ReadMenuDocumentHandlerBase::~ReadMenuDocumentHandlerBase() -{ -} - -Any SAL_CALL ReadMenuDocumentHandlerBase::queryInterface( - const Type & rType ) -throw( RuntimeException ) -{ - Any a = ::cppu::queryInterface( - rType , - SAL_STATIC_CAST( XDocumentHandler*, this )); - if ( a.hasValue() ) - return a; - - return OWeakObject::queryInterface( rType ); -} - -void SAL_CALL ReadMenuDocumentHandlerBase::ignorableWhitespace( - const OUString& aWhitespaces ) -throw( SAXException, RuntimeException ) -{ -} - -void SAL_CALL ReadMenuDocumentHandlerBase::processingInstruction( - const OUString& aTarget, const OUString& aData ) -throw( SAXException, RuntimeException ) -{ -} - -void SAL_CALL ReadMenuDocumentHandlerBase::setDocumentLocator( - const Reference< XLocator > &xLocator) -throw( SAXException, RuntimeException ) -{ - m_xLocator = xLocator; -} - -::rtl::OUString ReadMenuDocumentHandlerBase::getErrorLineString() -{ - char buffer[32]; - - if ( m_xLocator.is() ) - { - snprintf( buffer, sizeof(buffer), "Line: %ld - ", static_cast<long>( m_xLocator->getLineNumber() )); - return OUString::createFromAscii( buffer ); - } - else - return OUString(); -} - -// ----------------------------------------------------------------------------- - -// #110897# -OReadMenuDocumentHandler::OReadMenuDocumentHandler( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, - MenuBar* pMenuBar ) -: // #110897# - mxServiceFactory(xServiceFactory), - m_pMenuBar( pMenuBar ), - m_nElementDepth( 0 ), - m_bMenuBarMode( sal_False ), - m_nItemId( ITEMID_START_VALUE ) -{ -} - -// #110897# -const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& OReadMenuDocumentHandler::getServiceFactory() -{ - // #110897# - return mxServiceFactory; -} - -OReadMenuDocumentHandler::~OReadMenuDocumentHandler() -{ -} - - -void SAL_CALL OReadMenuDocumentHandler::startDocument(void) - throw ( SAXException, RuntimeException ) -{ -} - - -void SAL_CALL OReadMenuDocumentHandler::endDocument(void) - throw( SAXException, RuntimeException ) -{ - if ( m_nElementDepth > 0 ) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "A closing element is missing!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } -} - - -void SAL_CALL OReadMenuDocumentHandler::startElement( - const OUString& aName, const Reference< XAttributeList > &xAttrList ) -throw( SAXException, RuntimeException ) -{ - if ( m_bMenuBarMode ) - { - ++m_nElementDepth; - m_xReader->startElement( aName, xAttrList ); - } - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUBAR ))) - { - ++m_nElementDepth; - m_bMenuBarMode = sal_True; - - // #110897# m_xReader = Reference< XDocumentHandler >( new OReadMenuBarHandler( m_pMenuBar, &m_nItemId )); - m_xReader = Reference< XDocumentHandler >( new OReadMenuBarHandler( getServiceFactory(), m_pMenuBar, &m_nItemId )); - - m_xReader->startDocument(); - } -} - - -void SAL_CALL OReadMenuDocumentHandler::characters(const rtl::OUString& aChars) -throw( SAXException, RuntimeException ) -{ -} - - -void SAL_CALL OReadMenuDocumentHandler::endElement( const OUString& aName ) - throw( SAXException, RuntimeException ) -{ - if ( m_bMenuBarMode ) - { - --m_nElementDepth; - m_xReader->endElement( aName ); - if ( 0 == m_nElementDepth ) - { - m_xReader->endDocument(); - m_xReader = Reference< XDocumentHandler >(); - m_bMenuBarMode = sal_False; - if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUBAR ))) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "closing element menubar expected!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - } - } -} - - -// ----------------------------------------------------------------------------- - - -// #110897# -OReadMenuBarHandler::OReadMenuBarHandler( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, - MenuBar* pMenuBar, USHORT* pItemId ) -: // #110897# - mxServiceFactory( xServiceFactory ), - m_pMenuBar( pMenuBar ), - m_nElementDepth( 0 ), - m_bMenuMode( sal_False ), - m_pItemId( pItemId ) -{ -} - -// #110897# -const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& OReadMenuBarHandler::getServiceFactory() -{ - // #110897# - return mxServiceFactory; -} - -OReadMenuBarHandler::~OReadMenuBarHandler() -{ -} - - -void SAL_CALL OReadMenuBarHandler::startDocument(void) - throw ( SAXException, RuntimeException ) -{ -} - - -void SAL_CALL OReadMenuBarHandler::endDocument(void) - throw( SAXException, RuntimeException ) -{ -} - - -void SAL_CALL OReadMenuBarHandler::startElement( - const OUString& aName, const Reference< XAttributeList > &xAttrList ) -throw( SAXException, RuntimeException ) -{ - if ( m_bMenuMode ) - { - ++m_nElementDepth; - m_xReader->startElement( aName, xAttrList ); - } - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENU ))) - { - ++m_nElementDepth; - - ULONG nHelpId = 0; - OUString aCommandId; - OUString aLabel; - - m_bMenuMode = sal_True; - PopupMenu* pMenu = new PopupMenu(); - - // read attributes for menu - for ( int i=0; i< xAttrList->getLength(); i++ ) - { - OUString aName = xAttrList->getNameByIndex( i ); - OUString aValue = xAttrList->getValueByIndex( i ); - if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ID ))) - aCommandId = aValue; - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_LABEL ))) - aLabel = aValue; - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_HELPID ))) - nHelpId = aValue.toInt32(); - } - - if ( aCommandId.getLength() > 0 ) - { - USHORT nItemId; - if ( aCommandId.compareTo( aSlotProtocol, aSlotProtocol.getLength() ) == 0 ) - nItemId = (USHORT) aCommandId.copy( aSlotProtocol.getLength() ).toInt32(); - else - nItemId = ++(*m_pItemId); - - m_pMenuBar->InsertItem( nItemId, String() ); - m_pMenuBar->SetPopupMenu( nItemId, pMenu ); - m_pMenuBar->SetItemCommand( nItemId, aCommandId ); - if ( nHelpId > 0 ) - m_pMenuBar->SetHelpId( nItemId, nHelpId ); - if ( aLabel.getLength() > 0 ) - { - m_pMenuBar->SetItemText( nItemId, aLabel ); - m_pMenuBar->SetUserValue( nItemId, MENU_SAVE_LABEL ); - } - else - { - m_pMenuBar->SetUserValue( nItemId, 0 ); - } - } - else - { - delete pMenu; - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "attribute id for element menu required!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - - m_xReader = Reference< XDocumentHandler >( new OReadMenuHandler( pMenu, m_pItemId )); - m_xReader->startDocument(); - } - else - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "element menu expected!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } -} - - -void SAL_CALL OReadMenuBarHandler::characters(const rtl::OUString& aChars) -throw( SAXException, RuntimeException ) -{ -} - - -void OReadMenuBarHandler::endElement( const OUString& aName ) - throw( SAXException, RuntimeException ) -{ - if ( m_bMenuMode ) - { - --m_nElementDepth; - if ( 0 == m_nElementDepth ) - { - m_xReader->endDocument(); - m_xReader = Reference< XDocumentHandler >(); - m_bMenuMode = sal_False; - if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENU ))) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "closing element menu expected!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - } - else - m_xReader->endElement( aName ); - } -} - - -// ----------------------------------------------------------------------------- - - -OReadMenuHandler::OReadMenuHandler( Menu* pMenu, USHORT* pItemId ) : - m_pMenu( pMenu ), - m_nElementDepth( 0 ), - m_bMenuPopupMode( sal_False ), - m_pItemId( pItemId ) -{ -} - - -OReadMenuHandler::~OReadMenuHandler() -{ -} - - -void SAL_CALL OReadMenuHandler::startDocument(void) - throw ( SAXException, RuntimeException ) -{ -} - - -void SAL_CALL OReadMenuHandler::endDocument(void) - throw( SAXException, RuntimeException) -{ -} - - -void SAL_CALL OReadMenuHandler::startElement( - const OUString& aName, const Reference< XAttributeList > &xAttrList ) -throw( SAXException, RuntimeException ) -{ - if ( m_bMenuPopupMode ) - { - ++m_nElementDepth; - m_xReader->startElement( aName, xAttrList ); - } - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUPOPUP ))) - { - ++m_nElementDepth; - m_bMenuPopupMode = sal_True; - m_xReader = Reference< XDocumentHandler >( new OReadMenuPopupHandler( m_pMenu, m_pItemId )); - m_xReader->startDocument(); - } - else - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "unknown element found!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } -} - - -void SAL_CALL OReadMenuHandler::characters(const rtl::OUString& aChars) -throw( SAXException, RuntimeException ) -{ -} - - -void SAL_CALL OReadMenuHandler::endElement( const OUString& aName ) - throw( SAXException, RuntimeException ) -{ - if ( m_bMenuPopupMode ) - { - --m_nElementDepth; - if ( 0 == m_nElementDepth ) - { - m_xReader->endDocument(); - m_xReader = Reference< XDocumentHandler >(); - m_bMenuPopupMode = sal_False; - if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUPOPUP ))) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "closing element menupopup expected!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - } - else - m_xReader->endElement( aName ); - } -} - - -// ----------------------------------------------------------------------------- - - -OReadMenuPopupHandler::OReadMenuPopupHandler( Menu* pMenu, USHORT* pItemId ) : - m_pMenu( pMenu ), - m_nElementDepth( 0 ), - m_bMenuMode( sal_False ), - m_pItemId( pItemId ), - m_nNextElementExpected( ELEM_CLOSE_NONE ) -{ -} - - -OReadMenuPopupHandler::~OReadMenuPopupHandler() -{ -} - - -void SAL_CALL OReadMenuPopupHandler::startDocument(void) - throw ( SAXException, RuntimeException ) -{ -} - - -void SAL_CALL OReadMenuPopupHandler::endDocument(void) - throw( SAXException, RuntimeException) -{ -} - - -void SAL_CALL OReadMenuPopupHandler::startElement( - const OUString& aName, const Reference< XAttributeList > &xAttrList ) -throw( SAXException, RuntimeException ) -{ - ++m_nElementDepth; - - if ( m_bMenuMode ) - m_xReader->startElement( aName, xAttrList ); - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENU ))) - { - ULONG nHelpId = 0; - OUString aCommandId; - OUString aLabel; - - m_bMenuMode = sal_True; - PopupMenu* pMenu = new PopupMenu(); - - // read attributes for menu - for ( int i=0; i< xAttrList->getLength(); i++ ) - { - OUString aName = xAttrList->getNameByIndex( i ); - OUString aValue = xAttrList->getValueByIndex( i ); - if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ID ))) - aCommandId = aValue; - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_LABEL ))) - aLabel = aValue; - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_HELPID ))) - nHelpId = aValue.toInt32(); - } - - if ( aCommandId.getLength() > 0 ) - { - USHORT nItemId; - if ( aCommandId.compareTo( aSlotProtocol, aSlotProtocol.getLength() ) == 0 ) - nItemId = (USHORT) aCommandId.copy( aSlotProtocol.getLength() ).toInt32(); - else - nItemId = ++(*m_pItemId); - - m_pMenu->InsertItem( nItemId, String() ); - m_pMenu->SetPopupMenu( nItemId, pMenu ); - m_pMenu->SetItemCommand( nItemId, aCommandId ); - if ( nHelpId > 0 ) - m_pMenu->SetHelpId( nItemId, nHelpId ); - if ( aLabel.getLength() > 0 ) - { - m_pMenu->SetItemText( nItemId, aLabel ); - m_pMenu->SetUserValue( nItemId, MENU_SAVE_LABEL ); - } - else - { - m_pMenu->SetUserValue( nItemId, 0 ); - } - } - else - { - delete pMenu; - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "attribute id for element menu required!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - - m_xReader = Reference< XDocumentHandler >( new OReadMenuHandler( pMenu, m_pItemId )); - m_xReader->startDocument(); - } - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUITEM ))) - { - ULONG nHelpId = 0; - OUString aCommandId; - OUString aLabel; - - // read attributes for menu item - for ( int i=0; i< xAttrList->getLength(); i++ ) - { - OUString aName = xAttrList->getNameByIndex( i ); - OUString aValue = xAttrList->getValueByIndex( i ); - if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ID ))) - aCommandId = aValue; - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_LABEL ))) - aLabel = aValue; - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_HELPID ))) - nHelpId = aValue.toInt32(); - } - - if ( aCommandId.getLength() > 0 ) - { - USHORT nItemId; - if ( aCommandId.compareTo( aSlotProtocol, aSlotProtocol.getLength() ) == 0 ) - nItemId = (USHORT) aCommandId.copy( aSlotProtocol.getLength() ).toInt32(); - else - nItemId = ++(*m_pItemId); - - m_pMenu->InsertItem( nItemId, String() ); - m_pMenu->SetItemCommand( nItemId, aCommandId ); - if ( nHelpId > 0 ) - m_pMenu->SetHelpId( nItemId, nHelpId ); - if ( aLabel.getLength() > 0 ) - { - m_pMenu->SetItemText( nItemId, aLabel ); - m_pMenu->SetUserValue( nItemId, MENU_SAVE_LABEL ); - } - else - { - m_pMenu->SetUserValue( nItemId, 0 ); - } - } - - m_nNextElementExpected = ELEM_CLOSE_MENUITEM; - } - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUSEPARATOR ))) - { - m_pMenu->InsertSeparator(); - m_nNextElementExpected = ELEM_CLOSE_MENUSEPARATOR; - } - else - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "unknown element found!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } -} - - -void SAL_CALL OReadMenuPopupHandler::characters(const rtl::OUString& aChars) -throw( SAXException, RuntimeException ) -{ -} - - -void SAL_CALL OReadMenuPopupHandler::endElement( const OUString& aName ) - throw( SAXException, RuntimeException ) -{ - --m_nElementDepth; - if ( m_bMenuMode ) - { - if ( 0 == m_nElementDepth ) - { - m_xReader->endDocument(); - m_xReader = Reference< XDocumentHandler >(); - m_bMenuMode = sal_False; - if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENU ))) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "closing element menu expected!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - } - else - m_xReader->endElement( aName ); - } - else - { - if ( m_nNextElementExpected == ELEM_CLOSE_MENUITEM ) - { - if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUITEM ))) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "closing element menuitem expected!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - } - else if ( m_nNextElementExpected == ELEM_CLOSE_MENUSEPARATOR ) - { - if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUSEPARATOR ))) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "closing element menuseparator expected!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - } - - m_nNextElementExpected = ELEM_CLOSE_NONE; - } -} - - -// --------------------------------- Write XML --------------------------------- - - -OWriteMenuDocumentHandler::OWriteMenuDocumentHandler( MenuBar* pMenu, Reference< XDocumentHandler > rxWriteDocumentHandler ) : - m_pMenuBar( pMenu ), - m_xWriteDocumentHandler( rxWriteDocumentHandler ) -{ - m_xEmptyList = Reference< XAttributeList >( (XAttributeList *)new AttributeListImpl, UNO_QUERY ); - m_aAttributeType = OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_TYPE_CDATA )); -} - - -OWriteMenuDocumentHandler::~OWriteMenuDocumentHandler() -{ -} - - -void OWriteMenuDocumentHandler::WriteMenuDocument() -throw ( SAXException, RuntimeException ) -{ - AttributeListImpl* pList = new AttributeListImpl; - Reference< XAttributeList > rList( (XAttributeList *) pList , UNO_QUERY ); - - m_xWriteDocumentHandler->startDocument(); - - // write DOCTYPE line! - Reference< XExtendedDocumentHandler > xExtendedDocHandler( m_xWriteDocumentHandler, UNO_QUERY ); - if ( xExtendedDocHandler.is() ) - { - xExtendedDocHandler->unknown( OUString( RTL_CONSTASCII_USTRINGPARAM( MENUBAR_DOCTYPE )) ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - } - - pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_XMLNS_MENU )), - m_aAttributeType, - OUString( RTL_CONSTASCII_USTRINGPARAM( XMLNS_MENU )) ); - - pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_NS_ID )), - m_aAttributeType, - OUString( RTL_CONSTASCII_USTRINGPARAM( "menubar" )) ); - - m_xWriteDocumentHandler->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUBAR )), pList ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - - WriteMenu( m_pMenuBar ); - - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUBAR )) ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->endDocument(); -} - - -void OWriteMenuDocumentHandler::WriteMenu( Menu* pMenu ) -throw ( SAXException, RuntimeException ) -{ - USHORT nItemCount = pMenu->GetItemCount(); - BOOL bSeparator = FALSE; - - for ( USHORT nItemPos = 0; nItemPos < nItemCount; nItemPos++ ) - { - USHORT nItemId = pMenu->GetItemId( nItemPos ); - - PopupMenu* pPopupMenu = pMenu->GetPopupMenu( nItemId ); - if ( pPopupMenu ) - { - OUString aItemCommand = pMenu->GetItemCommand( nItemId ); - - if ( nItemId == SID_NEWDOCDIRECT || - nItemId == SID_AUTOPILOTMENU ) - { - // special popup menus (filled during runtime) must be saved as a menuitem!!! - WriteMenuItem( pMenu, nItemId ); - bSeparator = FALSE; - } - else if ( nItemId == SID_FORMATMENU ) - { - // special popup menu - must be written as empty popup! - AttributeListImpl* pListMenu = new AttributeListImpl; - Reference< XAttributeList > xListMenu( (XAttributeList *)pListMenu , UNO_QUERY ); - - String aCommand( pMenu->GetItemCommand( nItemId ) ); - if ( !aCommand.Len() ) - { - aCommand = String::CreateFromAscii("slot:"); - aCommand += String::CreateFromInt32( nItemId ); - } - - pListMenu->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_NS_ID )), - m_aAttributeType, - aCommand ); - -// if ( pMenu->GetUserValue( nItemId ) & MENU_SAVE_LABEL ) - pListMenu->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_NS_LABEL )), - m_aAttributeType, - pMenu->GetItemText( nItemId ) ); - - m_xWriteDocumentHandler->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENU )), xListMenu ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUPOPUP )), m_xEmptyList ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUPOPUP )) ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENU )) ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - bSeparator = FALSE; - } - else if ( !AddonPopupMenu::IsCommandURLPrefix ( aItemCommand )) - { - AttributeListImpl* pListMenu = new AttributeListImpl; - Reference< XAttributeList > xListMenu( (XAttributeList *)pListMenu , UNO_QUERY ); - - String aCommand( pMenu->GetItemCommand( nItemId ) ); - if ( !aCommand.Len() ) - { - aCommand = String::CreateFromAscii("slot:"); - aCommand += String::CreateFromInt32( nItemId ); - } - - pListMenu->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_NS_ID )), - m_aAttributeType, - aCommand ); - -// if ( pMenu->GetUserValue( nItemId ) & MENU_SAVE_LABEL ) - pListMenu->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_NS_LABEL )), - m_aAttributeType, - pMenu->GetItemText( nItemId ) ); - - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENU )), xListMenu ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUPOPUP )), m_xEmptyList ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - - WriteMenu( pPopupMenu ); - - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUPOPUP )) ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENU )) ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - bSeparator = FALSE; - } - } - else - { - if ( pMenu->GetItemType( nItemPos ) != MENUITEM_SEPARATOR ) - { - // don't save special menu items for (window list and pickup list, add-ons ) - if ( !MenuConfiguration::IsPickListItemId( nItemId ) && - !MenuConfiguration::IsWindowListItemId( nItemId ) && - !AddonMenuManager::IsAddonMenuId( nItemId )) - { - bSeparator = FALSE; - WriteMenuItem( pMenu, nItemId ); - } - } - else if ( !bSeparator ) - { - // Don't write two separators together - WriteMenuSeparator(); - bSeparator = TRUE; - } - } - } -} - - -void OWriteMenuDocumentHandler::WriteMenuItem( Menu* pMenu, USHORT nItemId ) -{ - AttributeListImpl* pList = new AttributeListImpl; - Reference< XAttributeList > xList( (XAttributeList *) pList , UNO_QUERY ); - - String aCommand( pMenu->GetItemCommand( nItemId ) ); - if ( !aCommand.Len() ) - { - aCommand = String::CreateFromAscii("slot:"); - aCommand += String::CreateFromInt32( nItemId ); - } - - pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_NS_ID )), - m_aAttributeType, - aCommand ); - - ULONG nHelpId = pMenu->GetHelpId( nItemId ); - if ( nHelpId > 0 ) - { - pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_NS_HELPID )), - m_aAttributeType, - OUString::valueOf( sal_Int64( nHelpId )) ); - } - -// if ( pMenu->GetUserValue( nItemId ) & MENU_SAVE_LABEL ) - pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_NS_LABEL )), - m_aAttributeType, - pMenu->GetItemText( nItemId )); - - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUITEM )), xList ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUITEM )) ); -} - - -void OWriteMenuDocumentHandler::WriteMenuSeparator() -{ - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUSEPARATOR )), m_xEmptyList ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUSEPARATOR )) ); -} - -} // namespace framework - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/services/modelwinservice.cxx b/framework/source/services/modelwinservice.cxx new file mode 100755 index 000000000000..d50fe7dcc653 --- /dev/null +++ b/framework/source/services/modelwinservice.cxx @@ -0,0 +1,279 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: urltransformer.cxx,v $ + * $Revision: 1.17 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_framework.hxx" + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#include "services.h" +#include "services/modelwinservice.hxx" + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +#include <com/sun/star/awt/XControlModel.hpp> + +using namespace ::com::sun::star; + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// non exported definitions +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// declarations +//_________________________________________________________________________________________________________________ + +class Impl_ModelWinService +{ + public: + ~Impl_ModelWinService(); + + static Impl_ModelWinService* getSingleInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rServiceManager ); + + uno::Any getByName( const ::rtl::OUString& sName ) + throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ); + + uno::Sequence< ::rtl::OUString > getElementNames() + throw( uno::RuntimeException ); + + sal_Bool hasByName( const ::rtl::OUString& sName ) + throw( uno::RuntimeException ); + + uno::Type getElementType() + throw( css::uno::RuntimeException ); + + sal_Bool hasElements() + throw( css::uno::RuntimeException ); + + void registerModelForXWindow( const uno::Reference< awt::XWindow >& rWindow, const uno::Reference< awt::XControlModel >& rModel ); + + void deregisterModelForXWindow( const uno::Reference< awt::XWindow >& rWindow ); + + private: + typedef BaseHash< uno::WeakReference< awt::XControlModel > > ModelWinMap; + + Impl_ModelWinService(); + Impl_ModelWinService( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rServiceManager ); + + static Impl_ModelWinService* m_pModelWinService; + + ::com::sun::star::uno::WeakReference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; + ModelWinMap m_aModelMap; +}; + +Impl_ModelWinService* Impl_ModelWinService::m_pModelWinService = 0; + +Impl_ModelWinService* Impl_ModelWinService::getSingleInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rServiceManager ) +{ + osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ; + if ( !m_pModelWinService ) + m_pModelWinService = new Impl_ModelWinService( rServiceManager ); + return m_pModelWinService; +} + +Impl_ModelWinService::Impl_ModelWinService( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rServiceManager ) : + m_xServiceManager( rServiceManager ) +{ +} + +Impl_ModelWinService::Impl_ModelWinService() +{ +} + +Impl_ModelWinService::~Impl_ModelWinService() +{ +} + +void Impl_ModelWinService::registerModelForXWindow( const uno::Reference< awt::XWindow >& rWindow, const uno::Reference< awt::XControlModel >& rModel ) +{ + osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ; + + ::rtl::OUString sName = rtl::OUString::valueOf( reinterpret_cast< sal_Int64 >((void*)rWindow.get())); + ModelWinMap::iterator pIter = m_aModelMap.find( sName ); + if ( pIter != m_aModelMap.end() ) + pIter->second = rModel; + else + m_aModelMap[sName] = rModel; +} + +void Impl_ModelWinService::deregisterModelForXWindow( const uno::Reference< awt::XWindow >& /*rWindow*/ ) +{ +} + +uno::Any Impl_ModelWinService::getByName( const ::rtl::OUString& sName ) +throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) +{ + uno::Any aAny; + + osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ; + ModelWinMap::iterator pIter = m_aModelMap.find( sName ); + if ( pIter != m_aModelMap.end()) + { + uno::Reference< awt::XControlModel > xModel( pIter->second ); + aAny = uno::makeAny(xModel); + } + + return aAny; +} + +uno::Sequence< ::rtl::OUString > Impl_ModelWinService::getElementNames() +throw( uno::RuntimeException ) +{ + osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ; + uno::Sequence< ::rtl::OUString > aResult( m_aModelMap.size() ); + + sal_Int32 i = 0; + ModelWinMap::const_iterator pIter = m_aModelMap.begin(); + while ( pIter != m_aModelMap.end()) + aResult[i++] = pIter->first; + + return aResult; +} + +sal_Bool Impl_ModelWinService::hasByName( const ::rtl::OUString& sName ) +throw( uno::RuntimeException ) +{ + osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ; + ModelWinMap::iterator pIter = m_aModelMap.find( sName ); + if ( pIter != m_aModelMap.end()) + return true; + else + return false; +} + +uno::Type Impl_ModelWinService::getElementType() +throw( css::uno::RuntimeException ) +{ + return ::getCppuType(( const uno::Reference< awt::XControlModel >*)NULL ); +} + +sal_Bool Impl_ModelWinService::hasElements() +throw( css::uno::RuntimeException ) +{ + osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ; + return (m_aModelMap.size() > 0); +} + +//***************************************************************************************************************** +// css::uno::XInterface, XTypeProvider, XServiceInfo +//***************************************************************************************************************** + +DEFINE_XINTERFACE_4 ( ModelWinService , + OWeakObject , + DIRECT_INTERFACE(css::lang::XTypeProvider ), + DIRECT_INTERFACE(css::lang::XServiceInfo ), + DIRECT_INTERFACE(css::container::XNameAccess ), + DIRECT_INTERFACE(css::container::XElementAccess ) + ) + +DEFINE_XTYPEPROVIDER_4 ( ModelWinService , + css::lang::XTypeProvider , + css::lang::XServiceInfo , + css::container::XNameAccess , + css::container::XElementAccess + ) + +DEFINE_XSERVICEINFO_MULTISERVICE ( ModelWinService , + OWeakObject , + SERVICENAME_MODELWINSERVICE , + IMPLEMENTATIONNAME_MODELWINSERVICE + ) + +DEFINE_INIT_SERVICE ( ModelWinService, + { + } + ) + +//***************************************************************************************************************** +// constructor +//***************************************************************************************************************** +ModelWinService::ModelWinService(const uno::Reference< lang::XMultiServiceFactory >& rServiceManager ) : + m_xServiceManager( rServiceManager ) +{ +} + +ModelWinService::~ModelWinService() +{ +} + +void ModelWinService::registerModelForXWindow( const uno::Reference< awt::XWindow >& rWindow, const uno::Reference< awt::XControlModel >& rModel ) +{ + Impl_ModelWinService::getSingleInstance(m_xServiceManager)->registerModelForXWindow( rWindow, rModel ); +} + +void ModelWinService::deregisterModelForXWindow( const uno::Reference< awt::XWindow >& rWindow ) +{ + Impl_ModelWinService::getSingleInstance(m_xServiceManager)->deregisterModelForXWindow( rWindow ); +} + +uno::Any SAL_CALL ModelWinService::getByName( const ::rtl::OUString& sName ) +throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) +{ + return Impl_ModelWinService::getSingleInstance(m_xServiceManager)->getByName( sName ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ModelWinService::getElementNames() +throw( uno::RuntimeException ) +{ + return Impl_ModelWinService::getSingleInstance(m_xServiceManager)->getElementNames( ); +} + +sal_Bool SAL_CALL ModelWinService::hasByName( const ::rtl::OUString& sName ) +throw( uno::RuntimeException ) +{ + return Impl_ModelWinService::getSingleInstance(m_xServiceManager)->hasByName( sName ); +} + +//--------------------------------------------------------------------------------------------------------- +// XElementAccess +//--------------------------------------------------------------------------------------------------------- +uno::Type SAL_CALL ModelWinService::getElementType() +throw( uno::RuntimeException ) +{ + return ::getCppuType( (const uno::Reference< awt::XControlModel > *)NULL ); +} + +sal_Bool SAL_CALL ModelWinService::hasElements() +throw( uno::RuntimeException ) +{ + return Impl_ModelWinService::getSingleInstance(m_xServiceManager)->hasElements(); +} + +} diff --git a/framework/source/services/modulemanager.cxx b/framework/source/services/modulemanager.cxx index f1ab43668bd6..f1ab43668bd6 100644..100755 --- a/framework/source/services/modulemanager.cxx +++ b/framework/source/services/modulemanager.cxx diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx index ff7e725586af..13079a4b7ae5 100644..100755 --- a/framework/source/services/pathsettings.cxx +++ b/framework/source/services/pathsettings.cxx @@ -60,6 +60,8 @@ #include <comphelper/configurationhelper.hxx> #include <unotools/configpathes.hxx> +#include <fwkdllapi.h> + // ______________________________________________ // non exported const @@ -249,21 +251,24 @@ void PathSettings::impl_readAll() OUStringList PathSettings::impl_readOldFormat(const ::rtl::OUString& sPath) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::impl_readOldFormat" ); - css::uno::Reference< css::container::XNameAccess > xCfg = fa_getCfgOld(); - css::uno::Any aVal = xCfg->getByName(sPath); - - ::rtl::OUString sStringVal; - css::uno::Sequence< ::rtl::OUString > lStringListVal; - OUStringList aPathVal; + css::uno::Reference< css::container::XNameAccess > xCfg( fa_getCfgOld() ); + OUStringList aPathVal; - if (aVal >>= sStringVal) - { - aPathVal.push_back(sStringVal); - } - else - if (aVal >>= lStringListVal) + if( xCfg->hasByName(sPath) ) { - aPathVal << lStringListVal; + css::uno::Any aVal( xCfg->getByName(sPath) ); + + ::rtl::OUString sStringVal; + css::uno::Sequence< ::rtl::OUString > lStringListVal; + + if (aVal >>= sStringVal) + { + aPathVal.push_back(sStringVal); + } + else if (aVal >>= lStringListVal) + { + aPathVal << lStringListVal; + } } return aPathVal; @@ -982,6 +987,13 @@ sal_Bool PathSettings::impl_isValidPath(const OUStringList& lPath) const //----------------------------------------------------------------------------- sal_Bool PathSettings::impl_isValidPath(const ::rtl::OUString& sPath) const { + // allow empty path to reset a path. +// idea by LLA to support empty pathes +// if (sPath.getLength() == 0) +// { +// return sal_True; +// } + return (! INetURLObject(sPath).HasError()); } diff --git a/framework/source/services/sessionlistener.cxx b/framework/source/services/sessionlistener.cxx index 72a7e5bc2046..72a7e5bc2046 100644..100755 --- a/framework/source/services/sessionlistener.cxx +++ b/framework/source/services/sessionlistener.cxx diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx index 9c881abbdc51..9c881abbdc51 100644..100755 --- a/framework/source/services/substitutepathvars.cxx +++ b/framework/source/services/substitutepathvars.cxx diff --git a/framework/source/services/tabwindowservice.cxx b/framework/source/services/tabwindowservice.cxx index 641328f69be3..2677ca60fbfd 100644..100755 --- a/framework/source/services/tabwindowservice.cxx +++ b/framework/source/services/tabwindowservice.cxx @@ -120,7 +120,7 @@ TabWindowService::TabWindowService( const css::uno::Reference< css::lang::XMulti , PropertySetHelper ( xFactory , &m_aLock , &m_aTransactionManager , - sal_False ) // FALSE => dont release shared mutex on calling us! + sal_False ) // sal_False => dont release shared mutex on calling us! , OWeakObject ( ) // Init member @@ -369,7 +369,7 @@ IMPL_LINK( TabWindowService, EventListener, VclSimpleEvent*, pEvent ) if ( !pEvent && !pEvent->ISA(VclWindowEvent)) return 0; - ULONG nEventId = pEvent->GetId(); + sal_uLong nEventId = pEvent->GetId(); VclWindowEvent* pWinEvt = static_cast< VclWindowEvent* >(pEvent); css::uno::Reference< css::uno::XInterface > xThis ( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY ); @@ -400,19 +400,19 @@ IMPL_LINK( TabWindowService, EventListener, VclSimpleEvent*, pEvent ) switch (nEventId) { case VCLEVENT_TABPAGE_ACTIVATE : - pListener->activated( (sal_Int32)(ULONG)pWinEvt->GetData() ); + pListener->activated( (sal_Int32)(sal_uLong)pWinEvt->GetData() ); break; case VCLEVENT_TABPAGE_DEACTIVATE : - pListener->deactivated( (sal_Int32)(ULONG)pWinEvt->GetData() ); + pListener->deactivated( (sal_Int32)(sal_uLong)pWinEvt->GetData() ); break; case VCLEVENT_TABPAGE_INSERTED : - pListener->inserted( (sal_Int32)(ULONG)pWinEvt->GetData() ); + pListener->inserted( (sal_Int32)(sal_uLong)pWinEvt->GetData() ); break; case VCLEVENT_TABPAGE_REMOVED : - pListener->removed( (sal_Int32)(ULONG)pWinEvt->GetData() ); + pListener->removed( (sal_Int32)(sal_uLong)pWinEvt->GetData() ); break; case VCLEVENT_TABPAGE_PAGETEXTCHANGED : diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx index 219816093a67..219816093a67 100644..100755 --- a/framework/source/services/taskcreatorsrv.cxx +++ b/framework/source/services/taskcreatorsrv.cxx diff --git a/framework/source/services/uriabbreviation.cxx b/framework/source/services/uriabbreviation.cxx index 31bf228b0c8e..31bf228b0c8e 100644..100755 --- a/framework/source/services/uriabbreviation.cxx +++ b/framework/source/services/uriabbreviation.cxx diff --git a/framework/source/services/urltransformer.cxx b/framework/source/services/urltransformer.cxx index 01e52f0f30cd..01e52f0f30cd 100644..100755 --- a/framework/source/services/urltransformer.cxx +++ b/framework/source/services/urltransformer.cxx |