From ab1ce9610fa399348a164fe1f8ed52919a0fe597 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 4 Sep 2009 12:24:40 +0200 Subject: merged in DEV300_m57 --- shell/inc/internal/basereader.hxx | 2 + shell/inc/internal/contentreader.hxx | 3 + shell/inc/internal/metainforeader.hxx | 3 + shell/inc/internal/propsheets.hxx | 1 - shell/inc/internal/types.hxx | 3 + shell/inc/internal/zipfile.hxx | 11 +- shell/prj/build.lst | 1 + shell/source/all/makefile.mk | 2 + shell/source/all/ooofilereader/basereader.cxx | 9 + shell/source/all/ooofilereader/contentreader.cxx | 23 ++ shell/source/all/ooofilereader/makefile.mk | 3 +- shell/source/all/ooofilereader/metainforeader.cxx | 42 ++++ shell/source/all/zipfile/makefile.mk | 7 +- shell/source/all/zipfile/zipfile.cxx | 22 ++ shell/source/backends/kde4be/exports.map | 10 + shell/source/backends/kde4be/kde4backend.cxx | 158 +++++++++++++ shell/source/backends/kde4be/kde4backend.hxx | 123 ++++++++++ shell/source/backends/kde4be/kde4be.xml | 35 +++ shell/source/backends/kde4be/kde4be1-ucd.txt | 6 + shell/source/backends/kde4be/kde4becdef.cxx | 143 ++++++++++++ shell/source/backends/kde4be/kde4commonlayer.cxx | 157 +++++++++++++ shell/source/backends/kde4be/kde4commonlayer.hxx | 51 +++++ shell/source/backends/kde4be/kde4inetlayer.cxx | 255 +++++++++++++++++++++ shell/source/backends/kde4be/kde4inetlayer.hxx | 59 +++++ shell/source/backends/kde4be/kde4pathslayer.cxx | 124 ++++++++++ shell/source/backends/kde4be/kde4pathslayer.hxx | 82 +++++++ shell/source/backends/kde4be/kde4vcllayer.cxx | 115 ++++++++++ shell/source/backends/kde4be/kde4vcllayer.hxx | 53 +++++ shell/source/backends/kde4be/makefile.mk | 94 ++++++++ shell/source/unix/misc/makefile.mk | 2 +- .../source/win32/shlxthandler/ooofilt/makefile.mk | 16 +- .../source/win32/shlxthandler/ooofilt/ooofilt.cxx | 212 ++++++++++++++++- .../source/win32/shlxthandler/ooofilt/ooofilt.hxx | 33 ++- .../shlxthandler/ooofilt/proxy/ooofiltproxy.cxx | 1 - .../win32/shlxthandler/propsheets/propsheets.cxx | 28 +-- shell/source/win32/shlxthandler/util/makefile.mk | 1 + shell/source/win32/shlxthandler/util/utilities.cxx | 1 - shell/source/win32/simplemail/smplmailclient.cxx | 12 +- 38 files changed, 1866 insertions(+), 37 deletions(-) create mode 100644 shell/source/backends/kde4be/exports.map create mode 100644 shell/source/backends/kde4be/kde4backend.cxx create mode 100644 shell/source/backends/kde4be/kde4backend.hxx create mode 100644 shell/source/backends/kde4be/kde4be.xml create mode 100644 shell/source/backends/kde4be/kde4be1-ucd.txt create mode 100644 shell/source/backends/kde4be/kde4becdef.cxx create mode 100644 shell/source/backends/kde4be/kde4commonlayer.cxx create mode 100644 shell/source/backends/kde4be/kde4commonlayer.hxx create mode 100644 shell/source/backends/kde4be/kde4inetlayer.cxx create mode 100644 shell/source/backends/kde4be/kde4inetlayer.hxx create mode 100644 shell/source/backends/kde4be/kde4pathslayer.cxx create mode 100644 shell/source/backends/kde4be/kde4pathslayer.hxx create mode 100644 shell/source/backends/kde4be/kde4vcllayer.cxx create mode 100644 shell/source/backends/kde4be/kde4vcllayer.hxx create mode 100644 shell/source/backends/kde4be/makefile.mk (limited to 'shell') diff --git a/shell/inc/internal/basereader.hxx b/shell/inc/internal/basereader.hxx index 47f7a9b82c40..4da8b7fa95be 100644 --- a/shell/inc/internal/basereader.hxx +++ b/shell/inc/internal/basereader.hxx @@ -50,6 +50,8 @@ public: protected: // protected because its only an implementation relevant class CBaseReader( const std::string& DocumentName ); + CBaseReader( void* stream, zlib_filefunc_def* fa ); + virtual void start_document(); virtual void end_document(); diff --git a/shell/inc/internal/contentreader.hxx b/shell/inc/internal/contentreader.hxx index 41491df9fa8b..d8b2d77d28c0 100644 --- a/shell/inc/internal/contentreader.hxx +++ b/shell/inc/internal/contentreader.hxx @@ -43,6 +43,9 @@ public: //CContentReader( const std::string& DocumentName ); CContentReader( const std::string& DocumentName, LocaleSet_t const & DocumentLocale ); + CContentReader( void* stream, LocaleSet_t const & DocumentLocale, zlib_filefunc_def* fa ); + + /** Get the chunkbuffer. @return diff --git a/shell/inc/internal/metainforeader.hxx b/shell/inc/internal/metainforeader.hxx index 62248beb845f..1e004b5a3727 100644 --- a/shell/inc/internal/metainforeader.hxx +++ b/shell/inc/internal/metainforeader.hxx @@ -45,6 +45,9 @@ public: virtual ~CMetaInfoReader(); CMetaInfoReader( const std::string& DocumentName ); + + CMetaInfoReader( void* stream, zlib_filefunc_def* fa); + /** check if the Tag is in the target meta.xml file. @param TagName diff --git a/shell/inc/internal/propsheets.hxx b/shell/inc/internal/propsheets.hxx index 3b14dc574fe3..0ebafcf0aa3a 100644 --- a/shell/inc/internal/propsheets.hxx +++ b/shell/inc/internal/propsheets.hxx @@ -92,7 +92,6 @@ private: private: long m_RefCnt; char m_szFileName[MAX_PATH]; - std::auto_ptr m_pMetaInfo; }; #endif diff --git a/shell/inc/internal/types.hxx b/shell/inc/internal/types.hxx index 316a5e716d5b..730263060041 100644 --- a/shell/inc/internal/types.hxx +++ b/shell/inc/internal/types.hxx @@ -36,6 +36,9 @@ #include #include #include +#include +#include + typedef std::vector StringList_t; diff --git a/shell/inc/internal/zipfile.hxx b/shell/inc/internal/zipfile.hxx index 81da437544fe..2a860bb4c6cd 100644 --- a/shell/inc/internal/zipfile.hxx +++ b/shell/inc/internal/zipfile.hxx @@ -35,7 +35,9 @@ #define _WINDOWS #endif -#include + +#include + #include #include @@ -69,6 +71,9 @@ public: */ static bool IsZipFile(const std::string& FileName); + static bool IsZipFile(void* stream); + + /** Returns wheter the version of the specified zip file may be uncompressed with the currently used zlib version or not @@ -86,6 +91,7 @@ public: */ static bool IsValidZipFileVersionNumber(const std::string& FileName); + static bool IsValidZipFileVersionNumber(void* stream); public: @@ -103,6 +109,9 @@ public: */ ZipFile(const std::string& FileName); + ZipFile(void* stream, zlib_filefunc_def* fa); + + /** Destroys a zip file */ ~ZipFile(); diff --git a/shell/prj/build.lst b/shell/prj/build.lst index 01077cbcb87d..7a2e91f973ba 100644 --- a/shell/prj/build.lst +++ b/shell/prj/build.lst @@ -31,6 +31,7 @@ sl shell\source\backends\wininetbe nmake - w sl_backends_w sl shell\source\backends\macbe nmake - u sl_backends_macbe sl_inc NULL sl shell\source\backends\gconfbe nmake - u sl_backends_gconfbe sl_inc NULL sl shell\source\backends\kdebe nmake - u sl_backends_kdebe sl_inc NULL +sl shell\source\backends\kde4be nmake - u sl_backends_kde4be sl_inc NULL sl shell\source\backends\desktopbe nmake - u sl_backends_desktopbe sl_inc NULL sl shell\source\win32\shlxthandler\ooofilt nmake - w sl_win32_shlxthandler_ooofilt sl_all_zipfile.w sl_all_ooofilereader.w sl_win32_shlxthandler_util.w sl_all sl_inc NULL sl shell\source\win32\shlxthandler\ooofilt\proxy nmake - w sl_win32_ooofiltproxy sl_inc NULL diff --git a/shell/source/all/makefile.mk b/shell/source/all/makefile.mk index 3695abae798c..623aad6d69c1 100755 --- a/shell/source/all/makefile.mk +++ b/shell/source/all/makefile.mk @@ -35,6 +35,7 @@ PRJNAME=shell TARGET=xmlparser ENABLE_EXCEPTIONS=TRUE + # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk @@ -61,6 +62,7 @@ CFLAGS+=-DSYSTEM_EXPAT .ENDIF SLOFILES=$(SLO)$/xml_parser.obj + .IF "$(BUILD_X64)"!="" SLOFILES_X64=$(SLO_X64)$/xml_parser.obj .ENDIF # "$(BUILD_X64)"!="" diff --git a/shell/source/all/ooofilereader/basereader.cxx b/shell/source/all/ooofilereader/basereader.cxx index 8412de36e458..d9be6740f057 100644 --- a/shell/source/all/ooofilereader/basereader.cxx +++ b/shell/source/all/ooofilereader/basereader.cxx @@ -50,6 +50,15 @@ m_ZipFile( DocumentName ) // //------------------------------ +CBaseReader::CBaseReader(void * sw, zlib_filefunc_def* fa): +m_ZipFile( sw , fa ) +{ +} + +//------------------------------ +// +//------------------------------ + CBaseReader::~CBaseReader() { } diff --git a/shell/source/all/ooofilereader/contentreader.cxx b/shell/source/all/ooofilereader/contentreader.cxx index f1990c741721..111647e70ad6 100644 --- a/shell/source/all/ooofilereader/contentreader.cxx +++ b/shell/source/all/ooofilereader/contentreader.cxx @@ -61,6 +61,29 @@ CBaseReader( DocumentName ) } } +CContentReader::CContentReader( void* stream, LocaleSet_t const & DocumentLocale, zlib_filefunc_def* fa ) : +CBaseReader( stream, fa ) +{ +try + { + m_DefaultLocale = DocumentLocale; + Initialize( DOC_CONTENT_NAME ); + } + catch(xml_parser_exception& + #if OSL_DEBUG_LEVEL > 0 + ex + #endif + ) + { + ENSURE(false, ex.what()); + } + catch(...) + { + ENSURE(false, "Unknown error"); + } +} + + /** destructor. */ diff --git a/shell/source/all/ooofilereader/makefile.mk b/shell/source/all/ooofilereader/makefile.mk index 1e9788cf3f17..b893db45d849 100644 --- a/shell/source/all/ooofilereader/makefile.mk +++ b/shell/source/all/ooofilereader/makefile.mk @@ -35,6 +35,7 @@ TARGET=ooofilereader LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE + # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk @@ -65,7 +66,7 @@ LIB1TARGET=$(SLB)$/$(TARGET).lib LIB1OBJFILES=$(SLOFILES) LIB1FILES=$(SLB)$/zipfile.lib\ $(SLB)$/xmlparser.lib - + .IF "$(BUILD_X64)"!="" SLOFILES_X64=$(SLO_X64)$/basereader.obj\ $(SLO_X64)$/metainforeader.obj\ diff --git a/shell/source/all/ooofilereader/metainforeader.cxx b/shell/source/all/ooofilereader/metainforeader.cxx index f09d8b3e41d0..cec17b59d3c9 100644 --- a/shell/source/all/ooofilereader/metainforeader.cxx +++ b/shell/source/all/ooofilereader/metainforeader.cxx @@ -80,6 +80,48 @@ CBaseReader( DocumentName ) } } +CMetaInfoReader::CMetaInfoReader( void* stream, zlib_filefunc_def* fa) : +CBaseReader( stream, fa) +{ +try + { + m_pKeywords_Builder = new CKeywordsTag( ); + m_pSimple_Builder = new CSimpleTag( ); + m_pDummy_Builder = new CDummyTag( ); + + //retrieve all infomation that is useful + m_AllMetaInfo[META_INFO_AUTHOR] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_TITLE] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_SUBJECT] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_KEYWORDS] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_DESCRIPTION] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_DOCUMENT_STATISTIC] = EMPTY_XML_TAG; + + m_AllMetaInfo[META_INFO_GENERATOR] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_CREATION] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_CREATOR] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_MODIFIED] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_LANGUAGE] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_DOCUMENT_NUMBER] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_EDITING_TIME] = EMPTY_XML_TAG; + + Initialize( META_CONTENT_NAME ); + } + catch(xml_parser_exception& + #if OSL_DEBUG_LEVEL > 0 + ex + #endif + ) + { + ENSURE(false, ex.what()); + } + catch(...) + { + ENSURE(false, "Unknown error"); + } + +} + /** destructor. */ diff --git a/shell/source/all/zipfile/makefile.mk b/shell/source/all/zipfile/makefile.mk index a7f9c95b95cf..9f294ce7aad0 100644 --- a/shell/source/all/zipfile/makefile.mk +++ b/shell/source/all/zipfile/makefile.mk @@ -33,6 +33,9 @@ PRJ=..$/..$/.. PRJNAME=shell TARGET=zipfile ENABLE_EXCEPTIONS=TRUE +EXTERNAL_WARNINGS_NOT_ERRORS := TRUE + + # --- Settings ----------------------------------------------------- @@ -45,8 +48,8 @@ SLOFILES=$(SLO)$/zipfile.obj\ $(SLO)$/zipexcptn.obj SLOFILES_X64=$(SLO_X64)$/zipfile.obj\ - $(SLO_X64)$/zipexcptn.obj - + $(SLO_X64)$/zipexcptn.obj + # --- Targets ------------------------------------------------------ .INCLUDE : set_wntx64.mk diff --git a/shell/source/all/zipfile/zipfile.cxx b/shell/source/all/zipfile/zipfile.cxx index b174c7a023e3..06fb6cc934d3 100644 --- a/shell/source/all/zipfile/zipfile.cxx +++ b/shell/source/all/zipfile/zipfile.cxx @@ -79,6 +79,12 @@ bool ZipFile::IsZipFile(const std::string& /*FileName*/) return true; } +bool ZipFile::IsZipFile(void* /*stream*/) +{ + return true; +} + + /** Returns wheter the version of the specified zip file may be uncompressed with the currently used zlib version or not @@ -99,6 +105,12 @@ bool ZipFile::IsValidZipFileVersionNumber(const std::string& /*FileName*/) return true; } +bool ZipFile::IsValidZipFileVersionNumber(void* /* stream*/) +{ + return true; +} + + /** Constructs a zip file from a zip file @precond The given parameter must be a string with length > 0 @@ -119,6 +131,16 @@ ZipFile::ZipFile(const std::string& FileName) throw IOException(-1); } +ZipFile::ZipFile(void* stream, zlib_filefunc_def* fa) +{ + fa->opaque = stream; + m_uzFile = unzOpen2((const char *)NULL, fa); + + if (0 == m_uzFile) + throw IOException(-1); +} + + /** Destroys a zip file */ ZipFile::~ZipFile() diff --git a/shell/source/backends/kde4be/exports.map b/shell/source/backends/kde4be/exports.map new file mode 100644 index 000000000000..ba501f9ae076 --- /dev/null +++ b/shell/source/backends/kde4be/exports.map @@ -0,0 +1,10 @@ +UDK_3_0_0 { + global: + GetVersionInfo; + component_getImplementationEnvironment; + component_getFactory; + component_writeInfo; + + local: + *; +}; diff --git a/shell/source/backends/kde4be/kde4backend.cxx b/shell/source/backends/kde4be/kde4backend.cxx new file mode 100644 index 000000000000..7eb093bf7217 --- /dev/null +++ b/shell/source/backends/kde4be/kde4backend.cxx @@ -0,0 +1,158 @@ +/************************************************************************* + * + * 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: kde4backend.cxx,v $ + * $Revision: 1.7 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_shell.hxx" + +#include "kde4backend.hxx" +#include "kde4commonlayer.hxx" +#include "kde4inetlayer.hxx" +#include "kde4vcllayer.hxx" +#include "kde4pathslayer.hxx" + +//------------------------------------------------------------------------------ + +KDEBackend* KDEBackend::mInstance= 0; + +KDEBackend* KDEBackend::createInstance(const uno::Reference& xContext) +{ + if (mInstance == 0) + { + mInstance = new KDEBackend (xContext); + } + + return mInstance; +} + +//------------------------------------------------------------------------------ + +KDEBackend::KDEBackend(const uno::Reference& xContext) + throw (backend::BackendAccessException) + : BackendBase(mMutex), m_xContext(xContext) +{ +} + +//------------------------------------------------------------------------------ + +KDEBackend::~KDEBackend(void) +{ +} + +//------------------------------------------------------------------------------ + +uno::Reference SAL_CALL KDEBackend::getLayer( + const rtl::OUString& aComponent, const rtl::OUString& /* aTimestamp */) + throw (backend::BackendAccessException, lang::IllegalArgumentException) +{ + uno::Reference xLayer; + + if( aComponent.equalsAscii("org.openoffice.Office.Common" ) ) + { + xLayer = new KDECommonLayer(m_xContext); + } + else if( aComponent.equalsAscii("org.openoffice.Inet" ) ) + { + xLayer = new KDEInetLayer(m_xContext); + } + else if( aComponent.equalsAscii("org.openoffice.VCL" ) ) + { + xLayer = new KDEVCLLayer(m_xContext); + } + else if( aComponent.equalsAscii("org.openoffice.Office.Paths" ) ) + { + xLayer = new KDEPathsLayer(m_xContext); + } + + return xLayer; +} + +//------------------------------------------------------------------------------ + +uno::Reference SAL_CALL +KDEBackend::getUpdatableLayer(const rtl::OUString& /* aComponent */) + throw (backend::BackendAccessException,lang::NoSupportException, + lang::IllegalArgumentException) +{ + throw lang::NoSupportException( rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("KDEBackend: No Update Operation allowed, Read Only access") ), + *this) ; +} + +//------------------------------------------------------------------------------ + +rtl::OUString SAL_CALL KDEBackend::getBackendName(void) +{ + return rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.KDE4Backend") ); +} + +//------------------------------------------------------------------------------ + +rtl::OUString SAL_CALL KDEBackend::getImplementationName(void) + throw (uno::RuntimeException) +{ + return getBackendName() ; +} + +//------------------------------------------------------------------------------ + +uno::Sequence SAL_CALL KDEBackend::getBackendServiceNames(void) +{ + uno::Sequence aServices(1) ; + aServices[0] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.KDE4Backend")) ; + + return aServices ; +} + +//------------------------------------------------------------------------------ + +sal_Bool SAL_CALL KDEBackend::supportsService(const rtl::OUString& aServiceName) + throw (uno::RuntimeException) +{ + uno::Sequence< rtl::OUString > const svc = getBackendServiceNames(); + + for(sal_Int32 i = 0; i < svc.getLength(); ++i ) + if(svc[i] == aServiceName) + return true; + + return false; +} + +//------------------------------------------------------------------------------ + +uno::Sequence +SAL_CALL KDEBackend::getSupportedServiceNames(void) + throw (uno::RuntimeException) +{ + return getBackendServiceNames() ; +} + +// --------------------------------------------------------------------------------------- diff --git a/shell/source/backends/kde4be/kde4backend.hxx b/shell/source/backends/kde4be/kde4backend.hxx new file mode 100644 index 000000000000..01599c41a74d --- /dev/null +++ b/shell/source/backends/kde4be/kde4backend.hxx @@ -0,0 +1,123 @@ +/************************************************************************* + * + * 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: kde4backend.hxx,v $ + * $Revision: 1.4 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#ifndef INCLUDED_MAP +#include +#define INCLUDED_MAP +#endif + +namespace css = com::sun::star ; +namespace uno = css::uno ; +namespace lang = css::lang ; +namespace backend = css::configuration::backend ; + + +//------------------------------------------------------------------------------ +typedef cppu::WeakComponentImplHelper2 BackendBase ; + +/** + Implements the SingleLayerStratum service for KDE access. + */ +class KDEBackend : public BackendBase { + public : + + static KDEBackend* createInstance(const uno::Reference& xContext); + + // XServiceInfo + virtual rtl::OUString SAL_CALL getImplementationName( ) + throw (uno::RuntimeException) ; + + virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& aServiceName ) + throw (uno::RuntimeException) ; + + virtual uno::Sequence SAL_CALL getSupportedServiceNames( ) + throw (uno::RuntimeException) ; + + /** + Provides the implementation name. + + @return implementation name + */ + static rtl::OUString SAL_CALL getBackendName(void) ; + + /** + Provides the supported services names + + @return service names + */ + static uno::Sequence SAL_CALL getBackendServiceNames(void) ; + + //XSingleLayerStratum + virtual uno::Reference SAL_CALL + getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp ) + throw (backend::BackendAccessException, lang::IllegalArgumentException) ; + + virtual uno::Reference SAL_CALL + getUpdatableLayer( const rtl::OUString& aLayerId ) + throw (backend::BackendAccessException, lang::NoSupportException, + lang::IllegalArgumentException) ; + + protected: + /** + Service constructor from a service factory. + + @param xContext component context + */ + KDEBackend(const uno::Reference& xContext) + throw (backend::BackendAccessException); + + /** Destructor */ + ~KDEBackend(void) ; + + private: + + /** Build KDE/OO mapping table */ + void initializeMappingTable (); + + + /** The component context */ + uno::Reference m_xContext; + + /** Mutex for reOOurces protection */ + osl::Mutex mMutex ; + + static KDEBackend* mInstance; +}; diff --git a/shell/source/backends/kde4be/kde4be.xml b/shell/source/backends/kde4be/kde4be.xml new file mode 100644 index 000000000000..ea2d9be6dd6b --- /dev/null +++ b/shell/source/backends/kde4be/kde4be.xml @@ -0,0 +1,35 @@ + + + + kde4be + + Éric Bischoff + com.sun.star.comp.configuration.backend.KDE4Backend + The KDE4 configuration backend + com.sun.star.loader.SharedLibrary + c++ + + com.sun.star.comp.configuration.backend.KDE4Backend + ... + com.sun.star.configuration.backend.XBackendChangesListener + com.sun.star.configuration.backend.XBackendChangesNotifier + com.sun.star.configuration.backend.XLayerHandler + com.sun.star.configuration.backend.XSingleLayerStratum + com.sun.star.lang.XMultiComponentFactory + com.sun.star.lang.XServiceInfo + com.sun.star.lang.XSingleComponentFactory + com.sun.star.lang.XTypeProvider + com.sun.star.uno.TypeClass + com.sun.star.uno.XAggregation + com.sun.star.uno.XComponentContext + com.sun.star.uno.XCurrentContext + com.sun.star.uno.XWeak + com.sun.star.registry.XRegistryKey + + cppuhelper + cppu + sal + cppuhelper3$(COM) + cppu3 + sal3 + diff --git a/shell/source/backends/kde4be/kde4be1-ucd.txt b/shell/source/backends/kde4be/kde4be1-ucd.txt new file mode 100644 index 000000000000..9671199b26e3 --- /dev/null +++ b/shell/source/backends/kde4be/kde4be1-ucd.txt @@ -0,0 +1,6 @@ +[ComponentDescriptor] +ImplementationName=com.sun.star.comp.configuration.backend.KDE4Backend +ComponentName=kde4be1.uno.so +LoaderName=com.sun.star.loader.SharedLibrary +[SupportedServices] +com.sun.star.configuration.backend.KDE4Backend diff --git a/shell/source/backends/kde4be/kde4becdef.cxx b/shell/source/backends/kde4be/kde4becdef.cxx new file mode 100644 index 000000000000..da0d22ead22e --- /dev/null +++ b/shell/source/backends/kde4be/kde4becdef.cxx @@ -0,0 +1,143 @@ +/************************************************************************* + * + * 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: kde4becdef.cxx,v $ + * $Revision: 1.8 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_shell.hxx" +#include "kde4backend.hxx" + +#include + +#include + +#include +#include + +#include "uno/current_context.hxx" + +namespace css = com::sun::star ; +namespace uno = css::uno ; +namespace lang = css::lang ; +namespace backend = css::configuration::backend ; + +//============================================================================== + +static uno::Reference SAL_CALL createKDEBackend(const uno::Reference& xContext) +{ + try { + uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext()); + + if (xCurrentContext.is()) + { + uno::Any aValue = xCurrentContext->getValueByName( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "system.desktop-environment" ) ) ); + + rtl::OUString aDesktopEnvironment; + if ( (aValue >>= aDesktopEnvironment) && (aDesktopEnvironment.equalsAscii("KDE")) && (KApplication::kApplication() != NULL) ) + return * KDEBackend::createInstance(xContext); + } + + return uno::Reference(); + + } catch (uno::RuntimeException e) { + return uno::Reference(); + } + +} + +//============================================================================== + +static const cppu::ImplementationEntry kImplementations_entries[] = +{ + { + createKDEBackend, + KDEBackend::getBackendName, + KDEBackend::getBackendServiceNames, + cppu::createSingleComponentFactory, + NULL, + 0 + }, + { NULL, NULL, NULL, NULL, NULL, 0 } +} ; +//------------------------------------------------------------------------------ + +extern "C" void SAL_CALL component_getImplementationEnvironment( + const sal_Char **aEnvTypeName, + uno_Environment **) { + *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; +} + +//------------------------------------------------------------------------------ + +extern "C" sal_Bool SAL_CALL component_writeInfo(void *, + void *pRegistryKey) { + + using namespace ::com::sun::star::registry; + if (pRegistryKey) + { + try + { + uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + KDEBackend::getBackendName() + ); + + // Register associated service names + uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") ) + ); + + uno::Sequence sServiceNames = KDEBackend::getBackendServiceNames(); + for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i) + xServicesKey->createKey(sServiceNames[i]); + + return sal_True; + } + + catch( InvalidRegistryException& ) + { + OSL_ENSURE(sal_False, "InvalidRegistryException caught"); + } + } + + return sal_False; +} + +//------------------------------------------------------------------------------ + +extern "C" void *component_getFactory(const sal_Char *aImplementationName, + void *aServiceManager, + void *aRegistryKey) { + + return cppu::component_getFactoryHelper( + aImplementationName, + aServiceManager, + aRegistryKey, + kImplementations_entries) ; +} +//------------------------------------------------------------------------------ diff --git a/shell/source/backends/kde4be/kde4commonlayer.cxx b/shell/source/backends/kde4be/kde4commonlayer.cxx new file mode 100644 index 000000000000..1ce844672225 --- /dev/null +++ b/shell/source/backends/kde4be/kde4commonlayer.cxx @@ -0,0 +1,157 @@ +/************************************************************************* + * + * 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: kde4commonlayer.cxx,v $ + * $Revision: 1.7 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_shell.hxx" + +#include "kde4commonlayer.hxx" + +#include +#include + +#include + +#include +#include +#include + +#define SPACE ' ' + +//============================================================================== + +KDECommonLayer::KDECommonLayer(const uno::Reference& xContext) +{ + //Create instance of LayerContentDescriber Service + rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.comp.configuration.backend.LayerDescriber")); + + typedef uno::Reference LayerDescriber; + uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); + if( xServiceManager.is() ) + { + m_xLayerContentDescriber = LayerDescriber::query( + xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext)); + } + else + { + OSL_TRACE("Could not retrieve ServiceManager"); + } +} + +//------------------------------------------------------------------------------ + +void SAL_CALL KDECommonLayer::readData( const uno::Reference& xHandler) + throw ( backend::MalformedDataException, lang::NullPointerException, + lang::WrappedTargetException, uno::RuntimeException) +{ + if( ! m_xLayerContentDescriber.is() ) + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service" + ) ), static_cast < backend::XLayer * > (this) ); + } + + uno::Sequence aPropInfoList(3); + sal_Int32 nProperties = 0; + + // Email client settings + KEMailSettings aEmailSettings; + QString aClientProgram; + ::rtl::OUString sClientProgram; + + aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram ); + if ( aClientProgram.isEmpty() ) + aClientProgram = "kmail"; + else + aClientProgram = aClientProgram.section(SPACE, 0, 0); + sClientProgram = (const sal_Unicode *) aClientProgram.utf16(); + + aPropInfoList[nProperties].Name = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/ExternalMailer/Program") ); + aPropInfoList[nProperties].Type = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "string" ) ); + aPropInfoList[nProperties].Protected = sal_False; + aPropInfoList[nProperties++].Value = uno::makeAny( sClientProgram ); + + // Source code font settings + QFont aFixedFont; + QString aFontName; + :: rtl::OUString sFontName; + short nFontHeight; + + aFixedFont = KGlobalSettings::fixedFont(); + aFontName = aFixedFont.family(); + sFontName = (const sal_Unicode *) aFontName.utf16(); + nFontHeight = aFixedFont.pointSize(); + + aPropInfoList[nProperties].Name = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontName") ); + aPropInfoList[nProperties].Type = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "string" ) ); + aPropInfoList[nProperties].Protected = sal_False; + aPropInfoList[nProperties++].Value = uno::makeAny( sFontName ); + + aPropInfoList[nProperties].Name = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontHeight") ); + aPropInfoList[nProperties].Type = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "short" ) ); + aPropInfoList[nProperties].Protected = sal_False; + aPropInfoList[nProperties++].Value = uno::makeAny( nFontHeight ); + + if( nProperties > 0 ) + { + aPropInfoList.realloc(nProperties); + m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList); + } +} + +//------------------------------------------------------------------------------ + +rtl::OUString SAL_CALL KDECommonLayer::getTimestamp(void) + throw (uno::RuntimeException) +{ + // Return the value as timestamp to avoid regenerating the binary cache + // on each office launch. + + KEMailSettings aEmailSettings; + QString aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram ); + aClientProgram = aClientProgram.section(SPACE, 0, 0); + + QString aFixedFont = KGlobalSettings::fixedFont().toString(); + + ::rtl::OUString sTimeStamp, + sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) ); + + sTimeStamp = (const sal_Unicode *) aClientProgram.utf16(); + sTimeStamp += sep; + sTimeStamp += (const sal_Unicode *) aFixedFont.utf16(); + + return sTimeStamp; +} diff --git a/shell/source/backends/kde4be/kde4commonlayer.hxx b/shell/source/backends/kde4be/kde4commonlayer.hxx new file mode 100644 index 000000000000..9ce4cd4dc962 --- /dev/null +++ b/shell/source/backends/kde4be/kde4commonlayer.hxx @@ -0,0 +1,51 @@ +#pragma once + +#include "kde4backend.hxx" +#include +#include +#include +#include +#include +#include + +namespace css = com::sun::star ; +namespace uno = css::uno ; +namespace lang = css::lang ; +namespace backend = css::configuration::backend ; +namespace util = css::util ; + +/** + Implementation of the XLayer interface for the KDE values mapped into + the org.openoffice.Office.Common configuration component. + */ +class KDECommonLayer : public cppu::WeakImplHelper2 +{ +public : + /** + Constructor given the component context + + @param xContext The component context + */ + + KDECommonLayer(const uno::Reference& xContext); + + // XLayer + virtual void SAL_CALL readData( + const uno::Reference& xHandler) + throw ( backend::MalformedDataException, + lang::NullPointerException, + lang::WrappedTargetException, + uno::RuntimeException) ; + + // XTimeStamped + virtual rtl::OUString SAL_CALL getTimestamp(void) + throw (uno::RuntimeException); + + protected: + + /** Destructor */ + ~KDECommonLayer(void) {} + + private : + uno::Reference m_xLayerContentDescriber ; +}; diff --git a/shell/source/backends/kde4be/kde4inetlayer.cxx b/shell/source/backends/kde4be/kde4inetlayer.cxx new file mode 100644 index 000000000000..bc661a093fb7 --- /dev/null +++ b/shell/source/backends/kde4be/kde4inetlayer.cxx @@ -0,0 +1,255 @@ +/************************************************************************* + * + * 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: kde4inetlayer.cxx,v $ + * $Revision: 1.7 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_shell.hxx" + +#include + +#include "kde4inetlayer.hxx" +#include +#include +#include + +#define COMMA ',' +#define SEMI_COLON ';' + +//============================================================================== + +KDEInetLayer::KDEInetLayer(const uno::Reference& xContext) +{ + //Create instance of LayerContentDescriber Service + rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.comp.configuration.backend.LayerDescriber")); + + typedef uno::Reference LayerDescriber; + uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); + if( xServiceManager.is() ) + { + m_xLayerContentDescriber = LayerDescriber::query( + xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext)); + } + else + { + OSL_TRACE("Could not retrieve ServiceManager"); + } +} + +//------------------------------------------------------------------------------ + +void SAL_CALL KDEInetLayer::readData( const uno::Reference& xHandler) + throw ( backend::MalformedDataException, lang::NullPointerException, + lang::WrappedTargetException, uno::RuntimeException) +{ + if( ! m_xLayerContentDescriber.is() ) + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service" + ) ), static_cast < backend::XLayer * > (this) ); + } + + uno::Sequence aPropInfoList(8); + sal_Int32 nProperties = 0; + + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + setProxy(aPropInfoList, nProperties, 1, + KProtocolManager::noProxyFor(), + KProtocolManager::proxyFor( "HTTP" ), + KProtocolManager::proxyFor( "FTP" ), + KProtocolManager::proxyFor( "HTTPS" )); + break; + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables +// In such cases, the proxy address is not stored in KDE, but determined dynamically. +// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... +// The best we can do here is to ask the current value for a given address. + setProxy(aPropInfoList, nProperties, 1, + KProtocolManager::noProxyFor(), + KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") ), + KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") ), + KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") )); + break; + default: // No proxy is used + setProxy(aPropInfoList, nProperties, 0); + } + + if ( nProperties > 0 ) + { + aPropInfoList.realloc(nProperties); + m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList); + } +} + +//------------------------------------------------------------------------------ + +rtl::OUString SAL_CALL KDEInetLayer::getTimestamp(void) + throw (uno::RuntimeException) +{ + // Return the value as timestamp to avoid regenerating the binary cache + // on each office launch. + + QString aProxyType, aNoProxyFor, aHTTPProxy, aHTTPSProxy, aFTPProxy; + + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: + aProxyType = '1'; + aNoProxyFor = KProtocolManager::noProxyFor(); + aHTTPProxy = KProtocolManager::proxyFor( "HTTP" ); + aHTTPProxy = KProtocolManager::proxyFor( "HTTPS" ); + aFTPProxy = KProtocolManager::proxyFor( "FTP" ); + break; + case KProtocolManager::PACProxy: + case KProtocolManager::WPADProxy: + case KProtocolManager::EnvVarProxy: + aProxyType = '1'; + aNoProxyFor = KProtocolManager::noProxyFor(); + aHTTPProxy = KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") ); + aHTTPSProxy = KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") ); + aFTPProxy = KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") ); + break; + default: + aProxyType = '0'; + } + + ::rtl::OUString sTimeStamp, + sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) ); + + sTimeStamp = (const sal_Unicode *) aProxyType.utf16(); + sTimeStamp += sep; + sTimeStamp += (const sal_Unicode *) aNoProxyFor.utf16(); + sTimeStamp += sep; + sTimeStamp += (const sal_Unicode *) aHTTPProxy.utf16(); + sTimeStamp += sep; + sTimeStamp += (const sal_Unicode *) aHTTPSProxy.utf16(); + sTimeStamp += sep; + sTimeStamp += (const sal_Unicode *) aFTPProxy.utf16(); + + return sTimeStamp; +} + +//------------------------------------------------------------------------------ + +void SAL_CALL KDEInetLayer::setProxy + (uno::Sequence &aPropInfoList, sal_Int32 &nProperties, + int nProxyType, const QString &aNoProxy, const QString &aHTTPProxy, const QString &aFTPProxy, const QString &aHTTPSProxy ) const +{ + aPropInfoList[nProperties].Name = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") ); + aPropInfoList[nProperties].Type = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "int" ) ); + aPropInfoList[nProperties].Protected = sal_False; + aPropInfoList[nProperties++].Value = uno::makeAny( (sal_Int32) nProxyType ); + + if (nProxyType == 0) return; + + if ( !aNoProxy.isEmpty() ) + { + QString aNoProxyFor(aNoProxy); + ::rtl::OUString sNoProxyFor; + + aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON ); + sNoProxyFor = (const sal_Unicode *) aNoProxyFor.utf16(); + + aPropInfoList[nProperties].Name = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") ); + aPropInfoList[nProperties].Type = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "string" ) ); + aPropInfoList[nProperties].Protected = sal_False; + aPropInfoList[nProperties++].Value = uno::makeAny( sNoProxyFor ); + } + + if ( !aHTTPProxy.isEmpty() ) + { + KUrl aProxy(aHTTPProxy); + ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16(); + sal_Int32 nPort = aProxy.port(); + + aPropInfoList[nProperties].Name = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") ); + aPropInfoList[nProperties].Type = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "string" ) ); + aPropInfoList[nProperties].Protected = sal_False; + aPropInfoList[nProperties++].Value = uno::makeAny( sProxy ); + + aPropInfoList[nProperties].Name = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") ); + aPropInfoList[nProperties].Type = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "int" ) ); + aPropInfoList[nProperties].Protected = sal_False; + aPropInfoList[nProperties++].Value = uno::makeAny( nPort ); + } + + if ( !aHTTPSProxy.isEmpty() ) + { + KUrl aProxy(aHTTPSProxy); + ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16(); + sal_Int32 nPort = aProxy.port(); + + aPropInfoList[nProperties].Name = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") ); + aPropInfoList[nProperties].Type = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "string" ) ); + aPropInfoList[nProperties].Protected = sal_False; + aPropInfoList[nProperties++].Value = uno::makeAny( sProxy ); + + aPropInfoList[nProperties].Name = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") ); + aPropInfoList[nProperties].Type = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "int" ) ); + aPropInfoList[nProperties].Protected = sal_False; + aPropInfoList[nProperties++].Value = uno::makeAny( nPort ); + } + + if ( !aFTPProxy.isEmpty() ) + { + KUrl aProxy(aFTPProxy); + ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16(); + sal_Int32 nPort = aProxy.port(); + + aPropInfoList[nProperties].Name = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") ); + aPropInfoList[nProperties].Type = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "string" ) ); + aPropInfoList[nProperties].Protected = sal_False; + aPropInfoList[nProperties++].Value = uno::makeAny( sProxy ); + + aPropInfoList[nProperties].Name = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") ); + aPropInfoList[nProperties].Type = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "int" ) ); + aPropInfoList[nProperties].Protected = sal_False; + aPropInfoList[nProperties++].Value = uno::makeAny( nPort ); + } +} + diff --git a/shell/source/backends/kde4be/kde4inetlayer.hxx b/shell/source/backends/kde4be/kde4inetlayer.hxx new file mode 100644 index 000000000000..64d00fec45fc --- /dev/null +++ b/shell/source/backends/kde4be/kde4inetlayer.hxx @@ -0,0 +1,59 @@ +#pragma once + +#include + +#include "kde4backend.hxx" + +#include +#include +#include +#include +#include +#include + +namespace css = com::sun::star ; +namespace uno = css::uno ; +namespace lang = css::lang ; +namespace backend = css::configuration::backend ; +namespace util = css::util ; + +/** + Implementation of the XLayer interface for the KDE values mapped into + the org.openoffice.Inet configuration component. + */ +class KDEInetLayer : public cppu::WeakImplHelper2 +{ +public : + /** + Constructor given the component context + + @param xContext The component context + */ + + KDEInetLayer(const uno::Reference& xContext); + + // XLayer + virtual void SAL_CALL readData( + const uno::Reference& xHandler) + throw ( backend::MalformedDataException, + lang::NullPointerException, + lang::WrappedTargetException, + uno::RuntimeException) ; + + // XTimeStamped + virtual rtl::OUString SAL_CALL getTimestamp(void) + throw (uno::RuntimeException); + + protected: + + /** Destructor */ + ~KDEInetLayer(void) {} + +private : + uno::Reference m_xLayerContentDescriber ; + + void SAL_CALL setProxy + (uno::Sequence &aPropInfoList, sal_Int32 &nProperties, + int nProxyType, const QString &aNoProxyfor = QString(), + const QString &aHTTPProxy = QString(), const QString &aFTPProxy = QString(), const QString &aHTTPSProxy = QString()) const; +}; diff --git a/shell/source/backends/kde4be/kde4pathslayer.cxx b/shell/source/backends/kde4be/kde4pathslayer.cxx new file mode 100644 index 000000000000..2511d0b57405 --- /dev/null +++ b/shell/source/backends/kde4be/kde4pathslayer.cxx @@ -0,0 +1,124 @@ +/************************************************************************* + * + * 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: kde4pathslayer.cxx,v $ + * $Revision: 1.5 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_shell.hxx" + +#include "kde4pathslayer.hxx" + +#include +#include + +#include +#include + +#include +#include +#include + +#define SPACE ' ' + +//============================================================================== + +KDEPathsLayer::KDEPathsLayer(const uno::Reference& xContext) +{ + //Create instance of LayerContentDescriber Service + rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.comp.configuration.backend.LayerDescriber")); + + typedef uno::Reference LayerDescriber; + uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); + if( xServiceManager.is() ) + { + m_xLayerContentDescriber = LayerDescriber::query( + xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext)); + } + else + { + OSL_TRACE("Could not retrieve ServiceManager"); + } +} + +//------------------------------------------------------------------------------ + +void SAL_CALL KDEPathsLayer::readData( const uno::Reference& xHandler) + throw ( backend::MalformedDataException, lang::NullPointerException, + lang::WrappedTargetException, uno::RuntimeException) +{ + if( ! m_xLayerContentDescriber.is() ) + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service" + ) ), static_cast < backend::XLayer * > (this) ); + } + + uno::Sequence aPropInfoList(1); + sal_Int32 nProperties = 0; + + QString aDocumentsDir( KGlobalSettings::documentPath() ); + rtl::OUString sDocumentsDir; + rtl::OUString sDocumentsURL; + if ( aDocumentsDir.endsWith(QChar('/')) ) + aDocumentsDir.truncate ( aDocumentsDir.length() - 1 ); + sDocumentsDir = (const sal_Unicode *) aDocumentsDir.utf16(); + osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData ); + + aPropInfoList[nProperties].Name = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Paths/Variables/Work") ); + aPropInfoList[nProperties].Type = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "string" ) ); + aPropInfoList[nProperties].Protected = sal_False; + aPropInfoList[nProperties++].Value = uno::makeAny( sDocumentsURL ); + + if( nProperties > 0 ) + { + aPropInfoList.realloc(nProperties); + m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList); + } +} + +//------------------------------------------------------------------------------ + +rtl::OUString SAL_CALL KDEPathsLayer::getTimestamp(void) + throw (uno::RuntimeException) +{ + // Return the value as timestamp to avoid regenerating the binary cache + // on each office launch. + + ::rtl::OUString sTimeStamp, + sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) ); + + QString aDocumentsDir; + aDocumentsDir = KGlobalSettings::documentPath(); + + sTimeStamp += (const sal_Unicode *) aDocumentsDir.utf16(); + + return sTimeStamp; +} diff --git a/shell/source/backends/kde4be/kde4pathslayer.hxx b/shell/source/backends/kde4be/kde4pathslayer.hxx new file mode 100644 index 000000000000..40d31a73c4f9 --- /dev/null +++ b/shell/source/backends/kde4be/kde4pathslayer.hxx @@ -0,0 +1,82 @@ +/************************************************************************* + * + * 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: kde4pathslayer.hxx,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#pragma once + +#include "kde4backend.hxx" +#include +#include +#include +#include +#include + +#include + +namespace css = com::sun::star ; +namespace uno = css::uno ; +namespace lang = css::lang ; +namespace backend = css::configuration::backend ; +namespace util = css::util ; + +/** + Implementation of the XLayer interface for the KDE values mapped into + the org.openoffice.Office.Paths configuration component. + */ +class KDEPathsLayer : public cppu::WeakImplHelper2 +{ +public : + /** + Constructor given the component context + + @param xContext The component context + */ + + KDEPathsLayer(const uno::Reference& xContext); + + // XLayer + virtual void SAL_CALL readData( + const uno::Reference& xHandler) + throw ( backend::MalformedDataException, + lang::NullPointerException, + lang::WrappedTargetException, + uno::RuntimeException) ; + + // XTimeStamped + virtual rtl::OUString SAL_CALL getTimestamp(void) + throw (uno::RuntimeException); + + protected: + + /** Destructor */ + ~KDEPathsLayer(void) {} + + private : + uno::Reference m_xLayerContentDescriber ; +}; diff --git a/shell/source/backends/kde4be/kde4vcllayer.cxx b/shell/source/backends/kde4be/kde4vcllayer.cxx new file mode 100644 index 000000000000..780c3e4e7ce1 --- /dev/null +++ b/shell/source/backends/kde4be/kde4vcllayer.cxx @@ -0,0 +1,115 @@ +/************************************************************************* + * + * 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: kde4vcllayer.cxx,v $ + * $Revision: 1.5 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_shell.hxx" + +#include "kde4vcllayer.hxx" + +#include +#include +#include + +//============================================================================== + +KDEVCLLayer::KDEVCLLayer(const uno::Reference& xContext) +{ + //Create instance of LayerContentDescriber Service + rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.comp.configuration.backend.LayerDescriber")); + + typedef uno::Reference LayerDescriber; + uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); + if( xServiceManager.is() ) + { + m_xLayerContentDescriber = LayerDescriber::query( + xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext)); + } + else + { + OSL_TRACE("Could not retrieve ServiceManager"); + } +} + +//------------------------------------------------------------------------------ + +void SAL_CALL KDEVCLLayer::readData( const uno::Reference& xHandler) + throw ( backend::MalformedDataException, lang::NullPointerException, + lang::WrappedTargetException, uno::RuntimeException) +{ + if( ! m_xLayerContentDescriber.is() ) + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service" + ) ), static_cast < backend::XLayer * > (this) ); + } + + uno::Sequence aPropInfoList(1); + +/* + Commenting out, does not make much sense without an accessibility bridge +=========================================================================== +#if defined(QT_ACCESSIBILITY_SUPPORT) +// Accessibility tools under Qt for UNIX are available starting with Qt 4.0 + int nVersionMajor = 0; + const char *q = qVersion(); // "3.1.0" for example + while ('0' <= *q && *q <= '9') + nVersionMajor = nVersionMajor * 10 + *q++ - '0'; + sal_Bool ATToolSupport = (sal_Bool) (nVersionMajor >= 4); +#else + sal_Bool ATToolSupport = sal_False; +#endif +=========================================================================== + End of commented out section +*/ sal_Bool ATToolSupport = sal_False; + + aPropInfoList[0].Name = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.VCL/Settings/Accessibility/EnableATToolSupport") ); + aPropInfoList[0].Type = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "string" ) ); + aPropInfoList[0].Protected = sal_False; + aPropInfoList[0].Value = uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) ); + + m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList); +} + +//------------------------------------------------------------------------------ + +rtl::OUString SAL_CALL KDEVCLLayer::getTimestamp(void) + throw (uno::RuntimeException) +{ + // Return the value as timestamp to avoid regenerating the binary cache + // on each office launch. + + ::rtl::OUString sTimeStamp( + RTL_CONSTASCII_USTRINGPARAM( "FALSE" ) ); + + return sTimeStamp; +} diff --git a/shell/source/backends/kde4be/kde4vcllayer.hxx b/shell/source/backends/kde4be/kde4vcllayer.hxx new file mode 100644 index 000000000000..16036ee89122 --- /dev/null +++ b/shell/source/backends/kde4be/kde4vcllayer.hxx @@ -0,0 +1,53 @@ +#pragma once + +#include "kde4backend.hxx" + +#include +#include +#include +#include +#include + +#include + +namespace css = com::sun::star ; +namespace uno = css::uno ; +namespace lang = css::lang ; +namespace backend = css::configuration::backend ; +namespace util = css::util ; + +/** + Implementation of the XLayer interface for the KDE values mapped into + the org.openoffice.VCL configuration component. + */ +class KDEVCLLayer : public cppu::WeakImplHelper2 +{ +public : + /** + Constructor given the component context + + @param xContext The component context + */ + + KDEVCLLayer(const uno::Reference& xContext); + + // XLayer + virtual void SAL_CALL readData( + const uno::Reference& xHandler) + throw ( backend::MalformedDataException, + lang::NullPointerException, + lang::WrappedTargetException, + uno::RuntimeException) ; + + // XTimeStamped + virtual rtl::OUString SAL_CALL getTimestamp(void) + throw (uno::RuntimeException); + + protected: + + /** Destructor */ + ~KDEVCLLayer(void) {} + + private : + uno::Reference m_xLayerContentDescriber ; +}; diff --git a/shell/source/backends/kde4be/makefile.mk b/shell/source/backends/kde4be/makefile.mk new file mode 100644 index 000000000000..6f92762e5ae1 --- /dev/null +++ b/shell/source/backends/kde4be/makefile.mk @@ -0,0 +1,94 @@ +#************************************************************************* +# +# 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: makefile.mk,v $ +# +# $Revision: 1.5 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* +PRJ=..$/..$/.. + +PRJNAME=shell +TARGET=kde4be + +LIBTARGET=NO +ENABLE_EXCEPTIONS=TRUE + +COMP1TYPELIST=$(TARGET) +COMPRDB=$(SOLARBINDIR)$/types.rdb +UNOUCROUT=$(OUT)$/inc$/$(TARGET) +INCPRE=$(UNOUCROUT) + +# --- Settings --- + +.INCLUDE : settings.mk + +# For some of the included external KDE headers, GCC complains about shadowed +# symbols in instantiated template code only at the end of a compilation unit, +# so the only solution is to disable that warning here: +.IF "$(COM)" == "GCC" +CFLAGSCXX+=-Wno-shadow +.ENDIF + +UNIXTEXT=$(MISC)/$(TARGET)1-ucd.txt + +# no "lib" prefix +DLLPRE = + +.IF "$(ENABLE_KDE4)" == "TRUE" + +CFLAGS+=$(KDE4_CFLAGS) + +# --- Files --- + +SLOFILES=\ + $(SLO)$/kde4backend.obj \ + $(SLO)$/kde4commonlayer.obj \ + $(SLO)$/kde4inetlayer.obj \ + $(SLO)$/kde4vcllayer.obj \ + $(SLO)$/kde4pathslayer.obj \ + $(SLO)$/kde4becdef.obj + +SHL1NOCHECK=TRUE +SHL1TARGET=$(TARGET)1.uno +SHL1OBJS=$(SLOFILES) +SHL1DEF=$(MISC)$/$(SHL1TARGET).def + +SHL1IMPLIB=i$(SHL1TARGET) +SHL1STDLIBS= \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(SALLIB) \ + $(KDE4_LIBS) -lkio + +SHL1VERSIONMAP=exports.map +SHL1DEF=$(MISC)$/$(SHL1TARGET).def +DEF1NAME=$(SHL1TARGET) + +.ENDIF + +# --- Targets --- + +.INCLUDE : target.mk diff --git a/shell/source/unix/misc/makefile.mk b/shell/source/unix/misc/makefile.mk index ba2ed56b83ef..8a5ee366223a 100644 --- a/shell/source/unix/misc/makefile.mk +++ b/shell/source/unix/misc/makefile.mk @@ -72,7 +72,7 @@ APP1TARGET = gnome-open-url.bin APP1OBJS = \ $(OBJ)$/gnome-open-url.obj APP1LIBS = -.IF "$(OS)"!="FREEBSD" +.IF "$(OS)"!="FREEBSD" && "$(OS)"!="NETBSD" APP1STDLIBS=-ldl .ENDIF diff --git a/shell/source/win32/shlxthandler/ooofilt/makefile.mk b/shell/source/win32/shlxthandler/ooofilt/makefile.mk index 74ecf35ac5fc..22127bc8ddac 100644 --- a/shell/source/win32/shlxthandler/ooofilt/makefile.mk +++ b/shell/source/win32/shlxthandler/ooofilt/makefile.mk @@ -36,6 +36,13 @@ LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE USE_DEFFILE=TRUE +# Do not use the dynamic STLport library. +# NO_DEFAULT_STL=YES + +# Do not use the uwinapi library +UWINAPILIB= + + # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk @@ -43,11 +50,10 @@ USE_DEFFILE=TRUE CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 CFLAGS+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820 CDEFS+=-D_WIN32_IE=0x501 +# SCPCDEFS+=-D_STLP_USE_STATIC_LIB # --- Files -------------------------------------------------------- -#UWINAPILIB= - SLOFILES=$(SLO)$/ooofilt.obj\ $(SLO)$/propspec.obj @@ -71,10 +77,12 @@ SHL1STDLIBS+=$(OLE32LIB)\ $(SHELL32LIB)\ $(KERNEL32LIB)\ $(OLDNAMESLIB) - + +# $(LIBSTLPORTST) + SHL1LIBS+=$(SLB)$/util.lib\ $(SLB)$/ooofilereader.lib - + SHL1DEPN= SHL1OBJS=$(SLOFILES) SHL1DEF=$(MISC)$/$(SHL1TARGET).def diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx index e22fb89f94cf..ac8dd676c3b1 100644 --- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx +++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx @@ -46,7 +46,7 @@ //-------------------------------------------------------------------------- #include "internal/contentreader.hxx" #include "internal/metainforeader.hxx" -#include "internal/utilities.hxx" +//#include "internal/utilities.hxx" #include "internal/registry.hxx" #include "internal/fileextensions.hxx" @@ -78,6 +78,8 @@ #include #include "assert.h" #include "ooofilt.hxx" +#include +#include #include "propspec.hxx" #ifdef __MINGW32__ #include @@ -117,7 +119,9 @@ COooFilter::COooFilter() : m_fEof(FALSE), m_ChunkPosition(0), m_cAttributes(0), - m_pAttributes(0) + m_pAttributes(0), + m_pStream(NULL) + { InterlockedIncrement( &g_lInstances ); } @@ -172,6 +176,8 @@ SCODE STDMETHODCALLTYPE COooFilter::QueryInterface( pUnkTemp = (IUnknown *)(IPersistFile *)this; else if ( IID_IPersist == riid ) pUnkTemp = (IUnknown *)(IPersist *)(IPersistFile *)this; + else if (IID_IPersistStream == riid) + pUnkTemp = (IUnknown *)(IPersistStream *)this; else if ( IID_IUnknown == riid ) pUnkTemp = (IUnknown *)(IPersist *)(IPersistFile *)this; else @@ -713,6 +719,101 @@ SCODE STDMETHODCALLTYPE COooFilter::SaveCompleted(LPCWSTR /*pszFileName*/) // File is opened read-only, so "save" is always finished return S_OK; } + +//M------------------------------------------------------------------------- +// +// Method: COooFilter::Load (IPersistStream::Load) +// +// Summary: Initializes an object from the stream where it was previously saved +// +// Arguments: pStm +// [in] Pointer to stream from which object should be loaded +// +// +// Returns: S_OK +// E_OUTOFMEMORY +// E_FAIL +// +// +//-------------------------------------------------------------------------- +SCODE STDMETHODCALLTYPE COooFilter::Load(IStream *pStm) +{ + + // These next few lines work around the "Seek pointer" bug found on Vista. + + char buf[20]; + unsigned long count; + HRESULT hr; + ULARGE_INTEGER NewPosition; + LARGE_INTEGER Move; + Move.QuadPart = 0; + hr = pStm->Seek (Move, STREAM_SEEK_SET, &NewPosition); + hr = pStm->Read (buf, 20, &count); + + zlib_filefunc_def z_filefunc; + fill_stream_filefunc (&z_filefunc); + z_filefunc.opaque = (void*)pStm; + + m_pStream = pStm; + + try + { + if (m_pMetaInfoReader) + delete m_pMetaInfoReader; + m_pMetaInfoReader = new CMetaInfoReader((void*)m_pStream, &z_filefunc); + + if (m_pContentReader) + delete m_pContentReader; + m_pContentReader = new CContentReader((void*)m_pStream, m_pMetaInfoReader->getDefaultLocale(), &z_filefunc); + } + catch (const std::exception&) + { + return E_FAIL; + } + return S_OK; +} + +//M------------------------------------------------------------------------- +// +// Method: COooFilter::GetSizeMax (IPersistStream::GetSizeMax) +// +// Summary: Returns the size in bytes of the stream neede to save the object. +// +// Arguments: pcbSize +// [out] Pointer to a 64 bit unsigned int indicating the size needed +// +// Returns: E_NOTIMPL +// +// +//-------------------------------------------------------------------------- +SCODE STDMETHODCALLTYPE COooFilter::GetSizeMax(ULARGE_INTEGER * /*pcbSize*/) +{ + // + return E_NOTIMPL; +} + +//M------------------------------------------------------------------------- +// +// Method: COooFilter::Save (IPersistStream::Save) +// +// Summary: Save object to specified stream +// +// Arguments: pStm +// [in] Pointer to stream +// +// fClearDirty +// [in] Indicates whether to clear dirty flag +// +// Returns: E_NOTIMPL +// +// +//-------------------------------------------------------------------------- +SCODE STDMETHODCALLTYPE COooFilter::Save(IStream * /*pStm*/, BOOL ) +{ + // + return E_NOTIMPL; +} + //M------------------------------------------------------------------------- // // Method: COooFilter::GetCurFile (IPersistFile::GetCurFile) @@ -1142,9 +1243,19 @@ namespace /* private */ std::string ClsidEntry_Persist = CLSID_GUID_ENTRY; SubstitutePlaceholder(ClsidEntry_Persist, GUID_PLACEHOLDER, ClsidToString(PersistentGuid)); + if (!SetRegistryKey(HKEY_CLASSES_ROOT, ClsidEntry_Persist.c_str(), "", "OpenOffice.org Persistent Handler")) return E_FAIL; + // Add missing entry + std::string ClsidEntry_Persist_Entry = CLSID_PERSIST_ENTRY; + SubstitutePlaceholder(ClsidEntry_Persist_Entry, + GUID_PLACEHOLDER, + ClsidToString(PersistentGuid)); + + if (!SetRegistryKey(HKEY_CLASSES_ROOT, ClsidEntry_Persist_Entry.c_str(), "", ClsidToString(PersistentGuid).c_str())); + + std::string ClsidEntry_Persist_Addin = CLSID_GUID_PERSIST_ADDIN_ENTRY; SubstitutePlaceholder(ClsidEntry_Persist_Addin, GUID_PLACEHOLDER, @@ -1393,3 +1504,100 @@ STDAPI DllUnregisterServer() */ return S_OK; } + +extern "C" { + + // IStream callback + voidpf ZCALLBACK cb_sopen (voidpf opaque, const char* filename, int mode) { + return opaque; + } + + uLong ZCALLBACK cb_sread (voidpf opaque, voidpf stream, void* buf, uLong size) { + unsigned long newsize; + HRESULT hr; + + hr = ((IStream *)stream)->Read (buf, size, &newsize); + if (hr == S_OK){ + return (unsigned long)newsize; + } + else { + return (uLong)0; + } + } + + long ZCALLBACK cb_sseek (voidpf opaque, voidpf stream, uLong offset, int origin) { + // IStream::Seek parameters + HRESULT hr; + LARGE_INTEGER Move; + DWORD dwOrigin; + Move.QuadPart = (__int64)offset; + + switch (origin) { + case SEEK_CUR: + dwOrigin = STREAM_SEEK_CUR; + break; + case SEEK_END: + dwOrigin = STREAM_SEEK_END; + break; + case SEEK_SET: + dwOrigin = STREAM_SEEK_SET; + break; + default: + return -1; + } + + hr = ((IStream*)stream)->Seek (Move, dwOrigin, NULL); + if (hr == S_OK){ + return 0; + } + else { + return -1; + } + } + + long ZCALLBACK cb_stell (voidpf opaque, voidpf stream) { + // IStream::Seek parameters + HRESULT hr; + LARGE_INTEGER Move; + ULARGE_INTEGER NewPosition; + Move.QuadPart = 0; + NewPosition.QuadPart = 0; + + hr = ((IStream*)stream)->Seek (Move, STREAM_SEEK_CUR, &NewPosition); + if (hr == S_OK){ + return (long) NewPosition.QuadPart; + } + else { + return -1; + } + } + + int ZCALLBACK cb_sclose (voidpf opaque, voidpf stream) { + return 0; + } + + int ZCALLBACK cb_serror (voidpf opaque, voidpf stream) { + return 0; //RJK - for now + } + + uLong ZCALLBACK cb_swrite (voidpf opaque, voidpf stream, const void* buf, uLong size) { + HRESULT hr; + unsigned long writecount; + hr = ((IStream*)stream)->Write (buf, size, &writecount); + if (hr == S_OK) + return (unsigned int)writecount; + else + return (uLong)0; + } + + void fill_stream_filefunc (zlib_filefunc_def* pzlib_filefunc_def) { + pzlib_filefunc_def->zopen_file = cb_sopen; + pzlib_filefunc_def->zread_file = cb_sread; + pzlib_filefunc_def->zwrite_file = cb_swrite; + pzlib_filefunc_def->ztell_file = cb_stell; + pzlib_filefunc_def->zseek_file = cb_sseek; + pzlib_filefunc_def->zclose_file = cb_sclose; + pzlib_filefunc_def->zerror_file = cb_serror; + } +} + diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx index f83e8792507f..9f1566b406bd 100644 --- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx +++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx @@ -96,8 +96,7 @@ enum FilterState FilteringContent, // Filtering the content property FilteringProperty // Filtering the pseudo property }; - -class COooFilter : public IFilter, public IPersistFile +class COooFilter : public IFilter, public IPersistFile, public IPersistStream { public: // From IUnknown @@ -144,6 +143,18 @@ public: virtual SCODE STDMETHODCALLTYPE GetCurFile( LPWSTR * ppszFileName); + // From IPersistStream + virtual SCODE STDMETHODCALLTYPE Load( + IStream *pStm); + + virtual SCODE STDMETHODCALLTYPE Save( + IStream *pStm, + BOOL fClearDirty); + + virtual SCODE STDMETHODCALLTYPE GetSizeMax( + ULARGE_INTEGER *pcbSize); + + private: friend class COooFilterCF; @@ -166,6 +177,8 @@ private: ULONG m_ChunkPosition; // Chunk pointer to specify the current Chunk; ULONG m_cAttributes; // Count of attributes CFullPropSpec * m_pAttributes; // Attributes to filter + IStream * m_pStream; + }; //C------------------------------------------------------------------------- @@ -207,6 +220,22 @@ private: long m_lRefs; // Reference count }; +extern "C" { + + voidpf ZCALLBACK cb_sopen OF((voidpf opaque, const char * filename, int mode)); + uLong ZCALLBACK cb_sread OF((voidpf opaque, voidpf stream, void* vuf, uLong size)); + uLong ZCALLBACK cb_swrite OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); + long ZCALLBACK cb_stell OF((voidpf opaque, voidpf stream)); + long ZCALLBACK cb_sseek OF((voidpf opaque, voidpf stream, uLong offset, int origin)); + int ZCALLBACK cb_sclose OF((voidpf opaque, voidpf stream)); + int ZCALLBACK cb_serror OF((voidpf opaque, voidpf stream)); + + void fill_stream_filefunc (zlib_filefunc_def* pzlib_filefunc_def); + +} + + + diff --git a/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx b/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx index 623bc7be7772..879cf8c0115b 100644 --- a/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx +++ b/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx @@ -147,7 +147,6 @@ extern "C" HRESULT __stdcall DllCanUnloadNow() extern "C" HRESULT __stdcall DllRegisterServer() { Init(); - if (Forward_DllRegisterServer) return Forward_DllRegisterServer(); else diff --git a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx index b8af5acbde78..171bc287715f 100644 --- a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx +++ b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx @@ -177,14 +177,6 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::Initialize( HRESULT STDMETHODCALLTYPE CPropertySheet::AddPages(LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam) { - try - { - m_pMetaInfo = std::auto_ptr(new CMetaInfoReader(m_szFileName)); - } - catch (const std::exception&) - { - return E_FAIL; - } PROPSHEETPAGE psp; @@ -317,14 +309,17 @@ BOOL CALLBACK CPropertySheet::PropPageStatisticsProc(HWND hwnd, UINT uiMsg, WPAR //################################## void CPropertySheet::InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/) { - SetWindowText(GetDlgItem(hwnd,IDC_TITLE), m_pMetaInfo->getTagData( META_INFO_TITLE ).c_str() ); - SetWindowText(GetDlgItem(hwnd,IDC_AUTHOR), m_pMetaInfo->getTagData( META_INFO_AUTHOR ).c_str() ); - SetWindowText(GetDlgItem(hwnd,IDC_SUBJECT), m_pMetaInfo->getTagData( META_INFO_SUBJECT ).c_str() ); - SetWindowText(GetDlgItem(hwnd,IDC_KEYWORDS), m_pMetaInfo->getTagData( META_INFO_KEYWORDS ).c_str() ); + + CMetaInfoReader metaInfo(m_szFileName); + + SetWindowText(GetDlgItem(hwnd,IDC_TITLE), metaInfo.getTagData( META_INFO_TITLE ).c_str() ); + SetWindowText(GetDlgItem(hwnd,IDC_AUTHOR), metaInfo.getTagData( META_INFO_AUTHOR ).c_str() ); + SetWindowText(GetDlgItem(hwnd,IDC_SUBJECT), metaInfo.getTagData( META_INFO_SUBJECT ).c_str() ); + SetWindowText(GetDlgItem(hwnd,IDC_KEYWORDS), metaInfo.getTagData( META_INFO_KEYWORDS ).c_str() ); // comments read from meta.xml use "\n" for return, but this will not displayable in Edit control, add // "\r" before "\n" to form "\r\n" in order to display return in Edit control. - std::wstring tempStr = m_pMetaInfo->getTagData( META_INFO_DESCRIPTION ).c_str(); + std::wstring tempStr = metaInfo.getTagData( META_INFO_DESCRIPTION ).c_str(); std::wstring::size_type itor = tempStr.find ( L"\n" , 0 ); while (itor != std::wstring::npos) { @@ -332,6 +327,7 @@ void CPropertySheet::InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/) itor = tempStr.find(L"\n", itor + 2); } SetWindowText(GetDlgItem(hwnd,IDC_COMMENTS), tempStr.c_str()); + } //--------------------------------- @@ -339,7 +335,10 @@ void CPropertySheet::InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/) */ void CPropertySheet::InitPropPageStatistics(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/) { - document_statistic_reader_ptr doc_stat_reader = create_document_statistic_reader(m_szFileName, m_pMetaInfo.get()); + + CMetaInfoReader metaInfo(m_szFileName); + + document_statistic_reader_ptr doc_stat_reader = create_document_statistic_reader(m_szFileName, &metaInfo); statistic_group_list_t sgl; doc_stat_reader->read(&sgl); @@ -350,6 +349,7 @@ void CPropertySheet::InitPropPageStatistics(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/ GetResString(IDS_PROPERTY_VALUE)); lv_builder->build(sgl); + } diff --git a/shell/source/win32/shlxthandler/util/makefile.mk b/shell/source/win32/shlxthandler/util/makefile.mk index f5d912c4b185..c0bec9c36d3b 100644 --- a/shell/source/win32/shlxthandler/util/makefile.mk +++ b/shell/source/win32/shlxthandler/util/makefile.mk @@ -35,6 +35,7 @@ TARGET=util #LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE + # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk diff --git a/shell/source/win32/shlxthandler/util/utilities.cxx b/shell/source/win32/shlxthandler/util/utilities.cxx index 0598b4d335b7..36c19dd0c500 100644 --- a/shell/source/win32/shlxthandler/util/utilities.cxx +++ b/shell/source/win32/shlxthandler/util/utilities.cxx @@ -586,5 +586,4 @@ LCID LocaleSetToLCID( const LocaleSet_t & Locale ) return GetSystemDefaultLCID(); //System Default Locale return MAKELCID( MAKELANGID( usPrimaryLang, usSubLang ), SORT_DEFAULT ); - } diff --git a/shell/source/win32/simplemail/smplmailclient.cxx b/shell/source/win32/simplemail/smplmailclient.cxx index acb113450e7f..82968b747d95 100644 --- a/shell/source/win32/simplemail/smplmailclient.cxx +++ b/shell/source/win32/simplemail/smplmailclient.cxx @@ -32,7 +32,7 @@ #include "precompiled_shell.hxx" #include #include -#include +#include #include "smplmailclient.hxx" #include "smplmailmsg.hxx" #include @@ -112,12 +112,10 @@ namespace /* private */ if (senddocUrl.getLength() == 0) { - rtl::OUString baseUrl; - if (!osl::Module::getUrlFromAddress(reinterpret_cast(getSenddocUrl), baseUrl)) - return rtl::OUString(); - - senddocUrl = baseUrl.copy(0, baseUrl.lastIndexOf('/') + 1); - senddocUrl += rtl::OUString::createFromAscii("senddoc.exe"); + senddocUrl = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "$OOO_BASE_DIR/program/senddoc.exe")); + rtl::Bootstrap::expandMacros(senddocUrl); //TODO: detect failure } return senddocUrl; } -- cgit From 42345be352f413b571b83d262cc96025a9e8618d Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 25 Sep 2009 14:47:45 +0200 Subject: #i101955# configmgr2 support for platform backends (with a new interface); adapted locale backend, rest to follow --- shell/source/backends/localebe/localebackend.cxx | 110 ++++++++--------------- shell/source/backends/localebe/localebackend.hxx | 65 ++++++-------- shell/source/backends/localebe/localebecdef.cxx | 44 ++------- shell/source/backends/localebe/localelayer.cxx | 88 ------------------ shell/source/backends/localebe/localelayer.hxx | 64 ------------- shell/source/backends/localebe/makefile.mk | 5 +- 6 files changed, 71 insertions(+), 305 deletions(-) delete mode 100644 shell/source/backends/localebe/localelayer.cxx delete mode 100644 shell/source/backends/localebe/localelayer.hxx (limited to 'shell') diff --git a/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx index d8e2f05c0332..5df54b055929 100644 --- a/shell/source/backends/localebe/localebackend.cxx +++ b/shell/source/backends/localebe/localebackend.cxx @@ -32,9 +32,6 @@ #include "precompiled_shell.hxx" #include "localebackend.hxx" -#include "localelayer.hxx" -#include -#include #include #include @@ -229,11 +226,7 @@ rtl::OUString ImplGetLocale(LCID lcid) // ------------------------------------------------------------------------------- -LocaleBackend::LocaleBackend(const uno::Reference& xContext) - throw (backend::BackendAccessException) : - ::cppu::WeakImplHelper2 < backend::XSingleLayerStratum, lang::XServiceInfo > (), - m_xContext(xContext) - +LocaleBackend::LocaleBackend() { } @@ -245,11 +238,9 @@ LocaleBackend::~LocaleBackend(void) //------------------------------------------------------------------------------ -LocaleBackend* LocaleBackend::createInstance( - const uno::Reference& xContext -) +LocaleBackend* LocaleBackend::createInstance() { - return new LocaleBackend(xContext); + return new LocaleBackend; } // --------------------------------------------------------------------------------------- @@ -291,61 +282,49 @@ rtl::OUString LocaleBackend::getSystemLocale(void) } //------------------------------------------------------------------------------ -rtl::OUString LocaleBackend::createTimeStamp() +css::uno::Type LocaleBackend::getElementType() throw(css::uno::RuntimeException) { - // the time stamp is free text, so just returning the values here. - return getLocale() + getUILocale() + getSystemLocale(); + return cppu::UnoType< cppu::UnoVoidType >::get(); } -//------------------------------------------------------------------------------ - -uno::Reference SAL_CALL LocaleBackend::getLayer( - const rtl::OUString& aComponent, const rtl::OUString& /*aTimestamp*/) - throw (backend::BackendAccessException, lang::IllegalArgumentException) +sal_Bool LocaleBackend::hasElements() throw(css::uno::RuntimeException) { + return true; +} - uno::Sequence aComps( getSupportedComponents() ); - if( aComponent.equals( aComps[0]) ) - { - if( ! m_xSystemLayer.is() ) - { - uno::Sequence aPropInfoList(3); - - aPropInfoList[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.System/L10N/UILocale") ); - aPropInfoList[0].Type = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[0].Protected = sal_False; - aPropInfoList[0].Value = uno::makeAny( getUILocale() ); - - aPropInfoList[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.System/L10N/Locale") ); - aPropInfoList[1].Type = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "string" )); - aPropInfoList[1].Protected = sal_False; - aPropInfoList[1].Value = uno::makeAny( getLocale() ); - - aPropInfoList[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.System/L10N/SystemLocale") ); - aPropInfoList[2].Type = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "string" )); - aPropInfoList[2].Protected = sal_False; - aPropInfoList[2].Value = uno::makeAny( getSystemLocale() ); - - m_xSystemLayer = new LocaleLayer(aPropInfoList, createTimeStamp(), m_xContext); - } - - return m_xSystemLayer; +css::uno::Any LocaleBackend::getByName(rtl::OUString const & aName) + throw ( + css::container::NoSuchElementException, + css::lang::WrappedTargetException, css::uno::RuntimeException) +{ + if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Locale"))) { + return css::uno::makeAny(getLocale()); + } else if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SystemLocale"))) { + return css::uno::makeAny(getSystemLocale()); + } else if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("UILocale"))) { + return css::uno::makeAny(getUILocale()); + } else { + throw css::container::NoSuchElementException( + aName, static_cast< cppu::OWeakObject * >(this)); } - - return uno::Reference(); } -//------------------------------------------------------------------------------ +css::uno::Sequence< rtl::OUString > LocaleBackend::getElementNames() + throw (css::uno::RuntimeException) +{ + css::uno::Sequence< rtl::OUString > names(3); + names[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Locale")); + names[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SystemLocale")); + names[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UILocale")); + return names; +} -uno::Reference SAL_CALL -LocaleBackend::getUpdatableLayer(const rtl::OUString& /*aComponent*/) - throw (backend::BackendAccessException,lang::NoSupportException, - lang::IllegalArgumentException) +sal_Bool LocaleBackend::hasByName(rtl::OUString const & aName) + throw (css::uno::RuntimeException) { - throw lang::NoSupportException( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "LocaleBackend: No Update Operation allowed, Read Only access") ), - *this) ; + return aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Locale")) || + aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SystemLocale")) || + aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("UILocale")); } //------------------------------------------------------------------------------ @@ -366,10 +345,8 @@ rtl::OUString SAL_CALL LocaleBackend::getImplementationName(void) uno::Sequence SAL_CALL LocaleBackend::getBackendServiceNames(void) { - uno::Sequence aServiceNameList(2); + uno::Sequence aServiceNameList(1); aServiceNameList[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.LocaleBackend")) ; - aServiceNameList[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.PlatformBackend")) ; - return aServiceNameList ; } @@ -394,16 +371,3 @@ uno::Sequence SAL_CALL LocaleBackend::getSupportedServiceNames(vo { return getBackendServiceNames() ; } - -// --------------------------------------------------------------------------------------- - -uno::Sequence SAL_CALL LocaleBackend::getSupportedComponents(void) -{ - uno::Sequence aSupportedComponentList(1); - aSupportedComponentList[0] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.System" ) - ); - - return aSupportedComponentList; -} - diff --git a/shell/source/backends/localebe/localebackend.hxx b/shell/source/backends/localebe/localebackend.hxx index 7546a0385cf0..5e5083694325 100644 --- a/shell/source/backends/localebe/localebackend.hxx +++ b/shell/source/backends/localebe/localebackend.hxx @@ -31,10 +31,8 @@ #ifndef _FIXEDVALUEBACKEND_HXX_ #define _FIXEDVALUEBACKEND_HXX_ -#include -#include +#include #include -#include #include #include @@ -42,19 +40,14 @@ namespace css = com::sun::star ; namespace uno = css::uno ; namespace lang = css::lang ; -namespace backend = css::configuration::backend ; - -/** - Implements the SingleLayerStratum service. - */ class LocaleBackend : public ::cppu::WeakImplHelper2 < - backend::XSingleLayerStratum, + css::container::XNameAccess, lang::XServiceInfo > { public : - static LocaleBackend* createInstance(const uno::Reference& xContext); + static LocaleBackend* createInstance(); // XServiceInfo virtual rtl::OUString SAL_CALL @@ -81,45 +74,41 @@ class LocaleBackend : public ::cppu::WeakImplHelper2 < @return service names */ static uno::Sequence SAL_CALL getBackendServiceNames(void) ; - /** - Provides the supported component nodes - - @return supported component nodes - */ - static uno::Sequence SAL_CALL getSupportedComponents(void) ; - - //XSingleLayerStratum - virtual uno::Reference SAL_CALL - getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp ) - throw (backend::BackendAccessException, - lang::IllegalArgumentException) ; - - virtual uno::Reference SAL_CALL - getUpdatableLayer( const rtl::OUString& aLayerId ) - throw (backend::BackendAccessException, - lang::NoSupportException, - lang::IllegalArgumentException) ; + + //XNameAccess + virtual uno::Type SAL_CALL + getElementType() + throw (uno::RuntimeException); + + virtual sal_Bool SAL_CALL + hasElements() + throw (uno::RuntimeException); + + virtual uno::Any SAL_CALL + getByName( const rtl::OUString& aName ) + throw (css::container::NoSuchElementException, + lang::WrappedTargetException, uno::RuntimeException); + + virtual uno::Sequence SAL_CALL + getElementNames() + throw (uno::RuntimeException); + + virtual sal_Bool SAL_CALL + hasByName( const rtl::OUString& aName ) + throw (uno::RuntimeException); + protected: /** Service constructor from a service factory. @param xContext component context */ - LocaleBackend(const uno::Reference& xContext) - throw (backend::BackendAccessException); + LocaleBackend(); /** Destructor */ ~LocaleBackend(void) ; private: - - uno::Reference m_xContext ; - uno::Reference m_xSystemLayer ; - - // Returns a time stamp in the appropriate format - // for configuration layers. - static rtl::OUString createTimeStamp(void); - // Returns the user locale static rtl::OUString getLocale(void); diff --git a/shell/source/backends/localebe/localebecdef.cxx b/shell/source/backends/localebe/localebecdef.cxx index c9211543a283..cefa6c8d542d 100644 --- a/shell/source/backends/localebe/localebecdef.cxx +++ b/shell/source/backends/localebe/localebecdef.cxx @@ -32,7 +32,6 @@ #include "precompiled_shell.hxx" #include -#include #ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_ #include @@ -42,14 +41,13 @@ namespace css = com::sun::star ; namespace uno = css::uno ; namespace lang = css::lang ; -namespace backend = css::configuration::backend ; //------------------------------------------------------------------------------ static uno::Reference SAL_CALL createLocaleBackend( - const uno::Reference& xContext){ + const uno::Reference&){ - return * LocaleBackend::createInstance(xContext); + return * LocaleBackend::createInstance(); } //------------------------------------------------------------------------------ @@ -77,41 +75,9 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( //------------------------------------------------------------------------------ -extern "C" sal_Bool SAL_CALL component_writeInfo(void * /*pServiceManager*/, void *pRegistryKey) { - - using namespace ::com::sun::star::registry; - if (pRegistryKey) - { - try - { - uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + LocaleBackend::getBackendName() - ); - - // Register associated service names - uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") ) - ); - - uno::Sequence sServiceNames = LocaleBackend::getBackendServiceNames(); - for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i) - xServicesKey->createKey(sServiceNames[i]); - - // Register supported components - uno::Reference xComponentKey = xImplKey->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/DATA/SupportedComponents") ) - ); - - xComponentKey->setAsciiListValue( LocaleBackend::getSupportedComponents() ); - - return sal_True; - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "InvalidRegistryException caught"); - } - } - return sal_False; +extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *pRegistryKey) { + return cppu::component_writeInfoHelper( + pServiceManager, pRegistryKey, kImplementations_entries); } //------------------------------------------------------------------------------ diff --git a/shell/source/backends/localebe/localelayer.cxx b/shell/source/backends/localebe/localelayer.cxx deleted file mode 100644 index 74253e9d9187..000000000000 --- a/shell/source/backends/localebe/localelayer.cxx +++ /dev/null @@ -1,88 +0,0 @@ -/************************************************************************* - * - * 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: localelayer.cxx,v $ - * $Revision: 1.6 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" -#include "localelayer.hxx" - -//------------------------------------------------------------------------------ - -LocaleLayer::LocaleLayer( const uno::Sequence& aPropInfoList, - const rtl::OUString& aTimestamp, - const uno::Reference& xContext) - : m_aTimestamp(aTimestamp), m_aPropInfoList(aPropInfoList) -{ - //Create instance of LayerContentDescriber Service - rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.configuration.backend.LayerDescriber")); - - typedef uno::Reference LayerDescriber; - uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); - if( xServiceManager.is() ) - { - m_xLayerContentDescriber = LayerDescriber::query( - xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext)); - } - else - { - OSL_TRACE("Could not retrieve ServiceManager"); - } - -} - -//------------------------------------------------------------------------------ - -void SAL_CALL LocaleLayer::readData( - const uno::Reference& xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException) -{ - - if (m_xLayerContentDescriber.is()) - { - m_xLayerContentDescriber->describeLayer(xHandler, m_aPropInfoList); - } - else - { - OSL_TRACE("Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"); - } -} - -//------------------------------------------------------------------------------ - -rtl::OUString SAL_CALL LocaleLayer::getTimestamp(void) - throw (uno::RuntimeException) -{ - return m_aTimestamp; -} - -//------------------------------------------------------------------------------ diff --git a/shell/source/backends/localebe/localelayer.hxx b/shell/source/backends/localebe/localelayer.hxx deleted file mode 100644 index 69b305079d33..000000000000 --- a/shell/source/backends/localebe/localelayer.hxx +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef _LOCALELAYER_HXX_ -#define _LOCALELAYER_HXX_ - -#include -#include -#include -#include - -#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_ -#include -#endif -#include -#include -#include - - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; -namespace util = css::util ; - -/** - Implementation of the XLayer interfaces for fixed values - */ - -class LocaleLayer : public cppu::WeakImplHelper2 -{ - public : - /** - Constructor given the requested component name - - @param aPropInfoListyMap Gconf->OO key map - @param aCompoentName Requested Component Name - @param sTimestamp timestamp indicating last modifictaion - */ - LocaleLayer(const uno::Sequence& aPropInfoList, - const rtl::OUString& aTimestamp, - const uno::Reference& xContext); - - /** Destructor */ - ~LocaleLayer(void) {} - - // XLayer - virtual void SAL_CALL readData(const uno::Reference& xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException) ; - - // XTimeStamped - virtual rtl::OUString SAL_CALL getTimestamp(void) - throw (uno::RuntimeException); - - private : - - rtl::OUString m_aTimestamp ; - rtl::OUString m_aComponent ; - - uno::Reference m_xLayerContentDescriber ; - uno::Sequence m_aPropInfoList ; -} ; - -#endif // _LOCALELAYER_HXX_ diff --git a/shell/source/backends/localebe/makefile.mk b/shell/source/backends/localebe/makefile.mk index 76767264a831..f320b2978524 100644 --- a/shell/source/backends/localebe/makefile.mk +++ b/shell/source/backends/localebe/makefile.mk @@ -49,9 +49,8 @@ DLLPRE = SLOFILES=\ $(SLO)$/localebecdef.obj \ - $(SLO)$/localebackend.obj \ - $(SLO)$/localelayer.obj - + $(SLO)$/localebackend.obj + SHL1TARGET=$(TARGET)1.uno SHL1OBJS=$(SLOFILES) SHL1DEF=$(MISC)$/$(SHL1TARGET).def -- cgit From 48df5d3811b284973b6ea988eb537f4f6ec3cb89 Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 30 Sep 2009 09:14:44 +0200 Subject: #i101955# adapted desktop and gconf platform backends to new interface (gconf still needs support for ENABLE_LOCKDOWN-only Setup/Office/Factories .xcu entries), more to come; regcomplazy consequently no longer needs to support [Data] sections --- shell/source/backends/desktopbe/desktopbackend.cxx | 248 +++++ shell/source/backends/desktopbe/desktopbe.xml | 37 - shell/source/backends/desktopbe/desktopbe1-ucd.txt | 3 - shell/source/backends/desktopbe/desktopbecdef.cxx | 205 ---- shell/source/backends/desktopbe/exports.map | 10 - shell/source/backends/desktopbe/makefile.mk | 66 +- shell/source/backends/gconfbe/exports.map | 10 - shell/source/backends/gconfbe/gconfaccess.cxx | 850 +++++++++++++++ shell/source/backends/gconfbe/gconfaccess.hxx | 119 +++ shell/source/backends/gconfbe/gconfbackend.cxx | 1124 +++----------------- shell/source/backends/gconfbe/gconfbackend.hxx | 225 ---- shell/source/backends/gconfbe/gconfbe.xml | 35 - shell/source/backends/gconfbe/gconfbecdef.cxx | 151 --- shell/source/backends/gconfbe/gconflayer.cxx | 564 ---------- shell/source/backends/gconfbe/gconflayer.hxx | 133 --- shell/source/backends/gconfbe/makefile.mk | 9 +- 16 files changed, 1407 insertions(+), 2382 deletions(-) create mode 100644 shell/source/backends/desktopbe/desktopbackend.cxx delete mode 100644 shell/source/backends/desktopbe/desktopbe.xml delete mode 100644 shell/source/backends/desktopbe/desktopbecdef.cxx delete mode 100644 shell/source/backends/desktopbe/exports.map delete mode 100644 shell/source/backends/gconfbe/exports.map create mode 100644 shell/source/backends/gconfbe/gconfaccess.cxx create mode 100644 shell/source/backends/gconfbe/gconfaccess.hxx delete mode 100644 shell/source/backends/gconfbe/gconfbackend.hxx delete mode 100644 shell/source/backends/gconfbe/gconfbe.xml delete mode 100644 shell/source/backends/gconfbe/gconfbecdef.cxx delete mode 100644 shell/source/backends/gconfbe/gconflayer.cxx delete mode 100644 shell/source/backends/gconfbe/gconflayer.hxx (limited to 'shell') diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx new file mode 100644 index 000000000000..bdc45e737687 --- /dev/null +++ b/shell/source/backends/desktopbe/desktopbackend.cxx @@ -0,0 +1,248 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* $RCSfile: code,v $ +* +* $Revision: 1.4 $ +* +* 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 +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +#include "precompiled_shell.hxx" +#include "sal/config.h" + +#include "boost/noncopyable.hpp" +#include "com/sun/star/container/NoSuchElementException.hpp" +#include "com/sun/star/container/XNameAccess.hpp" +#include "com/sun/star/lang/XMultiComponentFactory.hpp" +#include "com/sun/star/lang/XServiceInfo.hpp" +#include "com/sun/star/lang/WrappedTargetException.hpp" +#include "com/sun/star/uno/Any.hxx" +#include "com/sun/star/uno/Exception.hpp" +#include "com/sun/star/uno/RuntimeException.hpp" +#include "com/sun/star/uno/Sequence.hxx" +#include "com/sun/star/uno/Type.hxx" +#include "com/sun/star/uno/XComponentContext.hpp" +#include "com/sun/star/uno/XCurrentContext.hpp" +#include "cppu/unotype.hxx" +#include "cppuhelper/factory.hxx" +#include "cppuhelper/implbase2.hxx" +#include "cppuhelper/implementationentry.hxx" +#include "cppuhelper/weak.hxx" +#include "osl/diagnose.h" +#include "rtl/string.h" +#include "rtl/textenc.h" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" +#include "uno/current_context.hxx" +#include "uno/lbnames.h" + +namespace { + +namespace css = com::sun::star; + +rtl::OUString SAL_CALL getDefaultImplementationName() { + return rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.comp.configuration.backend.DesktopBackend")); +} + +css::uno::Sequence< rtl::OUString > SAL_CALL getDefaultSupportedServiceNames() { + rtl::OUString name( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.backend.DesktopBackend")); + return css::uno::Sequence< rtl::OUString >(&name, 1); +} + +class Default: + public cppu::WeakImplHelper2< + css::lang::XServiceInfo, css::container::XNameAccess >, + private boost::noncopyable +{ +public: + Default() {} + +private: + virtual ~Default() {} + + virtual rtl::OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException) + { return getDefaultImplementationName(); } + + virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName) + throw (css::uno::RuntimeException) + { return ServiceName == getSupportedServiceNames()[0]; } + + virtual css::uno::Sequence< rtl::OUString > SAL_CALL + getSupportedServiceNames() throw (css::uno::RuntimeException) + { return getDefaultSupportedServiceNames(); } + + virtual css::uno::Type SAL_CALL getElementType() + throw (css::uno::RuntimeException) + { return cppu::UnoType< cppu::UnoVoidType >::get(); } + + virtual sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException) + { return true; } + + virtual css::uno::Any SAL_CALL getByName(rtl::OUString const & aName) + throw ( + css::container::NoSuchElementException, + css::lang::WrappedTargetException, css::uno::RuntimeException); + + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getElementNames() + throw (css::uno::RuntimeException); + + virtual sal_Bool SAL_CALL hasByName(rtl::OUString const & aName) + throw (css::uno::RuntimeException); +}; + +css::uno::Any Default::getByName(rtl::OUString const & aName) + throw ( + css::container::NoSuchElementException, + css::lang::WrappedTargetException, css::uno::RuntimeException) +{ + if (!hasByName(aName)) { + throw css::container::NoSuchElementException( + aName, static_cast< cppu::OWeakObject * >(this)); + } + return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); +} + +css::uno::Sequence< rtl::OUString > Default::getElementNames() + throw (css::uno::RuntimeException) +{ + css::uno::Sequence< rtl::OUString > names(13); + names[0] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("EnableATToolSupport")); + names[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ExternalMailer")); + names[2] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("SourceViewFontHeight")); + names[3] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SourceViewFontName")); + names[4] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WorkPathVariable")); + names[5] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyName")); + names[6] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyPort")); + names[7] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyName")); + names[8] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyPort")); + names[9] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyName")); + names[10] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyPort")); + names[11] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetNoProxy")); + names[12] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetProxyType")); + return names; +} + +sal_Bool Default::hasByName(rtl::OUString const & aName) + throw (css::uno::RuntimeException) +{ + css::uno::Sequence< rtl::OUString > names(getElementNames()); + for (sal_Int32 i = 0; i < names.getLength(); ++i) { + if (aName == names[i]) { + return true; + } + } + return false; +} + +css::uno::Reference< css::uno::XInterface > createBackend( + css::uno::Reference< css::uno::XComponentContext > const & context, + rtl::OUString const & name) +{ + try { + return css::uno::Reference< css::lang::XMultiComponentFactory >( + context->getServiceManager(), css::uno::UNO_SET_THROW)-> + createInstanceWithContext(name, context); + } catch (css::uno::RuntimeException &) { + // Assuming these exceptions are real errors: + throw; + } catch (css::uno::Exception & e) { + // Assuming these exceptions indicate that the service is not installed: + OSL_TRACE( + "createInstance(%s) failed with %s", + rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr(), + rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); + return css::uno::Reference< css::uno::XInterface >(); + } +} + +css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( + css::uno::Reference< css::uno::XComponentContext > const & context) +{ + rtl::OUString desktop; + css::uno::Reference< css::uno::XCurrentContext > current( + css::uno::getCurrentContext()); + if (current.is()) { + current->getValueByName( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("system.desktop-environment"))) >>= + desktop; + } + // Fall back to the default if the specific backend is not available: + css::uno::Reference< css::uno::XInterface > backend; + if (desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("GNOME"))) { + backend = createBackend( + context, + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.backend.GconfBackend"))); + } else if (desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KDE"))) { + backend = createBackend( + context, + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.backend.KDEBackend"))); + } //TODO: KDE4? + return backend.is() + ? backend : static_cast< cppu::OWeakObject * >(new Default); +} + +static cppu::ImplementationEntry const services[] = { + { &createInstance, &getDefaultImplementationName, + &getDefaultSupportedServiceNames, &cppu::createSingleComponentFactory, 0, + 0 }, + { 0, 0, 0, 0, 0, 0 } +}; + +} + +extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( + char const * pImplName, void * pServiceManager, void * pRegistryKey) +{ + return cppu::component_getFactoryHelper( + pImplName, pServiceManager, pRegistryKey, services); +} + +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL +component_getImplementationEnvironment( + char const ** ppEnvTypeName, uno_Environment **) +{ + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} + +extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( + void * pServiceManager, void * pRegistryKey) +{ + return component_writeInfoHelper(pServiceManager, pRegistryKey, services); +} diff --git a/shell/source/backends/desktopbe/desktopbe.xml b/shell/source/backends/desktopbe/desktopbe.xml deleted file mode 100644 index 0230028157dd..000000000000 --- a/shell/source/backends/desktopbe/desktopbe.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - desktopbe - - Jan Holesovsky - com.sun.star.comp.configuration.backend.DesktopBackend - The shared gconf/KDE backend; will load GconfBackend or - KDEBackend depending on the desktop environment. - com.sun.star.loader.SharedLibrary - c++ - - com.sun.star.comp.configuration.backend.DesktopBackend - com.sun.star.comp.configuration.backend.PlatformBackend - ... - com.sun.star.configuration.backend.XBackendChangesListener - com.sun.star.configuration.backend.XBackendChangesNotifier - com.sun.star.configuration.backend.XLayerHandler - com.sun.star.configuration.backend.XSingleLayerStratum - com.sun.star.lang.XMultiComponentFactory - com.sun.star.lang.XServiceInfo - com.sun.star.lang.XSingleComponentFactory - com.sun.star.lang.XTypeProvider - com.sun.star.uno.TypeClass - com.sun.star.uno.XAggregation - com.sun.star.uno.XComponentContext - com.sun.star.uno.XCurrentContext - com.sun.star.uno.XWeak - com.sun.star.registry.XRegistryKey - - cppuhelper - cppu - sal - cppuhelper3$(COM) - cppu3 - sal3 - diff --git a/shell/source/backends/desktopbe/desktopbe1-ucd.txt b/shell/source/backends/desktopbe/desktopbe1-ucd.txt index c1df46010377..fd874a82ead5 100644 --- a/shell/source/backends/desktopbe/desktopbe1-ucd.txt +++ b/shell/source/backends/desktopbe/desktopbe1-ucd.txt @@ -2,8 +2,5 @@ ImplementationName=com.sun.star.comp.configuration.backend.DesktopBackend ComponentName=desktopbe1.uno.so LoaderName=com.sun.star.loader.SharedLibrary -[Data] -SupportedComponents=org.openoffice.VCL;org.openoffice.Inet;org.openoffice.Office.Common;org.openoffice.Office.Paths;org.openoffice.UserProfile;org.openoffice.Office.Recovery;org.openoffice.Setup [SupportedServices] com.sun.star.configuration.backend.DesktopBackend -com.sun.star.configuration.backend.PlatformBackend diff --git a/shell/source/backends/desktopbe/desktopbecdef.cxx b/shell/source/backends/desktopbe/desktopbecdef.cxx deleted file mode 100644 index 2ae366bfcc94..000000000000 --- a/shell/source/backends/desktopbe/desktopbecdef.cxx +++ /dev/null @@ -1,205 +0,0 @@ -/************************************************************************* - * - * 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: desktopbecdef.cxx,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" - -#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XSCHEMASUPPLIER_HPP_ -#include -#endif -#include - -#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_ -#include -#endif -#include - -#include "uno/current_context.hxx" - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; - -//============================================================================== - -static uno::Reference SAL_CALL createDesktopBackend(const uno::Reference& xContext) -{ - try { - uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext()); - - if (xCurrentContext.is()) - { - uno::Any aValue = xCurrentContext->getValueByName( - rtl::OUString::createFromAscii( "system.desktop-environment" ) ); - - rtl::OUString aDesktopEnvironment; - if ( aValue >>= aDesktopEnvironment ) - { - rtl::OUString aDesktopService; - if ( aDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "gnome" ) ) - aDesktopService = rtl::OUString::createFromAscii( "com.sun.star.configuration.backend.GconfBackend" ); - else if ( aDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde" ) ) - aDesktopService = rtl::OUString::createFromAscii( "com.sun.star.configuration.backend.KDEBackend" ); - else - return uno::Reference(); - - uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); - if( xServiceManager.is() ) - { - return uno::Reference< backend::XSingleLayerStratum >::query( - xServiceManager->createInstanceWithContext( aDesktopService, xContext) ); - } - } - } - } catch (uno::RuntimeException e) { - } - - return uno::Reference(); -} - -static rtl::OUString SAL_CALL getBackendName(void) { - return rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.DesktopBackend") ); -} - -static uno::Sequence SAL_CALL getBackendServiceNames(void) -{ - uno::Sequence aServices(2) ; - aServices[0] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.DesktopBackend")) ; - aServices[1] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.PlatformBackend")) ; - - return aServices ; -} - -static uno::Sequence SAL_CALL getSupportedComponents(void) -{ - const sal_Int32 nComponents = 7; - - uno::Sequence aSupportedComponentsList(nComponents) ; - - aSupportedComponentsList[0] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("org.openoffice.VCL")) ; - aSupportedComponentsList[1] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Inet")) ; - aSupportedComponentsList[2] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common")) ; - aSupportedComponentsList[3] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Paths")) ; - - aSupportedComponentsList[4] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("org.openoffice.UserProfile")) ; - aSupportedComponentsList[5] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Recovery")) ; - aSupportedComponentsList[6] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup")) ; - - return aSupportedComponentsList ; -} -//============================================================================== - -static const cppu::ImplementationEntry kImplementations_entries[] = -{ - { - createDesktopBackend, - getBackendName, - getBackendServiceNames, - cppu::createSingleComponentFactory, - NULL, - 0 - }, - { NULL, NULL, NULL, NULL, NULL, 0 } -} ; -//------------------------------------------------------------------------------ - -extern "C" void SAL_CALL component_getImplementationEnvironment( - const sal_Char **aEnvTypeName, - uno_Environment ** /* aEnvironment */) -{ - *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; -} - -//------------------------------------------------------------------------------ - -extern "C" sal_Bool SAL_CALL component_writeInfo(void * /* pServiceManager */, - void *pRegistryKey) -{ - using namespace ::com::sun::star::registry; - if (pRegistryKey) - { - try - { - uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + getBackendName() - ); - - // Register associated service names - uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") ) - ); - - uno::Sequence sServiceNames = getBackendServiceNames(); - for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i) - xServicesKey->createKey(sServiceNames[i]); - - // Register supported components - uno::Reference xComponentKey = xImplKey->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/DATA/SupportedComponents") ) - ); - - xComponentKey->setAsciiListValue( getSupportedComponents() ); - - return sal_True; - } - - catch( InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "InvalidRegistryException caught"); - } - } - - return sal_False; -} - -//------------------------------------------------------------------------------ - -extern "C" void *component_getFactory(const sal_Char *aImplementationName, - void *aServiceManager, - void *aRegistryKey) -{ - return cppu::component_getFactoryHelper( - aImplementationName, - aServiceManager, - aRegistryKey, - kImplementations_entries) ; -} -//------------------------------------------------------------------------------ diff --git a/shell/source/backends/desktopbe/exports.map b/shell/source/backends/desktopbe/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/shell/source/backends/desktopbe/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/desktopbe/makefile.mk b/shell/source/backends/desktopbe/makefile.mk index b6bcd3d95905..cc56e321296f 100644 --- a/shell/source/backends/desktopbe/makefile.mk +++ b/shell/source/backends/desktopbe/makefile.mk @@ -1,14 +1,13 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. +# +# Copyright 2009 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ +# $RCSfile: makefile,v $ # -# $Revision: 1.3 $ +# $Revision: 1.4 $ # # This file is part of OpenOffice.org. # @@ -26,50 +25,31 @@ # version 3 along with OpenOffice.org. If not, see # # for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=..$/..$/.. - -PRJNAME=shell -TARGET=desktopbe +#***********************************************************************/ -LIBTARGET=NO -ENABLE_EXCEPTIONS=TRUE +PRJ = ../../.. +PRJNAME = shell +TARGET = desktopbe -COMP1TYPELIST=$(TARGET) -COMPRDB=$(SOLARBINDIR)$/types.rdb -UNOUCROUT=$(OUT)$/inc$/$(TARGET) -INCPRE=$(UNOUCROUT) +ENABLE_EXCEPTIONS = TRUE +VISIBILITY_HIDDEN = TRUE -# --- Settings --- +.INCLUDE: settings.mk -.INCLUDE : settings.mk - -UNIXTEXT=$(MISC)/$(TARGET)1-ucd.txt - -# no "lib" prefix DLLPRE = -# --- Files --- - -SLOFILES=\ - $(SLO)$/desktopbecdef.obj - -SHL1NOCHECK=TRUE -SHL1TARGET=$(TARGET)1.uno -SHL1OBJS=$(SLOFILES) -SHL1DEF=$(MISC)$/$(SHL1TARGET).def +SLOFILES = $(SLO)/desktopbackend.obj -SHL1IMPLIB=i$(SHL1TARGET) -SHL1STDLIBS= \ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ - $(SALLIB) - -SHL1VERSIONMAP=exports.map -SHL1DEF=$(MISC)$/$(SHL1TARGET).def -DEF1NAME=$(SHL1TARGET) +SHL1IMPLIB = i$(SHL1TARGET) +SHL1OBJS = $(SLOFILES) +SHL1STDLIBS = \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(SALLIB) +SHL1TARGET = desktopbe1.uno +SHL1USE_EXPORTS = name +DEF1NAME = $(SHL1TARGET) -# --- Targets --- +UNIXTEXT = $(MISC)/desktopbe1-ucd.txt -.INCLUDE : target.mk +.INCLUDE: target.mk diff --git a/shell/source/backends/gconfbe/exports.map b/shell/source/backends/gconfbe/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/shell/source/backends/gconfbe/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/gconfbe/gconfaccess.cxx b/shell/source/backends/gconfbe/gconfaccess.cxx new file mode 100644 index 000000000000..8391eda712fa --- /dev/null +++ b/shell/source/backends/gconfbe/gconfaccess.cxx @@ -0,0 +1,850 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* $RCSfile: code,v $ +* +* $Revision: 1.4 $ +* +* 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 +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +#include "precompiled_shell.hxx" +#include "sal/config.h" + +#include + +#include "com/sun/star/uno/RuntimeException.hpp" +#include "osl/file.hxx" +#include "osl/security.hxx" +#include "osl/thread.h" +#include "rtl/strbuf.hxx" +#include "rtl/ustrbuf.hxx" + +#include "gconfaccess.hxx" + +#define GCONF_PROXY_MODE_KEY "/system/proxy/mode" +#define GCONF_AUTO_SAVE_KEY "/apps/openoffice/auto_save" + +namespace gconfaccess { + +namespace { + +namespace css = com::sun::star ; +namespace uno = css::uno ; +using namespace rtl; + +GConfClient* getGconfClient() +{ + static GConfClient* mClient= 0; + if (mClient == NULL) + { + /* initialize glib object type library */ + g_type_init(); + + GError* aError = NULL; + if (!gconf_init(0, NULL, &aError)) + { + rtl::OUStringBuffer msg; + msg.appendAscii("GconfBackend:GconfLayer: Cannot Initialize Gconf connection - " ); + msg.appendAscii(aError->message); + + g_error_free(aError); + aError = NULL; + throw uno::RuntimeException(msg.makeStringAndClear(),NULL); + } + + mClient = gconf_client_get_default(); + if (!mClient) + { + throw uno::RuntimeException(rtl::OUString::createFromAscii + ("GconfBackend:GconfLayer: Cannot Initialize Gconf connection"),NULL); + } + + static const char * const PreloadValuesList[] = + { + "/desktop/gnome/interface", + "/system/proxy", + "/system/http_proxy/host", + "/desktop/gnome/url-handlers/mailto", +#ifdef ENABLE_LOCKDOWN + "/apps/openoffice", + "/desktop/gnome/lockdown", + "/apps/openoffice/lockdown", +#endif // ENABLE_LOCKDOWN + NULL + }; + int i = 0; + while( PreloadValuesList[i] != NULL ) + gconf_client_preload( mClient, PreloadValuesList[i++], GCONF_CLIENT_PRELOAD_ONELEVEL, NULL ); + } + + return mClient; +} + +static OUString xdg_user_dir_lookup (const char *type) +{ + char *config_home; + char *p; + int relative; + bool bError = false; + + osl::Security aSecurity; + oslFileHandle handle; + OUString aHomeDirURL; + OUString aDocumentsDirURL; + OUString aConfigFileURL; + OUStringBuffer aUserDirBuf; + + if (!aSecurity.getHomeDir( aHomeDirURL ) ) + { + osl::FileBase::getFileURLFromSystemPath(rtl::OUString::createFromAscii("/tmp"), aDocumentsDirURL); + return aDocumentsDirURL; + } + + config_home = getenv ("XDG_CONFIG_HOME"); + if (config_home == NULL || config_home[0] == 0) + { + aConfigFileURL = OUString(aHomeDirURL); + aConfigFileURL += OUString::createFromAscii( "/.config/user-dirs.dirs" ); + } + else + { + aConfigFileURL = OUString::createFromAscii(config_home); + aConfigFileURL += OUString::createFromAscii( "/user-dirs.dirs" ); + } + + if(osl_File_E_None == osl_openFile(aConfigFileURL.pData, &handle, osl_File_OpenFlag_Read)) + { + rtl::ByteSequence seq; + while (osl_File_E_None == osl_readLine(handle , (sal_Sequence **)&seq)) + { + /* Remove newline at end */ + int len = seq.getLength(); + if(len>0 && seq[len-1] == '\n') + seq[len-1] = 0; + + p = (char *)seq.getArray(); + + while (*p == ' ' || *p == '\t') + p++; + + if (strncmp (p, "XDG_", 4) != 0) + continue; + p += 4; + if (strncmp (p, type, strlen (type)) != 0) + continue; + p += strlen (type); + if (strncmp (p, "_DIR", 4) != 0) + continue; + p += 4; + + while (*p == ' ' || *p == '\t') + p++; + + if (*p != '=') + continue; + p++; + + while (*p == ' ' || *p == '\t') + p++; + + if (*p != '"') + continue; + p++; + + relative = 0; + if (strncmp (p, "$HOME/", 6) == 0) + { + p += 6; + relative = 1; + } + else if (*p != '/') + continue; + + if (relative) + { + aUserDirBuf = OUStringBuffer(aHomeDirURL); + aUserDirBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "/" ) ); + } + else + { + aUserDirBuf = OUStringBuffer(); + } + + while (*p && *p != '"') + { + if ((*p == '\\') && (*(p+1) != 0)) + p++; + aUserDirBuf.append((sal_Unicode)*p++); + } + } + osl_closeFile(handle); + } + else + bError = true; + + if (aUserDirBuf.getLength()>0 && !bError) + { + aDocumentsDirURL = aUserDirBuf.makeStringAndClear(); + osl::Directory aDocumentsDir( aDocumentsDirURL ); + if( osl::FileBase::E_None == aDocumentsDir.open() ) + return aDocumentsDirURL; + } + + /* Special case desktop for historical compatibility */ + if (strcmp (type, "DESKTOP") == 0) + { + aUserDirBuf = OUStringBuffer(aHomeDirURL); + aUserDirBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "/Desktop" ) ); + return aUserDirBuf.makeStringAndClear(); + } + else + { + aUserDirBuf = OUStringBuffer(aHomeDirURL); + aUserDirBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "/Documents" ) ); + return aUserDirBuf.makeStringAndClear(); + } +} + +//------------------------------------------------------------------------------ + +uno::Any makeAnyOfGconfValue( GConfValue *aGconfValue ) +{ + switch( aGconfValue->type ) + { + case GCONF_VALUE_BOOL: + return uno::makeAny( (sal_Bool) gconf_value_get_bool( aGconfValue ) ); + + case GCONF_VALUE_INT: + return uno::makeAny( (sal_Int32) gconf_value_get_int( aGconfValue ) ); + + case GCONF_VALUE_STRING: + return uno::makeAny( OStringToOUString( rtl::OString( + gconf_value_get_string(aGconfValue) ), RTL_TEXTENCODING_UTF8 ) ); + + default: + fprintf( stderr, "makeAnyOfGconfValue: Type not handled.\n" ); + break; + } + + return uno::Any(); +} + +//------------------------------------------------------------------------------ + +static void splitFontName( GConfValue *aGconfValue, rtl::OUString &rName, sal_Int16 &rHeight) +{ + rtl::OString aFont( gconf_value_get_string( aGconfValue ) ); + aFont.trim(); + sal_Int32 nIdx = aFont.lastIndexOf( ' ' ); + if (nIdx < 1) { // urk + rHeight = 12; + nIdx = aFont.getLength(); + } else { + rtl::OString aSize = aFont.copy( nIdx + 1 ); + rHeight = static_cast( aSize.toInt32() ); + } + + rName = rtl::OStringToOUString( aFont.copy( 0, nIdx ), RTL_TEXTENCODING_UTF8 ); +} + +//------------------------------------------------------------------------------ + +uno::Any translateToOOo( const ConfigurationValue aValue, GConfValue *aGconfValue ) +{ + + switch( aValue.nSettingId ) + { + case SETTING_PROXY_MODE: + { + rtl::OUString aProxyMode; + uno::Any aOriginalValue = makeAnyOfGconfValue( aGconfValue ); + aOriginalValue >>= aProxyMode; + + if( aProxyMode.equals( rtl::OUString::createFromAscii( "manual" ) ) ) + return uno::makeAny( (sal_Int32) 1 ); + else if( aProxyMode.equals( rtl::OUString::createFromAscii( "none" ) ) ) + return uno::makeAny( (sal_Int32) 0 ); + } + break; + + case SETTING_NO_PROXY_FOR: + { + rtl::OStringBuffer aBuffer; + if( (GCONF_VALUE_LIST == aGconfValue->type) && (GCONF_VALUE_STRING == gconf_value_get_list_type(aGconfValue)) ) + { + GSList * list = gconf_value_get_list(aGconfValue); + for(; list; list = g_slist_next(list)) + { + aBuffer.append(gconf_value_get_string((GConfValue *) list->data)); + aBuffer.append(";"); + } + // Remove trailing ";" + aBuffer.setLength(aBuffer.getLength()-1); + return uno::makeAny(rtl::OStringToOUString(aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); + } + else + g_warning( "unexpected type for ignore_hosts" ); + } + break; + + case SETTING_MAILER_PROGRAM: + { + rtl::OUString aMailer; + uno::Any aOriginalValue = makeAnyOfGconfValue( aGconfValue ); + aOriginalValue >>= aMailer; + sal_Int32 nIndex = 0; + return uno::makeAny( aMailer.getToken( 0, ' ', nIndex ) ); + } + +#ifdef ENABLE_LOCKDOWN + // "short" values need to be returned a sal_Int16 + case SETTING_FONT_ANTI_ALIASING_MIN_PIXEL: + case SETTING_SYMBOL_SET: + { + sal_Int32 nShortValue; + uno::Any aOriginalValue = makeAnyOfGconfValue( aGconfValue ); + aOriginalValue >>= nShortValue; + return uno::makeAny( (sal_Int16) nShortValue ); + } + break; +#endif // ENABLE_LOCKDOWN + + // "boolean" values that need a string to be returned + case SETTING_ENABLE_ACCESSIBILITY: +#ifdef ENABLE_LOCKDOWN + case SETTING_DISABLE_PRINTING: +#endif // ENABLE_LOCKDOWN + { + sal_Bool bBooleanValue = false; + uno::Any aOriginalValue = makeAnyOfGconfValue( aGconfValue ); + aOriginalValue >>= bBooleanValue; + return uno::makeAny( rtl::OUString::valueOf( (sal_Bool) bBooleanValue ) ); + } + + case SETTING_WORK_DIRECTORY: + { + rtl::OUString aDocumentsDirURL = xdg_user_dir_lookup("DOCUMENTS"); + + return uno::makeAny( aDocumentsDirURL ); + } + + case SETTING_USER_GIVENNAME: + { + rtl::OUString aCompleteName( rtl::OStringToOUString( + g_get_real_name(), osl_getThreadTextEncoding() ) ); + sal_Int32 nIndex = 0; + rtl::OUString aGivenName; + do + aGivenName = aCompleteName.getToken( 0, ' ', nIndex ); + while ( nIndex == 0 ); + + return uno::makeAny( aGivenName ); + + } + + case SETTING_USER_SURNAME: + { + rtl::OUString aCompleteName( rtl::OStringToOUString( + g_get_real_name(), osl_getThreadTextEncoding() ) ); + sal_Int32 nIndex = 0; + rtl::OUString aSurname; + do + aSurname = aCompleteName.getToken( 0, ' ', nIndex ); + while ( nIndex >= 0 ); + + return uno::makeAny( aSurname ); + } + + case SETTING_SOURCEVIEWFONT_NAME: + case SETTING_SOURCEVIEWFONT_HEIGHT: + { + rtl::OUString aName; + sal_Int16 nHeight; + + splitFontName (aGconfValue, aName, nHeight); + if (aValue.nSettingId == SETTING_SOURCEVIEWFONT_NAME) + return uno::makeAny( aName ); + else + return uno::makeAny( nHeight ); + } + + + default: + fprintf( stderr, "Unhandled setting to translate.\n" ); + break; + } + + return uno::Any(); +} + +//------------------------------------------------------------------------------ + +sal_Bool SAL_CALL isDependencySatisfied( GConfClient* aClient, const ConfigurationValue aValue ) +{ + switch( aValue.nDependsOn ) + { + case SETTING_PROXY_MODE: + { + GConfValue* aGconfValue = gconf_client_get( aClient, GCONF_PROXY_MODE_KEY, NULL ); + + if ( aGconfValue != NULL ) + { + bool bOk = g_strcasecmp( "manual", gconf_value_get_string( aGconfValue ) ) == 0; + gconf_value_free( aGconfValue ); + if (bOk) return sal_True; + } + } + break; + + case SETTING_WORK_DIRECTORY: + { + rtl::OUString aDocumentsDirURL = xdg_user_dir_lookup("DOCUMENTS"); + osl::Directory aDocumentsDir( aDocumentsDirURL ); + + if( osl::FileBase::E_None == aDocumentsDir.open() ) + return sal_True; + } + break; + + case SETTING_USER_GIVENNAME: + { + rtl::OUString aCompleteName( rtl::OStringToOUString( + g_get_real_name(), osl_getThreadTextEncoding() ) ); + if( !aCompleteName.equalsAscii( "Unknown" ) ) + return sal_True; + } + break; + + case SETTING_USER_SURNAME: + { + rtl::OUString aCompleteName( rtl::OStringToOUString( + g_get_real_name(), osl_getThreadTextEncoding() ) ); + if( !aCompleteName.equalsAscii( "Unknown" ) ) + { + if( aCompleteName.trim().indexOf(rtl::OUString::createFromAscii(" "), 0) != -1 ) + return sal_True; + } + } + break; + +#ifdef ENABLE_LOCKDOWN + case SETTING_AUTO_SAVE: + { + GConfClient* aClient = GconfBackend::getGconfClient(); + GConfValue* aGconfValue = gconf_client_get( aClient, GCONF_AUTO_SAVE_KEY, NULL ); + + if( ( aGconfValue != NULL ) ) + { + bool bOk = gconf_value_get_bool( aGconfValue ); + gconf_value_free( aGconfValue ); + if (bOk) return sal_True; + } + } + break; +#endif // ENABLE_LOCKDOWN + + default: + fprintf( stderr, "Unhandled setting to check dependency.\n" ); + break; + } + + return sal_False; +} + +} + +ConfigurationValue const ConfigurationValues[] = +{ + { + SETTING_ENABLE_ACCESSIBILITY, + "/desktop/gnome/interface/accessibility", + "EnableATToolSupport", + sal_True, + SETTINGS_LAST + }, + + { + SETTING_PROXY_MODE, + GCONF_PROXY_MODE_KEY, + "ooInetProxyType", + sal_True, + SETTINGS_LAST + }, + + { + SETTING_PROXY_HTTP_HOST, + "/system/http_proxy/host", + "ooInetHTTPProxyName", + sal_False, + SETTING_PROXY_MODE + }, + + { + SETTING_PROXY_HTTP_PORT, + "/system/http_proxy/port", + "ooInetHTTPProxyPort", + sal_False, + SETTING_PROXY_MODE + }, + + { + SETTING_PROXY_HTTPS_HOST, + "/system/proxy/secure_host", + "ooInetHTTPSProxyName", + sal_False, + SETTING_PROXY_MODE + }, + + { + SETTING_PROXY_HTTPS_PORT, + "/system/proxy/secure_port", + "ooInetHTTPSProxyPort", + sal_False, + SETTING_PROXY_MODE + }, + + { + SETTING_PROXY_FTP_HOST, + "/system/proxy/ftp_host", + "ooInetFTPProxyName", + sal_False, + SETTING_PROXY_MODE + }, + + { + SETTING_PROXY_FTP_PORT, + "/system/proxy/ftp_port", + "ooInetFTPProxyPort", + sal_False, + SETTING_PROXY_MODE + }, + + { + SETTING_NO_PROXY_FOR, + "/system/http_proxy/ignore_hosts", + "ooInetNoProxy", + sal_True, + SETTING_PROXY_MODE + }, + + { + SETTING_MAILER_PROGRAM, + "/desktop/gnome/url-handlers/mailto/command", + "ExternalMailer", + sal_True, + SETTINGS_LAST + }, + { + SETTING_SOURCEVIEWFONT_NAME, + "/desktop/gnome/interface/monospace_font_name", + "SourceViewFontName", + sal_True, + SETTINGS_LAST + }, + { + SETTING_SOURCEVIEWFONT_HEIGHT, + "/desktop/gnome/interface/monospace_font_name", + "SourceViewFontHeight", + sal_True, + SETTINGS_LAST + }, + + { + SETTING_WORK_DIRECTORY, + "/desktop/gnome/url-handlers/mailto/command", // dummy + "WorkPathVariable", + sal_True, + SETTING_WORK_DIRECTORY, // so that the existence of the dir can be checked + }, + +#ifdef ENABLE_LOCKDOWN + { + SETTING_WRITER_DEFAULT_DOC_FORMAT, + "/apps/openoffice/writer_default_document_format", + "TextDocumentSetupFactoryDefaultFilter", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_IMPRESS_DEFAULT_DOC_FORMAT, + "/apps/openoffice/impress_default_document_format", + "PresentationDocumentSetupFactoryDefaultFilter", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_CALC_DEFAULT_DOC_FORMAT, + "/apps/openoffice/calc_default_document_format", + "SpreadsheetDocumentSetupFactoryDefaultFilter", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_AUTO_SAVE, + GCONF_AUTO_SAVE_KEY, + "AutoSaveEnabled", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_AUTO_SAVE_INTERVAL, + "/apps/openoffice/auto_save_interval", + "AutoSaveTimeIntervall", + sal_False, + SETTING_AUTO_SAVE + }, + + { + SETTING_USER_GIVENNAME, + "/desktop/gnome/url-handlers/mailto/command", // dummy + "givenname", + sal_True, + SETTING_USER_GIVENNAME + }, + + { + SETTING_USER_SURNAME, + "/desktop/gnome/url-handlers/mailto/command", // dummy + "sn", + sal_True, + SETTING_USER_SURNAME + }, + + { + SETTING_DISABLE_PRINTING, + "/desktop/gnome/lockdown/disable_printing", + "DisablePrinting", + sal_True, + SETTINGS_LAST + }, + + { + SETTING_USE_SYSTEM_FILE_DIALOG, + "/apps/openoffice/use_system_file_dialog", + "UseSystemFileDialog", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_PRINTING_MODIFIES_DOCUMENT, + "/apps/openoffice/printing_modifies_doc", + "PrintingModifiesDocument", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_SHOW_ICONS_IN_MENUS, + "/apps/openoffice/show_menu_icons", + "ShowIconsInMenues", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_SHOW_INACTIVE_MENUITEMS, + "/apps/openoffice/show_menu_inactive_items", + "DontHideDisabledEntry", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_SHOW_FONT_PREVIEW, + "/apps/openoffice/show_font_preview", + "ShowFontBoxWYSIWYG", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_SHOW_FONT_HISTORY, + "/apps/openoffice/show_font_history", + "FontViewHistory", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_ENABLE_OPENGL, + "/apps/openoffice/use_opengl", + "OpenGL", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_OPTIMIZE_OPENGL, + "/apps/openoffice/optimize_opengl", + "OpenGL_Faster", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_USE_SYSTEM_FONT, + "/apps/openoffice/use_system_font", + "AccessibilityIsSystemFont", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_USE_FONT_ANTI_ALIASING, + "/apps/openoffice/use_font_anti_aliasing", + "FontAntiAliasingEnabled", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_FONT_ANTI_ALIASING_MIN_PIXEL, + "/apps/openoffice/font_anti_aliasing_min_pixel", + "FontAntiAliasingMinPixelHeight", + sal_True, + SETTINGS_LAST + }, + + { + SETTING_WARN_CREATE_PDF, + "/apps/openoffice/lockdown/warn_info_create_pdf", + "WarnCreatePDF", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_WARN_PRINT_DOC, + "/apps/openoffice/lockdown/warn_info_printing", + "WarnPrintDoc", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_WARN_SAVEORSEND_DOC, + "/apps/openoffice/lockdown/warn_info_saving", + "WarnSaveOrSendDoc", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_WARN_SIGN_DOC, + "/apps/openoffice/lockdown/warn_info_signing", + "WarnSignDoc", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_REMOVE_PERSONAL_INFO, + "/apps/openoffice/lockdown/remove_personal_info_on_save", + "Scripting/RemovePersonalInfoOnSaving", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_RECOMMEND_PASSWORD, + "/apps/openoffice/lockdown/recommend_password_on_save", + "RecommendPasswordProtection", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_UNDO_STEPS, + "/apps/openoffice/undo_steps", + "UndoSteps", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_SYMBOL_SET, + "/apps/openoffice/icon_size", + "SymbolSet", + sal_True, + SETTINGS_LAST + }, + + { + SETTING_MACRO_SECURITY_LEVEL, + "/apps/openoffice/lockdown/macro_security_level", + "MacroSecurityLevel", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_CREATE_BACKUP, + "/apps/openoffice/create_backup", + "CreateBackup", + sal_False, + SETTINGS_LAST + }, + + { + SETTING_WARN_ALIEN_FORMAT, + "/apps/openoffice/warn_alien_format", + "WarnAlienFormat", + sal_False, + SETTINGS_LAST + }, + +#endif // ENABLE_LOCKDOWN +}; + +std::size_t const nConfigurationValues = + sizeof ConfigurationValues / sizeof ConfigurationValues[0]; + +css::uno::Any getValue(ConfigurationValue const & data) { + GConfClient* aClient = getGconfClient(); + GConfValue* aGconfValue; + if( ( data.nDependsOn == SETTINGS_LAST ) || isDependencySatisfied( aClient, data ) ) + { + aGconfValue = gconf_client_get( aClient, data.GconfItem, NULL ); + + if( aGconfValue != NULL ) + { + css::uno::Any value; + if( data.bNeedsTranslation ) + value = translateToOOo( data, aGconfValue ); + else + value = makeAnyOfGconfValue( aGconfValue ); + + gconf_value_free( aGconfValue ); + + return value; + } + } + return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); +} + +} diff --git a/shell/source/backends/gconfbe/gconfaccess.hxx b/shell/source/backends/gconfbe/gconfaccess.hxx new file mode 100644 index 000000000000..c986fd338da9 --- /dev/null +++ b/shell/source/backends/gconfbe/gconfaccess.hxx @@ -0,0 +1,119 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* $RCSfile: code,v $ +* +* $Revision: 1.4 $ +* +* 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 +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +#ifndef INCLUDED_SHELL_SOURCE_BACKENDS_GCONFBE_GCONFACCESS_HXX +#define INCLUDED_SHELL_SOURCE_BACKENDS_GCONFBE_GCONFACCESS_HXX + +#include "sal/config.h" + +#include + +#include "gconf/gconf-client.h" +#include "sal/types.h" + +namespace com { namespace sun { namespace star { namespace uno { + class Any; +} } } } + +namespace gconfaccess { + +enum ConfigurationSetting +{ + SETTING_PROXY_MODE, + SETTING_PROXY_HTTP_HOST, + SETTING_PROXY_HTTP_PORT, + SETTING_PROXY_HTTPS_HOST, + SETTING_PROXY_HTTPS_PORT, + SETTING_PROXY_FTP_HOST, + SETTING_PROXY_FTP_PORT, + SETTING_NO_PROXY_FOR, + SETTING_ENABLE_ACCESSIBILITY, + SETTING_MAILER_PROGRAM, + SETTING_WORK_DIRECTORY, + SETTING_SOURCEVIEWFONT_NAME, + SETTING_SOURCEVIEWFONT_HEIGHT, + SETTING_USER_GIVENNAME, + SETTING_USER_SURNAME, + +#ifdef ENABLE_LOCKDOWN + + SETTING_DISABLE_PRINTING, + SETTING_USE_SYSTEM_FILE_DIALOG, + SETTING_PRINTING_MODIFIES_DOCUMENT, + SETTING_SHOW_ICONS_IN_MENUS, + SETTING_SHOW_INACTIVE_MENUITEMS, + SETTING_SHOW_FONT_PREVIEW, + SETTING_SHOW_FONT_HISTORY, + SETTING_ENABLE_OPENGL, + SETTING_OPTIMIZE_OPENGL, + SETTING_SAVE_DOCUMENT_WINDOWS, + SETTING_SAVE_DOCUMENT_VIEW_INFO, + SETTING_USE_SYSTEM_FONT, + SETTING_USE_FONT_ANTI_ALIASING, + SETTING_FONT_ANTI_ALIASING_MIN_PIXEL, + SETTING_WARN_CREATE_PDF, + SETTING_WARN_PRINT_DOC, + SETTING_WARN_SAVEORSEND_DOC, + SETTING_WARN_SIGN_DOC, + SETTING_REMOVE_PERSONAL_INFO, + SETTING_RECOMMEND_PASSWORD, + SETTING_UNDO_STEPS, + SETTING_SYMBOL_SET, + SETTING_MACRO_SECURITY_LEVEL, + SETTING_CREATE_BACKUP, + SETTING_WARN_ALIEN_FORMAT, + SETTING_AUTO_SAVE, + SETTING_AUTO_SAVE_INTERVAL, + SETTING_WRITER_DEFAULT_DOC_FORMAT, + SETTING_IMPRESS_DEFAULT_DOC_FORMAT, + SETTING_CALC_DEFAULT_DOC_FORMAT, + +#endif // ENABLE_LOCKDOWN + + SETTINGS_LAST +}; + +struct ConfigurationValue +{ + const ConfigurationSetting nSettingId; + const gchar *GconfItem; + const char *OOoConfItem; + const sal_Bool bNeedsTranslation; + const ConfigurationSetting nDependsOn; +}; + +extern ConfigurationValue const ConfigurationValues[]; + +extern std::size_t const nConfigurationValues; + +com::sun::star::uno::Any getValue(ConfigurationValue const & data); + +} + +#endif diff --git a/shell/source/backends/gconfbe/gconfbackend.cxx b/shell/source/backends/gconfbe/gconfbackend.cxx index 504c3bba9232..cb18559c1b43 100644 --- a/shell/source/backends/gconfbe/gconfbackend.cxx +++ b/shell/source/backends/gconfbe/gconfbackend.cxx @@ -1,1011 +1,215 @@ /************************************************************************* - * - * 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: gconfbackend.cxx,v $ - * $Revision: 1.15 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* $RCSfile: code,v $ +* +* $Revision: 1.4 $ +* +* 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 +* +* for a copy of the LGPLv3 License. +************************************************************************/ -// MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_shell.hxx" +#include "sal/config.h" + +#include + +#include "boost/noncopyable.hpp" +#include "com/sun/star/container/NoSuchElementException.hpp" +#include "com/sun/star/container/XNameAccess.hpp" +#include "com/sun/star/lang/XMultiComponentFactory.hpp" +#include "com/sun/star/lang/XServiceInfo.hpp" +#include "com/sun/star/lang/WrappedTargetException.hpp" +#include "com/sun/star/uno/Any.hxx" +#include "com/sun/star/uno/RuntimeException.hpp" +#include "com/sun/star/uno/Sequence.hxx" +#include "com/sun/star/uno/Type.hxx" +#include "com/sun/star/uno/XCurrentContext.hpp" +#include "com/sun/star/uno/XComponentContext.hpp" +#include "cppu/unotype.hxx" +#include "cppuhelper/factory.hxx" +#include "cppuhelper/implbase2.hxx" +#include "cppuhelper/implementationentry.hxx" +#include "cppuhelper/weak.hxx" +#include "rtl/string.h" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" +#include "uno/current_context.hxx" +#include "uno/lbnames.h" + +#include "gconfaccess.hxx" +#include "orbit.h" + +namespace { + +namespace css = com::sun::star; + +rtl::OUString SAL_CALL getServiceImplementationName() { + return rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.comp.configuration.backend.GconfBackend")); +} -#include "gconfbackend.hxx" -#include "gconflayer.hxx" -#include - -#ifndef INCLUDED_VECTOR -#include -#define INCLUDED_VECTOR -#endif -#include -#include -#include -#include - -#include - -#ifdef ENABLE_LOCKDOWN -// each entry should have an identifying ConfigurationSetting -static const ConfigurationValue SetupConfigurationValuesList[] = -{ - { - SETTING_WRITER_DEFAULT_DOC_FORMAT, - "/apps/openoffice/writer_default_document_format", - "org.openoffice.Setup/Office/Factories/com.sun.star.text.TextDocument/ooSetupFactoryDefaultFilter", - "string", - sal_False, - sal_False, - SETTINGS_LAST - }, - - { - SETTING_IMPRESS_DEFAULT_DOC_FORMAT, - "/apps/openoffice/impress_default_document_format", - "org.openoffice.Setup/Office/Factories/com.sun.star.presentation.PresentationDocument/ooSetupFactoryDefaultFilter", - "string", - sal_False, - sal_False, - SETTINGS_LAST - }, - - { - SETTING_CALC_DEFAULT_DOC_FORMAT, - "/apps/openoffice/calc_default_document_format", - "org.openoffice.Setup/Office/Factories/com.sun.star.sheet.SpreadsheetDocument/ooSetupFactoryDefaultFilter", - "string", - sal_False, - sal_False, - SETTINGS_LAST - }, -}; -#endif // ENABLE_LOCKDOWN - -#ifdef ENABLE_LOCKDOWN -// each entry should have an identifying ConfigurationSetting -static const ConfigurationValue RecoveryConfigurationValuesList[] = -{ - { - SETTING_AUTO_SAVE, - GCONF_AUTO_SAVE_KEY, - "org.openoffice.Office.Recovery/AutoSave/Enabled", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, - - { - SETTING_AUTO_SAVE_INTERVAL, - "/apps/openoffice/auto_save_interval", - "org.openoffice.Office.Recovery/AutoSave/TimeIntervall", - "int", - sal_False, - sal_False, - SETTING_AUTO_SAVE - }, -}; -#endif // ENABLE_LOCKDOWN - -/* - * This should be in a different backend actually, but this has to wait .. - */ - -#ifdef ENABLE_LOCKDOWN -// each entry should have an identifying ConfigurationSetting -static const ConfigurationValue UserProfileConfigurationValuesList[] = -{ - { - SETTING_USER_GIVENNAME, - "/desktop/gnome/url-handlers/mailto/command", // dummy, needed for getTimestamp - "org.openoffice.UserProfile/Data/givenname", - "string", - sal_False, - sal_True, - SETTING_USER_GIVENNAME - }, - - { - SETTING_USER_SURNAME, - "/desktop/gnome/url-handlers/mailto/command", // dummy, needed for getTimestamp - "org.openoffice.UserProfile/Data/sn", - "string", - sal_False, - sal_True, - SETTING_USER_SURNAME - }, -}; -#endif // ENABLE_LOCKDOWN - -// each entry should have an identifying ConfigurationSetting -static const ConfigurationValue VCLConfigurationValuesList[] = -{ - { - SETTING_ENABLE_ACCESSIBILITY, - "/desktop/gnome/interface/accessibility", - "org.openoffice.VCL/Settings/Accessibility/EnableATToolSupport", - "string", - sal_False, - sal_True, - SETTINGS_LAST - }, - -#ifdef ENABLE_LOCKDOWN - - { - SETTING_DISABLE_PRINTING, - "/desktop/gnome/lockdown/disable_printing", - "org.openoffice.VCL/Settings/DesktopManagement/DisablePrinting", - "string", - sal_False, - sal_True, - SETTINGS_LAST - }, - -#endif // ENABLE_LOCKDOWN - -}; - -// each entry should have an identifying ConfigurationSetting -static const ConfigurationValue InetConfigurationValuesList[] = -{ - { - SETTING_PROXY_MODE, - GCONF_PROXY_MODE_KEY, - "org.openoffice.Inet/Settings/ooInetProxyType", - "int", - sal_False, - sal_True, - SETTINGS_LAST - }, - - { - SETTING_PROXY_HTTP_HOST, - "/system/http_proxy/host", - "org.openoffice.Inet/Settings/ooInetHTTPProxyName", - "string", - sal_False, - sal_False, - SETTING_PROXY_MODE - }, - - { - SETTING_PROXY_HTTP_PORT, - "/system/http_proxy/port", - "org.openoffice.Inet/Settings/ooInetHTTPProxyPort", - "int", - sal_False, - sal_False, - SETTING_PROXY_MODE - }, - - { - SETTING_PROXY_HTTPS_HOST, - "/system/proxy/secure_host", - "org.openoffice.Inet/Settings/ooInetHTTPSProxyName", - "string", - sal_False, - sal_False, - SETTING_PROXY_MODE - }, - - { - SETTING_PROXY_HTTPS_PORT, - "/system/proxy/secure_port", - "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort", - "int", - sal_False, - sal_False, - SETTING_PROXY_MODE - }, - - { - SETTING_PROXY_FTP_HOST, - "/system/proxy/ftp_host", - "org.openoffice.Inet/Settings/ooInetFTPProxyName", - "string", - sal_False, - sal_False, - SETTING_PROXY_MODE - }, - - { - SETTING_PROXY_FTP_PORT, - "/system/proxy/ftp_port", - "org.openoffice.Inet/Settings/ooInetFTPProxyPort", - "int", - sal_False, - sal_False, - SETTING_PROXY_MODE - }, - - { - SETTING_NO_PROXY_FOR, - "/system/http_proxy/ignore_hosts", - "org.openoffice.Inet/Settings/ooInetNoProxy", - "string", - sal_False, - sal_True, - SETTING_PROXY_MODE - }, -}; +css::uno::Sequence< rtl::OUString > SAL_CALL getServiceSupportedServiceNames() { + rtl::OUString name( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.backend.GconfBackend")); + return css::uno::Sequence< rtl::OUString >(&name, 1); +} -// each entry should have an identifying ConfigurationSetting -static const ConfigurationValue CommonConfigurationValuesList[] = +class Service: + public cppu::WeakImplHelper2< + css::lang::XServiceInfo, css::container::XNameAccess >, + private boost::noncopyable { - { - SETTING_MAILER_PROGRAM, - "/desktop/gnome/url-handlers/mailto/command", - "org.openoffice.Office.Common/ExternalMailer/Program", - "string", - sal_False, - sal_True, - SETTINGS_LAST - }, - { - SETTING_SOURCEVIEWFONT_NAME, - "/desktop/gnome/interface/monospace_font_name", - "org.openoffice.Office.Common/Font/SourceViewFont/FontName", - "string", - sal_False, - sal_True, - SETTINGS_LAST - }, - { - SETTING_SOURCEVIEWFONT_HEIGHT, - "/desktop/gnome/interface/monospace_font_name", - "org.openoffice.Office.Common/Font/SourceViewFont/FontHeight", - "short", - sal_False, - sal_True, - SETTINGS_LAST - }, - -#ifdef ENABLE_LOCKDOWN - - { - SETTING_USE_SYSTEM_FILE_DIALOG, - "/apps/openoffice/use_system_file_dialog", - "org.openoffice.Office.Common/Misc/UseSystemFileDialog", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, - - { - SETTING_DISABLE_UI_CUSTOMIZATION, - "/apps/openoffice/lockdown/disable_ui_customization", - "org.openoffice.Office.Common/Misc/DisableUICustomization", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, - - { - SETTING_PRINTING_MODIFIES_DOCUMENT, - "/apps/openoffice/printing_modifies_doc", - "org.openoffice.Office.Common/Print/PrintingModifiesDocument", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, - - { - SETTING_SHOW_ICONS_IN_MENUS, - "/apps/openoffice/show_menu_icons", - "org.openoffice.Office.Common/View/Menu/ShowIconsInMenues", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, - - { - SETTING_SHOW_INACTIVE_MENUITEMS, - "/apps/openoffice/show_menu_inactive_items", - "org.openoffice.Office.Common/View/Menu/DontHideDisabledEntry", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, - - { - SETTING_SHOW_FONT_PREVIEW, - "/apps/openoffice/show_font_preview", - "org.openoffice.Office.Common/Font/View/ShowFontBoxWYSIWYG", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, - - { - SETTING_SHOW_FONT_HISTORY, - "/apps/openoffice/show_font_history", - "org.openoffice.Office.Common/Font/View/History", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, - - { - SETTING_ENABLE_OPENGL, - "/apps/openoffice/use_opengl", - "org.openoffice.Office.Common/_3D_Engine/OpenGL", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, - - { - SETTING_OPTIMIZE_OPENGL, - "/apps/openoffice/optimize_opengl", - "org.openoffice.Office.Common/_3D_Engine/OpenGL_Faster", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, - - { - SETTING_USE_SYSTEM_FONT, - "/apps/openoffice/use_system_font", - "org.openoffice.Office.Common/Accessibility/IsSystemFont", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, - - { - SETTING_USE_FONT_ANTI_ALIASING, - "/apps/openoffice/use_font_anti_aliasing", - "org.openoffice.Office.Common/View/FontAntiAliasing/Enabled", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, - - { - SETTING_FONT_ANTI_ALIASING_MIN_PIXEL, - "/apps/openoffice/font_anti_aliasing_min_pixel", - "org.openoffice.Office.Common/View/FontAntiAliasing/MinPixelHeight", - "short", - sal_False, - sal_True, - SETTINGS_LAST - }, +public: + Service(); - { - SETTING_WARN_CREATE_PDF, - "/apps/openoffice/lockdown/warn_info_create_pdf", - "org.openoffice.Office.Common/Security/Scripting/WarnCreatePDF", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, +private: + virtual ~Service() {} - { - SETTING_WARN_PRINT_DOC, - "/apps/openoffice/lockdown/warn_info_printing", - "org.openoffice.Office.Common/Security/Scripting/WarnPrintDoc", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, + virtual rtl::OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException) + { return getServiceImplementationName(); } - { - SETTING_WARN_SAVEORSEND_DOC, - "/apps/openoffice/lockdown/warn_info_saving", - "org.openoffice.Office.Common/Security/Scripting/WarnSaveOrSendDoc", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, + virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName) + throw (css::uno::RuntimeException) + { return ServiceName == getSupportedServiceNames()[0]; } - { - SETTING_WARN_SIGN_DOC, - "/apps/openoffice/lockdown/warn_info_signing", - "org.openoffice.Office.Common/Security/Scripting/WarnSignDoc", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, + virtual css::uno::Sequence< rtl::OUString > SAL_CALL + getSupportedServiceNames() throw (css::uno::RuntimeException) + { return getServiceSupportedServiceNames(); } - { - SETTING_REMOVE_PERSONAL_INFO, - "/apps/openoffice/lockdown/remove_personal_info_on_save", - "org.openoffice.Office.Common/Security/Scripting/RemovePersonalInfoOnSaving", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, + virtual css::uno::Type SAL_CALL getElementType() + throw (css::uno::RuntimeException) + { return cppu::UnoType< cppu::UnoVoidType >::get(); } - { - SETTING_RECOMMEND_PASSWORD, - "/apps/openoffice/lockdown/recommend_password_on_save", - "org.openoffice.Office.Common/Security/Scripting/RecommendPasswordProtection", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, + virtual sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException) + { return true; } - { - SETTING_UNDO_STEPS, - "/apps/openoffice/undo_steps", - "org.openoffice.Office.Common/Undo/Steps", - "int", - sal_False, - sal_False, - SETTINGS_LAST - }, + virtual css::uno::Any SAL_CALL getByName(rtl::OUString const & aName) + throw ( + css::container::NoSuchElementException, + css::lang::WrappedTargetException, css::uno::RuntimeException); - { - SETTING_SYMBOL_SET, - "/apps/openoffice/icon_size", - "org.openoffice.Office.Common/Misc/SymbolSet", - "short", - sal_False, - sal_True, - SETTINGS_LAST - }, + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getElementNames() + throw (css::uno::RuntimeException); - { - SETTING_MACRO_SECURITY_LEVEL, - "/apps/openoffice/lockdown/macro_security_level", - "org.openoffice.Office.Common/Security/Scripting/MacroSecurityLevel", - "int", - sal_False, - sal_False, - SETTINGS_LAST - }, - - { - SETTING_CREATE_BACKUP, - "/apps/openoffice/create_backup", - "org.openoffice.Office.Common/Save/Document/CreateBackup", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, - - { - SETTING_WARN_ALIEN_FORMAT, - "/apps/openoffice/warn_alien_format", - "org.openoffice.Office.Common/Save/Document/WarnAlienFormat", - "boolean", - sal_False, - sal_False, - SETTINGS_LAST - }, - -#endif // ENABLE_LOCKDOWN + virtual sal_Bool SAL_CALL hasByName(rtl::OUString const & aName) + throw (css::uno::RuntimeException); + bool enabled_; }; -static const ConfigurationValue PathsConfigurationValuesList[] = -{ - { - SETTING_WORK_DIRECTORY, - "/desktop/gnome/url-handlers/mailto/command", // dummy, needed for getTimestamp - "org.openoffice.Office.Paths/Variables/Work", - "string", - sal_False, - sal_True, - SETTING_WORK_DIRECTORY, // so that the existence of the dir can be checked - }, -}; - -#ifdef ENABLE_LOCKDOWN -static const char * SetupPreloadValuesList[] = -{ - "/apps/openoffice", - NULL -}; -#endif // ENABLE_LOCKDOWN - -#ifdef ENABLE_LOCKDOWN -static const char * RecoveryPreloadValuesList[] = -{ - "/apps/openoffice", - NULL -}; -#endif // ENABLE_LOCKDOWN - -#ifdef ENABLE_LOCKDOWN -static const char * UserProfilePreloadValuesList[] = -{ - NULL -}; -#endif // ENABLE_LOCKDOWN - -static const char * VCLPreloadValuesList[] = -{ - "/desktop/gnome/interface", -#ifdef ENABLE_LOCKDOWN - "/desktop/gnome/lockdown", -#endif // ENABLE_LOCKDOWN - NULL -}; - -static const char * InetPreloadValuesList[] = -{ - "/system/proxy", - "/system/http_proxy/host", - NULL -}; - -static const char * CommonPreloadValuesList[] = -{ - "/desktop/gnome/url-handlers/mailto", -#ifdef ENABLE_LOCKDOWN - "/apps/openoffice/lockdown", - "/apps/openoffice", -#endif // ENABLE_LOCKDOWN - NULL -}; - -static const char * PathsPreloadValuesList[] = -{ - NULL -}; - -//============================================================================== - -/* -void ONotificationThread::run() -{ - mLoop= NULL; - //Need to start a GMain loop for notifications to work - mLoop=g_main_loop_new(g_main_context_default(),FALSE); - g_main_loop_run(mLoop); -} ; - -*/ - -//------------------------------------------------------------------------------ - -GconfBackend* GconfBackend::mInstance= 0; - -GconfBackend* GconfBackend::createInstance(const uno::Reference& xContext) -{ - if(mInstance == 0) - { - mInstance = new GconfBackend (xContext); +Service::Service(): enabled_(false) { + css::uno::Reference< css::uno::XCurrentContext > context( + css::uno::getCurrentContext()); + if (context.is()) { + rtl::OUString desktop; + context->getValueByName( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("system.desktop-environment"))) >>= + desktop; + enabled_ = desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("GNOME")) && + ((orbit_major_version == 2 && orbit_minor_version >= 8) || + orbit_major_version > 2); + // ORBit-2 versions < 2.8 cause a deadlock with the gtk+ VCL plugin } - - return mInstance; -} - -//------------------------------------------------------------------------------ - -GconfBackend::GconfBackend(const uno::Reference& xContext) - throw (backend::BackendAccessException) - : BackendBase(mMutex), m_xContext(xContext) -// , mNotificationThread(NULL) - - -{ -} - -//------------------------------------------------------------------------------ - -GconfBackend::~GconfBackend(void) { - - -// delete (mNotificationThread); - GconfBackend::mClient = NULL; - } -//------------------------------------------------------------------------------ - -GConfClient* GconfBackend::mClient= 0; - - -GConfClient* GconfBackend::getGconfClient() +css::uno::Any Service::getByName(rtl::OUString const & aName) + throw ( + css::container::NoSuchElementException, + css::lang::WrappedTargetException, css::uno::RuntimeException) { - - if (mClient == NULL) - { - /* initialize glib object type library */ - g_type_init(); - - GError* aError = NULL; - if (!gconf_init(0, NULL, &aError)) - { - rtl::OUStringBuffer msg; - msg.appendAscii("GconfBackend:GconfLayer: Cannot Initialize Gconf connection - " ); - msg.appendAscii(aError->message); - - g_error_free(aError); - aError = NULL; - throw uno::RuntimeException(msg.makeStringAndClear(),NULL); - } - - mClient = gconf_client_get_default(); - if (!mClient) + for (std::size_t i = 0; i < gconfaccess::nConfigurationValues; ++i) { + if (aName.equalsAscii( + gconfaccess::ConfigurationValues[i].OOoConfItem)) { - throw uno::RuntimeException(rtl::OUString::createFromAscii - ("GconfBackend:GconfLayer: Cannot Initialize Gconf connection"),NULL); + return enabled_ + ? gconfaccess::getValue(gconfaccess::ConfigurationValues[i]) + : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); } } - - return mClient; + throw css::container::NoSuchElementException( + aName, static_cast< cppu::OWeakObject * >(this)); } -//------------------------------------------------------------------------------ - -uno::Reference SAL_CALL GconfBackend::getLayer( - const rtl::OUString& aComponent, const rtl::OUString& /*aTimestamp*/) - throw (backend::BackendAccessException, lang::IllegalArgumentException) +css::uno::Sequence< rtl::OUString > Service::getElementNames() + throw (css::uno::RuntimeException) { - uno::Reference xLayer; - - if( aComponent.equalsAscii("org.openoffice.Office.Common" ) ) - { - xLayer = new GconfLayer( m_xContext, - CommonConfigurationValuesList, - G_N_ELEMENTS( CommonConfigurationValuesList ), - CommonPreloadValuesList ); - } - else if( aComponent.equalsAscii("org.openoffice.Inet" ) ) - { - xLayer = new GconfLayer( m_xContext, - InetConfigurationValuesList, - G_N_ELEMENTS( InetConfigurationValuesList ), - InetPreloadValuesList ); - } - else if( aComponent.equalsAscii("org.openoffice.VCL" ) ) - { - xLayer = new GconfLayer( m_xContext, - VCLConfigurationValuesList, - G_N_ELEMENTS( VCLConfigurationValuesList ), - VCLPreloadValuesList ); - } - else if( aComponent.equalsAscii("org.openoffice.Office.Paths" ) ) - { - xLayer = new GconfLayer( m_xContext, - PathsConfigurationValuesList, - G_N_ELEMENTS( PathsConfigurationValuesList ), - PathsPreloadValuesList ); + css::uno::Sequence< rtl::OUString > names( + gconfaccess::nConfigurationValues); + for (std::size_t i = 0; i < gconfaccess::nConfigurationValues; ++i) { + names[i] = rtl::OUString::createFromAscii( + gconfaccess::ConfigurationValues[i].OOoConfItem); } - -#ifdef ENABLE_LOCKDOWN - else if( aComponent.equalsAscii("org.openoffice.UserProfile" ) ) - { - xLayer = new GconfLayer( m_xContext, - UserProfileConfigurationValuesList, - G_N_ELEMENTS( UserProfileConfigurationValuesList ), - UserProfilePreloadValuesList ); - } - else if( aComponent.equalsAscii("org.openoffice.Office.Recovery" ) ) - { - xLayer = new GconfLayer( m_xContext, - RecoveryConfigurationValuesList, - G_N_ELEMENTS( RecoveryConfigurationValuesList ), - RecoveryPreloadValuesList ); - } - else if( aComponent.equalsAscii("org.openoffice.Setup" ) ) - { - xLayer = new GconfLayer( m_xContext, - SetupConfigurationValuesList, - G_N_ELEMENTS( SetupConfigurationValuesList ), - SetupPreloadValuesList ); - } -#endif // ENABLE_LOCKDOWN - - return xLayer; -} - -//------------------------------------------------------------------------------ - -uno::Reference SAL_CALL -GconfBackend::getUpdatableLayer(const rtl::OUString& /*aComponent*/) - throw (backend::BackendAccessException,lang::NoSupportException, - lang::IllegalArgumentException) -{ - throw lang::NoSupportException( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("GconfBackend: No Update Operation allowed, Read Only access") ), - *this) ; + return names; } -//------------------------------------------------------------------------------ - -// currently not used -#if 0 -static void -keyChangedCallback(GConfClient* aClient, - guint aID, - GConfEntry* aEntry, - gpointer aBackend) +sal_Bool Service::hasByName(rtl::OUString const & aName) + throw (css::uno::RuntimeException) { - - OSL_TRACE("In KeyChangedCallback Function"); - rtl::OUString aGconfKey= rtl::OUString::createFromAscii(aEntry->key); - GconfBackend * aGconfBe = (GconfBackend*) aBackend; - - aGconfBe->notifyListeners(aGconfKey); - -} -#endif - -//------------------------------------------------------------------------------ - -void GconfBackend::notifyListeners(const rtl::OUString& /*aGconfKey*/) -{ -/* - //look up associated component from Map using GconfKey - KeyMappingTable::iterator aIter; - rtl::OUString aComponent; - for( aIter= mKeyMap.begin(); aIter != mKeyMap.end(); aIter++) - { - if (aIter->second.mGconfName == aGconfKey) + for (std::size_t i = 0; i < gconfaccess::nConfigurationValues; ++i) { + if (aName.equalsAscii( + gconfaccess::ConfigurationValues[i].OOoConfItem)) { - aComponent = aIter->first; - break; + return true; } - - } - - - //Need to store updated layer TimeStamp as Gconf library - //has no access to TimeStamp via its api - TimeValue aTimeValue ={0,0} ; - osl_getSystemTime(&aTimeValue); - - oslDateTime aLayerTS; - rtl::OUString aTimeStamp; - - if (osl_getDateTimeFromTimeValue(&aTimeValue, &aLayerTS)) { - sal_Char asciiStamp [20] ; - - sprintf(asciiStamp, "%04d%02d%02d%02d%02d%02dZ", - aLayerTS.Year, aLayerTS.Month, aLayerTS.Day, - aLayerTS.Hours, aLayerTS.Minutes, aLayerTS.Seconds) ; - aTimeStamp = rtl::OUString::createFromAscii(asciiStamp) ; - } - - - TSMappingTable::iterator aTSIter; - aTSIter = mTSMap.find(aComponent); - if (aTSIter == mTSMap.end()) - { - mTSMap.insert(TSMappingTable::value_type(aComponent,aTimeStamp)); - } - else - { - aTSIter->second = aTimeStamp; - } - typedef ListenerList::iterator LLIter; - typedef std::pair BFRange; - BFRange aRange = mListenerList.equal_range(aComponent); - while (aRange.first != aRange.second) - { - LLIter cur = aRange.first++; - backend::ComponentChangeEvent aEvent; - aEvent.Component = aComponent; - aEvent.Source = *this; - cur->second->componentDataChanged(aEvent); - - } -*/ + return false; } - -//------------------------------------------------------------------------------ -void SAL_CALL GconfBackend::addChangesListener( - const uno::Reference& xListener, - const rtl::OUString& aComponent) - throw (::com::sun::star::uno::RuntimeException) -{ -/* - osl::MutexGuard aGuard(mMutex); - - GConfClient* aClient = getGconfClient(); - - ListenerList::iterator aIter; - aIter = mListenerList.find(aComponent); - if (aIter == mListenerList.end()) - { - typedef KeyMappingTable::iterator KMTIter; - typedef std::pair BFRange; - - BFRange aRange = mKeyMap.equal_range(aComponent); - - while (aRange.first != aRange.second) - { - KMTIter cur = aRange.first++; - - sal_Int32 nIndex = cur->second.mGconfName.lastIndexOf('/'); - rtl::OUString aDirectory = cur->second.mGconfName.copy(0, nIndex); - rtl::OString aDirectoryStr= rtl::OUStringToOString(aDirectory, RTL_TEXTENCODING_ASCII_US); - GError* aError = NULL; - gconf_client_add_dir(aClient, - aDirectoryStr.getStr(), - GCONF_CLIENT_PRELOAD_NONE, - &aError); - - if(aError != NULL) - { - OSL_TRACE("GconfBackend:: Cannot register listener for Component %s", - rtl::OUStringToOString(aComponent, RTL_TEXTENCODING_ASCII_US).getStr() ); - } - - rtl::OString aKey = rtl::OUStringToOString(cur->second.mGconfName, - RTL_TEXTENCODING_ASCII_US); - - GConfClientNotifyFunc aNotifyFunc = &keyChangedCallback; - sal_uInt32 aID = gconf_client_notify_add( - aClient, - aKey.getStr(), - aNotifyFunc, - this, - NULL, - &aError); - if(aError != NULL) - { - OSL_TRACE("GconfBackend:: Cannot register listener for Component %s", - rtl::OUStringToOString(aComponent, RTL_TEXTENCODING_ASCII_US).getStr() ); - } - - - - } - - } -*/ - -/* - if (mNotificationThread == NULL) - { - - mNotificationThread = new ONotificationThread(); - - if ( mNotificationThread == NULL) - { - OSL_ENSURE(false,"Could not start Notification Thread "); - } - else - { - mNotificationThread->create(); - } - } -*/ - //Store listener in list - mListenerList.insert(ListenerList::value_type(aComponent, xListener)); - - -} -//------------------------------------------------------------------------------ -void SAL_CALL GconfBackend::removeChangesListener( - const uno::Reference& /*xListener*/, - const rtl::OUString& /*aComponent*/) - throw (::com::sun::star::uno::RuntimeException) +css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( + css::uno::Reference< css::uno::XComponentContext > const &) { -/* - osl::MutexGuard aGuard(mMutex); - GConfClient* aClient = GconfBackend::getGconfClient(); - ListenerList::iterator aIter; - aIter = mListenerList.find(aComponent); - if (aIter == mListenerList.end()) - { - - OSL_TRACE("GconfBackend:: Cannot deregister listener for Component %s - Listner not registered", - rtl::OUStringToOString(aComponent, RTL_TEXTENCODING_ASCII_US).getStr() ); - - typedef KeyMappingTable::iterator KMTIter; - typedef std::pair BFRange; - - BFRange aRange = mKeyMap.equal_range(aComponent); - - while (aRange.first != aRange.second) - { - KMTIter cur = aRange.first++; - - sal_Int32 nIndex = cur->second.mGconfName.lastIndexOf('/'); - rtl::OUString aDirectory = cur->second.mGconfName.copy(0, nIndex); - rtl::OString aDirectoryStr= rtl::OUStringToOString(aDirectory, RTL_TEXTENCODING_ASCII_US); - GError* aError = NULL; - gconf_client_remove_dir(aClient, - aDirectoryStr.getStr(), - &aError); - - if(aError != NULL) - { - OSL_TRACE("GconfBackend:: Cannot deRegister listener for Component %s", - rtl::OUStringToOString(aComponent, RTL_TEXTENCODING_ASCII_US).getStr() ); - } - } - } -*/ -} - -//------------------------------------------------------------------------------ - -rtl::OUString SAL_CALL GconfBackend::getBackendName(void) { - return rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.GconfBackend") ); + return static_cast< cppu::OWeakObject * >(new Service); } -//------------------------------------------------------------------------------ +static cppu::ImplementationEntry const services[] = { + { &createInstance, &getServiceImplementationName, + &getServiceSupportedServiceNames, &cppu::createSingleComponentFactory, 0, + 0 }, + { 0, 0, 0, 0, 0, 0 } +}; -rtl::OUString SAL_CALL GconfBackend::getImplementationName(void) - throw (uno::RuntimeException) -{ - return getBackendName() ; } -//------------------------------------------------------------------------------ - -uno::Sequence SAL_CALL GconfBackend::getBackendServiceNames(void) +extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( + char const * pImplName, void * pServiceManager, void * pRegistryKey) { - uno::Sequence aServices(1) ; - aServices[0] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.GconfBackend")) ; - - return aServices ; + return cppu::component_getFactoryHelper( + pImplName, pServiceManager, pRegistryKey, services); } -//------------------------------------------------------------------------------ - -sal_Bool SAL_CALL GconfBackend::supportsService(const rtl::OUString& aServiceName) - throw (uno::RuntimeException) +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL +component_getImplementationEnvironment( + char const ** ppEnvTypeName, uno_Environment **) { - uno::Sequence< rtl::OUString > const svc = getBackendServiceNames(); - - for(sal_Int32 i = 0; i < svc.getLength(); ++i ) - if(svc[i] == aServiceName) - return true; - - return false; + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//------------------------------------------------------------------------------ - -uno::Sequence -SAL_CALL GconfBackend::getSupportedServiceNames(void) - throw (uno::RuntimeException) +extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( + void * pServiceManager, void * pRegistryKey) { - return getBackendServiceNames() ; + return component_writeInfoHelper(pServiceManager, pRegistryKey, services); } - -// --------------------------------------------------------------------------------------- - - diff --git a/shell/source/backends/gconfbe/gconfbackend.hxx b/shell/source/backends/gconfbe/gconfbackend.hxx deleted file mode 100644 index 721586a80186..000000000000 --- a/shell/source/backends/gconfbe/gconfbackend.hxx +++ /dev/null @@ -1,225 +0,0 @@ -/************************************************************************* - * - * 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: gconfbackend.hxx,v $ - * $Revision: 1.8 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef GCONFBACKEND_HXX_ -#define GCONFBACKEND_HXX_ - -#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XSCHEMASUPPLIER_HPP_ -#include -#endif -#include -#include -#include - -//#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ -//#include -//#endif // _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ -#include -#include -#include -#include - -#ifndef INCLUDED_MAP -#include -#define INCLUDED_MAP -#endif -//#ifndef _VOS_THREAD_HXX_ -//#include -//#endif - -#include - - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; - - -/** Structure containing the mapping between OOffice and Gconf keys. - AlOO specifies whether the key is protected, if key is protected it - can not be over riden in subsequent higher layers -*/ -struct keyMapping -{ - keyMapping(){}; - rtl::OUString mOOName; - rtl::OUString mOOType; - rtl::OUString mGconfName; - sal_Bool mbProtected; -}; - -typedef keyMapping KeyMappingInfo; -typedef std::multimap KeyMappingTable; - -/*Time Stamp mapping table used to store timestamps of updated components - when a notification is recieved. It is needed as you cannot access gconf key - timestamps via the Gconf api */ - -typedef std::multimap TSMappingTable; - -//------------------------------------------------------------------------------ - -/* -class ONotificationThread: public vos::OThread -{ - - -public: - ONotificationThread() - {} - - ~ONotificationThread() - { - g_main_loop_quit(mLoop); - } - -private: - virtual void SAL_CALL onTerminated() - { - delete this; - } - - virtual void SAL_CALL run(); - GMainLoop* mLoop; -}; - -*/ - -//------------------------------------------------------------------------------ -typedef cppu::WeakComponentImplHelper3 BackendBase ; - -/** - Implements the SingleLayerStratum service for gconf access. - */ -class GconfBackend : public BackendBase { - public : - - static GconfBackend* createInstance(const uno::Reference& xContext); - - // XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName( ) - throw (uno::RuntimeException) ; - - virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& aServiceName ) - throw (uno::RuntimeException) ; - - virtual uno::Sequence SAL_CALL getSupportedServiceNames( ) - throw (uno::RuntimeException) ; - - /** - Provides the implementation name. - - @return implementation name - */ - static rtl::OUString SAL_CALL getBackendName(void) ; - - /** - Provides the supported services names - - @return service names - */ - static uno::Sequence SAL_CALL getBackendServiceNames(void) ; - - /* returns a GconfClient */ - static GConfClient* getGconfClient(); - - //XSingleLayerStratum - virtual uno::Reference SAL_CALL - getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp ) - throw (backend::BackendAccessException, lang::IllegalArgumentException) ; - - virtual uno::Reference SAL_CALL - getUpdatableLayer( const rtl::OUString& aLayerId ) - throw (backend::BackendAccessException, lang::NoSupportException, - lang::IllegalArgumentException) ; - - // XBackendChangesNotifier - virtual void SAL_CALL addChangesListener( - const uno::Reference& xListener, - const rtl::OUString& aComponent) - throw (::com::sun::star::uno::RuntimeException); - - - virtual void SAL_CALL removeChangesListener( - const uno::Reference& xListener, - const rtl::OUString& aComponent) - throw (::com::sun::star::uno::RuntimeException); - - //Notify all listener of component change - void notifyListeners(const rtl::OUString& aGconfKey); - - protected: - /** - Service constructor from a service factory. - - @param xContext component context - */ - GconfBackend(const uno::Reference& xContext) - throw (backend::BackendAccessException); - - /** Destructor */ - ~GconfBackend(void) ; - - private: - - typedef uno::Reference ListenerRef; - typedef std::multimap ListenerList; - - /** Build Gconf/OO mapping table */ - void initializeMappingTable (); - - - /** The component context */ - uno::Reference m_xContext; - - /** Mutex for reOOurces protection */ - osl::Mutex mMutex ; - - KeyMappingTable mKeyMap; - - /** List of component TimeStamps */ - TSMappingTable mTSMap; - - static GconfBackend* mInstance; - - /** List of listener */ - ListenerList mListenerList; - - /**Connection to Gconf */ - static GConfClient* mClient; - -// ONotificationThread* mNotificationThread; -} ; - - -#endif // CONFIGMGR_LOCALBE_LOCALSINGLESTRATUM_HXX_ diff --git a/shell/source/backends/gconfbe/gconfbe.xml b/shell/source/backends/gconfbe/gconfbe.xml deleted file mode 100644 index 55eea1c1f6c9..000000000000 --- a/shell/source/backends/gconfbe/gconfbe.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - gconfbe - - Oliver Braun - com.sun.star.comp.configuration.backend.GconfBackend - The - com.sun.star.loader.SharedLibrary - c++ - - com.sun.star.comp.configuration.backend.GconfBackend - ... - com.sun.star.configuration.backend.XBackendChangesListener - com.sun.star.configuration.backend.XBackendChangesNotifier - com.sun.star.configuration.backend.XLayerHandler - com.sun.star.configuration.backend.XSingleLayerStratum - com.sun.star.lang.XMultiComponentFactory - com.sun.star.lang.XServiceInfo - com.sun.star.lang.XSingleComponentFactory - com.sun.star.lang.XTypeProvider - com.sun.star.uno.TypeClass - com.sun.star.uno.XAggregation - com.sun.star.uno.XComponentContext - com.sun.star.uno.XCurrentContext - com.sun.star.uno.XWeak - com.sun.star.registry.XRegistryKey - - cppuhelper - cppu - sal - cppuhelper3$(COM) - cppu3 - sal3 - diff --git a/shell/source/backends/gconfbe/gconfbecdef.cxx b/shell/source/backends/gconfbe/gconfbecdef.cxx deleted file mode 100644 index ed20759faa7e..000000000000 --- a/shell/source/backends/gconfbe/gconfbecdef.cxx +++ /dev/null @@ -1,151 +0,0 @@ -/************************************************************************* - * - * 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: gconfbecdef.cxx,v $ - * $Revision: 1.11 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" -#include "gconfbackend.hxx" -#include - -#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_ -#include -#endif // _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_ -#include -#include - -#include "uno/current_context.hxx" -#include -#include "orbit.h" - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; - -//============================================================================== - -static uno::Reference SAL_CALL createGconfBackend(const uno::Reference& xContext) -{ - try { - uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext()); - - if (xCurrentContext.is()) - { - uno::Any aValue = xCurrentContext->getValueByName( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "system.desktop-environment" ) ) ); - - rtl::OUString aDesktopEnvironment; - if ( (aValue >>= aDesktopEnvironment) && (aDesktopEnvironment.equalsAscii("GNOME")) ) - { - // ORBit-2 versions < 2.8 cause a deadlock with the gtk+ VCL plugin - if ( (orbit_major_version >= 2) && (orbit_minor_version >= 8) ) - { - return * GconfBackend::createInstance(xContext); - } - } - } - - return uno::Reference(); - - } catch (uno::RuntimeException e) { - return uno::Reference(); - } - -} - -//============================================================================== - -static const cppu::ImplementationEntry kImplementations_entries[] = -{ - { - createGconfBackend, - GconfBackend::getBackendName, - GconfBackend::getBackendServiceNames, - cppu::createSingleComponentFactory, - NULL, - 0 - }, - { NULL, NULL, NULL, NULL, NULL, 0 } -} ; -//------------------------------------------------------------------------------ - -extern "C" void SAL_CALL component_getImplementationEnvironment( - const sal_Char **aEnvTypeName, - uno_Environment **/*aEnvironment*/) { - *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; -} - -//------------------------------------------------------------------------------ - -extern "C" sal_Bool SAL_CALL component_writeInfo(void */*pServiceManager*/, - void *pRegistryKey) { - - using namespace ::com::sun::star::registry; - if (pRegistryKey) - { - try - { - uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + GconfBackend::getBackendName() - ); - - // Register associated service names - uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") ) - ); - - uno::Sequence sServiceNames = GconfBackend::getBackendServiceNames(); - for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i) - xServicesKey->createKey(sServiceNames[i]); - - return sal_True; - } - - catch( InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "InvalidRegistryException caught"); - } - } - - return sal_False; -} - -//------------------------------------------------------------------------------ - -extern "C" void *component_getFactory(const sal_Char *aImplementationName, - void *aServiceManager, - void *aRegistryKey) { - - return cppu::component_getFactoryHelper( - aImplementationName, - aServiceManager, - aRegistryKey, - kImplementations_entries) ; -} -//------------------------------------------------------------------------------ diff --git a/shell/source/backends/gconfbe/gconflayer.cxx b/shell/source/backends/gconfbe/gconflayer.cxx deleted file mode 100644 index 9d7ac2e8e47b..000000000000 --- a/shell/source/backends/gconfbe/gconflayer.cxx +++ /dev/null @@ -1,564 +0,0 @@ -/************************************************************************* - * - * 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: gconflayer.cxx,v $ - * $Revision: 1.15 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" -#include "gconflayer.hxx" -#include - -#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_ -#include -#endif -#include -#include -#include -#include -#include -#include - -#include - -using namespace rtl; - -//============================================================================== - -GconfLayer::GconfLayer( const uno::Reference& xContext, - const ConfigurationValue pConfigurationValuesList[], - const sal_Int32 nConfigurationValues, - const char * pPreloadValuesList[] ) - :m_pConfigurationValuesList( pConfigurationValuesList ) - ,m_nConfigurationValues( nConfigurationValues ) - ,m_pPreloadValuesList( pPreloadValuesList ) -{ - //Create instance of LayerContentDescriber Service - rtl::OUString const k_sLayerDescriberService( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.configuration.backend.LayerDescriber" ) ); - - typedef uno::Reference LayerDescriber; - uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); - if( xServiceManager.is() ) - { - m_xLayerContentDescriber = LayerDescriber::query( - xServiceManager->createInstanceWithContext( k_sLayerDescriberService, xContext ) ); - } - else - { - OSL_TRACE( "Could not retrieve ServiceManager" ); - } -} - -//------------------------------------------------------------------------------ - -static OUString xdg_user_dir_lookup (const char *type) -{ - char *config_home; - char *p; - int relative; - bool bError = false; - - osl::Security aSecurity; - oslFileHandle handle; - OUString aHomeDirURL; - OUString aDocumentsDirURL; - OUString aConfigFileURL; - OUStringBuffer aUserDirBuf; - - if (!aSecurity.getHomeDir( aHomeDirURL ) ) - { - osl::FileBase::getFileURLFromSystemPath(rtl::OUString::createFromAscii("/tmp"), aDocumentsDirURL); - return aDocumentsDirURL; - } - - config_home = getenv ("XDG_CONFIG_HOME"); - if (config_home == NULL || config_home[0] == 0) - { - aConfigFileURL = OUString(aHomeDirURL); - aConfigFileURL += OUString::createFromAscii( "/.config/user-dirs.dirs" ); - } - else - { - aConfigFileURL = OUString::createFromAscii(config_home); - aConfigFileURL += OUString::createFromAscii( "/user-dirs.dirs" ); - } - - if(osl_File_E_None == osl_openFile(aConfigFileURL.pData, &handle, osl_File_OpenFlag_Read)) - { - rtl::ByteSequence seq; - while (osl_File_E_None == osl_readLine(handle , (sal_Sequence **)&seq)) - { - /* Remove newline at end */ - int len = seq.getLength(); - if(len>0 && seq[len-1] == '\n') - seq[len-1] = 0; - - p = (char *)seq.getArray(); - - while (*p == ' ' || *p == '\t') - p++; - - if (strncmp (p, "XDG_", 4) != 0) - continue; - p += 4; - if (strncmp (p, type, strlen (type)) != 0) - continue; - p += strlen (type); - if (strncmp (p, "_DIR", 4) != 0) - continue; - p += 4; - - while (*p == ' ' || *p == '\t') - p++; - - if (*p != '=') - continue; - p++; - - while (*p == ' ' || *p == '\t') - p++; - - if (*p != '"') - continue; - p++; - - relative = 0; - if (strncmp (p, "$HOME/", 6) == 0) - { - p += 6; - relative = 1; - } - else if (*p != '/') - continue; - - if (relative) - { - aUserDirBuf = OUStringBuffer(aHomeDirURL); - aUserDirBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "/" ) ); - } - else - { - aUserDirBuf = OUStringBuffer(); - } - - while (*p && *p != '"') - { - if ((*p == '\\') && (*(p+1) != 0)) - p++; - aUserDirBuf.append((sal_Unicode)*p++); - } - } - osl_closeFile(handle); - } - else - bError = true; - - if (aUserDirBuf.getLength()>0 && !bError) - { - aDocumentsDirURL = aUserDirBuf.makeStringAndClear(); - osl::Directory aDocumentsDir( aDocumentsDirURL ); - if( osl::FileBase::E_None == aDocumentsDir.open() ) - return aDocumentsDirURL; - } - - /* Special case desktop for historical compatibility */ - if (strcmp (type, "DESKTOP") == 0) - { - aUserDirBuf = OUStringBuffer(aHomeDirURL); - aUserDirBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "/Desktop" ) ); - return aUserDirBuf.makeStringAndClear(); - } - else - { - aUserDirBuf = OUStringBuffer(aHomeDirURL); - aUserDirBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "/Documents" ) ); - return aUserDirBuf.makeStringAndClear(); - } -} - -//------------------------------------------------------------------------------ - -uno::Any makeAnyOfGconfValue( GConfValue *aGconfValue ) -{ - switch( aGconfValue->type ) - { - case GCONF_VALUE_BOOL: - return uno::makeAny( (sal_Bool) gconf_value_get_bool( aGconfValue ) ); - - case GCONF_VALUE_INT: - return uno::makeAny( (sal_Int32) gconf_value_get_int( aGconfValue ) ); - - case GCONF_VALUE_STRING: - return uno::makeAny( OStringToOUString( rtl::OString( - gconf_value_get_string(aGconfValue) ), RTL_TEXTENCODING_UTF8 ) ); - - default: - fprintf( stderr, "makeAnyOfGconfValue: Type not handled.\n" ); - break; - } - - return uno::Any(); -} - -//------------------------------------------------------------------------------ - -static void splitFontName( GConfValue *aGconfValue, rtl::OUString &rName, sal_Int16 &rHeight) -{ - rtl::OString aFont( gconf_value_get_string( aGconfValue ) ); - aFont.trim(); - sal_Int32 nIdx = aFont.lastIndexOf( ' ' ); - if (nIdx < 1) { // urk - rHeight = 12; - nIdx = aFont.getLength(); - } else { - rtl::OString aSize = aFont.copy( nIdx + 1 ); - rHeight = static_cast( aSize.toInt32() ); - } - - rName = rtl::OStringToOUString( aFont.copy( 0, nIdx ), RTL_TEXTENCODING_UTF8 ); -} - -//------------------------------------------------------------------------------ - -uno::Any translateToOOo( const ConfigurationValue aValue, GConfValue *aGconfValue ) -{ - - switch( aValue.nSettingId ) - { - case SETTING_PROXY_MODE: - { - rtl::OUString aProxyMode; - uno::Any aOriginalValue = makeAnyOfGconfValue( aGconfValue ); - aOriginalValue >>= aProxyMode; - - if( aProxyMode.equals( rtl::OUString::createFromAscii( "manual" ) ) ) - return uno::makeAny( (sal_Int32) 1 ); - else if( aProxyMode.equals( rtl::OUString::createFromAscii( "none" ) ) ) - return uno::makeAny( (sal_Int32) 0 ); - } - break; - - case SETTING_NO_PROXY_FOR: - { - rtl::OStringBuffer aBuffer; - if( (GCONF_VALUE_LIST == aGconfValue->type) && (GCONF_VALUE_STRING == gconf_value_get_list_type(aGconfValue)) ) - { - GSList * list = gconf_value_get_list(aGconfValue); - for(; list; list = g_slist_next(list)) - { - aBuffer.append(gconf_value_get_string((GConfValue *) list->data)); - aBuffer.append(";"); - } - // Remove trailing ";" - aBuffer.setLength(aBuffer.getLength()-1); - return uno::makeAny(rtl::OStringToOUString(aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); - } - else - g_warning( "unexpected type for ignore_hosts" ); - } - break; - - case SETTING_MAILER_PROGRAM: - { - rtl::OUString aMailer; - uno::Any aOriginalValue = makeAnyOfGconfValue( aGconfValue ); - aOriginalValue >>= aMailer; - sal_Int32 nIndex = 0; - return uno::makeAny( aMailer.getToken( 0, ' ', nIndex ) ); - } - -#ifdef ENABLE_LOCKDOWN - // "short" values need to be returned a sal_Int16 - case SETTING_FONT_ANTI_ALIASING_MIN_PIXEL: - case SETTING_SYMBOL_SET: - { - sal_Int32 nShortValue; - uno::Any aOriginalValue = makeAnyOfGconfValue( aGconfValue ); - aOriginalValue >>= nShortValue; - return uno::makeAny( (sal_Int16) nShortValue ); - } - break; -#endif // ENABLE_LOCKDOWN - - // "boolean" values that need a string to be returned - case SETTING_ENABLE_ACCESSIBILITY: -#ifdef ENABLE_LOCKDOWN - case SETTING_DISABLE_PRINTING: -#endif // ENABLE_LOCKDOWN - { - sal_Bool bBooleanValue = false; - uno::Any aOriginalValue = makeAnyOfGconfValue( aGconfValue ); - aOriginalValue >>= bBooleanValue; - return uno::makeAny( rtl::OUString::valueOf( (sal_Bool) bBooleanValue ) ); - } - - case SETTING_WORK_DIRECTORY: - { - rtl::OUString aDocumentsDirURL = xdg_user_dir_lookup("DOCUMENTS"); - - return uno::makeAny( aDocumentsDirURL ); - } - - case SETTING_USER_GIVENNAME: - { - rtl::OUString aCompleteName( rtl::OStringToOUString( - g_get_real_name(), osl_getThreadTextEncoding() ) ); - sal_Int32 nIndex = 0; - rtl::OUString aGivenName; - do - aGivenName = aCompleteName.getToken( 0, ' ', nIndex ); - while ( nIndex == 0 ); - - return uno::makeAny( aGivenName ); - - } - - case SETTING_USER_SURNAME: - { - rtl::OUString aCompleteName( rtl::OStringToOUString( - g_get_real_name(), osl_getThreadTextEncoding() ) ); - sal_Int32 nIndex = 0; - rtl::OUString aSurname; - do - aSurname = aCompleteName.getToken( 0, ' ', nIndex ); - while ( nIndex >= 0 ); - - return uno::makeAny( aSurname ); - } - - case SETTING_SOURCEVIEWFONT_NAME: - case SETTING_SOURCEVIEWFONT_HEIGHT: - { - rtl::OUString aName; - sal_Int16 nHeight; - - splitFontName (aGconfValue, aName, nHeight); - if (aValue.nSettingId == SETTING_SOURCEVIEWFONT_NAME) - return uno::makeAny( aName ); - else - return uno::makeAny( nHeight ); - } - - - default: - fprintf( stderr, "Unhandled setting to translate.\n" ); - break; - } - - return uno::Any(); -} - -//------------------------------------------------------------------------------ - -sal_Bool SAL_CALL isDependencySatisfied( const ConfigurationValue aValue ) -{ - switch( aValue.nDependsOn ) - { - case SETTING_PROXY_MODE: - { - GConfClient* aClient = GconfBackend::getGconfClient(); - GConfValue* aGconfValue = gconf_client_get( aClient, GCONF_PROXY_MODE_KEY, NULL ); - - if ( aGconfValue != NULL ) - { - bool bOk = g_strcasecmp( "manual", gconf_value_get_string( aGconfValue ) ) == 0; - gconf_value_free( aGconfValue ); - if (bOk) return sal_True; - } - } - break; - - case SETTING_WORK_DIRECTORY: - { - rtl::OUString aDocumentsDirURL = xdg_user_dir_lookup("DOCUMENTS"); - osl::Directory aDocumentsDir( aDocumentsDirURL ); - - if( osl::FileBase::E_None == aDocumentsDir.open() ) - return sal_True; - } - break; - - case SETTING_USER_GIVENNAME: - { - rtl::OUString aCompleteName( rtl::OStringToOUString( - g_get_real_name(), osl_getThreadTextEncoding() ) ); - if( !aCompleteName.equalsAscii( "Unknown" ) ) - return sal_True; - } - break; - - case SETTING_USER_SURNAME: - { - rtl::OUString aCompleteName( rtl::OStringToOUString( - g_get_real_name(), osl_getThreadTextEncoding() ) ); - if( !aCompleteName.equalsAscii( "Unknown" ) ) - { - if( aCompleteName.trim().indexOf(rtl::OUString::createFromAscii(" "), 0) != -1 ) - return sal_True; - } - } - break; - -#ifdef ENABLE_LOCKDOWN - case SETTING_AUTO_SAVE: - { - GConfClient* aClient = GconfBackend::getGconfClient(); - GConfValue* aGconfValue = gconf_client_get( aClient, GCONF_AUTO_SAVE_KEY, NULL ); - - if( ( aGconfValue != NULL ) ) - { - bool bOk = gconf_value_get_bool( aGconfValue ); - gconf_value_free( aGconfValue ); - if (bOk) return sal_True; - } - } - break; -#endif // ENABLE_LOCKDOWN - - default: - fprintf( stderr, "Unhandled setting to check dependency.\n" ); - break; - } - - return sal_False; -} - -//------------------------------------------------------------------------------ - -void SAL_CALL GconfLayer::readData( const uno::Reference& xHandler ) - throw ( backend::MalformedDataException, lang::NullPointerException, - lang::WrappedTargetException, uno::RuntimeException ) -{ - if( ! m_xLayerContentDescriber.is() ) - { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service" - ) ), static_cast < backend::XLayer * > (this) ); - } - - uno::Sequence aPropInfoList( m_nConfigurationValues ); - sal_Int32 nProperties = 0; - - GConfClient* aClient = GconfBackend::getGconfClient(); - GConfValue* aGconfValue; - int i = 0; - - while( m_pPreloadValuesList[i] != NULL ) - gconf_client_preload( aClient, m_pPreloadValuesList[i++], GCONF_CLIENT_PRELOAD_ONELEVEL, NULL ); - - for( i = 0; i < m_nConfigurationValues; i++ ) - { - if( ( m_pConfigurationValuesList[i].nDependsOn != SETTINGS_LAST ) && !isDependencySatisfied( m_pConfigurationValuesList[i] ) ) - continue; - - aGconfValue = gconf_client_get( aClient, m_pConfigurationValuesList[i].GconfItem, NULL ); - - if( aGconfValue != NULL ) - { - aPropInfoList[nProperties].Name = rtl::OUString::createFromAscii( m_pConfigurationValuesList[i].OOoConfItem ); - aPropInfoList[nProperties].Type = rtl::OUString::createFromAscii( m_pConfigurationValuesList[i].OOoConfValueType ); - aPropInfoList[nProperties].Protected = m_pConfigurationValuesList[i].bLocked; - - if( m_pConfigurationValuesList[i].bNeedsTranslation ) - aPropInfoList[nProperties].Value = translateToOOo( m_pConfigurationValuesList[i], aGconfValue ); - else - aPropInfoList[nProperties].Value = makeAnyOfGconfValue( aGconfValue ); - - gconf_value_free( aGconfValue ); - - nProperties++; - } - } - - if( nProperties > 0 ) - { - aPropInfoList.realloc( nProperties ); - m_xLayerContentDescriber->describeLayer( xHandler, aPropInfoList ); - } -} - -//------------------------------------------------------------------------------ - -rtl::OUString SAL_CALL GconfLayer::getTimestamp( void ) - throw (uno::RuntimeException) -{ - // Return a hash of the values as timestamp to avoid regenerating - // the binary cache on each office launch. - rtl::OStringBuffer aTimeStamp; - - // Make sure the timestamp differs from beta - sal_Int32 nHashCode = 0; - - GConfClient* aClient = GconfBackend::getGconfClient(); - GConfValue* aGconfValue; - int i = 0; - - while( m_pPreloadValuesList[i] != NULL ) - gconf_client_preload( aClient, m_pPreloadValuesList[i++], GCONF_CLIENT_PRELOAD_ONELEVEL, NULL ); - - for( i = 0; i < m_nConfigurationValues; i++ ) - { - aGconfValue = gconf_client_get( aClient, m_pConfigurationValuesList[i].GconfItem, NULL ); - - if( aGconfValue != NULL ) - { - switch( aGconfValue->type ) - { - case GCONF_VALUE_BOOL: - nHashCode ^= (sal_Int32) !gconf_value_get_bool( aGconfValue ); - break; - - case GCONF_VALUE_INT: - nHashCode ^= (sal_Int32) gconf_value_get_int( aGconfValue ); - break; - - case GCONF_VALUE_STRING: - nHashCode ^= (sal_Int32) g_str_hash( gconf_value_get_string( aGconfValue ) ); - break; - - case GCONF_VALUE_LIST: - if( GCONF_VALUE_STRING == gconf_value_get_list_type( aGconfValue ) ) - { - GSList *list = gconf_value_get_list( aGconfValue ); - for(; list; list = g_slist_next(list)) - nHashCode ^= (sal_Int32) g_str_hash( gconf_value_get_string((GConfValue *) list->data) ); - break; - } - - default: - fprintf( stderr, "getTimestamp: Type not handled.\n" ); - break; - } - nHashCode = (nHashCode << 5) - nHashCode; - gconf_value_free( aGconfValue ); - } - } - - return rtl::OUString::valueOf( nHashCode ); -} diff --git a/shell/source/backends/gconfbe/gconflayer.hxx b/shell/source/backends/gconfbe/gconflayer.hxx deleted file mode 100644 index af9753b9179a..000000000000 --- a/shell/source/backends/gconfbe/gconflayer.hxx +++ /dev/null @@ -1,133 +0,0 @@ -#ifndef GCONFLAYER_HXX_ -#define GCONFLAYER_HXX_ - -#include "gconfbackend.hxx" -#include -#include - -#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_ -#include -#endif // _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_ -#include -#include - -#define GCONF_PROXY_MODE_KEY "/system/proxy/mode" -#define GCONF_AUTO_SAVE_KEY "/apps/openoffice/auto_save" - -enum ConfigurationSetting -{ - SETTING_PROXY_MODE, - SETTING_PROXY_HTTP_HOST, - SETTING_PROXY_HTTP_PORT, - SETTING_PROXY_HTTPS_HOST, - SETTING_PROXY_HTTPS_PORT, - SETTING_PROXY_FTP_HOST, - SETTING_PROXY_FTP_PORT, - SETTING_NO_PROXY_FOR, - SETTING_ENABLE_ACCESSIBILITY, - SETTING_MAILER_PROGRAM, - SETTING_WORK_DIRECTORY, - SETTING_SOURCEVIEWFONT_NAME, - SETTING_SOURCEVIEWFONT_HEIGHT, - SETTING_USER_GIVENNAME, - SETTING_USER_SURNAME, - -#ifdef ENABLE_LOCKDOWN - - SETTING_DISABLE_PRINTING, - SETTING_USE_SYSTEM_FILE_DIALOG, - SETTING_DISABLE_UI_CUSTOMIZATION, - SETTING_PRINTING_MODIFIES_DOCUMENT, - SETTING_SHOW_ICONS_IN_MENUS, - SETTING_SHOW_INACTIVE_MENUITEMS, - SETTING_SHOW_FONT_PREVIEW, - SETTING_SHOW_FONT_HISTORY, - SETTING_ENABLE_OPENGL, - SETTING_OPTIMIZE_OPENGL, - SETTING_SAVE_DOCUMENT_WINDOWS, - SETTING_SAVE_DOCUMENT_VIEW_INFO, - SETTING_USE_SYSTEM_FONT, - SETTING_USE_FONT_ANTI_ALIASING, - SETTING_FONT_ANTI_ALIASING_MIN_PIXEL, - SETTING_WARN_CREATE_PDF, - SETTING_WARN_PRINT_DOC, - SETTING_WARN_SAVEORSEND_DOC, - SETTING_WARN_SIGN_DOC, - SETTING_REMOVE_PERSONAL_INFO, - SETTING_RECOMMEND_PASSWORD, - SETTING_UNDO_STEPS, - SETTING_SYMBOL_SET, - SETTING_MACRO_SECURITY_LEVEL, - SETTING_CREATE_BACKUP, - SETTING_WARN_ALIEN_FORMAT, - SETTING_AUTO_SAVE, - SETTING_AUTO_SAVE_INTERVAL, - SETTING_WRITER_DEFAULT_DOC_FORMAT, - SETTING_IMPRESS_DEFAULT_DOC_FORMAT, - SETTING_CALC_DEFAULT_DOC_FORMAT, - -#endif // ENABLE_LOCKDOWN - - SETTINGS_LAST -}; - -struct ConfigurationValue -{ - const ConfigurationSetting nSettingId; - const gchar *GconfItem; - const char *OOoConfItem; - const char *OOoConfValueType; - const sal_Bool bLocked; - const sal_Bool bNeedsTranslation; - const ConfigurationSetting nDependsOn; -}; - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; -namespace util = css::util ; - -/** - Implementation of the XLayer interface for the Gconf values mapped into - the org.openoffice.* configuration component. - */ -class GconfLayer : public cppu::WeakImplHelper2 -{ -public : - /** - Constructor given the component context - - @param xContext The component context - */ - - GconfLayer( const uno::Reference& xContext, - const ConfigurationValue pConfigurationValuesList[], - const sal_Int32 nConfigurationValues, - const char * pPreloadValuesList[] ); - - // XLayer - virtual void SAL_CALL readData( - const uno::Reference& xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException ); - - // XTimeStamped - virtual rtl::OUString SAL_CALL getTimestamp(void) - throw (uno::RuntimeException); - - protected: - - /** Destructor */ - ~GconfLayer(void) {} - -private : - uno::Reference m_xLayerContentDescriber; - const ConfigurationValue* m_pConfigurationValuesList; - const sal_Int32 m_nConfigurationValues; - const char** m_pPreloadValuesList; - } ; - -#endif // GCONFLAYER diff --git a/shell/source/backends/gconfbe/makefile.mk b/shell/source/backends/gconfbe/makefile.mk index 472db4b244a3..aae7af45b106 100644 --- a/shell/source/backends/gconfbe/makefile.mk +++ b/shell/source/backends/gconfbe/makefile.mk @@ -35,8 +35,7 @@ TARGET=gconfbe LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE - -COMP1TYPELIST=$(TARGET) +VISIBILITY_HIDDEN=TRUE # --- Settings --- @@ -69,9 +68,8 @@ PKGCONFIG_LIBS!:=-Wl,--export-dynamic $(PKGCONFIG_LIBS) SLOFILES=\ - $(SLO)$/gconfbecdef.obj \ - $(SLO)$/gconfbackend.obj \ - $(SLO)$/gconflayer.obj + $(SLO)$/gconfaccess.obj \ + $(SLO)$/gconfbackend.obj SHL1NOCHECK=TRUE SHL1TARGET=$(TARGET)1.uno @@ -86,7 +84,6 @@ SHL1STDLIBS= \ SHL1STDLIBS+=$(PKGCONFIG_LIBS) -SHL1VERSIONMAP=exports.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) -- cgit From 3ffb5481b5e116c4a39dd07335439e711f0ca706 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 1 Oct 2009 10:39:31 +0200 Subject: #i101955# adapted more platform backends to new interface --- shell/source/backends/desktopbe/desktopbackend.cxx | 8 +- shell/source/backends/gconfbe/gconfbackend.cxx | 2 +- shell/source/backends/kde4be/exports.map | 10 - shell/source/backends/kde4be/kde4access.cxx | 306 ++++++++++++++ shell/source/backends/kde4be/kde4access.hxx | 46 +++ shell/source/backends/kde4be/kde4backend.cxx | 315 ++++++++------ shell/source/backends/kde4be/kde4backend.hxx | 123 ------ shell/source/backends/kde4be/kde4be.xml | 35 -- shell/source/backends/kde4be/kde4becdef.cxx | 143 ------- shell/source/backends/kde4be/kde4commonlayer.cxx | 157 ------- shell/source/backends/kde4be/kde4commonlayer.hxx | 51 --- shell/source/backends/kde4be/kde4inetlayer.cxx | 255 ------------ shell/source/backends/kde4be/kde4inetlayer.hxx | 59 --- shell/source/backends/kde4be/kde4pathslayer.cxx | 124 ------ shell/source/backends/kde4be/kde4pathslayer.hxx | 82 ---- shell/source/backends/kde4be/kde4vcllayer.cxx | 115 ------ shell/source/backends/kde4be/kde4vcllayer.hxx | 53 --- shell/source/backends/kde4be/makefile.mk | 17 +- shell/source/backends/kdebe/exports.map | 10 - shell/source/backends/kdebe/kdeaccess.cxx | 301 ++++++++++++++ shell/source/backends/kdebe/kdeaccess.hxx | 46 +++ shell/source/backends/kdebe/kdebackend.cxx | 314 ++++++++------ shell/source/backends/kdebe/kdebackend.hxx | 128 ------ shell/source/backends/kdebe/kdebe.xml | 35 -- shell/source/backends/kdebe/kdebecdef.cxx | 143 ------- shell/source/backends/kdebe/kdecommonlayer.cxx | 153 ------- shell/source/backends/kdebe/kdecommonlayer.hxx | 56 --- shell/source/backends/kdebe/kdeinetlayer.cxx | 254 ------------ shell/source/backends/kdebe/kdeinetlayer.hxx | 62 --- shell/source/backends/kdebe/kdepathslayer.cxx | 121 ------ shell/source/backends/kdebe/kdepathslayer.hxx | 86 ---- shell/source/backends/kdebe/kdevcllayer.cxx | 116 ------ shell/source/backends/kdebe/kdevcllayer.hxx | 56 --- shell/source/backends/kdebe/makefile.mk | 17 +- shell/source/backends/localebe/localebe.xml | 1 - shell/source/backends/macbe/macbackend.cxx | 455 ++++++++++++++++++--- shell/source/backends/macbe/macbackend.hxx | 51 +-- shell/source/backends/macbe/macbe.xml | 1 - shell/source/backends/macbe/macbecdef.cxx | 43 +- shell/source/backends/macbe/makefile.mk | 3 +- shell/source/backends/wininetbe/makefile.mk | 5 +- shell/source/backends/wininetbe/wininetbackend.cxx | 403 +++++++++++++++--- shell/source/backends/wininetbe/wininetbackend.hxx | 87 ++-- shell/source/backends/wininetbe/wininetbe.xml | 1 - shell/source/backends/wininetbe/wininetbecdef.cxx | 43 +- shell/source/backends/wininetbe/wininetlayer.cxx | 377 ----------------- shell/source/backends/wininetbe/wininetlayer.hxx | 73 ---- 47 files changed, 1921 insertions(+), 3421 deletions(-) delete mode 100644 shell/source/backends/kde4be/exports.map create mode 100644 shell/source/backends/kde4be/kde4access.cxx create mode 100644 shell/source/backends/kde4be/kde4access.hxx delete mode 100644 shell/source/backends/kde4be/kde4backend.hxx delete mode 100644 shell/source/backends/kde4be/kde4be.xml delete mode 100644 shell/source/backends/kde4be/kde4becdef.cxx delete mode 100644 shell/source/backends/kde4be/kde4commonlayer.cxx delete mode 100644 shell/source/backends/kde4be/kde4commonlayer.hxx delete mode 100644 shell/source/backends/kde4be/kde4inetlayer.cxx delete mode 100644 shell/source/backends/kde4be/kde4inetlayer.hxx delete mode 100644 shell/source/backends/kde4be/kde4pathslayer.cxx delete mode 100644 shell/source/backends/kde4be/kde4pathslayer.hxx delete mode 100644 shell/source/backends/kde4be/kde4vcllayer.cxx delete mode 100644 shell/source/backends/kde4be/kde4vcllayer.hxx delete mode 100644 shell/source/backends/kdebe/exports.map create mode 100644 shell/source/backends/kdebe/kdeaccess.cxx create mode 100644 shell/source/backends/kdebe/kdeaccess.hxx delete mode 100644 shell/source/backends/kdebe/kdebackend.hxx delete mode 100644 shell/source/backends/kdebe/kdebe.xml delete mode 100644 shell/source/backends/kdebe/kdebecdef.cxx delete mode 100644 shell/source/backends/kdebe/kdecommonlayer.cxx delete mode 100644 shell/source/backends/kdebe/kdecommonlayer.hxx delete mode 100644 shell/source/backends/kdebe/kdeinetlayer.cxx delete mode 100644 shell/source/backends/kdebe/kdeinetlayer.hxx delete mode 100644 shell/source/backends/kdebe/kdepathslayer.cxx delete mode 100644 shell/source/backends/kdebe/kdepathslayer.hxx delete mode 100644 shell/source/backends/kdebe/kdevcllayer.cxx delete mode 100644 shell/source/backends/kdebe/kdevcllayer.hxx delete mode 100644 shell/source/backends/wininetbe/wininetlayer.cxx delete mode 100644 shell/source/backends/wininetbe/wininetlayer.hxx (limited to 'shell') diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx index bdc45e737687..a214b08edb18 100644 --- a/shell/source/backends/desktopbe/desktopbackend.cxx +++ b/shell/source/backends/desktopbe/desktopbackend.cxx @@ -213,7 +213,13 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.backend.KDEBackend"))); - } //TODO: KDE4? + } else if (desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KDE4"))) { + backend = createBackend( + context, + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.backend.KDE4Backend"))); + } return backend.is() ? backend : static_cast< cppu::OWeakObject * >(new Default); } diff --git a/shell/source/backends/gconfbe/gconfbackend.cxx b/shell/source/backends/gconfbe/gconfbackend.cxx index cb18559c1b43..2410ca85171f 100644 --- a/shell/source/backends/gconfbe/gconfbackend.cxx +++ b/shell/source/backends/gconfbe/gconfbackend.cxx @@ -42,8 +42,8 @@ #include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/uno/Sequence.hxx" #include "com/sun/star/uno/Type.hxx" -#include "com/sun/star/uno/XCurrentContext.hpp" #include "com/sun/star/uno/XComponentContext.hpp" +#include "com/sun/star/uno/XCurrentContext.hpp" #include "cppu/unotype.hxx" #include "cppuhelper/factory.hxx" #include "cppuhelper/implbase2.hxx" diff --git a/shell/source/backends/kde4be/exports.map b/shell/source/backends/kde4be/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/shell/source/backends/kde4be/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/kde4be/kde4access.cxx b/shell/source/backends/kde4be/kde4access.cxx new file mode 100644 index 000000000000..fc3ae7043330 --- /dev/null +++ b/shell/source/backends/kde4be/kde4access.cxx @@ -0,0 +1,306 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* $RCSfile: code,v $ +* +* $Revision: 1.4 $ +* +* 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 +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +#include "precompiled_shell.hxx" +#include "sal/config.h" + +#include "QFont" +#include "QString" +#include "kemailsettings.h" +#include "kglobalsettings.h" +#include "kprotocolmanager.h" + +#include "com/sun/star/uno/Any.hxx" +#include "cppu/unotype.hxx" +#include "osl/diagnose.h" +#include "osl/file.h" +#include "rtl/string.h" +#include "rtl/ustring.hxx" + +#define SPACE ' ' +#define COMMA ',' +#define SEMI_COLON ';' + +namespace kde4access { + +namespace { + +namespace css = com::sun::star ; +namespace uno = css::uno ; + +} + +css::uno::Any getValue(rtl::OUString const & id) { + if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ExternalMailer"))) { + KEMailSettings aEmailSettings; + QString aClientProgram; + ::rtl::OUString sClientProgram; + + aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram ); + if ( aClientProgram.isEmpty() ) + aClientProgram = "kmail"; + else + aClientProgram = aClientProgram.section(SPACE, 0, 0); + sClientProgram = (const sal_Unicode *) aClientProgram.utf16(); + return uno::makeAny( sClientProgram ); + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight"))) + { + QFont aFixedFont; + short nFontHeight; + + aFixedFont = KGlobalSettings::fixedFont(); + nFontHeight = aFixedFont.pointSize(); + return uno::makeAny( nFontHeight ); + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("SourceViewFontName"))) + { + QFont aFixedFont; + QString aFontName; + :: rtl::OUString sFontName; + + aFixedFont = KGlobalSettings::fixedFont(); + aFontName = aFixedFont.family(); + sFontName = (const sal_Unicode *) aFontName.utf16(); + return uno::makeAny( sFontName ); + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport"))) + { + /* does not make much sense without an accessibility bridge */ + sal_Bool ATToolSupport = sal_False; + return uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) ); + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("WorkPathVariable"))) + { + QString aDocumentsDir( KGlobalSettings::documentPath() ); + rtl::OUString sDocumentsDir; + rtl::OUString sDocumentsURL; + if ( aDocumentsDir.endsWith(QChar('/')) ) + aDocumentsDir.truncate ( aDocumentsDir.length() - 1 ); + sDocumentsDir = (const sal_Unicode *) aDocumentsDir.utf16(); + osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData ); + return uno::makeAny( sDocumentsURL ); + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName"))) + { + QString aFTPProxy; + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + aFTPProxy = KProtocolManager::proxyFor( "FTP" ); + break; + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables +// In such cases, the proxy address is not stored in KDE, but determined dynamically. +// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... +// The best we can do here is to ask the current value for a given address. + aFTPProxy = KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") ); + break; + default: // No proxy is used + break; + } + if ( !aFTPProxy.isEmpty() ) + { + KUrl aProxy(aFTPProxy); + ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16(); + return uno::makeAny( sProxy ); + } + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort"))) + { + QString aFTPProxy; + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + aFTPProxy = KProtocolManager::proxyFor( "FTP" ); + break; + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables +// In such cases, the proxy address is not stored in KDE, but determined dynamically. +// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... +// The best we can do here is to ask the current value for a given address. + aFTPProxy = KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") ); + break; + default: // No proxy is used + break; + } + if ( !aFTPProxy.isEmpty() ) + { + KUrl aProxy(aFTPProxy); + sal_Int32 nPort = aProxy.port(); + return uno::makeAny( nPort ); + } + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName"))) + { + QString aHTTPProxy; + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + aHTTPProxy = KProtocolManager::proxyFor( "HTTP" ); + break; + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables +// In such cases, the proxy address is not stored in KDE, but determined dynamically. +// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... +// The best we can do here is to ask the current value for a given address. + aHTTPProxy = KProtocolManager::proxyForUrl( KUrl("http://http.openoffice.org") ); + break; + default: // No proxy is used + break; + } + if ( !aHTTPProxy.isEmpty() ) + { + KUrl aProxy(aHTTPProxy); + ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16(); + return uno::makeAny( sProxy ); + } + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort"))) + { + QString aHTTPProxy; + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + aHTTPProxy = KProtocolManager::proxyFor( "HTTP" ); + break; + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables +// In such cases, the proxy address is not stored in KDE, but determined dynamically. +// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... +// The best we can do here is to ask the current value for a given address. + aHTTPProxy = KProtocolManager::proxyForUrl( KUrl("http://http.openoffice.org") ); + break; + default: // No proxy is used + break; + } + if ( !aHTTPProxy.isEmpty() ) + { + KUrl aProxy(aHTTPProxy); + sal_Int32 nPort = aProxy.port(); + return uno::makeAny( nPort ); + } + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName"))) + { + QString aHTTPSProxy; + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + aHTTPSProxy = KProtocolManager::proxyFor( "HTTPS" ); + break; + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables +// In such cases, the proxy address is not stored in KDE, but determined dynamically. +// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... +// The best we can do here is to ask the current value for a given address. + aHTTPSProxy = KProtocolManager::proxyForUrl( KUrl("https://https.openoffice.org") ); + break; + default: // No proxy is used + break; + } + if ( !aHTTPSProxy.isEmpty() ) + { + KUrl aProxy(aHTTPSProxy); + ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16(); + return uno::makeAny( sProxy ); + } + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort"))) + { + QString aHTTPSProxy; + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + aHTTPSProxy = KProtocolManager::proxyFor( "HTTPS" ); + break; + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables +// In such cases, the proxy address is not stored in KDE, but determined dynamically. +// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... +// The best we can do here is to ask the current value for a given address. + aHTTPSProxy = KProtocolManager::proxyForUrl( KUrl("https://https.openoffice.org") ); + break; + default: // No proxy is used + break; + } + if ( !aHTTPSProxy.isEmpty() ) + { + KUrl aProxy(aHTTPSProxy); + sal_Int32 nPort = aProxy.port(); + return uno::makeAny( nPort ); + } + } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy"))) { + QString aNoProxyFor; + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables + aNoProxyFor = KProtocolManager::noProxyFor(); + break; + default: // No proxy is used + break; + } + if ( !aNoProxyFor.isEmpty() ) + { + ::rtl::OUString sNoProxyFor; + + aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON ); + sNoProxyFor = (const sal_Unicode *) aNoProxyFor.utf16(); + return uno::makeAny( sNoProxyFor ); + } + } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"))) { + int nProxyType; + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables + nProxyType = 1; + break; + default: // No proxy is used + nProxyType = 0; + } + return uno::makeAny( (sal_Int32) nProxyType ); + } else { + OSL_ASSERT(false); // this cannot happen + } + return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); +} + +} diff --git a/shell/source/backends/kde4be/kde4access.hxx b/shell/source/backends/kde4be/kde4access.hxx new file mode 100644 index 000000000000..043dff6476ec --- /dev/null +++ b/shell/source/backends/kde4be/kde4access.hxx @@ -0,0 +1,46 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* $RCSfile: code,v $ +* +* $Revision: 1.4 $ +* +* 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 +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +#ifndef INCLUDED_SHELL_SOURCE_BACKENDS_KDE4BE_KDE4ACCESS_HXX +#define INCLUDED_SHELL_SOURCE_BACKENDS_KDE4BE_KDE4ACCESS_HXX + +#include "sal/config.h" + +namespace com { namespace sun { namespace star { namespace uno { + class Any; +} } } } +namespace rtl { class OUString; } + +namespace kde4access { + +com::sun::star::uno::Any getValue(rtl::OUString const & id); + +} + +#endif diff --git a/shell/source/backends/kde4be/kde4backend.cxx b/shell/source/backends/kde4be/kde4backend.cxx index 7eb093bf7217..feef44562d49 100644 --- a/shell/source/backends/kde4be/kde4backend.cxx +++ b/shell/source/backends/kde4be/kde4backend.cxx @@ -1,158 +1,221 @@ /************************************************************************* - * - * 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: kde4backend.cxx,v $ - * $Revision: 1.7 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" - -#include "kde4backend.hxx" -#include "kde4commonlayer.hxx" -#include "kde4inetlayer.hxx" -#include "kde4vcllayer.hxx" -#include "kde4pathslayer.hxx" +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* $RCSfile: code,v $ +* +* $Revision: 1.4 $ +* +* 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 +* +* for a copy of the LGPLv3 License. +************************************************************************/ -//------------------------------------------------------------------------------ +#include "precompiled_shell.hxx" +#include "sal/config.h" + +#include "kapplication.h" + +#include "boost/noncopyable.hpp" +#include "com/sun/star/container/NoSuchElementException.hpp" +#include "com/sun/star/container/XNameAccess.hpp" +#include "com/sun/star/lang/XMultiComponentFactory.hpp" +#include "com/sun/star/lang/XServiceInfo.hpp" +#include "com/sun/star/lang/WrappedTargetException.hpp" +#include "com/sun/star/uno/Any.hxx" +#include "com/sun/star/uno/RuntimeException.hpp" +#include "com/sun/star/uno/Sequence.hxx" +#include "com/sun/star/uno/Type.hxx" +#include "com/sun/star/uno/XComponentContext.hpp" +#include "com/sun/star/uno/XCurrentContext.hpp" +#include "cppu/unotype.hxx" +#include "cppuhelper/factory.hxx" +#include "cppuhelper/implbase2.hxx" +#include "cppuhelper/implementationentry.hxx" +#include "cppuhelper/weak.hxx" +#include "rtl/string.h" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" +#include "uno/current_context.hxx" +#include "uno/lbnames.h" + +#include "kde4access.hxx" + +namespace { + +namespace css = com::sun::star; + +rtl::OUString SAL_CALL getServiceImplementationName() { + return rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.comp.configuration.backend.KDE4Backend")); +} -KDEBackend* KDEBackend::mInstance= 0; +css::uno::Sequence< rtl::OUString > SAL_CALL getServiceSupportedServiceNames() { + rtl::OUString name( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.backend.KDE4Backend")); + return css::uno::Sequence< rtl::OUString >(&name, 1); +} -KDEBackend* KDEBackend::createInstance(const uno::Reference& xContext) +class Service: + public cppu::WeakImplHelper2< + css::lang::XServiceInfo, css::container::XNameAccess >, + private boost::noncopyable { - if (mInstance == 0) - { - mInstance = new KDEBackend (xContext); +public: + Service(); + +private: + virtual ~Service() {} + + virtual rtl::OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException) + { return getServiceImplementationName(); } + + virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName) + throw (css::uno::RuntimeException) + { return ServiceName == getSupportedServiceNames()[0]; } + + virtual css::uno::Sequence< rtl::OUString > SAL_CALL + getSupportedServiceNames() throw (css::uno::RuntimeException) + { return getServiceSupportedServiceNames(); } + + virtual css::uno::Type SAL_CALL getElementType() + throw (css::uno::RuntimeException) + { return cppu::UnoType< cppu::UnoVoidType >::get(); } + + virtual sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException) + { return true; } + + virtual css::uno::Any SAL_CALL getByName(rtl::OUString const & aName) + throw ( + css::container::NoSuchElementException, + css::lang::WrappedTargetException, css::uno::RuntimeException); + + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getElementNames() + throw (css::uno::RuntimeException); + + virtual sal_Bool SAL_CALL hasByName(rtl::OUString const & aName) + throw (css::uno::RuntimeException); + + bool enabled_; +}; + +Service::Service(): enabled_(false) { + css::uno::Reference< css::uno::XCurrentContext > context( + css::uno::getCurrentContext()); + if (context.is()) { + rtl::OUString desktop; + context->getValueByName( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("system.desktop-environment"))) >>= + desktop; + enabled_ = desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KDE4")) && + KApplication::kApplication() != 0; } - - return mInstance; } -//------------------------------------------------------------------------------ - -KDEBackend::KDEBackend(const uno::Reference& xContext) - throw (backend::BackendAccessException) - : BackendBase(mMutex), m_xContext(xContext) +css::uno::Any Service::getByName(rtl::OUString const & aName) + throw ( + css::container::NoSuchElementException, + css::lang::WrappedTargetException, css::uno::RuntimeException) { + if (!hasByName(aName)) { + throw css::container::NoSuchElementException( + aName, static_cast< cppu::OWeakObject * >(this)); + } + return enabled_ + ? kde4access::getValue(aName) + : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); } -//------------------------------------------------------------------------------ - -KDEBackend::~KDEBackend(void) +css::uno::Sequence< rtl::OUString > Service::getElementNames() + throw (css::uno::RuntimeException) { + css::uno::Sequence< rtl::OUString > names(13); + names[0] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("EnableATToolSupport")); + names[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ExternalMailer")); + names[2] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("SourceViewFontHeight")); + names[3] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SourceViewFontName")); + names[4] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WorkPathVariable")); + names[5] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyName")); + names[6] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyPort")); + names[7] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyName")); + names[8] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyPort")); + names[9] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyName")); + names[10] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyPort")); + names[11] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetNoProxy")); + names[12] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetProxyType")); + return names; } -//------------------------------------------------------------------------------ - -uno::Reference SAL_CALL KDEBackend::getLayer( - const rtl::OUString& aComponent, const rtl::OUString& /* aTimestamp */) - throw (backend::BackendAccessException, lang::IllegalArgumentException) +sal_Bool Service::hasByName(rtl::OUString const & aName) + throw (css::uno::RuntimeException) { - uno::Reference xLayer; - - if( aComponent.equalsAscii("org.openoffice.Office.Common" ) ) - { - xLayer = new KDECommonLayer(m_xContext); - } - else if( aComponent.equalsAscii("org.openoffice.Inet" ) ) - { - xLayer = new KDEInetLayer(m_xContext); - } - else if( aComponent.equalsAscii("org.openoffice.VCL" ) ) - { - xLayer = new KDEVCLLayer(m_xContext); - } - else if( aComponent.equalsAscii("org.openoffice.Office.Paths" ) ) - { - xLayer = new KDEPathsLayer(m_xContext); + css::uno::Sequence< rtl::OUString > names(getElementNames()); + for (sal_Int32 i = 0; i < names.getLength(); ++i) { + if (aName == names[i]) { + return true; + } } - - return xLayer; + return false; } -//------------------------------------------------------------------------------ - -uno::Reference SAL_CALL -KDEBackend::getUpdatableLayer(const rtl::OUString& /* aComponent */) - throw (backend::BackendAccessException,lang::NoSupportException, - lang::IllegalArgumentException) +css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( + css::uno::Reference< css::uno::XComponentContext > const &) { - throw lang::NoSupportException( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("KDEBackend: No Update Operation allowed, Read Only access") ), - *this) ; + return static_cast< cppu::OWeakObject * >(new Service); } -//------------------------------------------------------------------------------ +static cppu::ImplementationEntry const services[] = { + { &createInstance, &getServiceImplementationName, + &getServiceSupportedServiceNames, &cppu::createSingleComponentFactory, 0, + 0 }, + { 0, 0, 0, 0, 0, 0 } +}; -rtl::OUString SAL_CALL KDEBackend::getBackendName(void) -{ - return rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.KDE4Backend") ); } -//------------------------------------------------------------------------------ - -rtl::OUString SAL_CALL KDEBackend::getImplementationName(void) - throw (uno::RuntimeException) +extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( + char const * pImplName, void * pServiceManager, void * pRegistryKey) { - return getBackendName() ; + return cppu::component_getFactoryHelper( + pImplName, pServiceManager, pRegistryKey, services); } -//------------------------------------------------------------------------------ - -uno::Sequence SAL_CALL KDEBackend::getBackendServiceNames(void) +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL +component_getImplementationEnvironment( + char const ** ppEnvTypeName, uno_Environment **) { - uno::Sequence aServices(1) ; - aServices[0] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.KDE4Backend")) ; - - return aServices ; + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//------------------------------------------------------------------------------ - -sal_Bool SAL_CALL KDEBackend::supportsService(const rtl::OUString& aServiceName) - throw (uno::RuntimeException) +extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( + void * pServiceManager, void * pRegistryKey) { - uno::Sequence< rtl::OUString > const svc = getBackendServiceNames(); - - for(sal_Int32 i = 0; i < svc.getLength(); ++i ) - if(svc[i] == aServiceName) - return true; - - return false; -} - -//------------------------------------------------------------------------------ - -uno::Sequence -SAL_CALL KDEBackend::getSupportedServiceNames(void) - throw (uno::RuntimeException) -{ - return getBackendServiceNames() ; + return component_writeInfoHelper(pServiceManager, pRegistryKey, services); } - -// --------------------------------------------------------------------------------------- diff --git a/shell/source/backends/kde4be/kde4backend.hxx b/shell/source/backends/kde4be/kde4backend.hxx deleted file mode 100644 index 01599c41a74d..000000000000 --- a/shell/source/backends/kde4be/kde4backend.hxx +++ /dev/null @@ -1,123 +0,0 @@ -/************************************************************************* - * - * 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: kde4backend.hxx,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include - -#ifndef INCLUDED_MAP -#include -#define INCLUDED_MAP -#endif - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; - - -//------------------------------------------------------------------------------ -typedef cppu::WeakComponentImplHelper2 BackendBase ; - -/** - Implements the SingleLayerStratum service for KDE access. - */ -class KDEBackend : public BackendBase { - public : - - static KDEBackend* createInstance(const uno::Reference& xContext); - - // XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName( ) - throw (uno::RuntimeException) ; - - virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& aServiceName ) - throw (uno::RuntimeException) ; - - virtual uno::Sequence SAL_CALL getSupportedServiceNames( ) - throw (uno::RuntimeException) ; - - /** - Provides the implementation name. - - @return implementation name - */ - static rtl::OUString SAL_CALL getBackendName(void) ; - - /** - Provides the supported services names - - @return service names - */ - static uno::Sequence SAL_CALL getBackendServiceNames(void) ; - - //XSingleLayerStratum - virtual uno::Reference SAL_CALL - getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp ) - throw (backend::BackendAccessException, lang::IllegalArgumentException) ; - - virtual uno::Reference SAL_CALL - getUpdatableLayer( const rtl::OUString& aLayerId ) - throw (backend::BackendAccessException, lang::NoSupportException, - lang::IllegalArgumentException) ; - - protected: - /** - Service constructor from a service factory. - - @param xContext component context - */ - KDEBackend(const uno::Reference& xContext) - throw (backend::BackendAccessException); - - /** Destructor */ - ~KDEBackend(void) ; - - private: - - /** Build KDE/OO mapping table */ - void initializeMappingTable (); - - - /** The component context */ - uno::Reference m_xContext; - - /** Mutex for reOOurces protection */ - osl::Mutex mMutex ; - - static KDEBackend* mInstance; -}; diff --git a/shell/source/backends/kde4be/kde4be.xml b/shell/source/backends/kde4be/kde4be.xml deleted file mode 100644 index ea2d9be6dd6b..000000000000 --- a/shell/source/backends/kde4be/kde4be.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - kde4be - - Éric Bischoff - com.sun.star.comp.configuration.backend.KDE4Backend - The KDE4 configuration backend - com.sun.star.loader.SharedLibrary - c++ - - com.sun.star.comp.configuration.backend.KDE4Backend - ... - com.sun.star.configuration.backend.XBackendChangesListener - com.sun.star.configuration.backend.XBackendChangesNotifier - com.sun.star.configuration.backend.XLayerHandler - com.sun.star.configuration.backend.XSingleLayerStratum - com.sun.star.lang.XMultiComponentFactory - com.sun.star.lang.XServiceInfo - com.sun.star.lang.XSingleComponentFactory - com.sun.star.lang.XTypeProvider - com.sun.star.uno.TypeClass - com.sun.star.uno.XAggregation - com.sun.star.uno.XComponentContext - com.sun.star.uno.XCurrentContext - com.sun.star.uno.XWeak - com.sun.star.registry.XRegistryKey - - cppuhelper - cppu - sal - cppuhelper3$(COM) - cppu3 - sal3 - diff --git a/shell/source/backends/kde4be/kde4becdef.cxx b/shell/source/backends/kde4be/kde4becdef.cxx deleted file mode 100644 index da0d22ead22e..000000000000 --- a/shell/source/backends/kde4be/kde4becdef.cxx +++ /dev/null @@ -1,143 +0,0 @@ -/************************************************************************* - * - * 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: kde4becdef.cxx,v $ - * $Revision: 1.8 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" -#include "kde4backend.hxx" - -#include - -#include - -#include -#include - -#include "uno/current_context.hxx" - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; - -//============================================================================== - -static uno::Reference SAL_CALL createKDEBackend(const uno::Reference& xContext) -{ - try { - uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext()); - - if (xCurrentContext.is()) - { - uno::Any aValue = xCurrentContext->getValueByName( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "system.desktop-environment" ) ) ); - - rtl::OUString aDesktopEnvironment; - if ( (aValue >>= aDesktopEnvironment) && (aDesktopEnvironment.equalsAscii("KDE")) && (KApplication::kApplication() != NULL) ) - return * KDEBackend::createInstance(xContext); - } - - return uno::Reference(); - - } catch (uno::RuntimeException e) { - return uno::Reference(); - } - -} - -//============================================================================== - -static const cppu::ImplementationEntry kImplementations_entries[] = -{ - { - createKDEBackend, - KDEBackend::getBackendName, - KDEBackend::getBackendServiceNames, - cppu::createSingleComponentFactory, - NULL, - 0 - }, - { NULL, NULL, NULL, NULL, NULL, 0 } -} ; -//------------------------------------------------------------------------------ - -extern "C" void SAL_CALL component_getImplementationEnvironment( - const sal_Char **aEnvTypeName, - uno_Environment **) { - *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; -} - -//------------------------------------------------------------------------------ - -extern "C" sal_Bool SAL_CALL component_writeInfo(void *, - void *pRegistryKey) { - - using namespace ::com::sun::star::registry; - if (pRegistryKey) - { - try - { - uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + KDEBackend::getBackendName() - ); - - // Register associated service names - uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") ) - ); - - uno::Sequence sServiceNames = KDEBackend::getBackendServiceNames(); - for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i) - xServicesKey->createKey(sServiceNames[i]); - - return sal_True; - } - - catch( InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "InvalidRegistryException caught"); - } - } - - return sal_False; -} - -//------------------------------------------------------------------------------ - -extern "C" void *component_getFactory(const sal_Char *aImplementationName, - void *aServiceManager, - void *aRegistryKey) { - - return cppu::component_getFactoryHelper( - aImplementationName, - aServiceManager, - aRegistryKey, - kImplementations_entries) ; -} -//------------------------------------------------------------------------------ diff --git a/shell/source/backends/kde4be/kde4commonlayer.cxx b/shell/source/backends/kde4be/kde4commonlayer.cxx deleted file mode 100644 index 1ce844672225..000000000000 --- a/shell/source/backends/kde4be/kde4commonlayer.cxx +++ /dev/null @@ -1,157 +0,0 @@ -/************************************************************************* - * - * 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: kde4commonlayer.cxx,v $ - * $Revision: 1.7 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" - -#include "kde4commonlayer.hxx" - -#include -#include - -#include - -#include -#include -#include - -#define SPACE ' ' - -//============================================================================== - -KDECommonLayer::KDECommonLayer(const uno::Reference& xContext) -{ - //Create instance of LayerContentDescriber Service - rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.configuration.backend.LayerDescriber")); - - typedef uno::Reference LayerDescriber; - uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); - if( xServiceManager.is() ) - { - m_xLayerContentDescriber = LayerDescriber::query( - xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext)); - } - else - { - OSL_TRACE("Could not retrieve ServiceManager"); - } -} - -//------------------------------------------------------------------------------ - -void SAL_CALL KDECommonLayer::readData( const uno::Reference& xHandler) - throw ( backend::MalformedDataException, lang::NullPointerException, - lang::WrappedTargetException, uno::RuntimeException) -{ - if( ! m_xLayerContentDescriber.is() ) - { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service" - ) ), static_cast < backend::XLayer * > (this) ); - } - - uno::Sequence aPropInfoList(3); - sal_Int32 nProperties = 0; - - // Email client settings - KEMailSettings aEmailSettings; - QString aClientProgram; - ::rtl::OUString sClientProgram; - - aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram ); - if ( aClientProgram.isEmpty() ) - aClientProgram = "kmail"; - else - aClientProgram = aClientProgram.section(SPACE, 0, 0); - sClientProgram = (const sal_Unicode *) aClientProgram.utf16(); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/ExternalMailer/Program") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( sClientProgram ); - - // Source code font settings - QFont aFixedFont; - QString aFontName; - :: rtl::OUString sFontName; - short nFontHeight; - - aFixedFont = KGlobalSettings::fixedFont(); - aFontName = aFixedFont.family(); - sFontName = (const sal_Unicode *) aFontName.utf16(); - nFontHeight = aFixedFont.pointSize(); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontName") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( sFontName ); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontHeight") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "short" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( nFontHeight ); - - if( nProperties > 0 ) - { - aPropInfoList.realloc(nProperties); - m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList); - } -} - -//------------------------------------------------------------------------------ - -rtl::OUString SAL_CALL KDECommonLayer::getTimestamp(void) - throw (uno::RuntimeException) -{ - // Return the value as timestamp to avoid regenerating the binary cache - // on each office launch. - - KEMailSettings aEmailSettings; - QString aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram ); - aClientProgram = aClientProgram.section(SPACE, 0, 0); - - QString aFixedFont = KGlobalSettings::fixedFont().toString(); - - ::rtl::OUString sTimeStamp, - sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) ); - - sTimeStamp = (const sal_Unicode *) aClientProgram.utf16(); - sTimeStamp += sep; - sTimeStamp += (const sal_Unicode *) aFixedFont.utf16(); - - return sTimeStamp; -} diff --git a/shell/source/backends/kde4be/kde4commonlayer.hxx b/shell/source/backends/kde4be/kde4commonlayer.hxx deleted file mode 100644 index 9ce4cd4dc962..000000000000 --- a/shell/source/backends/kde4be/kde4commonlayer.hxx +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#include "kde4backend.hxx" -#include -#include -#include -#include -#include -#include - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; -namespace util = css::util ; - -/** - Implementation of the XLayer interface for the KDE values mapped into - the org.openoffice.Office.Common configuration component. - */ -class KDECommonLayer : public cppu::WeakImplHelper2 -{ -public : - /** - Constructor given the component context - - @param xContext The component context - */ - - KDECommonLayer(const uno::Reference& xContext); - - // XLayer - virtual void SAL_CALL readData( - const uno::Reference& xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException) ; - - // XTimeStamped - virtual rtl::OUString SAL_CALL getTimestamp(void) - throw (uno::RuntimeException); - - protected: - - /** Destructor */ - ~KDECommonLayer(void) {} - - private : - uno::Reference m_xLayerContentDescriber ; -}; diff --git a/shell/source/backends/kde4be/kde4inetlayer.cxx b/shell/source/backends/kde4be/kde4inetlayer.cxx deleted file mode 100644 index bc661a093fb7..000000000000 --- a/shell/source/backends/kde4be/kde4inetlayer.cxx +++ /dev/null @@ -1,255 +0,0 @@ -/************************************************************************* - * - * 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: kde4inetlayer.cxx,v $ - * $Revision: 1.7 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" - -#include - -#include "kde4inetlayer.hxx" -#include -#include -#include - -#define COMMA ',' -#define SEMI_COLON ';' - -//============================================================================== - -KDEInetLayer::KDEInetLayer(const uno::Reference& xContext) -{ - //Create instance of LayerContentDescriber Service - rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.configuration.backend.LayerDescriber")); - - typedef uno::Reference LayerDescriber; - uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); - if( xServiceManager.is() ) - { - m_xLayerContentDescriber = LayerDescriber::query( - xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext)); - } - else - { - OSL_TRACE("Could not retrieve ServiceManager"); - } -} - -//------------------------------------------------------------------------------ - -void SAL_CALL KDEInetLayer::readData( const uno::Reference& xHandler) - throw ( backend::MalformedDataException, lang::NullPointerException, - lang::WrappedTargetException, uno::RuntimeException) -{ - if( ! m_xLayerContentDescriber.is() ) - { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service" - ) ), static_cast < backend::XLayer * > (this) ); - } - - uno::Sequence aPropInfoList(8); - sal_Int32 nProperties = 0; - - switch ( KProtocolManager::proxyType() ) - { - case KProtocolManager::ManualProxy: // Proxies are manually configured - setProxy(aPropInfoList, nProperties, 1, - KProtocolManager::noProxyFor(), - KProtocolManager::proxyFor( "HTTP" ), - KProtocolManager::proxyFor( "FTP" ), - KProtocolManager::proxyFor( "HTTPS" )); - break; - case KProtocolManager::PACProxy: // A proxy configuration URL has been given - case KProtocolManager::WPADProxy: // A proxy should be automatically discovered - case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables -// In such cases, the proxy address is not stored in KDE, but determined dynamically. -// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... -// The best we can do here is to ask the current value for a given address. - setProxy(aPropInfoList, nProperties, 1, - KProtocolManager::noProxyFor(), - KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") ), - KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") ), - KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") )); - break; - default: // No proxy is used - setProxy(aPropInfoList, nProperties, 0); - } - - if ( nProperties > 0 ) - { - aPropInfoList.realloc(nProperties); - m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList); - } -} - -//------------------------------------------------------------------------------ - -rtl::OUString SAL_CALL KDEInetLayer::getTimestamp(void) - throw (uno::RuntimeException) -{ - // Return the value as timestamp to avoid regenerating the binary cache - // on each office launch. - - QString aProxyType, aNoProxyFor, aHTTPProxy, aHTTPSProxy, aFTPProxy; - - switch ( KProtocolManager::proxyType() ) - { - case KProtocolManager::ManualProxy: - aProxyType = '1'; - aNoProxyFor = KProtocolManager::noProxyFor(); - aHTTPProxy = KProtocolManager::proxyFor( "HTTP" ); - aHTTPProxy = KProtocolManager::proxyFor( "HTTPS" ); - aFTPProxy = KProtocolManager::proxyFor( "FTP" ); - break; - case KProtocolManager::PACProxy: - case KProtocolManager::WPADProxy: - case KProtocolManager::EnvVarProxy: - aProxyType = '1'; - aNoProxyFor = KProtocolManager::noProxyFor(); - aHTTPProxy = KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") ); - aHTTPSProxy = KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") ); - aFTPProxy = KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") ); - break; - default: - aProxyType = '0'; - } - - ::rtl::OUString sTimeStamp, - sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) ); - - sTimeStamp = (const sal_Unicode *) aProxyType.utf16(); - sTimeStamp += sep; - sTimeStamp += (const sal_Unicode *) aNoProxyFor.utf16(); - sTimeStamp += sep; - sTimeStamp += (const sal_Unicode *) aHTTPProxy.utf16(); - sTimeStamp += sep; - sTimeStamp += (const sal_Unicode *) aHTTPSProxy.utf16(); - sTimeStamp += sep; - sTimeStamp += (const sal_Unicode *) aFTPProxy.utf16(); - - return sTimeStamp; -} - -//------------------------------------------------------------------------------ - -void SAL_CALL KDEInetLayer::setProxy - (uno::Sequence &aPropInfoList, sal_Int32 &nProperties, - int nProxyType, const QString &aNoProxy, const QString &aHTTPProxy, const QString &aFTPProxy, const QString &aHTTPSProxy ) const -{ - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "int" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( (sal_Int32) nProxyType ); - - if (nProxyType == 0) return; - - if ( !aNoProxy.isEmpty() ) - { - QString aNoProxyFor(aNoProxy); - ::rtl::OUString sNoProxyFor; - - aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON ); - sNoProxyFor = (const sal_Unicode *) aNoProxyFor.utf16(); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( sNoProxyFor ); - } - - if ( !aHTTPProxy.isEmpty() ) - { - KUrl aProxy(aHTTPProxy); - ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16(); - sal_Int32 nPort = aProxy.port(); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( sProxy ); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "int" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( nPort ); - } - - if ( !aHTTPSProxy.isEmpty() ) - { - KUrl aProxy(aHTTPSProxy); - ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16(); - sal_Int32 nPort = aProxy.port(); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( sProxy ); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "int" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( nPort ); - } - - if ( !aFTPProxy.isEmpty() ) - { - KUrl aProxy(aFTPProxy); - ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16(); - sal_Int32 nPort = aProxy.port(); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( sProxy ); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "int" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( nPort ); - } -} - diff --git a/shell/source/backends/kde4be/kde4inetlayer.hxx b/shell/source/backends/kde4be/kde4inetlayer.hxx deleted file mode 100644 index 64d00fec45fc..000000000000 --- a/shell/source/backends/kde4be/kde4inetlayer.hxx +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once - -#include - -#include "kde4backend.hxx" - -#include -#include -#include -#include -#include -#include - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; -namespace util = css::util ; - -/** - Implementation of the XLayer interface for the KDE values mapped into - the org.openoffice.Inet configuration component. - */ -class KDEInetLayer : public cppu::WeakImplHelper2 -{ -public : - /** - Constructor given the component context - - @param xContext The component context - */ - - KDEInetLayer(const uno::Reference& xContext); - - // XLayer - virtual void SAL_CALL readData( - const uno::Reference& xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException) ; - - // XTimeStamped - virtual rtl::OUString SAL_CALL getTimestamp(void) - throw (uno::RuntimeException); - - protected: - - /** Destructor */ - ~KDEInetLayer(void) {} - -private : - uno::Reference m_xLayerContentDescriber ; - - void SAL_CALL setProxy - (uno::Sequence &aPropInfoList, sal_Int32 &nProperties, - int nProxyType, const QString &aNoProxyfor = QString(), - const QString &aHTTPProxy = QString(), const QString &aFTPProxy = QString(), const QString &aHTTPSProxy = QString()) const; -}; diff --git a/shell/source/backends/kde4be/kde4pathslayer.cxx b/shell/source/backends/kde4be/kde4pathslayer.cxx deleted file mode 100644 index 2511d0b57405..000000000000 --- a/shell/source/backends/kde4be/kde4pathslayer.cxx +++ /dev/null @@ -1,124 +0,0 @@ -/************************************************************************* - * - * 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: kde4pathslayer.cxx,v $ - * $Revision: 1.5 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" - -#include "kde4pathslayer.hxx" - -#include -#include - -#include -#include - -#include -#include -#include - -#define SPACE ' ' - -//============================================================================== - -KDEPathsLayer::KDEPathsLayer(const uno::Reference& xContext) -{ - //Create instance of LayerContentDescriber Service - rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.configuration.backend.LayerDescriber")); - - typedef uno::Reference LayerDescriber; - uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); - if( xServiceManager.is() ) - { - m_xLayerContentDescriber = LayerDescriber::query( - xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext)); - } - else - { - OSL_TRACE("Could not retrieve ServiceManager"); - } -} - -//------------------------------------------------------------------------------ - -void SAL_CALL KDEPathsLayer::readData( const uno::Reference& xHandler) - throw ( backend::MalformedDataException, lang::NullPointerException, - lang::WrappedTargetException, uno::RuntimeException) -{ - if( ! m_xLayerContentDescriber.is() ) - { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service" - ) ), static_cast < backend::XLayer * > (this) ); - } - - uno::Sequence aPropInfoList(1); - sal_Int32 nProperties = 0; - - QString aDocumentsDir( KGlobalSettings::documentPath() ); - rtl::OUString sDocumentsDir; - rtl::OUString sDocumentsURL; - if ( aDocumentsDir.endsWith(QChar('/')) ) - aDocumentsDir.truncate ( aDocumentsDir.length() - 1 ); - sDocumentsDir = (const sal_Unicode *) aDocumentsDir.utf16(); - osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData ); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Paths/Variables/Work") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( sDocumentsURL ); - - if( nProperties > 0 ) - { - aPropInfoList.realloc(nProperties); - m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList); - } -} - -//------------------------------------------------------------------------------ - -rtl::OUString SAL_CALL KDEPathsLayer::getTimestamp(void) - throw (uno::RuntimeException) -{ - // Return the value as timestamp to avoid regenerating the binary cache - // on each office launch. - - ::rtl::OUString sTimeStamp, - sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) ); - - QString aDocumentsDir; - aDocumentsDir = KGlobalSettings::documentPath(); - - sTimeStamp += (const sal_Unicode *) aDocumentsDir.utf16(); - - return sTimeStamp; -} diff --git a/shell/source/backends/kde4be/kde4pathslayer.hxx b/shell/source/backends/kde4be/kde4pathslayer.hxx deleted file mode 100644 index 40d31a73c4f9..000000000000 --- a/shell/source/backends/kde4be/kde4pathslayer.hxx +++ /dev/null @@ -1,82 +0,0 @@ -/************************************************************************* - * - * 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: kde4pathslayer.hxx,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#pragma once - -#include "kde4backend.hxx" -#include -#include -#include -#include -#include - -#include - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; -namespace util = css::util ; - -/** - Implementation of the XLayer interface for the KDE values mapped into - the org.openoffice.Office.Paths configuration component. - */ -class KDEPathsLayer : public cppu::WeakImplHelper2 -{ -public : - /** - Constructor given the component context - - @param xContext The component context - */ - - KDEPathsLayer(const uno::Reference& xContext); - - // XLayer - virtual void SAL_CALL readData( - const uno::Reference& xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException) ; - - // XTimeStamped - virtual rtl::OUString SAL_CALL getTimestamp(void) - throw (uno::RuntimeException); - - protected: - - /** Destructor */ - ~KDEPathsLayer(void) {} - - private : - uno::Reference m_xLayerContentDescriber ; -}; diff --git a/shell/source/backends/kde4be/kde4vcllayer.cxx b/shell/source/backends/kde4be/kde4vcllayer.cxx deleted file mode 100644 index 780c3e4e7ce1..000000000000 --- a/shell/source/backends/kde4be/kde4vcllayer.cxx +++ /dev/null @@ -1,115 +0,0 @@ -/************************************************************************* - * - * 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: kde4vcllayer.cxx,v $ - * $Revision: 1.5 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" - -#include "kde4vcllayer.hxx" - -#include -#include -#include - -//============================================================================== - -KDEVCLLayer::KDEVCLLayer(const uno::Reference& xContext) -{ - //Create instance of LayerContentDescriber Service - rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.configuration.backend.LayerDescriber")); - - typedef uno::Reference LayerDescriber; - uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); - if( xServiceManager.is() ) - { - m_xLayerContentDescriber = LayerDescriber::query( - xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext)); - } - else - { - OSL_TRACE("Could not retrieve ServiceManager"); - } -} - -//------------------------------------------------------------------------------ - -void SAL_CALL KDEVCLLayer::readData( const uno::Reference& xHandler) - throw ( backend::MalformedDataException, lang::NullPointerException, - lang::WrappedTargetException, uno::RuntimeException) -{ - if( ! m_xLayerContentDescriber.is() ) - { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service" - ) ), static_cast < backend::XLayer * > (this) ); - } - - uno::Sequence aPropInfoList(1); - -/* - Commenting out, does not make much sense without an accessibility bridge -=========================================================================== -#if defined(QT_ACCESSIBILITY_SUPPORT) -// Accessibility tools under Qt for UNIX are available starting with Qt 4.0 - int nVersionMajor = 0; - const char *q = qVersion(); // "3.1.0" for example - while ('0' <= *q && *q <= '9') - nVersionMajor = nVersionMajor * 10 + *q++ - '0'; - sal_Bool ATToolSupport = (sal_Bool) (nVersionMajor >= 4); -#else - sal_Bool ATToolSupport = sal_False; -#endif -=========================================================================== - End of commented out section -*/ sal_Bool ATToolSupport = sal_False; - - aPropInfoList[0].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.VCL/Settings/Accessibility/EnableATToolSupport") ); - aPropInfoList[0].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[0].Protected = sal_False; - aPropInfoList[0].Value = uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) ); - - m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList); -} - -//------------------------------------------------------------------------------ - -rtl::OUString SAL_CALL KDEVCLLayer::getTimestamp(void) - throw (uno::RuntimeException) -{ - // Return the value as timestamp to avoid regenerating the binary cache - // on each office launch. - - ::rtl::OUString sTimeStamp( - RTL_CONSTASCII_USTRINGPARAM( "FALSE" ) ); - - return sTimeStamp; -} diff --git a/shell/source/backends/kde4be/kde4vcllayer.hxx b/shell/source/backends/kde4be/kde4vcllayer.hxx deleted file mode 100644 index 16036ee89122..000000000000 --- a/shell/source/backends/kde4be/kde4vcllayer.hxx +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once - -#include "kde4backend.hxx" - -#include -#include -#include -#include -#include - -#include - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; -namespace util = css::util ; - -/** - Implementation of the XLayer interface for the KDE values mapped into - the org.openoffice.VCL configuration component. - */ -class KDEVCLLayer : public cppu::WeakImplHelper2 -{ -public : - /** - Constructor given the component context - - @param xContext The component context - */ - - KDEVCLLayer(const uno::Reference& xContext); - - // XLayer - virtual void SAL_CALL readData( - const uno::Reference& xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException) ; - - // XTimeStamped - virtual rtl::OUString SAL_CALL getTimestamp(void) - throw (uno::RuntimeException); - - protected: - - /** Destructor */ - ~KDEVCLLayer(void) {} - - private : - uno::Reference m_xLayerContentDescriber ; -}; diff --git a/shell/source/backends/kde4be/makefile.mk b/shell/source/backends/kde4be/makefile.mk index 6f92762e5ae1..560f06882c64 100644 --- a/shell/source/backends/kde4be/makefile.mk +++ b/shell/source/backends/kde4be/makefile.mk @@ -35,11 +35,7 @@ TARGET=kde4be LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE - -COMP1TYPELIST=$(TARGET) -COMPRDB=$(SOLARBINDIR)$/types.rdb -UNOUCROUT=$(OUT)$/inc$/$(TARGET) -INCPRE=$(UNOUCROUT) +VISIBILITY_HIDDEN=TRUE # --- Settings --- @@ -64,12 +60,8 @@ CFLAGS+=$(KDE4_CFLAGS) # --- Files --- SLOFILES=\ - $(SLO)$/kde4backend.obj \ - $(SLO)$/kde4commonlayer.obj \ - $(SLO)$/kde4inetlayer.obj \ - $(SLO)$/kde4vcllayer.obj \ - $(SLO)$/kde4pathslayer.obj \ - $(SLO)$/kde4becdef.obj + $(SLO)$/kde4access.obj \ + $(SLO)$/kde4backend.obj SHL1NOCHECK=TRUE SHL1TARGET=$(TARGET)1.uno @@ -82,8 +74,7 @@ SHL1STDLIBS= \ $(CPPULIB) \ $(SALLIB) \ $(KDE4_LIBS) -lkio - -SHL1VERSIONMAP=exports.map + SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/backends/kdebe/exports.map b/shell/source/backends/kdebe/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/shell/source/backends/kdebe/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/kdebe/kdeaccess.cxx b/shell/source/backends/kdebe/kdeaccess.cxx new file mode 100644 index 000000000000..9dd9ecd7478b --- /dev/null +++ b/shell/source/backends/kdebe/kdeaccess.cxx @@ -0,0 +1,301 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* $RCSfile: code,v $ +* +* $Revision: 1.4 $ +* +* 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 +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +#include "precompiled_shell.hxx" +#include "sal/config.h" + +#include "com/sun/star/uno/Any.hxx" +#include "cppu/unotype.hxx" +#include "osl/diagnose.h" +#include "osl/file.h" +#include "rtl/string.h" +#include "rtl/ustring.hxx" +#include "vcl/kde_headers.h" + +#define SPACE ' ' +#define COMMA ',' +#define SEMI_COLON ';' + +namespace kdeaccess { + +namespace { + +namespace css = com::sun::star ; +namespace uno = css::uno ; + +} + +css::uno::Any getValue(rtl::OUString const & id) { + if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ExternalMailer"))) { + KEMailSettings aEmailSettings; + QString aClientProgram; + ::rtl::OUString sClientProgram; + + aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram ); + if ( aClientProgram.isEmpty() ) + aClientProgram = "kmail"; + else + aClientProgram = aClientProgram.section(SPACE, 0, 0); + sClientProgram = (const sal_Unicode *) aClientProgram.ucs2(); + return uno::makeAny( sClientProgram ); + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight"))) + { + QFont aFixedFont; + short nFontHeight; + + aFixedFont = KGlobalSettings::fixedFont(); + nFontHeight = aFixedFont.pointSize(); + return uno::makeAny( nFontHeight ); + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("SourceViewFontName"))) + { + QFont aFixedFont; + QString aFontName; + :: rtl::OUString sFontName; + + aFixedFont = KGlobalSettings::fixedFont(); + aFontName = aFixedFont.family(); + sFontName = (const sal_Unicode *) aFontName.ucs2(); + return uno::makeAny( sFontName ); + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport"))) + { + /* does not make much sense without an accessibility bridge */ + sal_Bool ATToolSupport = sal_False; + return uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) ); + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("WorkPathVariable"))) + { + QString aDocumentsDir( KGlobalSettings::documentPath() ); + rtl::OUString sDocumentsDir; + rtl::OUString sDocumentsURL; + if ( aDocumentsDir.endsWith(QChar('/')) ) + aDocumentsDir.truncate ( aDocumentsDir.length() - 1 ); + sDocumentsDir = (const sal_Unicode *) aDocumentsDir.ucs2(); + osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData ); + return uno::makeAny( sDocumentsURL ); + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName"))) + { + QString aFTPProxy; + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + aFTPProxy = KProtocolManager::proxyFor( "FTP" ); + break; + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables +// In such cases, the proxy address is not stored in KDE, but determined dynamically. +// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... +// The best we can do here is to ask the current value for a given address. + aFTPProxy = KProtocolManager::proxyForURL( "ftp://ftp.openoffice.org" ); + break; + default: // No proxy is used + break; + } + if ( !aFTPProxy.isEmpty() ) + { + KURL aProxy(aFTPProxy); + ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2(); + return uno::makeAny( sProxy ); + } + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort"))) + { + QString aFTPProxy; + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + aFTPProxy = KProtocolManager::proxyFor( "FTP" ); + break; + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables +// In such cases, the proxy address is not stored in KDE, but determined dynamically. +// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... +// The best we can do here is to ask the current value for a given address. + aFTPProxy = KProtocolManager::proxyForURL( "ftp://ftp.openoffice.org" ); + break; + default: // No proxy is used + break; + } + if ( !aFTPProxy.isEmpty() ) + { + KURL aProxy(aFTPProxy); + sal_Int32 nPort = aProxy.port(); + return uno::makeAny( nPort ); + } + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName"))) + { + QString aHTTPProxy; + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + aHTTPProxy = KProtocolManager::proxyFor( "HTTP" ); + break; + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables +// In such cases, the proxy address is not stored in KDE, but determined dynamically. +// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... +// The best we can do here is to ask the current value for a given address. + aHTTPProxy = KProtocolManager::proxyForURL( "http://http.openoffice.org" ); + break; + default: // No proxy is used + break; + } + if ( !aHTTPProxy.isEmpty() ) + { + KURL aProxy(aHTTPProxy); + ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2(); + return uno::makeAny( sProxy ); + } + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort"))) + { + QString aHTTPProxy; + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + aHTTPProxy = KProtocolManager::proxyFor( "HTTP" ); + break; + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables +// In such cases, the proxy address is not stored in KDE, but determined dynamically. +// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... +// The best we can do here is to ask the current value for a given address. + aHTTPProxy = KProtocolManager::proxyForURL( "http://http.openoffice.org" ); + break; + default: // No proxy is used + break; + } + if ( !aHTTPProxy.isEmpty() ) + { + KURL aProxy(aHTTPProxy); + sal_Int32 nPort = aProxy.port(); + return uno::makeAny( nPort ); + } + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName"))) + { + QString aHTTPSProxy; + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + aHTTPSProxy = KProtocolManager::proxyFor( "HTTPS" ); + break; + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables +// In such cases, the proxy address is not stored in KDE, but determined dynamically. +// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... +// The best we can do here is to ask the current value for a given address. + aHTTPSProxy = KProtocolManager::proxyForURL( "https://https.openoffice.org" ); + break; + default: // No proxy is used + break; + } + if ( !aHTTPSProxy.isEmpty() ) + { + KURL aProxy(aHTTPSProxy); + ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2(); + return uno::makeAny( sProxy ); + } + } else if (id.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort"))) + { + QString aHTTPSProxy; + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + aHTTPSProxy = KProtocolManager::proxyFor( "HTTPS" ); + break; + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables +// In such cases, the proxy address is not stored in KDE, but determined dynamically. +// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... +// The best we can do here is to ask the current value for a given address. + aHTTPSProxy = KProtocolManager::proxyForURL( "https://https.openoffice.org" ); + break; + default: // No proxy is used + break; + } + if ( !aHTTPSProxy.isEmpty() ) + { + KURL aProxy(aHTTPSProxy); + sal_Int32 nPort = aProxy.port(); + return uno::makeAny( nPort ); + } + } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy"))) { + QString aNoProxyFor; + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables + aNoProxyFor = KProtocolManager::noProxyFor(); + break; + default: // No proxy is used + break; + } + if ( !aNoProxyFor.isEmpty() ) + { + ::rtl::OUString sNoProxyFor; + + aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON ); + sNoProxyFor = (const sal_Unicode *) aNoProxyFor.ucs2(); + return uno::makeAny( sNoProxyFor ); + } + } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"))) { + int nProxyType; + switch ( KProtocolManager::proxyType() ) + { + case KProtocolManager::ManualProxy: // Proxies are manually configured + case KProtocolManager::PACProxy: // A proxy configuration URL has been given + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables + nProxyType = 1; + break; + default: // No proxy is used + nProxyType = 0; + } + return uno::makeAny( (sal_Int32) nProxyType ); + } else { + OSL_ASSERT(false); // this cannot happen + } + return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); +} + +} diff --git a/shell/source/backends/kdebe/kdeaccess.hxx b/shell/source/backends/kdebe/kdeaccess.hxx new file mode 100644 index 000000000000..cb916a44d61b --- /dev/null +++ b/shell/source/backends/kdebe/kdeaccess.hxx @@ -0,0 +1,46 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* $RCSfile: code,v $ +* +* $Revision: 1.4 $ +* +* 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 +* +* for a copy of the LGPLv3 License. +************************************************************************/ + +#ifndef INCLUDED_SHELL_SOURCE_BACKENDS_KDEBE_KDEACCESS_HXX +#define INCLUDED_SHELL_SOURCE_BACKENDS_KDEBE_KDEACCESS_HXX + +#include "sal/config.h" + +namespace com { namespace sun { namespace star { namespace uno { + class Any; +} } } } +namespace rtl { class OUString; } + +namespace kdeaccess { + +com::sun::star::uno::Any getValue(rtl::OUString const & id); + +} + +#endif diff --git a/shell/source/backends/kdebe/kdebackend.cxx b/shell/source/backends/kdebe/kdebackend.cxx index 5f1ab4e7bc0d..0f52c2a917c1 100644 --- a/shell/source/backends/kdebe/kdebackend.cxx +++ b/shell/source/backends/kdebe/kdebackend.cxx @@ -1,158 +1,220 @@ /************************************************************************* - * - * 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: kdebackend.cxx,v $ - * $Revision: 1.7 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" - -#include "kdebackend.hxx" -#include "kdecommonlayer.hxx" -#include "kdeinetlayer.hxx" -#include "kdevcllayer.hxx" -#include "kdepathslayer.hxx" +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2009 by Sun Microsystems, Inc. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* $RCSfile: code,v $ +* +* $Revision: 1.4 $ +* +* 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 +* +* for a copy of the LGPLv3 License. +************************************************************************/ -//------------------------------------------------------------------------------ +#include "precompiled_shell.hxx" +#include "sal/config.h" + +#include "boost/noncopyable.hpp" +#include "com/sun/star/container/NoSuchElementException.hpp" +#include "com/sun/star/container/XNameAccess.hpp" +#include "com/sun/star/lang/XMultiComponentFactory.hpp" +#include "com/sun/star/lang/XServiceInfo.hpp" +#include "com/sun/star/lang/WrappedTargetException.hpp" +#include "com/sun/star/uno/Any.hxx" +#include "com/sun/star/uno/RuntimeException.hpp" +#include "com/sun/star/uno/Sequence.hxx" +#include "com/sun/star/uno/Type.hxx" +#include "com/sun/star/uno/XComponentContext.hpp" +#include "com/sun/star/uno/XCurrentContext.hpp" +#include "cppu/unotype.hxx" +#include "cppuhelper/factory.hxx" +#include "cppuhelper/implbase2.hxx" +#include "cppuhelper/implementationentry.hxx" +#include "cppuhelper/weak.hxx" +#include "rtl/string.h" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" +#include "uno/current_context.hxx" +#include "uno/lbnames.h" +#include "vcl/kde_headers.h" + +#include "kdeaccess.hxx" + +namespace { + +namespace css = com::sun::star; + +rtl::OUString SAL_CALL getServiceImplementationName() { + return rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.comp.configuration.backend.KDEBackend")); +} -KDEBackend* KDEBackend::mInstance= 0; +css::uno::Sequence< rtl::OUString > SAL_CALL getServiceSupportedServiceNames() { + rtl::OUString name( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.backend.KDEBackend")); + return css::uno::Sequence< rtl::OUString >(&name, 1); +} -KDEBackend* KDEBackend::createInstance(const uno::Reference& xContext) +class Service: + public cppu::WeakImplHelper2< + css::lang::XServiceInfo, css::container::XNameAccess >, + private boost::noncopyable { - if (mInstance == 0) - { - mInstance = new KDEBackend (xContext); +public: + Service(); + +private: + virtual ~Service() {} + + virtual rtl::OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException) + { return getServiceImplementationName(); } + + virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName) + throw (css::uno::RuntimeException) + { return ServiceName == getSupportedServiceNames()[0]; } + + virtual css::uno::Sequence< rtl::OUString > SAL_CALL + getSupportedServiceNames() throw (css::uno::RuntimeException) + { return getServiceSupportedServiceNames(); } + + virtual css::uno::Type SAL_CALL getElementType() + throw (css::uno::RuntimeException) + { return cppu::UnoType< cppu::UnoVoidType >::get(); } + + virtual sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException) + { return true; } + + virtual css::uno::Any SAL_CALL getByName(rtl::OUString const & aName) + throw ( + css::container::NoSuchElementException, + css::lang::WrappedTargetException, css::uno::RuntimeException); + + virtual css::uno::Sequence< rtl::OUString > SAL_CALL getElementNames() + throw (css::uno::RuntimeException); + + virtual sal_Bool SAL_CALL hasByName(rtl::OUString const & aName) + throw (css::uno::RuntimeException); + + bool enabled_; +}; + +Service::Service(): enabled_(false) { + css::uno::Reference< css::uno::XCurrentContext > context( + css::uno::getCurrentContext()); + if (context.is()) { + rtl::OUString desktop; + context->getValueByName( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("system.desktop-environment"))) >>= + desktop; + enabled_ = desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KDE")) && + KApplication::kApplication() != 0; } - - return mInstance; } -//------------------------------------------------------------------------------ - -KDEBackend::KDEBackend(const uno::Reference& xContext) - throw (backend::BackendAccessException) - : BackendBase(mMutex), m_xContext(xContext) +css::uno::Any Service::getByName(rtl::OUString const & aName) + throw ( + css::container::NoSuchElementException, + css::lang::WrappedTargetException, css::uno::RuntimeException) { + if (!hasByName(aName)) { + throw css::container::NoSuchElementException( + aName, static_cast< cppu::OWeakObject * >(this)); + } + return enabled_ + ? kdeaccess::getValue(aName) + : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); } -//------------------------------------------------------------------------------ - -KDEBackend::~KDEBackend(void) +css::uno::Sequence< rtl::OUString > Service::getElementNames() + throw (css::uno::RuntimeException) { + css::uno::Sequence< rtl::OUString > names(13); + names[0] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("EnableATToolSupport")); + names[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ExternalMailer")); + names[2] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("SourceViewFontHeight")); + names[3] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SourceViewFontName")); + names[4] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WorkPathVariable")); + names[5] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyName")); + names[6] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyPort")); + names[7] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyName")); + names[8] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyPort")); + names[9] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyName")); + names[10] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyPort")); + names[11] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetNoProxy")); + names[12] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetProxyType")); + return names; } -//------------------------------------------------------------------------------ - -uno::Reference SAL_CALL KDEBackend::getLayer( - const rtl::OUString& aComponent, const rtl::OUString& /* aTimestamp */) - throw (backend::BackendAccessException, lang::IllegalArgumentException) +sal_Bool Service::hasByName(rtl::OUString const & aName) + throw (css::uno::RuntimeException) { - uno::Reference xLayer; - - if( aComponent.equalsAscii("org.openoffice.Office.Common" ) ) - { - xLayer = new KDECommonLayer(m_xContext); - } - else if( aComponent.equalsAscii("org.openoffice.Inet" ) ) - { - xLayer = new KDEInetLayer(m_xContext); - } - else if( aComponent.equalsAscii("org.openoffice.VCL" ) ) - { - xLayer = new KDEVCLLayer(m_xContext); - } - else if( aComponent.equalsAscii("org.openoffice.Office.Paths" ) ) - { - xLayer = new KDEPathsLayer(m_xContext); + css::uno::Sequence< rtl::OUString > names(getElementNames()); + for (sal_Int32 i = 0; i < names.getLength(); ++i) { + if (aName == names[i]) { + return true; + } } - - return xLayer; + return false; } -//------------------------------------------------------------------------------ - -uno::Reference SAL_CALL -KDEBackend::getUpdatableLayer(const rtl::OUString& /* aComponent */) - throw (backend::BackendAccessException,lang::NoSupportException, - lang::IllegalArgumentException) +css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( + css::uno::Reference< css::uno::XComponentContext > const &) { - throw lang::NoSupportException( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("KDEBackend: No Update Operation allowed, Read Only access") ), - *this) ; + return static_cast< cppu::OWeakObject * >(new Service); } -//------------------------------------------------------------------------------ +static cppu::ImplementationEntry const services[] = { + { &createInstance, &getServiceImplementationName, + &getServiceSupportedServiceNames, &cppu::createSingleComponentFactory, 0, + 0 }, + { 0, 0, 0, 0, 0, 0 } +}; -rtl::OUString SAL_CALL KDEBackend::getBackendName(void) -{ - return rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.KDEBackend") ); } -//------------------------------------------------------------------------------ - -rtl::OUString SAL_CALL KDEBackend::getImplementationName(void) - throw (uno::RuntimeException) +extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( + char const * pImplName, void * pServiceManager, void * pRegistryKey) { - return getBackendName() ; + return cppu::component_getFactoryHelper( + pImplName, pServiceManager, pRegistryKey, services); } -//------------------------------------------------------------------------------ - -uno::Sequence SAL_CALL KDEBackend::getBackendServiceNames(void) +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL +component_getImplementationEnvironment( + char const ** ppEnvTypeName, uno_Environment **) { - uno::Sequence aServices(1) ; - aServices[0] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.KDEBackend")) ; - - return aServices ; + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//------------------------------------------------------------------------------ - -sal_Bool SAL_CALL KDEBackend::supportsService(const rtl::OUString& aServiceName) - throw (uno::RuntimeException) +extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( + void * pServiceManager, void * pRegistryKey) { - uno::Sequence< rtl::OUString > const svc = getBackendServiceNames(); - - for(sal_Int32 i = 0; i < svc.getLength(); ++i ) - if(svc[i] == aServiceName) - return true; - - return false; -} - -//------------------------------------------------------------------------------ - -uno::Sequence -SAL_CALL KDEBackend::getSupportedServiceNames(void) - throw (uno::RuntimeException) -{ - return getBackendServiceNames() ; + return component_writeInfoHelper(pServiceManager, pRegistryKey, services); } - -// --------------------------------------------------------------------------------------- diff --git a/shell/source/backends/kdebe/kdebackend.hxx b/shell/source/backends/kdebe/kdebackend.hxx deleted file mode 100644 index 57cb2338a5bf..000000000000 --- a/shell/source/backends/kdebe/kdebackend.hxx +++ /dev/null @@ -1,128 +0,0 @@ -/************************************************************************* - * - * 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: kdebackend.hxx,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef KDEBACKEND_HXX_ -#define KDEBACKEND_HXX_ - -#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XSCHEMASUPPLIER_HPP_ -#include -#endif -#include -#include -#include -#include -#include -#include - -#ifndef INCLUDED_MAP -#include -#define INCLUDED_MAP -#endif - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; - - -//------------------------------------------------------------------------------ -typedef cppu::WeakComponentImplHelper2 BackendBase ; - -/** - Implements the SingleLayerStratum service for KDE access. - */ -class KDEBackend : public BackendBase { - public : - - static KDEBackend* createInstance(const uno::Reference& xContext); - - // XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName( ) - throw (uno::RuntimeException) ; - - virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& aServiceName ) - throw (uno::RuntimeException) ; - - virtual uno::Sequence SAL_CALL getSupportedServiceNames( ) - throw (uno::RuntimeException) ; - - /** - Provides the implementation name. - - @return implementation name - */ - static rtl::OUString SAL_CALL getBackendName(void) ; - - /** - Provides the supported services names - - @return service names - */ - static uno::Sequence SAL_CALL getBackendServiceNames(void) ; - - //XSingleLayerStratum - virtual uno::Reference SAL_CALL - getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp ) - throw (backend::BackendAccessException, lang::IllegalArgumentException) ; - - virtual uno::Reference SAL_CALL - getUpdatableLayer( const rtl::OUString& aLayerId ) - throw (backend::BackendAccessException, lang::NoSupportException, - lang::IllegalArgumentException) ; - - protected: - /** - Service constructor from a service factory. - - @param xContext component context - */ - KDEBackend(const uno::Reference& xContext) - throw (backend::BackendAccessException); - - /** Destructor */ - ~KDEBackend(void) ; - - private: - - /** Build KDE/OO mapping table */ - void initializeMappingTable (); - - - /** The component context */ - uno::Reference m_xContext; - - /** Mutex for reOOurces protection */ - osl::Mutex mMutex ; - - static KDEBackend* mInstance; -}; - -#endif // CONFIGMGR_LOCALBE_LOCALSINGLESTRATUM_HXX_ diff --git a/shell/source/backends/kdebe/kdebe.xml b/shell/source/backends/kdebe/kdebe.xml deleted file mode 100644 index edb1beb0698e..000000000000 --- a/shell/source/backends/kdebe/kdebe.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - kdebe - - Éric Bischoff - com.sun.star.comp.configuration.backend.KDEBackend - The KDE configuration backend - com.sun.star.loader.SharedLibrary - c++ - - com.sun.star.comp.configuration.backend.KDEBackend - ... - com.sun.star.configuration.backend.XBackendChangesListener - com.sun.star.configuration.backend.XBackendChangesNotifier - com.sun.star.configuration.backend.XLayerHandler - com.sun.star.configuration.backend.XSingleLayerStratum - com.sun.star.lang.XMultiComponentFactory - com.sun.star.lang.XServiceInfo - com.sun.star.lang.XSingleComponentFactory - com.sun.star.lang.XTypeProvider - com.sun.star.uno.TypeClass - com.sun.star.uno.XAggregation - com.sun.star.uno.XComponentContext - com.sun.star.uno.XCurrentContext - com.sun.star.uno.XWeak - com.sun.star.registry.XRegistryKey - - cppuhelper - cppu - sal - cppuhelper3$(COM) - cppu3 - sal3 - diff --git a/shell/source/backends/kdebe/kdebecdef.cxx b/shell/source/backends/kdebe/kdebecdef.cxx deleted file mode 100644 index 4ef90e992b03..000000000000 --- a/shell/source/backends/kdebe/kdebecdef.cxx +++ /dev/null @@ -1,143 +0,0 @@ -/************************************************************************* - * - * 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: kdebecdef.cxx,v $ - * $Revision: 1.8 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" -#include "kdebackend.hxx" -#include - -#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_ -#include -#endif -#include -#include - -#include "uno/current_context.hxx" - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; - -//============================================================================== - -static uno::Reference SAL_CALL createKDEBackend(const uno::Reference& xContext) -{ - try { - uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext()); - - if (xCurrentContext.is()) - { - uno::Any aValue = xCurrentContext->getValueByName( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "system.desktop-environment" ) ) ); - - rtl::OUString aDesktopEnvironment; - if ( (aValue >>= aDesktopEnvironment) && (aDesktopEnvironment.equalsAscii("KDE")) && (KApplication::kApplication() != NULL) ) - return * KDEBackend::createInstance(xContext); - } - - return uno::Reference(); - - } catch (uno::RuntimeException e) { - return uno::Reference(); - } - -} - -//============================================================================== - -static const cppu::ImplementationEntry kImplementations_entries[] = -{ - { - createKDEBackend, - KDEBackend::getBackendName, - KDEBackend::getBackendServiceNames, - cppu::createSingleComponentFactory, - NULL, - 0 - }, - { NULL, NULL, NULL, NULL, NULL, 0 } -} ; -//------------------------------------------------------------------------------ - -extern "C" void SAL_CALL component_getImplementationEnvironment( - const sal_Char **aEnvTypeName, - uno_Environment **) { - *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; -} - -//------------------------------------------------------------------------------ - -extern "C" sal_Bool SAL_CALL component_writeInfo(void *, - void *pRegistryKey) { - - using namespace ::com::sun::star::registry; - if (pRegistryKey) - { - try - { - uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + KDEBackend::getBackendName() - ); - - // Register associated service names - uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") ) - ); - - uno::Sequence sServiceNames = KDEBackend::getBackendServiceNames(); - for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i) - xServicesKey->createKey(sServiceNames[i]); - - return sal_True; - } - - catch( InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "InvalidRegistryException caught"); - } - } - - return sal_False; -} - -//------------------------------------------------------------------------------ - -extern "C" void *component_getFactory(const sal_Char *aImplementationName, - void *aServiceManager, - void *aRegistryKey) { - - return cppu::component_getFactoryHelper( - aImplementationName, - aServiceManager, - aRegistryKey, - kImplementations_entries) ; -} -//------------------------------------------------------------------------------ diff --git a/shell/source/backends/kdebe/kdecommonlayer.cxx b/shell/source/backends/kdebe/kdecommonlayer.cxx deleted file mode 100644 index d2347f7becdb..000000000000 --- a/shell/source/backends/kdebe/kdecommonlayer.cxx +++ /dev/null @@ -1,153 +0,0 @@ -/************************************************************************* - * - * 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: kdecommonlayer.cxx,v $ - * $Revision: 1.7 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" -#include "kdecommonlayer.hxx" -#include -#include -#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_ -#include -#endif -#include - -#define SPACE ' ' - -//============================================================================== - -KDECommonLayer::KDECommonLayer(const uno::Reference& xContext) -{ - //Create instance of LayerContentDescriber Service - rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.configuration.backend.LayerDescriber")); - - typedef uno::Reference LayerDescriber; - uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); - if( xServiceManager.is() ) - { - m_xLayerContentDescriber = LayerDescriber::query( - xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext)); - } - else - { - OSL_TRACE("Could not retrieve ServiceManager"); - } -} - -//------------------------------------------------------------------------------ - -void SAL_CALL KDECommonLayer::readData( const uno::Reference& xHandler) - throw ( backend::MalformedDataException, lang::NullPointerException, - lang::WrappedTargetException, uno::RuntimeException) -{ - if( ! m_xLayerContentDescriber.is() ) - { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service" - ) ), static_cast < backend::XLayer * > (this) ); - } - - uno::Sequence aPropInfoList(3); - sal_Int32 nProperties = 0; - - // Email client settings - KEMailSettings aEmailSettings; - QString aClientProgram; - ::rtl::OUString sClientProgram; - - aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram ); - if ( aClientProgram.isEmpty() ) - aClientProgram = "kmail"; - else - aClientProgram = aClientProgram.section(SPACE, 0, 0); - sClientProgram = (const sal_Unicode *) aClientProgram.ucs2(); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/ExternalMailer/Program") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( sClientProgram ); - - // Source code font settings - QFont aFixedFont; - QString aFontName; - :: rtl::OUString sFontName; - short nFontHeight; - - aFixedFont = KGlobalSettings::fixedFont(); - aFontName = aFixedFont.family(); - sFontName = (const sal_Unicode *) aFontName.ucs2(); - nFontHeight = aFixedFont.pointSize(); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontName") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( sFontName ); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontHeight") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "short" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( nFontHeight ); - - if( nProperties > 0 ) - { - aPropInfoList.realloc(nProperties); - m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList); - } -} - -//------------------------------------------------------------------------------ - -rtl::OUString SAL_CALL KDECommonLayer::getTimestamp(void) - throw (uno::RuntimeException) -{ - // Return the value as timestamp to avoid regenerating the binary cache - // on each office launch. - - KEMailSettings aEmailSettings; - QString aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram ); - aClientProgram = aClientProgram.section(SPACE, 0, 0); - - QString aFixedFont = KGlobalSettings::fixedFont().toString(); - - ::rtl::OUString sTimeStamp, - sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) ); - - sTimeStamp = (const sal_Unicode *) aClientProgram.ucs2(); - sTimeStamp += sep; - sTimeStamp += (const sal_Unicode *) aFixedFont.ucs2(); - - return sTimeStamp; -} diff --git a/shell/source/backends/kdebe/kdecommonlayer.hxx b/shell/source/backends/kdebe/kdecommonlayer.hxx deleted file mode 100644 index e61661589145..000000000000 --- a/shell/source/backends/kdebe/kdecommonlayer.hxx +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef KDECOMMONLAYER_HXX_ -#define KDECOMMONLAYER_HXX_ - -#include "kdebackend.hxx" -#include -#include -#include -#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_ -#include -#endif -#include -#include - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; -namespace util = css::util ; - -/** - Implementation of the XLayer interface for the KDE values mapped into - the org.openoffice.Office.Common configuration component. - */ -class KDECommonLayer : public cppu::WeakImplHelper2 -{ -public : - /** - Constructor given the component context - - @param xContext The component context - */ - - KDECommonLayer(const uno::Reference& xContext); - - // XLayer - virtual void SAL_CALL readData( - const uno::Reference& xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException) ; - - // XTimeStamped - virtual rtl::OUString SAL_CALL getTimestamp(void) - throw (uno::RuntimeException); - - protected: - - /** Destructor */ - ~KDECommonLayer(void) {} - - private : - uno::Reference m_xLayerContentDescriber ; - } ; - -#endif // KDECOMMONLAYER diff --git a/shell/source/backends/kdebe/kdeinetlayer.cxx b/shell/source/backends/kdebe/kdeinetlayer.cxx deleted file mode 100644 index 78cc0f4ba06d..000000000000 --- a/shell/source/backends/kdebe/kdeinetlayer.cxx +++ /dev/null @@ -1,254 +0,0 @@ -/************************************************************************* - * - * 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: kdeinetlayer.cxx,v $ - * $Revision: 1.7 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" -#include "kdeinetlayer.hxx" -#include -#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_ -#include -#endif -#include - -#define COMMA ',' -#define SEMI_COLON ';' - -//============================================================================== - -KDEInetLayer::KDEInetLayer(const uno::Reference& xContext) -{ - //Create instance of LayerContentDescriber Service - rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.configuration.backend.LayerDescriber")); - - typedef uno::Reference LayerDescriber; - uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); - if( xServiceManager.is() ) - { - m_xLayerContentDescriber = LayerDescriber::query( - xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext)); - } - else - { - OSL_TRACE("Could not retrieve ServiceManager"); - } -} - -//------------------------------------------------------------------------------ - -void SAL_CALL KDEInetLayer::readData( const uno::Reference& xHandler) - throw ( backend::MalformedDataException, lang::NullPointerException, - lang::WrappedTargetException, uno::RuntimeException) -{ - if( ! m_xLayerContentDescriber.is() ) - { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service" - ) ), static_cast < backend::XLayer * > (this) ); - } - - uno::Sequence aPropInfoList(8); - sal_Int32 nProperties = 0; - - switch ( KProtocolManager::proxyType() ) - { - case KProtocolManager::ManualProxy: // Proxies are manually configured - setProxy(aPropInfoList, nProperties, 1, - KProtocolManager::noProxyFor(), - KProtocolManager::proxyFor( "HTTP" ), - KProtocolManager::proxyFor( "FTP" ), - KProtocolManager::proxyFor( "HTTPS" )); - break; - case KProtocolManager::PACProxy: // A proxy configuration URL has been given - case KProtocolManager::WPADProxy: // A proxy should be automatically discovered - case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables -// In such cases, the proxy address is not stored in KDE, but determined dynamically. -// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind... -// The best we can do here is to ask the current value for a given address. - setProxy(aPropInfoList, nProperties, 1, - KProtocolManager::noProxyFor(), - KProtocolManager::proxyForURL( "http://www.openoffice.org" ), - KProtocolManager::proxyForURL( "ftp://ftp.openoffice.org" ), - KProtocolManager::proxyForURL( "https://www.openoffice.org" )); - break; - default: // No proxy is used - setProxy(aPropInfoList, nProperties, 0); - } - - if ( nProperties > 0 ) - { - aPropInfoList.realloc(nProperties); - m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList); - } -} - -//------------------------------------------------------------------------------ - -rtl::OUString SAL_CALL KDEInetLayer::getTimestamp(void) - throw (uno::RuntimeException) -{ - // Return the value as timestamp to avoid regenerating the binary cache - // on each office launch. - - QString aProxyType, aNoProxyFor, aHTTPProxy, aHTTPSProxy, aFTPProxy; - - switch ( KProtocolManager::proxyType() ) - { - case KProtocolManager::ManualProxy: - aProxyType = '1'; - aNoProxyFor = KProtocolManager::noProxyFor(); - aHTTPProxy = KProtocolManager::proxyFor( "HTTP" ); - aHTTPProxy = KProtocolManager::proxyFor( "HTTPS" ); - aFTPProxy = KProtocolManager::proxyFor( "FTP" ); - break; - case KProtocolManager::PACProxy: - case KProtocolManager::WPADProxy: - case KProtocolManager::EnvVarProxy: - aProxyType = '1'; - aNoProxyFor = KProtocolManager::noProxyFor(); - aHTTPProxy = KProtocolManager::proxyForURL( "http://www.openoffice.org" ); - aHTTPSProxy = KProtocolManager::proxyForURL( "https://www.openoffice.org" ); - aFTPProxy = KProtocolManager::proxyForURL( "ftp://ftp.openoffice.org" ); - break; - default: - aProxyType = '0'; - } - - ::rtl::OUString sTimeStamp, - sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) ); - - sTimeStamp = (const sal_Unicode *) aProxyType.ucs2(); - sTimeStamp += sep; - sTimeStamp += (const sal_Unicode *) aNoProxyFor.ucs2(); - sTimeStamp += sep; - sTimeStamp += (const sal_Unicode *) aHTTPProxy.ucs2(); - sTimeStamp += sep; - sTimeStamp += (const sal_Unicode *) aHTTPSProxy.ucs2(); - sTimeStamp += sep; - sTimeStamp += (const sal_Unicode *) aFTPProxy.ucs2(); - - return sTimeStamp; -} - -//------------------------------------------------------------------------------ - -void SAL_CALL KDEInetLayer::setProxy - (uno::Sequence &aPropInfoList, sal_Int32 &nProperties, - int nProxyType, const QString &aNoProxy, const QString &aHTTPProxy, const QString &aFTPProxy, const QString &aHTTPSProxy ) const -{ - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "int" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( (sal_Int32) nProxyType ); - - if (nProxyType == 0) return; - - if ( !aNoProxy.isEmpty() ) - { - QString aNoProxyFor(aNoProxy); - ::rtl::OUString sNoProxyFor; - - aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON ); - sNoProxyFor = (const sal_Unicode *) aNoProxyFor.ucs2(); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( sNoProxyFor ); - } - - if ( !aHTTPProxy.isEmpty() ) - { - KURL aProxy(aHTTPProxy); - ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2(); - sal_Int32 nPort = aProxy.port(); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( sProxy ); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "int" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( nPort ); - } - - if ( !aHTTPSProxy.isEmpty() ) - { - KURL aProxy(aHTTPSProxy); - ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2(); - sal_Int32 nPort = aProxy.port(); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( sProxy ); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "int" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( nPort ); - } - - if ( !aFTPProxy.isEmpty() ) - { - KURL aProxy(aFTPProxy); - ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2(); - sal_Int32 nPort = aProxy.port(); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( sProxy ); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "int" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( nPort ); - } -} - diff --git a/shell/source/backends/kdebe/kdeinetlayer.hxx b/shell/source/backends/kdebe/kdeinetlayer.hxx deleted file mode 100644 index 7e8053a67b7b..000000000000 --- a/shell/source/backends/kdebe/kdeinetlayer.hxx +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef KDEINETLAYER_HXX_ -#define KDEINETLAYER_HXX_ - -#include "kdebackend.hxx" -#include -#include -#include -#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_ -#include -#endif -#include -#include -#include - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; -namespace util = css::util ; - -/** - Implementation of the XLayer interface for the KDE values mapped into - the org.openoffice.Inet configuration component. - */ -class KDEInetLayer : public cppu::WeakImplHelper2 -{ -public : - /** - Constructor given the component context - - @param xContext The component context - */ - - KDEInetLayer(const uno::Reference& xContext); - - // XLayer - virtual void SAL_CALL readData( - const uno::Reference& xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException) ; - - // XTimeStamped - virtual rtl::OUString SAL_CALL getTimestamp(void) - throw (uno::RuntimeException); - - protected: - - /** Destructor */ - ~KDEInetLayer(void) {} - -private : - uno::Reference m_xLayerContentDescriber ; - - void SAL_CALL setProxy - (uno::Sequence &aPropInfoList, sal_Int32 &nProperties, - int nProxyType, const QString &aNoProxyfor = QString(), - const QString &aHTTPProxy = QString(), const QString &aFTPProxy = QString(), const QString &aHTTPSProxy = QString()) const; - } ; - -#endif // KDEINETLAYER diff --git a/shell/source/backends/kdebe/kdepathslayer.cxx b/shell/source/backends/kdebe/kdepathslayer.cxx deleted file mode 100644 index 34d85ee93d6d..000000000000 --- a/shell/source/backends/kdebe/kdepathslayer.cxx +++ /dev/null @@ -1,121 +0,0 @@ -/************************************************************************* - * - * 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: kdepathslayer.cxx,v $ - * $Revision: 1.5 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" -#include "kdepathslayer.hxx" -#include -#include -#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_ -#include -#endif -#include -#include -#include - -#define SPACE ' ' - -//============================================================================== - -KDEPathsLayer::KDEPathsLayer(const uno::Reference& xContext) -{ - //Create instance of LayerContentDescriber Service - rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.configuration.backend.LayerDescriber")); - - typedef uno::Reference LayerDescriber; - uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); - if( xServiceManager.is() ) - { - m_xLayerContentDescriber = LayerDescriber::query( - xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext)); - } - else - { - OSL_TRACE("Could not retrieve ServiceManager"); - } -} - -//------------------------------------------------------------------------------ - -void SAL_CALL KDEPathsLayer::readData( const uno::Reference& xHandler) - throw ( backend::MalformedDataException, lang::NullPointerException, - lang::WrappedTargetException, uno::RuntimeException) -{ - if( ! m_xLayerContentDescriber.is() ) - { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service" - ) ), static_cast < backend::XLayer * > (this) ); - } - - uno::Sequence aPropInfoList(1); - sal_Int32 nProperties = 0; - - QString aDocumentsDir( KGlobalSettings::documentPath() ); - rtl::OUString sDocumentsDir; - rtl::OUString sDocumentsURL; - if ( aDocumentsDir.endsWith(QChar('/')) ) - aDocumentsDir.truncate ( aDocumentsDir.length() - 1 ); - sDocumentsDir = (const sal_Unicode *) aDocumentsDir.ucs2(); - osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData ); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Paths/Variables/Work") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( sDocumentsURL ); - - if( nProperties > 0 ) - { - aPropInfoList.realloc(nProperties); - m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList); - } -} - -//------------------------------------------------------------------------------ - -rtl::OUString SAL_CALL KDEPathsLayer::getTimestamp(void) - throw (uno::RuntimeException) -{ - // Return the value as timestamp to avoid regenerating the binary cache - // on each office launch. - - ::rtl::OUString sTimeStamp, - sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) ); - - QString aDocumentsDir; - aDocumentsDir = KGlobalSettings::documentPath(); - - sTimeStamp += (const sal_Unicode *) aDocumentsDir.ucs2(); - - return sTimeStamp; -} diff --git a/shell/source/backends/kdebe/kdepathslayer.hxx b/shell/source/backends/kdebe/kdepathslayer.hxx deleted file mode 100644 index 5a3b365be277..000000000000 --- a/shell/source/backends/kdebe/kdepathslayer.hxx +++ /dev/null @@ -1,86 +0,0 @@ -/************************************************************************* - * - * 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: kdepathslayer.hxx,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef KDEPATHSLAYER_HXX_ -#define KDEPATHSLAYER_HXX_ - -#include "kdebackend.hxx" -#include -#include -#include -#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_ -#include -#endif -#include -#include - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; -namespace util = css::util ; - -/** - Implementation of the XLayer interface for the KDE values mapped into - the org.openoffice.Office.Paths configuration component. - */ -class KDEPathsLayer : public cppu::WeakImplHelper2 -{ -public : - /** - Constructor given the component context - - @param xContext The component context - */ - - KDEPathsLayer(const uno::Reference& xContext); - - // XLayer - virtual void SAL_CALL readData( - const uno::Reference& xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException) ; - - // XTimeStamped - virtual rtl::OUString SAL_CALL getTimestamp(void) - throw (uno::RuntimeException); - - protected: - - /** Destructor */ - ~KDEPathsLayer(void) {} - - private : - uno::Reference m_xLayerContentDescriber ; - } ; - -#endif // KDEPATHSLAYER diff --git a/shell/source/backends/kdebe/kdevcllayer.cxx b/shell/source/backends/kdebe/kdevcllayer.cxx deleted file mode 100644 index d657ea5054a6..000000000000 --- a/shell/source/backends/kdebe/kdevcllayer.cxx +++ /dev/null @@ -1,116 +0,0 @@ -/************************************************************************* - * - * 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: kdevcllayer.cxx,v $ - * $Revision: 1.5 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" -#include "kdevcllayer.hxx" -#include -#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_ -#include -#endif -#include -#include - -//============================================================================== - -KDEVCLLayer::KDEVCLLayer(const uno::Reference& xContext) -{ - //Create instance of LayerContentDescriber Service - rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.configuration.backend.LayerDescriber")); - - typedef uno::Reference LayerDescriber; - uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); - if( xServiceManager.is() ) - { - m_xLayerContentDescriber = LayerDescriber::query( - xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext)); - } - else - { - OSL_TRACE("Could not retrieve ServiceManager"); - } -} - -//------------------------------------------------------------------------------ - -void SAL_CALL KDEVCLLayer::readData( const uno::Reference& xHandler) - throw ( backend::MalformedDataException, lang::NullPointerException, - lang::WrappedTargetException, uno::RuntimeException) -{ - if( ! m_xLayerContentDescriber.is() ) - { - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service" - ) ), static_cast < backend::XLayer * > (this) ); - } - - uno::Sequence aPropInfoList(1); - -/* - Commenting out, does not make much sense without an accessibility bridge -=========================================================================== -#if defined(QT_ACCESSIBILITY_SUPPORT) -// Accessibility tools under Qt for UNIX are available starting with Qt 4.0 - int nVersionMajor = 0; - const char *q = qVersion(); // "3.1.0" for example - while ('0' <= *q && *q <= '9') - nVersionMajor = nVersionMajor * 10 + *q++ - '0'; - sal_Bool ATToolSupport = (sal_Bool) (nVersionMajor >= 4); -#else - sal_Bool ATToolSupport = sal_False; -#endif -=========================================================================== - End of commented out section -*/ sal_Bool ATToolSupport = sal_False; - - aPropInfoList[0].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.VCL/Settings/Accessibility/EnableATToolSupport") ); - aPropInfoList[0].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[0].Protected = sal_False; - aPropInfoList[0].Value = uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) ); - - m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList); -} - -//------------------------------------------------------------------------------ - -rtl::OUString SAL_CALL KDEVCLLayer::getTimestamp(void) - throw (uno::RuntimeException) -{ - // Return the value as timestamp to avoid regenerating the binary cache - // on each office launch. - - ::rtl::OUString sTimeStamp( - RTL_CONSTASCII_USTRINGPARAM( "FALSE" ) ); - - return sTimeStamp; -} diff --git a/shell/source/backends/kdebe/kdevcllayer.hxx b/shell/source/backends/kdebe/kdevcllayer.hxx deleted file mode 100644 index 4b3a50e5c4c8..000000000000 --- a/shell/source/backends/kdebe/kdevcllayer.hxx +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef KDEVCLLAYER_HXX_ -#define KDEVCLLAYER_HXX_ - -#include "kdebackend.hxx" -#include -#include -#include -#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_ -#include -#endif -#include -#include - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; -namespace util = css::util ; - -/** - Implementation of the XLayer interface for the KDE values mapped into - the org.openoffice.VCL configuration component. - */ -class KDEVCLLayer : public cppu::WeakImplHelper2 -{ -public : - /** - Constructor given the component context - - @param xContext The component context - */ - - KDEVCLLayer(const uno::Reference& xContext); - - // XLayer - virtual void SAL_CALL readData( - const uno::Reference& xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException) ; - - // XTimeStamped - virtual rtl::OUString SAL_CALL getTimestamp(void) - throw (uno::RuntimeException); - - protected: - - /** Destructor */ - ~KDEVCLLayer(void) {} - - private : - uno::Reference m_xLayerContentDescriber ; - } ; - -#endif // KDEVCLLAYER diff --git a/shell/source/backends/kdebe/makefile.mk b/shell/source/backends/kdebe/makefile.mk index 8bc0b475be8e..289cf8263d14 100644 --- a/shell/source/backends/kdebe/makefile.mk +++ b/shell/source/backends/kdebe/makefile.mk @@ -35,11 +35,7 @@ TARGET=kdebe LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE - -COMP1TYPELIST=$(TARGET) -COMPRDB=$(SOLARBINDIR)$/types.rdb -UNOUCROUT=$(OUT)$/inc$/$(TARGET) -INCPRE=$(UNOUCROUT) +VISIBILITY_HIDDEN=TRUE # --- Settings --- @@ -64,12 +60,8 @@ CFLAGS+=$(KDE_CFLAGS) # --- Files --- SLOFILES=\ - $(SLO)$/kdebackend.obj \ - $(SLO)$/kdecommonlayer.obj \ - $(SLO)$/kdeinetlayer.obj \ - $(SLO)$/kdevcllayer.obj \ - $(SLO)$/kdepathslayer.obj \ - $(SLO)$/kdebecdef.obj + $(SLO)$/kdeaccess.obj \ + $(SLO)$/kdebackend.obj SHL1NOCHECK=TRUE SHL1TARGET=$(TARGET)1.uno @@ -82,8 +74,7 @@ SHL1STDLIBS= \ $(CPPULIB) \ $(SALLIB) \ $(KDE_LIBS) -lkio - -SHL1VERSIONMAP=exports.map + SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/backends/localebe/localebe.xml b/shell/source/backends/localebe/localebe.xml index fb6823b43a05..3c22a4970881 100644 --- a/shell/source/backends/localebe/localebe.xml +++ b/shell/source/backends/localebe/localebe.xml @@ -10,7 +10,6 @@ c++ com.sun.star.comp.configuration.backend.LocaleBackend - com.sun.star.comp.configuration.backend.PlatformBackend ... com.sun.star.configuration.backend.XBackendChangesListener com.sun.star.configuration.backend.XBackendChangesNotifier diff --git a/shell/source/backends/macbe/macbackend.cxx b/shell/source/backends/macbe/macbackend.cxx index 06589e4d6574..f532e943e9c7 100644 --- a/shell/source/backends/macbe/macbackend.cxx +++ b/shell/source/backends/macbe/macbackend.cxx @@ -31,18 +31,139 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_shell.hxx" +// For MAXHOSTNAMELEN constant +#include + +#include +#include +#include +#include + #include "macbackend.hxx" -#include "macbelayer.hxx" -#include -#include -#define MACBE_INET_COMPONENT "org.openoffice.Inet" -#define MACBE_PATHS_COMPONENT "org.openoffice.Office.Paths" +#include "rtl/ustrbuf.hxx" +#include "osl/file.h" + +#define SPACE ' ' +#define SEMI_COLON ';' + +typedef struct +{ + rtl::OUString Server; + sal_Int32 Port; +} ProxyEntry; + +typedef enum { + sHTTP, + sHTTPS, + sFTP +} ServiceType; + +//------------------------------------------------------------------------ +// helper functions +//------------------------------------------------------------------------ + +namespace // private +{ + +/* + * Returns current proxy settings for selected service type (HTTP or + * FTP) as a C string (in the buffer specified by host and hostSize) + * and a port number. + */ + +bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *port) +{ + bool result; + CFDictionaryRef proxyDict; + CFNumberRef enableNum; + int enable; + CFStringRef hostStr; + CFNumberRef portNum; + int portInt; + + proxyDict = SCDynamicStoreCopyProxies(NULL); + + if (!proxyDict) + return false; + + CFStringRef proxiesEnable; + CFStringRef proxiesProxy; + CFStringRef proxiesPort; + + switch ( sType ) + { + case sHTTP : proxiesEnable = kSCPropNetProxiesHTTPEnable; + proxiesProxy = kSCPropNetProxiesHTTPProxy; + proxiesPort = kSCPropNetProxiesHTTPPort; + break; + case sHTTPS: proxiesEnable = kSCPropNetProxiesHTTPSEnable; + proxiesProxy = kSCPropNetProxiesHTTPSProxy; + proxiesPort = kSCPropNetProxiesHTTPSPort; + break; + default: proxiesEnable = kSCPropNetProxiesFTPEnable; + proxiesProxy = kSCPropNetProxiesFTPProxy; + proxiesPort = kSCPropNetProxiesFTPPort; + break; + } + // Proxy enabled? + enableNum = (CFNumberRef) CFDictionaryGetValue( proxyDict, + proxiesEnable ); + + result = (enableNum != NULL) && (CFGetTypeID(enableNum) == CFNumberGetTypeID()); + + if (result) + result = CFNumberGetValue(enableNum, kCFNumberIntType, &enable) && (enable != 0); + + // Proxy enabled -> get hostname + if (result) + { + hostStr = (CFStringRef) CFDictionaryGetValue( proxyDict, + proxiesProxy ); + + result = (hostStr != NULL) && (CFGetTypeID(hostStr) == CFStringGetTypeID()); + } + + if (result) + result = CFStringGetCString(hostStr, host, (CFIndex) hostSize, kCFStringEncodingASCII); + + // Get proxy port + if (result) + { + portNum = (CFNumberRef) CFDictionaryGetValue( proxyDict, + proxiesPort ); + + result = (portNum != NULL) && (CFGetTypeID(portNum) == CFNumberGetTypeID()); + } + else + { + CFRelease(proxyDict); + return false; + } + + if (result) + result = CFNumberGetValue(portNum, kCFNumberIntType, &portInt); + + if (result) + *port = (UInt16) portInt; + + if (proxyDict) + CFRelease(proxyDict); + + if (!result) + { + *host = 0; + *port = 0; + } + + return result; +} + +} // end private namespace + +//------------------------------------------------------------------------------ -MacOSXBackend::MacOSXBackend(const uno::Reference& xContext) - throw (backend::BackendAccessException) : - ::cppu::WeakImplHelper2 < backend::XSingleLayerStratum, lang::XServiceInfo > (), - m_xContext(xContext) +MacOSXBackend::MacOSXBackend() { } @@ -54,46 +175,293 @@ MacOSXBackend::~MacOSXBackend(void) //------------------------------------------------------------------------------ -MacOSXBackend* MacOSXBackend::createInstance(const uno::Reference& xContext) +MacOSXBackend* MacOSXBackend::createInstance() { - return new MacOSXBackend(xContext); + return new MacOSXBackend; } // --------------------------------------------------------------------------------------- -uno::Reference SAL_CALL MacOSXBackend::getLayer(const rtl::OUString& aComponent, const rtl::OUString& /*aTimestamp*/) - throw (backend::BackendAccessException, lang::IllegalArgumentException) +rtl::OUString CFStringToOUString(const CFStringRef sOrig) { + CFRetain(sOrig); + + CFIndex nStringLen = CFStringGetLength(sOrig)+1; + + // Allocate a c string buffer + char sBuffer[nStringLen]; + + CFStringGetCString(sOrig, sBuffer, nStringLen, kCFStringEncodingASCII); + + CFRelease(sOrig); + + return rtl::OUString::createFromAscii((sal_Char*)sBuffer); +} + +rtl::OUString GetOUString( NSString* pStr ) { - if( aComponent.equalsAscii( MACBE_INET_COMPONENT ) ) - { - if( ! m_xSystemLayer.is() ) - m_xSystemLayer = new MacOSXLayer( m_xContext ); + if( ! pStr ) + return rtl::OUString(); + int nLen = [pStr length]; + if( nLen == 0 ) + return rtl::OUString(); + + rtl::OUStringBuffer aBuf( nLen+1 ); + aBuf.setLength( nLen ); + [pStr getCharacters: const_cast(aBuf.getStr())]; + return aBuf.makeStringAndClear(); +} - return m_xSystemLayer; - } - else if( aComponent.equalsAscii( MACBE_PATHS_COMPONENT ) ) - { - if( ! m_xPathLayer.is() ) - m_xPathLayer = new MacOSXPathLayer( m_xContext ); - return m_xPathLayer; - } +css::uno::Type MacOSXBackend::getElementType() throw(css::uno::RuntimeException) +{ + return cppu::UnoType< cppu::UnoVoidType >::get(); +} - return uno::Reference(); +sal_Bool MacOSXBackend::hasElements() throw(css::uno::RuntimeException) +{ + return true; } -//------------------------------------------------------------------------------ +css::uno::Any MacOSXBackend::getByName(rtl::OUString const & aName) + throw ( + css::container::NoSuchElementException, + css::lang::WrappedTargetException, css::uno::RuntimeException) +{ + if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("WorkPathVariable"))) { + rtl::OUString aDocDir; + NSArray* pPaths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, true ); + if( pPaths && [pPaths count] > 0 ) + { + aDocDir = GetOUString( [pPaths objectAtIndex: 0] ); + + rtl::OUString aDocURL; + if( aDocDir.getLength() > 0 && + osl_getFileURLFromSystemPath( aDocDir.pData, &aDocURL.pData ) == osl_File_E_None ) + { + return css::uno::makeAny(aDocURL); + } + else + { + OSL_TRACE( "user documents list contains empty file path or conversion failed" ); + } + } + else + { + OSL_TRACE( "Got nil or empty list of user document directories" ); + } + return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + } else if (aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName"))) + { + ProxyEntry aFtpProxy; + + char host[MAXHOSTNAMELEN]; + UInt16 port; + bool retVal; + + retVal = GetProxySetting(sFTP, host, 100, &port); + + if (retVal) + { + aFtpProxy.Server = rtl::OUString::createFromAscii( host ); + } + + // ftp proxy name + if( aFtpProxy.Server.getLength() > 0 ) + { + return uno::makeAny( aFtpProxy.Server ); + } + return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + } else if (aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort"))) + { + ProxyEntry aFtpProxy; + + char host[MAXHOSTNAMELEN]; + UInt16 port; + bool retVal; + + retVal = GetProxySetting(sFTP, host, 100, &port); + + if (retVal) + { + aFtpProxy.Port = port; + } + + // ftp proxy port + if( aFtpProxy.Port > 0 ) + { + return uno::makeAny( aFtpProxy.Port ); + } + return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + } else if (aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName"))) + { + ProxyEntry aHttpProxy; + + char host[MAXHOSTNAMELEN]; + UInt16 port; + bool retVal; + + retVal = GetProxySetting(sHTTP, host, 100, &port); + + if (retVal) + { + aHttpProxy.Server = rtl::OUString::createFromAscii( host ); + } + + // http proxy name + if( aHttpProxy.Server.getLength() > 0 ) + { + return uno::makeAny( aHttpProxy.Server ); + } + return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + } else if (aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort"))) + { + ProxyEntry aHttpProxy; + + char host[MAXHOSTNAMELEN]; + UInt16 port; + bool retVal; + + retVal = GetProxySetting(sHTTP, host, 100, &port); + + if (retVal) + { + aHttpProxy.Port = port; + } + + // http proxy port + if( aHttpProxy.Port > 0 ) + { + return uno::makeAny( aHttpProxy.Port ); + } + return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + } else if (aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName"))) + { + ProxyEntry aHttpsProxy; + + char host[MAXHOSTNAMELEN]; + UInt16 port; + bool retVal; + + retVal = GetProxySetting(sHTTPS, host, 100, &port); + + if (retVal) + { + aHttpsProxy.Server = rtl::OUString::createFromAscii( host ); + } + + // https proxy name + if( aHttpsProxy.Server.getLength() > 0 ) + { + return uno::makeAny( aHttpsProxy.Server ); + } + return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + } else if (aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort"))) + { + ProxyEntry aHttpsProxy; + + char host[MAXHOSTNAMELEN]; + UInt16 port; + bool retVal; + + retVal = GetProxySetting(sHTTPS, host, 100, &port); + + if (retVal) + { + aHttpsProxy.Port = port; + } + + // https proxy port + if( aHttpsProxy.Port > 0 ) + { + return uno::makeAny( aHttpsProxy.Port ); + } + return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + } else if (aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"))) + { + // override default for ProxyType, which is "0" meaning "No proxies". + sal_Int32 nProperties = 1; + return uno::makeAny( nProperties ); + } else if (aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy"))) + { + rtl::OUString aProxyBypassList; + + CFArrayRef rExceptionsList; + CFDictionaryRef rProxyDict = SCDynamicStoreCopyProxies(NULL); + + if (!rProxyDict) + rExceptionsList = false; + else + rExceptionsList = (CFArrayRef) CFDictionaryGetValue(rProxyDict, kSCPropNetProxiesExceptionsList); + + if (rExceptionsList) + { + for (CFIndex idx = 0; idx < CFArrayGetCount(rExceptionsList); idx++) + { + CFStringRef rException = (CFStringRef) CFArrayGetValueAtIndex(rExceptionsList, idx); + + if (idx>0) + aProxyBypassList += rtl::OUString::createFromAscii( ";" ); + + aProxyBypassList += CFStringToOUString(rException); + } + } + + if (rProxyDict) + CFRelease(rProxyDict); + + // fill proxy bypass list + if( aProxyBypassList.getLength() > 0 ) + { + return uno::makeAny( aProxyBypassList.replace( SPACE, SEMI_COLON ) ); + } + return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + } else { + throw css::container::NoSuchElementException( + aName, static_cast< cppu::OWeakObject * >(this)); + } +} -uno::Reference SAL_CALL - MacOSXBackend::getUpdatableLayer(const rtl::OUString& /*aComponent*/) - throw (backend::BackendAccessException,lang::NoSupportException, - lang::IllegalArgumentException) +css::uno::Sequence< rtl::OUString > MacOSXBackend::getElementNames() + throw (css::uno::RuntimeException) { - throw lang::NoSupportException( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "MacOSXBackend: No Update Operation allowed, Read Only access") ), - *this); + css::uno::Sequence< rtl::OUString > names(9); + names[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WorkPathVariable")); + names[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyName")); + names[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyPort")); + names[3] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyName")); + names[4] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyPort")); + names[5] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyName")); + names[6] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyPort")); + names[7] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetNoProxy")); + names[8] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetProxyType")); + return names; +} - return NULL; +sal_Bool MacOSXBackend::hasByName(rtl::OUString const & aName) + throw (css::uno::RuntimeException) +{ + return aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")) || + aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")) || + aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")) || + aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")) || + aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")) || + aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")) || + aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")) || + aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")) || + aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetProxyType")); } //------------------------------------------------------------------------------ @@ -115,9 +483,8 @@ rtl::OUString SAL_CALL MacOSXBackend::getImplementationName(void) uno::Sequence SAL_CALL MacOSXBackend::getBackendServiceNames(void) { - uno::Sequence aServiceNameList(2); + uno::Sequence aServiceNameList(1); aServiceNameList[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.MacOSXBackend")); - aServiceNameList[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.PlatformBackend")); return aServiceNameList; } @@ -143,15 +510,3 @@ uno::Sequence SAL_CALL MacOSXBackend::getSupportedServiceNames(vo { return getBackendServiceNames(); } - -// --------------------------------------------------------------------------------------- - -uno::Sequence SAL_CALL MacOSXBackend::getSupportedComponents(void) -{ - uno::Sequence aSupportedComponentList(2); - aSupportedComponentList[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( MACBE_INET_COMPONENT ) ); - aSupportedComponentList[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( MACBE_PATHS_COMPONENT ) ); - - return aSupportedComponentList; -} - diff --git a/shell/source/backends/macbe/macbackend.hxx b/shell/source/backends/macbe/macbackend.hxx index c25fe4296c0e..cd15aa83e11a 100644 --- a/shell/source/backends/macbe/macbackend.hxx +++ b/shell/source/backends/macbe/macbackend.hxx @@ -31,10 +31,8 @@ #ifndef _MACBACKEND_HXX_ #define _MACBACKEND_HXX_ -#include -#include +#include #include -#include #include #include @@ -44,18 +42,13 @@ namespace css = com::sun::star; namespace uno = css::uno; namespace lang = css::lang; -namespace backend = css::configuration::backend; - -/** - Implements the SingleLayerStratum service. - */ -class MacOSXBackend : public ::cppu::WeakImplHelper2 +class MacOSXBackend : public ::cppu::WeakImplHelper2 { public: - static MacOSXBackend* createInstance(const uno::Reference& xContext); + static MacOSXBackend* createInstance(); // XServiceInfo virtual rtl::OUString SAL_CALL getImplementationName() @@ -81,19 +74,27 @@ public: */ static uno::Sequence SAL_CALL getBackendServiceNames(void); - /** - Provides the supported component nodes + //XNameAccess + virtual uno::Type SAL_CALL + getElementType() + throw (uno::RuntimeException); - @return supported component nodes - */ - static uno::Sequence SAL_CALL getSupportedComponents(void); + virtual sal_Bool SAL_CALL + hasElements() + throw (uno::RuntimeException); + + virtual uno::Any SAL_CALL + getByName( const rtl::OUString& aName ) + throw (css::container::NoSuchElementException, + lang::WrappedTargetException, uno::RuntimeException); - // XSingleLayerStratum - virtual uno::Reference SAL_CALL getLayer(const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp) - throw (backend::BackendAccessException, lang::IllegalArgumentException); + virtual uno::Sequence SAL_CALL + getElementNames() + throw (uno::RuntimeException); - virtual uno::Reference SAL_CALL getUpdatableLayer(const rtl::OUString& aLayerId) - throw (backend::BackendAccessException, lang::NoSupportException, lang::IllegalArgumentException); + virtual sal_Bool SAL_CALL + hasByName( const rtl::OUString& aName ) + throw (uno::RuntimeException); protected: @@ -102,18 +103,10 @@ protected: @param xContext component context */ - MacOSXBackend(const uno::Reference& xContext) - throw (backend::BackendAccessException); + MacOSXBackend(); /** Destructor */ ~MacOSXBackend(void); - -private: - - uno::Reference m_xContext; - uno::Reference m_xSystemLayer; - uno::Reference m_xPathLayer; - }; #endif // _MACBACKEND_HXX_ diff --git a/shell/source/backends/macbe/macbe.xml b/shell/source/backends/macbe/macbe.xml index 85854250cfe3..7cee5bb14de5 100644 --- a/shell/source/backends/macbe/macbe.xml +++ b/shell/source/backends/macbe/macbe.xml @@ -10,7 +10,6 @@ c++ com.sun.star.comp.configuration.backend.MacOSXBackend - com.sun.star.comp.configuration.backend.PlatformBackend ... com.sun.star.configuration.backend.XBackendChangesListener com.sun.star.configuration.backend.XBackendChangesNotifier diff --git a/shell/source/backends/macbe/macbecdef.cxx b/shell/source/backends/macbe/macbecdef.cxx index 22698eb91ec5..ef1d8a7e2382 100644 --- a/shell/source/backends/macbe/macbecdef.cxx +++ b/shell/source/backends/macbe/macbecdef.cxx @@ -42,14 +42,13 @@ namespace css = com::sun::star; namespace uno = css::uno; namespace lang = css::lang; -namespace backend = css::configuration::backend; //------------------------------------------------------------------------------ static uno::Reference SAL_CALL createMacOSXBackend( - const uno::Reference& xContext) + const uno::Reference&) { - return * MacOSXBackend::createInstance(xContext); + return * MacOSXBackend::createInstance(); } //------------------------------------------------------------------------------ @@ -77,41 +76,9 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( //------------------------------------------------------------------------------ -extern "C" sal_Bool SAL_CALL component_writeInfo(void * /*pServiceManager*/, void *pRegistryKey) { - - using namespace ::com::sun::star::registry; - if (pRegistryKey) - { - try - { - uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + MacOSXBackend::getBackendName() - ); - - // Register associated service names - uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") ) - ); - - uno::Sequence sServiceNames = MacOSXBackend::getBackendServiceNames(); - for (sal_Int32 i = 0; i < sServiceNames.getLength(); ++ i) - xServicesKey->createKey(sServiceNames[i]); - - // Register supported components - uno::Reference xComponentKey = xImplKey->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/DATA/SupportedComponents") ) - ); - - xComponentKey->setAsciiListValue( MacOSXBackend::getSupportedComponents() ); - - return sal_True; - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "InvalidRegistryException caught"); - } - } - return sal_False; +extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *pRegistryKey) { + return cppu::component_writeInfoHelper( + pServiceManager, pRegistryKey, kImplementations_entries); } //------------------------------------------------------------------------------ diff --git a/shell/source/backends/macbe/makefile.mk b/shell/source/backends/macbe/makefile.mk index c8f6891d6f87..e2cfd3b3b211 100644 --- a/shell/source/backends/macbe/makefile.mk +++ b/shell/source/backends/macbe/makefile.mk @@ -58,8 +58,7 @@ CFLAGSCXX+=$(OBJCXXFLAGS) SLOFILES= \ $(SLO)$/macbecdef.obj \ - $(SLO)$/macbackend.obj \ - $(SLO)$/macbelayer.obj + $(SLO)$/macbackend.obj SHL1TARGET=$(TARGET)1.uno SHL1OBJS=$(SLOFILES) diff --git a/shell/source/backends/wininetbe/makefile.mk b/shell/source/backends/wininetbe/makefile.mk index be43ecaded36..b26e3a252185 100644 --- a/shell/source/backends/wininetbe/makefile.mk +++ b/shell/source/backends/wininetbe/makefile.mk @@ -50,9 +50,8 @@ DLLPRE = SLOFILES=\ $(SLO)$/wininetbecdef.obj \ - $(SLO)$/wininetbackend.obj \ - $(SLO)$/wininetlayer.obj - + $(SLO)$/wininetbackend.obj + SHL1TARGET=$(TARGET)1.uno SHL1OBJS=$(SLOFILES) SHL1DEF=$(MISC)$/$(SHL1TARGET).def diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx b/shell/source/backends/wininetbe/wininetbackend.cxx index 018560f4f762..344eefa1a08d 100644 --- a/shell/source/backends/wininetbe/wininetbackend.cxx +++ b/shell/source/backends/wininetbe/wininetbackend.cxx @@ -31,76 +31,379 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_shell.hxx" +#include "rtl/ustrbuf.hxx" + #include "wininetbackend.hxx" -#include "wininetlayer.hxx" -#include -#include + +#if defined _MSC_VER +#pragma warning(push, 1) +#endif +#include +#include +#if defined _MSC_VER +#pragma warning(pop) +#endif #define WININET_DLL_NAME "wininet.dll" +#define EQUAL_SIGN '=' +#define COLON ':' +#define SPACE ' ' +#define SEMI_COLON ';' + +namespace { + +struct Library { + HMODULE module; + + Library(HMODULE theModule): module(theModule) {} + + ~Library() { if (module) FreeLibrary(module); } +}; + +} -WinInetBackend::WinInetBackend(const uno::Reference& xContext) - throw (backend::BackendAccessException) : - ::cppu::WeakImplHelper2 < backend::XSingleLayerStratum, lang::XServiceInfo > (), - m_xContext(xContext) +typedef struct { - m_hWinInetDll = LoadLibrary( WININET_DLL_NAME ); + rtl::OUString Server; + rtl::OUString Port; +} ProxyEntry; + +//------------------------------------------------------------------------ +// helper functions +//------------------------------------------------------------------------ + +namespace // private +{ + ProxyEntry ReadProxyEntry(const rtl::OUString& aProxy, sal_Int32& i) + { + ProxyEntry aProxyEntry; + + aProxyEntry.Server = aProxy.getToken( 0, COLON, i ); + if ( i > -1 ) + aProxyEntry.Port = aProxy.getToken( 0, COLON, i ); + + return aProxyEntry; + } + + ProxyEntry FindProxyEntry(const rtl::OUString& aProxyList, const rtl::OUString& aType) + { + sal_Int32 nIndex = 0; + + do + { + // get the next token, e.g. ftp=server:port + rtl::OUString nextToken = aProxyList.getToken( 0, SPACE, nIndex ); + + // split the next token again into the parts separated + // through '=', e.g. ftp=server:port -> ftp and server:port + sal_Int32 i = 0; + if( nextToken.indexOf( EQUAL_SIGN ) > -1 ) + { + if( aType.equals( nextToken.getToken( 0, EQUAL_SIGN, i ) ) ) + return ReadProxyEntry(nextToken, i); + } + else if( aType.getLength() == 0) + return ReadProxyEntry(nextToken, i); + + } while ( nIndex >= 0 ); + + return ProxyEntry(); + } + +} // end private namespace + +//------------------------------------------------------------------------------ + +WinInetBackend::WinInetBackend(): + hasProxyType_(false), hasNoProxy_(false), hasHttpProxyName_(false), + hasHttpProxyPort_(false), hasHttpsProxyName_(false), + hasHttpsProxyPort_(false), hasFtpProxyName_(false), hasFtpProxyPort_(false) +{ + Library hWinInetDll( LoadLibrary( WININET_DLL_NAME ) ); + if( hWinInetDll.module ) + { + typedef BOOL ( WINAPI *InternetQueryOption_Proc_T )( HINTERNET, DWORD, LPVOID, LPDWORD ); + + InternetQueryOption_Proc_T lpfnInternetQueryOption = + reinterpret_cast< InternetQueryOption_Proc_T >( + GetProcAddress( hWinInetDll.module, "InternetQueryOptionA" ) ); + if (lpfnInternetQueryOption) + { + LPINTERNET_PROXY_INFO lpi = NULL; + + // query for the neccessary space + DWORD dwLength = 0; + BOOL bRet = lpfnInternetQueryOption( + NULL, + INTERNET_OPTION_PROXY, + (LPVOID)lpi, + &dwLength ); + + // allocate sufficient space on the heap + // insufficient space on the heap results + // in a stack overflow exception, we assume + // this never happens, because of the relatively + // small amount of memory we need + // _alloca is nice because it is fast and we don't + // have to free the allocated memory, it will be + // automatically done + lpi = reinterpret_cast< LPINTERNET_PROXY_INFO >( + _alloca( dwLength ) ); + + bRet = lpfnInternetQueryOption( + NULL, + INTERNET_OPTION_PROXY, + (LPVOID)lpi, + &dwLength ); + + // if a proxy is disabled, InternetQueryOption returns + // an empty proxy list, so we don't have to check if + // proxy is enabled or not + + rtl::OUString aProxyList = rtl::OUString::createFromAscii( lpi->lpszProxy ); + rtl::OUString aProxyBypassList = rtl::OUString::createFromAscii( lpi->lpszProxyBypass ); + + // override default for ProxyType, which is "0" meaning "No proxies". + sal_Int32 nProperties = 1; + + valueProxyType_ = nProperties; + hasProxyType_ = true; + + // fill proxy bypass list + if( aProxyBypassList.getLength() > 0 ) + { + rtl::OUStringBuffer aReverseList; + sal_Int32 nIndex = 0; + do + { + rtl::OUString aToken = aProxyBypassList.getToken( 0, SPACE, nIndex ); + if ( aProxyList.indexOf( aToken ) == -1 ) + { + if ( aReverseList.getLength() ) + { + aReverseList.insert( 0, sal_Unicode( SEMI_COLON ) ); + aReverseList.insert( 0, aToken ); + } + else + aReverseList = aToken; + } + } + while ( nIndex >= 0 ); + + aProxyBypassList = aReverseList.makeStringAndClear(); + + valueNoProxy_ = aProxyBypassList.replace( SPACE, SEMI_COLON ); + hasNoProxy_ = true; + } + + if( aProxyList.getLength() > 0 ) + { + //------------------------------------------------- + // this implementation follows the algorithm + // of the internet explorer + // if there are type-dependent proxy settings + // and type independent proxy settings in the + // registry the internet explorer chooses the + // type independent proxy for all settings + // e.g. imagine the following registry entry + // ftp=server:port;http=server:port;server:port + // the last token server:port is type independent + // so the ie chooses this proxy server + + // if there is no port specified for a type independent + // server the ie uses the port of an http server if + // there is one and it has a port + //------------------------------------------------- + + ProxyEntry aTypeIndepProxy = FindProxyEntry( aProxyList, rtl::OUString()); + ProxyEntry aHttpProxy = FindProxyEntry( aProxyList, rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "http" ) ) ); + ProxyEntry aHttpsProxy = FindProxyEntry( aProxyList, rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "https" ) ) ); + + ProxyEntry aFtpProxy = FindProxyEntry( aProxyList, rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "ftp" ) ) ); + + if( aTypeIndepProxy.Server.getLength() ) + { + aHttpProxy.Server = aTypeIndepProxy.Server; + aHttpsProxy.Server = aTypeIndepProxy.Server; + aFtpProxy.Server = aTypeIndepProxy.Server; + + if( aTypeIndepProxy.Port.getLength() ) + { + aHttpProxy.Port = aTypeIndepProxy.Port; + aHttpsProxy.Port = aTypeIndepProxy.Port; + aFtpProxy.Port = aTypeIndepProxy.Port; + } + else + { + aFtpProxy.Port = aHttpProxy.Port; + aHttpsProxy.Port = aHttpProxy.Port; + } + } + + // http proxy name + if( aHttpProxy.Server.getLength() > 0 ) + { + valueHttpProxyName_ = aHttpProxy.Server; + hasHttpProxyName_ = true; + } + + // http proxy port + if( aHttpProxy.Port.getLength() > 0 ) + { + valueHttpProxyPort_ = aHttpProxy.Port.toInt32(); + hasHttpProxyPort_ = true; + } + + // https proxy name + if( aHttpsProxy.Server.getLength() > 0 ) + { + valueHttpsProxyName_ = aHttpsProxy.Server; + valueHttpsProxyPort_ = true; + } + + // https proxy port + if( aHttpsProxy.Port.getLength() > 0 ) + { + valueHttpsProxyPort_ = aHttpsProxy.Port.toInt32(); + hasHttpsProxyPort_ = true; + } + + // ftp proxy name + if( aFtpProxy.Server.getLength() > 0 ) + { + valueFtpProxyName_ = aFtpProxy.Server; + hasFtpProxyName_ = true; + } + + // ftp proxy port + if( aFtpProxy.Port.getLength() > 0 ) + { + valueFtpProxyPort_ = aFtpProxy.Port.toInt32(); + hasFtpProxyPort_ = true; + } + } + } + } } //------------------------------------------------------------------------------ WinInetBackend::~WinInetBackend(void) { - if ( m_hWinInetDll ) - FreeLibrary( m_hWinInetDll ); } //------------------------------------------------------------------------------ -WinInetBackend* WinInetBackend::createInstance( - const uno::Reference& xContext -) +WinInetBackend* WinInetBackend::createInstance() { - return new WinInetBackend(xContext); + return new WinInetBackend; } // --------------------------------------------------------------------------------------- -uno::Reference SAL_CALL WinInetBackend::getLayer( - const rtl::OUString& aComponent, const rtl::OUString& /*aTimestamp*/) - throw (backend::BackendAccessException, lang::IllegalArgumentException) +css::uno::Type WinInetBackend::getElementType() throw(css::uno::RuntimeException) { + return cppu::UnoType< cppu::UnoVoidType >::get(); +} - if( aComponent.equals( getSupportedComponents()[0]) ) - { - if( ! m_xSystemLayer.is() && m_hWinInetDll ) - { - WinInetLayer::InternetQueryOption_Proc_T lpfnInternetQueryOption = - reinterpret_cast< WinInetLayer::InternetQueryOption_Proc_T >( - GetProcAddress( m_hWinInetDll, "InternetQueryOptionA" ) ); - - if( lpfnInternetQueryOption ) - m_xSystemLayer = new WinInetLayer(lpfnInternetQueryOption, m_xContext); - } +sal_Bool WinInetBackend::hasElements() throw(css::uno::RuntimeException) +{ + return true; +} - return m_xSystemLayer; +css::uno::Any WinInetBackend::getByName(rtl::OUString const & aName) + throw ( + css::container::NoSuchElementException, + css::lang::WrappedTargetException, css::uno::RuntimeException) +{ + if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName"))) { + return hasFtpProxyName_ + ? uno::makeAny( valueFtpProxyName_ ) + : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + } else if (aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort"))) + { + return hasFtpProxyPort_ + ? uno::makeAny( valueFtpProxyPort_ ) + : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + } else if (aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName"))) + { + return hasHttpProxyName_ + ? uno::makeAny( valueHttpProxyName_ ) + : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + } else if (aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort"))) + { + return hasHttpProxyPort_ + ? uno::makeAny( valueHttpProxyPort_ ) + : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + } else if (aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName"))) + { + return hasHttpsProxyName_ + ? uno::makeAny( valueHttpsProxyName_ ) + : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + } else if (aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort"))) + { + return hasHttpsProxyPort_ + ? uno::makeAny( valueHttpsProxyPort_ ) + : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + } else if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy"))) + { + return hasNoProxy_ + ? uno::makeAny( valueNoProxy_ ) + : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + } else if (aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"))) + { + return hasProxyType_ + ? uno::makeAny( valueProxyType_ ) + : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + } else { + throw css::container::NoSuchElementException( + aName, static_cast< cppu::OWeakObject * >(this)); } - - return uno::Reference(); } -//------------------------------------------------------------------------------ - -uno::Reference SAL_CALL -WinInetBackend::getUpdatableLayer(const rtl::OUString& /*aComponent*/) - throw (backend::BackendAccessException,lang::NoSupportException, - lang::IllegalArgumentException) +css::uno::Sequence< rtl::OUString > WinInetBackend::getElementNames() + throw (css::uno::RuntimeException) { - throw lang::NoSupportException( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "WinInetBackend: No Update Operation allowed, Read Only access") ), - *this) ; + css::uno::Sequence< rtl::OUString > names(8); + names[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyName")); + names[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyPort")); + names[2] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyName")); + names[3] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyPort")); + names[4] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyName")); + names[5] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyPort")); + names[6] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetNoProxy")); + names[7] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetProxyType")); + return names; +} - return NULL; +sal_Bool WinInetBackend::hasByName(rtl::OUString const & aName) + throw (css::uno::RuntimeException) +{ + return + aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")) || + aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")) || + aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")) || + aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")) || + aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")) || + aName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")) || + aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")) || + aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetProxyType")); } //------------------------------------------------------------------------------ @@ -121,9 +424,8 @@ rtl::OUString SAL_CALL WinInetBackend::getImplementationName(void) uno::Sequence SAL_CALL WinInetBackend::getBackendServiceNames(void) { - uno::Sequence aServiceNameList(2); + uno::Sequence aServiceNameList(1); aServiceNameList[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.WinInetBackend")) ; - aServiceNameList[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.PlatformBackend")) ; return aServiceNameList ; } @@ -149,16 +451,3 @@ uno::Sequence SAL_CALL WinInetBackend::getSupportedServiceNames(v { return getBackendServiceNames() ; } - -// --------------------------------------------------------------------------------------- - -uno::Sequence SAL_CALL WinInetBackend::getSupportedComponents(void) -{ - uno::Sequence aSupportedComponentList(1); - aSupportedComponentList[0] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet" ) - ); - - return aSupportedComponentList; -} - diff --git a/shell/source/backends/wininetbe/wininetbackend.hxx b/shell/source/backends/wininetbe/wininetbackend.hxx index c335fe005f12..776fdc5e9c16 100644 --- a/shell/source/backends/wininetbe/wininetbackend.hxx +++ b/shell/source/backends/wininetbe/wininetbackend.hxx @@ -31,38 +31,23 @@ #ifndef _FIXEDVALUEBACKEND_HXX_ #define _FIXEDVALUEBACKEND_HXX_ -#include -#include +#include #include #include #include #include -#if defined _MSC_VER -#pragma warning(push, 1) -#endif -#include -#include -#if defined _MSC_VER -#pragma warning(pop) -#endif - namespace css = com::sun::star ; namespace uno = css::uno ; namespace lang = css::lang ; -namespace backend = css::configuration::backend ; - -/** - Implements the SingleLayerStratum service. - */ class WinInetBackend : public ::cppu::WeakImplHelper2 < - backend::XSingleLayerStratum, + css::container::XNameAccess, lang::XServiceInfo > { public : - static WinInetBackend* createInstance(const uno::Reference& xContext); + static WinInetBackend* createInstance(); // XServiceInfo virtual rtl::OUString SAL_CALL @@ -89,43 +74,57 @@ class WinInetBackend : public ::cppu::WeakImplHelper2 < @return service names */ static uno::Sequence SAL_CALL getBackendServiceNames(void) ; - /** - Provides the supported component nodes - - @return supported component nodes - */ - static uno::Sequence SAL_CALL getSupportedComponents(void) ; - - //XSingleLayerStratum - virtual uno::Reference SAL_CALL - getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp ) - throw (backend::BackendAccessException, - lang::IllegalArgumentException) ; - - virtual uno::Reference SAL_CALL - getUpdatableLayer( const rtl::OUString& aLayerId ) - throw (backend::BackendAccessException, - lang::NoSupportException, - lang::IllegalArgumentException) ; + + //XNameAccess + virtual uno::Type SAL_CALL + getElementType() + throw (uno::RuntimeException); + + virtual sal_Bool SAL_CALL + hasElements() + throw (uno::RuntimeException); + + virtual uno::Any SAL_CALL + getByName( const rtl::OUString& aName ) + throw (css::container::NoSuchElementException, + lang::WrappedTargetException, uno::RuntimeException); + + virtual uno::Sequence SAL_CALL + getElementNames() + throw (uno::RuntimeException); + + virtual sal_Bool SAL_CALL + hasByName( const rtl::OUString& aName ) + throw (uno::RuntimeException); + protected: /** Service constructor from a service factory. @param xContext component context */ - WinInetBackend(const uno::Reference& xContext) - throw (backend::BackendAccessException); + WinInetBackend(); /** Destructor */ ~WinInetBackend(void) ; private: - - uno::Reference m_xContext ; - uno::Reference m_xSystemLayer ; - - // The wininet.dll module handle - HMODULE m_hWinInetDll; + sal_Int32 valueProxyType_; + rtl::OUString valueNoProxy_; + rtl::OUString valueHttpProxyName_; + sal_Int32 valueHttpProxyPort_; + rtl::OUString valueHttpsProxyName_; + sal_Int32 valueHttpsProxyPort_; + rtl::OUString valueFtpProxyName_; + sal_Int32 valueFtpProxyPort_; + bool hasProxyType_; + bool hasNoProxy_; + bool hasHttpProxyName_; + bool hasHttpProxyPort_; + bool hasHttpsProxyName_; + bool hasHttpsProxyPort_; + bool hasFtpProxyName_; + bool hasFtpProxyPort_; } ; diff --git a/shell/source/backends/wininetbe/wininetbe.xml b/shell/source/backends/wininetbe/wininetbe.xml index 42364deba3cb..1bf4bd2cd053 100644 --- a/shell/source/backends/wininetbe/wininetbe.xml +++ b/shell/source/backends/wininetbe/wininetbe.xml @@ -10,7 +10,6 @@ c++ com.sun.star.comp.configuration.backend.Win32Backend - com.sun.star.comp.configuration.backend.PlatformBackend ... com.sun.star.configuration.backend.XBackendChangesListener com.sun.star.configuration.backend.XBackendChangesNotifier diff --git a/shell/source/backends/wininetbe/wininetbecdef.cxx b/shell/source/backends/wininetbe/wininetbecdef.cxx index ae8ad725da1c..6f696ce6fac2 100644 --- a/shell/source/backends/wininetbe/wininetbecdef.cxx +++ b/shell/source/backends/wininetbe/wininetbecdef.cxx @@ -42,14 +42,13 @@ namespace css = com::sun::star ; namespace uno = css::uno ; namespace lang = css::lang ; -namespace backend = css::configuration::backend ; //------------------------------------------------------------------------------ static uno::Reference SAL_CALL createWinInetBackend( - const uno::Reference& xContext){ + const uno::Reference&){ - return * WinInetBackend::createInstance(xContext); + return * WinInetBackend::createInstance(); } //------------------------------------------------------------------------------ @@ -77,41 +76,9 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( //------------------------------------------------------------------------------ -extern "C" sal_Bool SAL_CALL component_writeInfo(void * /*pServiceManager*/, void *pRegistryKey) { - - using namespace ::com::sun::star::registry; - if (pRegistryKey) - { - try - { - uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + WinInetBackend::getBackendName() - ); - - // Register associated service names - uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") ) - ); - - uno::Sequence sServiceNames = WinInetBackend::getBackendServiceNames(); - for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i) - xServicesKey->createKey(sServiceNames[i]); - - // Register supported components - uno::Reference xComponentKey = xImplKey->createKey( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/DATA/SupportedComponents") ) - ); - - xComponentKey->setAsciiListValue( WinInetBackend::getSupportedComponents() ); - - return sal_True; - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "InvalidRegistryException caught"); - } - } - return sal_False; +extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *pRegistryKey) { + return cppu::component_writeInfoHelper( + pServiceManager, pRegistryKey, kImplementations_entries); } //------------------------------------------------------------------------------ diff --git a/shell/source/backends/wininetbe/wininetlayer.cxx b/shell/source/backends/wininetbe/wininetlayer.cxx deleted file mode 100644 index d38bda5a1581..000000000000 --- a/shell/source/backends/wininetbe/wininetlayer.cxx +++ /dev/null @@ -1,377 +0,0 @@ -/************************************************************************* - * - * 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: wininetlayer.cxx,v $ - * $Revision: 1.7 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" - -#ifndef _WININETLAYER_HXX_ -#include "wininetlayer.hxx" -#endif - -#include - -#include - -#define EQUAL_SIGN '=' -#define COLON ':' -#define SPACE ' ' -#define SEMI_COLON ';' - -typedef struct -{ - rtl::OUString Server; - rtl::OUString Port; -} ProxyEntry; - -//------------------------------------------------------------------------ -// helper functions -//------------------------------------------------------------------------ - -namespace // private -{ - ProxyEntry ReadProxyEntry(const rtl::OUString& aProxy, sal_Int32& i) - { - ProxyEntry aProxyEntry; - - aProxyEntry.Server = aProxy.getToken( 0, COLON, i ); - if ( i > -1 ) - aProxyEntry.Port = aProxy.getToken( 0, COLON, i ); - - return aProxyEntry; - } - - ProxyEntry FindProxyEntry(const rtl::OUString& aProxyList, const rtl::OUString& aType) - { - sal_Int32 nIndex = 0; - - do - { - // get the next token, e.g. ftp=server:port - rtl::OUString nextToken = aProxyList.getToken( 0, SPACE, nIndex ); - - // split the next token again into the parts separated - // through '=', e.g. ftp=server:port -> ftp and server:port - sal_Int32 i = 0; - if( nextToken.indexOf( EQUAL_SIGN ) > -1 ) - { - if( aType.equals( nextToken.getToken( 0, EQUAL_SIGN, i ) ) ) - return ReadProxyEntry(nextToken, i); - } - else if( aType.getLength() == 0) - return ReadProxyEntry(nextToken, i); - - } while ( nIndex >= 0 ); - - return ProxyEntry(); - } - -} // end private namespace - -//------------------------------------------------------------------------------ - -WinInetLayer::WinInetLayer( InternetQueryOption_Proc_T lpfnInternetQueryOption, - const uno::Reference& xContext) - : m_lpfnInternetQueryOption(lpfnInternetQueryOption) -{ - //Create instance of LayerContentDescriber Service - rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.configuration.backend.LayerDescriber")); - - typedef uno::Reference LayerDescriber; - uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); - if( xServiceManager.is() ) - { - m_xLayerContentDescriber = LayerDescriber::query( - xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext)); - } - else - { - OSL_TRACE("Could not retrieve ServiceManager"); - } - -} - -//------------------------------------------------------------------------------ - -void SAL_CALL WinInetLayer::readData( - const uno::Reference& xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException) -{ - - if (m_xLayerContentDescriber.is() && m_lpfnInternetQueryOption) - { - LPINTERNET_PROXY_INFO lpi = NULL; - - // query for the neccessary space - DWORD dwLength = 0; - BOOL bRet = m_lpfnInternetQueryOption( - NULL, - INTERNET_OPTION_PROXY, - (LPVOID)lpi, - &dwLength ); - - // allocate sufficient space on the heap - // insufficient space on the heap results - // in a stack overflow exception, we assume - // this never happens, because of the relatively - // small amount of memory we need - // _alloca is nice because it is fast and we don't - // have to free the allocated memory, it will be - // automatically done - lpi = reinterpret_cast< LPINTERNET_PROXY_INFO >( - _alloca( dwLength ) ); - - bRet = m_lpfnInternetQueryOption( - NULL, - INTERNET_OPTION_PROXY, - (LPVOID)lpi, - &dwLength ); - - // if a proxy is disabled, InternetQueryOption returns - // an empty proxy list, so we don't have to check if - // proxy is enabled or not - - rtl::OUString aProxyList = rtl::OUString::createFromAscii( lpi->lpszProxy ); - rtl::OUString aProxyBypassList = rtl::OUString::createFromAscii( lpi->lpszProxyBypass ); - - // override default for ProxyType, which is "0" meaning "No proxies". - uno::Sequence aPropInfoList(8); - sal_Int32 nProperties = 1; - - aPropInfoList[0].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") ); - aPropInfoList[0].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "int" ) ); - aPropInfoList[0].Protected = sal_False; - aPropInfoList[0].Value = uno::makeAny( nProperties ); - - // fill proxy bypass list - if( aProxyBypassList.getLength() > 0 ) - { - rtl::OUStringBuffer aReverseList; - sal_Int32 nIndex = 0; - do - { - rtl::OUString aToken = aProxyBypassList.getToken( 0, SPACE, nIndex ); - if ( aProxyList.indexOf( aToken ) == -1 ) - { - if ( aReverseList.getLength() ) - { - aReverseList.insert( 0, sal_Unicode( SEMI_COLON ) ); - aReverseList.insert( 0, aToken ); - } - else - aReverseList = aToken; - } - } - while ( nIndex >= 0 ); - - aProxyBypassList = aReverseList.makeStringAndClear(); - - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( aProxyBypassList.replace( SPACE, SEMI_COLON ) ); - } - - if( aProxyList.getLength() > 0 ) - { - //------------------------------------------------- - // this implementation follows the algorithm - // of the internet explorer - // if there are type-dependent proxy settings - // and type independent proxy settings in the - // registry the internet explorer chooses the - // type independent proxy for all settings - // e.g. imagine the following registry entry - // ftp=server:port;http=server:port;server:port - // the last token server:port is type independent - // so the ie chooses this proxy server - - // if there is no port specified for a type independent - // server the ie uses the port of an http server if - // there is one and it has a port - //------------------------------------------------- - - ProxyEntry aTypeIndepProxy = FindProxyEntry( aProxyList, rtl::OUString()); - ProxyEntry aHttpProxy = FindProxyEntry( aProxyList, rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "http" ) ) ); - ProxyEntry aHttpsProxy = FindProxyEntry( aProxyList, rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "https" ) ) ); - - ProxyEntry aFtpProxy = FindProxyEntry( aProxyList, rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "ftp" ) ) ); - - if( aTypeIndepProxy.Server.getLength() ) - { - aHttpProxy.Server = aTypeIndepProxy.Server; - aHttpsProxy.Server = aTypeIndepProxy.Server; - aFtpProxy.Server = aTypeIndepProxy.Server; - - if( aTypeIndepProxy.Port.getLength() ) - { - aHttpProxy.Port = aTypeIndepProxy.Port; - aHttpsProxy.Port = aTypeIndepProxy.Port; - aFtpProxy.Port = aTypeIndepProxy.Port; - } - else - { - aFtpProxy.Port = aHttpProxy.Port; - aHttpsProxy.Port = aHttpProxy.Port; - } - } - - // http proxy name - if( aHttpProxy.Server.getLength() > 0 ) - { - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( aHttpProxy.Server ); - } - - // http proxy port - if( aHttpProxy.Port.getLength() > 0 ) - { - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "int" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( aHttpProxy.Port.toInt32() ); - } - - // https proxy name - if( aHttpsProxy.Server.getLength() > 0 ) - { - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( aHttpsProxy.Server ); - } - - // https proxy port - if( aHttpsProxy.Port.getLength() > 0 ) - { - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "int" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( aHttpsProxy.Port.toInt32() ); - } - - // ftp proxy name - if( aFtpProxy.Server.getLength() > 0 ) - { - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( aFtpProxy.Server ); - } - - // ftp proxy port - if( aFtpProxy.Port.getLength() > 0 ) - { - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "int" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( aFtpProxy.Port.toInt32() ); - } - } - - // resize the property info list appropriately - aPropInfoList.realloc(nProperties); - - m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList); - } - else - { - OSL_TRACE("Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"); - } -} - -//------------------------------------------------------------------------------ - -rtl::OUString SAL_CALL WinInetLayer::getTimestamp(void) - throw (uno::RuntimeException) -{ - rtl::OUString aTimestamp; - - if (m_lpfnInternetQueryOption) - { - LPINTERNET_PROXY_INFO lpi = NULL; - - // query for the neccessary space - DWORD dwLength = 0; - BOOL bRet = m_lpfnInternetQueryOption( - NULL, - INTERNET_OPTION_PROXY, - (LPVOID)lpi, - &dwLength ); - - // allocate sufficient space on the heap - // insufficient space on the heap results - // in a stack overflow exception, we assume - // this never happens, because of the relatively - // small amount of memory we need - // _alloca is nice because it is fast and we don't - // have to free the allocated memory, it will be - // automatically done - lpi = reinterpret_cast< LPINTERNET_PROXY_INFO >( - _alloca( dwLength ) ); - - bRet = m_lpfnInternetQueryOption( - NULL, - INTERNET_OPTION_PROXY, - (LPVOID)lpi, - &dwLength ); - - aTimestamp = rtl::OUString::createFromAscii( lpi->lpszProxy ); - aTimestamp += rtl::OUString::createFromAscii( lpi->lpszProxyBypass ); - } - - return aTimestamp; -} - -//------------------------------------------------------------------------------ diff --git a/shell/source/backends/wininetbe/wininetlayer.hxx b/shell/source/backends/wininetbe/wininetlayer.hxx deleted file mode 100644 index 761e174d1df5..000000000000 --- a/shell/source/backends/wininetbe/wininetlayer.hxx +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef _WinInetLayer_HXX_ -#define _WinInetLayer_HXX_ - -#include -#include -#include -#include - -#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_ -#include -#endif -#include -#include -#include - -#if defined _MSC_VER -#pragma warning(push, 1) -#endif -#include -#include -#if defined _MSC_VER -#pragma warning(pop) -#endif - -namespace css = com::sun::star ; -namespace uno = css::uno ; -namespace lang = css::lang ; -namespace backend = css::configuration::backend ; -namespace util = css::util ; - -/** - Implementation of the XLayer interfaces for fixed values - */ - -class WinInetLayer : public cppu::WeakImplHelper2 -{ - public : - typedef BOOL ( WINAPI *InternetQueryOption_Proc_T )( HINTERNET, DWORD, LPVOID, LPDWORD ); - - /** - Constructor given the requested component name - - @param lpfnInternetQueryOption function pointer into wininet.dll - @param aTimestamp timestamp indicating last modifictaion - */ - WinInetLayer(InternetQueryOption_Proc_T lpfnInternetQueryOption, - const uno::Reference& xContext); - - /** Destructor */ - ~WinInetLayer(void) {} - - // XLayer - virtual void SAL_CALL readData(const uno::Reference& xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException) ; - - // XTimeStamped - virtual rtl::OUString SAL_CALL getTimestamp(void) - throw (uno::RuntimeException); - - private : - - rtl::OUString m_aComponent ; - - uno::Reference m_xLayerContentDescriber ; - - // The InternetQueryOption function pointer - InternetQueryOption_Proc_T m_lpfnInternetQueryOption; -} ; - -#endif // _WinInetLayer_HXX_ -- cgit From e573925559daab2f374c9b485290e28751978b52 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 1 Oct 2009 13:40:46 +0200 Subject: #i101955# changed platform backend interface once again, from XNameAccess to XPropertySet --- shell/source/backends/desktopbe/desktopbackend.cxx | 154 ++++--- shell/source/backends/gconfbe/gconfaccess.cxx | 7 +- shell/source/backends/gconfbe/gconfaccess.hxx | 4 +- shell/source/backends/gconfbe/gconfbackend.cxx | 120 +++--- shell/source/backends/kde4be/kde4access.cxx | 45 ++- shell/source/backends/kde4be/kde4access.hxx | 5 +- shell/source/backends/kde4be/kde4backend.cxx | 159 +++++--- shell/source/backends/kdebe/kdeaccess.cxx | 45 ++- shell/source/backends/kdebe/kdeaccess.hxx | 5 +- shell/source/backends/kdebe/kdebackend.cxx | 159 +++++--- shell/source/backends/localebe/localebackend.cxx | 69 ++-- shell/source/backends/localebe/localebackend.hxx | 75 ++-- shell/source/backends/macbe/macbackend.cxx | 138 +++---- shell/source/backends/macbe/macbackend.hxx | 75 ++-- shell/source/backends/macbe/macbelayer.cxx | 443 --------------------- shell/source/backends/macbe/macbelayer.hxx | 104 ----- shell/source/backends/wininetbe/wininetbackend.cxx | 152 +++---- shell/source/backends/wininetbe/wininetbackend.hxx | 109 +++-- 18 files changed, 764 insertions(+), 1104 deletions(-) delete mode 100644 shell/source/backends/macbe/macbelayer.cxx delete mode 100644 shell/source/backends/macbe/macbelayer.hxx (limited to 'shell') diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx index a214b08edb18..41d0c89f96b7 100644 --- a/shell/source/backends/desktopbe/desktopbackend.cxx +++ b/shell/source/backends/desktopbe/desktopbackend.cxx @@ -31,19 +31,25 @@ #include "sal/config.h" #include "boost/noncopyable.hpp" -#include "com/sun/star/container/NoSuchElementException.hpp" -#include "com/sun/star/container/XNameAccess.hpp" +#include "com/sun/star/beans/Optional.hpp" +#include "com/sun/star/beans/PropertyVetoException.hpp" +#include "com/sun/star/beans/UnknownPropertyException.hpp" +#include "com/sun/star/beans/XPropertyChangeListener.hpp" +#include "com/sun/star/beans/XPropertySet.hpp" +#include "com/sun/star/beans/XPropertySetInfo.hpp" +#include "com/sun/star/beans/XVetoableChangeListener.hpp" +#include "com/sun/star/lang/IllegalArgumentException.hpp" +#include "com/sun/star/lang/WrappedTargetException.hpp" #include "com/sun/star/lang/XMultiComponentFactory.hpp" #include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/lang/WrappedTargetException.hpp" #include "com/sun/star/uno/Any.hxx" #include "com/sun/star/uno/Exception.hpp" +#include "com/sun/star/uno/Reference.hxx" #include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/uno/Sequence.hxx" -#include "com/sun/star/uno/Type.hxx" #include "com/sun/star/uno/XComponentContext.hpp" #include "com/sun/star/uno/XCurrentContext.hpp" -#include "cppu/unotype.hxx" #include "cppuhelper/factory.hxx" #include "cppuhelper/implbase2.hxx" #include "cppuhelper/implementationentry.hxx" @@ -76,7 +82,7 @@ css::uno::Sequence< rtl::OUString > SAL_CALL getDefaultSupportedServiceNames() { class Default: public cppu::WeakImplHelper2< - css::lang::XServiceInfo, css::container::XNameAccess >, + css::lang::XServiceInfo, css::beans::XPropertySet >, private boost::noncopyable { public: @@ -97,73 +103,105 @@ private: getSupportedServiceNames() throw (css::uno::RuntimeException) { return getDefaultSupportedServiceNames(); } - virtual css::uno::Type SAL_CALL getElementType() - throw (css::uno::RuntimeException) - { return cppu::UnoType< cppu::UnoVoidType >::get(); } + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() throw (css::uno::RuntimeException) + { return css::uno::Reference< css::beans::XPropertySetInfo >(); } - virtual sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException) - { return true; } + virtual void SAL_CALL setPropertyValue( + rtl::OUString const &, css::uno::Any const &) + throw ( + css::beans::UnknownPropertyException, + css::beans::PropertyVetoException, + css::lang::IllegalArgumentException, + css::lang::WrappedTargetException, css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL getByName(rtl::OUString const & aName) + virtual css::uno::Any SAL_CALL getPropertyValue( + rtl::OUString const & PropertyName) throw ( - css::container::NoSuchElementException, + css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); - virtual css::uno::Sequence< rtl::OUString > SAL_CALL getElementNames() - throw (css::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XPropertyChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL removePropertyChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XPropertyChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} - virtual sal_Bool SAL_CALL hasByName(rtl::OUString const & aName) - throw (css::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XVetoableChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL removeVetoableChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XVetoableChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} }; -css::uno::Any Default::getByName(rtl::OUString const & aName) +void Default::setPropertyValue(rtl::OUString const &, css::uno::Any const &) throw ( - css::container::NoSuchElementException, - css::lang::WrappedTargetException, css::uno::RuntimeException) + css::beans::UnknownPropertyException, css::beans::PropertyVetoException, + css::lang::IllegalArgumentException, css::lang::WrappedTargetException, + css::uno::RuntimeException) { - if (!hasByName(aName)) { - throw css::container::NoSuchElementException( - aName, static_cast< cppu::OWeakObject * >(this)); - } - return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + throw css::lang::IllegalArgumentException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")), + static_cast< cppu::OWeakObject * >(this), -1); } -css::uno::Sequence< rtl::OUString > Default::getElementNames() - throw (css::uno::RuntimeException) -{ - css::uno::Sequence< rtl::OUString > names(13); - names[0] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("EnableATToolSupport")); - names[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ExternalMailer")); - names[2] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("SourceViewFontHeight")); - names[3] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SourceViewFontName")); - names[4] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WorkPathVariable")); - names[5] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyName")); - names[6] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyPort")); - names[7] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyName")); - names[8] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyPort")); - names[9] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyName")); - names[10] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyPort")); - names[11] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetNoProxy")); - names[12] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetProxyType")); - return names; -} - -sal_Bool Default::hasByName(rtl::OUString const & aName) - throw (css::uno::RuntimeException) +css::uno::Any Default::getPropertyValue(rtl::OUString const & PropertyName) + throw ( + css::beans::UnknownPropertyException, css::lang::WrappedTargetException, + css::uno::RuntimeException) { - css::uno::Sequence< rtl::OUString > names(getElementNames()); - for (sal_Int32 i = 0; i < names.getLength(); ++i) { - if (aName == names[i]) { - return true; - } + if (PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ExternalMailer")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("SourceViewFontName")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"))) + { + return css::uno::makeAny(css::beans::Optional< css::uno::Any >()); } - return false; + throw css::beans::UnknownPropertyException( + PropertyName, static_cast< cppu::OWeakObject * >(this)); } css::uno::Reference< css::uno::XInterface > createBackend( diff --git a/shell/source/backends/gconfbe/gconfaccess.cxx b/shell/source/backends/gconfbe/gconfaccess.cxx index 8391eda712fa..20de0af6ef3d 100644 --- a/shell/source/backends/gconfbe/gconfaccess.cxx +++ b/shell/source/backends/gconfbe/gconfaccess.cxx @@ -824,7 +824,8 @@ ConfigurationValue const ConfigurationValues[] = std::size_t const nConfigurationValues = sizeof ConfigurationValues / sizeof ConfigurationValues[0]; -css::uno::Any getValue(ConfigurationValue const & data) { +css::beans::Optional< css::uno::Any > getValue(ConfigurationValue const & data) +{ GConfClient* aClient = getGconfClient(); GConfValue* aGconfValue; if( ( data.nDependsOn == SETTINGS_LAST ) || isDependencySatisfied( aClient, data ) ) @@ -841,10 +842,10 @@ css::uno::Any getValue(ConfigurationValue const & data) { gconf_value_free( aGconfValue ); - return value; + return css::beans::Optional< css::uno::Any >(true, value); } } - return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + return css::beans::Optional< css::uno::Any >(); } } diff --git a/shell/source/backends/gconfbe/gconfaccess.hxx b/shell/source/backends/gconfbe/gconfaccess.hxx index c986fd338da9..ad156974b150 100644 --- a/shell/source/backends/gconfbe/gconfaccess.hxx +++ b/shell/source/backends/gconfbe/gconfaccess.hxx @@ -34,6 +34,7 @@ #include +#include "com/sun/star/beans/Optional.hpp" #include "gconf/gconf-client.h" #include "sal/types.h" @@ -112,7 +113,8 @@ extern ConfigurationValue const ConfigurationValues[]; extern std::size_t const nConfigurationValues; -com::sun::star::uno::Any getValue(ConfigurationValue const & data); +com::sun::star::beans::Optional< com::sun::star::uno::Any > getValue( + ConfigurationValue const & data); } diff --git a/shell/source/backends/gconfbe/gconfbackend.cxx b/shell/source/backends/gconfbe/gconfbackend.cxx index 2410ca85171f..27b098996b2a 100644 --- a/shell/source/backends/gconfbe/gconfbackend.cxx +++ b/shell/source/backends/gconfbe/gconfbackend.cxx @@ -33,18 +33,24 @@ #include #include "boost/noncopyable.hpp" -#include "com/sun/star/container/NoSuchElementException.hpp" -#include "com/sun/star/container/XNameAccess.hpp" +#include "com/sun/star/beans/Optional.hpp" +#include "com/sun/star/beans/PropertyVetoException.hpp" +#include "com/sun/star/beans/UnknownPropertyException.hpp" +#include "com/sun/star/beans/XPropertyChangeListener.hpp" +#include "com/sun/star/beans/XPropertySet.hpp" +#include "com/sun/star/beans/XPropertySetInfo.hpp" +#include "com/sun/star/beans/XVetoableChangeListener.hpp" +#include "com/sun/star/lang/IllegalArgumentException.hpp" +#include "com/sun/star/lang/WrappedTargetException.hpp" #include "com/sun/star/lang/XMultiComponentFactory.hpp" #include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/lang/WrappedTargetException.hpp" #include "com/sun/star/uno/Any.hxx" +#include "com/sun/star/uno/Reference.hxx" #include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/uno/Sequence.hxx" -#include "com/sun/star/uno/Type.hxx" #include "com/sun/star/uno/XComponentContext.hpp" #include "com/sun/star/uno/XCurrentContext.hpp" -#include "cppu/unotype.hxx" #include "cppuhelper/factory.hxx" #include "cppuhelper/implbase2.hxx" #include "cppuhelper/implementationentry.hxx" @@ -78,7 +84,7 @@ css::uno::Sequence< rtl::OUString > SAL_CALL getServiceSupportedServiceNames() { class Service: public cppu::WeakImplHelper2< - css::lang::XServiceInfo, css::container::XNameAccess >, + css::lang::XServiceInfo, css::beans::XPropertySet >, private boost::noncopyable { public: @@ -99,23 +105,55 @@ private: getSupportedServiceNames() throw (css::uno::RuntimeException) { return getServiceSupportedServiceNames(); } - virtual css::uno::Type SAL_CALL getElementType() - throw (css::uno::RuntimeException) - { return cppu::UnoType< cppu::UnoVoidType >::get(); } + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() throw (css::uno::RuntimeException) + { return css::uno::Reference< css::beans::XPropertySetInfo >(); } - virtual sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException) - { return true; } + virtual void SAL_CALL setPropertyValue( + rtl::OUString const &, css::uno::Any const &) + throw ( + css::beans::UnknownPropertyException, + css::beans::PropertyVetoException, + css::lang::IllegalArgumentException, + css::lang::WrappedTargetException, css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL getByName(rtl::OUString const & aName) + virtual css::uno::Any SAL_CALL getPropertyValue( + rtl::OUString const & PropertyName) throw ( - css::container::NoSuchElementException, + css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); - virtual css::uno::Sequence< rtl::OUString > SAL_CALL getElementNames() - throw (css::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XPropertyChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL removePropertyChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XPropertyChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL addVetoableChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XVetoableChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} - virtual sal_Bool SAL_CALL hasByName(rtl::OUString const & aName) - throw (css::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XVetoableChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} bool enabled_; }; @@ -136,47 +174,35 @@ Service::Service(): enabled_(false) { } } -css::uno::Any Service::getByName(rtl::OUString const & aName) +void Service::setPropertyValue(rtl::OUString const &, css::uno::Any const &) throw ( - css::container::NoSuchElementException, - css::lang::WrappedTargetException, css::uno::RuntimeException) + css::beans::UnknownPropertyException, css::beans::PropertyVetoException, + css::lang::IllegalArgumentException, css::lang::WrappedTargetException, + css::uno::RuntimeException) { - for (std::size_t i = 0; i < gconfaccess::nConfigurationValues; ++i) { - if (aName.equalsAscii( - gconfaccess::ConfigurationValues[i].OOoConfItem)) - { - return enabled_ - ? gconfaccess::getValue(gconfaccess::ConfigurationValues[i]) - : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); - } - } - throw css::container::NoSuchElementException( - aName, static_cast< cppu::OWeakObject * >(this)); + throw css::lang::IllegalArgumentException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")), + static_cast< cppu::OWeakObject * >(this), -1); } -css::uno::Sequence< rtl::OUString > Service::getElementNames() - throw (css::uno::RuntimeException) -{ - css::uno::Sequence< rtl::OUString > names( - gconfaccess::nConfigurationValues); - for (std::size_t i = 0; i < gconfaccess::nConfigurationValues; ++i) { - names[i] = rtl::OUString::createFromAscii( - gconfaccess::ConfigurationValues[i].OOoConfItem); - } - return names; -} - -sal_Bool Service::hasByName(rtl::OUString const & aName) - throw (css::uno::RuntimeException) +css::uno::Any Service::getPropertyValue(rtl::OUString const & PropertyName) + throw ( + css::beans::UnknownPropertyException, css::lang::WrappedTargetException, + css::uno::RuntimeException) { for (std::size_t i = 0; i < gconfaccess::nConfigurationValues; ++i) { - if (aName.equalsAscii( + if (PropertyName.equalsAscii( gconfaccess::ConfigurationValues[i].OOoConfItem)) { - return true; + return css::uno::makeAny( + enabled_ + ? gconfaccess::getValue(gconfaccess::ConfigurationValues[i]) + : css::beans::Optional< css::uno::Any >()); } } - return false; + throw css::beans::UnknownPropertyException( + PropertyName, static_cast< cppu::OWeakObject * >(this)); } css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( diff --git a/shell/source/backends/kde4be/kde4access.cxx b/shell/source/backends/kde4be/kde4access.cxx index fc3ae7043330..888f5cdc82fe 100644 --- a/shell/source/backends/kde4be/kde4access.cxx +++ b/shell/source/backends/kde4be/kde4access.cxx @@ -43,6 +43,8 @@ #include "rtl/string.h" #include "rtl/ustring.hxx" +#include "kde4access.hxx" + #define SPACE ' ' #define COMMA ',' #define SEMI_COLON ';' @@ -56,7 +58,7 @@ namespace uno = css::uno ; } -css::uno::Any getValue(rtl::OUString const & id) { +css::beans::Optional< css::uno::Any > getValue(rtl::OUString const & id) { if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ExternalMailer"))) { KEMailSettings aEmailSettings; QString aClientProgram; @@ -68,7 +70,8 @@ css::uno::Any getValue(rtl::OUString const & id) { else aClientProgram = aClientProgram.section(SPACE, 0, 0); sClientProgram = (const sal_Unicode *) aClientProgram.utf16(); - return uno::makeAny( sClientProgram ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( sClientProgram ) ); } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight"))) { @@ -77,7 +80,8 @@ css::uno::Any getValue(rtl::OUString const & id) { aFixedFont = KGlobalSettings::fixedFont(); nFontHeight = aFixedFont.pointSize(); - return uno::makeAny( nFontHeight ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( nFontHeight ) ); } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("SourceViewFontName"))) { @@ -88,13 +92,15 @@ css::uno::Any getValue(rtl::OUString const & id) { aFixedFont = KGlobalSettings::fixedFont(); aFontName = aFixedFont.family(); sFontName = (const sal_Unicode *) aFontName.utf16(); - return uno::makeAny( sFontName ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( sFontName ) ); } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport"))) { /* does not make much sense without an accessibility bridge */ sal_Bool ATToolSupport = sal_False; - return uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) ) ); } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("WorkPathVariable"))) { @@ -105,7 +111,8 @@ css::uno::Any getValue(rtl::OUString const & id) { aDocumentsDir.truncate ( aDocumentsDir.length() - 1 ); sDocumentsDir = (const sal_Unicode *) aDocumentsDir.utf16(); osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData ); - return uno::makeAny( sDocumentsURL ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( sDocumentsURL ) ); } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName"))) { @@ -130,7 +137,8 @@ css::uno::Any getValue(rtl::OUString const & id) { { KUrl aProxy(aFTPProxy); ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16(); - return uno::makeAny( sProxy ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( sProxy ) ); } } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort"))) @@ -156,7 +164,8 @@ css::uno::Any getValue(rtl::OUString const & id) { { KUrl aProxy(aFTPProxy); sal_Int32 nPort = aProxy.port(); - return uno::makeAny( nPort ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( nPort ) ); } } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName"))) @@ -182,7 +191,8 @@ css::uno::Any getValue(rtl::OUString const & id) { { KUrl aProxy(aHTTPProxy); ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16(); - return uno::makeAny( sProxy ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( sProxy ) ); } } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort"))) @@ -208,7 +218,8 @@ css::uno::Any getValue(rtl::OUString const & id) { { KUrl aProxy(aHTTPProxy); sal_Int32 nPort = aProxy.port(); - return uno::makeAny( nPort ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( nPort ) ); } } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName"))) @@ -234,7 +245,8 @@ css::uno::Any getValue(rtl::OUString const & id) { { KUrl aProxy(aHTTPSProxy); ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16(); - return uno::makeAny( sProxy ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( sProxy ) ); } } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort"))) @@ -260,7 +272,8 @@ css::uno::Any getValue(rtl::OUString const & id) { { KUrl aProxy(aHTTPSProxy); sal_Int32 nPort = aProxy.port(); - return uno::makeAny( nPort ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( nPort ) ); } } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy"))) { QString aNoProxyFor; @@ -281,7 +294,8 @@ css::uno::Any getValue(rtl::OUString const & id) { aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON ); sNoProxyFor = (const sal_Unicode *) aNoProxyFor.utf16(); - return uno::makeAny( sNoProxyFor ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( sNoProxyFor ) ); } } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"))) { int nProxyType; @@ -296,11 +310,12 @@ css::uno::Any getValue(rtl::OUString const & id) { default: // No proxy is used nProxyType = 0; } - return uno::makeAny( (sal_Int32) nProxyType ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( (sal_Int32) nProxyType ) ); } else { OSL_ASSERT(false); // this cannot happen } - return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + return css::beans::Optional< css::uno::Any >(); } } diff --git a/shell/source/backends/kde4be/kde4access.hxx b/shell/source/backends/kde4be/kde4access.hxx index 043dff6476ec..2edd2f3a8686 100644 --- a/shell/source/backends/kde4be/kde4access.hxx +++ b/shell/source/backends/kde4be/kde4access.hxx @@ -32,6 +32,8 @@ #include "sal/config.h" +#include "com/sun/star/beans/Optional.hpp" + namespace com { namespace sun { namespace star { namespace uno { class Any; } } } } @@ -39,7 +41,8 @@ namespace rtl { class OUString; } namespace kde4access { -com::sun::star::uno::Any getValue(rtl::OUString const & id); +com::sun::star::beans::Optional< com::sun::star::uno::Any > getValue( + rtl::OUString const & id); } diff --git a/shell/source/backends/kde4be/kde4backend.cxx b/shell/source/backends/kde4be/kde4backend.cxx index feef44562d49..e2f7e4c813f1 100644 --- a/shell/source/backends/kde4be/kde4backend.cxx +++ b/shell/source/backends/kde4be/kde4backend.cxx @@ -33,18 +33,24 @@ #include "kapplication.h" #include "boost/noncopyable.hpp" -#include "com/sun/star/container/NoSuchElementException.hpp" -#include "com/sun/star/container/XNameAccess.hpp" +#include "com/sun/star/beans/Optional.hpp" +#include "com/sun/star/beans/PropertyVetoException.hpp" +#include "com/sun/star/beans/UnknownPropertyException.hpp" +#include "com/sun/star/beans/XPropertyChangeListener.hpp" +#include "com/sun/star/beans/XPropertySet.hpp" +#include "com/sun/star/beans/XPropertySetInfo.hpp" +#include "com/sun/star/beans/XVetoableChangeListener.hpp" +#include "com/sun/star/lang/IllegalArgumentException.hpp" +#include "com/sun/star/lang/WrappedTargetException.hpp" #include "com/sun/star/lang/XMultiComponentFactory.hpp" #include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/lang/WrappedTargetException.hpp" #include "com/sun/star/uno/Any.hxx" +#include "com/sun/star/uno/Reference.hxx" #include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/uno/Sequence.hxx" -#include "com/sun/star/uno/Type.hxx" #include "com/sun/star/uno/XComponentContext.hpp" #include "com/sun/star/uno/XCurrentContext.hpp" -#include "cppu/unotype.hxx" #include "cppuhelper/factory.hxx" #include "cppuhelper/implbase2.hxx" #include "cppuhelper/implementationentry.hxx" @@ -77,7 +83,7 @@ css::uno::Sequence< rtl::OUString > SAL_CALL getServiceSupportedServiceNames() { class Service: public cppu::WeakImplHelper2< - css::lang::XServiceInfo, css::container::XNameAccess >, + css::lang::XServiceInfo, css::beans::XPropertySet >, private boost::noncopyable { public: @@ -98,23 +104,55 @@ private: getSupportedServiceNames() throw (css::uno::RuntimeException) { return getServiceSupportedServiceNames(); } - virtual css::uno::Type SAL_CALL getElementType() - throw (css::uno::RuntimeException) - { return cppu::UnoType< cppu::UnoVoidType >::get(); } + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() throw (css::uno::RuntimeException) + { return css::uno::Reference< css::beans::XPropertySetInfo >(); } - virtual sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException) - { return true; } + virtual void SAL_CALL setPropertyValue( + rtl::OUString const &, css::uno::Any const &) + throw ( + css::beans::UnknownPropertyException, + css::beans::PropertyVetoException, + css::lang::IllegalArgumentException, + css::lang::WrappedTargetException, css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL getByName(rtl::OUString const & aName) + virtual css::uno::Any SAL_CALL getPropertyValue( + rtl::OUString const & PropertyName) throw ( - css::container::NoSuchElementException, + css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); - virtual css::uno::Sequence< rtl::OUString > SAL_CALL getElementNames() - throw (css::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XPropertyChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL removePropertyChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XPropertyChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} - virtual sal_Bool SAL_CALL hasByName(rtl::OUString const & aName) - throw (css::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XVetoableChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL removeVetoableChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XVetoableChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} bool enabled_; }; @@ -133,56 +171,57 @@ Service::Service(): enabled_(false) { } } -css::uno::Any Service::getByName(rtl::OUString const & aName) +void Service::setPropertyValue(rtl::OUString const &, css::uno::Any const &) throw ( - css::container::NoSuchElementException, - css::lang::WrappedTargetException, css::uno::RuntimeException) + css::beans::UnknownPropertyException, css::beans::PropertyVetoException, + css::lang::IllegalArgumentException, css::lang::WrappedTargetException, + css::uno::RuntimeException) { - if (!hasByName(aName)) { - throw css::container::NoSuchElementException( - aName, static_cast< cppu::OWeakObject * >(this)); - } - return enabled_ - ? kde4access::getValue(aName) - : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + throw css::lang::IllegalArgumentException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")), + static_cast< cppu::OWeakObject * >(this), -1); } -css::uno::Sequence< rtl::OUString > Service::getElementNames() - throw (css::uno::RuntimeException) -{ - css::uno::Sequence< rtl::OUString > names(13); - names[0] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("EnableATToolSupport")); - names[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ExternalMailer")); - names[2] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("SourceViewFontHeight")); - names[3] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SourceViewFontName")); - names[4] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WorkPathVariable")); - names[5] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyName")); - names[6] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyPort")); - names[7] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyName")); - names[8] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyPort")); - names[9] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyName")); - names[10] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyPort")); - names[11] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetNoProxy")); - names[12] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetProxyType")); - return names; -} - -sal_Bool Service::hasByName(rtl::OUString const & aName) - throw (css::uno::RuntimeException) +css::uno::Any Service::getPropertyValue(rtl::OUString const & PropertyName) + throw ( + css::beans::UnknownPropertyException, css::lang::WrappedTargetException, + css::uno::RuntimeException) { - css::uno::Sequence< rtl::OUString > names(getElementNames()); - for (sal_Int32 i = 0; i < names.getLength(); ++i) { - if (aName == names[i]) { - return true; - } + if (PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ExternalMailer")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("SourceViewFontName")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"))) + { + return css::uno::makeAny( + enabled_ + ? kde4access::getValue(PropertyName) + : css::beans::Optional< css::uno::Any >()); } - return false; + throw css::beans::UnknownPropertyException( + PropertyName, static_cast< cppu::OWeakObject * >(this)); } css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( diff --git a/shell/source/backends/kdebe/kdeaccess.cxx b/shell/source/backends/kdebe/kdeaccess.cxx index 9dd9ecd7478b..dcb1df9c95b0 100644 --- a/shell/source/backends/kdebe/kdeaccess.cxx +++ b/shell/source/backends/kdebe/kdeaccess.cxx @@ -38,6 +38,8 @@ #include "rtl/ustring.hxx" #include "vcl/kde_headers.h" +#include "kdeaccess.hxx" + #define SPACE ' ' #define COMMA ',' #define SEMI_COLON ';' @@ -51,7 +53,7 @@ namespace uno = css::uno ; } -css::uno::Any getValue(rtl::OUString const & id) { +css::beans::Optional< css::uno::Any > getValue(rtl::OUString const & id) { if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ExternalMailer"))) { KEMailSettings aEmailSettings; QString aClientProgram; @@ -63,7 +65,8 @@ css::uno::Any getValue(rtl::OUString const & id) { else aClientProgram = aClientProgram.section(SPACE, 0, 0); sClientProgram = (const sal_Unicode *) aClientProgram.ucs2(); - return uno::makeAny( sClientProgram ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( sClientProgram ) ); } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight"))) { @@ -72,7 +75,8 @@ css::uno::Any getValue(rtl::OUString const & id) { aFixedFont = KGlobalSettings::fixedFont(); nFontHeight = aFixedFont.pointSize(); - return uno::makeAny( nFontHeight ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( nFontHeight ) ); } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("SourceViewFontName"))) { @@ -83,13 +87,15 @@ css::uno::Any getValue(rtl::OUString const & id) { aFixedFont = KGlobalSettings::fixedFont(); aFontName = aFixedFont.family(); sFontName = (const sal_Unicode *) aFontName.ucs2(); - return uno::makeAny( sFontName ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( sFontName ) ); } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport"))) { /* does not make much sense without an accessibility bridge */ sal_Bool ATToolSupport = sal_False; - return uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) ) ); } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("WorkPathVariable"))) { @@ -100,7 +106,8 @@ css::uno::Any getValue(rtl::OUString const & id) { aDocumentsDir.truncate ( aDocumentsDir.length() - 1 ); sDocumentsDir = (const sal_Unicode *) aDocumentsDir.ucs2(); osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData ); - return uno::makeAny( sDocumentsURL ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( sDocumentsURL ) ); } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName"))) { @@ -125,7 +132,8 @@ css::uno::Any getValue(rtl::OUString const & id) { { KURL aProxy(aFTPProxy); ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2(); - return uno::makeAny( sProxy ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( sProxy ) ); } } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort"))) @@ -151,7 +159,8 @@ css::uno::Any getValue(rtl::OUString const & id) { { KURL aProxy(aFTPProxy); sal_Int32 nPort = aProxy.port(); - return uno::makeAny( nPort ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( nPort ) ); } } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName"))) @@ -177,7 +186,8 @@ css::uno::Any getValue(rtl::OUString const & id) { { KURL aProxy(aHTTPProxy); ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2(); - return uno::makeAny( sProxy ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( sProxy ) ); } } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort"))) @@ -203,7 +213,8 @@ css::uno::Any getValue(rtl::OUString const & id) { { KURL aProxy(aHTTPProxy); sal_Int32 nPort = aProxy.port(); - return uno::makeAny( nPort ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( nPort ) ); } } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName"))) @@ -229,7 +240,8 @@ css::uno::Any getValue(rtl::OUString const & id) { { KURL aProxy(aHTTPSProxy); ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2(); - return uno::makeAny( sProxy ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( sProxy ) ); } } else if (id.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort"))) @@ -255,7 +267,8 @@ css::uno::Any getValue(rtl::OUString const & id) { { KURL aProxy(aHTTPSProxy); sal_Int32 nPort = aProxy.port(); - return uno::makeAny( nPort ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( nPort ) ); } } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy"))) { QString aNoProxyFor; @@ -276,7 +289,8 @@ css::uno::Any getValue(rtl::OUString const & id) { aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON ); sNoProxyFor = (const sal_Unicode *) aNoProxyFor.ucs2(); - return uno::makeAny( sNoProxyFor ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( sNoProxyFor ) ); } } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"))) { int nProxyType; @@ -291,11 +305,12 @@ css::uno::Any getValue(rtl::OUString const & id) { default: // No proxy is used nProxyType = 0; } - return uno::makeAny( (sal_Int32) nProxyType ); + return css::beans::Optional< css::uno::Any >( + true, uno::makeAny( (sal_Int32) nProxyType ) ); } else { OSL_ASSERT(false); // this cannot happen } - return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + return css::beans::Optional< css::uno::Any >(); } } diff --git a/shell/source/backends/kdebe/kdeaccess.hxx b/shell/source/backends/kdebe/kdeaccess.hxx index cb916a44d61b..5e61f5a224e0 100644 --- a/shell/source/backends/kdebe/kdeaccess.hxx +++ b/shell/source/backends/kdebe/kdeaccess.hxx @@ -32,6 +32,8 @@ #include "sal/config.h" +#include "com/sun/star/beans/Optional.hpp" + namespace com { namespace sun { namespace star { namespace uno { class Any; } } } } @@ -39,7 +41,8 @@ namespace rtl { class OUString; } namespace kdeaccess { -com::sun::star::uno::Any getValue(rtl::OUString const & id); +com::sun::star::beans::Optional< com::sun::star::uno::Any > getValue( + rtl::OUString const & id); } diff --git a/shell/source/backends/kdebe/kdebackend.cxx b/shell/source/backends/kdebe/kdebackend.cxx index 0f52c2a917c1..743971a0d9e2 100644 --- a/shell/source/backends/kdebe/kdebackend.cxx +++ b/shell/source/backends/kdebe/kdebackend.cxx @@ -31,18 +31,24 @@ #include "sal/config.h" #include "boost/noncopyable.hpp" -#include "com/sun/star/container/NoSuchElementException.hpp" -#include "com/sun/star/container/XNameAccess.hpp" +#include "com/sun/star/beans/Optional.hpp" +#include "com/sun/star/beans/PropertyVetoException.hpp" +#include "com/sun/star/beans/UnknownPropertyException.hpp" +#include "com/sun/star/beans/XPropertyChangeListener.hpp" +#include "com/sun/star/beans/XPropertySet.hpp" +#include "com/sun/star/beans/XPropertySetInfo.hpp" +#include "com/sun/star/beans/XVetoableChangeListener.hpp" +#include "com/sun/star/lang/IllegalArgumentException.hpp" +#include "com/sun/star/lang/WrappedTargetException.hpp" #include "com/sun/star/lang/XMultiComponentFactory.hpp" #include "com/sun/star/lang/XServiceInfo.hpp" #include "com/sun/star/lang/WrappedTargetException.hpp" #include "com/sun/star/uno/Any.hxx" +#include "com/sun/star/uno/Reference.hxx" #include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/uno/Sequence.hxx" -#include "com/sun/star/uno/Type.hxx" #include "com/sun/star/uno/XComponentContext.hpp" #include "com/sun/star/uno/XCurrentContext.hpp" -#include "cppu/unotype.hxx" #include "cppuhelper/factory.hxx" #include "cppuhelper/implbase2.hxx" #include "cppuhelper/implementationentry.hxx" @@ -76,7 +82,7 @@ css::uno::Sequence< rtl::OUString > SAL_CALL getServiceSupportedServiceNames() { class Service: public cppu::WeakImplHelper2< - css::lang::XServiceInfo, css::container::XNameAccess >, + css::lang::XServiceInfo, css::beans::XPropertySet >, private boost::noncopyable { public: @@ -97,23 +103,55 @@ private: getSupportedServiceNames() throw (css::uno::RuntimeException) { return getServiceSupportedServiceNames(); } - virtual css::uno::Type SAL_CALL getElementType() - throw (css::uno::RuntimeException) - { return cppu::UnoType< cppu::UnoVoidType >::get(); } + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() throw (css::uno::RuntimeException) + { return css::uno::Reference< css::beans::XPropertySetInfo >(); } - virtual sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException) - { return true; } + virtual void SAL_CALL setPropertyValue( + rtl::OUString const &, css::uno::Any const &) + throw ( + css::beans::UnknownPropertyException, + css::beans::PropertyVetoException, + css::lang::IllegalArgumentException, + css::lang::WrappedTargetException, css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL getByName(rtl::OUString const & aName) + virtual css::uno::Any SAL_CALL getPropertyValue( + rtl::OUString const & PropertyName) throw ( - css::container::NoSuchElementException, + css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException); - virtual css::uno::Sequence< rtl::OUString > SAL_CALL getElementNames() - throw (css::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XPropertyChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL removePropertyChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XPropertyChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} - virtual sal_Bool SAL_CALL hasByName(rtl::OUString const & aName) - throw (css::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XVetoableChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL removeVetoableChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XVetoableChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} bool enabled_; }; @@ -132,56 +170,57 @@ Service::Service(): enabled_(false) { } } -css::uno::Any Service::getByName(rtl::OUString const & aName) +void Service::setPropertyValue(rtl::OUString const &, css::uno::Any const &) throw ( - css::container::NoSuchElementException, - css::lang::WrappedTargetException, css::uno::RuntimeException) + css::beans::UnknownPropertyException, css::beans::PropertyVetoException, + css::lang::IllegalArgumentException, css::lang::WrappedTargetException, + css::uno::RuntimeException) { - if (!hasByName(aName)) { - throw css::container::NoSuchElementException( - aName, static_cast< cppu::OWeakObject * >(this)); - } - return enabled_ - ? kdeaccess::getValue(aName) - : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + throw css::lang::IllegalArgumentException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")), + static_cast< cppu::OWeakObject * >(this), -1); } -css::uno::Sequence< rtl::OUString > Service::getElementNames() - throw (css::uno::RuntimeException) -{ - css::uno::Sequence< rtl::OUString > names(13); - names[0] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("EnableATToolSupport")); - names[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ExternalMailer")); - names[2] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("SourceViewFontHeight")); - names[3] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SourceViewFontName")); - names[4] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WorkPathVariable")); - names[5] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyName")); - names[6] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyPort")); - names[7] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyName")); - names[8] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyPort")); - names[9] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyName")); - names[10] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyPort")); - names[11] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetNoProxy")); - names[12] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetProxyType")); - return names; -} - -sal_Bool Service::hasByName(rtl::OUString const & aName) - throw (css::uno::RuntimeException) +css::uno::Any Service::getPropertyValue(rtl::OUString const & PropertyName) + throw ( + css::beans::UnknownPropertyException, css::lang::WrappedTargetException, + css::uno::RuntimeException) { - css::uno::Sequence< rtl::OUString > names(getElementNames()); - for (sal_Int32 i = 0; i < names.getLength(); ++i) { - if (aName == names[i]) { - return true; - } + if (PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ExternalMailer")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("SourceViewFontName")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")) || + PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"))) + { + return css::uno::makeAny( + enabled_ + ? kdeaccess::getValue(PropertyName) + : css::beans::Optional< css::uno::Any >()); } - return false; + throw css::beans::UnknownPropertyException( + PropertyName, static_cast< cppu::OWeakObject * >(this)); } css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( diff --git a/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx index 5df54b055929..75544c6d7f05 100644 --- a/shell/source/backends/localebe/localebackend.cxx +++ b/shell/source/backends/localebe/localebackend.cxx @@ -32,6 +32,7 @@ #include "precompiled_shell.hxx" #include "localebackend.hxx" +#include #include #include @@ -282,51 +283,47 @@ rtl::OUString LocaleBackend::getSystemLocale(void) } //------------------------------------------------------------------------------ -css::uno::Type LocaleBackend::getElementType() throw(css::uno::RuntimeException) -{ - return cppu::UnoType< cppu::UnoVoidType >::get(); -} - -sal_Bool LocaleBackend::hasElements() throw(css::uno::RuntimeException) +void LocaleBackend::setPropertyValue( + rtl::OUString const &, css::uno::Any const &) + throw ( + css::beans::UnknownPropertyException, css::beans::PropertyVetoException, + css::lang::IllegalArgumentException, css::lang::WrappedTargetException, + css::uno::RuntimeException) { - return true; + throw css::lang::IllegalArgumentException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")), + static_cast< cppu::OWeakObject * >(this), -1); } -css::uno::Any LocaleBackend::getByName(rtl::OUString const & aName) +css::uno::Any LocaleBackend::getPropertyValue( + rtl::OUString const & PropertyName) throw ( - css::container::NoSuchElementException, - css::lang::WrappedTargetException, css::uno::RuntimeException) + css::beans::UnknownPropertyException, css::lang::WrappedTargetException, + css::uno::RuntimeException) { - if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Locale"))) { - return css::uno::makeAny(getLocale()); - } else if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SystemLocale"))) { - return css::uno::makeAny(getSystemLocale()); - } else if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("UILocale"))) { - return css::uno::makeAny(getUILocale()); + if (PropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Locale"))) { + return css::uno::makeAny( + css::beans::Optional< css::uno::Any >( + true, css::uno::makeAny(getLocale()))); + } else if (PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("SystemLocale"))) + { + return css::uno::makeAny( + css::beans::Optional< css::uno::Any >( + true, css::uno::makeAny(getSystemLocale()))); + } else if (PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("UILocale"))) + { + return css::uno::makeAny( + css::beans::Optional< css::uno::Any >( + true, css::uno::makeAny(getUILocale()))); } else { - throw css::container::NoSuchElementException( - aName, static_cast< cppu::OWeakObject * >(this)); + throw css::beans::UnknownPropertyException( + PropertyName, static_cast< cppu::OWeakObject * >(this)); } } -css::uno::Sequence< rtl::OUString > LocaleBackend::getElementNames() - throw (css::uno::RuntimeException) -{ - css::uno::Sequence< rtl::OUString > names(3); - names[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Locale")); - names[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SystemLocale")); - names[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UILocale")); - return names; -} - -sal_Bool LocaleBackend::hasByName(rtl::OUString const & aName) - throw (css::uno::RuntimeException) -{ - return aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Locale")) || - aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SystemLocale")) || - aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("UILocale")); -} - //------------------------------------------------------------------------------ rtl::OUString SAL_CALL LocaleBackend::getBackendName(void) { diff --git a/shell/source/backends/localebe/localebackend.hxx b/shell/source/backends/localebe/localebackend.hxx index 5e5083694325..954a2bba9a0a 100644 --- a/shell/source/backends/localebe/localebackend.hxx +++ b/shell/source/backends/localebe/localebackend.hxx @@ -31,7 +31,7 @@ #ifndef _FIXEDVALUEBACKEND_HXX_ #define _FIXEDVALUEBACKEND_HXX_ -#include +#include #include #include #include @@ -42,7 +42,7 @@ namespace uno = css::uno ; namespace lang = css::lang ; class LocaleBackend : public ::cppu::WeakImplHelper2 < - css::container::XNameAccess, + css::beans::XPropertySet, lang::XServiceInfo > { public : @@ -75,27 +75,56 @@ class LocaleBackend : public ::cppu::WeakImplHelper2 < */ static uno::Sequence SAL_CALL getBackendServiceNames(void) ; - //XNameAccess - virtual uno::Type SAL_CALL - getElementType() - throw (uno::RuntimeException); - - virtual sal_Bool SAL_CALL - hasElements() - throw (uno::RuntimeException); - - virtual uno::Any SAL_CALL - getByName( const rtl::OUString& aName ) - throw (css::container::NoSuchElementException, - lang::WrappedTargetException, uno::RuntimeException); - - virtual uno::Sequence SAL_CALL - getElementNames() - throw (uno::RuntimeException); - - virtual sal_Bool SAL_CALL - hasByName( const rtl::OUString& aName ) - throw (uno::RuntimeException); + // XPropertySet + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() throw (css::uno::RuntimeException) + { return css::uno::Reference< css::beans::XPropertySetInfo >(); } + + virtual void SAL_CALL setPropertyValue( + rtl::OUString const &, css::uno::Any const &) + throw ( + css::beans::UnknownPropertyException, + css::beans::PropertyVetoException, + css::lang::IllegalArgumentException, + css::lang::WrappedTargetException, css::uno::RuntimeException); + + virtual css::uno::Any SAL_CALL getPropertyValue( + rtl::OUString const & PropertyName) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException); + + virtual void SAL_CALL addPropertyChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XPropertyChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL removePropertyChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XPropertyChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL addVetoableChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XVetoableChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL removeVetoableChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XVetoableChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} protected: /** diff --git a/shell/source/backends/macbe/macbackend.cxx b/shell/source/backends/macbe/macbackend.cxx index f532e943e9c7..5c408e059da4 100644 --- a/shell/source/backends/macbe/macbackend.cxx +++ b/shell/source/backends/macbe/macbackend.cxx @@ -41,6 +41,7 @@ #include "macbackend.hxx" +#include "com/sun/star/beans/Optional.hpp" #include "rtl/ustrbuf.hxx" #include "osl/file.h" @@ -211,22 +212,28 @@ rtl::OUString GetOUString( NSString* pStr ) return aBuf.makeStringAndClear(); } -css::uno::Type MacOSXBackend::getElementType() throw(css::uno::RuntimeException) -{ - return cppu::UnoType< cppu::UnoVoidType >::get(); -} - -sal_Bool MacOSXBackend::hasElements() throw(css::uno::RuntimeException) +void MacOSXBackend::setPropertyValue( + rtl::OUString const &, css::uno::Any const &) + throw ( + css::beans::UnknownPropertyException, css::beans::PropertyVetoException, + css::lang::IllegalArgumentException, css::lang::WrappedTargetException, + css::uno::RuntimeException) { - return true; + throw css::lang::IllegalArgumentException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")), + static_cast< cppu::OWeakObject * >(this), -1); } -css::uno::Any MacOSXBackend::getByName(rtl::OUString const & aName) +css::uno::Any MacOSXBackend::getPropertyValue( + rtl::OUString const & PropertyName) throw ( - css::container::NoSuchElementException, - css::lang::WrappedTargetException, css::uno::RuntimeException) + css::beans::UnknownPropertyException, css::lang::WrappedTargetException, + css::uno::RuntimeException) { - if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("WorkPathVariable"))) { + if (PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("WorkPathVariable"))) + { rtl::OUString aDocDir; NSArray* pPaths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, true ); if( pPaths && [pPaths count] > 0 ) @@ -237,7 +244,9 @@ css::uno::Any MacOSXBackend::getByName(rtl::OUString const & aName) if( aDocDir.getLength() > 0 && osl_getFileURLFromSystemPath( aDocDir.pData, &aDocURL.pData ) == osl_File_E_None ) { - return css::uno::makeAny(aDocURL); + return css::uno::makeAny( + css::beans::Optional< css::uno::Any >( + true, css::uno::makeAny( aDocURL ) ) ); } else { @@ -248,8 +257,8 @@ css::uno::Any MacOSXBackend::getByName(rtl::OUString const & aName) { OSL_TRACE( "Got nil or empty list of user document directories" ); } - return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); - } else if (aName.equalsAsciiL( + return css::uno::makeAny(css::beans::Optional< css::uno::Any >()); + } else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName"))) { ProxyEntry aFtpProxy; @@ -268,10 +277,12 @@ css::uno::Any MacOSXBackend::getByName(rtl::OUString const & aName) // ftp proxy name if( aFtpProxy.Server.getLength() > 0 ) { - return uno::makeAny( aFtpProxy.Server ); + return css::uno::makeAny( + css::beans::Optional< css::uno::Any >( + true, uno::makeAny( aFtpProxy.Server ) ) ); } - return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); - } else if (aName.equalsAsciiL( + return css::uno::makeAny(css::beans::Optional< css::uno::Any >()); + } else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort"))) { ProxyEntry aFtpProxy; @@ -290,10 +301,12 @@ css::uno::Any MacOSXBackend::getByName(rtl::OUString const & aName) // ftp proxy port if( aFtpProxy.Port > 0 ) { - return uno::makeAny( aFtpProxy.Port ); + return css::uno::makeAny( + css::beans::Optional< css::uno::Any >( + true, uno::makeAny( aFtpProxy.Port ) ) ); } - return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); - } else if (aName.equalsAsciiL( + return css::uno::makeAny(css::beans::Optional< css::uno::Any >()); + } else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName"))) { ProxyEntry aHttpProxy; @@ -312,10 +325,12 @@ css::uno::Any MacOSXBackend::getByName(rtl::OUString const & aName) // http proxy name if( aHttpProxy.Server.getLength() > 0 ) { - return uno::makeAny( aHttpProxy.Server ); + return css::uno::makeAny( + css::beans::Optional< css::uno::Any >( + true, uno::makeAny( aHttpProxy.Server ) ) ); } - return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); - } else if (aName.equalsAsciiL( + return css::uno::makeAny(css::beans::Optional< css::uno::Any >()); + } else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort"))) { ProxyEntry aHttpProxy; @@ -334,10 +349,12 @@ css::uno::Any MacOSXBackend::getByName(rtl::OUString const & aName) // http proxy port if( aHttpProxy.Port > 0 ) { - return uno::makeAny( aHttpProxy.Port ); + return css::uno::makeAny( + css::beans::Optional< css::uno::Any >( + true, uno::makeAny( aHttpProxy.Port ) ) ); } - return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); - } else if (aName.equalsAsciiL( + return css::uno::makeAny(css::beans::Optional< css::uno::Any >()); + } else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName"))) { ProxyEntry aHttpsProxy; @@ -356,10 +373,12 @@ css::uno::Any MacOSXBackend::getByName(rtl::OUString const & aName) // https proxy name if( aHttpsProxy.Server.getLength() > 0 ) { - return uno::makeAny( aHttpsProxy.Server ); + return css::uno::makeAny( + css::beans::Optional< css::uno::Any >( + true, uno::makeAny( aHttpsProxy.Server ) ) ); } - return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); - } else if (aName.equalsAsciiL( + return css::uno::makeAny(css::beans::Optional< css::uno::Any >()); + } else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort"))) { ProxyEntry aHttpsProxy; @@ -378,16 +397,20 @@ css::uno::Any MacOSXBackend::getByName(rtl::OUString const & aName) // https proxy port if( aHttpsProxy.Port > 0 ) { - return uno::makeAny( aHttpsProxy.Port ); + return css::uno::makeAny( + css::beans::Optional< css::uno::Any >( + true, uno::makeAny( aHttpsProxy.Port ) ) ); } - return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); - } else if (aName.equalsAsciiL( + return css::uno::makeAny(css::beans::Optional< css::uno::Any >()); + } else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"))) { // override default for ProxyType, which is "0" meaning "No proxies". sal_Int32 nProperties = 1; - return uno::makeAny( nProperties ); - } else if (aName.equalsAsciiL( + return css::uno::makeAny( + css::beans::Optional< css::uno::Any >( + true, uno::makeAny( nProperties ) ) ); + } else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy"))) { rtl::OUString aProxyBypassList; @@ -419,51 +442,18 @@ css::uno::Any MacOSXBackend::getByName(rtl::OUString const & aName) // fill proxy bypass list if( aProxyBypassList.getLength() > 0 ) { - return uno::makeAny( aProxyBypassList.replace( SPACE, SEMI_COLON ) ); + return css::uno::makeAny( + css::beans::Optional< css::uno::Any >( + true, + uno::makeAny( aProxyBypassList.replace( SPACE, SEMI_COLON ) ) ) ); } - return css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + return css::uno::makeAny(css::beans::Optional< css::uno::Any >()); } else { - throw css::container::NoSuchElementException( - aName, static_cast< cppu::OWeakObject * >(this)); + throw css::beans::UnknownPropertyException( + PropertyName, static_cast< cppu::OWeakObject * >(this)); } } -css::uno::Sequence< rtl::OUString > MacOSXBackend::getElementNames() - throw (css::uno::RuntimeException) -{ - css::uno::Sequence< rtl::OUString > names(9); - names[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WorkPathVariable")); - names[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyName")); - names[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyPort")); - names[3] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyName")); - names[4] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyPort")); - names[5] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyName")); - names[6] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyPort")); - names[7] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetNoProxy")); - names[8] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetProxyType")); - return names; -} - -sal_Bool MacOSXBackend::hasByName(rtl::OUString const & aName) - throw (css::uno::RuntimeException) -{ - return aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")) || - aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")) || - aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")) || - aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")) || - aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")) || - aName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")) || - aName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")) || - aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")) || - aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetProxyType")); -} - //------------------------------------------------------------------------------ rtl::OUString SAL_CALL MacOSXBackend::getBackendName(void) diff --git a/shell/source/backends/macbe/macbackend.hxx b/shell/source/backends/macbe/macbackend.hxx index cd15aa83e11a..ef919f077cb1 100644 --- a/shell/source/backends/macbe/macbackend.hxx +++ b/shell/source/backends/macbe/macbackend.hxx @@ -31,7 +31,7 @@ #ifndef _MACBACKEND_HXX_ #define _MACBACKEND_HXX_ -#include +#include #include #include #include @@ -43,7 +43,7 @@ namespace css = com::sun::star; namespace uno = css::uno; namespace lang = css::lang; -class MacOSXBackend : public ::cppu::WeakImplHelper2 +class MacOSXBackend : public ::cppu::WeakImplHelper2 { public: @@ -74,27 +74,56 @@ public: */ static uno::Sequence SAL_CALL getBackendServiceNames(void); - //XNameAccess - virtual uno::Type SAL_CALL - getElementType() - throw (uno::RuntimeException); - - virtual sal_Bool SAL_CALL - hasElements() - throw (uno::RuntimeException); - - virtual uno::Any SAL_CALL - getByName( const rtl::OUString& aName ) - throw (css::container::NoSuchElementException, - lang::WrappedTargetException, uno::RuntimeException); - - virtual uno::Sequence SAL_CALL - getElementNames() - throw (uno::RuntimeException); - - virtual sal_Bool SAL_CALL - hasByName( const rtl::OUString& aName ) - throw (uno::RuntimeException); + // XPropertySet + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() throw (css::uno::RuntimeException) + { return css::uno::Reference< css::beans::XPropertySetInfo >(); } + + virtual void SAL_CALL setPropertyValue( + rtl::OUString const &, css::uno::Any const &) + throw ( + css::beans::UnknownPropertyException, + css::beans::PropertyVetoException, + css::lang::IllegalArgumentException, + css::lang::WrappedTargetException, css::uno::RuntimeException); + + virtual css::uno::Any SAL_CALL getPropertyValue( + rtl::OUString const & PropertyName) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException); + + virtual void SAL_CALL addPropertyChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XPropertyChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL removePropertyChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XPropertyChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL addVetoableChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XVetoableChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL removeVetoableChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XVetoableChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} protected: diff --git a/shell/source/backends/macbe/macbelayer.cxx b/shell/source/backends/macbe/macbelayer.cxx deleted file mode 100644 index ea0d3cb63fb7..000000000000 --- a/shell/source/backends/macbe/macbelayer.cxx +++ /dev/null @@ -1,443 +0,0 @@ -/************************************************************************* - * - * 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: macbelayer.cxx,v $ - * $Revision: 1.6 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" - -// For MAXHOSTNAMELEN constant -#include - -#include -#include -#include -#include - -#include "macbelayer.hxx" - -#include "rtl/ustrbuf.hxx" -#include "osl/file.h" - -#define SPACE ' ' -#define SEMI_COLON ';' - -typedef struct -{ - rtl::OUString Server; - sal_Int32 Port; -} ProxyEntry; - -typedef enum { - sHTTP, - sHTTPS, - sFTP -} ServiceType; - -//------------------------------------------------------------------------ -// helper functions -//------------------------------------------------------------------------ - -namespace // private -{ - -/* - * Returns current proxy settings for selected service type (HTTP or - * FTP) as a C string (in the buffer specified by host and hostSize) - * and a port number. - */ - -bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *port) -{ - bool result; - CFDictionaryRef proxyDict; - CFNumberRef enableNum; - int enable; - CFStringRef hostStr; - CFNumberRef portNum; - int portInt; - - proxyDict = SCDynamicStoreCopyProxies(NULL); - - if (!proxyDict) - return false; - - CFStringRef proxiesEnable; - CFStringRef proxiesProxy; - CFStringRef proxiesPort; - - switch ( sType ) - { - case sHTTP : proxiesEnable = kSCPropNetProxiesHTTPEnable; - proxiesProxy = kSCPropNetProxiesHTTPProxy; - proxiesPort = kSCPropNetProxiesHTTPPort; - break; - case sHTTPS: proxiesEnable = kSCPropNetProxiesHTTPSEnable; - proxiesProxy = kSCPropNetProxiesHTTPSProxy; - proxiesPort = kSCPropNetProxiesHTTPSPort; - break; - default: proxiesEnable = kSCPropNetProxiesFTPEnable; - proxiesProxy = kSCPropNetProxiesFTPProxy; - proxiesPort = kSCPropNetProxiesFTPPort; - break; - } - // Proxy enabled? - enableNum = (CFNumberRef) CFDictionaryGetValue( proxyDict, - proxiesEnable ); - - result = (enableNum != NULL) && (CFGetTypeID(enableNum) == CFNumberGetTypeID()); - - if (result) - result = CFNumberGetValue(enableNum, kCFNumberIntType, &enable) && (enable != 0); - - // Proxy enabled -> get hostname - if (result) - { - hostStr = (CFStringRef) CFDictionaryGetValue( proxyDict, - proxiesProxy ); - - result = (hostStr != NULL) && (CFGetTypeID(hostStr) == CFStringGetTypeID()); - } - - if (result) - result = CFStringGetCString(hostStr, host, (CFIndex) hostSize, kCFStringEncodingASCII); - - // Get proxy port - if (result) - { - portNum = (CFNumberRef) CFDictionaryGetValue( proxyDict, - proxiesPort ); - - result = (portNum != NULL) && (CFGetTypeID(portNum) == CFNumberGetTypeID()); - } - else - { - CFRelease(proxyDict); - return false; - } - - if (result) - result = CFNumberGetValue(portNum, kCFNumberIntType, &portInt); - - if (result) - *port = (UInt16) portInt; - - if (proxyDict) - CFRelease(proxyDict); - - if (!result) - { - *host = 0; - *port = 0; - } - - return result; -} - -} // end private namespace - -//------------------------------------------------------------------------------ - -MacOSXLayer::MacOSXLayer( const uno::Reference& xContext) -{ - //Create instance of LayerContentDescriber Service - rtl::OUString const k_sLayerDescriberService( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.LayerDescriber")); - - typedef uno::Reference LayerDescriber; - uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager(); - if( xServiceManager.is() ) - { - m_xLayerContentDescriber = LayerDescriber::query( - xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext)); - } - else - { - OSL_TRACE("Could not retrieve ServiceManager"); - } - -} - -//------------------------------------------------------------------------------ - -rtl::OUString CFStringToOUString(const CFStringRef sOrig) { - CFRetain(sOrig); - - CFIndex nStringLen = CFStringGetLength(sOrig)+1; - - // Allocate a c string buffer - char sBuffer[nStringLen]; - - CFStringGetCString(sOrig, sBuffer, nStringLen, kCFStringEncodingASCII); - - CFRelease(sOrig); - - return rtl::OUString::createFromAscii((sal_Char*)sBuffer); -} - -void SAL_CALL MacOSXLayer::readData( - const uno::Reference& xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException) -{ - - if (m_xLayerContentDescriber.is()) - { - rtl::OUString aProxyBypassList; - - CFArrayRef rExceptionsList; - CFDictionaryRef rProxyDict = SCDynamicStoreCopyProxies(NULL); - - if (!rProxyDict) - rExceptionsList = false; - else - rExceptionsList = (CFArrayRef) CFDictionaryGetValue(rProxyDict, kSCPropNetProxiesExceptionsList); - - if (rExceptionsList) - { - for (CFIndex idx = 0; idx < CFArrayGetCount(rExceptionsList); idx++) - { - CFStringRef rException = (CFStringRef) CFArrayGetValueAtIndex(rExceptionsList, idx); - - if (idx>0) - aProxyBypassList += rtl::OUString::createFromAscii( ";" ); - - aProxyBypassList += CFStringToOUString(rException); - } - } - - if (rProxyDict) - CFRelease(rProxyDict); - - // override default for ProxyType, which is "0" meaning "No proxies". - // CAUTION: if you add properties, please increase the sequence size here ! - uno::Sequence aPropInfoList(8); - sal_Int32 nProperties = 1; - - aPropInfoList[0].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") ); - aPropInfoList[0].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "int" ) ); - aPropInfoList[0].Protected = sal_False; - aPropInfoList[0].Value = uno::makeAny( nProperties ); - - // fill proxy bypass list - if( aProxyBypassList.getLength() > 0 ) - { - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( aProxyBypassList.replace( SPACE, SEMI_COLON ) ); - } - - ProxyEntry aHttpProxy; - ProxyEntry aHttpsProxy; - ProxyEntry aFtpProxy; - - char host[MAXHOSTNAMELEN]; - UInt16 port; - bool retVal; - - retVal = GetProxySetting(sHTTP, host, 100, &port); - - if (retVal) - { - aHttpProxy.Server = rtl::OUString::createFromAscii( host ); - aHttpProxy.Port = port; - } - - retVal = GetProxySetting(sHTTPS, host, 100, &port); - - if (retVal) - { - aHttpsProxy.Server = rtl::OUString::createFromAscii( host ); - aHttpsProxy.Port = port; - } - - retVal = GetProxySetting(sFTP, host, 100, &port); - - if (retVal) - { - aFtpProxy.Server = rtl::OUString::createFromAscii( host ); - aFtpProxy.Port = port; - } - - // http proxy name - if( aHttpProxy.Server.getLength() > 0 ) - { - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( aHttpProxy.Server ); - } - - // http proxy port - if( aHttpProxy.Port > 0 ) - { - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "int" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( aHttpProxy.Port ); - } - - // https proxy name - if( aHttpsProxy.Server.getLength() > 0 ) - { - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( aHttpsProxy.Server ); - } - - // https proxy port - if( aHttpsProxy.Port > 0 ) - { - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "int" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( aHttpsProxy.Port ); - } - - // ftp proxy name - if( aFtpProxy.Server.getLength() > 0 ) - { - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( aFtpProxy.Server ); - } - - // ftp proxy port - if( aFtpProxy.Port > 0 ) - { - aPropInfoList[nProperties].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") ); - aPropInfoList[nProperties].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "int" ) ); - aPropInfoList[nProperties].Protected = sal_False; - aPropInfoList[nProperties++].Value = uno::makeAny( aFtpProxy.Port ); - } - - // resize the property info list appropriately - aPropInfoList.realloc(nProperties); - - m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList); - } - else - { - OSL_TRACE("Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"); - } -} - -//------------------------------------------------------------------------------ - -rtl::OUString SAL_CALL MacOSXLayer::getTimestamp(void) - throw (uno::RuntimeException) -{ - // FIXME: Always new timestamp!? - rtl::OUString aTimestamp = rtl::OUString::valueOf( time(NULL) ); - - return aTimestamp; -} - -//------------------------------------------------------------------------------ - -rtl::OUString GetOUString( NSString* pStr ) -{ - if( ! pStr ) - return rtl::OUString(); - int nLen = [pStr length]; - if( nLen == 0 ) - return rtl::OUString(); - - rtl::OUStringBuffer aBuf( nLen+1 ); - aBuf.setLength( nLen ); - [pStr getCharacters: const_cast(aBuf.getStr())]; - return aBuf.makeStringAndClear(); -} - -void SAL_CALL MacOSXPathLayer::readData( - const uno::Reference& i_xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException) -{ - if (m_xLayerContentDescriber.is()) - { - rtl::OUString aDocDir; - NSArray* pPaths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, true ); - if( pPaths && [pPaths count] > 0 ) - { - aDocDir = GetOUString( [pPaths objectAtIndex: 0] ); - - rtl::OUString aDocURL; - if( aDocDir.getLength() > 0 && - osl_getFileURLFromSystemPath( aDocDir.pData, &aDocURL.pData ) == osl_File_E_None ) - { - uno::Sequence aPropInfoList(1); - - aPropInfoList[0].Name = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Paths/Variables/Work" ) ); - aPropInfoList[0].Type = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "string" ) ); - aPropInfoList[0].Protected = sal_False; - aPropInfoList[0].Value <<= aDocURL; - - m_xLayerContentDescriber->describeLayer(i_xHandler, aPropInfoList); - } - else - { - OSL_TRACE( "user documents list contains empty file path or conversion failed" ); - } - } - else - { - OSL_TRACE( "Got nil or empty list of user document directories" ); - } - } - else - { - OSL_TRACE("Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"); - } -} - diff --git a/shell/source/backends/macbe/macbelayer.hxx b/shell/source/backends/macbe/macbelayer.hxx deleted file mode 100644 index a1f27148d1a3..000000000000 --- a/shell/source/backends/macbe/macbelayer.hxx +++ /dev/null @@ -1,104 +0,0 @@ -/************************************************************************* - * - * 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: macbelayer.hxx,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _MACBELAYER_HXX_ -#define _MACBELAYER_HXX_ - -#include -#include -#include -#include - -#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_ -#include -#endif -#include -#include -#include - -namespace css = com::sun::star; -namespace uno = css::uno; -namespace lang = css::lang; -namespace backend = css::configuration::backend; -namespace util = css::util; - -/** - Implementation of the XLayer interfaces for fixed values - */ - -class MacOSXLayer : public cppu::WeakImplHelper2 -{ -public: - - /** - Constructor given the requested component name - - @param aTimestamp timestamp indicating last modifictaion - */ - MacOSXLayer(const uno::Reference& xContext); - - /** Destructor */ - virtual ~MacOSXLayer(void) {} - - // XLayer - virtual void SAL_CALL readData(const uno::Reference& xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException); - - // XTimeStamped - virtual rtl::OUString SAL_CALL getTimestamp(void) - throw (uno::RuntimeException); - -protected: - - rtl::OUString m_aComponent; - - uno::Reference m_xLayerContentDescriber; - -}; - -class MacOSXPathLayer : public MacOSXLayer -{ - public: - MacOSXPathLayer(const uno::Reference& i_xContext) : - MacOSXLayer( i_xContext ) {} - virtual ~MacOSXPathLayer() {} - - // XLayer - virtual void SAL_CALL readData(const uno::Reference& i_xHandler) - throw ( backend::MalformedDataException, - lang::NullPointerException, - lang::WrappedTargetException, - uno::RuntimeException); -}; - -#endif // _MACBELAYER_HXX_ diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx b/shell/source/backends/wininetbe/wininetbackend.cxx index 344eefa1a08d..8daa9d690c2b 100644 --- a/shell/source/backends/wininetbe/wininetbackend.cxx +++ b/shell/source/backends/wininetbe/wininetbackend.cxx @@ -114,10 +114,7 @@ namespace // private //------------------------------------------------------------------------------ -WinInetBackend::WinInetBackend(): - hasProxyType_(false), hasNoProxy_(false), hasHttpProxyName_(false), - hasHttpProxyPort_(false), hasHttpsProxyName_(false), - hasHttpsProxyPort_(false), hasFtpProxyName_(false), hasFtpProxyPort_(false) +WinInetBackend::WinInetBackend() { Library hWinInetDll( LoadLibrary( WININET_DLL_NAME ) ); if( hWinInetDll.module ) @@ -166,8 +163,8 @@ WinInetBackend::WinInetBackend(): // override default for ProxyType, which is "0" meaning "No proxies". sal_Int32 nProperties = 1; - valueProxyType_ = nProperties; - hasProxyType_ = true; + valueProxyType_.IsPresent = true; + valueProxyType_.Value <<= nProperties; // fill proxy bypass list if( aProxyBypassList.getLength() > 0 ) @@ -192,8 +189,8 @@ WinInetBackend::WinInetBackend(): aProxyBypassList = aReverseList.makeStringAndClear(); - valueNoProxy_ = aProxyBypassList.replace( SPACE, SEMI_COLON ); - hasNoProxy_ = true; + valueNoProxy_.IsPresent = true; + valueNoProxy_.Value <<= aProxyBypassList.replace( SPACE, SEMI_COLON ); } if( aProxyList.getLength() > 0 ) @@ -246,43 +243,43 @@ WinInetBackend::WinInetBackend(): // http proxy name if( aHttpProxy.Server.getLength() > 0 ) { - valueHttpProxyName_ = aHttpProxy.Server; - hasHttpProxyName_ = true; + valueHttpProxyName_.IsPresent = true; + valueHttpProxyName_.Value <<= aHttpProxy.Server; } // http proxy port if( aHttpProxy.Port.getLength() > 0 ) { - valueHttpProxyPort_ = aHttpProxy.Port.toInt32(); - hasHttpProxyPort_ = true; + valueHttpProxyPort_.IsPresent = true; + valueHttpProxyPort_.Value <<= aHttpProxy.Port.toInt32(); } // https proxy name if( aHttpsProxy.Server.getLength() > 0 ) { - valueHttpsProxyName_ = aHttpsProxy.Server; - valueHttpsProxyPort_ = true; + valueHttpsProxyName_.IsPresent = true; + valueHttpsProxyName_.Value <<= aHttpsProxy.Server; } // https proxy port if( aHttpsProxy.Port.getLength() > 0 ) { - valueHttpsProxyPort_ = aHttpsProxy.Port.toInt32(); - hasHttpsProxyPort_ = true; + valueHttpsProxyPort_.IsPresent = true; + valueHttpsProxyPort_.Value <<= aHttpsProxy.Port.toInt32(); } // ftp proxy name if( aFtpProxy.Server.getLength() > 0 ) { - valueFtpProxyName_ = aFtpProxy.Server; - hasFtpProxyName_ = true; + valueFtpProxyName_.IsPresent = true; + valueFtpProxyName_.Value <<= aFtpProxy.Server; } // ftp proxy port if( aFtpProxy.Port.getLength() > 0 ) { - valueFtpProxyPort_ = aFtpProxy.Port.toInt32(); - hasFtpProxyPort_ = true; + valueFtpProxyPort_.IsPresent = true; + valueFtpProxyPort_.Value <<= aFtpProxy.Port.toInt32(); } } } @@ -304,108 +301,63 @@ WinInetBackend* WinInetBackend::createInstance() // --------------------------------------------------------------------------------------- -css::uno::Type WinInetBackend::getElementType() throw(css::uno::RuntimeException) -{ - return cppu::UnoType< cppu::UnoVoidType >::get(); -} - -sal_Bool WinInetBackend::hasElements() throw(css::uno::RuntimeException) +void WinInetBackend::setPropertyValue( + rtl::OUString const &, css::uno::Any const &) + throw ( + css::beans::UnknownPropertyException, css::beans::PropertyVetoException, + css::lang::IllegalArgumentException, css::lang::WrappedTargetException, + css::uno::RuntimeException) { - return true; + throw css::lang::IllegalArgumentException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")), + static_cast< cppu::OWeakObject * >(this), -1); } -css::uno::Any WinInetBackend::getByName(rtl::OUString const & aName) +css::uno::Any WinInetBackend::getPropertyValue( + rtl::OUString const & PropertyName) throw ( - css::container::NoSuchElementException, - css::lang::WrappedTargetException, css::uno::RuntimeException) + css::beans::UnknownPropertyException, css::lang::WrappedTargetException, + css::uno::RuntimeException) { - if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName"))) { - return hasFtpProxyName_ - ? uno::makeAny( valueFtpProxyName_ ) - : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); - } else if (aName.equalsAsciiL( + if (PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName"))) + { + return css::uno::makeAny(valueFtpProxyName_); + } else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort"))) { - return hasFtpProxyPort_ - ? uno::makeAny( valueFtpProxyPort_ ) - : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); - } else if (aName.equalsAsciiL( + return css::uno::makeAny(valueFtpProxyPort_); + } else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName"))) { - return hasHttpProxyName_ - ? uno::makeAny( valueHttpProxyName_ ) - : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); - } else if (aName.equalsAsciiL( + return css::uno::makeAny(valueHttpProxyName_); + } else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort"))) { - return hasHttpProxyPort_ - ? uno::makeAny( valueHttpProxyPort_ ) - : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); - } else if (aName.equalsAsciiL( + return css::uno::makeAny(valueHttpProxyPort_); + } else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName"))) { - return hasHttpsProxyName_ - ? uno::makeAny( valueHttpsProxyName_ ) - : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); - } else if (aName.equalsAsciiL( + return css::uno::makeAny(valueHttpsProxyName_); + } else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort"))) { - return hasHttpsProxyPort_ - ? uno::makeAny( valueHttpsProxyPort_ ) - : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); - } else if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy"))) + return css::uno::makeAny(valueHttpsProxyPort_); + } else if (PropertyName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy"))) { - return hasNoProxy_ - ? uno::makeAny( valueNoProxy_ ) - : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); - } else if (aName.equalsAsciiL( + return css::uno::makeAny(valueNoProxy_); + } else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"))) { - return hasProxyType_ - ? uno::makeAny( valueProxyType_ ) - : css::uno::makeAny(cppu::UnoType< cppu::UnoVoidType >::get()); + return css::uno::makeAny(valueProxyType_); } else { - throw css::container::NoSuchElementException( - aName, static_cast< cppu::OWeakObject * >(this)); + throw css::beans::UnknownPropertyException( + PropertyName, static_cast< cppu::OWeakObject * >(this)); } } -css::uno::Sequence< rtl::OUString > WinInetBackend::getElementNames() - throw (css::uno::RuntimeException) -{ - css::uno::Sequence< rtl::OUString > names(8); - names[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyName")); - names[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetFTPProxyPort")); - names[2] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyName")); - names[3] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPProxyPort")); - names[4] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyName")); - names[5] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("ooInetHTTPSProxyPort")); - names[6] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetNoProxy")); - names[7] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ooInetProxyType")); - return names; -} - -sal_Bool WinInetBackend::hasByName(rtl::OUString const & aName) - throw (css::uno::RuntimeException) -{ - return - aName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")) || - aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")) || - aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")) || - aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")) || - aName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")) || - aName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")) || - aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")) || - aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetProxyType")); -} - //------------------------------------------------------------------------------ rtl::OUString SAL_CALL WinInetBackend::getBackendName(void) { diff --git a/shell/source/backends/wininetbe/wininetbackend.hxx b/shell/source/backends/wininetbe/wininetbackend.hxx index 776fdc5e9c16..d1ba7c59d2a4 100644 --- a/shell/source/backends/wininetbe/wininetbackend.hxx +++ b/shell/source/backends/wininetbe/wininetbackend.hxx @@ -31,9 +31,9 @@ #ifndef _FIXEDVALUEBACKEND_HXX_ #define _FIXEDVALUEBACKEND_HXX_ -#include +#include +#include #include -#include #include #include @@ -42,7 +42,7 @@ namespace uno = css::uno ; namespace lang = css::lang ; class WinInetBackend : public ::cppu::WeakImplHelper2 < - css::container::XNameAccess, + css::beans::XPropertySet, lang::XServiceInfo > { public : @@ -75,27 +75,56 @@ class WinInetBackend : public ::cppu::WeakImplHelper2 < */ static uno::Sequence SAL_CALL getBackendServiceNames(void) ; - //XNameAccess - virtual uno::Type SAL_CALL - getElementType() - throw (uno::RuntimeException); - - virtual sal_Bool SAL_CALL - hasElements() - throw (uno::RuntimeException); - - virtual uno::Any SAL_CALL - getByName( const rtl::OUString& aName ) - throw (css::container::NoSuchElementException, - lang::WrappedTargetException, uno::RuntimeException); - - virtual uno::Sequence SAL_CALL - getElementNames() - throw (uno::RuntimeException); - - virtual sal_Bool SAL_CALL - hasByName( const rtl::OUString& aName ) - throw (uno::RuntimeException); + // XPropertySet + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() throw (css::uno::RuntimeException) + { return css::uno::Reference< css::beans::XPropertySetInfo >(); } + + virtual void SAL_CALL setPropertyValue( + rtl::OUString const &, css::uno::Any const &) + throw ( + css::beans::UnknownPropertyException, + css::beans::PropertyVetoException, + css::lang::IllegalArgumentException, + css::lang::WrappedTargetException, css::uno::RuntimeException); + + virtual css::uno::Any SAL_CALL getPropertyValue( + rtl::OUString const & PropertyName) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException); + + virtual void SAL_CALL addPropertyChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XPropertyChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL removePropertyChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XPropertyChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL addVetoableChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XVetoableChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL removeVetoableChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XVetoableChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} protected: /** @@ -109,22 +138,22 @@ class WinInetBackend : public ::cppu::WeakImplHelper2 < ~WinInetBackend(void) ; private: - sal_Int32 valueProxyType_; - rtl::OUString valueNoProxy_; - rtl::OUString valueHttpProxyName_; - sal_Int32 valueHttpProxyPort_; - rtl::OUString valueHttpsProxyName_; - sal_Int32 valueHttpsProxyPort_; - rtl::OUString valueFtpProxyName_; - sal_Int32 valueFtpProxyPort_; - bool hasProxyType_; - bool hasNoProxy_; - bool hasHttpProxyName_; - bool hasHttpProxyPort_; - bool hasHttpsProxyName_; - bool hasHttpsProxyPort_; - bool hasFtpProxyName_; - bool hasFtpProxyPort_; + com::sun::star::beans::Optional< com::sun::star::uno::Any > + valueProxyType_; + com::sun::star::beans::Optional< com::sun::star::uno::Any > + valueNoProxy_; + com::sun::star::beans::Optional< com::sun::star::uno::Any > + valueHttpProxyName_; + com::sun::star::beans::Optional< com::sun::star::uno::Any > + valueHttpProxyPort_; + com::sun::star::beans::Optional< com::sun::star::uno::Any > + valueHttpsProxyName_; + com::sun::star::beans::Optional< com::sun::star::uno::Any > + valueHttpsProxyPort_; + com::sun::star::beans::Optional< com::sun::star::uno::Any > + valueFtpProxyName_; + com::sun::star::beans::Optional< com::sun::star::uno::Any > + valueFtpProxyPort_; } ; -- cgit From 668284400187d5ee432dcd340e0778d2e7415aad Mon Sep 17 00:00:00 2001 From: Tobias Krause Date: Wed, 25 Nov 2009 11:44:28 +0100 Subject: tkr32: #i106189,i106190# get rid of stlport for windows shell extensions --- shell/prj/build.lst | 1 - shell/source/all/makefile.mk | 4 + shell/source/all/ooofilereader/makefile.mk | 4 + shell/source/all/zipfile/makefile.mk | 6 +- shell/source/win32/makefile.mk | 2 + .../win32/shlxthandler/columninfo/makefile.mk | 2 + .../source/win32/shlxthandler/infotips/makefile.mk | 3 + shell/source/win32/shlxthandler/makefile.mk | 5 +- .../source/win32/shlxthandler/ooofilt/makefile.mk | 7 +- .../source/win32/shlxthandler/ooofilt/ooofilt.cxx | 400 ++++++++++----------- .../win32/shlxthandler/ooofilt/proxy/exports.dxp | 4 - .../win32/shlxthandler/ooofilt/proxy/makefile.mk | 92 ----- .../shlxthandler/ooofilt/proxy/ooofiltproxy.cxx | 164 --------- .../win32/shlxthandler/propsheets/makefile.mk | 2 + .../win32/shlxthandler/thumbviewer/makefile.mk | 2 + .../win32/shlxthandler/util/iso8601_converter.cxx | 4 +- shell/source/win32/shlxthandler/util/makefile.mk | 2 + 17 files changed, 238 insertions(+), 466 deletions(-) delete mode 100644 shell/source/win32/shlxthandler/ooofilt/proxy/exports.dxp delete mode 100644 shell/source/win32/shlxthandler/ooofilt/proxy/makefile.mk delete mode 100644 shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx (limited to 'shell') diff --git a/shell/prj/build.lst b/shell/prj/build.lst index ed4fbca7e3f5..864ff49b3211 100644 --- a/shell/prj/build.lst +++ b/shell/prj/build.lst @@ -31,4 +31,3 @@ sl shell\source\backends\kdebe nmake - u sl_backends_k sl shell\source\backends\kde4be nmake - u sl_backends_kde4be sl_inc NULL sl shell\source\backends\desktopbe nmake - u sl_backends_desktopbe sl_inc NULL sl shell\source\win32\shlxthandler\ooofilt nmake - w sl_win32_shlxthandler_ooofilt sl_all_zipfile.w sl_all_ooofilereader.w sl_win32_shlxthandler_util.w sl_all sl_inc NULL -sl shell\source\win32\shlxthandler\ooofilt\proxy nmake - w sl_win32_ooofiltproxy sl_inc NULL diff --git a/shell/source/all/makefile.mk b/shell/source/all/makefile.mk index 623aad6d69c1..dd72f8e1c061 100755 --- a/shell/source/all/makefile.mk +++ b/shell/source/all/makefile.mk @@ -69,5 +69,9 @@ SLOFILES_X64=$(SLO_X64)$/xml_parser.obj .INCLUDE : set_wntx64.mk .INCLUDE : target.mk +.IF "$(OS)" == "WNT" +INCLUDE!:=$(subst,/stl, $(INCLUDE)) +.EXPORT : INCLUDE +.ENDIF .INCLUDE : tg_wntx64.mk diff --git a/shell/source/all/ooofilereader/makefile.mk b/shell/source/all/ooofilereader/makefile.mk index b893db45d849..cfdf53523634 100644 --- a/shell/source/all/ooofilereader/makefile.mk +++ b/shell/source/all/ooofilereader/makefile.mk @@ -85,5 +85,9 @@ LIB1FILES_X64=$(SLB_X64)$/zipfile.lib\ .INCLUDE : set_wntx64.mk .INCLUDE : target.mk +.IF "$(OS)" == "WNT" +INCLUDE!:=$(subst,/stl, $(INCLUDE)) +.EXPORT : INCLUDE +.ENDIF .INCLUDE : tg_wntx64.mk diff --git a/shell/source/all/zipfile/makefile.mk b/shell/source/all/zipfile/makefile.mk index 9f294ce7aad0..8a7aadb6c4ac 100644 --- a/shell/source/all/zipfile/makefile.mk +++ b/shell/source/all/zipfile/makefile.mk @@ -33,7 +33,7 @@ PRJ=..$/..$/.. PRJNAME=shell TARGET=zipfile ENABLE_EXCEPTIONS=TRUE -EXTERNAL_WARNINGS_NOT_ERRORS := TRUE +EXTERNAL_WARNINGS_NOT_ERRORS := TRUE @@ -54,5 +54,9 @@ SLOFILES_X64=$(SLO_X64)$/zipfile.obj\ .INCLUDE : set_wntx64.mk .INCLUDE : target.mk +.IF "$(OS)" == "WNT" +INCLUDE!:=$(subst,/stl, $(INCLUDE)) +.EXPORT : INCLUDE +.ENDIF .INCLUDE : tg_wntx64.mk diff --git a/shell/source/win32/makefile.mk b/shell/source/win32/makefile.mk index 04cc45d89bc3..cf9e9dc9f600 100644 --- a/shell/source/win32/makefile.mk +++ b/shell/source/win32/makefile.mk @@ -68,4 +68,6 @@ DEF1EXPORTFILE= exports.dxp # --- Targets ------------------------------------------------------ .INCLUDE : target.mk +INCLUDE!:=$(subst,/stl, $(INCLUDE)) +.EXPORT : INCLUDE diff --git a/shell/source/win32/shlxthandler/columninfo/makefile.mk b/shell/source/win32/shlxthandler/columninfo/makefile.mk index 0b25d470aa7b..98adab6b7573 100644 --- a/shell/source/win32/shlxthandler/columninfo/makefile.mk +++ b/shell/source/win32/shlxthandler/columninfo/makefile.mk @@ -58,4 +58,6 @@ SLOFILES_X64=$(SLO_X64)$/$(TARGET).obj # --- Targets ------------------------------------------------------ .INCLUDE : set_wntx64.mk .INCLUDE : target.mk +INCLUDE!:=$(subst,/stl, $(INCLUDE)) +.EXPORT : INCLUDE .INCLUDE : tg_wntx64.mk \ No newline at end of file diff --git a/shell/source/win32/shlxthandler/infotips/makefile.mk b/shell/source/win32/shlxthandler/infotips/makefile.mk index cf489f323278..3533b9718565 100644 --- a/shell/source/win32/shlxthandler/infotips/makefile.mk +++ b/shell/source/win32/shlxthandler/infotips/makefile.mk @@ -34,6 +34,7 @@ PRJNAME=shell TARGET=infotips LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE +EXTERNAL_WARNINGS_NOT_ERRORS := TRUE # --- Settings ----------------------------------------------------- @@ -58,4 +59,6 @@ SLOFILES_X64=$(SLO_X64)$/$(TARGET).obj .INCLUDE : set_wntx64.mk .INCLUDE : target.mk +INCLUDE!:=$(subst,/stl, $(INCLUDE)) +.EXPORT : INCLUDE .INCLUDE : tg_wntx64.mk \ No newline at end of file diff --git a/shell/source/win32/shlxthandler/makefile.mk b/shell/source/win32/shlxthandler/makefile.mk index 07eea87f0263..481dbe654a7f 100644 --- a/shell/source/win32/shlxthandler/makefile.mk +++ b/shell/source/win32/shlxthandler/makefile.mk @@ -79,7 +79,8 @@ SHL1STDLIBS+=\ $(SHELL32LIB)\ $(KERNEL32LIB)\ $(GDI32LIB)\ - $(GDIPLUSLIB) + $(GDIPLUSLIB)\ + msvcprt.lib SHL1LIBS+=$(SLB)$/util.lib\ $(SLB)$/ooofilereader.lib @@ -143,4 +144,6 @@ DEF1EXPORTFILE_X64=exports.dxp .INCLUDE : set_wntx64.mk .INCLUDE : target.mk +INCLUDE!:=$(subst,/stl, $(INCLUDE)) +.EXPORT : INCLUDE .INCLUDE : tg_wntx64.mk diff --git a/shell/source/win32/shlxthandler/ooofilt/makefile.mk b/shell/source/win32/shlxthandler/ooofilt/makefile.mk index 22127bc8ddac..f8e53d030b69 100644 --- a/shell/source/win32/shlxthandler/ooofilt/makefile.mk +++ b/shell/source/win32/shlxthandler/ooofilt/makefile.mk @@ -37,7 +37,7 @@ ENABLE_EXCEPTIONS=TRUE USE_DEFFILE=TRUE # Do not use the dynamic STLport library. -# NO_DEFAULT_STL=YES +NO_DEFAULT_STL=YES # Do not use the uwinapi library UWINAPILIB= @@ -76,7 +76,8 @@ SHL1STDLIBS+=$(OLE32LIB)\ $(UUIDLIB)\ $(SHELL32LIB)\ $(KERNEL32LIB)\ - $(OLDNAMESLIB) + $(OLDNAMESLIB)\ + msvcprt.lib # $(LIBSTLPORTST) @@ -129,4 +130,6 @@ DEF1EXPORTFILE_X64=exports.dxp .INCLUDE : set_wntx64.mk .INCLUDE : target.mk +INCLUDE!:=$(subst,/stl, $(INCLUDE)) +.EXPORT : INCLUDE .INCLUDE : tg_wntx64.mk \ No newline at end of file diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx index ac8dd676c3b1..9ba8542f33d4 100644 --- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx +++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx @@ -78,8 +78,8 @@ #include #include "assert.h" #include "ooofilt.hxx" -#include -#include +#include +#include #include "propspec.hxx" #ifdef __MINGW32__ #include @@ -120,7 +120,7 @@ COooFilter::COooFilter() : m_ChunkPosition(0), m_cAttributes(0), m_pAttributes(0), - m_pStream(NULL) + m_pStream(NULL) { InterlockedIncrement( &g_lInstances ); @@ -176,8 +176,8 @@ SCODE STDMETHODCALLTYPE COooFilter::QueryInterface( pUnkTemp = (IUnknown *)(IPersistFile *)this; else if ( IID_IPersist == riid ) pUnkTemp = (IUnknown *)(IPersist *)(IPersistFile *)this; - else if (IID_IPersistStream == riid) - pUnkTemp = (IUnknown *)(IPersistStream *)this; + else if (IID_IPersistStream == riid) + pUnkTemp = (IUnknown *)(IPersistStream *)this; else if ( IID_IUnknown == riid ) pUnkTemp = (IUnknown *)(IPersist *)(IPersistFile *)this; else @@ -720,99 +720,99 @@ SCODE STDMETHODCALLTYPE COooFilter::SaveCompleted(LPCWSTR /*pszFileName*/) return S_OK; } -//M------------------------------------------------------------------------- -// -// Method: COooFilter::Load (IPersistStream::Load) -// -// Summary: Initializes an object from the stream where it was previously saved -// -// Arguments: pStm -// [in] Pointer to stream from which object should be loaded -// -// -// Returns: S_OK -// E_OUTOFMEMORY -// E_FAIL -// -// -//-------------------------------------------------------------------------- -SCODE STDMETHODCALLTYPE COooFilter::Load(IStream *pStm) -{ - - // These next few lines work around the "Seek pointer" bug found on Vista. - - char buf[20]; - unsigned long count; - HRESULT hr; - ULARGE_INTEGER NewPosition; - LARGE_INTEGER Move; - Move.QuadPart = 0; - hr = pStm->Seek (Move, STREAM_SEEK_SET, &NewPosition); - hr = pStm->Read (buf, 20, &count); - - zlib_filefunc_def z_filefunc; - fill_stream_filefunc (&z_filefunc); - z_filefunc.opaque = (void*)pStm; - - m_pStream = pStm; - - try - { - if (m_pMetaInfoReader) - delete m_pMetaInfoReader; - m_pMetaInfoReader = new CMetaInfoReader((void*)m_pStream, &z_filefunc); - - if (m_pContentReader) - delete m_pContentReader; - m_pContentReader = new CContentReader((void*)m_pStream, m_pMetaInfoReader->getDefaultLocale(), &z_filefunc); - } - catch (const std::exception&) - { - return E_FAIL; - } - return S_OK; -} - -//M------------------------------------------------------------------------- -// -// Method: COooFilter::GetSizeMax (IPersistStream::GetSizeMax) -// -// Summary: Returns the size in bytes of the stream neede to save the object. -// -// Arguments: pcbSize -// [out] Pointer to a 64 bit unsigned int indicating the size needed -// -// Returns: E_NOTIMPL -// -// -//-------------------------------------------------------------------------- -SCODE STDMETHODCALLTYPE COooFilter::GetSizeMax(ULARGE_INTEGER * /*pcbSize*/) -{ - // - return E_NOTIMPL; -} - -//M------------------------------------------------------------------------- -// -// Method: COooFilter::Save (IPersistStream::Save) -// -// Summary: Save object to specified stream -// -// Arguments: pStm -// [in] Pointer to stream -// -// fClearDirty -// [in] Indicates whether to clear dirty flag -// -// Returns: E_NOTIMPL -// -// -//-------------------------------------------------------------------------- -SCODE STDMETHODCALLTYPE COooFilter::Save(IStream * /*pStm*/, BOOL ) -{ - // - return E_NOTIMPL; -} +//M------------------------------------------------------------------------- +// +// Method: COooFilter::Load (IPersistStream::Load) +// +// Summary: Initializes an object from the stream where it was previously saved +// +// Arguments: pStm +// [in] Pointer to stream from which object should be loaded +// +// +// Returns: S_OK +// E_OUTOFMEMORY +// E_FAIL +// +// +//-------------------------------------------------------------------------- +SCODE STDMETHODCALLTYPE COooFilter::Load(IStream *pStm) +{ + + // These next few lines work around the "Seek pointer" bug found on Vista. + + char buf[20]; + unsigned long count; + HRESULT hr; + ULARGE_INTEGER NewPosition; + LARGE_INTEGER Move; + Move.QuadPart = 0; + hr = pStm->Seek (Move, STREAM_SEEK_SET, &NewPosition); + hr = pStm->Read (buf, 20, &count); + + zlib_filefunc_def z_filefunc; + fill_stream_filefunc (&z_filefunc); + z_filefunc.opaque = (void*)pStm; + + m_pStream = pStm; + + try + { + if (m_pMetaInfoReader) + delete m_pMetaInfoReader; + m_pMetaInfoReader = new CMetaInfoReader((void*)m_pStream, &z_filefunc); + + if (m_pContentReader) + delete m_pContentReader; + m_pContentReader = new CContentReader((void*)m_pStream, m_pMetaInfoReader->getDefaultLocale(), &z_filefunc); + } + catch (const std::exception&) + { + return E_FAIL; + } + return S_OK; +} + +//M------------------------------------------------------------------------- +// +// Method: COooFilter::GetSizeMax (IPersistStream::GetSizeMax) +// +// Summary: Returns the size in bytes of the stream neede to save the object. +// +// Arguments: pcbSize +// [out] Pointer to a 64 bit unsigned int indicating the size needed +// +// Returns: E_NOTIMPL +// +// +//-------------------------------------------------------------------------- +SCODE STDMETHODCALLTYPE COooFilter::GetSizeMax(ULARGE_INTEGER * /*pcbSize*/) +{ + // + return E_NOTIMPL; +} + +//M------------------------------------------------------------------------- +// +// Method: COooFilter::Save (IPersistStream::Save) +// +// Summary: Save object to specified stream +// +// Arguments: pStm +// [in] Pointer to stream +// +// fClearDirty +// [in] Indicates whether to clear dirty flag +// +// Returns: E_NOTIMPL +// +// +//-------------------------------------------------------------------------- +SCODE STDMETHODCALLTYPE COooFilter::Save(IStream * /*pStm*/, BOOL ) +{ + // + return E_NOTIMPL; +} //M------------------------------------------------------------------------- // @@ -1247,14 +1247,14 @@ namespace /* private */ if (!SetRegistryKey(HKEY_CLASSES_ROOT, ClsidEntry_Persist.c_str(), "", "OpenOffice.org Persistent Handler")) return E_FAIL; - // Add missing entry - std::string ClsidEntry_Persist_Entry = CLSID_PERSIST_ENTRY; - SubstitutePlaceholder(ClsidEntry_Persist_Entry, - GUID_PLACEHOLDER, - ClsidToString(PersistentGuid)); - - if (!SetRegistryKey(HKEY_CLASSES_ROOT, ClsidEntry_Persist_Entry.c_str(), "", ClsidToString(PersistentGuid).c_str())); + // Add missing entry + std::string ClsidEntry_Persist_Entry = CLSID_PERSIST_ENTRY; + SubstitutePlaceholder(ClsidEntry_Persist_Entry, + GUID_PLACEHOLDER, + ClsidToString(PersistentGuid)); + if (!SetRegistryKey(HKEY_CLASSES_ROOT, ClsidEntry_Persist_Entry.c_str(), "", ClsidToString(PersistentGuid).c_str())) + return E_FAIL; std::string ClsidEntry_Persist_Addin = CLSID_GUID_PERSIST_ADDIN_ENTRY; SubstitutePlaceholder(ClsidEntry_Persist_Addin, @@ -1505,99 +1505,99 @@ STDAPI DllUnregisterServer() return S_OK; } -extern "C" { - - // IStream callback - voidpf ZCALLBACK cb_sopen (voidpf opaque, const char* filename, int mode) { - return opaque; - } - - uLong ZCALLBACK cb_sread (voidpf opaque, voidpf stream, void* buf, uLong size) { - unsigned long newsize; - HRESULT hr; - - hr = ((IStream *)stream)->Read (buf, size, &newsize); - if (hr == S_OK){ - return (unsigned long)newsize; - } - else { - return (uLong)0; - } - } - - long ZCALLBACK cb_sseek (voidpf opaque, voidpf stream, uLong offset, int origin) { - // IStream::Seek parameters - HRESULT hr; - LARGE_INTEGER Move; - DWORD dwOrigin; - Move.QuadPart = (__int64)offset; - - switch (origin) { - case SEEK_CUR: - dwOrigin = STREAM_SEEK_CUR; - break; - case SEEK_END: - dwOrigin = STREAM_SEEK_END; - break; - case SEEK_SET: - dwOrigin = STREAM_SEEK_SET; - break; - default: - return -1; - } - - hr = ((IStream*)stream)->Seek (Move, dwOrigin, NULL); - if (hr == S_OK){ - return 0; - } - else { - return -1; - } - } - - long ZCALLBACK cb_stell (voidpf opaque, voidpf stream) { - // IStream::Seek parameters - HRESULT hr; - LARGE_INTEGER Move; - ULARGE_INTEGER NewPosition; - Move.QuadPart = 0; - NewPosition.QuadPart = 0; - - hr = ((IStream*)stream)->Seek (Move, STREAM_SEEK_CUR, &NewPosition); - if (hr == S_OK){ - return (long) NewPosition.QuadPart; - } - else { - return -1; - } - } - - int ZCALLBACK cb_sclose (voidpf opaque, voidpf stream) { - return 0; - } - - int ZCALLBACK cb_serror (voidpf opaque, voidpf stream) { - return 0; //RJK - for now - } - - uLong ZCALLBACK cb_swrite (voidpf opaque, voidpf stream, const void* buf, uLong size) { - HRESULT hr; - unsigned long writecount; - hr = ((IStream*)stream)->Write (buf, size, &writecount); - if (hr == S_OK) - return (unsigned int)writecount; - else - return (uLong)0; - } - - void fill_stream_filefunc (zlib_filefunc_def* pzlib_filefunc_def) { - pzlib_filefunc_def->zopen_file = cb_sopen; - pzlib_filefunc_def->zread_file = cb_sread; - pzlib_filefunc_def->zwrite_file = cb_swrite; - pzlib_filefunc_def->ztell_file = cb_stell; - pzlib_filefunc_def->zseek_file = cb_sseek; - pzlib_filefunc_def->zclose_file = cb_sclose; - pzlib_filefunc_def->zerror_file = cb_serror; - } -} +extern "C" { + + // IStream callback + voidpf ZCALLBACK cb_sopen (voidpf opaque, const char* /*filename*/, int /*mode*/) { + return opaque; + } + + uLong ZCALLBACK cb_sread (voidpf /*opaque*/, voidpf stream, void* buf, uLong size) { + unsigned long newsize; + HRESULT hr; + + hr = ((IStream *)stream)->Read (buf, size, &newsize); + if (hr == S_OK){ + return (unsigned long)newsize; + } + else { + return (uLong)0; + } + } + + long ZCALLBACK cb_sseek (voidpf /*opaque*/, voidpf stream, uLong offset, int origin) { + // IStream::Seek parameters + HRESULT hr; + LARGE_INTEGER Move; + DWORD dwOrigin; + Move.QuadPart = (__int64)offset; + + switch (origin) { + case SEEK_CUR: + dwOrigin = STREAM_SEEK_CUR; + break; + case SEEK_END: + dwOrigin = STREAM_SEEK_END; + break; + case SEEK_SET: + dwOrigin = STREAM_SEEK_SET; + break; + default: + return -1; + } + + hr = ((IStream*)stream)->Seek (Move, dwOrigin, NULL); + if (hr == S_OK){ + return 0; + } + else { + return -1; + } + } + + long ZCALLBACK cb_stell (voidpf /*opaque*/, voidpf stream) { + // IStream::Seek parameters + HRESULT hr; + LARGE_INTEGER Move; + ULARGE_INTEGER NewPosition; + Move.QuadPart = 0; + NewPosition.QuadPart = 0; + + hr = ((IStream*)stream)->Seek (Move, STREAM_SEEK_CUR, &NewPosition); + if (hr == S_OK){ + return (long) NewPosition.QuadPart; + } + else { + return -1; + } + } + + int ZCALLBACK cb_sclose (voidpf /*opaque*/, voidpf /*stream*/) { + return 0; + } + + int ZCALLBACK cb_serror (voidpf /*opaque*/, voidpf /*stream*/) { + return 0; //RJK - for now + } + + uLong ZCALLBACK cb_swrite (voidpf /*opaque*/, voidpf stream, const void* buf, uLong size) { + HRESULT hr; + unsigned long writecount; + hr = ((IStream*)stream)->Write (buf, size, &writecount); + if (hr == S_OK) + return (unsigned int)writecount; + else + return (uLong)0; + } + + void fill_stream_filefunc (zlib_filefunc_def* pzlib_filefunc_def) { + pzlib_filefunc_def->zopen_file = cb_sopen; + pzlib_filefunc_def->zread_file = cb_sread; + pzlib_filefunc_def->zwrite_file = cb_swrite; + pzlib_filefunc_def->ztell_file = cb_stell; + pzlib_filefunc_def->zseek_file = cb_sseek; + pzlib_filefunc_def->zclose_file = cb_sclose; + pzlib_filefunc_def->zerror_file = cb_serror; + } +} diff --git a/shell/source/win32/shlxthandler/ooofilt/proxy/exports.dxp b/shell/source/win32/shlxthandler/ooofilt/proxy/exports.dxp deleted file mode 100644 index 953039ccc957..000000000000 --- a/shell/source/win32/shlxthandler/ooofilt/proxy/exports.dxp +++ /dev/null @@ -1,4 +0,0 @@ -DllRegisterServer PRIVATE -DllUnregisterServer PRIVATE -DllGetClassObject PRIVATE -DllCanUnloadNow PRIVATE \ No newline at end of file diff --git a/shell/source/win32/shlxthandler/ooofilt/proxy/makefile.mk b/shell/source/win32/shlxthandler/ooofilt/proxy/makefile.mk deleted file mode 100644 index 54dc3d59a734..000000000000 --- a/shell/source/win32/shlxthandler/ooofilt/proxy/makefile.mk +++ /dev/null @@ -1,92 +0,0 @@ -#************************************************************************* -# -# 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: makefile.mk,v $ -# -# $Revision: 1.7 $ -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/..$/..$/..$/.. -PRJNAME=shell -TARGET=ooofiltproxy -LIBTARGET=NO -ENABLE_EXCEPTIONS=TRUE -USE_DEFFILE=TRUE -DYNAMIC_CRT= -UWINAPILIB= - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -CFLAGS+=-DWIN32_LEAN_AND_MEAN -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 -CDEFS+=-D_WIN32_IE=0x501 - -# --- Files -------------------------------------------------------- - -SLOFILES=$(SLO)$/ooofiltproxy.obj -SHL1TARGET=$(TARGET) -SHL1STDLIBS=$(OLE32LIB)\ - $(ADVAPO32LIB)\ - $(COMCTL32LIB)\ - $(UUIDLIB)\ - $(SHELL32LIB)\ - $(KERNEL32LIB) - -SHL1DEPN= -SHL1OBJS=$(SLOFILES) -SHL1DEF=$(MISC)$/$(SHL1TARGET).def -DEF1NAME=$(SHL1TARGET) -DEF1EXPORTFILE=exports.dxp - -.IF "$(BUILD_X64)"!="" -#------------- x64 stuff ---------------- -USE_DEFFILE_X64=TRUE -CFLAGS_X64+=-DWIN32_LEAN_AND_MEAN -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 -CDEFS_X64+=-D_WIN32_IE=0x501 - -SLOFILES_X64=$(SLO_X64)$/ooofiltproxy.obj -SHL1TARGET_X64=$(TARGET) -SHL1STDLIBS_X64=$(OLE32LIB_X64)\ - $(ADVAPO32LIB_X64)\ - $(COMCTL32LIB_X64)\ - $(UUIDLIB_X64)\ - $(SHELL32LIB_X64)\ - $(KERNEL32LIB_X64)\ - $(MSVCRT_X64) - -SHL1DEPN_X64= -SHL1OBJS_X64=$(SLO_X64)$/ooofiltproxy.obj -SHL1DEF_X64=$(MISC_X64)$/$(TARGET).def -DEF1NAME_X64=$(TARGET) -DEF1EXPORTFILE_X64=exports.dxp -.ENDIF # "$(BUILD_X64)"!="" - -# --- Targets ------------------------------------------------------ - -.INCLUDE : set_wntx64.mk -.INCLUDE : target.mk -.INCLUDE : tg_wntx64.mk diff --git a/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx b/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx deleted file mode 100644 index 879cf8c0115b..000000000000 --- a/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx +++ /dev/null @@ -1,164 +0,0 @@ -/************************************************************************* - * - * 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: ooofiltproxy.cxx,v $ - * $Revision: 1.8 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" - -#if defined _MSC_VER -#pragma warning(push, 1) -#endif -#include -#if defined _MSC_VER -#pragma warning(pop) -#endif -#include -#ifdef __MINGW32__ -#include -#endif - - -/* - The indexing filter library ooofilt.dll is linked against a couple - of libaries (e.g. stlport, uwinapi, ...) which are not standard on - a windows system. Unfortunately the library will be loaded by the - indexing service via LoadLibrary so that the libraries ooofilt.dll - depends on need to be in one of the standard search directories or - the directory need to be added to the PATH - environment variable. In order to prevent failures while loading - the ooofilt.dll we're installing and registering this proxy library - which will load ooofilt.dll using LoadLibraryEx with the flag - LOAD_WITH_ALTERED_SEARCH_PATH (see MSDN for details). This approach - ensures that all libraries ooofilt.dll depends on will be found. -*/ - -typedef HRESULT (__stdcall * Forward_DllGetClassObject_t)(REFCLSID cid, REFIID iid, void** ppvObj); -typedef HRESULT (__stdcall * Forward_DllCanUnloadNow_t)(); -typedef HRESULT (__stdcall * Forward_DllRegisterServer_t)(); -typedef HRESULT (__stdcall * Forward_DllUnregisterServer_t)(); - -Forward_DllGetClassObject_t Forward_DllGetClassObject = NULL; -Forward_DllCanUnloadNow_t Forward_DllCanUnloadNow = NULL; -Forward_DllRegisterServer_t Forward_DllRegisterServer = NULL; -Forward_DllUnregisterServer_t Forward_DllUnregisterServer = NULL; - -HMODULE hOoofilt = NULL; -HMODULE hThisLibrary = NULL; - -/* Truncates the file name from an absolute path but - leaves the final '\' */ -void PathTruncateFileName(TCHAR* path) -{ - TCHAR* p = path + lstrlen(path); - while (*p != _T('\\')) p--; - p++; - *p = 0; -} - -void Init() -{ - if (Forward_DllGetClassObject == NULL) - { - TCHAR buff[MAX_PATH]; - GetModuleFileName(hThisLibrary, buff, (sizeof(buff)/sizeof(TCHAR))); - PathTruncateFileName(buff); - lstrcat(buff, TEXT("ooofilt.dll")); - - hOoofilt = LoadLibraryEx(buff, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); - - if (hOoofilt) - { - Forward_DllGetClassObject = reinterpret_cast( - GetProcAddress(hOoofilt, "DllGetClassObject")); - Forward_DllCanUnloadNow = reinterpret_cast( - GetProcAddress(hOoofilt, "DllCanUnloadNow")); - Forward_DllRegisterServer = reinterpret_cast( - GetProcAddress(hOoofilt, "DllRegisterServer")); - Forward_DllUnregisterServer = reinterpret_cast( - GetProcAddress(hOoofilt, "DllUnregisterServer")); - } - } -} - -extern "C" BOOL WINAPI DllMain(HMODULE hInstance, DWORD fdwReason, LPVOID /*lpvReserved*/) -{ - switch (fdwReason) - { - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls( hInstance ); - hThisLibrary = hInstance; - break; - case DLL_PROCESS_DETACH: - if (hOoofilt) - FreeLibrary(hOoofilt); - break; - default: - break; - } - return TRUE; -} - -extern "C" HRESULT __stdcall DllGetClassObject(REFCLSID cid, REFIID iid, void** ppvObj) -{ - Init(); - - if (Forward_DllGetClassObject) - return Forward_DllGetClassObject(cid, iid, ppvObj); - else - return E_FAIL; -} - -extern "C" HRESULT __stdcall DllCanUnloadNow() -{ - Init(); - - if (Forward_DllCanUnloadNow) - return Forward_DllCanUnloadNow(); - else - return E_FAIL; -} - -extern "C" HRESULT __stdcall DllRegisterServer() -{ - Init(); - if (Forward_DllRegisterServer) - return Forward_DllRegisterServer(); - else - return E_FAIL; -} - -extern "C" HRESULT __stdcall DllUnregisterServer() -{ - Init(); - - if (Forward_DllUnregisterServer) - return Forward_DllUnregisterServer(); - else - return E_FAIL; -} diff --git a/shell/source/win32/shlxthandler/propsheets/makefile.mk b/shell/source/win32/shlxthandler/propsheets/makefile.mk index ac12795cf37f..22df3b376c00 100644 --- a/shell/source/win32/shlxthandler/propsheets/makefile.mk +++ b/shell/source/win32/shlxthandler/propsheets/makefile.mk @@ -63,4 +63,6 @@ SLOFILES_X64=$(SLO_X64)$/propsheets.obj\ .INCLUDE : set_wntx64.mk .INCLUDE : target.mk +INCLUDE!:=$(subst,/stl, $(INCLUDE)) +.EXPORT : INCLUDE .INCLUDE : tg_wntx64.mk \ No newline at end of file diff --git a/shell/source/win32/shlxthandler/thumbviewer/makefile.mk b/shell/source/win32/shlxthandler/thumbviewer/makefile.mk index a7b0b40032dd..808a529df329 100644 --- a/shell/source/win32/shlxthandler/thumbviewer/makefile.mk +++ b/shell/source/win32/shlxthandler/thumbviewer/makefile.mk @@ -60,5 +60,7 @@ SLOFILES_X64=$(SLO_X64)$/$(TARGET).obj .INCLUDE : set_wntx64.mk .INCLUDE : target.mk +INCLUDE!:=$(subst,/stl, $(INCLUDE)) +.EXPORT : INCLUDE .INCLUDE : tg_wntx64.mk diff --git a/shell/source/win32/shlxthandler/util/iso8601_converter.cxx b/shell/source/win32/shlxthandler/util/iso8601_converter.cxx index ff7fe963413f..e104f810e813 100644 --- a/shell/source/win32/shlxthandler/util/iso8601_converter.cxx +++ b/shell/source/win32/shlxthandler/util/iso8601_converter.cxx @@ -149,7 +149,7 @@ std::wstring iso8601_duration_to_local_duration(const std::wstring& iso8601durat hours = buff; } -#if defined(_MSC_VER) && defined(_M_X64) +#if defined(_MSC_VER) //&& defined(_M_X64) std::wostringstream oss; oss << std::setw(2) << std::setfill(wchar_t('0')) << hours << L":" << std::setw(2) << std::setfill(wchar_t('0')) << minutes << L":" << @@ -172,12 +172,14 @@ std::wstring iso8601_duration_to_local_duration(const std::wstring& iso8601durat return result; #undef ADD_AS_PREFILLED +/* #else std::wostringstream oss; oss << std::setw(2) << std::setfill('0') << hours << L":" << std::setw(2) << std::setfill('0') << minutes << L":" << std::setw(2) << std::setfill('0') << seconds; return oss.str(); +*/ #endif } diff --git a/shell/source/win32/shlxthandler/util/makefile.mk b/shell/source/win32/shlxthandler/util/makefile.mk index c0bec9c36d3b..75afe53b614d 100644 --- a/shell/source/win32/shlxthandler/util/makefile.mk +++ b/shell/source/win32/shlxthandler/util/makefile.mk @@ -66,5 +66,7 @@ SLOFILES_X64=$(SLO_X64)$/dbgmacros.obj\ .INCLUDE : set_wntx64.mk .INCLUDE : target.mk +INCLUDE!:=$(subst,/stl, $(INCLUDE)) +.EXPORT : INCLUDE .INCLUDE : tg_wntx64.mk -- cgit From c5ac08c9fdc71eaa55964c97b7dc2fe0b135b686 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Wed, 3 Feb 2010 16:23:21 +0100 Subject: ause113: #i108416# update windows version defines --- shell/source/win32/shlxthandler/propsheets/makefile.mk | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'shell') diff --git a/shell/source/win32/shlxthandler/propsheets/makefile.mk b/shell/source/win32/shlxthandler/propsheets/makefile.mk index ac12795cf37f..ce1300596687 100644 --- a/shell/source/win32/shlxthandler/propsheets/makefile.mk +++ b/shell/source/win32/shlxthandler/propsheets/makefile.mk @@ -39,13 +39,14 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk -CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 +CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE +CDEFS+=-U_WIN32_WINNT -D_WIN32_WINNT=0x0501 -U_WIN32_IE -D_WIN32_IE=0x501 +.IF "$(COM)"!="GCC" CFLAGS+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820 -CDEFS+=-D_WIN32_IE=0x501 - -CFLAGS_X64+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 +CFLAGS_X64+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE CFLAGS_X64+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820 -CDEFS_X64+=-D_WIN32_IE=0x501 +CDEFS_X64+=-D_WIN32_WINNT=0x0501 -D_WIN32_IE=0x501 +.ENDIF # --- Files -------------------------------------------------------- -- cgit From 85e0cc246d4350122b17fbe2bfd15635a190ad77 Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Wed, 20 Jan 2010 11:33:12 +0100 Subject: dv17: #i70994#: Use property handler instead of column info for Windows Vista --- shell/inc/internal/metainforeader.hxx | 2 +- shell/inc/internal/propertyhdl.hxx | 90 ++++++ shell/inc/internal/shlxthdl.hxx | 4 + shell/inc/internal/stream_helper.hxx | 35 +++ shell/inc/internal/utilities.hxx | 0 shell/prj/build.lst | 7 +- shell/source/win32/shlxthandler/classfactory.cxx | 4 + shell/source/win32/shlxthandler/makefile.mk | 8 +- .../source/win32/shlxthandler/ooofilt/makefile.mk | 3 +- .../source/win32/shlxthandler/ooofilt/ooofilt.cxx | 294 ++++++----------- .../source/win32/shlxthandler/ooofilt/ooofilt.hxx | 47 +-- .../win32/shlxthandler/ooofilt/stream_helper.cxx | 181 +++++++++++ .../source/win32/shlxthandler/prophdl/makefile.mk | 61 ++++ .../win32/shlxthandler/prophdl/propertyhdl.cxx | 350 +++++++++++++++++++++ .../win32/shlxthandler/propsheets/propsheets.cxx | 71 +++-- shell/source/win32/shlxthandler/shlxthdl.cxx | 3 +- 16 files changed, 895 insertions(+), 265 deletions(-) mode change 100644 => 100755 shell/inc/internal/metainforeader.hxx create mode 100755 shell/inc/internal/propertyhdl.hxx mode change 100644 => 100755 shell/inc/internal/shlxthdl.hxx create mode 100755 shell/inc/internal/stream_helper.hxx mode change 100644 => 100755 shell/inc/internal/utilities.hxx mode change 100644 => 100755 shell/prj/build.lst mode change 100644 => 100755 shell/source/win32/shlxthandler/classfactory.cxx mode change 100644 => 100755 shell/source/win32/shlxthandler/makefile.mk mode change 100644 => 100755 shell/source/win32/shlxthandler/ooofilt/makefile.mk mode change 100644 => 100755 shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx mode change 100644 => 100755 shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx create mode 100755 shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx create mode 100755 shell/source/win32/shlxthandler/prophdl/makefile.mk create mode 100755 shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx mode change 100644 => 100755 shell/source/win32/shlxthandler/propsheets/propsheets.cxx mode change 100644 => 100755 shell/source/win32/shlxthandler/shlxthdl.cxx (limited to 'shell') diff --git a/shell/inc/internal/metainforeader.hxx b/shell/inc/internal/metainforeader.hxx old mode 100644 new mode 100755 index 1e004b5a3727..478365811da3 --- a/shell/inc/internal/metainforeader.hxx +++ b/shell/inc/internal/metainforeader.hxx @@ -46,7 +46,7 @@ public: CMetaInfoReader( const std::string& DocumentName ); - CMetaInfoReader( void* stream, zlib_filefunc_def* fa); + CMetaInfoReader( void* stream, zlib_filefunc_def* fa); /** check if the Tag is in the target meta.xml file. diff --git a/shell/inc/internal/propertyhdl.hxx b/shell/inc/internal/propertyhdl.hxx new file mode 100755 index 000000000000..60ff10bc6958 --- /dev/null +++ b/shell/inc/internal/propertyhdl.hxx @@ -0,0 +1,90 @@ +/************************************************************************* + * + * 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: PropertyHdl.hxx,v $ + * $Revision: 1.5 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef PROPERTYHDL_HXX_INCLUDED +#define PROPERTYHDL_HXX_INCLUDED + +#if defined _MSC_VER +#pragma warning(push, 1) +#pragma warning(disable:4917) +#endif +#include +#if defined _MSC_VER +#pragma warning(pop) +#endif + +class CMetaInfoReader; + +class CPropertyHdl : public IPropertyStore, + public IPropertyStoreCapabilities, + public IInitializeWithStream +{ +public: + CPropertyHdl(long RefCnt = 1); + virtual ~CPropertyHdl(); + + //----------------------------- + // IUnknown methods + //----------------------------- + virtual HRESULT STDMETHODCALLTYPE QueryInterface( + REFIID riid, + void __RPC_FAR *__RPC_FAR *ppvObject ); + virtual ULONG STDMETHODCALLTYPE AddRef( void ); + virtual ULONG STDMETHODCALLTYPE Release( void ); + + //----------------------------- + // IPropertyStore + //----------------------------- + virtual HRESULT STDMETHODCALLTYPE GetCount( DWORD *pcProps ); + virtual HRESULT STDMETHODCALLTYPE GetAt( DWORD iProp, PROPERTYKEY *pkey ); + virtual HRESULT STDMETHODCALLTYPE GetValue( REFPROPERTYKEY key, PROPVARIANT *pPropVar ); + virtual HRESULT STDMETHODCALLTYPE SetValue( REFPROPERTYKEY key, REFPROPVARIANT propVar ); + virtual HRESULT STDMETHODCALLTYPE Commit(); + + //----------------------------- + // IPropertyStoreCapabilities + //----------------------------- + virtual HRESULT STDMETHODCALLTYPE IsPropertyWritable( REFPROPERTYKEY key ); + + //----------------------------- + // IInitializeWithStream + //----------------------------- + virtual HRESULT STDMETHODCALLTYPE Initialize(IStream *pStream, DWORD grfMode); + +private: + void LoadProperties( CMetaInfoReader *pMetaInfoReader ); + HRESULT GetItemData( CMetaInfoReader *pMetaInfoReader, UINT nIndex, PROPVARIANT *pVarData ); + +private: + long m_RefCnt; + IPropertyStoreCache* m_pCache; +}; + +#endif diff --git a/shell/inc/internal/shlxthdl.hxx b/shell/inc/internal/shlxthdl.hxx old mode 100644 new mode 100755 index 782212f6dc5b..70830c9775ec --- a/shell/inc/internal/shlxthdl.hxx +++ b/shell/inc/internal/shlxthdl.hxx @@ -55,4 +55,8 @@ const CLSID CLSID_PROPERTYSHEET_HANDLER = const CLSID CLSID_THUMBVIEWER_HANDLER = { 0x3b092f0c, 0x7696, 0x40e3, { 0xa8, 0xf, 0x68, 0xd7, 0x4d, 0xa8, 0x42, 0x10 } }; +// {AE424E85-F6DF-4910-A6A9-438797986431} +const CLSID CLSID_PROPERTY_HANDLER = +{ 0xae424e85, 0xf6df, 0x4910, { 0xa6, 0xa9, 0x43, 0x87, 0x97, 0x98, 0x64, 0x31 } }; + #endif diff --git a/shell/inc/internal/stream_helper.hxx b/shell/inc/internal/stream_helper.hxx new file mode 100755 index 000000000000..2ef4529b54ce --- /dev/null +++ b/shell/inc/internal/stream_helper.hxx @@ -0,0 +1,35 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 by Sun Microsystems, Inc. + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef STREAM_HELPER_HXX_INCLUDED +#define STREAM_HELPER_HXX_INCLUDED + +#include "internal/types.hxx" + +IStream* PrepareIStream( IStream* pStream, zlib_filefunc_def &zFileFunc ); + +#endif diff --git a/shell/inc/internal/utilities.hxx b/shell/inc/internal/utilities.hxx old mode 100644 new mode 100755 diff --git a/shell/prj/build.lst b/shell/prj/build.lst old mode 100644 new mode 100755 index ed4fbca7e3f5..5499014e2a41 --- a/shell/prj/build.lst +++ b/shell/prj/build.lst @@ -16,13 +16,16 @@ sl shell\source\all\zipfile nmake - w sl_all_zipfil sl shell\source\all\zipfile nmake - p sl_all_zipfile sl_inc NULL sl shell\source\all\ooofilereader nmake - w sl_all_ooofilereader sl_all_zipfile.w sl_all sl_inc NULL sl shell\source\all\ooofilereader nmake - p sl_all_ooofilereader sl_all_zipfile.w sl_all sl_inc NULL +sl shell\source\win32\shlxthandler\ooofilt\proxy nmake - w sl_win32_ooofiltproxy sl_inc NULL sl shell\source\win32\shlxthandler\res nmake - w sl_win32_shlxthandler_res sl_win32_lngconv.w sl_inc NULL sl shell\source\win32\shlxthandler\util nmake - w sl_win32_shlxthandler_util sl_inc NULL sl shell\source\win32\shlxthandler\propsheets nmake - w sl_win32_shlxthandler_propsheets sl_inc NULL sl shell\source\win32\shlxthandler\infotips nmake - w sl_win32_shlxthandler_infotips sl_inc NULL sl shell\source\win32\shlxthandler\columninfo nmake - w sl_win32_shlxthandler_columninfo sl_inc NULL sl shell\source\win32\shlxthandler\thumbviewer nmake - w sl_win32_shlxthandler_thumbviewer sl_inc NULL -sl shell\source\win32\shlxthandler nmake - w sl_win32_shlxthandler sl_win32_lngconv.w sl_win32_shlxthandler_res.w sl_win32_shlxthandler_util.w sl_all_zipfile.w sl_all_ooofilereader.w sl_win32_shlxthandler_propsheets.w sl_win32_shlxthandler_infotips.w sl_win32_shlxthandler_columninfo.w sl_win32_shlxthandler_thumbviewer.w sl_inc NULL +sl shell\source\win32\shlxthandler\prophdl nmake - w sl_win32_shlxthandler_prophdl sl_inc NULL +sl shell\source\win32\shlxthandler\ooofilt nmake - w sl_win32_shlxthandler_ooofilt sl_all_zipfile.w sl_all_ooofilereader.w sl_win32_shlxthandler_util.w sl_all sl_inc NULL +sl shell\source\win32\shlxthandler nmake - w sl_win32_shlxthandler sl_win32_lngconv.w sl_win32_shlxthandler_res.w sl_win32_shlxthandler_util.w sl_all_zipfile.w sl_all_ooofilereader.w sl_win32_shlxthandler_propsheets.w sl_win32_shlxthandler_infotips.w sl_win32_shlxthandler_columninfo.w sl_win32_shlxthandler_thumbviewer.w sl_win32_shlxthandler_prophdl.w sl_inc sl_win32_shlxthandler_ooofilt.w NULL sl shell\source\backends\localebe nmake - all sl_backends_localebe sl_inc NULL sl shell\source\backends\wininetbe nmake - w sl_backends_wininetbe sl_inc NULL sl shell\source\backends\macbe nmake - u sl_backends_macbe sl_inc NULL @@ -30,5 +33,3 @@ sl shell\source\backends\gconfbe nmake - u sl_backends_g sl shell\source\backends\kdebe nmake - u sl_backends_kdebe sl_inc NULL sl shell\source\backends\kde4be nmake - u sl_backends_kde4be sl_inc NULL sl shell\source\backends\desktopbe nmake - u sl_backends_desktopbe sl_inc NULL -sl shell\source\win32\shlxthandler\ooofilt nmake - w sl_win32_shlxthandler_ooofilt sl_all_zipfile.w sl_all_ooofilereader.w sl_win32_shlxthandler_util.w sl_all sl_inc NULL -sl shell\source\win32\shlxthandler\ooofilt\proxy nmake - w sl_win32_ooofiltproxy sl_inc NULL diff --git a/shell/source/win32/shlxthandler/classfactory.cxx b/shell/source/win32/shlxthandler/classfactory.cxx old mode 100644 new mode 100755 index ee60cb4f62b7..10dd3e82934d --- a/shell/source/win32/shlxthandler/classfactory.cxx +++ b/shell/source/win32/shlxthandler/classfactory.cxx @@ -35,6 +35,7 @@ #include "internal/infotips.hxx" #include "internal/propsheets.hxx" #include "internal/columninfo.hxx" +#include "internal/propertyhdl.hxx" #ifdef __MINGW32__ #include using ::std::max; @@ -137,6 +138,9 @@ HRESULT STDMETHODCALLTYPE CClassFactory::CreateInstance( else if (CLSID_THUMBVIEWER_HANDLER == m_Clsid) pUnk = static_cast(new CThumbviewer()); + else if (CLSID_PROPERTY_HANDLER == m_Clsid) + pUnk = static_cast(new CPropertyHdl()); + POST_CONDITION(pUnk != 0, "Could not create COM object"); if (0 == pUnk) diff --git a/shell/source/win32/shlxthandler/makefile.mk b/shell/source/win32/shlxthandler/makefile.mk old mode 100644 new mode 100755 index 07eea87f0263..07a7539e9e11 --- a/shell/source/win32/shlxthandler/makefile.mk +++ b/shell/source/win32/shlxthandler/makefile.mk @@ -58,7 +58,9 @@ SLOFILES=$(SLO)$/classfactory.obj\ $(SLO)$/shlxthdl.obj\ $(SLO)$/listviewbuilder.obj\ $(SLO)$/document_statistic.obj\ - $(SLO)$/thumbviewer.obj + $(SLO)$/thumbviewer.obj\ + $(SLO)$/propertyhdl.obj\ + $(SLO)$/stream_helper.obj\ SHL1TARGET=$(TARGET) @@ -79,7 +81,9 @@ SHL1STDLIBS+=\ $(SHELL32LIB)\ $(KERNEL32LIB)\ $(GDI32LIB)\ - $(GDIPLUSLIB) + $(GDIPLUSLIB)\ + $(SHLWAPILIB)\ + propsys.lib SHL1LIBS+=$(SLB)$/util.lib\ $(SLB)$/ooofilereader.lib diff --git a/shell/source/win32/shlxthandler/ooofilt/makefile.mk b/shell/source/win32/shlxthandler/ooofilt/makefile.mk old mode 100644 new mode 100755 index 22127bc8ddac..221ec6ee99c5 --- a/shell/source/win32/shlxthandler/ooofilt/makefile.mk +++ b/shell/source/win32/shlxthandler/ooofilt/makefile.mk @@ -55,7 +55,8 @@ CDEFS+=-D_WIN32_IE=0x501 # --- Files -------------------------------------------------------- SLOFILES=$(SLO)$/ooofilt.obj\ - $(SLO)$/propspec.obj + $(SLO)$/propspec.obj\ + $(SLO)$/stream_helper.obj # $(SLO)$/utilities.obj # $(SLO)$/dbgmacros.obj diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx old mode 100644 new mode 100755 index ac8dd676c3b1..e7460e899e82 --- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx +++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx @@ -78,14 +78,15 @@ #include #include "assert.h" #include "ooofilt.hxx" -#include -#include +#include +#include #include "propspec.hxx" #ifdef __MINGW32__ #include using ::std::min; #endif +#include "internal/stream_helper.hxx" //C------------------------------------------------------------------------- // @@ -120,7 +121,7 @@ COooFilter::COooFilter() : m_ChunkPosition(0), m_cAttributes(0), m_pAttributes(0), - m_pStream(NULL) + m_pStream(NULL) { InterlockedIncrement( &g_lInstances ); @@ -176,8 +177,8 @@ SCODE STDMETHODCALLTYPE COooFilter::QueryInterface( pUnkTemp = (IUnknown *)(IPersistFile *)this; else if ( IID_IPersist == riid ) pUnkTemp = (IUnknown *)(IPersist *)(IPersistFile *)this; - else if (IID_IPersistStream == riid) - pUnkTemp = (IUnknown *)(IPersistStream *)this; + else if (IID_IPersistStream == riid) + pUnkTemp = (IUnknown *)(IPersistStream *)this; else if ( IID_IUnknown == riid ) pUnkTemp = (IUnknown *)(IPersist *)(IPersistFile *)this; else @@ -720,99 +721,85 @@ SCODE STDMETHODCALLTYPE COooFilter::SaveCompleted(LPCWSTR /*pszFileName*/) return S_OK; } -//M------------------------------------------------------------------------- -// -// Method: COooFilter::Load (IPersistStream::Load) -// -// Summary: Initializes an object from the stream where it was previously saved -// -// Arguments: pStm -// [in] Pointer to stream from which object should be loaded -// -// -// Returns: S_OK -// E_OUTOFMEMORY -// E_FAIL -// -// -//-------------------------------------------------------------------------- -SCODE STDMETHODCALLTYPE COooFilter::Load(IStream *pStm) -{ - - // These next few lines work around the "Seek pointer" bug found on Vista. - - char buf[20]; - unsigned long count; - HRESULT hr; - ULARGE_INTEGER NewPosition; - LARGE_INTEGER Move; - Move.QuadPart = 0; - hr = pStm->Seek (Move, STREAM_SEEK_SET, &NewPosition); - hr = pStm->Read (buf, 20, &count); - - zlib_filefunc_def z_filefunc; - fill_stream_filefunc (&z_filefunc); - z_filefunc.opaque = (void*)pStm; - - m_pStream = pStm; - - try - { - if (m_pMetaInfoReader) - delete m_pMetaInfoReader; - m_pMetaInfoReader = new CMetaInfoReader((void*)m_pStream, &z_filefunc); - - if (m_pContentReader) - delete m_pContentReader; - m_pContentReader = new CContentReader((void*)m_pStream, m_pMetaInfoReader->getDefaultLocale(), &z_filefunc); - } - catch (const std::exception&) - { - return E_FAIL; - } - return S_OK; -} - -//M------------------------------------------------------------------------- -// -// Method: COooFilter::GetSizeMax (IPersistStream::GetSizeMax) -// -// Summary: Returns the size in bytes of the stream neede to save the object. -// -// Arguments: pcbSize -// [out] Pointer to a 64 bit unsigned int indicating the size needed -// -// Returns: E_NOTIMPL -// -// -//-------------------------------------------------------------------------- -SCODE STDMETHODCALLTYPE COooFilter::GetSizeMax(ULARGE_INTEGER * /*pcbSize*/) -{ - // - return E_NOTIMPL; -} - -//M------------------------------------------------------------------------- -// -// Method: COooFilter::Save (IPersistStream::Save) -// -// Summary: Save object to specified stream -// -// Arguments: pStm -// [in] Pointer to stream -// -// fClearDirty -// [in] Indicates whether to clear dirty flag -// -// Returns: E_NOTIMPL -// -// -//-------------------------------------------------------------------------- -SCODE STDMETHODCALLTYPE COooFilter::Save(IStream * /*pStm*/, BOOL ) -{ - // - return E_NOTIMPL; -} +//M------------------------------------------------------------------------- +// +// Method: COooFilter::Load (IPersistStream::Load) +// +// Summary: Initializes an object from the stream where it was previously saved +// +// Arguments: pStm +// [in] Pointer to stream from which object should be loaded +// +// +// Returns: S_OK +// E_OUTOFMEMORY +// E_FAIL +// +// +//-------------------------------------------------------------------------- +SCODE STDMETHODCALLTYPE COooFilter::Load(IStream *pStm) +{ + zlib_filefunc_def z_filefunc; + + m_pStream = PrepareIStream( pStm, z_filefunc ); + + try + { + if (m_pMetaInfoReader) + delete m_pMetaInfoReader; + m_pMetaInfoReader = new CMetaInfoReader((void*)m_pStream, &z_filefunc); + + if (m_pContentReader) + delete m_pContentReader; + m_pContentReader = new CContentReader((void*)m_pStream, m_pMetaInfoReader->getDefaultLocale(), &z_filefunc); + } + catch (const std::exception&) + { + return E_FAIL; + } + return S_OK; +} + +//M------------------------------------------------------------------------- +// +// Method: COooFilter::GetSizeMax (IPersistStream::GetSizeMax) +// +// Summary: Returns the size in bytes of the stream neede to save the object. +// +// Arguments: pcbSize +// [out] Pointer to a 64 bit unsigned int indicating the size needed +// +// Returns: E_NOTIMPL +// +// +//-------------------------------------------------------------------------- +SCODE STDMETHODCALLTYPE COooFilter::GetSizeMax(ULARGE_INTEGER * /*pcbSize*/) +{ + // + return E_NOTIMPL; +} + +//M------------------------------------------------------------------------- +// +// Method: COooFilter::Save (IPersistStream::Save) +// +// Summary: Save object to specified stream +// +// Arguments: pStm +// [in] Pointer to stream +// +// fClearDirty +// [in] Indicates whether to clear dirty flag +// +// Returns: E_NOTIMPL +// +// +//-------------------------------------------------------------------------- +SCODE STDMETHODCALLTYPE COooFilter::Save(IStream * /*pStm*/, BOOL ) +{ + // + return E_NOTIMPL; +} //M------------------------------------------------------------------------- // @@ -1247,13 +1234,13 @@ namespace /* private */ if (!SetRegistryKey(HKEY_CLASSES_ROOT, ClsidEntry_Persist.c_str(), "", "OpenOffice.org Persistent Handler")) return E_FAIL; - // Add missing entry - std::string ClsidEntry_Persist_Entry = CLSID_PERSIST_ENTRY; - SubstitutePlaceholder(ClsidEntry_Persist_Entry, - GUID_PLACEHOLDER, - ClsidToString(PersistentGuid)); - - if (!SetRegistryKey(HKEY_CLASSES_ROOT, ClsidEntry_Persist_Entry.c_str(), "", ClsidToString(PersistentGuid).c_str())); + // Add missing entry + std::string ClsidEntry_Persist_Entry = CLSID_PERSIST_ENTRY; + SubstitutePlaceholder(ClsidEntry_Persist_Entry, + GUID_PLACEHOLDER, + ClsidToString(PersistentGuid)); + + if (!SetRegistryKey(HKEY_CLASSES_ROOT, ClsidEntry_Persist_Entry.c_str(), "", ClsidToString(PersistentGuid).c_str())); std::string ClsidEntry_Persist_Addin = CLSID_GUID_PERSIST_ADDIN_ENTRY; @@ -1504,100 +1491,3 @@ STDAPI DllUnregisterServer() */ return S_OK; } - -extern "C" { - - // IStream callback - voidpf ZCALLBACK cb_sopen (voidpf opaque, const char* filename, int mode) { - return opaque; - } - - uLong ZCALLBACK cb_sread (voidpf opaque, voidpf stream, void* buf, uLong size) { - unsigned long newsize; - HRESULT hr; - - hr = ((IStream *)stream)->Read (buf, size, &newsize); - if (hr == S_OK){ - return (unsigned long)newsize; - } - else { - return (uLong)0; - } - } - - long ZCALLBACK cb_sseek (voidpf opaque, voidpf stream, uLong offset, int origin) { - // IStream::Seek parameters - HRESULT hr; - LARGE_INTEGER Move; - DWORD dwOrigin; - Move.QuadPart = (__int64)offset; - - switch (origin) { - case SEEK_CUR: - dwOrigin = STREAM_SEEK_CUR; - break; - case SEEK_END: - dwOrigin = STREAM_SEEK_END; - break; - case SEEK_SET: - dwOrigin = STREAM_SEEK_SET; - break; - default: - return -1; - } - - hr = ((IStream*)stream)->Seek (Move, dwOrigin, NULL); - if (hr == S_OK){ - return 0; - } - else { - return -1; - } - } - - long ZCALLBACK cb_stell (voidpf opaque, voidpf stream) { - // IStream::Seek parameters - HRESULT hr; - LARGE_INTEGER Move; - ULARGE_INTEGER NewPosition; - Move.QuadPart = 0; - NewPosition.QuadPart = 0; - - hr = ((IStream*)stream)->Seek (Move, STREAM_SEEK_CUR, &NewPosition); - if (hr == S_OK){ - return (long) NewPosition.QuadPart; - } - else { - return -1; - } - } - - int ZCALLBACK cb_sclose (voidpf opaque, voidpf stream) { - return 0; - } - - int ZCALLBACK cb_serror (voidpf opaque, voidpf stream) { - return 0; //RJK - for now - } - - uLong ZCALLBACK cb_swrite (voidpf opaque, voidpf stream, const void* buf, uLong size) { - HRESULT hr; - unsigned long writecount; - hr = ((IStream*)stream)->Write (buf, size, &writecount); - if (hr == S_OK) - return (unsigned int)writecount; - else - return (uLong)0; - } - - void fill_stream_filefunc (zlib_filefunc_def* pzlib_filefunc_def) { - pzlib_filefunc_def->zopen_file = cb_sopen; - pzlib_filefunc_def->zread_file = cb_sread; - pzlib_filefunc_def->zwrite_file = cb_swrite; - pzlib_filefunc_def->ztell_file = cb_stell; - pzlib_filefunc_def->zseek_file = cb_sseek; - pzlib_filefunc_def->zclose_file = cb_sclose; - pzlib_filefunc_def->zerror_file = cb_serror; - } -} - diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx old mode 100644 new mode 100755 index 9f1566b406bd..a3bf364ccaf1 --- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx +++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx @@ -96,7 +96,7 @@ enum FilterState FilteringContent, // Filtering the content property FilteringProperty // Filtering the pseudo property }; -class COooFilter : public IFilter, public IPersistFile, public IPersistStream +class COooFilter : public IFilter, public IPersistFile, public IPersistStream { public: // From IUnknown @@ -143,16 +143,16 @@ public: virtual SCODE STDMETHODCALLTYPE GetCurFile( LPWSTR * ppszFileName); - // From IPersistStream - virtual SCODE STDMETHODCALLTYPE Load( - IStream *pStm); - - virtual SCODE STDMETHODCALLTYPE Save( - IStream *pStm, - BOOL fClearDirty); - - virtual SCODE STDMETHODCALLTYPE GetSizeMax( - ULARGE_INTEGER *pcbSize); + // From IPersistStream + virtual SCODE STDMETHODCALLTYPE Load( + IStream *pStm); + + virtual SCODE STDMETHODCALLTYPE Save( + IStream *pStm, + BOOL fClearDirty); + + virtual SCODE STDMETHODCALLTYPE GetSizeMax( + ULARGE_INTEGER *pcbSize); private: @@ -177,7 +177,7 @@ private: ULONG m_ChunkPosition; // Chunk pointer to specify the current Chunk; ULONG m_cAttributes; // Count of attributes CFullPropSpec * m_pAttributes; // Attributes to filter - IStream * m_pStream; + IStream * m_pStream; }; @@ -219,26 +219,3 @@ private: long m_lRefs; // Reference count }; - -extern "C" { - - voidpf ZCALLBACK cb_sopen OF((voidpf opaque, const char * filename, int mode)); - uLong ZCALLBACK cb_sread OF((voidpf opaque, voidpf stream, void* vuf, uLong size)); - uLong ZCALLBACK cb_swrite OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); - long ZCALLBACK cb_stell OF((voidpf opaque, voidpf stream)); - long ZCALLBACK cb_sseek OF((voidpf opaque, voidpf stream, uLong offset, int origin)); - int ZCALLBACK cb_sclose OF((voidpf opaque, voidpf stream)); - int ZCALLBACK cb_serror OF((voidpf opaque, voidpf stream)); - - void fill_stream_filefunc (zlib_filefunc_def* pzlib_filefunc_def); - -} - - - - - - - - - diff --git a/shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx b/shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx new file mode 100755 index 000000000000..e12f95a88e50 --- /dev/null +++ b/shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx @@ -0,0 +1,181 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 by Sun Microsystems, Inc. + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_shell.hxx" + +#if defined _MSC_VER +#pragma warning(push, 1) +#endif +#include +#if defined _MSC_VER +#pragma warning(pop) +#endif + +#include +#include + +/*#include +#include +#include +#include +#include "assert.h" +#include "propspec.hxx" +#ifdef __MINGW32__ +#include +using ::std::min; +#endif +*/ + +#include "internal/stream_helper.hxx" + +extern "C" { + voidpf ZCALLBACK cb_sopen OF((voidpf opaque, const char * filename, int mode)); + uLong ZCALLBACK cb_sread OF((voidpf opaque, voidpf stream, void* vuf, uLong size)); + uLong ZCALLBACK cb_swrite OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); + long ZCALLBACK cb_stell OF((voidpf opaque, voidpf stream)); + long ZCALLBACK cb_sseek OF((voidpf opaque, voidpf stream, uLong offset, int origin)); + int ZCALLBACK cb_sclose OF((voidpf opaque, voidpf stream)); + int ZCALLBACK cb_serror OF((voidpf opaque, voidpf stream)); + + void fill_stream_filefunc (zlib_filefunc_def* pzlib_filefunc_def); +} + +//----------------------------- +IStream* PrepareIStream( IStream* pStream, zlib_filefunc_def &zFileFunc ) +{ + // These next few lines work around the "Seek pointer" bug found on Vista. + char cBuf[20]; + unsigned long nCount; + HRESULT hr; + ULARGE_INTEGER nNewPosition; + LARGE_INTEGER nMove; + nMove.QuadPart = 0; + hr = pStream->Seek( nMove, STREAM_SEEK_SET, &nNewPosition ); + hr = pStream->Read( cBuf, 20, &nCount ); + + fill_stream_filefunc( &zFileFunc ); + zFileFunc.opaque = (void*)pStream; + + return pStream; +} + +extern "C" { + + // IStream callback + voidpf ZCALLBACK cb_sopen (voidpf opaque, const char* /*filename*/, int /*mode*/) { + return opaque; + } + + uLong ZCALLBACK cb_sread (voidpf /*opaque*/, voidpf stream, void* buf, uLong size) { + unsigned long newsize; + HRESULT hr; + + hr = ((IStream *)stream)->Read (buf, size, &newsize); + if (hr == S_OK){ + return (unsigned long)newsize; + } + else { + return (uLong)0; + } + } + + long ZCALLBACK cb_sseek (voidpf /*opaque*/, voidpf stream, uLong offset, int origin) { + // IStream::Seek parameters + HRESULT hr; + LARGE_INTEGER Move; + DWORD dwOrigin; + Move.QuadPart = (__int64)offset; + + switch (origin) { + case SEEK_CUR: + dwOrigin = STREAM_SEEK_CUR; + break; + case SEEK_END: + dwOrigin = STREAM_SEEK_END; + break; + case SEEK_SET: + dwOrigin = STREAM_SEEK_SET; + break; + default: + return -1; + } + + hr = ((IStream*)stream)->Seek (Move, dwOrigin, NULL); + if (hr == S_OK){ + return 0; + } + else { + return -1; + } + } + + long ZCALLBACK cb_stell (voidpf /*opaque*/, voidpf stream) { + // IStream::Seek parameters + HRESULT hr; + LARGE_INTEGER Move; + ULARGE_INTEGER NewPosition; + Move.QuadPart = 0; + NewPosition.QuadPart = 0; + + hr = ((IStream*)stream)->Seek (Move, STREAM_SEEK_CUR, &NewPosition); + if (hr == S_OK){ + return (long) NewPosition.QuadPart; + } + else { + return -1; + } + } + + int ZCALLBACK cb_sclose (voidpf /*opaque*/, voidpf /*stream*/) { + return 0; + } + + int ZCALLBACK cb_serror (voidpf /*opaque*/, voidpf /*stream*/) { + return 0; //RJK - for now + } + + uLong ZCALLBACK cb_swrite (voidpf /*opaque*/, voidpf stream, const void* buf, uLong size) { + HRESULT hr; + unsigned long writecount; + hr = ((IStream*)stream)->Write (buf, size, &writecount); + if (hr == S_OK) + return (unsigned int)writecount; + else + return (uLong)0; + } + + void fill_stream_filefunc (zlib_filefunc_def* pzlib_filefunc_def) { + pzlib_filefunc_def->zopen_file = cb_sopen; + pzlib_filefunc_def->zread_file = cb_sread; + pzlib_filefunc_def->zwrite_file = cb_swrite; + pzlib_filefunc_def->ztell_file = cb_stell; + pzlib_filefunc_def->zseek_file = cb_sseek; + pzlib_filefunc_def->zclose_file = cb_sclose; + pzlib_filefunc_def->zerror_file = cb_serror; + } +} diff --git a/shell/source/win32/shlxthandler/prophdl/makefile.mk b/shell/source/win32/shlxthandler/prophdl/makefile.mk new file mode 100755 index 000000000000..30efd7cedaa8 --- /dev/null +++ b/shell/source/win32/shlxthandler/prophdl/makefile.mk @@ -0,0 +1,61 @@ +#************************************************************************* +# +# 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: makefile.mk,v $ +# +# $Revision: 1.6 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/..$/.. +PRJNAME=shell +TARGET=propertyhdl +LIBTARGET=NO +ENABLE_EXCEPTIONS=TRUE + + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 +CFLAGS+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820 +CDEFS+=-D_WIN32_IE=0x501 + +# --- Files -------------------------------------------------------- + +SLOFILES=$(SLO)$/propertyhdl.obj + +.IF "$(BUILD_X64)"!="" +CFLAGS_X64+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 +CFLAGS_X64+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820 +CDEFS_X64+=-D_WIN32_IE=0x501 +SLOFILES_X64=$(SLO_X64)$/$(TARGET).obj +.ENDIF # "$(BUILD_X64)"!="" + +# --- Targets ------------------------------------------------------ +.INCLUDE : set_wntx64.mk +.INCLUDE : target.mk +.INCLUDE : tg_wntx64.mk \ No newline at end of file diff --git a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx new file mode 100755 index 000000000000..06d619de6f8d --- /dev/null +++ b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx @@ -0,0 +1,350 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 by Sun Microsystems, Inc. + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_shell.hxx" +#include "internal/global.hxx" +#include "internal/PropertyHdl.hxx" +#include "internal/fileextensions.hxx" +#include "internal/metainforeader.hxx" +#include "internal/utilities.hxx" +#include "internal/config.hxx" + +#include +#include + +#include +#include + +#include "internal/stream_helper.hxx" + +//---------------------------------------------------------- +#ifdef DEBUG +inline void OutputDebugStringFormat( LPCSTR pFormat, ... ) +{ + CHAR buffer[1024]; + va_list args; + + va_start( args, pFormat ); + StringCchVPrintfA( buffer, sizeof(buffer), pFormat, args ); + OutputDebugStringA( buffer ); +} +#else +static inline void OutputDebugStringFormat( LPCSTR, ... ) +{ +} +#endif + +//---------------------------- +// +//---------------------------- + +//namespace /* private */ +/*{ + SHPropertyHdl PropertyHdlTable[] = + { + {{PSGUID_SUMMARYINFORMATION, PIDSI_TITLE}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Title", L"Title"}, + {{PSGUID_SUMMARYINFORMATION, PIDSI_AUTHOR}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Author", L"Author"}, + {{PSGUID_SUMMARYINFORMATION, PIDSI_SUBJECT}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Subject", L"Subject"}, + {{PSGUID_SUMMARYINFORMATION, PIDSI_KEYWORDS}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Keywords", L"Keywords"}, + {{PSGUID_SUMMARYINFORMATION, PIDSI_COMMENTS}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Comments", L"Comments"}, + {{PSGUID_SUMMARYINFORMATION, PIDSI_PAGECOUNT},VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Pagecount", L"Pagecount"} + }; + + size_t PropertyHdlTableSize = sizeof(PropertyHdlTable)/sizeof(PropertyHdlTable[0]); +}*/ + +// +// Map of property keys to the locations of their value(s) in the .??? XML schema +// +struct PROPERTYMAP +{ + PROPERTYKEY key; + PCWSTR pszXPathParent; + PCWSTR pszValueNodeName; +}; + +PROPERTYMAP g_rgPROPERTYMAP[] = +{ + { PKEY_Title, L"OpenOffice.org", L"Title" }, + { PKEY_Author, L"OpenOffice.org", L"Author" }, + { PKEY_Subject, L"OpenOffice.org", L"Subject" }, + { PKEY_Keywords, L"OpenOffice.org", L"Keyword" }, + { PKEY_Comment, L"OpenOffice.org", L"Comments" }, +}; + +size_t gPropertyMapTableSize = sizeof(g_rgPROPERTYMAP)/sizeof(g_rgPROPERTYMAP[0]); + +//---------------------------- +// +//---------------------------- + +CPropertyHdl::CPropertyHdl( long nRefCnt ) : + m_RefCnt( nRefCnt ), + m_pCache( NULL ) +{ + OutputDebugStringFormat( "CPropertyHdl: CTOR\n" ); + InterlockedIncrement( &g_DllRefCnt ); +} + +//---------------------------- +// +//---------------------------- + +CPropertyHdl::~CPropertyHdl() +{ + if ( m_pCache ) + { + m_pCache->Release(); + m_pCache = NULL; + } + InterlockedDecrement( &g_DllRefCnt ); +} + +//----------------------------- +// IUnknown methods +//----------------------------- +HRESULT STDMETHODCALLTYPE CPropertyHdl::QueryInterface(REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject) +{ + *ppvObject = 0; + + if (IID_IUnknown == riid || IID_IPropertyStore == riid) + { + OutputDebugStringFormat( "CPropertyHdl: QueryInterface (IID_IPropertyStore)\n" ); + IUnknown* pUnk = static_cast(this); + pUnk->AddRef(); + *ppvObject = pUnk; + return S_OK; + } + else if (IID_IPropertyStoreCapabilities == riid) + { + OutputDebugStringFormat( "CPropertyHdl: QueryInterface (IID_IPropertyStoreCapabilities)\n" ); + IUnknown* pUnk = static_cast(this); + pUnk->AddRef(); + *ppvObject = pUnk; + return S_OK; + } + else if (IID_IInitializeWithStream == riid) + { + OutputDebugStringFormat( "CPropertyHdl: QueryInterface (IID_IInitializeWithStream)\n" ); + IUnknown* pUnk = static_cast(this); + pUnk->AddRef(); + *ppvObject = pUnk; + return S_OK; + } + OutputDebugStringFormat( "CPropertyHdl: QueryInterface (something different)\n" ); + + return E_NOINTERFACE; +} + +//---------------------------- +ULONG STDMETHODCALLTYPE CPropertyHdl::AddRef(void) +{ + return InterlockedIncrement(&m_RefCnt); +} + +//---------------------------- +ULONG STDMETHODCALLTYPE CPropertyHdl::Release( void) +{ + long refcnt = InterlockedDecrement(&m_RefCnt); + + if (0 == m_RefCnt) + delete this; + + return refcnt; +} + +//----------------------------- +// IPropertyStore +//----------------------------- +HRESULT STDMETHODCALLTYPE CPropertyHdl::GetCount( DWORD *pcProps ) +{ + HRESULT hr = E_UNEXPECTED; + if ( m_pCache && pcProps ) + { + hr = m_pCache->GetCount( pcProps ); + } + + return hr; +} + +//----------------------------- +HRESULT STDMETHODCALLTYPE CPropertyHdl::GetAt( DWORD iProp, PROPERTYKEY *pKey ) +{ + HRESULT hr = E_UNEXPECTED; + if ( m_pCache ) + { + hr = m_pCache->GetAt( iProp, pKey ); + } + + return hr; +} + +//----------------------------- +HRESULT STDMETHODCALLTYPE CPropertyHdl::GetValue( REFPROPERTYKEY key, PROPVARIANT *pPropVar ) +{ + HRESULT hr = E_UNEXPECTED; + if ( m_pCache ) + { + hr = m_pCache->GetValue( key, pPropVar ); + } + + return hr; +} + +//----------------------------- +HRESULT STDMETHODCALLTYPE CPropertyHdl::SetValue( REFPROPERTYKEY key, REFPROPVARIANT propVar ) +{ + HRESULT hr = E_UNEXPECTED; + if ( m_pCache ) + { + hr = STG_E_ACCESSDENIED; + } + return hr; +} + +//----------------------------- +HRESULT STDMETHODCALLTYPE CPropertyHdl::Commit() +{ + return S_OK; +} + +//----------------------------- +// IPropertyStore +//----------------------------- +HRESULT STDMETHODCALLTYPE CPropertyHdl::IsPropertyWritable( REFPROPERTYKEY key ) +{ + // We start with read only properties only + return S_FALSE; +} + +//----------------------------- +// IInitializeWithStream +//----------------------------- +HRESULT STDMETHODCALLTYPE CPropertyHdl::Initialize( IStream *pStream, DWORD grfMode ) +{ + if ( grfMode & STGM_READWRITE ) + return STG_E_ACCESSDENIED; + + if ( !m_pCache ) + { + if ( FAILED( PSCreateMemoryPropertyStore( IID_PPV_ARGS( &m_pCache ) ) ) ) + OutputDebugStringFormat( "CPropertyHdl::Initialize: PSCreateMemoryPropertyStore failed" ); + + zlib_filefunc_def z_filefunc; + pStream = PrepareIStream( pStream, z_filefunc ); + + CMetaInfoReader *pMetaInfoReader = NULL; + + try + { + pMetaInfoReader = new CMetaInfoReader( (void*)pStream, &z_filefunc ); + } + catch (const std::exception& e) + { + OutputDebugStringFormat( "CPropertyHdl::Initialize: Caught exception [%s]", e.what() ); + return E_FAIL; + } + + LoadProperties( pMetaInfoReader ); +/* + // load extended properties and search content + _LoadExtendedProperties(); + _LoadSearchContent(); +*/ + } + + return S_OK; +} + +//----------------------------- +void CPropertyHdl::LoadProperties( CMetaInfoReader *pMetaInfoReader ) +{ + OutputDebugStringFormat( "CPropertyHdl: LoadProperties\n" ); + PROPVARIANT propvarValues; + + for ( UINT i = 0; i < (UINT)gPropertyMapTableSize; ++i ) + { + PropVariantClear( &propvarValues ); + HRESULT hr = GetItemData( pMetaInfoReader, i, &propvarValues); + if (hr == S_OK) + { + // coerce the value(s) to the appropriate type for the property key + hr = PSCoerceToCanonicalValue( g_rgPROPERTYMAP[i].key, &propvarValues ); + if (SUCCEEDED(hr)) + { + // cache the value(s) loaded + hr = m_pCache->SetValueAndState( g_rgPROPERTYMAP[i].key, &propvarValues, PSC_NORMAL ); + } + } + } +} + +//----------------------------- +HRESULT CPropertyHdl::GetItemData( CMetaInfoReader *pMetaInfoReader, UINT nIndex, PROPVARIANT *pVarData ) +{ + switch (nIndex) { + case 0: { + pVarData->vt = VT_BSTR; + pVarData->bstrVal = SysAllocString( pMetaInfoReader->getTagData( META_INFO_TITLE ).c_str() ); + OutputDebugStringFormat( "CPropertyHdl::GetItemData: Title=%S.\n", pMetaInfoReader->getTagData( META_INFO_TITLE ).c_str() ); + return S_OK; + } + case 1: { + pVarData->vt = VT_BSTR; + pVarData->bstrVal = SysAllocString( pMetaInfoReader->getTagData( META_INFO_AUTHOR ).c_str() ); + OutputDebugStringFormat( "CPropertyHdl::GetItemData: Author=%S.\n", pMetaInfoReader->getTagData( META_INFO_AUTHOR ).c_str() ); + return S_OK; + } + case 2: { + pVarData->vt = VT_BSTR; + pVarData->bstrVal = SysAllocString( pMetaInfoReader->getTagData( META_INFO_SUBJECT ).c_str() ); + OutputDebugStringFormat( "CPropertyHdl::GetItemData: Subject=%S.\n", pMetaInfoReader->getTagData( META_INFO_SUBJECT ).c_str() ); + return S_OK; + } + case 3: { + pVarData->vt = VT_BSTR; + pVarData->bstrVal = SysAllocString( pMetaInfoReader->getTagData( META_INFO_KEYWORDS ).c_str() ); + OutputDebugStringFormat( "CPropertyHdl::GetItemData: Keywords=%S.\n", pMetaInfoReader->getTagData( META_INFO_KEYWORDS ).c_str() ); + return S_OK; + } + case 4: { + pVarData->vt = VT_BSTR; + pVarData->bstrVal = SysAllocString( pMetaInfoReader->getTagData( META_INFO_DESCRIPTION ).c_str() ); + OutputDebugStringFormat( "CPropertyHdl::GetItemData: Description=%S.\n", pMetaInfoReader->getTagData( META_INFO_DESCRIPTION ).c_str() ); + return S_OK; + } + case 5: { + pVarData->vt = VT_BSTR; + pVarData->bstrVal = SysAllocString( pMetaInfoReader->getTagAttribute( META_INFO_DOCUMENT_STATISTIC, META_INFO_PAGES ).c_str() ); + OutputDebugStringFormat( "CPropertyHdl::GetItemData: Pages=%S.\n", pMetaInfoReader->getTagAttribute( META_INFO_DOCUMENT_STATISTIC, META_INFO_PAGES ).c_str() ); + return S_OK; + } + } + + return S_FALSE; +} \ No newline at end of file diff --git a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx old mode 100644 new mode 100755 index 171bc287715f..51eb2d251f71 --- a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx +++ b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx @@ -51,6 +51,24 @@ #include #include #include +#include + +//---------------------------------------------------------- +#ifdef DEBUG +inline void OutputDebugStringFormat( LPCSTR pFormat, ... ) +{ + CHAR buffer[1024]; + va_list args; + + va_start( args, pFormat ); + StringCchVPrintfA( buffer, sizeof(buffer), pFormat, args ); + OutputDebugStringA( buffer ); +} +#else +static inline void OutputDebugStringFormat( LPCSTR, ... ) +{ +} +#endif /*--------------------------------------------- @@ -70,6 +88,7 @@ CPropertySheet::CPropertySheet(long RefCnt) : m_RefCnt(RefCnt) { + OutputDebugStringFormat("CPropertySheet::CTor [%d], [%d]", m_RefCnt, g_DllRefCnt ); InterlockedIncrement(&g_DllRefCnt); } @@ -79,6 +98,7 @@ CPropertySheet::CPropertySheet(long RefCnt) : CPropertySheet::~CPropertySheet() { + OutputDebugStringFormat("CPropertySheet::DTor [%d], [%d]", m_RefCnt, g_DllRefCnt ); InterlockedDecrement(&g_DllRefCnt); } @@ -116,6 +136,7 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::QueryInterface( ULONG STDMETHODCALLTYPE CPropertySheet::AddRef(void) { + OutputDebugStringFormat("CPropertySheet::AddRef [%d]", m_RefCnt ); return InterlockedIncrement(&m_RefCnt); } @@ -125,6 +146,7 @@ ULONG STDMETHODCALLTYPE CPropertySheet::AddRef(void) ULONG STDMETHODCALLTYPE CPropertySheet::Release(void) { + OutputDebugStringFormat("CPropertySheet::Release [%d]", m_RefCnt ); long refcnt = InterlockedDecrement(&m_RefCnt); if (0 == refcnt) @@ -177,42 +199,51 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::Initialize( HRESULT STDMETHODCALLTYPE CPropertySheet::AddPages(LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam) { + // Get OS version (we don't need the summary page on Windows Vista or later) + OSVERSIONINFO sInfoOS; - PROPSHEETPAGE psp; + ZeroMemory( &sInfoOS, sizeof(OSVERSIONINFO) ); + sInfoOS.dwOSVersionInfoSize = sizeof( OSVERSIONINFO ); + GetVersionEx( &sInfoOS ); + bool bIsVistaOrLater = (sInfoOS.dwMajorVersion >= 6); - // add the summary property page + std::wstring proppage_header; + PROPSHEETPAGE psp; ZeroMemory(&psp, sizeof(PROPSHEETPAGEA)); - std::wstring proppage_header = GetResString(IDS_PROPPAGE_SUMMARY_TITLE); - + // add the summary property page psp.dwSize = sizeof(PROPSHEETPAGE); psp.dwFlags = PSP_DEFAULT | PSP_USETITLE | PSP_USECALLBACK; psp.hInstance = GetModuleHandle(MODULE_NAME); - psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_SUMMARY); - psp.pszTitle = proppage_header.c_str(); - psp.pfnDlgProc = reinterpret_cast(CPropertySheet::PropPageSummaryProc); psp.lParam = reinterpret_cast(this); psp.pfnCallback = reinterpret_cast(CPropertySheet::PropPageSummaryCallback); - HPROPSHEETPAGE hPage = CreatePropertySheetPage(&psp); + HPROPSHEETPAGE hPage = NULL; - // keep this instance alive - // will be released when the - // the page is about to be - // destroyed in the callback - // function - - if (hPage) + if ( !bIsVistaOrLater ) { - if (lpfnAddPage(hPage, lParam)) - AddRef(); - else - DestroyPropertySheetPage(hPage); + proppage_header = GetResString(IDS_PROPPAGE_SUMMARY_TITLE); + + psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_SUMMARY); + psp.pszTitle = proppage_header.c_str(); + psp.pfnDlgProc = reinterpret_cast(CPropertySheet::PropPageSummaryProc); + + hPage = CreatePropertySheetPage(&psp); + + // keep this instance alive, will be released when the + // the page is about to be destroyed in the callback function + + if (hPage) + { + if (lpfnAddPage(hPage, lParam)) + AddRef(); + else + DestroyPropertySheetPage(hPage); + } } // add the statistics property page - proppage_header = GetResString(IDS_PROPPAGE_STATISTICS_TITLE); psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_STATISTICS); diff --git a/shell/source/win32/shlxthandler/shlxthdl.cxx b/shell/source/win32/shlxthandler/shlxthdl.cxx old mode 100644 new mode 100755 index 1249d3cde6e7..9af1f6314ae0 --- a/shell/source/win32/shlxthandler/shlxthdl.cxx +++ b/shell/source/win32/shlxthandler/shlxthdl.cxx @@ -392,7 +392,8 @@ extern "C" STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void** ppv) if ((rclsid != CLSID_INFOTIP_HANDLER) && (rclsid != CLSID_COLUMN_HANDLER) && (rclsid != CLSID_PROPERTYSHEET_HANDLER) && - (rclsid != CLSID_THUMBVIEWER_HANDLER)) + (rclsid != CLSID_THUMBVIEWER_HANDLER) && + (rclsid != CLSID_PROPERTY_HANDLER)) return CLASS_E_CLASSNOTAVAILABLE; if ((riid != IID_IUnknown) && (riid != IID_IClassFactory)) -- cgit From f8d47b590bb74979453368f35f24250384a24ce2 Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Mon, 25 Jan 2010 07:08:21 +0100 Subject: dv17: #i70994#: Proprty handler should work with 64bit, too --- shell/source/win32/shlxthandler/makefile.mk | 13 ++++----- .../source/win32/shlxthandler/ooofilt/makefile.mk | 3 +- .../source/win32/shlxthandler/prophdl/makefile.mk | 2 +- .../win32/shlxthandler/prophdl/propertyhdl.cxx | 32 ---------------------- .../win32/shlxthandler/propsheets/propsheets.cxx | 17 ------------ shell/source/win32/shlxthandler/shlxthdl.cxx | 11 ++++++++ 6 files changed, 20 insertions(+), 58 deletions(-) (limited to 'shell') diff --git a/shell/source/win32/shlxthandler/makefile.mk b/shell/source/win32/shlxthandler/makefile.mk index c9859578d992..7735a5947c80 100755 --- a/shell/source/win32/shlxthandler/makefile.mk +++ b/shell/source/win32/shlxthandler/makefile.mk @@ -6,10 +6,6 @@ # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.14 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -83,7 +79,7 @@ SHL1STDLIBS+=\ $(GDI32LIB)\ $(GDIPLUSLIB)\ $(SHLWAPILIB)\ - propsys.lib + $(PROPSYSLIB) SHL1LIBS+=$(SLB)$/util.lib\ $(SLB)$/ooofilereader.lib @@ -112,7 +108,9 @@ SLOFILES_X64= \ $(SLO_X64)$/shlxthdl.obj\ $(SLO_X64)$/listviewbuilder.obj\ $(SLO_X64)$/document_statistic.obj\ - $(SLO_X64)$/thumbviewer.obj + $(SLO_X64)$/thumbviewer.obj\ + $(SLO_X64)$/propertyhdl.obj\ + $(SLO_X64)$/stream_helper.obj\ SHL1TARGET_X64=$(TARGET) SHL1LIBS_X64=$(SOLARLIBDIR_X64)$/zlib.lib\ @@ -131,7 +129,8 @@ SHL1STDLIBS_X64+=\ $(GDIPLUSLIB_X64) \ $(MSVCRT_X64) \ $(MSVCPRT_X64) \ - $(OLDNAMESLIB_X64) + $(OLDNAMESLIB_X64)\ + $(PROPSYSLIB_X64) SHL1LIBS_X64+=$(SLB_X64)$/util.lib\ $(SLB_X64)$/ooofilereader.lib diff --git a/shell/source/win32/shlxthandler/ooofilt/makefile.mk b/shell/source/win32/shlxthandler/ooofilt/makefile.mk index 221ec6ee99c5..88f561ec6749 100755 --- a/shell/source/win32/shlxthandler/ooofilt/makefile.mk +++ b/shell/source/win32/shlxthandler/ooofilt/makefile.mk @@ -99,7 +99,8 @@ CDEFS_X64+=-D_WIN32_IE=0x501 USE_DEFFILE_X64=TRUE SLOFILES_X64=$(SLO_X64)$/ooofilt.obj\ - $(SLO_X64)$/propspec.obj + $(SLO_X64)$/propspec.obj\ + $(SLO_X64)$/stream_helper.obj SHL1TARGET_X64=$(TARGET) diff --git a/shell/source/win32/shlxthandler/prophdl/makefile.mk b/shell/source/win32/shlxthandler/prophdl/makefile.mk index 30efd7cedaa8..19f9d494b741 100755 --- a/shell/source/win32/shlxthandler/prophdl/makefile.mk +++ b/shell/source/win32/shlxthandler/prophdl/makefile.mk @@ -46,7 +46,7 @@ CDEFS+=-D_WIN32_IE=0x501 # --- Files -------------------------------------------------------- -SLOFILES=$(SLO)$/propertyhdl.obj +SLOFILES=$(SLO)$/$(TARGET).obj .IF "$(BUILD_X64)"!="" CFLAGS_X64+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 diff --git a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx index 06d619de6f8d..97db20caaea5 100755 --- a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx +++ b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx @@ -42,42 +42,10 @@ #include "internal/stream_helper.hxx" -//---------------------------------------------------------- -#ifdef DEBUG -inline void OutputDebugStringFormat( LPCSTR pFormat, ... ) -{ - CHAR buffer[1024]; - va_list args; - - va_start( args, pFormat ); - StringCchVPrintfA( buffer, sizeof(buffer), pFormat, args ); - OutputDebugStringA( buffer ); -} -#else -static inline void OutputDebugStringFormat( LPCSTR, ... ) -{ -} -#endif - //---------------------------- // //---------------------------- -//namespace /* private */ -/*{ - SHPropertyHdl PropertyHdlTable[] = - { - {{PSGUID_SUMMARYINFORMATION, PIDSI_TITLE}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Title", L"Title"}, - {{PSGUID_SUMMARYINFORMATION, PIDSI_AUTHOR}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Author", L"Author"}, - {{PSGUID_SUMMARYINFORMATION, PIDSI_SUBJECT}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Subject", L"Subject"}, - {{PSGUID_SUMMARYINFORMATION, PIDSI_KEYWORDS}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Keywords", L"Keywords"}, - {{PSGUID_SUMMARYINFORMATION, PIDSI_COMMENTS}, VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Comments", L"Comments"}, - {{PSGUID_SUMMARYINFORMATION, PIDSI_PAGECOUNT},VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L"Pagecount", L"Pagecount"} - }; - - size_t PropertyHdlTableSize = sizeof(PropertyHdlTable)/sizeof(PropertyHdlTable[0]); -}*/ - // // Map of property keys to the locations of their value(s) in the .??? XML schema // diff --git a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx index 0dd5e37fb4ea..f2aa131cb0ef 100755 --- a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx +++ b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx @@ -53,23 +53,6 @@ #include #include -//---------------------------------------------------------- -#ifdef DEBUG -inline void OutputDebugStringFormat( LPCSTR pFormat, ... ) -{ - CHAR buffer[1024]; - va_list args; - - va_start( args, pFormat ); - StringCchVPrintfA( buffer, sizeof(buffer), pFormat, args ); - OutputDebugStringA( buffer ); -} -#else -static inline void OutputDebugStringFormat( LPCSTR, ... ) -{ -} -#endif - /*--------------------------------------------- INFO - INFO - INFO - INFO - INFO - INFO diff --git a/shell/source/win32/shlxthandler/shlxthdl.cxx b/shell/source/win32/shlxthandler/shlxthdl.cxx index 9af1f6314ae0..80f17470c379 100755 --- a/shell/source/win32/shlxthandler/shlxthdl.cxx +++ b/shell/source/win32/shlxthandler/shlxthdl.cxx @@ -399,6 +399,17 @@ extern "C" STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void** ppv) if ((riid != IID_IUnknown) && (riid != IID_IClassFactory)) return E_NOINTERFACE; + if ( rclsid == CLSID_INFOTIP_HANDLER ) + OutputDebugStringFormat( "DllGetClassObject: Create CLSID_INFOTIP_HANDLER\n" ); + else if ( rclsid == CLSID_COLUMN_HANDLER ) + OutputDebugStringFormat( "DllGetClassObject: Create CLSID_COLUMN_HANDLER\n" ); + else if ( rclsid == CLSID_PROPERTYSHEET_HANDLER ) + OutputDebugStringFormat( "DllGetClassObject: Create CLSID_PROPERTYSHEET_HANDLER\n" ); + else if ( rclsid == CLSID_THUMBVIEWER_HANDLER ) + OutputDebugStringFormat( "DllGetClassObject: Create CLSID_THUMBVIEWER_HANDLER\n" ); + else if ( rclsid == CLSID_PROPERTY_HANDLER ) + OutputDebugStringFormat( "DllGetClassObject: Create CLSID_PROPERTY_HANDLER\n" ); + IUnknown* pUnk = new CClassFactory(rclsid); if (0 == pUnk) return E_OUTOFMEMORY; -- cgit From 69adeb47391412ea0328055d3773d5b6ce0d00a6 Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Tue, 26 Jan 2010 07:36:23 +0100 Subject: dv17: #i70994#: Moved property handler to own library to avoid problems with old Windows versions --- shell/inc/internal/propertyhdl.hxx | 36 +++++ shell/inc/internal/shlxthdl.hxx | 4 - shell/prj/d.lst | 1 + shell/source/win32/shlxthandler/classfactory.cxx | 4 - shell/source/win32/shlxthandler/makefile.mk | 10 +- .../source/win32/shlxthandler/prophdl/exports.dxp | 2 + .../source/win32/shlxthandler/prophdl/makefile.mk | 83 ++++++++++- .../win32/shlxthandler/prophdl/propertyhdl.cxx | 159 +++++++++++++++++++-- shell/source/win32/shlxthandler/shlxthdl.cxx | 5 +- 9 files changed, 268 insertions(+), 36 deletions(-) create mode 100755 shell/source/win32/shlxthandler/prophdl/exports.dxp (limited to 'shell') diff --git a/shell/inc/internal/propertyhdl.hxx b/shell/inc/internal/propertyhdl.hxx index 60ff10bc6958..6379fdf0137b 100755 --- a/shell/inc/internal/propertyhdl.hxx +++ b/shell/inc/internal/propertyhdl.hxx @@ -40,6 +40,10 @@ #pragma warning(pop) #endif +// {AE424E85-F6DF-4910-A6A9-438797986431} +const CLSID CLSID_PROPERTY_HANDLER = +{ 0xae424e85, 0xf6df, 0x4910, { 0xa6, 0xa9, 0x43, 0x87, 0x97, 0x98, 0x64, 0x31 } }; + class CMetaInfoReader; class CPropertyHdl : public IPropertyStore, @@ -87,4 +91,36 @@ private: IPropertyStoreCache* m_pCache; }; +class CClassFactory : public IClassFactory +{ +public: + CClassFactory( const CLSID& clsid ); + virtual ~CClassFactory(); + + //----------------------------- + // IUnknown methods + //----------------------------- + virtual HRESULT STDMETHODCALLTYPE QueryInterface( + REFIID riid, + void __RPC_FAR *__RPC_FAR *ppvObject); + virtual ULONG STDMETHODCALLTYPE AddRef( void ); + virtual ULONG STDMETHODCALLTYPE Release( void ); + + //----------------------------- + // IClassFactory methods + //----------------------------- + virtual HRESULT STDMETHODCALLTYPE CreateInstance( + IUnknown __RPC_FAR *pUnkOuter, + REFIID riid, + void __RPC_FAR *__RPC_FAR *ppvObject); + + virtual HRESULT STDMETHODCALLTYPE LockServer( BOOL fLock ); + static bool IsLocked(); + +private: + long m_RefCnt; + CLSID m_Clsid; + static long s_ServerLocks; +}; + #endif diff --git a/shell/inc/internal/shlxthdl.hxx b/shell/inc/internal/shlxthdl.hxx index 70830c9775ec..782212f6dc5b 100755 --- a/shell/inc/internal/shlxthdl.hxx +++ b/shell/inc/internal/shlxthdl.hxx @@ -55,8 +55,4 @@ const CLSID CLSID_PROPERTYSHEET_HANDLER = const CLSID CLSID_THUMBVIEWER_HANDLER = { 0x3b092f0c, 0x7696, 0x40e3, { 0xa8, 0xf, 0x68, 0xd7, 0x4d, 0xa8, 0x42, 0x10 } }; -// {AE424E85-F6DF-4910-A6A9-438797986431} -const CLSID CLSID_PROPERTY_HANDLER = -{ 0xae424e85, 0xf6df, 0x4910, { 0xa6, 0xa9, 0x43, 0x87, 0x97, 0x98, 0x64, 0x31 } }; - #endif diff --git a/shell/prj/d.lst b/shell/prj/d.lst index eee13ef34fe9..ea8be0bbaf04 100755 --- a/shell/prj/d.lst +++ b/shell/prj/d.lst @@ -7,6 +7,7 @@ ..\%__SRC%\bin\x64\shlxthdl.dll %_DEST%\bin%_EXT%\shlxthdl_x64.dll ..\%__SRC%\bin\x64\ooofiltproxy.dll %_DEST%\bin%_EXT%\ooofiltproxy_x64.dll ..\%__SRC%\bin\x64\ooofilt.dll %_DEST%\bin%_EXT%\ooofilt_x64.dll +..\%__SRC%\bin\x64\propertyhdl.dll %_DEST%\bin%_EXT%\propertyhdl_x64.dll ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib ..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a diff --git a/shell/source/win32/shlxthandler/classfactory.cxx b/shell/source/win32/shlxthandler/classfactory.cxx index 10dd3e82934d..ee60cb4f62b7 100755 --- a/shell/source/win32/shlxthandler/classfactory.cxx +++ b/shell/source/win32/shlxthandler/classfactory.cxx @@ -35,7 +35,6 @@ #include "internal/infotips.hxx" #include "internal/propsheets.hxx" #include "internal/columninfo.hxx" -#include "internal/propertyhdl.hxx" #ifdef __MINGW32__ #include using ::std::max; @@ -138,9 +137,6 @@ HRESULT STDMETHODCALLTYPE CClassFactory::CreateInstance( else if (CLSID_THUMBVIEWER_HANDLER == m_Clsid) pUnk = static_cast(new CThumbviewer()); - else if (CLSID_PROPERTY_HANDLER == m_Clsid) - pUnk = static_cast(new CPropertyHdl()); - POST_CONDITION(pUnk != 0, "Could not create COM object"); if (0 == pUnk) diff --git a/shell/source/win32/shlxthandler/makefile.mk b/shell/source/win32/shlxthandler/makefile.mk index 7735a5947c80..83998a15e627 100755 --- a/shell/source/win32/shlxthandler/makefile.mk +++ b/shell/source/win32/shlxthandler/makefile.mk @@ -55,8 +55,6 @@ SLOFILES=$(SLO)$/classfactory.obj\ $(SLO)$/listviewbuilder.obj\ $(SLO)$/document_statistic.obj\ $(SLO)$/thumbviewer.obj\ - $(SLO)$/propertyhdl.obj\ - $(SLO)$/stream_helper.obj\ SHL1TARGET=$(TARGET) @@ -78,8 +76,7 @@ SHL1STDLIBS+=\ $(KERNEL32LIB)\ $(GDI32LIB)\ $(GDIPLUSLIB)\ - $(SHLWAPILIB)\ - $(PROPSYSLIB) + $(SHLWAPILIB) SHL1LIBS+=$(SLB)$/util.lib\ $(SLB)$/ooofilereader.lib @@ -109,8 +106,6 @@ SLOFILES_X64= \ $(SLO_X64)$/listviewbuilder.obj\ $(SLO_X64)$/document_statistic.obj\ $(SLO_X64)$/thumbviewer.obj\ - $(SLO_X64)$/propertyhdl.obj\ - $(SLO_X64)$/stream_helper.obj\ SHL1TARGET_X64=$(TARGET) SHL1LIBS_X64=$(SOLARLIBDIR_X64)$/zlib.lib\ @@ -129,8 +124,7 @@ SHL1STDLIBS_X64+=\ $(GDIPLUSLIB_X64) \ $(MSVCRT_X64) \ $(MSVCPRT_X64) \ - $(OLDNAMESLIB_X64)\ - $(PROPSYSLIB_X64) + $(OLDNAMESLIB_X64) SHL1LIBS_X64+=$(SLB_X64)$/util.lib\ $(SLB_X64)$/ooofilereader.lib diff --git a/shell/source/win32/shlxthandler/prophdl/exports.dxp b/shell/source/win32/shlxthandler/prophdl/exports.dxp new file mode 100755 index 000000000000..2ada8255f8f7 --- /dev/null +++ b/shell/source/win32/shlxthandler/prophdl/exports.dxp @@ -0,0 +1,2 @@ +DllGetClassObject PRIVATE +DllCanUnloadNow PRIVATE \ No newline at end of file diff --git a/shell/source/win32/shlxthandler/prophdl/makefile.mk b/shell/source/win32/shlxthandler/prophdl/makefile.mk index 19f9d494b741..b9153bf014de 100755 --- a/shell/source/win32/shlxthandler/prophdl/makefile.mk +++ b/shell/source/win32/shlxthandler/prophdl/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2010 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.6 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -34,25 +30,98 @@ PRJNAME=shell TARGET=propertyhdl LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE - +USE_DEFFILE=TRUE +.IF "$(BUILD_X64)"!="" +USE_DEFFILE_X64=TRUE +.ENDIF # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk +UWINAPILIB = +UWINAPILIB_X64 = + CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 CFLAGS+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820 CDEFS+=-D_WIN32_IE=0x501 # --- Files -------------------------------------------------------- -SLOFILES=$(SLO)$/$(TARGET).obj +SLOFILES=$(SLO)$/$(TARGET).obj\ + $(SLO)$/stream_helper.obj + +SHL1TARGET=$(TARGET) + +.IF "$(COM)"=="GCC" +SHL1STDLIBS=$(ZLIB3RDLIB) $(EXPAT3RDLIB) $(COMCTL32LIB) +SHL1LIBS= +.ELSE +SHL1STDLIBS= +SHL1LIBS=$(SOLARLIBDIR)$/zlib.lib\ + $(SOLARLIBDIR)$/expat_xmlparse.lib\ + $(SOLARLIBDIR)$/expat_xmltok.lib +.ENDIF +SHL1STDLIBS+=\ + $(OLEAUT32LIB)\ + $(ADVAPI32LIB)\ + $(OLE32LIB)\ + $(UUIDLIB)\ + $(SHELL32LIB)\ + $(KERNEL32LIB)\ + $(GDI32LIB)\ + $(GDIPLUSLIB)\ + $(SHLWAPILIB)\ + $(PROPSYSLIB) + +SHL1LIBS+=$(SLB)$/util.lib\ + $(SLB)$/ooofilereader.lib +SHL1DEPN= +SHL1OBJS=$(SLOFILES) +SHL1DEF=$(MISC)$/$(SHL1TARGET).def +DEF1NAME=$(SHL1TARGET) +DEF1EXPORTFILE=exports.dxp + +# -------------------- x64 ----------------------- .IF "$(BUILD_X64)"!="" CFLAGS_X64+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 CFLAGS_X64+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820 CDEFS_X64+=-D_WIN32_IE=0x501 SLOFILES_X64=$(SLO_X64)$/$(TARGET).obj + +SLOFILES_X64= \ + $(SLO_X64)$/propertyhdl.obj\ + $(SLO_X64)$/stream_helper.obj\ + +SHL1TARGET_X64=$(TARGET) +SHL1LIBS_X64=$(SOLARLIBDIR_X64)$/zlib.lib\ + $(SOLARLIBDIR_X64)$/expat_xmlparse.lib\ + $(SOLARLIBDIR_X64)$/expat_xmltok.lib + +SHL1STDLIBS_X64+=\ + $(OLEAUT32LIB_X64)\ + $(ADVAPI32LIB_X64)\ + $(OLE32LIB_X64)\ + $(UUIDLIB_X64)\ + $(SHELL32LIB_X64)\ + $(KERNEL32LIB_X64)\ + $(GDI32LIB_X64)\ + $(USER32LIB_X64) \ + $(GDIPLUSLIB_X64) \ + $(MSVCRT_X64) \ + $(MSVCPRT_X64) \ + $(OLDNAMESLIB_X64)\ + $(PROPSYSLIB_X64) + +SHL1LIBS_X64+=$(SLB_X64)$/util.lib\ + $(SLB_X64)$/ooofilereader.lib +SHL1OBJS_X64=$(SLOFILES_X64) +SHL1DEF_X64=$(MISC_X64)$/$(SHL1TARGET).def + +DEF1NAME_X64=$(SHL1TARGET_X64) +DEF1EXPORTFILE_X64=exports.dxp + .ENDIF # "$(BUILD_X64)"!="" # --- Targets ------------------------------------------------------ diff --git a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx index 97db20caaea5..3cece320ace4 100755 --- a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx +++ b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx @@ -42,9 +42,11 @@ #include "internal/stream_helper.hxx" -//---------------------------- -// -//---------------------------- +//--------------------------- +// Module global +//--------------------------- +long g_DllRefCnt = 0; +HINSTANCE g_hModule = NULL; // // Map of property keys to the locations of their value(s) in the .??? XML schema @@ -130,17 +132,17 @@ HRESULT STDMETHODCALLTYPE CPropertyHdl::QueryInterface(REFIID riid, void __RPC_F } //---------------------------- -ULONG STDMETHODCALLTYPE CPropertyHdl::AddRef(void) +ULONG STDMETHODCALLTYPE CPropertyHdl::AddRef( void ) { - return InterlockedIncrement(&m_RefCnt); + return InterlockedIncrement( &m_RefCnt ); } //---------------------------- -ULONG STDMETHODCALLTYPE CPropertyHdl::Release( void) +ULONG STDMETHODCALLTYPE CPropertyHdl::Release( void ) { - long refcnt = InterlockedDecrement(&m_RefCnt); + long refcnt = InterlockedDecrement( &m_RefCnt ); - if (0 == m_RefCnt) + if ( 0 == m_RefCnt ) delete this; return refcnt; @@ -315,4 +317,143 @@ HRESULT CPropertyHdl::GetItemData( CMetaInfoReader *pMetaInfoReader, UINT nIndex } return S_FALSE; -} \ No newline at end of file +} + +//----------------------------------------------------------------------------- +// CClassFactory +//----------------------------------------------------------------------------- + +long CClassFactory::s_ServerLocks = 0; + +//----------------------------------------------------------------------------- +CClassFactory::CClassFactory( const CLSID& clsid ) : + m_RefCnt(1), + m_Clsid(clsid) +{ + InterlockedIncrement( &g_DllRefCnt ); +} + +//----------------------------------------------------------------------------- +CClassFactory::~CClassFactory() +{ + InterlockedDecrement( &g_DllRefCnt ); +} + +//----------------------------------------------------------------------------- +// IUnknown methods +//----------------------------------------------------------------------------- +HRESULT STDMETHODCALLTYPE CClassFactory::QueryInterface( REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject ) +{ + *ppvObject = 0; + + if ( IID_IUnknown == riid || IID_IClassFactory == riid ) + { + IUnknown* pUnk = this; + pUnk->AddRef(); + *ppvObject = pUnk; + return S_OK; + } + + return E_NOINTERFACE; +} + +//----------------------------------------------------------------------------- +ULONG STDMETHODCALLTYPE CClassFactory::AddRef( void ) +{ + return InterlockedIncrement( &m_RefCnt ); +} + +//----------------------------------------------------------------------------- +ULONG STDMETHODCALLTYPE CClassFactory::Release( void ) +{ + long refcnt = InterlockedDecrement( &m_RefCnt ); + + if (0 == refcnt) + delete this; + + return refcnt; +} + +//----------------------------------------------------------------------------- +// IClassFactory methods +//----------------------------------------------------------------------------- +HRESULT STDMETHODCALLTYPE CClassFactory::CreateInstance( + IUnknown __RPC_FAR *pUnkOuter, + REFIID riid, + void __RPC_FAR *__RPC_FAR *ppvObject) +{ + if ( pUnkOuter != NULL ) + return CLASS_E_NOAGGREGATION; + + IUnknown* pUnk = 0; + + if ( CLSID_PROPERTY_HANDLER == m_Clsid ) + pUnk = static_cast( new CPropertyHdl() ); + + POST_CONDITION(pUnk != 0, "Could not create COM object"); + + if (0 == pUnk) + return E_OUTOFMEMORY; + + HRESULT hr = pUnk->QueryInterface( riid, ppvObject ); + + // if QueryInterface failed the component will destroy itself + pUnk->Release(); + + return hr; +} + +//----------------------------------------------------------------------------- +HRESULT STDMETHODCALLTYPE CClassFactory::LockServer( BOOL fLock ) +{ + if ( fLock ) + InterlockedIncrement( &s_ServerLocks ); + else + InterlockedDecrement( &s_ServerLocks ); + + return S_OK; +} + +//----------------------------------------------------------------------------- +bool CClassFactory::IsLocked() +{ + return ( s_ServerLocks > 0 ); +} + +//----------------------------------------------------------------------------- +extern "C" STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void** ppv) +{ + OutputDebugStringFormat( "DllGetClassObject.\n" ); + *ppv = 0; + + if ( rclsid != CLSID_PROPERTY_HANDLER ) + return CLASS_E_CLASSNOTAVAILABLE; + + if ( (riid != IID_IUnknown) && (riid != IID_IClassFactory) ) + return E_NOINTERFACE; + + IUnknown* pUnk = new CClassFactory( rclsid ); + if ( 0 == pUnk ) + return E_OUTOFMEMORY; + + *ppv = pUnk; + return S_OK; +} + +//----------------------------------------------------------------------------- +extern "C" STDAPI DllCanUnloadNow( void ) +{ + OutputDebugStringFormat( "DllCanUnloadNow.\n" ); + if (CClassFactory::IsLocked() || g_DllRefCnt > 0) + return S_FALSE; + + return S_OK; +} + +//----------------------------------------------------------------------------- +BOOL WINAPI DllMain( HINSTANCE hInst, ULONG /*ul_reason_for_call*/, LPVOID /*lpReserved*/ ) +{ + OutputDebugStringFormat( "DllMain.\n" ); + g_hModule = hInst; + return TRUE; +} diff --git a/shell/source/win32/shlxthandler/shlxthdl.cxx b/shell/source/win32/shlxthandler/shlxthdl.cxx index 80f17470c379..11bb23448cd0 100755 --- a/shell/source/win32/shlxthandler/shlxthdl.cxx +++ b/shell/source/win32/shlxthandler/shlxthdl.cxx @@ -392,8 +392,7 @@ extern "C" STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void** ppv) if ((rclsid != CLSID_INFOTIP_HANDLER) && (rclsid != CLSID_COLUMN_HANDLER) && (rclsid != CLSID_PROPERTYSHEET_HANDLER) && - (rclsid != CLSID_THUMBVIEWER_HANDLER) && - (rclsid != CLSID_PROPERTY_HANDLER)) + (rclsid != CLSID_THUMBVIEWER_HANDLER)) return CLASS_E_CLASSNOTAVAILABLE; if ((riid != IID_IUnknown) && (riid != IID_IClassFactory)) @@ -407,8 +406,6 @@ extern "C" STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void** ppv) OutputDebugStringFormat( "DllGetClassObject: Create CLSID_PROPERTYSHEET_HANDLER\n" ); else if ( rclsid == CLSID_THUMBVIEWER_HANDLER ) OutputDebugStringFormat( "DllGetClassObject: Create CLSID_THUMBVIEWER_HANDLER\n" ); - else if ( rclsid == CLSID_PROPERTY_HANDLER ) - OutputDebugStringFormat( "DllGetClassObject: Create CLSID_PROPERTY_HANDLER\n" ); IUnknown* pUnk = new CClassFactory(rclsid); if (0 == pUnk) -- cgit From 46e81a69d5a3791742997fefd96a9ea3cf1302f3 Mon Sep 17 00:00:00 2001 From: Tobias Krause Date: Wed, 27 Jan 2010 08:42:12 +0100 Subject: tkr32: #i106190# remove ooofiltproxy --- .../shlxthandler/ooofilt/proxy/ooofiltproxy.cxx | 166 --------------------- 1 file changed, 166 deletions(-) delete mode 100644 shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx (limited to 'shell') diff --git a/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx b/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx deleted file mode 100644 index 218ba500d368..000000000000 --- a/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx +++ /dev/null @@ -1,166 +0,0 @@ -/************************************************************************* - * - * 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: ooofiltproxy.cxx,v $ - * $Revision: 1.8 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_shell.hxx" - -#if defined _MSC_VER -#pragma warning(push, 1) -#endif -#include -#if defined _MSC_VER -#pragma warning(pop) -#endif -#include -#ifdef __MINGW32__ -#include -#endif -#include "internal/config.hxx" - - -/* - The indexing filter library ooofilt.dll is linked against a couple - of libaries (e.g. stlport, uwinapi, ...) which are not standard on - a windows system. Unfortunately the library will be loaded by the - indexing service via LoadLibrary so that the libraries ooofilt.dll - depends on need to be in one of the standard search directories or - the directory need to be added to the PATH - environment variable. In order to prevent failures while loading - the ooofilt.dll we're installing and registering this proxy library - which will load ooofilt.dll using LoadLibraryEx with the flag - LOAD_WITH_ALTERED_SEARCH_PATH (see MSDN for details). This approach - ensures that all libraries ooofilt.dll depends on will be found. -*/ - -typedef HRESULT (__stdcall * Forward_DllGetClassObject_t)(REFCLSID cid, REFIID iid, void** ppvObj); -typedef HRESULT (__stdcall * Forward_DllCanUnloadNow_t)(); -typedef HRESULT (__stdcall * Forward_DllRegisterServer_t)(); -typedef HRESULT (__stdcall * Forward_DllUnregisterServer_t)(); - -Forward_DllGetClassObject_t Forward_DllGetClassObject = NULL; -Forward_DllCanUnloadNow_t Forward_DllCanUnloadNow = NULL; -Forward_DllRegisterServer_t Forward_DllRegisterServer = NULL; -Forward_DllUnregisterServer_t Forward_DllUnregisterServer = NULL; - -HMODULE hOoofilt = NULL; -HMODULE hThisLibrary = NULL; - -/* Truncates the file name from an absolute path but - leaves the final '\' */ -void PathTruncateFileName(TCHAR* path) -{ - TCHAR* p = path + lstrlen(path); - while (*p != _T('\\')) p--; - p++; - *p = 0; -} - -void Init() -{ - if (Forward_DllGetClassObject == NULL) - { - TCHAR buff[MAX_PATH]; - GetModuleFileName(hThisLibrary, buff, (sizeof(buff)/sizeof(TCHAR))); - PathTruncateFileName(buff); - - lstrcat(buff, MODULE_NAME_FILTER); - - hOoofilt = LoadLibraryEx(buff, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); - - if (hOoofilt) - { - Forward_DllGetClassObject = reinterpret_cast( - GetProcAddress(hOoofilt, "DllGetClassObject")); - Forward_DllCanUnloadNow = reinterpret_cast( - GetProcAddress(hOoofilt, "DllCanUnloadNow")); - Forward_DllRegisterServer = reinterpret_cast( - GetProcAddress(hOoofilt, "DllRegisterServer")); - Forward_DllUnregisterServer = reinterpret_cast( - GetProcAddress(hOoofilt, "DllUnregisterServer")); - } - } -} - -extern "C" BOOL WINAPI DllMain(HMODULE hInstance, DWORD fdwReason, LPVOID /*lpvReserved*/) -{ - switch (fdwReason) - { - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls( hInstance ); - hThisLibrary = hInstance; - break; - case DLL_PROCESS_DETACH: - if (hOoofilt) - FreeLibrary(hOoofilt); - break; - default: - break; - } - return TRUE; -} - -extern "C" HRESULT __stdcall DllGetClassObject(REFCLSID cid, REFIID iid, void** ppvObj) -{ - Init(); - - if (Forward_DllGetClassObject) - return Forward_DllGetClassObject(cid, iid, ppvObj); - else - return E_FAIL; -} - -extern "C" HRESULT __stdcall DllCanUnloadNow() -{ - Init(); - - if (Forward_DllCanUnloadNow) - return Forward_DllCanUnloadNow(); - else - return E_FAIL; -} - -extern "C" HRESULT __stdcall DllRegisterServer() -{ - Init(); - if (Forward_DllRegisterServer) - return Forward_DllRegisterServer(); - else - return E_FAIL; -} - -extern "C" HRESULT __stdcall DllUnregisterServer() -{ - Init(); - - if (Forward_DllUnregisterServer) - return Forward_DllUnregisterServer(); - else - return E_FAIL; -} -- cgit From 66e9fff8d67cfbea50eb84badf1340e558600649 Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Fri, 29 Jan 2010 15:26:36 +0100 Subject: dv17: #i70994#: Added missing dependency for the property hdl in build.lst --- shell/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/prj/build.lst b/shell/prj/build.lst index 31eb4a9fdc3f..902db53d5ea1 100755 --- a/shell/prj/build.lst +++ b/shell/prj/build.lst @@ -23,7 +23,7 @@ sl shell\source\win32\shlxthandler\propsheets nmake - w sl_win32_shlx sl shell\source\win32\shlxthandler\infotips nmake - w sl_win32_shlxthandler_infotips sl_inc NULL sl shell\source\win32\shlxthandler\columninfo nmake - w sl_win32_shlxthandler_columninfo sl_inc NULL sl shell\source\win32\shlxthandler\thumbviewer nmake - w sl_win32_shlxthandler_thumbviewer sl_inc NULL -sl shell\source\win32\shlxthandler\prophdl nmake - w sl_win32_shlxthandler_prophdl sl_inc NULL +sl shell\source\win32\shlxthandler\prophdl nmake - w sl_win32_shlxthandler_prophdl sl_win32_shlxthandler_ooofilt.w sl_inc NULL sl shell\source\win32\shlxthandler\ooofilt nmake - w sl_win32_shlxthandler_ooofilt sl_all_zipfile.w sl_all_ooofilereader.w sl_win32_shlxthandler_util.w sl_all sl_inc NULL sl shell\source\win32\shlxthandler nmake - w sl_win32_shlxthandler sl_win32_lngconv.w sl_win32_shlxthandler_res.w sl_win32_shlxthandler_util.w sl_all_zipfile.w sl_all_ooofilereader.w sl_win32_shlxthandler_propsheets.w sl_win32_shlxthandler_infotips.w sl_win32_shlxthandler_columninfo.w sl_win32_shlxthandler_thumbviewer.w sl_win32_shlxthandler_prophdl.w sl_inc sl_win32_shlxthandler_ooofilt.w NULL sl shell\source\backends\localebe nmake - all sl_backends_localebe sl_inc NULL -- cgit From ec0ee57607a1e8a800bb4809a0be6921df1f2e19 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 29 Jan 2010 17:01:54 +0100 Subject: sb118: #i108776# changed addsym.awk to also export STLport num_put symbols, and simplified it by requiring that first section is labeled UDK_3_0_0; adapted map files accordingly, replacing many individual ones with solenv/src templates --- shell/source/backends/desktopbe/exports.map | 10 ---------- shell/source/backends/desktopbe/makefile.mk | 2 +- shell/source/backends/gconfbe/exports.map | 10 ---------- shell/source/backends/gconfbe/makefile.mk | 2 +- shell/source/backends/kde4be/exports.map | 10 ---------- shell/source/backends/kde4be/makefile.mk | 2 +- shell/source/backends/kdebe/exports.map | 10 ---------- shell/source/backends/kdebe/makefile.mk | 2 +- shell/source/backends/localebe/exports.map | 10 ---------- shell/source/backends/localebe/makefile.mk | 2 +- shell/source/backends/macbe/exports.map | 10 ---------- shell/source/backends/macbe/makefile.mk | 2 +- shell/source/backends/wininetbe/exports.map | 10 ---------- shell/source/backends/wininetbe/makefile.mk | 2 +- shell/source/cmdmail/exports.map | 10 ---------- shell/source/cmdmail/makefile.mk | 2 +- shell/source/unix/exec/exports.map | 10 ---------- shell/source/unix/exec/makefile.mk | 2 +- shell/source/unix/sysshell/recfile.map | 2 +- 19 files changed, 10 insertions(+), 100 deletions(-) delete mode 100644 shell/source/backends/desktopbe/exports.map delete mode 100644 shell/source/backends/gconfbe/exports.map delete mode 100644 shell/source/backends/kde4be/exports.map delete mode 100644 shell/source/backends/kdebe/exports.map delete mode 100644 shell/source/backends/localebe/exports.map delete mode 100644 shell/source/backends/macbe/exports.map delete mode 100644 shell/source/backends/wininetbe/exports.map delete mode 100644 shell/source/cmdmail/exports.map delete mode 100644 shell/source/unix/exec/exports.map (limited to 'shell') diff --git a/shell/source/backends/desktopbe/exports.map b/shell/source/backends/desktopbe/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/shell/source/backends/desktopbe/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/desktopbe/makefile.mk b/shell/source/backends/desktopbe/makefile.mk index b6bcd3d95905..a8f4270b9c8f 100644 --- a/shell/source/backends/desktopbe/makefile.mk +++ b/shell/source/backends/desktopbe/makefile.mk @@ -66,7 +66,7 @@ SHL1STDLIBS= \ $(CPPULIB) \ $(SALLIB) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/backends/gconfbe/exports.map b/shell/source/backends/gconfbe/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/shell/source/backends/gconfbe/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/gconfbe/makefile.mk b/shell/source/backends/gconfbe/makefile.mk index 472db4b244a3..1eddb6a843fb 100644 --- a/shell/source/backends/gconfbe/makefile.mk +++ b/shell/source/backends/gconfbe/makefile.mk @@ -86,7 +86,7 @@ SHL1STDLIBS= \ SHL1STDLIBS+=$(PKGCONFIG_LIBS) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/backends/kde4be/exports.map b/shell/source/backends/kde4be/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/shell/source/backends/kde4be/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/kde4be/makefile.mk b/shell/source/backends/kde4be/makefile.mk index 6f92762e5ae1..e20867033265 100644 --- a/shell/source/backends/kde4be/makefile.mk +++ b/shell/source/backends/kde4be/makefile.mk @@ -83,7 +83,7 @@ SHL1STDLIBS= \ $(SALLIB) \ $(KDE4_LIBS) -lkio -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/backends/kdebe/exports.map b/shell/source/backends/kdebe/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/shell/source/backends/kdebe/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/kdebe/makefile.mk b/shell/source/backends/kdebe/makefile.mk index 6159be6be151..80259409eb24 100644 --- a/shell/source/backends/kdebe/makefile.mk +++ b/shell/source/backends/kdebe/makefile.mk @@ -83,7 +83,7 @@ SHL1STDLIBS= \ $(CPPULIB) \ $(SALLIB) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/backends/localebe/exports.map b/shell/source/backends/localebe/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/shell/source/backends/localebe/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/localebe/makefile.mk b/shell/source/backends/localebe/makefile.mk index 76767264a831..5ad7dc153b57 100644 --- a/shell/source/backends/localebe/makefile.mk +++ b/shell/source/backends/localebe/makefile.mk @@ -67,7 +67,7 @@ SHL1STDLIBS= \ SHL1STDLIBS+= -framework CoreServices .ENDIF -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/backends/macbe/exports.map b/shell/source/backends/macbe/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/shell/source/backends/macbe/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/macbe/makefile.mk b/shell/source/backends/macbe/makefile.mk index c8f6891d6f87..654fb8a8eaf6 100644 --- a/shell/source/backends/macbe/makefile.mk +++ b/shell/source/backends/macbe/makefile.mk @@ -72,7 +72,7 @@ SHL1STDLIBS= \ $(SALLIB) \ -framework Cocoa -framework SystemConfiguration -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/backends/wininetbe/exports.map b/shell/source/backends/wininetbe/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/shell/source/backends/wininetbe/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/backends/wininetbe/makefile.mk b/shell/source/backends/wininetbe/makefile.mk index be43ecaded36..0b423d4b91fc 100644 --- a/shell/source/backends/wininetbe/makefile.mk +++ b/shell/source/backends/wininetbe/makefile.mk @@ -63,7 +63,7 @@ SHL1STDLIBS= \ $(CPPULIB) \ $(SALLIB) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/cmdmail/exports.map b/shell/source/cmdmail/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/shell/source/cmdmail/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/cmdmail/makefile.mk b/shell/source/cmdmail/makefile.mk index 6b83d74842f2..d42afc376629 100644 --- a/shell/source/cmdmail/makefile.mk +++ b/shell/source/cmdmail/makefile.mk @@ -57,7 +57,7 @@ SHL1STDLIBS=$(CPPULIB)\ $(CPPUHELPERLIB)\ $(SALLIB) -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/unix/exec/exports.map b/shell/source/unix/exec/exports.map deleted file mode 100644 index ba501f9ae076..000000000000 --- a/shell/source/unix/exec/exports.map +++ /dev/null @@ -1,10 +0,0 @@ -UDK_3_0_0 { - global: - GetVersionInfo; - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -}; diff --git a/shell/source/unix/exec/makefile.mk b/shell/source/unix/exec/makefile.mk index e23e249e0835..1ffcfcb1856d 100644 --- a/shell/source/unix/exec/makefile.mk +++ b/shell/source/unix/exec/makefile.mk @@ -60,7 +60,7 @@ SHL1IMPLIB=i$(TARGET) SHL1IMPLIB= .ENDIF -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/shell/source/unix/sysshell/recfile.map b/shell/source/unix/sysshell/recfile.map index fa87f39161aa..7e454f111896 100755 --- a/shell/source/unix/sysshell/recfile.map +++ b/shell/source/unix/sysshell/recfile.map @@ -1,4 +1,4 @@ -RECFILE_1_0_0 { +UDK_3_0_0 { global: add_to_recently_used_file_list; local: -- cgit From 9052c35863c67ed02f7f2129a3262dadfd74d843 Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 3 Feb 2010 13:43:59 +0100 Subject: sb118: additional main -> SAL_MAIN adaptions (to ensure osl_setCommandArgs is called) --- shell/source/tools/lngconvex/lngconvex.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/source/tools/lngconvex/lngconvex.cxx b/shell/source/tools/lngconvex/lngconvex.cxx index f605d6f340d9..0fa106a15aac 100644 --- a/shell/source/tools/lngconvex/lngconvex.cxx +++ b/shell/source/tools/lngconvex/lngconvex.cxx @@ -48,6 +48,7 @@ #include "osl/thread.h" #include "osl/process.h" #include "osl/file.hxx" +#include "sal/main.h" #include "tools/config.hxx" #include "i18npool/mslangid.hxx" @@ -568,7 +569,7 @@ void inflate_rc_template_to_file( #define RC_HEADER(c) MAKE_ABSOLUTE((c).get_arg("-rch")) #define RC_FOOTER(c) MAKE_ABSOLUTE((c).get_arg("-rcf")) -int main(int argc, char* argv[]) +SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { try { -- cgit From 82b1d381cd7000675522fb2a075dd34545a1bbb2 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Fri, 12 Feb 2010 15:01:35 +0100 Subject: changefileheader2: #i109125#: change source file copyright notice from Sun Microsystems to Oracle; remove CVS style keywords (RCSfile, Revision) --- shell/inc/internal/basereader.hxx | 5 +---- shell/inc/internal/columninfo.hxx | 5 +---- shell/inc/internal/config.hxx | 5 +---- shell/inc/internal/contentreader.hxx | 5 +---- shell/inc/internal/dbgmacros.hxx | 5 +---- shell/inc/internal/fileextensions.hxx | 5 +---- shell/inc/internal/global.hxx | 5 +---- shell/inc/internal/i_xml_parser_event_handler.hxx | 5 +---- shell/inc/internal/infotips.hxx | 5 +---- shell/inc/internal/iso8601_converter.hxx | 5 +---- shell/inc/internal/metainforeader.hxx | 5 +---- shell/inc/internal/propsheets.hxx | 5 +---- shell/inc/internal/registry.hxx | 5 +---- shell/inc/internal/shlxthdl.hxx | 5 +---- shell/inc/internal/thumbviewer.hxx | 5 +---- shell/inc/internal/types.hxx | 5 +---- shell/inc/internal/utilities.hxx | 5 +---- shell/inc/internal/xml_parser.hxx | 5 +---- shell/inc/internal/zipfile.hxx | 5 +---- shell/inc/kde_headers.h | 5 +---- shell/inc/makefile.mk | 6 +----- shell/inc/pch/precompiled_shell.cxx | 5 +---- shell/inc/pch/precompiled_shell.hxx | 5 +---- shell/qa/i_xml_parser_event_handler.hxx | 5 +---- shell/qa/makefile.mk | 8 ++------ shell/qa/recent_docs.cxx | 5 +---- shell/source/all/makefile.mk | 6 +----- shell/source/all/ooofilereader/autostyletag.cxx | 5 +---- shell/source/all/ooofilereader/autostyletag.hxx | 5 +---- shell/source/all/ooofilereader/basereader.cxx | 5 +---- shell/source/all/ooofilereader/contentreader.cxx | 5 +---- shell/source/all/ooofilereader/dummytag.hxx | 5 +---- shell/source/all/ooofilereader/itag.hxx | 5 +---- shell/source/all/ooofilereader/keywordstag.cxx | 5 +---- shell/source/all/ooofilereader/keywordstag.hxx | 5 +---- shell/source/all/ooofilereader/makefile.mk | 6 +----- shell/source/all/ooofilereader/metainforeader.cxx | 5 +---- shell/source/all/ooofilereader/simpletag.cxx | 5 +---- shell/source/all/ooofilereader/simpletag.hxx | 5 +---- shell/source/all/xml_parser.cxx | 5 +---- shell/source/all/zipfile/makefile.mk | 6 +----- shell/source/all/zipfile/zipexcptn.cxx | 5 +---- shell/source/all/zipfile/zipfile.cxx | 5 +---- shell/source/backends/desktopbe/desktopbecdef.cxx | 5 +---- shell/source/backends/desktopbe/makefile.mk | 6 +----- shell/source/backends/gconfbe/gconfbackend.cxx | 5 +---- shell/source/backends/gconfbe/gconfbackend.hxx | 5 +---- shell/source/backends/gconfbe/gconfbecdef.cxx | 5 +---- shell/source/backends/gconfbe/gconflayer.cxx | 5 +---- shell/source/backends/gconfbe/makefile.mk | 6 +----- shell/source/backends/gconfbe/orbit.h | 5 +---- shell/source/backends/kde4be/kde4backend.cxx | 5 +---- shell/source/backends/kde4be/kde4backend.hxx | 5 +---- shell/source/backends/kde4be/kde4becdef.cxx | 5 +---- shell/source/backends/kde4be/kde4commonlayer.cxx | 5 +---- shell/source/backends/kde4be/kde4inetlayer.cxx | 5 +---- shell/source/backends/kde4be/kde4pathslayer.cxx | 5 +---- shell/source/backends/kde4be/kde4pathslayer.hxx | 5 +---- shell/source/backends/kde4be/kde4vcllayer.cxx | 5 +---- shell/source/backends/kde4be/makefile.mk | 6 +----- shell/source/backends/kdebe/kdebackend.cxx | 5 +---- shell/source/backends/kdebe/kdebackend.hxx | 5 +---- shell/source/backends/kdebe/kdebecdef.cxx | 5 +---- shell/source/backends/kdebe/kdecommonlayer.cxx | 5 +---- shell/source/backends/kdebe/kdeinetlayer.cxx | 5 +---- shell/source/backends/kdebe/kdepathslayer.cxx | 5 +---- shell/source/backends/kdebe/kdepathslayer.hxx | 5 +---- shell/source/backends/kdebe/kdevcllayer.cxx | 5 +---- shell/source/backends/kdebe/makefile.mk | 6 +----- shell/source/backends/localebe/localebackend.cxx | 5 +---- shell/source/backends/localebe/localebackend.hxx | 5 +---- shell/source/backends/localebe/localebecdef.cxx | 5 +---- shell/source/backends/localebe/localelayer.cxx | 5 +---- shell/source/backends/localebe/makefile.mk | 6 +----- shell/source/backends/macbe/macbackend.cxx | 5 +---- shell/source/backends/macbe/macbackend.hxx | 5 +---- shell/source/backends/macbe/macbecdef.cxx | 5 +---- shell/source/backends/macbe/macbelayer.cxx | 5 +---- shell/source/backends/macbe/macbelayer.hxx | 5 +---- shell/source/backends/macbe/makefile.mk | 6 +----- shell/source/backends/wininetbe/makefile.mk | 6 +----- shell/source/backends/wininetbe/wininetbackend.cxx | 5 +---- shell/source/backends/wininetbe/wininetbackend.hxx | 5 +---- shell/source/backends/wininetbe/wininetbecdef.cxx | 5 +---- shell/source/backends/wininetbe/wininetlayer.cxx | 5 +---- shell/source/cmdmail/cmdmailentry.cxx | 5 +---- shell/source/cmdmail/cmdmailmsg.cxx | 5 +---- shell/source/cmdmail/cmdmailmsg.hxx | 5 +---- shell/source/cmdmail/cmdmailsuppl.cxx | 5 +---- shell/source/cmdmail/cmdmailsuppl.hxx | 5 +---- shell/source/cmdmail/makefile.mk | 6 +----- shell/source/tools/lngconvex/cmdline.cxx | 5 +---- shell/source/tools/lngconvex/lngconvex.cxx | 5 +---- shell/source/tools/lngconvex/makefile.mk | 6 +----- shell/source/tools/regsvrex/makefile.mk | 6 +----- shell/source/tools/regsvrex/regsvrex.cxx | 5 +---- shell/source/unix/exec/makefile.mk | 6 +----- shell/source/unix/exec/shellexec.cxx | 5 +---- shell/source/unix/exec/shellexec.hxx | 5 +---- shell/source/unix/exec/shellexecentry.cxx | 5 +---- shell/source/unix/exec/urltest.cxx | 5 +---- shell/source/unix/misc/gnome-open-url.c | 5 +---- shell/source/unix/misc/makefile.mk | 6 +----- shell/source/unix/misc/open-url.c | 2 +- shell/source/unix/misc/senddoc.c | 2 +- shell/source/unix/misc/uri-encode.c | 5 +---- shell/source/unix/sysshell/makefile.mk | 6 +----- shell/source/unix/sysshell/recently_used_file.cxx | 5 +---- shell/source/unix/sysshell/recently_used_file.hxx | 5 +---- shell/source/unix/sysshell/recently_used_file_handler.cxx | 5 +---- shell/source/win32/SysShExec.cxx | 5 +---- shell/source/win32/SysShExec.hxx | 5 +---- shell/source/win32/SysShentry.cxx | 5 +---- shell/source/win32/makefile.mk | 6 +----- shell/source/win32/shlxthandler/classfactory.cxx | 5 +---- shell/source/win32/shlxthandler/classfactory.hxx | 5 +---- shell/source/win32/shlxthandler/columninfo/columninfo.cxx | 5 +---- shell/source/win32/shlxthandler/columninfo/makefile.mk | 6 +----- shell/source/win32/shlxthandler/infotips/infotips.cxx | 5 +---- shell/source/win32/shlxthandler/infotips/makefile.mk | 6 +----- shell/source/win32/shlxthandler/makefile.mk | 8 ++------ shell/source/win32/shlxthandler/ooofilt/makefile.mk | 6 +----- shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx | 5 +---- shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx | 5 +---- shell/source/win32/shlxthandler/ooofilt/propspec.cxx | 5 +---- shell/source/win32/shlxthandler/ooofilt/propspec.hxx | 5 +---- shell/source/win32/shlxthandler/ooofilt/proxy/makefile.mk | 6 +----- shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx | 5 +---- shell/source/win32/shlxthandler/propsheets/document_statistic.cxx | 5 +---- shell/source/win32/shlxthandler/propsheets/document_statistic.hxx | 5 +---- shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx | 5 +---- shell/source/win32/shlxthandler/propsheets/listviewbuilder.hxx | 5 +---- shell/source/win32/shlxthandler/propsheets/makefile.mk | 6 +----- shell/source/win32/shlxthandler/propsheets/propsheets.cxx | 5 +---- shell/source/win32/shlxthandler/res/makefile.mk | 6 +----- shell/source/win32/shlxthandler/shlxthdl.cxx | 5 +---- shell/source/win32/shlxthandler/thumbviewer/makefile.mk | 6 +----- shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx | 5 +---- shell/source/win32/shlxthandler/util/dbgmacros.cxx | 5 +---- shell/source/win32/shlxthandler/util/fileextensions.cxx | 5 +---- shell/source/win32/shlxthandler/util/iso8601_converter.cxx | 5 +---- shell/source/win32/shlxthandler/util/makefile.mk | 6 +----- shell/source/win32/shlxthandler/util/registry.cxx | 5 +---- shell/source/win32/shlxthandler/util/utilities.cxx | 5 +---- shell/source/win32/simplemail/makefile.mk | 6 +----- shell/source/win32/simplemail/senddoc.cxx | 5 +---- shell/source/win32/simplemail/simplemapi.cxx | 5 +---- shell/source/win32/simplemail/simplemapi.hxx | 5 +---- shell/source/win32/simplemail/smplmailclient.cxx | 5 +---- shell/source/win32/simplemail/smplmailclient.hxx | 5 +---- shell/source/win32/simplemail/smplmailentry.cxx | 5 +---- shell/source/win32/simplemail/smplmailmsg.cxx | 5 +---- shell/source/win32/simplemail/smplmailmsg.hxx | 5 +---- shell/source/win32/simplemail/smplmailsuppl.cxx | 5 +---- shell/source/win32/simplemail/smplmailsuppl.hxx | 5 +---- shell/source/win32/workbench/TestProxySet.cxx | 5 +---- shell/source/win32/workbench/TestSmplMail.cxx | 5 +---- shell/source/win32/workbench/TestSysShExec.cxx | 5 +---- shell/source/win32/workbench/makefile.mk | 6 +----- 159 files changed, 161 insertions(+), 662 deletions(-) (limited to 'shell') diff --git a/shell/inc/internal/basereader.hxx b/shell/inc/internal/basereader.hxx index 4da8b7fa95be..8aef93528806 100644 --- a/shell/inc/internal/basereader.hxx +++ b/shell/inc/internal/basereader.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: basereader.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/columninfo.hxx b/shell/inc/internal/columninfo.hxx index e08babffe04b..4e392dd76f4d 100644 --- a/shell/inc/internal/columninfo.hxx +++ b/shell/inc/internal/columninfo.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: columninfo.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/config.hxx b/shell/inc/internal/config.hxx index e9b3e0fd59ac..3c10e7db26a7 100644 --- a/shell/inc/internal/config.hxx +++ b/shell/inc/internal/config.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: config.hxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/contentreader.hxx b/shell/inc/internal/contentreader.hxx index d8b2d77d28c0..b4ed30970c46 100644 --- a/shell/inc/internal/contentreader.hxx +++ b/shell/inc/internal/contentreader.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: contentreader.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/dbgmacros.hxx b/shell/inc/internal/dbgmacros.hxx index b7a0c2eab747..fbab023664ac 100644 --- a/shell/inc/internal/dbgmacros.hxx +++ b/shell/inc/internal/dbgmacros.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dbgmacros.hxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/fileextensions.hxx b/shell/inc/internal/fileextensions.hxx index e23e30a665a3..48d6f283ea1d 100644 --- a/shell/inc/internal/fileextensions.hxx +++ b/shell/inc/internal/fileextensions.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: fileextensions.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/global.hxx b/shell/inc/internal/global.hxx index a4596b428e69..ebf3305934bd 100644 --- a/shell/inc/internal/global.hxx +++ b/shell/inc/internal/global.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: global.hxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/i_xml_parser_event_handler.hxx b/shell/inc/internal/i_xml_parser_event_handler.hxx index 72b854ded738..5164f2236522 100644 --- a/shell/inc/internal/i_xml_parser_event_handler.hxx +++ b/shell/inc/internal/i_xml_parser_event_handler.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: i_xml_parser_event_handler.hxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/infotips.hxx b/shell/inc/internal/infotips.hxx index eb1c148411ea..8193615a505f 100644 --- a/shell/inc/internal/infotips.hxx +++ b/shell/inc/internal/infotips.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: infotips.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/iso8601_converter.hxx b/shell/inc/internal/iso8601_converter.hxx index ad4ddb08189e..f7f00bbe1c53 100644 --- a/shell/inc/internal/iso8601_converter.hxx +++ b/shell/inc/internal/iso8601_converter.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: iso8601_converter.hxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/metainforeader.hxx b/shell/inc/internal/metainforeader.hxx index 1e004b5a3727..e936acc71d41 100644 --- a/shell/inc/internal/metainforeader.hxx +++ b/shell/inc/internal/metainforeader.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: metainforeader.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/propsheets.hxx b/shell/inc/internal/propsheets.hxx index 0ebafcf0aa3a..0159379e3127 100644 --- a/shell/inc/internal/propsheets.hxx +++ b/shell/inc/internal/propsheets.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: propsheets.hxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/registry.hxx b/shell/inc/internal/registry.hxx index 81ccdc157305..25f1749a6a3c 100644 --- a/shell/inc/internal/registry.hxx +++ b/shell/inc/internal/registry.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: registry.hxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/shlxthdl.hxx b/shell/inc/internal/shlxthdl.hxx index 782212f6dc5b..b13a142b6e2c 100644 --- a/shell/inc/internal/shlxthdl.hxx +++ b/shell/inc/internal/shlxthdl.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: shlxthdl.hxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/thumbviewer.hxx b/shell/inc/internal/thumbviewer.hxx index 174048ff0cca..8c4a8979a181 100644 --- a/shell/inc/internal/thumbviewer.hxx +++ b/shell/inc/internal/thumbviewer.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: thumbviewer.hxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/types.hxx b/shell/inc/internal/types.hxx index 730263060041..d636595537e4 100644 --- a/shell/inc/internal/types.hxx +++ b/shell/inc/internal/types.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: types.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/utilities.hxx b/shell/inc/internal/utilities.hxx index 4da6d6ce1eca..4701a2682446 100644 --- a/shell/inc/internal/utilities.hxx +++ b/shell/inc/internal/utilities.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: utilities.hxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/xml_parser.hxx b/shell/inc/internal/xml_parser.hxx index ff9842c18208..57e8a4fd6d88 100644 --- a/shell/inc/internal/xml_parser.hxx +++ b/shell/inc/internal/xml_parser.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xml_parser.hxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/internal/zipfile.hxx b/shell/inc/internal/zipfile.hxx index 2a860bb4c6cd..d349f0294d11 100644 --- a/shell/inc/internal/zipfile.hxx +++ b/shell/inc/internal/zipfile.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: zipfile.hxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/kde_headers.h b/shell/inc/kde_headers.h index ccbffc99cb99..772a5382fe81 100644 --- a/shell/inc/kde_headers.h +++ b/shell/inc/kde_headers.h @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kde_headers.h,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/makefile.mk b/shell/inc/makefile.mk index ae070770d882..c297cb4f77e9 100644 --- a/shell/inc/makefile.mk +++ b/shell/inc/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.3 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/pch/precompiled_shell.cxx b/shell/inc/pch/precompiled_shell.cxx index 76b567ae566e..778ff4e4578e 100644 --- a/shell/inc/pch/precompiled_shell.cxx +++ b/shell/inc/pch/precompiled_shell.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: precompiled_shell.cxx,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/inc/pch/precompiled_shell.hxx b/shell/inc/pch/precompiled_shell.hxx index 8371985ebd82..a3ea4e27b4bb 100644 --- a/shell/inc/pch/precompiled_shell.hxx +++ b/shell/inc/pch/precompiled_shell.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: precompiled_shell.hxx,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/qa/i_xml_parser_event_handler.hxx b/shell/qa/i_xml_parser_event_handler.hxx index d95493fdd25f..1758e2075b55 100644 --- a/shell/qa/i_xml_parser_event_handler.hxx +++ b/shell/qa/i_xml_parser_event_handler.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: i_xml_parser_event_handler.hxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/qa/makefile.mk b/shell/qa/makefile.mk index e935abd1c0d6..a9047f97cf83 100755 --- a/shell/qa/makefile.mk +++ b/shell/qa/makefile.mk @@ -1,15 +1,11 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.4 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/qa/recent_docs.cxx b/shell/qa/recent_docs.cxx index 5936c8c033b1..b4408e2f7737 100755 --- a/shell/qa/recent_docs.cxx +++ b/shell/qa/recent_docs.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: recent_docs.cxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/makefile.mk b/shell/source/all/makefile.mk index 623aad6d69c1..2c5e4d3359ec 100755 --- a/shell/source/all/makefile.mk +++ b/shell/source/all/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.9 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/ooofilereader/autostyletag.cxx b/shell/source/all/ooofilereader/autostyletag.cxx index 57084491f6f1..6d51259345df 100644 --- a/shell/source/all/ooofilereader/autostyletag.cxx +++ b/shell/source/all/ooofilereader/autostyletag.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: autostyletag.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/ooofilereader/autostyletag.hxx b/shell/source/all/ooofilereader/autostyletag.hxx index 2b51f19125a4..3957dd1b09b8 100644 --- a/shell/source/all/ooofilereader/autostyletag.hxx +++ b/shell/source/all/ooofilereader/autostyletag.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: autostyletag.hxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/ooofilereader/basereader.cxx b/shell/source/all/ooofilereader/basereader.cxx index d9be6740f057..17c35268680e 100644 --- a/shell/source/all/ooofilereader/basereader.cxx +++ b/shell/source/all/ooofilereader/basereader.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: basereader.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/ooofilereader/contentreader.cxx b/shell/source/all/ooofilereader/contentreader.cxx index 111647e70ad6..9cb841eef0fc 100644 --- a/shell/source/all/ooofilereader/contentreader.cxx +++ b/shell/source/all/ooofilereader/contentreader.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: contentreader.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/ooofilereader/dummytag.hxx b/shell/source/all/ooofilereader/dummytag.hxx index fe88a6142a18..cbd4382e84e3 100644 --- a/shell/source/all/ooofilereader/dummytag.hxx +++ b/shell/source/all/ooofilereader/dummytag.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dummytag.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/ooofilereader/itag.hxx b/shell/source/all/ooofilereader/itag.hxx index 074fb6fead75..97c09ed35b32 100644 --- a/shell/source/all/ooofilereader/itag.hxx +++ b/shell/source/all/ooofilereader/itag.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: itag.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/ooofilereader/keywordstag.cxx b/shell/source/all/ooofilereader/keywordstag.cxx index 9ed2a304334f..2ffccfddaff2 100644 --- a/shell/source/all/ooofilereader/keywordstag.cxx +++ b/shell/source/all/ooofilereader/keywordstag.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: keywordstag.cxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/ooofilereader/keywordstag.hxx b/shell/source/all/ooofilereader/keywordstag.hxx index 775388c55401..634810febd31 100644 --- a/shell/source/all/ooofilereader/keywordstag.hxx +++ b/shell/source/all/ooofilereader/keywordstag.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: keywordstag.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/ooofilereader/makefile.mk b/shell/source/all/ooofilereader/makefile.mk index b893db45d849..4dcea90b24c9 100644 --- a/shell/source/all/ooofilereader/makefile.mk +++ b/shell/source/all/ooofilereader/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.7 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/ooofilereader/metainforeader.cxx b/shell/source/all/ooofilereader/metainforeader.cxx index cec17b59d3c9..ba61c031660c 100644 --- a/shell/source/all/ooofilereader/metainforeader.cxx +++ b/shell/source/all/ooofilereader/metainforeader.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: metainforeader.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/ooofilereader/simpletag.cxx b/shell/source/all/ooofilereader/simpletag.cxx index 646cf136002e..8fad2dc618ed 100644 --- a/shell/source/all/ooofilereader/simpletag.cxx +++ b/shell/source/all/ooofilereader/simpletag.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: simpletag.cxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/ooofilereader/simpletag.hxx b/shell/source/all/ooofilereader/simpletag.hxx index 394af4db7c1a..8e251c4329ab 100644 --- a/shell/source/all/ooofilereader/simpletag.hxx +++ b/shell/source/all/ooofilereader/simpletag.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: simpletag.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/xml_parser.cxx b/shell/source/all/xml_parser.cxx index 046397f64b8b..b7f73d2404a8 100644 --- a/shell/source/all/xml_parser.cxx +++ b/shell/source/all/xml_parser.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xml_parser.cxx,v $ - * $Revision: 1.10 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/zipfile/makefile.mk b/shell/source/all/zipfile/makefile.mk index 9f294ce7aad0..2b77e5c3ae2b 100644 --- a/shell/source/all/zipfile/makefile.mk +++ b/shell/source/all/zipfile/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.5 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/zipfile/zipexcptn.cxx b/shell/source/all/zipfile/zipexcptn.cxx index 5602322c0aaf..fcbbf54382bf 100644 --- a/shell/source/all/zipfile/zipexcptn.cxx +++ b/shell/source/all/zipfile/zipexcptn.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: zipexcptn.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/all/zipfile/zipfile.cxx b/shell/source/all/zipfile/zipfile.cxx index 06fb6cc934d3..d4ff929c7788 100644 --- a/shell/source/all/zipfile/zipfile.cxx +++ b/shell/source/all/zipfile/zipfile.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: zipfile.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/desktopbe/desktopbecdef.cxx b/shell/source/backends/desktopbe/desktopbecdef.cxx index 2ae366bfcc94..ab292cf1e5bb 100644 --- a/shell/source/backends/desktopbe/desktopbecdef.cxx +++ b/shell/source/backends/desktopbe/desktopbecdef.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: desktopbecdef.cxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/desktopbe/makefile.mk b/shell/source/backends/desktopbe/makefile.mk index b6bcd3d95905..dd0afd88fe13 100644 --- a/shell/source/backends/desktopbe/makefile.mk +++ b/shell/source/backends/desktopbe/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.3 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/gconfbe/gconfbackend.cxx b/shell/source/backends/gconfbe/gconfbackend.cxx index 3c5b5eb86ad6..15d2ee654e8e 100644 --- a/shell/source/backends/gconfbe/gconfbackend.cxx +++ b/shell/source/backends/gconfbe/gconfbackend.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: gconfbackend.cxx,v $ - * $Revision: 1.15 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/gconfbe/gconfbackend.hxx b/shell/source/backends/gconfbe/gconfbackend.hxx index 185577ec0265..849f7097d2c3 100644 --- a/shell/source/backends/gconfbe/gconfbackend.hxx +++ b/shell/source/backends/gconfbe/gconfbackend.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: gconfbackend.hxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/gconfbe/gconfbecdef.cxx b/shell/source/backends/gconfbe/gconfbecdef.cxx index ed20759faa7e..91714cd9cafc 100644 --- a/shell/source/backends/gconfbe/gconfbecdef.cxx +++ b/shell/source/backends/gconfbe/gconfbecdef.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: gconfbecdef.cxx,v $ - * $Revision: 1.11 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/gconfbe/gconflayer.cxx b/shell/source/backends/gconfbe/gconflayer.cxx index 9d7ac2e8e47b..67fbb3ea2750 100644 --- a/shell/source/backends/gconfbe/gconflayer.cxx +++ b/shell/source/backends/gconfbe/gconflayer.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: gconflayer.cxx,v $ - * $Revision: 1.15 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/gconfbe/makefile.mk b/shell/source/backends/gconfbe/makefile.mk index 472db4b244a3..9a17d3aeaeb5 100644 --- a/shell/source/backends/gconfbe/makefile.mk +++ b/shell/source/backends/gconfbe/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.19 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/gconfbe/orbit.h b/shell/source/backends/gconfbe/orbit.h index 4ddd26a03a89..2858e8100dc8 100644 --- a/shell/source/backends/gconfbe/orbit.h +++ b/shell/source/backends/gconfbe/orbit.h @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: orbit.h,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kde4be/kde4backend.cxx b/shell/source/backends/kde4be/kde4backend.cxx index 7eb093bf7217..28cfcd180d05 100644 --- a/shell/source/backends/kde4be/kde4backend.cxx +++ b/shell/source/backends/kde4be/kde4backend.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kde4backend.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kde4be/kde4backend.hxx b/shell/source/backends/kde4be/kde4backend.hxx index 01599c41a74d..ed0658c07c25 100644 --- a/shell/source/backends/kde4be/kde4backend.hxx +++ b/shell/source/backends/kde4be/kde4backend.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kde4backend.hxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kde4be/kde4becdef.cxx b/shell/source/backends/kde4be/kde4becdef.cxx index da0d22ead22e..189d7ff80d61 100644 --- a/shell/source/backends/kde4be/kde4becdef.cxx +++ b/shell/source/backends/kde4be/kde4becdef.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kde4becdef.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kde4be/kde4commonlayer.cxx b/shell/source/backends/kde4be/kde4commonlayer.cxx index 1ce844672225..c0d1cbf70b43 100644 --- a/shell/source/backends/kde4be/kde4commonlayer.cxx +++ b/shell/source/backends/kde4be/kde4commonlayer.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kde4commonlayer.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kde4be/kde4inetlayer.cxx b/shell/source/backends/kde4be/kde4inetlayer.cxx index bc661a093fb7..7382d7a089b0 100644 --- a/shell/source/backends/kde4be/kde4inetlayer.cxx +++ b/shell/source/backends/kde4be/kde4inetlayer.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kde4inetlayer.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kde4be/kde4pathslayer.cxx b/shell/source/backends/kde4be/kde4pathslayer.cxx index 2511d0b57405..cf6eb052d0bb 100644 --- a/shell/source/backends/kde4be/kde4pathslayer.cxx +++ b/shell/source/backends/kde4be/kde4pathslayer.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kde4pathslayer.cxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kde4be/kde4pathslayer.hxx b/shell/source/backends/kde4be/kde4pathslayer.hxx index 40d31a73c4f9..bc09b0f027db 100644 --- a/shell/source/backends/kde4be/kde4pathslayer.hxx +++ b/shell/source/backends/kde4be/kde4pathslayer.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kde4pathslayer.hxx,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kde4be/kde4vcllayer.cxx b/shell/source/backends/kde4be/kde4vcllayer.cxx index 780c3e4e7ce1..a3a9f32dba74 100644 --- a/shell/source/backends/kde4be/kde4vcllayer.cxx +++ b/shell/source/backends/kde4be/kde4vcllayer.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kde4vcllayer.cxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kde4be/makefile.mk b/shell/source/backends/kde4be/makefile.mk index 6f92762e5ae1..cc7a51ab0f3c 100644 --- a/shell/source/backends/kde4be/makefile.mk +++ b/shell/source/backends/kde4be/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.5 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kdebe/kdebackend.cxx b/shell/source/backends/kdebe/kdebackend.cxx index 5f1ab4e7bc0d..edf88212a9af 100644 --- a/shell/source/backends/kdebe/kdebackend.cxx +++ b/shell/source/backends/kdebe/kdebackend.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kdebackend.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kdebe/kdebackend.hxx b/shell/source/backends/kdebe/kdebackend.hxx index 57cb2338a5bf..23e8d148bb33 100644 --- a/shell/source/backends/kdebe/kdebackend.hxx +++ b/shell/source/backends/kdebe/kdebackend.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kdebackend.hxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kdebe/kdebecdef.cxx b/shell/source/backends/kdebe/kdebecdef.cxx index c4995e6e81c1..2201a7f27dda 100644 --- a/shell/source/backends/kdebe/kdebecdef.cxx +++ b/shell/source/backends/kdebe/kdebecdef.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kdebecdef.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kdebe/kdecommonlayer.cxx b/shell/source/backends/kdebe/kdecommonlayer.cxx index 44592e893342..6e8d0d630e04 100644 --- a/shell/source/backends/kdebe/kdecommonlayer.cxx +++ b/shell/source/backends/kdebe/kdecommonlayer.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kdecommonlayer.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kdebe/kdeinetlayer.cxx b/shell/source/backends/kdebe/kdeinetlayer.cxx index 78cc0f4ba06d..231204191663 100644 --- a/shell/source/backends/kdebe/kdeinetlayer.cxx +++ b/shell/source/backends/kdebe/kdeinetlayer.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kdeinetlayer.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kdebe/kdepathslayer.cxx b/shell/source/backends/kdebe/kdepathslayer.cxx index c60a7fff040a..29d779cfdfc1 100644 --- a/shell/source/backends/kdebe/kdepathslayer.cxx +++ b/shell/source/backends/kdebe/kdepathslayer.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kdepathslayer.cxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kdebe/kdepathslayer.hxx b/shell/source/backends/kdebe/kdepathslayer.hxx index 5a3b365be277..5ee289aeb68a 100644 --- a/shell/source/backends/kdebe/kdepathslayer.hxx +++ b/shell/source/backends/kdebe/kdepathslayer.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kdepathslayer.hxx,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kdebe/kdevcllayer.cxx b/shell/source/backends/kdebe/kdevcllayer.cxx index f6c5368acfec..3fa08b46ff33 100644 --- a/shell/source/backends/kdebe/kdevcllayer.cxx +++ b/shell/source/backends/kdebe/kdevcllayer.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: kdevcllayer.cxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/kdebe/makefile.mk b/shell/source/backends/kdebe/makefile.mk index 6159be6be151..7bf8d53568b5 100644 --- a/shell/source/backends/kdebe/makefile.mk +++ b/shell/source/backends/kdebe/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.5 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx index 1496f426d3c6..c67d4f836d9e 100644 --- a/shell/source/backends/localebe/localebackend.cxx +++ b/shell/source/backends/localebe/localebackend.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: localebackend.cxx,v $ - * $Revision: 1.12 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/localebe/localebackend.hxx b/shell/source/backends/localebe/localebackend.hxx index 7546a0385cf0..bfb89c6d06da 100644 --- a/shell/source/backends/localebe/localebackend.hxx +++ b/shell/source/backends/localebe/localebackend.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: localebackend.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/localebe/localebecdef.cxx b/shell/source/backends/localebe/localebecdef.cxx index c9211543a283..e5ff65318200 100644 --- a/shell/source/backends/localebe/localebecdef.cxx +++ b/shell/source/backends/localebe/localebecdef.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: localebecdef.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/localebe/localelayer.cxx b/shell/source/backends/localebe/localelayer.cxx index 74253e9d9187..a353478ac836 100644 --- a/shell/source/backends/localebe/localelayer.cxx +++ b/shell/source/backends/localebe/localelayer.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: localelayer.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/localebe/makefile.mk b/shell/source/backends/localebe/makefile.mk index 76767264a831..51a95344aa1f 100644 --- a/shell/source/backends/localebe/makefile.mk +++ b/shell/source/backends/localebe/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.7 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/macbe/macbackend.cxx b/shell/source/backends/macbe/macbackend.cxx index 06589e4d6574..499696cea54c 100644 --- a/shell/source/backends/macbe/macbackend.cxx +++ b/shell/source/backends/macbe/macbackend.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: macbackend.cxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/macbe/macbackend.hxx b/shell/source/backends/macbe/macbackend.hxx index c25fe4296c0e..5c477d1a73e5 100644 --- a/shell/source/backends/macbe/macbackend.hxx +++ b/shell/source/backends/macbe/macbackend.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: macbackend.hxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/macbe/macbecdef.cxx b/shell/source/backends/macbe/macbecdef.cxx index 22698eb91ec5..82fae97dbdbe 100644 --- a/shell/source/backends/macbe/macbecdef.cxx +++ b/shell/source/backends/macbe/macbecdef.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: macbecdef.cxx,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/macbe/macbelayer.cxx b/shell/source/backends/macbe/macbelayer.cxx index ea0d3cb63fb7..113f7f964f54 100644 --- a/shell/source/backends/macbe/macbelayer.cxx +++ b/shell/source/backends/macbe/macbelayer.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: macbelayer.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/macbe/macbelayer.hxx b/shell/source/backends/macbe/macbelayer.hxx index a1f27148d1a3..06e80632da50 100644 --- a/shell/source/backends/macbe/macbelayer.hxx +++ b/shell/source/backends/macbe/macbelayer.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: macbelayer.hxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/macbe/makefile.mk b/shell/source/backends/macbe/makefile.mk index c8f6891d6f87..1d5d68a1f615 100644 --- a/shell/source/backends/macbe/makefile.mk +++ b/shell/source/backends/macbe/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.4 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/wininetbe/makefile.mk b/shell/source/backends/wininetbe/makefile.mk index be43ecaded36..fd87b9268475 100644 --- a/shell/source/backends/wininetbe/makefile.mk +++ b/shell/source/backends/wininetbe/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.5 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx b/shell/source/backends/wininetbe/wininetbackend.cxx index 018560f4f762..0734b2cbba3a 100644 --- a/shell/source/backends/wininetbe/wininetbackend.cxx +++ b/shell/source/backends/wininetbe/wininetbackend.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: wininetbackend.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/wininetbe/wininetbackend.hxx b/shell/source/backends/wininetbe/wininetbackend.hxx index c335fe005f12..d624d2cefb10 100644 --- a/shell/source/backends/wininetbe/wininetbackend.hxx +++ b/shell/source/backends/wininetbe/wininetbackend.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: wininetbackend.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/wininetbe/wininetbecdef.cxx b/shell/source/backends/wininetbe/wininetbecdef.cxx index ae8ad725da1c..1a941429a3ec 100644 --- a/shell/source/backends/wininetbe/wininetbecdef.cxx +++ b/shell/source/backends/wininetbe/wininetbecdef.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: wininetbecdef.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/backends/wininetbe/wininetlayer.cxx b/shell/source/backends/wininetbe/wininetlayer.cxx index d38bda5a1581..df00abe0081b 100644 --- a/shell/source/backends/wininetbe/wininetlayer.cxx +++ b/shell/source/backends/wininetbe/wininetlayer.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: wininetlayer.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/cmdmail/cmdmailentry.cxx b/shell/source/cmdmail/cmdmailentry.cxx index 195916b7341d..aacef87396c4 100755 --- a/shell/source/cmdmail/cmdmailentry.cxx +++ b/shell/source/cmdmail/cmdmailentry.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: cmdmailentry.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/cmdmail/cmdmailmsg.cxx b/shell/source/cmdmail/cmdmailmsg.cxx index 66a74ea68989..77de429ed771 100755 --- a/shell/source/cmdmail/cmdmailmsg.cxx +++ b/shell/source/cmdmail/cmdmailmsg.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: cmdmailmsg.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/cmdmail/cmdmailmsg.hxx b/shell/source/cmdmail/cmdmailmsg.hxx index a9ddebfa234a..520bd0acbb56 100644 --- a/shell/source/cmdmail/cmdmailmsg.hxx +++ b/shell/source/cmdmail/cmdmailmsg.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: cmdmailmsg.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/cmdmail/cmdmailsuppl.cxx b/shell/source/cmdmail/cmdmailsuppl.cxx index e3f5bbb3dc3f..4878f8d7783f 100755 --- a/shell/source/cmdmail/cmdmailsuppl.cxx +++ b/shell/source/cmdmail/cmdmailsuppl.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: cmdmailsuppl.cxx,v $ - * $Revision: 1.15 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/cmdmail/cmdmailsuppl.hxx b/shell/source/cmdmail/cmdmailsuppl.hxx index 08f98d3dc021..343de67cb68c 100644 --- a/shell/source/cmdmail/cmdmailsuppl.hxx +++ b/shell/source/cmdmail/cmdmailsuppl.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: cmdmailsuppl.hxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/cmdmail/makefile.mk b/shell/source/cmdmail/makefile.mk index 6b83d74842f2..a7eaec1f89dd 100644 --- a/shell/source/cmdmail/makefile.mk +++ b/shell/source/cmdmail/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.7 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/tools/lngconvex/cmdline.cxx b/shell/source/tools/lngconvex/cmdline.cxx index 68df937ca7c0..8e51e0b203e1 100644 --- a/shell/source/tools/lngconvex/cmdline.cxx +++ b/shell/source/tools/lngconvex/cmdline.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: cmdline.cxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/tools/lngconvex/lngconvex.cxx b/shell/source/tools/lngconvex/lngconvex.cxx index f605d6f340d9..0d716d6c568d 100644 --- a/shell/source/tools/lngconvex/lngconvex.cxx +++ b/shell/source/tools/lngconvex/lngconvex.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: lngconvex.cxx,v $ - * $Revision: 1.18 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/tools/lngconvex/makefile.mk b/shell/source/tools/lngconvex/makefile.mk index c98f5d47968c..da28e5ff68f4 100644 --- a/shell/source/tools/lngconvex/makefile.mk +++ b/shell/source/tools/lngconvex/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.6 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/tools/regsvrex/makefile.mk b/shell/source/tools/regsvrex/makefile.mk index 52c6ee70b6ec..2eb8dbf48481 100644 --- a/shell/source/tools/regsvrex/makefile.mk +++ b/shell/source/tools/regsvrex/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.5 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/tools/regsvrex/regsvrex.cxx b/shell/source/tools/regsvrex/regsvrex.cxx index db5f451d2d21..516e386e5e06 100644 --- a/shell/source/tools/regsvrex/regsvrex.cxx +++ b/shell/source/tools/regsvrex/regsvrex.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: regsvrex.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/unix/exec/makefile.mk b/shell/source/unix/exec/makefile.mk index e23e249e0835..2d9d5d250da4 100644 --- a/shell/source/unix/exec/makefile.mk +++ b/shell/source/unix/exec/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.12 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx index 4ee0f32eb072..e6aca26922da 100644 --- a/shell/source/unix/exec/shellexec.cxx +++ b/shell/source/unix/exec/shellexec.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: shellexec.cxx,v $ - * $Revision: 1.21 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/unix/exec/shellexec.hxx b/shell/source/unix/exec/shellexec.hxx index 5b15736d7cb3..d7955cc135fd 100644 --- a/shell/source/unix/exec/shellexec.hxx +++ b/shell/source/unix/exec/shellexec.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: shellexec.hxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/unix/exec/shellexecentry.cxx b/shell/source/unix/exec/shellexecentry.cxx index 4af2d96a2e10..da5e5613f955 100644 --- a/shell/source/unix/exec/shellexecentry.cxx +++ b/shell/source/unix/exec/shellexecentry.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: shellexecentry.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/unix/exec/urltest.cxx b/shell/source/unix/exec/urltest.cxx index ee19df4bb342..1de12766e650 100644 --- a/shell/source/unix/exec/urltest.cxx +++ b/shell/source/unix/exec/urltest.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: urltest.cxx,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/unix/misc/gnome-open-url.c b/shell/source/unix/misc/gnome-open-url.c index 326b1a735786..3bd7a61e6546 100644 --- a/shell/source/unix/misc/gnome-open-url.c +++ b/shell/source/unix/misc/gnome-open-url.c @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: gnome-open-url.c,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/unix/misc/makefile.mk b/shell/source/unix/misc/makefile.mk index 8a5ee366223a..67fcc708c615 100644 --- a/shell/source/unix/misc/makefile.mk +++ b/shell/source/unix/misc/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.8 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/unix/misc/open-url.c b/shell/source/unix/misc/open-url.c index f8e76f26ec5d..91f4aeaff398 100644 --- a/shell/source/unix/misc/open-url.c +++ b/shell/source/unix/misc/open-url.c @@ -2,7 +2,7 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * diff --git a/shell/source/unix/misc/senddoc.c b/shell/source/unix/misc/senddoc.c index bbe96420699d..5a21ef1ec50f 100644 --- a/shell/source/unix/misc/senddoc.c +++ b/shell/source/unix/misc/senddoc.c @@ -2,7 +2,7 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * diff --git a/shell/source/unix/misc/uri-encode.c b/shell/source/unix/misc/uri-encode.c index 04e6582286ee..e93bd61e6675 100644 --- a/shell/source/unix/misc/uri-encode.c +++ b/shell/source/unix/misc/uri-encode.c @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: uri-encode.c,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/unix/sysshell/makefile.mk b/shell/source/unix/sysshell/makefile.mk index 2c1ace9fe187..3d8a55d4377f 100644 --- a/shell/source/unix/sysshell/makefile.mk +++ b/shell/source/unix/sysshell/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.11 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/unix/sysshell/recently_used_file.cxx b/shell/source/unix/sysshell/recently_used_file.cxx index 6de067a62936..cc4fbf75adcc 100644 --- a/shell/source/unix/sysshell/recently_used_file.cxx +++ b/shell/source/unix/sysshell/recently_used_file.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: recently_used_file.cxx,v $ - * $Revision: 1.7.30.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/unix/sysshell/recently_used_file.hxx b/shell/source/unix/sysshell/recently_used_file.hxx index ec27e5458cf0..346541a7efda 100644 --- a/shell/source/unix/sysshell/recently_used_file.hxx +++ b/shell/source/unix/sysshell/recently_used_file.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: recently_used_file.hxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/unix/sysshell/recently_used_file_handler.cxx b/shell/source/unix/sysshell/recently_used_file_handler.cxx index 80d22501ed46..b124d03b589c 100644 --- a/shell/source/unix/sysshell/recently_used_file_handler.cxx +++ b/shell/source/unix/sysshell/recently_used_file_handler.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: recently_used_file_handler.cxx,v $ - * $Revision: 1.12 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx index cdc4f9543a57..7264afaac109 100644 --- a/shell/source/win32/SysShExec.cxx +++ b/shell/source/win32/SysShExec.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: SysShExec.cxx,v $ - * $Revision: 1.12 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/SysShExec.hxx b/shell/source/win32/SysShExec.hxx index 31f2f445b8eb..b4d5f18b7899 100644 --- a/shell/source/win32/SysShExec.hxx +++ b/shell/source/win32/SysShExec.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: SysShExec.hxx,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/SysShentry.cxx b/shell/source/win32/SysShentry.cxx index 2109c733cdc9..a542d046fc59 100644 --- a/shell/source/win32/SysShentry.cxx +++ b/shell/source/win32/SysShentry.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: SysShentry.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/makefile.mk b/shell/source/win32/makefile.mk index 04cc45d89bc3..065261cd8dad 100644 --- a/shell/source/win32/makefile.mk +++ b/shell/source/win32/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.12 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/classfactory.cxx b/shell/source/win32/shlxthandler/classfactory.cxx index ee60cb4f62b7..e19dd68383b4 100644 --- a/shell/source/win32/shlxthandler/classfactory.cxx +++ b/shell/source/win32/shlxthandler/classfactory.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: classfactory.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/classfactory.hxx b/shell/source/win32/shlxthandler/classfactory.hxx index 11463e747eb6..f0a8b84ae6ee 100644 --- a/shell/source/win32/shlxthandler/classfactory.hxx +++ b/shell/source/win32/shlxthandler/classfactory.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: classfactory.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/columninfo/columninfo.cxx b/shell/source/win32/shlxthandler/columninfo/columninfo.cxx index 9e40a3097ab4..f8816668f8ab 100644 --- a/shell/source/win32/shlxthandler/columninfo/columninfo.cxx +++ b/shell/source/win32/shlxthandler/columninfo/columninfo.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: columninfo.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/columninfo/makefile.mk b/shell/source/win32/shlxthandler/columninfo/makefile.mk index 0b25d470aa7b..2e7bd47261c5 100644 --- a/shell/source/win32/shlxthandler/columninfo/makefile.mk +++ b/shell/source/win32/shlxthandler/columninfo/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.6 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/infotips/infotips.cxx b/shell/source/win32/shlxthandler/infotips/infotips.cxx index da6974d4399d..72da8c9e7060 100644 --- a/shell/source/win32/shlxthandler/infotips/infotips.cxx +++ b/shell/source/win32/shlxthandler/infotips/infotips.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: infotips.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/infotips/makefile.mk b/shell/source/win32/shlxthandler/infotips/makefile.mk index cf489f323278..85d4099b20d3 100644 --- a/shell/source/win32/shlxthandler/infotips/makefile.mk +++ b/shell/source/win32/shlxthandler/infotips/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.6 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/makefile.mk b/shell/source/win32/shlxthandler/makefile.mk index 479f8c0b6cd9..db3496687d6c 100644 --- a/shell/source/win32/shlxthandler/makefile.mk +++ b/shell/source/win32/shlxthandler/makefile.mk @@ -1,15 +1,11 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.14 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/ooofilt/makefile.mk b/shell/source/win32/shlxthandler/ooofilt/makefile.mk index 22127bc8ddac..2fa6a57ab756 100644 --- a/shell/source/win32/shlxthandler/ooofilt/makefile.mk +++ b/shell/source/win32/shlxthandler/ooofilt/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.8 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx index ac8dd676c3b1..0cfc8eaaae01 100644 --- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx +++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: ooofilt.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx index 9f1566b406bd..8e14141d7e02 100644 --- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx +++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: ooofilt.hxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/ooofilt/propspec.cxx b/shell/source/win32/shlxthandler/ooofilt/propspec.cxx index 16e49dfdc21f..fd7a24f2711a 100644 --- a/shell/source/win32/shlxthandler/ooofilt/propspec.cxx +++ b/shell/source/win32/shlxthandler/ooofilt/propspec.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: propspec.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/ooofilt/propspec.hxx b/shell/source/win32/shlxthandler/ooofilt/propspec.hxx index 3f264a2f4da4..ba4c34233d64 100644 --- a/shell/source/win32/shlxthandler/ooofilt/propspec.hxx +++ b/shell/source/win32/shlxthandler/ooofilt/propspec.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: propspec.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/ooofilt/proxy/makefile.mk b/shell/source/win32/shlxthandler/ooofilt/proxy/makefile.mk index 54dc3d59a734..aab2285f980b 100644 --- a/shell/source/win32/shlxthandler/ooofilt/proxy/makefile.mk +++ b/shell/source/win32/shlxthandler/ooofilt/proxy/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.7 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx b/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx index 218ba500d368..bd11c4102f53 100644 --- a/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx +++ b/shell/source/win32/shlxthandler/ooofilt/proxy/ooofiltproxy.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: ooofiltproxy.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/propsheets/document_statistic.cxx b/shell/source/win32/shlxthandler/propsheets/document_statistic.cxx index 37523a9539de..1e41f478b95b 100644 --- a/shell/source/win32/shlxthandler/propsheets/document_statistic.cxx +++ b/shell/source/win32/shlxthandler/propsheets/document_statistic.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: document_statistic.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/propsheets/document_statistic.hxx b/shell/source/win32/shlxthandler/propsheets/document_statistic.hxx index 2773eafabc97..0b3a3dd96c07 100644 --- a/shell/source/win32/shlxthandler/propsheets/document_statistic.hxx +++ b/shell/source/win32/shlxthandler/propsheets/document_statistic.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: document_statistic.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx b/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx index 2b10fdceba5c..5d3d365beb62 100644 --- a/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx +++ b/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: listviewbuilder.cxx,v $ - * $Revision: 1.9 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/propsheets/listviewbuilder.hxx b/shell/source/win32/shlxthandler/propsheets/listviewbuilder.hxx index d7357485b342..c764ff9809ad 100644 --- a/shell/source/win32/shlxthandler/propsheets/listviewbuilder.hxx +++ b/shell/source/win32/shlxthandler/propsheets/listviewbuilder.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: listviewbuilder.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/propsheets/makefile.mk b/shell/source/win32/shlxthandler/propsheets/makefile.mk index ac12795cf37f..81bab609a8e5 100644 --- a/shell/source/win32/shlxthandler/propsheets/makefile.mk +++ b/shell/source/win32/shlxthandler/propsheets/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.6 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx index d854694d8394..b57a21c1cf82 100644 --- a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx +++ b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: propsheets.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/res/makefile.mk b/shell/source/win32/shlxthandler/res/makefile.mk index 8f8c77638387..ec0529015179 100644 --- a/shell/source/win32/shlxthandler/res/makefile.mk +++ b/shell/source/win32/shlxthandler/res/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.8 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/shlxthdl.cxx b/shell/source/win32/shlxthandler/shlxthdl.cxx index 1249d3cde6e7..21fd4e3438ab 100644 --- a/shell/source/win32/shlxthandler/shlxthdl.cxx +++ b/shell/source/win32/shlxthandler/shlxthdl.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: shlxthdl.cxx,v $ - * $Revision: 1.9 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/thumbviewer/makefile.mk b/shell/source/win32/shlxthandler/thumbviewer/makefile.mk index a7b0b40032dd..eaa6beb3e2a4 100644 --- a/shell/source/win32/shlxthandler/thumbviewer/makefile.mk +++ b/shell/source/win32/shlxthandler/thumbviewer/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.5 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx index 6315a719a62e..13f49c8a2efd 100644 --- a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx +++ b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: thumbviewer.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/util/dbgmacros.cxx b/shell/source/win32/shlxthandler/util/dbgmacros.cxx index 5bf6d68ee4d4..01ef1d47c083 100644 --- a/shell/source/win32/shlxthandler/util/dbgmacros.cxx +++ b/shell/source/win32/shlxthandler/util/dbgmacros.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dbgmacros.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/util/fileextensions.cxx b/shell/source/win32/shlxthandler/util/fileextensions.cxx index 3849045f71d9..b8de490a5c47 100644 --- a/shell/source/win32/shlxthandler/util/fileextensions.cxx +++ b/shell/source/win32/shlxthandler/util/fileextensions.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: fileextensions.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/util/iso8601_converter.cxx b/shell/source/win32/shlxthandler/util/iso8601_converter.cxx index ff7fe963413f..c55b7be0017e 100644 --- a/shell/source/win32/shlxthandler/util/iso8601_converter.cxx +++ b/shell/source/win32/shlxthandler/util/iso8601_converter.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: iso8601_converter.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/util/makefile.mk b/shell/source/win32/shlxthandler/util/makefile.mk index c0bec9c36d3b..f49ee1389b49 100644 --- a/shell/source/win32/shlxthandler/util/makefile.mk +++ b/shell/source/win32/shlxthandler/util/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.6 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/util/registry.cxx b/shell/source/win32/shlxthandler/util/registry.cxx index 1b1280152135..bac126bb0504 100644 --- a/shell/source/win32/shlxthandler/util/registry.cxx +++ b/shell/source/win32/shlxthandler/util/registry.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: registry.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/shlxthandler/util/utilities.cxx b/shell/source/win32/shlxthandler/util/utilities.cxx index f2ae6238715a..f721c4113aa8 100644 --- a/shell/source/win32/shlxthandler/util/utilities.cxx +++ b/shell/source/win32/shlxthandler/util/utilities.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: utilities.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/simplemail/makefile.mk b/shell/source/win32/simplemail/makefile.mk index 70e25f76fe1f..84a209e4c072 100644 --- a/shell/source/win32/simplemail/makefile.mk +++ b/shell/source/win32/simplemail/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.7 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/simplemail/senddoc.cxx b/shell/source/win32/simplemail/senddoc.cxx index bcd60253edf1..c8ac40799cea 100644 --- a/shell/source/win32/simplemail/senddoc.cxx +++ b/shell/source/win32/simplemail/senddoc.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: senddoc.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/simplemail/simplemapi.cxx b/shell/source/win32/simplemail/simplemapi.cxx index 8d7e99fcf210..faf383f580aa 100644 --- a/shell/source/win32/simplemail/simplemapi.cxx +++ b/shell/source/win32/simplemail/simplemapi.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: simplemapi.cxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/simplemail/simplemapi.hxx b/shell/source/win32/simplemail/simplemapi.hxx index ab0962326f49..e4feb3524ed3 100644 --- a/shell/source/win32/simplemail/simplemapi.hxx +++ b/shell/source/win32/simplemail/simplemapi.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: simplemapi.hxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/simplemail/smplmailclient.cxx b/shell/source/win32/simplemail/smplmailclient.cxx index 82968b747d95..49c546e5721d 100644 --- a/shell/source/win32/simplemail/smplmailclient.cxx +++ b/shell/source/win32/simplemail/smplmailclient.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: smplmailclient.cxx,v $ - * $Revision: 1.16 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/simplemail/smplmailclient.hxx b/shell/source/win32/simplemail/smplmailclient.hxx index 160e9a0d585c..5457dffbffd9 100644 --- a/shell/source/win32/simplemail/smplmailclient.hxx +++ b/shell/source/win32/simplemail/smplmailclient.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: smplmailclient.hxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/simplemail/smplmailentry.cxx b/shell/source/win32/simplemail/smplmailentry.cxx index 1c9596e7b7de..e65d93a95fca 100644 --- a/shell/source/win32/simplemail/smplmailentry.cxx +++ b/shell/source/win32/simplemail/smplmailentry.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: smplmailentry.cxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/simplemail/smplmailmsg.cxx b/shell/source/win32/simplemail/smplmailmsg.cxx index 4e87216dfae1..088d84a050ad 100644 --- a/shell/source/win32/simplemail/smplmailmsg.cxx +++ b/shell/source/win32/simplemail/smplmailmsg.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: smplmailmsg.cxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/simplemail/smplmailmsg.hxx b/shell/source/win32/simplemail/smplmailmsg.hxx index 7e194ed34a15..caeb0710de90 100644 --- a/shell/source/win32/simplemail/smplmailmsg.hxx +++ b/shell/source/win32/simplemail/smplmailmsg.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: smplmailmsg.hxx,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/simplemail/smplmailsuppl.cxx b/shell/source/win32/simplemail/smplmailsuppl.cxx index db916bf95a27..375da5b07856 100644 --- a/shell/source/win32/simplemail/smplmailsuppl.cxx +++ b/shell/source/win32/simplemail/smplmailsuppl.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: smplmailsuppl.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/simplemail/smplmailsuppl.hxx b/shell/source/win32/simplemail/smplmailsuppl.hxx index ed691063071f..e945556c6f8b 100644 --- a/shell/source/win32/simplemail/smplmailsuppl.hxx +++ b/shell/source/win32/simplemail/smplmailsuppl.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: smplmailsuppl.hxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/workbench/TestProxySet.cxx b/shell/source/win32/workbench/TestProxySet.cxx index e0dbc9fa296e..ab0d89e945d2 100644 --- a/shell/source/win32/workbench/TestProxySet.cxx +++ b/shell/source/win32/workbench/TestProxySet.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: TestProxySet.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/workbench/TestSmplMail.cxx b/shell/source/win32/workbench/TestSmplMail.cxx index 7442fc916c67..a9b04a9f4e05 100644 --- a/shell/source/win32/workbench/TestSmplMail.cxx +++ b/shell/source/win32/workbench/TestSmplMail.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: TestSmplMail.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/workbench/TestSysShExec.cxx b/shell/source/win32/workbench/TestSysShExec.cxx index 41892e016450..c459408d3802 100644 --- a/shell/source/win32/workbench/TestSysShExec.cxx +++ b/shell/source/win32/workbench/TestSysShExec.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: TestSysShExec.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/shell/source/win32/workbench/makefile.mk b/shell/source/win32/workbench/makefile.mk index 2a48f6322207..9d9c7945b9bf 100644 --- a/shell/source/win32/workbench/makefile.mk +++ b/shell/source/win32/workbench/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.9 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify -- cgit From db02ac8b89b8ec1e3d84f2676665667916582423 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Fri, 12 Feb 2010 16:56:44 +0100 Subject: changefileheader2: #i10000#: convert files with CR/LF characters to CR only --- shell/inc/internal/basereader.hxx | 2 +- shell/inc/internal/contentreader.hxx | 2 +- shell/inc/internal/metainforeader.hxx | 2 +- shell/inc/internal/types.hxx | 4 +- shell/inc/internal/zipfile.hxx | 12 +- shell/source/all/ooofilereader/basereader.cxx | 16 +- shell/source/all/ooofilereader/contentreader.cxx | 42 +-- shell/source/all/ooofilereader/metainforeader.cxx | 84 ++--- shell/source/all/zipfile/makefile.mk | 2 +- shell/source/all/zipfile/zipfile.cxx | 32 +- .../source/win32/shlxthandler/ooofilt/ooofilt.cxx | 400 ++++++++++----------- .../source/win32/shlxthandler/ooofilt/ooofilt.hxx | 52 +-- 12 files changed, 325 insertions(+), 325 deletions(-) (limited to 'shell') diff --git a/shell/inc/internal/basereader.hxx b/shell/inc/internal/basereader.hxx index 8aef93528806..fcdf1cdd7dff 100644 --- a/shell/inc/internal/basereader.hxx +++ b/shell/inc/internal/basereader.hxx @@ -47,7 +47,7 @@ public: protected: // protected because its only an implementation relevant class CBaseReader( const std::string& DocumentName ); - CBaseReader( void* stream, zlib_filefunc_def* fa ); + CBaseReader( void* stream, zlib_filefunc_def* fa ); virtual void start_document(); diff --git a/shell/inc/internal/contentreader.hxx b/shell/inc/internal/contentreader.hxx index b4ed30970c46..63b0c550c534 100644 --- a/shell/inc/internal/contentreader.hxx +++ b/shell/inc/internal/contentreader.hxx @@ -40,7 +40,7 @@ public: //CContentReader( const std::string& DocumentName ); CContentReader( const std::string& DocumentName, LocaleSet_t const & DocumentLocale ); - CContentReader( void* stream, LocaleSet_t const & DocumentLocale, zlib_filefunc_def* fa ); + CContentReader( void* stream, LocaleSet_t const & DocumentLocale, zlib_filefunc_def* fa ); /** Get the chunkbuffer. diff --git a/shell/inc/internal/metainforeader.hxx b/shell/inc/internal/metainforeader.hxx index e936acc71d41..ea29dff07c80 100644 --- a/shell/inc/internal/metainforeader.hxx +++ b/shell/inc/internal/metainforeader.hxx @@ -43,7 +43,7 @@ public: CMetaInfoReader( const std::string& DocumentName ); - CMetaInfoReader( void* stream, zlib_filefunc_def* fa); + CMetaInfoReader( void* stream, zlib_filefunc_def* fa); /** check if the Tag is in the target meta.xml file. diff --git a/shell/inc/internal/types.hxx b/shell/inc/internal/types.hxx index d636595537e4..c11692912aec 100644 --- a/shell/inc/internal/types.hxx +++ b/shell/inc/internal/types.hxx @@ -33,8 +33,8 @@ #include #include #include -#include -#include +#include +#include typedef std::vector StringList_t; diff --git a/shell/inc/internal/zipfile.hxx b/shell/inc/internal/zipfile.hxx index d349f0294d11..a3e3575082c0 100644 --- a/shell/inc/internal/zipfile.hxx +++ b/shell/inc/internal/zipfile.hxx @@ -32,9 +32,9 @@ #define _WINDOWS #endif - -#include - + +#include + #include #include @@ -68,7 +68,7 @@ public: */ static bool IsZipFile(const std::string& FileName); - static bool IsZipFile(void* stream); + static bool IsZipFile(void* stream); /** Returns wheter the version of the specified zip file may be uncompressed with the @@ -88,7 +88,7 @@ public: */ static bool IsValidZipFileVersionNumber(const std::string& FileName); - static bool IsValidZipFileVersionNumber(void* stream); + static bool IsValidZipFileVersionNumber(void* stream); public: @@ -106,7 +106,7 @@ public: */ ZipFile(const std::string& FileName); - ZipFile(void* stream, zlib_filefunc_def* fa); + ZipFile(void* stream, zlib_filefunc_def* fa); /** Destroys a zip file diff --git a/shell/source/all/ooofilereader/basereader.cxx b/shell/source/all/ooofilereader/basereader.cxx index 17c35268680e..2fc4a0c79297 100644 --- a/shell/source/all/ooofilereader/basereader.cxx +++ b/shell/source/all/ooofilereader/basereader.cxx @@ -47,14 +47,14 @@ m_ZipFile( DocumentName ) // //------------------------------ -CBaseReader::CBaseReader(void * sw, zlib_filefunc_def* fa): -m_ZipFile( sw , fa ) -{ -} - -//------------------------------ -// -//------------------------------ +CBaseReader::CBaseReader(void * sw, zlib_filefunc_def* fa): +m_ZipFile( sw , fa ) +{ +} + +//------------------------------ +// +//------------------------------ CBaseReader::~CBaseReader() { diff --git a/shell/source/all/ooofilereader/contentreader.cxx b/shell/source/all/ooofilereader/contentreader.cxx index 9cb841eef0fc..4afb278ff2c8 100644 --- a/shell/source/all/ooofilereader/contentreader.cxx +++ b/shell/source/all/ooofilereader/contentreader.cxx @@ -58,27 +58,27 @@ CBaseReader( DocumentName ) } } -CContentReader::CContentReader( void* stream, LocaleSet_t const & DocumentLocale, zlib_filefunc_def* fa ) : -CBaseReader( stream, fa ) -{ -try - { - m_DefaultLocale = DocumentLocale; - Initialize( DOC_CONTENT_NAME ); - } - catch(xml_parser_exception& - #if OSL_DEBUG_LEVEL > 0 - ex - #endif - ) - { - ENSURE(false, ex.what()); - } - catch(...) - { - ENSURE(false, "Unknown error"); - } -} +CContentReader::CContentReader( void* stream, LocaleSet_t const & DocumentLocale, zlib_filefunc_def* fa ) : +CBaseReader( stream, fa ) +{ +try + { + m_DefaultLocale = DocumentLocale; + Initialize( DOC_CONTENT_NAME ); + } + catch(xml_parser_exception& + #if OSL_DEBUG_LEVEL > 0 + ex + #endif + ) + { + ENSURE(false, ex.what()); + } + catch(...) + { + ENSURE(false, "Unknown error"); + } +} /** destructor. diff --git a/shell/source/all/ooofilereader/metainforeader.cxx b/shell/source/all/ooofilereader/metainforeader.cxx index ba61c031660c..24e59f6845da 100644 --- a/shell/source/all/ooofilereader/metainforeader.cxx +++ b/shell/source/all/ooofilereader/metainforeader.cxx @@ -77,48 +77,48 @@ CBaseReader( DocumentName ) } } -CMetaInfoReader::CMetaInfoReader( void* stream, zlib_filefunc_def* fa) : -CBaseReader( stream, fa) -{ -try - { - m_pKeywords_Builder = new CKeywordsTag( ); - m_pSimple_Builder = new CSimpleTag( ); - m_pDummy_Builder = new CDummyTag( ); - - //retrieve all infomation that is useful - m_AllMetaInfo[META_INFO_AUTHOR] = EMPTY_XML_TAG; - m_AllMetaInfo[META_INFO_TITLE] = EMPTY_XML_TAG; - m_AllMetaInfo[META_INFO_SUBJECT] = EMPTY_XML_TAG; - m_AllMetaInfo[META_INFO_KEYWORDS] = EMPTY_XML_TAG; - m_AllMetaInfo[META_INFO_DESCRIPTION] = EMPTY_XML_TAG; - m_AllMetaInfo[META_INFO_DOCUMENT_STATISTIC] = EMPTY_XML_TAG; - - m_AllMetaInfo[META_INFO_GENERATOR] = EMPTY_XML_TAG; - m_AllMetaInfo[META_INFO_CREATION] = EMPTY_XML_TAG; - m_AllMetaInfo[META_INFO_CREATOR] = EMPTY_XML_TAG; - m_AllMetaInfo[META_INFO_MODIFIED] = EMPTY_XML_TAG; - m_AllMetaInfo[META_INFO_LANGUAGE] = EMPTY_XML_TAG; - m_AllMetaInfo[META_INFO_DOCUMENT_NUMBER] = EMPTY_XML_TAG; - m_AllMetaInfo[META_INFO_EDITING_TIME] = EMPTY_XML_TAG; - - Initialize( META_CONTENT_NAME ); - } - catch(xml_parser_exception& - #if OSL_DEBUG_LEVEL > 0 - ex - #endif - ) - { - ENSURE(false, ex.what()); - } - catch(...) - { - ENSURE(false, "Unknown error"); - } - -} - +CMetaInfoReader::CMetaInfoReader( void* stream, zlib_filefunc_def* fa) : +CBaseReader( stream, fa) +{ +try + { + m_pKeywords_Builder = new CKeywordsTag( ); + m_pSimple_Builder = new CSimpleTag( ); + m_pDummy_Builder = new CDummyTag( ); + + //retrieve all infomation that is useful + m_AllMetaInfo[META_INFO_AUTHOR] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_TITLE] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_SUBJECT] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_KEYWORDS] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_DESCRIPTION] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_DOCUMENT_STATISTIC] = EMPTY_XML_TAG; + + m_AllMetaInfo[META_INFO_GENERATOR] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_CREATION] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_CREATOR] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_MODIFIED] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_LANGUAGE] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_DOCUMENT_NUMBER] = EMPTY_XML_TAG; + m_AllMetaInfo[META_INFO_EDITING_TIME] = EMPTY_XML_TAG; + + Initialize( META_CONTENT_NAME ); + } + catch(xml_parser_exception& + #if OSL_DEBUG_LEVEL > 0 + ex + #endif + ) + { + ENSURE(false, ex.what()); + } + catch(...) + { + ENSURE(false, "Unknown error"); + } + +} + /** destructor. */ diff --git a/shell/source/all/zipfile/makefile.mk b/shell/source/all/zipfile/makefile.mk index 2b77e5c3ae2b..9e16a7afe4dc 100644 --- a/shell/source/all/zipfile/makefile.mk +++ b/shell/source/all/zipfile/makefile.mk @@ -29,7 +29,7 @@ PRJ=..$/..$/.. PRJNAME=shell TARGET=zipfile ENABLE_EXCEPTIONS=TRUE -EXTERNAL_WARNINGS_NOT_ERRORS := TRUE +EXTERNAL_WARNINGS_NOT_ERRORS := TRUE diff --git a/shell/source/all/zipfile/zipfile.cxx b/shell/source/all/zipfile/zipfile.cxx index d4ff929c7788..96dd7922ec08 100644 --- a/shell/source/all/zipfile/zipfile.cxx +++ b/shell/source/all/zipfile/zipfile.cxx @@ -76,10 +76,10 @@ bool ZipFile::IsZipFile(const std::string& /*FileName*/) return true; } -bool ZipFile::IsZipFile(void* /*stream*/) -{ - return true; -} +bool ZipFile::IsZipFile(void* /*stream*/) +{ + return true; +} /** Returns wheter the version of the specified zip file may be uncompressed with the @@ -102,10 +102,10 @@ bool ZipFile::IsValidZipFileVersionNumber(const std::string& /*FileName*/) return true; } -bool ZipFile::IsValidZipFileVersionNumber(void* /* stream*/) -{ - return true; -} +bool ZipFile::IsValidZipFileVersionNumber(void* /* stream*/) +{ + return true; +} /** Constructs a zip file from a zip file @@ -128,14 +128,14 @@ ZipFile::ZipFile(const std::string& FileName) throw IOException(-1); } -ZipFile::ZipFile(void* stream, zlib_filefunc_def* fa) -{ - fa->opaque = stream; - m_uzFile = unzOpen2((const char *)NULL, fa); - - if (0 == m_uzFile) - throw IOException(-1); -} +ZipFile::ZipFile(void* stream, zlib_filefunc_def* fa) +{ + fa->opaque = stream; + m_uzFile = unzOpen2((const char *)NULL, fa); + + if (0 == m_uzFile) + throw IOException(-1); +} /** Destroys a zip file diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx index 0cfc8eaaae01..d04f98e537b6 100644 --- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx +++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx @@ -75,8 +75,8 @@ #include #include "assert.h" #include "ooofilt.hxx" -#include -#include +#include +#include #include "propspec.hxx" #ifdef __MINGW32__ #include @@ -117,7 +117,7 @@ COooFilter::COooFilter() : m_ChunkPosition(0), m_cAttributes(0), m_pAttributes(0), - m_pStream(NULL) + m_pStream(NULL) { InterlockedIncrement( &g_lInstances ); @@ -173,8 +173,8 @@ SCODE STDMETHODCALLTYPE COooFilter::QueryInterface( pUnkTemp = (IUnknown *)(IPersistFile *)this; else if ( IID_IPersist == riid ) pUnkTemp = (IUnknown *)(IPersist *)(IPersistFile *)this; - else if (IID_IPersistStream == riid) - pUnkTemp = (IUnknown *)(IPersistStream *)this; + else if (IID_IPersistStream == riid) + pUnkTemp = (IUnknown *)(IPersistStream *)this; else if ( IID_IUnknown == riid ) pUnkTemp = (IUnknown *)(IPersist *)(IPersistFile *)this; else @@ -717,99 +717,99 @@ SCODE STDMETHODCALLTYPE COooFilter::SaveCompleted(LPCWSTR /*pszFileName*/) return S_OK; } -//M------------------------------------------------------------------------- -// -// Method: COooFilter::Load (IPersistStream::Load) -// -// Summary: Initializes an object from the stream where it was previously saved -// -// Arguments: pStm -// [in] Pointer to stream from which object should be loaded -// -// -// Returns: S_OK -// E_OUTOFMEMORY -// E_FAIL -// -// -//-------------------------------------------------------------------------- -SCODE STDMETHODCALLTYPE COooFilter::Load(IStream *pStm) -{ - - // These next few lines work around the "Seek pointer" bug found on Vista. - - char buf[20]; - unsigned long count; - HRESULT hr; - ULARGE_INTEGER NewPosition; - LARGE_INTEGER Move; - Move.QuadPart = 0; - hr = pStm->Seek (Move, STREAM_SEEK_SET, &NewPosition); - hr = pStm->Read (buf, 20, &count); - - zlib_filefunc_def z_filefunc; - fill_stream_filefunc (&z_filefunc); - z_filefunc.opaque = (void*)pStm; - - m_pStream = pStm; - - try - { - if (m_pMetaInfoReader) - delete m_pMetaInfoReader; - m_pMetaInfoReader = new CMetaInfoReader((void*)m_pStream, &z_filefunc); - - if (m_pContentReader) - delete m_pContentReader; - m_pContentReader = new CContentReader((void*)m_pStream, m_pMetaInfoReader->getDefaultLocale(), &z_filefunc); - } - catch (const std::exception&) - { - return E_FAIL; - } - return S_OK; -} - -//M------------------------------------------------------------------------- -// -// Method: COooFilter::GetSizeMax (IPersistStream::GetSizeMax) -// -// Summary: Returns the size in bytes of the stream neede to save the object. -// -// Arguments: pcbSize -// [out] Pointer to a 64 bit unsigned int indicating the size needed -// -// Returns: E_NOTIMPL -// -// -//-------------------------------------------------------------------------- -SCODE STDMETHODCALLTYPE COooFilter::GetSizeMax(ULARGE_INTEGER * /*pcbSize*/) -{ - // - return E_NOTIMPL; -} - -//M------------------------------------------------------------------------- -// -// Method: COooFilter::Save (IPersistStream::Save) -// -// Summary: Save object to specified stream -// -// Arguments: pStm -// [in] Pointer to stream -// -// fClearDirty -// [in] Indicates whether to clear dirty flag -// -// Returns: E_NOTIMPL -// -// -//-------------------------------------------------------------------------- -SCODE STDMETHODCALLTYPE COooFilter::Save(IStream * /*pStm*/, BOOL ) -{ - // - return E_NOTIMPL; -} +//M------------------------------------------------------------------------- +// +// Method: COooFilter::Load (IPersistStream::Load) +// +// Summary: Initializes an object from the stream where it was previously saved +// +// Arguments: pStm +// [in] Pointer to stream from which object should be loaded +// +// +// Returns: S_OK +// E_OUTOFMEMORY +// E_FAIL +// +// +//-------------------------------------------------------------------------- +SCODE STDMETHODCALLTYPE COooFilter::Load(IStream *pStm) +{ + + // These next few lines work around the "Seek pointer" bug found on Vista. + + char buf[20]; + unsigned long count; + HRESULT hr; + ULARGE_INTEGER NewPosition; + LARGE_INTEGER Move; + Move.QuadPart = 0; + hr = pStm->Seek (Move, STREAM_SEEK_SET, &NewPosition); + hr = pStm->Read (buf, 20, &count); + + zlib_filefunc_def z_filefunc; + fill_stream_filefunc (&z_filefunc); + z_filefunc.opaque = (void*)pStm; + + m_pStream = pStm; + + try + { + if (m_pMetaInfoReader) + delete m_pMetaInfoReader; + m_pMetaInfoReader = new CMetaInfoReader((void*)m_pStream, &z_filefunc); + + if (m_pContentReader) + delete m_pContentReader; + m_pContentReader = new CContentReader((void*)m_pStream, m_pMetaInfoReader->getDefaultLocale(), &z_filefunc); + } + catch (const std::exception&) + { + return E_FAIL; + } + return S_OK; +} + +//M------------------------------------------------------------------------- +// +// Method: COooFilter::GetSizeMax (IPersistStream::GetSizeMax) +// +// Summary: Returns the size in bytes of the stream neede to save the object. +// +// Arguments: pcbSize +// [out] Pointer to a 64 bit unsigned int indicating the size needed +// +// Returns: E_NOTIMPL +// +// +//-------------------------------------------------------------------------- +SCODE STDMETHODCALLTYPE COooFilter::GetSizeMax(ULARGE_INTEGER * /*pcbSize*/) +{ + // + return E_NOTIMPL; +} + +//M------------------------------------------------------------------------- +// +// Method: COooFilter::Save (IPersistStream::Save) +// +// Summary: Save object to specified stream +// +// Arguments: pStm +// [in] Pointer to stream +// +// fClearDirty +// [in] Indicates whether to clear dirty flag +// +// Returns: E_NOTIMPL +// +// +//-------------------------------------------------------------------------- +SCODE STDMETHODCALLTYPE COooFilter::Save(IStream * /*pStm*/, BOOL ) +{ + // + return E_NOTIMPL; +} //M------------------------------------------------------------------------- // @@ -1244,13 +1244,13 @@ namespace /* private */ if (!SetRegistryKey(HKEY_CLASSES_ROOT, ClsidEntry_Persist.c_str(), "", "OpenOffice.org Persistent Handler")) return E_FAIL; - // Add missing entry - std::string ClsidEntry_Persist_Entry = CLSID_PERSIST_ENTRY; - SubstitutePlaceholder(ClsidEntry_Persist_Entry, - GUID_PLACEHOLDER, - ClsidToString(PersistentGuid)); - - if (!SetRegistryKey(HKEY_CLASSES_ROOT, ClsidEntry_Persist_Entry.c_str(), "", ClsidToString(PersistentGuid).c_str())); + // Add missing entry + std::string ClsidEntry_Persist_Entry = CLSID_PERSIST_ENTRY; + SubstitutePlaceholder(ClsidEntry_Persist_Entry, + GUID_PLACEHOLDER, + ClsidToString(PersistentGuid)); + + if (!SetRegistryKey(HKEY_CLASSES_ROOT, ClsidEntry_Persist_Entry.c_str(), "", ClsidToString(PersistentGuid).c_str())); std::string ClsidEntry_Persist_Addin = CLSID_GUID_PERSIST_ADDIN_ENTRY; @@ -1502,99 +1502,99 @@ STDAPI DllUnregisterServer() return S_OK; } -extern "C" { - - // IStream callback - voidpf ZCALLBACK cb_sopen (voidpf opaque, const char* filename, int mode) { - return opaque; - } - - uLong ZCALLBACK cb_sread (voidpf opaque, voidpf stream, void* buf, uLong size) { - unsigned long newsize; - HRESULT hr; - - hr = ((IStream *)stream)->Read (buf, size, &newsize); - if (hr == S_OK){ - return (unsigned long)newsize; - } - else { - return (uLong)0; - } - } - - long ZCALLBACK cb_sseek (voidpf opaque, voidpf stream, uLong offset, int origin) { - // IStream::Seek parameters - HRESULT hr; - LARGE_INTEGER Move; - DWORD dwOrigin; - Move.QuadPart = (__int64)offset; - - switch (origin) { - case SEEK_CUR: - dwOrigin = STREAM_SEEK_CUR; - break; - case SEEK_END: - dwOrigin = STREAM_SEEK_END; - break; - case SEEK_SET: - dwOrigin = STREAM_SEEK_SET; - break; - default: - return -1; - } - - hr = ((IStream*)stream)->Seek (Move, dwOrigin, NULL); - if (hr == S_OK){ - return 0; - } - else { - return -1; - } - } - - long ZCALLBACK cb_stell (voidpf opaque, voidpf stream) { - // IStream::Seek parameters - HRESULT hr; - LARGE_INTEGER Move; - ULARGE_INTEGER NewPosition; - Move.QuadPart = 0; - NewPosition.QuadPart = 0; - - hr = ((IStream*)stream)->Seek (Move, STREAM_SEEK_CUR, &NewPosition); - if (hr == S_OK){ - return (long) NewPosition.QuadPart; - } - else { - return -1; - } - } - - int ZCALLBACK cb_sclose (voidpf opaque, voidpf stream) { - return 0; - } - - int ZCALLBACK cb_serror (voidpf opaque, voidpf stream) { - return 0; //RJK - for now - } - - uLong ZCALLBACK cb_swrite (voidpf opaque, voidpf stream, const void* buf, uLong size) { - HRESULT hr; - unsigned long writecount; - hr = ((IStream*)stream)->Write (buf, size, &writecount); - if (hr == S_OK) - return (unsigned int)writecount; - else - return (uLong)0; - } - - void fill_stream_filefunc (zlib_filefunc_def* pzlib_filefunc_def) { - pzlib_filefunc_def->zopen_file = cb_sopen; - pzlib_filefunc_def->zread_file = cb_sread; - pzlib_filefunc_def->zwrite_file = cb_swrite; - pzlib_filefunc_def->ztell_file = cb_stell; - pzlib_filefunc_def->zseek_file = cb_sseek; - pzlib_filefunc_def->zclose_file = cb_sclose; - pzlib_filefunc_def->zerror_file = cb_serror; - } -} +extern "C" { + + // IStream callback + voidpf ZCALLBACK cb_sopen (voidpf opaque, const char* filename, int mode) { + return opaque; + } + + uLong ZCALLBACK cb_sread (voidpf opaque, voidpf stream, void* buf, uLong size) { + unsigned long newsize; + HRESULT hr; + + hr = ((IStream *)stream)->Read (buf, size, &newsize); + if (hr == S_OK){ + return (unsigned long)newsize; + } + else { + return (uLong)0; + } + } + + long ZCALLBACK cb_sseek (voidpf opaque, voidpf stream, uLong offset, int origin) { + // IStream::Seek parameters + HRESULT hr; + LARGE_INTEGER Move; + DWORD dwOrigin; + Move.QuadPart = (__int64)offset; + + switch (origin) { + case SEEK_CUR: + dwOrigin = STREAM_SEEK_CUR; + break; + case SEEK_END: + dwOrigin = STREAM_SEEK_END; + break; + case SEEK_SET: + dwOrigin = STREAM_SEEK_SET; + break; + default: + return -1; + } + + hr = ((IStream*)stream)->Seek (Move, dwOrigin, NULL); + if (hr == S_OK){ + return 0; + } + else { + return -1; + } + } + + long ZCALLBACK cb_stell (voidpf opaque, voidpf stream) { + // IStream::Seek parameters + HRESULT hr; + LARGE_INTEGER Move; + ULARGE_INTEGER NewPosition; + Move.QuadPart = 0; + NewPosition.QuadPart = 0; + + hr = ((IStream*)stream)->Seek (Move, STREAM_SEEK_CUR, &NewPosition); + if (hr == S_OK){ + return (long) NewPosition.QuadPart; + } + else { + return -1; + } + } + + int ZCALLBACK cb_sclose (voidpf opaque, voidpf stream) { + return 0; + } + + int ZCALLBACK cb_serror (voidpf opaque, voidpf stream) { + return 0; //RJK - for now + } + + uLong ZCALLBACK cb_swrite (voidpf opaque, voidpf stream, const void* buf, uLong size) { + HRESULT hr; + unsigned long writecount; + hr = ((IStream*)stream)->Write (buf, size, &writecount); + if (hr == S_OK) + return (unsigned int)writecount; + else + return (uLong)0; + } + + void fill_stream_filefunc (zlib_filefunc_def* pzlib_filefunc_def) { + pzlib_filefunc_def->zopen_file = cb_sopen; + pzlib_filefunc_def->zread_file = cb_sread; + pzlib_filefunc_def->zwrite_file = cb_swrite; + pzlib_filefunc_def->ztell_file = cb_stell; + pzlib_filefunc_def->zseek_file = cb_sseek; + pzlib_filefunc_def->zclose_file = cb_sclose; + pzlib_filefunc_def->zerror_file = cb_serror; + } +} diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx index 8e14141d7e02..a661609eb803 100644 --- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx +++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx @@ -93,7 +93,7 @@ enum FilterState FilteringContent, // Filtering the content property FilteringProperty // Filtering the pseudo property }; -class COooFilter : public IFilter, public IPersistFile, public IPersistStream +class COooFilter : public IFilter, public IPersistFile, public IPersistStream { public: // From IUnknown @@ -140,16 +140,16 @@ public: virtual SCODE STDMETHODCALLTYPE GetCurFile( LPWSTR * ppszFileName); - // From IPersistStream - virtual SCODE STDMETHODCALLTYPE Load( - IStream *pStm); - - virtual SCODE STDMETHODCALLTYPE Save( - IStream *pStm, - BOOL fClearDirty); - - virtual SCODE STDMETHODCALLTYPE GetSizeMax( - ULARGE_INTEGER *pcbSize); + // From IPersistStream + virtual SCODE STDMETHODCALLTYPE Load( + IStream *pStm); + + virtual SCODE STDMETHODCALLTYPE Save( + IStream *pStm, + BOOL fClearDirty); + + virtual SCODE STDMETHODCALLTYPE GetSizeMax( + ULARGE_INTEGER *pcbSize); private: @@ -174,7 +174,7 @@ private: ULONG m_ChunkPosition; // Chunk pointer to specify the current Chunk; ULONG m_cAttributes; // Count of attributes CFullPropSpec * m_pAttributes; // Attributes to filter - IStream * m_pStream; + IStream * m_pStream; }; @@ -217,20 +217,20 @@ private: long m_lRefs; // Reference count }; -extern "C" { - - voidpf ZCALLBACK cb_sopen OF((voidpf opaque, const char * filename, int mode)); - uLong ZCALLBACK cb_sread OF((voidpf opaque, voidpf stream, void* vuf, uLong size)); - uLong ZCALLBACK cb_swrite OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); - long ZCALLBACK cb_stell OF((voidpf opaque, voidpf stream)); - long ZCALLBACK cb_sseek OF((voidpf opaque, voidpf stream, uLong offset, int origin)); - int ZCALLBACK cb_sclose OF((voidpf opaque, voidpf stream)); - int ZCALLBACK cb_serror OF((voidpf opaque, voidpf stream)); - - void fill_stream_filefunc (zlib_filefunc_def* pzlib_filefunc_def); - -} - +extern "C" { + + voidpf ZCALLBACK cb_sopen OF((voidpf opaque, const char * filename, int mode)); + uLong ZCALLBACK cb_sread OF((voidpf opaque, voidpf stream, void* vuf, uLong size)); + uLong ZCALLBACK cb_swrite OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); + long ZCALLBACK cb_stell OF((voidpf opaque, voidpf stream)); + long ZCALLBACK cb_sseek OF((voidpf opaque, voidpf stream, uLong offset, int origin)); + int ZCALLBACK cb_sclose OF((voidpf opaque, voidpf stream)); + int ZCALLBACK cb_serror OF((voidpf opaque, voidpf stream)); + + void fill_stream_filefunc (zlib_filefunc_def* pzlib_filefunc_def); + +} + -- cgit From 7cea4264b04ec6999045bae40f80428068cb7753 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Thu, 18 Feb 2010 12:19:49 +0100 Subject: #i10000# remove falsely resynced string --- shell/prj/build.lst | 2 -- 1 file changed, 2 deletions(-) (limited to 'shell') diff --git a/shell/prj/build.lst b/shell/prj/build.lst index 0d8559f1e0b5..9a5bf35dde3f 100755 --- a/shell/prj/build.lst +++ b/shell/prj/build.lst @@ -16,7 +16,6 @@ sl shell\source\all\zipfile nmake - w sl_all_zipfil sl shell\source\all\zipfile nmake - p sl_all_zipfile sl_inc NULL sl shell\source\all\ooofilereader nmake - w sl_all_ooofilereader sl_all_zipfile.w sl_all sl_inc NULL sl shell\source\all\ooofilereader nmake - p sl_all_ooofilereader sl_all_zipfile.w sl_all sl_inc NULL -sl shell\source\win32\shlxthandler\ooofilt\proxy nmake - w sl_win32_ooofiltproxy sl_inc NULL sl shell\source\win32\shlxthandler\res nmake - w sl_win32_shlxthandler_res sl_win32_lngconv.w sl_inc NULL sl shell\source\win32\shlxthandler\util nmake - w sl_win32_shlxthandler_util sl_inc NULL sl shell\source\win32\shlxthandler\propsheets nmake - w sl_win32_shlxthandler_propsheets sl_inc NULL @@ -24,7 +23,6 @@ sl shell\source\win32\shlxthandler\infotips nmake - w sl_win32_shlx sl shell\source\win32\shlxthandler\columninfo nmake - w sl_win32_shlxthandler_columninfo sl_inc NULL sl shell\source\win32\shlxthandler\thumbviewer nmake - w sl_win32_shlxthandler_thumbviewer sl_inc NULL sl shell\source\win32\shlxthandler\prophdl nmake - w sl_win32_shlxthandler_prophdl sl_win32_shlxthandler_ooofilt.w sl_inc NULL -sl shell\source\win32\shlxthandler\ooofilt nmake - w sl_win32_shlxthandler_ooofilt sl_all_zipfile.w sl_all_ooofilereader.w sl_win32_shlxthandler_util.w sl_all sl_inc NULL sl shell\source\win32\shlxthandler nmake - w sl_win32_shlxthandler sl_win32_lngconv.w sl_win32_shlxthandler_res.w sl_win32_shlxthandler_util.w sl_all_zipfile.w sl_all_ooofilereader.w sl_win32_shlxthandler_propsheets.w sl_win32_shlxthandler_infotips.w sl_win32_shlxthandler_columninfo.w sl_win32_shlxthandler_thumbviewer.w sl_win32_shlxthandler_prophdl.w sl_inc sl_win32_shlxthandler_ooofilt.w NULL sl shell\source\backends\localebe nmake - all sl_backends_localebe sl_inc NULL sl shell\source\backends\wininetbe nmake - w sl_backends_wininetbe sl_inc NULL -- cgit From d95aa4928a41713923feecd7138c744cd0a4ddc8 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Tue, 23 Feb 2010 15:52:34 +0100 Subject: #i10000# fix for buildbreaker --- shell/source/win32/shlxthandler/makefile.mk | 2 +- shell/source/win32/shlxthandler/ooofilt/makefile.mk | 9 +++++++-- shell/source/win32/shlxthandler/prophdl/makefile.mk | 14 +++++++++++--- 3 files changed, 19 insertions(+), 6 deletions(-) (limited to 'shell') diff --git a/shell/source/win32/shlxthandler/makefile.mk b/shell/source/win32/shlxthandler/makefile.mk index 69d247cf51f0..d543d91d9ef3 100755 --- a/shell/source/win32/shlxthandler/makefile.mk +++ b/shell/source/win32/shlxthandler/makefile.mk @@ -76,7 +76,7 @@ SHL1STDLIBS+=\ $(KERNEL32LIB)\ $(GDI32LIB)\ $(GDIPLUSLIB)\ - msvcprt.lib + msvcprt.lib \ $(SHLWAPILIB) SHL1LIBS+=$(SLB)$/util.lib\ diff --git a/shell/source/win32/shlxthandler/ooofilt/makefile.mk b/shell/source/win32/shlxthandler/ooofilt/makefile.mk index afd51c1dd4d7..0d2a40e147fe 100755 --- a/shell/source/win32/shlxthandler/ooofilt/makefile.mk +++ b/shell/source/win32/shlxthandler/ooofilt/makefile.mk @@ -74,7 +74,12 @@ SHL1STDLIBS+=$(OLE32LIB)\ $(SHELL32LIB)\ $(KERNEL32LIB)\ $(OLDNAMESLIB)\ - msvcprt.lib + msvcprt.lib + +.IF "$(PRODUCT)"!="full" +SHL1STDLIBS+=msvcrt.lib +.ENDIF + # $(LIBSTLPORTST) @@ -130,4 +135,4 @@ DEF1EXPORTFILE_X64=exports.dxp .INCLUDE : target.mk INCLUDE!:=$(subst,/stl, $(INCLUDE)) .EXPORT : INCLUDE -.INCLUDE : tg_wntx64.mk \ No newline at end of file +.INCLUDE : tg_wntx64.mk diff --git a/shell/source/win32/shlxthandler/prophdl/makefile.mk b/shell/source/win32/shlxthandler/prophdl/makefile.mk index b9153bf014de..572dcb938591 100755 --- a/shell/source/win32/shlxthandler/prophdl/makefile.mk +++ b/shell/source/win32/shlxthandler/prophdl/makefile.mk @@ -30,6 +30,7 @@ PRJNAME=shell TARGET=propertyhdl LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE +NO_DEFAULT_STL=YES USE_DEFFILE=TRUE .IF "$(BUILD_X64)"!="" USE_DEFFILE_X64=TRUE @@ -43,7 +44,7 @@ UWINAPILIB = UWINAPILIB_X64 = CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 -CFLAGS+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820 +CFLAGS+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820 -wd4100 CDEFS+=-D_WIN32_IE=0x501 # --- Files -------------------------------------------------------- @@ -72,7 +73,12 @@ SHL1STDLIBS+=\ $(GDI32LIB)\ $(GDIPLUSLIB)\ $(SHLWAPILIB)\ - $(PROPSYSLIB) + $(PROPSYSLIB) \ + msvcprt.lib + +.IF "$(PRODUCT)"!="full" +SHL1STDLIBS+=msvcrt.lib +.ENDIF SHL1LIBS+=$(SLB)$/util.lib\ $(SLB)$/ooofilereader.lib @@ -127,4 +133,6 @@ DEF1EXPORTFILE_X64=exports.dxp # --- Targets ------------------------------------------------------ .INCLUDE : set_wntx64.mk .INCLUDE : target.mk -.INCLUDE : tg_wntx64.mk \ No newline at end of file +INCLUDE!:=$(subst,/stl, $(INCLUDE)) +.EXPORT : INCLUDE +.INCLUDE : tg_wntx64.mk -- cgit From 4d8175599b8d193aba6eef89ef905c830b87d7e7 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Tue, 23 Feb 2010 16:13:08 +0100 Subject: #i10000# fix for buildbreaker --- shell/source/win32/shlxthandler/makefile.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/source/win32/shlxthandler/makefile.mk b/shell/source/win32/shlxthandler/makefile.mk index d543d91d9ef3..0c2abb405be0 100755 --- a/shell/source/win32/shlxthandler/makefile.mk +++ b/shell/source/win32/shlxthandler/makefile.mk @@ -125,7 +125,12 @@ SHL1STDLIBS_X64+=\ $(GDIPLUSLIB_X64) \ $(MSVCRT_X64) \ $(MSVCPRT_X64) \ - $(OLDNAMESLIB_X64) + $(OLDNAMESLIB_X64) \ + msvcprt.lib + +.IF "$(PRODUCT)"!="full" +SHL1STDLIBS+=msvcrt.lib +.ENDIF SHL1LIBS_X64+=$(SLB_X64)$/util.lib\ $(SLB_X64)$/ooofilereader.lib -- cgit From 1fb53ace3492c293080191a61e36f1d332511422 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 25 Feb 2010 15:59:15 +0100 Subject: sb118: #i109125# change source file copyright notice from Sun Microsystems to Oracle --- shell/source/backends/desktopbe/desktopbackend.cxx | 8 +++----- shell/source/backends/gconfbe/gconfaccess.cxx | 8 +++----- shell/source/backends/gconfbe/gconfaccess.hxx | 8 +++----- shell/source/backends/kde4be/kde4access.cxx | 8 +++----- shell/source/backends/kde4be/kde4access.hxx | 8 +++----- shell/source/backends/kdebe/kdeaccess.cxx | 8 +++----- shell/source/backends/kdebe/kdeaccess.hxx | 8 +++----- 7 files changed, 21 insertions(+), 35 deletions(-) (limited to 'shell') diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx index 41d0c89f96b7..21371755b479 100644 --- a/shell/source/backends/desktopbe/desktopbackend.cxx +++ b/shell/source/backends/desktopbe/desktopbackend.cxx @@ -1,14 +1,11 @@ /************************************************************************* +* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * -* Copyright 2009 by Sun Microsystems, Inc. +* Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * -* $RCSfile: code,v $ -* -* $Revision: 1.4 $ -* * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -25,6 +22,7 @@ * version 3 along with OpenOffice.org. If not, see * * for a copy of the LGPLv3 License. +* ************************************************************************/ #include "precompiled_shell.hxx" diff --git a/shell/source/backends/gconfbe/gconfaccess.cxx b/shell/source/backends/gconfbe/gconfaccess.cxx index 20de0af6ef3d..99a5b362c161 100644 --- a/shell/source/backends/gconfbe/gconfaccess.cxx +++ b/shell/source/backends/gconfbe/gconfaccess.cxx @@ -1,14 +1,11 @@ /************************************************************************* +* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * -* Copyright 2009 by Sun Microsystems, Inc. +* Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * -* $RCSfile: code,v $ -* -* $Revision: 1.4 $ -* * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -25,6 +22,7 @@ * version 3 along with OpenOffice.org. If not, see * * for a copy of the LGPLv3 License. +* ************************************************************************/ #include "precompiled_shell.hxx" diff --git a/shell/source/backends/gconfbe/gconfaccess.hxx b/shell/source/backends/gconfbe/gconfaccess.hxx index ad156974b150..7fdd82ff05e7 100644 --- a/shell/source/backends/gconfbe/gconfaccess.hxx +++ b/shell/source/backends/gconfbe/gconfaccess.hxx @@ -1,14 +1,11 @@ /************************************************************************* +* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * -* Copyright 2009 by Sun Microsystems, Inc. +* Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * -* $RCSfile: code,v $ -* -* $Revision: 1.4 $ -* * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -25,6 +22,7 @@ * version 3 along with OpenOffice.org. If not, see * * for a copy of the LGPLv3 License. +* ************************************************************************/ #ifndef INCLUDED_SHELL_SOURCE_BACKENDS_GCONFBE_GCONFACCESS_HXX diff --git a/shell/source/backends/kde4be/kde4access.cxx b/shell/source/backends/kde4be/kde4access.cxx index 888f5cdc82fe..336d2d4a458e 100644 --- a/shell/source/backends/kde4be/kde4access.cxx +++ b/shell/source/backends/kde4be/kde4access.cxx @@ -1,14 +1,11 @@ /************************************************************************* +* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * -* Copyright 2009 by Sun Microsystems, Inc. +* Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * -* $RCSfile: code,v $ -* -* $Revision: 1.4 $ -* * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -25,6 +22,7 @@ * version 3 along with OpenOffice.org. If not, see * * for a copy of the LGPLv3 License. +* ************************************************************************/ #include "precompiled_shell.hxx" diff --git a/shell/source/backends/kde4be/kde4access.hxx b/shell/source/backends/kde4be/kde4access.hxx index 2edd2f3a8686..bfb7bc1ac945 100644 --- a/shell/source/backends/kde4be/kde4access.hxx +++ b/shell/source/backends/kde4be/kde4access.hxx @@ -1,14 +1,11 @@ /************************************************************************* +* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * -* Copyright 2009 by Sun Microsystems, Inc. +* Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * -* $RCSfile: code,v $ -* -* $Revision: 1.4 $ -* * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -25,6 +22,7 @@ * version 3 along with OpenOffice.org. If not, see * * for a copy of the LGPLv3 License. +* ************************************************************************/ #ifndef INCLUDED_SHELL_SOURCE_BACKENDS_KDE4BE_KDE4ACCESS_HXX diff --git a/shell/source/backends/kdebe/kdeaccess.cxx b/shell/source/backends/kdebe/kdeaccess.cxx index 2058cc6271b9..618d74b5eacf 100644 --- a/shell/source/backends/kdebe/kdeaccess.cxx +++ b/shell/source/backends/kdebe/kdeaccess.cxx @@ -1,14 +1,11 @@ /************************************************************************* +* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * -* Copyright 2009 by Sun Microsystems, Inc. +* Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * -* $RCSfile: code,v $ -* -* $Revision: 1.4 $ -* * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -25,6 +22,7 @@ * version 3 along with OpenOffice.org. If not, see * * for a copy of the LGPLv3 License. +* ************************************************************************/ #include "precompiled_shell.hxx" diff --git a/shell/source/backends/kdebe/kdeaccess.hxx b/shell/source/backends/kdebe/kdeaccess.hxx index 5e61f5a224e0..36a22e23db9a 100644 --- a/shell/source/backends/kdebe/kdeaccess.hxx +++ b/shell/source/backends/kdebe/kdeaccess.hxx @@ -1,14 +1,11 @@ /************************************************************************* +* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * -* Copyright 2009 by Sun Microsystems, Inc. +* Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * -* $RCSfile: code,v $ -* -* $Revision: 1.4 $ -* * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -25,6 +22,7 @@ * version 3 along with OpenOffice.org. If not, see * * for a copy of the LGPLv3 License. +* ************************************************************************/ #ifndef INCLUDED_SHELL_SOURCE_BACKENDS_KDEBE_KDEACCESS_HXX -- cgit From fea6cf46ea0cc4f25aed62cb4f06377fe190661d Mon Sep 17 00:00:00 2001 From: Rene Engelhard Date: Thu, 4 Mar 2010 00:11:19 +0100 Subject: sb118: add missing CFLAGS+= $(CPPUNIT_CFLAGS) to loads of other makefiles, too --- shell/qa/makefile.mk | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'shell') diff --git a/shell/qa/makefile.mk b/shell/qa/makefile.mk index a9047f97cf83..b918d571adfa 100755 --- a/shell/qa/makefile.mk +++ b/shell/qa/makefile.mk @@ -37,6 +37,10 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +.IF "$(SYSTEM_CPPUNIT)"=="YES" +CFLAGS+= $(CPPUNIT_CFLAGS) +.ENDIF + # BEGIN ---------------------------------------------------------------- # auto generated Target:testjob by codegen.pl -- cgit From ff783db420cdb801613ca46ffec6dc6812d9ad0d Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 4 Mar 2010 22:13:08 +0100 Subject: sb118: #i109791# improved CPPUNIT_CFLAGS handling --- shell/qa/makefile.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'shell') diff --git a/shell/qa/makefile.mk b/shell/qa/makefile.mk index b918d571adfa..cc91a6b1ad5c 100755 --- a/shell/qa/makefile.mk +++ b/shell/qa/makefile.mk @@ -37,9 +37,7 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk -.IF "$(SYSTEM_CPPUNIT)"=="YES" -CFLAGS+= $(CPPUNIT_CFLAGS) -.ENDIF +CFLAGSCXX += $(CPPUNIT_CFLAGS) # BEGIN ---------------------------------------------------------------- # auto generated Target:testjob by codegen.pl -- cgit From 47f52adce81cde0b8a74c7f73c0e695911b47d82 Mon Sep 17 00:00:00 2001 From: tono Date: Fri, 5 Mar 2010 19:15:20 +0900 Subject: i#109673: Mingw port fix: new Windows property handler --- shell/source/win32/shlxthandler/makefile.mk | 10 ++++++++-- shell/source/win32/shlxthandler/ooofilt/makefile.mk | 7 +++++-- shell/source/win32/shlxthandler/prophdl/makefile.mk | 6 +++++- shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx | 4 ++++ 4 files changed, 22 insertions(+), 5 deletions(-) (limited to 'shell') diff --git a/shell/source/win32/shlxthandler/makefile.mk b/shell/source/win32/shlxthandler/makefile.mk index 0c2abb405be0..4452cb1a90e6 100755 --- a/shell/source/win32/shlxthandler/makefile.mk +++ b/shell/source/win32/shlxthandler/makefile.mk @@ -75,8 +75,14 @@ SHL1STDLIBS+=\ $(SHELL32LIB)\ $(KERNEL32LIB)\ $(GDI32LIB)\ - $(GDIPLUSLIB)\ - msvcprt.lib \ + $(GDIPLUSLIB) + +.IF "$(COM)"!="GCC" +SHL1STDLIBS+=\ + msvcprt.lib +.ENDIF + +SHL1STDLIBS+=\ $(SHLWAPILIB) SHL1LIBS+=$(SLB)$/util.lib\ diff --git a/shell/source/win32/shlxthandler/ooofilt/makefile.mk b/shell/source/win32/shlxthandler/ooofilt/makefile.mk index 0d2a40e147fe..9111069ab889 100755 --- a/shell/source/win32/shlxthandler/ooofilt/makefile.mk +++ b/shell/source/win32/shlxthandler/ooofilt/makefile.mk @@ -73,12 +73,15 @@ SHL1STDLIBS+=$(OLE32LIB)\ $(UUIDLIB)\ $(SHELL32LIB)\ $(KERNEL32LIB)\ - $(OLDNAMESLIB)\ - msvcprt.lib + $(OLDNAMESLIB) + +.IF "$(COM)"!="GCC" +SHL1STDLIBS+=msvcprt.lib .IF "$(PRODUCT)"!="full" SHL1STDLIBS+=msvcrt.lib .ENDIF +.ENDIF # $(LIBSTLPORTST) diff --git a/shell/source/win32/shlxthandler/prophdl/makefile.mk b/shell/source/win32/shlxthandler/prophdl/makefile.mk index 572dcb938591..dc6d0e159046 100755 --- a/shell/source/win32/shlxthandler/prophdl/makefile.mk +++ b/shell/source/win32/shlxthandler/prophdl/makefile.mk @@ -73,12 +73,16 @@ SHL1STDLIBS+=\ $(GDI32LIB)\ $(GDIPLUSLIB)\ $(SHLWAPILIB)\ - $(PROPSYSLIB) \ + $(PROPSYSLIB) + +.IF "$(COM)"!="GCC" +SHL1STDLIBS+=\ msvcprt.lib .IF "$(PRODUCT)"!="full" SHL1STDLIBS+=msvcrt.lib .ENDIF +.ENDIF SHL1LIBS+=$(SLB)$/util.lib\ $(SLB)$/ooofilereader.lib diff --git a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx index 3cece320ace4..3f495a7aa53d 100755 --- a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx +++ b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx @@ -222,7 +222,11 @@ HRESULT STDMETHODCALLTYPE CPropertyHdl::Initialize( IStream *pStream, DWORD grfM if ( !m_pCache ) { +#ifdef __MINGW32__ + if ( FAILED( PSCreateMemoryPropertyStore( IID_IPropertyStoreCache, reinterpret_cast(&m_pCache) ) ) ) +#else if ( FAILED( PSCreateMemoryPropertyStore( IID_PPV_ARGS( &m_pCache ) ) ) ) +#endif OutputDebugStringFormat( "CPropertyHdl::Initialize: PSCreateMemoryPropertyStore failed" ); zlib_filefunc_def z_filefunc; -- cgit From 7e06f4dfbdb87688d7d2fd1bd68ff98aa71116bd Mon Sep 17 00:00:00 2001 From: tono Date: Sun, 7 Mar 2010 06:59:41 +0900 Subject: mingwport29: Windows API version check fix (see i108416 and cws ause113) --- shell/source/win32/shlxthandler/propsheets/makefile.mk | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'shell') diff --git a/shell/source/win32/shlxthandler/propsheets/makefile.mk b/shell/source/win32/shlxthandler/propsheets/makefile.mk index fd83f33b9960..55a31c9c59d3 100644 --- a/shell/source/win32/shlxthandler/propsheets/makefile.mk +++ b/shell/source/win32/shlxthandler/propsheets/makefile.mk @@ -35,13 +35,14 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk -CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 +CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE +CDEFS+=-U_WIN32_WINNT -D_WIN32_WINNT=0x0501 -U_WIN32_IE -D_WIN32_IE=0x501 +.IF "$(COM)"!="GCC" CFLAGS+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820 -CDEFS+=-D_WIN32_IE=0x501 - -CFLAGS_X64+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 +CFLAGS_X64+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE CFLAGS_X64+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820 -CDEFS_X64+=-D_WIN32_IE=0x501 +CDEFS_X64+=-D_WIN32_WINNT=0x0501 -D_WIN32_IE=0x501 +.ENDIF # --- Files -------------------------------------------------------- -- cgit From fcf883e6883a699f8b8b3b3c34eeb9ede9230eee Mon Sep 17 00:00:00 2001 From: tono Date: Wed, 24 Mar 2010 19:26:36 +0900 Subject: i#110194: Mingw port update fix: use alloca instead of _alloca in shell --- shell/source/backends/wininetbe/wininetbackend.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'shell') diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx b/shell/source/backends/wininetbe/wininetbackend.cxx index e28bab3affe4..af6f1036496d 100644 --- a/shell/source/backends/wininetbe/wininetbackend.cxx +++ b/shell/source/backends/wininetbe/wininetbackend.cxx @@ -37,6 +37,7 @@ #endif #include #include +#include #if defined _MSC_VER #pragma warning(pop) #endif @@ -138,11 +139,11 @@ WinInetBackend::WinInetBackend() // in a stack overflow exception, we assume // this never happens, because of the relatively // small amount of memory we need - // _alloca is nice because it is fast and we don't + // alloca is nice because it is fast and we don't // have to free the allocated memory, it will be // automatically done lpi = reinterpret_cast< LPINTERNET_PROXY_INFO >( - _alloca( dwLength ) ); + alloca( dwLength ) ); bRet = lpfnInternetQueryOption( NULL, -- cgit