summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-11-16 17:25:15 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-11-16 17:25:15 +0000
commit5c50a949dfc9d61c4f2c29b2353539dcd6ae91a1 (patch)
tree9568e3d9c866836f0e66113af516b23f30af44d5 /vcl/source
parent27f85382fe716fb860f68bbfdb622e3525e0252f (diff)
parent9b9d44ee50a38180c2451ca527bf7b9f6f46f0fe (diff)
controltextrendering: merge changes from DEV300_m61
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/app/svapp.cxx10
-rw-r--r--vcl/source/components/dtranscomp.cxx556
-rw-r--r--vcl/source/components/factory.cxx52
-rw-r--r--vcl/source/components/makefile.mk1
-rw-r--r--vcl/source/control/button.cxx13
-rw-r--r--vcl/source/control/combobox.cxx3
-rw-r--r--vcl/source/control/field.cxx3
-rw-r--r--vcl/source/control/fixed.cxx14
-rw-r--r--vcl/source/control/ilstbox.cxx17
-rw-r--r--vcl/source/control/imgctrl.cxx8
-rw-r--r--vcl/source/control/lstbox.cxx3
-rw-r--r--vcl/source/fontsubset/cff.cxx474
-rw-r--r--vcl/source/fontsubset/fontsubset.cxx2
-rw-r--r--vcl/source/gdi/outdev3.cxx45
-rw-r--r--vcl/source/gdi/wall.cxx2
-rw-r--r--vcl/source/glyphs/graphite_adaptors.cxx2
-rw-r--r--vcl/source/glyphs/graphite_cache.cxx2
-rw-r--r--vcl/source/glyphs/graphite_features.cxx2
-rw-r--r--vcl/source/glyphs/graphite_layout.cxx6
-rw-r--r--vcl/source/glyphs/graphite_serverfont.cxx2
-rw-r--r--vcl/source/helper/lazydelete.cxx3
-rw-r--r--vcl/source/window/brdwin.cxx2
-rw-r--r--vcl/source/window/dockmgr.cxx4
-rw-r--r--vcl/source/window/floatwin.cxx14
-rw-r--r--vcl/source/window/menu.cxx14
-rw-r--r--vcl/source/window/msgbox.cxx6
-rw-r--r--vcl/source/window/toolbox.cxx2
-rw-r--r--vcl/source/window/toolbox2.cxx4
-rw-r--r--vcl/source/window/window.cxx16
29 files changed, 981 insertions, 301 deletions
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 262910d18c82..6057409baa14 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -674,11 +674,11 @@ void Application::MergeSystemSettings( AllSettings& rSettings )
ImplSVData* pSVData = ImplGetSVData();
if ( !pSVData->maAppData.mbSettingsInit )
{
- pWindow->ImplGetFrame()->UpdateSettings( *pSVData->maAppData.mpSettings );
+ // side effect: ImplUpdateGlobalSettings does an ImplGetFrame()->UpdateSettings
pWindow->ImplUpdateGlobalSettings( *pSVData->maAppData.mpSettings );
pSVData->maAppData.mbSettingsInit = TRUE;
}
- pWindow->ImplGetFrame()->UpdateSettings( rSettings );
+ // side effect: ImplUpdateGlobalSettings does an ImplGetFrame()->UpdateSettings
pWindow->ImplUpdateGlobalSettings( rSettings, FALSE );
}
}
@@ -1989,6 +1989,12 @@ const ::rtl::OUString& Application::GetDesktopEnvironment()
return SalGetDesktopEnvironment();
}
+void Application::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType)
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ pSVData->mpDefInst->AddToRecentDocumentList(rFileUrl, rMimeType);
+}
+
BOOL Application::IsAccessibilityEnabled()
{
return FALSE;
diff --git a/vcl/source/components/dtranscomp.cxx b/vcl/source/components/dtranscomp.cxx
new file mode 100644
index 000000000000..58792cd4fbdb
--- /dev/null
+++ b/vcl/source/components/dtranscomp.cxx
@@ -0,0 +1,556 @@
+/*************************************************************************
+ *
+ * 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: fontident.cxx,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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/XSingleServiceFactory.hpp"
+#include "com/sun/star/lang/XInitialization.hpp"
+#include "com/sun/star/lang/DisposedException.hpp"
+#include "com/sun/star/datatransfer/XTransferable.hpp"
+#include "com/sun/star/datatransfer/clipboard/XClipboard.hpp"
+#include "com/sun/star/datatransfer/clipboard/XClipboardEx.hpp"
+#include "com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp"
+#include "com/sun/star/datatransfer/clipboard/XClipboardListener.hpp"
+#include "com/sun/star/datatransfer/dnd/XDragSource.hpp"
+#include "com/sun/star/datatransfer/dnd/XDropTarget.hpp"
+#include "com/sun/star/datatransfer/dnd/DNDConstants.hpp"
+
+#include "vcl/svapp.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/salinst.hxx"
+#include "vos/mutex.hxx"
+#include "osl/mutex.hxx"
+
+#include "cppuhelper/compbase1.hxx"
+#include "cppuhelper/compbase2.hxx"
+#include "cppuhelper/compbase3.hxx"
+#include "cppuhelper/implbase1.hxx"
+
+using rtl::OUString;
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::lang;
+
+// -----------------------------------------------------------------------
+
+namespace vcl
+{
+// generic implementation to satisfy SalInstance
+class GenericClipboard :
+ public cppu::WeakComponentImplHelper3 <
+ datatransfer::clipboard::XClipboardEx,
+ datatransfer::clipboard::XClipboardNotifier,
+ XServiceInfo
+ >
+{
+ osl::Mutex m_aMutex;
+ Reference< ::com::sun::star::datatransfer::XTransferable > m_aContents;
+ Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner > m_aOwner;
+ std::list< Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener > > m_aListeners;
+
+ void fireChangedContentsEvent();
+ void clearContents();
+
+public:
+
+ GenericClipboard() : cppu::WeakComponentImplHelper3<
+ datatransfer::clipboard::XClipboardEx,
+ datatransfer::clipboard::XClipboardNotifier,
+ XServiceInfo
+ >( m_aMutex )
+ {}
+ virtual ~GenericClipboard();
+
+ /*
+ * XServiceInfo
+ */
+
+ virtual rtl::OUString SAL_CALL getImplementationName() throw( RuntimeException );
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw( RuntimeException );
+ virtual Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( RuntimeException );
+
+ static rtl::OUString getImplementationName_static();
+ static Sequence< rtl::OUString > getSupportedServiceNames_static();
+
+ /*
+ * XClipboard
+ */
+
+ virtual Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents()
+ throw(RuntimeException);
+
+ virtual void SAL_CALL setContents(
+ const Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans,
+ const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
+ throw(RuntimeException);
+
+ virtual ::rtl::OUString SAL_CALL getName()
+ throw(RuntimeException);
+
+ /*
+ * XClipboardEx
+ */
+
+ virtual sal_Int8 SAL_CALL getRenderingCapabilities()
+ throw(RuntimeException);
+
+ /*
+ * XClipboardNotifier
+ */
+ virtual void SAL_CALL addClipboardListener(
+ const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
+ throw(RuntimeException);
+
+ virtual void SAL_CALL removeClipboardListener(
+ const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
+ throw(RuntimeException);
+};
+
+GenericClipboard::~GenericClipboard()
+{
+}
+
+rtl::OUString GenericClipboard::getImplementationName_static()
+{
+ return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.datatransfer.VCLGenericClipboard" ) );
+}
+
+Sequence< rtl::OUString > GenericClipboard::getSupportedServiceNames_static()
+{
+ Sequence< OUString > aRet(1);
+ aRet[0] = OUString::createFromAscii("com.sun.star.datatransfer.clipboard.SystemClipboard");
+ return aRet;
+}
+
+rtl::OUString GenericClipboard::getImplementationName() throw( RuntimeException )
+{
+ return getImplementationName_static();
+}
+
+Sequence< rtl::OUString > GenericClipboard::getSupportedServiceNames() throw( RuntimeException )
+{
+ return getSupportedServiceNames_static();
+}
+
+sal_Bool GenericClipboard::supportsService( const ::rtl::OUString& ServiceName ) throw( RuntimeException )
+{
+ Sequence< OUString > aServices( getSupportedServiceNames() );
+ sal_Int32 nServices = aServices.getLength();
+ for( sal_Int32 i = 0; i < nServices; i++ )
+ {
+ if( aServices[i] == ServiceName )
+ return sal_True;
+ }
+ return sal_False;
+}
+
+Reference< ::com::sun::star::datatransfer::XTransferable > GenericClipboard::getContents() throw( RuntimeException )
+{
+ return m_aContents;
+}
+
+void GenericClipboard::setContents(
+ const Reference< ::com::sun::star::datatransfer::XTransferable >& xTrans,
+ const Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
+ throw( RuntimeException )
+{
+ osl::ClearableMutexGuard aGuard( m_aMutex );
+ Reference< datatransfer::clipboard::XClipboardOwner > xOldOwner( m_aOwner );
+ Reference< datatransfer::XTransferable > xOldContents( m_aContents );
+ m_aContents = xTrans;
+ m_aOwner = xClipboardOwner;
+
+ std::list< Reference< datatransfer::clipboard::XClipboardListener > > xListeners( m_aListeners );
+ datatransfer::clipboard::ClipboardEvent aEv;
+ aEv.Contents = m_aContents;
+
+ aGuard.clear();
+
+ if( xOldOwner.is() && xOldOwner != xClipboardOwner )
+ xOldOwner->lostOwnership( this, xOldContents );
+ for( std::list< Reference< datatransfer::clipboard::XClipboardListener > >::iterator it =
+ xListeners.begin(); it != xListeners.end() ; ++it )
+ {
+ (*it)->changedContents( aEv );
+ }
+}
+
+rtl::OUString GenericClipboard::getName() throw( RuntimeException )
+{
+ return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CLIPBOARD" ) );
+}
+
+sal_Int8 GenericClipboard::getRenderingCapabilities() throw( RuntimeException )
+{
+ return 0;
+}
+
+void GenericClipboard::addClipboardListener( const Reference< datatransfer::clipboard::XClipboardListener >& listener )
+ throw( RuntimeException )
+{
+ osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ m_aListeners.push_back( listener );
+}
+
+void GenericClipboard::removeClipboardListener( const Reference< datatransfer::clipboard::XClipboardListener >& listener )
+ throw( RuntimeException )
+{
+ osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ m_aListeners.remove( listener );
+}
+
+// ------------------------------------------------------------------------
+
+class ClipboardFactory : public ::cppu::WeakComponentImplHelper1<
+ com::sun::star::lang::XSingleServiceFactory
+>
+{
+ osl::Mutex m_aMutex;
+public:
+ ClipboardFactory();
+ virtual ~ClipboardFactory();
+
+ /*
+ * XSingleServiceFactory
+ */
+ virtual Reference< XInterface > SAL_CALL createInstance() throw();
+ virtual Reference< XInterface > SAL_CALL createInstanceWithArguments( const Sequence< Any >& rArgs ) throw();
+};
+
+// ------------------------------------------------------------------------
+
+ClipboardFactory::ClipboardFactory() :
+ cppu::WeakComponentImplHelper1<
+ com::sun::star::lang::XSingleServiceFactory
+>( m_aMutex )
+{
+}
+
+// ------------------------------------------------------------------------
+
+ClipboardFactory::~ClipboardFactory()
+{
+}
+
+// ------------------------------------------------------------------------
+
+Reference< XInterface > ClipboardFactory::createInstance() throw()
+{
+ return createInstanceWithArguments( Sequence< Any >() );
+}
+
+// ------------------------------------------------------------------------
+
+Reference< XInterface > ClipboardFactory::createInstanceWithArguments( const Sequence< Any >& arguments ) throw()
+{
+ vos::OGuard aGuard( Application::GetSolarMutex() );
+ Reference< XInterface > xResult = ImplGetSVData()->mpDefInst->CreateClipboard( arguments );
+ return xResult;
+}
+
+// ------------------------------------------------------------------------
+
+Sequence< OUString > SAL_CALL Clipboard_getSupportedServiceNames()
+{
+ Sequence< OUString > aRet(1);
+ aRet[0] = OUString::createFromAscii("com.sun.star.datatransfer.clipboard.SystemClipboard");
+ return aRet;
+}
+
+OUString SAL_CALL Clipboard_getImplementationName()
+{
+ #if defined UNX
+ return OUString( RTL_CONSTASCII_USTRINGPARAM(
+ #if ! defined QUARTZ
+ "com.sun.star.datatransfer.X11ClipboardSupport"
+ #else
+ "com.sun.star.datatransfer.clipboard.AquaClipboard"
+ #endif
+ ) );
+ #else
+ return GenericClipboard::getImplementationName_static();
+ #endif
+}
+
+Reference< XSingleServiceFactory > SAL_CALL Clipboard_createFactory( const Reference< XMultiServiceFactory > & )
+{
+ return Reference< XSingleServiceFactory >( new ClipboardFactory() );
+}
+
+/*
+* generic DragSource dummy
+*/
+class GenericDragSource : public cppu::WeakComponentImplHelper2<
+ datatransfer::dnd::XDragSource,
+ XInitialization
+ >
+{
+ osl::Mutex m_aMutex;
+public:
+ GenericDragSource() : cppu::WeakComponentImplHelper2< datatransfer::dnd::XDragSource, XInitialization >( m_aMutex ) {}
+ virtual ~GenericDragSource();
+
+ // XDragSource
+ virtual sal_Bool SAL_CALL isDragImageSupported() throw();
+ virtual sal_Int32 SAL_CALL getDefaultCursor( sal_Int8 dragAction ) throw();
+ virtual void SAL_CALL startDrag(
+ const datatransfer::dnd::DragGestureEvent& trigger,
+ sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
+ const Reference< datatransfer::XTransferable >& transferable,
+ const Reference< datatransfer::dnd::XDragSourceListener >& listener
+ ) throw();
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const Sequence< Any >& arguments ) throw( ::com::sun::star::uno::Exception );
+
+ static Sequence< OUString > getSupportedServiceNames_static()
+ {
+ Sequence< OUString > aRet( 1 );
+ aRet[0] = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.GenericDragSource" );
+ return aRet;
+ }
+
+ static OUString getImplementationName_static()
+ {
+ return OUString::createFromAscii( "com.sun.star.datatransfer.dnd.VclGenericDragSource" );
+ }
+};
+
+GenericDragSource::~GenericDragSource()
+{
+}
+
+sal_Bool GenericDragSource::isDragImageSupported() throw()
+{
+ return sal_False;
+}
+
+sal_Int32 GenericDragSource::getDefaultCursor( sal_Int8 ) throw()
+{
+ return 0;
+}
+
+void GenericDragSource::startDrag( const datatransfer::dnd::DragGestureEvent&,
+ sal_Int8 /*sourceActions*/, sal_Int32 /*cursor*/, sal_Int32 /*image*/,
+ const Reference< datatransfer::XTransferable >&,
+ const Reference< datatransfer::dnd::XDragSourceListener >& listener
+ ) throw()
+{
+ datatransfer::dnd::DragSourceDropEvent aEv;
+ aEv.DropAction = datatransfer::dnd::DNDConstants::ACTION_COPY;
+ aEv.DropSuccess = sal_False;
+ listener->dragDropEnd( aEv );
+}
+
+void GenericDragSource::initialize( const Sequence< Any >& ) throw( Exception )
+{
+}
+
+
+Sequence< OUString > SAL_CALL DragSource_getSupportedServiceNames()
+{
+ #if defined UNX
+ static OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM(
+ #if ! defined QUARTZ
+ "com.sun.star.datatransfer.dnd.X11DragSource"
+ #else
+ "com.sun.star.datatransfer.dnd.OleDragSource"
+ #endif
+ ) );
+ static Sequence< OUString > aServiceNames( &aServiceName, 1 );
+ return aServiceNames;
+ #else
+ return GenericDragSource::getSupportedServiceNames_static();
+ #endif
+}
+
+OUString SAL_CALL DragSource_getImplementationName()
+{
+ #if defined UNX
+ return OUString( RTL_CONSTASCII_USTRINGPARAM(
+ #if ! defined QUARTZ
+ "com.sun.star.datatransfer.dnd.XdndSupport"
+ #else
+ "com.sun.star.comp.datatransfer.dnd.OleDragSource_V1"
+ #endif
+ ) );
+ #else
+ return GenericDragSource::getImplementationName_static();
+ #endif
+}
+
+Reference< XInterface > SAL_CALL DragSource_createInstance( const Reference< XMultiServiceFactory >& )
+{
+ vos::OGuard aGuard( Application::GetSolarMutex() );
+ Reference< XInterface > xResult = ImplGetSVData()->mpDefInst->CreateDragSource();
+ return xResult;
+}
+
+/*
+* generic DragSource dummy
+*/
+
+class GenericDropTarget : public cppu::WeakComponentImplHelper2<
+ datatransfer::dnd::XDropTarget,
+ XInitialization
+ >
+{
+ osl::Mutex m_aMutex;
+public:
+ GenericDropTarget() : cppu::WeakComponentImplHelper2<
+ datatransfer::dnd::XDropTarget,
+ XInitialization
+ > ( m_aMutex )
+ {}
+ virtual ~GenericDropTarget();
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const Sequence< Any >& args ) throw ( Exception );
+
+ // XDropTarget
+ virtual void SAL_CALL addDropTargetListener( const Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
+ virtual void SAL_CALL removeDropTargetListener( const Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw();
+ virtual sal_Bool SAL_CALL isActive() throw();
+ virtual void SAL_CALL setActive( sal_Bool active ) throw();
+ virtual sal_Int8 SAL_CALL getDefaultActions() throw();
+ virtual void SAL_CALL setDefaultActions( sal_Int8 actions ) throw();
+
+ static Sequence< OUString > getSupportedServiceNames_static()
+ {
+ Sequence< OUString > aRet( 1 );
+ aRet[0] = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.GenericDropTarget" );
+ return aRet;
+ }
+
+ static OUString getImplementationName_static()
+ {
+ return OUString::createFromAscii( "com.sun.star.datatransfer.dnd.VclGenericDropTarget" );
+ }
+};
+
+GenericDropTarget::~GenericDropTarget()
+{
+}
+
+void GenericDropTarget::initialize( const Sequence< Any >& ) throw( Exception )
+{
+}
+
+void GenericDropTarget::addDropTargetListener( const Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw()
+{
+}
+
+void GenericDropTarget::removeDropTargetListener( const Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& ) throw()
+{
+}
+
+sal_Bool GenericDropTarget::isActive() throw()
+{
+ return sal_False;
+}
+
+void GenericDropTarget::setActive( sal_Bool ) throw()
+{
+}
+
+sal_Int8 GenericDropTarget::getDefaultActions() throw()
+{
+ return 0;
+}
+
+void GenericDropTarget::setDefaultActions( sal_Int8) throw()
+{
+}
+
+Sequence< OUString > SAL_CALL DropTarget_getSupportedServiceNames()
+{
+ #if defined UNX
+ static OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM(
+ #if ! defined QUARTZ
+ "com.sun.star.datatransfer.dnd.X11DropTarget"
+ #else
+ "com.sun.star.datatransfer.dnd.OleDropTarget"
+ #endif
+ ) );
+ static Sequence< OUString > aServiceNames( &aServiceName, 1 );
+ return aServiceNames;
+ #else
+ return GenericDropTarget::getSupportedServiceNames_static();
+ #endif
+}
+
+OUString SAL_CALL DropTarget_getImplementationName()
+{
+ #if defined UNX
+ return OUString( RTL_CONSTASCII_USTRINGPARAM(
+ #if ! defined QUARTZ
+ "com.sun.star.datatransfer.dnd.XdndDropTarget"
+ #else
+ "com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1"
+ #endif
+ ) );
+ #else
+ return GenericDropTarget::getImplementationName_static();
+ #endif
+}
+
+Reference< XInterface > SAL_CALL DropTarget_createInstance( const Reference< XMultiServiceFactory >& )
+{
+ vos::OGuard aGuard( Application::GetSolarMutex() );
+ Reference< XInterface > xResult = ImplGetSVData()->mpDefInst->CreateDropTarget();
+ return xResult;
+}
+
+
+} // namespace vcl
+
+/*
+* SalInstance generic
+*/
+Reference< XInterface > SalInstance::CreateClipboard( const Sequence< Any >& )
+{
+ return Reference< XInterface >( ( cppu::OWeakObject * )new vcl::GenericClipboard() );
+}
+
+Reference< XInterface > SalInstance::CreateDragSource()
+{
+ return Reference< XInterface >( ( cppu::OWeakObject * )new vcl::GenericDragSource() );
+}
+
+Reference< XInterface > SalInstance::CreateDropTarget()
+{
+ return Reference< XInterface >( ( cppu::OWeakObject * )new vcl::GenericDropTarget() );
+}
+
diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx
index ef2e5c3b85fd..e816c31c613a 100644
--- a/vcl/source/components/factory.cxx
+++ b/vcl/source/components/factory.cxx
@@ -59,11 +59,23 @@ namespace vcl
{
extern Sequence< OUString > SAL_CALL DisplayAccess_getSupportedServiceNames();
extern OUString SAL_CALL DisplayAccess_getImplementationName();
-extern Reference< XInterface > SAL_CALL DisplayAccess_createInstance( const Reference< XMultiServiceFactory > & );
+extern Reference< XInterface > SAL_CALL DisplayAccess_createInstance( const Reference< XMultiServiceFactory > & );
extern Sequence< OUString > SAL_CALL FontIdentificator_getSupportedServiceNames();
extern OUString SAL_CALL FontIdentificator_getImplementationName();
-extern Reference< XInterface > SAL_CALL FontIdentificator_createInstance( const Reference< XMultiServiceFactory > & );
+extern Reference< XInterface > SAL_CALL FontIdentificator_createInstance( const Reference< XMultiServiceFactory > & );
+
+extern Sequence< OUString > SAL_CALL Clipboard_getSupportedServiceNames();
+extern OUString SAL_CALL Clipboard_getImplementationName();
+extern Reference< XSingleServiceFactory > SAL_CALL Clipboard_createFactory( const Reference< XMultiServiceFactory > & );
+
+extern Sequence< OUString > SAL_CALL DragSource_getSupportedServiceNames();
+extern OUString SAL_CALL DragSource_getImplementationName();
+extern Reference< XInterface > SAL_CALL DragSource_createInstance( const Reference< XMultiServiceFactory > & );
+
+extern Sequence< OUString > SAL_CALL DropTarget_getSupportedServiceNames();
+extern OUString SAL_CALL DropTarget_getImplementationName();
+extern Reference< XInterface > SAL_CALL DropTarget_createInstance( const Reference< XMultiServiceFactory > & );
}
extern "C" {
@@ -102,6 +114,26 @@ extern "C" {
aImplName.append( vcl::FontIdentificator_getSupportedServiceNames()[0] );
xKey->createKey( aImplName.makeStringAndClear() );
+ #if defined UNX
+ aImplName.appendAscii( "/" );
+ aImplName.append( vcl::Clipboard_getImplementationName() );
+ aImplName.appendAscii( "/UNO/SERVICES/" );
+ aImplName.append( vcl::Clipboard_getSupportedServiceNames()[0] );
+ xKey->createKey( aImplName.makeStringAndClear() );
+
+ aImplName.appendAscii( "/" );
+ aImplName.append( vcl::DragSource_getImplementationName() );
+ aImplName.appendAscii( "/UNO/SERVICES/" );
+ aImplName.append( vcl::DragSource_getSupportedServiceNames()[0] );
+ xKey->createKey( aImplName.makeStringAndClear() );
+
+ aImplName.appendAscii( "/" );
+ aImplName.append( vcl::DropTarget_getImplementationName() );
+ aImplName.appendAscii( "/UNO/SERVICES/" );
+ aImplName.append( vcl::DropTarget_getSupportedServiceNames()[0] );
+ xKey->createKey( aImplName.makeStringAndClear() );
+ #endif
+
return sal_True;
}
catch( ::com::sun::star::registry::InvalidRegistryException& )
@@ -143,6 +175,22 @@ extern "C" {
xMgr, vcl::FontIdentificator_getImplementationName(), vcl::FontIdentificator_createInstance,
vcl::FontIdentificator_getSupportedServiceNames() );
}
+ else if( vcl::Clipboard_getImplementationName().equalsAscii( pImplementationName ) )
+ {
+ xFactory = vcl::Clipboard_createFactory( xMgr );
+ }
+ else if( vcl::DragSource_getImplementationName().equalsAscii( pImplementationName ) )
+ {
+ xFactory = ::cppu::createSingleFactory(
+ xMgr, vcl::DragSource_getImplementationName(), vcl::DragSource_createInstance,
+ vcl::DragSource_getSupportedServiceNames() );
+ }
+ else if( vcl::DropTarget_getImplementationName().equalsAscii( pImplementationName ) )
+ {
+ xFactory = ::cppu::createSingleFactory(
+ xMgr, vcl::DropTarget_getImplementationName(), vcl::DropTarget_createInstance,
+ vcl::DropTarget_getSupportedServiceNames() );
+ }
if( xFactory.is() )
{
xFactory->acquire();
diff --git a/vcl/source/components/makefile.mk b/vcl/source/components/makefile.mk
index 9158d33bb888..8cc836fe5424 100644
--- a/vcl/source/components/makefile.mk
+++ b/vcl/source/components/makefile.mk
@@ -44,6 +44,7 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
SLOFILES= $(SLO)$/display.obj \
+ $(SLO)$/dtranscomp.obj \
$(SLO)$/fontident.obj \
$(SLO)$/factory.obj
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 2c8d6aa0601d..53a060af6bd6 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -419,10 +419,9 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
Image *pImage = &(mpButtonData->maImage);
BitmapEx *pBitmapEx = mpButtonData->mpBitmapEx;
- Color aBackCol;
- if( !!(mpButtonData->maImageHC) && ImplGetCurrentBackgroundColor( aBackCol ) )
+ if( !!(mpButtonData->maImageHC) )
{
- if( aBackCol.IsDark() )
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
{
pImage = &(mpButtonData->maImageHC);
pBitmapEx = mpButtonData->mpBitmapExHC;
@@ -2362,14 +2361,10 @@ if ( bNativeOK == FALSE )
// check for HC mode
Image *pImage = &maImage;
- Color aBackCol;
- if( !!maImageHC && ImplGetCurrentBackgroundColor( aBackCol ) )
+ if( !!maImageHC )
{
- if( aBackCol.IsDark() )
+ if( rStyleSettings.GetHighContrastMode() )
pImage = &maImageHC;
- // #99902 no col transform required
- //if( aBackCol.IsBright() )
- // nStyle |= IMAGE_DRAW_COLORTRANSFORM;
}
Point aImagePos( aImageRect.TopLeft() );
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 38e43a75b935..21707d0182f5 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -287,6 +287,7 @@ BOOL ComboBox::IsAutocompleteEnabled() const
IMPL_LINK( ComboBox, ImplClickBtnHdl, void*, EMPTYARG )
{
+ ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
mpSubEdit->GrabFocus();
if ( !mpImplLB->GetEntryList()->GetMRUCount() )
ImplUpdateFloatSelection();
@@ -523,6 +524,7 @@ void ComboBox::ToggleDropDown()
ImplUpdateFloatSelection();
else
mpImplLB->SelectEntry( 0 , TRUE );
+ ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
mpBtn->SetPressed( TRUE );
SetSelection( Selection( 0, SELECTION_MAX ) );
mpFloatWin->StartFloat( TRUE );
@@ -824,6 +826,7 @@ long ComboBox::Notify( NotifyEvent& rNEvt )
ImplUpdateFloatSelection();
if( ( nKeyCode == KEY_DOWN ) && mpFloatWin && !mpFloatWin->IsInPopupMode() && aKeyEvt.GetKeyCode().IsMod2() )
{
+ ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
mpBtn->SetPressed( TRUE );
if ( mpImplLB->GetEntryList()->GetMRUCount() )
mpImplLB->SelectEntry( 0 , TRUE );
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 1bc6af51f369..3cb6e45f0400 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -503,6 +503,9 @@ void NumericFormatter::ImplLoadRes( const ResId& rResId )
mnFieldValue = mnMin;
mnLastValue = mnFieldValue;
}
+
+ if ( NUMERICFORMATTER_NOTHOUSANDSEP & nMask )
+ SetUseThousandSep( !(BOOL)pMgr->ReadShort() );
}
}
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 53029c8e3573..3d19e288a1ce 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -778,13 +778,10 @@ void FixedBitmap::ImplDraw( OutputDevice* pDev, ULONG /* nDrawFlags */,
USHORT nStyle = 0;
Bitmap* pBitmap = &maBitmap;
Color aCol;
- if( !!maBitmapHC && ImplGetCurrentBackgroundColor( aCol ) )
+ if( !!maBitmapHC )
{
- if( aCol.IsDark() )
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
pBitmap = &maBitmapHC;
- // #99902 no col transform required
- //if( aCol.IsBright() )
- // nStyle |= IMAGE_DRAW_COLORTRANSFORM;
}
if( nStyle & IMAGE_DRAW_COLORTRANSFORM )
@@ -1032,13 +1029,10 @@ void FixedImage::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
Image *pImage = &maImage;
Color aCol;
- if( !!maImageHC && ImplGetCurrentBackgroundColor( aCol ) )
+ if( !!maImageHC )
{
- if( aCol.IsDark() )
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
pImage = &maImageHC;
- // #99902 no col transform required
- //if( aCol.IsBright() )
- // nStyle |= IMAGE_DRAW_COLORTRANSFORM;
}
// Haben wir ueberhaupt ein Image
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 597b9bc3a874..a915d8e6b9e8 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -2899,23 +2899,8 @@ void ImplWin::DrawEntry( BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImageP
if( !!maImageHC )
{
- // determine backgroundcolor as done in Paint()
- Color aBackCol;
- if( IsEnabled() )
- {
- if( HasFocus() )
- aBackCol = GetSettings().GetStyleSettings().GetHighlightColor();
- else
- aBackCol = GetBackground().GetColor();
- }
- else // Disabled
- aBackCol = GetBackground().GetColor();
-
- if( aBackCol.IsDark() )
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
pImage = &maImageHC;
- // #99902 no col transform required
- //if( aBackCol.IsBright() )
- // nStyle |= IMAGE_DRAW_COLORTRANSFORM;
}
if ( !IsZoom() )
diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx
index 6d4777013a73..73b5154d32ac 100644
--- a/vcl/source/control/imgctrl.cxx
+++ b/vcl/source/control/imgctrl.cxx
@@ -93,14 +93,10 @@ void ImageControl::UserDraw( const UserDrawEvent& rUDEvt )
{
USHORT nStyle = 0;
BitmapEx* pBitmap = &maBmp;
- Color aCol;
- if( !!maBmpHC && ImplGetCurrentBackgroundColor( aCol ) )
+ if( !!maBmpHC )
{
- if( aCol.IsDark() )
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
pBitmap = &maBmpHC;
- // #99902 no col transform required
- //if( aCol.IsBright() )
- // nStyle |= IMAGE_DRAW_COLORTRANSFORM;
}
if ( !*pBitmap )
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index 15bd56ae4e98..ceabbe4ab166 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -303,6 +303,7 @@ IMPL_LINK( ListBox, ImplClickBtnHdl, void*, EMPTYARG )
{
if( !mpFloatWin->IsInPopupMode() )
{
+ ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
mpImplWin->GrabFocus();
mpBtn->SetPressed( TRUE );
mpFloatWin->StartFloat( TRUE );
@@ -363,6 +364,7 @@ void ListBox::ToggleDropDown()
mpFloatWin->EndPopupMode();
else
{
+ ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
mpImplWin->GrabFocus();
mpBtn->SetPressed( TRUE );
mpFloatWin->StartFloat( TRUE );
@@ -919,6 +921,7 @@ long ListBox::PreNotify( NotifyEvent& rNEvt )
if( mpFloatWin && !mpFloatWin->IsInPopupMode() &&
aKeyEvt.GetKeyCode().IsMod2() )
{
+ ImplCallEventListeners( VCLEVENT_DROPDOWN_PRE_OPEN );
mpBtn->SetPressed( TRUE );
mpFloatWin->StartFloat( FALSE );
ImplCallEventListeners( VCLEVENT_DROPDOWN_OPEN );
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index 7af7e7e9c9e0..e5d83dc0733a 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -42,8 +42,10 @@ typedef long long S64;
typedef sal_Int32 GlyphWidth;
+typedef float RealType;
+typedef RealType ValType;
#include <vector>
-typedef std::vector<int> IntVector;
+typedef std::vector<ValType> ValVector;
// ====================================================================
@@ -310,8 +312,8 @@ struct CffGlobal
int mnFontDictBase;
int mnFDAryCount;
- IntVector maFontBBox;
- //FloatVector maFontMatrix;
+ ValVector maFontBBox;
+ ValVector maFontMatrix;
int mnFontNameSID;
int mnFullNameSID;
@@ -336,16 +338,16 @@ struct CffLocal
// ATM hinting related values
int mnStemStdHW;
int mnStemStdVW;
- IntVector maStemSnapH;
- IntVector maStemSnapV;
- IntVector maBlueValues;
- IntVector maOtherBlues;
- IntVector maFamilyBlues;
- IntVector maFamilyOtherBlues;
- double mfBlueScale;
- double mfBlueShift;
- double mfBlueFuzz;
- double mfExpFactor;
+ ValVector maStemSnapH;
+ ValVector maStemSnapV;
+ ValVector maBlueValues;
+ ValVector maOtherBlues;
+ ValVector maFamilyBlues;
+ ValVector maFamilyOtherBlues;
+ RealType mfBlueScale;
+ RealType mfBlueShift;
+ RealType mfBlueFuzz;
+ RealType mfExpFactor;
int mnLangGroup;
bool mbForceBold;
};
@@ -422,7 +424,7 @@ private:
CffLocal* mpCffLocal;
void readDictOp( void);
- double readRealVal( void);
+ RealType readRealVal( void);
const char* getString( int nStringID);
int getFDSelect( int nGlyphIndex) const;
int getGlyphSID( int nGlyphIndex) const;
@@ -431,7 +433,7 @@ private:
void readTypeOp( void);
void read2push( void);
void pop2write( void);
- void writeType1Val( int/*TODO: double*/ nVal);
+ void writeType1Val( ValType);
void writeTypeOp( int nTypeOp);
void writeTypeEsc( int nTypeOp);
void writeCurveTo( int nStackPos, int nIX1, int nIY1, int nIX2, int nIY2, int nIX3, int nIY3);
@@ -441,10 +443,13 @@ private:
public: // TODO: is public really needed?
// accessing the value stack
// TODO: add more checks
- void push( int nVal) { mnValStack[ mnStackIdx++] = nVal;}
- int pop( void) { return ((mnStackIdx>0) ? mnValStack[ --mnStackIdx] : 0);}
- int peek( void) { return ((mnStackIdx>0) ? mnValStack[ mnStackIdx-1] : 0);}
- int get( int nIndex) { return mnValStack[ nIndex];}
+ void push( ValType nVal) { mnValStack[ mnStackIdx++] = nVal;}
+ ValType popVal( void) { return ((mnStackIdx>0) ? mnValStack[ --mnStackIdx] : 0);}
+ ValType peekVal( void) const { return ((mnStackIdx>0) ? mnValStack[ mnStackIdx-1] : 0);}
+ ValType getVal( int nIndex) const { return mnValStack[ nIndex];}
+ int popInt( void);
+ int peekInt( void) const;
+ int getInt( int nIndex) const;
int size( void) const { return mnStackIdx;}
bool empty( void) const { return !mnStackIdx;}
void clear( void) { mnStackIdx = 0;}
@@ -453,7 +458,7 @@ public: // TODO: is public really needed?
void addHints( bool bVerticalHints);
int getHorzHintCount( void) const { return (mnHorzHintSize/2);}
int getVertHintCount( void) const { return (mnHintSize-mnHorzHintSize)/2;}
- void getHintPair( int nIndex, int* nMin, int* nEnd) const;
+ void getHintPair( int nIndex, ValType* nMin, ValType* nEnd) const;
// accessing other charstring specifics
bool hasCharWidth( void) const { return (mnCharWidth != -1);}
@@ -465,12 +470,12 @@ public: // TODO: is public really needed?
private:
// typeop exceution context
int mnStackIdx;
- int mnValStack[ NMAXSTACK];
- int mnTransVals[ NMAXTRANS];
+ ValType mnValStack[ NMAXSTACK];
+ ValType mnTransVals[ NMAXTRANS];
int mnHintSize;
int mnHorzHintSize;
- int mnHintStack[ NMAXHINTS];
+ ValType mnHintStack[ NMAXHINTS];
int mnCharWidth;
};
@@ -499,6 +504,36 @@ CffSubsetterContext::~CffSubsetterContext( void)
// --------------------------------------------------------------------
+inline int CffSubsetterContext::popInt( void)
+{
+ const ValType aVal = popVal();
+ const int nInt = static_cast<int>(aVal);
+ assert( nInt == aVal);
+ return nInt;
+}
+
+// --------------------------------------------------------------------
+
+inline int CffSubsetterContext::peekInt( void) const
+{
+ const ValType aVal = peekVal();
+ const int nInt = static_cast<int>(aVal);
+ assert( nInt == aVal);
+ return nInt;
+}
+
+// --------------------------------------------------------------------
+
+inline int CffSubsetterContext::getInt( int nIndex) const
+{
+ const ValType aVal = getVal( nIndex);
+ const int nInt = static_cast<int>(aVal);
+ assert( nInt == aVal);
+ return nInt;
+}
+
+// --------------------------------------------------------------------
+
inline void CffSubsetterContext::updateWidth( bool bUseFirstVal)
{
#if 1 // TODO: is this still needed?
@@ -507,7 +542,7 @@ inline void CffSubsetterContext::updateWidth( bool bUseFirstVal)
return;
#endif
if( bUseFirstVal) {
- mnCharWidth = mpCffLocal->mnNominalWidth + mnValStack[0];
+ mnCharWidth = static_cast<int>(mpCffLocal->mnNominalWidth + mnValStack[0]);
// remove bottom stack entry
--mnStackIdx;
for( int i = 0; i < mnStackIdx; ++i)
@@ -535,16 +570,16 @@ void CffSubsetterContext::addHints( bool bVerticalHints)
assert( (mnHintSize + mnStackIdx) <= 2*NMAXHINTS);
#ifdef IGNORE_HINTS
- mnHorzHintSize += mnStackIdx;
+ mnHintSize += mnStackIdx;
#else
- int nHintOfs = 0;
+ ValType nHintOfs = 0;
for( int i = 0; i < mnStackIdx; ++i) {
- nHintOfs += mnValStack[ i];
+ nHintOfs += mnValStack[ i ];
mnHintStack[ mnHintSize++] = nHintOfs;
}
+#endif // IGNORE_HINTS
if( !bVerticalHints)
mnHorzHintSize = mnHintSize;
-#endif // IGNORE_HINTS
// clear all values from the stack
mnStackIdx = 0;
@@ -552,12 +587,12 @@ void CffSubsetterContext::addHints( bool bVerticalHints)
// --------------------------------------------------------------------
-void CffSubsetterContext::getHintPair( int nIndex, int* pMin, int* pEnd) const
+void CffSubsetterContext::getHintPair( int nIndex, ValType* pMin, ValType* pEnd) const
{
nIndex *= 2;
assert( nIndex < mnHintSize);
assert( nIndex >= 0);
- const int* pHint = &mnHintStack[ nIndex];
+ const ValType* pHint = &mnHintStack[ nIndex ];
*pMin = pHint[0];
*pEnd = pHint[1];
}
@@ -596,7 +631,8 @@ void CffSubsetterContext::readCharString( const U8* pTypeOps, int nTypeLen)
void CffSubsetterContext::readDictOp( void)
{
- int nVal = 0;
+ ValType nVal = 0;
+ int nInt = 0;
const U8 c = *mpReadPtr;
if( c <= 21 ) {
int nOpId = *(mpReadPtr++);
@@ -613,41 +649,45 @@ void CffSubsetterContext::readDictOp( void)
switch( *pCmdName) {
default: fprintf( stderr, "unsupported DictOp.type=\'%c\'\n", *pCmdName); break;
case 'b': // bool
- nVal = pop();
+ nInt = popInt();
switch( nOpId) {
- case 915: mpCffLocal->mbForceBold = nVal; break; // "ForceBold"
+ case 915: mpCffLocal->mbForceBold = nInt; break; // "ForceBold"
default: break; // TODO: handle more boolean dictops?
}
break;
case 'n': // dict-op number
- nVal = pop();
+ nVal = popVal();
+ nInt = static_cast<int>(nVal);
switch( nOpId) {
- case 10: mpCffLocal->mnStemStdHW = nVal; break; // "StdHW"
- case 11: mpCffLocal->mnStemStdVW = nVal; break; // "StdVW"
- case 15: mnCharsetBase = nVal; break; // "charset"
- case 16: mnEncodingBase = nVal; break; // "nEncoding"
- case 17: mnCharStrBase = nVal; break; // "nCharStrings"
- case 19: mpCffLocal->mnLocalSubrOffs = nVal; break;// "nSubrs"
- case 20: setDefaultWidth( nVal); break; // "defaultWidthX"
- case 21: setNominalWidth( nVal); break; // "nominalWidthX"
+ case 10: mpCffLocal->mnStemStdHW = nInt; break; // "StdHW"
+ case 11: mpCffLocal->mnStemStdVW = nInt; break; // "StdVW"
+ case 15: mnCharsetBase = nInt; break; // "charset"
+ case 16: mnEncodingBase = nInt; break; // "nEncoding"
+ case 17: mnCharStrBase = nInt; break; // "nCharStrings"
+ case 19: mpCffLocal->mnLocalSubrOffs = nInt; break;// "nSubrs"
+ case 20: setDefaultWidth( nInt ); break; // "defaultWidthX"
+ case 21: setNominalWidth( nInt ); break; // "nominalWidthX"
case 909: mpCffLocal->mfBlueScale = nVal; break; // "BlueScale"
case 910: mpCffLocal->mfBlueShift = nVal; break; // "BlueShift"
case 911: mpCffLocal->mfBlueFuzz = nVal; break; // "BlueFuzz"
case 912: mpCffLocal->mfExpFactor = nVal; break; // "ExpansionFactor"
- case 917: mpCffLocal->mnLangGroup = nVal; break; // "LanguageGroup"
- case 936: mnFontDictBase = nVal; break; // "nFDArray"
- case 937: mnFDSelectBase = nVal; break; // "nFDSelect"
+ case 917: mpCffLocal->mnLangGroup = nInt; break; // "LanguageGroup"
+ case 936: mnFontDictBase = nInt; break; // "nFDArray"
+ case 937: mnFDSelectBase = nInt; break; // "nFDSelect"
default: break; // TODO: handle more numeric dictops?
}
break;
case 'a': { // array
+ switch( nOpId) {
+ case 5: maFontBBox.clear(); break; // "FontBBox"
+ case 907: maFontMatrix.clear(); break; // "FontMatrix"
+ default: break; // TODO: reset other arrays?
+ }
for( int i = 0; i < size(); ++i ) {
- nVal = get(i);
+ nVal = getVal(i);
switch( nOpId) {
case 5: maFontBBox.push_back( nVal); break; // "FontBBox"
-#if 0 // TODO
case 907: maFontMatrix.push_back( nVal); break; // "FontMatrix"
-#endif
default: break; // TODO: handle more array dictops?
}
}
@@ -656,7 +696,7 @@ void CffSubsetterContext::readDictOp( void)
case 'd': { // delta array
nVal = 0;
for( int i = 0; i < size(); ++i ) {
- nVal += get(i);
+ nVal += getVal(i);
switch( nOpId) {
case 6: mpCffLocal->maBlueValues.push_back( nVal); break; // "BlueValues"
case 7: mpCffLocal->maOtherBlues.push_back( nVal); break; // "OtherBlues"
@@ -670,39 +710,39 @@ void CffSubsetterContext::readDictOp( void)
clear();
} break;
case 's': // stringid (SID)
- nVal = pop();
- switch( nOpId) {
- case 2: mnFullNameSID = nVal; break; // "FullName"
- case 3: mnFamilyNameSID = nVal; break; // "FamilyName"
- case 938: mnFontNameSID = nVal; break; // "FontName"
+ nInt = popInt();
+ switch( nOpId ) {
+ case 2: mnFullNameSID = nInt; break; // "FullName"
+ case 3: mnFamilyNameSID = nInt; break; // "FamilyName"
+ case 938: mnFontNameSID = nInt; break; // "FontName"
default: break; // TODO: handle more string dictops?
}
break;
case 'P': // private dict
- mpCffLocal->mnPrivDictBase = pop();
- mpCffLocal->mnPrivDictSize = pop();
+ mpCffLocal->mnPrivDictBase = popInt();
+ mpCffLocal->mnPrivDictSize = popInt();
break;
case 'r': { // ROS operands
- int nSid1 = pop();
- int nSid2 = pop();
+ int nSid1 = popInt();
+ int nSid2 = popInt();
(void)nSid1; // TODO: use
(void)nSid2; // TODO: use
- nVal = pop();
+ nVal = popVal();
mbCIDFont = true;
} break;
case 't': // CharstringType
- nVal = pop();
- setCharStringType( nVal);
+ nInt = popInt();
+ setCharStringType( nInt );
break;
}
return;
}
- if( (c >= 32) || (c == 28)) {
+ if( (c >= 32) || (c == 28) ) {
// --mpReadPtr;
read2push();
- } else if( c == 29) { // longint
+ } else if( c == 29 ) { // longint
++mpReadPtr; // skip 29
int nS32 = mpReadPtr[0] << 24;
nS32 += mpReadPtr[1] << 16;
@@ -711,13 +751,13 @@ void CffSubsetterContext::readDictOp( void)
if( (sizeof(nS32) != 4) && (nS32 & (1<<31)))
nS32 |= (~0U) << 31; // assuming 2s complement
mpReadPtr += 4;
- nVal = nS32;
- push( nVal);
+ nVal = static_cast<ValType>(nS32);
+ push( nVal );
} else if( c == 30) { // real number
++mpReadPtr; // skip 30
- const double fReal = readRealVal();
+ const RealType fReal = readRealVal();
// push value onto stack
- nVal = static_cast<int>(fReal+0.5); //TODO!!! allow float on operand stack!
+ nVal = fReal;
push( nVal);
}
}
@@ -759,12 +799,12 @@ void CffSubsetterContext::readTypeOp( void)
case 'C': nMinStack = 6; nMaxStack = 999; break;
case 'E': nMinStack = 1; nMaxStack = 999; break;
case 'G': nMinStack = 1; nMaxStack = 999; // global subr
- nVal = peek();
+ nVal = peekInt();
// TODO global subr
break;
case 'L': // local subr
nMinStack = 1; nMaxStack = 999;
- nVal = peek();
+ nVal = peekInt();
// TODO local subr
break;
case 'I': // operands for "index"
@@ -830,57 +870,70 @@ void CffSubsetterContext::readTypeOp( void)
// --------------------------------------------------------------------
-void CffSubsetterContext::read2push( void)
+void CffSubsetterContext::read2push()
{
- int nVal = 0;
+ ValType aVal = 0;
const U8*& p = mpReadPtr;
const U8 c = *p;
- if( c == 28) {
+ if( c == 28 ) {
short nS16 = (p[1] << 8) + p[2];
if( (sizeof(nS16) != 2) && (nS16 & (1<<15)))
nS16 |= (~0U) << 15; // assuming 2s complement
- nVal = nS16;
+ aVal = nS16;
p += 3;
- } else if( c <= 246) { // -107..+107
- nVal = p[0] - 139;
+ } else if( c <= 246 ) { // -107..+107
+ aVal = static_cast<ValType>(p[0] - 139);
p += 1;
- } else if( c <= 250) { // +108..+1131
- nVal = ((p[0] << 8) + p[1]) - 63124;
+ } else if( c <= 250 ) { // +108..+1131
+ aVal = static_cast<ValType>(((p[0] << 8) + p[1]) - 63124);
p += 2;
- } else if( c <= 254) { // -108..-1131
- nVal = 64148 - ((p[0] << 8) + p[1]);
+ } else if( c <= 254 ) { // -108..-1131
+ aVal = static_cast<ValType>(64148 - ((p[0] << 8) + p[1]));
p += 2;
} else /*if( c == 255)*/ { // Fixed16.16
- nVal = (p[1] << 8) + p[2];
- // TODO: read non-integer part
+ int nS32 = (p[1] << 24) + (p[2] << 16) + (p[3] << 8) + p[4];
+ if( (sizeof(nS32) != 2) && (nS32 & (1<<31)))
+ nS32 |= (~0U) << 31; // assuming 2s complement
+ aVal = static_cast<ValType>(nS32 * (1.0 / 0x10000));
p += 5;
}
- push( nVal);
+ push( aVal);
}
// --------------------------------------------------------------------
-void CffSubsetterContext::writeType1Val( int/*TODO: double*/ nVal)
+void CffSubsetterContext::writeType1Val( ValType aVal)
{
U8* pOut = mpWritePtr;
- if( (nVal >= -107) && (nVal <= +107)) {
- *(pOut++) = static_cast<U8>(nVal + 139); // -107..+107
- } else if( (nVal >= -1131) && (nVal <= +1131)) {
- if( nVal >= 0)
- nVal += 63124; // +108..+1131
+
+ int nInt = static_cast<int>(aVal);
+ static const int nOutCharstrType = 1;
+ if( (nInt != aVal) && (nOutCharstrType == 2)) {
+ // numtype==255 means int32 for Type1, but 16.16 for Type2 charstrings!!!
+ *(pOut++) = 255; // Fixed 16.16
+ *(pOut++) = static_cast<U8>(nInt >> 8);
+ *(pOut++) = static_cast<U8>(nInt);
+ nInt = static_cast<int>(aVal * 0x10000) & 0xFFFF;
+ *(pOut++) = static_cast<U8>(nInt >> 8);
+ *(pOut++) = static_cast<U8>(nInt);
+ } else if( (nInt >= -107) && (nInt <= +107)) {
+ *(pOut++) = static_cast<U8>(nInt + 139); // -107..+107
+ } else if( (nInt >= -1131) && (nInt <= +1131)) {
+ if( nInt >= 0)
+ nInt += 63124; // +108..+1131
else
- nVal = 64148 - nVal; // -108..-1131
- *(pOut++) = static_cast<U8>(nVal >> 8);
- *(pOut++) = static_cast<U8>(nVal);
- } else {
+ nInt = 64148 - nInt; // -108..-1131
+ *(pOut++) = static_cast<U8>(nInt >> 8);
+ *(pOut++) = static_cast<U8>(nInt);
+ } else if( nOutCharstrType == 1) {
// numtype==255 means int32 for Type1, but 16.16 for Type2 charstrings!!!
*(pOut++) = 255;
- *(pOut++) = static_cast<U8>(nVal >> 24);
- *(pOut++) = static_cast<U8>(nVal >> 16);
- *(pOut++) = static_cast<U8>(nVal >> 8);
- *(pOut++) = static_cast<U8>(nVal);
+ *(pOut++) = static_cast<U8>(nInt >> 24);
+ *(pOut++) = static_cast<U8>(nInt >> 16);
+ *(pOut++) = static_cast<U8>(nInt >> 8);
+ *(pOut++) = static_cast<U8>(nInt);
}
mpWritePtr = pOut;
@@ -890,8 +943,8 @@ void CffSubsetterContext::writeType1Val( int/*TODO: double*/ nVal)
inline void CffSubsetterContext::pop2write( void)
{
- int nVal = pop();
- writeType1Val( nVal);
+ const ValType aVal = popVal();
+ writeType1Val( aVal);
}
// --------------------------------------------------------------------
@@ -915,8 +968,8 @@ void CffSubsetterContext::pop2MultiWrite( int nArgsPerTypo, int nTypeOp, int nTy
{
for( int i = 0; i < mnStackIdx;) {
for( int j = 0; j < nArgsPerTypo; ++j) {
- int nVal = mnValStack[i+j];
- writeType1Val( nVal);
+ const ValType aVal = mnValStack[i+j];
+ writeType1Val( aVal);
}
i += nArgsPerTypo;
writeTypeOp( nTypeOp);
@@ -931,8 +984,8 @@ void CffSubsetterContext::popAll2Write( int nTypeOp)
{
// pop in reverse order, then write
for( int i = 0; i < mnStackIdx; ++i) {
- int nVal = mnValStack[i];
- writeType1Val( nVal);
+ const ValType aVal = mnValStack[i];
+ writeType1Val( aVal);
}
clear();
writeTypeOp( nTypeOp);
@@ -944,23 +997,23 @@ void CffSubsetterContext::writeCurveTo( int nStackPos,
int nIX1, int nIY1, int nIX2, int nIY2, int nIX3, int nIY3)
{
// get the values from the stack
- const int nDX1 = nIX1 ? mnValStack[ nStackPos+nIX1] : 0;
- const int nDY1 = nIY1 ? mnValStack[ nStackPos+nIY1] : 0;
- const int nDX2 = nIX2 ? mnValStack[ nStackPos+nIX2] : 0;
- const int nDY2 = nIY2 ? mnValStack[ nStackPos+nIY2] : 0;
- const int nDX3 = nIX3 ? mnValStack[ nStackPos+nIX3] : 0;
- const int nDY3 = nIY3 ? mnValStack[ nStackPos+nIY3] : 0;
+ const ValType nDX1 = nIX1 ? mnValStack[ nStackPos+nIX1 ] : 0;
+ const ValType nDY1 = nIY1 ? mnValStack[ nStackPos+nIY1 ] : 0;
+ const ValType nDX2 = nIX2 ? mnValStack[ nStackPos+nIX2 ] : 0;
+ const ValType nDY2 = nIY2 ? mnValStack[ nStackPos+nIY2 ] : 0;
+ const ValType nDX3 = nIX3 ? mnValStack[ nStackPos+nIX3 ] : 0;
+ const ValType nDY3 = nIY3 ? mnValStack[ nStackPos+nIY3 ] : 0;
// emit the curveto operator and operands
// TODO: determine the most efficient curveto operator
// TODO: depending on type1op or type2op target
- writeType1Val( nDX1);
- writeType1Val( nDY1);
- writeType1Val( nDX2);
- writeType1Val( nDY2);
- writeType1Val( nDX3);
- writeType1Val( nDY3);
- writeTypeOp( TYPE1OP::RCURVETO);
+ writeType1Val( nDX1 );
+ writeType1Val( nDY1 );
+ writeType1Val( nDX2 );
+ writeType1Val( nDY2 );
+ writeType1Val( nDX3 );
+ writeType1Val( nDY3 );
+ writeTypeOp( TYPE1OP::RCURVETO );
}
// --------------------------------------------------------------------
@@ -969,7 +1022,7 @@ void CffSubsetterContext::convertOneTypeOp( void)
{
const int nType2Op = *(mpReadPtr++);
- int i, nVal; // prevent WAE for declarations inside switch cases
+ int i, nInt; // prevent WAE for declarations inside switch cases
// convert each T2op
switch( nType2Op) {
case TYPE2OP::T2ESC:
@@ -977,12 +1030,12 @@ void CffSubsetterContext::convertOneTypeOp( void)
break;
case TYPE2OP::HSTEM:
case TYPE2OP::VSTEM:
- addHints( nType2Op == TYPE2OP::VSTEM);
+ addHints( nType2Op == TYPE2OP::VSTEM );
#ifndef IGNORE_HINTS
- for( i = 0; i < mnHintSize; i+=2) {
+ for( i = 0; i < mnHintSize; i+=2 ) {
writeType1Val( mnHintStack[i]);
writeType1Val( mnHintStack[i+1] - mnHintStack[i]);
- writeTypeOp( nType2Op);
+ writeTypeOp( nType2Op );
}
#endif // IGNORE_HINTS
break;
@@ -1063,9 +1116,9 @@ void CffSubsetterContext::convertOneTypeOp( void)
case TYPE2OP::CALLSUBR:
case TYPE2OP::CALLGSUBR:
{
- nVal = pop();
+ nInt = popInt();
const bool bGlobal = (nType2Op == TYPE2OP::CALLGSUBR);
- callType2Subr( bGlobal, nVal);
+ callType2Subr( bGlobal, nInt);
}
break;
case TYPE2OP::RETURN:
@@ -1131,19 +1184,19 @@ void CffSubsetterContext::convertOneTypeOp( void)
{
bool bVert = (nType2Op == TYPE2OP::VHCURVETO);
i = 0;
- nVal = 0;
- if( mnStackIdx & 1)
- nVal = mnValStack[ --mnStackIdx];
+ nInt = 0;
+ if( mnStackIdx & 1 )
+ nInt = static_cast<int>(mnValStack[ --mnStackIdx ]);
while( (i += 4) <= mnStackIdx) {
// TODO: use writeCurveTo()
- if( bVert) writeType1Val( 0);
- writeType1Val( mnValStack[i-4]);
- if( !bVert) writeType1Val( 0);
- writeType1Val( mnValStack[i-3]);
- writeType1Val( mnValStack[i-2]);
- if( !bVert) writeType1Val( (i==mnStackIdx) ? nVal : 0);
- writeType1Val( mnValStack[i-1]);
- if( bVert) writeType1Val( (i==mnStackIdx) ? nVal : 0 );
+ if( bVert ) writeType1Val( 0 );
+ writeType1Val( mnValStack[i-4] );
+ if( !bVert ) writeType1Val( 0);
+ writeType1Val( mnValStack[i-3] );
+ writeType1Val( mnValStack[i-2] );
+ if( !bVert ) writeType1Val( static_cast<ValType>((i==mnStackIdx) ? nInt : 0) );
+ writeType1Val( mnValStack[i-1] );
+ if( bVert ) writeType1Val( static_cast<ValType>((i==mnStackIdx) ? nInt : 0) );
bVert = !bVert;
writeTypeOp( TYPE2OP::RCURVETO);
}
@@ -1195,83 +1248,83 @@ void CffSubsetterContext::convertOneTypeOp( void)
void CffSubsetterContext::convertOneTypeEsc( void)
{
const int nType2Esc = *(mpReadPtr++);
- int* pTop = &mnValStack[ mnStackIdx-1];
+ ValType* pTop = &mnValStack[ mnStackIdx-1];
// convert each T2op
switch( nType2Esc) {
case TYPE2OP::AND:
- assert( mnStackIdx >= 2);
- pTop[0] &= pTop[-1];
+ assert( mnStackIdx >= 2 );
+ pTop[0] = static_cast<ValType>(static_cast<int>(pTop[0]) & static_cast<int>(pTop[-1]));
--mnStackIdx;
break;
case TYPE2OP::OR:
- assert( mnStackIdx >= 2);
- pTop[0] |= pTop[-1];
+ assert( mnStackIdx >= 2 );
+ pTop[0] = static_cast<ValType>(static_cast<int>(pTop[0]) | static_cast<int>(pTop[-1]));
--mnStackIdx;
break;
case TYPE2OP::NOT:
- assert( mnStackIdx >= 1);
- pTop[0] = !pTop[0];
+ assert( mnStackIdx >= 1 );
+ pTop[0] = (pTop[0] == 0);
break;
case TYPE2OP::ABS:
- assert( mnStackIdx >= 1);
+ assert( mnStackIdx >= 1 );
if( pTop[0] >= 0)
break;
// fall through
case TYPE2OP::NEG:
- assert( mnStackIdx >= 1);
+ assert( mnStackIdx >= 1 );
pTop[0] = -pTop[0];
break;
case TYPE2OP::ADD:
- assert( mnStackIdx >= 2);
+ assert( mnStackIdx >= 2 );
pTop[0] += pTop[-1];
--mnStackIdx;
break;
case TYPE2OP::SUB:
- assert( mnStackIdx >= 2);
+ assert( mnStackIdx >= 2 );
pTop[0] -= pTop[-1];
--mnStackIdx;
break;
case TYPE2OP::MUL:
- assert( mnStackIdx >= 2);
+ assert( mnStackIdx >= 2 );
if( pTop[-1])
pTop[0] *= pTop[-1];
--mnStackIdx;
break;
case TYPE2OP::DIV:
- assert( mnStackIdx >= 2);
+ assert( mnStackIdx >= 2 );
if( pTop[-1])
pTop[0] /= pTop[-1];
--mnStackIdx;
break;
case TYPE2OP::EQ:
- assert( mnStackIdx >= 2);
+ assert( mnStackIdx >= 2 );
pTop[0] = (pTop[0] == pTop[-1]);
--mnStackIdx;
break;
case TYPE2OP::DROP:
- assert( mnStackIdx >= 1);
+ assert( mnStackIdx >= 1 );
--mnStackIdx;
break;
case TYPE2OP::PUT: {
- assert( mnStackIdx >= 2);
- const int nIdx = pTop[0];
- assert( nIdx >= 0);
- assert( nIdx < NMAXTRANS);
+ assert( mnStackIdx >= 2 );
+ const int nIdx = static_cast<int>(pTop[0]);
+ assert( nIdx >= 0 );
+ assert( nIdx < NMAXTRANS );
mnTransVals[ nIdx] = pTop[-1];
mnStackIdx -= 2;
break;
}
case TYPE2OP::GET: {
- assert( mnStackIdx >= 1);
- const int nIdx = pTop[0];
- assert( nIdx >= 0);
- assert( nIdx < NMAXTRANS);
- pTop[0] = mnTransVals[ nIdx];
+ assert( mnStackIdx >= 1 );
+ const int nIdx = static_cast<int>(pTop[0]);
+ assert( nIdx >= 0 );
+ assert( nIdx < NMAXTRANS );
+ pTop[0] = mnTransVals[ nIdx ];
break;
}
case TYPE2OP::IFELSE: {
- assert( mnStackIdx >= 4);
- if( pTop[-1] > pTop[0])
+ assert( mnStackIdx >= 4 );
+ if( pTop[-1] > pTop[0] )
pTop[-3] = pTop[-2];
mnStackIdx -= 3;
break;
@@ -1284,69 +1337,69 @@ void CffSubsetterContext::convertOneTypeEsc( void)
// TODO: implement
break;
case TYPE2OP::DUP:
- assert( mnStackIdx >= 1);
+ assert( mnStackIdx >= 1 );
pTop[+1] = pTop[0];
++mnStackIdx;
break;
case TYPE2OP::EXCH: {
- assert( mnStackIdx >= 2);
- const int nVal = pTop[0];
+ assert( mnStackIdx >= 2 );
+ const ValType nVal = pTop[0];
pTop[0] = pTop[-1];
pTop[-1] = nVal;
break;
}
case TYPE2OP::INDEX: {
- assert( mnStackIdx >= 1);
- const int nVal = pTop[0];
- assert( nVal >= 0);
- assert( nVal < mnStackIdx-1);
+ assert( mnStackIdx >= 1 );
+ const int nVal = static_cast<int>(pTop[0]);
+ assert( nVal >= 0 );
+ assert( nVal < mnStackIdx-1 );
pTop[0] = pTop[-1-nVal];
break;
}
case TYPE2OP::ROLL: {
- assert( mnStackIdx >= 1);
- const int nNum = pTop[0];
+ assert( mnStackIdx >= 1 );
+ const int nNum = static_cast<int>(pTop[0]);
assert( nNum >= 0);
- assert( nNum < mnStackIdx-2);
+ assert( nNum < mnStackIdx-2 );
(void)nNum; // TODO: implement
- const int nOfs = pTop[-1];
+ const int nOfs = static_cast<int>(pTop[-1]);
mnStackIdx -= 2;
(void)nOfs;// TODO: implement
break;
}
case TYPE2OP::HFLEX1: {
- assert( mnStackIdx == 9);
- writeCurveTo( mnStackIdx, -9, -8, -7, -6, -5, -6);
- writeCurveTo( mnStackIdx, -4, -6, -3, -2, -1, -8);
+ assert( mnStackIdx == 9 );
+ writeCurveTo( mnStackIdx, -9, -8, -7, -6, -5, -6 );
+ writeCurveTo( mnStackIdx, -4, -6, -3, -2, -1, -8 );
mnStackIdx -= 9;
}
break;
case TYPE2OP::HFLEX: {
- assert( mnStackIdx == 7);
- writeCurveTo( mnStackIdx, -7, 0, -6, -5, -4, -5);
- writeCurveTo( mnStackIdx, -3, -5, -2, 0, -1, 0);
+ assert( mnStackIdx == 7 );
+ writeCurveTo( mnStackIdx, -7, 0, -6, -5, -4, -5 );
+ writeCurveTo( mnStackIdx, -3, -5, -2, 0, -1, 0 );
mnStackIdx -= 7;
}
break;
case TYPE2OP::FLEX: {
- assert( mnStackIdx == 13);
- writeCurveTo( mnStackIdx, -13, -12, -11, -10, -9, -8);
- writeCurveTo( mnStackIdx, -7, -6, -5, -4, -3, -2);
- const int nFlexDepth = mnValStack[ mnStackIdx-1];
+ assert( mnStackIdx == 13 );
+ writeCurveTo( mnStackIdx, -13, -12, -11, -10, -9, -8 );
+ writeCurveTo( mnStackIdx, -7, -6, -5, -4, -3, -2 );
+ const ValType nFlexDepth = mnValStack[ mnStackIdx-1 ];
(void)nFlexDepth; // ignoring nFlexDepth
mnStackIdx -= 13;
}
break;
case TYPE2OP::FLEX1: {
- assert( mnStackIdx == 11);
+ assert( mnStackIdx == 11 );
// write the first part of the flex1-hinted curve
- writeCurveTo( mnStackIdx, -11, -10, -9, -8, -7, -6);
+ writeCurveTo( mnStackIdx, -11, -10, -9, -8, -7, -6 );
// determine if nD6 is horizontal or vertical
const int i = mnStackIdx;
- int nDeltaX = mnValStack[i-11] + mnValStack[i-9] + mnValStack[i-7] + mnValStack[i-5] + mnValStack[i-3];
+ ValType nDeltaX = mnValStack[i-11] + mnValStack[i-9] + mnValStack[i-7] + mnValStack[i-5] + mnValStack[i-3];
if( nDeltaX < 0 ) nDeltaX = -nDeltaX;
- int nDeltaY = mnValStack[i-10] + mnValStack[i-8] + mnValStack[i-6] + mnValStack[i-4] + mnValStack[i-2];
+ ValType nDeltaY = mnValStack[i-10] + mnValStack[i-8] + mnValStack[i-6] + mnValStack[i-4] + mnValStack[i-2];
if( nDeltaY < 0 ) nDeltaY = -nDeltaY;
const bool bVertD6 = (nDeltaY > nDeltaX);
@@ -1473,14 +1526,14 @@ if( mbSawError) {
// --------------------------------------------------------------------
-double CffSubsetterContext::readRealVal()
+RealType CffSubsetterContext::readRealVal()
{
// TODO: more thorough number validity test
bool bComma = false;
int nExpVal = 0;
int nExpSign = 0;
S64 nNumber = 0;
- double fReal = +1.0;
+ RealType fReal = +1.0;
for(;;){
const U8 c = *(mpReadPtr++); // read nibbles
// parse high nibble
@@ -1548,6 +1601,7 @@ double CffSubsetterContext::readRealVal()
// prepare to access an element inside a CFF/CID index table
int CffSubsetterContext::seekIndexData( int nIndexBase, int nDataIndex)
{
+ assert( (nIndexBase > 0) && (mpBasePtr + nIndexBase + 3 <= mpBaseEnd));
if( nDataIndex < 0)
return -1;
mpReadPtr = mpBasePtr + nIndexBase;
@@ -1578,6 +1632,7 @@ int CffSubsetterContext::seekIndexData( int nIndexBase, int nDataIndex)
mpReadEnd = mpReadPtr + (nOfs2 - nOfs1);
assert( nOfs1 >= 0);
assert( nOfs2 >= nOfs1);
+ assert( mpReadPtr <= mpBaseEnd);
assert( mpReadEnd <= mpBaseEnd);
return (nOfs2 - nOfs1);
}
@@ -1587,10 +1642,12 @@ int CffSubsetterContext::seekIndexData( int nIndexBase, int nDataIndex)
// skip over a CFF/CID index table
void CffSubsetterContext::seekIndexEnd( int nIndexBase)
{
+ assert( (nIndexBase > 0) && (mpBasePtr + nIndexBase + 3 <= mpBaseEnd));
mpReadPtr = mpBasePtr + nIndexBase;
const int nDataCount = (mpReadPtr[0]<<8) + mpReadPtr[1];
const int nDataOfsSz = mpReadPtr[2];
mpReadPtr += 3 + nDataOfsSz * nDataCount;
+ assert( mpReadPtr <= mpBaseEnd);
int nEndOfs = 0;
switch( nDataOfsSz) {
default: fprintf( stderr, "\tINVALID nDataOfsSz=%d\n\n", nDataOfsSz); return;
@@ -1602,6 +1659,8 @@ void CffSubsetterContext::seekIndexEnd( int nIndexBase)
mpReadPtr += nDataOfsSz;
mpReadPtr += nEndOfs - 1;
mpReadEnd = mpBaseEnd;
+ assert( nEndOfs >= 0);
+ assert( mpReadEnd <= mpBaseEnd);
}
// ====================================================================
@@ -1944,7 +2003,7 @@ public:
void emitAllCrypted( void);
int tellPos( void) const;
void updateLen( int nTellPos, int nLength);
- void emitIntVector( const char* pLineHead, const char* pLineTail, const IntVector&);
+ void emitValVector( const char* pLineHead, const char* pLineTail, const ValVector&);
private:
FILE* mpFileOut;
bool mbCloseOutfile;
@@ -2095,8 +2154,8 @@ void Type1Emitter::emitAllCrypted( void)
// --------------------------------------------------------------------
-void Type1Emitter::emitIntVector( const char* pLineHead, const char* pLineTail,
- const IntVector& rVector)
+void Type1Emitter::emitValVector( const char* pLineHead, const char* pLineTail,
+ const ValVector& rVector)
{
// ignore empty vectors
if( rVector.empty())
@@ -2105,15 +2164,15 @@ void Type1Emitter::emitIntVector( const char* pLineHead, const char* pLineTail,
// emit the line head
mpPtr += sprintf( mpPtr, pLineHead);
// emit the vector values
- IntVector::value_type nVal = 0;
- for( IntVector::const_iterator it = rVector.begin();;) {
- nVal = *it;
+ ValVector::value_type aVal = 0;
+ for( ValVector::const_iterator it = rVector.begin();;) {
+ aVal = *it;
if( ++it == rVector.end() )
break;
- mpPtr += sprintf( mpPtr, "%d ", nVal);
+ mpPtr += sprintf( mpPtr, "%g ", aVal);
}
// emit the last value
- mpPtr += sprintf( mpPtr, "%d", nVal);
+ mpPtr += sprintf( mpPtr, "%g", aVal);
// emit the line tail
mpPtr += sprintf( mpPtr, pLineTail);
}
@@ -2178,12 +2237,16 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
"/PaintType 0 def\n");
pOut += sprintf( pOut, "/FontName /%s def\n", rEmitter.maSubsetName);
pOut += sprintf( pOut, "/UniqueID %d def\n", nUniqueId);
- pOut += sprintf( pOut, "/FontMatrix [0.001 0 0 0.001 0 0 ]readonly def\n");
+ // emit FontMatrix
+ if( maFontMatrix.size() == 6)
+ rEmitter.emitValVector( "/FontMatrix [", "]readonly def\n", maFontMatrix);
+ else // emit default FontMatrix if needed
+ pOut += sprintf( pOut, "/FontMatrix [0.001 0 0 0.001 0 0]readonly def\n");
+ // emit FontBBox
if( maFontBBox.size() == 4)
- pOut += sprintf( pOut, "/FontBBox [%d %d %d %d ]readonly def\n",
- maFontBBox[0], maFontBBox[1], maFontBBox[2], maFontBBox[3]);
- else
- pOut += sprintf( pOut, "/FontBBox [0 0 999 999]readonly def\n");
+ rEmitter.emitValVector( "/FontBBox {", "}readonly def\n", maFontBBox);
+ else // emit default FontBBox if needed
+ pOut += sprintf( pOut, "/FontBBox {0 0 999 999}readonly def\n");
// emit FONTINFO into TOPDICT
pOut += sprintf( pOut,
"/FontInfo 2 dict dup begin\n" // TODO: check fontinfo entry count
@@ -2259,12 +2322,12 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
#else
// emit blue hint related privdict entries
if( !mpCffLocal->maBlueValues.empty())
- rEmitter.emitIntVector( "/BlueValues [", "]ND\n", mpCffLocal->maBlueValues);
+ rEmitter.emitValVector( "/BlueValues [", "]ND\n", mpCffLocal->maBlueValues);
else
pOut += sprintf( pOut, "/BlueValues []ND\n"); // default to empty BlueValues
- rEmitter.emitIntVector( "/OtherBlues [", "]ND\n", mpCffLocal->maOtherBlues);
- rEmitter.emitIntVector( "/FamilyBlues [", "]ND\n", mpCffLocal->maFamilyBlues);
- rEmitter.emitIntVector( "/FamilyOtherBlues [", "]ND\n", mpCffLocal->maFamilyOtherBlues);
+ rEmitter.emitValVector( "/OtherBlues [", "]ND\n", mpCffLocal->maOtherBlues);
+ rEmitter.emitValVector( "/FamilyBlues [", "]ND\n", mpCffLocal->maFamilyBlues);
+ rEmitter.emitValVector( "/FamilyOtherBlues [", "]ND\n", mpCffLocal->maFamilyOtherBlues);
if( mpCffLocal->mfBlueScale)
pOut += sprintf( pOut, "/BlueScale %.6f def\n", mpCffLocal->mfBlueScale);
@@ -2278,8 +2341,8 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
pOut += sprintf( pOut, "/StdHW [%d] def\n", mpCffLocal->mnStemStdHW);
if( mpCffLocal->mnStemStdVW)
pOut += sprintf( pOut, "/StdVW [%d] def\n", mpCffLocal->mnStemStdVW);
- rEmitter.emitIntVector( "/StemSnapH [", "]ND\n", mpCffLocal->maStemSnapH);
- rEmitter.emitIntVector( "/StemSnapV [", "]ND\n", mpCffLocal->maStemSnapV);
+ rEmitter.emitValVector( "/StemSnapH [", "]ND\n", mpCffLocal->maStemSnapH);
+ rEmitter.emitValVector( "/StemSnapV [", "]ND\n", mpCffLocal->maStemSnapV);
// emit other hints
if( mpCffLocal->mbForceBold)
@@ -2383,7 +2446,8 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
// provide details to the subset requesters, TODO: move into own method?
// note: Top and Bottom are flipped between Type1 and VCL
- rFSInfo.m_aFontBBox = Rectangle( Point( maFontBBox[0], maFontBBox[1] ), Point( maFontBBox[2], maFontBBox[3] ) );
+ rFSInfo.m_aFontBBox = Rectangle( Point( static_cast<long>(maFontBBox[0]), static_cast<long>(maFontBBox[1]) ),
+ Point( static_cast<long>(maFontBBox[2]), static_cast<long>(maFontBBox[3]) ) );
// PDF-Spec says the values below mean the ink bounds!
// TODO: use better approximations for these ink bounds
rFSInfo.m_nAscent = +rFSInfo.m_aFontBBox.Bottom(); // for capital letters
diff --git a/vcl/source/fontsubset/fontsubset.cxx b/vcl/source/fontsubset/fontsubset.cxx
index e203feed1645..84f548d0a32f 100644
--- a/vcl/source/fontsubset/fontsubset.cxx
+++ b/vcl/source/fontsubset/fontsubset.cxx
@@ -40,7 +40,7 @@ FontSubsetInfo::FontSubsetInfo()
, m_nCapHeight( 0)
, m_nFontType( FontSubsetInfo::NO_FONT)
, mpInFontBytes( NULL)
-, mnInByteLength( NULL)
+, mnInByteLength( 0)
, meInFontType( FontSubsetInfo::NO_FONT)
, mpSftTTFont( NULL)
{}
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 6bd612d364a1..77d924bc2e9a 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -6788,17 +6788,21 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
{
BOOL bHighContrastBlack = FALSE;
BOOL bHighContrastWhite = FALSE;
- Color aCol;
- if( rTargetDevice.IsBackground() )
- aCol = rTargetDevice.GetBackground().GetColor();
- else
- // best guess is the face color here
- // but it may be totally wrong. the background color
- // was typically already reset
- aCol = rTargetDevice.GetSettings().GetStyleSettings().GetFaceColor();
+ const StyleSettings& rStyleSettings( rTargetDevice.GetSettings().GetStyleSettings() );
+ if( rStyleSettings.GetHighContrastMode() )
+ {
+ Color aCol;
+ if( rTargetDevice.IsBackground() )
+ aCol = rTargetDevice.GetBackground().GetColor();
+ else
+ // best guess is the face color here
+ // but it may be totally wrong. the background color
+ // was typically already reset
+ aCol = rStyleSettings.GetFaceColor();
- bHighContrastBlack = aCol.IsDark();
- bHighContrastWhite = aCol.IsBright() && rTargetDevice.GetSettings().GetStyleSettings().GetHighContrastMode();
+ bHighContrastBlack = aCol.IsDark();
+ bHighContrastWhite = aCol.IsBright();
+ }
aOldTextColor = rTargetDevice.GetTextColor();
if ( rTargetDevice.IsTextFillColor() )
@@ -6806,8 +6810,6 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
bRestoreFillColor = TRUE;
aOldTextFillColor = rTargetDevice.GetTextFillColor();
}
- else
- bRestoreFillColor = FALSE;
if( bHighContrastBlack )
rTargetDevice.SetTextColor( COL_GREEN );
else if( bHighContrastWhite )
@@ -6822,7 +6824,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
aRect.Move( 1, 1 );
DrawText( aRect, rOrigStr, nStyle & ~TEXT_DRAW_DISABLE );
*/
- rTargetDevice.SetTextColor( rTargetDevice.GetSettings().GetStyleSettings().GetShadowColor() );
+ rTargetDevice.SetTextColor( rTargetDevice.GetSettings().GetStyleSettings().GetDisableColor() );
}
}
@@ -7472,13 +7474,18 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
BOOL bRestoreFillColor;
BOOL bHighContrastBlack = FALSE;
BOOL bHighContrastWhite = FALSE;
- if( IsBackground() )
+ const StyleSettings& rStyleSettings( GetSettings().GetStyleSettings() );
+ if( rStyleSettings.GetHighContrastMode() )
{
- Wallpaper aWall = GetBackground();
- Color aCol = aWall.GetColor();
- bHighContrastBlack = aCol.IsDark();
- bHighContrastWhite = aCol.IsBright() && GetSettings().GetStyleSettings().GetHighContrastMode();
+ if( IsBackground() )
+ {
+ Wallpaper aWall = GetBackground();
+ Color aCol = aWall.GetColor();
+ bHighContrastBlack = aCol.IsDark();
+ bHighContrastWhite = aCol.IsBright();
+ }
}
+
aOldTextColor = GetTextColor();
if ( IsTextFillColor() )
{
@@ -7493,7 +7500,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
else if( bHighContrastWhite )
SetTextColor( COL_LIGHTGREEN );
else
- SetTextColor( GetSettings().GetStyleSettings().GetShadowColor() );
+ SetTextColor( GetSettings().GetStyleSettings().GetDisableColor() );
DrawText( rPos, aStr, nIndex, nLen, pVector, pDisplayText );
if ( !(GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_NOMNEMONICS) && !pVector )
diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx
index e0c69ce582f4..587395fa783f 100644
--- a/vcl/source/gdi/wall.cxx
+++ b/vcl/source/gdi/wall.cxx
@@ -469,7 +469,7 @@ Gradient Wallpaper::ImplGetApplicationGradient() const
g.SetStyle( GRADIENT_LINEAR );
g.SetStartColor( Application::GetSettings().GetStyleSettings().GetFaceColor() );
// no 'extreme' gradient when high contrast
- if( Application::GetSettings().GetStyleSettings().GetFaceColor().IsDark() )
+ if( Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
g.SetEndColor( Application::GetSettings().GetStyleSettings().GetFaceColor() );
else
g.SetEndColor( Application::GetSettings().GetStyleSettings().GetFaceGradientColor() );
diff --git a/vcl/source/glyphs/graphite_adaptors.cxx b/vcl/source/glyphs/graphite_adaptors.cxx
index 67330698ffdf..9b16318fdc40 100644
--- a/vcl/source/glyphs/graphite_adaptors.cxx
+++ b/vcl/source/glyphs/graphite_adaptors.cxx
@@ -47,7 +47,7 @@
#include <rtl/ustring.hxx>
#include <i18npool/mslangid.hxx>
// Platform
-#ifndef MSC
+#ifndef WNT
#include <saldisp.hxx>
#include <vcl/salgdi.hxx>
diff --git a/vcl/source/glyphs/graphite_cache.cxx b/vcl/source/glyphs/graphite_cache.cxx
index c1bca0f87cb8..8c514c611d2c 100644
--- a/vcl/source/glyphs/graphite_cache.cxx
+++ b/vcl/source/glyphs/graphite_cache.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifdef MSC
+#ifdef WNT
#include <tools/svwin.h>
#include <svsys.h>
#endif
diff --git a/vcl/source/glyphs/graphite_features.cxx b/vcl/source/glyphs/graphite_features.cxx
index 3c5214d3c420..dae1bfc2866e 100644
--- a/vcl/source/glyphs/graphite_features.cxx
+++ b/vcl/source/glyphs/graphite_features.cxx
@@ -38,7 +38,7 @@
#include <sal/types.h>
-#ifdef MSC
+#ifdef WNT
#include <tools/svwin.h>
#include <svsys.h>
#endif
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 751c3694d033..86dee2749efa 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -54,7 +54,7 @@
#include <deque>
// Platform
-#ifdef MSC
+#ifdef WNT
#include <tools/svwin.h>
#include <svsys.h>
#endif
@@ -86,7 +86,7 @@
FILE * grLogFile = NULL;
FILE * grLog()
{
-#ifdef MSC
+#ifdef WNT
std::string logFileName(getenv("TEMP"));
logFileName.append("\\graphitelayout.log");
if (grLogFile == NULL) grLogFile = fopen(logFileName.c_str(),"w");
@@ -135,7 +135,7 @@ namespace
UErrorCode status = U_ZERO_ERROR;
UBiDi *ubidi = ubidi_openSized(charCount, 0, &status);
int limit = 0;
- ubidi_setPara(ubidi, buffer, charCount,
+ ubidi_setPara(ubidi, reinterpret_cast<const UChar *>(buffer), charCount,
(rtl)?UBIDI_DEFAULT_RTL:UBIDI_DEFAULT_LTR, NULL, &status);
UBiDiLevel level = 0;
ubidi_getLogicalRun(ubidi, 0, &limit, &level);
diff --git a/vcl/source/glyphs/graphite_serverfont.cxx b/vcl/source/glyphs/graphite_serverfont.cxx
index e8cd152b43ac..be424c94b9d2 100644
--- a/vcl/source/glyphs/graphite_serverfont.cxx
+++ b/vcl/source/glyphs/graphite_serverfont.cxx
@@ -45,7 +45,7 @@
#include "graphite_textsrc.hxx"
#include <vcl/graphite_serverfont.hxx>
-#ifndef MSC
+#ifndef WNT
//
// An implementation of the GraphiteLayout interface to enable Graphite enabled fonts to be used.
diff --git a/vcl/source/helper/lazydelete.cxx b/vcl/source/helper/lazydelete.cxx
index f5a8d8fbb14e..a300aedf8175 100644
--- a/vcl/source/helper/lazydelete.cxx
+++ b/vcl/source/helper/lazydelete.cxx
@@ -84,6 +84,9 @@ template<> bool LazyDeletor<Menu>::is_less( Menu* left, Menu* right )
DeleteOnDeinitBase::~DeleteOnDeinitBase()
{
+ ImplSVData* pSVData = ImplGetSVData();
+ if( pSVData && pSVData->mpDeinitDeleteList != NULL )
+ pSVData->mpDeinitDeleteList->remove( this );
}
void DeleteOnDeinitBase::addDeinitContainer( DeleteOnDeinitBase* i_pContainer )
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index f8baad0b4137..c9e8d11557e8 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -1840,7 +1840,7 @@ void ImplBorderWindow::ImplInit( Window* pParent,
{
// Alle WindowBits entfernen, die wir nicht haben wollen
WinBits nOrgStyle = nStyle;
- WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_PINABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN | WB_INTROWIN | WB_DEFAULTWIN | WB_TOOLTIPWIN | WB_NOSHADOW | WB_OWNERDRAWDECORATION | WB_SYSTEMCHILDWINDOW );
+ WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_PINABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN | WB_INTROWIN | WB_DEFAULTWIN | WB_TOOLTIPWIN | WB_NOSHADOW | WB_OWNERDRAWDECORATION | WB_SYSTEMCHILDWINDOW | WB_NEEDSFOCUS);
if ( nTypeStyle & BORDERWINDOW_STYLE_APP )
nTestStyle |= WB_APP;
nStyle &= nTestStyle;
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index b5f1ada74a98..c587b7ad8441 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -1238,8 +1238,8 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox )
ULONG nFlags = FLOATWIN_POPUPMODE_ALLOWTEAROFF |
FLOATWIN_POPUPMODE_NOFOCUSCLOSE |
FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE |
- FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE |
- FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE;
+ FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE;
+// |FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE;
// if the subtoolbar was opened via keyboard make sure that key events
// will go into subtoolbar
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 7bcb90bbb8fc..5f1578c4b9e2 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -243,6 +243,13 @@ FloatingWindow::~FloatingWindow()
// -----------------------------------------------------------------------
+Point FloatingWindow::CalcFloatingPosition( Window* pWindow, const Rectangle& rRect, ULONG nFlags, USHORT& rArrangeIndex )
+{
+ return ImplCalcPos( pWindow, rRect, nFlags, rArrangeIndex );
+}
+
+// -----------------------------------------------------------------------
+
Point FloatingWindow::ImplCalcPos( Window* pWindow,
const Rectangle& rRect, ULONG nFlags,
USHORT& rArrangeIndex )
@@ -676,8 +683,6 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags )
// avoid close on focus change for decorated floating windows only
if( mpWindowImpl->mbFrame && (GetStyle() & WB_MOVEABLE) )
nFlags |= FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE;
- else
- nFlags &= ~FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE;
// #102010# For debugging Accessibility
static const char* pEnv = getenv("SAL_FLOATWIN_NOAPPFOCUSCLOSE" );
@@ -751,8 +756,9 @@ void FloatingWindow::StartPopupMode( ToolBox* pBox, ULONG nFlags )
// FLOATWIN_POPUPMODE_NOMOUSECLOSE |
FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE |
// FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE | // #105968# floating toolboxes should close when clicked in (parent's) float rect
- FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE |
- FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE;
+ FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE;
+// | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE;
+
/*
* FLOATWIN_POPUPMODE_NOKEYCLOSE |
* don't set since it disables closing floaters with escape
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 9ce8030c4bb9..ebd4475a80fc 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -557,7 +557,7 @@ public:
void DataChanged( const DataChangedEvent& rDCEvt );
- void SetImages( long nMaxHeight = 0 );
+ void SetImages( long nMaxHeight = 0, bool bForce = false );
void calcMinSize();
Size getMinSize();
@@ -591,7 +591,7 @@ void DecoToolBox::DataChanged( const DataChangedEvent& rDCEvt )
{
calcMinSize();
SetBackground();
- SetImages();
+ SetImages( 0, true);
}
}
@@ -625,7 +625,7 @@ Size DecoToolBox::getMinSize()
return maMinSize;
}
-void DecoToolBox::SetImages( long nMaxHeight )
+void DecoToolBox::SetImages( long nMaxHeight, bool bForce )
{
long border = getMinSize().Height() - maImage.GetSizePixel().Height();
@@ -635,13 +635,13 @@ void DecoToolBox::SetImages( long nMaxHeight )
if( nMaxHeight < getMinSize().Height() )
nMaxHeight = getMinSize().Height();
- if( lastSize != nMaxHeight - border )
+ if( (lastSize != nMaxHeight - border) || bForce )
{
lastSize = nMaxHeight - border;
Color aEraseColor( 255, 255, 255, 255 );
BitmapEx aBmpExDst( maImage.GetBitmapEx() );
- BitmapEx aBmpExSrc( GetSettings().GetStyleSettings().GetMenuBarColor().IsDark() ?
+ BitmapEx aBmpExSrc( GetSettings().GetStyleSettings().GetHighContrastMode() ?
maImageHC.GetBitmapEx() : aBmpExDst );
aEraseColor.SetTransparency( 255 );
@@ -5066,7 +5066,7 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) :
aCloser.SetParentClipMode( PARENTCLIPMODE_NOCLIP );
aCloser.InsertItem( IID_DOCUMENTCLOSE,
- GetSettings().GetStyleSettings().GetMenuBarColor().IsDark() ? aCloser.maImageHC : aCloser.maImage, 0 );
+ GetSettings().GetStyleSettings().GetHighContrastMode() ? aCloser.maImageHC : aCloser.maImage, 0 );
aCloser.SetSelectHdl( LINK( this, MenuBarWindow, CloserHdl ) );
aCloser.AddEventListener( LINK( this, MenuBarWindow, ToolboxEventHdl ) );
aCloser.SetQuickHelpText( IID_DOCUMENTCLOSE, XubString( ResId( SV_HELPTEXT_CLOSEDOCUMENT, *pResMgr ) ) );
@@ -5707,7 +5707,7 @@ void MenuBarWindow::Paint( const Rectangle& )
// in high contrast mode draw a separating line on the lower edge
if( ! IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL) &&
- GetSettings().GetStyleSettings().GetFaceColor().IsDark() )
+ GetSettings().GetStyleSettings().GetHighContrastMode() )
{
Push( PUSH_LINECOLOR | PUSH_MAPMODE );
SetLineColor( Color( COL_WHITE ) );
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index bd727092a836..3d3245af831f 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -500,7 +500,7 @@ void InfoBox::ImplInitInfoBoxData()
if ( !GetText().Len() )
SetText( Application::GetDisplayName() );
- SetImage( GetSettings().GetStyleSettings().GetDialogColor().IsDark() ?
+ SetImage( GetSettings().GetStyleSettings().GetHighContrastMode() ?
InfoBox::GetStandardImageHC() : InfoBox::GetStandardImage() );
mnSoundType = ((USHORT)SOUND_INFO)+1;
}
@@ -591,7 +591,7 @@ void ErrorBox::ImplInitErrorBoxData()
if ( !GetText().Len() )
SetText( Application::GetDisplayName() );
- SetImage( GetSettings().GetStyleSettings().GetDialogColor().IsDark() ?
+ SetImage( GetSettings().GetStyleSettings().GetHighContrastMode() ?
ErrorBox::GetStandardImageHC() : ErrorBox::GetStandardImage() );
mnSoundType = ((USHORT)SOUND_ERROR)+1;
}
@@ -637,7 +637,7 @@ void QueryBox::ImplInitQueryBoxData()
if ( !GetText().Len() )
SetText( Application::GetDisplayName() );
- SetImage( GetSettings().GetStyleSettings().GetDialogColor().IsDark() ?
+ SetImage( GetSettings().GetStyleSettings().GetHighContrastMode() ?
QueryBox::GetStandardImageHC() : QueryBox::GetStandardImage() );
mnSoundType = ((USHORT)SOUND_QUERY)+1;
}
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 68fa3b74ccf1..8aa4926f5e1a 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -397,7 +397,7 @@ void ToolBox::ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapp
Color startCol, endCol;
startCol = pThis->GetSettings().GetStyleSettings().GetFaceGradientColor();
endCol = pThis->GetSettings().GetStyleSettings().GetFaceColor();
- if( endCol.IsDark() )
+ if( pThis->GetSettings().GetStyleSettings().GetHighContrastMode() )
// no 'extreme' gradient when high contrast
startCol = endCol;
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 7fa8f76e1586..9ec86fab20de 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -2413,10 +2413,10 @@ void ToolBox::ImplUpdateImageList()
{
if (mpData->mpImageListProvider != NULL)
{
- BOOL bIsDark = GetSettings().GetStyleSettings().GetFaceColor().IsDark();
+ BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
try
{
- ImageListType eType = bIsDark ? vcl::HIGHCONTRAST_YES : vcl::HIGHCONTRAST_NO;
+ ImageListType eType = bHC ? vcl::HIGHCONTRAST_YES : vcl::HIGHCONTRAST_NO;
if (eType != mpData->meImageListType)
{
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 92cb4b5233cf..69d2ebfdbaa4 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -292,6 +292,13 @@ bool Window::ImplCheckUIFont( const Font& rFont )
void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
{
+ // reset high contrast to false, so the system can either update it
+ // or AutoDetectSystemHC can kick in (see below)
+ StyleSettings aTmpSt( rSettings.GetStyleSettings() );
+ aTmpSt.SetHighContrastMode( FALSE );
+ rSettings.SetStyleSettings( aTmpSt );
+ ImplGetFrame()->UpdateSettings( rSettings );
+
// Verify availability of the configured UI font, otherwise choose "Andale Sans UI"
String aUserInterfaceFont;
bool bUseSystemFont = rSettings.GetStyleSettings().GetUseSystemUIFonts();
@@ -472,7 +479,8 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
rSettings.SetStyleSettings( aStyleSettings );
- // #104427# auto detect HC mode ?
+ // auto detect HC mode; if the system already set it to "yes"
+ // (see above) then accept that
if( !rSettings.GetStyleSettings().GetHighContrastMode() )
{
sal_Bool bTmp = sal_False, bAutoHCMode = sal_True;
@@ -728,7 +736,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
nBorderTypeStyle |= BORDERWINDOW_STYLE_FRAME;
nStyle |= WB_BORDER;
}
- ImplBorderWindow* pBorderWin = new ImplBorderWindow( pParent, nStyle & (WB_BORDER | WB_DIALOGCONTROL | WB_NODIALOGCONTROL), nBorderTypeStyle );
+ ImplBorderWindow* pBorderWin = new ImplBorderWindow( pParent, nStyle & (WB_BORDER | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_NEEDSFOCUS), nBorderTypeStyle );
((Window*)pBorderWin)->mpWindowImpl->mpClientWindow = this;
pBorderWin->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder );
mpWindowImpl->mpBorderWindow = pBorderWin;
@@ -783,6 +791,8 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
nFrameStyle = SAL_FRAME_STYLE_FLOAT;
if( nStyle & WB_OWNERDRAWDECORATION )
nFrameStyle |= (SAL_FRAME_STYLE_OWNERDRAWDECORATION | SAL_FRAME_STYLE_NOSHADOW);
+ if( nStyle & WB_NEEDSFOCUS )
+ nFrameStyle |= SAL_FRAME_STYLE_FLOAT_FOCUSABLE;
}
else if( mpWindowImpl->mbFloatWin )
nFrameStyle |= SAL_FRAME_STYLE_TOOLWINDOW;
@@ -923,7 +933,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
! (nStyle & (WB_INTROWIN|WB_DEFAULTWIN))
)
{
- mpWindowImpl->mpFrame->UpdateSettings( *pSVData->maAppData.mpSettings );
+ // side effect: ImplUpdateGlobalSettings does an ImplGetFrame()->UpdateSettings
ImplUpdateGlobalSettings( *pSVData->maAppData.mpSettings );
OutputDevice::SetSettings( *pSVData->maAppData.mpSettings );
pSVData->maAppData.mbSettingsInit = TRUE;