diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2012-11-28 10:53:20 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2012-11-28 16:33:01 +0100 |
commit | 0af524741660bd0ad734ebe7922b81e3af0297d4 (patch) | |
tree | 9e2a0728475693a88950c57260f41e490f098089 /sysui | |
parent | 33a6f881805122b7d2c2124d3d5fc8914dae94c5 (diff) |
sysui: remove some unused stuff
Change-Id: I6d18017311013f3bb63451c4b6f59f82f02f918a
Diffstat (limited to 'sysui')
-rw-r--r-- | sysui/prj/build.lst | 2 | ||||
-rw-r--r-- | sysui/source/win32/misc/AutoBuffer.cxx | 153 | ||||
-rw-r--r-- | sysui/source/win32/misc/AutoBuffer.hxx | 73 | ||||
-rw-r--r-- | sysui/source/win32/misc/WinImplHelper.cxx | 348 | ||||
-rw-r--r-- | sysui/source/win32/misc/WinImplHelper.hxx | 74 | ||||
-rw-r--r-- | sysui/source/win32/misc/makefile.mk | 43 | ||||
-rw-r--r-- | sysui/source/win32/misc/resourceprovider.cxx | 217 | ||||
-rw-r--r-- | sysui/source/win32/misc/resourceprovider.hxx | 44 | ||||
-rw-r--r-- | sysui/util/exports.dxp | 1 |
9 files changed, 0 insertions, 955 deletions
diff --git a/sysui/prj/build.lst b/sysui/prj/build.lst index 6cd060b40461..0298d9164717 100644 --- a/sysui/prj/build.lst +++ b/sysui/prj/build.lst @@ -1,6 +1,4 @@ su sysui : offapi DESKTOP:l10ntools NULL -#su sysui\source\win32\QuickStart nmake - w su_win32_quickstart NULL -#su sysui\source\win32\QuickStart\so nmake - w su_win32_quickstart_so su_win32_quickstart.w NULL su sysui\desktop\icons nmake - w su_iconsw NULL su sysui\desktop\macosx nmake - u su_dtmacosx su_dtshare.u NULL su sysui\desktop\cleanversion nmake - u su_dtcleanversion NULL diff --git a/sysui/source/win32/misc/AutoBuffer.cxx b/sysui/source/win32/misc/AutoBuffer.cxx deleted file mode 100644 index f072df5a9666..000000000000 --- a/sysui/source/win32/misc/AutoBuffer.cxx +++ /dev/null @@ -1,153 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "AutoBuffer.hxx" -#include <osl/diagnose.h> - -#include <windows.h> - -//------------------------------------------------------------------------ -// namespace directives -//------------------------------------------------------------------------ - -using rtl::OUString; - -//------------------------------------------------------------------------ -// -//------------------------------------------------------------------------ - -CAutoUnicodeBuffer::CAutoUnicodeBuffer( size_t size, sal_Bool bLazyCreation ) : - m_buffSize( size ), - m_pBuff( NULL ) -{ - if ( !bLazyCreation ) - init( ); -} - -//------------------------------------------------------------------------ -// -//------------------------------------------------------------------------ - -CAutoUnicodeBuffer::~CAutoUnicodeBuffer( ) -{ - delete [] m_pBuff; -} - -//------------------------------------------------------------------------ -// -//------------------------------------------------------------------------ - -sal_Bool SAL_CALL CAutoUnicodeBuffer::resize( size_t new_size ) -{ - OSL_ASSERT( new_size >= 0 ); - - if ( new_size != m_buffSize ) - { - if ( new_size > m_buffSize ) - { - delete [] m_pBuff; - m_pBuff = NULL; - } - - m_buffSize = new_size; - } - - return sal_True; -} - -//------------------------------------------------------------------------ -// -//------------------------------------------------------------------------ - -void SAL_CALL CAutoUnicodeBuffer::empty( ) -{ - if ( m_pBuff ) - ZeroMemory( m_pBuff, m_buffSize * sizeof( sal_Unicode ) ); -} - -//------------------------------------------------------------------------ -// -//------------------------------------------------------------------------ - -sal_Bool SAL_CALL CAutoUnicodeBuffer::fill( const sal_Unicode* pContent, size_t nLen ) -{ - OSL_ASSERT( pContent && m_buffSize && (m_buffSize >= nLen) ); - - init( ); - - sal_Bool bRet = sal_False; - - if ( m_pBuff && pContent && nLen ) - { - CopyMemory( m_pBuff, pContent, nLen * sizeof( sal_Unicode ) ); - bRet = sal_True; - } - - return bRet; -} - -//------------------------------------------------------------------------ -// -//------------------------------------------------------------------------ - -size_t SAL_CALL CAutoUnicodeBuffer::size( ) const -{ - return m_buffSize; -} - -//------------------------------------------------------------------------ -// -//------------------------------------------------------------------------ - -CAutoUnicodeBuffer::operator sal_Unicode*( ) -{ - return m_pBuff; -} - -//------------------------------------------------------------------------ -// -//------------------------------------------------------------------------ - -sal_Unicode* CAutoUnicodeBuffer::operator&( ) -{ - return m_pBuff; -} - -//------------------------------------------------------------------------ -// -//------------------------------------------------------------------------ - -const sal_Unicode* CAutoUnicodeBuffer::operator&( ) const -{ - return m_pBuff; -} - -//------------------------------------------------------------------------ -// -//------------------------------------------------------------------------ - -void SAL_CALL CAutoUnicodeBuffer::init( ) -{ - if ( !m_pBuff && (m_buffSize > 0) ) - m_pBuff = new sal_Unicode[ m_buffSize ]; - - empty( ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sysui/source/win32/misc/AutoBuffer.hxx b/sysui/source/win32/misc/AutoBuffer.hxx deleted file mode 100644 index eb224e762bf7..000000000000 --- a/sysui/source/win32/misc/AutoBuffer.hxx +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef _AUTO_BUFFER_HXX_ -#define _AUTO_BUFFER_HXX_ - -#include <sal/types.h> - -#include <rtl/ustring> - -//------------------------------------------------------------- -// A simple unicode buffer management class, the class itself -// is responsible for the allocated unicode buffer, any -// modification of the buffer size outside the class may lead -// to undefined behaviour -//------------------------------------------------------------- - -class CAutoUnicodeBuffer -{ -public: - - // if bLazyCreation is true the buffer will be created - // when someone wants to fill the buffer - CAutoUnicodeBuffer( size_t size, sal_Bool bLazyCreation = sal_False ); - ~CAutoUnicodeBuffer( ); - - // resizes the buffer - sal_Bool SAL_CALL resize( size_t new_size ); - - // zeros the buffer - void SAL_CALL empty( ); - - // fills the buffer with a given content - sal_Bool SAL_CALL fill( const sal_Unicode* pContent, size_t nLen ); - - // returns the size of the buffer - size_t SAL_CALL size( ) const; - - // conversion operator - operator sal_Unicode*( ); - - // address operator - sal_Unicode* operator&( ); - - const sal_Unicode* operator&( ) const; - -private: - void SAL_CALL init( ); - -private: - size_t m_buffSize; // the number of unicode chars - sal_Unicode* m_pBuff; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sysui/source/win32/misc/WinImplHelper.cxx b/sysui/source/win32/misc/WinImplHelper.cxx deleted file mode 100644 index a5ada601df44..000000000000 --- a/sysui/source/win32/misc/WinImplHelper.cxx +++ /dev/null @@ -1,348 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <osl/diagnose.h> -#include "AutoBuffer.hxx" -#include "WinImplHelper.hxx" -#include <com/sun/star/uno/Sequence.hxx> - -#include <windows.h> - -//------------------------------------------------------------ -// namespace directives -//------------------------------------------------------------ - -using rtl::OUString; -using ::com::sun::star::lang::IllegalArgumentException; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::XInterface; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Sequence; - -//------------------------------------------------------------ -// determine if we are running under Win2000 -//------------------------------------------------------------ - -sal_Bool SAL_CALL IsWin2000( ) -{ - OSVERSIONINFOEX osvi; - BOOL bOsVersionInfoEx; - sal_Bool bRet = sal_False; - - osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFOEX ); - bOsVersionInfoEx = GetVersionEx( ( OSVERSIONINFO* )&osvi ); - if( !bOsVersionInfoEx ) - { - // if OSVERSIONINFOEX doesn't work - osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFO ); - if( !GetVersionEx( ( OSVERSIONINFO* )&osvi ) ) - return sal_False; - } - - if( ( VER_PLATFORM_WIN32_NT == osvi.dwPlatformId ) && ( osvi.dwMajorVersion >= 5 ) ) - bRet = sal_True; - - return bRet; -} - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -void SAL_CALL ListboxAddString( HWND hwnd, const OUString& aString ) -{ - LRESULT rc = SendMessageW( - hwnd, CB_ADDSTRING, 0, reinterpret_cast< LPARAM >(aString.getStr( )) ); - - OSL_ASSERT( (CB_ERR != rc) && (CB_ERRSPACE != rc) ); -} - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -OUString SAL_CALL ListboxGetString( HWND hwnd, sal_Int32 aPosition ) -{ - OSL_ASSERT( IsWindow( hwnd ) ); - - OUString aString; - - LRESULT lItem = - SendMessageW( hwnd, CB_GETLBTEXTLEN, aPosition, 0 ); - - if ( (CB_ERR != lItem) && (lItem > 0) ) - { - // message returns the len of a combobox item - // without trailing '\0' that's why += 1 - lItem++; - - CAutoUnicodeBuffer aBuff( lItem ); - - LRESULT lRet = - SendMessageW( - hwnd, CB_GETLBTEXT, aPosition, - reinterpret_cast<LPARAM>(&aBuff) ); - - OSL_ASSERT( lRet != CB_ERR ); - - if ( CB_ERR != lRet ) - aString = OUString( aBuff, lRet ); - } - - return aString; -} - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -void SAL_CALL ListboxAddItem( HWND hwnd, const Any& aItem, const Reference< XInterface >& rXInterface, sal_Int16 aArgPos ) - throw( IllegalArgumentException ) -{ - OSL_ASSERT( IsWindow( hwnd ) ); - - if ( !aItem.hasValue( ) || - aItem.getValueType( ) != getCppuType((OUString*)0) ) - throw IllegalArgumentException( - "invalid value type or any has no value", - rXInterface, - aArgPos ); - - OUString cbItem; - aItem >>= cbItem; - - ListboxAddString( hwnd, cbItem ); -} - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -void SAL_CALL ListboxAddItems( HWND hwnd, const Any& aItemList, const Reference< XInterface >& rXInterface, sal_Int16 aArgPos ) - throw( IllegalArgumentException ) -{ - OSL_ASSERT( IsWindow( hwnd ) ); - - if ( !aItemList.hasValue( ) || - aItemList.getValueType( ) != getCppuType((Sequence<OUString>*)0) ) - throw IllegalArgumentException( - "invalid value type or any has no value", - rXInterface, - aArgPos ); - - Sequence< OUString > aStringList; - aItemList >>= aStringList; - - sal_Int32 nItemCount = aStringList.getLength( ); - for( sal_Int32 i = 0; i < nItemCount; i++ ) - { - ListboxAddString( hwnd, aStringList[i] ); - } -} - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -void SAL_CALL ListboxDeleteItem( HWND hwnd, const Any& aPosition, const Reference< XInterface >& rXInterface, sal_Int16 aArgPos ) - throw( IllegalArgumentException ) -{ - OSL_ASSERT( IsWindow( hwnd ) ); - - if ( !aPosition.hasValue( ) || - ( (aPosition.getValueType( ) != getCppuType((sal_Int32*)0)) && - (aPosition.getValueType( ) != getCppuType((sal_Int16*)0)) && - (aPosition.getValueType( ) != getCppuType((sal_Int8*)0)) ) ) - throw IllegalArgumentException( - "invalid value type or any has no value", - rXInterface, - aArgPos ); - - sal_Int32 nPos; - aPosition >>= nPos; - - LRESULT lRet = SendMessage( hwnd, CB_DELETESTRING, nPos, 0 ); - - // if the return value is CB_ERR the given - // index was not correct - if ( CB_ERR == lRet ) - throw IllegalArgumentException( - "inavlid item position", - rXInterface, - aArgPos ); -} - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -void SAL_CALL ListboxDeleteItems( HWND hwnd, const Any& /*unused*/, const Reference< XInterface >& rXInterface, sal_Int16 aArgPos ) - throw( IllegalArgumentException ) -{ - OSL_ASSERT( IsWindow( hwnd ) ); - - LRESULT lRet = 0; - - do - { - // the return value on success is the number - // of remaining elements in the listbox - lRet = SendMessageW( hwnd, CB_DELETESTRING, 0, 0 ); - } - while ( (lRet != CB_ERR) && (lRet > 0) ); -} - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -void SAL_CALL ListboxSetSelectedItem( HWND hwnd, const Any& aPosition, const Reference< XInterface >& rXInterface, sal_Int16 aArgPos ) - throw( IllegalArgumentException ) -{ - OSL_ASSERT( IsWindow( hwnd ) ); - - if ( !aPosition.hasValue( ) || - ( (aPosition.getValueType( ) != getCppuType((sal_Int32*)0)) && - (aPosition.getValueType( ) != getCppuType((sal_Int16*)0)) && - (aPosition.getValueType( ) != getCppuType((sal_Int8*)0)) ) ) - throw IllegalArgumentException( - "invalid value type or any has no value", - rXInterface, - aArgPos ); - - sal_Int32 nPos; - aPosition >>= nPos; - - if ( nPos < -1 ) - throw IllegalArgumentException( - "invalid index", - rXInterface, - aArgPos ); - - LRESULT lRet = SendMessageW( hwnd, CB_SETCURSEL, nPos, 0 ); - - if ( (CB_ERR == lRet) && (-1 != nPos) ) - throw IllegalArgumentException( - "invalid index", - rXInterface, - aArgPos ); -} - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -Any SAL_CALL ListboxGetItems( HWND hwnd ) -{ - OSL_ASSERT( IsWindow( hwnd ) ); - - LRESULT nItemCount = SendMessageW( hwnd, CB_GETCOUNT, 0, 0 ); - - Sequence< OUString > aItemList; - - if ( CB_ERR != nItemCount ) - { - aItemList.realloc( nItemCount ); - - for ( sal_Int32 i = 0; i < nItemCount; i++ ) - { - aItemList[i] = ListboxGetString( hwnd, i ); - } - } - - Any aAny; - aAny <<= aItemList; - - return aAny; -} - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -Any SAL_CALL ListboxGetSelectedItem( HWND hwnd ) -{ - OSL_ASSERT( IsWindow( hwnd ) ); - - LRESULT idxItem = SendMessageW( hwnd, CB_GETCURSEL, 0, 0 ); - - Any aAny; - aAny <<= ListboxGetString( hwnd, idxItem ); - - return aAny; -} - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -Any SAL_CALL CheckboxGetState( HWND hwnd ) -{ - OSL_ASSERT( IsWindow( hwnd ) ); - - LRESULT lChkState = SendMessageW( hwnd, BM_GETCHECK, 0, 0 ); - sal_Bool bChkState = (lChkState == BST_CHECKED) ? sal_True : sal_False; - Any aAny; - aAny.setValue( &bChkState, getCppuType((sal_Bool*)0) ); - return aAny; -} - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -void SAL_CALL CheckboxSetState( - HWND hwnd, const ::com::sun::star::uno::Any& aState, const Reference< XInterface >& rXInterface, sal_Int16 aArgPos ) - throw( IllegalArgumentException ) -{ - OSL_ASSERT( IsWindow( hwnd ) ); - - if ( !aState.hasValue( ) || - aState.getValueType( ) != getCppuType((sal_Bool*)0) ) - throw IllegalArgumentException( - "invalid value type or any has no value", - rXInterface, - aArgPos ); - - sal_Bool bCheckState = *reinterpret_cast< const sal_Bool* >( aState.getValue( ) ); - WPARAM wParam = bCheckState ? BST_CHECKED : BST_UNCHECKED; - SendMessageW( hwnd, BM_SETCHECK, wParam, 0 ); -} - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -sal_uInt32 SAL_CALL _wcslenex( const sal_Unicode* pStr ) -{ - if ( !pStr ) - return 0; - - const sal_Unicode* pTemp = pStr; - sal_uInt32 strLen = 0; - while( *pTemp || *(pTemp + 1) ) - { - pTemp++; - strLen++; - } - - return strLen; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sysui/source/win32/misc/WinImplHelper.hxx b/sysui/source/win32/misc/WinImplHelper.hxx deleted file mode 100644 index 331dbc12d003..000000000000 --- a/sysui/source/win32/misc/WinImplHelper.hxx +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#ifndef _WINIMPLHELPER_HXX_ -#define _WINIMPLHELPER_HXX_ - -#include <sal/types.h> - -#include <rtl/ustring> - -#include <windows.h> -#include <com/sun/star/uno/Any.hxx> -#include <com/sun/star/lang/IllegalArgumentException.hpp> - -sal_Bool SAL_CALL IsWin2000( ); - -// set actions -void SAL_CALL ListboxAddItem( - HWND hwnd, const ::com::sun::star::uno::Any& aItem, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rXInterface, sal_Int16 aArgPos ) - throw( ::com::sun::star::lang::IllegalArgumentException ); - -void SAL_CALL ListboxAddItems( - HWND hwnd, const ::com::sun::star::uno::Any& aItemList, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rXInterface, sal_Int16 aArgPos ) - throw( ::com::sun::star::lang:: IllegalArgumentException ); - -void SAL_CALL ListboxDeleteItem( - HWND hwnd, const ::com::sun::star::uno::Any& aPosition, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rXInterface, sal_Int16 aArgPos ) - throw( ::com::sun::star::lang::IllegalArgumentException ); - -void SAL_CALL ListboxDeleteItems( - HWND hwnd, const ::com::sun::star::uno::Any& aUnused, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rXInterface, sal_Int16 aArgPos ) - throw( ::com::sun::star::lang::IllegalArgumentException ); - -void SAL_CALL ListboxSetSelectedItem( - HWND hwnd, const ::com::sun::star::uno::Any& aPosition, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rXInterface, sal_Int16 aArgPos ) - throw( ::com::sun::star::lang::IllegalArgumentException ); - -// get actions -::com::sun::star::uno::Any SAL_CALL ListboxGetItems( HWND hwnd ); -::com::sun::star::uno::Any SAL_CALL ListboxGetSelectedItem( HWND hwnd ); - -// checkbox helper functions -::com::sun::star::uno::Any SAL_CALL CheckboxGetState( HWND hwnd ); - -void SAL_CALL CheckboxSetState( - HWND hwnd, const ::com::sun::star::uno::Any& aState, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rXInterface, sal_Int16 aArgPos ) - throw( ::com::sun::star::lang::IllegalArgumentException ); - -// calculates the length of '\0' separated and '\0\0' -// ending strings used in some Win32 functions -// e.g. Filter\0*.txt\0\0 -// the returned length excludes the last '\0' -sal_uInt32 SAL_CALL _wcslenex( const sal_Unicode* pStr ); - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sysui/source/win32/misc/makefile.mk b/sysui/source/win32/misc/makefile.mk deleted file mode 100644 index cbb9c5f53b20..000000000000 --- a/sysui/source/win32/misc/makefile.mk +++ /dev/null @@ -1,43 +0,0 @@ -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -PRJ=..$/..$/.. -PRJNAME=sysui -TARGET=utils -LIBTARGET=NO - -# --- Settings ---------------------------------- - -.INCLUDE : settings.mk - -CFLAGS+=/GX - -# --- Files ------------------------------------- - -SLOFILES=$(SLO)$/WinImplHelper.obj\ - $(SLO)$/AutoBuffer.obj\ - $(SLO)$/resourceprovider.obj - -LIB1TARGET=$(SLB)$/$(TARGET).lib -LIB1OBJFILES=$(SLOFILES) - -# --- Targets ---------------------------------- - -.INCLUDE : target.mk - - diff --git a/sysui/source/win32/misc/resourceprovider.cxx b/sysui/source/win32/misc/resourceprovider.cxx deleted file mode 100644 index e79428886069..000000000000 --- a/sysui/source/win32/misc/resourceprovider.cxx +++ /dev/null @@ -1,217 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <osl/diagnose.h> -#include <rtl/ustrbuf.hxx> -#include "resourceprovider.hxx" -#include <tools/resmgr.hxx> -#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp> -#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> - -#include <svtools/svtools.hrc> - -//------------------------------------------------------------ -// namespace directives -//------------------------------------------------------------ - -using rtl::OUString; -using namespace ::com::sun::star::ui::dialogs::ExtendedFilePickerElementIds; -using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds; - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -// because the label of a listbox is -// a control itself (static text) we -// have defined a control id for this -// label which is the listbox control -// id + 100 -#define LB_LABEL_OFFSET 100 - -const rtl::OUString TILDE( "~" ); -const sal_Unicode TILDE_SIGN = L'~'; - -#define FOLDERPICKER_TITLE 500 -#define FOLDER_PICKER_DEF_DESCRIPTION 501 - -//------------------------------------------------------------ -// we have to translate control ids to resource ids -//------------------------------------------------------------ - -struct _Entry -{ - sal_Int32 ctrlId; - sal_Int16 resId; -}; - -_Entry CtrlIdToResIdTable[] = { - { CHECKBOX_AUTOEXTENSION, STR_SVT_FILEPICKER_AUTO_EXTENSION }, - { CHECKBOX_PASSWORD, STR_SVT_FILEPICKER_PASSWORD }, - { CHECKBOX_FILTEROPTIONS, STR_SVT_FILEPICKER_FILTER_OPTIONS }, - { CHECKBOX_READONLY, STR_SVT_FILEPICKER_READONLY }, - { CHECKBOX_LINK, STR_SVT_FILEPICKER_INSERT_AS_LINK }, - { CHECKBOX_PREVIEW, STR_SVT_FILEPICKER_SHOW_PREVIEW }, - { PUSHBUTTON_PLAY, STR_SVT_FILEPICKER_PLAY }, - { LISTBOX_VERSION + LB_LABEL_OFFSET, STR_SVT_FILEPICKER_VERSION }, - { LISTBOX_TEMPLATE + LB_LABEL_OFFSET, STR_SVT_FILEPICKER_TEMPLATES }, - { LISTBOX_IMAGE_TEMPLATE + LB_LABEL_OFFSET, STR_SVT_FILEPICKER_IMAGE_TEMPLATE }, - { CHECKBOX_SELECTION, STR_SVT_FILEPICKER_SELECTION }, - { FOLDERPICKER_TITLE, STR_SVT_FOLDERPICKER_DEFAULT_TITLE }, - { FOLDER_PICKER_DEF_DESCRIPTION, STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION } -}; - -const sal_Int32 SIZE_TABLE = sizeof( CtrlIdToResIdTable ) / sizeof( _Entry ); - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -sal_Int16 CtrlIdToResId( sal_Int32 aControlId ) -{ - sal_Int16 aResId = -1; - - for ( sal_Int32 i = 0; i < SIZE_TABLE; i++ ) - { - if ( CtrlIdToResIdTable[i].ctrlId == aControlId ) - { - aResId = CtrlIdToResIdTable[i].resId; - break; - } - } - - return aResId; -} - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -class CResourceProvider_Impl -{ -public: - - //------------------------------------- - // - //------------------------------------- - - CResourceProvider_Impl( ) - { - m_ResMgr = ResMgr::CreateResMgr("svt"); - } - - //------------------------------------- - // - //------------------------------------- - - ~CResourceProvider_Impl( ) - { - delete m_ResMgr; - } - - //------------------------------------- - // - //------------------------------------- - - OUString getResString( sal_Int16 aId ) - { - String aResString; - OUString aResOUString; - - try - { - OSL_ASSERT( m_ResMgr ); - - // translate the control id to a resource id - sal_Int16 aResId = CtrlIdToResId( aId ); - - if ( aResId > -1 ) - { - aResString = String( ResId( aResId, m_ResMgr ) ); - aResOUString = OUString( aResString ); - - // remove '~' signs, if there are two '~' signs - // in a row we remove only one of them - if ( aResOUString.indexOf( TILDE ) > -1 ) - { - sal_Int32 nStrLen = aResOUString.getLength( ); - rtl::OUStringBuffer aBuffer( nStrLen ); - sal_Int32 i = 0; - const sal_Unicode* pPos = aResOUString.getStr( ); - const sal_Unicode* pNext = aResOUString.getStr( ) + 1; - const sal_Unicode* pEnd = aResOUString.getStr( ) + nStrLen; - - while( pPos < pEnd ) - { - // we insert the next character only if the current character - // in not a '~' or the following character is also a '~' - if ( (*pPos != TILDE_SIGN) || - ((*pPos == TILDE_SIGN) && (pNext < pEnd) && (*pNext == TILDE_SIGN)) ) - { - aBuffer.insert( i, *pPos ); - i++; - } - - pPos++; - pNext++; - } - - aResOUString = aBuffer.makeStringAndClear( ); - } - } - } - catch(...) - { - } - - return aResOUString; - } - -public: - ResMgr* m_ResMgr; -}; - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -CResourceProvider::CResourceProvider( ) : - m_pImpl( new CResourceProvider_Impl() ) -{ -} - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -CResourceProvider::~CResourceProvider( ) -{ - delete m_pImpl; -} - -//------------------------------------------------------------ -// -//------------------------------------------------------------ - -OUString CResourceProvider::getResString( sal_Int32 aId ) -{ - return m_pImpl->getResString( aId ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sysui/source/win32/misc/resourceprovider.hxx b/sysui/source/win32/misc/resourceprovider.hxx deleted file mode 100644 index 33f1b4f5e47f..000000000000 --- a/sysui/source/win32/misc/resourceprovider.hxx +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#ifndef _RESOURCEPROVIDER_HXX_ -#define _RESOURCEPROVIDER_HXX_ - -#include <sal/types.h> - -#include <rtl/ustring> - -class CResourceProvider_Impl; - -class CResourceProvider -{ -public: - CResourceProvider( ); - ~CResourceProvider( ); - - rtl::OUString getResString( sal_Int32 aId ); - -private: - CResourceProvider_Impl* m_pImpl; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sysui/util/exports.dxp b/sysui/util/exports.dxp deleted file mode 100644 index 70033078921a..000000000000 --- a/sysui/util/exports.dxp +++ /dev/null @@ -1 +0,0 @@ -component_getFactory |