summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/aqua/inc/salframe.h3
-rwxr-xr-xvcl/aqua/inc/salframeview.h6
-rw-r--r--vcl/aqua/source/a11y/documentfocuslistener.cxx4
-rw-r--r--vcl/aqua/source/app/salinst.cxx4
-rw-r--r--vcl/aqua/source/window/salframe.cxx24
-rwxr-xr-xvcl/aqua/source/window/salframeview.mm35
-rw-r--r--vcl/inc/vcl/dialog.hxx1
-rw-r--r--vcl/inc/vcl/fldunit.hxx10
-rw-r--r--vcl/inc/vcl/fontcfg.hxx232
-rw-r--r--vcl/inc/vcl/fontcvt.hxx103
-rw-r--r--vcl/inc/vcl/impimagetree.hxx22
-rw-r--r--vcl/inc/vcl/mapunit.hxx10
-rw-r--r--vcl/inc/vcl/outdev.h29
-rw-r--r--vcl/inc/vcl/outdev.hxx26
-rw-r--r--vcl/inc/vcl/outfont.hxx16
-rw-r--r--vcl/inc/vcl/pdfwriter.hxx2
-rw-r--r--vcl/inc/vcl/salbtype.hxx32
-rw-r--r--vcl/inc/vcl/salframe.hxx1
-rw-r--r--vcl/inc/vcl/salsession.hxx10
-rw-r--r--vcl/inc/vcl/settings.hxx21
-rw-r--r--vcl/inc/vcl/svdata.hxx44
-rw-r--r--vcl/inc/vcl/syswin.hxx4
-rw-r--r--vcl/inc/vcl/toolbox.h1
-rw-r--r--vcl/inc/vcl/wintypes.hxx303
-rw-r--r--vcl/os2/source/app/salinst.cxx3
-rw-r--r--vcl/prj/build.lst2
-rw-r--r--vcl/source/app/salvtables.cxx7
-rw-r--r--vcl/source/app/session.cxx26
-rwxr-xr-x[-rw-r--r--]vcl/source/app/settings.cxx203
-rw-r--r--vcl/source/app/svapp.cxx12
-rw-r--r--vcl/source/app/svdata.cxx8
-rw-r--r--vcl/source/app/svmain.cxx10
-rw-r--r--vcl/source/control/field2.cxx11
-rw-r--r--vcl/source/gdi/base14.cxx2
-rw-r--r--vcl/source/gdi/configsettings.cxx205
-rw-r--r--vcl/source/gdi/font.cxx12
-rw-r--r--vcl/source/gdi/fontcfg.cxx1381
-rw-r--r--vcl/source/gdi/fontcvt.cxx1528
-rw-r--r--vcl/source/gdi/impimagetree.cxx60
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/makefile.mk5
-rw-r--r--vcl/source/gdi/outdev.cxx13
-rw-r--r--vcl/source/gdi/outdev3.cxx611
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx238
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx10
-rw-r--r--vcl/source/gdi/region.cxx8
-rw-r--r--vcl/source/window/accmgr.cxx17
-rw-r--r--vcl/source/window/dialog.cxx14
-rw-r--r--vcl/source/window/syswin.cxx24
-rw-r--r--vcl/source/window/toolbox2.cxx3
-rw-r--r--vcl/source/window/window.cxx4
-rw-r--r--vcl/unx/gtk/a11y/atktext.cxx12
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx5
-rw-r--r--vcl/unx/inc/kde_headers.h97
-rw-r--r--vcl/unx/inc/plugins/kde/kdedata.hxx2
-rw-r--r--vcl/unx/inc/salframe.h4
-rw-r--r--vcl/unx/inc/sm.hxx2
-rw-r--r--vcl/unx/kde/kdedata.cxx2
-rw-r--r--vcl/unx/kde/salnativewidgets-kde.cxx7
-rw-r--r--vcl/unx/kde4/KDESalFrame.cxx5
-rw-r--r--vcl/unx/kde4/KDESalFrame.hxx2
-rw-r--r--vcl/unx/source/app/salinst.cxx4
-rw-r--r--vcl/unx/source/app/sm.cxx13
-rw-r--r--vcl/unx/source/gdi/salgdi.cxx2
-rw-r--r--vcl/unx/source/plugadapt/salplug.cxx58
-rw-r--r--vcl/unx/source/printergfx/glyphset.cxx38
-rw-r--r--vcl/unx/source/window/salframe.cxx10
-rw-r--r--vcl/util/makefile.mk1
-rw-r--r--vcl/win/source/app/salinst.cxx3
-rw-r--r--vcl/win/source/window/salframe.cxx3
69 files changed, 1034 insertions, 4596 deletions
diff --git a/vcl/aqua/inc/salframe.h b/vcl/aqua/inc/salframe.h
index 1d1eb3cb6bd3..5ddd96dae34d 100644
--- a/vcl/aqua/inc/salframe.h
+++ b/vcl/aqua/inc/salframe.h
@@ -121,6 +121,7 @@ public:
virtual BOOL PostEvent( void* pData );
virtual void SetTitle( const XubString& rTitle );
virtual void SetIcon( USHORT nIcon );
+ virtual void SetRepresentedURL( const rtl::OUString& );
virtual void SetMenu( SalMenu* pSalMenu );
virtual void DrawMenuBar();
virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
@@ -140,7 +141,7 @@ public:
virtual void SetPointer( PointerStyle ePointerStyle );
virtual void CaptureMouse( BOOL bMouse );
virtual void SetPointerPos( long nX, long nY );
- virtual void Flush( void);
+ virtual void Flush( void );
virtual void Flush( const Rectangle& );
virtual void Sync();
virtual void SetInputContext( SalInputContext* pContext );
diff --git a/vcl/aqua/inc/salframeview.h b/vcl/aqua/inc/salframeview.h
index 7fd4d96c4a45..e823837e7af6 100755
--- a/vcl/aqua/inc/salframeview.h
+++ b/vcl/aqua/inc/salframeview.h
@@ -132,7 +132,11 @@
-(void)moveWordForwardAndModifySelection: (id)aSender;
-(void)moveWordRightAndModifySelection: (id)aSender;
-(void)moveToEndOfLine: (id)aSender;
+-(void)moveToRightEndOfLine: (id)aSender;
+-(void)moveToLeftEndOfLine: (id)aSender;
-(void)moveToEndOfLineAndModifySelection: (id)aSender;
+-(void)moveToRightEndOfLineAndModifySelection: (id)aSender;
+-(void)moveToLeftEndOfLineAndModifySelection: (id)aSender;
-(void)moveToBeginningOfLine: (id)aSender;
-(void)moveToBeginningOfLineAndModifySelection: (id)aSender;
-(void)moveToEndOfParagraph: (id)aSender;
@@ -144,8 +148,10 @@
-(void)moveParagraphBackward: (id)aSender;
-(void)moveParagraphBackwardAndModifySelection: (id)aSender;
-(void)moveToEndOfDocument: (id)aSender;
+-(void)scrollToEndOfDocument: (id)aSender;
-(void)moveToEndOfDocumentAndModifySelection: (id)aSender;
-(void)moveToBeginningOfDocument: (id)aSender;
+-(void)scrollToBeginningOfDocument: (id)aSender;
-(void)moveToBeginningOfDocumentAndModifySelection: (id)aSender;
-(void)insertNewline: (id)aSender;
-(void)deleteBackward: (id)aSender;
diff --git a/vcl/aqua/source/a11y/documentfocuslistener.cxx b/vcl/aqua/source/a11y/documentfocuslistener.cxx
index 2bb1429bc9fe..f20a67a85f29 100644
--- a/vcl/aqua/source/a11y/documentfocuslistener.cxx
+++ b/vcl/aqua/source/a11y/documentfocuslistener.cxx
@@ -102,12 +102,12 @@ DocumentFocusListener::notifyEvent( const AccessibleEventObject& aEvent )
break;
case AccessibleEventId::INVALIDATE_ALL_CHILDREN:
-/* {
+ {
Reference< XAccessible > xAccessible( getAccessible(aEvent) );
detachRecursive(xAccessible);
attachRecursive(xAccessible);
}
-*/
+
OSL_TRACE( "Invalidate all children called\n" );
break;
default:
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index e4037df0c4aa..4ec3339d5372 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -69,7 +69,7 @@
#import "apple_remote/RemoteMainController.h"
#include "apple_remote/RemoteControl.h"
#include "postmac.h"
-
+#include <tools/solarmutex.hxx>
using namespace std;
using namespace ::com::sun::star;
@@ -472,6 +472,7 @@ AquaSalInstance::AquaSalInstance()
{
mpSalYieldMutex = new SalYieldMutex;
mpSalYieldMutex->acquire();
+ ::tools::SolarMutex::SetSolarMutex( mpSalYieldMutex );
maMainThread = vos::OThread::getCurrentIdentifier();
mbWaitingYield = false;
maUserEventListMutex = osl_createMutex();
@@ -482,6 +483,7 @@ AquaSalInstance::AquaSalInstance()
AquaSalInstance::~AquaSalInstance()
{
+ ::tools::SolarMutex::SetSolarMutex( 0 );
mpSalYieldMutex->release();
delete mpSalYieldMutex;
osl_destroyMutex( maUserEventListMutex );
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index b942c97cead1..7fe3b93ef2e8 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -54,10 +54,7 @@
#include "boost/assert.hpp"
#include "vcl/svapp.hxx"
#include "rtl/ustrbuf.hxx"
-
-#include <premac.h>
-#include <CoreFoundation/CoreFoundation.h>
-#include <postmac.h>
+#include "osl/file.h"
using namespace std;
@@ -329,8 +326,25 @@ void AquaSalFrame::SetTitle(const XubString& rTitle)
// -----------------------------------------------------------------------
-void AquaSalFrame::SetIcon( USHORT nIcon )
+void AquaSalFrame::SetIcon( USHORT )
+{
+}
+
+// -----------------------------------------------------------------------
+
+void AquaSalFrame::SetRepresentedURL( const rtl::OUString& i_rDocURL )
{
+ if( i_rDocURL.indexOfAsciiL( "file:", 5 ) == 0 )
+ {
+ rtl::OUString aSysPath;
+ osl_getSystemPathFromFileURL( i_rDocURL.pData, &aSysPath.pData );
+ NSString* pStr = CreateNSString( aSysPath );
+ if( pStr )
+ {
+ [pStr autorelease];
+ [mpWindow setRepresentedFilename: pStr];
+ }
+ }
}
// -----------------------------------------------------------------------
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index aabc287dc885..51f1b1a3b63c 100755
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -1065,21 +1065,41 @@ private:
[self sendKeyInputAndReleaseToFrame: com::sun::star::awt::Key::MOVE_TO_END_OF_LINE character: 0 modifiers: 0];
}
+-(void)moveToRightEndOfLine: (id)aSender
+{
+ [self sendKeyInputAndReleaseToFrame: com::sun::star::awt::Key::MOVE_TO_END_OF_LINE character: 0 modifiers: 0];
+}
+
-(void)moveToEndOfLineAndModifySelection: (id)aSender
{
[self sendKeyInputAndReleaseToFrame: com::sun::star::awt::Key::SELECT_TO_END_OF_LINE character: 0 modifiers: 0];
}
+-(void)moveToRightEndOfLineAndModifySelection: (id)aSender
+{
+ [self sendKeyInputAndReleaseToFrame: com::sun::star::awt::Key::SELECT_TO_END_OF_LINE character: 0 modifiers: 0];
+}
+
-(void)moveToBeginningOfLine: (id)aSender
{
[self sendKeyInputAndReleaseToFrame: com::sun::star::awt::Key::MOVE_TO_BEGIN_OF_LINE character: 0 modifiers: 0];
}
+-(void)moveToLeftEndOfLine: (id)aSender
+{
+ [self sendKeyInputAndReleaseToFrame: com::sun::star::awt::Key::MOVE_TO_BEGIN_OF_LINE character: 0 modifiers: 0];
+}
+
-(void)moveToBeginningOfLineAndModifySelection: (id)aSender
{
[self sendKeyInputAndReleaseToFrame: com::sun::star::awt::Key::SELECT_TO_BEGIN_OF_LINE character: 0 modifiers: 0];
}
+-(void)moveToLeftEndOfLineAndModifySelection: (id)aSender
+{
+ [self sendKeyInputAndReleaseToFrame: com::sun::star::awt::Key::SELECT_TO_BEGIN_OF_LINE character: 0 modifiers: 0];
+}
+
-(void)moveToEndOfParagraph: (id)aSender
{
[self sendKeyInputAndReleaseToFrame: com::sun::star::awt::Key::MOVE_TO_END_OF_PARAGRAPH character: 0 modifiers: 0];
@@ -1125,6 +1145,12 @@ private:
[self sendKeyInputAndReleaseToFrame: com::sun::star::awt::Key::MOVE_TO_END_OF_DOCUMENT character: 0 modifiers: 0];
}
+-(void)scrollToEndOfDocument: (id)aSender
+{
+ // this is not exactly what we should do, but it makes "End" and "Shift-End" behave consistent
+ [self sendKeyInputAndReleaseToFrame: com::sun::star::awt::Key::MOVE_TO_END_OF_DOCUMENT character: 0 modifiers: 0];
+}
+
-(void)moveToEndOfDocumentAndModifySelection: (id)aSender
{
[self sendKeyInputAndReleaseToFrame: com::sun::star::awt::Key::SELECT_TO_END_OF_DOCUMENT character: 0 modifiers: 0];
@@ -1135,6 +1161,12 @@ private:
[self sendKeyInputAndReleaseToFrame: com::sun::star::awt::Key::MOVE_TO_BEGIN_OF_DOCUMENT character: 0 modifiers: 0];
}
+-(void)scrollToBeginningOfDocument: (id)aSender
+{
+ // this is not exactly what we should do, but it makes "Home" and "Shift-Home" behave consistent
+ [self sendKeyInputAndReleaseToFrame: com::sun::star::awt::Key::MOVE_TO_BEGIN_OF_DOCUMENT character: 0 modifiers: 0];
+}
+
-(void)moveToBeginningOfDocumentAndModifySelection: (id)aSender
{
[self sendKeyInputAndReleaseToFrame: com::sun::star::awt::Key::SELECT_TO_BEGIN_OF_DOCUMENT character: 0 modifiers: 0];
@@ -1462,6 +1494,9 @@ private:
{
if( AquaSalFrame::isAlive( mpFrame ) )
{
+ #if OSL_DEBUG_LEVEL > 1
+ // fprintf( stderr, "SalFrameView: doCommandBySelector %s\n", (char*)aSelector );
+ #endif
if( (mpFrame->mnICOptions & SAL_INPUTCONTEXT_TEXT) != 0 &&
aSelector != NULL && [self respondsToSelector: aSelector] )
{
diff --git a/vcl/inc/vcl/dialog.hxx b/vcl/inc/vcl/dialog.hxx
index f34db3a2a5db..c5f032dfff82 100644
--- a/vcl/inc/vcl/dialog.hxx
+++ b/vcl/inc/vcl/dialog.hxx
@@ -65,6 +65,7 @@ private:
SAL_DLLPRIVATE Dialog (const Dialog &);
SAL_DLLPRIVATE Dialog & operator= (const Dialog &);
+ DECL_DLLPRIVATE_LINK( ImplAsyncCloseHdl, void* );
protected:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle );
diff --git a/vcl/inc/vcl/fldunit.hxx b/vcl/inc/vcl/fldunit.hxx
index 98bc27cbadba..7417342d95be 100644
--- a/vcl/inc/vcl/fldunit.hxx
+++ b/vcl/inc/vcl/fldunit.hxx
@@ -31,14 +31,6 @@
#ifndef _VCL_FLDUNIT_HXX
#define _VCL_FLDUNIT_HXX
-// --------------
-// - FieldTypes -
-// --------------
-
-// By changes you must also change: rsc/vclrsc.hxx
-enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM,
- FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA,
- FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CUSTOM,
- FUNIT_PERCENT, FUNIT_100TH_MM };
+#include <tools/fldunit.hxx>
#endif // _VCL_FLDUNIT_HXX
diff --git a/vcl/inc/vcl/fontcfg.hxx b/vcl/inc/vcl/fontcfg.hxx
deleted file mode 100644
index 76864f0cb40a..000000000000
--- a/vcl/inc/vcl/fontcfg.hxx
+++ /dev/null
@@ -1,232 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: fontcfg.hxx,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _VCL_FONTCFG_HXX
-#define _VCL_FONTCFG_HXX
-
-#include "dllapi.h"
-#include <tools/string.hxx>
-#ifndef _VCL_ENUM_HXX
-#include <vcl/vclenum.hxx>
-#endif
-#include <com/sun/star/lang/Locale.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-
-#include <hash_map>
-#include <hash_set>
-#include <vector>
-
-namespace com {
-namespace sun {
-namespace star {
-namespace lang {
-
-// equality operator needed for hash_map;
-// (-> why does this need to be in the namespace of Locale ? g++ fails to compile else)
-inline bool operator==( const com::sun::star::lang::Locale& rLeft, const com::sun::star::lang::Locale& rRight )
-{
- return
- rLeft.Language.equals( rRight.Language ) &&
- rLeft.Country.equals( rRight.Country ) &&
- rLeft.Variant.equals( rRight.Variant )
- ;
-}
-}}}}
-
-namespace vcl
-{
-
-struct LocaleHash
-{
- size_t operator()( const com::sun::star::lang::Locale& rLocale ) const
- {
- return
- (size_t)rLocale.Language.hashCode() ^
- (size_t)rLocale.Country.hashCode() ^
- (size_t)rLocale.Variant.hashCode();
- }
-};
-
-class DefaultFontConfiguration
-{
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
- m_xConfigProvider;
- com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >
- m_xConfigAccess;
-
- struct LocaleAccess
- {
- // the real string used in the configuration
- // used to get rid of upper/lower case problems
- rtl::OUString aConfigLocaleString;
- // xAccess is mutable to be able to be filled on demand
- mutable com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xAccess;
- };
-
- std::hash_map< com::sun::star::lang::Locale,
- LocaleAccess,
- vcl::LocaleHash >
- m_aConfig;
-
- rtl::OUString tryLocale( const com::sun::star::lang::Locale& rLocale, const rtl::OUString& rType ) const;
-
- DefaultFontConfiguration();
- public:
- ~DefaultFontConfiguration();
-
- static DefaultFontConfiguration* get();
-
- rtl::OUString getDefaultFont( const com::sun::star::lang::Locale& rLocale, int nType ) const;
- rtl::OUString getUserInterfaceFont( const com::sun::star::lang::Locale& rLocale ) const;
-};
-
-// IMPL_FONT_ATTR_DEFAULT - Default-Font like Andale Sans UI, Palace Script, Albany, Thorndale, Cumberland, ...
-// IMPL_FONT_ATTR_STANDARD - Standard-Font like Arial, Times, Courier, ...
-// IMPL_FONT_ATTR_NORMAL - normal Font for writing text like Arial, Verdana, Arial Narrow, Trebuchet, Times, Courier, ...
-// IMPL_FONT_ATTR_SYMBOL - Font with symbols
-// IMPL_FONT_ATTR_DECORATIVE - Readable and normally used for drawings
-// IMPL_FONT_ATTR_SPECIAL - very special design
-// IMPL_FONT_ATTR_TITLING - only uppercase characters
-// IMPL_FONT_ATTR_FULL - Font with normally all characters
-// IMPL_FONT_ATTR_CAPITALS - only uppercase characters, but lowercase characters smaller as the uppercase characters
-// IMPL_FONT_ATTR_TYPEWRITER - like a typewriter: Courier, ...
-// IMPL_FONT_ATTR_SCRIPT - Handwriting or Script
-// IMPL_FONT_ATTR_HANDWRITING - More Handwriting with normal letters
-// IMPL_FONT_ATTR_CHANCERY - Like Zapf Chancery
-// IMPL_FONT_ATTR_COMIC - Like Comic Sans MS
-// IMPL_FONT_ATTR_BRUSHSCRIPT - More Script
-// IMPL_FONT_ATTR_OTHERSTYLE - OldStyle, ... so negativ points
-#define IMPL_FONT_ATTR_DEFAULT ((ULONG)0x00000001)
-#define IMPL_FONT_ATTR_STANDARD ((ULONG)0x00000002)
-#define IMPL_FONT_ATTR_NORMAL ((ULONG)0x00000004)
-#define IMPL_FONT_ATTR_SYMBOL ((ULONG)0x00000008)
-#define IMPL_FONT_ATTR_FIXED ((ULONG)0x00000010)
-#define IMPL_FONT_ATTR_SANSSERIF ((ULONG)0x00000020)
-#define IMPL_FONT_ATTR_SERIF ((ULONG)0x00000040)
-#define IMPL_FONT_ATTR_DECORATIVE ((ULONG)0x00000080)
-#define IMPL_FONT_ATTR_SPECIAL ((ULONG)0x00000100)
-#define IMPL_FONT_ATTR_ITALIC ((ULONG)0x00000200)
-#define IMPL_FONT_ATTR_TITLING ((ULONG)0x00000400)
-#define IMPL_FONT_ATTR_CAPITALS ((ULONG)0x00000800)
-#define IMPL_FONT_ATTR_CJK ((ULONG)0x00001000)
-#define IMPL_FONT_ATTR_CJK_JP ((ULONG)0x00002000)
-#define IMPL_FONT_ATTR_CJK_SC ((ULONG)0x00004000)
-#define IMPL_FONT_ATTR_CJK_TC ((ULONG)0x00008000)
-#define IMPL_FONT_ATTR_CJK_KR ((ULONG)0x00010000)
-#define IMPL_FONT_ATTR_CTL ((ULONG)0x00020000)
-#define IMPL_FONT_ATTR_NONELATIN ((ULONG)0x00040000)
-#define IMPL_FONT_ATTR_FULL ((ULONG)0x00080000)
-#define IMPL_FONT_ATTR_OUTLINE ((ULONG)0x00100000)
-#define IMPL_FONT_ATTR_SHADOW ((ULONG)0x00200000)
-#define IMPL_FONT_ATTR_ROUNDED ((ULONG)0x00400000)
-#define IMPL_FONT_ATTR_TYPEWRITER ((ULONG)0x00800000)
-#define IMPL_FONT_ATTR_SCRIPT ((ULONG)0x01000000)
-#define IMPL_FONT_ATTR_HANDWRITING ((ULONG)0x02000000)
-#define IMPL_FONT_ATTR_CHANCERY ((ULONG)0x04000000)
-#define IMPL_FONT_ATTR_COMIC ((ULONG)0x08000000)
-#define IMPL_FONT_ATTR_BRUSHSCRIPT ((ULONG)0x10000000)
-#define IMPL_FONT_ATTR_GOTHIC ((ULONG)0x20000000)
-#define IMPL_FONT_ATTR_SCHOOLBOOK ((ULONG)0x40000000)
-#define IMPL_FONT_ATTR_OTHERSTYLE ((ULONG)0x80000000)
-
-#define IMPL_FONT_ATTR_CJK_ALLLANG (IMPL_FONT_ATTR_CJK_JP | IMPL_FONT_ATTR_CJK_SC | IMPL_FONT_ATTR_CJK_TC | IMPL_FONT_ATTR_CJK_KR)
-#define IMPL_FONT_ATTR_ALLSCRIPT (IMPL_FONT_ATTR_SCRIPT | IMPL_FONT_ATTR_HANDWRITING | IMPL_FONT_ATTR_CHANCERY | IMPL_FONT_ATTR_COMIC | IMPL_FONT_ATTR_BRUSHSCRIPT)
-#define IMPL_FONT_ATTR_ALLSUBSCRIPT (IMPL_FONT_ATTR_HANDWRITING | IMPL_FONT_ATTR_CHANCERY | IMPL_FONT_ATTR_COMIC | IMPL_FONT_ATTR_BRUSHSCRIPT)
-#define IMPL_FONT_ATTR_ALLSERIFSTYLE (IMPL_FONT_ATTR_ALLSCRIPT |\
- IMPL_FONT_ATTR_SANSSERIF | IMPL_FONT_ATTR_SERIF |\
- IMPL_FONT_ATTR_FIXED | IMPL_FONT_ATTR_ITALIC |\
- IMPL_FONT_ATTR_GOTHIC | IMPL_FONT_ATTR_SCHOOLBOOK |\
- IMPL_FONT_ATTR_SHADOW | IMPL_FONT_ATTR_OUTLINE)
-
-struct FontNameAttr
-{
- String Name;
- ::std::vector< String > Substitutions;
- ::std::vector< String > MSSubstitutions;
- ::std::vector< String > PSSubstitutions;
- ::std::vector< String > HTMLSubstitutions;
- FontWeight Weight;
- FontWidth Width;
- unsigned long Type; // bitfield of IMPL_FONT_ATTR_*
-};
-
-class VCL_DLLPUBLIC FontSubstConfiguration
-{
-private:
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
- m_xConfigProvider;
- com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >
- m_xConfigAccess;
- struct LocaleSubst
- {
- rtl::OUString aConfigLocaleString;
- mutable bool bConfigRead;
- // note: aSubstAttributes must be sorted alphabetically by Name
- // searches on the substitutes are done with Name as key, where
- // a minimal match is sufficient (that is e.g. "Thorndale" will match
- // "Thorndale BlaBlub"). Also names must be lower case.
- mutable std::vector< FontNameAttr > aSubstAttributes;
-
- LocaleSubst() : bConfigRead( false ) {}
- };
- std::hash_map< com::sun::star::lang::Locale, LocaleSubst, vcl::LocaleHash > m_aSubst;
- typedef std::hash_set< rtl::OUString, rtl::OUStringHash > UniqueSubstHash;
- mutable UniqueSubstHash maSubstHash;
-
-
- void fillSubstVector( const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xFont,
- const rtl::OUString& rType,
- std::vector< String >& rSubstVector ) const;
- FontWeight getSubstWeight( const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xFont,
- const rtl::OUString& rType ) const;
- FontWidth getSubstWidth( const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xFont,
- const rtl::OUString& rType ) const;
- unsigned long getSubstType( const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xFont,
- const rtl::OUString& rType ) const;
- void readLocaleSubst( const com::sun::star::lang::Locale& rLocale ) const;
- FontSubstConfiguration();
-public:
- ~FontSubstConfiguration();
-
- static FontSubstConfiguration* get();
-
- const FontNameAttr* getSubstInfo(
- const String& rFontName,
- const com::sun::star::lang::Locale& rLocale =
- com::sun::star::lang::Locale( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "en" ) ),
- rtl::OUString(),
- rtl::OUString() )
- ) const;
- static void getMapName( const String& rOrgName, String& rShortName, String& rFamilyName, FontWeight& rWeight, FontWidth& rWidth, ULONG& rType );
-};
-
-} // namespace vcl
-
-#endif // _VCL_FONTCFG_HXX
diff --git a/vcl/inc/vcl/fontcvt.hxx b/vcl/inc/vcl/fontcvt.hxx
deleted file mode 100644
index 8269928dc730..000000000000
--- a/vcl/inc/vcl/fontcvt.hxx
+++ /dev/null
@@ -1,103 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: fontcvt.hxx,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SV_FONTCVT_HXX
-#define _SV_FONTCVT_HXX
-
-#include <vcl/dllapi.h>
-#include <tools/string.hxx>
-
-// ------------------
-// - FontToSubsFont -
-// ------------------
-
-#define FONTTOSUBSFONT_IMPORT ((ULONG)0x00000001)
-#define FONTTOSUBSFONT_EXPORT ((ULONG)0x00000002)
-#define FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ((ULONG)0x00000004)
-
-typedef void* FontToSubsFontConverter;
-VCL_DLLPUBLIC FontToSubsFontConverter CreateFontToSubsFontConverter( const String& rFontName, ULONG nFlags );
-VCL_DLLPUBLIC void DestroyFontToSubsFontConverter( FontToSubsFontConverter hConverter );
-VCL_DLLPUBLIC sal_Unicode ConvertFontToSubsFontChar( FontToSubsFontConverter hConverter, sal_Unicode c );
-VCL_DLLPUBLIC String GetFontToSubsFontName( FontToSubsFontConverter hConverter );
-
-// ----------------
-// - SubsFontName -
-// ----------------
-
-#define SUBSFONT_ONLYONE ((ULONG)0x00000001)
-#define SUBSFONT_MS ((ULONG)0x00000002)
-#define SUBSFONT_PS ((ULONG)0x00000004)
-#define SUBSFONT_HTML ((ULONG)0x00000008)
-VCL_DLLPUBLIC String GetSubsFontName( const String& rName, ULONG nFlags );
-
-// -----------------
-// - FontTokenName -
-// -----------------
-
-VCL_DLLPUBLIC String GetFontToken( const String& rName, xub_StrLen nToken, xub_StrLen& rIndex );
-inline String GetFontToken( const String& rName, xub_StrLen nToken )
-{
- xub_StrLen nTempIndex = 0;
- return GetFontToken( rName, nToken, nTempIndex );
-}
-
-// ---------------------------
-// - StarSymbolToMSMultiFont -
-// ---------------------------
-
-class VCL_DLLPUBLIC StarSymbolToMSMultiFont
-{
-public:
- //Returns the name of the best windows symbol font which this char can be
- //mapped to. Sets rChar to the correct position for that font. If no
- //match found, then no name is returned, and rChar is unchanged. If you
- //want to convert a string, you don't want to use this.
- virtual String ConvertChar(sal_Unicode &rChar) = 0;
-
- //Starts converting the string at position rIndex. It converts as much of
- //the string that can be converted to the same symbol font and returns the
- //name of that font. rIndex is modified to the last index that was
- //converted. Typically you call if continously until rIndex ==
- //rString.Len() and handle each section as seperate 8bit strings using
- //seperate fonts. Will return an empty string for a continous section
- //that has no possible mapping.
- virtual String ConvertString(String &rString, xub_StrLen &rIndex) = 0;
- virtual ~StarSymbolToMSMultiFont() {}
-};
-
-//with bPerfect set the converter will only try and convert symbols which have
-//perfect mappings to the windows symbols fonts. With it not set, it will
-//allow somewhat more dubious transformations that are nevertheless
-//recognizably similiar. Even in this mode there will be characters that fail.
-//The users of this might want to make a distinction between failed characters
-//which were inside and those outside the unicode private area.
-VCL_DLLPUBLIC StarSymbolToMSMultiFont *CreateStarSymbolToMSMultiFont(bool bPerfectOnly=false);
-#endif // _SV_FONTCVT_HXX
diff --git a/vcl/inc/vcl/impimagetree.hxx b/vcl/inc/vcl/impimagetree.hxx
index dfbcb366fe6a..92761eabdf3c 100644
--- a/vcl/inc/vcl/impimagetree.hxx
+++ b/vcl/inc/vcl/impimagetree.hxx
@@ -54,14 +54,17 @@ public:
~ImplImageTree();
+ // check whether the icon style is installed
+ bool checkStyle(rtl::OUString const & style);
+
bool loadImage(
rtl::OUString const & name, rtl::OUString const & style,
- BitmapEx & bitmap, bool localized = false);
+ BitmapEx & bitmap, bool localized = false );
void shutDown();
// a crude form of life cycle control (called from DeInitVCL; otherwise,
// if the ImplImageTree singleton were destroyed during exit that would
- // be too late for the destructors of the bitmaps in m_cache)
+ // be too late for the destructors of the bitmaps in m_iconCache)
private:
typedef std::list<
@@ -71,20 +74,23 @@ private:
com::sun::star::container::XNameAccess > > > Zips;
typedef std::hash_map<
- rtl::OUString, std::pair< bool, BitmapEx >, rtl::OUStringHash > Cache;
+ rtl::OUString, bool, rtl::OUStringHash > CheckStyleCache;
+ typedef std::hash_map<
+ rtl::OUString, std::pair< bool, BitmapEx >, rtl::OUStringHash > IconCache;
rtl::OUString m_style;
Zips m_zips;
- Cache m_cache;
+ CheckStyleCache m_checkStyleCache;
+ IconCache m_iconCache;
- void setStyle(rtl::OUString const & style);
+ void setStyle(rtl::OUString const & style );
void resetZips();
- bool cacheLookup(
- rtl::OUString const & name, bool localized, BitmapEx & bitmap);
+ bool checkStyleCacheLookup( rtl::OUString const & style, bool &exists );
+ bool iconCacheLookup( rtl::OUString const & name, bool localized, BitmapEx & bitmap );
- bool find(std::vector< rtl::OUString > const & paths, BitmapEx & bitmap);
+ bool find(std::vector< rtl::OUString > const & paths, BitmapEx & bitmap );
};
typedef salhelper::SingletonRef< ImplImageTree > ImplImageTreeSingletonRef;
diff --git a/vcl/inc/vcl/mapunit.hxx b/vcl/inc/vcl/mapunit.hxx
index 6ba500f4fdb7..c50ba49c17bb 100644
--- a/vcl/inc/vcl/mapunit.hxx
+++ b/vcl/inc/vcl/mapunit.hxx
@@ -31,14 +31,6 @@
#ifndef _VCL_MAPUNIT_HXX
#define _VCL_MAPUNIT_HXX
-// -----------------
-// - MapMode-Types -
-// -----------------
-
-// By changes you must also change: rsc/vclrsc.hxx
-enum MapUnit { MAP_100TH_MM, MAP_10TH_MM, MAP_MM, MAP_CM,
- MAP_1000TH_INCH, MAP_100TH_INCH, MAP_10TH_INCH, MAP_INCH,
- MAP_POINT, MAP_TWIP, MAP_PIXEL, MAP_SYSFONT, MAP_APPFONT,
- MAP_RELATIVE, MAP_REALAPPFONT, MAP_LASTENUMDUMMY };
+#include <tools/mapunit.hxx>
#endif // _VCL_MAPUNIT_HXX
diff --git a/vcl/inc/vcl/outdev.h b/vcl/inc/vcl/outdev.h
index af671e24ee0a..67dc256ce11c 100644
--- a/vcl/inc/vcl/outdev.h
+++ b/vcl/inc/vcl/outdev.h
@@ -31,7 +31,7 @@
#ifndef _SV_OUTDEV_H
#define _SV_OUTDEV_H
-#include <vcl/sv.h>
+#include <tools/solar.h>
#include <vcl/outfont.hxx>
#include <vector>
@@ -44,13 +44,6 @@ class VirtualDevice;
class ImplServerGraphics;
class ImplGetDevFontList;
class GetDevSizeList;
-namespace vcl {
-class FontSubstConfiguration;
-}
-
-// -----------------------------------------------------------------------
-
-void ImplGetEnglishSearchFontName( String& rName );
// -----------------------
// - ImplDevFontListData -
@@ -80,7 +73,7 @@ public:
int GetMinQuality() const { return mnMinQuality; }
bool AddFontFace( ImplFontData* );
- void InitMatchData( const vcl::FontSubstConfiguration&,
+ void InitMatchData( const utl::FontSubstConfiguration&,
const String& rSearchName );
ImplFontData* FindBestFontFace( const ImplFontSelectData& rFSD ) const;
@@ -106,24 +99,6 @@ friend class ImplDevFontList; // TODO: remove soon
};
-// ---------------
-// - ImplCvtChar -
-// ---------------
-
-class ImplCvtChar
-{
-public:
- const sal_Unicode* mpCvtTab;
- const char* mpSubsFontName;
- sal_Unicode (*mpCvtFunc)( sal_Unicode );
-};
-
-sal_Unicode ImplRecodeChar( const ImplCvtChar* pCvtData, sal_Unicode c );
-void ImplRecodeString( const ImplCvtChar* pCvtData, String& rStr,
- xub_StrLen nIndex, xub_StrLen nLen );
-const ImplCvtChar* ImplGetRecodeData( const String& rOrgFontName,
- const String& rMapFontName );
-
// ----------------------
// - ImplGetDevFontList -
// ----------------------
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index 130492a2bd0c..1e1f784f0f49 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -45,6 +45,7 @@
#include <tools/poly.hxx>
#include <basegfx/vector/b2enums.hxx>
#include <com/sun/star/uno/Reference.h>
+#include <unotools/fontdefs.hxx>
#include <vector>
@@ -264,31 +265,6 @@ struct KerningPair
#define FONT_SUBSTITUTE_ALWAYS ((USHORT)0x0001)
#define FONT_SUBSTITUTE_SCREENONLY ((USHORT)0x0002)
-// Default-Font
-#define DEFAULTFONT_SANS_UNICODE ((USHORT)1)
-#define DEFAULTFONT_SANS ((USHORT)2)
-#define DEFAULTFONT_SERIF ((USHORT)3)
-#define DEFAULTFONT_FIXED ((USHORT)4)
-#define DEFAULTFONT_SYMBOL ((USHORT)5)
-#define DEFAULTFONT_UI_SANS ((USHORT)1000)
-#define DEFAULTFONT_UI_FIXED ((USHORT)1001)
-#define DEFAULTFONT_LATIN_TEXT ((USHORT)2000)
-#define DEFAULTFONT_LATIN_PRESENTATION ((USHORT)2001)
-#define DEFAULTFONT_LATIN_SPREADSHEET ((USHORT)2002)
-#define DEFAULTFONT_LATIN_HEADING ((USHORT)2003)
-#define DEFAULTFONT_LATIN_DISPLAY ((USHORT)2004)
-#define DEFAULTFONT_LATIN_FIXED ((USHORT)2005)
-#define DEFAULTFONT_CJK_TEXT ((USHORT)3000)
-#define DEFAULTFONT_CJK_PRESENTATION ((USHORT)3001)
-#define DEFAULTFONT_CJK_SPREADSHEET ((USHORT)3002)
-#define DEFAULTFONT_CJK_HEADING ((USHORT)3003)
-#define DEFAULTFONT_CJK_DISPLAY ((USHORT)3004)
-#define DEFAULTFONT_CTL_TEXT ((USHORT)4000)
-#define DEFAULTFONT_CTL_PRESENTATION ((USHORT)4001)
-#define DEFAULTFONT_CTL_SPREADSHEET ((USHORT)4002)
-#define DEFAULTFONT_CTL_HEADING ((USHORT)4003)
-#define DEFAULTFONT_CTL_DISPLAY ((USHORT)4004)
-
#define DEFAULTFONT_FLAGS_ONLYONE ((ULONG)0x00000001)
enum OutDevType { OUTDEV_DONTKNOW, OUTDEV_WINDOW, OUTDEV_PRINTER, OUTDEV_VIRDEV };
diff --git a/vcl/inc/vcl/outfont.hxx b/vcl/inc/vcl/outfont.hxx
index 88316130cc3a..b72e78994a75 100644
--- a/vcl/inc/vcl/outfont.hxx
+++ b/vcl/inc/vcl/outfont.hxx
@@ -32,9 +32,9 @@
#include <tools/list.hxx>
#include <i18npool/lang.h>
#include <tools/gen.hxx>
-#include <vcl/sv.h>
+#include <tools/solar.h>
#include <vcl/dllapi.h>
-
+#include <unotools/fontdefs.hxx>
#include <vcl/vclenum.hxx>
#include <hash_map>
@@ -48,14 +48,10 @@ class ImplPreMatchFontSubstitution;
class ImplGlyphFallbackFontSubstitution;
class ImplFontSelectData;
class Font;
-class ImplCvtChar;
+class ConvertChar;
struct FontMatchStatus;
class OutputDevice;
-namespace vcl {
- struct FontNameAttr;
-}
-
// ----------------------
// - ImplFontAttributes -
// ----------------------
@@ -185,8 +181,6 @@ public: // TODO: change to private
ImplFontEntry* mpFontEntry; // pointer to the resulting FontCache entry
};
-struct FontNameHash { int operator()(const String&) const; };
-
// -------------------
// - ImplDevFontList -
// -------------------
@@ -238,7 +232,7 @@ protected:
ImplDevFontListData* ImplFindByTokenNames( const String& ) const;
ImplDevFontListData* ImplFindByAliasName( const String& rSearchName, const String& rShortName ) const;
- ImplDevFontListData* ImplFindBySubstFontAttr( const vcl::FontNameAttr& ) const;
+ ImplDevFontListData* ImplFindBySubstFontAttr( const utl::FontNameAttr& ) const;
ImplDevFontListData* ImplFindByAttributes( ULONG nSearchType, FontWeight, FontWidth,
FontFamily, FontItalic, const String& rSearchFamily ) const;
ImplDevFontListData* FindDefaultFont() const;
@@ -337,7 +331,7 @@ public:
public: // TODO: make data members private
ImplFontSelectData maFontSelData; // FontSelectionData
ImplFontMetricData maMetric; // Font Metric
- const ImplCvtChar* mpConversion; // used e.g. for StarBats->StarSymbol
+ const ConvertChar* mpConversion; // used e.g. for StarBats->StarSymbol
long mnLineHeight;
ULONG mnRefCount;
USHORT mnSetFontFlags; // Flags returned by SalGraphics::SetFont()
diff --git a/vcl/inc/vcl/pdfwriter.hxx b/vcl/inc/vcl/pdfwriter.hxx
index a4a6c4d53170..dbfaf9eda18d 100644
--- a/vcl/inc/vcl/pdfwriter.hxx
+++ b/vcl/inc/vcl/pdfwriter.hxx
@@ -547,6 +547,7 @@ The following structure describes the permissions used in PDF security
*/
PDFWriter::ExportDataFormat SubmitFormat;
bool AllowDuplicateFieldNames;
+ bool FieldsUseSystemFonts;
/* the following data members are used to customize the PDF viewer
preferences
*/
@@ -592,6 +593,7 @@ The following structure describes the permissions used in PDF security
EmbedStandardFonts( false ),
SubmitFormat( PDFWriter::FDF ),
AllowDuplicateFieldNames( false ),
+ FieldsUseSystemFonts( true ),
PDFDocumentMode( PDFWriter::ModeDefault ),
PDFDocumentAction( PDFWriter::ActionDefault ),
Zoom( 100 ),
diff --git a/vcl/inc/vcl/salbtype.hxx b/vcl/inc/vcl/salbtype.hxx
index 2a10353bee94..d9be75369a5d 100644
--- a/vcl/inc/vcl/salbtype.hxx
+++ b/vcl/inc/vcl/salbtype.hxx
@@ -37,6 +37,7 @@
#include <tools/debug.hxx>
#include <vcl/salgtype.hxx>
#include <tools/color.hxx>
+#include <tools/gen.hxx>
#include <vcl/sv.h>
#include <vcl/dllapi.h>
@@ -49,14 +50,6 @@ typedef HPBYTE Scanline;
typedef const BYTE* ConstHPBYTE;
typedef ConstHPBYTE ConstScanline;
-// --------------------
-// - Helper functions -
-// --------------------
-
-inline long MinMax( long nVal, long nMin, long nMax );
-inline long AlignedWidth4Bytes( long nWidthBits );
-inline long FRound( double fVal );
-
// ------------------
// - Bitmap formats -
// ------------------
@@ -292,29 +285,6 @@ struct VCL_DLLPUBLIC BitmapBuffer
VCL_DLLPUBLIC BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRect& rTwoRect,
ULONG nDstBitmapFormat, BitmapPalette* pDstPal = NULL, ColorMask* pDstMask = NULL );
-// ---------------
-// - Inlines -
-// ---------------
-
-inline long MinMax( long nVal, long nMin, long nMax )
-{
- return( nVal >= nMin ? ( nVal <= nMax ? nVal : nMax ) : nMin );
-}
-
-// ------------------------------------------------------------------
-
-inline long AlignedWidth4Bytes( long nWidthBits )
-{
- return( ( ( nWidthBits + 31 ) >> 5 ) << 2 );
-}
-
-// ------------------------------------------------------------------
-
-inline long FRound( double fVal )
-{
- return( fVal > 0.0 ? (long) ( fVal + 0.5 ) : -(long) ( -fVal + 0.5 ) );
-}
-
// ------------------------------------------------------------------
inline BitmapColor::BitmapColor() :
diff --git a/vcl/inc/vcl/salframe.hxx b/vcl/inc/vcl/salframe.hxx
index 0e3f4e94a0b3..b95f7036ad19 100644
--- a/vcl/inc/vcl/salframe.hxx
+++ b/vcl/inc/vcl/salframe.hxx
@@ -170,6 +170,7 @@ public:
virtual void SetTitle( const XubString& rTitle ) = 0;
virtual void SetIcon( USHORT nIcon ) = 0;
+ virtual void SetRepresentedURL( const rtl::OUString& );
virtual void SetMenu( SalMenu *pSalMenu ) = 0;
virtual void DrawMenuBar() = 0;
diff --git a/vcl/inc/vcl/salsession.hxx b/vcl/inc/vcl/salsession.hxx
index 05aa76cb0f56..bdc698fc63fd 100644
--- a/vcl/inc/vcl/salsession.hxx
+++ b/vcl/inc/vcl/salsession.hxx
@@ -37,7 +37,8 @@ enum SalSessionEventType
{
Interaction,
SaveRequest,
- ShutdownCancel
+ ShutdownCancel,
+ Quit
};
struct SalSessionEvent
@@ -78,6 +79,13 @@ struct SalSessionShutdownCancelEvent : public SalSessionEvent
{}
};
+struct SalSessionQuitEvent : public SalSessionEvent
+{
+ SalSessionQuitEvent()
+ : SalSessionEvent( Quit )
+ {}
+};
+
typedef void(*SessionProc)( SalSessionEvent *pEvent);
class VCL_DLLPUBLIC SalSession
diff --git a/vcl/inc/vcl/settings.hxx b/vcl/inc/vcl/settings.hxx
index decb7d01b2d4..61a970b738e0 100644
--- a/vcl/inc/vcl/settings.hxx
+++ b/vcl/inc/vcl/settings.hxx
@@ -38,6 +38,7 @@
#include "vcl/accel.hxx"
#include "vcl/wall.hxx"
#include "com/sun/star/lang/Locale.hpp"
+#include <unotools/syslocale.hxx>
class CollatorWrapper;
class LocaleDataWrapper;
@@ -521,9 +522,10 @@ private:
#define STYLE_SYMBOLS_HICONTRAST ((ULONG)2)
#define STYLE_SYMBOLS_INDUSTRIAL ((ULONG)3)
#define STYLE_SYMBOLS_CRYSTAL ((ULONG)4)
-#define STYLE_SYMBOLS_TANGO ((ULONG)5)
-#define STYLE_SYMBOLS_CLASSIC ((ULONG)6)
-#define STYLE_SYMBOLS_THEMES_MAX ((ULONG)6)
+#define STYLE_SYMBOLS_TANGO ((ULONG)5)
+#define STYLE_SYMBOLS_OXYGEN ((ULONG)6)
+#define STYLE_SYMBOLS_CLASSIC ((ULONG)7)
+#define STYLE_SYMBOLS_THEMES_MAX ((ULONG)8)
#define STYLE_CURSOR_NOBLINKTIME ((ULONG)0xFFFFFFFF)
@@ -947,6 +949,8 @@ public:
void SetPreferredSymbolsStyleName( const ::rtl::OUString &rName );
ULONG GetPreferredSymbolsStyle() const
{ return mpData->mnPreferredSymbolsStyle; }
+ // check whether the symbols style is supported (icons are installed)
+ bool CheckSymbolStyle( ULONG nStyle ) const;
ULONG GetAutoSymbolsStyle() const;
ULONG GetCurrentSymbolsStyle() const;
@@ -993,7 +997,6 @@ class ImplMiscData
private:
ULONG mnRefCount;
- USHORT mnTwoDigitYearStart;
USHORT mnEnableATT;
BOOL mbEnableLocalizedDecimalSep;
USHORT mnDisablePrinting;
@@ -1015,10 +1018,6 @@ public:
MiscSettings( const MiscSettings& rSet );
~MiscSettings();
- void SetTwoDigitYearStart( USHORT nYearStart )
- { CopyData(); mpData->mnTwoDigitYearStart = nYearStart; }
- USHORT GetTwoDigitYearStart() const
- { return mpData->mnTwoDigitYearStart; }
void SetEnableATToolSupport( BOOL bEnable );
BOOL GetEnableATToolSupport() const;
void SetDisablePrinting( BOOL bEnable );
@@ -1141,7 +1140,7 @@ public:
// -----------------------
// - ImplAllSettingsData -
// -----------------------
-
+class LocaleConfigurationListener;
class ImplAllSettingsData
{
friend class AllSettings;
@@ -1171,6 +1170,8 @@ private:
CollatorWrapper* mpUICollatorWrapper;
vcl::I18nHelper* mpI18nHelper;
vcl::I18nHelper* mpUII18nHelper;
+ LocaleConfigurationListener* mpLocaleCfgListener;
+ SvtSysLocale maSysLocale;
};
// ---------------
@@ -1287,6 +1288,8 @@ public:
BOOL operator ==( const AllSettings& rSet ) const;
BOOL operator !=( const AllSettings& rSet ) const
{ return !(*this == rSet); }
+ static void LocaleSettingsChanged( sal_uInt32 nHint );
+ SvtSysLocale& GetSysLocale() { return mpData->maSysLocale; }
};
#endif // _SV_SETTINGS_HXX
diff --git a/vcl/inc/vcl/svdata.hxx b/vcl/inc/vcl/svdata.hxx
index 5d970f060448..17ad1aa28c1a 100644
--- a/vcl/inc/vcl/svdata.hxx
+++ b/vcl/inc/vcl/svdata.hxx
@@ -44,6 +44,7 @@
#include <tools/debug.hxx>
#include <vcl/dllapi.h>
#include <com/sun/star/uno/Reference.hxx>
+#include <unotools/options.hxx>
namespace com {
namespace sun {
@@ -114,11 +115,17 @@ class VclEventListeners2;
namespace vos { class OMutex; }
namespace vos { class OCondition; }
-namespace vcl { class DisplayConnection; class FontSubstConfiguration; class SettingsConfigItem; class DefaultFontConfiguration; class DeleteOnDeinitBase; }
+namespace vcl { class DisplayConnection; class SettingsConfigItem; class DeleteOnDeinitBase; }
+namespace utl { class DefaultFontConfiguration; class FontSubstConfiguration; }
// -----------------
// - ImplSVAppData -
// -----------------
+class LocaleConfigurationListener : public utl::ConfigurationListener
+{
+public:
+ virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
+};
struct ImplSVAppData
{
@@ -131,21 +138,22 @@ struct ImplSVAppData
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
String* mpMSFTempFileName;
- AllSettings* mpSettings; // Application settings
- VclEventListeners* mpEventListeners; // listeners for vcl events (eg, extended toolkit)
- VclEventListeners* mpKeyListeners; // listeners for key events only (eg, extended toolkit)
- ImplAccelManager* mpAccelMgr; // Accelerator Manager
- XubString* mpAppName; // Application name
- XubString* mpAppFileName; // Abs. Application FileName
- XubString* mpDisplayName; // Application Display Name
- String* mpFontPath; // Additional Fontpath
- Help* mpHelp; // Application help
- PopupMenu* mpActivePopupMenu; // Actives Popup-Menu (in Execute)
- UniqueIdContainer* mpUniqueIdCont; // Fuer Eindeutige Id's
- ImplIdleMgr* mpIdleMgr; // Idle-Manager
- ImplWheelWindow* mpWheelWindow; // WheelWindow
- ImplHotKey* mpFirstHotKey; // HotKey-Verwaltung
- ImplEventHook* mpFirstEventHook; // Event-Hooks
+ AllSettings* mpSettings; // Application settings
+ LocaleConfigurationListener* mpCfgListener;
+ VclEventListeners* mpEventListeners; // listeners for vcl events (eg, extended toolkit)
+ VclEventListeners* mpKeyListeners; // listeners for key events only (eg, extended toolkit)
+ ImplAccelManager* mpAccelMgr; // Accelerator Manager
+ XubString* mpAppName; // Application name
+ XubString* mpAppFileName; // Abs. Application FileName
+ XubString* mpDisplayName; // Application Display Name
+ String* mpFontPath; // Additional Fontpath
+ Help* mpHelp; // Application help
+ PopupMenu* mpActivePopupMenu; // Actives Popup-Menu (in Execute)
+ UniqueIdContainer* mpUniqueIdCont; // Fuer Eindeutige Id's
+ ImplIdleMgr* mpIdleMgr; // Idle-Manager
+ ImplWheelWindow* mpWheelWindow; // WheelWindow
+ ImplHotKey* mpFirstHotKey; // HotKey-Verwaltung
+ ImplEventHook* mpFirstEventHook; // Event-Hooks
VclEventListeners2* mpPostYieldListeners; // post yield listeners
ULONG mnLastInputTime; // GetLastInputTime()
USHORT mnDispatchLevel; // DispatchLevel
@@ -200,8 +208,8 @@ struct ImplSVGDIData
long mnAppFontX; // AppFont X-Numenator for 40/tel Width + DialogScaleX
long mnAppFontY; // AppFont Y-Numenator for 80/tel Height
BOOL mbFontSubChanged; // TRUE: FontSubstitution wurde zwischen Begin/End geaendert
- vcl::DefaultFontConfiguration* mpDefaultFontConfiguration;
- vcl::FontSubstConfiguration* mpFontSubstConfiguration;
+ utl::DefaultFontConfiguration* mpDefaultFontConfiguration;
+ utl::FontSubstConfiguration* mpFontSubstConfiguration;
bool mbPrinterPullModel; // true: use pull model instead of normal push model when printing
bool mbNativeFontConfig; // true: do not override UI font
bool mbNoXORClipping; // true: do not use XOR to achieve clipping effects
diff --git a/vcl/inc/vcl/syswin.hxx b/vcl/inc/vcl/syswin.hxx
index 99a340ae4a58..d590cfe0a37e 100644
--- a/vcl/inc/vcl/syswin.hxx
+++ b/vcl/inc/vcl/syswin.hxx
@@ -201,6 +201,10 @@ public:
void SetIcon( USHORT nIcon );
USHORT GetIcon() const { return mnIcon; }
+ // for systems like MacOSX which can display the URL a document is loaded from
+ // separately from the window title
+ void SetRepresentedURL( const rtl::OUString& );
+ const rtl::OUString& GetRepresentedURL() const;
void SetZLevel( BYTE nLevel );
BYTE GetZLevel() const;
diff --git a/vcl/inc/vcl/toolbox.h b/vcl/inc/vcl/toolbox.h
index 52a0db40b226..2dee85ab6b82 100644
--- a/vcl/inc/vcl/toolbox.h
+++ b/vcl/inc/vcl/toolbox.h
@@ -51,6 +51,7 @@
#define TB_LARGEIMAGESIZE 26
#define TB_LARGEIMAGESIZE_INDUSTRIAL 24
#define TB_LARGEIMAGESIZE_CRYSTAL 22
+#define TB_LARGEIMAGESIZE_OXYGEN 22
class Window;
diff --git a/vcl/inc/vcl/wintypes.hxx b/vcl/inc/vcl/wintypes.hxx
index 968f0e1d255f..9e84648fb6a8 100644
--- a/vcl/inc/vcl/wintypes.hxx
+++ b/vcl/inc/vcl/wintypes.hxx
@@ -30,308 +30,7 @@
#ifndef _SV_WINTYPES_HXX
#define _SV_WINTYPES_HXX
-#include <vcl/sv.h>
-#include <sal/types.h>
-
-// ----------------
-// - Window-Types -
-// ----------------
-
-typedef USHORT WindowType;
-#define WINDOW_BASE 0x0100
-#define WINDOW_FIRST (WINDOW_BASE + 0x30)
-#define WINDOW_MESSBOX (WINDOW_FIRST)
-#define WINDOW_INFOBOX (WINDOW_FIRST + 0x01)
-#define WINDOW_WARNINGBOX (WINDOW_FIRST + 0x02)
-#define WINDOW_ERRORBOX (WINDOW_FIRST + 0x03)
-#define WINDOW_QUERYBOX (WINDOW_FIRST + 0x04)
-#define WINDOW_WINDOW (WINDOW_FIRST + 0x05)
-#define WINDOW_SYSWINDOW (WINDOW_FIRST + 0x06)
-#define WINDOW_WORKWINDOW (WINDOW_FIRST + 0x07)
-// #define WINDOW_MDIWINDOW (WINDOW_FIRST + 0x08)
-#define WINDOW_FLOATINGWINDOW (WINDOW_FIRST + 0x09)
-#define WINDOW_DIALOG (WINDOW_FIRST + 0x0a)
-#define WINDOW_MODELESSDIALOG (WINDOW_FIRST + 0x0b)
-#define WINDOW_MODALDIALOG (WINDOW_FIRST + 0x0c)
-#define WINDOW_SYSTEMDIALOG (WINDOW_FIRST + 0x0d)
-#define WINDOW_PATHDIALOG (WINDOW_FIRST + 0x0e)
-#define WINDOW_FILEDIALOG (WINDOW_FIRST + 0x0f)
-#define WINDOW_PRINTERSETUPDIALOG (WINDOW_FIRST + 0x10)
-#define WINDOW_PRINTDIALOG (WINDOW_FIRST + 0x11)
-#define WINDOW_COLORDIALOG (WINDOW_FIRST + 0x12)
-#define WINDOW_FONTDIALOG (WINDOW_FIRST + 0x13)
-#define WINDOW_CONTROL (WINDOW_FIRST + 0x14)
-#define WINDOW_BUTTON (WINDOW_FIRST + 0x15)
-#define WINDOW_PUSHBUTTON (WINDOW_FIRST + 0x16)
-#define WINDOW_OKBUTTON (WINDOW_FIRST + 0x17)
-#define WINDOW_CANCELBUTTON (WINDOW_FIRST + 0x18)
-#define WINDOW_HELPBUTTON (WINDOW_FIRST + 0x19)
-#define WINDOW_IMAGEBUTTON (WINDOW_FIRST + 0x1a)
-#define WINDOW_MENUBUTTON (WINDOW_FIRST + 0x1b)
-#define WINDOW_MOREBUTTON (WINDOW_FIRST + 0x1c)
-#define WINDOW_SPINBUTTON (WINDOW_FIRST + 0x1d)
-#define WINDOW_RADIOBUTTON (WINDOW_FIRST + 0x1e)
-#define WINDOW_IMAGERADIOBUTTON (WINDOW_FIRST + 0x1f)
-#define WINDOW_CHECKBOX (WINDOW_FIRST + 0x20)
-#define WINDOW_TRISTATEBOX (WINDOW_FIRST + 0x21)
-#define WINDOW_EDIT (WINDOW_FIRST + 0x22)
-#define WINDOW_MULTILINEEDIT (WINDOW_FIRST + 0x23)
-#define WINDOW_COMBOBOX (WINDOW_FIRST + 0x24)
-#define WINDOW_LISTBOX (WINDOW_FIRST + 0x25)
-#define WINDOW_MULTILISTBOX (WINDOW_FIRST + 0x26)
-#define WINDOW_FIXEDTEXT (WINDOW_FIRST + 0x27)
-#define WINDOW_FIXEDLINE (WINDOW_FIRST + 0x28)
-#define WINDOW_FIXEDBITMAP (WINDOW_FIRST + 0x29)
-#define WINDOW_FIXEDIMAGE (WINDOW_FIRST + 0x2a)
-#define WINDOW_GROUPBOX (WINDOW_FIRST + 0x2c)
-#define WINDOW_SCROLLBAR (WINDOW_FIRST + 0x2d)
-#define WINDOW_SCROLLBARBOX (WINDOW_FIRST + 0x2e)
-#define WINDOW_SPLITTER (WINDOW_FIRST + 0x2f)
-#define WINDOW_SPLITWINDOW (WINDOW_FIRST + 0x30)
-#define WINDOW_SPINFIELD (WINDOW_FIRST + 0x31)
-#define WINDOW_PATTERNFIELD (WINDOW_FIRST + 0x32)
-#define WINDOW_NUMERICFIELD (WINDOW_FIRST + 0x33)
-#define WINDOW_METRICFIELD (WINDOW_FIRST + 0x34)
-#define WINDOW_CURRENCYFIELD (WINDOW_FIRST + 0x35)
-#define WINDOW_DATEFIELD (WINDOW_FIRST + 0x36)
-#define WINDOW_TIMEFIELD (WINDOW_FIRST + 0x37)
-#define WINDOW_PATTERNBOX (WINDOW_FIRST + 0x38)
-#define WINDOW_NUMERICBOX (WINDOW_FIRST + 0x39)
-#define WINDOW_METRICBOX (WINDOW_FIRST + 0x3a)
-#define WINDOW_CURRENCYBOX (WINDOW_FIRST + 0x3b)
-#define WINDOW_DATEBOX (WINDOW_FIRST + 0x3c)
-#define WINDOW_TIMEBOX (WINDOW_FIRST + 0x3d)
-#define WINDOW_LONGCURRENCYFIELD (WINDOW_FIRST + 0x3e)
-#define WINDOW_LONGCURRENCYBOX (WINDOW_FIRST + 0x3f)
-#define WINDOW_TOOLBOX (WINDOW_FIRST + 0x41)
-#define WINDOW_DOCKINGWINDOW (WINDOW_FIRST + 0x42)
-#define WINDOW_STATUSBAR (WINDOW_FIRST + 0x43)
-#define WINDOW_TABPAGE (WINDOW_FIRST + 0x44)
-#define WINDOW_TABCONTROL (WINDOW_FIRST + 0x45)
-#define WINDOW_TABDIALOG (WINDOW_FIRST + 0x46)
-#define WINDOW_BORDERWINDOW (WINDOW_FIRST + 0x47)
-#define WINDOW_BUTTONDIALOG (WINDOW_FIRST + 0x48)
-#define WINDOW_SYSTEMCHILDWINDOW (WINDOW_FIRST + 0x49)
-#define WINDOW_FIXEDBORDER (WINDOW_FIRST + 0x4a)
-#define WINDOW_SLIDER (WINDOW_FIRST + 0x4b)
-#define WINDOW_MENUBARWINDOW (WINDOW_FIRST + 0x4c)
-#define WINDOW_TREELISTBOX (WINDOW_FIRST + 0x4d)
-#define WINDOW_HELPTEXTWINDOW (WINDOW_FIRST + 0x4e)
-#define WINDOW_INTROWINDOW (WINDOW_FIRST + 0x4f)
-#define WINDOW_LISTBOXWINDOW (WINDOW_FIRST + 0x50)
-#define WINDOW_DOCKINGAREA (WINDOW_FIRST + 0x51)
-#define WINDOW_LAST (WINDOW_DOCKINGAREA)
-
-
-// ---------------
-// - Window-Bits -
-// ---------------
-
-// By changes you must also change: rsc/vclrsc.hxx
-typedef sal_Int64 WinBits;
-
-// Window-Bits fuer Window
-#define WB_CLIPCHILDREN ((WinBits)0x00000001)
-#define WB_DIALOGCONTROL ((WinBits)0x00000002)
-#define WB_NODIALOGCONTROL ((WinBits)0x00000004)
-#define WB_BORDER ((WinBits)0x00000008)
-#define WB_NOBORDER ((WinBits)0x00000010)
-#define WB_SIZEABLE ((WinBits)0x00000020)
-#define WB_3DLOOK ((WinBits)0x00000040)
-#define WB_AUTOSIZE ((WinBits)0x00000080)
-
-// Window-Bits fuer SystemWindows
-#define WB_MOVEABLE ((WinBits)0x00000100)
-#define WB_ROLLABLE ((WinBits)0x00000200)
-#define WB_CLOSEABLE ((WinBits)0x00000400)
-#define WB_STANDALONE ((WinBits)0x00000800)
-#define WB_APP ((WinBits)0x00001000)
-#define WB_PINABLE ((WinBits)0x00002000)
-#define WB_SYSTEMWINDOW ((WinBits)SAL_CONST_INT64(0x40000000))
-// warning: do not confuse WB_SYSTEMCHILDWINDOW with the SystemChildWindow class
-
-// the SystemChildWindow class was there first and is a very specialized
-// sytem child window type for plugged applications. The SystemChildWindow class
-// explicitly should never use the WB_SYSTEMCHILDWINDOW WinBit
-
-// WB_SYSTEMCHILDWINDOW on the other hand is to be used on system windows
-// which should be created as system child windows with (more or less)
-// normal event handling
-#define WB_SYSTEMCHILDWINDOW ((WinBits)SAL_CONST_INT64(0x8000000000))
-#define WB_SIZEMOVE (WB_SIZEABLE | WB_MOVEABLE)
-
-// Standard-Window-Bits fuer ChildWindows
-#define WB_TABSTOP ((WinBits)0x00000100)
-#define WB_NOTABSTOP ((WinBits)0x00000200)
-#define WB_GROUP ((WinBits)0x00000400)
-#define WB_NOGROUP ((WinBits)0x00000800)
-#define WB_HORZ ((WinBits)0x00001000)
-#define WB_VERT ((WinBits)0x00002000)
-#define WB_LEFT ((WinBits)0x00004000)
-#define WB_CENTER ((WinBits)0x00008000)
-#define WB_RIGHT ((WinBits)0x00010000)
-#define WB_TOP ((WinBits)0x00020000)
-#define WB_VCENTER ((WinBits)0x00040000)
-#define WB_BOTTOM ((WinBits)0x00080000)
-#define WB_DRAG ((WinBits)0x00100000)
-#define WB_SPIN ((WinBits)0x00200000)
-#define WB_REPEAT ((WinBits)0x00400000)
-#define WB_NOPOINTERFOCUS ((WinBits)0x00800000)
-#define WB_WORDBREAK ((WinBits)0x01000000)
-#define WB_NOLABEL ((WinBits)0x02000000)
-#define WB_SORT ((WinBits)0x04000000)
-#define WB_DROPDOWN ((WinBits)0x08000000)
-#define WB_AUTOHSCROLL ((WinBits)SAL_CONST_INT64(0x10000000))
-#define WB_DOCKABLE ((WinBits)SAL_CONST_INT64(0x20000000))
-#define WB_AUTOVSCROLL ((WinBits)SAL_CONST_INT64(0x40000000))
-#define WB_HYPHENATION (((WinBits)SAL_CONST_INT64(0x80000000)) | WB_WORDBREAK)
-#define WB_CHILDDLGCTRL ((WinBits)SAL_CONST_INT64(0x100000000000))
-
-// system floating window
-#define WB_SYSTEMFLOATWIN ((WinBits)SAL_CONST_INT64(0x100000000))
-#define WB_INTROWIN ((WinBits)SAL_CONST_INT64(0x200000000))
-#define WB_NOSHADOW ((WinBits)SAL_CONST_INT64(0x400000000))
-#define WB_TOOLTIPWIN ((WinBits)SAL_CONST_INT64(0x800000000))
-#define WB_OWNERDRAWDECORATION ((WinBits)SAL_CONST_INT64(0x2000000000))
-#define WB_DEFAULTWIN ((WinBits)SAL_CONST_INT64(0x4000000000))
-#define WB_NEEDSFOCUS ((WinBits)SAL_CONST_INT64(0x1000000000))
-
-#define WB_HIDE ((WinBits)SAL_CONST_INT64(0x80000000))
-#define WB_HSCROLL WB_HORZ
-#define WB_VSCROLL WB_VERT
-#define WB_TOPIMAGE WB_TOP
-
-// Window-Bits for PushButtons
-#define WB_DEFBUTTON ((WinBits)0x10000000)
-#define WB_NOLIGHTBORDER ((WinBits)0x20000000)
-#define WB_RECTSTYLE ((WinBits)0x08000000)
-#define WB_SMALLSTYLE ((WinBits)0x04000000)
-#define WB_TOGGLE ((WinBits)SAL_CONST_INT64(0x1000000000))
-#define WB_BEVELBUTTON ((WinBits)SAL_CONST_INT64(0x2000000000))
-
-// Window-Bits for FixedText
-#define WB_PATHELLIPSIS ((WinBits)0x00100000)
-#define WB_EXTRAOFFSET ((WinBits)0x02000000)
-#define WB_NOMULTILINE ((WinBits)0x10000000)
-#define WB_INFO ((WinBits)0x20000000)
-
-// Window-Bits for CheckBox
-#define WB_CBLINESTYLE ((WinBits)SAL_CONST_INT64(0x2000000000))
-
-// Window-Bits for Edit
-#define WB_PASSWORD ((WinBits)0x01000000)
-#define WB_READONLY ((WinBits)0x02000000)
-#define WB_NOHIDESELECTION ((WinBits)SAL_CONST_INT64(0x1000000000))
-#define WB_FORCECTRLBACKGROUND ((WinBits)0x80000000)
-
-// Window-Bits for MultiLineEdit
-#define WB_IGNORETAB ((WinBits)0x20000000)
-
-// Window-Bits for ListBox and MultiListBox
-#define WB_SIMPLEMODE ((WinBits)0x20000000)
-
-// Window-Bits for FixedBitmap
-#define WB_FAST ((WinBits)0x04000000)
-#define WB_SCALE ((WinBits)0x08000000)
-#define WB_TOPLEFTVISIBLE ((WinBits)0x10000000)
-
-// Window-Bits for ToolBox
-#define WB_LINESPACING ((WinBits)0x01000000)
-#define WB_SCROLL ((WinBits)0x02000000)
-#define WB_FORCETABCYCLE ((WinBits)0x04000000)
-
-// Window-Bits for TabControl
-#define WB_SINGLELINE ((WinBits)0x02000000)
-
-// Window-Bits for DockingWindows
-#define WB_DOCKBORDER ((WinBits)0x00001000)
-
-// Window-Bits for SplitWindow
-#define WB_NOSPLITDRAW ((WinBits)0x01000000)
-#define WB_FLATSPLITDRAW ((WinBits)0x02000000)
-
-// Window-Bits for MessageBoxen
-#define WB_OK ((WinBits)0x00100000)
-#define WB_OK_CANCEL ((WinBits)0x00200000)
-#define WB_YES_NO ((WinBits)0x00400000)
-#define WB_YES_NO_CANCEL ((WinBits)0x00800000)
-#define WB_RETRY_CANCEL ((WinBits)0x01000000)
-#define WB_DEF_OK ((WinBits)0x02000000)
-#define WB_DEF_CANCEL ((WinBits)0x04000000)
-#define WB_DEF_RETRY ((WinBits)0x08000000)
-#define WB_DEF_YES ((WinBits)SAL_CONST_INT64(0x10000000))
-#define WB_DEF_NO ((WinBits)SAL_CONST_INT64(0x20000000))
-#define WB_ABORT_RETRY_IGNORE ((WinBits)SAL_CONST_INT64(0x1000000000))
-#define WB_DEF_IGNORE ((WinBits)SAL_CONST_INT64(0x2000000000))
-
-// Standard-WinBits
-#define WB_STDWORK (WB_SIZEMOVE | WB_CLOSEABLE)
-#define WB_STDDOCKWIN (WB_DOCKABLE | WB_MOVEABLE | WB_CLOSEABLE)
-#define WB_STDFLOATWIN (WB_SIZEMOVE | WB_CLOSEABLE | WB_ROLLABLE)
-#define WB_STDDIALOG (WB_MOVEABLE | WB_CLOSEABLE)
-#define WB_STDMODELESS (WB_STDDIALOG)
-#define WB_STDMODAL (WB_STDDIALOG)
-#define WB_STDTABDIALOG (WB_STDDIALOG)
-#define WB_STDTABCONTROL 0
-
-// For TreeListBox
-#define WB_HASBUTTONS ((WinBits)0x00800000)
-#define WB_HASLINES ((WinBits)0x01000000)
-#define WB_HASLINESATROOT ((WinBits)0x02000000)
-
-// For FileOpen Dialog
-#define WB_PATH ((WinBits)0x00100000)
-#define WB_OPEN ((WinBits)0x00200000)
-#define WB_SAVEAS ((WinBits)0x00400000)
-
-// For Slider
-// Window-Bits for TabControl
-#define WB_SLIDERSET ((WinBits)0x02000000)
-
-
-// --------------------
-// - extended WinBits -
-// --------------------
-#define WB_EXT_DOCUMENT ((WinBits)0x00000001)
-#define WB_EXT_DOCMODIFIED ((WinBits)0x00000002)
-
-// ---------------
-// - WindowAlign -
-// ---------------
-
-// By changes you must also change: rsc/vclrsc.hxx
-enum WindowAlign { WINDOWALIGN_LEFT, WINDOWALIGN_TOP, WINDOWALIGN_RIGHT, WINDOWALIGN_BOTTOM };
-enum ImageAlign { IMAGEALIGN_LEFT, IMAGEALIGN_TOP, IMAGEALIGN_RIGHT, IMAGEALIGN_BOTTOM,
- IMAGEALIGN_LEFT_TOP, IMAGEALIGN_LEFT_BOTTOM, IMAGEALIGN_TOP_LEFT,
- IMAGEALIGN_TOP_RIGHT, IMAGEALIGN_RIGHT_TOP, IMAGEALIGN_RIGHT_BOTTOM,
- IMAGEALIGN_BOTTOM_LEFT, IMAGEALIGN_BOTTOM_RIGHT, IMAGEALIGN_CENTER };
-enum SymbolAlign { SYMBOLALIGN_LEFT, SYMBOLALIGN_RIGHT };
-
-// ------------
-// - TriState -
-// ------------
-
-// By changes you must also change: rsc/vclrsc.hxx
-enum TriState { STATE_NOCHECK, STATE_CHECK, STATE_DONTKNOW };
-
-
-// ----------------------
-// - ButtonDialog-Types -
-// ----------------------
-
-typedef USHORT StandardButtonType;
-#define BUTTON_OK ((StandardButtonType)0)
-#define BUTTON_CANCEL ((StandardButtonType)1)
-#define BUTTON_YES ((StandardButtonType)2)
-#define BUTTON_NO ((StandardButtonType)3)
-#define BUTTON_RETRY ((StandardButtonType)4)
-#define BUTTON_HELP ((StandardButtonType)5)
-#define BUTTON_CLOSE ((StandardButtonType)6)
-#define BUTTON_MORE ((StandardButtonType)7)
-#define BUTTON_IGNORE ((StandardButtonType)8)
-#define BUTTON_ABORT ((StandardButtonType)9)
-#define BUTTON_LESS ((StandardButtonType)10)
-#define BUTTON_COUNT 11
+#include <tools/wintypes.hxx>
#endif // _SV_WINTYPES_HXX
diff --git a/vcl/os2/source/app/salinst.cxx b/vcl/os2/source/app/salinst.cxx
index d4d324ad469c..633ad4137aff 100644
--- a/vcl/os2/source/app/salinst.cxx
+++ b/vcl/os2/source/app/salinst.cxx
@@ -55,6 +55,7 @@
#include <salbmp.h>
#include <vcl/salimestatus.hxx>
#include <vcl/timer.hxx>
+#include <tools/solarmutex.hxx>
// =======================================================================
@@ -501,12 +502,14 @@ Os2SalInstance::Os2SalInstance()
mpSalWaitMutex = new vos::OMutex;
mnYieldWaitCount = 0;
mpSalYieldMutex->acquire();
+ ::tools::SolarMutex::SetSolarMutex( mpSalYieldMutex );
}
// -----------------------------------------------------------------------
Os2SalInstance::~Os2SalInstance()
{
+ ::tools::SolarMutex::SetSolarMutex( 0 );
mpSalYieldMutex->release();
delete mpSalYieldMutex;
delete mpSalWaitMutex;
diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst
index 908dd1eafd72..5d2aaf90c6f7 100644
--- a/vcl/prj/build.lst
+++ b/vcl/prj/build.lst
@@ -1,4 +1,4 @@
-vc vcl : l10n apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools transex3 icc SO:print_header cpputools NULL
+vc vcl : l10n apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools transex3 icc SO:print_header cpputools shell NULL
vc vcl usr1 - all vc_mkout NULL
vc vcl\inc nmake - all vc_inc NULL
vc vcl\source\glyphs nmake - all vc_glyphs vc_inc NULL
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 9d398aef10cd..516b23dd76be 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -61,6 +61,13 @@ void SalFrame::Flush( const Rectangle& )
// -----------------------------------------------------------------------
+void SalFrame::SetRepresentedURL( const rtl::OUString& )
+{
+ // currently this is Mac only functionality
+}
+
+// -----------------------------------------------------------------------
+
SalInstance::~SalInstance()
{
}
diff --git a/vcl/source/app/session.cxx b/vcl/source/app/session.cxx
index ed8e355c2071..e82e93a9ccca 100644
--- a/vcl/source/app/session.cxx
+++ b/vcl/source/app/session.cxx
@@ -38,6 +38,7 @@
#include <tools/debug.hxx>
#include <com/sun/star/frame/XSessionManagerClient.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/frame/XSessionManagerListener2.hpp>
#include <list>
@@ -81,6 +82,7 @@ class VCLSession : public cppu::WeakComponentImplHelper1 < XSessionManagerClient
void callSaveRequested( bool bShutdown, bool bCancelable );
void callShutdownCancelled();
void callInteractionGranted( bool bGranted );
+ void callQuit();
public:
VCLSession();
virtual ~VCLSession();
@@ -199,6 +201,27 @@ void VCLSession::callShutdownCancelled()
Application::AcquireSolarMutex( nAcquireCount );
}
+void VCLSession::callQuit()
+{
+ std::list< Listener > aListeners;
+ {
+ osl::MutexGuard aGuard( m_aMutex );
+ // copy listener list since calling a listener may remove it.
+ aListeners = m_aListeners;
+ // set back interaction state
+ m_bInteractionRequested = m_bInteractionDone = m_bInteractionGranted = false;
+ }
+
+ ULONG nAcquireCount = Application::ReleaseSolarMutex();
+ for( std::list< Listener >::const_iterator it = aListeners.begin(); it != aListeners.end(); ++it )
+ {
+ Reference< XSessionManagerListener2 > xListener2( it->m_xListener, UNO_QUERY );
+ if( xListener2.is() )
+ xListener2->doQuit();
+ }
+ Application::AcquireSolarMutex( nAcquireCount );
+}
+
void VCLSession::SalSessionEventProc( SalSessionEvent* pEvent )
{
switch( pEvent->m_eType )
@@ -218,6 +241,9 @@ void VCLSession::SalSessionEventProc( SalSessionEvent* pEvent )
case ShutdownCancel:
pOneInstance->callShutdownCancelled();
break;
+ case Quit:
+ pOneInstance->callQuit();
+ break;
}
}
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 6aa453563596..bd90d8824d91 100644..100755
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -37,14 +37,17 @@
#include "vcl/event.hxx"
#include "vcl/settings.hxx"
#include "vcl/i18nhelp.hxx"
-#include "vcl/fontcfg.hxx"
+#include "unotools/fontcfg.hxx"
#include "vcl/configsettings.hxx"
#include "vcl/gradient.hxx"
#include "vcl/unohelp.hxx"
+#include "vcl/bitmapex.hxx"
+#include "vcl/impimagetree.hxx"
#include "unotools/localedatawrapper.hxx"
#include "unotools/collatorwrapper.hxx"
#include "unotools/configmgr.hxx"
#include "unotools/confignode.hxx"
+#include <unotools/syslocaleoptions.hxx>
#ifdef WNT
#include "tools/prewin.h"
@@ -66,7 +69,6 @@ DBG_NAME( AllSettings )
STYLE_OPTION_NOMNEMONICS)
// =======================================================================
-
ImplMachineData::ImplMachineData()
{
mnRefCount = 1;
@@ -549,7 +551,7 @@ void ImplStyleData::SetStandardStyles()
Font aStdFont( FAMILY_SWISS, Size( 0, 8 ) );
aStdFont.SetCharSet( gsl_getSystemTextEncoding() );
aStdFont.SetWeight( WEIGHT_NORMAL );
- aStdFont.SetName( vcl::DefaultFontConfiguration::get()->getUserInterfaceFont(com::sun::star::lang::Locale( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("en") ), rtl::OUString(), rtl::OUString() ) ) );
+ aStdFont.SetName( utl::DefaultFontConfiguration::get()->getUserInterfaceFont(com::sun::star::lang::Locale( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("en") ), rtl::OUString(), rtl::OUString() ) ) );
maAppFont = aStdFont;
maHelpFont = aStdFont;
maMenuFont = aStdFont;
@@ -706,6 +708,7 @@ void StyleSettings::Set3DColors( const Color& rColor )
case STYLE_SYMBOLS_INDUSTRIAL: return ::rtl::OUString::createFromAscii( "industrial" );
case STYLE_SYMBOLS_CRYSTAL: return ::rtl::OUString::createFromAscii( "crystal" );
case STYLE_SYMBOLS_TANGO: return ::rtl::OUString::createFromAscii( "tango" );
+ case STYLE_SYMBOLS_OXYGEN: return ::rtl::OUString::createFromAscii( "oxygen" );
case STYLE_SYMBOLS_CLASSIC: return ::rtl::OUString::createFromAscii( "classic" );
}
@@ -726,6 +729,8 @@ ULONG StyleSettings::ImplNameToSymbolsStyle( const ::rtl::OUString &rName ) cons
return STYLE_SYMBOLS_CRYSTAL;
else if ( rName == ::rtl::OUString::createFromAscii( "tango" ) )
return STYLE_SYMBOLS_TANGO;
+ else if ( rName == ::rtl::OUString::createFromAscii( "oxygen" ) )
+ return STYLE_SYMBOLS_OXYGEN;
else if ( rName == ::rtl::OUString::createFromAscii( "classic" ) )
return STYLE_SYMBOLS_CLASSIC;
@@ -759,12 +764,12 @@ ULONG StyleSettings::GetCurrentSymbolsStyle() const
// style selected in Tools -> Options... -> OpenOffice.org -> View
ULONG nStyle = GetSymbolsStyle();
- if ( nStyle == STYLE_SYMBOLS_AUTO )
+ if ( nStyle == STYLE_SYMBOLS_AUTO || ( !CheckSymbolStyle (nStyle) ) )
{
// the preferred style can be read from the desktop setting by the desktop native widgets modules
ULONG nPreferredStyle = GetPreferredSymbolsStyle();
- if ( nPreferredStyle == STYLE_SYMBOLS_AUTO )
+ if ( nPreferredStyle == STYLE_SYMBOLS_AUTO || ( !CheckSymbolStyle (nPreferredStyle) ) )
{
// use a hardcoded desktop-specific fallback if no preferred style has been detected
@@ -780,7 +785,10 @@ ULONG StyleSettings::GetCurrentSymbolsStyle() const
nPreferredStyle = snFallbackDesktopStyle;
}
- nStyle = GetHighContrastMode()? STYLE_SYMBOLS_HICONTRAST: nPreferredStyle;
+ if (GetHighContrastMode() && CheckSymbolStyle (STYLE_SYMBOLS_HICONTRAST) )
+ nStyle = STYLE_SYMBOLS_HICONTRAST;
+ else
+ nStyle = nPreferredStyle;
}
return nStyle;
@@ -814,6 +822,33 @@ ULONG StyleSettings::GetAutoSymbolsStyle() const
nRet = STYLE_SYMBOLS_TANGO;
else if( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde" ) )
nRet = STYLE_SYMBOLS_CRYSTAL;
+ else if( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde4" ) )
+ nRet = STYLE_SYMBOLS_OXYGEN;
+ }
+
+ // falback to any existing style
+ if ( ! CheckSymbolStyle (nRet) )
+ {
+ for ( ULONG n = 0 ; n <= STYLE_SYMBOLS_THEMES_MAX ; n++ )
+ {
+ ULONG nStyleToCheck = n;
+
+ // auto is not a real theme => can't be fallback
+ if ( nStyleToCheck == STYLE_SYMBOLS_AUTO )
+ continue;
+
+ // will check hicontrast in the end
+ if ( nStyleToCheck == STYLE_SYMBOLS_HICONTRAST )
+ continue;
+ if ( nStyleToCheck == STYLE_SYMBOLS_THEMES_MAX )
+ nStyleToCheck = STYLE_SYMBOLS_HICONTRAST;
+
+ if ( CheckSymbolStyle ( nStyleToCheck ) )
+ {
+ nRet = nStyleToCheck;
+ n = STYLE_SYMBOLS_THEMES_MAX;
+ }
+ }
}
return nRet;
@@ -821,6 +856,14 @@ ULONG StyleSettings::GetAutoSymbolsStyle() const
// -----------------------------------------------------------------------
+bool StyleSettings::CheckSymbolStyle( ULONG nStyle ) const
+{
+ static ImplImageTreeSingletonRef aImageTree;
+ return aImageTree->checkStyle( ImplSymbolsStyleToName( nStyle ) );
+}
+
+// -----------------------------------------------------------------------
+
void StyleSettings::SetStandardStyles()
{
CopyData();
@@ -1069,7 +1112,6 @@ BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const
ImplMiscData::ImplMiscData()
{
mnRefCount = 1;
- mnTwoDigitYearStart = 1930;
mnEnableATT = sal::static_int_cast<USHORT>(~0U);
mnDisablePrinting = sal::static_int_cast<USHORT>(~0U);
static const char* pEnv = getenv("SAL_DECIMALSEP_ENABLED" ); // set default without UI
@@ -1081,7 +1123,6 @@ ImplMiscData::ImplMiscData()
ImplMiscData::ImplMiscData( const ImplMiscData& rData )
{
mnRefCount = 1;
- mnTwoDigitYearStart = rData.mnTwoDigitYearStart;
mnEnableATT = rData.mnEnableATT;
mnDisablePrinting = rData.mnDisablePrinting;
mbEnableLocalizedDecimalSep = rData.mbEnableLocalizedDecimalSep;
@@ -1155,8 +1196,7 @@ BOOL MiscSettings::operator ==( const MiscSettings& rSet ) const
if ( mpData == rSet.mpData )
return TRUE;
- if ( (mpData->mnTwoDigitYearStart == rSet.mpData->mnTwoDigitYearStart ) &&
- (mpData->mnEnableATT == rSet.mpData->mnEnableATT ) &&
+ if ( (mpData->mnEnableATT == rSet.mpData->mnEnableATT ) &&
(mpData->mnDisablePrinting == rSet.mpData->mnDisablePrinting ) &&
(mpData->mbEnableLocalizedDecimalSep == rSet.mpData->mbEnableLocalizedDecimalSep ) )
return TRUE;
@@ -1513,28 +1553,20 @@ BOOL HelpSettings::operator ==( const HelpSettings& rSet ) const
// =======================================================================
-static BOOL ImplCompareLocales( const ::com::sun::star::lang::Locale& L1, const ::com::sun::star::lang::Locale& L2 )
-{
- return ( ( L1.Language == L2.Language ) &&
- ( L1.Country == L2.Country ) &&
- ( L1.Variant == L2.Variant ) );
-}
-
-// =======================================================================
-
ImplAllSettingsData::ImplAllSettingsData()
{
mnRefCount = 1;
mnSystemUpdate = SETTINGS_ALLSETTINGS;
mnWindowUpdate = SETTINGS_ALLSETTINGS;
meLanguage = LANGUAGE_SYSTEM;
- meUILanguage = LANGUAGE_SYSTEM;
+ meUILanguage = LANGUAGE_SYSTEM;
mpLocaleDataWrapper = NULL;
mpUILocaleDataWrapper = NULL;
mpCollatorWrapper = NULL;
mpUICollatorWrapper = NULL;
mpI18nHelper = NULL;
mpUII18nHelper = NULL;
+ maMiscSettings.SetEnableLocalizedDecimalSep( maSysLocale.GetOptions().IsDecimalSeparatorAsLocale() );
}
// -----------------------------------------------------------------------
@@ -1546,15 +1578,12 @@ ImplAllSettingsData::ImplAllSettingsData( const ImplAllSettingsData& rData ) :
maMiscSettings( rData.maMiscSettings ),
maNotificationSettings( rData.maNotificationSettings ),
maHelpSettings( rData.maHelpSettings ),
- maLocale( rData.maLocale ),
- maUILocale( rData.maUILocale )
-
+ maLocale( rData.maLocale )
{
mnRefCount = 1;
mnSystemUpdate = rData.mnSystemUpdate;
mnWindowUpdate = rData.mnWindowUpdate;
meLanguage = rData.meLanguage;
- meUILanguage = rData.meUILanguage;
// Pointer couldn't shared and objects haven't a copy ctor
// So we create the cache objects new, if the GetFunction is
// called
@@ -1750,11 +1779,7 @@ ULONG AllSettings::Update( ULONG nFlags, const AllSettings& rSet )
if ( nFlags & SETTINGS_UILOCALE )
{
- if ( mpData->meUILanguage || rSet.mpData->meUILanguage )
- {
- SetUILanguage( rSet.mpData->meUILanguage );
- nChangeFlags |= SETTINGS_UILOCALE;
- }
+ // UILocale can't be changed
}
return nChangeFlags;
@@ -1793,9 +1818,6 @@ ULONG AllSettings::GetChangeFlags( const AllSettings& rSet ) const
if ( mpData->meLanguage || rSet.mpData->meLanguage )
nChangeFlags |= SETTINGS_LOCALE;
- if ( mpData->meUILanguage || rSet.mpData->meUILanguage )
- nChangeFlags |= SETTINGS_UILOCALE;
-
return nChangeFlags;
}
@@ -1817,18 +1839,13 @@ BOOL AllSettings::operator ==( const AllSettings& rSet ) const
(mpData->maNotificationSettings == rSet.mpData->maNotificationSettings) &&
(mpData->maHelpSettings == rSet.mpData->maHelpSettings) &&
(mpData->mnSystemUpdate == rSet.mpData->mnSystemUpdate) &&
+ (mpData->maLocale == rSet.mpData->maLocale) &&
(mpData->mnWindowUpdate == rSet.mpData->mnWindowUpdate) )
{
- // special treatment for Locale, because maLocale is only
- // initialized after first call of GetLocale().
- ::com::sun::star::lang::Locale aEmptyLocale;
- if ( ( ImplCompareLocales( mpData->maLocale, aEmptyLocale ) && ImplCompareLocales( rSet.mpData->maLocale, aEmptyLocale ) )
- || ImplCompareLocales( GetLocale(), rSet.GetLocale() ) )
- {
- return TRUE;
- }
+ return TRUE;
}
- return FALSE;
+ else
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -1857,70 +1874,39 @@ void AllSettings::SetLocale( const ::com::sun::star::lang::Locale& rLocale )
// -----------------------------------------------------------------------
-void AllSettings::SetUILocale( const ::com::sun::star::lang::Locale& rLocale )
+void AllSettings::SetUILocale( const ::com::sun::star::lang::Locale& )
{
- CopyData();
-
- mpData->maUILocale = rLocale;
-
- if ( !rLocale.Language.getLength() )
- mpData->meUILanguage = LANGUAGE_SYSTEM;
- else
- mpData->meUILanguage = MsLangId::convertLocaleToLanguage( rLocale );
- if ( mpData->mpUILocaleDataWrapper )
- {
- delete mpData->mpUILocaleDataWrapper;
- mpData->mpUILocaleDataWrapper = NULL;
- }
- if ( mpData->mpUII18nHelper )
- {
- delete mpData->mpUII18nHelper;
- mpData->mpUII18nHelper = NULL;
- }
+ // there is only one UILocale per process
}
// -----------------------------------------------------------------------
void AllSettings::SetLanguage( LanguageType eLang )
{
- CopyData();
-
- mpData->meLanguage = eLang;
-
- // Will be calculated in GetLocale()
- mpData->maLocale = ::com::sun::star::lang::Locale();
- if ( mpData->mpLocaleDataWrapper )
- {
- delete mpData->mpLocaleDataWrapper;
- mpData->mpLocaleDataWrapper = NULL;
- }
- if ( mpData->mpI18nHelper )
+ if ( eLang != mpData->meLanguage )
{
- delete mpData->mpI18nHelper;
- mpData->mpI18nHelper = NULL;
+ CopyData();
+
+ mpData->meLanguage = eLang;
+ MsLangId::convertLanguageToLocale( GetLanguage(), ((AllSettings*)this)->mpData->maLocale );
+ if ( mpData->mpLocaleDataWrapper )
+ {
+ delete mpData->mpLocaleDataWrapper;
+ mpData->mpLocaleDataWrapper = NULL;
+ }
+ if ( mpData->mpI18nHelper )
+ {
+ delete mpData->mpI18nHelper;
+ mpData->mpI18nHelper = NULL;
+ }
}
}
// -----------------------------------------------------------------------
-void AllSettings::SetUILanguage( LanguageType eLang )
+void AllSettings::SetUILanguage( LanguageType )
{
- CopyData();
-
- mpData->meUILanguage = eLang;
-
- // Will be calculated in GetUILocale()
- mpData->maUILocale = ::com::sun::star::lang::Locale();
- if ( mpData->mpUILocaleDataWrapper )
- {
- delete mpData->mpUILocaleDataWrapper;
- mpData->mpUILocaleDataWrapper = NULL;
- }
- if ( mpData->mpUII18nHelper )
- {
- delete mpData->mpUII18nHelper;
- mpData->mpUII18nHelper = NULL;
- }
+ // there is only one UILanguage per process
}
// -----------------------------------------------------------------------
@@ -1973,8 +1959,7 @@ BOOL AllSettings::GetLayoutRTL() const
const ::com::sun::star::lang::Locale& AllSettings::GetLocale() const
{
if ( !mpData->maLocale.Language.getLength() )
- MsLangId::convertLanguageToLocale( GetLanguage(),
- ((AllSettings*)this)->mpData->maLocale );
+ mpData->maLocale = mpData->maSysLocale.GetLocale();
return mpData->maLocale;
}
@@ -1983,9 +1968,9 @@ const ::com::sun::star::lang::Locale& AllSettings::GetLocale() const
const ::com::sun::star::lang::Locale& AllSettings::GetUILocale() const
{
+ // the UILocale is never changed
if ( !mpData->maUILocale.Language.getLength() )
- MsLangId::convertLanguageToLocale( GetUILanguage(),
- ((AllSettings*)this)->mpData->maUILocale );
+ mpData->maUILocale = mpData->maSysLocale.GetUILocale();
return mpData->maUILocale;
}
@@ -1994,8 +1979,9 @@ const ::com::sun::star::lang::Locale& AllSettings::GetUILocale() const
LanguageType AllSettings::GetLanguage() const
{
+ // meLanguage == LANGUAGE_SYSTEM means: use settings from SvtSysLocale
if ( mpData->meLanguage == LANGUAGE_SYSTEM )
- return MsLangId::getSystemLanguage();
+ return mpData->maSysLocale.GetLanguage();
return mpData->meLanguage;
}
@@ -2004,10 +1990,8 @@ LanguageType AllSettings::GetLanguage() const
LanguageType AllSettings::GetUILanguage() const
{
- if ( mpData->meUILanguage == LANGUAGE_SYSTEM )
- return MsLangId::getSystemUILanguage();
-
- return mpData->meUILanguage;
+ // the UILanguage is never changed
+ return mpData->maSysLocale.GetUILanguage();
}
// -----------------------------------------------------------------------
@@ -2076,3 +2060,22 @@ const CollatorWrapper& AllSettings::GetUICollatorWrapper() const
}
*/
+void AllSettings::LocaleSettingsChanged( sal_uInt32 nHint )
+{
+ AllSettings aAllSettings( Application::GetSettings() );
+ if ( nHint & SYSLOCALEOPTIONS_HINT_DECSEP )
+ {
+ MiscSettings aMiscSettings = aAllSettings.GetMiscSettings();
+ BOOL bIsDecSepAsLocale = aAllSettings.mpData->maSysLocale.GetOptions().IsDecimalSeparatorAsLocale();
+ if ( aMiscSettings.GetEnableLocalizedDecimalSep() != bIsDecSepAsLocale )
+ {
+ aMiscSettings.SetEnableLocalizedDecimalSep( bIsDecSepAsLocale );
+ aAllSettings.SetMiscSettings( aMiscSettings );
+ }
+ }
+
+ if ( (nHint & SYSLOCALEOPTIONS_HINT_LOCALE) )
+ aAllSettings.SetLocale( aAllSettings.mpData->maSysLocale.GetOptions().GetLocale() );
+
+ Application::SetSettings( aAllSettings );
+}
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 47ffa7dffec7..7f329f2d24d5 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -76,7 +76,8 @@
#include "vcl/salimestatus.hxx"
#include <utility>
-#include "vcl/lazydelete.hxx"
+#include <vcl/lazydelete.hxx>
+#include <unotools/syslocaleoptions.hxx>
using namespace ::com::sun::star::uno;
@@ -704,12 +705,10 @@ bool Application::ValidateSystemFont()
void Application::SetSettings( const AllSettings& rSettings )
{
- MsLangId::setConfiguredSystemLanguage( rSettings.GetLanguage());
- MsLangId::setConfiguredSystemUILanguage( rSettings.GetUILanguage());
ImplSVData* pSVData = ImplGetSVData();
if ( !pSVData->maAppData.mpSettings )
{
- pSVData->maAppData.mpSettings = new AllSettings();
+ GetSettings();
*pSVData->maAppData.mpSettings = rSettings;
ResMgr::SetDefaultLocale( rSettings.GetUILocale() );
}
@@ -811,7 +810,12 @@ const AllSettings& Application::GetSettings()
{
ImplSVData* pSVData = ImplGetSVData();
if ( !pSVData->maAppData.mpSettings )
+ {
+ pSVData->maAppData.mpCfgListener = new LocaleConfigurationListener;
pSVData->maAppData.mpSettings = new AllSettings();
+ pSVData->maAppData.mpSettings->GetSysLocale().GetOptions().AddListener( pSVData->maAppData.mpCfgListener );
+ }
+
return *(pSVData->maAppData.mpSettings);
}
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index 21e1f34c1ef5..6a61d15db4c0 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -47,7 +47,7 @@
#include <uno/current_context.hxx>
#include <cppuhelper/implbase1.hxx>
#include <tools/debug.hxx>
-#include <vcl/fontcfg.hxx>
+#include <unotools/fontcfg.hxx>
#include <vcl/configsettings.hxx>
#include <vcl/svdata.hxx>
#include <vcl/window.h>
@@ -523,3 +523,9 @@ Window* ImplFindWindow( const SalFrame* pFrame, Point& rSalFramePos )
return NULL;
}
+
+void LocaleConfigurationListener::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 nHint )
+{
+ AllSettings::LocaleSettingsChanged( nHint );
+}
+
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 6c09978e37b1..310c01a40673 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -79,8 +79,8 @@
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/lang/XComponent.hpp"
#include "rtl/logfile.hxx"
-
-#include "vcl/fontcfg.hxx"
+#include <unotools/syslocaleoptions.hxx>
+#include "unotools/fontcfg.hxx"
#include "vcl/configsettings.hxx"
#include "vcl/lazydelete.hxx"
@@ -467,6 +467,12 @@ void DeInitVCL()
if ( pSVData->maAppData.mpSettings )
{
+ if ( pSVData->maAppData.mpCfgListener )
+ {
+ pSVData->maAppData.mpSettings->GetSysLocale().GetOptions().RemoveListener( pSVData->maAppData.mpCfgListener );
+ delete pSVData->maAppData.mpCfgListener;
+ }
+
delete pSVData->maAppData.mpSettings;
pSVData->maAppData.mpSettings = NULL;
}
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index b417774142d3..a7729f4ace24 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -55,6 +55,7 @@
#include <unotools/localedatawrapper.hxx>
#include <unotools/calendarwrapper.hxx>
#include <unotools/charclass.hxx>
+#include <unotools/misccfg.hxx>
using namespace ::com::sun::star;
@@ -1214,7 +1215,7 @@ static BOOL ImplDateProcessKeyInput( Edit*, const KeyEvent& rKEvt, ExtDateFieldF
static BOOL ImplDateGetValue( const XubString& rStr, Date& rDate, ExtDateFieldFormat eDateFormat,
const LocaleDataWrapper& rLocaleDataWrapper, const CalendarWrapper& rCalendarWrapper,
- const AllSettings& rSettings )
+ const AllSettings& )
{
USHORT nDay = 0;
USHORT nMonth = 0;
@@ -1312,7 +1313,7 @@ static BOOL ImplDateGetValue( const XubString& rStr, Date& rDate, ExtDateFieldFo
return FALSE;
Date aNewDate( nDay, nMonth, nYear );
- DateFormatter::ExpandCentury( aNewDate, rSettings.GetMiscSettings().GetTwoDigitYearStart() );
+ DateFormatter::ExpandCentury( aNewDate, utl::MiscCfg().GetYear2000() );
if ( aNewDate.IsValid() )
{
rDate = aNewDate;
@@ -1355,7 +1356,7 @@ BOOL DateFormatter::ImplDateReformat( const XubString& rStr, XubString& rOutStr,
// -----------------------------------------------------------------------
XubString DateFormatter::ImplGetDateAsText( const Date& rDate,
- const AllSettings& rSettings ) const
+ const AllSettings& ) const
{
BOOL bShowCentury = FALSE;
switch ( GetExtDateFormat() )
@@ -1379,7 +1380,7 @@ XubString DateFormatter::ImplGetDateAsText( const Date& rDate,
if ( !bShowCentury )
{
// Check if I have to use force showing the century
- USHORT nTwoDigitYearStart = rSettings.GetMiscSettings().GetTwoDigitYearStart();
+ USHORT nTwoDigitYearStart = utl::MiscCfg().GetYear2000();
USHORT nYear = rDate.GetYear();
// Wenn Jahr nicht im 2stelligen Grenzbereich liegt,
@@ -2033,7 +2034,7 @@ void DateFormatter::Reformat()
void DateFormatter::ExpandCentury( Date& rDate )
{
- ExpandCentury( rDate, Application::GetSettings().GetMiscSettings().GetTwoDigitYearStart() );
+ ExpandCentury( rDate, utl::MiscCfg().GetYear2000() );
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/base14.cxx b/vcl/source/gdi/base14.cxx
index 17e616d196b4..56d1c3ff5eba 100644
--- a/vcl/source/gdi/base14.cxx
+++ b/vcl/source/gdi/base14.cxx
@@ -601,7 +601,7 @@ const PDFWriterImpl::BuiltinFont PDFWriterImpl::m_aBuiltinFonts[ 14 ] = {
"Symbol", // PSName
1010, -293, // ascend, descend
FAMILY_DONTKNOW, // family style
- RTL_TEXTENCODING_SYMBOL, // charset
+ RTL_TEXTENCODING_ADOBE_SYMBOL, // charset
PITCH_VARIABLE, // pitch
WIDTH_NORMAL, // width type
WEIGHT_NORMAL, // weight type
diff --git a/vcl/source/gdi/configsettings.cxx b/vcl/source/gdi/configsettings.cxx
new file mode 100644
index 000000000000..b601caef301a
--- /dev/null
+++ b/vcl/source/gdi/configsettings.cxx
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * 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 <vcl/configsettings.hxx>
+#include <vcl/svdata.hxx>
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
+
+using namespace rtl;
+using namespace utl;
+using namespace vcl;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::lang;
+using namespace com::sun::star::beans;
+using namespace com::sun::star::container;
+
+#define SETTINGS_CONFIGNODE "VCL/Settings"
+
+/*
+ * SettingsConfigItem::get
+ */
+
+SettingsConfigItem* SettingsConfigItem::get()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ if( ! pSVData->mpSettingsConfigItem )
+ pSVData->mpSettingsConfigItem = new SettingsConfigItem();
+ return pSVData->mpSettingsConfigItem;
+}
+
+/*
+ * SettignsConfigItem constructor
+ */
+
+SettingsConfigItem::SettingsConfigItem()
+ :
+ ConfigItem( OUString( RTL_CONSTASCII_USTRINGPARAM( SETTINGS_CONFIGNODE ) ),
+ CONFIG_MODE_DELAYED_UPDATE ),
+ m_aSettings( 0 )
+{
+ getValues();
+}
+
+/*
+ * SettingsConfigItem destructor
+ */
+
+SettingsConfigItem::~SettingsConfigItem()
+{
+ if( IsModified() )
+ Commit();
+}
+
+/*
+ * SettingsConfigItem::Commit
+ */
+
+void SettingsConfigItem::Commit()
+{
+ if( ! IsValidConfigMgr() )
+ return;
+
+ std::hash_map< OUString, SmallOUStrMap, rtl::OUStringHash >::const_iterator group;
+
+ for( group = m_aSettings.begin(); group != m_aSettings.end(); ++group )
+ {
+ String aKeyName( group->first );
+ /*sal_Bool bAdded =*/ AddNode( OUString(), aKeyName );
+ Sequence< PropertyValue > aValues( group->second.size() );
+ PropertyValue* pValues = aValues.getArray();
+ int nIndex = 0;
+ SmallOUStrMap::const_iterator it;
+ for( it = group->second.begin(); it != group->second.end(); ++it )
+ {
+ String aName( aKeyName );
+ aName.Append( '/' );
+ aName.Append( String( it->first ) );
+ pValues[nIndex].Name = aName;
+ pValues[nIndex].Handle = 0;
+ pValues[nIndex].Value <<= it->second;
+ pValues[nIndex].State = PropertyState_DIRECT_VALUE;
+ nIndex++;
+ }
+ ReplaceSetProperties( aKeyName, aValues );
+ }
+}
+
+/*
+ * SettingsConfigItem::Notify
+ */
+
+void SettingsConfigItem::Notify( const Sequence< OUString >& )
+{
+ getValues();
+}
+
+/*
+ * SettingsConfigItem::getValues
+ */
+void SettingsConfigItem::getValues()
+{
+ if( ! IsValidConfigMgr() )
+ return;
+
+ m_aSettings.clear();
+
+ Sequence< OUString > aNames( GetNodeNames( OUString() ) );
+ m_aSettings.resize( aNames.getLength() );
+
+ for( int j = 0; j < aNames.getLength(); j++ )
+ {
+#if OSL_DEBUG_LEVEL > 2
+ fprintf( stderr, "found settings data for \"%s\"\n",
+ OUStringToOString( aNames.getConstArray()[j], RTL_TEXTENCODING_ASCII_US ).getStr()
+ );
+#endif
+ String aKeyName( aNames.getConstArray()[j] );
+ Sequence< OUString > aKeys( GetNodeNames( aKeyName ) );
+ Sequence< OUString > aSettingsKeys( aKeys.getLength() );
+ const OUString* pFrom = aKeys.getConstArray();
+ OUString* pTo = aSettingsKeys.getArray();
+ for( int m = 0; m < aKeys.getLength(); m++ )
+ {
+ String aName( aKeyName );
+ aName.Append( '/' );
+ aName.Append( String( pFrom[m] ) );
+ pTo[m] = aName;
+ }
+ Sequence< Any > aValues( GetProperties( aSettingsKeys ) );
+ const Any* pValue = aValues.getConstArray();
+ for( int i = 0; i < aValues.getLength(); i++, pValue++ )
+ {
+ if( pValue->getValueTypeClass() == TypeClass_STRING )
+ {
+ const OUString* pLine = (const OUString*)pValue->getValue();
+ if( pLine->getLength() )
+ m_aSettings[ aKeyName ][ pFrom[i] ] = *pLine;
+#if OSL_DEBUG_LEVEL > 2
+ fprintf( stderr, " \"%s\"=\"%.30s\"\n",
+ OUStringToOString( aKeys.getConstArray()[i], RTL_TEXTENCODING_ASCII_US ).getStr(),
+ OUStringToOString( *pLine, RTL_TEXTENCODING_ASCII_US ).getStr()
+ );
+#endif
+ }
+ }
+ }
+}
+
+/*
+ * SettingsConfigItem::getDefaultFont
+ */
+
+const OUString& SettingsConfigItem::getValue( const OUString& rGroup, const OUString& rKey ) const
+{
+ ::std::hash_map< OUString, SmallOUStrMap, rtl::OUStringHash >::const_iterator group = m_aSettings.find( rGroup );
+ if( group == m_aSettings.end() || group->second.find( rKey ) == group->second.end() )
+ {
+ static OUString aEmpty;
+ return aEmpty;
+ }
+ return group->second.find(rKey)->second;
+}
+
+/*
+ * SettingsConfigItem::setDefaultFont
+ */
+
+void SettingsConfigItem::setValue( const OUString& rGroup, const OUString& rKey, const OUString& rValue )
+{
+ bool bModified = m_aSettings[ rGroup ][ rKey ] != rValue;
+ if( bModified )
+ {
+ m_aSettings[ rGroup ][ rKey ] = rValue;
+ SetModified();
+ }
+}
+
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 3bbdba5dad5f..afd6181351b4 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -38,8 +38,8 @@
#include "tools/debug.hxx"
#include "vcl/font.hxx"
#include "vcl/impfont.hxx"
-#include "vcl/fontcfg.hxx"
-#include "vcl/outdev.h" // just for ImplGetEnglishSearchFontName! TODO: move it
+#include "vcl/outfont.hxx"
+#include "unotools/fontcfg.hxx"
#include <algorithm>
@@ -169,7 +169,7 @@ void Impl_Font::AskConfig()
mbConfigLookup = true;
// prepare the FontSubst configuration lookup
- const vcl::FontSubstConfiguration* pFontSubst = vcl::FontSubstConfiguration::get();
+ const utl::FontSubstConfiguration* pFontSubst = utl::FontSubstConfiguration::get();
String aShortName;
String aFamilyName;
@@ -177,12 +177,12 @@ void Impl_Font::AskConfig()
FontWeight eWeight = WEIGHT_DONTKNOW;
FontWidth eWidthType = WIDTH_DONTKNOW;
String aMapName = maFamilyName;
- ImplGetEnglishSearchFontName( aMapName );
- vcl::FontSubstConfiguration::getMapName( aMapName,
+ GetEnglishSearchFontName( aMapName );
+ utl::FontSubstConfiguration::getMapName( aMapName,
aShortName, aFamilyName, eWeight, eWidthType, nType );
// lookup the font name in the configuration
- const vcl::FontNameAttr* pFontAttr = pFontSubst->getSubstInfo( aMapName );
+ const utl::FontNameAttr* pFontAttr = pFontSubst->getSubstInfo( aMapName );
// if the direct lookup failed try again with an alias name
if ( !pFontAttr && (aShortName != aMapName) )
diff --git a/vcl/source/gdi/fontcfg.cxx b/vcl/source/gdi/fontcfg.cxx
deleted file mode 100644
index 68d3b499341d..000000000000
--- a/vcl/source/gdi/fontcfg.cxx
+++ /dev/null
@@ -1,1381 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: fontcfg.cxx,v $
- * $Revision: 1.49.114.1 $
- *
- * 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 <vcl/fontcfg.hxx>
-#include <vcl/configsettings.hxx>
-#include <vcl/outdev.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/unohelp.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <unotools/configpathes.hxx>
-#include <rtl/ustrbuf.hxx>
-
-#if OSL_DEBUG_LEVEL > 1
-#include <stdio.h>
-#endif
-
-#include <string.h>
-#include <list>
-#include <algorithm>
-
-#define DEFAULTFONT_CONFIGNODE "VCL/DefaultFonts"
-#define SUBSTFONT_CONFIGNODE "VCL/FontSubstitutions"
-#define SETTINGS_CONFIGNODE "VCL/Settings"
-
-using namespace vcl;
-using namespace rtl;
-using namespace utl;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::container;
-
-
-/*
- * DefaultFontConfiguration
- */
-
-static const char* getKeyType( int nKeyType )
-{
- switch( nKeyType )
- {
- case DEFAULTFONT_CJK_DISPLAY: return "CJK_DISPLAY";
- case DEFAULTFONT_CJK_HEADING: return "CJK_HEADING";
- case DEFAULTFONT_CJK_PRESENTATION: return "CJK_PRESENTATION";
- case DEFAULTFONT_CJK_SPREADSHEET: return "CJK_SPREADSHEET";
- case DEFAULTFONT_CJK_TEXT: return "CJK_TEXT";
- case DEFAULTFONT_CTL_DISPLAY: return "CTL_DISPLAY";
- case DEFAULTFONT_CTL_HEADING: return "CTL_HEADING";
- case DEFAULTFONT_CTL_PRESENTATION: return "CTL_PRESENTATION";
- case DEFAULTFONT_CTL_SPREADSHEET: return "CTL_SPREADSHEET";
- case DEFAULTFONT_CTL_TEXT: return "CTL_TEXT";
- case DEFAULTFONT_FIXED: return "FIXED";
- case DEFAULTFONT_LATIN_DISPLAY: return "LATIN_DISPLAY";
- case DEFAULTFONT_LATIN_FIXED: return "LATIN_FIXED";
- case DEFAULTFONT_LATIN_HEADING: return "LATIN_HEADING";
- case DEFAULTFONT_LATIN_PRESENTATION: return "LATIN_PRESENTATION";
- case DEFAULTFONT_LATIN_SPREADSHEET: return "LATIN_SPREADSHEET";
- case DEFAULTFONT_LATIN_TEXT: return "LATIN_TEXT";
- case DEFAULTFONT_SANS: return "SANS";
- case DEFAULTFONT_SANS_UNICODE: return "SANS_UNICODE";
- case DEFAULTFONT_SERIF: return "SERIF";
- case DEFAULTFONT_SYMBOL: return "SYMBOL";
- case DEFAULTFONT_UI_FIXED: return "UI_FIXED";
- case DEFAULTFONT_UI_SANS: return "UI_SANS";
- default:
- DBG_ERROR( "unmatched type" );
- return "";
- }
-}
-
-DefaultFontConfiguration* DefaultFontConfiguration::get()
-{
- ImplSVData* pSVData = ImplGetSVData();
- if( ! pSVData->maGDIData.mpDefaultFontConfiguration )
- pSVData->maGDIData.mpDefaultFontConfiguration = new DefaultFontConfiguration();
- return pSVData->maGDIData.mpDefaultFontConfiguration;
-}
-
-DefaultFontConfiguration::DefaultFontConfiguration()
-{
- try
- {
- // get service provider
- Reference< XMultiServiceFactory > xSMgr( unohelper::GetMultiServiceFactory() );
- // create configuration hierachical access name
- if( xSMgr.is() )
- {
- try
- {
- m_xConfigProvider =
- Reference< XMultiServiceFactory >(
- xSMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider" ))),
- UNO_QUERY );
- if( m_xConfigProvider.is() )
- {
- Sequence< Any > aArgs(1);
- PropertyValue aVal;
- aVal.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) );
- aVal.Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.VCL/DefaultFonts" ) );
- aArgs.getArray()[0] <<= aVal;
- m_xConfigAccess =
- Reference< XNameAccess >(
- m_xConfigProvider->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationAccess" )),
- aArgs ),
- UNO_QUERY );
- if( m_xConfigAccess.is() )
- {
- Sequence< OUString > aLocales = m_xConfigAccess->getElementNames();
- // fill config hash with empty interfaces
- int nLocales = aLocales.getLength();
- const OUString* pLocaleStrings = aLocales.getConstArray();
- Locale aLoc;
- for( int i = 0; i < nLocales; i++ )
- {
- sal_Int32 nIndex = 0;
- aLoc.Language = pLocaleStrings[i].getToken( 0, sal_Unicode('-'), nIndex ).toAsciiLowerCase();
- if( nIndex != -1 )
- aLoc.Country = pLocaleStrings[i].getToken( 0, sal_Unicode('-'), nIndex ).toAsciiUpperCase();
- else
- aLoc.Country = OUString();
- if( nIndex != -1 )
- aLoc.Variant = pLocaleStrings[i].getToken( 0, sal_Unicode('-'), nIndex ).toAsciiUpperCase();
- else
- aLoc.Variant = OUString();
- m_aConfig[ aLoc ] = LocaleAccess();
- m_aConfig[ aLoc ].aConfigLocaleString = pLocaleStrings[i];
- }
- }
- }
- }
- catch( Exception& )
- {
- // configuration is awry
- m_xConfigProvider.clear();
- m_xConfigAccess.clear();
- }
- }
- }
- catch( WrappedTargetException& )
- {
- }
- #if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "config provider: %s, config access: %s\n",
- m_xConfigProvider.is() ? "true" : "false",
- m_xConfigAccess.is() ? "true" : "false"
- );
- #endif
-}
-
-DefaultFontConfiguration::~DefaultFontConfiguration()
-{
- // release all nodes
- m_aConfig.clear();
- // release top node
- m_xConfigAccess.clear();
- // release config provider
- m_xConfigProvider.clear();
-}
-
-OUString DefaultFontConfiguration::tryLocale( const Locale& rLocale, const OUString& rType ) const
-{
- OUString aRet;
-
- std::hash_map< Locale, LocaleAccess, LocaleHash >::const_iterator it =
- m_aConfig.find( rLocale );
- if( it != m_aConfig.end() )
- {
- if( !it->second.xAccess.is() )
- {
- try
- {
- Reference< XNameAccess > xNode;
- if ( m_xConfigAccess->hasByName( it->second.aConfigLocaleString ) )
- {
- Any aAny = m_xConfigAccess->getByName( it->second.aConfigLocaleString );
- if( aAny >>= xNode )
- it->second.xAccess = xNode;
- }
- }
- catch( NoSuchElementException )
- {
- }
- catch( WrappedTargetException )
- {
- }
- }
- if( it->second.xAccess.is() )
- {
- try
- {
- if ( it->second.xAccess->hasByName( rType ) )
- {
- Any aAny = it->second.xAccess->getByName( rType );
- aAny >>= aRet;
- }
- }
- catch( NoSuchElementException& )
- {
- }
- catch( WrappedTargetException& )
- {
- }
- }
- }
-
- return aRet;
-}
-
-OUString DefaultFontConfiguration::getDefaultFont( const Locale& rLocale, int nType ) const
-{
- Locale aLocale;
- aLocale.Language = rLocale.Language.toAsciiLowerCase();
- aLocale.Country = rLocale.Country.toAsciiUpperCase();
- aLocale.Variant = rLocale.Variant.toAsciiUpperCase();
-
- OUString aType = OUString::createFromAscii( getKeyType( nType ) );
- OUString aRet = tryLocale( aLocale, aType );
- if( ! aRet.getLength() && aLocale.Variant.getLength() )
- {
- aLocale.Variant = OUString();
- aRet = tryLocale( aLocale, aType );
- }
- if( ! aRet.getLength() && aLocale.Country.getLength() )
- {
- aLocale.Country = OUString();
- aRet = tryLocale( aLocale, aType );
- }
- if( ! aRet.getLength() )
- {
- aLocale.Language = OUString( RTL_CONSTASCII_USTRINGPARAM( "en" ) );
- aRet = tryLocale( aLocale, aType );
- }
- return aRet;
-}
-
-OUString DefaultFontConfiguration::getUserInterfaceFont( const Locale& rLocale ) const
-{
- Locale aLocale = rLocale;
- if( ! aLocale.Language.getLength() )
- aLocale = Application::GetSettings().GetUILocale();
-
- OUString aUIFont = getDefaultFont( aLocale, DEFAULTFONT_UI_SANS );
-
- if( aUIFont.getLength() )
- return aUIFont;
-
- // fallback mechanism (either no configuration or no entry in configuration
-
- #define FALLBACKFONT_UI_SANS "Andale Sans UI;Albany;Albany AMT;Tahoma;Arial Unicode MS;Arial;Nimbus Sans L;Bitstream Vera Sans;gnu-unifont;Interface User;Geneva;WarpSans;Dialog;Swiss;Lucida;Helvetica;Charcoal;Chicago;MS Sans Serif;Helv;Times;Times New Roman;Interface System"
- #define FALLBACKFONT_UI_SANS_LATIN2 "Andale Sans UI;Albany;Albany AMT;Tahoma;Arial Unicode MS;Arial;Nimbus Sans L;Luxi Sans;Bitstream Vera Sans;Interface User;Geneva;WarpSans;Dialog;Swiss;Lucida;Helvetica;Charcoal;Chicago;MS Sans Serif;Helv;Times;Times New Roman;Interface System"
- #define FALLBACKFONT_UI_SANS_ARABIC "Tahoma;Traditional Arabic;Simplified Arabic;Lucidasans;Lucida Sans;Supplement;Andale Sans UI;clearlyU;Interface User;Arial Unicode MS;Lucida Sans Unicode;WarpSans;Geneva;MS Sans Serif;Helv;Dialog;Albany;Lucida;Helvetica;Charcoal;Chicago;Arial;Helmet;Interface System;Sans Serif"
- #define FALLBACKFONT_UI_SANS_THAI "OONaksit;Tahoma;Lucidasans;Arial Unicode MS"
- #define FALLBACKFONT_UI_SANS_KOREAN "SunGulim;BaekmukGulim;Gulim;Roundgothic;Arial Unicode MS;Lucida Sans Unicode;gnu-unifont;Andale Sans UI"
- #define FALLBACKFONT_UI_SANS_JAPANESE1 "HG-GothicB-Sun;Andale Sans UI;HG MhinchoLightJ"
- #define FALLBACKFONT_UI_SANS_JAPANESE2 "Kochi Gothic;Gothic"
- #define FALLBACKFONT_UI_SANS_CHINSIM "Andale Sans UI;Arial Unicode MS;ZYSong18030;AR PL SungtiL GB;AR PL KaitiM GB;SimSun;Lucida Sans Unicode;Fangsong;Hei;Song;Kai;Ming;gnu-unifont;Interface User;"
- #define FALLBACKFONT_UI_SANS_CHINTRD "Andale Sans UI;Arial Unicode MS;AR PL Mingti2L Big5;AR PL KaitiM Big5;Kai;PMingLiU;MingLiU;Ming;Lucida Sans Unicode;gnu-unifont;Interface User;"
-
- // we need localized names for japanese fonts
- static sal_Unicode const aMSGothic[] = { 0xFF2D, 0xFF33, ' ', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 };
- static sal_Unicode const aMSPGothic[] = { 0xFF2D, 0xFF33, ' ', 0xFF30, 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 };
- static sal_Unicode const aTLPGothic[] = { 0x0054, 0x004C, 0x0050, 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 };
- static sal_Unicode const aLXGothic[] = { 0x004C, 0x0058, 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 };
- static sal_Unicode const aKochiGothic[] = { 0x6771, 0x98A8, 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 };
-
- String aFallBackJapaneseLocalized( RTL_CONSTASCII_USTRINGPARAM( "MS UI Gothic;" ) );
- aFallBackJapaneseLocalized += String( RTL_CONSTASCII_USTRINGPARAM( FALLBACKFONT_UI_SANS_JAPANESE1 ) );
- aFallBackJapaneseLocalized += String( aMSPGothic );
- aFallBackJapaneseLocalized += String(RTL_CONSTASCII_USTRINGPARAM( ";" ) );
- aFallBackJapaneseLocalized += String( aMSGothic );
- aFallBackJapaneseLocalized += String(RTL_CONSTASCII_USTRINGPARAM( ";" ) );
- aFallBackJapaneseLocalized += String( aTLPGothic );
- aFallBackJapaneseLocalized += String(RTL_CONSTASCII_USTRINGPARAM( ";" ) );
- aFallBackJapaneseLocalized += String( aLXGothic );
- aFallBackJapaneseLocalized += String(RTL_CONSTASCII_USTRINGPARAM( ";" ) );
- aFallBackJapaneseLocalized += String( aKochiGothic );
- aFallBackJapaneseLocalized += String(RTL_CONSTASCII_USTRINGPARAM( ";" ) );
- aFallBackJapaneseLocalized += String(RTL_CONSTASCII_USTRINGPARAM( FALLBACKFONT_UI_SANS_JAPANESE2 ) );
- static const OUString aFallBackJapanese( aFallBackJapaneseLocalized );
- static const OUString aFallback (RTL_CONSTASCII_USTRINGPARAM(FALLBACKFONT_UI_SANS));
- static const OUString aFallbackLatin2 (RTL_CONSTASCII_USTRINGPARAM(FALLBACKFONT_UI_SANS_LATIN2));
- static const OUString aFallBackArabic (RTL_CONSTASCII_USTRINGPARAM( FALLBACKFONT_UI_SANS_ARABIC ) );
- static const OUString aFallBackThai (RTL_CONSTASCII_USTRINGPARAM( FALLBACKFONT_UI_SANS_THAI ) );
- static const OUString aFallBackChineseSIM (RTL_CONSTASCII_USTRINGPARAM( FALLBACKFONT_UI_SANS_CHINSIM ) );
- static const OUString aFallBackChineseTRD (RTL_CONSTASCII_USTRINGPARAM( FALLBACKFONT_UI_SANS_CHINTRD ) );
-
- // we need localized names for korean fonts
- static sal_Unicode const aSunGulim[] = { 0xC36C, 0xAD74, 0xB9BC, 0 };
- static sal_Unicode const aBaekmukGulim[] = { 0xBC31, 0xBC35, 0xAD74, 0xB9BC, 0 };
- String aFallBackKoreanLocalized( aSunGulim );
- aFallBackKoreanLocalized += String(RTL_CONSTASCII_USTRINGPARAM( ";" ) );
- aFallBackKoreanLocalized += String( aBaekmukGulim );
- aFallBackKoreanLocalized += String(RTL_CONSTASCII_USTRINGPARAM( ";" ) );
- aFallBackKoreanLocalized += String(RTL_CONSTASCII_USTRINGPARAM( FALLBACKFONT_UI_SANS_KOREAN ) );
- static const OUString aFallBackKorean( aFallBackKoreanLocalized );
-
- // optimize font list for some locales, as long as Andale Sans UI does not support them
- if( aLocale.Language.equalsAscii( "ar" ) ||
- aLocale.Language.equalsAscii( "he" ) ||
- aLocale.Language.equalsAscii( "iw" ) )
- {
- return aFallBackArabic;
- }
- else if( aLocale.Language.equalsAscii( "th" ) )
- {
- return aFallBackThai;
- }
- else if( aLocale.Language.equalsAscii( "ko" ) )
- {
- return aFallBackKorean;
- }
- else if( aLocale.Language.equalsAscii( "cs" ) ||
- aLocale.Language.equalsAscii( "hu" ) ||
- aLocale.Language.equalsAscii( "pl" ) ||
- aLocale.Language.equalsAscii( "ro" ) ||
- aLocale.Language.equalsAscii( "rm" ) ||
- aLocale.Language.equalsAscii( "hr" ) ||
- aLocale.Language.equalsAscii( "sk" ) ||
- aLocale.Language.equalsAscii( "sl" ) ||
- aLocale.Language.equalsAscii( "sb" ) )
- {
- return aFallbackLatin2;
- }
- else if( aLocale.Language.equalsAscii( "zh" ) )
- {
- if( ! aLocale.Country.equalsAscii( "cn" ) )
- return aFallBackChineseTRD;
- else
- return aFallBackChineseSIM;
- }
- else if( aLocale.Language.equalsAscii( "ja" ) )
- {
- return aFallBackJapanese;
- }
-
- return aFallback;
-}
-
-// ------------------------------------------------------------------------------------
-
-/*
- * FontSubstConfigItem::get
- */
-
-FontSubstConfiguration* FontSubstConfiguration::get()
-{
- ImplSVData* pSVData = ImplGetSVData();
- if( ! pSVData->maGDIData.mpFontSubstConfiguration )
- pSVData->maGDIData.mpFontSubstConfiguration = new FontSubstConfiguration();
- return pSVData->maGDIData.mpFontSubstConfiguration;
-}
-
-/*
- * FontSubstConfigItem::FontSubstConfigItem
- */
-
-FontSubstConfiguration::FontSubstConfiguration() :
- maSubstHash( 300 )
-{
- try
- {
- // get service provider
- Reference< XMultiServiceFactory > xSMgr( unohelper::GetMultiServiceFactory() );
- // create configuration hierachical access name
- if( xSMgr.is() )
- {
- try
- {
- m_xConfigProvider =
- Reference< XMultiServiceFactory >(
- xSMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider" ))),
- UNO_QUERY );
- if( m_xConfigProvider.is() )
- {
- Sequence< Any > aArgs(1);
- PropertyValue aVal;
- aVal.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) );
- aVal.Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.VCL/FontSubstitutions" ) );
- aArgs.getArray()[0] <<= aVal;
- m_xConfigAccess =
- Reference< XNameAccess >(
- m_xConfigProvider->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationAccess" )),
- aArgs ),
- UNO_QUERY );
- if( m_xConfigAccess.is() )
- {
- Sequence< OUString > aLocales = m_xConfigAccess->getElementNames();
- // fill config hash with empty interfaces
- int nLocales = aLocales.getLength();
- const OUString* pLocaleStrings = aLocales.getConstArray();
- Locale aLoc;
- for( int i = 0; i < nLocales; i++ )
- {
- sal_Int32 nIndex = 0;
- aLoc.Language = pLocaleStrings[i].getToken( 0, sal_Unicode('-'), nIndex ).toAsciiLowerCase();
- if( nIndex != -1 )
- aLoc.Country = pLocaleStrings[i].getToken( 0, sal_Unicode('-'), nIndex ).toAsciiUpperCase();
- else
- aLoc.Country = OUString();
- if( nIndex != -1 )
- aLoc.Variant = pLocaleStrings[i].getToken( 0, sal_Unicode('-'), nIndex ).toAsciiUpperCase();
- else
- aLoc.Variant = OUString();
- m_aSubst[ aLoc ] = LocaleSubst();
- m_aSubst[ aLoc ].aConfigLocaleString = pLocaleStrings[i];
- }
- }
- }
- }
- catch( Exception& )
- {
- // configuration is awry
- m_xConfigProvider.clear();
- m_xConfigAccess.clear();
- }
- }
- }
- catch( WrappedTargetException& )
- {
- }
- #if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "config provider: %s, config access: %s\n",
- m_xConfigProvider.is() ? "true" : "false",
- m_xConfigAccess.is() ? "true" : "false"
- );
- #endif
-}
-
-/*
- * FontSubstConfigItem::~FontSubstConfigItem
- */
-
-FontSubstConfiguration::~FontSubstConfiguration()
-{
- // release config access
- m_xConfigAccess.clear();
- // release config provider
- m_xConfigProvider.clear();
-}
-
-/*
- * FontSubstConfigItem::getMapName
- */
-// =======================================================================
-
-static const char* const aImplKillLeadingList[] =
-{
- "microsoft",
- "monotype",
- "linotype",
- "baekmuk",
- "adobe",
- "nimbus",
- "zycjk",
- "itc",
- "sun",
- "amt",
- "ms",
- "mt",
- "cg",
- "hg",
- "fz",
- "ipa",
- "sazanami",
- "kochi",
- NULL
-};
-
-// -----------------------------------------------------------------------
-
-static const char* const aImplKillTrailingList[] =
-{
- "microsoft",
- "monotype",
- "linotype",
- "adobe",
- "nimbus",
- "itc",
- "sun",
- "amt",
- "ms",
- "mt",
- "clm",
- // Scripts, for compatibility with older versions
- "we",
- "cyr",
- "tur",
- "wt",
- "greek",
- "wl",
- // CJK extensions
- "gb",
- "big5",
- "pro",
- "z01",
- "z02",
- "z03",
- "z13",
- "b01",
- "w3x12",
- // Old Printer Fontnames
- "5cpi",
- "6cpi",
- "7cpi",
- "8cpi",
- "9cpi",
- "10cpi",
- "11cpi",
- "12cpi",
- "13cpi",
- "14cpi",
- "15cpi",
- "16cpi",
- "18cpi",
- "24cpi",
- "scale",
- "pc",
- NULL
-};
-
-// -----------------------------------------------------------------------
-
-static const char* const aImplKillTrailingWithExceptionsList[] =
-{
- "ce", "monospace", "oldface", NULL,
- "ps", "caps", NULL,
- NULL
-};
-
-// -----------------------------------------------------------------------
-
-struct ImplFontAttrWeightSearchData
-{
- const char* mpStr;
- FontWeight meWeight;
-};
-
-static ImplFontAttrWeightSearchData const aImplWeightAttrSearchList[] =
-{
-// the attribute names are ordered by "first match wins"
-// e.g. "semilight" should wins over "semi"
-{ "extrablack", WEIGHT_BLACK },
-{ "ultrablack", WEIGHT_BLACK },
-{ "ultrabold", WEIGHT_ULTRABOLD },
-{ "semibold", WEIGHT_SEMIBOLD },
-{ "semilight", WEIGHT_SEMILIGHT },
-{ "semi", WEIGHT_SEMIBOLD },
-{ "demi", WEIGHT_SEMIBOLD },
-{ "black", WEIGHT_BLACK },
-{ "bold", WEIGHT_BOLD },
-{ "heavy", WEIGHT_BLACK },
-{ "ultralight", WEIGHT_ULTRALIGHT },
-{ "light", WEIGHT_LIGHT },
-{ "medium", WEIGHT_MEDIUM },
-{ NULL, WEIGHT_DONTKNOW },
-};
-
-// -----------------------------------------------------------------------
-
-struct ImplFontAttrWidthSearchData
-{
- const char* mpStr;
- FontWidth meWidth;
-};
-
-static ImplFontAttrWidthSearchData const aImplWidthAttrSearchList[] =
-{
-{ "narrow", WIDTH_CONDENSED },
-{ "semicondensed", WIDTH_SEMI_CONDENSED },
-{ "ultracondensed", WIDTH_ULTRA_CONDENSED },
-{ "semiexpanded", WIDTH_SEMI_EXPANDED },
-{ "ultraexpanded", WIDTH_ULTRA_EXPANDED },
-{ "expanded", WIDTH_EXPANDED },
-{ "wide", WIDTH_ULTRA_EXPANDED },
-{ "condensed", WIDTH_CONDENSED },
-{ "cond", WIDTH_CONDENSED },
-{ "cn", WIDTH_CONDENSED },
-{ NULL, WIDTH_DONTKNOW },
-};
-
-struct ImplFontAttrTypeSearchData
-{
- const char* mpStr;
- ULONG mnType;
-};
-
-static ImplFontAttrTypeSearchData const aImplTypeAttrSearchList[] =
-{
-{ "monotype", 0 },
-{ "linotype", 0 },
-{ "titling", IMPL_FONT_ATTR_TITLING },
-{ "captitals", IMPL_FONT_ATTR_CAPITALS },
-{ "captital", IMPL_FONT_ATTR_CAPITALS },
-{ "caps", IMPL_FONT_ATTR_CAPITALS },
-{ "italic", IMPL_FONT_ATTR_ITALIC },
-{ "oblique", IMPL_FONT_ATTR_ITALIC },
-{ "rounded", IMPL_FONT_ATTR_ROUNDED },
-{ "outline", IMPL_FONT_ATTR_OUTLINE },
-{ "shadow", IMPL_FONT_ATTR_SHADOW },
-{ "handwriting", IMPL_FONT_ATTR_HANDWRITING | IMPL_FONT_ATTR_SCRIPT },
-{ "hand", IMPL_FONT_ATTR_HANDWRITING | IMPL_FONT_ATTR_SCRIPT },
-{ "signet", IMPL_FONT_ATTR_HANDWRITING | IMPL_FONT_ATTR_SCRIPT },
-{ "script", IMPL_FONT_ATTR_BRUSHSCRIPT | IMPL_FONT_ATTR_SCRIPT },
-{ "calligraphy", IMPL_FONT_ATTR_CHANCERY | IMPL_FONT_ATTR_SCRIPT },
-{ "chancery", IMPL_FONT_ATTR_CHANCERY | IMPL_FONT_ATTR_SCRIPT },
-{ "corsiva", IMPL_FONT_ATTR_CHANCERY | IMPL_FONT_ATTR_SCRIPT },
-{ "gothic", IMPL_FONT_ATTR_SANSSERIF | IMPL_FONT_ATTR_GOTHIC },
-{ "schoolbook", IMPL_FONT_ATTR_SERIF | IMPL_FONT_ATTR_SCHOOLBOOK },
-{ "schlbk", IMPL_FONT_ATTR_SERIF | IMPL_FONT_ATTR_SCHOOLBOOK },
-{ "typewriter", IMPL_FONT_ATTR_TYPEWRITER | IMPL_FONT_ATTR_FIXED },
-{ "lineprinter", IMPL_FONT_ATTR_TYPEWRITER | IMPL_FONT_ATTR_FIXED },
-{ "monospaced", IMPL_FONT_ATTR_FIXED },
-{ "monospace", IMPL_FONT_ATTR_FIXED },
-{ "mono", IMPL_FONT_ATTR_FIXED },
-{ "fixed", IMPL_FONT_ATTR_FIXED },
-{ "sansserif", IMPL_FONT_ATTR_SANSSERIF },
-{ "sans", IMPL_FONT_ATTR_SANSSERIF },
-{ "swiss", IMPL_FONT_ATTR_SANSSERIF },
-{ "serif", IMPL_FONT_ATTR_SERIF },
-{ "bright", IMPL_FONT_ATTR_SERIF },
-{ "symbols", IMPL_FONT_ATTR_SYMBOL },
-{ "symbol", IMPL_FONT_ATTR_SYMBOL },
-{ "dingbats", IMPL_FONT_ATTR_SYMBOL },
-{ "dings", IMPL_FONT_ATTR_SYMBOL },
-{ "ding", IMPL_FONT_ATTR_SYMBOL },
-{ "bats", IMPL_FONT_ATTR_SYMBOL },
-{ "math", IMPL_FONT_ATTR_SYMBOL },
-{ "oldstyle", IMPL_FONT_ATTR_OTHERSTYLE },
-{ "oldface", IMPL_FONT_ATTR_OTHERSTYLE },
-{ "old", IMPL_FONT_ATTR_OTHERSTYLE },
-{ "new", 0 },
-{ "modern", 0 },
-{ "lucida", 0 },
-{ "regular", 0 },
-{ "extended", 0 },
-{ "extra", IMPL_FONT_ATTR_OTHERSTYLE },
-{ "ext", 0 },
-{ "scalable", 0 },
-{ "scale", 0 },
-{ "nimbus", 0 },
-{ "adobe", 0 },
-{ "itc", 0 },
-{ "amt", 0 },
-{ "mt", 0 },
-{ "ms", 0 },
-{ "cpi", 0 },
-{ "no", 0 },
-{ NULL, 0 },
-};
-
-// -----------------------------------------------------------------------
-
-static bool ImplKillLeading( String& rName, const char* const* ppStr )
-{
- for(; *ppStr; ++ppStr )
- {
- const char* pStr = *ppStr;
- const xub_Unicode* pNameStr = rName.GetBuffer();
- while ( (*pNameStr == (xub_Unicode)(unsigned char)*pStr) && *pStr )
- {
- pNameStr++;
- pStr++;
- }
- if ( !*pStr )
- {
- xub_StrLen nLen = sal::static_int_cast<xub_StrLen>(pNameStr - rName.GetBuffer());
- rName.Erase( 0, nLen );
- return true;
- }
- }
-
- // special case for Baekmuk
- // TODO: allow non-ASCII KillLeading list
- const xub_Unicode* pNameStr = rName.GetBuffer();
- if( (pNameStr[0]==0xBC31) && (pNameStr[1]==0xBC35) )
- {
- xub_StrLen nLen = (pNameStr[2]==0x0020) ? 3 : 2;
- rName.Erase( 0, nLen );
- return true;
- }
-
- return false;
-}
-
-// -----------------------------------------------------------------------
-
-static xub_StrLen ImplIsTrailing( const String& rName, const char* pStr )
-{
- xub_StrLen nStrLen = static_cast<xub_StrLen>( strlen( pStr ) );
- if( nStrLen >= rName.Len() )
- return 0;
-
- const xub_Unicode* pEndName = rName.GetBuffer() + rName.Len();
- const sal_Unicode* pNameStr = pEndName - nStrLen;
- do if( *(pNameStr++) != *(pStr++) )
- return 0;
- while( *pStr );
-
- return nStrLen;
-}
-
-// -----------------------------------------------------------------------
-
-static bool ImplKillTrailing( String& rName, const char* const* ppStr )
-{
- for(; *ppStr; ++ppStr )
- {
- xub_StrLen nTrailLen = ImplIsTrailing( rName, *ppStr );
- if( nTrailLen )
- {
- rName.Erase( rName.Len()-nTrailLen );
- return true;
- }
- }
-
- return false;
-}
-
-// -----------------------------------------------------------------------
-
-static bool ImplKillTrailingWithExceptions( String& rName, const char* const* ppStr )
-{
- for(; *ppStr; ++ppStr )
- {
- xub_StrLen nTrailLen = ImplIsTrailing( rName, *ppStr );
- if( nTrailLen )
- {
- // check string match against string exceptions
- while( *++ppStr )
- if( ImplIsTrailing( rName, *ppStr ) )
- return false;
-
- rName.Erase( rName.Len()-nTrailLen );
- return true;
- }
- else
- {
- // skip exception strings
- while( *++ppStr ) ;
- }
- }
-
- return false;
-}
-
-// -----------------------------------------------------------------------
-
-static BOOL ImplFindAndErase( String& rName, const char* pStr )
-{
- xub_StrLen nPos = rName.SearchAscii( pStr );
- if ( nPos == STRING_NOTFOUND )
- return FALSE;
-
- const char* pTempStr = pStr;
- while ( *pTempStr )
- pTempStr++;
- rName.Erase( nPos, (xub_StrLen)(pTempStr-pStr) );
- return TRUE;
-}
-
-// =======================================================================
-
-void FontSubstConfiguration::getMapName( const String& rOrgName, String& rShortName,
- String& rFamilyName, FontWeight& rWeight, FontWidth& rWidth, ULONG& rType )
-{
- rShortName = rOrgName;
-
- // TODO: get rid of the crazy O(N*strlen) searches below
- // they should be possible in O(strlen)
-
- // Kill leading vendor names and other unimportant data
- ImplKillLeading( rShortName, aImplKillLeadingList );
-
- // Kill trailing vendor names and other unimportant data
- ImplKillTrailing( rShortName, aImplKillTrailingList );
- ImplKillTrailingWithExceptions( rShortName, aImplKillTrailingWithExceptionsList );
-
- rFamilyName = rShortName;
-
- // Kill attributes from the name and update the data
- // Weight
- const ImplFontAttrWeightSearchData* pWeightList = aImplWeightAttrSearchList;
- while ( pWeightList->mpStr )
- {
- if ( ImplFindAndErase( rFamilyName, pWeightList->mpStr ) )
- {
- if ( (rWeight == WEIGHT_DONTKNOW) || (rWeight == WEIGHT_NORMAL) )
- rWeight = pWeightList->meWeight;
- break;
- }
- pWeightList++;
- }
-
- // Width
- const ImplFontAttrWidthSearchData* pWidthList = aImplWidthAttrSearchList;
- while ( pWidthList->mpStr )
- {
- if ( ImplFindAndErase( rFamilyName, pWidthList->mpStr ) )
- {
- if ( (rWidth == WIDTH_DONTKNOW) || (rWidth == WIDTH_NORMAL) )
- rWidth = pWidthList->meWidth;
- break;
- }
- pWidthList++;
- }
-
- // Type
- rType = 0;
- const ImplFontAttrTypeSearchData* pTypeList = aImplTypeAttrSearchList;
- while ( pTypeList->mpStr )
- {
- if ( ImplFindAndErase( rFamilyName, pTypeList->mpStr ) )
- rType |= pTypeList->mnType;
- pTypeList++;
- }
-
- // Remove numbers
- // TODO: also remove localized and fullwidth digits
- xub_StrLen i = 0;
- while ( i < rFamilyName.Len() )
- {
- sal_Unicode c = rFamilyName.GetChar( i );
- if ( (c >= 0x0030) && (c <= 0x0039) )
- rFamilyName.Erase( i, 1 );
- else
- i++;
- }
-}
-
-
-struct StrictStringSort : public ::std::binary_function< const FontNameAttr&, const FontNameAttr&, bool >
-{
- bool operator()( const FontNameAttr& rLeft, const FontNameAttr& rRight )
- { return rLeft.Name.CompareTo( rRight.Name ) == COMPARE_LESS ; }
-};
-
-static const char* const pAttribNames[] =
-{
- "default",
- "standard",
- "normal",
- "symbol",
- "fixed",
- "sansserif",
- "serif",
- "decorative",
- "special",
- "italic",
- "title",
- "capitals",
- "cjk",
- "cjk_jp",
- "cjk_sc",
- "cjk_tc",
- "cjk_kr",
- "ctl",
- "nonelatin",
- "full",
- "outline",
- "shadow",
- "rounded",
- "typewriter",
- "script",
- "handwriting",
- "chancery",
- "comic",
- "brushscript",
- "gothic",
- "schoolbook",
- "other"
-};
-
-struct enum_convert
-{
- const char* pName;
- int nEnum;
-};
-
-
-static const enum_convert pWeightNames[] =
-{
- { "normal", WEIGHT_NORMAL },
- { "medium", WEIGHT_MEDIUM },
- { "bold", WEIGHT_BOLD },
- { "black", WEIGHT_BLACK },
- { "semibold", WEIGHT_SEMIBOLD },
- { "light", WEIGHT_LIGHT },
- { "semilight", WEIGHT_SEMILIGHT },
- { "ultrabold", WEIGHT_ULTRABOLD },
- { "semi", WEIGHT_SEMIBOLD },
- { "demi", WEIGHT_SEMIBOLD },
- { "heavy", WEIGHT_BLACK },
- { "unknown", WEIGHT_DONTKNOW },
- { "thin", WEIGHT_THIN },
- { "ultralight", WEIGHT_ULTRALIGHT }
-};
-
-static const enum_convert pWidthNames[] =
-{
- { "normal", WIDTH_NORMAL },
- { "condensed", WIDTH_CONDENSED },
- { "expanded", WIDTH_EXPANDED },
- { "unknown", WIDTH_DONTKNOW },
- { "ultracondensed", WIDTH_ULTRA_CONDENSED },
- { "extracondensed", WIDTH_EXTRA_CONDENSED },
- { "semicondensed", WIDTH_SEMI_CONDENSED },
- { "semiexpanded", WIDTH_SEMI_EXPANDED },
- { "extraexpanded", WIDTH_EXTRA_EXPANDED },
- { "ultraexpanded", WIDTH_ULTRA_EXPANDED }
-};
-
-void FontSubstConfiguration::fillSubstVector( const com::sun::star::uno::Reference< XNameAccess > xFont,
- const rtl::OUString& rType,
- std::vector< String >& rSubstVector ) const
-{
- try
- {
- Any aAny = xFont->getByName( rType );
- if( aAny.getValueTypeClass() == TypeClass_STRING )
- {
- const OUString* pLine = (const OUString*)aAny.getValue();
- sal_Int32 nIndex = 0;
- sal_Int32 nLength = pLine->getLength();
- if( nLength )
- {
- const sal_Unicode* pStr = pLine->getStr();
- sal_Int32 nTokens = 0;
- // count tokens
- while( nLength-- )
- {
- if( *pStr++ == sal_Unicode(';') )
- nTokens++;
- }
- rSubstVector.clear();
- // optimize performance, heap fragmentation
- rSubstVector.reserve( nTokens );
- while( nIndex != -1 )
- {
- OUString aSubst( pLine->getToken( 0, ';', nIndex ) );
- if( aSubst.getLength() )
- {
- UniqueSubstHash::iterator aEntry = maSubstHash.find( aSubst );
- if (aEntry != maSubstHash.end())
- aSubst = *aEntry;
- else
- maSubstHash.insert( aSubst );
- rSubstVector.push_back( aSubst );
- }
- }
- }
- }
- }
- catch( NoSuchElementException )
- {
- }
- catch( WrappedTargetException )
- {
- }
-}
-
-FontWeight FontSubstConfiguration::getSubstWeight( const com::sun::star::uno::Reference< XNameAccess > xFont,
- const rtl::OUString& rType ) const
-{
- int weight = -1;
- try
- {
- Any aAny = xFont->getByName( rType );
- if( aAny.getValueTypeClass() == TypeClass_STRING )
- {
- const OUString* pLine = (const OUString*)aAny.getValue();
- if( pLine->getLength() )
- {
- for( weight=sizeof(pWeightNames)/sizeof(pWeightNames[0])-1; weight >= 0; weight-- )
- if( pLine->equalsIgnoreAsciiCaseAscii( pWeightNames[weight].pName ) )
- break;
- }
-#if OSL_DEBUG_LEVEL > 1
- if( weight < 0 )
- fprintf( stderr, "Error: invalid weight %s\n",
- OUStringToOString( *pLine, RTL_TEXTENCODING_ASCII_US ).getStr() );
-#endif
- }
- }
- catch( NoSuchElementException )
- {
- }
- catch( WrappedTargetException )
- {
- }
- return (FontWeight)( weight >= 0 ? pWeightNames[weight].nEnum : WEIGHT_DONTKNOW );
-}
-
-FontWidth FontSubstConfiguration::getSubstWidth( const com::sun::star::uno::Reference< XNameAccess > xFont,
- const rtl::OUString& rType ) const
-{
- int width = -1;
- try
- {
- Any aAny = xFont->getByName( rType );
- if( aAny.getValueTypeClass() == TypeClass_STRING )
- {
- const OUString* pLine = (const OUString*)aAny.getValue();
- if( pLine->getLength() )
- {
- for( width=sizeof(pWidthNames)/sizeof(pWidthNames[0])-1; width >= 0; width-- )
- if( pLine->equalsIgnoreAsciiCaseAscii( pWidthNames[width].pName ) )
- break;
- }
-#if OSL_DEBUG_LEVEL > 1
- if( width < 0 )
- fprintf( stderr, "Error: invalid width %s\n",
- OUStringToOString( *pLine, RTL_TEXTENCODING_ASCII_US ).getStr() );
-#endif
- }
- }
- catch( NoSuchElementException )
- {
- }
- catch( WrappedTargetException )
- {
- }
- return (FontWidth)( width >= 0 ? pWidthNames[width].nEnum : WIDTH_DONTKNOW );
-}
-
-unsigned long FontSubstConfiguration::getSubstType( const com::sun::star::uno::Reference< XNameAccess > xFont,
- const rtl::OUString& rType ) const
-{
- unsigned long type = 0;
- try
- {
- Any aAny = xFont->getByName( rType );
- if( aAny.getValueTypeClass() == TypeClass_STRING )
- {
- const OUString* pLine = (const OUString*)aAny.getValue();
- if( pLine->getLength() )
- {
- sal_Int32 nIndex = 0;
- while( nIndex != -1 )
- {
- String aToken( pLine->getToken( 0, ',', nIndex ) );
- for( int k = 0; k < 32; k++ )
- if( aToken.EqualsIgnoreCaseAscii( pAttribNames[k] ) )
- {
- type |= 1 << k;
- break;
- }
- }
- }
- }
- }
- catch( NoSuchElementException )
- {
- }
- catch( WrappedTargetException )
- {
- }
-
- return type;
-}
-
-void FontSubstConfiguration::readLocaleSubst( const com::sun::star::lang::Locale& rLocale ) const
-{
- std::hash_map< Locale, LocaleSubst, LocaleHash >::const_iterator it =
- m_aSubst.find( rLocale );
- if( it != m_aSubst.end() )
- {
- if( ! it->second.bConfigRead )
- {
- it->second.bConfigRead = true;
- Reference< XNameAccess > xNode;
- try
- {
- Any aAny = m_xConfigAccess->getByName( it->second.aConfigLocaleString );
- aAny >>= xNode;
- }
- catch( NoSuchElementException )
- {
- }
- catch( WrappedTargetException )
- {
- }
- if( xNode.is() )
- {
- Sequence< OUString > aFonts = xNode->getElementNames();
- int nFonts = aFonts.getLength();
- const OUString* pFontNames = aFonts.getConstArray();
- // improve performance, heap fragmentation
- it->second.aSubstAttributes.reserve( nFonts );
-
- // strings for subst retrieval, construct only once
- OUString aSubstFontsStr ( RTL_CONSTASCII_USTRINGPARAM( "SubstFonts" ) );
- OUString aSubstFontsMSStr ( RTL_CONSTASCII_USTRINGPARAM( "SubstFontsMS" ) );
- OUString aSubstFontsPSStr ( RTL_CONSTASCII_USTRINGPARAM( "SubstFontsPS" ) );
- OUString aSubstFontsHTMLStr ( RTL_CONSTASCII_USTRINGPARAM( "SubstFontsHTML" ) );
- OUString aSubstWeightStr ( RTL_CONSTASCII_USTRINGPARAM( "FontWeight" ) );
- OUString aSubstWidthStr ( RTL_CONSTASCII_USTRINGPARAM( "FontWidth" ) );
- OUString aSubstTypeStr ( RTL_CONSTASCII_USTRINGPARAM( "FontType" ) );
- for( int i = 0; i < nFonts; i++ )
- {
- Reference< XNameAccess > xFont;
- try
- {
- Any aAny = xNode->getByName( pFontNames[i] );
- aAny >>= xFont;
- }
- catch( NoSuchElementException )
- {
- }
- catch( WrappedTargetException )
- {
- }
- if( ! xFont.is() )
- {
- #if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "did not get font attributes for %s\n",
- OUStringToOString( pFontNames[i], RTL_TEXTENCODING_UTF8 ).getStr() );
- #endif
- continue;
- }
-
- FontNameAttr aAttr;
- // read subst attributes from config
- aAttr.Name = pFontNames[i];
- fillSubstVector( xFont, aSubstFontsStr, aAttr.Substitutions );
- fillSubstVector( xFont, aSubstFontsMSStr, aAttr.MSSubstitutions );
- fillSubstVector( xFont, aSubstFontsPSStr, aAttr.PSSubstitutions );
- fillSubstVector( xFont, aSubstFontsHTMLStr, aAttr.HTMLSubstitutions );
- aAttr.Weight = getSubstWeight( xFont, aSubstWeightStr );
- aAttr.Width = getSubstWidth( xFont, aSubstWidthStr );
- aAttr.Type = getSubstType( xFont, aSubstTypeStr );
-
- // finally insert this entry
- it->second.aSubstAttributes.push_back( aAttr );
- }
- std::sort( it->second.aSubstAttributes.begin(), it->second.aSubstAttributes.end(), StrictStringSort() );
- }
- }
- }
-}
-
-const FontNameAttr* FontSubstConfiguration::getSubstInfo( const String& rFontName, const Locale& rLocale ) const
-{
- if( !rFontName.Len() )
- return NULL;
-
- // search if a (language dep.) replacement table for the given font exists
- // fallback is english
- String aSearchFont( rFontName );
- aSearchFont.ToLowerAscii();
- FontNameAttr aSearchAttr;
- aSearchAttr.Name = aSearchFont;
-
- Locale aLocale;
- aLocale.Language = rLocale.Language.toAsciiLowerCase();
- aLocale.Country = rLocale.Country.toAsciiUpperCase();
- aLocale.Variant = rLocale.Variant.toAsciiUpperCase();
-
- if( ! aLocale.Language.getLength() )
- aLocale = Application::GetSettings().GetUILocale();
-
- while( aLocale.Language.getLength() )
- {
- std::hash_map< Locale, LocaleSubst, LocaleHash >::const_iterator lang = m_aSubst.find( aLocale );
- if( lang != m_aSubst.end() )
- {
- if( ! lang->second.bConfigRead )
- readLocaleSubst( aLocale );
- // try to find an exact match
- // because the list is sorted this will also find fontnames of the form searchfontname*
- std::vector< FontNameAttr >::const_iterator it = ::std::lower_bound( lang->second.aSubstAttributes.begin(), lang->second.aSubstAttributes.end(), aSearchAttr, StrictStringSort() );
- if( it != lang->second.aSubstAttributes.end() && aSearchFont.CompareTo( it->Name, aSearchFont.Len() ) == COMPARE_EQUAL )
- return &(*it);
- }
- // gradually become more unspecific
- if( aLocale.Variant.getLength() )
- aLocale.Variant = OUString();
- else if( aLocale.Country.getLength() )
- aLocale.Country = OUString();
- else if( ! aLocale.Language.equalsAscii( "en" ) )
- aLocale.Language = OUString( RTL_CONSTASCII_USTRINGPARAM( "en" ) );
- else
- aLocale.Language = OUString();
- }
- return NULL;
-}
-
-/*
- * SettingsConfigItem::get
- */
-
-SettingsConfigItem* SettingsConfigItem::get()
-{
- ImplSVData* pSVData = ImplGetSVData();
- if( ! pSVData->mpSettingsConfigItem )
- pSVData->mpSettingsConfigItem = new SettingsConfigItem();
- return pSVData->mpSettingsConfigItem;
-}
-
-/*
- * SettignsConfigItem constructor
- */
-
-SettingsConfigItem::SettingsConfigItem()
- :
- ConfigItem( OUString( RTL_CONSTASCII_USTRINGPARAM( SETTINGS_CONFIGNODE ) ),
- CONFIG_MODE_DELAYED_UPDATE ),
- m_aSettings( 0 )
-{
- getValues();
-}
-
-/*
- * SettingsConfigItem destructor
- */
-
-SettingsConfigItem::~SettingsConfigItem()
-{
- if( IsModified() )
- Commit();
-}
-
-/*
- * SettingsConfigItem::Commit
- */
-
-void SettingsConfigItem::Commit()
-{
- if( ! IsValidConfigMgr() )
- return;
-
- std::hash_map< OUString, SmallOUStrMap, rtl::OUStringHash >::const_iterator group;
-
- for( group = m_aSettings.begin(); group != m_aSettings.end(); ++group )
- {
- String aKeyName( group->first );
- /*sal_Bool bAdded =*/ AddNode( OUString(), aKeyName );
- Sequence< PropertyValue > aValues( group->second.size() );
- PropertyValue* pValues = aValues.getArray();
- int nIndex = 0;
- SmallOUStrMap::const_iterator it;
- for( it = group->second.begin(); it != group->second.end(); ++it )
- {
- String aName( aKeyName );
- aName.Append( '/' );
- aName.Append( String( it->first ) );
- pValues[nIndex].Name = aName;
- pValues[nIndex].Handle = 0;
- pValues[nIndex].Value <<= it->second;
- pValues[nIndex].State = PropertyState_DIRECT_VALUE;
- nIndex++;
- }
- ReplaceSetProperties( aKeyName, aValues );
- }
-}
-
-/*
- * SettingsConfigItem::Notify
- */
-
-void SettingsConfigItem::Notify( const Sequence< OUString >& )
-{
- getValues();
-}
-
-/*
- * SettingsConfigItem::getValues
- */
-void SettingsConfigItem::getValues()
-{
- if( ! IsValidConfigMgr() )
- return;
-
- m_aSettings.clear();
-
- Sequence< OUString > aNames( GetNodeNames( OUString() ) );
- m_aSettings.resize( aNames.getLength() );
-
- for( int j = 0; j < aNames.getLength(); j++ )
- {
-#if OSL_DEBUG_LEVEL > 2
- fprintf( stderr, "found settings data for \"%s\"\n",
- OUStringToOString( aNames.getConstArray()[j], RTL_TEXTENCODING_ASCII_US ).getStr()
- );
-#endif
- String aKeyName( aNames.getConstArray()[j] );
- Sequence< OUString > aKeys( GetNodeNames( aKeyName ) );
- Sequence< OUString > aSettingsKeys( aKeys.getLength() );
- const OUString* pFrom = aKeys.getConstArray();
- OUString* pTo = aSettingsKeys.getArray();
- for( int m = 0; m < aKeys.getLength(); m++ )
- {
- String aName( aKeyName );
- aName.Append( '/' );
- aName.Append( String( pFrom[m] ) );
- pTo[m] = aName;
- }
- Sequence< Any > aValues( GetProperties( aSettingsKeys ) );
- const Any* pValue = aValues.getConstArray();
- for( int i = 0; i < aValues.getLength(); i++, pValue++ )
- {
- if( pValue->getValueTypeClass() == TypeClass_STRING )
- {
- const OUString* pLine = (const OUString*)pValue->getValue();
- if( pLine->getLength() )
- m_aSettings[ aKeyName ][ pFrom[i] ] = *pLine;
-#if OSL_DEBUG_LEVEL > 2
- fprintf( stderr, " \"%s\"=\"%.30s\"\n",
- OUStringToOString( aKeys.getConstArray()[i], RTL_TEXTENCODING_ASCII_US ).getStr(),
- OUStringToOString( *pLine, RTL_TEXTENCODING_ASCII_US ).getStr()
- );
-#endif
- }
- }
- }
-}
-
-/*
- * SettingsConfigItem::getDefaultFont
- */
-
-const OUString& SettingsConfigItem::getValue( const OUString& rGroup, const OUString& rKey ) const
-{
- ::std::hash_map< OUString, SmallOUStrMap, rtl::OUStringHash >::const_iterator group = m_aSettings.find( rGroup );
- if( group == m_aSettings.end() || group->second.find( rKey ) == group->second.end() )
- {
- static OUString aEmpty;
- return aEmpty;
- }
- return group->second.find(rKey)->second;
-}
-
-/*
- * SettingsConfigItem::setDefaultFont
- */
-
-void SettingsConfigItem::setValue( const OUString& rGroup, const OUString& rKey, const OUString& rValue )
-{
- bool bModified = m_aSettings[ rGroup ][ rKey ] != rValue;
- if( bModified )
- {
- m_aSettings[ rGroup ][ rKey ] = rValue;
- SetModified();
- }
-}
-
diff --git a/vcl/source/gdi/fontcvt.cxx b/vcl/source/gdi/fontcvt.cxx
deleted file mode 100644
index 565c92740dad..000000000000
--- a/vcl/source/gdi/fontcvt.cxx
+++ /dev/null
@@ -1,1528 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: fontcvt.cxx,v $
- * $Revision: 1.24 $
- *
- * 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 <vcl/fontcvt.hxx>
-#include <vcl/outdev.h>
-
-#ifndef _STLP_MAP
-#include <map>
-#endif
-#ifndef _STLP_VECTOR
-#include <vector>
-#endif
-#ifndef _STLP_ALGORITHM
-#include <algorithm>
-#endif
-#ifndef _STLP_FUNCTIONAL
-#include <functional>
-#endif
-
-//=======================================================================
-// note: the character mappings that are only approximations
-// are marked (with an empty comment)
-
-static const sal_Unicode aStarBatsTab[224] =
-{
- // F020
- 0x0020, 0x263a, 0x25cf, 0x274d,
- 0x25a0, 0x25a1, 0xE000, 0x2751,
- 0x2752, 0xE001, 0xE002, 0xE003,
- 0x2756, 0xE004, 0xE005, 0x27a2,
- // F030
- 0xE006, 0x2794, 0x2713, 0x2612,
- 0x2611, 0x27b2, 0x261b, 0x270d,
- 0x270e, 0xE007, 0x2714, 0xE008,
- 0xE009, 0xE00A, 0x274f, 0x2750,
- // F040
- 0xE00B, 0xE00C, 0xE00D, 0xE00E,
- 0x2722, 0x2723, 0x2724, 0x2725,
- 0x2733, 0x2734, 0x2735, 0x2736,
- 0x2737, 0x2738, 0x2739, 0x2717,
- // F050
- 0x2718, 0x2719, 0x271a, 0x271b,
- 0x271c, 0x272b, 0x272c, 0x272d,
- 0x272e, 0x272f, 0x2730, 0,
- 0xE00F, 0x278a, 0x278b, 0x278c,
- // F060
- 0x278d, 0x278e, 0x278f, 0x2790,
- 0x2791, 0x2792, 0x2793, 0xE010,
- 0x2780, 0x2781, 0x2782, 0x2783,
- 0x2784, 0x2785, 0x2786, 0x2787,
- // F070
- 0x2788, 0x2789, 0xE011, 0xE012,
- 0x260e, 0xE013, 0xE014, 0xE015,
- 0xE016, 0xE017, 0xE018, 0xE019,
- 0xE01A, 0x261e, 0xE01B, 0,
- // F080
- 0x20ac, 0, 0x201a, 0x0192,
- 0x201e, 0x2026, 0x2020, 0x2021,
- 0xE01c, 0x2030, 0x0160, 0x2039,
- 0x0152, 0, 0x017d, 0,
- // F090
- 0, 0x2018, 0x2019, 0x201c,
- 0x201d, 0x2022, 0x2013, 0x2014,
- 0xE01d, 0x2122, 0x0161, 0x203a,
- 0x0153, 0, 0x017e, 0x0178,
- // F0A0
- 0, 0x21e7, 0x21e8, 0x21e9,
- 0x21e6, 0xE01e, 0xE01f, 0x00a7,
- 0xE020, 0xE021, 0xE022, 0x00ab,
- 0xE023, 0x2639, 0xE024, 0xE025,
- // F0B0
- 0xE026, 0xE027, 0xE028, 0x21e5,
- 0x21e4, 0x2192, 0x2193, 0x2190,
- 0x2191, 0xE029, 0xE02a, 0x00bb,
- 0xE02b, 0xE02c, 0xE02d, 0xE02e,
- // F0C0
- 0xE02f, 0xE030, 0xE031, 0xE032,
- 0x25be, 0x25b4, 0x25bf, 0x25b5,
- 0xE033, 0xE034, 0xE035, 0x2702,
- 0x2708, 0x2721, 0x273f, 0x2744,
- // F0D0
- 0x25d7, 0x2759, 0xE036, 0xE037,
- 0x2762, 0x2663, 0x2665, 0x2660,
- 0x2194, 0x2195, 0x2798, 0x279a,
- 0x27b8, 0, 0x00b6, 0,
- // F0E0
- 0x00a2, 0x00a4, 0x00a5, 0xE038,
- 0x20a1, 0x20a2, 0x20a3, 0x20a4,
- 0x20a9, 0x20ab, 0x20a8, 0xE039,
- 0, 0, 0, 0,
- // F0F0
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0xE03a
-};
-
-// -----------------------------------------------------------------------
-
-static const sal_Unicode aStarMathTab[224] =
-{
- // F020
- 0x0020, 0x0021, 0x0022, 0x0023,
- 0xE080, 0x0025, 0x0026, 0x221e,
- 0x0028, 0x0029, 0x002a, 0x002b,
- 0x002c, 0x002d, 0x002e, 0x002f,
- // F030
- 0x2224, 0x21d2, 0x21d0, 0x21d4,
- 0xE081, 0xE082, 0x00b0, 0,
- 0, 0, 0x003a, 0x003b,
- 0x003c, 0x003d, 0x003e, 0x00bf,
- // F040
- 0x2260, 0xE083, 0x2212, 0x2217,
- 0x00d7, 0x22c5, 0x00f7, 0x00b1,
- 0x2213, 0x2295, 0x2296, 0x2297,
- 0x2298, 0x2299, 0x222a, 0x2229,
- // F050
- 0xE084, 0xE085, 0x2264, 0x2265,
- 0xE086, 0xE087, 0x226a, 0x226b,
- 0x007e, 0x2243, 0x2248, 0x225d,
- 0x2261, 0x221d, 0x2202, 0x2282,
- // F060
- 0x2283, 0x2286, 0x2287, 0x2284,
- 0x2285, 0x2288, 0x2289, 0x2208,
- 0x2209, 0xE089, 0x2203, 0x220d,
- 0x2135, 0x2111, 0x211c, 0x2118,
- // F070
- 0xE08a, 0x2221, 0x2222, 0x2223,
- 0x2225, 0x22a5, 0xE08b, 0x22ef,
- 0x22ee, 0x22f0, 0x22f1, 0x22b6,
- 0x22b7, 0xE08c, 0x2216, 0x00ac,
- // F080
- 0x222b, 0x222c, 0x222d, 0x222e,
- 0x222f, 0x2230, 0x221a, 0xE08d,
- 0xE08e, 0xE08f, 0x2210, 0x220f,
- 0x2211, 0x2207, 0x2200, 0xE090,
- // F090
- 0xE091, 0xE092, 0xE093, 0xE094,
- 0xE095, 0xE096, 0xE097, 0xE098,
- 0x02d9, 0x00a8, 0xE09b, 0x02da,
- 0x2227, 0x2228, 0x220b, 0x2205,
- // F0A0
- 0x007b, 0x007d, 0xe09e, 0xe09f,
- 0x2329, 0x232a, 0x005b, 0x005d,
- 0xE0a0, 0x22be, 0xE0a1, 0x2259,
- 0x2254, 0x2255, 0x21b3, 0x2197,
- // F0B0
- 0x2198, 0x2245, 0x301a, 0x301b,
- 0x2373, 0xE0a5, 0xE0a6, 0x22a4,
- 0x2112, 0x2130, 0x2131, 0,
- 0xE0a7, 0xE0a8, 0xE0a9, 0xE0aa,
- // F0C0
- 0x2308, 0x230a, 0x2309, 0x230b,
- 0, 0xe0ab, 0xe0ac, 0xe0ad,
- 0xe0ae, 0xe0af, 0xe0b0, 0xe0b1,
- 0xe0b2, 0xe0b3, 0xe0b4, 0xe0b5,
- // F0D0
- 0xe0b6, 0xe0b7, 0xe0b8, 0xe0b9,
- 0xe0ba, 0xe0bb, 0xe0bc, 0xe0bd,
- 0xe0be, 0xe0bf, 0xe0c0, 0xe0c1,
- 0xe0c2, 0xe0c3, 0xe0c4, 0xe0c5,
- // F0E0
- 0xe0c6, 0xe0c7, 0xe0c8, 0xe0c9,
- 0xe0ca, 0xe0cb, 0xe0cc, 0xe0cd,
- 0xe0ce, 0xe0cf, 0xe0d0, 0xe0d1,
- 0x03f1, 0xe0d3, 0xe0d4, 0xe0d5,
- // F0F0
- 0x2113, 0xe0d6, 0x2107, 0x2127,
- 0x210a, 0xe0d9, 0x210f, 0x019b,
- 0xe0db, 0xe0dc, 0xe0dd, 0x2115,
- 0x2124, 0x211a, 0x211d, 0x2102
-};
-
-// -----------------------------------------------------------------------
-
-static const sal_Unicode aWingDingsTab[224] =
-{
- // F020
- 0x0020, 0xe400, 0xe401, 0xe402,
- 0xe403, 0xe404, 0xe405, 0xe406,
- 0xe407, 0xe408, 0xe409, 0xe40a,
- 0xe40b, 0xe40c, 0xe40d, 0xe40e,
- // F030
- 0xe40f, 0xe410, 0xe411, 0xe412,
- 0xe413, 0xe414, 0xe415, 0xe416,
- 0xe417, 0xe418, 0xe419, 0xe41a,
- 0xe41b, 0xe41c, 0x2707, 0xe41d,
- // F040
- 0xe41e, 0xe41f, 0xe420, 0xe421,
- 0x261c, 0xe423, 0x261d, 0x261f,
- 0x261f, 0xe424, 0xe425, 0xe426,
- 0xe427, 0xe428, 0xe429, 0xe42a,
- // F050
- 0xe42b, 0xe42c, 0x263c, 0xe42d,
- 0xe42e, 0xe42f, 0xe430, 0xe431,
- 0xe432, 0xe433, 0x262a, 0x262f,
- 0x0950, 0xe434, 0x2648, 0x2649,
- // F060
- 0x264a, 0x264b, 0x264c, 0x264d,
- 0x264e, 0x264f, 0x2650, 0x2651,
- 0x2652, 0x2653, 0xe435, 0xe436,
- 0xe437, 0xe438, 0xe439, 0xe43a,
- // F070
- 0xe43b, 0xe43c, 0xe43d, 0xe43e,
- 0xe43f, 0xe440, 0xe441, 0xe442,
- 0xe443, 0x2353, 0x2318, 0xe444,
- 0xe445, 0xe446, 0xe447, 0,
- // F080
- 0xe448, 0xe449, 0xe44a, 0xe44b,
- 0xe44c, 0xe44d, 0xe44e, 0xe44f,
- 0xe450, 0xe451, 0xe452, 0xe453,
- 0xe454, 0xe455, 0xe456, 0xe457,
- // F090
- 0xe458, 0xe459, 0xe45a, 0xe45b,
- 0xe45c, 0xe45d, 0xe45e, 0xe45f,
- 0xe460, 0xe461, 0xe462, 0xe463,
- 0xe464, 0xe465, 0xe466, 0xe467,
- // F0a0
- 0xe468, 0xe469, 0xe46a, 0xe46b,
- 0xe46c, 0xe46d, 0xe46e, 0xe46f,
- 0xe470, 0xe471, 0xe472, 0xe473,
- 0xe474, 0xe475, 0xe476, 0xe477,
- // F0b0
- 0xe478, 0xe479, 0xe47a, 0xe47b,
- 0xe47c, 0xe47d, 0xe47e, 0xe47f,
- 0xe480, 0xe481, 0xe482, 0xe483,
- 0xe484, 0xe485, 0xe486, 0xe487,
- // F0c0
- 0xe488, 0xe489, 0xe48a, 0xe48b,
- 0xe48c, 0xe48d, 0xe48e, 0xe48f,
- 0xe490, 0xe491, 0xe492, 0xe493,
- 0xe494, 0xe495, 0xe496, 0xe497,
- // F0d0
- 0xe498, 0xe499, 0xe49a, 0xe49b,
- 0xe49c, 0x232b, 0x2326, 0xe49d,
- 0xe49e, 0xe49f, 0xe4a0, 0xe4a1,
- 0xe4a2, 0xe4a3, 0xe4a4, 0xe4a5,
- // F0e0
- 0xe4a6, 0xe4a7, 0xe4a8, 0xe4a9,
- 0xe4aa, 0xe4ab, 0xe4ac, 0xe4ad,
- 0xe4ae, 0xe4af, 0xe4b0, 0xe4b1,
- 0xe4b2, 0xe4b3, 0xe4b4, 0xe4b5,
- // F0f0
- 0xe4b6, 0xe4b7, 0xe4b8, 0xe4b9,
- 0xe4ba, 0xe4bb, 0xe4bc, 0xe4bd,
- 0xe4be, 0xe4bf, 0xe4c0, 0xe4c1,
- 0xe4c2, 0xe4c3, 0xe4c4, 0xe4c5
-};
-
-// -----------------------------------------------------------------------
-
-static const sal_Unicode aWingDings2Tab[224] =
-{
- // F020
- 0x0020, 0xe500, 0xe501, 0xe502,
- 0xe503, 0xe504, 0xe505, 0xe506,
- 0xe507, 0xe508, 0xe509, 0xe50a,
- 0xe50b, 0xe50c, 0xe50d, 0xe50e,
- // F030
- 0xe50f, 0xe510, 0xe511, 0xe512,
- 0xe513, 0xe514, 0xe515, 0xe516,
- 0xe517, 0xe518, 0xe519, 0xe51a,
- 0xe51b, 0xe51c, 0xe51d, 0xe51e,
- // F040
- 0xe51f, 0xe520, 0xe521, 0xe522,
- 0xe523, 0xe524, 0xe525, 0xe526,
- 0xe527, 0xe528, 0xe529, 0xe52a,
- 0xe52b, 0xe52c, 0xe52d, 0xe52e,
- // F050
- 0xe52f, 0xe530, 0xe531, 0xe532,
- 0xe533, 0xe534, 0xe535, 0xe536,
- 0xe537, 0xe538, 0xe539, 0xe53a,
- 0xe53b, 0xe53c, 0xe53d, 0xe53e,
- // F060
- 0xe53f, 0xe540, 0xe541, 0xe542,
- 0xe543, 0xe544, 0xe545, 0xe546,
- 0xe547, 0xe548, 0xe549, 0xe54a,
- 0xe54b, 0xe54c, 0xe54d, 0xe54e,
- // F070
- 0xe54e, 0xe54f, 0xe550, 0xe551,
- 0xe552, 0xe553, 0xe554, 0xe555,
- 0xe556, 0xe557, 0xe558, 0xe559,
- 0xe55a, 0xe55b, 0xe55c, 0,
- // F080
- 0x2609, 0x25cb, 0x263d, 0x263e,
- 0xe55d, 0xe55e, 0xe55f, 0xe560,
- 0xe561, 0xe562, 0xe563, 0xe564,
- 0xe565, 0xe566, 0xe567, 0xe568,
- // F090
- 0xe569, 0xe56a, 0xe56b, 0xe56c,
- 0xe56d, 0xe56e, 0xe56f, 0xe570,
- 0xe571, 0xe572, 0xe573, 0xe574,
- 0xe575, 0xe576, 0xe577, 0xe578,
- // F0a0
- 0xe579, 0xe57a, 0xe57b, 0xe57c,
- 0xe57d, 0xe57e, 0xe57f, 0xe580,
- 0xe581, 0xe582, 0xe583, 0xe584,
- 0xe585, 0xe586, 0xe587, 0xe588,
- // F0b0
- 0xe589, 0xe58a, 0xe58b, 0xe58c,
- 0xe58d, 0xe58e, 0xe58f, 0xe590,
- 0xe591, 0xe592, 0xe593, 0xe594,
- 0xe595, 0xe596, 0xe597, 0xe598,
- // F0c0
- 0xe599, 0xe59a, 0xe59b, 0xe59c,
- 0xe59d, 0xe59e, 0xe59f, 0xe5a0,
- 0xe5a1, 0xe5a2, 0xe5a3, 0xe5a4,
- 0xe5a5, 0xe5a6, 0xe5a7, 0xe5a8,
- // F0d0
- 0xe5a9, 0xe5aa, 0xe5ab, 0xe5ac,
- 0xe5ad, 0xe5ae, 0xe5af, 0xe5b0,
- 0xe5b1, 0xe5b2, 0xe5b3, 0xe5b4,
- 0xe5b5, 0xe5b6, 0xe5b7, 0xe5b8,
- // F0e0
- 0xe5b9, 0xe5ba, 0xe5bb, 0xe5bc,
- 0xe5bd, 0xe5be, 0xe5bf, 0xe5c0,
- 0xe5c1, 0xe5c2, 0xe5c3, 0xe5c4,
- 0xe5c5, 0xe5c6, 0xe5c7, 0xe5c8,
- // F0f0
- 0xe5c9, 0xe5ca, 0xe5cb, 0xe5cc,
- 0xe5cd, 0xe5ce, 0xe5cf, 0xe5d0,
- 0x203b, 0x2042, 0, 0,
- 0, 0, 0, 0
-};
-
-// -----------------------------------------------------------------------
-
-static const sal_Unicode aWingDings3Tab[224] =
-{
- // F020
- 0x0020, 0xe600, 0xe601, 0xe602,
- 0xe603, 0x2196, 0xe604, 0x2199,
- 0xe605, 0xe606, 0xe607, 0xe608,
- 0xe609, 0xe60a, 0xe60b, 0x21de,
- // F030
- 0x21df, 0xe60c, 0xe60d, 0xe60e,
- 0x21e2, 0x21e1, 0x21e3, 0x21af,
- 0x21b5, 0xe60f, 0xe610, 0xe611,
- 0xe612, 0xe613, 0xe614, 0xe615,
- // F040
- 0xe616, 0xe617, 0xe618, 0xe619,
- 0x21c4, 0x21c5, 0xe61a, 0xe61b,
- 0x21c7, 0x21c9, 0x21c8, 0x21ca,
- 0x21b6, 0x21b7, 0xe61c, 0xe61d,
- // F050
- 0x21bb, 0x21ba, 0xe61e, 0x2324,
- 0x2303, 0x2325, 0x2334, 0xe61f,
- 0x21ea, 0xe620, 0xe621, 0xe622,
- 0xe623, 0xe624, 0xe625, 0xe626,
- // F060
- 0xe627, 0xe628, 0xe629, 0xe62a,
- 0xe62b, 0xe62c, 0xe62d, 0xe62e,
- 0xe62f, 0xe630, 0xe631, 0xe632,
- 0xe633, 0xe634, 0xe635, 0xe636,
- // F070
- 0xe637, 0xe638, 0x25b3, 0x25bd,
- 0x25c0, 0x25b6, 0x25c1, 0x25b7,
- 0x25e3, 0xe639, 0x25e4, 0x25e5,
- 0x25c2, 0x25b8, 0xe63a, 0,
- // F080
- 0xe63b, 0xe63c, 0xe63d, 0xe63e,
- 0xe63f, 0xe640, 0xe641, 0xe642,
- 0xe643, 0xe644, 0xe645, 0xe646,
- 0xe647, 0xe648, 0xe649, 0xe64a,
- // F090
- 0xe64b, 0xe64c, 0xe64d, 0xe64e,
- 0xe64f, 0xe650, 0xe651, 0xe652,
- 0xe653, 0xe654, 0xe655, 0xe656,
- 0xe657, 0xe658, 0xe659, 0xe65a,
- // F0a0
- 0xe65b, 0xe65c, 0xe65d, 0xe65e,
- 0xe65f, 0xe660, 0xe661, 0xe662,
- 0xe663, 0xe664, 0xe665, 0xe666,
- 0xe667, 0xe668, 0xe669, 0xe66a,
- // F0b0
- 0xe66b, 0xe66c, 0xe66d, 0xe66e,
- 0xe66f, 0xe670, 0xe671, 0xe672,
- 0xe673, 0xe674, 0xe675, 0xe676,
- 0xe677, 0xe678, 0xe679, 0xe67a,
- // F0c0
- 0xe67b, 0xe67c, 0xe67d, 0xe67e,
- 0xe67f, 0xe680, 0xe681, 0xe682,
- 0xe683, 0xe684, 0xe685, 0xe686,
- 0xe687, 0xe688, 0xe689, 0xe68a,
- // F0d0
- 0xe68b, 0xe68c, 0xe68d, 0xe68e,
- 0xe68f, 0xe690, 0xe691, 0xe692,
- 0xe693, 0xe694, 0xe695, 0xe696,
- 0xe697, 0xe698, 0xe699, 0xe69a,
- // F0e0
- 0xe69b, 0xe69c, 0xe69d, 0xe69e,
- 0xe69f, 0xe6a0, 0xe6a1, 0xe6a2,
- 0xe6a3, 0xe6a4, 0xe6a5, 0xe6a6,
- 0xe6a7, 0xe6a8, 0xe6a9, 0xe6aa,
- // F0f0
- 0xe6ab, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0
-};
-
-// -----------------------------------------------------------------------
-
-static const sal_Unicode aWebDingsTab[224] =
-{
- // F020
- 0x0020, 0xe300, 0xe301, 0xe302,
- 0xe303, 0xe304, 0xe305, 0xe306,
- 0xe307, 0xe308, 0xe309, 0xe30a,
- 0xe30b, 0xe30c, 0xe30d, 0xe30e,
- // F030
- 0xe30f, 0xe310, 0xe311, 0xe312,
- 0xe313, 0xe314, 0xe315, 0xe316,
- 0xe317, 0xe318, 0xe319, 0xe31a,
- 0xe31b, 0xe31c, 0xe31d, 0xe31e,
- // F040
- 0xe31f, 0xe320, 0xe321, 0xe322,
- 0xe323, 0xe324, 0xe325, 0xe326,
- 0xe327, 0xe328, 0xe329, 0xe32a,
- 0xe32b, 0xe32c, 0xe32d, 0xe32e,
- // F050
- 0xe32f, 0xe330, 0xe331, 0xe332,
- 0xe333, 0xe334, 0xe335, 0xe336,
- 0xe337, 0xe338, 0xe339, 0xe33a,
- 0xe33b, 0xe33c, 0xe33d, 0xe33e,
- // F060
- 0xe33f, 0xe340, 0xe341, 0xe342,
- 0xe343, 0xe344, 0xe345, 0xe346,
- 0xe347, 0xe348, 0xe349, 0xe34a,
- 0xe34b, 0xe34c, 0xe34d, 0xe34e,
- // F070
- 0xe34f, 0xe350, 0xe351, 0xe352,
- 0xe353, 0xe354, 0xe355, 0xe356,
- 0xe357, 0xe358, 0xe359, 0xe35a,
- 0xe35b, 0xe35c, 0xe35d, 0,
- // F080
- 0xe35e, 0xe35f, 0xe360, 0xe361,
- 0xe362, 0xe363, 0xe364, 0xe365,
- 0xe366, 0xe367, 0xe368, 0xe369,
- 0xe36a, 0xe36b, 0xe36c, 0xe36d,
- // F090
- 0xe36e, 0xe36f, 0xe370, 0xe371,
- 0xe372, 0xe373, 0xe374, 0xe375,
- 0xe376, 0xe377, 0xe378, 0xe379,
- 0xe37a, 0xe37b, 0xe37c, 0xe37d,
- // F0a0
- 0xe37e, 0xe37f, 0xe380, 0xe381,
- 0xe382, 0xe383, 0xe384, 0xe385,
- 0xe386, 0xe387, 0xe388, 0xe389,
- 0xe38a, 0xe38b, 0xe38c, 0xe38d,
- // F0b0
- 0xe38e, 0xe38f, 0xe390, 0xe391,
- 0xe392, 0xe393, 0xe394, 0xe395,
- 0xe396, 0xe397, 0xe398, 0xe399,
- 0xe39a, 0xe39b, 0xe39c, 0xe39d,
- // F0c0
- 0xe39e, 0xe39f, 0xe3a0, 0xe3a1,
- 0xe3a2, 0xe3a3, 0xe3a4, 0xe3a5,
- 0xe3a6, 0xe3a7, 0xe3a8, 0xe3a9,
- 0xe3aa, 0xe3ab, 0xe3ac, 0xe3ad,
- // F0d0
- 0xe3ae, 0xe3af, 0xe3b0, 0xe3b1,
- 0xe3b2, 0xe3b3, 0xe3b4, 0xe3b5,
- 0xe3b6, 0xe3b7, 0xe3b8, 0xe3b9,
- 0xe3ba, 0xe3bb, 0xe3bc, 0xe3bd,
- // F0e0
- 0xe3be, 0xe3bf, 0xe3c0, 0xe3c1,
- 0xe3c2, 0xe3c3, 0xe3c4, 0xe3c5,
- 0xe3c6, 0xe3c7, 0xe3c8, 0xe3c9,
- 0xe3ca, 0xe3cb, 0xe3cd, 0xe3ce,
- // F0f0
- 0xe3cf, 0xe3d0, 0xe3d1, 0xe3d2,
- 0xe3d3, 0xe3d4, 0xe3d5, 0xe3d6,
- 0xe3d7, 0xe3d8, 0xe3d9, 0xe3da,
- 0xe3db, 0xe3dc, 0xe3dd, 0xe3de
-};
-
-// -----------------------------------------------------------------------
-
-static const sal_Unicode aAdobeSymbolTab[224] =
-{
-//TODO:
- // F020
- 0x0020, 0xe100, 0xe101, 0xe102,
- 0xe103, 0xe104, 0xe16a, 0xe105,
- 0xe106, 0xe107, 0xe108, 0xe109,
- 0xe10a, 0xe10b, 0xe10c, 0xe10d,
- // F030
- 0x0030, 0x0031, 0x0032, 0x0033,
- 0x0034, 0x0035, 0x0036, 0x0037,
- 0x0038, 0x0039, 0xe10e, 0xe10f,
- 0xe110, 0xe111, 0xe112, 0x003f,
- // F040
- 0xe113, 0x0391, 0x0392, 0x03a7,
- 0x0394, 0x0395, 0x03a6, 0x0393,
- 0x0397, 0x0399, 0x03d1, 0x039a,
- 0x039b, 0x039c, 0x039d, 0x039f,
- // F050
- 0x03a0, 0x0398, 0x03a1, 0x03a3,
- 0x03a4, 0x03a5, 0x03c2, 0x03a9,
- 0x039e, 0x03a8, 0x0396, 0xe114,
- 0x2234, 0xe115, 0xe116, 0x005f,
- // F060
- 0x00af, 0x03b1, 0x03b2, 0x03c7,
- 0x03b4, 0x03b5, 0x03d5, 0x03b3,
- 0x03b7, 0x03b9, 0x03c6, 0x03ba,
- 0x03bb, 0x03bc, 0x03bd, 0x03bf,
- // F070
- 0x03c0, 0x03b8, 0x03c1, 0x03c3,
- 0x03c4, 0x03c5, 0x03d6, 0x03c9,
- 0x03be, 0x03c8, 0x03b6, 0xe117,
- 0x007c, 0xe118, 0xe119, 0,
- // F080
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F090
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F0a0
- 0xe11a, 0x03d2, 0x0384, 0xe11b,
- 0x2215, 0xe11c, 0xe11d, 0xe11e,
- 0x2666, 0xe11f, 0xe120, 0xe121,
- 0xe122, 0xe123, 0xe124, 0xe125,
- // F0b0
- 0xe126, 0xe127, 0x2033, 0xe128,
- 0xe129, 0xe12a, 0xe12b, 0xe12c,
- 0xe12d, 0xe12e, 0xe12f, 0xe130,
- 0xe131, 0x2502, 0x2500, 0x21b2,
- // F0c0
- 0xe132, 0xe133, 0xe134, 0xe135,
- 0xe136, 0xe137, 0xe138, 0xe139,
- 0xe13a, 0xe13b, 0xe13c, 0xe13d,
- 0xe13e, 0xe13f, 0xe140, 0xe141,
- // F0d0
- 0x2220, 0xe142, 0x00ae, 0x00a9,
- 0xe143, 0xe144, 0xe145, 0xe146,
- 0xe147, 0xe148, 0xe149, 0xe14a,
- 0xe14b, 0x21d1, 0xe14c, 0x21d3,
- // F0e0
- 0x25ca, 0xe14d, 0xe14e, 0xe14f,
- 0xe150, 0xe151, 0xe152, 0xe153,
- 0xe154, 0xe155, 0xe156, 0xe157,
- 0xe158, 0xe159, 0xe15a, 0xe15b,
- // F0f0
- 0, 0xe15c, 0xe15d, 0xe15e,
- 0xe15f, 0xe160, 0xe161, 0xe162,
- 0xe163, 0xe164, 0xe165, 0xe166,
- 0xe167, 0xe168, 0xe169, 0,
-};
-
-// -----------------------------------------------------------------------
-
-static const sal_Unicode aMonotypeSortsTab[224] =
-{
- // F020
- 0x0020, 0x2701, 0xe200, 0x2703,
- 0x2704, 0xe201, 0x2706, 0xe202,
- 0xe203, 0xe203, 0xe204, 0xe205,
- 0x270c, 0xe206, 0xe207, 0xe208,
- // F030
- 0x2710, 0x2711, 0x2712, 0xe209,
- 0xe20a, 0x2715, 0x2716, 0xe20b,
- 0xe20c, 0xe20d, 0xe20e, 0xe20f,
- 0xe210, 0x271d, 0x271e, 0x271f,
- // F040
- 0x2720, 0xe211, 0xe212, 0xe213,
- 0xe214, 0xe215, 0x2726, 0x2727,
- 0x2605, 0x2729, 0x272a, 0xe216,
- 0xe217, 0xe218, 0xe219, 0xe21a,
- // F050
- 0xe21b, 0xe21c, 0x2732, 0xe21d,
- 0xe21e, 0xe21f, 0xe220, 0xe221,
- 0xe222, 0xe223, 0x273a, 0x273b,
- 0x273c, 0x273d, 0x273e, 0xe224,
- // F060
- 0x2740, 0x2741, 0x2742, 0x2743,
- 0xe225, 0x2745, 0x2746, 0x2747,
- 0x2748, 0x2749, 0x274a, 0x274b,
- 0xe226, 0xe227, 0xe228, 0xe229,
- // F070
- 0xe22a, 0xe22b, 0xe22c, 0x25b2,
- 0x25bc, 0xe22d, 0xe22e, 0xe22f,
- 0x2758, 0xe230, 0x275a, 0x275b,
- 0x275c, 0x275d, 0x275e, 0,
- // F080
- 0xe231, 0xe232, 0xe233, 0xe234,
- 0xe235, 0xe236, 0xe237, 0xe238,
- 0xe239, 0xe23a, 0xe23b, 0xe23c,
- 0xe23d, 0xe23e, 0, 0,
- // F090
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F0a0
- 0, 0xe23f, 0xe240, 0x2763,
- 0x2764, 0x2765, 0x2766, 0x2767,
- 0xe241, 0xe242, 0xe243, 0xe244,
- 0x2460, 0x2461, 0x2462, 0x2463,
- // F0b0
- 0x2464, 0x2465, 0x2466, 0x2467,
- 0x2468, 0x2469, 0x2776, 0x2777,
- 0x2778, 0x2779, 0x277a, 0x277b,
- 0x277c, 0x277d, 0x277e, 0x277f,
- // F0c0
- 0xe245, 0xe246, 0xe247, 0xe248,
- 0xe249, 0xe24a, 0xe24b, 0xe24c,
- 0xe24d, 0xe24e, 0xe24f, 0xe250,
- 0xe251, 0xe252, 0xe253, 0xe254,
- // F0d0
- 0xe255, 0xe256, 0xe257, 0xe258,
- 0xe259, 0xe25a, 0xe25b, 0xe25c,
- 0xe25d, 0x2799, 0xe25e, 0x279b,
- 0x279c, 0x279d, 0x279e, 0x279f,
- // F0e0
- 0x27a0, 0x27a1, 0xe25f, 0x27a3,
- 0x27a4, 0x27a5, 0x27a6, 0x27a7,
- 0x27a8, 0x27a9, 0x27aa, 0x27ab,
- 0x27ac, 0x27ad, 0x27ae, 0x27af,
- // F0f0
- 0, 0x27b1, 0xe260, 0x27b3,
- 0x27b4, 0x27b5, 0x27b6, 0x27b7,
- 0xe261, 0x27b9, 0x27ba, 0x27bb,
- 0x27bc, 0x27bd, 0x27be, 0,
-};
-
-// -----------------------------------------------------------------------
-
-/*
-static const sal_Unicode aMonotypeSorts2Tab[224] =
-{
-//TODO:
- // F020
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F030
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F040
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F050
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F060
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F070
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F080
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F090
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F0a0
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F0b0
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F0c0
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F0d0
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F0e0
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F0f0
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
-};
-*/
-
-static const sal_Unicode aMTExtraTab[224] =
-{
- // F020
- 0x0020, 0, 0, 0xE095,
- 0xE091, 0xE096, 0x02D9, 0,
- 0xE093, 0, 0, 0,
- 0, 0, 0, 0,
- // F030
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0x25C1, 0, 0x25B7, 0,
- // F040
- 0, 0, 0x2210, 0x019b,
- 0, 0, 0, 0,
- 0, 0x2229, 0, 0xE08B,
- 0x22EF, 0x22EE, 0x22F0, 0x22F1,
- // F050
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F060
- 0xE095, 0, 0xE25C, 0xE4BA,
- 0, 0, 0x210F, 0,
- 0, 0, 0, 0,
- 0x2113, 0x2213, 0, 0x00B0,
- // F070
- 0, 0, 0xE098, 0,
- 0, 0xE097, 0, 0,
- 0, 0, 0, 0xE081,
- 0, 0xE082, 0, 0,
- // F080
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F090
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F0a0
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F0b0
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F0c0
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F0d0
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F0e0
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- // F0f0
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0
-};
-
-
-//=======================================================================
-
-static sal_Unicode ImplStarSymbolToStarBats( sal_Unicode c )
-{
- switch ( c )
- {
- case 0x00A2: c = 0xF0E0; break;
- case 0x00A4: c = 0xF0E1; break;
- case 0x00A5: c = 0xF0E2; break;
- case 0x00A7: c = 0xF0A7; break;
- case 0x00AB: c = 0xF0AB; break;
- case 0x00B6: c = 0xF0DE; break;
- case 0x00BB: c = 0xF0BB; break;
-
- case 0x0152: c = 0xF08C; break;
- case 0x0153: c = 0xF09C; break;
- case 0x0160: c = 0xF08A; break;
- case 0x0161: c = 0xF09A; break;
- case 0x0178: c = 0xF09F; break;
- case 0x017D: c = 0xF08E; break;
- case 0x017E: c = 0xF09E; break;
-
- case 0x0192: c = 0xF083; break;
- case 0x02C6: c = 0xF088; break;
- case 0x02DC: c = 0xF098; break;
- case 0x2013: c = 0xF096; break;
- case 0x2014: c = 0xF097; break;
- case 0x2018: c = 0xF091; break;
-
- case 0x2019: c = 0xF092; break;
- case 0x201A: c = 0xF082; break;
- case 0x201C: c = 0xF093; break;
- case 0x201D: c = 0xF094; break;
- case 0x201E: c = 0xF084; break;
- case 0x2020: c = 0xF086; break;
-
- case 0x2021: c = 0xF087; break;
- case 0x2022: c = 0xF095; break;
- case 0x2026: c = 0xF085; break;
- case 0x2030: c = 0xF089; break;
- case 0x2039: c = 0xF08B; break;
- case 0x203A: c = 0xF09B; break;
-
- case 0x20A1: c = 0xF0E4; break;
- case 0x20A2: c = 0xF0E5; break;
- case 0x20A3: c = 0xF0E6; break;
- case 0x20A4: c = 0xF0E7; break;
- case 0x20A8: c = 0xF0EA; break;
- case 0x20A9: c = 0xF0E8; break;
- case 0x20AB: c = 0xF0E9; break;
- case 0x20AC: c = 0xF080; break;
-
- case 0x2122: c = 0xF099; break;
- case 0x2190: c = 0xF0B7; break;
- case 0x2191: c = 0xF0B8; break;
- case 0x2192: c = 0xF0B5; break;
- case 0x2193: c = 0xF0B6; break;
- case 0x2194: c = 0xF0D8; break;
- case 0x2195: c = 0xF0D9; break;
-
- case 0x21E4: c = 0xF0B4; break;
- case 0x21E5: c = 0xF0B3; break;
- case 0x21E6: c = 0xF0A4; break;
- case 0x21E7: c = 0xF0B2; break;
- case 0x21E8: c = 0xF0AF; break;
- case 0x21E9: c = 0xF0A3; break;
-
- case 0x25A0: c = 0xF024; break;
- case 0x25A1: c = 0xF025; break;
- case 0x25B4: c = 0xF0C5; break;
- case 0x25B5: c = 0xF0C7; break;
- case 0x25BE: c = 0xF0C4; break;
- case 0x25BF: c = 0xF0C6; break;
- case 0x25C6: c = 0xF043; break;
- case 0x25CF: c = 0xF022; break;
- case 0x25D7: c = 0xF0D0; break;
-
- case 0x260E: c = 0xF074; break;
- case 0x2611: c = 0xF034; break;
- case 0x2612: c = 0xF033; break;
- case 0x261B: c = 0xF036; break;
- case 0x261E: c = 0xF07D; break;
- case 0x2639: c = 0xF0AD; break;
- case 0x263A: c = 0xF021; break;
-
- case 0x2702: c = 0xF0CB; break;
- case 0x2708: c = 0xF0CC; break;
- case 0x270D: c = 0xF07E; break;
- case 0x270E: c = 0xF038; break;
-
- case 0x2713: c = 0xF039; break;
- case 0x2714: c = 0xF03A; break;
- case 0x2717: c = 0xF04F; break;
- case 0x2718: c = 0xF050; break;
- case 0x2719: c = 0xF051; break;
- case 0x271A: c = 0xF052; break;
- case 0x271B: c = 0xF053; break;
- case 0x271C: c = 0xF054; break;
-
- case 0x2721: c = 0xF0CD; break;
- case 0x2722: c = 0xF044; break;
- case 0x2723: c = 0xF045; break;
- case 0x2724: c = 0xF046; break;
- case 0x2725: c = 0xF047; break;
- case 0x272B: c = 0xF055; break;
- case 0x272C: c = 0xF056; break;
- case 0x272D: c = 0xF057; break;
- case 0x272E: c = 0xF058; break;
- case 0x272F: c = 0xF059; break;
-
- case 0x2730: c = 0xF05A; break;
- case 0x2733: c = 0xF048; break;
- case 0x2734: c = 0xF049; break;
- case 0x2735: c = 0xF04A; break;
- case 0x2736: c = 0xF04B; break;
- case 0x2737: c = 0xF04C; break;
- case 0x2738: c = 0xF04D; break;
- case 0x2739: c = 0xF04E; break;
- case 0x273F: c = 0xF0CE; break;
-
- case 0x2744: c = 0xF0CF; break;
- case 0x274D: c = 0xF023; break;
- case 0x274F: c = 0xF03E; break;
- case 0x2750: c = 0xF03F; break;
- case 0x2751: c = 0xF027; break;
- case 0x2752: c = 0xF028; break;
- case 0x2756: c = 0xF02C; break;
- case 0x2759: c = 0xF0D1; break;
- case 0x2762: c = 0xF0D4; break;
-
- case 0x2780: c = 0xF068; break;
- case 0x2781: c = 0xF069; break;
- case 0x2782: c = 0xF06A; break;
- case 0x2783: c = 0xF06B; break;
- case 0x2784: c = 0xF06C; break;
- case 0x2785: c = 0xF06D; break;
- case 0x2786: c = 0xF06E; break;
- case 0x2787: c = 0xF06F; break;
- case 0x2788: c = 0xF070; break;
- case 0x2789: c = 0xF071; break;
- case 0x278A: c = 0xF05D; break;
- case 0x278B: c = 0xF05E; break;
- case 0x278C: c = 0xF05F; break;
- case 0x278D: c = 0xF060; break;
- case 0x278E: c = 0xF061; break;
- case 0x278F: c = 0xF062; break;
-
- case 0x2790: c = 0xF063; break;
- case 0x2791: c = 0xF064; break;
- case 0x2792: c = 0xF065; break;
- case 0x2793: c = 0xF066; break;
- case 0x2794: c = 0xF031; break;
- case 0x2798: c = 0xF0DA; break;
- case 0x279A: c = 0xF0DB; break;
-
- case 0x27A2: c = 0xF02F; break;
- case 0x27B2: c = 0xF035; break;
- case 0x27B8: c = 0xF0DC; break;
-
- case 0xE000: c = 0xF000+38; break;
- case 0xE001: c = 0xF000+41; break;
- case 0xE002: c = 0xF000+42; break;
- case 0xE003: c = 0xF000+43; break;
- case 0xE004: c = 0xF000+45; break;
- case 0xE005: c = 0xF000+46; break;
- case 0xE006: c = 0xF000+48; break;
- case 0xE007: c = 0xF000+57; break;
-
- case 0xE008: c = 0xF000+59; break;
- case 0xE009: c = 0xF000+60; break;
- case 0xE00a: c = 0xF000+61; break;
- case 0xE00b: c = 0xF000+64; break;
- case 0xE00c: c = 0xF000+65; break;
- case 0xE00d: c = 0xF000+66; break;
- case 0xE00e: c = 0xF000+67; break;
- case 0xE00f: c = 0xF000+92; break;
-
- case 0xE010: c = 0xF000+103; break;
- case 0xE011: c = 0xF000+114; break;
- case 0xE012: c = 0xF000+115; break;
- case 0xE013: c = 0xF000+117; break;
- case 0xE014: c = 0xF000+118; break;
- case 0xE015: c = 0xF000+119; break;
- case 0xE016: c = 0xF000+120; break;
- case 0xE017: c = 0xF000+121; break;
-
- case 0xE018: c = 0xF000+122; break;
- case 0xE019: c = 0xF000+123; break;
- case 0xE01a: c = 0xF000+124; break;
- case 0xE01b: c = 0xF000+126; break;
- case 0xE01c: c = 0xF000+136; break;
- case 0xE01d: c = 0xF000+155; break;
- case 0xE01e: c = 0xF000+165; break;
- case 0xE01f: c = 0xF000+166; break;
-
- case 0xE020: c = 0xF000+168; break;
- case 0xE021: c = 0xF000+169; break;
- case 0xE022: c = 0xF000+170; break;
- case 0xE023: c = 0xF000+172; break;
- case 0xE024: c = 0xF000+174; break;
- case 0xE025: c = 0xF000+175; break;
- case 0xE026: c = 0xF000+176; break;
- case 0xE027: c = 0xF000+177; break;
-
- case 0xE028: c = 0xF000+178; break;
- case 0xE029: c = 0xF000+185; break;
- case 0xE02a: c = 0xF000+186; break;
- case 0xE02b: c = 0xF000+188; break;
- case 0xE02c: c = 0xF000+189; break;
- case 0xE02d: c = 0xF000+190; break;
- case 0xE02e: c = 0xF000+191; break;
- case 0xE02f: c = 0xF000+192; break;
-
- case 0xE030: c = 0xF000+193; break;
- case 0xE031: c = 0xF000+194; break;
- case 0xE032: c = 0xF000+195; break;
- case 0xE033: c = 0xF000+200; break;
- case 0xE034: c = 0xF000+201; break;
- case 0xE035: c = 0xF000+202; break;
- case 0xE036: c = 0xF000+210; break;
- case 0xE037: c = 0xF000+211; break;
-
- case 0xE038: c = 0xF000+227; break;
- case 0xE039: c = 0xF000+235; break;
- case 0xE03a: c = 0xF000+255; break;
-
- default: c = 0; break;
- }
-
- return c;
-}
-
-enum SymbolFont
-{
- Symbol=1, Wingdings=2, MonotypeSorts=4, Webdings=8, Wingdings2=16,
- Wingdings3=32, MTExtra=64, TimesNewRoman=128
-};
-
-const char *aSymbolNames[] =
-{
- "Symbol", "Wingdings", "Monotype Sorts", "Webdings", "Wingdings 2",
- "Wingdings 3", "MT Extra", "Times New Roman"
-};
-
-struct SymbolEntry
-{
- sal_uInt8 cIndex;
- enum SymbolFont eFont;
-};
-
-class StarSymbolToMSMultiFontImpl : public StarSymbolToMSMultiFont
-{
-private:
- ::std::multimap<sal_Unicode, SymbolEntry> maMagicMap;
-public:
- StarSymbolToMSMultiFontImpl(bool bPerfectOnly);
- String ConvertChar(sal_Unicode &rChar);
- String ConvertString(String &rString, xub_StrLen& rIndex);
-};
-
-struct ExtraTable { sal_Unicode cStar; sal_uInt8 cMS;};
-
-ExtraTable aWingDingsExtraTab[] =
-{
- {0x25cf, 0x6C}, {0x2714, 0xFC}, {0x2717, 0xFB}, {0x2794, 0xE8},
- {0x27a2, 0xD8}, {0xe000, 0x6F}, {0xe001, 0x73}, {0xe002, 0x74},
- {0xe003, 0x75}, {0xe004, 0x77}, {0xe005, 0xA6}, {0xe006, 0xE0},
- {0xe007, 0xFC}, {0xe008, 0x6C}, {0xe009, 0x6D}, {0xe00a, 0x6E},
- {0xe00b, 0x72}, {0xe00c, 0x75}, {0xe00d, 0x76}, {0xe00e, 0x74},
- {0xe00f, 0x8B}, {0xe010, 0x80}, {0xe011, 0x2B}, {0xe012, 0x3A},
- {0xe013, 0x5D}, {0xe014, 0x29}, {0xe015, 0x3A}, {0xe016, 0x3C},
- {0xe017, 0x38}, {0xe018, 0x3A}, {0xe019, 0x2A}, {0xe01a, 0x2B},
- {0xe01b, 0x3F}, {0xe01c, 0x9F}, {0xe01d, 0x80}, {0xe01e, 0x8B},
- {0xe023, 0x4A}, {0xe025, 0xF0}, {0xe026, 0xF2}, {0xe027, 0xEF},
- {0xe028, 0xF1}, {0xe029, 0x52}, {0xe02a, 0x29}, {0xe02b, 0xE0},
- {0xe02c, 0xE2}, {0xe02d, 0xDF}, {0xe02e, 0xE1}, {0xe02f, 0xAC},
- {0xe030, 0xAD}, {0xe031, 0xAE}, {0xe032, 0x7C}, {0xe033, 0x43},
- {0xe034, 0x4D}, {0xe0aa, 0x71}, {0xe422, 0x44}
-};
-
-ExtraTable aSymbolExtraTab2[] =
-{
- {0x0020, 0x20}, {0x00A0, 0x20}, {0x0021, 0x21}, {0x2200, 0x22},
- {0x0023, 0x23}, {0x2203, 0x24}, {0x0025, 0x25}, {0x0026, 0x26},
- {0x220B, 0x27}, {0x0028, 0x28}, {0x0029, 0x29}, {0x2217, 0x2A},
- {0x002B, 0x2B}, {0x002C, 0x2C}, {0x2212, 0x2D}, {0x002E, 0x2E},
- {0x002F, 0x2F}, {0x003A, 0x3A}, {0x003B, 0x3B}, {0x003C, 0x3C},
- {0x003D, 0x3D}, {0x003E, 0x3E}, {0x2245, 0x40}, {0x2206, 0x44},
- {0x2126, 0x57}, {0x005B, 0x5B}, {0x005D, 0x5D}, {0x22A5, 0x5E},
- {0x03C6, 0x66}, {0x03D5, 0x6A}, {0x00B5, 0x6D}, {0x007B, 0x7B},
- {0x007C, 0x7C}, {0x007D, 0x7D}, {0x223C, 0x7E}, {0x20AC, 0xA0},
- {0x2032, 0xA2}, {0x2264, 0xA3}, {0x2044, 0xA4}, {0x221E, 0xA5},
- {0x0192, 0xA6}, {0x2663, 0xA7}, {0x2665, 0xA9}, {0x2660, 0xAA},
- {0x2194, 0xAB}, {0x2190, 0xAC}, {0x2191, 0xAD}, {0x2192, 0xAE},
- {0x2193, 0xAF}, {0x00B0, 0xB0}, {0x00B1, 0xB1}, {0x2265, 0xB3},
- {0x00D7, 0xB4}, {0x221D, 0xB5}, {0x2202, 0xB6}, {0x2022, 0xB7},
- {0x00F7, 0xB8}, {0x2260, 0xB9}, {0x2261, 0xBA}, {0x2248, 0xBB},
- {0x2026, 0xBC}, {0x21B5, 0xBF}, {0x2135, 0xC0}, {0x2111, 0xC1},
- {0x211C, 0xC2}, {0x2118, 0xC3}, {0x2297, 0xC4}, {0x2295, 0xC5},
- {0x2205, 0xC6}, {0x2229, 0xC7}, {0x222A, 0xC8}, {0x2283, 0xC9},
- {0x2287, 0xCA}, {0x2284, 0xCB}, {0x2282, 0xCC}, {0x2286, 0xCD},
- {0x2208, 0xCE}, {0x2209, 0xCF}, {0x2207, 0xD1}, {0x220F, 0xD5},
- {0x221A, 0xD6}, {0x22C5, 0xD7}, {0x00AC, 0xD8}, {0x2227, 0xD9},
- {0x2228, 0xDA}, {0x21D4, 0xDB}, {0x21D0, 0xDC}, {0x21D2, 0xDE},
- {0x2329, 0xE1}, {0x2211, 0xE5}, {0x232A, 0xF1}, {0x222B, 0xF2},
- {0x2320, 0xF3}, {0x2321, 0xF5}, {0x2013, 0x2D}
-};
-
-ExtraTable aSymbolExtraTab[] =
-{
- {0xe021, 0xD3}, {0xe024, 0xD2}, {0xe035, 0x20}, {0xe036, 0x28},
- {0xe037, 0x29}, {0xe039, 0x20}, {0xe083, 0x2B}, {0xe084, 0x3C},
- {0xe085, 0x3E}, {0xe086, 0xA3}, {0xe087, 0xB3}, {0xe089, 0xCE},
- {0xe08a, 0xA6}, {0xe08c, 0xAE}, {0xe08d, 0xD6}, {0xe08e, 0xD6},
- {0xe08f, 0xD6}, {0xe094, 0xA2}, {0xe09e, 0x28}, {0xe09f, 0x29},
- {0xe0a0, 0xD0}, {0xe0a6, 0xA2}, {0xe0a7, 0x7C}, {0xe0a8, 0x2F},
- {0xe0ab, 0x7C}, {0xe0ac, 0x47}, {0xe0ad, 0x44}, {0xe0ae, 0x51},
- {0xe0af, 0x4C}, {0xe0b0, 0x58}, {0xe0b1, 0x50}, {0xe0b2, 0x53},
- {0xe0b3, 0x55}, {0xe0b4, 0x46}, {0xe0b5, 0x59}, {0xe0b6, 0x57},
- {0xe0b7, 0x61}, {0xe0b8, 0x62}, {0xe0b9, 0x67}, {0xe0ba, 0x64},
- {0xe0bb, 0x65}, {0xe0bc, 0x7A}, {0xe0bd, 0x68}, {0xe0be, 0x71},
- {0xe0bf, 0x69}, {0xe0c0, 0x6B}, {0xe0c1, 0x6C}, {0xe0c2, 0x6D},
- {0xe0c3, 0x6E}, {0xe0c4, 0x78}, {0xe0c5, 0x6F}, {0xe0c6, 0x70},
- {0xe0c7, 0x72}, {0xe0c8, 0x73}, {0xe0c9, 0x74}, {0xe0ca, 0x75},
- {0xe0cb, 0x66}, {0xe0cc, 0x63}, {0xe0cd, 0x79}, {0xe0ce, 0x77},
- {0xe0cf, 0x65}, {0xe0d0, 0x4A}, {0xe0d1, 0x76}, {0xe0d3, 0x56},
- {0xe0d4, 0x6A}, {0xe0d5, 0xB6}, {0xe0d6, 0x69}, {0xe0db, 0xAC},
- {0xe0dc, 0xAD}, {0xe0dd, 0xAF}
-};
-
-ExtraTable aTNRExtraTab[] =
-{
- {0xe021, 0xA9},
- {0xe022, 0x40},
- {0xe024, 0xAE},
- {0xe035, 0x20},
- {0xe036, '('},
- {0xe037, ')'},
- {0xe039, 0x20},
- {0xe03a, 0x80},
- {0xe080, 0x89},
- {0xe083, '+'},
- {0xe084, '<'},
- {0xe085, '>'},
- {0xe0a9, '\\'}
-};
-
-StarSymbolToMSMultiFontImpl::StarSymbolToMSMultiFontImpl(bool bPerfectOnly)
-{
- struct ConvertTable
- {
- enum SymbolFont meFont;
- const sal_Unicode* pTab;
- };
-
- //In order of preference
- const ConvertTable aConservativeTable[] =
- {
- {Symbol, aAdobeSymbolTab},
- {Wingdings, aWingDingsTab},
- {MonotypeSorts, aMonotypeSortsTab},
- {Webdings, aWebDingsTab},
- {Wingdings2, aWingDings2Tab},
- {Wingdings3, aWingDings3Tab},
- {MTExtra, aMTExtraTab}
- };
-
- struct ExtendedConvertTable
- {
- enum SymbolFont meFont;
- const ExtraTable *mpTable;
- size_t mnSize;
- ExtendedConvertTable(SymbolFont eFont, const ExtraTable *pTable,
- size_t nSize)
- : meFont(eFont), mpTable(pTable), mnSize(nSize) {}
- };
-
- //Reverse map from a given starsymbol char to exact matches in ms symbol
- //fonts.
- int nEntries = sizeof(aConservativeTable) / sizeof(aConservativeTable[0]);
- int i;
- for (i = 0; i < nEntries; ++i)
- {
- const ConvertTable& r = aConservativeTable[i];
- SymbolEntry aEntry;
- aEntry.eFont = r.meFont;
- for (aEntry.cIndex = 0xFF; aEntry.cIndex >= 0x20; --aEntry.cIndex)
- {
- if (sal_Unicode cChar = r.pTab[aEntry.cIndex-0x20])
- maMagicMap.insert(
- ::std::multimap<sal_Unicode, SymbolEntry>::value_type(
- cChar, aEntry));
- }
- }
-
- //In order of preference
- const ExtendedConvertTable aAgressiveTable[] =
- {
- ExtendedConvertTable(Symbol, aSymbolExtraTab2,
- sizeof(aSymbolExtraTab2)),
- ExtendedConvertTable(Symbol, aSymbolExtraTab,
- sizeof(aSymbolExtraTab)),
- ExtendedConvertTable(Wingdings, aWingDingsExtraTab,
- sizeof(aWingDingsExtraTab)),
- ExtendedConvertTable(TimesNewRoman, aTNRExtraTab,
- sizeof(aTNRExtraTab))
- };
-
- //Allow extra conversions that are not perfect, but "good enough"
- if (!bPerfectOnly)
- nEntries = sizeof(aAgressiveTable) / sizeof(aAgressiveTable[0]);
- else
- nEntries = 1;
-
- for (i = 0; i < nEntries; ++i)
- {
- const ExtendedConvertTable& r = aAgressiveTable[i];
- SymbolEntry aEntry;
- aEntry.eFont = r.meFont;
- for (int j = r.mnSize / sizeof(r.mpTable[0]); j >=0; --j)
- {
- aEntry.cIndex = r.mpTable[j].cMS;
- maMagicMap.insert(
- ::std::multimap<sal_Unicode, SymbolEntry>::value_type(
- r.mpTable[j].cStar, aEntry));
- }
- }
-}
-
-const char *SymbolFontToString(int nResult)
-{
- const char **ppName = aSymbolNames;
- int nI = Symbol;
- while (nI <= nResult)
- {
- if (!(nI & nResult))
- nI = nI << 1;
- else
- break;
- ppName++;
- }
- return *ppName;
-}
-
-String StarSymbolToMSMultiFontImpl::ConvertChar(sal_Unicode &rChar)
-{
- String sRet;
-
- ::std::multimap<sal_Unicode, SymbolEntry>::const_iterator aResult =
- maMagicMap.find(rChar);
-
- if (aResult != maMagicMap.end())
- {
- const SymbolEntry &rEntry = (*aResult).second;
- sRet.AssignAscii(SymbolFontToString(rEntry.eFont));
- rChar = rEntry.cIndex;
- }
-
- return sRet;
-}
-
-String StarSymbolToMSMultiFontImpl::ConvertString(String &rString,
- xub_StrLen& rIndex)
-{
- typedef ::std::multimap<sal_Unicode, SymbolEntry>::iterator MI;
- typedef ::std::pair<MI, MI> Result;
-
- String sRet;
-
- xub_StrLen nLen = rString.Len();
- if (rIndex >= nLen)
- return sRet;
-
- int nTotal = 0, nResult = 0;
- ::std::vector<Result> aPossibilities;
- aPossibilities.reserve(nLen - rIndex);
- xub_StrLen nStart = rIndex;
- do
- {
- Result aResult = maMagicMap.equal_range(rString.GetChar(rIndex));
- int nBitfield = 0;
- for (MI aIndex = aResult.first; aIndex != aResult.second; ++aIndex)
- nBitfield |= aIndex->second.eFont;
-
- if (!nTotal)
- nTotal = nBitfield;
- else
- {
- if (nTotal != nBitfield) //Allow a series of failures
- {
- nTotal &= nBitfield;
- if (!nTotal)
- break;
- }
- }
- nResult = nTotal;
- if (nResult) //Don't bother storing a series of failures
- aPossibilities.push_back(aResult);
- ++rIndex;
- }while(rIndex < nLen);
-
- if (nResult)
- {
- int nI = Symbol;
- while (nI <= nResult)
- {
- if (!(nI & nResult))
- nI = nI << 1;
- else
- break;
- }
- sRet.AssignAscii(SymbolFontToString(nI));
-
- xub_StrLen nSize = sal::static_int_cast<xub_StrLen>(aPossibilities.size());
- for(xub_StrLen nPos = 0; nPos < nSize; ++nPos)
- {
- const Result &rResult = aPossibilities[nPos];
-
- for (MI aIndex = rResult.first; aIndex != rResult.second; ++aIndex)
- {
- if (aIndex->second.eFont == nI)
- {
- rString.SetChar(nPos+nStart, aIndex->second.cIndex);
- break;
- }
- }
- }
- }
-
- return sRet;
-}
-
-StarSymbolToMSMultiFont *CreateStarSymbolToMSMultiFont(bool bPerfectOnly)
-{
- return new StarSymbolToMSMultiFontImpl(bPerfectOnly);
-}
-
-//=======================================================================
-
-sal_Unicode ImplRecodeChar( const ImplCvtChar* pConversion, sal_Unicode cChar )
-{
- sal_Unicode cRetVal = 0;
- if( pConversion->mpCvtFunc )
- {
- // use a conversion function for recoding
- cRetVal = pConversion->mpCvtFunc( cChar );
- }
- else
- {
- // use a conversion table for recoding
- sal_Unicode cIndex = cChar;
- // allow symbol aliasing
- if( cIndex & 0xFF00 )
- cIndex -= 0xF000;
- // recode the symbol
- if( cIndex>=0x0020 && cIndex<=0x00FF )
- cRetVal = pConversion->mpCvtTab[ cIndex - 0x0020 ];
- }
-
- return cRetVal ? cRetVal : cChar;
-}
-
-// -----------------------------------------------------------------------
-
-// recode the string assuming the character codes are symbol codes
-// from an traditional symbol font (i.e. U+F020..U+F0FF)
-void ImplRecodeString( const ImplCvtChar* pConversion, String& rStr,
- xub_StrLen nIndex, xub_StrLen nLen )
-{
- ULONG nLastIndex = (ULONG)nIndex + nLen;
- if( nLastIndex > rStr.Len() )
- nLastIndex = rStr.Len();
-
- for(; nIndex < nLastIndex; ++nIndex )
- {
- sal_Unicode cOrig = rStr.GetChar( nIndex );
- // only recode symbols and their U+00xx aliases
- if( ((cOrig < 0x0020) || (cOrig > 0x00FF))
- && ((cOrig < 0xF020) || (cOrig > 0xF0FF)) )
- continue;
-
- // recode a symbol
- sal_Unicode cNew = ImplRecodeChar( pConversion, cOrig );
- if( cOrig != cNew )
- rStr.SetChar( nIndex, cNew );
- }
-}
-
-//=======================================================================
-
-struct RecodeTable { const char* pOrgName; ImplCvtChar aCvt;};
-
-static RecodeTable aRecodeTable[] =
-{
- // the first two entries must be StarMath and StarBats; do not reorder!
- // reason: fgrep for FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS
- {"starbats", {aStarBatsTab, "StarSymbol", NULL}},
- {"starmath", {aStarMathTab, "StarSymbol", NULL}},
-
- {"symbol", {aAdobeSymbolTab, "StarSymbol", NULL}},
- {"standardsymbols", {aAdobeSymbolTab, "StarSymbol", NULL}},
- {"standardsymbolsl",{aAdobeSymbolTab, "StarSymbol", NULL}},
-
- {"monotypesorts", {aMonotypeSortsTab, "StarSymbol", NULL}},
-// {"monotypesorts2", {aMonotypeSorts2Tab, "StarSymbol", NULL}}
- {"zapfdingbats", {aMonotypeSortsTab, "StarSymbol", NULL}}, //ZapfDingbats=MonotypeSorts-X?
- {"itczapfdingbats", {aMonotypeSortsTab, "StarSymbol", NULL}},
- {"dingbats", {aMonotypeSortsTab, "StarSymbol", NULL}},
-
- {"webdings", {aWebDingsTab, "StarSymbol", NULL}},
- {"wingdings", {aWingDingsTab, "StarSymbol", NULL}},
- {"wingdings2", {aWingDings2Tab, "StarSymbol", NULL}},
- {"wingdings3", {aWingDings3Tab, "StarSymbol", NULL}},
- {"mtextra", {aMTExtraTab, "StarSymbol", NULL}}
-};
-
-static ImplCvtChar aImplStarSymbolCvt = { NULL, "StarBats", ImplStarSymbolToStarBats };
-#if 0
-// not used
-static ImplCvtChar aImplDingBatsCvt = { aMonotypeSortsTab, "StarSymbol", NULL };
-#endif
-
-// -----------------------------------------------------------------------
-
-const ImplCvtChar* ImplGetRecodeData( const String& rOrgFontName,
- const String& rMapFontName )
-{
- const ImplCvtChar* pCvt = NULL;
- String aOrgName( rOrgFontName );
- ImplGetEnglishSearchFontName( aOrgName );
- String aMapName( rMapFontName );
- ImplGetEnglishSearchFontName( aMapName );
-
- if( aMapName.EqualsAscii( "starsymbol" )
- || aMapName.EqualsAscii( "opensymbol" ) )
- {
- int nEntries = sizeof(aRecodeTable) / sizeof(aRecodeTable[0]);
- for( int i = 0; i < nEntries; ++i)
- {
- RecodeTable& r = aRecodeTable[i];
- if( aOrgName.EqualsAscii( r.pOrgName ) )
- { pCvt = &r.aCvt; break; }
- }
- }
- else if( aMapName.EqualsAscii( "starbats" ) )
- {
- if( aOrgName.EqualsAscii( "starsymbol" ) )
- pCvt = &aImplStarSymbolCvt;
- else if( aOrgName.EqualsAscii( "opensymbol" ) )
- pCvt = &aImplStarSymbolCvt;
- }
-
- return pCvt;
-}
-
-//=======================================================================
-
-FontToSubsFontConverter CreateFontToSubsFontConverter(
- const String& rOrgName, ULONG nFlags )
-{
- const ImplCvtChar* pCvt = NULL;
-
- String aName = rOrgName;
- ImplGetEnglishSearchFontName( aName );
-
- if ( nFlags & FONTTOSUBSFONT_IMPORT )
- {
- int nEntries = sizeof(aRecodeTable) / sizeof(aRecodeTable[0]);
- if ( nFlags & FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ) // only StarMath+StarBats
- nEntries = 2;
- for( int i = 0; i < nEntries; ++i )
- {
- RecodeTable& r = aRecodeTable[i];
- if( aName.EqualsAscii( r.pOrgName ) )
- { pCvt = &r.aCvt; break; }
- }
- }
- else
- {
- // TODO: FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS
- if( aName.EqualsAscii( "starsymbol" ) ) pCvt = &aImplStarSymbolCvt;
- else if( aName.EqualsAscii( "opensymbol" ) ) pCvt = &aImplStarSymbolCvt;
- }
-
- return (FontToSubsFontConverter)pCvt;
-}
-
-// -----------------------------------------------------------------------
-
-void DestroyFontToSubsFontConverter( FontToSubsFontConverter )
-{
- // nothing to do for now, because we use static ImplCvtChars
-}
-
-// -----------------------------------------------------------------------
-
-sal_Unicode ConvertFontToSubsFontChar(
- FontToSubsFontConverter hConverter, sal_Unicode cChar )
-{
- if ( hConverter )
- return ImplRecodeChar( (ImplCvtChar*)hConverter, cChar );
- else
- return cChar;
-}
-
-// -----------------------------------------------------------------------
-
-String GetFontToSubsFontName( FontToSubsFontConverter hConverter )
-{
- if ( !hConverter )
- return String();
-
- const char* pName = ((ImplCvtChar*)hConverter)->mpSubsFontName;
- return String::CreateFromAscii( pName );
-}
diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx
index 039041826124..8178204a4ffd 100644
--- a/vcl/source/gdi/impimagetree.cxx
+++ b/vcl/source/gdi/impimagetree.cxx
@@ -46,6 +46,7 @@
#include "com/sun/star/uno/RuntimeException.hpp"
#include "com/sun/star/uno/Sequence.hxx"
#include "comphelper/processfactory.hxx"
+#include "osl/file.hxx"
#include "osl/diagnose.h"
#include "rtl/bootstrap.hxx"
#include "rtl/string.h"
@@ -118,12 +119,43 @@ ImplImageTree::ImplImageTree() {}
ImplImageTree::~ImplImageTree() {}
+bool ImplImageTree::checkStyle(rtl::OUString const & style)
+{
+ bool exists;
+
+ // using cache because setStyle is an expensive operation
+ // setStyle calls resetZips => closes any opened zip files with icons, cleans the icon cache, ...
+ if (checkStyleCacheLookup(style, exists)) {
+ return exists;
+ }
+
+ setStyle(style);
+
+ exists = false;
+ const rtl::OUString sBrandURLSuffix(RTL_CONSTASCII_USTRINGPARAM("_brand.zip"));
+ for (Zips::iterator i(m_zips.begin()); i != m_zips.end() && !exists;) {
+ ::rtl::OUString aZipURL = i->first;
+ sal_Int32 nFromIndex = aZipURL.getLength() - sBrandURLSuffix.getLength();
+ // skip brand-specific icon themes; they are incomplete and thus not useful for this check
+ if (nFromIndex < 0 || !aZipURL.match(sBrandURLSuffix, nFromIndex)) {
+ osl::File aZip(aZipURL);
+ if (aZip.open(OpenFlag_Read) == ::osl::FileBase::E_None) {
+ aZip.close();
+ exists = true;
+ }
+ }
+ ++i;
+ }
+ m_checkStyleCache[style] = exists;
+ return exists;
+}
+
bool ImplImageTree::loadImage(
rtl::OUString const & name, rtl::OUString const & style, BitmapEx & bitmap,
bool localized)
{
setStyle(style);
- if (cacheLookup(name, localized, bitmap)) {
+ if (iconCacheLookup(name, localized, bitmap)) {
return true;
}
if (!bitmap.IsEmpty()) {
@@ -164,7 +196,7 @@ bool ImplImageTree::loadImage(
rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
}
if (found) {
- m_cache[name.intern()] = std::make_pair(localized, bitmap);
+ m_iconCache[name.intern()] = std::make_pair(localized, bitmap);
}
return found;
}
@@ -173,7 +205,8 @@ void ImplImageTree::shutDown() {
m_style = rtl::OUString();
// for safety; empty m_style means "not initialized"
m_zips.clear();
- m_cache.clear();
+ m_iconCache.clear();
+ m_checkStyleCache.clear();
}
void ImplImageTree::setStyle(rtl::OUString const & style) {
@@ -181,7 +214,7 @@ void ImplImageTree::setStyle(rtl::OUString const & style) {
if (style != m_style) {
m_style = style;
resetZips();
- m_cache.clear();
+ m_iconCache.clear();
}
}
@@ -241,6 +274,7 @@ void ImplImageTree::resetZips() {
u.GetMainURL(INetURLObject::NO_DECODE),
css::uno::Reference< css::container::XNameAccess >()));
}
+ if ( m_style.equals(::rtl::OUString::createFromAscii("default")) )
{
rtl::OUString url(
RTL_CONSTASCII_USTRINGPARAM(
@@ -252,11 +286,23 @@ void ImplImageTree::resetZips() {
}
}
-bool ImplImageTree::cacheLookup(
+bool ImplImageTree::checkStyleCacheLookup(
+ rtl::OUString const & style, bool &exists)
+{
+ CheckStyleCache::iterator i(m_checkStyleCache.find(style));
+ if (i != m_checkStyleCache.end()) {
+ exists = i->second;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool ImplImageTree::iconCacheLookup(
rtl::OUString const & name, bool localized, BitmapEx & bitmap)
{
- Cache::iterator i(m_cache.find(name));
- if (i != m_cache.end() && i->second.first == localized) {
+ IconCache::iterator i(m_iconCache.find(name));
+ if (i != m_iconCache.end() && i->second.first == localized) {
bitmap = i->second.second;
return true;
} else {
diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk
index c77508ea159e..421505a3d500 100644..100755
--- a/vcl/source/gdi/makefile.mk
+++ b/vcl/source/gdi/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# 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
@@ -57,6 +57,7 @@ EXCEPTIONSFILES= $(SLO)$/salmisc.obj \
$(SLO)$/gfxlink.obj \
$(SLO)$/print.obj \
$(SLO)$/print2.obj \
+ $(SLO)$/configsettings.obj \
$(SLO)$/sallayout.obj \
$(SLO)$/image.obj \
$(SLO)$/impimage.obj \
@@ -64,10 +65,8 @@ EXCEPTIONSFILES= $(SLO)$/salmisc.obj \
$(SLO)$/metric.obj \
$(SLO)$/pdfwriter_impl.obj \
$(SLO)$/pdffontcache.obj\
- $(SLO)$/fontcfg.obj \
$(SLO)$/bmpconv.obj \
$(SLO)$/pdfextoutdevdata.obj \
- $(SLO)$/fontcvt.obj \
$(SLO)$/jobset.obj \
$(SLO)$/impimagetree.obj \
$(SLO)$/pngread.obj \
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index 5b543258cb0b..6298ff51a16a 100644
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -1128,11 +1128,16 @@ namespace
{
inline int iround( float x )
{
- sal_Int32 a = *reinterpret_cast<const sal_Int32 *>(&x);
- sal_Int32 exponent = (127 + 31) - ((a >> 23) & 0xFF);
- sal_Int32 r = ((sal_Int32(a) << 8) | (1U << 31)) >> exponent;
+ union
+ {
+ float f;
+ sal_Int32 i;
+ };
+ f = x;
+ sal_Int32 exponent = (127 + 31) - ((i >> 23) & 0xFF);
+ sal_Int32 r = ((sal_Int32(i) << 8) | (1U << 31)) >> exponent;
r &= ((exponent - 32) >> 31);
- sal_Int32 sign = a >> 31;
+ sal_Int32 sign = i >> 31;
return r = (r ^ sign) - sign;
}
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index b6e0e1b8d441..51aad0790a26 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -56,10 +56,10 @@
#include <vcl/window.hxx>
#include <vcl/svapp.hxx>
#include <vcl/bmpacc.hxx>
-#include <vcl/fontcvt.hxx>
+#include <unotools/fontcvt.hxx>
#include <vcl/outdev.hxx>
#include <vcl/edit.hxx>
-#include <vcl/fontcfg.hxx>
+#include <unotools/fontcfg.hxx>
#include <vcl/sysdata.hxx>
#include <vcl/textlayout.hxx>
#ifndef _OSL_FILE_H
@@ -97,6 +97,7 @@
#include <memory>
#include <algorithm>
+
// =======================================================================
DBG_NAMEEX( OutputDevice )
@@ -108,6 +109,7 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::rtl;
using namespace ::vcl;
+using namespace ::utl;
// =======================================================================
@@ -305,451 +307,6 @@ void OutputDevice::ImplUpdateAllFontData( bool bNewFontLists )
// =======================================================================
-struct ImplLocalizedFontName
-{
- const char* mpEnglishName;
- const sal_Unicode* mpLocalizedNames;
-};
-
-static sal_Unicode const aBatang[] = { 0xBC14, 0xD0D5, 0, 0 };
-static sal_Unicode const aBatangChe[] = { 0xBC14, 0xD0D5, 0xCCB4, 0, 0 };
-static sal_Unicode const aGungsuh[] = { 0xAD81, 0xC11C, 0, 0 };
-static sal_Unicode const aGungsuhChe[] = { 0xAD81, 0xC11C, 0xCCB4, 0, 0 };
-static sal_Unicode const aGulim[] = { 0xAD74, 0xB9BC, 0, 0 };
-static sal_Unicode const aGulimChe[] = { 0xAD74, 0xB9BC, 0xCCB4, 0, 0 };
-static sal_Unicode const aDotum[] = { 0xB3CB, 0xC6C0, 0, 0 };
-static sal_Unicode const aDotumChe[] = { 0xB3CB, 0xC6C0, 0xCCB4, 0, 0 };
-static sal_Unicode const aSimSun[] = { 0x5B8B, 0x4F53, 0, 0 };
-static sal_Unicode const aNSimSun[] = { 0x65B0, 0x5B8B, 0x4F53, 0, 0 };
-static sal_Unicode const aSimHei[] = { 0x9ED1, 0x4F53, 0, 0 };
-static sal_Unicode const aSimKai[] = { 0x6977, 0x4F53, 0, 0 };
-static sal_Unicode const azycjkSun[] = { 0x4E2D, 0x6613, 0x5B8B, 0x4F53, 0, 0 };
-static sal_Unicode const azycjkHei[] = { 0x4E2D, 0x6613, 0x9ED1, 0x4F53, 0, 0 };
-static sal_Unicode const azycjkKai[] = { 0x4E2D, 0x6613, 0x6977, 0x4F53, 0, 0 };
-static sal_Unicode const aFZHei[] = { 0x65B9, 0x6B63, 0x9ED1, 0x4F53, 0, 0 };
-static sal_Unicode const aFZKai[] = { 0x65B9, 0x6B63, 0x6977, 0x4F53, 0, 0 };
-static sal_Unicode const aFZSongYI[] = { 0x65B9, 0x6B63, 0x5B8B, 0x4E00, 0, 0 };
-static sal_Unicode const aFZShuSong[] = { 0x65B9, 0x6B63, 0x4E66, 0x5B8B, 0, 0 };
-static sal_Unicode const aFZFangSong[] = { 0x65B9, 0x6B63, 0x4EFF, 0x5B8B, 0, 0 };
-// Attention: this fonts includes the wrong encoding vector - so we double the names with correct and wrong encoding
-// First one is the GB-Encoding (we think the correct one), second is the big5 encoded name
-static sal_Unicode const aMHei[] = { 'm', 0x7B80, 0x9ED1, 0, 'm', 0x6F60, 0x7AAA, 0, 0 };
-static sal_Unicode const aMKai[] = { 'm', 0x7B80, 0x6977, 0x566C, 0, 'm', 0x6F60, 0x7FF1, 0x628E, 0, 0 };
-static sal_Unicode const aMSong[] = { 'm', 0x7B80, 0x5B8B, 0, 'm', 0x6F60, 0x51BC, 0, 0 };
-static sal_Unicode const aCFangSong[] = { 'm', 0x7B80, 0x592B, 0x5B8B, 0, 'm', 0x6F60, 0x6E98, 0x51BC, 0, 0 };
-static sal_Unicode const aMingLiU[] = { 0x7D30, 0x660E, 0x9AD4, 0, 0 };
-static sal_Unicode const aPMingLiU[] = { 0x65B0, 0x7D30, 0x660E, 0x9AD4, 0, 0 };
-static sal_Unicode const aHei[] = { 0x6865, 0, 0 };
-static sal_Unicode const aKai[] = { 0x6B61, 0, 0 };
-static sal_Unicode const aMing[] = { 0x6D69, 0x6E67, 0, 0 };
-static sal_Unicode const aMSGothic[] = { 'm','s', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 };
-static sal_Unicode const aMSPGothic[] = { 'm','s','p', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 };
-static sal_Unicode const aMSMincho[] = { 'm', 's', 0x660E, 0x671D, 0 };
-static sal_Unicode const aMSPMincho[] = { 'm','s','p', 0x660E, 0x671D, 0 };
-static sal_Unicode const aMeiryo[] = { 0x30e1, 0x30a4, 0x30ea, 0x30aa, 0 };
-static sal_Unicode const aHGMinchoL[] = { 'h','g', 0x660E, 0x671D, 'l', 0, 0 };
-static sal_Unicode const aHGGothicB[] = { 'h','g', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 'b', 0 };
-static sal_Unicode const aHGPMinchoL[] = { 'h','g','p', 0x660E, 0x671D, 'l', 0 };
-static sal_Unicode const aHGPGothicB[] = { 'h','g','p', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 'b', 0 };
-static sal_Unicode const aHGMinchoLSun[] = { 'h','g', 0x660E, 0x671D, 'l', 's', 'u', 'n', 0 };
-static sal_Unicode const aHGPMinchoLSun[] = { 'h','g','p', 0x660E, 0x671D, 'l', 's', 'u', 'n', 0 };
-static sal_Unicode const aHGGothicBSun[] = { 'h', 'g', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 'b', 's', 'u', 'n', 0 };
-static sal_Unicode const aHGPGothicBSun[] = { 'h', 'g', 'p', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 'b', 's', 'u', 'n', 0 };
-static sal_Unicode const aHGHeiseiMin[] = { 'h', 'g', 0x5E73, 0x6210, 0x660E, 0x671D, 0x4F53, 0, 'h', 'g', 0x5E73, 0x6210, 0x660E, 0x671D, 0x4F53, 'w', '3', 'x', '1', '2', 0, 0 };
-static sal_Unicode const aIPAMincho[] = { 'i', 'p', 'a', 0x660E, 0x671D, 0 };
-static sal_Unicode const aIPAPMincho[] = { 'i', 'p', 'a', 'p', 0x660E, 0x671D, 0 };
-static sal_Unicode const aIPAGothic[] = { 'i', 'p', 'a', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
-static sal_Unicode const aIPAPGothic[] = { 'i', 'p', 'a', 'p', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
-static sal_Unicode const aIPAUIGothic[] = { 'i', 'p', 'a', 'u', 'i', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
-static sal_Unicode const aSazanamiMincho[] = { 0x3055, 0x3056, 0x306A, 0x307F, 0x660E, 0x671D, 0, 0 };
-static sal_Unicode const aSazanamiGothic[] = { 0x3055, 0x3056, 0x306A, 0x307F, 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 };
-static sal_Unicode const aKochiMincho[] = { 0x6771, 0x98A8, 0x660E, 0x671D, 0, 0 };
-static sal_Unicode const aKochiGothic[] = { 0x6771, 0x98A8, 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 };
-static sal_Unicode const aSunDotum[] = { 0xC36C, 0xB3CB, 0xC6C0, 0, 0 };
-static sal_Unicode const aSunGulim[] = { 0xC36C, 0xAD74, 0xB9BC, 0, 0 };
-static sal_Unicode const aSunBatang[] = { 0xC36C, 0xBC14, 0xD0D5, 0, 0 };
-static sal_Unicode const aBaekmukDotum[] = { 0xBC31, 0xBB35, 0xB3CB, 0xC6C0, 0, 0 };
-static sal_Unicode const aBaekmukGulim[] = { 0xBC31, 0xBB35, 0xAD74, 0xB9BC, 0, 0 };
-static sal_Unicode const aBaekmukBatang[] = { 0xBC31, 0xBB35, 0xBC14, 0xD0D5, 0, 0 };
-static sal_Unicode const aFzMingTi[] = { 0x65B9, 0x6B63, 0x660E, 0x9AD4, 0, 0 };
-static sal_Unicode const aFzHeiTiTW[]= { 0x65B9, 0x6B63, 0x9ED1, 0x9AD4, 0, 0 };
-static sal_Unicode const aFzKaiTiTW[]= { 0x65B9, 0x6B63, 0x6977, 0x9AD4, 0, 0 };
-static sal_Unicode const aFzHeiTiCN[]= { 0x65B9, 0x6B63, 0x9ED1, 0x4F53, 0, 0 };
-static sal_Unicode const aFzKaiTiCN[]= { 0x65B9, 0x6B63, 0x6977, 0x4F53, 0, 0 };
-static sal_Unicode const aFzSongTi[] = { 0x65B9, 0x6B63, 0x5B8B, 0x4F53, 0, 0 };
-static sal_Unicode const aHYMyeongJoExtra[] = { 'h', 'y', 0xACAC, 0xBA85, 0xC870, 0, 0 };
-static sal_Unicode const aHYSinMyeongJoMedium[] = { 'h', 'y', 0xC2E0, 0xBA85, 0xC870, 0, 0 };
-static sal_Unicode const aHYGothicMedium[] = { 'h', 'y', 0xC911, 0xACE0, 0xB515, 0, 0 };
-static sal_Unicode const aHYGraphicMedium[] = { 'h', 'y', 0xADF8, 0xB798, 0xD53D, 'm', 0, 0 };
-static sal_Unicode const aHYGraphic[] = { 'h', 'y', 0xADF8, 0xB798, 0xD53D, 0, 0 };
-static sal_Unicode const aNewGulim[] = { 0xC0C8, 0xAD74, 0xB9BC, 0, 0 };
-static sal_Unicode const aSunGungseo[] = { 0xC36C, 0xAD81, 0xC11C, 0, 0 };
-static sal_Unicode const aHYGungSoBold[] = { 'h','y', 0xAD81, 0xC11C, 'b', 0, 0 };
-static sal_Unicode const aHYGungSo[] = { 'h','y', 0xAD81, 0xC11C, 0, 0 };
-static sal_Unicode const aSunHeadLine[] = { 0xC36C, 0xD5E4, 0xB4DC, 0xB77C, 0xC778, 0, 0 };
-static sal_Unicode const aHYHeadLineMedium[] = { 'h', 'y', 0xD5E4, 0xB4DC, 0xB77C, 0xC778, 'm', 0, 0 };
-static sal_Unicode const aHYHeadLine[] = { 'h', 'y', 0xD5E4, 0xB4DC, 0xB77C, 0xC778, 0, 0 };
-static sal_Unicode const aYetR[] = { 0xD734, 0xBA3C, 0xC61B, 0xCCB4, 0, 0 };
-static sal_Unicode const aHYGothicExtra[] = { 'h', 'y', 0xACAC, 0xACE0, 0xB515, 0, 0 };
-static sal_Unicode const aSunMokPan[] = { 0xC36C, 0xBAA9, 0xD310, 0, 0 };
-static sal_Unicode const aSunYeopseo[] = { 0xC36C, 0xC5FD, 0xC11C, 0, 0 };
-static sal_Unicode const aSunBaekSong[] = { 0xC36C, 0xBC31, 0xC1A1, 0, 0 };
-static sal_Unicode const aHYPostLight[] = { 'h', 'y', 0xC5FD, 0xC11C, 'l', 0, 0 };
-static sal_Unicode const aHYPost[] = { 'h', 'y', 0xC5FD, 0xC11C, 0, 0 };
-static sal_Unicode const aMagicR[] = { 0xD734, 0xBA3C, 0xB9E4, 0xC9C1, 0xCCB4, 0, 0 };
-static sal_Unicode const aSunCrystal[] = { 0xC36C, 0xD06C, 0xB9AC, 0xC2A4, 0xD0C8, 0, 0 };
-static sal_Unicode const aSunSaemmul[] = { 0xC36C, 0xC0D8, 0xBB3C, 0, 0 };
-static sal_Unicode const aHaansoftBatang[] = { 0xD55C, 0xCEF4, 0xBC14, 0xD0D5, 0, 0 };
-static sal_Unicode const aHaansoftDotum[] = { 0xD55C, 0xCEF4, 0xB3CB, 0xC6C0, 0, 0 };
-static sal_Unicode const aHyhaeseo[] = { 0xD55C, 0xC591, 0xD574, 0xC11C, 0, 0 };
-static sal_Unicode const aMDSol[] = { 'm', 'd', 0xC194, 0xCCB4, 0, 0 };
-static sal_Unicode const aMDGaesung[] = { 'm', 'd', 0xAC1C, 0xC131, 0xCCB4, 0, 0 };
-static sal_Unicode const aMDArt[] = { 'm', 'd', 0xC544, 0xD2B8, 0xCCB4, 0, 0 };
-static sal_Unicode const aMDAlong[] = { 'm', 'd', 0xC544, 0xB871, 0xCCB4, 0, 0 };
-static sal_Unicode const aMDEasop[] = { 'm', 'd', 0xC774, 0xC19D, 0xCCB4, 0, 0 };
-static sal_Unicode const aHYShortSamulMedium[] = { 'h', 'y', 0xC595, 0xC740, 0xC0D8, 0xBB3C, 'm', 0 };
-static sal_Unicode const aHYShortSamul[] = { 'h', 'y', 0xC595, 0xC740, 0xC0D8, 0xBB3C, 0 };
-static sal_Unicode const aHGGothicE[] = { 'h','g', 0xFF7A, 0xFF9E, 0xFF7C, 0xFF6F, 0xFF78, 'e', 0 };
-static sal_Unicode const aHGPGothicE[] = { 'h','g','p', 0xFF7A, 0xFF9E, 0xFF7C, 0xFF6F, 0xFF78, 'e', 0 };
-static sal_Unicode const aHGSGothicE[] = { 'h','g','s', 0xFF7A, 0xFF9E, 0xFF7C, 0xFF6F, 0xFF78, 'e', 0 };
-static sal_Unicode const aHGGothicM[] = { 'h','g', 0xFF7A, 0xFF9E, 0xFF7C, 0xFF6F, 0xFF78, 'm', 0 };
-static sal_Unicode const aHGPGothicM[] = { 'h','g','p', 0xFF7A, 0xFF9E, 0xFF7C, 0xFF6F, 0xFF78, 'm', 0 };
-static sal_Unicode const aHGSGothicM[] = { 'h','g','s', 0xFF7A, 0xFF9E, 0xFF7C, 0xFF6F, 0xFF78, 'm', 0 };
-static sal_Unicode const aHGGyoshotai[] = { 'h','g', 0x884C, 0x66F8, 0x4F53, 0 };
-static sal_Unicode const aHGPGyoshotai[] = { 'h','g','p', 0x884C, 0x66F8, 0x4F53, 0 };
-static sal_Unicode const aHGSGyoshotai[] = { 'h','g','s', 0x884C, 0x66F8, 0x4F53, 0 };
-static sal_Unicode const aHGKyokashotai[] = { 'h','g', 0x6559, 0x79D1, 0x66F8, 0x4F53, 0 };
-static sal_Unicode const aHGPKyokashotai[] = { 'h','g','p', 0x6559, 0x79D1, 0x66F8, 0x4F53, 0 };
-static sal_Unicode const aHGSKyokashotai[] = { 'h','g','s', 0x6559, 0x79D1, 0x66F8, 0x4F53, 0 };
-static sal_Unicode const aHGMinchoB[] = { 'h','g', 0x660E, 0x671D, 'b', 0 };
-static sal_Unicode const aHGPMinchoB[] = { 'h','g','p', 0x660E, 0x671D, 'b', 0 };
-static sal_Unicode const aHGSMinchoB[] = { 'h','g','s', 0x660E, 0x671D, 'b', 0 };
-static sal_Unicode const aHGMinchoE[] = { 'h','g', 0x660E, 0x671D, 'e', 0 };
-static sal_Unicode const aHGPMinchoE[] = { 'h','g','p', 0x660E, 0x671D, 'e', 0 };
-static sal_Unicode const aHGSMinchoE[] = { 'h','g','s', 0x660E, 0x671D, 'e', 0 };
-static sal_Unicode const aHGSoeiKakupoptai[] = { 'h','g', 0x5275,0x82F1,0x89D2,0xFF8E,
- 0xFF9F,0xFF6F,0xFF8C,0xFF9F,0x4F53,0};
-static sal_Unicode const aHGPSoeiKakupoptai[] = { 'h','g', 'p', 0x5275,0x82F1,0x89D2,0xFF8E,
- 0xFF9F,0xFF6F,0xFF8C,0xFF9F,0x4F53,0};
-static sal_Unicode const aHGSSoeiKakupoptai[] = { 'h','g', 's', 0x5275,0x82F1,0x89D2,0xFF8E,
- 0xFF9F,0xFF6F,0xFF8C,0xFF9F,0x4F53,0};
-static sal_Unicode const aHGSoeiPresenceEB[] = { 'h','g', 0x5275,0x82F1,0xFF8C,0xFF9F,
- 0xFF9A,0xFF7E,0xFF9E,0xFF9D,0xFF7D, 'e','b',0};
-static sal_Unicode const aHGPSoeiPresenceEB[] = { 'h','g','p', 0x5275,0x82F1,0xFF8C,0xFF9F,
- 0xFF9A,0xFF7E,0xFF9E,0xFF9D,0xFF7D, 'e','b',0};
-static sal_Unicode const aHGSSoeiPresenceEB[] = { 'h','g','s', 0x5275,0x82F1,0xFF8C,0xFF9F,
- 0xFF9A,0xFF7E,0xFF9E,0xFF9D,0xFF7D, 'e','b',0};
-static sal_Unicode const aHGSoeiKakugothicUB[] = { 'h','g', 0x5275,0x82F1,0x89D2,0xFF7A,
- 0xFF9E,0xFF7C,0xFF6F,0xFF78,'u','b',0};
-static sal_Unicode const aHGPSoeiKakugothicUB[] = { 'h','g','p', 0x5275,0x82F1,0x89D2,0xFF7A,
- 0xFF9E,0xFF7C,0xFF6F,0xFF78,'u','b',0};
-static sal_Unicode const aHGSSoeiKakugothicUB[] = { 'h','g','s', 0x5275,0x82F1,0x89D2,0xFF7A,
- 0xFF9E,0xFF7C,0xFF6F,0xFF78,'u','b',0};
-static sal_Unicode const aHGSeikaishotaiPRO[] = { 'h','g', 0x6B63,0x6977,0x66F8,0x4F53, '-','p','r','o',0};
-static sal_Unicode const aHGMaruGothicMPRO[] = { 'h','g', 0x4E38,0xFF7A,0xFF9E,0xFF7C,0xFF6F,0xFF78, '-','p','r','o',0};
-static sal_Unicode const aHiraginoMinchoPro[] = { 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x660E, 0x671D, 'p','r','o',0};
-static sal_Unicode const aHiraginoMinchoProN[] = { 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x660E, 0x671D, 'p','r','o','n',0};
-static sal_Unicode const aHiraginoKakuGothicPro[] = { 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x89D2, 0x30B4, 'p','r','o',0};
-static sal_Unicode const aHiraginoKakuGothicProN[] = { 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x89D2, 0x30B4, 'p','r','o','n',0};
-static sal_Unicode const aHiraginoMaruGothicPro[] = { 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x4E38, 0x30B4, 'p','r','o',0};
-static sal_Unicode const aHiraginoMaruGothicProN[] = { 0x30D2, 0x30E9, 0x30AE, 0x30CE, 0x4E38, 0x30B4, 'p','r','o','n',0};
-
-
-static ImplLocalizedFontName aImplLocalizedNamesList[] =
-{
-{ "batang", aBatang },
-{ "batangche", aBatangChe },
-{ "gungshu", aGungsuh },
-{ "gungshuche", aGungsuhChe },
-{ "gulim", aGulim },
-{ "gulimche", aGulimChe },
-{ "dotum", aDotum },
-{ "dotumche", aDotumChe },
-{ "simsun", aSimSun },
-{ "nsimsun", aNSimSun },
-{ "simhei", aSimHei },
-{ "simkai", aSimKai },
-{ "zycjksun", azycjkSun },
-{ "zycjkhei", azycjkHei },
-{ "zycjkkai", azycjkKai },
-{ "fzhei", aFZHei },
-{ "fzkai", aFZKai },
-{ "fzsong", aFZSongYI },
-{ "fzshusong", aFZShuSong },
-{ "fzfangsong", aFZFangSong },
-{ "mhei", aMHei },
-{ "mkai", aMKai },
-{ "msong", aMSong },
-{ "cfangsong", aCFangSong },
-{ "mingliu", aMingLiU },
-{ "pmingliu", aPMingLiU },
-{ "hei", aHei },
-{ "kai", aKai },
-{ "ming", aMing },
-{ "msgothic", aMSGothic },
-{ "mspgothic", aMSPGothic },
-{ "msmincho", aMSMincho },
-{ "mspmincho", aMSPMincho },
-{ "meiryo", aMeiryo },
-{ "hgminchol", aHGMinchoL },
-{ "hggothicb", aHGGothicB },
-{ "hgpminchol", aHGPMinchoL },
-{ "hgpgothicb", aHGPGothicB },
-{ "hgmincholsun", aHGMinchoLSun },
-{ "hggothicbsun", aHGGothicBSun },
-{ "hgpmincholsun", aHGPMinchoLSun },
-{ "hgpgothicbsun", aHGPGothicBSun },
-{ "hgheiseimin", aHGHeiseiMin },
-{ "ipamincho", aIPAMincho },
-{ "ipapmincho", aIPAPMincho },
-{ "ipagothic", aIPAGothic },
-{ "ipapgothic", aIPAPGothic },
-{ "ipauigothic", aIPAUIGothic },
-{ "sazanamimincho", aSazanamiMincho },
-{ "sazanamigothic", aSazanamiGothic },
-{ "kochimincho", aKochiMincho },
-{ "kochigothic", aKochiGothic },
-{ "sundotum", aSunDotum },
-{ "sungulim", aSunGulim },
-{ "sunbatang", aSunBatang },
-{ "baekmukdotum", aBaekmukDotum },
-{ "baekmukgulim", aBaekmukGulim },
-{ "baekmukbatang", aBaekmukBatang },
-{ "fzheiti", aFzHeiTiCN },
-{ "fzheiti", aFzHeiTiTW },
-{ "fzkaiti", aFzKaiTiCN },
-{ "fzkaitib", aFzKaiTiTW },
-{ "fzmingtib", aFzMingTi },
-{ "fzsongti", aFzSongTi },
-{ "hymyeongjoextra", aHYMyeongJoExtra },
-{ "hysinmyeongjomedium", aHYSinMyeongJoMedium },
-{ "hygothicmedium", aHYGothicMedium },
-{ "hygraphicmedium", aHYGraphicMedium },
-{ "hygraphic", aHYGraphic },
-{ "newgulim", aNewGulim },
-{ "sungungseo", aSunGungseo },
-{ "hygungsobold", aHYGungSoBold },
-{ "hygungso", aHYGungSo },
-{ "sunheadline", aSunHeadLine },
-{ "hyheadlinemedium", aHYHeadLineMedium },
-{ "hyheadline", aHYHeadLine },
-{ "yetr", aYetR },
-{ "hygothicextra", aHYGothicExtra },
-{ "sunmokpan", aSunMokPan },
-{ "sunyeopseo", aSunYeopseo },
-{ "sunbaeksong", aSunBaekSong },
-{ "hypostlight", aHYPostLight },
-{ "hypost", aHYPost },
-{ "magicr", aMagicR },
-{ "suncrystal", aSunCrystal },
-{ "sunsaemmul", aSunSaemmul },
-{ "hyshortsamulmedium", aHYShortSamulMedium },
-{ "hyshortsamul", aHYShortSamul },
-{ "haansoftbatang", aHaansoftBatang },
-{ "haansoftdotum", aHaansoftDotum },
-{ "hyhaeseo", aHyhaeseo },
-{ "mdsol", aMDSol },
-{ "mdgaesung", aMDGaesung },
-{ "mdart", aMDArt },
-{ "mdalong", aMDAlong },
-{ "mdeasop", aMDEasop },
-{ "hggothice", aHGGothicE },
-{ "hgpgothice", aHGPGothicE },
-{ "hgpothice", aHGSGothicE },
-{ "hggothicm", aHGGothicM },
-{ "hgpgothicm", aHGPGothicM },
-{ "hgpgothicm", aHGSGothicM },
-{ "hggyoshotai", aHGGyoshotai },
-{ "hgpgyoshotai", aHGPGyoshotai },
-{ "hgsgyoshotai", aHGSGyoshotai },
-{ "hgkyokashotai", aHGKyokashotai },
-{ "hgpkyokashotai", aHGPKyokashotai },
-{ "hgskyokashotai", aHGSKyokashotai },
-{ "hgminchob", aHGMinchoB },
-{ "hgpminchob", aHGPMinchoB },
-{ "hgsminchob", aHGSMinchoB },
-{ "hgminchoe", aHGMinchoE },
-{ "hgpminchoe", aHGPMinchoE },
-{ "hgsminchoe", aHGSMinchoE },
-{ "hgsoeikakupoptai", aHGSoeiKakupoptai },
-{ "hgpsoeikakupopta", aHGPSoeiKakupoptai },
-{ "hgssoeikakupopta", aHGSSoeiKakupoptai },
-{ "hgsoeipresenceeb", aHGSoeiPresenceEB },
-{ "hgpsoeipresenceeb", aHGPSoeiPresenceEB },
-{ "hgssoeipresenceeb", aHGSSoeiPresenceEB },
-{ "hgsoeikakugothicub", aHGSoeiKakugothicUB },
-{ "hgpsoeikakugothicub", aHGPSoeiKakugothicUB },
-{ "hgssoeikakugothicub", aHGSSoeiKakugothicUB },
-{ "hgseikaishotaipro", aHGSeikaishotaiPRO },
-{ "hgmarugothicmpro", aHGMaruGothicMPRO },
-{ "hiraginominchopro", aHiraginoMinchoPro },
-{ "hiraginominchopron", aHiraginoMinchoProN },
-{ "hiraginokakugothicpro", aHiraginoKakuGothicPro },
-{ "hiraginokakugothicpron", aHiraginoKakuGothicProN },
-{ "hiraginomarugothicpro", aHiraginoMaruGothicPro },
-{ "hiraginomarugothicpron", aHiraginoMaruGothicProN },
-{ NULL, NULL },
-};
-
-// -----------------------------------------------------------------------
-
-void ImplGetEnglishSearchFontName( String& rName )
-{
- bool bNeedTranslation = false;
- xub_StrLen nLen = rName.Len();
-
- // Remove trailing whitespaces
- xub_StrLen i = nLen;
- while ( i && (rName.GetChar( i-1 ) < 32) )
- i--;
- if ( i != nLen )
- rName.Erase( i );
-
- // Remove Script at the end
- // Scriptname must be the last part of the fontname and
- // looks like "fontname (scriptname)". So there can only be a
- // script name at the and of the fontname, when the last char is ')'
- if ( (nLen >= 3) && rName.GetChar( nLen-1 ) == ')' )
- {
- int nOpen = 1;
- xub_StrLen nTempLen = nLen-2;
- while ( nTempLen )
- {
- if ( rName.GetChar( nTempLen ) == '(' )
- {
- nOpen--;
- if ( !nOpen )
- {
- // Remove Space at the end
- if ( nTempLen && (rName.GetChar( nTempLen-1 ) == ' ') )
- nTempLen--;
- rName.Erase( nTempLen );
- nLen = nTempLen;
- break;
- }
- }
- if ( rName.GetChar( nTempLen ) == ')' )
- nOpen++;
- nTempLen--;
- }
- }
-
- // remove all whitespaces and converts to lower case ASCII
- // TODO: better transliteration to ASCII e.g. all digits
- i = 0;
- while ( i < nLen )
- {
- sal_Unicode c = rName.GetChar( i );
- if ( c > 127 )
- {
- // Translate to Lowercase-ASCII
- // FullWidth-ASCII to half ASCII
- if ( (c >= 0xFF00) && (c <= 0xFF5E) )
- {
- c -= 0xFF00-0x0020;
- // Upper to Lower
- if ( (c >= 'A') && (c <= 'Z') )
- c += 'a' - 'A';
- rName.SetChar( i, c );
- }
- else
- {
- // Only Fontnames with None-Ascii-Characters must be translated
- bNeedTranslation = true;
- }
- }
- // not lowercase Ascii
- else if ( !((c >= 'a') && (c <= 'z')) )
- {
- // To Lowercase-Ascii
- if ( (c >= 'A') && (c <= 'Z') )
- {
- c += 'a' - 'A';
- rName.SetChar( i, c );
- }
- else if( ((c < '0') || (c > '9')) && (c != ';') ) // not 0-9 or semicolon
- {
- // Remove white spaces and special characters
- rName.Erase( i, 1 );
- nLen--;
- continue;
- }
- }
-
- i++;
- }
-
- // translate normalized localized name to its normalized English ASCII name
- if( bNeedTranslation )
- {
- typedef std::hash_map<const String, const char*,FontNameHash> FontNameDictionary;
- static FontNameDictionary aDictionary( sizeof(aImplLocalizedNamesList) / sizeof(*aImplLocalizedNamesList) );
- // the font name dictionary needs to be intialized once
- if( aDictionary.empty() )
- {
- // TODO: check if all dictionary entries are already normalized?
- const ImplLocalizedFontName* pList = aImplLocalizedNamesList;
- for(; pList->mpEnglishName; ++pList )
- aDictionary[ pList->mpLocalizedNames ] = pList->mpEnglishName;
- }
-
- FontNameDictionary::const_iterator it = aDictionary.find( rName );
- if( it != aDictionary.end() )
- rName.AssignAscii( it->second );
- }
-}
-
-// -----------------------------------------------------------------------
-
-static String GetNextFontToken( const String& rTokenStr, xub_StrLen& rIndex )
-{
- // check for valid start index
- int nStringLen = rTokenStr.Len();
- if( rIndex >= nStringLen )
- {
- rIndex = STRING_NOTFOUND;
- return String();
- }
-
- // find the next token delimiter and return the token substring
- const sal_Unicode* pStr = rTokenStr.GetBuffer() + rIndex;
- const sal_Unicode* pEnd = rTokenStr.GetBuffer() + nStringLen;
- for(; pStr < pEnd; ++pStr )
- if( (*pStr == ';') || (*pStr == ',') )
- break;
-
- xub_StrLen nTokenStart = rIndex;
- xub_StrLen nTokenLen;
- if( pStr < pEnd )
- {
- rIndex = sal::static_int_cast<xub_StrLen>(pStr - rTokenStr.GetBuffer());
- nTokenLen = rIndex - nTokenStart;
- ++rIndex; // skip over token separator
- }
- else
- {
- // no token delimiter found => handle last token
- rIndex = STRING_NOTFOUND;
- nTokenLen = STRING_LEN;
-
- // optimize if the token string consists of just one token
- if( !nTokenStart )
- return rTokenStr;
- }
-
- return String( rTokenStr, nTokenStart, nTokenLen );
-}
-
-// TODO: get rid of this in another incompatible build with SW project.
-// SW's WW8 and RTF filters still use this (from fontcvt.hxx)
-String GetFontToken( const String& rTokenStr, xub_StrLen nToken, xub_StrLen& rIndex )
-{
- // skip nToken Tokens
- for( xub_StrLen i = 0; (i < nToken) && (rIndex != STRING_NOTFOUND); ++i )
- GetNextFontToken( rTokenStr, rIndex );
-
- return GetNextFontToken( rTokenStr, rIndex );
-}
// =======================================================================
@@ -813,8 +370,8 @@ ImplFontSubstEntry::ImplFontSubstEntry( const String& rFontName,
{
maSearchName = rFontName;
maSearchReplaceName = rSubstFontName;
- ImplGetEnglishSearchFontName( maSearchName );
- ImplGetEnglishSearchFontName( maSearchReplaceName );
+ GetEnglishSearchFontName( maSearchName );
+ GetEnglishSearchFontName( maSearchReplaceName );
}
// -----------------------------------------------------------------------
@@ -914,7 +471,7 @@ static void ImplFontSubstitute( String& rFontName,
{
#ifdef DBG_UTIL
String aTempName = rFontName;
- ImplGetEnglishSearchFontName( aTempName );
+ GetEnglishSearchFontName( aTempName );
DBG_ASSERT( aTempName == rFontName, "ImplFontSubstitute() called without a searchname" );
#endif
@@ -939,44 +496,6 @@ static void ImplFontSubstitute( String& rFontName,
}
}
-// =======================================================================
-
-static bool ImplIsFontToken( const String& rName, const String& rToken )
-{
- String aTempName;
- xub_StrLen nIndex = 0;
- do
- {
- aTempName = GetNextFontToken( rName, nIndex );
- if ( rToken == aTempName )
- return true;
- }
- while ( nIndex != STRING_NOTFOUND );
-
- return false;
-}
-
-// -----------------------------------------------------------------------
-
-static void ImplAppendFontToken( String& rName, const String& rNewToken )
-{
- if ( rName.Len() )
- {
- rName.Append( ';' );
- rName.Append( rNewToken );
- }
- else
- rName = rNewToken;
-}
-
-// -----------------------------------------------------------------------
-
-static void ImplAddTokenFontName( String& rName, const String& rNewToken )
-{
- if ( !ImplIsFontToken( rName, rNewToken ) )
- ImplAppendFontToken( rName, rNewToken );
-}
-
// -----------------------------------------------------------------------
Font OutputDevice::GetDefaultFont( USHORT nType, LanguageType eLang,
@@ -994,7 +513,7 @@ Font OutputDevice::GetDefaultFont( USHORT nType, LanguageType eLang,
MsLangId::convertLanguageToLocale( eLang, aLocale );
}
- DefaultFontConfiguration& rDefaults = *DefaultFontConfiguration::get();
+ utl::DefaultFontConfiguration& rDefaults = *utl::DefaultFontConfiguration::get();
String aSearch = rDefaults.getUserInterfaceFont( aLocale ); // ensure a fallback
String aDefault = rDefaults.getDefaultFont( aLocale, nType );
if( aDefault.Len() )
@@ -1073,11 +592,11 @@ Font OutputDevice::GetDefaultFont( USHORT nType, LanguageType eLang,
do
{
aSearchName = GetNextFontToken( aSearch, nIndex );
- ImplGetEnglishSearchFontName( aSearchName );
+ GetEnglishSearchFontName( aSearchName );
ImplDevFontListData* pFontFamily = pOutDev->mpFontList->ImplFindBySearchName( aSearchName );
if( pFontFamily )
{
- ImplAddTokenFontName( aName, pFontFamily->GetFamilyName() );
+ AddTokenFontName( aName, pFontFamily->GetFamilyName() );
if( nFlags & DEFAULTFONT_FLAGS_ONLYONE )
break;
}
@@ -1177,61 +696,6 @@ Font OutputDevice::GetDefaultFont( USHORT nType, LanguageType eLang,
// =======================================================================
-String GetSubsFontName( const String& rName, ULONG nFlags )
-{
- String aName;
-
- xub_StrLen nIndex = 0;
- String aOrgName = GetNextFontToken( rName, nIndex );
- ImplGetEnglishSearchFontName( aOrgName );
-
- // #93662# do not try to replace StarSymbol with MS only font
- if( nFlags == (SUBSFONT_MS|SUBSFONT_ONLYONE)
- && ( aOrgName.EqualsAscii( "starsymbol" )
- || aOrgName.EqualsAscii( "opensymbol" ) ) )
- return aName;
-
- const FontNameAttr* pAttr = FontSubstConfiguration::get()->getSubstInfo( aOrgName );
- if ( pAttr )
- {
- for( int i = 0; i < 3; i++ )
- {
- const ::std::vector< String >* pVector = NULL;
- switch( i )
- {
- case 0:
- if( nFlags & SUBSFONT_MS && pAttr->MSSubstitutions.size() )
- pVector = &pAttr->MSSubstitutions;
- break;
- case 1:
- if( nFlags & SUBSFONT_PS && pAttr->PSSubstitutions.size() )
- pVector = &pAttr->PSSubstitutions;
- break;
- case 2:
- if( nFlags & SUBSFONT_HTML && pAttr->HTMLSubstitutions.size() )
- pVector = &pAttr->HTMLSubstitutions;
- break;
- }
- if( ! pVector )
- continue;
- for( ::std::vector< String >::const_iterator it = pVector->begin(); it != pVector->end(); ++it )
- if( ! ImplIsFontToken( rName, *it ) )
- {
- ImplAppendFontToken( aName, *it );
- if( nFlags & SUBSFONT_ONLYONE )
- {
- i = 4;
- break;
- }
- }
- }
- }
-
- return aName;
-}
-
-// =======================================================================
-
static unsigned ImplIsCJKFont( const String& rFontName )
{
// Test, if Fontname includes CJK characters --> In this case we
@@ -1696,7 +1160,7 @@ bool ImplDevFontListData::AddFontFace( ImplFontData* pNewData )
// -----------------------------------------------------------------------
// get font attributes using the normalized font family name
-void ImplDevFontListData::InitMatchData( const vcl::FontSubstConfiguration& rFontSubst,
+void ImplDevFontListData::InitMatchData( const utl::FontSubstConfiguration& rFontSubst,
const String& rSearchName )
{
String aShortName;
@@ -1835,29 +1299,6 @@ void ImplDevFontList::Clear()
mbMatchData = false;
}
-// -----------------------------------------------------------------------
-
-// TODO: use a more generic String hash
-int FontNameHash::operator()( const String& rStr ) const
-{
- // this simple hash just has to be good enough for font names
- int nHash = 0;
- const int nLen = rStr.Len();
- const sal_Unicode* p = rStr.GetBuffer();
- switch( nLen )
- {
- default: nHash = (p[0]<<16) - (p[1]<<8) + p[2];
- nHash += nLen;
- p += nLen - 3;
- // fall through
- case 3: nHash += (p[2]<<16); // fall through
- case 2: nHash += (p[1]<<8); // fall through
- case 1: nHash += p[0]; // fall through
- case 0: break;
- };
-
- return nHash;
-}
// -----------------------------------------------------------------------
@@ -2004,7 +1445,7 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( ImplFontSelectData&
// call the hook to query the best matching glyph fallback font
if( mpFallbackHook->FindFontSubstitute( rFontSelData, rMissingCodes ) )
// apply outdev3.cxx specific fontname normalization
- ImplGetEnglishSearchFontName( rFontSelData.maSearchName );
+ GetEnglishSearchFontName( rFontSelData.maSearchName );
else
rFontSelData.maSearchName = String();
@@ -2059,7 +1500,7 @@ void ImplDevFontList::Add( ImplFontData* pNewData )
for( xub_StrLen nMapNameIndex = 0; nMapNameIndex != STRING_NOTFOUND; )
{
String aSearchName = pNewData->maName;
- ImplGetEnglishSearchFontName( aSearchName );
+ GetEnglishSearchFontName( aSearchName );
DevFontList::const_iterator it = maDevFontList.find( aSearchName );
ImplDevFontListData* pFoundData = NULL;
@@ -2096,7 +1537,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindBySearchName( const String& rSearc
{
#ifdef DEBUG
String aTempName = rSearchName;
- ImplGetEnglishSearchFontName( aTempName );
+ GetEnglishSearchFontName( aTempName );
DBG_ASSERT( aTempName == rSearchName, "ImplDevFontList::ImplFindBySearchName() called with non-normalized name" );
#endif
@@ -2151,7 +1592,7 @@ ImplDevFontListData* ImplDevFontList::FindFontFamily( const String& rFontName )
{
// normalize the font fomily name and
String aName = rFontName;
- ImplGetEnglishSearchFontName( aName );
+ GetEnglishSearchFontName( aName );
ImplDevFontListData* pFound = ImplFindBySearchName( aName );
return pFound;
}
@@ -2168,7 +1609,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByTokenNames( const String& rToken
String aSearchName = GetNextFontToken( rTokenStr, nTokenPos );
if( !aSearchName.Len() )
continue;
- ImplGetEnglishSearchFontName( aSearchName );
+ GetEnglishSearchFontName( aSearchName );
pFoundData = ImplFindBySearchName( aSearchName );
if( pFoundData )
break;
@@ -2179,7 +1620,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByTokenNames( const String& rToken
// -----------------------------------------------------------------------
-ImplDevFontListData* ImplDevFontList::ImplFindBySubstFontAttr( const vcl::FontNameAttr& rFontAttr ) const
+ImplDevFontListData* ImplDevFontList::ImplFindBySubstFontAttr( const utl::FontNameAttr& rFontAttr ) const
{
ImplDevFontListData* pFoundData = NULL;
@@ -2188,7 +1629,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindBySubstFontAttr( const vcl::FontNa
for(; it != rFontAttr.Substitutions.end(); ++it )
{
String aSearchName( *it );
- ImplGetEnglishSearchFontName( aSearchName );
+ GetEnglishSearchFontName( aSearchName );
pFoundData = ImplFindBySearchName( aSearchName );
if( pFoundData )
@@ -2934,7 +2375,7 @@ ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList,
// if we found a different symbol font we need a symbol conversion table
if( pFontData->IsSymbolFont() )
if( aFontSelData.maTargetName != aFontSelData.maSearchName )
- pEntry->mpConversion = ImplGetRecodeData( aFontSelData.maTargetName, aFontSelData.maSearchName );
+ pEntry->mpConversion = ConvertChar::GetRecodeData( aFontSelData.maTargetName, aFontSelData.maSearchName );
// add the new entry to the cache
maFontInstanceList[ aFontSelData ] = pEntry;
@@ -2982,7 +2423,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD,
#endif
- ImplGetEnglishSearchFontName( aSearchName );
+ GetEnglishSearchFontName( aSearchName );
ImplFontSubstitute( aSearchName, nSubstFlags, pDevSpecific );
// #114999# special emboldening for Ricoh fonts
// TODO: smarter check for special cases by using PreMatch infrastructure?
@@ -3030,7 +2471,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD,
#endif
if( mpPreMatchHook )
if( mpPreMatchHook->FindFontSubstitute( rFSD ) )
- ImplGetEnglishSearchFontName( aSearchName );
+ GetEnglishSearchFontName( aSearchName );
#ifdef ENABLE_GRAPHITE
// the prematch hook uses the target name to search, but we now need
// to restore the features to make the font selection data unique
@@ -3057,13 +2498,13 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD,
{
rFSD.maTargetName = GetNextFontToken( rFSD.maName, nTokenPos );
aSearchName = rFSD.maTargetName;
- ImplGetEnglishSearchFontName( aSearchName );
+ GetEnglishSearchFontName( aSearchName );
}
else
nTokenPos = STRING_NOTFOUND;
if( mpPreMatchHook )
if( mpPreMatchHook->FindFontSubstitute( rFSD ) )
- ImplGetEnglishSearchFontName( aSearchName );
+ GetEnglishSearchFontName( aSearchName );
ImplFontSubstitute( aSearchName, nSubstFlags, pDevSpecific );
ImplDevFontListData* pFoundData = ImplFindBySearchName( aSearchName );
if( pFoundData )
@@ -3077,7 +2518,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD,
nTokenPos = 0;
rFSD.maTargetName = GetNextFontToken( rFSD.maName, nTokenPos );
aSearchName = rFSD.maTargetName;
- ImplGetEnglishSearchFontName( aSearchName );
+ GetEnglishSearchFontName( aSearchName );
}
String aSearchShortName;
@@ -3152,7 +2593,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD,
continue;
aSearchName = rFSD.maTargetName;
- ImplGetEnglishSearchFontName( aSearchName );
+ GetEnglishSearchFontName( aSearchName );
String aTempShortName;
String aTempFamilyName;
@@ -6488,7 +5929,7 @@ SalLayout* OutputDevice::ImplLayout( const String& rOrigStr,
// convert from logical units to physical units
// recode string if needed
if( mpFontEntry->mpConversion )
- ImplRecodeString( mpFontEntry->mpConversion, aStr, 0, aStr.Len() );
+ mpFontEntry->mpConversion->RecodeString( aStr, 0, aStr.Len() );
long nPixelWidth = nLogicalWidth;
if( nLogicalWidth && mbMap )
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index dd2f4a62c88d..4146f1764204 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2847,6 +2847,121 @@ static bool getPfbSegmentLengths( const unsigned char* pFontBytes, int nByteLen,
return true;
}
+std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const ImplFontData* pFont, EmbedFont& rEmbed )
+{
+ std::map< sal_Int32, sal_Int32 > aRet;
+ if( isBuiltinFont( pFont ) )
+ {
+ aRet[ rEmbed.m_nNormalFontID ] = emitBuiltinFont( pFont );
+ return aRet;
+ }
+
+ sal_Int32 nFontObject = 0;
+ sal_Int32 nFontDescriptor = 0;
+ rtl::OString aSubType( "/Type1" );
+ FontSubsetInfo aInfo;
+ // fill in dummy values
+ aInfo.m_nAscent = 1000;
+ aInfo.m_nDescent = 200;
+ aInfo.m_nCapHeight = 1000;
+ aInfo.m_aFontBBox = Rectangle( Point( -200, -200 ), Size( 1700, 1700 ) );
+ aInfo.m_aPSName = pFont->maName;
+ sal_Int32 pWidths[256];
+ rtl_zeroMemory( pWidths, sizeof(pWidths) );
+ if( pFont->IsEmbeddable() )
+ {
+ const unsigned char* pFontData = NULL;
+ long nFontLen = 0;
+ sal_Ucs nEncodedCodes[256];
+ sal_Int32 pEncWidths[256];
+ if( (pFontData = (const unsigned char*)m_pReferenceDevice->mpGraphics->GetEmbedFontData( pFont, nEncodedCodes, pEncWidths, aInfo, &nFontLen )) != NULL )
+ {
+ m_pReferenceDevice->mpGraphics->FreeEmbedFontData( pFontData, nFontLen );
+ for( int i = 0; i < 256; i++ )
+ {
+ if( nEncodedCodes[i] >= 32 && nEncodedCodes[i] < 256 )
+ {
+ pWidths[i] = pEncWidths[ i ];
+ }
+ }
+ }
+ }
+ else if( pFont->mbSubsettable )
+ {
+ aSubType = rtl::OString( "/TrueType" );
+ Int32Vector aGlyphWidths;
+ Ucs2UIntMap aUnicodeMap;
+ m_pReferenceDevice->mpGraphics->GetGlyphWidths( pFont, false, aGlyphWidths, aUnicodeMap );
+
+ OUString aTmpName;
+ osl_createTempFile( NULL, NULL, &aTmpName.pData );
+ sal_Int32 pGlyphIDs[ 256 ];
+ sal_uInt8 pEncoding[ 256 ];
+ sal_Ucs pUnicodes[ 256 ];
+ sal_Int32 pDuWidths[ 256 ];
+
+ memset( pGlyphIDs, 0, sizeof( pGlyphIDs ) );
+ memset( pEncoding, 0, sizeof( pEncoding ) );
+ memset( pUnicodes, 0, sizeof( pUnicodes ) );
+ memset( pDuWidths, 0, sizeof( pDuWidths ) );
+
+ for( sal_Ucs c = 32; c < 256; c++ )
+ {
+ pUnicodes[c] = c;
+ pEncoding[c] = c;
+ pGlyphIDs[c] = 0;
+ if( aUnicodeMap.find( c ) != aUnicodeMap.end() )
+ pWidths[ c ] = aGlyphWidths[ aUnicodeMap[ c ] ];
+ }
+
+ m_pReferenceDevice->mpGraphics->CreateFontSubset( aTmpName, pFont, pGlyphIDs, pEncoding, pDuWidths, 256, aInfo );
+ osl_removeFile( aTmpName.pData );
+ }
+ else
+ {
+ DBG_ERROR( "system font neither embeddable nor subsettable" );
+ }
+
+ // write font descriptor
+ nFontDescriptor = emitFontDescriptor( pFont, aInfo, 0, 0 );
+ if( nFontDescriptor )
+ {
+ // write font object
+ sal_Int32 nObject = createObject();
+ if( updateObject( nObject ) )
+ {
+ OStringBuffer aLine( 1024 );
+ aLine.append( nObject );
+ aLine.append( " 0 obj\n"
+ "<</Type/Font/Subtype" );
+ aLine.append( aSubType );
+ aLine.append( "/BaseFont/" );
+ appendName( aInfo.m_aPSName, aLine );
+ aLine.append( "\n" );
+ if( !pFont->mbSymbolFlag )
+ aLine.append( "/Encoding/WinAnsiEncoding\n" );
+ aLine.append( "/FirstChar 32 /LastChar 255\n"
+ "/Widths[" );
+ for( int i = 32; i < 256; i++ )
+ {
+ aLine.append( pWidths[i] );
+ aLine.append( ((i&15) == 15) ? "\n" : " " );
+ }
+ aLine.append( "]\n"
+ "/FontDescriptor " );
+ aLine.append( nFontDescriptor );
+ aLine.append( " 0 R>>\n"
+ "endobj\n\n" );
+ writeBuffer( aLine.getStr(), aLine.getLength() );
+
+ nFontObject = nObject;
+ aRet[ rEmbed.m_nNormalFontID ] = nObject;
+ }
+ }
+
+ return aRet;
+}
+
// TODO: always subset instead of embedding the full font => this method becomes obsolete then
std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFontData* pFont, EmbedFont& rEmbed )
{
@@ -3606,24 +3721,28 @@ sal_Int32 PDFWriterImpl::emitFontDescriptor( const ImplFontData* pFont, FontSubs
// According to PDF reference 1.4 StemV is required
// seems a tad strange to me, but well ...
aLine.append( "\n"
- "/StemV 80\n"
- "/FontFile" );
- switch( rInfo.m_nFontType )
+ "/StemV 80\n" );
+ if( nFontStream )
{
- case FontSubsetInfo::SFNT_TTF:
- aLine.append( '2' );
- break;
- case FontSubsetInfo::TYPE1_PFA:
- case FontSubsetInfo::TYPE1_PFB:
- case FontSubsetInfo::ANY_TYPE1:
- break;
- default:
- DBG_ERROR( "unknown fonttype in PDF font descriptor" );
- return 0;
+ aLine.append( "/FontFile" );
+ switch( rInfo.m_nFontType )
+ {
+ case FontSubsetInfo::SFNT_TTF:
+ aLine.append( '2' );
+ break;
+ case FontSubsetInfo::TYPE1_PFA:
+ case FontSubsetInfo::TYPE1_PFB:
+ case FontSubsetInfo::ANY_TYPE1:
+ break;
+ default:
+ DBG_ERROR( "unknown fonttype in PDF font descriptor" );
+ return 0;
+ }
+ aLine.append( ' ' );
+ aLine.append( nFontStream );
+ aLine.append( " 0 R\n" );
}
- aLine.append( ' ' );
- aLine.append( nFontStream );
- aLine.append( " 0 R>>\n"
+ aLine.append( ">>\n"
"endobj\n\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
@@ -3880,6 +3999,17 @@ bool PDFWriterImpl::emitFonts()
}
}
+ // emit system fonts
+ for( FontEmbedData::iterator sit = m_aSystemFonts.begin(); sit != m_aSystemFonts.end(); ++sit )
+ {
+ std::map< sal_Int32, sal_Int32 > aObjects = emitSystemFont( sit->first, sit->second );
+ for( std::map< sal_Int32, sal_Int32 >::iterator fit = aObjects.begin(); fit != aObjects.end(); ++fit )
+ {
+ CHECK_RETURN( fit->second );
+ aFontIDToObject[ fit->first ] = fit->second;
+ }
+ }
+
OStringBuffer aFontDict( 1024 );
aFontDict.append( getFontDictObject() );
aFontDict.append( " 0 obj\n"
@@ -4580,13 +4710,25 @@ void PDFWriterImpl::createDefaultEditAppearance( PDFWidget& rEdit, const PDFWrit
// prepare font to use, draw field border
Font aFont = drawFieldBorder( rEdit, rWidget, rSettings );
- sal_Int32 nBest = getBestBuiltinFont( aFont );
+ sal_Int32 nBest = m_aContext.FieldsUseSystemFonts ? getSystemFont( aFont ): getBestBuiltinFont( aFont );
// prepare DA string
OStringBuffer aDA( 32 );
appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetFieldTextColor() ), aDA );
aDA.append( ' ' );
- aDA.append( m_aBuiltinFonts[nBest].getNameObject() );
+ if( m_aContext.FieldsUseSystemFonts )
+ {
+ aDA.append( "/F" );
+ aDA.append( nBest );
+
+ OStringBuffer aDR( 32 );
+ aDR.append( "/Font " );
+ aDR.append( getFontDictObject() );
+ aDR.append( " 0 R" );
+ rEdit.m_aDRDict = aDR.makeStringAndClear();
+ }
+ else
+ aDA.append( m_aBuiltinFonts[nBest].getNameObject() );
aDA.append( ' ' );
m_aPages[ m_nCurrentPage ].appendMappedLength( sal_Int32( aFont.GetHeight() ), aDA );
aDA.append( " Tf" );
@@ -4620,7 +4762,7 @@ void PDFWriterImpl::createDefaultListBoxAppearance( PDFWidget& rBox, const PDFWr
// prepare font to use, draw field border
Font aFont = drawFieldBorder( rBox, rWidget, rSettings );
- sal_Int32 nBest = getBestBuiltinFont( aFont );
+ sal_Int32 nBest = m_aContext.FieldsUseSystemFonts ? getSystemFont( aFont ): getBestBuiltinFont( aFont );
beginRedirect( pListBoxStream, rBox.m_aRect );
OStringBuffer aAppearance( 64 );
@@ -4668,9 +4810,22 @@ void PDFWriterImpl::createDefaultListBoxAppearance( PDFWidget& rBox, const PDFWr
aDA.append( " 2 Tr " );
}
#endif
+ // prepare DA string
appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetFieldTextColor() ), aDA );
aDA.append( ' ' );
- aDA.append( m_aBuiltinFonts[nBest].getNameObject() );
+ if( m_aContext.FieldsUseSystemFonts )
+ {
+ aDA.append( "/F" );
+ aDA.append( nBest );
+
+ OStringBuffer aDR( 32 );
+ aDR.append( "/Font " );
+ aDR.append( getFontDictObject() );
+ aDR.append( " 0 R" );
+ rBox.m_aDRDict = aDR.makeStringAndClear();
+ }
+ else
+ aDA.append( m_aBuiltinFonts[nBest].getNameObject() );
aDA.append( ' ' );
m_aPages[ m_nCurrentPage ].appendMappedLength( sal_Int32( aFont.GetHeight() ), aDA );
aDA.append( " Tf" );
@@ -5247,9 +5402,18 @@ bool PDFWriterImpl::emitWidgetAnnotations()
}
if( rWidget.m_aDAString.getLength() )
{
- aLine.append( "/DR<</Font<<" );
- appendBuiltinFontsToDict( aLine );
- aLine.append( ">>>>\n" );
+ if( rWidget.m_aDRDict.getLength() )
+ {
+ aLine.append( "/DR<<" );
+ aLine.append( rWidget.m_aDRDict );
+ aLine.append( ">>\n" );
+ }
+ else
+ {
+ aLine.append( "/DR<</Font<<" );
+ appendBuiltinFontsToDict( aLine );
+ aLine.append( ">>>>\n" );
+ }
aLine.append( "/DA" );
appendLiteralStringEncrypt( rWidget.m_aDAString, rWidget.m_nObject, aLine );
aLine.append( "\n" );
@@ -6390,6 +6554,29 @@ std::set< PDFWriter::ErrorCode > PDFWriterImpl::getErrors()
return m_aErrors;
}
+sal_Int32 PDFWriterImpl::getSystemFont( const Font& i_rFont )
+{
+ getReferenceDevice()->Push();
+ getReferenceDevice()->SetFont( i_rFont );
+ getReferenceDevice()->ImplNewFont();
+
+ const ImplFontData* pDevFont = m_pReferenceDevice->mpFontEntry->maFontSelData.mpFontData;
+ sal_Int32 nFontID = 0;
+ FontEmbedData::iterator it = m_aSystemFonts.find( pDevFont );
+ if( it != m_aSystemFonts.end() )
+ nFontID = it->second.m_nNormalFontID;
+ else
+ {
+ nFontID = m_nNextFID++;
+ m_aSystemFonts[ pDevFont ] = EmbedFont();
+ m_aSystemFonts[ pDevFont ].m_nNormalFontID = nFontID;
+ }
+
+ getReferenceDevice()->Pop();
+ getReferenceDevice()->ImplNewFont();
+
+ return nFontID;
+}
void PDFWriterImpl::registerGlyphs( int nGlyphs,
sal_GlyphId* pGlyphs,
@@ -10145,12 +10332,17 @@ void PDFWriterImpl::setFont( const Font& rFont )
void PDFWriterImpl::push( sal_uInt16 nFlags )
{
+ OSL_ENSURE( m_aGraphicsStack.size() > 0, "invalid graphics stack" );
m_aGraphicsStack.push_front( m_aGraphicsStack.front() );
m_aGraphicsStack.front().m_nFlags = nFlags;
}
void PDFWriterImpl::pop()
{
+ OSL_ENSURE( m_aGraphicsStack.size() > 1, "pop without push" );
+ if( m_aGraphicsStack.size() < 2 )
+ return;
+
GraphicsState aState = m_aGraphicsStack.front();
m_aGraphicsStack.pop_front();
GraphicsState& rOld = m_aGraphicsStack.front();
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 7d5ec2bf4f61..e058cfa487db 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -311,6 +311,8 @@ public:
{
sal_Int32 m_nNormalFontID;
std::list< EmbedEncoding > m_aExtendedEncodings;
+
+ EmbedFont() : m_nNormalFontID( 0 ) {}
};
typedef std::map< const ImplFontData*, EmbedFont > FontEmbedData;
@@ -396,6 +398,7 @@ public:
USHORT m_nTextStyle;
rtl::OUString m_aValue;
rtl::OString m_aDAString;
+ rtl::OString m_aDRDict;
rtl::OString m_aMKDict;
rtl::OString m_aMKDictCAString; // i12626, added to be able to encrypt the /CA text string
// since the object number is not known at the moment
@@ -612,6 +615,7 @@ private:
FontSubsetData m_aSubsets;
bool m_bEmbedStandardFonts;
FontEmbedData m_aEmbeddedFonts;
+ FontEmbedData m_aSystemFonts;
sal_Int32 m_nNextFID;
PDFFontCache m_aFontCache;
@@ -679,6 +683,7 @@ private:
m_aOverlineColor( COL_TRANSPARENT ),
m_nAntiAlias( 1 ),
m_nLayoutMode( 0 ),
+ m_aDigitLanguage( 0 ),
m_nTransparentPercent( 0 ),
m_nFlags( 0xffff ),
m_nUpdateFlags( 0xffff )
@@ -693,6 +698,7 @@ private:
m_aClipRegion( rState.m_aClipRegion ),
m_nAntiAlias( rState.m_nAntiAlias ),
m_nLayoutMode( rState.m_nLayoutMode ),
+ m_aDigitLanguage( rState.m_aDigitLanguage ),
m_nTransparentPercent( rState.m_nTransparentPercent ),
m_nFlags( rState.m_nFlags ),
m_nUpdateFlags( rState.m_nUpdateFlags )
@@ -710,6 +716,7 @@ private:
m_aClipRegion = rState.m_aClipRegion;
m_nAntiAlias = rState.m_nAntiAlias;
m_nLayoutMode = rState.m_nLayoutMode;
+ m_aDigitLanguage = rState.m_aDigitLanguage;
m_nTransparentPercent = rState.m_nTransparentPercent;
m_nFlags = rState.m_nFlags;
m_nUpdateFlags = rState.m_nUpdateFlags;
@@ -897,6 +904,8 @@ i12626
sal_Int32 emitBuiltinFont( const ImplFontData*, sal_Int32 nObject = -1 );
/* writes a type1 embedded font object and returns its mapping from font ids to object ids (or 0 in case of failure ) */
std::map< sal_Int32, sal_Int32 > emitEmbeddedFont( const ImplFontData*, EmbedFont& );
+ /* writes a type1 system font object and returns its mapping from font ids to object ids (or 0 in case of failure ) */
+ std::map< sal_Int32, sal_Int32 > emitSystemFont( const ImplFontData*, EmbedFont& );
/* writes a font descriptor and returns its object id (or 0) */
sal_Int32 emitFontDescriptor( const ImplFontData*, FontSubsetInfo&, sal_Int32 nSubsetID, sal_Int32 nStream );
/* writes a ToUnicode cmap, returns the corresponding stream object */
@@ -983,6 +992,7 @@ i12626
sal_Int32 findRadioGroupWidget( const PDFWriter::RadioButtonWidget& rRadio );
Font replaceFont( const Font& rControlFont, const Font& rAppSetFont );
sal_Int32 getBestBuiltinFont( const Font& rFont );
+ sal_Int32 getSystemFont( const Font& i_rFont );
// used for edit and listbox
Font drawFieldBorder( PDFWidget&, const PDFWriter::AnyWidget&, const StyleSettings& );
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index 5314837143de..66865759db4b 100644
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -2459,6 +2459,14 @@ SvStream& operator>>( SvStream& rIStrm, Region& rRegion )
}
}
+ if( rIStrm.IsEof() )
+ {
+ DBG_ERROR( "premature end of region stream" );
+ delete rRegion.mpImplRegion;
+ rRegion.mpImplRegion = (ImplRegion*)&aImplEmptyRegion;
+ return rIStrm;
+ }
+
// get next header
rIStrm >> nTmp16;
}
diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx
index 71373bbabee5..36064fc8bc6b 100644
--- a/vcl/source/window/accmgr.cxx
+++ b/vcl/source/window/accmgr.cxx
@@ -83,6 +83,23 @@ void ImplAccelManager::RemoveAccel( Accelerator* pAccel )
if ( !mpAccelList )
return;
+ //e.g. #i90599#. Someone starts typing a sequence in a dialog, but doesn't
+ //end it, and then closes the dialog, deleting the accelerators. So if
+ //we're removing an accelerator that a sub-accelerator which is in the
+ //sequence list, throw away the entire sequence
+ if ( mpSequenceList )
+ {
+ for (USHORT i = 0; i < pAccel->GetItemCount(); ++i)
+ {
+ Accelerator* pSubAccel = pAccel->GetAccel(pAccel->GetItemId(i));
+ if ( mpSequenceList->GetPos( pSubAccel ) != LIST_ENTRY_NOTFOUND )
+ {
+ EndSequence( true );
+ break;
+ }
+ }
+ }
+
// Raus damit
mpAccelList->Remove( pAccel );
}
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 1fc2b9be703a..997e63d8b22e 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -453,6 +453,14 @@ Dialog::~Dialog()
// -----------------------------------------------------------------------
+IMPL_LINK( Dialog, ImplAsyncCloseHdl, void*, EMPTYARG )
+{
+ Close();
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
long Dialog::Notify( NotifyEvent& rNEvt )
{
// Zuerst Basisklasse rufen wegen TabSteuerung
@@ -468,7 +476,11 @@ long Dialog::Notify( NotifyEvent& rNEvt )
if ( (nKeyCode == KEY_ESCAPE) &&
((GetStyle() & WB_CLOSEABLE) || ImplGetCancelButton( this ) || ImplGetOKButton( this )) )
{
- Close();
+ // #i89505# for the benefit of slightly mentally challenged implementations
+ // like e.g. SfxModelessDialog which destroy themselves inside Close()
+ // post this Close asynchronous so we can leave our key handler before
+ // we get destroyed
+ PostUserEvent( LINK( this, Dialog, ImplAsyncCloseHdl ), this );
return TRUE;
}
}
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index f3ce8b2d05ea..2d99fbb20b65 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -62,6 +62,7 @@ public:
TaskPaneList* mpTaskPaneList;
Size maMaxOutSize;
+ rtl::OUString maRepresentedURL;
};
SystemWindow::ImplData::ImplData()
@@ -277,6 +278,29 @@ void SystemWindow::SetZLevel( BYTE nLevel )
// -----------------------------------------------------------------------
+void SystemWindow::SetRepresentedURL( const rtl::OUString& i_rURL )
+{
+ bool bChanged = (i_rURL != mpImplData->maRepresentedURL);
+ mpImplData->maRepresentedURL = i_rURL;
+ if ( !mbSysChild && bChanged )
+ {
+ const Window* pWindow = this;
+ while ( pWindow->mpWindowImpl->mpBorderWindow )
+ pWindow = pWindow->mpWindowImpl->mpBorderWindow;
+
+ if ( pWindow->mpWindowImpl->mbFrame )
+ pWindow->mpWindowImpl->mpFrame->SetRepresentedURL( i_rURL );
+ }
+}
+// -----------------------------------------------------------------------
+
+const rtl::OUString& SystemWindow::GetRepresentedURL() const
+{
+ return mpImplData->maRepresentedURL;
+}
+
+// -----------------------------------------------------------------------
+
void SystemWindow::SetIcon( USHORT nIcon )
{
if ( mnIcon == nIcon )
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 9ec86fab20de..ecc335420f18 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1002,6 +1002,9 @@ const Size& ToolBox::GetDefaultImageSize() const
case STYLE_SYMBOLS_CRYSTAL:
aLargeButtonSize = Size( TB_LARGEIMAGESIZE_CRYSTAL, TB_LARGEIMAGESIZE_CRYSTAL );
break;
+ case STYLE_SYMBOLS_OXYGEN:
+ aLargeButtonSize = Size( TB_LARGEIMAGESIZE_OXYGEN, TB_LARGEIMAGESIZE_OXYGEN );
+ break;
default:
aLargeButtonSize = Size( TB_LARGEIMAGESIZE, TB_LARGEIMAGESIZE );
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 371f962c45ac..bcf86c749673 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -68,7 +68,7 @@
#include "vcl/wall.hxx"
#include "vcl/gradient.hxx"
#include "vcl/toolbox.h"
-#include "vcl/fontcfg.hxx"
+#include "unotools/fontcfg.hxx"
#include "vcl/sysdata.hxx"
#include "vcl/sallayout.hxx"
#include "vcl/button.hxx" // Button::GetStandardText
@@ -310,7 +310,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
if ( !bUseSystemFont )
{
ImplInitFontList();
- String aConfigFont = vcl::DefaultFontConfiguration::get()->getUserInterfaceFont( rSettings.GetUILocale() );
+ String aConfigFont = utl::DefaultFontConfiguration::get()->getUserInterfaceFont( rSettings.GetUILocale() );
xub_StrLen nIndex = 0;
while( nIndex != STRING_NOTFOUND )
{
diff --git a/vcl/unx/gtk/a11y/atktext.cxx b/vcl/unx/gtk/a11y/atktext.cxx
index 8d83ca008e4a..0a97e5ba1ca6 100644
--- a/vcl/unx/gtk/a11y/atktext.cxx
+++ b/vcl/unx/gtk/a11y/atktext.cxx
@@ -187,8 +187,16 @@ static accessibility::XAccessibleTextMarkup*
if( !pWrap->mpTextMarkup && pWrap->mpContext )
{
uno::Any any = pWrap->mpContext->queryInterface( accessibility::XAccessibleTextMarkup::static_type(NULL) );
- pWrap->mpTextMarkup = reinterpret_cast< accessibility::XAccessibleTextMarkup * > (any.pReserved);
- pWrap->mpTextMarkup->acquire();
+ /* Since this not a dedicated interface in Atk and thus has not
+ * been queried during wrapper initialization, we need to check
+ * the return value here.
+ */
+ if( typelib_TypeClass_INTERFACE == any.pType->eTypeClass )
+ {
+ pWrap->mpTextMarkup = reinterpret_cast< accessibility::XAccessibleTextMarkup * > (any.pReserved);
+ if( pWrap->mpTextMarkup )
+ pWrap->mpTextMarkup->acquire();
+ }
}
return pWrap->mpTextMarkup;
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 99a331be2318..92ff2d3b8d8e 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -2377,6 +2377,11 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc
}
}
+ // free xrender resources
+ for( unsigned int i = 0; i < sizeof(m_aGraphics)/sizeof(m_aGraphics[0]); i++ )
+ if( m_aGraphics[i].bInUse )
+ m_aGraphics[i].pGraphics->SetDrawable( None, m_nScreen );
+
// first deinit frame
if( m_pIMHandler )
{
diff --git a/vcl/unx/inc/kde_headers.h b/vcl/unx/inc/kde_headers.h
deleted file mode 100644
index ccbffc99cb99..000000000000
--- a/vcl/unx/inc/kde_headers.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: kde_headers.h,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * 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.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_VCL_KDE_HEADERS_H
-#define INCLUDED_VCL_KDE_HEADERS_H
-
-/* ********* Suppress warnings if needed */
-#include "sal/config.h"
-
-#if defined __GNUC__
-#pragma GCC system_header
-#endif
-
-
-/* ********* Hack, but needed because of conflicting types... */
-#define Region QtXRegion
-
-
-/* ********* Qt headers */
-#include <qaccessible.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qfont.h>
-#include <qframe.h>
-#include <qlineedit.h>
-#include <qlistview.h>
-#include <qmainwindow.h>
-#include <qmenudata.h>
-#include <qpaintdevice.h>
-#include <qpainter.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qrangecontrol.h>
-#include <qstring.h>
-#include <qtabbar.h>
-#include <qtabwidget.h>
-#include <qtoolbar.h>
-#include <qtoolbutton.h>
-#include <qwidget.h>
-#include <qprogressbar.h>
-
-/* ********* See hack on top of this file */
-#undef Region
-
-
-/* ********* KDE base headers */
-#include <kaboutdata.h>
-#include <kapplication.h>
-#include <kcmdlineargs.h>
-#include <kconfig.h>
-#include <kdeversion.h>
-#include <kemailsettings.h>
-#include <kglobal.h>
-#include <kglobalsettings.h>
-#include <klocale.h>
-#include <kmainwindow.h>
-#include <kmenubar.h>
-#include <kprotocolmanager.h>
-#include <kstartupinfo.h>
-#include <kstyle.h>
-
-
-/* ********* KDE address book connectivity headers */
-#include <kabc/addressbook.h>
-#include <kabc/addressee.h>
-#include <kabc/field.h>
-#include <kabc/stdaddressbook.h>
-
-
-#endif
diff --git a/vcl/unx/inc/plugins/kde/kdedata.hxx b/vcl/unx/inc/plugins/kde/kdedata.hxx
index 831621e38cc1..04730b39fad2 100644
--- a/vcl/unx/inc/plugins/kde/kdedata.hxx
+++ b/vcl/unx/inc/plugins/kde/kdedata.hxx
@@ -75,7 +75,7 @@ public:
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics *pGraphics );
- virtual void updateGraphics();
+ virtual void updateGraphics( bool bClear );
virtual void UpdateSettings( AllSettings& rSettings );
virtual void Show( BOOL bVisible, BOOL bNoActivate );
};
diff --git a/vcl/unx/inc/salframe.h b/vcl/unx/inc/salframe.h
index 848f2250d31c..8dad0350a937 100644
--- a/vcl/unx/inc/salframe.h
+++ b/vcl/unx/inc/salframe.h
@@ -212,7 +212,9 @@ public:
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics* pGraphics );
- virtual void updateGraphics();
+ // call with true to clear graphics (setting None as drawable)
+ // call with false to setup graphics with window (GetWindow())
+ virtual void updateGraphics( bool bClear );
virtual BOOL PostEvent( void* pData );
diff --git a/vcl/unx/inc/sm.hxx b/vcl/unx/inc/sm.hxx
index 17bb40e2106a..09d2f5557e1d 100644
--- a/vcl/unx/inc/sm.hxx
+++ b/vcl/unx/inc/sm.hxx
@@ -69,7 +69,7 @@ public:
static bool checkDocumentsSaved();
static bool queryInteraction();
static void saveDone();
- static void interactionDone();
+ static void interactionDone( bool bCancelShutdown );
static String getExecName();
static VCL_DLLPUBLIC const ByteString& getSessionID();
diff --git a/vcl/unx/kde/kdedata.cxx b/vcl/unx/kde/kdedata.cxx
index 1b5a2f86dcee..9da57b6e790d 100644
--- a/vcl/unx/kde/kdedata.cxx
+++ b/vcl/unx/kde/kdedata.cxx
@@ -29,7 +29,7 @@
#include "precompiled_vcl.hxx"
#define _SV_SALDATA_CXX
-#include "kde_headers.h"
+#include <shell/kde_headers.h>
#include <unistd.h>
#include <fcntl.h>
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index 8046d22d75d3..cd461fc36c8f 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -32,7 +32,7 @@
#include "precompiled_vcl.hxx"
#define _SV_SALNATIVEWIDGETS_KDE_CXX
-#include "kde_headers.h"
+#include <shell/kde_headers.h>
#include <salunx.h>
#include <saldata.hxx>
@@ -2073,12 +2073,13 @@ void KDESalFrame::ReleaseGraphics( SalGraphics *pGraphics )
}
}
-void KDESalFrame::updateGraphics()
+void KDESalFrame::updateGraphics( bool bClear )
{
+ Drawable aDrawable = bClear ? None : GetWindow();
for( int i = 0; i < nMaxGraphics; i++ )
{
if( m_aGraphics[i].bInUse )
- m_aGraphics[i].pGraphics->SetDrawable( GetWindow(), GetScreenNumber() );
+ m_aGraphics[i].pGraphics->SetDrawable( aDrawable, GetScreenNumber() );
}
}
diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx
index 202d3dbcd517..6177c4b2896a 100644
--- a/vcl/unx/kde4/KDESalFrame.cxx
+++ b/vcl/unx/kde4/KDESalFrame.cxx
@@ -363,12 +363,13 @@ void KDESalFrame::ReleaseGraphics( SalGraphics *pGraphics )
}
}
-void KDESalFrame::updateGraphics()
+void KDESalFrame::updateGraphics( bool bClear )
{
+ Drawable aDrawable = bClear ? None : GetWindow();
for( int i = 0; i < nMaxGraphics; i++ )
{
if( m_aGraphics[i].bInUse )
- m_aGraphics[i].pGraphics->SetDrawable( GetWindow(), GetScreenNumber() );
+ m_aGraphics[i].pGraphics->SetDrawable( aDrawable, GetScreenNumber() );
}
}
diff --git a/vcl/unx/kde4/KDESalFrame.hxx b/vcl/unx/kde4/KDESalFrame.hxx
index 11a22bd93ba5..de3a5af189ee 100644
--- a/vcl/unx/kde4/KDESalFrame.hxx
+++ b/vcl/unx/kde4/KDESalFrame.hxx
@@ -52,7 +52,7 @@ class KDESalFrame : public X11SalFrame
virtual SalGraphics* GetGraphics();
virtual void ReleaseGraphics( SalGraphics *pGraphics );
- virtual void updateGraphics();
+ virtual void updateGraphics( bool bClear );
virtual void UpdateSettings( AllSettings& rSettings );
virtual void Show( BOOL bVisible, BOOL bNoActivate );
}; \ No newline at end of file
diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx
index 1dc2d1404009..6b7753960290 100644
--- a/vcl/unx/source/app/salinst.cxx
+++ b/vcl/unx/source/app/salinst.cxx
@@ -50,7 +50,7 @@
#include "vcl/salwtype.hxx"
#include "vcl/salatype.hxx"
#include "vcl/helper.hxx"
-
+#include <tools/solarmutex.hxx>
#include "vos/mutex.hxx"
// -------------------------------------------------------------------------
@@ -63,6 +63,7 @@ SalYieldMutex::SalYieldMutex()
{
mnCount = 0;
mnThreadId = 0;
+ ::tools::SolarMutex::SetSolarMutex( this );
}
void SalYieldMutex::acquire()
@@ -141,6 +142,7 @@ X11SalInstance::~X11SalInstance()
delete pSalData;
SetSalData( NULL );
+ ::tools::SolarMutex::SetSolarMutex( 0 );
delete mpSalYieldMutex;
}
diff --git a/vcl/unx/source/app/sm.cxx b/vcl/unx/source/app/sm.cxx
index ff981b04259b..c5605cec1dfb 100644
--- a/vcl/unx/source/app/sm.cxx
+++ b/vcl/unx/source/app/sm.cxx
@@ -114,7 +114,7 @@ void IceSalSession::queryInteraction()
void IceSalSession::interactionDone()
{
- SessionManagerClient::interactionDone();
+ SessionManagerClient::interactionDone( false );
}
void IceSalSession::saveDone()
@@ -129,6 +129,7 @@ void IceSalSession::saveDone()
bool IceSalSession::cancelShutdown()
{
+ SessionManagerClient::interactionDone( true );
return false;
}
@@ -368,6 +369,12 @@ void SessionManagerClient::SaveYourselfProc(
IMPL_STATIC_LINK_NOINSTANCE( SessionManagerClient, ShutDownHdl, void*, EMPTYARG )
{
+ if( pOneInstance )
+ {
+ SalSessionQuitEvent aEvent;
+ pOneInstance->CallCallback( &aEvent );
+ }
+
const std::list< SalFrame* >& rFrames = GetX11SalData()->GetDisplay()->getFrames();
SMprintf( rFrames.begin() != rFrames.end() ? "shutdown on first frame\n" : "shutdown event but no frame\n" );
if( rFrames.begin() != rFrames.end() )
@@ -526,12 +533,12 @@ bool SessionManagerClient::queryInteraction()
return bRet;
}
-void SessionManagerClient::interactionDone()
+void SessionManagerClient::interactionDone( bool bCancelShutdown )
{
if( aSmcConnection )
{
ICEConnectionObserver::lock();
- SmcInteractDone( aSmcConnection, False );
+ SmcInteractDone( aSmcConnection, bCancelShutdown ? True : False );
ICEConnectionObserver::unlock();
}
}
diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx
index c09803dcb269..cb554bccea21 100644
--- a/vcl/unx/source/gdi/salgdi.cxx
+++ b/vcl/unx/source/gdi/salgdi.cxx
@@ -1793,7 +1793,7 @@ void splitIntersectingSegments( LSVector& rLSVector)
// prepare the result vector
// try to avoid reallocations by guessing a reasonable result size
- rLSVector.reserve( aYMinQueue.size() * 1.5);
+ rLSVector.reserve( aYMinQueue.size() * 3/2 );
// find all intersections
CutPointSet aCutPointSet;
diff --git a/vcl/unx/source/plugadapt/salplug.cxx b/vcl/unx/source/plugadapt/salplug.cxx
index 14de25b13e4d..f1c63b8abee7 100644
--- a/vcl/unx/source/plugadapt/salplug.cxx
+++ b/vcl/unx/source/plugadapt/salplug.cxx
@@ -149,34 +149,53 @@ static const rtl::OUString& get_desktop_environment()
return aRet;
}
-static const char* autodetect_plugin()
+static SalInstance* autodetect_plugin()
{
+ static const char* pKDEFallbackList[] =
+ {
+ "kde4", "kde", "gtk", "gen", 0
+ };
+
+ static const char* pStandardFallbackList[] =
+ {
+ "gtk", "gen", 0
+ };
+
+ static const char* pHeadlessFallbackList[] =
+ {
+ "svp", 0
+ };
+
const rtl::OUString& desktop( get_desktop_environment() );
- const char * pRet = "gen";
+ const char ** pList = pStandardFallbackList;
+ int nListEntry = 0;
// no server at all: dummy plugin
if ( desktop.equalsAscii( desktop_strings[DESKTOP_NONE] ) )
- pRet = "svp";
+ pList = pHeadlessFallbackList;
else if ( desktop.equalsAscii( desktop_strings[DESKTOP_GNOME] ) )
- pRet = "gtk";
+ pList = pStandardFallbackList;
else if( desktop.equalsAscii( desktop_strings[DESKTOP_KDE] ) )
- pRet = "kde";
- else if( desktop.equalsAscii( desktop_strings[DESKTOP_KDE4] ) )
- pRet = "kde4";
- else
{
- // #i95296# use the much nicer looking gtk plugin
- // on desktops that set gtk variables (e.g. XFCE)
- static const char* pEnv = getenv( "GTK2_RC_FILES" );
- if( pEnv && *pEnv ) // check for existance and non emptiness
- pRet = "gtk";
+ pList = pKDEFallbackList;
+ nListEntry = 1;
}
+ else if( desktop.equalsAscii( desktop_strings[DESKTOP_KDE4] ) )
+ pList = pKDEFallbackList;
-#if OSL_DEBUG_LEVEL > 1
- std::fprintf( stderr, "plugin autodetection: %s\n", pRet );
-#endif
+ SalInstance* pInst = NULL;
+ while( pList[nListEntry] && pInst == NULL )
+ {
+ rtl::OUString aTry( rtl::OUString::createFromAscii( pList[nListEntry] ) );
+ pInst = tryInstance( aTry );
+ #if OSL_DEBUG_LEVEL > 1
+ if( pInst )
+ std::fprintf( stderr, "plugin autodetection: %s\n", pList[nListEntry] );
+ #endif
+ nListEntry++;
+ }
- return pRet;
+ return pInst;
}
static SalInstance* check_headless_plugin()
@@ -202,10 +221,7 @@ SalInstance *CreateSalInstance()
pInst = check_headless_plugin();
if( ! pInst && !(pUsePlugin && *pUsePlugin) )
- pUsePlugin = autodetect_plugin();
-
- if( ! pInst && pUsePlugin && *pUsePlugin )
- pInst = tryInstance( OUString::createFromAscii( pUsePlugin ) );
+ pInst = autodetect_plugin();
// fallback to gen
if( ! pInst )
diff --git a/vcl/unx/source/printergfx/glyphset.cxx b/vcl/unx/source/printergfx/glyphset.cxx
index 156517d98220..5adff6683267 100644
--- a/vcl/unx/source/printergfx/glyphset.cxx
+++ b/vcl/unx/source/printergfx/glyphset.cxx
@@ -46,6 +46,7 @@
#include <set>
#include <map>
+#include <algorithm>
using namespace vcl;
using namespace psp;
@@ -785,6 +786,17 @@ GlyphSet::PSUploadEncoding(osl::File* pOutFile, PrinterGfx &rGfx)
return sal_True;
}
+struct EncEntry
+{
+ sal_uChar aEnc;
+ long aGID;
+
+ EncEntry() : aEnc( 0 ), aGID( 0 ) {}
+
+ bool operator<( const EncEntry& rRight ) const
+ { return aEnc < rRight.aEnc; }
+};
+
static void CreatePSUploadableFont( TrueTypeFont* pSrcFont, FILE* pTmpFile,
const char* pGlyphSetName, int nGlyphCount,
/*const*/ sal_uInt16* pRequestedGlyphs, /*const*/ sal_uChar* pEncoding,
@@ -796,17 +808,29 @@ static void CreatePSUploadableFont( TrueTypeFont* pSrcFont, FILE* pTmpFile,
if( bAllowType42 )
nTargetMask |= FontSubsetInfo::TYPE42_FONT;
+ std::vector< EncEntry > aSorted( nGlyphCount, EncEntry() );
+ for( int i = 0; i < nGlyphCount; i++ )
+ {
+ aSorted[i].aEnc = pEncoding[i];
+ aSorted[i].aGID = pRequestedGlyphs[i];
+ }
+
+ std::stable_sort( aSorted.begin(), aSorted.end() );
+
+ std::vector< sal_uChar > aEncoding( nGlyphCount );
+ std::vector< long > aRequestedGlyphs( nGlyphCount );
+
+ for( int i = 0; i < nGlyphCount; i++ )
+ {
+ aEncoding[i] = aSorted[i].aEnc;
+ aRequestedGlyphs[i] = aSorted[i].aGID;
+ }
+
FontSubsetInfo aInfo;
aInfo.LoadFont( pSrcFont );
-#if 1 // TODO: remove 16bit->long conversion when input args has been changed
- long aRequestedGlyphs[256];
- for( int i = 0; i < nGlyphCount; ++i )
- aRequestedGlyphs[i] = pRequestedGlyphs[i];
-#endif
-
aInfo.CreateFontSubset( nTargetMask, pTmpFile, pGlyphSetName,
- aRequestedGlyphs, pEncoding, nGlyphCount, NULL );
+ &aRequestedGlyphs[0], &aEncoding[0], nGlyphCount, NULL );
}
sal_Bool
diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx
index 6219b50d6ec3..68c99e05da77 100644
--- a/vcl/unx/source/window/salframe.cxx
+++ b/vcl/unx/source/window/salframe.cxx
@@ -930,12 +930,13 @@ void X11SalFrame::ReleaseGraphics( SalGraphics *pGraphics )
pGraphics_ = NULL;
}
-void X11SalFrame::updateGraphics()
+void X11SalFrame::updateGraphics( bool bClear )
{
+ Drawable aDrawable = bClear ? None : GetWindow();
if( pGraphics_ )
- pGraphics_->SetDrawable( GetWindow(), m_nScreen );
+ pGraphics_->SetDrawable( aDrawable, m_nScreen );
if( pFreeGraphics_ )
- pFreeGraphics_->SetDrawable( GetWindow(), m_nScreen );
+ pFreeGraphics_->SetDrawable( aDrawable, m_nScreen );
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -2726,6 +2727,7 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen )
}
// first deinit frame
+ updateGraphics(true);
if( mpInputContext )
{
mpInputContext->UnsetICFocus( this );
@@ -2748,7 +2750,7 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen )
Init( nStyle_ & ~SAL_FRAME_STYLE_PLUG, nScreen, NULL, true );
// update graphics if necessary
- updateGraphics();
+ updateGraphics(false);
if( m_aTitle.Len() )
SetTitle( m_aTitle );
diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk
index 32620d9e966a..ef4f13301ecd 100644
--- a/vcl/util/makefile.mk
+++ b/vcl/util/makefile.mk
@@ -73,7 +73,6 @@ HXXDEPNLST= $(INC)$/vcl$/accel.hxx \
$(INC)$/vcl$/fixed.hxx \
$(INC)$/vcl$/floatwin.hxx \
$(INC)$/vcl$/font.hxx \
- $(INC)$/vcl$/fontcvt.hxx \
$(INC)$/vcl$/floatwin.hxx \
$(INC)$/vcl$/graph.hxx \
$(INC)$/vcl$/group.hxx \
diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx
index 2b5ac6d3162d..68177795c8db 100644
--- a/vcl/win/source/app/salinst.cxx
+++ b/vcl/win/source/app/salinst.cxx
@@ -55,6 +55,7 @@
#include <vcl/salimestatus.hxx>
#include <vcl/timer.hxx>
#include <wincomp.hxx> // CS_DROPSHADOW
+#include <tools/solarmutex.hxx>
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
@@ -661,12 +662,14 @@ WinSalInstance::WinSalInstance()
mpSalWaitMutex = new vos::OMutex;
mnYieldWaitCount = 0;
mpSalYieldMutex->acquire();
+ ::tools::SolarMutex::SetSolarMutex( mpSalYieldMutex );
}
// -----------------------------------------------------------------------
WinSalInstance::~WinSalInstance()
{
+ ::tools::SolarMutex::SetSolarMutex( 0 );
mpSalYieldMutex->release();
delete mpSalYieldMutex;
delete mpSalWaitMutex;
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 53f822a1e409..fc92757e0925 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -39,6 +39,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <comphelper/processfactory.hxx>
+#include <unotools/misccfg.hxx>
#include <string.h>
#include <limits.h>
@@ -3095,7 +3096,7 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
if ( (nValue > 1000) && (nValue < 10000) )
{
MiscSettings aMiscSettings = rSettings.GetMiscSettings();
- aMiscSettings.SetTwoDigitYearStart( (USHORT)(nValue-99) );
+ utl::MiscCfg().SetYear2000( (sal_Int32)(nValue-99) );
rSettings.SetMiscSettings( aMiscSettings );
}
}