summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2003-03-27 16:59:30 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2003-03-27 16:59:30 +0000
commit2f382d6c2579a25c68dbd121af7f1f5dc7ec9852 (patch)
tree8c6c555a872e6812cd3f76de570b06683526ad14 /vcl/source
parentf7a0cc83bb59efd6abd820bd78acc75e8313ea4e (diff)
MWS_SRX644: migrate branch mws_srx644 -> HEAD
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/app/settings.cxx220
-rw-r--r--vcl/source/app/sound.cxx28
-rw-r--r--vcl/source/app/svapp.cxx26
-rw-r--r--vcl/source/app/svdata.cxx303
-rw-r--r--vcl/source/control/combobox.cxx51
-rw-r--r--vcl/source/control/edit.cxx30
-rw-r--r--vcl/source/control/ilstbox.cxx22
-rw-r--r--vcl/source/control/lstbox.cxx8
-rw-r--r--vcl/source/gdi/base14.cxx20
-rw-r--r--vcl/source/gdi/bitmap.cxx9
-rw-r--r--vcl/source/gdi/bmpconv.cxx253
-rw-r--r--vcl/source/gdi/cvtsvm.cxx57
-rw-r--r--vcl/source/gdi/font.cxx5
-rw-r--r--vcl/source/gdi/fontcfg.cxx17
-rw-r--r--vcl/source/gdi/graph.cxx21
-rw-r--r--vcl/source/gdi/image.cxx8
-rw-r--r--vcl/source/gdi/implncvt.cxx12
-rw-r--r--vcl/source/gdi/impprn.cxx32
-rw-r--r--vcl/source/gdi/impvect.cxx7
-rw-r--r--vcl/source/gdi/makefile.mk15
-rw-r--r--vcl/source/gdi/metaact.cxx9
-rw-r--r--vcl/source/gdi/opengl.cxx25
-rw-r--r--vcl/source/gdi/outdev.cxx85
-rw-r--r--vcl/source/gdi/outdev2.cxx54
-rw-r--r--vcl/source/gdi/outdev3.cxx1075
-rw-r--r--vcl/source/gdi/outdev4.cxx87
-rw-r--r--vcl/source/gdi/outdev5.cxx31
-rw-r--r--vcl/source/gdi/outdev6.cxx14
-rw-r--r--vcl/source/gdi/outmap.cxx551
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx275
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx9
-rw-r--r--vcl/source/gdi/print.cxx89
-rw-r--r--vcl/source/gdi/print2.cxx1177
-rw-r--r--vcl/source/gdi/salgdilayout.cxx32
-rwxr-xr-xvcl/source/gdi/sallayout.cxx801
-rw-r--r--vcl/source/glyphs/gcach_ftyp.cxx26
-rwxr-xr-xvcl/source/glyphs/gcach_layout.cxx99
-rw-r--r--vcl/source/glyphs/glyphcache.cxx83
-rw-r--r--vcl/source/helper/makefile.mk10
-rw-r--r--vcl/source/src/btntext.src27
-rw-r--r--vcl/source/src/helptext.src141
-rw-r--r--vcl/source/src/menu.src58
-rw-r--r--vcl/source/src/stdtext.src220
-rw-r--r--vcl/source/src/units.src65
-rw-r--r--vcl/source/window/brdwin.cxx8
-rw-r--r--vcl/source/window/cursor.cxx61
-rw-r--r--vcl/source/window/decoview.cxx42
-rw-r--r--vcl/source/window/dialog.cxx16
-rw-r--r--vcl/source/window/dndevdis.cxx40
-rw-r--r--vcl/source/window/dockwin.cxx11
-rw-r--r--vcl/source/window/floatwin.cxx29
-rw-r--r--vcl/source/window/introwin.cxx132
-rw-r--r--vcl/source/window/makefile.mk6
-rw-r--r--vcl/source/window/menu.cxx64
-rw-r--r--vcl/source/window/splitwin.cxx81
-rw-r--r--vcl/source/window/status.cxx55
-rw-r--r--vcl/source/window/toolbox.cxx60
-rw-r--r--vcl/source/window/window.cxx309
-rw-r--r--vcl/source/window/window2.cxx15
-rw-r--r--vcl/source/window/winproc.cxx18
-rw-r--r--vcl/source/window/wrkwin.cxx29
61 files changed, 4702 insertions, 2461 deletions
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 1001f7a27a3e..e2cb26afce04 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: settings.cxx,v $
*
- * $Revision: 1.35 $
+ * $Revision: 1.36 $
*
- * last change: $Author: cd $ $Date: 2002-12-13 07:32:25 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -93,6 +93,9 @@
#ifndef _UNOTOOLS_COLLATORWRAPPER_HXX
#include <unotools/collatorwrapper.hxx>
#endif
+#ifndef _UNOTOOLS_CONFIGNODE_HXX_
+#include <unotools/confignode.hxx>
+#endif
#ifdef UNX
#include <prex.h>
@@ -101,6 +104,14 @@
#include <stdio.h>
#endif
+#ifdef WNT
+#include <tools/prewin.h>
+#include <windows.h>
+#include <tools/postwin.h>
+#endif
+
+using namespace rtl;
+
#pragma hdrstop
// =======================================================================
@@ -480,6 +491,7 @@ ImplStyleData::ImplStyleData()
mnDisplayOptions = 0;
mnOptions = 0;
mnAutoMnemonic = 1;
+ mnToolbarIconSize = STYLE_TOOLBAR_ICONSIZE_UNKNOWN;
SetStandardStyles();
}
@@ -515,6 +527,7 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
maDeactiveBorderColor( rData.maDeactiveBorderColor ),
maMenuColor( rData.maMenuColor ),
maMenuBarColor( rData.maMenuBarColor ),
+ maMenuBorderColor( rData.maMenuBorderColor ),
maMenuTextColor( rData.maMenuTextColor ),
maMenuHighlightColor( rData.maMenuHighlightColor ),
maMenuHighlightTextColor( rData.maMenuHighlightTextColor ),
@@ -538,7 +551,8 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
maRadioCheckFont( rData.maRadioCheckFont ),
maPushButtonFont( rData.maPushButtonFont ),
maFieldFont( rData.maFieldFont ),
- maIconFont( rData.maIconFont )
+ maIconFont( rData.maIconFont ),
+ maFontColor( rData.maFontColor )
{
mnRefCount = 1;
mnBorderSize = rData.mnBorderSize;
@@ -568,8 +582,10 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
mnOptions = rData.mnOptions;
mnHighContrast = rData.mnHighContrast;
mnUseSystemUIFonts = rData.mnUseSystemUIFonts;
+ mnUseFlatMenues = rData.mnUseFlatMenues;
mnAutoMnemonic = rData.mnAutoMnemonic;
mnUseImagesInMenus = rData.mnUseImagesInMenus;
+ mnToolbarIconSize = rData.mnToolbarIconSize;
}
// -----------------------------------------------------------------------
@@ -624,6 +640,7 @@ void ImplStyleData::SetStandardStyles()
maDeactiveBorderColor = Color( COL_LIGHTGRAY );
maMenuColor = Color( COL_LIGHTGRAY );
maMenuBarColor = Color( COL_LIGHTGRAY );
+ maMenuBorderColor = Color( COL_LIGHTGRAY );
maMenuTextColor = Color( COL_BLACK );
maMenuHighlightColor = Color( COL_BLUE );
maMenuHighlightTextColor = Color( COL_WHITE );
@@ -635,6 +652,7 @@ void ImplStyleData::SetStandardStyles()
maLinkColor = Color( COL_BLUE );
maVisitedLinkColor = Color( COL_RED );
maHighlightLinkColor = Color( COL_LIGHTBLUE );
+ maFontColor = Color( COL_BLACK );
mnRadioButtonStyle &= ~STYLE_RADIOBUTTON_STYLE;
mnCheckBoxStyle &= ~STYLE_CHECKBOX_STYLE;
@@ -649,6 +667,7 @@ void ImplStyleData::SetStandardStyles()
mnMenuBarHeight = 14;
mnHighContrast = 0;
mnUseSystemUIFonts = 0;
+ mnUseFlatMenues = 0;
mnUseImagesInMenus = (USHORT)TRUE;
}
@@ -722,6 +741,7 @@ void ImplStyleData::SetStandardOS2Styles()
maDeactiveBorderColor = Color( COL_LIGHTGRAY );
maMenuColor = Color( COL_LIGHTGRAY );
maMenuBarColor = Color( COL_LIGHTGRAY );
+ maMenuBorderColor = Color( COL_LIGHTGRAY );
maMenuTextColor = Color( COL_BLACK );
maMenuHighlightColor = Color( COL_BLUE );
maMenuHighlightTextColor = Color( COL_WHITE );
@@ -749,6 +769,7 @@ void ImplStyleData::SetStandardOS2Styles()
mnMenuBarHeight = 14;
mnHighContrast = 0;
mnUseSystemUIFonts = 0;
+ mnUseFlatMenues = 0;
mnUseImagesInMenus = (USHORT)TRUE;
}
@@ -807,6 +828,7 @@ void ImplStyleData::SetStandardMacStyles()
maDeactiveBorderColor = Color( COL_LIGHTGRAY );
maMenuColor = Color( COL_LIGHTGRAY );
maMenuBarColor = Color( COL_LIGHTGRAY );
+ maMenuBorderColor = Color( COL_LIGHTGRAY );
maMenuTextColor = Color( COL_BLACK );
maMenuHighlightColor = Color( COL_BLUE );
maMenuHighlightTextColor = Color( COL_WHITE );
@@ -833,6 +855,7 @@ void ImplStyleData::SetStandardMacStyles()
mnMenuBarHeight = 14;
mnHighContrast = 0;
mnUseSystemUIFonts = 0;
+ mnUseFlatMenues = 0;
mnUseImagesInMenus = (USHORT)TRUE;
}
@@ -901,6 +924,7 @@ void StyleSettings::Set3DColors( const Color& rColor )
CopyData();
mpData->maFaceColor = rColor;
mpData->maLightBorderColor = rColor;
+ mpData->maMenuBorderColor = rColor;
mpData->maDarkShadowColor = Color( COL_BLACK );
if ( rColor != Color( COL_LIGHTGRAY ) )
{
@@ -1032,6 +1056,7 @@ BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const
(mpData->mnTabControlStyle == rSet.mpData->mnTabControlStyle) &&
(mpData->mnHighContrast == rSet.mpData->mnHighContrast) &&
(mpData->mnUseSystemUIFonts == rSet.mpData->mnUseSystemUIFonts) &&
+ (mpData->mnUseFlatMenues == rSet.mpData->mnUseFlatMenues) &&
(mpData->maFaceColor == rSet.mpData->maFaceColor) &&
(mpData->maCheckedColor == rSet.mpData->maCheckedColor) &&
(mpData->maLightColor == rSet.mpData->maLightColor) &&
@@ -1060,6 +1085,7 @@ BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const
(mpData->maDeactiveBorderColor == rSet.mpData->maDeactiveBorderColor) &&
(mpData->maMenuColor == rSet.mpData->maMenuColor) &&
(mpData->maMenuBarColor == rSet.mpData->maMenuBarColor) &&
+ (mpData->maMenuBorderColor == rSet.mpData->maMenuBorderColor) &&
(mpData->maMenuTextColor == rSet.mpData->maMenuTextColor) &&
(mpData->maMenuHighlightColor == rSet.mpData->maMenuHighlightColor) &&
(mpData->maMenuHighlightTextColor == rSet.mpData->maMenuHighlightTextColor) &&
@@ -1084,7 +1110,8 @@ BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const
(mpData->maPushButtonFont == rSet.mpData->maPushButtonFont) &&
(mpData->maFieldFont == rSet.mpData->maFieldFont) &&
(mpData->maIconFont == rSet.mpData->maIconFont) &&
- (mpData->mnUseImagesInMenus == rSet.mpData->mnUseImagesInMenus) )
+ (mpData->mnUseImagesInMenus == rSet.mpData->mnUseImagesInMenus) &&
+ (mpData->maFontColor == rSet.mpData->maFontColor ))
return TRUE;
else
return FALSE;
@@ -1187,19 +1214,16 @@ BOOL MiscSettings::operator ==( const MiscSettings& rSet ) const
BOOL MiscSettings::GetEnableATToolSupport() const
{
+#ifndef REMOTE_APPSERVER
if( mpData->mnEnableATT == (USHORT)~0 )
{
#ifdef UNX
mpData->mnEnableATT = 0;
-#ifndef REMOTE_APPSERVER
DtIntegrator* pIntegrator = DtIntegrator::CreateDtIntegrator( NULL );
static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" );
if( ( pIntegrator && pIntegrator->GetDtType() == DtGNOME ) ||
( pEnv && *pEnv ) )
-#else
- if( 0 )
-#endif
{
char buf[16];
// use 2 shells to suppress the eventual "gcontool-2 not found" message
@@ -1219,17 +1243,66 @@ BOOL MiscSettings::GetEnableATToolSupport() const
static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" );
if( !pEnv || !*pEnv )
{
+#ifdef WNT
+ // Check in the Windows registry if an AT tool wants Accessibility support to
+ // be activated ..
+ HKEY hkey;
+
+ if( ERROR_SUCCESS == RegOpenKey(HKEY_CURRENT_USER,
+ "Software\\OpenOffice.org\\Accessibility\\AtToolSupport",
+ &hkey) )
+ {
+ DWORD dwType;
+ WIN_BYTE Data[6]; // possible values: "true", "false", "1", "0", DWORD
+ DWORD cbData = sizeof(Data);
+
+ if( ERROR_SUCCESS == RegQueryValueEx(hkey, "SupportAssistiveTechnology",
+ NULL, &dwType, Data, &cbData) )
+ {
+ switch (dwType)
+ {
+ case REG_SZ:
+ mpData->mnEnableATT = ((0 == stricmp((const char *) Data, "1")) || (0 == stricmp((const char *) Data, "true")));
+ break;
+ case REG_DWORD:
+ mpData->mnEnableATT = (USHORT) (((DWORD *) Data)[0]);
+ break;
+ default:
+ // Unsupported registry type
+ mpData->mnEnableATT = 0;
+ break;
+ }
+ }
+
+ RegCloseKey(hkey);
+ }
+
+ // Registry does not exist ..
+ if( mpData->mnEnableATT == (USHORT)~0 )
+ {
+ rtl::OUString aEnable =
+ vcl::SettingsConfigItem::get()->
+ getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Accessibility" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableATToolSupport" ) ) );
+ mpData->mnEnableATT = aEnable.equalsIgnoreAsciiCaseAscii( "true" ) ? 1 : 0;
+ }
+#else
rtl::OUString aEnable =
vcl::SettingsConfigItem::get()->
getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Accessibility" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableATToolSupport" ) ) );
mpData->mnEnableATT = aEnable.equalsIgnoreAsciiCaseAscii( "true" ) ? 1 : 0;
+#endif
}
else
mpData->mnEnableATT = 1;
#endif
}
return (BOOL)mpData->mnEnableATT;
+
+#else // REMOTE_APPSERVER
+ return FALSE;
+#endif
}
// -----------------------------------------------------------------------
@@ -1238,9 +1311,47 @@ void MiscSettings::SetEnableATToolSupport( BOOL bEnable )
{
if ( bEnable != mpData->mnEnableATT )
{
- if( bEnable && !ImplInitAccessBridge() )
- bEnable = FALSE;
+ if( bEnable && !ImplInitAccessBridge(false) )
+ return;
+
+#ifdef WNT
+ HKEY hkey;
+ // If the accessibility key in the Windows registry exists, change it synchronously
+ if( ERROR_SUCCESS == RegOpenKey(HKEY_CURRENT_USER,
+ "Software\\OpenOffice.org\\Accessibility\\AtToolSupport",
+ &hkey) )
+ {
+ DWORD dwType;
+ WIN_BYTE Data[6]; // possible values: "true", "false", 1, 0
+ DWORD cbData = sizeof(Data);
+
+ if( ERROR_SUCCESS == RegQueryValueEx(hkey, "SupportAssistiveTechnology",
+ NULL, &dwType, Data, &cbData) )
+ {
+ switch (dwType)
+ {
+ case REG_SZ:
+ RegSetValueEx(hkey, "SupportAssistiveTechnology",
+ NULL, dwType,
+ bEnable ? (WIN_BYTE *) "true" : (WIN_BYTE *) "false",
+ bEnable ? sizeof("true") : sizeof("false"));
+ break;
+ case REG_DWORD:
+ ((DWORD *) Data)[0] = bEnable ? 1 : 0;
+ RegSetValueEx(hkey, "SupportAssistiveTechnology",
+ NULL, dwType, Data, sizeof(DWORD));
+ break;
+ default:
+ // Unsupported registry type
+ break;
+ }
+ }
+
+ RegCloseKey(hkey);
+ }
+
+#endif
vcl::SettingsConfigItem::get()->
setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Accessibility" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableATToolSupport" ) ),
@@ -1998,42 +2109,71 @@ void AllSettings::SetUILanguage( LanguageType eLang )
BOOL AllSettings::GetLayoutRTL() const
{
static const char* pEnv = getenv("SAL_RTL_ENABLED" );
+ static int nUIMirroring = -1; // -1: undef, 0: auto, 1: on 2: off
+
+ // environment always overrides
+ if( pEnv )
+ return true;
- LanguageType aLang = LANGUAGE_DONTKNOW;
BOOL bRTL = FALSE;
- ImplSVData* pSVData = ImplGetSVData();
- if ( pSVData->maAppData.mpSettings )
- aLang = pSVData->maAppData.mpSettings->GetUILanguage();
+ if( nUIMirroring == -1 )
+ {
+ nUIMirroring = 0; // ask configuration only once
+ utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
+ vcl::unohelper::GetMultiServiceFactory(),
+ OUString::createFromAscii( "org.openoffice.Office.Common/I18N/CTL" ) ); // note: case sensisitive !
+ if ( aNode.isValid() )
+ {
+ BOOL bTmp;
+ ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString::createFromAscii( "UIMirroring" ) );
+ if( aValue >>= bTmp )
+ {
+ // found true or false; if it was nil, nothing is changed
+ nUIMirroring = bTmp ? 1 : 2;
+ }
+ }
+ }
- switch( aLang )
+ if( nUIMirroring == 0 ) // no config found (eg, setup) or default (nil) was set: check language
{
- // languages with right-to-left UI
- case LANGUAGE_ARABIC:
- case LANGUAGE_ARABIC_SAUDI_ARABIA:
- case LANGUAGE_ARABIC_IRAQ:
- case LANGUAGE_ARABIC_EGYPT:
- case LANGUAGE_ARABIC_LIBYA:
- case LANGUAGE_ARABIC_ALGERIA:
- case LANGUAGE_ARABIC_MOROCCO:
- case LANGUAGE_ARABIC_TUNISIA:
- case LANGUAGE_ARABIC_OMAN:
- case LANGUAGE_ARABIC_YEMEN:
- case LANGUAGE_ARABIC_SYRIA:
- case LANGUAGE_ARABIC_JORDAN:
- case LANGUAGE_ARABIC_LEBANON:
- case LANGUAGE_ARABIC_KUWAIT:
- case LANGUAGE_ARABIC_UAE:
- case LANGUAGE_ARABIC_BAHRAIN:
- case LANGUAGE_ARABIC_QATAR:
- case LANGUAGE_HEBREW:
- bRTL = TRUE;
- break;
-
- default:
- break;
+ LanguageType aLang = LANGUAGE_DONTKNOW;
+ ImplSVData* pSVData = ImplGetSVData();
+ if ( pSVData->maAppData.mpSettings )
+ aLang = pSVData->maAppData.mpSettings->GetUILanguage();
+
+ switch( aLang )
+ {
+ // languages with right-to-left UI
+ case LANGUAGE_ARABIC:
+ case LANGUAGE_ARABIC_SAUDI_ARABIA:
+ case LANGUAGE_ARABIC_IRAQ:
+ case LANGUAGE_ARABIC_EGYPT:
+ case LANGUAGE_ARABIC_LIBYA:
+ case LANGUAGE_ARABIC_ALGERIA:
+ case LANGUAGE_ARABIC_MOROCCO:
+ case LANGUAGE_ARABIC_TUNISIA:
+ case LANGUAGE_ARABIC_OMAN:
+ case LANGUAGE_ARABIC_YEMEN:
+ case LANGUAGE_ARABIC_SYRIA:
+ case LANGUAGE_ARABIC_JORDAN:
+ case LANGUAGE_ARABIC_LEBANON:
+ case LANGUAGE_ARABIC_KUWAIT:
+ case LANGUAGE_ARABIC_UAE:
+ case LANGUAGE_ARABIC_BAHRAIN:
+ case LANGUAGE_ARABIC_QATAR:
+ case LANGUAGE_HEBREW:
+ bRTL = TRUE;
+ break;
+
+ default:
+ break;
+ }
}
- return (bRTL || pEnv);
+ else
+ bRTL = (nUIMirroring == 1);
+
+ return bRTL;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/app/sound.cxx b/vcl/source/app/sound.cxx
index 518c1e297262..6a227ed0a4b9 100644
--- a/vcl/source/app/sound.cxx
+++ b/vcl/source/app/sound.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sound.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: ka $ $Date: 2001-07-30 11:47:12 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -189,7 +189,7 @@ void Sound::Notify()
BOOL Sound::SetSoundName( const XubString& rSoundName )
{
- BOOL bRet;
+ BOOL bRet( FALSE );
if( !rSoundName.Len() )
{
@@ -225,27 +225,37 @@ BOOL Sound::SetSoundName( const XubString& rSoundName )
{
INetURLObject aSoundURL( rSoundName );
String aSoundName, aTmp;
+ BOOL bValidName( FALSE );
- if( aSoundURL.GetProtocol() != INET_PROT_NOT_VALID )
+ // #106654# Accept only local sound files
+ if( aSoundURL.GetProtocol() == INET_PROT_FILE )
{
#ifdef REMOTE_APPSERVER
aSoundName = aSoundURL.GetMainURL( INetURLObject::NO_DECODE );
#else
::utl::LocalFileHelper::ConvertURLToPhysicalName( aSoundURL.GetMainURL( INetURLObject::NO_DECODE ), aSoundName );
#endif
+ bValidName = TRUE;
}
- else if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( rSoundName, aTmp ) )
+ else if( aSoundURL.GetProtocol() == INET_PROT_NOT_VALID &&
+ ::utl::LocalFileHelper::ConvertPhysicalNameToURL( rSoundName, aTmp ) )
+ {
aSoundName = rSoundName;
+ bValidName = TRUE;
+ }
else
{
- DBG_ERROR( "invalid sound file name" );
+ // no valid sound file name
aSoundName = String();
+
+ // #106654# Don't set bRet to true for invalid sound file
+ // names, but init with empty string, anyway
+ mpSound->Init( NULL, aSoundName, mnSoundLen );
}
- bRet = mpSound->Init( NULL, aSoundName, mnSoundLen );
+ if( bValidName )
+ bRet = mpSound->Init( NULL, aSoundName, mnSoundLen );
}
- else
- bRet = FALSE;
maSoundName = rSoundName;
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 161e8e60cba9..65bf030067dd 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: svapp.cxx,v $
*
- * $Revision: 1.41 $
+ * $Revision: 1.42 $
*
- * last change: $Author: ssa $ $Date: 2002-12-09 09:23:17 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -200,7 +200,22 @@ ImplReservedKey ImplReservedKeys[] = {
ImplReservedKey(KeyCode(KEY_F6,0), SV_SHORTCUT_NEXTSUBWINDOW),
ImplReservedKey(KeyCode(KEY_F6,KEY_MOD1), SV_SHORTCUT_TODOCUMENT),
ImplReservedKey(KeyCode(KEY_F6,KEY_SHIFT), SV_SHORTCUT_PREVSUBWINDOW),
+ ImplReservedKey(KeyCode(KEY_F6,KEY_MOD1|KEY_SHIFT), 0), // activate splitter (string is missing!)
ImplReservedKey(KeyCode(KEY_F10,0), SV_SHORTCUT_MENUBAR)
+#ifdef UNX
+ ,
+ ImplReservedKey(KeyCode(KEY_1,KEY_SHIFT|KEY_MOD1), 0),
+ ImplReservedKey(KeyCode(KEY_2,KEY_SHIFT|KEY_MOD1), 0),
+ ImplReservedKey(KeyCode(KEY_3,KEY_SHIFT|KEY_MOD1), 0),
+ ImplReservedKey(KeyCode(KEY_4,KEY_SHIFT|KEY_MOD1), 0),
+ ImplReservedKey(KeyCode(KEY_5,KEY_SHIFT|KEY_MOD1), 0),
+ ImplReservedKey(KeyCode(KEY_6,KEY_SHIFT|KEY_MOD1), 0),
+ ImplReservedKey(KeyCode(KEY_7,KEY_SHIFT|KEY_MOD1), 0),
+ ImplReservedKey(KeyCode(KEY_8,KEY_SHIFT|KEY_MOD1), 0),
+ ImplReservedKey(KeyCode(KEY_9,KEY_SHIFT|KEY_MOD1), 0),
+ ImplReservedKey(KeyCode(KEY_0,KEY_SHIFT|KEY_MOD1), 0),
+ ImplReservedKey(KeyCode(KEY_ADD,KEY_SHIFT|KEY_MOD1), 0)
+#endif
};
@@ -531,7 +546,7 @@ const KeyCode* Application::GetReservedKeyCode( ULONG i )
String Application::GetReservedKeyCodeDescription( ULONG i )
{
- if( i >= GetReservedKeyCodeCount() )
+ if( i >= GetReservedKeyCodeCount() || ! ImplReservedKeys[i].mnResId )
return String();
else
return String( ResId( ImplReservedKeys[i].mnResId, ImplGetResMgr() ) );
@@ -1015,6 +1030,11 @@ void Application::SetSettings( const AllSettings& rSettings )
else
{
AllSettings aOldSettings = *pSVData->maAppData.mpSettings;
+ if( aOldSettings.GetUILanguage() != rSettings.GetUILanguage() && pSVData->mpResMgr )
+ {
+ delete pSVData->mpResMgr;
+ pSVData->mpResMgr = NULL;
+ }
*pSVData->maAppData.mpSettings = rSettings;
ULONG nChangeFlags = aOldSettings.GetChangeFlags( *pSVData->maAppData.mpSettings );
if ( nChangeFlags )
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index 61d4f420e8e9..17c433587fd1 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: svdata.cxx,v $
*
- * $Revision: 1.21 $
+ * $Revision: 1.22 $
*
- * last change: $Author: vg $ $Date: 2002-12-09 16:50:33 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -79,6 +79,7 @@
#include <vos/mutex.hxx>
#endif
+#include <osl/process.h>
#include <osl/file.hxx>
#ifndef _UNO_CURRENT_CONTEXT_HXX_
#include <uno/current_context.hxx>
@@ -129,8 +130,17 @@
#ifndef _COM_SUN_STAR_AWT_XEXTENDEDTOOLKIT_HPP_
#include <drafts/com/sun/star/awt/XExtendedToolkit.hpp>
#endif
-#ifndef _COM_SUN_STAR_JAVA_JAVAINITIALIZATIONEXCEPTION_HPP_
-#include <com/sun/star/java/JavaInitializationException.hpp>
+#ifndef _COM_SUN_STAR_JAVA_JAVANOTCONFIGUREDEXCEPTION_HPP_
+#include <com/sun/star/java/JavaNotConfiguredException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_JAVA_JAVAVMCREATIONFAILUREEXCEPTION_HPP_
+#include <com/sun/star/java/JavaVMCreationFailureException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_JAVA_MISSINGJAVARUNTIMEEXCEPTION_HPP_
+#include <com/sun/star/java/MissingJavaRuntimeException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_JAVA_JAVADISABLEDEXCEPTION_HPP_
+#include <com/sun/star/java/JavaDisabledException.hpp>
#endif
#include <com/sun/star/lang/XComponent.hpp>
@@ -164,6 +174,7 @@ ImplSVShlData aImplSVShlData;
static String& ReplaceJavaErrorMessages( String& rString )
{
+ rString.SearchAndReplaceAllAscii( "%OK", Button::GetStandardText( BUTTON_OK ) );
rString.SearchAndReplaceAllAscii( "%IGNORE", Button::GetStandardText( BUTTON_IGNORE ) );
rString.SearchAndReplaceAllAscii( "%CANCEL", Button::GetStandardText( BUTTON_CANCEL ) );
@@ -325,30 +336,32 @@ com::sun::star::uno::Any AccessBridgeCurrentContext::getValueByName( const rtl::
}
-bool ImplInitAccessBridge()
+bool ImplInitAccessBridge(bool bOnFirstWindow)
{
- bool bSuccess = true;
bool bErrorMessage = (FALSE != vcl::SettingsConfigItem::get()->IsValidConfigMgr());
- // No error messages when env var is set ..
- static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" );
- if( pEnv && *pEnv )
- {
- bErrorMessage = false;
+ // Always return true on shutdown to avoid that these messages appear more than once
+ if (ImplGetSVData()->maAppData.mbAppQuit == TRUE) {
+ return true;
}
- ImplSVData* pSVData = ImplGetSVData();
- if( ! pSVData->mxAccessBridge.is() )
+ try
{
- try
+ bool bSuccess = true;
+
+ // No error messages when env var is set ..
+ static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" );
+ if( pEnv && *pEnv )
+ {
+ bErrorMessage = false;
+ }
+
+ ImplSVData* pSVData = ImplGetSVData();
+ if( ! pSVData->mxAccessBridge.is() )
{
Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory());
- // customize the java-not-available-interaction-handler entry within the
- // current context.
- com::sun::star::uno::ContextLayer layer(
- new AccessBridgeCurrentContext( com::sun::star::uno::getCurrentContext() ) );
- if(xFactory.is())
+ if( xFactory.is() )
{
Reference< XExtendedToolkit > xToolkit =
Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY);
@@ -356,72 +369,242 @@ bool ImplInitAccessBridge()
Sequence< Any > arguments(1);
arguments[0] = makeAny(xToolkit);
- pSVData->mxAccessBridge = Reference< XAccessibleTopWindowMap >(
- xFactory->createInstanceWithArguments(
- OUString::createFromAscii( "drafts.com.sun.star.accessibility.bridge.AccessBridge" ),
- arguments
- ), UNO_QUERY );
+#ifdef WNT
+ // This code causes the AccessBridge to redirect the console output to log file,
+ // which is extremly helpful on Windows because there is currently no code that
+ // opens a console window on demand.
+
+ OUString aLogPath;
+ OUString aEnvVar("ACCESSBRIDGE_LOGPATH", sizeof("ACCESSBRIDGE_LOGPATH"), RTL_TEXTENCODING_ASCII_US);
+ osl_getEnvironment(aEnvVar.pData, &aLogPath.pData);
+ if( aLogPath.getLength() > 0 )
+ {
+ arguments.realloc(2);
+ arguments[1] = makeAny(aLogPath);
+ }
+#endif
+
+ // Disable default java error messages on startup, because they were probably unreadable
+ // for a disabled user. Use native message boxes which are accessible without java support.
+ // No need to do this when activated by Tools-Options dialog ..
+ if( bOnFirstWindow )
+ {
+ // customize the java-not-available-interaction-handler entry within the
+ // current context when called at startup.
+ com::sun::star::uno::ContextLayer layer(
+ new AccessBridgeCurrentContext( com::sun::star::uno::getCurrentContext() ) );
+
+ pSVData->mxAccessBridge = Reference< XAccessibleTopWindowMap >(
+ xFactory->createInstanceWithArguments(
+ OUString::createFromAscii( "drafts.com.sun.star.accessibility.bridge.AccessBridge" ),
+ arguments
+ ), UNO_QUERY );
+ }
+ else
+ {
+ pSVData->mxAccessBridge = Reference< XAccessibleTopWindowMap >(
+ xFactory->createInstanceWithArguments(
+ OUString::createFromAscii( "drafts.com.sun.star.accessibility.bridge.AccessBridge" ),
+ arguments
+ ), UNO_QUERY );
+ }
if( !pSVData->mxAccessBridge.is() )
bSuccess = false;
}
}
- catch(::com::sun::star::java::JavaInitializationException exception)
+ return bSuccess;
+ }
+
+ catch(::com::sun::star::java::JavaNotConfiguredException e)
+ {
+ if( bErrorMessage )
{
- bSuccess = false;
+ ResMgr *pResMgr = ImplGetResMgr();
- if( bErrorMessage )
+ String aTitle(ResId(SV_ACCESSERROR_JAVA_NOT_CONFIGURED, pResMgr));
+ String aMessage(ResId(SV_ACCESSERROR_JAVA_MSG, pResMgr));
+
+ aMessage += String(" ", 1, RTL_TEXTENCODING_ASCII_US);
+ aMessage += String(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, pResMgr));
+
+ int ret = ImplShowNativeMessageBox(
+ aTitle,
+ ReplaceJavaErrorMessages(aMessage),
+ SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL,
+ SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL);
+
+ // Do not change the setting in case the user chooses to cancel
+ if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
{
- ResMgr *pResMgr = ImplGetResMgr();
-
- String aMessage1(ResId(SV_ACCESSERROR_MISSING_JAVA, pResMgr));
- String aMessage2(ResId(SV_ACCESSERROR_MISSING_JAVA_MSG, pResMgr));
- ImplShowNativeMessageBox(
- ReplaceJavaErrorMessages(aMessage1),
- ReplaceJavaErrorMessages(aMessage2),
- SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE,
- SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE);
+ // Application::Quit results in an endlesss loop
+ ImplGetSVData()->maAppData.mbAppQuit = TRUE;
+ return true;
+
}
}
- catch(::com::sun::star::uno::Exception exception)
+ return false;
+ }
+
+ catch(::com::sun::star::java::JavaVMCreationFailureException e)
+ {
+ if( bErrorMessage )
{
- bSuccess = false;
+ ResMgr *pResMgr = ImplGetResMgr();
+
+ String aTitle(ResId(SV_ACCESSERROR_FAULTY_JAVA, pResMgr));
+ String aMessage(ResId(SV_ACCESSERROR_JAVA_MSG, pResMgr));
+
+ aMessage += String(" ", 1, RTL_TEXTENCODING_ASCII_US);
+ aMessage += String(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, pResMgr));
+
+ int ret = ImplShowNativeMessageBox(
+ aTitle,
+ ReplaceJavaErrorMessages(aMessage),
+ SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL,
+ SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL);
- if( bErrorMessage )
+ // Do not change the setting in case the user chooses to cancel
+ if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
{
- String aTitle;
- String aMessage;
- ResMgr *pResMgr = ImplGetResMgr();
+ // Application::Quit results in an endlesss loop
+ ImplGetSVData()->maAppData.mbAppQuit = TRUE;
+ return true;
- if( exception.Message.compareTo(::rtl::OUString::createFromAscii("ClassNotFound"), 13) )
- {
- String aTmp(ResId(SV_ACCESSERROR_MISSING_BRIDGE, pResMgr));
- aTitle = ReplaceJavaErrorMessages(aTmp);
- aTmp = String(ResId(SV_ACCESSERROR_MISSING_BRIDGE_MSG, pResMgr));
- aMessage = ReplaceJavaErrorMessages(aTmp);
- }
- else if( exception.Message.compareTo(::rtl::OUString::createFromAscii("NoSuchMethod"), 12) )
+ }
+ }
+
+ return false;
+ }
+
+ catch(::com::sun::star::java::MissingJavaRuntimeException e)
+ {
+ if( bErrorMessage )
+ {
+ ResMgr *pResMgr = ImplGetResMgr();
+
+ String aTitle(ResId(SV_ACCESSERROR_MISSING_JAVA, pResMgr));
+ String aMessage(ResId(SV_ACCESSERROR_JAVA_MSG, pResMgr));
+
+ aMessage += String(" ", 1, RTL_TEXTENCODING_ASCII_US);
+ aMessage += String(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, pResMgr));
+
+ int ret = ImplShowNativeMessageBox(
+ aTitle,
+ ReplaceJavaErrorMessages(aMessage),
+ SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL,
+ SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL);
+
+ // Do not change the setting in case the user chooses to cancel
+ if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
+ {
+ // Application::Quit results in an endlesss loop
+ ImplGetSVData()->maAppData.mbAppQuit = TRUE;
+ return true;
+
+ }
+ }
+
+ return false;
+ }
+
+ catch(::com::sun::star::java::JavaDisabledException e)
+ {
+ if( bErrorMessage )
+ {
+ ResMgr *pResMgr = ImplGetResMgr();
+
+ String aTitle(ResId(SV_ACCESSERROR_JAVA_DISABLED, pResMgr));
+ String aMessage(ResId(SV_ACCESSERROR_JAVA_MSG, pResMgr));
+
+ aMessage += String(" ", 1, RTL_TEXTENCODING_ASCII_US);
+ aMessage += String(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, pResMgr));
+
+ int ret = ImplShowNativeMessageBox(
+ aTitle,
+ ReplaceJavaErrorMessages(aMessage),
+ SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL,
+ SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL);
+
+ // Do not change the setting in case the user chooses to cancel
+ if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
+ {
+ // Application::Quit results in an endlesss loop
+ ImplGetSVData()->maAppData.mbAppQuit = TRUE;
+ return true;
+
+ }
+ }
+
+ return false;
+ }
+
+
+ catch(::com::sun::star::uno::RuntimeException e)
+ {
+ if( bErrorMessage )
+ {
+ ResMgr *pResMgr = ImplGetResMgr();
+
+ String aTitle;
+ String aMessage(ResId(SV_ACCESSERROR_BRIDGE_MSG, pResMgr));
+
+ if( 0 == e.Message.compareTo(::rtl::OUString::createFromAscii("ClassNotFound"), 13) )
+ {
+ aTitle = String(ResId(SV_ACCESSERROR_MISSING_BRIDGE, pResMgr));
+ }
+ else if( 0 == e.Message.compareTo(::rtl::OUString::createFromAscii("NoSuchMethod"), 12) )
+ {
+ aTitle = String(ResId(SV_ACCESSERROR_WRONG_VERSION, pResMgr));
+ }
+
+ if( aTitle.Len() != 0 )
+ {
+ if( bOnFirstWindow )
{
- String aTmp(ResId(SV_ACCESSERROR_WRONG_VERSION, pResMgr));
- aTitle = ReplaceJavaErrorMessages(aTmp);
- aTmp = String(ResId(SV_ACCESSERROR_WRONG_VERSION_MSG, pResMgr));
- aMessage = ReplaceJavaErrorMessages(aTmp);
- }
+ // Something went wrong initializing the Java AccessBridge (on Windows) during the
+ // startup. Since the office will be probably unusable for a disabled user, we offer
+ // to terminate directly.
+ aMessage += String(" ", 1, RTL_TEXTENCODING_ASCII_US);
+ aMessage += String(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, pResMgr));
- if( aTitle.Len() != 0 )
+ int ret = ImplShowNativeMessageBox(
+ aTitle,
+ ReplaceJavaErrorMessages(aMessage),
+ SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL,
+ SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL);
+
+ // Do not change the setting in case the user chooses to cancel
+ if( SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL == ret )
+ {
+ // Application::Quit results in an endlesss loop
+ ImplGetSVData()->maAppData.mbAppQuit = TRUE;
+ return true;
+
+ }
+ }
+ else
{
+ // The user tried to activate accessibility support using Tools-Options dialog,
+ // so we don't offer to terminate here !
ImplShowNativeMessageBox(
aTitle,
- aMessage,
- SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE,
- SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE);
+ ReplaceJavaErrorMessages(aMessage),
+ SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK,
+ SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK);
}
}
}
+
+ return false;
+ }
+
+ catch (...)
+ {
+ return false;
}
- return bSuccess;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 05b74c757729..42f58c873d24 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: combobox.cxx,v $
*
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
- * last change: $Author: mt $ $Date: 2002-12-12 16:26:01 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -819,7 +819,11 @@ long ComboBox::Notify( NotifyEvent& rNEvt )
nDone = 1;
}
else
+ {
+ if( mpFloatWin )
+ mpImplLB->GetMainWindow()->CalcMaxVisibleEntries( mpFloatWin->CalcFloatSize() );
nDone = mpImplLB->ProcessKeyInput( aKeyEvt );
+ }
}
break;
@@ -1399,3 +1403,46 @@ const Wallpaper& ComboBox::GetDisplayBackground() const
return Control::GetDisplayBackground();
return rBack;
}
+// -----------------------------------------------------------------------------
+USHORT ComboBox::GetSelectEntryCount() const
+{
+ return mpImplLB->GetEntryList()->GetSelectEntryCount();
+}
+// -----------------------------------------------------------------------------
+USHORT ComboBox::GetSelectEntryPos( USHORT nIndex ) const
+{
+ USHORT nPos = mpImplLB->GetEntryList()->GetSelectEntryPos( nIndex );
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ {
+ if ( nPos < mpImplLB->GetEntryList()->GetMRUCount() )
+ nPos = mpImplLB->GetEntryList()->FindEntry( mpImplLB->GetEntryList()->GetEntryText( nPos ) );
+ nPos -= mpImplLB->GetEntryList()->GetMRUCount();
+ }
+ return nPos;
+}
+// -----------------------------------------------------------------------------
+BOOL ComboBox::IsEntryPosSelected( USHORT nPos ) const
+{
+ return mpImplLB->GetEntryList()->IsEntryPosSelected( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
+}
+// -----------------------------------------------------------------------------
+void ComboBox::SelectEntryPos( USHORT nPos, BOOL bSelect)
+{
+ if ( nPos < mpImplLB->GetEntryList()->GetEntryCount() )
+ mpImplLB->SelectEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), bSelect );
+}
+// -----------------------------------------------------------------------------
+void ComboBox::SetNoSelection()
+{
+ mpImplLB->SetNoSelection();
+ mpSubEdit->SetText( String() );
+}
+// -----------------------------------------------------------------------------
+Rectangle ComboBox::GetBoundingRectangle( USHORT nItem ) const
+{
+ Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle( nItem );
+ Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( (Window*)this );
+ aRect.Move( aOffset.TopLeft().X(), aOffset.TopLeft().Y() );
+ return aRect;
+}
+// -----------------------------------------------------------------------------
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 767d8fc5d4fa..584213a16d33 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: edit.cxx,v $
*
- * $Revision: 1.55 $
+ * $Revision: 1.56 $
*
- * last change: $Author: tbe $ $Date: 2002-11-28 13:19:11 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:52 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -827,7 +827,7 @@ void Edit::ImplSetText( const XubString& rText, const Selection* pNewSelection )
{
// Der Text wird dadurch geloescht das der alte Text komplett 'selektiert'
// wird, dann InsertText, damit flackerfrei.
- if ( (rText != maText) || (pNewSelection && (*pNewSelection != maSelection)) )
+ if ( ( rText.Len() <= mnMaxTextLen ) && ( (rText != maText) || (pNewSelection && (*pNewSelection != maSelection)) ) )
{
delete mpLayoutData, mpLayoutData = NULL;
maSelection.Min() = 0;
@@ -1083,6 +1083,15 @@ void Edit::ImplLoadRes( const ResId& rResId )
// -----------------------------------------------------------------------
+void Edit::ImplCopyToSelectionClipboard()
+{
+ if ( GetSelection().Len() )
+ {
+ ::com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboard> aSelection(Window::GetSelection());
+ ImplCopy( aSelection );
+ }
+}
+
void Edit::ImplCopy( uno::Reference< datatransfer::clipboard::XClipboard >& rxClipboard )
{
if ( rxClipboard.is() )
@@ -1163,12 +1172,17 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt )
{
mbClickedInSelection = FALSE;
if ( rMEvt.GetClicks() == 3 )
+ {
ImplSetSelection( Selection( 0, 0xFFFF ) );
+ ImplCopyToSelectionClipboard();
+
+ }
else if ( rMEvt.GetClicks() == 2 )
{
uno::Reference < i18n::XBreakIterator > xBI = ImplGetBreakIterator();
i18n::Boundary aBoundary = xBI->getWordBoundary( maText, aSelection.Max(), GetSettings().GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
ImplSetSelection( Selection( aBoundary.startPos, aBoundary.endPos ) );
+ ImplCopyToSelectionClipboard();
}
else if ( !rMEvt.IsShift() && HasFocus() && aSelection.IsInside( nChar ) )
mbClickedInSelection = TRUE;
@@ -1214,10 +1228,9 @@ void Edit::Tracking( const TrackingEvent& rTEvt )
ImplSetCursorPos( nChar, FALSE );
mbClickedInSelection = FALSE;
}
- else if ( rTEvt.GetMouseEvent().IsLeft() && GetSelection().Len() )
+ else if ( rTEvt.GetMouseEvent().IsLeft() )
{
- ::com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboard> aSelection(Window::GetSelection());
- ImplCopy( aSelection );
+ ImplCopyToSelectionClipboard();
}
}
else
@@ -1346,10 +1359,7 @@ BOOL Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( aSel != GetSelection() )
{
ImplSetSelection( aSel );
- if ( aSel.Len() ) {
- ::com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboard> aSelection(Window::GetSelection());
- ImplCopy( aSelection );
- }
+ ImplCopyToSelectionClipboard();
}
if ( (nCode == KEY_END) && maAutocompleteHdl.IsSet() && !rKEvt.GetKeyCode().GetModifier() )
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 3d9231b66922..ca757c9d82bc 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ilstbox.cxx,v $
*
- * $Revision: 1.39 $
+ * $Revision: 1.40 $
*
- * last change: $Author: mt $ $Date: 2002-11-22 11:26:19 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -927,6 +927,7 @@ void ImplListBoxWindow::SelectEntry( USHORT nPos, BOOL bSelect )
delete mpLayoutData, mpLayoutData = NULL;
if ( !mnMaxVisibleEntries || !IsReallyVisible() || ( nPos < GetTopEntry() ) )
{
+ Resize();
SetTopEntry( nPos );
}
else
@@ -1522,6 +1523,10 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
((nSelect != mnCurrentPos ) || ( eLET == LET_KEYSPACE)) )
{
DBG_ASSERT( (nSelect != mnCurrentPos) || mbMulti, "ImplListBox: Selecting same Entry" );
+ if( nSelect >= mpEntryList->GetEntryCount() )
+ nSelect = mpEntryList->GetEntryCount()-1;
+ else if (nSelect < 0 )
+ nSelect = 0;
mnCurrentPos = nSelect;
if ( SelectEntries( nSelect, eLET, bShift, bCtrl ) )
{
@@ -1736,6 +1741,14 @@ void ImplListBoxWindow::Resize()
// -----------------------------------------------------------------------
+void ImplListBoxWindow::CalcMaxVisibleEntries( const Size& rFloatSize )
+{
+ if( mnMaxHeight )
+ mnMaxVisibleEntries = (USHORT) ( (rFloatSize.Height()-4) / mnMaxHeight );
+}
+
+// -----------------------------------------------------------------------
+
void ImplListBoxWindow::GetFocus()
{
USHORT nPos = mnCurrentPos;
@@ -2203,7 +2216,8 @@ void ImplListBox::ImplResizeControls()
else
{
mpVScrollBar->Hide();
- SetTopEntry( 0 );
+ // #107254# Don't reset top entry after resize, but check for max top entry
+ SetTopEntry( GetTopEntry() );
}
// horz. ScrollBar
@@ -2610,7 +2624,7 @@ void ImplBtn::MouseButtonDown( const MouseEvent& rMEvt )
// =======================================================================
ImplListBoxFloatingWindow::ImplListBoxFloatingWindow( Window* pParent ) :
- FloatingWindow( pParent, WB_BORDER | WB_SYSTEMWINDOW )
+ FloatingWindow( pParent, WB_BORDER | WB_SYSTEMWINDOW | WB_NOSHADOW ) // no drop shadow for list boxes
{
mpImplLB = NULL;
mnDDLineCount = 0;
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index 089867e99752..f01bbcbb7edb 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: lstbox.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: mt $ $Date: 2002-12-12 16:26:00 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -809,7 +809,11 @@ long ListBox::PreNotify( NotifyEvent& rNEvt )
break;
default:
+ {
+ if( mpFloatWin )
+ mpImplLB->GetMainWindow()->CalcMaxVisibleEntries( mpFloatWin->CalcFloatSize() );
nDone = mpImplLB->ProcessKeyInput( aKeyEvt );
+ }
}
}
else if ( rNEvt.GetType() == EVENT_LOSEFOCUS )
diff --git a/vcl/source/gdi/base14.cxx b/vcl/source/gdi/base14.cxx
index 4191655eebcc..4f6890cd1b74 100644
--- a/vcl/source/gdi/base14.cxx
+++ b/vcl/source/gdi/base14.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: base14.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: pl $ $Date: 2002-07-29 12:47:10 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -72,7 +72,7 @@ const PDFWriterImpl::BuiltinFont PDFWriterImpl::m_aBuiltinFonts[ 14 ] = {
RTL_TEXTENCODING_MS_1252, // charset
PITCH_FIXED, // pitch
WIDTH_NORMAL, // width type
- WEIGHT_NORMAL, // weight type
+ WEIGHT_MEDIUM, // weight type
ITALIC_NONE, // italic type
{ 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 7
0, 0, 0, 0, 0, 0, 0, 0, // 8 - 15
@@ -117,7 +117,7 @@ const PDFWriterImpl::BuiltinFont PDFWriterImpl::m_aBuiltinFonts[ 14 ] = {
RTL_TEXTENCODING_MS_1252, // charset
PITCH_FIXED, // pitch
WIDTH_NORMAL, // width type
- WEIGHT_NORMAL, // weight type
+ WEIGHT_MEDIUM, // weight type
ITALIC_NORMAL, // italic type
{ 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 7
0, 0, 0, 0, 0, 0, 0, 0, // 8 - 15
@@ -252,7 +252,7 @@ const PDFWriterImpl::BuiltinFont PDFWriterImpl::m_aBuiltinFonts[ 14 ] = {
RTL_TEXTENCODING_MS_1252, // charset
PITCH_VARIABLE, // pitch
WIDTH_NORMAL, // width type
- WEIGHT_NORMAL, // weight type
+ WEIGHT_MEDIUM, // weight type
ITALIC_NONE, // italic type
{ 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 7
0, 0, 0, 0, 0, 0, 0, 0, // 8 - 15
@@ -297,7 +297,7 @@ const PDFWriterImpl::BuiltinFont PDFWriterImpl::m_aBuiltinFonts[ 14 ] = {
RTL_TEXTENCODING_MS_1252, // charset
PITCH_VARIABLE, // pitch
WIDTH_NORMAL, // width type
- WEIGHT_NORMAL, // weight type
+ WEIGHT_MEDIUM, // weight type
ITALIC_NORMAL, // italic type
{ 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 7
0, 0, 0, 0, 0, 0, 0, 0, // 8 - 15
@@ -432,7 +432,7 @@ const PDFWriterImpl::BuiltinFont PDFWriterImpl::m_aBuiltinFonts[ 14 ] = {
RTL_TEXTENCODING_MS_1252, // charset
PITCH_VARIABLE, // pitch
WIDTH_NORMAL, // width type
- WEIGHT_NORMAL, // weight type
+ WEIGHT_MEDIUM, // weight type
ITALIC_NONE, // italic type
{ 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 7
0, 0, 0, 0, 0, 0, 0, 0, // 8 - 15
@@ -477,7 +477,7 @@ const PDFWriterImpl::BuiltinFont PDFWriterImpl::m_aBuiltinFonts[ 14 ] = {
RTL_TEXTENCODING_MS_1252, // charset
PITCH_VARIABLE, // pitch
WIDTH_NORMAL, // width type
- WEIGHT_NORMAL, // weight type
+ WEIGHT_MEDIUM, // weight type
ITALIC_NORMAL, // italic type
{ 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 7
0, 0, 0, 0, 0, 0, 0, 0, // 8 - 15
@@ -612,7 +612,7 @@ const PDFWriterImpl::BuiltinFont PDFWriterImpl::m_aBuiltinFonts[ 14 ] = {
RTL_TEXTENCODING_SYMBOL, // charset
PITCH_VARIABLE, // pitch
WIDTH_NORMAL, // width type
- WEIGHT_NORMAL, // weight type
+ WEIGHT_MEDIUM, // weight type
ITALIC_NONE, // italic type
{ 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 7
0, 0, 0, 0, 0, 0, 0, 0, // 8 - 15
@@ -657,7 +657,7 @@ const PDFWriterImpl::BuiltinFont PDFWriterImpl::m_aBuiltinFonts[ 14 ] = {
RTL_TEXTENCODING_SYMBOL, // charset
PITCH_VARIABLE, // pitch
WIDTH_NORMAL, // width type
- WEIGHT_NORMAL, // weight type
+ WEIGHT_MEDIUM, // weight type
ITALIC_NONE, // italic type
{ 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 7
0, 0, 0, 0, 0, 0, 0, 0, // 8 - 15
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index b20101c4786a..5651cb70b5f1 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: bitmap.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: thb $ $Date: 2002-10-22 17:25:33 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1929,6 +1929,11 @@ BOOL Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
return bRet;
}
+BOOL Bitmap::MakeMono( BYTE cThreshold )
+{
+ return ImplMakeMono( cThreshold );
+}
+
// ------------------------------------------------------------------
#ifdef REMOTE_APPSERVER
diff --git a/vcl/source/gdi/bmpconv.cxx b/vcl/source/gdi/bmpconv.cxx
new file mode 100644
index 000000000000..8a9d3d124e04
--- /dev/null
+++ b/vcl/source/gdi/bmpconv.cxx
@@ -0,0 +1,253 @@
+/*************************************************************************
+ *
+ * $RCSfile: bmpconv.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <bitmap.hxx>
+#include <impbmpconv.hxx>
+#include <svapp.hxx>
+#include <vos/mutex.hxx>
+
+#ifndef _STREAM_HXX
+#include <tools/stream.hxx>
+#endif
+#ifndef _COM_SUN_STAR_SCRIPT_XINVOCATION_HPP_
+#include <com/sun/star/script/XInvocation.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_XBITMAP_HPP_
+#include <com/sun/star/awt/XBitmap.hpp>
+#endif
+
+#ifndef _CPPUHELPER_COMPBASE1_HXX_
+#include <cppuhelper/compbase1.hxx>
+#endif
+
+
+using namespace com::sun::star::uno;
+using namespace com::sun::star::script;
+using namespace com::sun::star::beans;
+using namespace com::sun::star::reflection;
+using namespace com::sun::star::awt;
+using namespace rtl;
+
+namespace vcl {
+
+class BmpTransporter :
+ public cppu::WeakImplHelper1< com::sun::star::awt::XBitmap >
+{
+ Sequence<sal_Int8> m_aBM;
+ com::sun::star::awt::Size m_aSize;
+public:
+ BmpTransporter( const Bitmap& rBM );
+ virtual ~BmpTransporter();
+
+ virtual com::sun::star::awt::Size SAL_CALL getSize() throw();
+ virtual Sequence< sal_Int8 > SAL_CALL getDIB() throw();
+ virtual Sequence< sal_Int8 > SAL_CALL getMaskDIB() throw();
+};
+
+class BmpConverter :
+ public cppu::WeakImplHelper1< com::sun::star::script::XInvocation >
+{
+public:
+ BmpConverter();
+ virtual ~BmpConverter();
+
+ virtual Reference< XIntrospectionAccess > SAL_CALL getIntrospection() throw();
+ virtual void SAL_CALL setValue( const OUString& rProperty, const Any& rValue )
+ throw( UnknownPropertyException );
+ virtual Any SAL_CALL getValue( const OUString& rProperty )
+ throw( UnknownPropertyException );
+ virtual sal_Bool SAL_CALL hasMethod( const OUString& rName ) throw();
+ virtual sal_Bool SAL_CALL hasProperty( const OUString& rProp ) throw();
+
+ virtual Any SAL_CALL invoke( const OUString& rFunction,
+ const Sequence< Any >& rParams,
+ Sequence< sal_Int16 >& rOutParamIndex,
+ Sequence< Any >& rOutParam
+ )
+ throw( CannotConvertException, InvocationTargetException );
+};
+
+}
+
+using namespace vcl;
+
+Reference< XInvocation > vcl::createBmpConverter()
+{
+ return static_cast<XInvocation*>(new BmpConverter());
+}
+
+BmpConverter::BmpConverter()
+{
+}
+
+BmpConverter::~BmpConverter()
+{
+}
+
+Reference< XIntrospectionAccess > SAL_CALL BmpConverter::getIntrospection() throw()
+{
+ return Reference< XIntrospectionAccess >();
+}
+
+void SAL_CALL BmpConverter::setValue( const OUString& rProperty, const Any& rValue ) throw( UnknownPropertyException )
+{
+ throw UnknownPropertyException();
+}
+
+Any SAL_CALL BmpConverter::getValue( const OUString& rProperty ) throw( UnknownPropertyException )
+{
+ throw UnknownPropertyException();
+}
+
+sal_Bool SAL_CALL BmpConverter::hasMethod( const OUString& rName ) throw()
+{
+ return rName.equalsIgnoreAsciiCase( OUString::createFromAscii( "convert-bitmap-depth" ) );
+}
+
+sal_Bool SAL_CALL BmpConverter::hasProperty( const OUString& rName ) throw()
+{
+ return sal_False;
+}
+
+Any SAL_CALL BmpConverter::invoke(
+ const OUString& rFunction,
+ const Sequence< Any >& rParams,
+ Sequence< sal_Int16 >& rOutParamIndex,
+ Sequence< Any >& rOutParam )
+ throw( CannotConvertException, InvocationTargetException )
+{
+ Any aRet;
+
+ if( rFunction.equalsIgnoreAsciiCase( OUString::createFromAscii( "convert-bitmap-depth" ) ) )
+ {
+ Reference< XBitmap > xBM;
+ sal_uInt16 nTargetDepth = 0;
+ if( rParams.getLength() != 2 )
+ throw CannotConvertException();
+
+ if( ! (rParams.getConstArray()[0] >>= xBM ) ||
+ ! ( rParams.getConstArray()[1] >>= nTargetDepth ) )
+ throw CannotConvertException();
+
+ Sequence< sal_Int8 > aDIB = xBM->getDIB();
+
+ // call into vcl not thread safe
+ vos::OGuard aGuard( Application::GetSolarMutex() );
+
+ SvMemoryStream aStream( aDIB.getArray(), aDIB.getLength(), STREAM_READ | STREAM_WRITE );
+ Bitmap aBM;
+ aBM.Read( aStream, TRUE );
+ if( nTargetDepth < 4 )
+ nTargetDepth = 1;
+ else if( nTargetDepth < 8 )
+ nTargetDepth = 4;
+ else if( nTargetDepth >8 && nTargetDepth < 24 )
+ nTargetDepth = 24;
+
+ if( aBM.GetBitCount() == 24 && nTargetDepth <= 8 )
+ aBM.Dither( BMP_DITHER_FLOYD );
+
+ if( aBM.GetBitCount() != nTargetDepth )
+ {
+ switch( nTargetDepth )
+ {
+ case 1: aBM.Convert( BMP_CONVERSION_1BIT_THRESHOLD );break;
+ case 4: aBM.ReduceColors( BMP_CONVERSION_4BIT_COLORS );break;
+ case 8: aBM.ReduceColors( BMP_CONVERSION_8BIT_COLORS );break;
+ case 24: aBM.Convert( BMP_CONVERSION_24BIT );break;
+ }
+ }
+ xBM = new BmpTransporter( aBM );
+ aRet <<= xBM;
+ }
+ else
+ throw InvocationTargetException();
+
+ return aRet;
+}
+
+BmpTransporter::BmpTransporter( const Bitmap& rBM )
+{
+ m_aSize.Width = rBM.GetSizePixel().Width();
+ m_aSize.Height = rBM.GetSizePixel().Height();
+ SvMemoryStream aStream;
+ rBM.Write( aStream, FALSE, TRUE );
+ m_aBM = Sequence<sal_Int8>((const sal_Int8*)aStream.GetData(), aStream.GetSize() );
+}
+
+BmpTransporter::~BmpTransporter()
+{
+}
+
+com::sun::star::awt::Size SAL_CALL BmpTransporter::getSize() throw()
+{
+ return m_aSize;
+}
+
+Sequence< sal_Int8 > SAL_CALL BmpTransporter::getDIB() throw()
+{
+ return m_aBM;
+}
+
+Sequence< sal_Int8 > SAL_CALL BmpTransporter::getMaskDIB() throw()
+{
+ return Sequence< sal_Int8 >();
+}
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index ca57ea3c9c57..270f223f09ef 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: cvtsvm.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: thb $ $Date: 2002-12-10 17:28:12 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,6 +62,7 @@
#define _SV_CVTSVM_CXX
#define ENABLE_BYTESTRING_STREAM_OPERATORS
+#include <algorithm>
#include <string.h>
#ifndef _STACK_HXX //autogen
@@ -445,6 +446,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
const USHORT nOldFormat = rIStm.GetNumberFormatInt();
rtl_TextEncoding eActualCharSet = gsl_getSystemTextEncoding();
BOOL bFatLine = FALSE;
+ VirtualDevice aFontVDev;
rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
@@ -695,6 +697,9 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
rMtf.AddAction( new MetaTextAlignAction( aFont.GetAlign() ) );
rMtf.AddAction( new MetaTextColorAction( aFont.GetColor() ) );
rMtf.AddAction( new MetaTextFillColorAction( aFont.GetFillColor(), !aFont.IsTransparent() ) );
+
+ // #106172# Track font relevant data in shadow VDev
+ aFontVDev.SetFont( aFont );
}
break;
@@ -724,10 +729,41 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
if( nAryLen > 0L )
{
- pDXAry = new long[ nAryLen ];
+ INT32 nStrLen( aStr.Len() );
+
+ pDXAry = new long[ ::std::max( nAryLen, nStrLen ) ];
for( long i = 0L; i < nAryLen; i++ )
rIStm >> nTmp, pDXAry[ i ] = nTmp;
+
+ // #106172# Add last DX array elem, if missing
+ if( nAryLen != nStrLen )
+ {
+ if( nAryLen+1 == nStrLen )
+ {
+ long* pTmpAry = new long[nStrLen];
+
+ aFontVDev.GetTextArray( aStr, pTmpAry, (USHORT) nIndex, (USHORT) nLen );
+
+ // now, the difference between the
+ // last and the second last DX array
+ // is the advancement for the last
+ // glyph. Thus, to complete our meta
+ // action's DX array, just add that
+ // difference to last elem and store
+ // in very last.
+ if( nStrLen > 1 )
+ pDXAry[ nStrLen-1 ] = pDXAry[ nStrLen-2 ] + pTmpAry[ nStrLen-1 ] - pTmpAry[ nStrLen-2 ];
+ else
+ pDXAry[ nStrLen-1 ] = pTmpAry[ nStrLen-1 ]; // len=1: 0th position taken to be 0
+
+ delete pTmpAry;
+ }
+#ifdef DBG_UTIL
+ else
+ DBG_ERROR("More than one DX array element missing on SVM import");
+#endif
+ }
}
if ( nUnicodeCommentActionNumber == i )
ImplReadUnicodeComment( nUnicodeCommentStreamPos, rIStm, aStr );
@@ -812,6 +848,9 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
ImplReadMapMode( rIStm, aMapMode );
rMtf.AddAction( new MetaMapModeAction( aMapMode ) );
+
+ // #106172# Track font relevant data in shadow VDev
+ aFontVDev.SetMapMode( aMapMode );
}
break;
@@ -919,6 +958,9 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
aLIStack.Push( new LineInfo( aLineInfo ) );
rMtf.AddAction( new MetaPushAction( PUSH_ALL ) );
+
+ // #106172# Track font relevant data in shadow VDev
+ aFontVDev.Push();
}
break;
@@ -936,6 +978,9 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
}
rMtf.AddAction( new MetaPopAction() );
+
+ // #106172# Track font relevant data in shadow VDev
+ aFontVDev.Pop();
}
break;
@@ -1032,6 +1077,12 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
#ifdef CVTSVM_WRITE_SUBACTIONCOUNT
i += nFollowingActionCount;
#endif
+
+ // #106172# Track font relevant data in shadow VDev
+ if( bSet )
+ aFontVDev.SetRefPoint( aRefPoint );
+ else
+ aFontVDev.SetRefPoint();
}
break;
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index b70562a97420..83d766457867 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: font.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: pl $ $Date: 2001-08-01 12:32:47 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -538,6 +538,7 @@ BOOL Font::operator==( const Font& rFont ) const
(mpImplFont->maFillColor == rFont.mpImplFont->maFillColor ) &&
(mpImplFont->maSize == rFont.mpImplFont->maSize ) &&
(mpImplFont->mnOrientation == rFont.mpImplFont->mnOrientation ) &&
+ (mpImplFont->mbVertical == rFont.mpImplFont->mbVertical ) &&
(mpImplFont->meUnderline == rFont.mpImplFont->meUnderline ) &&
(mpImplFont->meStrikeout == rFont.mpImplFont->meStrikeout ) &&
(mpImplFont->meRelief == rFont.mpImplFont->meRelief ) &&
diff --git a/vcl/source/gdi/fontcfg.cxx b/vcl/source/gdi/fontcfg.cxx
index eb1314ba9f1f..26733c7adcdb 100644
--- a/vcl/source/gdi/fontcfg.cxx
+++ b/vcl/source/gdi/fontcfg.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fontcfg.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: ssa $ $Date: 2002-10-11 13:28:08 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -406,6 +406,7 @@ const OUString& DefaultFontConfigItem::getUserInterfaceFont( int nLanguage ) con
#define FALLBACKFONT_UI_SANS "Andale Sans UI;Tahoma;Arial Unicode MS;Interface User;Geneva;WarpSans;Dialog;Swiss;Lucida;Helvetica;Charcoal;Chicago;Arial;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;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;Gulim;Roundgothic;Arial Unicode MS;Lucida Sans Unicode;Tahoma;Andale Sans UI"
if( nLanguage == LANGUAGE_SYSTEM )
nLanguage = Application::GetSettings().GetUILanguage();
@@ -420,6 +421,14 @@ const OUString& DefaultFontConfigItem::getUserInterfaceFont( int nLanguage ) con
static const OUString aFallback (RTL_CONSTASCII_USTRINGPARAM(FALLBACKFONT_UI_SANS));
static const OUString aFallBackArabic (RTL_CONSTASCII_USTRINGPARAM( FALLBACKFONT_UI_SANS_ARABIC ) );
static const OUString aFallBackThai (RTL_CONSTASCII_USTRINGPARAM( FALLBACKFONT_UI_SANS_THAI ) );
+
+ // we need localized names for korean fonts
+ static sal_Unicode const aSunGulim[] = { 0xC36C, 0xAD74, 0xB9BC, 0, 0 };
+ String aFallBackKoreanLocalized( aSunGulim );
+ 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
switch( nLanguage )
{
@@ -446,6 +455,10 @@ const OUString& DefaultFontConfigItem::getUserInterfaceFont( int nLanguage ) con
case LANGUAGE_THAI:
return aFallBackThai;
break;
+ case LANGUAGE_KOREAN:
+ case LANGUAGE_KOREAN_JOHAB:
+ return aFallBackKorean;
+ break;
default:
break;
}
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 0afb77b34f57..90bb71990a67 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: graph.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: ka $ $Date: 2001-08-24 14:10:36 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -67,6 +67,9 @@
#ifndef _SV_OUTDEV_HXX
#include <outdev.hxx>
#endif
+#ifndef _SV_SVAPP_HXX
+#include <svapp.hxx>
+#endif
#include <graph.hxx>
// -----------------------
@@ -499,6 +502,20 @@ void Graphic::SetPrefMapMode( const MapMode& rPrefMapMode )
// ------------------------------------------------------------------
+Size Graphic::GetSizePixel( const OutputDevice* pRefDevice ) const
+{
+ Size aRet;
+
+ if( GRAPHIC_BITMAP == mpImpGraphic->ImplGetType() )
+ aRet = mpImpGraphic->ImplGetBitmapEx( NULL ).GetSizePixel();
+ else
+ aRet = ( pRefDevice ? pRefDevice : Application::GetDefaultDevice() )->LogicToPixel( GetPrefSize(), GetPrefMapMode() );
+
+ return aRet;
+}
+
+// ------------------------------------------------------------------
+
ULONG Graphic::GetSizeBytes() const
{
return mpImpGraphic->ImplGetSizeBytes();
diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx
index e30131defdae..1d20876c2f6c 100644
--- a/vcl/source/gdi/image.cxx
+++ b/vcl/source/gdi/image.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: image.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: cd $ $Date: 2002-11-28 14:06:32 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1737,7 +1737,7 @@ void OutputDevice::DrawImage( const Point& rPos, const Image& rImage,
DBG_ASSERT( GetOutDevType() != OUTDEV_PRINTER,
"DrawImage(): Images can't be drawn on any mprinter" );
- if( !rImage.mpImplData )
+ if( !rImage.mpImplData || ImplIsRecordLayout() )
return;
switch( rImage.mpImplData->meType )
@@ -1784,7 +1784,7 @@ void OutputDevice::DrawImage( const Point& rPos, const Size& rSize,
DBG_ASSERT( GetOutDevType() != OUTDEV_PRINTER,
"DrawImage(): Images can't be drawn on any mprinter" );
- if( !rImage.mpImplData )
+ if( !rImage.mpImplData || ImplIsRecordLayout() )
return;
switch( rImage.mpImplData->meType )
diff --git a/vcl/source/gdi/implncvt.cxx b/vcl/source/gdi/implncvt.cxx
index 98a428d36380..8450b387188d 100644
--- a/vcl/source/gdi/implncvt.cxx
+++ b/vcl/source/gdi/implncvt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: implncvt.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:05:38 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -362,8 +362,8 @@ const Polygon* ImplLineConverter::ImplGetNext()
ImplFloatPoint aN2Vec( aPointB.GetNVec( aPointC ) );
aN2Vec *= mfWidthHalf;
- f2D = ( aN2Vec.fX == 0 ) ? 1 : ( aN2Vec.fY / aN2Vec.fX );
- if ( f1D == f2D )
+ f2D = ( fabs( aN2Vec.fX ) < 0.00000001 ) ? 1 : ( aN2Vec.fY / aN2Vec.fX );
+ if ( fabs( f1D - f2D ) < 0.00000001 )
nDirection = CURVE_STRAIGHTON;
else
{
@@ -413,7 +413,7 @@ const Polygon* ImplLineConverter::ImplGetNext()
int nValid = 0;
- if ( ( aN2Vec.fX ) == 0 )
+ if ( fabs( aN2Vec.fX ) < 0.00000001 )
{
fX = aDestPoint.fX;
nValid = 1;
@@ -421,7 +421,7 @@ const Polygon* ImplLineConverter::ImplGetNext()
else
fBDest = aDestPoint.fY - ( aN2Vec.fY / aN2Vec.fX * aDestPoint.fX );
- if ( ( aN1Vec.fX ) == 0 )
+ if ( fabs( aN1Vec.fX ) < 0.000000001 )
{
fX = aSourcePoint.fX;
nValid = 2;
diff --git a/vcl/source/gdi/impprn.cxx b/vcl/source/gdi/impprn.cxx
index fa3c038a8251..523e4bb8b167 100644
--- a/vcl/source/gdi/impprn.cxx
+++ b/vcl/source/gdi/impprn.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: impprn.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: ka $ $Date: 2001-07-04 11:28:52 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -265,7 +265,33 @@ void ImplQPrinter::ImplPrintMtf( GDIMetaFile& rMtf, long nMaxBmpDPIX, long nMaxB
}
else if( nType == META_TRANSPARENT_ACTION )
{
- DrawPolyPolygon( ( (MetaTransparentAction*) pAct )->GetPolyPolygon() );
+ MetaTransparentAction* pTransAct = static_cast<MetaTransparentAction*>(pAct);
+ USHORT nTransparency( pTransAct->GetTransparence() );
+
+ // #i10613# Respect transparency for draw color
+ if( nTransparency )
+ {
+ Push( PUSH_LINECOLOR|PUSH_FILLCOLOR );
+
+ // assume white background for alpha blending
+ Color aLineColor( GetLineColor() );
+ aLineColor.SetRed( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetRed()) / 100L ) );
+ aLineColor.SetGreen( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetGreen()) / 100L ) );
+ aLineColor.SetBlue( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aLineColor.GetBlue()) / 100L ) );
+ SetLineColor( aLineColor );
+
+ Color aFillColor( GetFillColor() );
+ aFillColor.SetRed( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetRed()) / 100L ) );
+ aFillColor.SetGreen( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetGreen()) / 100L ) );
+ aFillColor.SetBlue( static_cast<UINT8>( (255L*nTransparency + (100L - nTransparency)*aFillColor.GetBlue()) / 100L ) );
+ SetFillColor( aFillColor );
+ }
+
+ DrawPolyPolygon( pTransAct->GetPolyPolygon() );
+
+ if( nTransparency )
+ Pop();
+
bExecuted = sal_True;
}
else if( nType == META_FLOATTRANSPARENT_ACTION )
diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx
index 2a3e27ebf2c5..95f9e712038d 100644
--- a/vcl/source/gdi/impvect.cxx
+++ b/vcl/source/gdi/impvect.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: impvect.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:05:38 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -303,8 +303,7 @@ inline const Point& ImplPointArray::operator[]( ULONG nPos ) const
void ImplPointArray::ImplCreatePoly( Polygon& rPoly ) const
{
- rPoly.SetSize( (USHORT) mnRealSize );
- HMEMCPY( rPoly.ImplGetPointAry(), mpArray, mnRealSize * sizeof( Point ) );
+ rPoly = Polygon( mnRealSize, mpArray );
}
// ---------------
diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk
index f8824c041071..33b641076651 100644
--- a/vcl/source/gdi/makefile.mk
+++ b/vcl/source/gdi/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.13 $
+# $Revision: 1.14 $
#
-# last change: $Author: vg $ $Date: 2002-08-22 12:47:16 $
+# last change: $Author: hr $ $Date: 2003-03-27 17:57:58 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -109,7 +109,6 @@ SLOFILES= $(SLO)$/salmisc.obj \
$(SLO)$/impvect.obj \
$(SLO)$/implncvt.obj \
$(SLO)$/jobset.obj \
- $(SLO)$/line.obj \
$(SLO)$/lineinfo.obj \
$(SLO)$/mapmod.obj \
$(SLO)$/metaact.obj \
@@ -123,8 +122,6 @@ SLOFILES= $(SLO)$/salmisc.obj \
$(SLO)$/outdev5.obj \
$(SLO)$/outdev6.obj \
$(SLO)$/fontcvt.obj \
- $(SLO)$/poly.obj \
- $(SLO)$/poly2.obj \
$(SLO)$/print.obj \
$(SLO)$/print2.obj \
$(SLO)$/regband.obj \
@@ -135,7 +132,8 @@ SLOFILES= $(SLO)$/salmisc.obj \
$(SLO)$/fontcfg.obj \
$(SLO)$/base14.obj \
$(SLO)$/pdfwriter.obj \
- $(SLO)$/pdfwriter_impl.obj
+ $(SLO)$/pdfwriter_impl.obj\
+ $(SLO)$/bmpconv.obj
.IF "$(remote)"==""
SLOFILES += $(SLO)$/salgdilayout.obj
@@ -154,7 +152,6 @@ EXCEPTIONSFILES= $(SLO)$/bitmap.obj \
$(SLO)$/outdev.obj \
$(SLO)$/outdev3.obj \
$(SLO)$/outdev6.obj \
- $(SLO)$/poly.obj \
$(SLO)$/print.obj \
$(SLO)$/print2.obj \
$(SLO)$/virdev.obj
@@ -162,9 +159,9 @@ EXCEPTIONSFILES= $(SLO)$/bitmap.obj \
.ELSE
EXCEPTIONSFILES= $(SLO)$/outdev.obj \
$(SLO)$/gfxlink.obj \
- $(SLO)$/poly.obj \
$(SLO)$/print.obj \
- $(SLO)$/impgraph.obj
+ $(SLO)$/impgraph.obj \
+ $(SLO)$/bmpconv.obj
.ENDIF
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 994c4afde0ff..4530c5aa2195 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: metaact.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: sj $ $Date: 2002-10-25 12:30:49 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,6 +62,7 @@
#define _SV_METAACT_CXX
#define ENABLE_BYTESTRING_STREAM_OPERATORS
+#include <algorithm>
#include <string.h>
#ifndef _STREAM_HXX
@@ -1464,7 +1465,9 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
if( nAryLen )
{
- mpDXAry = new long[ nAryLen ];
+ // #i9762#, #106172# Ensure that DX array is at least mnLen entries long
+ const ULONG nIntAryLen( ::std::max(nAryLen, static_cast<ULONG>(mnLen)) );
+ mpDXAry = new long[ nIntAryLen ];
for( ULONG i = 0UL; i < nAryLen; i++ )
rIStm >> mpDXAry[ i ];
diff --git a/vcl/source/gdi/opengl.cxx b/vcl/source/gdi/opengl.cxx
index 930aeed7cd78..9d7e58fcaebe 100644
--- a/vcl/source/gdi/opengl.cxx
+++ b/vcl/source/gdi/opengl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: opengl.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: pl $ $Date: 2002-03-15 17:10:25 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -76,6 +76,10 @@
#ifndef _SV_OPENGL_HXX
#include <opengl.hxx>
#endif
+#ifndef _SV_SALGDI_HXX
+#include <salgdi.hxx>
+#endif
+
#include <svapp.hxx>
#include <vos/mutex.hxx>
@@ -616,6 +620,14 @@ void OpenGL::Viewport( GLint nX, GLint nY, GLsizei nWidth, GLsizei nHeight )
mpOGL->OGLEntry( PGRAPHICS );
+ // --- RTL --- mirror viewport coordinates
+ if( mpOutDev->ImplHasMirroredGraphics() )
+ {
+ long lx = nX + mpOutDev->mnOutOffX;
+ long lwidth = nWidth;
+ ((SalGraphicsLayout*)mpOutDev->mpGraphics)->mirror( lx, lwidth, mpOutDev );
+ nX = lx - mpOutDev->mnOutOffX;
+ }
pImplOpenGLFncViewport( nX + mpOutDev->mnOutOffX,
nOutHeight - nY - nHeight - mpOutDev->mnOutOffY,
nWidth, nHeight );
@@ -1505,6 +1517,15 @@ void OpenGL::Scissor( GLint nX, GLint nY, GLsizei nWidth, GLsizei nHeight )
nOutHeight = mpOutDev->mnOutHeight;
mpOGL->OGLEntry( PGRAPHICS );
+
+ // --- RTL --- mirror scissor coordinates
+ if( mpOutDev->ImplHasMirroredGraphics() )
+ {
+ long lx = nX + mpOutDev->mnOutOffX;
+ long lwidth = nWidth;
+ ((SalGraphicsLayout*)mpOutDev->mpGraphics)->mirror( lx, lwidth, mpOutDev );
+ nX = lx - mpOutDev->mnOutOffX;
+ }
pImplOpenGLFncScissor( nX + mpOutDev->mnOutOffX,
nOutHeight - nY - nHeight - mpOutDev->mnOutOffY,
nWidth, nHeight );
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index 1cff4ec9edfd..16a9493de6a0 100644
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: outdev.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: thb $ $Date: 2002-11-19 18:22:29 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -98,11 +98,8 @@
#ifndef _SV_SVAPP_HXX
#include <svapp.hxx>
#endif
-#ifndef _SV_POLY_H
-#include <poly.h>
-#endif
-#ifndef _SV_POLY_HXX
-#include <poly.hxx>
+#ifndef _POLY_HXX
+#include <tools/poly.hxx>
#endif
#ifndef _SV_REGION_HXX
#include <region.hxx>
@@ -339,8 +336,8 @@ void OutputDevice::ImplDrawPolyPolygon( USHORT nPoly, const PolyPolygon& rPolyPo
if ( nSize )
{
pPointAry[i] = nSize;
- pPointAryAry[i] = (PCONSTSALPOINT)rPoly.ImplGetConstPointAry();
- pFlagAryAry[i] = rPoly.ImplGetConstFlagAry();
+ pPointAryAry[i] = (PCONSTSALPOINT)rPoly.GetConstPointAry();
+ pFlagAryAry[i] = rPoly.GetConstFlagAry();
last = i;
if( pFlagAryAry[i] )
@@ -361,7 +358,7 @@ void OutputDevice::ImplDrawPolyPolygon( USHORT nPoly, const PolyPolygon& rPolyPo
if( !mpGraphics->DrawPolygonBezier( *pPointAry, *pPointAryAry, *pFlagAryAry, this ) )
{
Polygon aPoly = ImplSubdivideBezier( rPolyPoly.GetObject( last ) );
- mpGraphics->DrawPolygon( aPoly.GetSize(), (const SalPoint*)aPoly.ImplGetConstPointAry(), this );
+ mpGraphics->DrawPolygon( aPoly.GetSize(), (const SalPoint*)aPoly.GetConstPointAry(), this );
}
}
else
@@ -436,6 +433,7 @@ OutputDevice::OutputDevice() :
mnDrawMode = 0;
mnTextLayoutMode = 0;
meOutDevType = OUTDEV_DONTKNOW;
+ meOutDevViewType = OUTDEV_VIEWTYPE_DONTKNOW;
mbMap = FALSE;
mbMapIsDefault = TRUE;
mbClipRegion = FALSE;
@@ -526,6 +524,21 @@ OutputDevice::~OutputDevice()
// -----------------------------------------------------------------------
+void OutputDevice::EnableRTL( BOOL bEnable )
+{
+ mbEnableRTL = (bEnable != 0);
+ if( meOutDevType == OUTDEV_VIRDEV )
+ {
+ // virdevs default to not mirroring, they will only be set to mirroring
+ // under rare circumstances in the UI, eg the valueset control
+ // because each virdev has its own SalGraphics we can safely switch the SalGraphics here
+ // ...hopefully
+ if( Application::GetSettings().GetLayoutRTL() ) // allow mirroring only in BiDi Office
+ if( ImplGetGraphics() )
+ mpGraphics->SetLayout( mbEnableRTL ? SAL_LAYOUT_BIDI_RTL : 0 );
+ }
+}
+
BOOL OutputDevice::ImplHasMirroredGraphics()
{
#ifndef REMOTE_APPSERVER
@@ -818,17 +831,33 @@ void OutputDevice::ImplInitOutDevData()
{
mpOutDevData = new ImplOutDevData;
mpOutDevData->mpRotateDev = NULL;
+ mpOutDevData->mpRecordLayout = NULL;
+ mpOutDevData->mpFirstFontSubstEntry = NULL;
}
}
// -----------------------------------------------------------------------
+BOOL OutputDevice::ImplIsRecordLayout() const
+{
+ return mpOutDevData && mpOutDevData->mpRecordLayout;
+}
+
+// -----------------------------------------------------------------------
+
void OutputDevice::ImplDeInitOutDevData()
{
if ( mpOutDevData )
{
if ( mpOutDevData->mpRotateDev )
delete mpOutDevData->mpRotateDev;
+ ImplFontSubstEntry* pEntry = mpOutDevData->mpFirstFontSubstEntry;
+ while( pEntry )
+ {
+ ImplFontSubstEntry* pNext = pEntry->mpNext;
+ delete pEntry;
+ pEntry = pNext;
+ }
delete mpOutDevData;
}
}
@@ -1193,7 +1222,7 @@ void OutputDevice::SetLineColor( const Color& rColor )
}
else if( mnDrawMode & DRAWMODE_SETTINGSLINE )
{
- aColor = GetSettings().GetStyleSettings().GetWindowTextColor();
+ aColor = GetSettings().GetStyleSettings().GetFontColor();
}
if( mnDrawMode & DRAWMODE_GHOSTEDLINE )
@@ -1379,7 +1408,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt )
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaLineAction( rStartPt, rEndPt ) );
- if ( !IsDeviceOutputNecessary() || !mbLineColor )
+ if ( !IsDeviceOutputNecessary() || !mbLineColor || ImplIsRecordLayout() )
return;
#ifndef REMOTE_APPSERVER
@@ -1430,7 +1459,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt,
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaLineAction( rStartPt, rEndPt, rLineInfo ) );
- if ( !IsDeviceOutputNecessary() || !mbLineColor || ( LINE_NONE == rLineInfo.GetStyle() ) )
+ if ( !IsDeviceOutputNecessary() || !mbLineColor || ( LINE_NONE == rLineInfo.GetStyle() ) || ImplIsRecordLayout() )
return;
#ifndef REMOTE_APPSERVER
@@ -1465,7 +1494,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt,
ImplInitFillColor();
for( const Polygon* pPoly = aLineCvt.ImplGetFirst(); pPoly; pPoly = aLineCvt.ImplGetNext() )
- mpGraphics->DrawPolygon( pPoly->GetSize(), (const SalPoint*) pPoly->ImplGetConstPointAry(), this );
+ mpGraphics->DrawPolygon( pPoly->GetSize(), (const SalPoint*) pPoly->GetConstPointAry(), this );
SetFillColor( aOldFillColor );
SetLineColor( aOldLineColor );
@@ -1557,7 +1586,7 @@ void OutputDevice::DrawRect( const Rectangle& rRect )
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaRectAction( rRect ) );
- if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) )
+ if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || ImplIsRecordLayout() )
return;
Rectangle aRect( ImplLogicToDevicePixel( rRect ) );
@@ -1610,7 +1639,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly )
USHORT nPoints = rPoly.GetSize();
- if ( !IsDeviceOutputNecessary() || !mbLineColor || (nPoints < 2) )
+ if ( !IsDeviceOutputNecessary() || !mbLineColor || (nPoints < 2) || ImplIsRecordLayout() )
return;
#ifndef REMOTE_APPSERVER
@@ -1630,16 +1659,16 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly )
ImplInitLineColor();
Polygon aPoly = ImplLogicToDevicePixel( rPoly );
- const SalPoint* pPtAry = (const SalPoint*)aPoly.ImplGetConstPointAry();
+ const SalPoint* pPtAry = (const SalPoint*)aPoly.GetConstPointAry();
// #100127# Forward beziers to sal, if any
if( aPoly.HasFlags() )
{
- const BYTE* pFlgAry = aPoly.ImplGetConstFlagAry();
+ const BYTE* pFlgAry = aPoly.GetConstFlagAry();
if( !mpGraphics->DrawPolyLineBezier( nPoints, pPtAry, pFlgAry, this ) )
{
aPoly = ImplSubdivideBezier(aPoly);
- pPtAry = (const SalPoint*)aPoly.ImplGetConstPointAry();
+ pPtAry = (const SalPoint*)aPoly.GetConstPointAry();
mpGraphics->DrawPolyLine( aPoly.GetSize(), pPtAry, this );
}
}
@@ -1684,7 +1713,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo
USHORT nPoints = rPoly.GetSize();
- if ( !IsDeviceOutputNecessary() || !mbLineColor || ( nPoints < 2 ) || ( LINE_NONE == rLineInfo.GetStyle() ) )
+ if ( !IsDeviceOutputNecessary() || !mbLineColor || ( nPoints < 2 ) || ( LINE_NONE == rLineInfo.GetStyle() ) || ImplIsRecordLayout() )
return;
Polygon aPoly = ImplLogicToDevicePixel( rPoly );
@@ -1723,7 +1752,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo
ImplInitFillColor();
for( const Polygon* pPoly = aLineCvt.ImplGetFirst(); pPoly; pPoly = aLineCvt.ImplGetNext() )
- mpGraphics->DrawPolygon( pPoly->GetSize(), (const SalPoint*) pPoly->ImplGetConstPointAry(), this );
+ mpGraphics->DrawPolygon( pPoly->GetSize(), (const SalPoint*) pPoly->GetConstPointAry(), this );
SetLineColor( aOldLineColor );
SetFillColor( aOldFillColor );
@@ -1737,10 +1766,10 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo
{
ImplLineConverter aLineCvt( aPoly, aInfo, ( mbRefPoint ) ? &maRefPoint : NULL );
for( const Polygon* pPoly = aLineCvt.ImplGetFirst(); pPoly; pPoly = aLineCvt.ImplGetNext() )
- mpGraphics->DrawPolyLine( pPoly->GetSize(), (const SalPoint*)pPoly->ImplGetConstPointAry(), this );
+ mpGraphics->DrawPolyLine( pPoly->GetSize(), (const SalPoint*)pPoly->GetConstPointAry(), this );
}
else
- mpGraphics->DrawPolyLine( nPoints, (const SalPoint*) aPoly.ImplGetConstPointAry(), this );
+ mpGraphics->DrawPolyLine( nPoints, (const SalPoint*) aPoly.GetConstPointAry(), this );
}
#else
ImplServerGraphics* pGraphics = ImplGetServerGraphics();
@@ -1799,7 +1828,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly )
USHORT nPoints = rPoly.GetSize();
- if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || (nPoints < 2) )
+ if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || (nPoints < 2) || ImplIsRecordLayout() )
return;
#ifndef REMOTE_APPSERVER
@@ -1821,16 +1850,16 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly )
ImplInitFillColor();
Polygon aPoly = ImplLogicToDevicePixel( rPoly );
- const SalPoint* pPtAry = (const SalPoint*)aPoly.ImplGetConstPointAry();
+ const SalPoint* pPtAry = (const SalPoint*)aPoly.GetConstPointAry();
// #100127# Forward beziers to sal, if any
if( aPoly.HasFlags() )
{
- const BYTE* pFlgAry = aPoly.ImplGetConstFlagAry();
+ const BYTE* pFlgAry = aPoly.GetConstFlagAry();
if( !mpGraphics->DrawPolygonBezier( nPoints, pPtAry, pFlgAry, this ) )
{
aPoly = ImplSubdivideBezier(aPoly);
- pPtAry = (const SalPoint*)aPoly.ImplGetConstPointAry();
+ pPtAry = (const SalPoint*)aPoly.GetConstPointAry();
mpGraphics->DrawPolygon( aPoly.GetSize(), pPtAry, this );
}
}
@@ -1871,7 +1900,7 @@ void OutputDevice::DrawPolyPolygon( const PolyPolygon& rPolyPoly )
USHORT nPoly = rPolyPoly.Count();
- if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || !nPoly )
+ if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || !nPoly || ImplIsRecordLayout() )
return;
#ifndef REMOTE_APPSERVER
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index 27203e09ba5a..ae59b229ac51 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: outdev2.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: thb $ $Date: 2002-11-15 10:48:09 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -342,6 +342,9 @@ void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_ASSERT( meOutDevType != OUTDEV_PRINTER, "Don't use OutputDevice::DrawOutDev(...) with printer devices!" );
+ if( ImplIsRecordLayout() )
+ return;
+
if ( meOutDevType == OUTDEV_PRINTER )
return;
@@ -412,7 +415,7 @@ void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
DBG_ASSERT( meOutDevType != OUTDEV_PRINTER, "Don't use OutputDevice::DrawOutDev(...) with printer devices!" );
DBG_ASSERT( rOutDev.meOutDevType != OUTDEV_PRINTER, "Don't use OutputDevice::DrawOutDev(...) with printer devices!" );
- if ( (meOutDevType == OUTDEV_PRINTER) || (rOutDev.meOutDevType == OUTDEV_PRINTER) )
+ if ( (meOutDevType == OUTDEV_PRINTER) || (rOutDev.meOutDevType == OUTDEV_PRINTER) || ImplIsRecordLayout() )
return;
if ( ROP_INVERT == meRasterOp )
@@ -452,7 +455,7 @@ void OutputDevice::CopyArea( const Point& rDestPt,
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_ASSERT( meOutDevType != OUTDEV_PRINTER, "Don't use OutputDevice::CopyArea(...) with printer devices!" );
- if ( meOutDevType == OUTDEV_PRINTER )
+ if ( meOutDevType == OUTDEV_PRINTER || ImplIsRecordLayout() )
return;
RasterOp eOldRop = GetRasterOp();
@@ -596,6 +599,10 @@ void OutputDevice::ImplGetFrameDev( const Point& rPt, const Point& rDevPt, const
void OutputDevice::DrawBitmap( const Point& rDestPt, const Bitmap& rBitmap )
{
DBG_TRACE( "OutputDevice::DrawBitmap()" );
+
+ if( ImplIsRecordLayout() )
+ return;
+
const Size aSizePix( rBitmap.GetSizePixel() );
ImplDrawBitmap( rDestPt, PixelToLogic( aSizePix ), Point(), aSizePix, rBitmap, META_BMP_ACTION );
}
@@ -605,6 +612,10 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Bitmap& rBitmap )
void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize, const Bitmap& rBitmap )
{
DBG_TRACE( "OutputDevice::DrawBitmap( Size )" );
+
+ if( ImplIsRecordLayout() )
+ return;
+
ImplDrawBitmap( rDestPt, rDestSize, Point(), rBitmap.GetSizePixel(), rBitmap, META_BMPSCALE_ACTION );
}
@@ -615,6 +626,10 @@ void OutputDevice::DrawBitmap( const Point& rDestPt, const Size& rDestSize,
const Bitmap& rBitmap )
{
DBG_TRACE( "OutputDevice::DrawBitmap( Point, Size )" );
+
+ if( ImplIsRecordLayout() )
+ return;
+
ImplDrawBitmap( rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, rBitmap, META_BMPSCALEPART_ACTION );
}
@@ -726,6 +741,9 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt,
{
DBG_TRACE( "OutputDevice::DrawBitmapEx()" );
+ if( ImplIsRecordLayout() )
+ return;
+
if( TRANSPARENT_NONE == rBitmapEx.GetTransparentType() )
DrawBitmap( rDestPt, rBitmapEx.GetBitmap() );
else
@@ -742,6 +760,9 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
{
DBG_TRACE( "OutputDevice::DrawBitmapEx( Size )" );
+ if( ImplIsRecordLayout() )
+ return;
+
if ( TRANSPARENT_NONE == rBitmapEx.GetTransparentType() )
DrawBitmap( rDestPt, rDestSize, rBitmapEx.GetBitmap() );
else
@@ -756,6 +777,9 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
{
DBG_TRACE( "OutputDevice::DrawBitmapEx( Point, Size )" );
+ if( ImplIsRecordLayout() )
+ return;
+
if( TRANSPARENT_NONE == rBitmapEx.GetTransparentType() )
DrawBitmap( rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, rBitmapEx.GetBitmap() );
else
@@ -897,6 +921,10 @@ void OutputDevice::DrawMask( const Point& rDestPt,
const Bitmap& rBitmap, const Color& rMaskColor )
{
DBG_TRACE( "OutputDevice::DrawMask()" );
+
+ if( ImplIsRecordLayout() )
+ return;
+
const Size aSizePix( rBitmap.GetSizePixel() );
ImplDrawMask( rDestPt, PixelToLogic( aSizePix ), Point(), aSizePix, rBitmap, rMaskColor, META_MASK_ACTION );
}
@@ -907,6 +935,10 @@ void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize,
const Bitmap& rBitmap, const Color& rMaskColor )
{
DBG_TRACE( "OutputDevice::DrawMask( Size )" );
+
+ if( ImplIsRecordLayout() )
+ return;
+
ImplDrawMask( rDestPt, rDestSize, Point(), rBitmap.GetSizePixel(), rBitmap, rMaskColor, META_MASKSCALE_ACTION );
}
@@ -917,6 +949,10 @@ void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize,
const Bitmap& rBitmap, const Color& rMaskColor )
{
DBG_TRACE( "OutputDevice::DrawMask( Point, Size )" );
+
+ if( ImplIsRecordLayout() )
+ return;
+
ImplDrawMask( rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, rBitmap, rMaskColor, META_MASKSCALEPART_ACTION );
}
@@ -1239,7 +1275,7 @@ void OutputDevice::DrawPixel( const Point& rPt )
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaPointAction( rPt ) );
- if ( !IsDeviceOutputNecessary() || !mbLineColor )
+ if ( !IsDeviceOutputNecessary() || !mbLineColor || ImplIsRecordLayout() )
return;
#ifndef REMOTE_APPSERVER
@@ -1302,7 +1338,7 @@ void OutputDevice::DrawPixel( const Point& rPt, const Color& rColor )
}
else if( mnDrawMode & DRAWMODE_SETTINGSLINE )
{
- aColor = GetSettings().GetStyleSettings().GetWindowTextColor();
+ aColor = GetSettings().GetStyleSettings().GetFontColor();
}
if( mnDrawMode & DRAWMODE_GHOSTEDLINE )
@@ -1317,7 +1353,7 @@ void OutputDevice::DrawPixel( const Point& rPt, const Color& rColor )
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaPixelAction( rPt, aColor ) );
- if ( !IsDeviceOutputNecessary() || ImplIsColorTransparent( aColor ) )
+ if ( !IsDeviceOutputNecessary() || ImplIsColorTransparent( aColor ) || ImplIsRecordLayout() )
return;
#ifndef REMOTE_APPSERVER
@@ -1363,7 +1399,7 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color* pColors )
for ( USHORT i = 0; i < nSize; i++ )
mpMetaFile->AddAction( new MetaPixelAction( rPts[ i ], pColors[ i ] ) );
- if ( !IsDeviceOutputNecessary() )
+ if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return;
#ifndef REMOTE_APPSERVER
@@ -1397,7 +1433,7 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color* pColors )
void OutputDevice::DrawPixel( const Polygon& rPts, const Color& rColor )
{
- if( rColor != COL_TRANSPARENT )
+ if( rColor != COL_TRANSPARENT && ! ImplIsRecordLayout() )
{
const USHORT nSize = rPts.GetSize();
Color* pColArray = new Color[ nSize ];
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 9afbe256fefe..991a03c269c4 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: outdev3.cxx,v $
*
- * $Revision: 1.142 $
+ * $Revision: 1.143 $
*
- * last change: $Author: hdu $ $Date: 2002-12-12 18:07:00 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:57:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -157,6 +157,9 @@
#ifndef _VCL_PDFWRITER_IMPL_HXX
#include <pdfwriter_impl.hxx>
#endif
+#ifndef _VCL_CONTROLLAYOUT_HXX
+#include <controllayout.hxx>
+#endif
#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUES_HDL_
#include <com/sun/star/beans/PropertyValues.hdl>
@@ -311,7 +314,21 @@ void OutputDevice::ImplUpdateFontData( BOOL bNewFontLists )
mpFontCache = new ImplFontCache( FALSE );
}
else
+ {
+ if( mpOutDevData )
+ {
+ ImplFontSubstEntry* pEntry = mpOutDevData->mpFirstFontSubstEntry;
+ while( pEntry )
+ {
+ ImplFontSubstEntry* pNext = pEntry->mpNext;
+ delete pEntry;
+ pEntry = pNext;
+ }
+ mpOutDevData->mpFirstFontSubstEntry = NULL;
+ }
mpGraphics->GetDevFontList( mpFontList );
+ mpGraphics->GetDevFontSubstList( this );
+ }
}
}
}
@@ -431,6 +448,47 @@ static sal_Unicode const aMSPMincho[] = { 'm', 's', 'p', 0x660E, 0x671D, 0, 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, 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 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 aFzHeiTi[] = { 0x65B9, 0x6B63, 0x9ED1, 0x9AD4, 0, 0 };
+static sal_Unicode const aFzMingTi[] = { 0x65B9, 0x6B63, 0x660E, 0x9AD4, 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 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 aHYShortSamulMedium[] = { 'h', 'y', 0xC595, 0xC740, 0xC0D8, 0xBB3C, 'm', 0, 0 };
+static sal_Unicode const aHYShortSamul[] = { 'h', 'y', 0xC595, 0xC740, 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 HYShortSamulMedium[] = { 'h', 'y', 0xC595, 0xC740, 0xC0D8, 0xBB3C, 'm', 0, 0 };
+static sal_Unicode const HYShortSamul[] = { 'h', 'y', 0xC595, 0xC740, 0xC0D8, 0xBB3C, 0, 0 };
+
static ImplLocaliziedFontName const aImplLocaliziedNamesList[] =
{
@@ -470,6 +528,45 @@ static ImplLocaliziedFontName const aImplLocaliziedNamesList[] =
{ "hgminchol", aHGMinchoL },
{ "hggothicb", aHGGothicB },
{ "hgheiseimin", aHGHeiseiMin },
+{ "sundotum", aSunDotum },
+{ "sungulim", aSunGulim },
+{ "sunbatang", aSunBatang },
+{ "fzheiti", aFzHeiTi },
+{ "fzmingti", 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 },
+{ "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 },
+{ "hyshortsamulmedium", HYShortSamulMedium },
+{ "hyshortsamul", HYShortSamul },
{ NULL, NULL },
};
@@ -595,11 +692,11 @@ String GetFontToken( const String& rStr, xub_StrLen nToken, xub_StrLen& rIndex )
xub_StrLen nFirstChar = rIndex;
xub_StrLen i = nFirstChar;
- // Bestimme die Token-Position und Laenge
+ // get the token position and it's length
pStr += i;
while ( i < nLen )
{
- // Stimmt das Tokenzeichen ueberein, dann erhoehe TokCount
+ // increase TokCount when the token matches
if ( (*pStr == ';') || (*pStr == ',') )
{
nTok++;
@@ -649,55 +746,6 @@ static int ImplStrMatchCompare( const String& rStr1, const char* pStr2 )
return *pStr1-((xub_Unicode)(unsigned char)*pStr2);
}
-// -----------------------------------------------------------------------
-#if 0
-static const ImplFontNameAttr* ImplGetFontNameAttr( const String& rName )
-{
-#if 0
-#ifdef DEBUG
- static bool bOnce = false;
- if( ! bOnce )
- {
- bOnce = true;
- writeFontNameList();
- }
-#endif
-#endif
- int nCount = sizeof( aImplFontNameList ) / sizeof( ImplFontNameAttr );
- for( int nLower = 0, nUpper = nCount-1; nLower <= nUpper; )
- {
- long nMid = (nUpper + nLower) >> 1;
- int nComp = ImplStrMatchCompare( rName, aImplFontNameList[nMid].mpName );
- if ( !nComp )
- {
- // Find shortest match
- while ( nMid &&
- (ImplStrMatchCompare( rName, aImplFontNameList[nMid-1].mpName ) == 0) )
- nMid--;
- return &(aImplFontNameList[nMid]);
- }
- else if ( nComp < 0 )
- nUpper = nMid-1;
- else /* ( nComp > 0 ) */
- nLower = nMid+1;
- }
-
- return NULL;
-}
-#endif
-
-// =======================================================================
-
-struct ImplFontSubstEntry
-{
- String maName;
- String maReplaceName;
- String maSearchName;
- String maSearchReplaceName;
- USHORT mnFlags;
- ImplFontSubstEntry* mpNext;
-};
-
// =======================================================================
void ImplFreeOutDevFontData()
@@ -761,14 +809,36 @@ void OutputDevice::AddFontSubstitute( const XubString& rFontName,
// -----------------------------------------------------------------------
+void OutputDevice::ImplAddDevFontSubstitute( const XubString& rFontName,
+ const XubString& rReplaceFontName,
+ USHORT nFlags )
+{
+ ImplInitOutDevData();
+
+ ImplFontSubstEntry* pEntry = new ImplFontSubstEntry;
+
+ pEntry->maName = rFontName;
+ pEntry->maReplaceName = rReplaceFontName;
+ pEntry->maSearchName = rFontName;
+ pEntry->maSearchReplaceName = rReplaceFontName;
+ pEntry->mnFlags = nFlags;
+ pEntry->mpNext = mpOutDevData->mpFirstFontSubstEntry;
+ ImplGetEnglishSearchFontName( pEntry->maSearchName );
+ ImplGetEnglishSearchFontName( pEntry->maSearchReplaceName );
+
+ mpOutDevData->mpFirstFontSubstEntry = pEntry;
+}
+
+// -----------------------------------------------------------------------
+
void OutputDevice::RemoveFontSubstitute( USHORT n )
{
ImplSVData* pSVData = ImplGetSVData();
ImplFontSubstEntry* pEntry = pSVData->maGDIData.mpFirstFontSubst;
ImplFontSubstEntry* pPrev = NULL;
USHORT nCount = 0;
- while ( pEntry )
+ while ( pEntry )
{
if ( nCount == n )
{
@@ -831,7 +901,7 @@ void OutputDevice::GetFontSubstitute( USHORT n,
// -----------------------------------------------------------------------
static BOOL ImplFontSubstitute( XubString& rFontName,
- USHORT nFlags1, USHORT nFlags2 )
+ USHORT nFlags1, USHORT nFlags2, ImplFontSubstEntry* pDevSpecific )
{
#ifdef DBG_UTIL
String aTempName = rFontName;
@@ -839,6 +909,7 @@ static BOOL ImplFontSubstitute( XubString& rFontName,
DBG_ASSERT( aTempName == rFontName, "ImplFontSubstitute() called without a searchname" );
#endif
+ // apply font replacement (eg, from the list in Tools->Options)
ImplSVData* pSVData = ImplGetSVData();
ImplFontSubstEntry* pEntry = pSVData->maGDIData.mpFirstFontSubst;
while ( pEntry )
@@ -852,6 +923,20 @@ static BOOL ImplFontSubstitute( XubString& rFontName,
pEntry = pEntry->mpNext;
}
+ if( pDevSpecific )
+ {
+ pEntry = pDevSpecific;
+ while ( pEntry )
+ {
+ if ( ((pEntry->mnFlags & nFlags1) == nFlags2) &&
+ (pEntry->maSearchName == rFontName) )
+ {
+ rFontName = pEntry->maSearchReplaceName;
+ return TRUE;
+ }
+ pEntry = pEntry->mpNext;
+ }
+ }
return FALSE;
}
@@ -947,8 +1032,13 @@ Font OutputDevice::GetDefaultFont( USHORT nType, LanguageType eLang,
#define FALLBACKFONT_UI_SANS "Andale Sans UI;Tahoma;Arial Unicode MS;Interface User;Geneva;WarpSans;Dialog;Swiss;Lucida;Helvetica;Charcoal;Chicago;Arial;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;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;Gulim;Roundgothic;Arial Unicode MS;Lucida Sans Unicode;Tahoma;Andale Sans UI"
+
+ if( eLang == LANGUAGE_NONE || eLang == LANGUAGE_SYSTEM || eLang == LANGUAGE_DONTKNOW )
+ {
+ eLang = Application::GetSettings().GetUILanguage();
+ }
- Font aFont;
String aSearch( RTL_CONSTASCII_USTRINGPARAM( FALLBACKFONT_UI_SANS ) );
// optimize font list for some locales, as long as Andale Sans UI does not support them
@@ -977,16 +1067,27 @@ Font OutputDevice::GetDefaultFont( USHORT nType, LanguageType eLang,
case LANGUAGE_THAI:
aSearch = String( RTL_CONSTASCII_USTRINGPARAM( FALLBACKFONT_UI_SANS_THAI ) );
break;
+ case LANGUAGE_KOREAN:
+ case LANGUAGE_KOREAN_JOHAB:
+ {
+ // we need localized names for korean fonts
+ static sal_Unicode const aSunGulim[] = { 0xC36C, 0xAD74, 0xB9BC, 0, 0 };
+ aSearch = String( aSunGulim );
+ aSearch += String( RTL_CONSTASCII_USTRINGPARAM( ";" ) );
+ aSearch += String( RTL_CONSTASCII_USTRINGPARAM( FALLBACKFONT_UI_SANS_KOREAN ) );
+ break;
+ }
default:
break;
}
DefaultFontConfigItem* pDefaults = DefaultFontConfigItem::get();
-
String aDefault = pDefaults->getDefaultFont( eLang, nType );
if( aDefault.Len() )
aSearch = aDefault;
+
+ Font aFont;
switch ( nType )
{
case DEFAULTFONT_SANS_UNICODE:
@@ -1095,10 +1196,9 @@ Font OutputDevice::GetDefaultFont( USHORT nType, LanguageType eLang,
if( (0 == aSize.Width()) && (0 != aFont.GetSize().Width()) )
aSize.Width() = 1;
- ImplFontEntry* pEntry = pOutDev->mpFontCache->Get( pOutDev->mpFontList, aFont, aSize );
- aFont.SetName( pEntry->maFontSelData.maName );
+ ImplFontEntry* pEntry = pOutDev->mpFontCache->Get( pOutDev->mpFontList, aFont, aSize, pOutDev->mpOutDevData ? pOutDev->mpOutDevData->mpFirstFontSubstEntry : NULL );
+ aFont.SetName( pEntry->maFontSelData.maFoundName ); // returns a single name
}
-
}
else
aFont.SetName( aSearch );
@@ -1162,21 +1262,37 @@ String GetSubsFontName( const String& rName, ULONG nFlags )
// =======================================================================
-static BOOL ImplIsCJKFont( const String& rFontName )
+static unsigned ImplIsCJKFont( const String& rFontName )
{
// Test, if Fontname includes CJK characters --> In this case we
// mention that it is a CJK font
const sal_Unicode* pStr = rFontName.GetBuffer();
while ( *pStr )
{
+ // japanese
+ if ( ((*pStr >= 0x3040) && (*pStr <= 0x30FF)) ||
+ ((*pStr >= 0x3190) && (*pStr <= 0x319F)) )
+ return IMPL_FONT_ATTR_CJK|IMPL_FONT_ATTR_CJK_JP;
+
+ // korean
+ if ( ((*pStr >= 0xAC00) && (*pStr <= 0xD7AF)) ||
+ ((*pStr >= 0x3130) && (*pStr <= 0x318F)) ||
+ ((*pStr >= 0x1100) && (*pStr <= 0x11FF)) )
+ return IMPL_FONT_ATTR_CJK|IMPL_FONT_ATTR_CJK_KR;
+
+ // chinese
+ if ( ((*pStr >= 0x3400) && (*pStr <= 0x9FFF)) )
+ return IMPL_FONT_ATTR_CJK|IMPL_FONT_ATTR_CJK_TC|IMPL_FONT_ATTR_CJK_SC;
+
+ // cjk
if ( ((*pStr >= 0x3000) && (*pStr <= 0xD7AF)) ||
((*pStr >= 0xFF00) && (*pStr <= 0xFFEE)) )
- return TRUE;
+ return IMPL_FONT_ATTR_CJK;
pStr++;
}
- return FALSE;
+ return 0;
}
// -----------------------------------------------------------------------
@@ -1218,6 +1334,8 @@ ImplDevFontList::ImplDevFontList() :
{
mbMatchData = FALSE;
mbMapNames = FALSE;
+ mpFallbackList = NULL;
+ mnFallbackCount = -1;
}
// -----------------------------------------------------------------------
@@ -1250,6 +1368,14 @@ void ImplDevFontList::ImplClear()
delete pEntry;
}
+
+ // remove fallback lists
+ delete[] mpFallbackList;
+ mpFallbackList = NULL;
+ mnFallbackCount = -1;
+
+ // match data must be recalculated too
+ mbMatchData = FALSE;
}
// -----------------------------------------------------------------------
@@ -1262,6 +1388,30 @@ void ImplDevFontList::Clear()
// -----------------------------------------------------------------------
+bool ImplDevFontList::HasFallbacks() const
+{
+ return (mnFallbackCount >= 0);
+}
+
+// -----------------------------------------------------------------------
+
+void ImplDevFontList::SetFallbacks( ImplDevFontListData** pList, int nCount )
+{
+ mnFallbackCount = nCount;
+ mpFallbackList = pList;
+}
+
+// -----------------------------------------------------------------------
+
+ImplDevFontListData* ImplDevFontList::GetFallback( int nIndex ) const
+{
+ if( nIndex < mnFallbackCount )
+ return mpFallbackList[ nIndex ];
+ return NULL;
+}
+
+// -----------------------------------------------------------------------
+
static StringCompare ImplCompareFontDataWithoutSize( const ImplFontData* pEntry1,
const ImplFontData* pEntry2 )
{
@@ -1318,7 +1468,7 @@ void ImplDevFontList::Add( ImplFontData* pNewData )
XubString aSearchName = pNewData->maName;
ImplGetEnglishSearchFontName( aSearchName );
- // Add Font
+ // add font
ULONG nIndex;
ImplDevFontListData* pFoundData = ImplFind( aSearchName, &nIndex );
BOOL bInsert = TRUE;
@@ -1369,6 +1519,12 @@ void ImplDevFontList::Add( ImplFontData* pNewData )
(pNewData->meItalic == ITALIC_OBLIQUE) )
pFoundData->mnTypeFaces |= IMPL_DEVFONT_ITALIC;
+ // TODO: is it cheaper to calc match data now or later?
+ if( (pFoundData->meMatchWeight == WEIGHT_DONTKNOW)
+ || (pFoundData->meMatchWidth == WIDTH_DONTKNOW)
+ || (pFoundData->mnMatchType == 0) )
+ mbMatchData = FALSE;
+
// add map/alias names
if ( pNewData->maMapNames.Len() )
{
@@ -1551,8 +1707,7 @@ void ImplDevFontList::InitMatchData()
pTempFontAttr = pFontSubst->getSubstInfo( aTempShortName );
ImplCalcType( pEntry->mnMatchType, pEntry->meMatchWeight, pEntry->meMatchWidth,
pEntry->meFamily, pTempFontAttr );
- if ( ImplIsCJKFont( pEntry->maName ) )
- pEntry->mnMatchType |= IMPL_FONT_ATTR_CJK;
+ pEntry->mnMatchType |= ImplIsCJKFont( pEntry->maName );
pEntry = Next();
}
@@ -1587,8 +1742,7 @@ void ImplGetDevSizeList::Add( long nNewHeight )
ImplFontEntry::~ImplFontEntry()
{
- if ( mpKernPairs )
- delete mpKernPairs;
+ delete[] mpKernPairs;
}
// =======================================================================
@@ -1604,17 +1758,18 @@ ImplFontCache::ImplFontCache( BOOL bPrinter )
ImplFontCache::~ImplFontCache()
{
- for( ImplFontEntry* pEntry = mpFirstEntry, *pNext; pEntry; pEntry = pNext )
+ for( ImplFontEntry* pEntry = mpFirstEntry; pEntry; )
{
- pNext = pEntry->mpNext;
+ ImplFontEntry* pNext = pEntry->mpNext;
delete pEntry;
+ pEntry = pNext;
}
}
// -----------------------------------------------------------------------
ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
- const Font& rFont, const Size& rSize )
+ const Font& rFont, const Size& rSize, ImplFontSubstEntry* pDevSpecific )
{
String aName = rFont.GetName();
const XubString& rStyleName = rFont.GetStyleName();
@@ -1653,7 +1808,7 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
&& (nHeight == pFontSelData->mnHeight) &&
(eWeight == pFontSelData->meWeight) &&
(eItalic == pFontSelData->meItalic) &&
- (aName == pFontSelData->maName) &&
+ ((aName == pFontSelData->maName) || (aName == pFontSelData->maFoundName)) &&
(rStyleName == pFontSelData->maStyleName) &&
(eFamily == pFontSelData->meFamily) &&
(ePitch == pFontSelData->mePitch) &&
@@ -1666,7 +1821,7 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
if ( !pEntry->mnRefCount++ )
mnRef0Count--;
- // Entry nach vorne bringen
+ // entry becomes head of list
if ( pPrevEntry )
{
pPrevEntry->mpNext = pEntry->mpNext;
@@ -1702,7 +1857,7 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
String aToken = GetFontToken( aName, 0, nIndex );
aSearchName = aToken;
ImplGetEnglishSearchFontName( aSearchName );
- ImplFontSubstitute( aSearchName, nSubstFlags1, nSubstFlags2 );
+ ImplFontSubstitute( aSearchName, nSubstFlags1, nSubstFlags2, pDevSpecific );
pFoundData = pFontList->ImplFind( aSearchName );
if( pFoundData )
{
@@ -1730,7 +1885,7 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
}
else
nIndex = STRING_NOTFOUND;
- ImplFontSubstitute( aSearchName, nSubstFlags1, nSubstFlags2 );
+ ImplFontSubstitute( aSearchName, nSubstFlags1, nSubstFlags2, pDevSpecific );
pFoundData = pFontList->ImplFind( aSearchName );
if( pFoundData )
break;
@@ -1762,14 +1917,16 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
FontSubstConfigItem::getMapName( aSearchName, aSearchShortName, aSearchFamilyName,
eSearchWeight, eSearchWidth, nSearchType );
+ // note: the search name was already translated to english (if possible)
+
// Search, if ShortName is available
if ( aSearchShortName != aSearchName )
{
+#ifdef UNX
/* #96738# don't use mincho as an replacement for "MS Mincho" on X11: Mincho is
a korean bitmap font that is not suitable here. Use the font replacement table,
that automatically leads to the desired "HG Mincho Light J". Same story for
MS Gothic, there are thai and korean "Gothic" fonts, so we even prefer Andale */
-#ifdef UNX
static String aMS_Mincho = String(RTL_CONSTASCII_USTRINGPARAM("msmincho"));
static String aMS_Gothic = String(RTL_CONSTASCII_USTRINGPARAM("msgothic"));
if ((aSearchName != aMS_Mincho) && (aSearchName != aMS_Gothic))
@@ -1778,16 +1935,24 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
}
if ( !pFoundData && aSearchName.Len() )
{
+ // look for substitution tables for the name, shortname and family name in that order
pFontAttr = pFontSubst->getSubstInfo( aSearchName );
if ( !pFontAttr && (aSearchShortName != aSearchName) )
pFontAttr = pFontSubst->getSubstInfo( aSearchShortName );
+ if ( !pFontAttr && (aSearchFamilyName != aSearchShortName) )
+ pFontAttr = pFontSubst->getSubstInfo( aSearchFamilyName );
// Try Substitution
if ( pFontAttr )
{
for( ::std::vector< String >::const_iterator it = pFontAttr->Substitutions.begin();
! pFoundData && it != pFontAttr->Substitutions.end(); ++it )
- pFoundData = pFontList->ImplFind( *it );
+ {
+ String aFontname( *it );
+ // list may contain localized names -> translate
+ ImplGetEnglishSearchFontName( aFontname );
+ pFoundData = pFontList->ImplFind( aFontname );
+ }
}
}
@@ -1820,16 +1985,24 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
if ( !pFoundData && aTempName.Len() )
{
+ // look for substitution tables for the name, shortname and family name in that order
pTempFontAttr = pFontSubst->getSubstInfo( aTempName );
if ( !pTempFontAttr && (aTempShortName != aTempName) )
pTempFontAttr = pFontSubst->getSubstInfo( aTempShortName );
+ if ( !pTempFontAttr && (aTempFamilyName != aTempShortName) )
+ pTempFontAttr = pFontSubst->getSubstInfo( aTempFamilyName );
// Try Substitution
if ( pTempFontAttr )
{
for( ::std::vector< String >::const_iterator it = pTempFontAttr->Substitutions.begin();
! pFoundData && it != pTempFontAttr->Substitutions.end(); ++it )
- pFoundData = pFontList->ImplFind( *it );
+ {
+ String aFontname( *it );
+ // list may contain localized names -> translate
+ ImplGetEnglishSearchFontName( aFontname );
+ pFoundData = pFontList->ImplFind( aFontname );
+ }
}
}
}
@@ -1889,10 +2062,7 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
else if ( eLang == LANGUAGE_JAPANESE )
nSearchType |= IMPL_FONT_ATTR_CJK | IMPL_FONT_ATTR_CJK_JP;
else
- {
- if ( ImplIsCJKFont( aName ) )
- nSearchType |= IMPL_FONT_ATTR_CJK;
- }
+ nSearchType |= ImplIsCJKFont( aName );
if ( bSymbolEncoding )
nSearchType |= IMPL_FONT_ATTR_SYMBOL;
@@ -2159,8 +2329,7 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
!(pData->mnTypeFaces & IMPL_DEVFONT_NORMAL) )
nTestMatch -= 1000000;
- // skalierbare Schriften haben schon einen echten Vorteil
- // gegenueber nicht skalierbaren Schriften
+ // prefer scalable fonts
if ( pData->mnTypeFaces & IMPL_DEVFONT_SCALABLE )
nTestMatch += 10000*4;
else
@@ -2168,7 +2337,6 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
if ( nMatchType & IMPL_FONT_ATTR_STANDARD )
nTestMatch += 10000*2;
if ( nMatchType & IMPL_FONT_ATTR_DEFAULT )
-
nTestMatch += 10000;
if ( nMatchType & IMPL_FONT_ATTR_FULL )
nTestMatch += 10000;
@@ -2211,7 +2379,7 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
}
else if ( nTestMatch == nBestMatch )
{
- // We have some fonts, where we think that they are more useful
+ // some fonts are more suitable defaults
if ( nMatchType & IMPL_FONT_ATTR_DEFAULT )
{
pFoundData = pData;
@@ -2468,22 +2636,23 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
mpFirstEntry = pEntry;
// initialize font selection data
- ImplFontSelectData* pFontSelData = &(pEntry->maFontSelData);
- pFontSelData->mpFontData = pFontData;
- pFontSelData->maName = aName;
- pFontSelData->maStyleName = rStyleName;
- pFontSelData->mnWidth = nWidth;
- pFontSelData->mnHeight = nHeight;
- pFontSelData->meFamily = eFamily;
- pFontSelData->meCharSet = eCharSet;
- pFontSelData->meLanguage = eLanguage;
- pFontSelData->meWidthType = WIDTH_DONTKNOW;
- pFontSelData->meWeight = eWeight;
- pFontSelData->meItalic = eItalic;
- pFontSelData->mePitch = ePitch;
- pFontSelData->mnOrientation = nOrientation;
- pFontSelData->mbVertical = bVertical;
- pFontSelData->mbNonAntialiased = FALSE;
+ ImplFontSelectData& rFontSelData = pEntry->maFontSelData;
+ rFontSelData.mpFontData = pFontData;
+ rFontSelData.maName = rFont.GetName();
+ rFontSelData.maFoundName = aName;
+ rFontSelData.maStyleName = rStyleName;
+ rFontSelData.mnWidth = nWidth;
+ rFontSelData.mnHeight = nHeight;
+ rFontSelData.meFamily = eFamily;
+ rFontSelData.meCharSet = eCharSet;
+ rFontSelData.meLanguage = eLanguage;
+ rFontSelData.meWidthType = WIDTH_DONTKNOW;
+ rFontSelData.meWeight = eWeight;
+ rFontSelData.meItalic = eItalic;
+ rFontSelData.mePitch = ePitch;
+ rFontSelData.mnOrientation = nOrientation;
+ rFontSelData.mbVertical = bVertical;
+ rFontSelData.mbNonAntialiased = FALSE;
return pEntry;
}
@@ -2491,12 +2660,62 @@ ImplFontEntry* ImplFontCache::Get( ImplDevFontList* pFontList,
// -----------------------------------------------------------------------
ImplFontEntry* ImplFontCache::GetFallback( ImplDevFontList* pFontList,
- const Font& rOrigFont, const Size& rSize, sal_Unicode cMissingChar )
+ const Font& rOrigFont, const Size& rSize, int nLevel, ImplFontSubstEntry* pDevSpecific )
{
+ // make sure the fontlist knows it's fallbacks
+ if( !pFontList->HasFallbacks() )
+ {
+ // TODO: implement dynamic lists or improve static lists
+ #define FALLBACKFONT_NAMELIST \
+ "Arial Unicode MS;Andale Sans UI;Cyberbit;StarSymbol;Lucida TypeWriter;" \
+ "FZMingTi;SunBatang;" \
+ "HGMinchoLightJ;MSungLightSC;MSungLightTC;HYMyeongJoLight K;" \
+ "Lucida Sans;Tahoma;" \
+ "Shree;Mangal;Raavi;Shruti;Tunga;Latha;" \
+ "Shayyal MT;Nask MT;David;" \
+ "Norasi;AngsanaUPC;" \
+ "Gulim;Batang;Dotum;MS Mincho"
+ String aNameList( RTL_CONSTASCII_USTRINGPARAM(FALLBACKFONT_NAMELIST) );
+ int nMaxLevel = 0;
+ ImplDevFontListData** pFallbackList = NULL;
+ for( xub_StrLen nTokenPos = 0; nTokenPos != STRING_NOTFOUND; )
+ {
+ String aTokenName = GetFontToken( aNameList, 0, nTokenPos );
+ ImplGetEnglishSearchFontName( aTokenName );
+ //ImplFontSubstitute( aSearchName, nSubstFlags1, nSubstFlags2 );
+ ImplDevFontListData* pFoundData = pFontList->ImplFind( aTokenName );
+ // TODO: check FontCharset and reject if it is already covered
+ if( pFoundData && (pFoundData->mpFirst->meType == TYPE_SCALABLE) )
+ {
+ if( !pFallbackList )
+ pFallbackList = new ImplDevFontListData*[ MAX_FALLBACK ];
+ pFallbackList[ nMaxLevel ] = pFoundData;
+ if( ++nMaxLevel >= MAX_FALLBACK )
+ break;
+ }
+ }
+
+ pFontList->SetFallbacks( pFallbackList, nMaxLevel );
+ }
+
+ // nLevel>=1 for fallback => remove +1 offset
+ ImplDevFontListData* pFallbackData = pFontList->GetFallback( nLevel-1 );
+ if( !pFallbackData )
+ return NULL;
+
+ // TODO: use pFallbackData directly
Font aFallbackFont = rOrigFont;
- // TODO: use cMissingChar for fallback font name
- aFallbackFont.SetName( String( RTL_CONSTASCII_USTRINGPARAM( "Arial Unicode MS;Andale Sans UI" ) ) );
- ImplFontEntry* pFallbackFont = Get( pFontList, aFallbackFont, rSize );
+ aFallbackFont.SetName( pFallbackData->maName );
+ ImplFontEntry* pFallbackFont = Get( pFontList, aFallbackFont, rSize, pDevSpecific );
+
+ if( pFallbackFont && !pFallbackFont->mbInit )
+ {
+ // HACK: maMetrics are irrelevant for fallback fonts, but
+ // to prevent trouble at cleanup we need to set some members
+ pFallbackFont->maMetric.maName =
+ pFallbackFont->maMetric.maStyleName = pFallbackData->maName;
+ }
+
return pFallbackFont;
}
@@ -2504,30 +2723,30 @@ ImplFontEntry* ImplFontCache::GetFallback( ImplDevFontList* pFontList,
void ImplFontCache::Release( ImplFontEntry* pEntry )
{
+ static const int FONTCACHE_MIN = 5;
+ static const int FONTCACHE_MAX = 50;
+
if( --pEntry->mnRefCount > 0 )
return;
- if( ++mnRef0Count < MAXFONT_CACHE )
+ if( ++mnRef0Count < FONTCACHE_MAX )
return;
- // delete least-recently-used unreferenced entry
- ImplFontEntry* pPrevDelEntry = mpFirstEntry;
- int nCurRef0Count = !(pPrevDelEntry->mnRefCount);
- while( ImplFontEntry* pDelEntry = pPrevDelEntry->mpNext )
+ // delete least-recently-used unreferenced entries
+ int mnRef0Index = 0;
+ for( ImplFontEntry** pNextPtr = &mpFirstEntry; pEntry = *pNextPtr; )
{
- if( !pDelEntry->mnRefCount && (++nCurRef0Count >= MAXFONT_CACHE) )
+ if( (pEntry->mnRefCount > 0) || (++mnRef0Index < FONTCACHE_MAX) )
+ pNextPtr = &pEntry->mpNext;
+ else
{
+ *pNextPtr = pEntry->mpNext;
+ delete pEntry;
--mnRef0Count;
- pPrevDelEntry->mpNext = pDelEntry->mpNext;
- delete pDelEntry;
- return;
}
-
- pPrevDelEntry = pDelEntry;
}
- DBG_ASSERT( false, "ImplFontCache::Release() - no font released" );
- return; // we should never get here
+ DBG_ASSERT( (mnRef0Index<=FONTCACHE_MAX), "ImplFontCache::Release() - mismatch" );
}
// -----------------------------------------------------------------------
@@ -2535,7 +2754,7 @@ void ImplFontCache::Release( ImplFontEntry* pEntry )
void ImplFontCache::Clear()
{
// delete all entries
- for( ImplFontEntry* pNext = mpFirstEntry; pNext; )
+ for( ImplFontEntry* pNext = mpFirstEntry; pNext != NULL; )
{
ImplFontEntry* pEntry = pNext;
pNext = pEntry->mpNext;
@@ -2551,9 +2770,9 @@ void ImplFontCache::Clear()
ImplMultiTextLineInfo::ImplMultiTextLineInfo()
{
- mpLines = new PImplTextLineInfo[MULTITEXTLINEINFO_RESIZE];
- mnLines = 0;
- mnSize = MULTITEXTLINEINFO_RESIZE;
+ mpLines = new PImplTextLineInfo[MULTITEXTLINEINFO_RESIZE];
+ mnLines = 0;
+ mnSize = MULTITEXTLINEINFO_RESIZE;
}
@@ -2743,7 +2962,7 @@ int OutputDevice::ImplNewFont()
// get font entry
ImplFontEntry* pOldEntry = mpFontEntry;
- mpFontEntry = mpFontCache->Get( mpFontList, maFont, aSize );
+ mpFontEntry = mpFontCache->Get( mpFontList, maFont, aSize, mpOutDevData ? mpOutDevData->mpFirstFontSubstEntry : NULL );
ImplFontEntry* pFontEntry = mpFontEntry;
// do lower layers need notification
@@ -3012,109 +3231,6 @@ void OutputDevice::ImplInitKerningPairs( ImplKernPairData* pKernPairs, long nKer
// -----------------------------------------------------------------------
-#ifndef ENABLE_CTL
-
-long OutputDevice::ImplCalcKerning( const sal_Unicode* pStr, xub_StrLen nLen,
- long* pDXAry, xub_StrLen nAryLen ) const
-{
- if ( !nLen )
- return 0;
-
- ImplFontEntry* pEntry = mpFontEntry;
- ImplKernPairData* pKernPairs = pEntry->mpKernPairs;
- ULONG nKernPairs = pEntry->mnKernPairs;
- long nWidth = 0;
- xub_StrLen i;
-
- if( (maFont.GetKerning() & KERNING_FONTSPECIFIC) && nKernPairs )
- {
-#ifdef DBG_UTIL
- {
- ImplKernPairData aTestPair;
-#ifdef __LITTLEENDIAN
- sal_uInt32 nTestComp = ((sal_uInt32)((USHORT)0xAABB) << 16) | (USHORT)0xCCDD;
-#else
- sal_uInt32 nTestComp = ((sal_uInt32)((USHORT)0xCCDD) << 16) | (USHORT)0xAABB;
-#endif
- aTestPair.mnChar1 = 0xCCDD;
- aTestPair.mnChar2 = 0xAABB;
- DBG_ASSERT( nTestComp == *((ULONG*)&aTestPair), "Code doesn't work in this Version" );
- }
-#endif
-
- const sal_Unicode* pTempStr = pStr;
- for ( i = 0; i < nLen-1; i++ )
- {
- USHORT nIndex = (USHORT)*pTempStr;
- pTempStr++;
-#ifdef __LITTLEENDIAN
- sal_uInt32 nComp = ((sal_uInt32)((USHORT)*pTempStr) << 16) | nIndex;
-#else
-
- sal_uInt32 nComp = ((sal_uInt32)nIndex << 16) | ((USHORT)*pTempStr);
-#endif
-
- // Search for Kerning Pair
- for( long nLower = 0, nUpper = (long)nKernPairs-1; nLower <= nUpper; )
- {
- long nMid = (nUpper + nLower) >> 1;
- ImplKernPairData* pCurKernPair = pKernPairs+nMid;
- sal_uInt32 nCurComp = *((sal_uInt32*)pCurKernPair);
- if ( nComp == nCurComp )
- {
- long nAmount = pCurKernPair->mnKern;
- nWidth += nAmount;
- if ( pDXAry )
- {
- for ( xub_StrLen n = i; n < nAryLen; n++ )
- pDXAry[n] += nAmount;
- }
- break;
-
- }
- else if ( nComp < nCurComp )
- nUpper = nMid-1;
- else // ( nComp > nCurComp )
- nLower = nMid+1;
- }
- }
-
- }
-
- if ( (maFont.GetKerning() & KERNING_ASIAN) &&
- (ImplGetCharWidth(0x3001) == ImplGetCharWidth(0x3007)) ) // monospaced font?
- {
- for( i = 0; i < nLen-1; ++i )
- {
- sal_Unicode nFirst = pStr[i];
- sal_Unicode nNext = pStr[i+1];
-
- if ( (nFirst >= 0x3000) && (nNext >= 0x3000) &&
- (nFirst <= 0x30FB) && (nNext <= 0x30FB) )
- {
- long nKernFirst = +CalcAsianKerning( nFirst, true );
- long nKernNext = -CalcAsianKerning( nNext, false );
-
- long nAmount = (nKernFirst < nKernNext) ? nKernFirst : nKernNext;
- if( nAmount<0 && nKernFirst!=0 && nKernNext!=0 )
- {
- nAmount *= ImplGetCharWidth( nFirst );
- nAmount /= 4 * mpFontEntry->mnWidthFactor;
- nWidth += nAmount;
- for( xub_StrLen n = i; n < nAryLen; ++n )
- pDXAry[n] += nAmount;
- }
- }
- }
- }
-
- return nWidth;
-}
-
-#endif // ENABLE_CTL
-
-// -----------------------------------------------------------------------
-
long OutputDevice::ImplGetTextWidth( const SalLayout& rSalLayout ) const
{
long nWidth = rSalLayout.GetTextWidth();
@@ -3766,7 +3882,7 @@ void OutputDevice::ImplDrawTextLine( long nBaseX,
// calculate approximation of strikeout atom size
long nStrikeoutWidth = nWidth;
String aStrikeoutTest( pChars, 4 );
- SalLayout* pSalLayout = ImplLayout( aStrikeoutTest, 0, 4, Point(0,0) );
+ SalLayout* pSalLayout = ImplLayout( aStrikeoutTest, 0, 4 );
if( pSalLayout )
{
nStrikeoutWidth = (pSalLayout->GetTextWidth() + 2) / 4;
@@ -4452,7 +4568,7 @@ void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout )
if( !rSalLayout.GetNextGlyphs( 1, &nGlyphIndex, aOutPoint, nStart ) )
break;
- if( !mpGraphics->GetGlyphBoundRect( nGlyphIndex, true, aRectangle, NULL ) )
+ if( !mpGraphics->GetGlyphBoundRect( nGlyphIndex, aRectangle, NULL ) )
continue;
if( !rSalLayout.IsSpacingGlyph( nGlyphIndex ) )
@@ -4571,7 +4687,7 @@ void OutputDevice::ImplDrawTextDirect( SalLayout& rSalLayout, BOOL bTextLines )
if( ImplDrawRotateText( rSalLayout ) )
return;
- long oldX = rSalLayout.DrawBase().X();
+ long nOldX = rSalLayout.DrawBase().X();
if( ! (mpPDFWriter && mpPDFWriter->isBuiltinFont(mpFontEntry->maFontSelData.mpFontData) ) )
{
if( ImplHasMirroredGraphics() )
@@ -4591,7 +4707,7 @@ void OutputDevice::ImplDrawTextDirect( SalLayout& rSalLayout, BOOL bTextLines )
rSalLayout.DrawText( *mpGraphics );
}
- rSalLayout.DrawBase().X() = oldX;
+ rSalLayout.DrawBase().X() = nOldX;
if( bTextLines )
ImplDrawTextLines( rSalLayout,
@@ -4773,9 +4889,10 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
if ( xBI.is() )
{
+ static const com::sun::star::lang::Locale aDefLocale;
xub_StrLen nSoftBreak = GetTextBreak( rStr, nWidth, nPos, nBreakPos - nPos );
DBG_ASSERT( nSoftBreak < nBreakPos, "Break?!" );
- i18n::LineBreakResults aLBR = xBI->getLineBreak( aText, nSoftBreak, GetSettings().GetLocale(), nPos, aHyphOptions, aUserOptions );
+ i18n::LineBreakResults aLBR = xBI->getLineBreak( aText, nSoftBreak, aDefLocale, nPos, aHyphOptions, aUserOptions );
nBreakPos = (xub_StrLen)aLBR.breakIndex;
if ( nBreakPos <= nPos )
nBreakPos = nSoftBreak;
@@ -4850,7 +4967,7 @@ void OutputDevice::SetFont( const Font& rNewFont )
aTextColor = Color( cLum, cLum, cLum );
}
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
- aTextColor = GetSettings().GetStyleSettings().GetWindowTextColor();
+ aTextColor = GetSettings().GetStyleSettings().GetFontColor();
if ( mnDrawMode & DRAWMODE_GHOSTEDTEXT )
{
@@ -4948,7 +5065,7 @@ void OutputDevice::SetTextColor( const Color& rColor )
aColor = Color( cLum, cLum, cLum );
}
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
- aColor = GetSettings().GetStyleSettings().GetWindowTextColor();
+ aColor = GetSettings().GetStyleSettings().GetFontColor();
if ( mnDrawMode & DRAWMODE_GHOSTEDTEXT )
{
@@ -5081,7 +5198,7 @@ void OutputDevice::SetTextLineColor( const Color& rColor )
aColor = Color( cLum, cLum, cLum );
}
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
- aColor = GetSettings().GetStyleSettings().GetWindowTextColor();
+ aColor = GetSettings().GetStyleSettings().GetFontColor();
if ( mnDrawMode & DRAWMODE_GHOSTEDTEXT )
{
@@ -5132,7 +5249,7 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth,
((eStrikeout == STRIKEOUT_NONE) || (eStrikeout == STRIKEOUT_DONTKNOW)) )
return;
- if ( !IsDeviceOutputNecessary() )
+ if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return;
#ifndef REMOTE_APPSERVER
@@ -5178,7 +5295,7 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
#ifndef REMOTE_APPSERVER
- if ( !IsDeviceOutputNecessary() )
+ if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return;
// we need a graphics
@@ -5244,25 +5361,36 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
// -----------------------------------------------------------------------
-void OutputDevice::DrawText( const Point& rStartPt, const String& rOrigStr,
+void OutputDevice::DrawText( const Point& rStartPt, const String& rStr,
xub_StrLen nIndex, xub_StrLen nLen,
MetricVector* pVector, String* pDisplayText
)
{
+ if( mpOutDevData && mpOutDevData->mpRecordLayout )
+ {
+ pVector = &mpOutDevData->mpRecordLayout->m_aUnicodeBoundRects;
+ pDisplayText = &mpOutDevData->mpRecordLayout->m_aDisplayText;
+ }
+
DBG_TRACE( "OutputDevice::DrawText()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaTextAction( rStartPt, rOrigStr, nIndex, nLen ) );
+ mpMetaFile->AddAction( new MetaTextAction( rStartPt, rStr, nIndex, nLen ) );
if( pVector )
{
Region aClip( GetClipRegion() );
if( meOutDevType == OUTDEV_WINDOW )
aClip.Intersect( Rectangle( Point(), GetOutputSize() ) );
+ if( mpOutDevData && mpOutDevData->mpRecordLayout )
+ {
+ mpOutDevData->mpRecordLayout->m_aLineIndices.push_back( mpOutDevData->mpRecordLayout->m_aDisplayText.Len() );
+ aClip.Intersect( mpOutDevData->maRecordRect );
+ }
if( ! aClip.IsNull() )
{
MetricVector aTmp;
- GetGlyphBoundRects( rStartPt, rOrigStr, nIndex, nLen, nIndex, aTmp );
+ GetGlyphBoundRects( rStartPt, rStr, nIndex, nLen, nIndex, aTmp );
bool bInserted = false;
for( MetricVector::const_iterator it = aTmp.begin(); it != aTmp.end(); ++it, nIndex++ )
@@ -5271,7 +5399,7 @@ void OutputDevice::DrawText( const Point& rStartPt, const String& rOrigStr,
if( aClip.IsOver( *it ) )
bAppend = true;
- else if( rOrigStr.GetChar( nIndex ) == ' ' && bInserted )
+ else if( rStr.GetChar( nIndex ) == ' ' && bInserted )
{
MetricVector::const_iterator next = it;
++next;
@@ -5283,34 +5411,34 @@ void OutputDevice::DrawText( const Point& rStartPt, const String& rOrigStr,
{
pVector->push_back( *it );
if( pDisplayText )
- pDisplayText->Append( rOrigStr.GetChar( nIndex ) );
+ pDisplayText->Append( rStr.GetChar( nIndex ) );
bInserted = true;
}
}
}
else
{
- GetGlyphBoundRects( rStartPt, rOrigStr, nIndex, nLen, nIndex, *pVector );
+ GetGlyphBoundRects( rStartPt, rStr, nIndex, nLen, nIndex, *pVector );
if( pDisplayText )
- pDisplayText->Append( rOrigStr.Copy( nIndex, nLen ) );
+ pDisplayText->Append( rStr.Copy( nIndex, nLen ) );
}
}
if ( !IsDeviceOutputNecessary() || pVector )
return;
#ifdef UNX
- String aStr( rOrigStr );
+ String aStr( rStr );
if( meOutDevType == OUTDEV_PRINTER )
{
if( !mpGraphics )
if( !ImplGetGraphics() )
return;
xub_StrLen nCutStart, nCutStop;
- aStr = mpGraphics->maGraphicsData.FaxPhoneComment( rOrigStr, nIndex, nLen, nCutStart, nCutStop );
+ aStr = mpGraphics->maGraphicsData.FaxPhoneComment( rStr, nIndex, nLen, nCutStart, nCutStop );
}
SalLayout* pSalLayout = ImplLayout( aStr, nIndex, nLen, rStartPt );
#else
- SalLayout* pSalLayout = ImplLayout( rOrigStr, nIndex, nLen, rStartPt );
+ SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen, rStartPt );
#endif
if( pSalLayout )
{
@@ -5321,13 +5449,13 @@ void OutputDevice::DrawText( const Point& rStartPt, const String& rOrigStr,
// -----------------------------------------------------------------------
-long OutputDevice::GetTextWidth( const String& rOrigStr,
+long OutputDevice::GetTextWidth( const String& rStr,
xub_StrLen nIndex, xub_StrLen nLen ) const
{
DBG_TRACE( "OutputDevice::GetTextWidth()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- long nWidth = GetTextArray( rOrigStr, NULL, nIndex, nLen );
+ long nWidth = GetTextArray( rStr, NULL, nIndex, nLen );
return nWidth;
}
@@ -5352,7 +5480,7 @@ long OutputDevice::GetTextHeight() const
// -----------------------------------------------------------------------
-void OutputDevice::DrawTextArray( const Point& rStartPt, const String& rOrigStr,
+void OutputDevice::DrawTextArray( const Point& rStartPt, const String& rStr,
const long* pDXAry,
xub_StrLen nIndex, xub_StrLen nLen )
{
@@ -5360,20 +5488,20 @@ void OutputDevice::DrawTextArray( const Point& rStartPt, const String& rOrigStr,
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaTextArrayAction( rStartPt, rOrigStr, pDXAry, nIndex, nLen ) );
+ mpMetaFile->AddAction( new MetaTextArrayAction( rStartPt, rStr, pDXAry, nIndex, nLen ) );
if ( !IsDeviceOutputNecessary() )
return;
#ifdef UNX
- String aStr( rOrigStr );
+ String aStr( rStr );
if( meOutDevType == OUTDEV_PRINTER )
{
if( !mpGraphics )
if( !ImplGetGraphics() )
return;
xub_StrLen nCutStart, nCutStop, nOrgLen = nLen;
- aStr = mpGraphics->maGraphicsData.FaxPhoneComment( rOrigStr, nIndex, nLen, nCutStart, nCutStop );
+ aStr = mpGraphics->maGraphicsData.FaxPhoneComment( rStr, nIndex, nLen, nCutStart, nCutStop );
if( nCutStop != nCutStart )
{
long* pAry = (long*)alloca(sizeof(long)*nLen );
@@ -5385,7 +5513,7 @@ void OutputDevice::DrawTextArray( const Point& rStartPt, const String& rOrigStr,
}
SalLayout* pSalLayout = ImplLayout( aStr, nIndex, nLen, rStartPt, 0, pDXAry );
#else
- SalLayout* pSalLayout = ImplLayout( rOrigStr, nIndex, nLen, rStartPt, 0, pDXAry );
+ SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen, rStartPt, 0, pDXAry );
#endif
if( pSalLayout )
{
@@ -5396,26 +5524,31 @@ void OutputDevice::DrawTextArray( const Point& rStartPt, const String& rOrigStr,
// -----------------------------------------------------------------------
-long OutputDevice::GetTextArray( const String& rOrigStr, long* pDXAry,
+long OutputDevice::GetTextArray( const String& rStr, long* pDXAry,
xub_StrLen nIndex, xub_StrLen nLen ) const
{
DBG_TRACE( "OutputDevice::GetTextArray()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- if( nIndex >= rOrigStr.Len() )
+ if( nIndex >= rStr.Len() )
return 0;
- if( (ULONG)nIndex+nLen >= rOrigStr.Len() )
- nLen = rOrigStr.Len() - nIndex;
+ if( (ULONG)nIndex+nLen >= rStr.Len() )
+ nLen = rStr.Len() - nIndex;
// do layout
- SalLayout* pSalLayout = ImplLayout( rOrigStr, nIndex, nLen, Point(0,0) );
+ SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen );
if( !pSalLayout )
return 0;
- int nWidthFactor = pSalLayout->GetUnitsPerPixel();
long nWidth = pSalLayout->FillDXArray( pDXAry );
+ int nWidthFactor = pSalLayout->GetUnitsPerPixel();
pSalLayout->Release();
+ // convert virtual char widths to virtual absolute positions
+ if( pDXAry )
+ for( int i = 1; i < nLen; ++i )
+ pDXAry[ i ] += pDXAry[ i-1 ];
+
// convert from font units to logical units
if( mbMap )
{
@@ -5425,7 +5558,7 @@ long OutputDevice::GetTextArray( const String& rOrigStr, long* pDXAry,
nWidth = ImplDevicePixelToLogicWidth( nWidth );
}
- if( nWidthFactor != 1 )
+ if( nWidthFactor > 1 )
{
if( pDXAry )
for( int i = 0; i < nLen; ++i )
@@ -5458,26 +5591,41 @@ bool OutputDevice::GetCaretPositions( const XubString& rStr, long* pCaretXArray,
return false;
int nWidthFactor = pSalLayout->GetUnitsPerPixel();
- pSalLayout->GetCaretPositions( pCaretXArray );
+ pSalLayout->GetCaretPositions( 2*nLen, pCaretXArray );
long nWidth = pSalLayout->GetTextWidth();
pSalLayout->Release();
- if( Application::GetSettings().GetLayoutRTL() && IsRTLEnabled() )
+ // fixup unknown caret positions
+ int i;
+ for( i = 0; i < 2 * nLen; ++i )
+ if( pCaretXArray[ i ] >= 0 )
+ break;
+ long nXPos = pCaretXArray[ i ];
+ for( i = 0; i < 2 * nLen; ++i )
+ {
+ if( pCaretXArray[ i ] >= 0 )
+ nXPos = pCaretXArray[ i ];
+ else
+ pCaretXArray[ i ] = nXPos;
+ }
+
+ // handle window mirroring
+ if( ((OutputDevice*)this)->ImplHasMirroredGraphics() && IsRTLEnabled() )
{
- for( int i = 0; i < 2 * nLen; ++i )
+ for( i = 0; i < 2 * nLen; ++i )
pCaretXArray[i] = nWidth - pCaretXArray[i] - 1;
}
// convert from font units to logical units
if( mbMap )
{
- for( int i = 0; i < 2*nLen; ++i )
+ for( i = 0; i < 2*nLen; ++i )
pCaretXArray[i] = ImplDevicePixelToLogicWidth( pCaretXArray[i] );
}
if( nWidthFactor != 1 )
{
- for( int i = 0; i < 2*nLen; ++i )
+ for( i = 0; i < 2*nLen; ++i )
pCaretXArray[i] /= nWidthFactor;
}
@@ -5493,31 +5641,31 @@ bool OutputDevice::GetCaretPositions( const XubString& rStr, long* pCaretXArray,
// -----------------------------------------------------------------------
void OutputDevice::DrawStretchText( const Point& rStartPt, ULONG nWidth,
- const String& rOrigStr,
+ const String& rStr,
xub_StrLen nIndex, xub_StrLen nLen )
{
DBG_TRACE( "OutputDevice::DrawStretchText()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaStretchTextAction( rStartPt, nWidth, rOrigStr, nIndex, nLen ) );
+ mpMetaFile->AddAction( new MetaStretchTextAction( rStartPt, nWidth, rStr, nIndex, nLen ) );
if ( !IsDeviceOutputNecessary() )
return;
#ifdef UNX
- String aStr( rOrigStr );
+ String aStr( rStr );
if( meOutDevType == OUTDEV_PRINTER )
{
if( !mpGraphics )
if( !ImplGetGraphics() )
return;
xub_StrLen nCutStart, nCutStop;
- aStr = mpGraphics->maGraphicsData.FaxPhoneComment( rOrigStr, nIndex, nLen, nCutStart, nCutStop );
+ aStr = mpGraphics->maGraphicsData.FaxPhoneComment( rStr, nIndex, nLen, nCutStart, nCutStop );
}
SalLayout* pSalLayout = ImplLayout( aStr, nIndex, nLen, rStartPt, nWidth );
#else
- SalLayout* pSalLayout = ImplLayout( rOrigStr, nIndex, nLen, rStartPt, nWidth );
+ SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen, rStartPt, nWidth );
#endif
if( pSalLayout )
{
@@ -5574,7 +5722,7 @@ SalLayout* OutputDevice::ImplLayout( const String& rOrigStr,
{
// disable Bidi if no RTL hint and no RTL codes used
const xub_Unicode* pStr = aStr.GetBuffer() + nMinIndex;
- const xub_Unicode* pEnd = pStr + (nEndIndex - nMinIndex);
+ const xub_Unicode* pEnd = aStr.GetBuffer() + nEndIndex;
for( ; pStr < pEnd; ++pStr )
if( ((*pStr >= 0x0580) && (*pStr < 0x0800)) // middle eastern scripts
|| ((*pStr >= 0xFB18) && (*pStr < 0xFE00)) // hebrew + arabic A presentation forms
@@ -5601,12 +5749,12 @@ SalLayout* OutputDevice::ImplLayout( const String& rOrigStr,
{
// disable CTL for non-CTL text
const xub_Unicode* pStr = aStr.GetBuffer() + nMinIndex;
- const xub_Unicode* pEnd = pStr + (nEndIndex-nMinIndex);
+ const xub_Unicode* pEnd = aStr.GetBuffer() + nEndIndex;
for( ; pStr < pEnd; ++pStr )
- if( (*pStr >= 0x0590) && (*pStr < 0x10A0)
- || (*pStr >= 0x1700) && (*pStr < 0x1900)
- || (*pStr >= 0xFB1D) && (*pStr < 0xFE00) // middle east presentation
- || (*pStr >= 0xFE70) && (*pStr < 0xFF00) ) // arabic presentation B
+ if( ((*pStr >= 0x0590) && (*pStr < 0x10A0))
+ || ((*pStr >= 0x1700) && (*pStr < 0x1900))
+ || ((*pStr >= 0xFB1D) && (*pStr < 0xFE00)) // middle east presentation
+ || ((*pStr >= 0xFE70) && (*pStr < 0xFF00)) ) // arabic presentation B
break;
if( pStr >= pEnd )
nLayoutFlags |= SAL_LAYOUT_COMPLEX_DISABLED;
@@ -5614,11 +5762,14 @@ SalLayout* OutputDevice::ImplLayout( const String& rOrigStr,
// right align for RTL text, DRAWPOS_REVERSED, RTL window style
bool bRightAlign = ((mnTextLayoutMode & TEXT_LAYOUT_BIDI_RTL) != 0);
- bRightAlign ^= ((mnTextLayoutMode & TEXT_LAYOUT_DRAWPOS_REVERSED) != 0);
+ if( mnTextLayoutMode & TEXT_LAYOUT_TEXTORIGIN_LEFT )
+ bRightAlign = false;
+ else if ( mnTextLayoutMode & TEXT_LAYOUT_TEXTORIGIN_RIGHT )
+ bRightAlign = true;
// SSA: hack for western office, ie text get right aligned
// for debugging purposes of mirrored UI
//static const char* pEnv = getenv( "SAL_RTL_MIRRORTEXT" );
- bool bRTLWindow = (Application::GetSettings().GetLayoutRTL() && IsRTLEnabled());
+ bool bRTLWindow = (((OutputDevice*)this)->ImplHasMirroredGraphics() && IsRTLEnabled());
bRightAlign ^= bRTLWindow;
if( bRightAlign )
nLayoutFlags |= SAL_LAYOUT_RIGHT_ALIGN;
@@ -5650,44 +5801,87 @@ SalLayout* OutputDevice::ImplLayout( const String& rOrigStr,
}
aLayoutArgs.SetDXArray( pDXArray );
+ // get matching layout object for base font
if( mpPDFWriter )
- pSalLayout = mpPDFWriter->createSalLayout( &mpFontEntry->maFontSelData, aLayoutArgs );
+ pSalLayout = mpPDFWriter->GetTextLayout( aLayoutArgs, &mpFontEntry->maFontSelData );
if( !pSalLayout )
- pSalLayout = mpGraphics->LayoutText( aLayoutArgs, 0 );
-
- // TODO: multi-level font fallback
- if( aLayoutArgs.SetFallbackArgs() && mpFontEntry )
- {
- bool bRTL;
- int nCharPos;
- aLayoutArgs.GetNextPos( &nCharPos, &bRTL );
- sal_Unicode cMissing = aLayoutArgs.mpStr[ nCharPos ];
- aLayoutArgs.ResetPos();
- Size aSize( mpFontEntry->maFontSelData.mnWidth, mpFontEntry->maFontSelData.mnHeight );
- ImplFontEntry* pFallbackFont = mpFontCache->GetFallback( mpFontList, maFont, aSize, cMissing );
-
- if( pFallbackFont && (pFallbackFont != mpFontEntry) )
- {
- // use matching fallback font for text layout
- ImplFontSelectData aIFSD = mpFontEntry->maFontSelData;
- aIFSD.mpFontData = pFallbackFont->maFontSelData.mpFontData;
- pFallbackFont->mnSetFontFlags = mpGraphics->SetFont( &aIFSD, 1 );
- SalLayout* pFallback = mpGraphics->LayoutText( aLayoutArgs, 1 );
+ pSalLayout = mpGraphics->GetTextLayout( aLayoutArgs, 0 );
+
+ // layout text
+ if( pSalLayout && !pSalLayout->LayoutText( aLayoutArgs ) )
+ {
+ pSalLayout->Release();
+ pSalLayout = NULL;
+ }
+
+ // do glyph fallback if needed
+ // #105768# avoid fallback for very small font sizes
+ if( mpFontEntry && (mpFontEntry->maFontSelData.mnHeight >= 6)
+ && (pSalLayout && aLayoutArgs.PrepareFallback()) )
+ {
+ // prepare multi level glyph fallback
+ MultiSalLayout* pMultiSalLayout = NULL;
+ ImplLayoutArgs aMultiArgs = aLayoutArgs;
+ aLayoutArgs.mnFlags |= SAL_LAYOUT_FOR_FALLBACK;
+
+ ImplFontSelectData aFontSelData = mpFontEntry->maFontSelData;
+ Size aFontSize( mpFontEntry->maFontSelData.mnWidth, mpFontEntry->maFontSelData.mnHeight );
+
+ for( int nLevel = 1; nLevel < MAX_FALLBACK; ++nLevel )
+ {
+ // find font family suited for this fallback
+ ImplFontEntry* pFallbackFont = mpFontCache->GetFallback( mpFontList,
+ maFont, aFontSize, nLevel, mpOutDevData ? mpOutDevData->mpFirstFontSubstEntry : NULL );
+ if( !pFallbackFont )
+ break;
+
+ // set up fallback font to match the original font
+ // don't fallback to itself
+ aFontSelData.mpFontData = pFallbackFont->maFontSelData.mpFontData;
+ if( mpFontEntry
+ && mpFontEntry->maFontSelData.mpFontData == aFontSelData.mpFontData )
+ continue;
+ pFallbackFont->mnSetFontFlags = mpGraphics->SetFont( &aFontSelData, nLevel );
+
+ // create and add fallback layout to multilayout
+ aLayoutArgs.ResetPos();
+ SalLayout* pFallback = mpGraphics->GetTextLayout( aLayoutArgs, nLevel );
if( pFallback )
{
- MultiSalLayout* pMulti = new MultiSalLayout( aLayoutArgs, *pSalLayout );
- pMulti->ApplyFallback( *pFallback );
- pSalLayout = pMulti;
+ if( pFallback->LayoutText( aLayoutArgs ) )
+ {
+ if( !pMultiSalLayout )
+ pMultiSalLayout = new MultiSalLayout( *pSalLayout );
+ pMultiSalLayout->AddFallback( *pFallback );
+ }
+ else
+ pFallback->Release();
}
+
mpFontCache->Release( pFallbackFont );
+
+ // break when this fallback was sufficient
+ if( !aLayoutArgs.PrepareFallback() )
+ break;
}
+
+ if( pMultiSalLayout )
+ {
+ pMultiSalLayout->LayoutText( aMultiArgs );
+ pSalLayout = pMultiSalLayout;
+ }
+
+ // restore orig font settings
+ pSalLayout->InitFont();
}
- // adjust to right alignment if necessary
if( pSalLayout )
{
+ // position, justify, etc. the layout
+ pSalLayout->AdjustLayout( aLayoutArgs );
pSalLayout->DrawBase() = aPixelPos;
+ // adjust to right alignment if necessary
if( bRightAlign )
{
long nRTLOffset;
@@ -5714,7 +5908,7 @@ xub_StrLen OutputDevice::GetTextBreak( const String& rStr, long nTextWidth,
DBG_TRACE( "OutputDevice::GetTextBreak()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen, Point(0,0) );
+ SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen );
xub_StrLen nRetVal = STRING_LEN;
if( pSalLayout )
{
@@ -5752,7 +5946,7 @@ xub_StrLen OutputDevice::GetTextBreak( const String& rStr, long nTextWidth,
rHyphenatorPos = STRING_LEN;
- SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen, Point(0,0) );
+ SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen );
if( !pSalLayout )
return STRING_LEN;
@@ -5777,7 +5971,8 @@ xub_StrLen OutputDevice::GetTextBreak( const String& rStr, long nTextWidth,
// calculate hyphenated break position
String aHyphenatorStr( &nHyphenatorChar, 1 );
- SalLayout* pHyphenatorLayout = ImplLayout( aHyphenatorStr, 0, 1, Point(0,0) );
+ xub_StrLen nTempLen = 1;
+ SalLayout* pHyphenatorLayout = ImplLayout( aHyphenatorStr, 0, nTempLen );
if( pHyphenatorLayout )
{
// calculate subpixel width of hyphenation character
@@ -5803,7 +5998,14 @@ xub_StrLen OutputDevice::GetTextBreak( const String& rStr, long nTextWidth,
void OutputDevice::DrawText( const Rectangle& rRect,
const String& rOrigStr, USHORT nStyle,
MetricVector* pVector, String* pDisplayText )
+
{
+ if( mpOutDevData && mpOutDevData->mpRecordLayout )
+ {
+ pVector = &mpOutDevData->mpRecordLayout->m_aUnicodeBoundRects;
+ pDisplayText = &mpOutDevData->mpRecordLayout->m_aDisplayText;
+ }
+
DBG_TRACE( "OutputDevice::DrawText( const Rectangle& )" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -5977,12 +6179,16 @@ void OutputDevice::DrawText( const Rectangle& rRect,
long *pCaretXArray = (long*) alloca( 2 * sizeof(long) * nLineLen );
BOOL bRet = GetCaretPositions( aStr, pCaretXArray,
nIndex, nLineLen);
- long lc_x1 = pCaretXArray[2*(nIndex + nMnemonicPos)];
- long lc_x2 = pCaretXArray[2*(nIndex + nMnemonicPos)+1];
+ long lc_x1 = pCaretXArray[2*(nMnemonicPos - nIndex)];
+ long lc_x2 = pCaretXArray[2*(nMnemonicPos - nIndex)+1];
nMnemonicWidth = ::abs((int)(lc_x1 - lc_x2));
Point aTempPos = LogicToPixel( aPos );
+#if (_MSC_VER < 1300)
nMnemonicX = mnOutOffX + aTempPos.X() + ImplLogicWidthToDevicePixel( std::min( lc_x1, lc_x2 ) );
+#else
+ nMnemonicX = mnOutOffX + aTempPos.X() + ImplLogicWidthToDevicePixel( min( lc_x1, lc_x2 ) );
+#endif
nMnemonicY = mnOutOffY + aTempPos.Y() + ImplLogicWidthToDevicePixel( GetFontMetric().GetAscent() );
ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
}
@@ -6052,7 +6258,11 @@ void OutputDevice::DrawText( const Rectangle& rRect,
nMnemonicWidth = ::abs((int)(lc_x1 - lc_x2));
Point aTempPos = LogicToPixel( aPos );
+#if (_MSC_VER < 1300)
nMnemonicX = mnOutOffX + aTempPos.X() + ImplLogicWidthToDevicePixel( std::min(lc_x1, lc_x2) );
+#else
+ nMnemonicX = mnOutOffX + aTempPos.X() + ImplLogicWidthToDevicePixel( min(lc_x1, lc_x2) );
+#endif
nMnemonicY = mnOutOffY + aTempPos.Y() + ImplLogicWidthToDevicePixel( GetFontMetric().GetAscent() );
}
@@ -6381,6 +6591,17 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
--nLen;
DBG_ASSERT( nMnemonicPos < (nIndex+nLen), "Mnemonic underline marker after last character" );
}
+ BOOL bInvalidPos = FALSE;
+
+ if( nMnemonicPos >= nLen )
+ {
+ // #106952#
+ // may occur in BiDi-Strings: the '~' is sometimes found behind the last char
+ // due to some strange BiDi text editors
+ // ->place the underline behind the string to indicate a failure
+ bInvalidPos = TRUE;
+ nMnemonicPos = nLen-1;
+ }
long *pCaretXArray = (long*)alloca( 2 * sizeof(long) * nLen );
BOOL bRet = GetCaretPositions( aStr, pCaretXArray, nIndex, nLen );
@@ -6388,7 +6609,15 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
long lc_x2 = pCaretXArray[ 2*(nMnemonicPos - nIndex)+1 ];
nMnemonicWidth = ::abs((int)(lc_x1 - lc_x2));
+#if (_MSC_VER < 1300)
Point aTempPos( std::min(lc_x1,lc_x2), GetFontMetric().GetAscent() );
+ if( bInvalidPos ) // #106952#, place behind the (last) character
+ aTempPos = Point( std::max(lc_x1,lc_x2), GetFontMetric().GetAscent() );
+#else
+ Point aTempPos( min(lc_x1,lc_x2), GetFontMetric().GetAscent() );
+ if( bInvalidPos ) // #106952#, place behind the (last) character
+ aTempPos = Point( max(lc_x1,lc_x2), GetFontMetric().GetAscent() );
+#endif
aTempPos += rPos;
aTempPos = LogicToPixel( aTempPos );
nMnemonicX = mnOutOffX + aTempPos.X();
@@ -6695,17 +6924,18 @@ FontMetric OutputDevice::GetFontMetric() const
FontMetric aMetric;
- if( mbNewFont && !(const_cast<OutputDevice&>(*this).ImplNewFont()) )
- return aMetric;
+ if( mbNewFont )
+ if( !(const_cast<OutputDevice&>(*this).ImplNewFont()) )
+ return aMetric;
ImplFontEntry* pEntry = mpFontEntry;
ImplFontMetricData* pMetric = &(pEntry->maMetric);
- // Mappen und StarView Struktur fuellen
+ // map and fill StarView structure
aMetric.Font::operator=( maFont );
- // Fontdaten ermitteln und setzen
- aMetric.SetName( pMetric->maName );
+ // set aMetric with info from font
+ aMetric.SetName( maFont.GetName() );
aMetric.SetStyleName( pMetric->maStyleName );
aMetric.SetSize( PixelToLogic( Size( pMetric->mnWidth, pMetric->mnAscent+pMetric->mnDescent-pMetric->mnLeading ) ) );
aMetric.SetCharSet( pMetric->meCharSet );
@@ -6860,36 +7090,39 @@ BOOL OutputDevice::GetTextBoundRect( Rectangle& rRect,
rRect.SetEmpty();
SalLayout* pSalLayout = NULL;
-
// calculate offset when nBase!=nIndex
long nXOffset = 0;
if( nBase != nIndex )
{
+#if (_MSC_VER < 1300)
xub_StrLen nStart = std::min( nBase, nIndex );
xub_StrLen nOfsLen = std::max( nBase, nIndex ) - nStart;
- pSalLayout = ImplLayout( rStr, nStart, nOfsLen, Point(0,0) );
+#else
+ xub_StrLen nStart = min( nBase, nIndex );
+ xub_StrLen nOfsLen = max( nBase, nIndex ) - nStart;
+#endif
+ pSalLayout = ImplLayout( rStr, nStart, nOfsLen );
if( pSalLayout )
{
- nXOffset = pSalLayout->FillDXArray( NULL );
+ nXOffset = pSalLayout->GetTextWidth();
nXOffset /= pSalLayout->GetUnitsPerPixel();
pSalLayout->Release();
// TODO: fix offset calculation for Bidi case
- if( nBase > nIndex)
+ if( nBase < nIndex)
nXOffset = -nXOffset;
}
}
- pSalLayout = ImplLayout( rStr, nIndex, nLen, Point(0,0) );
+ pSalLayout = ImplLayout( rStr, nIndex, nLen );
+ Rectangle aPixelRect;
if( pSalLayout )
{
- int nWidthFactor = pSalLayout->GetUnitsPerPixel();
- Point aPos = pSalLayout->GetDrawPosition();
-
- Rectangle aPixelRect;
bRet = pSalLayout->GetBoundRect( *mpGraphics, aPixelRect );
if( bRet )
{
+ int nWidthFactor = pSalLayout->GetUnitsPerPixel();
+
if( nWidthFactor > 1 )
{
double fFactor = 1.0 / nWidthFactor;
@@ -6917,109 +7150,112 @@ BOOL OutputDevice::GetTextBoundRect( Rectangle& rRect,
if( bRet || (OUTDEV_PRINTER == meOutDevType) )
return bRet;
- // bitmap method to get the bounding rectangle
+ // fall back to bitmap method to get the bounding rectangle,
+ // so we need a monochrome virtual device with matching font
VirtualDevice aVDev( 1 );
- pSalLayout = aVDev.ImplLayout( rStr, nIndex, nLen, Point(0,0) );
- if( !pSalLayout )
- return false;
-
- long nWidth = ImplGetTextWidth( *pSalLayout );
- long nHeight = mpFontEntry->mnLineHeight + mnEmphasisAscent + mnEmphasisDescent;
- Point aOffset( nWidth >> 1, 8 );
- Size aSize( nWidth + ( aOffset.X() << 1 ), nHeight + ( aOffset.Y() << 1 ) );
-
- if( !aVDev.SetOutputSizePixel( aSize ) )
- return false;
-
Font aFont( GetFont() );
aFont.SetShadow( FALSE );
aFont.SetOutline( FALSE );
aFont.SetRelief( RELIEF_NONE );
aFont.SetOrientation( 0 );
aFont.SetSize( Size( mpFontEntry->maFontSelData.mnWidth, mpFontEntry->maFontSelData.mnHeight ) );
-
aVDev.SetFont( aFont );
aVDev.SetTextAlign( ALIGN_TOP );
+
+ // layout the text on the virtual device
+ pSalLayout = aVDev.ImplLayout( rStr, nIndex, nLen );
+ if( !pSalLayout )
+ return false;
+
+ // make the bitmap big enough
+ // TODO: use factors when it would get too big
+ long nWidth = pSalLayout->GetTextWidth();
+ long nHeight = mpFontEntry->mnLineHeight + mnEmphasisAscent + mnEmphasisDescent;
+ Point aOffset( nWidth/2, 8 );
+ Size aSize( nWidth + 2*aOffset.X(), nHeight + 2*aOffset.Y() );
+ if( !nWidth || !aVDev.SetOutputSizePixel( aSize ) )
+ return false;
+
+ // draw text in black
+ pSalLayout->DrawBase() = aOffset;
aVDev.SetTextColor( Color( COL_BLACK ) );
aVDev.SetTextFillColor();
- aVDev.ImplNewFont();
- aVDev.ImplInitFont();
aVDev.ImplInitTextColor();
-
- pSalLayout->DrawBase() = aOffset - Point( mnTextOffX, mnTextOffY );
aVDev.ImplDrawText( *pSalLayout );
pSalLayout->Release();
+ // find extents using the bitmap
Bitmap aBmp = aVDev.GetBitmap( Point(), aSize );
BitmapReadAccess* pAcc = aBmp.AcquireReadAccess();
- if( pAcc )
- {
- const long nW = pAcc->Width();
- const long nW1 = nW - 1L;
- const long nH = pAcc->Height();
- long nLeft, nTop, nRight, nBottom;
- const BitmapColor aBlack( pAcc->GetBestMatchingColor( Color( COL_BLACK ) ) );
- BOOL bLineDone;
-
- nLeft = nW;
- nTop = nH;
- nRight = nBottom = -1L;
-
- for( long nY = 0L; nY < nH; nY++ )
- {
- bLineDone = FALSE;
-
- for( long nX = 0L; ( nX < nW ) && !bLineDone; nX++ )
- {
- if( pAcc->GetPixel( nY, nX ) == aBlack )
- {
- // find y minimum
- if( nY < nTop )
- nTop = nY;
-
- // find y maximum
- if( nY > nBottom )
- nBottom = nY;
-
- // find x minimum
- if( nX < nLeft )
- nLeft = nX;
+ if( !pAcc )
+ return FALSE;
+ const BitmapColor aBlack( pAcc->GetBestMatchingColor( Color( COL_BLACK ) ) );
+ const long nW = pAcc->Width();
+ const long nH = pAcc->Height();
+ long nLeft, nRight;
- // find x maximum (last pixel in line)
- for( long nX2 = nW1; nX2 >= nX; nX2-- )
+ // find top left point
+ long nTop = 0;
+ for(; nTop < nH; ++nTop )
+ {
+ for( nLeft = 0; nLeft < nW; ++nLeft )
+ if( pAcc->GetPixel( nTop, nLeft ) == aBlack )
+ break;
+ if( nLeft < nW )
+ break;
+ }
- {
- if( pAcc->GetPixel( nY, nX2 ) == aBlack )
- {
- if( nX2 > nRight )
- nRight = nX2;
+ // find bottom right point
+ long nBottom = nH;
+ while( --nBottom >= nTop )
+ {
+ for( nRight = nW; --nRight >= 0; )
+ if( pAcc->GetPixel( nBottom, nRight ) == aBlack )
+ break;
+ if( nRight >= 0 )
+ break;
+ }
+ if( nRight < nLeft )
+ {
+ long nX = nRight;
+ nRight = nLeft;
+ nLeft = nX;
+ }
- bLineDone = TRUE;
- break;
- }
- }
- }
- }
- }
+ for( long nY = nTop; nY <= nBottom; ++nY )
+ {
+ // find leftmost point
+ long nX;
+ for( nX = 0; nX < nLeft; ++nX )
+ if( pAcc->GetPixel( nY, nX ) == aBlack )
+ break;
+ nLeft = nX;
- if( nLeft < nW && nTop < nH && nRight > -1L && nBottom > -1L )
- {
- nLeft -= aOffset.X(), nTop -= aOffset.Y();
- nRight -= aOffset.X(), nBottom -= aOffset.Y();
+ // find rightmost point
+ for( nX = nW; --nX > nRight; )
+ if( pAcc->GetPixel( nY, nX ) == aBlack )
+ break;
+ nRight = nX;
+ }
- nWidth = ImplDevicePixelToLogicWidth( nRight - nLeft + 1L );
- nHeight = ImplDevicePixelToLogicHeight( nBottom - nTop + 1L );
- nLeft = ImplDevicePixelToLogicWidth( nLeft );
- nTop = ImplDevicePixelToLogicHeight( nTop );
- rRect = Rectangle( Point( nLeft, nTop ), Size( nWidth, nHeight ) );
- bRet = TRUE;
- }
+ aBmp.ReleaseAccess( pAcc );
- aBmp.ReleaseAccess( pAcc );
+ if( nTop <= nBottom )
+ {
+ Size aSize( nRight - nLeft + 1, nBottom - nTop + 1 );
+ Point aTopLeft( nLeft, nTop );
+ aTopLeft -= aOffset;
+ // adjust to text alignment
+ aTopLeft.Y()+= mnTextOffY - (mpFontEntry->maMetric.mnAscent + mnEmphasisAscent);
+ // convert to logical coordinates
+ aSize = PixelToLogic( aSize );
+ aTopLeft.X() = ImplDevicePixelToLogicWidth( aTopLeft.X() );
+ aTopLeft.Y() = ImplDevicePixelToLogicHeight( aTopLeft.Y() );
+ rRect = Rectangle( aTopLeft, aSize );
+ return TRUE;
}
- rRect += Point( mnTextOffX, mnTextOffY );
- return bRet;
+ return FALSE;
}
// -----------------------------------------------------------------------
@@ -7047,6 +7283,9 @@ BOOL OutputDevice::GetTextOutlines( PolyPolyVector& rVector,
{
BOOL bRet = FALSE;
rVector.clear();
+ if( nLen == STRING_LEN )
+ nLen = rStr.Len() - nIndex;
+ rVector.reserve( nLen );
// we want to get the Rectangle in logical units, so to
// avoid rounding errors we just size the font in logical units
@@ -7063,12 +7302,17 @@ BOOL OutputDevice::GetTextOutlines( PolyPolyVector& rVector,
long nXOffset = 0;
if( nBase != nIndex )
{
+#if (_MSC_VER < 1300)
xub_StrLen nStart = std::min( nBase, nIndex );
xub_StrLen nOfsLen = std::max( nBase, nIndex ) - nStart;
- pSalLayout = ImplLayout( rStr, nStart, nOfsLen, Point(0,0) );
+#else
+ xub_StrLen nStart = min( nBase, nIndex );
+ xub_StrLen nOfsLen = max( nBase, nIndex ) - nStart;
+#endif
+ pSalLayout = ImplLayout( rStr, nStart, nOfsLen );
if( pSalLayout )
{
- nXOffset = pSalLayout->FillDXArray( NULL );
+ nXOffset = pSalLayout->GetTextWidth();
pSalLayout->Release();
// TODO: fix offset calculation for Bidi case
if( nBase > nIndex)
@@ -7076,7 +7320,7 @@ BOOL OutputDevice::GetTextOutlines( PolyPolyVector& rVector,
}
}
- pSalLayout = ImplLayout( rStr, nIndex, nLen, Point(0,0) );
+ pSalLayout = ImplLayout( rStr, nIndex, nLen );
if( pSalLayout )
{
int nWidthFactor = pSalLayout->GetUnitsPerPixel();
@@ -7119,10 +7363,10 @@ BOOL OutputDevice::GetTextOutlines( PolyPolyVector& rVector,
// Here, we can savely assume that the mapping between characters and glyphs
// is one-to-one.
- pSalLayout = ImplLayout(rStr, nIndex, nLen, Point(0, 0));
+ pSalLayout = ImplLayout(rStr, nIndex, nLen );
if (pSalLayout == 0)
return false;
- long nOrgWidth = ImplGetTextWidth(*pSalLayout);
+ long nOrgWidth = pSalLayout->GetTextWidth();
long nOrgHeight = mpFontEntry->mnLineHeight + mnEmphasisAscent
+ mnEmphasisDescent;
pSalLayout->Release();
@@ -7144,10 +7388,10 @@ BOOL OutputDevice::GetTextOutlines( PolyPolyVector& rVector,
xVDev->SetTextColor(Color(COL_BLACK));
xVDev->SetTextFillColor();
- pSalLayout = xVDev->ImplLayout(rStr, nIndex, nLen, Point(0, 0));
+ pSalLayout = xVDev->ImplLayout(rStr, nIndex, nLen );
if (pSalLayout == 0)
return false;
- long nWidth = xVDev->ImplGetTextWidth(*pSalLayout);
+ long nWidth = pSalLayout->GetTextWidth();
long nHeight = xVDev->mpFontEntry->mnLineHeight + xVDev->mnEmphasisAscent
+ xVDev->mnEmphasisDescent;
pSalLayout->Release();
@@ -7162,12 +7406,17 @@ BOOL OutputDevice::GetTextOutlines( PolyPolyVector& rVector,
nXOffset = 0;
if( nBase != nIndex )
{
+#if (_MSC_VER < 1300)
xub_StrLen nStart = std::min( nBase, nIndex );
xub_StrLen nLength = std::max( nBase, nIndex ) - nStart;
- pSalLayout = xVDev->ImplLayout( rStr, nStart, nLength, Point(0,0) );
+#else
+ xub_StrLen nStart = min( nBase, nIndex );
+ xub_StrLen nLength = max( nBase, nIndex ) - nStart;
+#endif
+ pSalLayout = xVDev->ImplLayout( rStr, nStart, nLength );
if( pSalLayout )
{
- nXOffset = pSalLayout->FillDXArray( NULL );
+ nXOffset = pSalLayout->GetTextWidth();
pSalLayout->Release();
if( nBase > nIndex)
nXOffset = -nXOffset;
@@ -7180,10 +7429,10 @@ BOOL OutputDevice::GetTextOutlines( PolyPolyVector& rVector,
bool bSuccess = false;
// draw character into virtual device
- pSalLayout = xVDev->ImplLayout(rStr, i, 1, Point(0, 0));
+ pSalLayout = xVDev->ImplLayout(rStr, i, 1 );
if (pSalLayout == 0)
return false;
- long nCharWidth = xVDev->ImplGetTextWidth(*pSalLayout);
+ long nCharWidth = pSalLayout->GetTextWidth();
Point aOffset(nCharWidth / 2, 8);
Size aSize(nCharWidth + 2 * aOffset.X(), nHeight + 2 * aOffset.Y());
@@ -7192,7 +7441,7 @@ BOOL OutputDevice::GetTextOutlines( PolyPolyVector& rVector,
{
xVDev->Erase();
pSalLayout->DrawBase() += aOffset;
- xVDev->ImplDrawText(*pSalLayout);
+ pSalLayout->DrawText( *xVDev->mpGraphics );
}
pSalLayout->Release();
diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx
index 590ffa811a9c..307672c4136a 100644
--- a/vcl/source/gdi/outdev4.cxx
+++ b/vcl/source/gdi/outdev4.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: outdev4.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: thb $ $Date: 2002-10-14 09:56:03 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:00 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -95,11 +95,8 @@
#ifndef _SV_OUTDATA_HXX
#include <outdata.hxx>
#endif
-#ifndef _SV_POLY_H
-#include <poly.h>
-#endif
-#ifndef _SV_POLY_HXX
-#include <poly.hxx>
+#ifndef _POLY_HXX
+#include <tools/poly.hxx>
#endif
#ifndef _SV_SALBTYPE_HXX
#include <salbtype.hxx>
@@ -161,7 +158,7 @@ void OutputDevice::ImplDrawPolygon( const Polygon& rPoly, const PolyPolygon* pCl
if ( nPoints < 2 )
return;
- const SalPoint* pPtAry = (const SalPoint*)rPoly.ImplGetConstPointAry();
+ const SalPoint* pPtAry = (const SalPoint*)rPoly.GetConstPointAry();
mpGraphics->DrawPolygon( nPoints, pPtAry, this );
}
}
@@ -187,7 +184,7 @@ void OutputDevice::ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const Poly
if( nSize >= 2 )
{
- const SalPoint* pPtAry = (const SalPoint*)rPoly.ImplGetConstPointAry();
+ const SalPoint* pPtAry = (const SalPoint*)rPoly.GetConstPointAry();
mpGraphics->DrawPolygon( nSize, pPtAry, this );
}
}
@@ -204,7 +201,7 @@ void OutputDevice::ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const Poly
if ( nSize )
{
pPointAry[i] = nSize;
- pPointAryAry[i] = (PCONSTSALPOINT)rPoly.ImplGetConstPointAry();
+ pPointAryAry[i] = (PCONSTSALPOINT)rPoly.GetConstPointAry();
i++;
}
else
@@ -332,9 +329,14 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
long nInc;
if ( meOutDevType != OUTDEV_PRINTER && !bMtf )
+ {
nInc = (nMinRect < 50) ? 2 : 4;
+ }
else
- nInc = ((nMinRect >> 9) + 1) << 3;
+ {
+ // #105998# Use display-equivalent step size calculation
+ nInc = (nMinRect < 800) ? 10 : 20;
+ }
if ( !nInc )
nInc = 1;
@@ -450,7 +452,10 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
{
// fuer axiale FV muss die letzte Farbe der ersten
// Farbe entsprechen
- if ( i > nSteps )
+ // #107350# Setting end color one step earlier, as the
+ // last time we get here, we drop out of the loop later
+ // on.
+ if ( i >= nSteps )
{
nRed = (UINT8)nEndRed;
nGreen = (UINT8)nEndGreen;
@@ -582,10 +587,14 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
long nInc;
if ( meOutDevType != OUTDEV_PRINTER && !bMtf )
+ {
nInc = ( nMinRect < 50 ) ? 2 : 4;
-
+ }
else
- nInc = ( ( nMinRect >> 9 ) + 1 ) << 3;
+ {
+ // #105998# Use display-equivalent step size calculation
+ nInc = (nMinRect < 800) ? 10 : 20;
+ }
if( !nInc )
nInc = 1;
@@ -615,6 +624,7 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
double fScanBottom = aRect.Bottom();
double fScanInc = (double) nMinRect / (double) nSteps * 0.5;
UINT8 nRed = (UINT8) nStartRed, nGreen = (UINT8) nStartGreen, nBlue = (UINT8) nStartBlue;
+ bool bPaintLastPolygon( false ); // #107349# Paint last polygon only if loop has generated any output
if( bMtf )
mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
@@ -668,16 +678,11 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
nGreen = ImplGetGradientColorValue( nStartGreen + ( ( nGreenSteps * nStepIndex ) / nSteps ) );
nBlue = ImplGetGradientColorValue( nStartBlue + ( ( nBlueSteps * nStepIndex ) / nSteps ) );
- if( bMtf )
- mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
-#ifndef REMOTE_APPSERVER
- else
- mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
-#endif
-
// entweder langsame PolyPolygon-Ausgaben oder schnelles Polygon-Painting
if( pPolyPoly )
{
+ bPaintLastPolygon = true; // #107349# Paint last polygon only if loop has generated any output
+
pPolyPoly->Replace( pPolyPoly->GetObject( 1 ), 0 );
pPolyPoly->Replace( aPoly, 1 );
@@ -687,10 +692,30 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
else
ImplDrawPolyPolygon( *pPolyPoly, pClipPolyPoly );
#endif
+
+ // #107349# Set fill color _after_ geometry painting:
+ // pPolyPoly's geometry is the band from last iteration's
+ // aPoly to current iteration's aPoly. The window outdev
+ // path (see else below), on the other hand, paints the
+ // full aPoly. Thus, here, we're painting the band before
+ // the one painted in the window outdev path below. To get
+ // matching colors, have to delay color setting here.
+ if( bMtf )
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
+ else
+ mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
}
#ifndef REMOTE_APPSERVER
else
+ {
+ // #107349# Set fill color _before_ geometry painting
+ if( bMtf )
+ mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), TRUE ) );
+ else
+ mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) );
+
ImplDrawPolygon( aPoly, pClipPolyPoly );
+ }
#endif
}
@@ -701,9 +726,15 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
if( !rPoly.GetBoundRect().IsEmpty() )
{
- nRed = ImplGetGradientColorValue( nEndRed );
- nGreen = ImplGetGradientColorValue( nEndGreen );
- nBlue = ImplGetGradientColorValue( nEndBlue );
+ // #107349# Paint last polygon with end color only if loop
+ // has generated output. Otherwise, the current
+ // (i.e. start) color is taken, to generate _any_ output.
+ if( bPaintLastPolygon )
+ {
+ nRed = ImplGetGradientColorValue( nEndRed );
+ nGreen = ImplGetGradientColorValue( nEndGreen );
+ nBlue = ImplGetGradientColorValue( nEndBlue );
+ }
if( bMtf )
{
@@ -792,7 +823,7 @@ void OutputDevice::DrawGradient( const Rectangle& rRect,
if( mpMetaFile )
mpMetaFile->AddAction( new MetaGradientAction( rRect, aGradient ) );
- if( !IsDeviceOutputNecessary() )
+ if( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return;
// Rechteck in Pixel umrechnen
@@ -925,7 +956,7 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
mpMetaFile->AddAction( new MetaCommentAction( "XGRAD_SEQ_END" ) );
}
- if( !IsDeviceOutputNecessary() )
+ if( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return;
Gradient aGradient( rGradient );
@@ -1128,7 +1159,7 @@ void OutputDevice::DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch
}
else if( mnDrawMode & DRAWMODE_SETTINGSLINE )
{
- aColor = GetSettings().GetStyleSettings().GetWindowTextColor();
+ aColor = GetSettings().GetStyleSettings().GetFontColor();
}
if ( mnDrawMode & DRAWMODE_GHOSTEDLINE )
@@ -1144,7 +1175,7 @@ void OutputDevice::DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch
if( mpMetaFile )
mpMetaFile->AddAction( new MetaHatchAction( rPolyPoly, aHatch ) );
- if( !IsDeviceOutputNecessary() )
+ if( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return;
#ifndef REMOTE_APPSERVER
diff --git a/vcl/source/gdi/outdev5.cxx b/vcl/source/gdi/outdev5.cxx
index 918ee8b76ac2..4563b20fdc4a 100644
--- a/vcl/source/gdi/outdev5.cxx
+++ b/vcl/source/gdi/outdev5.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: outdev5.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: ssa $ $Date: 2002-08-29 15:35:30 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:00 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -84,11 +84,8 @@
#ifndef _SV_SVDATA_HXX
#include <svdata.hxx>
#endif
-#ifndef _SV_POLY_H
-#include <poly.h>
-#endif
-#ifndef _SV_POLY_HXX
-#include <poly.hxx>
+#ifndef _POLY_HXX
+#include <tools/poly.hxx>
#endif
#ifndef _SV_METAACT_HXX
#include <metaact.hxx>
@@ -121,7 +118,7 @@ void OutputDevice::DrawRect( const Rectangle& rRect,
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaRoundRectAction( rRect, nHorzRound, nVertRound ) );
- if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) )
+ if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || ImplIsRecordLayout() )
return;
const Rectangle aRect( ImplLogicToDevicePixel( rRect ) );
@@ -158,7 +155,7 @@ void OutputDevice::DrawRect( const Rectangle& rRect,
if ( aRoundRectPoly.GetSize() >= 2 )
{
- const SalPoint* pPtAry = (const SalPoint*) aRoundRectPoly.ImplGetConstPointAry();
+ const SalPoint* pPtAry = (const SalPoint*) aRoundRectPoly.GetConstPointAry();
if ( !mbFillColor )
mpGraphics->DrawPolyLine( aRoundRectPoly.GetSize(), pPtAry, this );
@@ -192,7 +189,7 @@ void OutputDevice::DrawEllipse( const Rectangle& rRect )
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaEllipseAction( rRect ) );
- if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) )
+ if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || ImplIsRecordLayout() )
return;
Rectangle aRect( ImplLogicToDevicePixel( rRect ) );
@@ -218,7 +215,7 @@ void OutputDevice::DrawEllipse( const Rectangle& rRect )
Polygon aRectPoly( aRect.Center(), aRect.GetWidth() >> 1, aRect.GetHeight() >> 1 );
if ( aRectPoly.GetSize() >= 2 )
{
- const SalPoint* pPtAry = (const SalPoint*)aRectPoly.ImplGetConstPointAry();
+ const SalPoint* pPtAry = (const SalPoint*)aRectPoly.GetConstPointAry();
if ( !mbFillColor )
mpGraphics->DrawPolyLine( aRectPoly.GetSize(), pPtAry, this );
else
@@ -252,7 +249,7 @@ void OutputDevice::DrawArc( const Rectangle& rRect,
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaArcAction( rRect, rStartPt, rEndPt ) );
- if ( !IsDeviceOutputNecessary() || !mbLineColor )
+ if ( !IsDeviceOutputNecessary() || !mbLineColor || ImplIsRecordLayout() )
return;
Rectangle aRect( ImplLogicToDevicePixel( rRect ) );
@@ -281,7 +278,7 @@ void OutputDevice::DrawArc( const Rectangle& rRect,
if ( aArcPoly.GetSize() >= 2 )
{
- const SalPoint* pPtAry = (const SalPoint*)aArcPoly.ImplGetConstPointAry();
+ const SalPoint* pPtAry = (const SalPoint*)aArcPoly.GetConstPointAry();
mpGraphics->DrawPolyLine( aArcPoly.GetSize(), pPtAry, this );
}
#else
@@ -310,7 +307,7 @@ void OutputDevice::DrawPie( const Rectangle& rRect,
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaPieAction( rRect, rStartPt, rEndPt ) );
- if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) )
+ if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || ImplIsRecordLayout() )
return;
Rectangle aRect( ImplLogicToDevicePixel( rRect ) );
@@ -339,7 +336,7 @@ void OutputDevice::DrawPie( const Rectangle& rRect,
if ( aPiePoly.GetSize() >= 2 )
{
- const SalPoint* pPtAry = (const SalPoint*)aPiePoly.ImplGetConstPointAry();
+ const SalPoint* pPtAry = (const SalPoint*)aPiePoly.GetConstPointAry();
if ( !mbFillColor )
mpGraphics->DrawPolyLine( aPiePoly.GetSize(), pPtAry, this );
else
@@ -375,7 +372,7 @@ void OutputDevice::DrawChord( const Rectangle& rRect,
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaChordAction( rRect, rStartPt, rEndPt ) );
- if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) )
+ if ( !IsDeviceOutputNecessary() || (!mbLineColor && !mbFillColor) || ImplIsRecordLayout() )
return;
Rectangle aRect( ImplLogicToDevicePixel( rRect ) );
@@ -404,7 +401,7 @@ void OutputDevice::DrawChord( const Rectangle& rRect,
if ( aChordPoly.GetSize() >= 2 )
{
- const SalPoint* pPtAry = (const SalPoint*)aChordPoly.ImplGetConstPointAry();
+ const SalPoint* pPtAry = (const SalPoint*)aChordPoly.GetConstPointAry();
if ( !mbFillColor )
mpGraphics->DrawPolyLine( aChordPoly.GetSize(), pPtAry, this );
else
diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx
index 3499fc433bfa..5d8ba68e2efb 100644
--- a/vcl/source/gdi/outdev6.cxx
+++ b/vcl/source/gdi/outdev6.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: outdev6.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: ssa $ $Date: 2002-08-29 15:35:30 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:00 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -123,7 +123,7 @@ void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, ULONG nF
Rectangle aDstRect( PixelToLogic( Point() ), GetOutputSize() );
aDstRect.Intersection( rRect );
- if( aDstRect.IsEmpty() )
+ if( aDstRect.IsEmpty() || ImplIsRecordLayout() )
return;
#ifndef REMOTE_APPSERVER
@@ -241,7 +241,7 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
if( mpMetaFile )
mpMetaFile->AddAction( new MetaTransparentAction( rPolyPoly, nTransparencePercent ) );
- if( !IsDeviceOutputNecessary() || ( !mbLineColor && !mbFillColor ) )
+ if( !IsDeviceOutputNecessary() || ( !mbLineColor && !mbFillColor ) || ImplIsRecordLayout() )
return;
GDIMetaFile* pOldMetaFile = mpMetaFile;
@@ -912,7 +912,7 @@ void OutputDevice::DrawWallpaper( const Rectangle& rRect,
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaWallpaperAction( rRect, rWallpaper ) );
- if ( !IsDeviceOutputNecessary() )
+ if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return;
if ( rWallpaper.GetStyle() != WALLPAPER_NULL )
@@ -932,7 +932,7 @@ void OutputDevice::DrawWallpaper( const Rectangle& rRect,
void OutputDevice::Erase()
{
- if ( !IsDeviceOutputNecessary() )
+ if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return;
if ( mbBackground )
@@ -1003,7 +1003,7 @@ void OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
mpMetaFile->AddAction( new MetaEPSAction( rPoint, rSize, rGfxLink, aSubst ) );
}
- if ( !IsDeviceOutputNecessary() )
+ if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return;
Rectangle aRect( ImplLogicToDevicePixel( Rectangle( rPoint, rSize ) ) );
diff --git a/vcl/source/gdi/outmap.cxx b/vcl/source/gdi/outmap.cxx
index 91c179ff1769..969cc27adb24 100644
--- a/vcl/source/gdi/outmap.cxx
+++ b/vcl/source/gdi/outmap.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: outmap.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: thb $ $Date: 2002-11-15 10:49:43 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:01 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -77,11 +77,8 @@
#ifndef _SV_SVDATA_HXX
#include <svdata.hxx>
#endif
-#ifndef _SV_POLY_H
-#include <poly.h>
-#endif
-#ifndef _SV_POLY_HXX
-#include <poly.hxx>
+#ifndef _POLY_HXX
+#include <tools/poly.hxx>
#endif
#ifndef _SV_REGION_HXX
#include <region.hxx>
@@ -416,178 +413,6 @@ inline void ImplCalcMapResolution( const MapMode& rMapMode,
// -----------------------------------------------------------------------
-void OutputDevice::SetMapMode()
-{
- DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
-
- if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaMapModeAction( MapMode() ) );
-
- if ( mbMap || !maMapMode.IsDefault() )
- {
- mbMap = FALSE;
- maMapMode = MapMode();
-
- // create new objects (clip region werden nicht neu skaliert)
- mbNewFont = TRUE;
- mbInitFont = TRUE;
- if ( GetOutDevType() == OUTDEV_WINDOW )
- {
- if ( ((Window*)this)->mpCursor )
- ((Window*)this)->mpCursor->ImplNew();
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
-{
- DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
-
- BOOL bRelMap = (rNewMapMode.GetMapUnit() == MAP_RELATIVE);
-
- if ( mpMetaFile )
- {
- mpMetaFile->AddAction( new MetaMapModeAction( rNewMapMode ) );
-#ifdef DBG_UTIL
- if ( GetOutDevType() != OUTDEV_PRINTER )
- DBG_ASSERTWARNING( bRelMap, "Please record only relative MapModes!" );
-#endif
- }
-
- // Ist der MapMode der gleiche wie vorher, dann mache nichts
- if ( maMapMode == rNewMapMode )
- return;
-
- // Ist Default-MapMode, dann bereche nichts
- BOOL bOldMap = mbMap;
- mbMap = !rNewMapMode.IsDefault();
- if ( mbMap )
- {
- // Falls nur der Orign umgesetzt wird, dann scaliere nichts neu
- if ( (rNewMapMode.GetMapUnit() == maMapMode.GetMapUnit()) &&
- (rNewMapMode.GetScaleX() == maMapMode.GetScaleX()) &&
- (rNewMapMode.GetScaleY() == maMapMode.GetScaleY()) &&
- (bOldMap == mbMap) )
- {
- // Offset setzen
- Point aOrigin = rNewMapMode.GetOrigin();
- maMapRes.mnMapOfsX = aOrigin.X();
- maMapRes.mnMapOfsY = aOrigin.Y();
- maMapMode = rNewMapMode;
- return;
- }
- if ( !bOldMap && bRelMap )
- {
- maMapRes.mnMapScNumX = 1;
- maMapRes.mnMapScNumY = 1;
- maMapRes.mnMapScDenomX = mnDPIX;
- maMapRes.mnMapScDenomY = mnDPIY;
- maMapRes.mnMapOfsX = 0;
- maMapRes.mnMapOfsY = 0;
- }
-
- // Neue MapMode-Aufloesung berechnen
- ImplCalcMapResolution( rNewMapMode, mnDPIX, mnDPIY, maMapRes, maThresRes );
- }
-
- // Neuen MapMode setzen
- if ( bRelMap )
- {
- Point aOrigin( maMapRes.mnMapOfsX, maMapRes.mnMapOfsY );
- // aScale? = maMapMode.GetScale?() * rNewMapMode.GetScale?()
- Fraction aScaleX = ImplMakeFraction( maMapMode.GetScaleX().GetNumerator(),
- rNewMapMode.GetScaleX().GetNumerator(),
- maMapMode.GetScaleX().GetDenominator(),
- rNewMapMode.GetScaleX().GetDenominator() );
- Fraction aScaleY = ImplMakeFraction( maMapMode.GetScaleY().GetNumerator(),
- rNewMapMode.GetScaleY().GetNumerator(),
- maMapMode.GetScaleY().GetDenominator(),
- rNewMapMode.GetScaleY().GetDenominator() );
- maMapMode.SetOrigin( aOrigin );
- maMapMode.SetScaleX( aScaleX );
- maMapMode.SetScaleY( aScaleY );
- }
- else
- maMapMode = rNewMapMode;
-
- // create new objects (clip region werden nicht neu skaliert)
- mbNewFont = TRUE;
- mbInitFont = TRUE;
- if ( GetOutDevType() == OUTDEV_WINDOW )
- {
- if ( ((Window*)this)->mpCursor )
- ((Window*)this)->mpCursor->ImplNew();
- }
-}
-
-// -----------------------------------------------------------------------
-
-void OutputDevice::SetRelativeMapMode( const MapMode& rNewMapMode )
-{
- DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
-
- // Ist der MapMode der gleiche wie vorher, dann mache nichts
- if ( maMapMode == rNewMapMode )
- return;
-
- MapUnit eOld = maMapMode.GetMapUnit();
- MapUnit eNew = rNewMapMode.GetMapUnit();
-
- // a?F = rNewMapMode.GetScale?() / maMapMode.GetScale?()
- Fraction aXF = ImplMakeFraction( rNewMapMode.GetScaleX().GetNumerator(),
- maMapMode.GetScaleX().GetDenominator(),
- rNewMapMode.GetScaleX().GetDenominator(),
- maMapMode.GetScaleX().GetNumerator() );
- Fraction aYF = ImplMakeFraction( rNewMapMode.GetScaleY().GetNumerator(),
- maMapMode.GetScaleY().GetDenominator(),
- rNewMapMode.GetScaleY().GetDenominator(),
- maMapMode.GetScaleY().GetNumerator() );
-
- Point aPt( LogicToLogic( Point(), NULL, &rNewMapMode ) );
- if ( eNew != eOld )
- {
- if ( eOld > MAP_PIXEL )
- {
- DBG_ERRORFILE( "Not implemented MapUnit" )
- }
- else if ( eNew > MAP_PIXEL )
- {
- DBG_ERRORFILE( "Not implemented MapUnit" )
- }
- else
- {
- Fraction aF( aImplNumeratorAry[eNew] * aImplDenominatorAry[eOld],
- aImplNumeratorAry[eOld] * aImplDenominatorAry[eNew] );
-
- // a?F = a?F * aF
- aXF = ImplMakeFraction( aXF.GetNumerator(), aF.GetNumerator(),
- aXF.GetDenominator(), aF.GetDenominator() );
- aYF = ImplMakeFraction( aYF.GetNumerator(), aF.GetNumerator(),
- aYF.GetDenominator(), aF.GetDenominator() );
- if ( eOld == MAP_PIXEL )
- {
- aXF *= Fraction( mnDPIX, 1 );
- aYF *= Fraction( mnDPIY, 1 );
- }
- else if ( eNew == MAP_PIXEL )
- {
- aXF *= Fraction( 1, mnDPIX );
- aYF *= Fraction( 1, mnDPIY );
- }
- }
- }
-
- MapMode aNewMapMode( MAP_RELATIVE, Point( -aPt.X(), -aPt.Y() ), aXF, aYF );
- SetMapMode( aNewMapMode );
-
- if ( eNew != eOld )
- maMapMode = rNewMapMode;
-}
-
-// -----------------------------------------------------------------------
-
static long ImplLogicToPixel( long n, long nDPI, long nMapNum, long nMapDenom,
long nThres )
{
@@ -860,32 +685,31 @@ Polygon OutputDevice::ImplLogicToDevicePixel( const Polygon& rLogicPoly ) const
Polygon aPoly( rLogicPoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
-#ifdef WIN
- Point huge* pPointAry = (Point huge*)aPoly.ImplGetPointAry();
-#else
- Point* pPointAry = aPoly.ImplGetPointAry();
-#endif
+ const Point* pPointAry = aPoly.GetConstPointAry();
if ( mbMap )
{
for ( i = 0; i < nPoints; i++ )
{
- Point* pPt = &(pPointAry[i]);
- pPt->X() = ImplLogicToPixel( pPt->X()+maMapRes.mnMapOfsX, mnDPIX,
- maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX,
- maThresRes.mnThresLogToPixX )+mnOutOffX+mnOutOffOrigX;
- pPt->Y() = ImplLogicToPixel( pPt->Y()+maMapRes.mnMapOfsY, mnDPIY,
- maMapRes.mnMapScNumY, maMapRes.mnMapScDenomY,
- maThresRes.mnThresLogToPixY )+mnOutOffY+mnOutOffOrigY;
+ const Point* pPt = &(pPointAry[i]);
+ Point aPt;
+ aPt.X() = ImplLogicToPixel( pPt->X()+maMapRes.mnMapOfsX, mnDPIX,
+ maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX,
+ maThresRes.mnThresLogToPixX )+mnOutOffX+mnOutOffOrigX;
+ aPt.Y() = ImplLogicToPixel( pPt->Y()+maMapRes.mnMapOfsY, mnDPIY,
+ maMapRes.mnMapScNumY, maMapRes.mnMapScDenomY,
+ maThresRes.mnThresLogToPixY )+mnOutOffY+mnOutOffOrigY;
+ aPoly[i] = aPt;
}
}
else
{
for ( i = 0; i < nPoints; i++ )
{
- Point* pPt = &(pPointAry[i]);
- pPt->X() += mnOutOffX;
- pPt->Y() += mnOutOffY;
+ Point aPt = pPointAry[i];
+ aPt.X() += mnOutOffX;
+ aPt.Y() += mnOutOffY;
+ aPoly[i] = aPt;
}
}
@@ -981,6 +805,198 @@ Region OutputDevice::ImplPixelToDevicePixel( const Region& rRegion ) const
// -----------------------------------------------------------------------
+void OutputDevice::SetMapMode()
+{
+ DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
+
+ if ( mpMetaFile )
+ mpMetaFile->AddAction( new MetaMapModeAction( MapMode() ) );
+
+ if ( mbMap || !maMapMode.IsDefault() )
+ {
+ mbMap = FALSE;
+ maMapMode = MapMode();
+
+ // create new objects (clip region werden nicht neu skaliert)
+ mbNewFont = TRUE;
+ mbInitFont = TRUE;
+ if ( GetOutDevType() == OUTDEV_WINDOW )
+ {
+ if ( ((Window*)this)->mpCursor )
+ ((Window*)this)->mpCursor->ImplNew();
+ }
+
+ // #106426# Adapt logical offset when changing mapmode
+ mnOutOffLogicX = mnOutOffOrigX; // no mapping -> equal offsets
+ mnOutOffLogicY = mnOutOffOrigY;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
+{
+ DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
+
+ BOOL bRelMap = (rNewMapMode.GetMapUnit() == MAP_RELATIVE);
+
+ if ( mpMetaFile )
+ {
+ mpMetaFile->AddAction( new MetaMapModeAction( rNewMapMode ) );
+#ifdef DBG_UTIL
+ if ( GetOutDevType() != OUTDEV_PRINTER )
+ DBG_ASSERTWARNING( bRelMap, "Please record only relative MapModes!" );
+#endif
+ }
+
+ // Ist der MapMode der gleiche wie vorher, dann mache nichts
+ if ( maMapMode == rNewMapMode )
+ return;
+
+ // Ist Default-MapMode, dann bereche nichts
+ BOOL bOldMap = mbMap;
+ mbMap = !rNewMapMode.IsDefault();
+ if ( mbMap )
+ {
+ // Falls nur der Orign umgesetzt wird, dann scaliere nichts neu
+ if ( (rNewMapMode.GetMapUnit() == maMapMode.GetMapUnit()) &&
+ (rNewMapMode.GetScaleX() == maMapMode.GetScaleX()) &&
+ (rNewMapMode.GetScaleY() == maMapMode.GetScaleY()) &&
+ (bOldMap == mbMap) )
+ {
+ // Offset setzen
+ Point aOrigin = rNewMapMode.GetOrigin();
+ maMapRes.mnMapOfsX = aOrigin.X();
+ maMapRes.mnMapOfsY = aOrigin.Y();
+ maMapMode = rNewMapMode;
+ return;
+ }
+ if ( !bOldMap && bRelMap )
+ {
+ maMapRes.mnMapScNumX = 1;
+ maMapRes.mnMapScNumY = 1;
+ maMapRes.mnMapScDenomX = mnDPIX;
+ maMapRes.mnMapScDenomY = mnDPIY;
+ maMapRes.mnMapOfsX = 0;
+ maMapRes.mnMapOfsY = 0;
+ }
+
+ // Neue MapMode-Aufloesung berechnen
+ ImplCalcMapResolution( rNewMapMode, mnDPIX, mnDPIY, maMapRes, maThresRes );
+ }
+
+ // Neuen MapMode setzen
+ if ( bRelMap )
+ {
+ Point aOrigin( maMapRes.mnMapOfsX, maMapRes.mnMapOfsY );
+ // aScale? = maMapMode.GetScale?() * rNewMapMode.GetScale?()
+ Fraction aScaleX = ImplMakeFraction( maMapMode.GetScaleX().GetNumerator(),
+ rNewMapMode.GetScaleX().GetNumerator(),
+ maMapMode.GetScaleX().GetDenominator(),
+ rNewMapMode.GetScaleX().GetDenominator() );
+ Fraction aScaleY = ImplMakeFraction( maMapMode.GetScaleY().GetNumerator(),
+ rNewMapMode.GetScaleY().GetNumerator(),
+ maMapMode.GetScaleY().GetDenominator(),
+ rNewMapMode.GetScaleY().GetDenominator() );
+ maMapMode.SetOrigin( aOrigin );
+ maMapMode.SetScaleX( aScaleX );
+ maMapMode.SetScaleY( aScaleY );
+ }
+ else
+ maMapMode = rNewMapMode;
+
+ // create new objects (clip region werden nicht neu skaliert)
+ mbNewFont = TRUE;
+ mbInitFont = TRUE;
+ if ( GetOutDevType() == OUTDEV_WINDOW )
+ {
+ if ( ((Window*)this)->mpCursor )
+ ((Window*)this)->mpCursor->ImplNew();
+ }
+
+ // #106426# Adapt logical offset when changing mapmode
+ mnOutOffLogicX = ImplPixelToLogic( mnOutOffOrigX, mnDPIX,
+ maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX,
+ maThresRes.mnThresPixToLogX );
+ mnOutOffLogicY = ImplPixelToLogic( mnOutOffOrigY, mnDPIY,
+ maMapRes.mnMapScNumY, maMapRes.mnMapScDenomY,
+ maThresRes.mnThresPixToLogY );
+}
+
+// -----------------------------------------------------------------------
+
+void OutputDevice::SetRelativeMapMode( const MapMode& rNewMapMode )
+{
+ DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
+
+ // Ist der MapMode der gleiche wie vorher, dann mache nichts
+ if ( maMapMode == rNewMapMode )
+ return;
+
+ MapUnit eOld = maMapMode.GetMapUnit();
+ MapUnit eNew = rNewMapMode.GetMapUnit();
+
+ // a?F = rNewMapMode.GetScale?() / maMapMode.GetScale?()
+ Fraction aXF = ImplMakeFraction( rNewMapMode.GetScaleX().GetNumerator(),
+ maMapMode.GetScaleX().GetDenominator(),
+ rNewMapMode.GetScaleX().GetDenominator(),
+ maMapMode.GetScaleX().GetNumerator() );
+ Fraction aYF = ImplMakeFraction( rNewMapMode.GetScaleY().GetNumerator(),
+ maMapMode.GetScaleY().GetDenominator(),
+ rNewMapMode.GetScaleY().GetDenominator(),
+ maMapMode.GetScaleY().GetNumerator() );
+
+ Point aPt( LogicToLogic( Point(), NULL, &rNewMapMode ) );
+ if ( eNew != eOld )
+ {
+ if ( eOld > MAP_PIXEL )
+ {
+ DBG_ERRORFILE( "Not implemented MapUnit" )
+ }
+ else if ( eNew > MAP_PIXEL )
+ {
+ DBG_ERRORFILE( "Not implemented MapUnit" )
+ }
+ else
+ {
+ Fraction aF( aImplNumeratorAry[eNew] * aImplDenominatorAry[eOld],
+ aImplNumeratorAry[eOld] * aImplDenominatorAry[eNew] );
+
+ // a?F = a?F * aF
+ aXF = ImplMakeFraction( aXF.GetNumerator(), aF.GetNumerator(),
+ aXF.GetDenominator(), aF.GetDenominator() );
+ aYF = ImplMakeFraction( aYF.GetNumerator(), aF.GetNumerator(),
+ aYF.GetDenominator(), aF.GetDenominator() );
+ if ( eOld == MAP_PIXEL )
+ {
+ aXF *= Fraction( mnDPIX, 1 );
+ aYF *= Fraction( mnDPIY, 1 );
+ }
+ else if ( eNew == MAP_PIXEL )
+ {
+ aXF *= Fraction( 1, mnDPIX );
+ aYF *= Fraction( 1, mnDPIY );
+ }
+ }
+ }
+
+ MapMode aNewMapMode( MAP_RELATIVE, Point( -aPt.X(), -aPt.Y() ), aXF, aYF );
+ SetMapMode( aNewMapMode );
+
+ if ( eNew != eOld )
+ maMapMode = rNewMapMode;
+
+ // #106426# Adapt logical offset when changing mapmode
+ mnOutOffLogicX = ImplPixelToLogic( mnOutOffOrigX, mnDPIX,
+ maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX,
+ maThresRes.mnThresPixToLogX );
+ mnOutOffLogicY = ImplPixelToLogic( mnOutOffOrigY, mnDPIY,
+ maMapRes.mnMapScNumY, maMapRes.mnMapScDenomY,
+ maThresRes.mnThresPixToLogY );
+}
+
+// -----------------------------------------------------------------------
+
Point OutputDevice::LogicToPixel( const Point& rLogicPt ) const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -1051,21 +1067,19 @@ Polygon OutputDevice::LogicToPixel( const Polygon& rLogicPoly ) const
Polygon aPoly( rLogicPoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
-#ifdef WIN
- Point huge* pPointAry = (Point huge*)aPoly.ImplGetPointAry();
-#else
- Point* pPointAry = aPoly.ImplGetPointAry();
-#endif
+ const Point* pPointAry = aPoly.GetConstPointAry();
for ( i = 0; i < nPoints; i++ )
{
- Point* pPt = &(pPointAry[i]);
- pPt->X() = ImplLogicToPixel( pPt->X() + maMapRes.mnMapOfsX, mnDPIX,
- maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX,
- maThresRes.mnThresLogToPixX )+mnOutOffOrigX;
- pPt->Y() = ImplLogicToPixel( pPt->Y() + maMapRes.mnMapOfsY, mnDPIY,
- maMapRes.mnMapScNumY, maMapRes.mnMapScDenomY,
- maThresRes.mnThresLogToPixY )+mnOutOffOrigY;
+ const Point* pPt = &(pPointAry[i]);
+ Point aPt;
+ aPt.X() = ImplLogicToPixel( pPt->X() + maMapRes.mnMapOfsX, mnDPIX,
+ maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX,
+ maThresRes.mnThresLogToPixX )+mnOutOffOrigX;
+ aPt.Y() = ImplLogicToPixel( pPt->Y() + maMapRes.mnMapOfsY, mnDPIY,
+ maMapRes.mnMapScNumY, maMapRes.mnMapScDenomY,
+ maThresRes.mnThresLogToPixY )+mnOutOffOrigY;
+ aPoly[i] = aPt;
}
return aPoly;
@@ -1227,21 +1241,19 @@ Polygon OutputDevice::LogicToPixel( const Polygon& rLogicPoly,
Polygon aPoly( rLogicPoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
-#ifdef WIN
- Point huge* pPointAry = (Point huge*)aPoly.ImplGetPointAry();
-#else
- Point* pPointAry = aPoly.ImplGetPointAry();
-#endif
+ const Point* pPointAry = aPoly.GetConstPointAry();
for ( i = 0; i < nPoints; i++ )
{
- Point* pPt = &(pPointAry[i]);
- pPt->X() = ImplLogicToPixel( pPt->X() + aMapRes.mnMapOfsX, mnDPIX,
- aMapRes.mnMapScNumX, aMapRes.mnMapScDenomX,
- aThresRes.mnThresLogToPixX )+mnOutOffOrigX;
- pPt->Y() = ImplLogicToPixel( pPt->Y() + aMapRes.mnMapOfsY, mnDPIY,
- aMapRes.mnMapScNumY, aMapRes.mnMapScDenomY,
- aThresRes.mnThresLogToPixY )+mnOutOffOrigY;
+ const Point* pPt = &(pPointAry[i]);
+ Point aPt;
+ aPt.X() = ImplLogicToPixel( pPt->X() + aMapRes.mnMapOfsX, mnDPIX,
+ aMapRes.mnMapScNumX, aMapRes.mnMapScDenomX,
+ aThresRes.mnThresLogToPixX )+mnOutOffOrigX;
+ aPt.Y() = ImplLogicToPixel( pPt->Y() + aMapRes.mnMapOfsY, mnDPIY,
+ aMapRes.mnMapScNumY, aMapRes.mnMapScDenomY,
+ aThresRes.mnThresLogToPixY )+mnOutOffOrigY;
+ aPoly[i] = aPt;
}
return aPoly;
@@ -1318,12 +1330,12 @@ Point OutputDevice::PixelToLogic( const Point& rDevicePt ) const
if ( !mbMap )
return rDevicePt;
- return Point( ImplPixelToLogic( rDevicePt.X()-mnOutOffOrigX, mnDPIX,
+ return Point( ImplPixelToLogic( rDevicePt.X(), mnDPIX,
maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX,
- maThresRes.mnThresPixToLogX ) - maMapRes.mnMapOfsX,
- ImplPixelToLogic( rDevicePt.Y()-mnOutOffOrigY, mnDPIY,
+ maThresRes.mnThresPixToLogX ) - maMapRes.mnMapOfsX - mnOutOffLogicX,
+ ImplPixelToLogic( rDevicePt.Y(), mnDPIY,
maMapRes.mnMapScNumY, maMapRes.mnMapScDenomY,
- maThresRes.mnThresPixToLogY ) - maMapRes.mnMapOfsY );
+ maThresRes.mnThresPixToLogY ) - maMapRes.mnMapOfsY - mnOutOffLogicY );
}
// -----------------------------------------------------------------------
@@ -1352,18 +1364,18 @@ Rectangle OutputDevice::PixelToLogic( const Rectangle& rDeviceRect ) const
if ( !mbMap || rDeviceRect.IsEmpty() )
return rDeviceRect;
- return Rectangle( ImplPixelToLogic( rDeviceRect.Left()-mnOutOffOrigX, mnDPIX,
+ return Rectangle( ImplPixelToLogic( rDeviceRect.Left(), mnDPIX,
maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX,
- maThresRes.mnThresPixToLogX ) - maMapRes.mnMapOfsX,
- ImplPixelToLogic( rDeviceRect.Top()-mnOutOffOrigY, mnDPIY,
+ maThresRes.mnThresPixToLogX ) - maMapRes.mnMapOfsX - mnOutOffLogicX,
+ ImplPixelToLogic( rDeviceRect.Top(), mnDPIY,
maMapRes.mnMapScNumY, maMapRes.mnMapScDenomY,
- maThresRes.mnThresPixToLogY ) - maMapRes.mnMapOfsY,
- ImplPixelToLogic( rDeviceRect.Right()-mnOutOffOrigX, mnDPIX,
+ maThresRes.mnThresPixToLogY ) - maMapRes.mnMapOfsY - mnOutOffLogicY,
+ ImplPixelToLogic( rDeviceRect.Right(), mnDPIX,
maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX,
- maThresRes.mnThresPixToLogX ) - maMapRes.mnMapOfsX,
- ImplPixelToLogic( rDeviceRect.Bottom()-mnOutOffOrigY, mnDPIY,
+ maThresRes.mnThresPixToLogX ) - maMapRes.mnMapOfsX - mnOutOffLogicX,
+ ImplPixelToLogic( rDeviceRect.Bottom(), mnDPIY,
maMapRes.mnMapScNumY, maMapRes.mnMapScDenomY,
- maThresRes.mnThresPixToLogY ) - maMapRes.mnMapOfsY );
+ maThresRes.mnThresPixToLogY ) - maMapRes.mnMapOfsY - mnOutOffLogicY );
}
// -----------------------------------------------------------------------
@@ -1381,21 +1393,19 @@ Polygon OutputDevice::PixelToLogic( const Polygon& rDevicePoly ) const
Polygon aPoly( rDevicePoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
-#ifdef WIN
- Point huge* pPointAry = (Point huge*)aPoly.ImplGetPointAry();
-#else
- Point* pPointAry = aPoly.ImplGetPointAry();
-#endif
+ const Point* pPointAry = aPoly.GetConstPointAry();
for ( i = 0; i < nPoints; i++ )
{
- Point* pPt = &(pPointAry[i]);
- pPt->X() = ImplPixelToLogic( pPt->X()-mnOutOffOrigX, mnDPIX,
- maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX,
- maThresRes.mnThresPixToLogX ) - maMapRes.mnMapOfsX;
- pPt->Y() = ImplPixelToLogic( pPt->Y()-mnOutOffOrigY, mnDPIY,
- maMapRes.mnMapScNumY, maMapRes.mnMapScDenomY,
- maThresRes.mnThresPixToLogY ) - maMapRes.mnMapOfsY;
+ const Point* pPt = &(pPointAry[i]);
+ Point aPt;
+ aPt.X() = ImplPixelToLogic( pPt->X(), mnDPIX,
+ maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX,
+ maThresRes.mnThresPixToLogX ) - maMapRes.mnMapOfsX - mnOutOffLogicX;
+ aPt.Y() = ImplPixelToLogic( pPt->Y(), mnDPIY,
+ maMapRes.mnMapScNumY, maMapRes.mnMapScDenomY,
+ maThresRes.mnThresPixToLogY ) - maMapRes.mnMapOfsY - mnOutOffLogicY;
+ aPoly[i] = aPt;
}
return aPoly;
@@ -1477,12 +1487,12 @@ Point OutputDevice::PixelToLogic( const Point& rDevicePt,
ImplThresholdRes aThresRes;
ImplCalcMapResolution( rMapMode, mnDPIX, mnDPIY, aMapRes, aThresRes );
- return Point( ImplPixelToLogic( rDevicePt.X()-mnOutOffOrigX, mnDPIX,
+ return Point( ImplPixelToLogic( rDevicePt.X(), mnDPIX,
aMapRes.mnMapScNumX, aMapRes.mnMapScDenomX,
- aThresRes.mnThresPixToLogX ) - aMapRes.mnMapOfsX,
- ImplPixelToLogic( rDevicePt.Y()-mnOutOffOrigY, mnDPIY,
+ aThresRes.mnThresPixToLogX ) - aMapRes.mnMapOfsX - mnOutOffLogicX,
+ ImplPixelToLogic( rDevicePt.Y(), mnDPIY,
aMapRes.mnMapScNumY, aMapRes.mnMapScDenomY,
- aThresRes.mnThresPixToLogY ) - aMapRes.mnMapOfsY );
+ aThresRes.mnThresPixToLogY ) - aMapRes.mnMapOfsY - mnOutOffLogicY );
}
// -----------------------------------------------------------------------
@@ -1525,18 +1535,18 @@ Rectangle OutputDevice::PixelToLogic( const Rectangle& rDeviceRect,
ImplThresholdRes aThresRes;
ImplCalcMapResolution( rMapMode, mnDPIX, mnDPIY, aMapRes, aThresRes );
- return Rectangle( ImplPixelToLogic( rDeviceRect.Left()-mnOutOffOrigX, mnDPIX,
+ return Rectangle( ImplPixelToLogic( rDeviceRect.Left(), mnDPIX,
aMapRes.mnMapScNumX, aMapRes.mnMapScDenomX,
- aThresRes.mnThresPixToLogX ) - aMapRes.mnMapOfsX,
- ImplPixelToLogic( rDeviceRect.Top()-mnOutOffOrigY, mnDPIY,
+ aThresRes.mnThresPixToLogX ) - aMapRes.mnMapOfsX - mnOutOffLogicX,
+ ImplPixelToLogic( rDeviceRect.Top(), mnDPIY,
aMapRes.mnMapScNumY, aMapRes.mnMapScDenomY,
- aThresRes.mnThresPixToLogY ) - aMapRes.mnMapOfsY,
- ImplPixelToLogic( rDeviceRect.Right()-mnOutOffOrigX, mnDPIX,
+ aThresRes.mnThresPixToLogY ) - aMapRes.mnMapOfsY - mnOutOffLogicY,
+ ImplPixelToLogic( rDeviceRect.Right(), mnDPIX,
aMapRes.mnMapScNumX, aMapRes.mnMapScDenomX,
- aThresRes.mnThresPixToLogX ) - aMapRes.mnMapOfsX,
- ImplPixelToLogic( rDeviceRect.Bottom()-mnOutOffOrigY, mnDPIY,
+ aThresRes.mnThresPixToLogX ) - aMapRes.mnMapOfsX - mnOutOffLogicX,
+ ImplPixelToLogic( rDeviceRect.Bottom(), mnDPIY,
aMapRes.mnMapScNumY, aMapRes.mnMapScDenomY,
- aThresRes.mnThresPixToLogY ) - aMapRes.mnMapOfsY );
+ aThresRes.mnThresPixToLogY ) - aMapRes.mnMapOfsY - mnOutOffLogicY );
}
// -----------------------------------------------------------------------
@@ -1561,21 +1571,19 @@ Polygon OutputDevice::PixelToLogic( const Polygon& rDevicePoly,
Polygon aPoly( rDevicePoly );
// Pointer auf das Point-Array holen (Daten werden kopiert)
-#ifdef WIN
- Point huge* pPointAry = (Point huge*)aPoly.ImplGetPointAry();
-#else
- Point* pPointAry = aPoly.ImplGetPointAry();
-#endif
+ const Point* pPointAry = aPoly.GetConstPointAry();
for ( i = 0; i < nPoints; i++ )
{
- Point* pPt = &(pPointAry[i]);
- pPt->X() = ImplPixelToLogic( pPt->X()-mnOutOffOrigX, mnDPIX,
- aMapRes.mnMapScNumX, aMapRes.mnMapScDenomX,
- aThresRes.mnThresPixToLogX ) - aMapRes.mnMapOfsX;
- pPt->Y() = ImplPixelToLogic( pPt->Y()-mnOutOffOrigY, mnDPIY,
- aMapRes.mnMapScNumY, aMapRes.mnMapScDenomY,
- aThresRes.mnThresPixToLogY ) - aMapRes.mnMapOfsY;
+ const Point* pPt = &(pPointAry[i]);
+ Point aPt;
+ aPt.X() = ImplPixelToLogic( pPt->X(), mnDPIX,
+ aMapRes.mnMapScNumX, aMapRes.mnMapScDenomX,
+ aThresRes.mnThresPixToLogX ) - aMapRes.mnMapOfsX - mnOutOffLogicX;
+ aPt.Y() = ImplPixelToLogic( pPt->Y(), mnDPIY,
+ aMapRes.mnMapScNumY, aMapRes.mnMapScDenomY,
+ aThresRes.mnThresPixToLogY ) - aMapRes.mnMapOfsY - mnOutOffLogicY;
+ aPoly[i] = aPt;
}
return aPoly;
@@ -2090,8 +2098,15 @@ long OutputDevice::LogicToLogic( long nLongSource,
void OutputDevice::SetPixelOffset( const Size& rOffset )
{
- mnOutOffOrigX = rOffset.Width();
- mnOutOffOrigY = rOffset.Height();
+ mnOutOffOrigX = rOffset.Width();
+ mnOutOffOrigY = rOffset.Height();
+
+ mnOutOffLogicX = ImplPixelToLogic( mnOutOffOrigX, mnDPIX,
+ maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX,
+ maThresRes.mnThresPixToLogX );
+ mnOutOffLogicY = ImplPixelToLogic( mnOutOffOrigY, mnDPIY,
+ maMapRes.mnMapScNumY, maMapRes.mnMapScDenomY,
+ maThresRes.mnThresPixToLogY );
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 278f88f892f2..0716cffc08b7 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: pdfwriter_impl.cxx,v $
*
- * $Revision: 1.46 $
+ * $Revision: 1.47 $
*
- * last change: $Author: pl $ $Date: 2002-11-20 14:37:06 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:01 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -292,11 +292,33 @@ bool PDFWriterImpl::PDFPage::emit(sal_Int32 nParentObject )
return m_pWriter->writeBuffer( aLine.getStr(), aLine.getLength() );
}
+namespace vcl
+{
+template < class GEOMETRY >
+GEOMETRY lcl_convert( const MapMode& _rSource, const MapMode& _rDest, OutputDevice* _pPixelConversion, const GEOMETRY& _rObject )
+{
+ GEOMETRY aPoint;
+ if ( MAP_PIXEL == _rSource.GetMapUnit() )
+ {
+ aPoint = _pPixelConversion->PixelToLogic( _rObject, _rDest );
+ }
+ else
+ {
+ aPoint = OutputDevice::LogicToLogic( _rObject, _rSource, _rDest );
+ }
+ return aPoint;
+}
+}
+
void PDFWriterImpl::PDFPage::appendPoint( const Point& rPoint, OStringBuffer& rBuffer, bool bNeg )
{
- Point aPoint = OutputDevice::LogicToLogic( rPoint,
- m_pWriter->m_aGraphicsStack.front().m_aMapMode,
- m_pWriter->m_aMapMode );
+ Point aPoint( lcl_convert(
+ m_pWriter->m_aGraphicsStack.front().m_aMapMode,
+ m_pWriter->m_aMapMode,
+ m_pWriter->getReferenceDevice(),
+ rPoint
+ ) );
+
sal_Int32 nValue = aPoint.X();
if( bNeg )
nValue = -nValue;
@@ -348,9 +370,11 @@ void PDFWriterImpl::PDFPage::appendRect( const Rectangle& rRect, OStringBuffer&
void PDFWriterImpl::PDFPage::convertRect( Rectangle& rRect )
{
- Rectangle aConvertRect = OutputDevice::LogicToLogic( rRect,
- m_pWriter->getMapMode(),
- m_pWriter->m_aMapMode );
+ Rectangle aConvertRect( lcl_convert( m_pWriter->m_aGraphicsStack.front().m_aMapMode,
+ m_pWriter->m_aMapMode,
+ m_pWriter->getReferenceDevice(),
+ rRect
+ ) );
sal_Int32 nMirror = m_nPageHeight ? m_nPageHeight : m_pWriter->m_nInheritedPageHeight;
rRect = Rectangle( Point( aConvertRect.BottomLeft().X(), 10*nMirror-aConvertRect.BottomLeft().Y() ),
aConvertRect.GetSize() );
@@ -386,9 +410,10 @@ void PDFWriterImpl::PDFPage::appendMappedLength( sal_Int32 nLength, OStringBuffe
nLength = -nLength;
}
- Size aSize = OutputDevice::LogicToLogic( Size( nLength, nLength ),
- m_pWriter->m_aGraphicsStack.front().m_aMapMode,
- m_pWriter->m_aMapMode );
+ Size aSize( lcl_convert( m_pWriter->m_aGraphicsStack.front().m_aMapMode,
+ m_pWriter->m_aMapMode,
+ m_pWriter->getReferenceDevice(),
+ Size( nLength, nLength ) ) );
sal_Int32 nInt = ( bVertical ? aSize.Height() : aSize.Width() ) / 10;
sal_Int32 nDecimal = ( bVertical ? aSize.Height() : aSize.Width() ) % 10;
@@ -402,10 +427,10 @@ void PDFWriterImpl::PDFPage::appendMappedLength( sal_Int32 nLength, OStringBuffe
void PDFWriterImpl::PDFPage::appendMappedLength( double fLength, OStringBuffer& rBuffer, bool bVertical )
{
- Size aSize = OutputDevice::LogicToLogic( Size( 1000, 1000 ),
- m_pWriter->m_aGraphicsStack.front().m_aMapMode,
- m_pWriter->m_aMapMode );
-
+ Size aSize( lcl_convert( m_pWriter->m_aGraphicsStack.front().m_aMapMode,
+ m_pWriter->m_aMapMode,
+ m_pWriter->getReferenceDevice(),
+ Size( 1000, 1000 ) ) );
fLength *= (double)(bVertical ? aSize.Height() : aSize.Width()) / 10000.0;
appendDouble( fLength, rBuffer );
}
@@ -676,7 +701,7 @@ ImplDevFontList* PDFWriterImpl::filterDevFontList( ImplDevFontList* pFontList )
pNewData->meWidthType = m_aBuiltinFonts[i].m_eWidthType;
pNewData->meType = TYPE_SCALABLE;
pNewData->mnVerticalOrientation = 0;
- pNewData->mbOrientation = FALSE;
+ pNewData->mbOrientation = TRUE;
pNewData->mbDevice = TRUE;
pNewData->mnQuality = 50000;
pNewData->mbSubsettable = FALSE;
@@ -724,48 +749,62 @@ void PDFWriterImpl::getFontMetric( ImplFontSelectData* pSelect, ImplFontMetricDa
// -----------------------------------------------------------------------
+namespace vcl {
+
class PDFSalLayout : public GenericSalLayout
{
- const String maText;
+ PDFWriterImpl& mrPDFWriterImpl;
+ const PDFWriterImpl::BuiltinFont& mrBuiltinFont;
+ bool mbIsSymbolFont;
long mnPixelPerEM;
- const PDFWriterImpl::BuiltinFont& mrFont;
+ String maOrigText;
public:
- PDFSalLayout( ImplLayoutArgs&, const String&,
- const PDFWriterImpl::BuiltinFont&, long nPixelPerEM );
+ PDFSalLayout( PDFWriterImpl&,
+ const PDFWriterImpl::BuiltinFont&,
+ long nPixelPerEM, int nOrientation );
- virtual bool LayoutText( ImplLayoutArgs& rArgs );
+ void SetText( const String& rText ) { maOrigText = rText; }
+ virtual bool LayoutText( ImplLayoutArgs& );
+ virtual void InitFont() const;
virtual void DrawText( SalGraphics& ) const;
};
+}
+
// -----------------------------------------------------------------------
-PDFSalLayout::PDFSalLayout( ImplLayoutArgs& rArgs, const String& rStr,
- const PDFWriterImpl::BuiltinFont& rFont, long nPixelPerEM )
-: GenericSalLayout( rArgs ),
- maText( rStr ),
- mrFont( rFont ),
+PDFSalLayout::PDFSalLayout( PDFWriterImpl& rPDFWriterImpl,
+ const PDFWriterImpl::BuiltinFont& rBuiltinFont,
+ long nPixelPerEM, int nOrientation )
+: mrPDFWriterImpl( rPDFWriterImpl ),
+ mrBuiltinFont( rBuiltinFont ),
mnPixelPerEM( nPixelPerEM )
-{}
+{
+ mbIsSymbolFont = (rBuiltinFont.m_eCharSet == RTL_TEXTENCODING_SYMBOL);
+ SetOrientation( nOrientation );
+}
// -----------------------------------------------------------------------
bool PDFSalLayout::LayoutText( ImplLayoutArgs& rArgs )
{
+ const String aText( rArgs.mpStr+rArgs.mnMinCharPos, rArgs.mnEndCharPos-rArgs.mnMinCharPos );
+ SetText( aText );
SetUnitsPerPixel( 1000 );
Point aNewPos( 0, 0 );
- for( int nGlyphCount = 0;; ++nGlyphCount )
+ for(;;)
{
- int nLogicalIndex;
+ int nCharPos;
bool bRightToLeft;
- if( !rArgs.GetNextPos( &nLogicalIndex, &bRightToLeft ) )
+ if( !rArgs.GetNextPos( &nCharPos, &bRightToLeft ) )
break;
- sal_Unicode cChar = rArgs.mpStr[ nLogicalIndex ];
+ sal_Unicode cChar = rArgs.mpStr[ nCharPos ];
if( cChar & 0xff00 )
{
// some characters can be used by conversion
- if( mrFont.m_eCharSet == RTL_TEXTENCODING_SYMBOL && cChar >= 0xf000 )
+ if( (cChar >= 0xf000) && mbIsSymbolFont )
cChar -= 0xf000;
else
{
@@ -775,105 +814,57 @@ bool PDFSalLayout::LayoutText( ImplLayoutArgs& rArgs )
}
}
DBG_ASSERT( cChar < 256, "invalid character index requested for builtin font" );
- if( cChar & 0xff00 ) // not so good
- cChar = 0;
-#if 0
- // TODO: find out if builtin font contains the char
- // update fallback_runs if needed
- if( mrFont.HasGlyph( cChar ) )
+ if( cChar & 0xff00 )
+ {
+ cChar = 0; // NotDef glyph
rArgs.NeedFallback( nCharPos, bRightToLeft );
-#endif
+ }
- long nGlyphWidth = (long)mrFont.m_aWidths[cChar] * mnPixelPerEM;
+ long nGlyphWidth = (long)mrBuiltinFont.m_aWidths[cChar] * mnPixelPerEM;
long nGlyphFlags = (nGlyphWidth > 0) ? 0 : GlyphItem::IS_IN_CLUSTER;
if( bRightToLeft )
nGlyphFlags |= GlyphItem::IS_RTL_GLYPH;
- GlyphItem aGI( nLogicalIndex, cChar, aNewPos, nGlyphFlags, nGlyphWidth );
+ GlyphItem aGI( nCharPos, cChar, aNewPos, nGlyphFlags, nGlyphWidth );
AppendGlyph( aGI );
aNewPos.X() += nGlyphWidth;
}
- if( rArgs.mpDXArray )
- ApplyDXArray( rArgs.mpDXArray );
- if( rArgs.mnLayoutWidth )
- Justify( rArgs.mnLayoutWidth );
- return false;
+ return true;
+}
+
+// -----------------------------------------------------------------------
+
+void PDFSalLayout::InitFont() const
+{
+ // TODO: recreate font with all its attributes
}
// -----------------------------------------------------------------------
void PDFSalLayout::DrawText( SalGraphics& rSalGraphics ) const
{
- // TODO
- DBG_ASSERT( false, "PDFSalLayout::DrawText() not implemented yet" );
+ mrPDFWriterImpl.drawLayout( *const_cast<PDFSalLayout*>(this), maOrigText, true );
}
// -----------------------------------------------------------------------
-SalLayout* PDFWriterImpl::createSalLayout( ImplFontSelectData* pSelect, ImplLayoutArgs& rArgs ) const
+SalLayout* PDFWriterImpl::GetTextLayout( ImplLayoutArgs& rArgs, ImplFontSelectData* pSelect )
{
+ DBG_ASSERT( (pSelect->mpFontData != NULL),
+ "PDFWriterImpl::GetTextLayout mpFontData is NULL" );
+
for( unsigned int n = 0; n < sizeof(m_aBuiltinFonts)/sizeof(m_aBuiltinFonts[0]); n++ )
{
if( pSelect->mpFontData->mpSysData != (void*)&m_aBuiltinFonts[n] )
continue;
- const String aText( rArgs.mpStr+rArgs.mnMinCharPos, rArgs.mnEndCharPos-rArgs.mnMinCharPos );
long nPixelPerEM = pSelect->mnWidth ? pSelect->mnWidth : pSelect->mnHeight;
- PDFSalLayout& rLayout = *new PDFSalLayout( rArgs, aText, m_aBuiltinFonts[n], nPixelPerEM );
-
-#if 1
- rLayout.SetOrientation( pSelect->mnOrientation );
- rLayout.LayoutText( rArgs );
-#else
- Point aNewPos( 0, 0 );
- for( int nGlyphCount = 0;; ++nGlyphCount )
- {
- int nLogicalIndex;
- bool bRightToLeft;
- if( !rArgs.GetNextPos( &nLogicalIndex, &bRightToLeft ) )
- break;
- sal_Unicode cChar = rArgs.mpStr[ nLogicalIndex ];
- if( cChar & 0xff00 )
- {
- // some characters can be used by conversion
- if( m_aBuiltinFonts[n].m_eCharSet == RTL_TEXTENCODING_SYMBOL && cChar >= 0xf000 )
- cChar -= 0xf000;
- else
- {
- String aString( cChar);
- ByteString aChar( aString, RTL_TEXTENCODING_MS_1252 );
- cChar = ((sal_Unicode)aChar.GetChar( 0 )) & 0x00ff;
- }
- }
- DBG_ASSERT( cChar < 256, "invalid character index requested for builtin font" );
- if( cChar & 0xff00 ) // not so good
- cChar = 0;
-#if 0
- // TODO: find out if builtin font contains the char
- // update fallback_runs if needed
- if( m_aBuiltinFonts[n].HasGlyph( cChar ) )
- rArgs.NeedFallback( nCharPos, bRightToLeft );
-#endif
-
- long nGlyphWidth = (long)m_aBuiltinFonts[n].m_aWidths[cChar] * nPixelPerEM;
- long nGlyphFlags = (nGlyphWidth > 0) ? 0 : GlyphItem::IS_IN_CLUSTER;
- if( bRightToLeft )
- nGlyphFlags |= GlyphItem::IS_RTL_GLYPH;
- GlyphItem aGI( nLogicalIndex, cChar, aNewPos, nGlyphFlags, nGlyphWidth );
- rLayout.AppendGlyph( aGI );
-
- aNewPos.X() += nGlyphWidth;
- }
-
- rLayout.SetUnitsPerPixel( 1000 );
- rLayout.SetOrientation( pSelect->mnOrientation );
- if( rArgs.mpDXArray )
- rLayout.ApplyDXArray( rArgs.mpDXArray );
- if( rArgs.mnLayoutWidth )
- rLayout.Justify( rArgs.mnLayoutWidth );
-#endif
- return &rLayout;
+ int nOrientation = pSelect->mnOrientation;
+ PDFSalLayout* pLayout = new PDFSalLayout( *this, m_aBuiltinFonts[n],
+ nPixelPerEM, nOrientation );
+ pLayout->SetText( rArgs.mpStr );
+ return pLayout;
}
return NULL;
@@ -891,15 +882,15 @@ void PDFWriterImpl::endPage()
{
if( m_aPages.begin() != m_aPages.end() )
{
- if( m_pCodec )
- endCompression();
-
m_aGraphicsStack.clear();
m_aGraphicsStack.push_back( GraphicsState() );
// this should pop the PDF graphics stack if necessary
updateGraphicsState();
+ if( m_pCodec )
+ endCompression();
+
m_aPages.back().endStream();
// reset the default font
@@ -1140,7 +1131,10 @@ bool PDFWriterImpl::emitHatches()
// prepare matrix
const double theta = (double)rHatch.GetAngle() * M_PI / 1800.0;
Size aSize( rHatch.GetDistance(), 0 );
- aSize = OutputDevice::LogicToLogic( aSize, it->m_aMapMode, MapMode( MAP_POINT ) );
+ aSize = lcl_convert( it->m_aMapMode,
+ MapMode( MAP_POINT ),
+ getReferenceDevice(),
+ aSize );
const double scale = (double)aSize.Width();
appendDouble( scale*cos( theta ), aHatchObj );
aHatchObj.append( ' ' );
@@ -1244,10 +1238,10 @@ sal_Int32 PDFWriterImpl::emitBuiltinFont( ImplFontData* pFont )
" /Subtype /Type1\r\n"
" /BaseFont /" );
aLine.append( m_aBuiltinFonts[i].m_pPSName );
- aLine.append( "\r\n"
- " /Encoding /WinAnsiEncoding\r\n"
- ">>\r\n"
- "endobj\r\n\r\n" );
+ aLine.append( "\r\n" );
+ if( m_aBuiltinFonts[i].m_eCharSet != RTL_TEXTENCODING_SYMBOL )
+ aLine.append( " /Encoding /WinAnsiEncoding\r\n" );
+ aLine.append( ">>\r\nendobj\r\n\r\n" );
CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) );
break;
@@ -1374,13 +1368,13 @@ sal_Int32 PDFWriterImpl::emitEmbeddedFont( ImplFontData* pFont )
// if the first four bytes are all ascii hex characters, then binary data
// has to be converted to real binary data
for( nIndex = 0; nIndex < 4 &&
- ! ( ( pFontData[ nBeginBinaryIndex+nIndex ] >= '0' && pFontData[ nBeginBinaryIndex+nIndex ] <= '9' ) ||
- ( pFontData[ nBeginBinaryIndex+nIndex ] >= 'a' && pFontData[ nBeginBinaryIndex+nIndex ] <= 'f' ) ||
- ( pFontData[ nBeginBinaryIndex+nIndex ] >= 'A' && pFontData[ nBeginBinaryIndex+nIndex ] <= 'F' )
- ); ++nIndex )
+ ( ( pFontData[ nBeginBinaryIndex+nIndex ] >= '0' && pFontData[ nBeginBinaryIndex+nIndex ] <= '9' ) ||
+ ( pFontData[ nBeginBinaryIndex+nIndex ] >= 'a' && pFontData[ nBeginBinaryIndex+nIndex ] <= 'f' ) ||
+ ( pFontData[ nBeginBinaryIndex+nIndex ] >= 'A' && pFontData[ nBeginBinaryIndex+nIndex ] <= 'F' )
+ ); ++nIndex )
;
bool bConvertHexData = true;
- if( nIndex > 3 )
+ if( nIndex < 4 )
{
bConvertHexData = false;
nLength2 = nEndBinaryIndex - nBeginBinaryIndex + 1; // include the last byte
@@ -1586,9 +1580,10 @@ sal_Int32 PDFWriterImpl::emitEmbeddedFont( ImplFontData* pFont )
" /Subtype /Type1\r\n"
" /BaseFont /" );
aLine.append( OUStringToOString( aInfo.m_aPSName, osl_getThreadTextEncoding() ) );
- aLine.append( "\r\n"
- " /Encoding /WinAnsiEncoding\r\n"
- " /FirstChar 0\r\n"
+ aLine.append( "\r\n" );
+ if( pFont->meCharSet != RTL_TEXTENCODING_SYMBOL )
+ aLine.append( " /Encoding /WinAnsiEncoding\r\n" );
+ aLine.append( " /FirstChar 0\r\n"
" /LastChar 255\r\n"
" /Widths [ " );
for( int i = 0; i < 256; i++ )
@@ -2957,12 +2952,6 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, US
else if ( nStyle & TEXT_DRAW_VCENTER )
aPos.Y() += (nHeight-(nFormatLines*nTextHeight))/2;
- // font alignment
- if ( eAlign == ALIGN_BOTTOM )
- aPos.Y() -= m_pReferenceDevice->GetFontMetric().GetDescent();
- else if ( eAlign == ALIGN_TOP )
- aPos.Y() += m_pReferenceDevice->GetFontMetric().GetAscent();
-
// draw all lines excluding the last
for ( i = 0; i < nFormatLines; i++ )
{
@@ -3008,12 +2997,6 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, US
else if ( nStyle & TEXT_DRAW_CENTER )
aPos.X() += (nWidth-nTextWidth)/2;
- // font alignment
- if ( eAlign == ALIGN_BOTTOM )
- aPos.Y() -= m_pReferenceDevice->GetFontMetric().GetDescent();
- else if ( eAlign == ALIGN_TOP )
- aPos.Y() += m_pReferenceDevice->GetFontMetric().GetAscent();
-
if ( nStyle & TEXT_DRAW_BOTTOM )
aPos.Y() += nHeight-nTextHeight;
else if ( nStyle & TEXT_DRAW_VCENTER )
@@ -4587,7 +4570,10 @@ void PDFWriterImpl::drawMask( const Point& rDestPoint, const Size& rDestSize, co
sal_Int32 PDFWriterImpl::createGradient( const Gradient& rGradient, const Size& rSize )
{
- Size aPtSize = OutputDevice::LogicToLogic( rSize, m_aGraphicsStack.front().m_aMapMode, MapMode( MAP_POINT ) );
+ Size aPtSize( lcl_convert( m_aGraphicsStack.front().m_aMapMode,
+ MapMode( MAP_POINT ),
+ getReferenceDevice(),
+ rSize ) );
// check if we already have this gradient
for( std::list<GradientEmit>::iterator it = m_aGradients.begin(); it != m_aGradients.end(); ++it )
{
@@ -4746,9 +4732,10 @@ void PDFWriterImpl::drawWallpaper( const Rectangle& rRect, const Wallpaper& rWal
if( rWall.IsBitmap() )
{
aBitmap = rWall.GetBitmap();
- aBmpSize = OutputDevice::LogicToLogic( aBitmap.GetPrefSize(),
- aBitmap.GetPrefMapMode(),
- getMapMode() );
+ aBmpSize = lcl_convert( aBitmap.GetPrefMapMode(),
+ getMapMode(),
+ getReferenceDevice(),
+ aBitmap.GetPrefSize() );
Rectangle aRect( rRect );
if( rWall.IsRect() )
{
@@ -5030,14 +5017,24 @@ void PDFWriterImpl::setClipRegion( const Region& rRegion )
void PDFWriterImpl::moveClipRegion( sal_Int32 nX, sal_Int32 nY )
{
- Point aPoint = OutputDevice::LogicToLogic( Point( nX, nY ), m_aGraphicsStack.front().m_aMapMode, m_aMapMode );
- aPoint -= OutputDevice::LogicToLogic( Point(), m_aGraphicsStack.front().m_aMapMode, m_aMapMode );
+ Point aPoint( lcl_convert( m_aGraphicsStack.front().m_aMapMode,
+ m_aMapMode,
+ getReferenceDevice(),
+ Point( nX, nY ) ) );
+ aPoint -= lcl_convert( m_aGraphicsStack.front().m_aMapMode,
+ m_aMapMode,
+ getReferenceDevice(),
+ Point() );
m_aGraphicsStack.front().m_aClipRegion.Move( nX, nY );
}
bool PDFWriterImpl::intersectClipRegion( const Rectangle& rRect )
{
- Rectangle aRect = OutputDevice::LogicToLogic( rRect, m_aGraphicsStack.front().m_aMapMode, m_aMapMode );
+ Rectangle aRect( lcl_convert( m_aGraphicsStack.front().m_aMapMode,
+ m_aMapMode,
+ getReferenceDevice(),
+ rRect ) );
+
return m_aGraphicsStack.front().m_aClipRegion.Intersect( aRect );
}
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index abc12185f13f..90aed93916be 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: pdfwriter_impl.hxx,v $
*
- * $Revision: 1.21 $
+ * $Revision: 1.22 $
*
- * last change: $Author: pl $ $Date: 2002-10-23 18:30:55 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:01 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -115,8 +115,11 @@ class SvMemoryStream;
namespace vcl
{
+class PDFSalLayout;
+
class PDFWriterImpl
{
+ friend class PDFSalLayout;
public:
// definition of structs
struct BuiltinFont
@@ -479,7 +482,7 @@ public:
/* for OutputDevice: get layout for builtin fonts
*/
bool isBuiltinFont( ImplFontData* pFont ) const;
- SalLayout* createSalLayout( ImplFontSelectData* pFont, ImplLayoutArgs& rArgs ) const;
+ SalLayout* GetTextLayout( ImplLayoutArgs& rArgs, ImplFontSelectData* pFont );
void getFontMetric( ImplFontSelectData* pFont, ImplFontMetricData* pMetric ) const;
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 672ead94d08b..69009f327079 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: print.cxx,v $
*
- * $Revision: 1.39 $
+ * $Revision: 1.40 $
*
- * last change: $Author: ssa $ $Date: 2002-11-20 12:04:16 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -174,9 +174,10 @@ int nImplSysDialog = 0;
// =======================================================================
-#define PAPER_SLOPPY 20
+#define PAPER_SLOPPY 50 // Bigger sloppy value as PaperInfo uses only mm accuracy!
#define PAPER_COUNT 9
+// Use more accurate metric values for Letter/Legal/Tabloid paper formats
static long ImplPaperFormats[PAPER_COUNT*2] =
{
29700, 42000, // A3
@@ -184,9 +185,9 @@ static long ImplPaperFormats[PAPER_COUNT*2] =
14800, 21000, // A5
25000, 35300, // B4
17600, 25000, // B5
- 21600, 27900, // Letter
- 21600, 35600, // Legal
- 27900, 43100, // Tabloid
+ 21590, 27940, // Letter
+ 21590, 35570, // Legal
+ 27960, 43130, // Tabloid
0, 0 // USER
};
@@ -1340,6 +1341,72 @@ USHORT Printer::GetPaperBin() const
// -----------------------------------------------------------------------
+static BOOL ImplPaperSizeEqual( unsigned long nPaperWidth1, unsigned long nPaperHeight1,
+ unsigned long nPaperWidth2, unsigned long nPaperHeight2 )
+{
+ const unsigned long PAPER_ACCURACY = 1; // 1.0 mm accuracy
+
+ return ( (Abs( (short)(nPaperWidth1-nPaperWidth2) ) <= PAPER_ACCURACY ) &&
+ (Abs( (short)(nPaperHeight1-nPaperHeight2) ) <= PAPER_ACCURACY ) );
+}
+
+// -----------------------------------------------------------------------
+
+// Map user paper format to a available printer paper formats
+void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup )
+{
+ ImplJobSetup* pSetupData = aJobSetup.ImplGetData();
+
+ int nLandscapeAngle = GetLandscapeAngle();
+ int nPaperCount = GetPaperInfoCount();
+
+ unsigned long nPaperWidth = pSetupData->mnPaperWidth/100;
+ unsigned long nPaperHeight = pSetupData->mnPaperHeight/100;
+
+ // Alle Papierformate vergleichen und ein passendes raussuchen
+ for ( int i = 0; i < nPaperCount; i++ )
+ {
+ const vcl::PaperInfo& rPaperInfo = GetPaperInfo( i );
+
+ if ( ImplPaperSizeEqual( rPaperInfo.m_nPaperWidth,
+ rPaperInfo.m_nPaperHeight,
+ nPaperWidth,
+ nPaperHeight ) )
+ {
+ pSetupData->meOrientation = ORIENTATION_PORTRAIT;
+ pSetupData->mePaperFormat = ImplGetPaperFormat( rPaperInfo.m_nPaperWidth*100,
+ rPaperInfo.m_nPaperHeight*100 );
+ break;
+ }
+ }
+
+ // If the printer supports landscape orientation, check paper sizes again
+ // with landscape orientation. This is necessary as a printer driver provides
+ // all paper sizes with portrait orientation only!!
+ if ( pSetupData->mePaperFormat == PAPER_USER &&
+ nLandscapeAngle != 0 &&
+ HasSupport( SUPPORT_SET_ORIENTATION ))
+ {
+ for ( int i = 0; i < nPaperCount; i++ )
+ {
+ const vcl::PaperInfo& rPaperInfo = GetPaperInfo( i );
+
+ if ( ImplPaperSizeEqual( rPaperInfo.m_nPaperWidth,
+ rPaperInfo.m_nPaperHeight,
+ nPaperHeight,
+ nPaperWidth ))
+ {
+ pSetupData->meOrientation = ORIENTATION_LANDSCAPE;
+ pSetupData->mePaperFormat = ImplGetPaperFormat( rPaperInfo.m_nPaperWidth*100,
+ rPaperInfo.m_nPaperHeight*100 );
+ break;
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
BOOL Printer::SetPaper( Paper ePaper )
{
if ( mbInPrintPage )
@@ -1365,7 +1432,9 @@ BOOL Printer::SetPaper( Paper ePaper )
#ifndef REMOTE_APPSERVER
ImplReleaseGraphics();
- if ( mpInfoPrinter->SetData( SAL_JOBSET_PAPERSIZE, pSetupData ) )
+ if ( ePaper == PAPER_USER )
+ ImplFindPaperFormatForUserSize( aJobSetup );
+ if ( mpInfoPrinter->SetData( SAL_JOBSET_PAPERSIZE|SAL_JOBSET_ORIENTATION, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
#else
@@ -1417,7 +1486,10 @@ BOOL Printer::SetPaperSizeUser( const Size& rSize )
#ifndef REMOTE_APPSERVER
ImplReleaseGraphics();
- if ( mpInfoPrinter->SetData( SAL_JOBSET_PAPERSIZE, pSetupData ) )
+ ImplFindPaperFormatForUserSize( aJobSetup );
+
+ // Changing the paper size can also change the orientation!
+ if ( mpInfoPrinter->SetData( SAL_JOBSET_PAPERSIZE|SAL_JOBSET_ORIENTATION, pSetupData ) )
{
ImplUpdateJobSetupPaper( aJobSetup );
#else
@@ -1440,6 +1512,7 @@ BOOL Printer::SetPaperSizeUser( const Size& rSize )
return TRUE;
}
+
// -----------------------------------------------------------------------
static const vcl::PaperInfo& ImplGetEmptyPaper()
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index 1c5e737e7dc6..56fd6bae9b89 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: print2.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: thb $ $Date: 2002-12-10 17:28:12 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,6 +62,12 @@
#define _SV_PRINT_CXX
#define _SPOOLPRINTER_EXT
+#include <functional>
+#include <algorithm>
+#include <utility>
+#include <list>
+#include <vector>
+
#ifndef _DEBUG_HXX
#include <tools/debug.hxx>
#endif
@@ -97,334 +103,406 @@
#define MAX_TILE_WIDTH 1024
#define MAX_TILE_HEIGHT 1024
-// -----------------
-// - ImplCheckRect -
-// -----------------
+// -----------
+// - Printer -
+// -----------
-struct ImplCheckRect
+// #i10613# Extracted from Printer::GetPreparedMetaFile
+static bool ImplIsActionSpecial( const MetaAction& rAct )
{
- Rectangle* mpRect;
- MetaAction* mpAct;
- ImplCheckRect* mpNext;
- BOOL mbSpecialOutput;
-
- ImplCheckRect() { }
- ~ImplCheckRect() { delete mpRect; }
- void ImplCreate( MetaAction* pAct, OutputDevice* pOut, BOOL bSpecial );
- BOOL Intersects( const ImplCheckRect& rRect )
- {
- return( mpRect && rRect.mpRect ) ? mpRect->IsOver( *rRect.mpRect ) : FALSE;
- }
-};
-
-// -----------------------------------------------------------------------------
+ bool bRet( false );
+
+ if( META_TRANSPARENT_ACTION == rAct.GetType() )
+ bRet = true;
+ else if( META_FLOATTRANSPARENT_ACTION == rAct.GetType() )
+ bRet = true;
+ else if( META_BMPEX_ACTION == rAct.GetType() )
+ bRet = static_cast<const MetaBmpExAction&>(rAct).GetBitmapEx().IsAlpha() != 0;
+ else if( META_BMPEXSCALE_ACTION == rAct.GetType() )
+ bRet = static_cast<const MetaBmpExScaleAction&>(rAct).GetBitmapEx().IsAlpha() != 0;
+ else if( META_BMPEXSCALEPART_ACTION == rAct.GetType() )
+ bRet = static_cast<const MetaBmpExScalePartAction&>(rAct).GetBitmapEx().IsAlpha() != 0;
+
+ return bRet;
+}
-void ImplCheckRect::ImplCreate( MetaAction* pAct, OutputDevice* pOut, BOOL bSpecial )
+// #i10613# Extracted from ImplCheckRect::ImplCreate
+// Returns true, if given action creates visible (i.e. non-transparent) output
+static bool ImplIsNotTransparent( const MetaAction& rAct, const OutputDevice& rOut )
{
- const long bLineTransparency = ( pOut->GetLineColor().GetTransparency() == 255 );
- const long bFillTransparency = ( pOut->GetFillColor().GetTransparency() == 255 );
-
- mpAct = pAct;
- mpNext = NULL;
- mpRect = NULL;
+ const bool bLineTransparency( rOut.GetLineColor().GetTransparency() == 255 );
+ const bool bFillTransparency( rOut.GetFillColor().GetTransparency() == 255 );
+ bool bRet( false );
- switch( mpAct->GetType() )
+ switch( rAct.GetType() )
{
- case( META_PIXEL_ACTION ):
- mpRect = new Rectangle( ( (MetaPixelAction*) mpAct )->GetPoint(), Size( 1, 1 ) );
- break;
-
- case( META_POINT_ACTION ):
- {
+ case META_POINT_ACTION:
if( !bLineTransparency )
- mpRect = new Rectangle( ( (MetaPointAction*) mpAct )->GetPoint(), Size( 1, 1 ) );
- }
- break;
+ bRet = true;
+ break;
- case( META_LINE_ACTION ):
- {
+ case META_LINE_ACTION:
if( !bLineTransparency )
- {
- MetaLineAction* pA = (MetaLineAction*) mpAct;
- mpRect = new Rectangle( pA->GetStartPoint(), pA->GetEndPoint() );
- }
- }
- break;
+ bRet = true;
+ break;
- case( META_RECT_ACTION ):
- {
+ case META_RECT_ACTION:
if( !bLineTransparency || !bFillTransparency )
- mpRect = new Rectangle( ( (MetaRectAction*) mpAct )->GetRect() );
- }
- break;
+ bRet = true;
+ break;
- case( META_ROUNDRECT_ACTION ):
- {
+ case META_ROUNDRECT_ACTION:
if( !bLineTransparency || !bFillTransparency )
- {
- MetaRoundRectAction* pA = (MetaRoundRectAction*) mpAct;
- mpRect = new Rectangle( Polygon( pA->GetRect(),
- pA->GetHorzRound(),
- pA->GetVertRound() ).GetBoundRect() );
- }
- }
- break;
+ bRet = true;
+ break;
- case( META_ELLIPSE_ACTION ):
- {
+ case META_ELLIPSE_ACTION:
if( !bLineTransparency || !bFillTransparency )
- {
- MetaEllipseAction* pA = (MetaEllipseAction*) mpAct;
- const Rectangle& rRect = pA->GetRect();
- mpRect = new Rectangle( Polygon( rRect.Center(),
- rRect.GetWidth() >> 1,
- rRect.GetHeight() >> 1 ).GetBoundRect() );
- }
- }
- break;
+ bRet = true;
+ break;
- case( META_ARC_ACTION ):
- {
+ case META_ARC_ACTION:
if( !bLineTransparency || !bFillTransparency )
- {
- MetaArcAction* pA = (MetaArcAction*) mpAct;
- mpRect = new Rectangle( Polygon( pA->GetRect(),
- pA->GetStartPoint(),
- pA->GetEndPoint(), POLY_ARC ).GetBoundRect() );
- }
- }
- break;
+ bRet = true;
+ break;
- case( META_PIE_ACTION ):
- {
+ case META_PIE_ACTION:
if( !bLineTransparency || !bFillTransparency )
- {
- MetaPieAction* pA = (MetaPieAction*) mpAct;
- mpRect = new Rectangle( Polygon( pA->GetRect(),
- pA->GetStartPoint(),
- pA->GetEndPoint(), POLY_PIE ).GetBoundRect() );
- }
- }
- break;
+ bRet = true;
+ break;
- case( META_CHORD_ACTION ):
- {
+ case META_CHORD_ACTION:
if( !bLineTransparency || !bFillTransparency )
- {
- MetaChordAction* pA = (MetaChordAction*) mpAct;
- mpRect = new Rectangle( Polygon( pA->GetRect(),
- pA->GetStartPoint(),
- pA->GetEndPoint(), POLY_CHORD ).GetBoundRect() );
- }
- }
- break;
+ bRet = true;
+ break;
- case( META_POLYLINE_ACTION ):
- {
+ case META_POLYLINE_ACTION:
if( !bLineTransparency )
- {
- MetaPolyLineAction* pA = (MetaPolyLineAction*) mpAct;
- mpRect = new Rectangle( pA->GetPolygon().GetBoundRect() );
- }
- }
- break;
+ bRet = true;
+ break;
- case( META_POLYGON_ACTION ):
- {
+ case META_POLYGON_ACTION:
if( !bLineTransparency || !bFillTransparency )
- {
- MetaPolygonAction* pA = (MetaPolygonAction*) mpAct;
- mpRect = new Rectangle( pA->GetPolygon().GetBoundRect() );
- }
- }
- break;
+ bRet = true;
+ break;
- case( META_POLYPOLYGON_ACTION ):
- {
+ case META_POLYPOLYGON_ACTION:
if( !bLineTransparency || !bFillTransparency )
- {
- MetaPolyPolygonAction* pA = (MetaPolyPolygonAction*) mpAct;
- mpRect = new Rectangle( pA->GetPolyPolygon().GetBoundRect() );
- }
- }
- break;
-
- case( META_BMP_ACTION ):
- {
- MetaBmpAction* pA = (MetaBmpAction*) mpAct;
- mpRect = new Rectangle( pA->GetPoint(), pOut->PixelToLogic( pA->GetBitmap().GetSizePixel() ) );
- }
- break;
-
- case( META_BMPSCALE_ACTION ):
- {
- MetaBmpScaleAction* pA = (MetaBmpScaleAction*) mpAct;
- mpRect = new Rectangle( pA->GetPoint(), pA->GetSize() );
- }
- break;
-
- case( META_BMPSCALEPART_ACTION ):
- {
- MetaBmpScalePartAction* pA = (MetaBmpScalePartAction*) mpAct;
- mpRect = new Rectangle( pA->GetDestPoint(), pA->GetDestSize() );
- }
- break;
-
- case( META_BMPEX_ACTION ):
- {
- MetaBmpExAction* pA = (MetaBmpExAction*) mpAct;
- mpRect = new Rectangle( pA->GetPoint(), pOut->PixelToLogic( pA->GetBitmapEx().GetSizePixel() ) );
- }
- break;
+ bRet = true;
+ break;
- case( META_BMPEXSCALE_ACTION ):
+ case META_TEXT_ACTION:
{
- MetaBmpExScaleAction* pA = (MetaBmpExScaleAction*) mpAct;
- mpRect = new Rectangle( pA->GetPoint(), pA->GetSize() );
- }
- break;
+ const MetaTextAction& rTextAct = static_cast<const MetaTextAction&>(rAct);
+ const XubString aString( rTextAct.GetText(), rTextAct.GetIndex(), rTextAct.GetLen() );
- case( META_BMPEXSCALEPART_ACTION ):
- {
- MetaBmpExScalePartAction* pA = (MetaBmpExScalePartAction*) mpAct;
- mpRect = new Rectangle( pA->GetDestPoint(), pA->GetDestSize() );
- }
- break;
-
- case( META_MASK_ACTION ):
- {
- MetaMaskAction* pA = (MetaMaskAction*) mpAct;
- mpRect = new Rectangle( pA->GetPoint(), pOut->PixelToLogic( pA->GetBitmap().GetSizePixel() ) );
+ if( aString.Len() )
+ bRet = true;
}
break;
- case( META_MASKSCALE_ACTION ):
+ case META_TEXTARRAY_ACTION:
{
- MetaMaskScaleAction* pA = (MetaMaskScaleAction*) mpAct;
- mpRect = new Rectangle( pA->GetPoint(), pA->GetSize() );
- }
- break;
+ const MetaTextArrayAction& rTextAct = static_cast<const MetaTextArrayAction&>(rAct);
+ const XubString aString( rTextAct.GetText(), rTextAct.GetIndex(), rTextAct.GetLen() );
- case( META_MASKSCALEPART_ACTION ):
- {
- MetaMaskScalePartAction* pA = (MetaMaskScalePartAction*) mpAct;
- mpRect = new Rectangle( pA->GetDestPoint(), pA->GetDestSize() );
+ if( aString.Len() )
+ bRet = true;
}
break;
- case( META_GRADIENT_ACTION ):
- mpRect = new Rectangle( ( (MetaGradientAction*) mpAct )->GetRect() );
- break;
-
- case( META_GRADIENTEX_ACTION ):
- mpRect = new Rectangle( ( (MetaGradientExAction*) mpAct )->GetPolyPolygon().GetBoundRect() );
- break;
+ case META_PIXEL_ACTION:
+ case META_BMP_ACTION:
+ case META_BMPSCALE_ACTION:
+ case META_BMPSCALEPART_ACTION:
+ case META_BMPEX_ACTION:
+ case META_BMPEXSCALE_ACTION:
+ case META_BMPEXSCALEPART_ACTION:
+ case META_MASK_ACTION:
+ case META_MASKSCALE_ACTION:
+ case META_MASKSCALEPART_ACTION:
+ case META_GRADIENT_ACTION:
+ case META_GRADIENTEX_ACTION:
+ case META_HATCH_ACTION:
+ case META_WALLPAPER_ACTION:
+ case META_TRANSPARENT_ACTION:
+ case META_FLOATTRANSPARENT_ACTION:
+ case META_EPS_ACTION:
+ case META_TEXTRECT_ACTION:
+ case META_STRETCHTEXT_ACTION:
+ case META_TEXTLINE_ACTION:
+ // all other actions: generate non-transparent output
+ bRet = true;
+ break;
- case( META_HATCH_ACTION ):
- mpRect = new Rectangle( ( (MetaHatchAction*) mpAct )->GetPolyPolygon().GetBoundRect() );
- break;
-
- case( META_WALLPAPER_ACTION ):
- mpRect = new Rectangle( ( (MetaWallpaperAction*) mpAct )->GetRect() );
- break;
+ default:
+ break;
+ }
- case( META_TRANSPARENT_ACTION ):
- mpRect = new Rectangle( ( (MetaTransparentAction*) mpAct )->GetPolyPolygon().GetBoundRect() );
- break;
+ return bRet;
+}
- case( META_FLOATTRANSPARENT_ACTION ):
- {
- MetaFloatTransparentAction* pA = (MetaFloatTransparentAction*) mpAct;
- mpRect = new Rectangle( pA->GetPoint(), pA->GetSize() );
- }
- break;
+// #i10613# Extracted from ImplCheckRect::ImplCreate
+static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevice& rOut )
+{
+ Rectangle aActionBounds;
- case( META_EPS_ACTION ):
+ switch( rAct.GetType() )
+ {
+ case META_PIXEL_ACTION:
+ aActionBounds = Rectangle( static_cast<const MetaPixelAction&>(rAct).GetPoint(), Size( 1, 1 ) );
+ break;
+
+ case META_POINT_ACTION:
+ aActionBounds = Rectangle( static_cast<const MetaPointAction&>(rAct).GetPoint(), Size( 1, 1 ) );
+ break;
+
+ case META_LINE_ACTION:
+ aActionBounds = Rectangle( static_cast<const MetaLineAction&>(rAct).GetStartPoint(),
+ static_cast<const MetaLineAction&>(rAct).GetEndPoint() );
+ break;
+
+ case META_RECT_ACTION:
+ aActionBounds = static_cast<const MetaRectAction&>(rAct).GetRect();
+ break;
+
+ case META_ROUNDRECT_ACTION:
+ aActionBounds = Polygon( static_cast<const MetaRoundRectAction&>(rAct).GetRect(),
+ static_cast<const MetaRoundRectAction&>(rAct).GetHorzRound(),
+ static_cast<const MetaRoundRectAction&>(rAct).GetVertRound() ).GetBoundRect();
+ break;
+
+ case META_ELLIPSE_ACTION:
{
- MetaEPSAction* pA = (MetaEPSAction*) mpAct;
- mpRect = new Rectangle( pA->GetPoint(), pA->GetSize() );
+ const Rectangle& rRect = static_cast<const MetaEllipseAction&>(rAct).GetRect();
+ aActionBounds = Polygon( rRect.Center(),
+ rRect.GetWidth() >> 1,
+ rRect.GetHeight() >> 1 ).GetBoundRect();
+ break;
}
- break;
- case( META_TEXT_ACTION ):
+ case META_ARC_ACTION:
+ aActionBounds = Polygon( static_cast<const MetaArcAction&>(rAct).GetRect(),
+ static_cast<const MetaArcAction&>(rAct).GetStartPoint(),
+ static_cast<const MetaArcAction&>(rAct).GetEndPoint(), POLY_ARC ).GetBoundRect();
+ break;
+
+ case META_PIE_ACTION:
+ aActionBounds = Polygon( static_cast<const MetaPieAction&>(rAct).GetRect(),
+ static_cast<const MetaPieAction&>(rAct).GetStartPoint(),
+ static_cast<const MetaPieAction&>(rAct).GetEndPoint(), POLY_PIE ).GetBoundRect();
+ break;
+
+ case META_CHORD_ACTION:
+ aActionBounds = Polygon( static_cast<const MetaChordAction&>(rAct).GetRect(),
+ static_cast<const MetaChordAction&>(rAct).GetStartPoint(),
+ static_cast<const MetaChordAction&>(rAct).GetEndPoint(), POLY_CHORD ).GetBoundRect();
+ break;
+
+ case META_POLYLINE_ACTION:
+ aActionBounds = static_cast<const MetaPolyLineAction&>(rAct).GetPolygon().GetBoundRect();
+ break;
+
+ case META_POLYGON_ACTION:
+ aActionBounds = static_cast<const MetaPolygonAction&>(rAct).GetPolygon().GetBoundRect();
+ break;
+
+ case META_POLYPOLYGON_ACTION:
+ aActionBounds = static_cast<const MetaPolyPolygonAction&>(rAct).GetPolyPolygon().GetBoundRect();
+ break;
+
+ case META_BMP_ACTION:
+ aActionBounds = Rectangle( static_cast<const MetaBmpAction&>(rAct).GetPoint(),
+ rOut.PixelToLogic( static_cast<const MetaBmpAction&>(rAct).GetBitmap().GetSizePixel() ) );
+ break;
+
+ case META_BMPSCALE_ACTION:
+ aActionBounds = Rectangle( static_cast<const MetaBmpScaleAction&>(rAct).GetPoint(),
+ static_cast<const MetaBmpScaleAction&>(rAct).GetSize() );
+ break;
+
+ case META_BMPSCALEPART_ACTION:
+ aActionBounds = Rectangle( static_cast<const MetaBmpScalePartAction&>(rAct).GetDestPoint(),
+ static_cast<const MetaBmpScalePartAction&>(rAct).GetDestSize() );
+ break;
+
+ case META_BMPEX_ACTION:
+ aActionBounds = Rectangle( static_cast<const MetaBmpExAction&>(rAct).GetPoint(),
+ rOut.PixelToLogic( static_cast<const MetaBmpExAction&>(rAct).GetBitmapEx().GetSizePixel() ) );
+ break;
+
+ case META_BMPEXSCALE_ACTION:
+ aActionBounds = Rectangle( static_cast<const MetaBmpExScaleAction&>(rAct).GetPoint(),
+ static_cast<const MetaBmpExScaleAction&>(rAct).GetSize() );
+ break;
+
+ case META_BMPEXSCALEPART_ACTION:
+ aActionBounds = Rectangle( static_cast<const MetaBmpExScalePartAction&>(rAct).GetDestPoint(),
+ static_cast<const MetaBmpExScalePartAction&>(rAct).GetDestSize() );
+ break;
+
+ case META_MASK_ACTION:
+ aActionBounds = Rectangle( static_cast<const MetaMaskAction&>(rAct).GetPoint(),
+ rOut.PixelToLogic( static_cast<const MetaMaskAction&>(rAct).GetBitmap().GetSizePixel() ) );
+ break;
+
+ case META_MASKSCALE_ACTION:
+ aActionBounds = Rectangle( static_cast<const MetaMaskScaleAction&>(rAct).GetPoint(),
+ static_cast<const MetaMaskScaleAction&>(rAct).GetSize() );
+ break;
+
+ case META_MASKSCALEPART_ACTION:
+ aActionBounds = Rectangle( static_cast<const MetaMaskScalePartAction&>(rAct).GetDestPoint(),
+ static_cast<const MetaMaskScalePartAction&>(rAct).GetDestSize() );
+ break;
+
+ case META_GRADIENT_ACTION:
+ aActionBounds = static_cast<const MetaGradientAction&>(rAct).GetRect();
+ break;
+
+ case META_GRADIENTEX_ACTION:
+ aActionBounds = static_cast<const MetaGradientExAction&>(rAct).GetPolyPolygon().GetBoundRect();
+ break;
+
+ case META_HATCH_ACTION:
+ aActionBounds = static_cast<const MetaHatchAction&>(rAct).GetPolyPolygon().GetBoundRect();
+ break;
+
+ case META_WALLPAPER_ACTION:
+ aActionBounds = static_cast<const MetaWallpaperAction&>(rAct).GetRect();
+ break;
+
+ case META_TRANSPARENT_ACTION:
+ aActionBounds = static_cast<const MetaTransparentAction&>(rAct).GetPolyPolygon().GetBoundRect();
+ break;
+
+ case META_FLOATTRANSPARENT_ACTION:
+ aActionBounds = Rectangle( static_cast<const MetaFloatTransparentAction&>(rAct).GetPoint(),
+ static_cast<const MetaFloatTransparentAction&>(rAct).GetSize() );
+ break;
+
+ case META_EPS_ACTION:
+ aActionBounds = Rectangle( static_cast<const MetaEPSAction&>(rAct).GetPoint(),
+ static_cast<const MetaEPSAction&>(rAct).GetSize() );
+ break;
+
+ case META_TEXT_ACTION:
{
- MetaTextAction* pA = (MetaTextAction*) mpAct;
- const XubString aString( pA->GetText(), pA->GetIndex(), pA->GetLen() );
+ const MetaTextAction& rTextAct = static_cast<const MetaTextAction&>(rAct);
+ const XubString aString( rTextAct.GetText(), rTextAct.GetIndex(), rTextAct.GetLen() );
if( aString.Len() )
{
- const Point aPtLog( pA->GetPoint() );
-
- mpRect = new Rectangle();
+ const Point aPtLog( rTextAct.GetPoint() );
// #105987# Use API method instead of Impl* methods
- pOut->GetTextBoundRect( *mpRect, pA->GetText(), 0, pA->GetIndex(), pA->GetLen() );
- mpRect->Move( aPtLog.X(), aPtLog.Y() );
+ // #107490# Set base parameter equal to index parameter
+ rOut.GetTextBoundRect( aActionBounds, rTextAct.GetText(), rTextAct.GetIndex(),
+ rTextAct.GetIndex(), rTextAct.GetLen() );
+ aActionBounds.Move( aPtLog.X(), aPtLog.Y() );
}
}
break;
- case( META_TEXTARRAY_ACTION ):
+ case META_TEXTARRAY_ACTION:
{
- MetaTextArrayAction* pA = (MetaTextArrayAction*) mpAct;
- const XubString aString( pA->GetText(), pA->GetIndex(), pA->GetLen() );
- const long nLen = aString.Len();
+ const MetaTextArrayAction& rTextAct = static_cast<const MetaTextArrayAction&>(rAct);
+ const XubString aString( rTextAct.GetText(), rTextAct.GetIndex(), rTextAct.GetLen() );
+ const long nLen = aString.Len();
if( nLen )
{
// #105987# ImplLayout takes everything in logical coordinates
- SalLayout* pSalLayout = pOut->ImplLayout( pA->GetText(), pA->GetIndex(),
- pA->GetLen(), pA->GetPoint(),
- 0, pA->GetDXArray() );
+ SalLayout* pSalLayout = rOut.ImplLayout( rTextAct.GetText(), rTextAct.GetIndex(),
+ rTextAct.GetLen(), rTextAct.GetPoint(),
+ 0, rTextAct.GetDXArray() );
if( pSalLayout )
{
- Rectangle aBoundRect( pOut->ImplGetTextBoundRect( *pSalLayout ) );
- mpRect = new Rectangle( pOut->PixelToLogic( aBoundRect ) );
+ Rectangle aBoundRect( const_cast<OutputDevice&>(rOut).ImplGetTextBoundRect( *pSalLayout ) );
+ aActionBounds = rOut.PixelToLogic( aBoundRect );
pSalLayout->Release();
}
- else
- mpRect = new Rectangle();
}
}
break;
- case( META_TEXTRECT_ACTION ):
- {
- MetaTextRectAction* pA = (MetaTextRectAction*) mpAct;
- mpRect = new Rectangle( pA->GetRect() );
- }
- break;
+ case META_TEXTRECT_ACTION:
+ aActionBounds = static_cast<const MetaTextRectAction&>(rAct).GetRect();
+ break;
- case( META_STRETCHTEXT_ACTION ):
- case( META_TEXTLINE_ACTION ):
- mpRect = NULL;
- // !!! DBG_ERROR( "Missing" );
- break;
+ case META_STRETCHTEXT_ACTION:
+ DBG_ERROR("META_STRETCHTEXT_ACTION not supported");
+ break;
+
+ case META_TEXTLINE_ACTION:
+ DBG_ERROR("META_TEXTLINE_ACTION not supported");
+ break;
default:
- break;
+ break;
}
- if( mpRect )
- {
- *mpRect = pOut->LogicToPixel( *mpRect );
- mbSpecialOutput = bSpecial;
- }
+ if( !aActionBounds.IsEmpty() )
+ return rOut.LogicToPixel( aActionBounds );
else
- mbSpecialOutput = FALSE;
+ return Rectangle();
}
-// -----------
-// - Printer -
-// -----------
+static bool ImplIsActionHandlingTransparency( const MetaAction& rAct )
+{
+ // META_FLOATTRANSPARENT_ACTION can contain a whole metafile,
+ // which is to be rendered with the given transparent gradient. We
+ // currently cannot emulate transparent painting on a white
+ // background reliably.
+
+ // For the time being, bitmaps are also not handled correctly,
+ // since they don't calculate explicit alpha against white
+ // background in ImplQPrinter::ImplPrintMtf.
+
+ // Leaves us with META_TRANSPARENT_ACTION
+ if( rAct.GetType() == META_TRANSPARENT_ACTION )
+ return true;
+ else
+ return false;
+}
+
+// predicate functor for checking whether given element is fully transparent
+class Impl_IsNotTransparent : public ::std::unary_function< ::std::pair< const MetaAction*, int >, bool >
+{
+public:
+ Impl_IsNotTransparent( const OutputDevice& rOut ) : mrOut(rOut) {}
+ bool operator()( ::std::pair< const MetaAction*, int > rElem )
+ {
+ return ImplIsNotTransparent( *rElem.first, mrOut );
+ }
+
+private:
+ const OutputDevice& mrOut;
+};
+
+typedef ::std::pair< const MetaAction*, int > Component; // MetaAction plus index in metafile
+
+// List of (intersecting) actions, plus overall bounds
+struct ConnectedComponents
+{
+ ::std::list< Component > aComponentList;
+ Rectangle aBounds;
+ bool bIsSpecial;
+};
+
+typedef ::std::list< ConnectedComponents > ConnectedComponentsList;
+
+// remove comment to enable highlighting of generated output
+#ifdef DBG_UTIL
+//#define DEBUG_GetPreparedMetaFile
+#endif
void Printer::GetPreparedMetaFile( const GDIMetaFile& rInMtf, GDIMetaFile& rOutMtf,
long nMaxBmpDPIX, long nMaxBmpDPIY )
{
const PrinterOptions& rPrinterOptions = GetPrinterOptions();
- MetaAction* pAct;
- ULONG i;
- BOOL bTransparent = FALSE;
+ MetaAction* pCurrAct;
+ bool bTransparent( false );
rOutMtf.Clear();
@@ -432,250 +510,475 @@ void Printer::GetPreparedMetaFile( const GDIMetaFile& rInMtf, GDIMetaFile& rOutM
( PRINTER_TRANSPARENCY_AUTO == rPrinterOptions.GetReducedTransparencyMode() ) )
{
// watch for transparent drawing actions
- for( pAct = ( (GDIMetaFile&) rInMtf ).FirstAction(); pAct && !bTransparent; pAct = ( (GDIMetaFile&) rInMtf ).NextAction() )
+ for( pCurrAct = ( (GDIMetaFile&) rInMtf ).FirstAction();
+ pCurrAct && !bTransparent;
+ pCurrAct = ( (GDIMetaFile&) rInMtf ).NextAction() )
{
- if( META_TRANSPARENT_ACTION == pAct->GetType() )
- bTransparent = TRUE;
- else if( META_FLOATTRANSPARENT_ACTION == pAct->GetType() )
- bTransparent = TRUE;
- else if( META_BMPEX_ACTION == pAct->GetType() )
- bTransparent = ( (MetaBmpExAction*) pAct )->GetBitmapEx().IsAlpha();
- else if( META_BMPEXSCALE_ACTION == pAct->GetType() )
- bTransparent = ( (MetaBmpExScaleAction*) pAct )->GetBitmapEx().IsAlpha();
- else if( META_BMPEXSCALEPART_ACTION == pAct->GetType() )
- bTransparent = ( (MetaBmpExScalePartAction*) pAct )->GetBitmapEx().IsAlpha();
+ // #i10613# Extracted "specialness" predicate into extra method
+ if( ImplIsActionSpecial( *pCurrAct ) )
+ bTransparent = true;
}
}
- // separate actions which are special actions or which are affected by special actions
- if( bTransparent )
+ // #i10613# Determine set of connected components containing transparent objects. These are
+ // then processed as bitmaps, the original actions are removed from the metafile.
+ if( !bTransparent )
+ {
+ // nothing transparent -> just copy
+ rOutMtf = rInMtf;
+ }
+ else
{
- Rectangle aBoundRect;
- const ULONG nCount = rInMtf.GetActionCount();
- VirtualDevice aPaintVDev;
- ImplCheckRect* pRects = new ImplCheckRect[ nCount ];
- ImplCheckRect* pIListFirst = NULL;
- ImplCheckRect* pIListPrev = NULL;
- ImplCheckRect* pIListAct = NULL;
- ImplCheckRect* pOListFirst = NULL;
- ImplCheckRect* pOListLast = NULL;
- ImplCheckRect* pOListAct = NULL;
- ImplCheckRect* pO;
-
- aPaintVDev.mnDPIX = mnDPIX;
- aPaintVDev.mnDPIY = mnDPIY;
- aPaintVDev.mbOutput = FALSE;
-
- // create list of special action rects
- for( i = 0, pO = pRects, pAct = ( (GDIMetaFile&) rInMtf ).FirstAction(); pAct;
- pAct = ( (GDIMetaFile&) rInMtf ).NextAction(), i++, pO++ )
+ // #i10613#
+ // This works as follows: we want a number of distinct sets of
+ // connected components, where each set contains metafile
+ // actions that are intersecting (note: there are possibly
+ // more actions contained as are directly intersecting,
+ // because we can only produce rectangular bitmaps later
+ // on. Thus, each set of connected components is the smallest
+ // enclosing, axis-aligned rectangle that completely bounds a
+ // number of intersecting metafile actions, plus any action
+ // that would otherwise be cut in two). Therefore, we
+ // iteratively add metafile actions from the original metafile
+ // to this connected components list (aCCList), by checking
+ // each element's bounding box against intersection with the
+ // metaaction at hand.
+ // All those intersecting elements are removed from aCCList
+ // and collected in a temporary list (aCCMergeList). After all
+ // elements have been checked, the aCCMergeList elements are
+ // merged with the metaaction at hand into one resulting
+ // connected component, with one big bounding box, and
+ // inserted into aCCList again.
+ // The time complexity of this algorithm is O(n^3), where n is
+ // the number of metafile actions, and it finds all distinct
+ // regions of rectangle-bounded connected components. This
+ // algorithm was designed by AF.
+ //
+
+ ConnectedComponentsList aCCList; // list containing distinct sets of connected components as elements.
+ int nActionNum;
+
+ // create an OutputDevice to record mapmode changes and the like
+ VirtualDevice aMapModeVDev;
+ aMapModeVDev.mnDPIX = mnDPIX;
+ aMapModeVDev.mnDPIY = mnDPIY;
+ aMapModeVDev.EnableOutput(FALSE);
+
+ //
+ // STAGE 1: Generate connected components list
+ // ===========================================
+ //
+
+ // iterate over all actions
+ for( pCurrAct=const_cast<GDIMetaFile&>(rInMtf).FirstAction(), nActionNum=0;
+ pCurrAct;
+ pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction(), ++nActionNum )
{
- // set transparency flag
- if( META_TRANSPARENT_ACTION == pAct->GetType() )
- bTransparent = TRUE;
- else if( META_FLOATTRANSPARENT_ACTION == pAct->GetType() )
- bTransparent = TRUE;
- else if( META_BMPEX_ACTION == pAct->GetType() )
- bTransparent = ( (MetaBmpExAction*) pAct )->GetBitmapEx().IsAlpha();
- else if( META_BMPEXSCALE_ACTION == pAct->GetType() )
- bTransparent = ( (MetaBmpExScaleAction*) pAct )->GetBitmapEx().IsAlpha();
- else if( META_BMPEXSCALEPART_ACTION == pAct->GetType() )
- bTransparent = ( (MetaBmpExScalePartAction*) pAct )->GetBitmapEx().IsAlpha();
- else
- bTransparent = FALSE;
+ // execute action to get correct MapModes etc.
+ pCurrAct->Execute( &aMapModeVDev );
+
+ // cache bounds of current action
+ const Rectangle aBBCurrAct( ImplCalcActionBounds(*pCurrAct, aMapModeVDev) );
+
+ // accumulate collected bounds here, initialize with current action
+ Rectangle aTotalBounds( aBBCurrAct ); // thus,
+ // aTotalComponents.aBounds
+ // is
+ // empty
+ // for
+ // non-output-generating
+ // actions
+ bool bTreatSpecial( false );
+ ConnectedComponents aTotalComponents;
+
+ //
+ // STAGE 1.1: Search for intersecting cc entries
+ // =============================================
+ //
+
+ // if aBBCurrAct is empty, it will intersect with no
+ // aCCList member. Thus, we can safe us the check.
+ // Furthermore, this ensures that non-output-generating
+ // actions get their own aCCList entry, which is necessary
+ // when copying them to the output metafile (see stage 3
+ // below).
+ if( !aBBCurrAct.IsEmpty() )
+ {
+ ConnectedComponentsList::iterator aCurrCC;
+ const ConnectedComponentsList::iterator aLastCC( aCCList.end() );
+ bool bSomeComponentsChanged;
+
+ // now, this is unfortunate: since changing anyone of
+ // the aCCList elements (e.g. by merging or addition
+ // of an action) might generate new intersection with
+ // other aCCList elements, have to repeat the whole
+ // element scanning, until nothing changes anymore.
+ // Thus, this loop here makes us O(n^3) in the worst
+ // case.
+ do
+ {
+ // only loop here if 'intersects' branch below was hit
+ bSomeComponentsChanged = false;
+
+ // iterate over all current members of aCCList
+ for( aCurrCC=aCCList.begin(); aCurrCC != aLastCC; )
+ {
+ // first check if current element's bounds are
+ // empty. This ensures that empty actions are not
+ // merged into one component, as a matter of fact,
+ // they have no position.
+ if( !aCurrCC->aBounds.IsEmpty() &&
+ aCurrCC->aBounds.IsOver( aTotalBounds ) )
+ {
+ // union the intersecting aCCList element into aTotalComponents
+
+ // calc union bounding box
+ aTotalBounds.Union( aCurrCC->aBounds );
+
+ // extract all aCurr actions to aTotalComponents
+ aTotalComponents.aComponentList.splice( aTotalComponents.aComponentList.end(),
+ aCurrCC->aComponentList );
+
+ if( aCurrCC->bIsSpecial )
+ bTreatSpecial = true;
- // execute action to get correct MapMode's etc.
- pAct->Execute( &aPaintVDev );
+ // remove and delete aCurrCC element from list (we've now merged its content)
+ aCurrCC = aCCList.erase( aCurrCC );
- // create (bounding) rect object
- pO->ImplCreate( pAct, &aPaintVDev, bTransparent );
+ // at least one component changed, need to rescan everything
+ bSomeComponentsChanged = true;
+ }
+ else
+ {
+ ++aCurrCC;
+ }
+ }
+ }
+ while( bSomeComponentsChanged );
+ }
- // add object to one of the lists
- if( pO->mbSpecialOutput )
+ //
+ // STAGE 1.2: Determine special state for cc element
+ // =================================================
+ //
+
+ // now test whether the whole connected component must be
+ // treated specially (i.e. rendered as a bitmap): if the
+ // added action is the very first action, or all actions
+ // before it are completely transparent, the connected
+ // component need not be treated specially, not even if
+ // the added action contains transparency. This is because
+ // painting of transparent objects on _white background_
+ // works without alpha compositing (you just calculate the
+ // color). Note that for the test "all objects before me
+ // are transparent" no sorting is necessary, since the
+ // added metaaction pCurrAct is always in the order the
+ // metafile is painted. Generally, the order of the
+ // metaactions in the ConnectedComponents are not
+ // guaranteed to be the same as in the metafile.
+ if( bTreatSpecial )
{
- if( !pOListFirst )
- pOListFirst = pOListAct = pOListLast = pO;
- else
- pOListAct = pOListAct->mpNext = pOListLast = pO;
+ // prev component(s) special -> this one, too
+ aTotalComponents.bIsSpecial = true;
}
- else
+ else if( !ImplIsActionSpecial( *pCurrAct ) )
{
- if( !pIListFirst )
- pIListFirst = pIListAct = pO;
- else
- pIListAct = pIListAct->mpNext = pO;
+ // added action and none of prev components special ->
+ // this one normal, too
+ aTotalComponents.bIsSpecial = false;
}
- }
-
- // find all intersections and create list of (bitmap)
- for( pO = pOListFirst; pO; pO = pO->mpNext )
- {
- pIListPrev = NULL, pIListAct = pIListFirst;
-
- while( pIListAct )
+ else
{
- // move act object from in list to out list?
- if( pIListAct->Intersects( *pO ) )
- {
- // mark it as special object
- pIListAct->mbSpecialOutput = TRUE;
-
- if( pIListPrev )
- pIListPrev->mpNext = pIListAct->mpNext;
- else
- pIListFirst = pIListAct->mpNext;
+ // added action is special and none of prev components
+ // special -> do the detailed tests
- pOListLast = pOListLast->mpNext = pIListAct;
+ // can the action handle transparency correctly
+ // (i.e. when painted on white background, does the
+ // action still look correct)?
+ if( !ImplIsActionHandlingTransparency( *pCurrAct ) )
+ {
+ // no, action cannot handle its transparency on
+ // a printer device, render to bitmap
+ aTotalComponents.bIsSpecial = true;
}
else
- pIListPrev = pIListAct;
-
- pIListAct = pIListAct->mpNext;
- pOListLast->mpNext = NULL;
+ {
+ // yes, action can handle its transparency, so
+ // check whether we're on white background
+ if( aTotalComponents.aComponentList.empty() )
+ {
+ // nothing between pCurrAct and empty page
+ // background -> don't be special
+ aTotalComponents.bIsSpecial = false;
+ }
+ else
+ {
+ // check if _every_ object between pCurrAct and
+ // empty sheet of paper is fully transparent
+ Impl_IsNotTransparent aSpecialPredicate( aMapModeVDev );
+ if( ::std::find_if( aTotalComponents.aComponentList.begin(),
+ aTotalComponents.aComponentList.end(),
+ aSpecialPredicate ) == aTotalComponents.aComponentList.end() )
+ {
+ // predicate Impl_IsNotTransparent never
+ // returned true, so every object is
+ // transparent -> don't be special
+ aTotalComponents.bIsSpecial = false;
+ }
+ else
+ {
+ // predicate Impl_IsNotTransparent returned
+ // true at least once, so there's a visible
+ // object between pCurrAct and the empty sheet
+ // of paper -> be special, then
+ aTotalComponents.bIsSpecial = true;
+ }
+ }
+ }
}
- }
- // calculate bounding rectangle of special actions
- for( pO = pOListFirst; pO; pO = pO->mpNext )
- aBoundRect.Union( *pO->mpRect );
+ //
+ // STAGE 1.3: Add newly generated CC list element
+ // ==============================================
+ //
- Point aPoint;
- const Rectangle aOutputRect( aPoint, GetOutputSizePixel() );
+ // set new bounds and add action to list
+ aTotalComponents.aBounds = aTotalBounds;
+ aTotalComponents.aComponentList.push_back( ::std::make_pair(
+ const_cast<const MetaAction*>(pCurrAct), nActionNum) );
- aBoundRect.Intersection( aOutputRect );
+ // add aTotalComponents as a new entry to aCCList
+ aCCList.push_back( aTotalComponents );
- const double fBmpArea = (double) aBoundRect.GetWidth() * aBoundRect.GetHeight();
- const double fOutArea = (double) aOutputRect.GetWidth() * aOutputRect.GetHeight();
+ DBG_ASSERT( !aTotalComponents.aComponentList.empty(),
+ "Printer::GetPreparedMetaFile empty component" );
+ DBG_ASSERT( !aTotalComponents.aBounds.IsEmpty() ||
+ (aTotalComponents.aBounds.IsEmpty() && aTotalComponents.aComponentList.size() == 1),
+ "Printer::GetPreparedMetaFile non-output generating actions must be solitary");
+ }
- // check if output doesn't exceed given size
- if( rPrinterOptions.IsReduceTransparency() &&
- ( PRINTER_TRANSPARENCY_AUTO == rPrinterOptions.GetReducedTransparencyMode() ) &&
- ( fBmpArea > ( 0.25 * fOutArea ) ) )
+ // well now, we've got the list of disjunct connected
+ // components. Now we've got to create a map, which contains
+ // the corresponding aCCList element for every
+ // metaaction. Later on, we always process the complete
+ // metafile for each bitmap to be generated, but switch on
+ // output only for actions contained in the then current
+ // aCCList element. This ensures correct mapmode and attribute
+ // settings for all cases.
+
+ // maps mtf actions to CC list entries
+ ::std::vector< const ConnectedComponents* > aCCList_MemberMap( rInMtf.GetActionCount() );
+
+ // iterate over all aCCList members and their contained metaactions
+ ConnectedComponentsList::iterator aCurr( aCCList.begin() );
+ const ConnectedComponentsList::iterator aLast( aCCList.end() );
+ for( ; aCurr != aLast; ++aCurr )
{
- rOutMtf = rInMtf;
+ ::std::list< Component >::iterator aCurrAct( aCurr->aComponentList.begin() );
+ const ::std::list< Component >::iterator aLastAct( aCurr->aComponentList.end() );
+ for( ; aCurrAct != aLastAct; ++aCurrAct )
+ {
+ // set pointer to aCCList element for corresponding index
+ aCCList_MemberMap[ aCurrAct->second ] = &(*aCurr);
+ }
}
- else
+
+ //
+ // STAGE 2: Generate banded bitmaps for special regions
+ // ====================================================
+ //
+
+ Point aTmpPoint;
+ const Rectangle aOutputRect( aTmpPoint, GetOutputSizePixel() );
+
+ // iterate over all aCCList members and generate bitmaps for the special ones
+ for( aCurr = aCCList.begin(); aCurr != aLast; ++aCurr )
{
- // create new bitmap action first
- if( aBoundRect.GetWidth() && aBoundRect.GetHeight() )
+ if( aCurr->bIsSpecial )
{
- Point aDstPtPix( aBoundRect.TopLeft() );
- Size aDstSzPix;
- VirtualDevice aMapVDev;
+ Rectangle aBoundRect( aCurr->aBounds );
+ aBoundRect.Intersection( aOutputRect );
- rOutMtf.AddAction( new MetaPushAction( PUSH_MAPMODE ) );
- rOutMtf.AddAction( new MetaMapModeAction() );
+ const double fBmpArea( (double) aBoundRect.GetWidth() * aBoundRect.GetHeight() );
+ const double fOutArea( (double) aOutputRect.GetWidth() * aOutputRect.GetHeight() );
- aPaintVDev.mbOutput = TRUE;
- aPaintVDev.SetDrawMode( GetDrawMode() );
+ // check if output doesn't exceed given size
+ if( rPrinterOptions.IsReduceTransparency() &&
+ ( PRINTER_TRANSPARENCY_AUTO == rPrinterOptions.GetReducedTransparencyMode() ) &&
+ ( fBmpArea > ( 0.25 * fOutArea ) ) )
+ {
+ // output normally. Therefore, we simply clear the
+ // special attribute, as everything non-special is
+ // copied to rOutMtf further below.
+ aCurr->bIsSpecial = false;
+ }
+ else
+ {
+ // create new bitmap action first
+ if( aBoundRect.GetWidth() && aBoundRect.GetHeight() )
+ {
+ Point aDstPtPix( aBoundRect.TopLeft() );
+ Size aDstSzPix;
- aMapVDev.mbOutput = FALSE;
+ VirtualDevice aMapVDev; // here, we record only mapmode information
+ aMapVDev.EnableOutput(FALSE);
- while( aDstPtPix.Y() <= aBoundRect.Bottom() )
- {
- aDstPtPix.X() = aBoundRect.Left();
- aDstSzPix = Size( MAX_TILE_WIDTH, MAX_TILE_HEIGHT );
+ VirtualDevice aPaintVDev; // into this one, we render.
- if( ( aDstPtPix.Y() + aDstSzPix.Height() - 1L ) > aBoundRect.Bottom() )
- aDstSzPix.Height() = aBoundRect.Bottom() - aDstPtPix.Y() + 1L;
+ rOutMtf.AddAction( new MetaPushAction( PUSH_MAPMODE ) );
+ rOutMtf.AddAction( new MetaMapModeAction() );
- while( aDstPtPix.X() <= aBoundRect.Right() )
- {
- if( ( aDstPtPix.X() + aDstSzPix.Width() - 1L ) > aBoundRect.Right() )
- aDstSzPix.Width() = aBoundRect.Right() - aDstPtPix.X() + 1L;
+ aPaintVDev.SetDrawMode( GetDrawMode() );
- if( !Rectangle( aDstPtPix, aDstSzPix ).Intersection( aBoundRect ).IsEmpty() &&
- aPaintVDev.SetOutputSizePixel( aDstSzPix ) )
+ while( aDstPtPix.Y() <= aBoundRect.Bottom() )
{
- aPaintVDev.Push();
- aMapVDev.Push();
+ aDstPtPix.X() = aBoundRect.Left();
+ aDstSzPix = Size( MAX_TILE_WIDTH, MAX_TILE_HEIGHT );
- aMapVDev.mnDPIX = aPaintVDev.mnDPIX = mnDPIX;
- aMapVDev.mnDPIY = aPaintVDev.mnDPIY = mnDPIY;
+ if( ( aDstPtPix.Y() + aDstSzPix.Height() - 1L ) > aBoundRect.Bottom() )
+ aDstSzPix.Height() = aBoundRect.Bottom() - aDstPtPix.Y() + 1L;
- for( i = 0, pO = pRects; i < nCount; i++, pO++ )
+ while( aDstPtPix.X() <= aBoundRect.Right() )
{
- MetaAction* pAction = pO->mpAct;
- const USHORT nType = pAction->GetType();
+ if( ( aDstPtPix.X() + aDstSzPix.Width() - 1L ) > aBoundRect.Right() )
+ aDstSzPix.Width() = aBoundRect.Right() - aDstPtPix.X() + 1L;
- if( META_MAPMODE_ACTION == nType )
+ if( !Rectangle( aDstPtPix, aDstSzPix ).Intersection( aBoundRect ).IsEmpty() &&
+ aPaintVDev.SetOutputSizePixel( aDstSzPix ) )
{
- pAction->Execute( &aMapVDev );
+ aPaintVDev.Push();
+ aMapVDev.Push();
+
+ aMapVDev.mnDPIX = aPaintVDev.mnDPIX = mnDPIX;
+ aMapVDev.mnDPIY = aPaintVDev.mnDPIY = mnDPIY;
+
+ aPaintVDev.EnableOutput(FALSE);
+
+ // iterate over all actions
+ for( pCurrAct=const_cast<GDIMetaFile&>(rInMtf).FirstAction(), nActionNum=0;
+ pCurrAct;
+ pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction(), ++nActionNum )
+ {
+ // enable output only for
+ // actions that are members of
+ // the current aCCList element
+ // (aCurr)
+ if( aCCList_MemberMap[nActionNum] == &(*aCurr) )
+ aPaintVDev.EnableOutput(TRUE);
+
+ // but process every action
+ const USHORT nType( pCurrAct->GetType() );
+
+ if( META_MAPMODE_ACTION == nType )
+ {
+ pCurrAct->Execute( &aMapVDev );
+
+ MapMode aMtfMap( aMapVDev.GetMapMode() );
+ const Point aNewOrg( aMapVDev.PixelToLogic( aDstPtPix ) );
+
+ aMtfMap.SetOrigin( Point( -aNewOrg.X(), -aNewOrg.Y() ) );
+ aPaintVDev.SetMapMode( aMtfMap );
+ }
+ else if( ( META_PUSH_ACTION == nType ) || ( META_POP_ACTION ) == nType )
+ {
+ pCurrAct->Execute( &aMapVDev );
+ pCurrAct->Execute( &aPaintVDev );
+ }
+ else if( META_GRADIENT_ACTION == nType )
+ {
+ MetaGradientAction* pGradientAction = static_cast<MetaGradientAction*>(pCurrAct);
+ DrawGradientEx( &aPaintVDev, pGradientAction->GetRect(), pGradientAction->GetGradient() );
+ }
+ else
+ {
+ pCurrAct->Execute( &aPaintVDev );
+ }
+
+ if( !( nActionNum % 4 ) )
+ Application::Reschedule();
+ }
+
+ const BOOL bOldMap = mbMap;
+ mbMap = aPaintVDev.mbMap = FALSE;
+
+ Bitmap aBandBmp( aPaintVDev.GetBitmap( Point(), aDstSzPix ) );
+
+ // scale down bitmap, if requested
+ if( rPrinterOptions.IsReduceBitmaps() && rPrinterOptions.IsReducedBitmapIncludesTransparency() )
+ {
+ aBandBmp = GetPreparedBitmap( aDstPtPix, aDstSzPix,
+ Point(), aBandBmp.GetSizePixel(),
+ aBandBmp, nMaxBmpDPIX, nMaxBmpDPIY );
+ }
+
+#ifdef DEBUG_GetPreparedMetaFile
+ //aBandBmp.Invert();
+#endif
- MapMode aMtfMap( aMapVDev.GetMapMode() );
- const Point aNewOrg( aMapVDev.PixelToLogic( aDstPtPix ) );
+ rOutMtf.AddAction( new MetaCommentAction( "PRNSPOOL_TRANSPARENTBITMAP_BEGIN" ) );
+ rOutMtf.AddAction( new MetaBmpScaleAction( aDstPtPix, aDstSzPix, aBandBmp ) );
+ rOutMtf.AddAction( new MetaCommentAction( "PRNSPOOL_TRANSPARENTBITMAP_END" ) );
- aMtfMap.SetOrigin( Point( -aNewOrg.X(), -aNewOrg.Y() ) );
- aPaintVDev.SetMapMode( aMtfMap );
- }
- else if( ( META_PUSH_ACTION == nType ) || ( META_POP_ACTION ) == nType )
- {
- pAction->Execute( &aMapVDev );
- pAction->Execute( &aPaintVDev );
+ aPaintVDev.mbMap = TRUE;
+ mbMap = bOldMap;
+ aMapVDev.Pop();
+ aPaintVDev.Pop();
}
- else if( META_GRADIENT_ACTION == nType )
- {
- MetaGradientAction* pGradientAction = (MetaGradientAction*) pAction;
- DrawGradientEx( &aPaintVDev, pGradientAction->GetRect(), pGradientAction->GetGradient() );
- }
- else
- pAction->Execute( &aPaintVDev );
-
- if( !( i % 4 ) )
- Application::Reschedule();
- }
- const BOOL bOldMap = mbMap;
- mbMap = aPaintVDev.mbMap = FALSE;
-
- Bitmap aBandBmp( aPaintVDev.GetBitmap( Point(), aDstSzPix ) );
-
- // scale down bitmap, if requested
- if( rPrinterOptions.IsReduceBitmaps() && rPrinterOptions.IsReducedBitmapIncludesTransparency() )
- {
- aBandBmp = GetPreparedBitmap( aDstPtPix, aDstSzPix,
- Point(), aBandBmp.GetSizePixel(),
- aBandBmp, nMaxBmpDPIX, nMaxBmpDPIY );
+ // overlapping bands to avoid missing lines (e.g. PostScript)
+ aDstPtPix.X() += aDstSzPix.Width();
}
-#ifdef DEBUG
- // aBandBmp.Invert();
-#endif
-
- rOutMtf.AddAction( new MetaCommentAction( "PRNSPOOL_TRANSPARENTBITMAP_BEGIN" ) );
- rOutMtf.AddAction( new MetaBmpScaleAction( aDstPtPix, aDstSzPix, aBandBmp ) );
- rOutMtf.AddAction( new MetaCommentAction( "PRNSPOOL_TRANSPARENTBITMAP_END" ) );
-
- aPaintVDev.mbMap = TRUE;
- mbMap = bOldMap;
- aMapVDev.Pop();
- aPaintVDev.Pop();
+ // overlapping bands to avoid missing lines (e.g. PostScript)
+ aDstPtPix.Y() += aDstSzPix.Height();
}
- // overlapping bands to avoid missing lines (e.g. PostScript)
- aDstPtPix.X() += aDstSzPix.Width();
+ rOutMtf.AddAction( new MetaPopAction() );
}
-
- // overlapping bands to avoid missing lines (e.g. PostScript)
- aDstPtPix.Y() += aDstSzPix.Height();
}
-
- rOutMtf.AddAction( new MetaPopAction() );
}
+ }
- // add normal actions
- for( i = 0, pO = pRects; i < nCount; i++, pO++ )
- if( !pO->mbSpecialOutput )
- rOutMtf.AddAction( ( pO->mpAct->Duplicate(), pO->mpAct ) );
+ //
+ // STAGE 3: Copy actions to output metafile
+ // ========================================
+ //
- rOutMtf.SetPrefMapMode( rInMtf.GetPrefMapMode() );
- rOutMtf.SetPrefSize( rInMtf.GetPrefSize() );
+ // iterate over all actions and duplicate the ones not in a
+ // special aCCList member into rOutMtf
+ for( pCurrAct=const_cast<GDIMetaFile&>(rInMtf).FirstAction(), nActionNum=0;
+ pCurrAct;
+ pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction(), ++nActionNum )
+ {
+ // NOTE: This relies on the fact that map-mode or draw
+ // mode changing actions are solitary aCCList elements and
+ // have empty bounding boxes, see comment on stage 1.1
+ // above
+ if( aCCList_MemberMap[nActionNum] &&
+ (aCCList_MemberMap[nActionNum]->aBounds.IsEmpty() ||
+ !aCCList_MemberMap[nActionNum]->bIsSpecial) )
+ {
+ rOutMtf.AddAction( ( pCurrAct->Duplicate(), pCurrAct ) );
+ }
}
- delete[] pRects;
+ rOutMtf.SetPrefMapMode( rInMtf.GetPrefMapMode() );
+ rOutMtf.SetPrefSize( rInMtf.GetPrefSize() );
+
+#ifdef DEBUG_GetPreparedMetaFile
+ // iterate over all aCCList members and generate rectangles for the bounding boxes
+ rOutMtf.AddAction( new MetaFillColorAction( COL_WHITE, FALSE ) );
+ for( aCurr = aCCList.begin(); aCurr != aLast; ++aCurr )
+ {
+ if( aCurr->bIsSpecial )
+ rOutMtf.AddAction( new MetaLineColorAction( COL_RED, TRUE) );
+ else
+ rOutMtf.AddAction( new MetaLineColorAction( COL_BLUE, TRUE) );
+
+ rOutMtf.AddAction( new MetaRectAction( aMapModeVDev.PixelToLogic( aCurr->aBounds ) ) );
+ }
+#endif
}
- else
- rOutMtf = rInMtf;
}
// -----------------------------------------------------------------------------
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index e8af5a08610a..99cca7764899 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: salgdilayout.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: pl $ $Date: 2002-09-18 16:28:28 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -95,11 +95,8 @@
#ifndef _SV_SVAPP_HXX
#include <svapp.hxx>
#endif
-#ifndef _SV_POLY_H
-#include <poly.h>
-#endif
-#ifndef _SV_POLY_HXX
-#include <poly.hxx>
+#ifndef _POLY_HXX
+#include <tools/poly.hxx>
#endif
#ifndef _SV_REGION_HXX
#include <region.hxx>
@@ -194,7 +191,12 @@ SalGraphicsLayout::~SalGraphicsLayout()
void SalGraphicsLayout::mirror( long& x, const OutputDevice *pOutDev )
{
- long w = GetGraphicsWidth();
+ long w;
+ if( pOutDev && pOutDev->meOutDevType == OUTDEV_VIRDEV )
+ w = pOutDev->mnOutWidth;
+ else
+ w = GetGraphicsWidth();
+
if( w )
{
x = w-1-x;
@@ -210,7 +212,12 @@ void SalGraphicsLayout::mirror( long& x, const OutputDevice *pOutDev )
void SalGraphicsLayout::mirror( long& x, long& nWidth, const OutputDevice *pOutDev )
{
- long w = GetGraphicsWidth();
+ long w;
+ if( pOutDev && pOutDev->meOutDevType == OUTDEV_VIRDEV )
+ w = pOutDev->mnOutWidth;
+ else
+ w = GetGraphicsWidth();
+
if( w )
{
x = w-nWidth-x;
@@ -226,7 +233,12 @@ void SalGraphicsLayout::mirror( long& x, long& nWidth, const OutputDevice *pOutD
BOOL SalGraphicsLayout::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev )
{
- long w = GetGraphicsWidth();
+ long w;
+ if( pOutDev && pOutDev->meOutDevType == OUTDEV_VIRDEV )
+ w = pOutDev->mnOutWidth;
+ else
+ w = GetGraphicsWidth();
+
if( w )
{
sal_uInt32 i, j;
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index a8a10ea53e4d..1737cd5b3e82 100755
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sallayout.cxx,v $
*
- * $Revision: 1.37 $
+ * $Revision: 1.38 $
*
- * last change: $Author: hdu $ $Date: 2002-12-12 13:52:57 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -129,7 +129,9 @@ int GetVerticalFlags( sal_Unicode nChar )
sal_Unicode GetVerticalChar( sal_Unicode nChar )
{
+return 0;
int nVert = 0;
+
switch( nChar )
{
// CJK compatibility forms
@@ -173,6 +175,46 @@ sal_Unicode GetMirroredChar( sal_Unicode nChar )
return nChar;
}
+// -----------------------------------------------------------------------
+
+sal_Unicode GetLocalizedChar( sal_Unicode nChar, int nLocalFlags )
+{
+ // currently only conversion from ASCII digits is interesting
+ if( (nChar < '0') || ('9' < nChar) )
+ return nChar;
+
+ sal_Unicode nOffset;
+ switch( nLocalFlags )
+ {
+ case 0: nOffset = 0x0000; break; // western
+ case 1: nOffset = 0x0660; break; // persian/urdu
+ case 2: nOffset = 0x09E6; break; // bengali
+ case 3: nOffset = 0x0966; break; // devanagari
+ case 4: nOffset = 0x1369; break; // ethiopic
+ case 5: nOffset = 0x0AE6; break; // gujarati
+ case 6: nOffset = 0x0A66; break; // gurmukhi
+ case 7: nOffset = 0x0CE6; break; // kannada
+ case 8: nOffset = 0x17E0; break; // khmer
+ case 9: nOffset = 0x0ED0; break; // lao
+ case 10: nOffset = 0x0D66; break; // malayalam
+ case 11: nOffset = 0x1810; break; // mongolian
+ case 12: nOffset = 0x1040; break; // myanmar
+ case 13: nOffset = 0x0B66; break; // oriya
+ case 14: nOffset = 0x0BE7; break; // tamil
+ case 15: nOffset = 0x0C66; break; // telugu
+ case 16: nOffset = 0x0E50; break; // thai
+ case 17: nOffset = 0x0F20; break; // tibetan
+
+ case 90: nOffset = 0x2776; break; // dingbat circled
+ case 91: nOffset = 0x2070; break; // superscript
+ case 92: nOffset = 0x2080; break; // subscript
+ default: nOffset = 0; break;
+ }
+
+ nChar += nOffset;
+ return nChar;
+}
+
// =======================================================================
ImplLayoutArgs::ImplLayoutArgs( const xub_Unicode* pStr, int nLength,
@@ -251,7 +293,7 @@ ImplLayoutArgs::ImplLayoutArgs( const xub_Unicode* pStr, int nLength,
bool ImplLayoutArgs::GetNextPos( int* nCharPos, bool* bRightToLeft )
{
- if( mnRunIndex >= maRuns.size() )
+ if( mnRunIndex >= (int)maRuns.size() )
return false;
// update position in run
@@ -275,12 +317,12 @@ bool ImplLayoutArgs::GetNextPos( int* nCharPos, bool* bRightToLeft )
bool ImplLayoutArgs::GetNextRun( int* nMinRunPos, int* nEndRunPos, bool* bRightToLeft )
{
- if( mnRunIndex >= maRuns.size() )
+ if( mnRunIndex >= (int)maRuns.size() )
return false;
int nRunPos0 = maRuns[ mnRunIndex+0 ];
int nRunPos1 = maRuns[ mnRunIndex+1 ];
- if( (mnRunIndex += 2) < maRuns.size() )
+ if( (mnRunIndex += 2) < (int)maRuns.size() )
mnCurCharPos = maRuns[ mnRunIndex ];
if( nRunPos0 < nRunPos1 )
{
@@ -300,29 +342,29 @@ bool ImplLayoutArgs::GetNextRun( int* nMinRunPos, int* nEndRunPos, bool* bRightT
// -----------------------------------------------------------------------
-void ImplLayoutArgs::NeedFallback( int nCharPos, bool bRTL )
+bool ImplLayoutArgs::NeedFallback( int nCharPos, bool bRTL )
{
// try to merge fallback runs
int nIndex = maReruns.size();
- if( --nIndex > 0 )
+ if( (--nIndex > 0) && ((nCharPos + bRTL) == maReruns[ nIndex ]) )
{
- int nLastPos = maReruns[ nIndex ];
- if( (nCharPos + bRTL) == nLastPos )
- {
- // merge with current run
- maReruns[ nIndex ] = nCharPos + !bRTL;
- return;
- }
+ // merge with current run
+ maReruns[ nIndex ] = nCharPos + !bRTL;
+ }
+ else
+ {
+ // append new run
+ maReruns.push_back( nCharPos + bRTL );
+ maReruns.push_back( nCharPos + !bRTL );
}
- // append new run
- maReruns.push_back( nCharPos + bRTL );
- maReruns.push_back( nCharPos + !bRTL );
+ // TODO: return !(mnFlags & SAL_LAYOUT_FOR_FALLBACK);
+ return true;
}
// -----------------------------------------------------------------------
-void ImplLayoutArgs::NeedFallback( int nCharPos0, int nCharPos1, bool bRTL )
+bool ImplLayoutArgs::NeedFallback( int nCharPos0, int nCharPos1, bool bRTL )
{
// swap if needed
if( (nCharPos0 < nCharPos1) ^ bRTL )
@@ -335,16 +377,21 @@ void ImplLayoutArgs::NeedFallback( int nCharPos0, int nCharPos1, bool bRTL )
// append new run
maReruns.push_back( nCharPos0 );
maReruns.push_back( nCharPos1 );
+
+ return true;
+ // TODO: return !(mnFlags & SAL_LAYOUT_FOR_FALLBACK);
}
// -----------------------------------------------------------------------
-bool ImplLayoutArgs::SetFallbackArgs()
+bool ImplLayoutArgs::PrepareFallback()
{
int nSize = maReruns.size();
if( !nSize )
return false;
DBG_ASSERT( !(nSize & 1), "odd ImplLayoutArgs run size" );
+
+ // TODO: sort out chars that were not requested anyway
maRuns = maReruns;
maReruns.clear();
ResetPos();
@@ -353,11 +400,11 @@ bool ImplLayoutArgs::SetFallbackArgs()
// =======================================================================
-SalLayout::SalLayout( const ImplLayoutArgs& rArgs )
-: mnMinCharPos( rArgs.mnMinCharPos ),
- mnEndCharPos( rArgs.mnEndCharPos ),
- mnOrientation( rArgs.mnOrientation ),
- mnLayoutFlags( rArgs.mnFlags ),
+SalLayout::SalLayout()
+: mnMinCharPos( -1 ),
+ mnEndCharPos( -1 ),
+ mnLayoutFlags( 0 ),
+ mnOrientation( 0 ),
maDrawOffset( 0, 0 ),
mnUnitsPerPixel( 1 ),
mnRefCount( 1 )
@@ -370,6 +417,17 @@ SalLayout::~SalLayout()
// -----------------------------------------------------------------------
+void SalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
+{
+ mnMinCharPos = rArgs.mnMinCharPos;
+ mnEndCharPos = rArgs.mnEndCharPos;
+ mnLayoutFlags = rArgs.mnFlags;
+
+ mnOrientation = rArgs.mnOrientation;
+}
+
+// -----------------------------------------------------------------------
+
void SalLayout::Reference() const
{
// TODO: protect when multiple threads can access this
@@ -473,8 +531,7 @@ bool SalLayout::GetOutline( SalGraphics& rSalGraphics, PolyPolyVector& rVector )
break;
// get outline of individual glyph, ignoring "empty" glyphs
- bool bIsGlyph = ((nLGlyph & GF_ISCHAR) == 0);
- bool bSuccess = rSalGraphics.GetGlyphOutline( nLGlyph, bIsGlyph, aGlyphOutline, NULL );
+ bool bSuccess = rSalGraphics.GetGlyphOutline( nLGlyph, aGlyphOutline, NULL );
bRet &= bSuccess;
// only add non-empty outlines
if( bSuccess && (aGlyphOutline.Count() > 0) )
@@ -490,13 +547,12 @@ bool SalLayout::GetOutline( SalGraphics& rSalGraphics, PolyPolyVector& rVector )
// -----------------------------------------------------------------------
-bool SalLayout::GetBoundRect( SalGraphics& rSalGraphics, Rectangle& rRectangle ) const
+bool SalLayout::GetBoundRect( SalGraphics& rSalGraphics, Rectangle& rRect ) const
{
bool bRet = false;
- rRectangle.SetEmpty();
+ rRect.SetEmpty();
Point aPos;
-
Rectangle aRectangle;
for( int nStart = 0;;)
{
@@ -505,13 +561,11 @@ bool SalLayout::GetBoundRect( SalGraphics& rSalGraphics, Rectangle& rRectangle )
break;
// get bounding rectangle of individual glyph
- bool bIsGlyph = (nLGlyph & GF_ISCHAR) == 0;
- if( rSalGraphics.GetGlyphBoundRect( nLGlyph, bIsGlyph, aRectangle, NULL ) )
+ if( rSalGraphics.GetGlyphBoundRect( nLGlyph, aRectangle, NULL ) )
{
// merge rectangle
aRectangle += aPos;
- rRectangle.Union( aRectangle );
-
+ rRect.Union( aRectangle );
bRet = true;
}
}
@@ -521,15 +575,6 @@ bool SalLayout::GetBoundRect( SalGraphics& rSalGraphics, Rectangle& rRectangle )
// -----------------------------------------------------------------------
-bool SalLayout::IsNotdefGlyph( long nGlyph ) const
-{
- if( (nGlyph & GF_ISCHAR) || !(nGlyph & GF_IDXMASK) )
- return true;
- return false;
-}
-
-// -----------------------------------------------------------------------
-
bool SalLayout::IsSpacingGlyph( long nGlyph ) const
{
bool bRet = false;
@@ -548,9 +593,10 @@ bool SalLayout::IsSpacingGlyph( long nGlyph ) const
// =======================================================================
-GenericSalLayout::GenericSalLayout( const ImplLayoutArgs& rArgs )
-: SalLayout( rArgs ),
- mnGlyphCapacity(0), mnGlyphCount(0), mpGlyphItems(NULL)
+GenericSalLayout::GenericSalLayout()
+: mnGlyphCount(0),
+ mnGlyphCapacity(0),
+ mpGlyphItems(0)
{}
// -----------------------------------------------------------------------
@@ -567,7 +613,7 @@ void GenericSalLayout::AppendGlyph( const GlyphItem& rGlyphItem )
// TODO: use std::list<GlyphItem>
if( mnGlyphCount >= mnGlyphCapacity )
{
- mnGlyphCapacity += 8 + mnGlyphCount;
+ mnGlyphCapacity += 16 + mnGlyphCount;
GlyphItem* pNewGI = new GlyphItem[ mnGlyphCapacity ];
if( mpGlyphItems )
{
@@ -583,180 +629,6 @@ void GenericSalLayout::AppendGlyph( const GlyphItem& rGlyphItem )
// -----------------------------------------------------------------------
-void GenericSalLayout::UpdateGlyphPos( int nStart, int nNewXPos )
-{
- if( nStart >= mnGlyphCount )
- return;
- GlyphItem* pG = mpGlyphItems + nStart;
- long nXDelta = nNewXPos - pG->maLinearPos.X();
-#if 1
- if( !nXDelta )
- return;
- GlyphItem* pGEnd = mpGlyphItems + mnGlyphCount;
- for(; pG < pGEnd; ++pG )
-#endif
- pG->maLinearPos.X() += nXDelta;
-}
-
-// -----------------------------------------------------------------------
-
-void GenericSalLayout::RemoveNotdefs()
-{
- GlyphItem* pGDst = mpGlyphItems;
- const GlyphItem* pGSrc = mpGlyphItems;
- const GlyphItem* pGEnd = mpGlyphItems + mnGlyphCount;
- for(; pGSrc < pGEnd; ++pGSrc )
- {
- if( !IsNotdefGlyph( pGSrc->mnGlyphIndex ) )
- {
- if( pGDst != pGSrc )
- *pGDst = *pGSrc;
- ++pGDst;
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-bool GenericSalLayout::ApplyFallback( SalLayout& rFallback )
-{
- // find positions where this fallback would fit
- GlyphItem* pGNext = mpGlyphItems;
- GlyphItem* pGEnd = mpGlyphItems + mnGlyphCount;
- int bSuccess = false;
- for( int nFallbackIdx=0; pGNext < pGEnd; )
- {
- // find parts that need fallback
- GlyphItem* pGCur = pGNext;
- while( (pGCur < pGEnd) && !IsNotdefGlyph( pGCur->mnGlyphIndex ) )
- ++pGCur;
- if( pGCur >= pGEnd )
- break;
- pGNext = pGCur;
- int nMinCharPos = pGNext->mnCharPos;
- int nMaxCharPos = nMinCharPos;
-
- while( (++pGNext < pGEnd) && IsNotdefGlyph( pGNext->mnGlyphIndex ) )
- {
- if( nMinCharPos > pGNext->mnCharPos )
- nMinCharPos = pGNext->mnCharPos;
- if( nMaxCharPos < pGNext->mnCharPos )
- nMaxCharPos = pGNext->mnCharPos;
- }
-
- // update parts that have a fallback
- Point aPos;
- long nXPos = pGCur->maLinearPos.X();
- int nStart = nFallbackIdx;
- for( ;; )
- {
- // get fallback glyphs
- long nGlyphIdx;
- long nGlyphAdv;
- int nCharPos;
- int nStartBefore = nStart;
- if( !rFallback.GetNextGlyphs( 1, &nGlyphIdx, aPos, nStart,
- &nGlyphAdv, &nCharPos ) )
- break;
-
- // when this fallback doesn't match we need it for another part
- if( nCharPos < nMinCharPos || nMaxCharPos < nCharPos )
- {
- nFallbackIdx = nStartBefore;
- break;
- }
-
- // no need to fallback when it does not help
- if( rFallback.IsNotdefGlyph( nGlyphIdx ) )
- {
- // sync up position of current layout with fallback
- while( (pGCur->mnCharPos != nCharPos) && (++pGCur < pGEnd) );
- continue;
- }
-
- // adjust fallback positions
- rFallback.UpdateGlyphPos( nStartBefore, nXPos );
- nXPos += nGlyphAdv;
- bSuccess = true;
-
- // remove notdef that is handled by fallback
- --mnGlyphCount;
- --pGEnd;
- if( pGCur < pGEnd )
- {
- long nDelta = nXPos - pGCur[1].maLinearPos.X();
- for( GlyphItem* pG = pGCur; pG < pGEnd; ++pG )
- {
- pG[0] = pG[1];
- pG[0].maLinearPos.X() += nDelta;
- }
- }
- }
-
- nFallbackIdx = nStart;
- }
-
- // we are not interested in unresolved fallback glyphs
- rFallback.RemoveNotdefs();
-
- return bSuccess;
-}
-
-// -----------------------------------------------------------------------
-
-Point GenericSalLayout::GetCharPosition( int nCharPos, bool bRTL ) const
-{
- int nStartIndex = mnGlyphCount;
- int nGlyphIndex = mnGlyphCount;
- int nEndIndex = 0;
-
- int nMaxIndex = 0;
- const GlyphItem* pG = mpGlyphItems;
- for( int i = 0; i < mnGlyphCount; ++i, ++pG )
- {
- int n = pG->mnCharPos;
- if( n < mnMinCharPos || n >= mnEndCharPos )
- continue;
-
- if( nStartIndex > i )
- nStartIndex = i;
- nMaxIndex = i;
-
- if( (n <= nCharPos) && (nGlyphIndex > i) )
- nGlyphIndex = i;
- }
-
-
- long nXPos = 0;
-
- if( !bRTL ) // relative to left edge
- {
- nXPos = mpGlyphItems[nGlyphIndex].maLinearPos.X();
-
- // adjust start to cluster start
- pG = mpGlyphItems + nStartIndex;
- while( (pG > mpGlyphItems) && !pG->IsClusterStart() )
- --pG;
- nXPos -= pG->maLinearPos.X();
- }
- else // relative to right edge
- {
- // find end of last cluster
- pG = mpGlyphItems + nMaxIndex;
- const GlyphItem* pGLimit = mpGlyphItems + mnGlyphCount;
- while( (++pG < pGLimit) && !pG->IsClusterStart() );
-
- // adjust offset from start to last cluster
- pGLimit = pG;
- for( pG = mpGlyphItems + nStartIndex ; pG < pGLimit; ++pG )
- nXPos -= pG->mnNewWidth;
- }
-
- return Point( nXPos, 0 );
-}
-
-// -----------------------------------------------------------------------
-
bool GenericSalLayout::GetCharWidths( long* pCharWidths ) const
{
// initialize character extents buffer
@@ -833,21 +705,13 @@ bool GenericSalLayout::GetCharWidths( long* pCharWidths ) const
// -----------------------------------------------------------------------
-long GenericSalLayout::FillDXArray( long* pDXArray ) const
+long GenericSalLayout::FillDXArray( long* pCharWidths ) const
{
- int nCharCapacity = mnEndCharPos - mnMinCharPos;
- long* pCharWidths = (long*)alloca( nCharCapacity * sizeof(long) );
- if( !GetCharWidths( pCharWidths ) )
- return 0;
-
- long nWidth = 0;
- for( int i = mnMinCharPos; i < mnEndCharPos; ++i )
- {
- nWidth += pCharWidths[ i - mnMinCharPos ];
- if( pDXArray )
- pDXArray[ i - mnMinCharPos ] = nWidth;
- }
+ if( pCharWidths )
+ if( !GetCharWidths( pCharWidths ) )
+ return 0;
+ long nWidth = GetTextWidth();
return nWidth;
}
@@ -859,19 +723,16 @@ long GenericSalLayout::GetTextWidth() const
return 0;
const GlyphItem* pG = mpGlyphItems;
- long nMinPos = pG->maLinearPos.X();
- long nMaxPos = nMinPos + pG->mnNewWidth;
+ long nMinPos = 0;
+ long nMaxPos = pG->maLinearPos.X() + pG->mnNewWidth;
for( int i = 1; i < mnGlyphCount; ++i )
{
++pG;
- int n = pG->mnCharPos;
- if( (n < mnMinCharPos) || (mnEndCharPos <= n) )
- continue;
long nXPos = pG->maLinearPos.X();
if( nMinPos > nXPos )
nMinPos = nXPos;
nXPos += pG->mnNewWidth;
- if( nMaxPos < nXPos )
+ if( nMaxPos < nXPos )
nMaxPos = nXPos;
}
@@ -881,32 +742,41 @@ long GenericSalLayout::GetTextWidth() const
// -----------------------------------------------------------------------
-void GenericSalLayout::ApplyDXArray( const long* pDXArray )
+void GenericSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
+{
+ SalLayout::AdjustLayout( rArgs );
+
+ if( rArgs.mpDXArray )
+ ApplyDXArray( rArgs );
+ else if( rArgs.mnLayoutWidth )
+ Justify( rArgs.mnLayoutWidth );
+}
+
+// -----------------------------------------------------------------------
+
+void GenericSalLayout::ApplyDXArray( ImplLayoutArgs& rArgs )
{
if( mnGlyphCount <= 0 )
return;
// determine cluster boundaries and x base offset
- int nChars = mnEndCharPos - mnMinCharPos;
- int* pLogCluster = (int*)alloca( nChars * sizeof(int) );
+ int nCharCount = rArgs.mnEndCharPos - rArgs.mnMinCharPos;
+ int* pLogCluster = (int*)alloca( nCharCount * sizeof(int) );
int i, n;
- for( i = 0; i < nChars; ++i )
- pLogCluster[ i ] = -1;
-
long nBasePointX = -1;
+ if( mnLayoutFlags & SAL_LAYOUT_FOR_FALLBACK )
+ nBasePointX = 0;
+ for( i = 0; i < nCharCount; ++i )
+ pLogCluster[ i ] = -1;
GlyphItem* pG = mpGlyphItems;
for( i = 0; i < mnGlyphCount; ++i, ++pG )
{
- n = pG->mnCharPos;
- if( n < mnEndCharPos )
- {
- if( (n -= mnMinCharPos) >= 0 )
- {
- pLogCluster[ n ] = i;
- if( nBasePointX < 0 )
- nBasePointX = pG->maLinearPos.X();
- }
- }
+ n = pG->mnCharPos - rArgs.mnMinCharPos;
+ if( (n < 0) || (nCharCount <= n) )
+ continue;
+ pLogCluster[ n ] = i;
+ if( nBasePointX < 0 )
+ nBasePointX = pG->maLinearPos.X();
}
// calculate adjusted cluster widths
@@ -914,18 +784,18 @@ void GenericSalLayout::ApplyDXArray( const long* pDXArray )
for( i = 0; i < mnGlyphCount; ++i )
pNewClusterWidths[ i ] = 0;
- for( i = 0; i < nChars; ++i )
- if( (n = pLogCluster[i]) >= 0 )
- break;
- long nOldPos = pDXArray[i] * mnUnitsPerPixel;
- pNewClusterWidths[ n ] = nOldPos;
- while( ++i < nChars )
+ bool bRTL;
+ for( rArgs.ResetPos(); rArgs.GetNextPos( &n, &bRTL ); )
{
- if( pLogCluster[i] >= 0 )
- n = pLogCluster[ i ];
- long nNewPos = pDXArray[i] * mnUnitsPerPixel;
- pNewClusterWidths[ n ] += nNewPos - nOldPos;
- nOldPos = nNewPos;
+ n -= rArgs.mnMinCharPos;
+ i = pLogCluster[ n ];
+ if( i >= 0 )
+ {
+ long nDelta = rArgs.mpDXArray[ n ] ;
+ if( n > 0 )
+ nDelta -= rArgs.mpDXArray[ n-1 ];
+ pNewClusterWidths[ i ] += nDelta * mnUnitsPerPixel;
+ }
}
// move cluster positions using the adjusted widths
@@ -939,7 +809,7 @@ void GenericSalLayout::ApplyDXArray( const long* pDXArray )
nDelta = nBasePointX + (nNewPos - pG->maLinearPos.X());
// right align in new space for RTL glyphs
if( pG->IsRTLGlyph() )
- pG->maLinearPos.X() += pNewClusterWidths[i] - pG->mnOrigWidth;
+ nDelta += pNewClusterWidths[i] - pG->mnOrigWidth;
}
pG->maLinearPos.X() += nDelta;
@@ -956,25 +826,13 @@ void GenericSalLayout::ApplyDXArray( const long* pDXArray )
void GenericSalLayout::Justify( long nNewWidth )
{
- int nCharCapacity = mnEndCharPos - mnMinCharPos;
- long* pCharWidths = (long*)alloca( nCharCapacity * sizeof(long) );
- if( !GetCharWidths( pCharWidths ) )
- return;
-
nNewWidth *= mnUnitsPerPixel;
- int nOldWidth = FillDXArray( NULL );
+ int nOldWidth = GetTextWidth();
if( !nOldWidth || nNewWidth==nOldWidth )
return;
// find rightmost glyph, it won't get stretched
- GlyphItem* pG = mpGlyphItems;
- for( pG += mnGlyphCount; --pG > mpGlyphItems; )
- {
- int n = pG->mnCharPos;
- if( (n >= mnMinCharPos) || (n < mnEndCharPos) )
- break;
- }
- GlyphItem* pGRight = pG;
+ GlyphItem* pGRight = mpGlyphItems + mnGlyphCount - 1;
// move rightmost glyph to requested position, correct adjustment widths
nOldWidth -= pGRight->mnOrigWidth;
@@ -985,16 +843,13 @@ void GenericSalLayout::Justify( long nNewWidth )
pGRight->maLinearPos.X() = nBasePos + nNewWidth;
// interpolate inbetween glyph positions
+ GlyphItem* pG;
double fFactor = (double)nNewWidth / nOldWidth;
for( pG = mpGlyphItems; pG < pGRight; ++pG )
{
- int n = pG->mnCharPos;
- if( (n >= mnMinCharPos) || (n < mnEndCharPos) )
- {
- long nOldPos = pG->maLinearPos.X();
- long nNewPos = nBasePos + (long)(fFactor * (nOldPos - nBasePos) + 0.5);
- pG->maLinearPos.X() += nNewPos - nOldPos;
- }
+ long nOldPos = pG->maLinearPos.X();
+ long nNewPos = nBasePos + (long)(fFactor * (nOldPos - nBasePos) + 0.5);
+ pG->maLinearPos.X() += nNewPos - nOldPos;
}
// adjust new glyph advance widths to glyph movements above,
@@ -1101,13 +956,12 @@ void GenericSalLayout::KashidaJustify( long nKashidaIndex, int nKashidaWidth )
// -----------------------------------------------------------------------
-void GenericSalLayout::GetCaretPositions( long* pCaretXArray ) const
+void GenericSalLayout::GetCaretPositions( int nMaxIndex, long* pCaretXArray ) const
{
// initialize result array
- const int nMaxIdx = 2 * (mnEndCharPos - mnMinCharPos);
long nXPos = -1;
int i;
- for( i = 0; i < nMaxIdx; ++i )
+ for( i = 0; i < nMaxIndex; ++i )
pCaretXArray[ i ] = nXPos;
// calculate caret positions using glyph array
@@ -1117,38 +971,19 @@ void GenericSalLayout::GetCaretPositions( long* pCaretXArray ) const
nXPos = pG->maLinearPos.X();
long nXRight = nXPos + pG->mnOrigWidth;
int n = pG->mnCharPos;
- if( (n >= mnMinCharPos) && (n < mnEndCharPos) )
+ int nCurrIdx = 2 * (n - mnMinCharPos);
+ if( !pG->IsRTLGlyph() )
{
- int nCurrIdx = 2 * (n - mnMinCharPos);
- if( !pG->IsRTLGlyph() )
- {
- // normal positions for LTR case
- pCaretXArray[ nCurrIdx ] = nXPos;
- pCaretXArray[ nCurrIdx+1 ] = nXRight;
- }
- else
- {
-
- // reverse positions for RTL case
- pCaretXArray[ nCurrIdx ] = nXRight;
- pCaretXArray[ nCurrIdx+1 ] = nXPos;
- }
+ // normal positions for LTR case
+ pCaretXArray[ nCurrIdx ] = nXPos;
+ pCaretXArray[ nCurrIdx+1 ] = nXRight;
}
- }
-
-
- // fixup unknown caret positions
- for( i = 0; i < nMaxIdx; ++i )
- if( pCaretXArray[ i ] >= 0 )
- break;
- nXPos = pCaretXArray[ i ];
-
- for( i = 0; i < nMaxIdx; ++i )
- {
- if( pCaretXArray[ i ] >= 0 )
- nXPos = pCaretXArray[ i ];
else
- pCaretXArray[ i ] = nXPos;
+ {
+ // reverse positions for RTL case
+ pCaretXArray[ nCurrIdx ] = nXRight;
+ pCaretXArray[ nCurrIdx+1 ] = nXPos;
+ }
}
}
@@ -1184,9 +1019,8 @@ int GenericSalLayout::GetNextGlyphs( int nLen, long* pGlyphs, Point& rPos,
for(; nStart < mnGlyphCount; ++nStart, ++pG )
{
int n = pG->mnCharPos;
- if( n < mnMinCharPos || n >= mnEndCharPos )
- continue;
- break;
+ if( (mnMinCharPos <= n) && (n < mnEndCharPos) )
+ break;
}
// return zero if no more glyph found
@@ -1202,21 +1036,23 @@ int GenericSalLayout::GetNextGlyphs( int nLen, long* pGlyphs, Point& rPos,
long nOldFlags = pG->mnGlyphIndex;
while( nCount < nLen )
{
+ // update return data with glyph info
+ ++nCount;
*(pGlyphs++) = pG->mnGlyphIndex;
- if( pGlyphAdvAry )
- *(pGlyphAdvAry++) = pG->mnNewWidth;
if( pCharPosAry )
*(pCharPosAry++) = pG->mnCharPos;
- ++nCount;
+ if( pGlyphAdvAry )
+ *(pGlyphAdvAry++) = pG->mnNewWidth;
if( ++nStart >= mnGlyphCount )
break;
// stop when x-position is unexpected
- if( !pGlyphAdvAry && (pG->mnOrigWidth != pG->mnNewWidth) )
- break;
-
+ long nXPos = pG->maLinearPos.X();
++pG;
+ if( !pGlyphAdvAry )
+ if( pG->mnOrigWidth != (pG->maLinearPos.X() - nXPos) )
+ break;
// stop when y-position is unexpected
if( nYPos != pG->maLinearPos.Y() )
@@ -1224,7 +1060,7 @@ int GenericSalLayout::GetNextGlyphs( int nLen, long* pGlyphs, Point& rPos,
// stop when no longer in string
int n = pG->mnCharPos;
- if( (n < mnMinCharPos) || (n >= mnEndCharPos) )
+ if( (n < mnMinCharPos) || (mnEndCharPos <= n) )
break;
// stop when glyph flags change
@@ -1241,14 +1077,62 @@ int GenericSalLayout::GetNextGlyphs( int nLen, long* pGlyphs, Point& rPos,
return nCount;
}
+// -----------------------------------------------------------------------
+
+void GenericSalLayout::MoveGlyph( int nStart, long nNewXPos )
+{
+ if( nStart >= mnGlyphCount )
+ return;
+ GlyphItem* pG = mpGlyphItems + nStart;
+ long nXDelta = nNewXPos - pG->maLinearPos.X();
+ if( nXDelta != 0 )
+ {
+ GlyphItem* const pGEnd = mpGlyphItems + mnGlyphCount;
+ for(; pG < pGEnd; ++pG )
+ pG->maLinearPos.X() += nXDelta;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void GenericSalLayout::DropGlyph( int nStart )
+{
+ if( nStart >= mnGlyphCount )
+ return;
+ GlyphItem* pG = mpGlyphItems + nStart;
+ pG->mnGlyphIndex = GF_DROPPED;
+ pG->mnCharPos = -1;
+}
+
+// -----------------------------------------------------------------------
+
+void GenericSalLayout::Simplify( bool bIsBase )
+{
+ long nDropMarker = bIsBase ? GF_DROPPED : 0;
+
+ // remove dropped glyphs inplace
+ GlyphItem* pGDst = mpGlyphItems;
+ const GlyphItem* pGSrc = mpGlyphItems;
+ const GlyphItem* pGEnd = mpGlyphItems + mnGlyphCount;
+ for(; pGSrc < pGEnd; ++pGSrc )
+ {
+ if( pGSrc->mnGlyphIndex == nDropMarker )
+ continue;
+ if( pGDst != pGSrc )
+ *pGDst = *pGSrc;
+ ++pGDst;
+ }
+ mnGlyphCount = pGDst - mpGlyphItems;
+}
+
// =======================================================================
-MultiSalLayout::MultiSalLayout( const ImplLayoutArgs& rArgs, SalLayout& rLayout )
-: SalLayout( rArgs ),
+MultiSalLayout::MultiSalLayout( SalLayout& rBaseLayout )
+: SalLayout(),
mnLevel( 0 )
{
- if( &rLayout )
- mpLayouts[ mnLevel++ ] = &rLayout;
+ mpLayouts[ mnLevel++ ] = &rBaseLayout;
+ mnUnitsPerPixel = rBaseLayout.GetUnitsPerPixel();
}
// -----------------------------------------------------------------------
@@ -1261,27 +1145,154 @@ MultiSalLayout::~MultiSalLayout()
// -----------------------------------------------------------------------
-bool MultiSalLayout::ApplyFallback( SalLayout& rFallback )
+bool MultiSalLayout::AddFallback( SalLayout& rFallback )
{
- if( !&rFallback )
- return false;
if( mnLevel >= MAX_FALLBACK )
return false;
- mpLayouts[ mnLevel ] = &rFallback;
- if( ++mnLevel > 1 )
+ // TODO: remove test below when issues are fixed
+ if( mnUnitsPerPixel != rFallback.GetUnitsPerPixel() )
+ return false;
+
+ mpLayouts[ mnLevel++ ] = &rFallback;
+ return true;
+}
+
+// -----------------------------------------------------------------------
+
+bool MultiSalLayout::LayoutText( ImplLayoutArgs& rArgs )
+{
+ if( mnLevel <= 1 )
+ return false;
+
+ // prepare "merge sort"
+ int nStartOld[ MAX_FALLBACK ];
+ int nStartNew[ MAX_FALLBACK ];
+ int nCharPos[ MAX_FALLBACK ];
+ long nGlyphAdv[ MAX_FALLBACK ];
+ int nValid[ MAX_FALLBACK ];
+
+ long nDummy;
+ Point aPos;
+ int nLevel = 0, n;
+ for( n = 0; n < mnLevel; ++n )
{
- if( !mpLayouts[0]->ApplyFallback( rFallback ) )
+ mpLayouts[n]->SalLayout::AdjustLayout( rArgs );
+ if( n > 0 )
+ mpLayouts[n]->Simplify( false );
+ nStartNew[ nLevel ] = nStartOld[ nLevel ] = 0;
+ nValid[ nLevel ] = mpLayouts[n]->GetNextGlyphs( 1, &nDummy, aPos,
+ nStartNew[ nLevel ], &nGlyphAdv[ nLevel ], &nCharPos[ nLevel ] );
+ // release unused fallbacks
+ if( nValid[ nLevel ] || !n )
+ mpLayouts[ nLevel++ ] = mpLayouts[ n ];
+ else
+ mpLayouts[ n ]->Release();
+ }
+ mnLevel = nLevel;
+ if( mnLevel <= 1 )
+ return false;
+
+ // merge the fallback levels
+ // TODO: replace O(m*n) algorithm
+ long nXPos = 0;
+ bool bRightToLeft;
+ int nMinRunPos, nEndRunPos;
+ bool bRC = rArgs.GetNextRun( &nMinRunPos, &nEndRunPos, &bRightToLeft );
+ DBG_ASSERT( bRC, "MultiSalLayout rArgs.GNR() returned false" );
+ while( nValid[0] )
+ {
+ if( (nCharPos[0] < nMinRunPos) || (nEndRunPos <= nCharPos[0]) )
{
- rFallback.Release();
- mpLayouts[ --mnLevel ] = NULL;
+ // no fallback necessary => use base layout
+ n = 0;
+ }
+ else // fallback has been requested
+ {
+ // find match in highest level fallback
+ for( n = 1; n < nLevel; ++n )
+ if( nValid[n] && (nCharPos[0] == nCharPos[n]) )
+ break;
+
+ if( n < nLevel )
+ {
+ // update position of fallback glyph
+ mpLayouts[n]->MoveGlyph( nStartOld[n], nXPos );
+ }
+ else // if needed keep NotDef from base layout
+ n = 0;
+ }
+
+ // use glyph from best matching layout
+ nXPos += nGlyphAdv[n];
+ nStartOld[n] = nStartNew[n];
+ nValid[n] = mpLayouts[n]->GetNextGlyphs( 1, &nDummy, aPos,
+ nStartNew[n], &nGlyphAdv[n], &nCharPos[n] );
+
+ if( n > 0 ) // glyph fallback succeeded
+ {
+ // when fallback level is completed, performance optimize
+ if( !nValid[n] && (n >= nLevel-1) )
+ nLevel = nLevel - 1;
+ // drop NotDef glyph from base layout
+ mpLayouts[0]->DropGlyph( nStartOld[0] );
+ mpLayouts[0]->MoveGlyph( nStartNew[0], nXPos );
+ nStartOld[0] = nStartNew[0];
+ nValid[0] = mpLayouts[0]->GetNextGlyphs( 1, &nDummy, aPos,
+ nStartNew[0], &nGlyphAdv[0], &nCharPos[0] );
+ // use next run if current one is done
+ if( (nCharPos[0] < nMinRunPos) || (nEndRunPos <= nCharPos[0]) )
+ if( !rArgs.GetNextRun( &nMinRunPos, &nEndRunPos, &bRightToLeft ) )
+ break;
}
}
+
+ mpLayouts[0]->Simplify( true );
return true;
}
// -----------------------------------------------------------------------
+void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
+{
+ SalLayout::AdjustLayout( rArgs );
+
+ const long* pOrigArray = rArgs.mpDXArray;
+ if( !rArgs.mpDXArray && rArgs.mnLayoutWidth )
+ {
+ // for MultiSalLayout justification needs to be converted
+ // to individual adjustments of virtual character widths
+ int nCharCount = rArgs.mnEndCharPos - rArgs.mnMinCharPos;
+ long* pJustArray = (long*)alloca( nCharCount * sizeof(long) );
+ long nOrigWidth = FillDXArray( pJustArray );
+ if( nOrigWidth && (rArgs.mnLayoutWidth != nOrigWidth) )
+ {
+ const float fStretch = rArgs.mnLayoutWidth / (float)nOrigWidth;
+ for( int i = 0; i < nCharCount; ++i )
+ pJustArray[i] = (long)(pJustArray[i] * fStretch);
+ // temporarily change the pDXArray
+ rArgs.mpDXArray = pJustArray;
+ }
+ }
+
+ for( int i = mnLevel; --i >= 0; )
+ {
+ SalLayout& rLayout = *mpLayouts[ i ];
+ rLayout.AdjustLayout( rArgs );
+ }
+ rArgs.mpDXArray = pOrigArray;
+}
+
+// -----------------------------------------------------------------------
+
+void MultiSalLayout::InitFont() const
+{
+ if( mnLevel > 0 )
+ mpLayouts[0]->InitFont();
+}
+
+// -----------------------------------------------------------------------
+
void MultiSalLayout::DrawText( SalGraphics& rGraphics ) const
{
for( int i = mnLevel; --i >= 0; )
@@ -1293,70 +1304,88 @@ void MultiSalLayout::DrawText( SalGraphics& rGraphics ) const
rLayout.DrawText( rGraphics );
rLayout.DrawOffset() -= maDrawOffset;
}
+ // NOTE: now the baselevel font is active again
}
-// -----------------------------------------------------------------------
+ // -----------------------------------------------------------------------
int MultiSalLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const
{
- // TODO: merge multiple fallback levels
- SalLayout& rLayout = *mpLayouts[ 0 ];
- int nRetVal = rLayout.GetTextBreak( nMaxWidth, nCharExtra, nFactor );
- return nRetVal;
+ if( mnLevel <= 0 )
+ return STRING_LEN;
+ if( mnLevel == 1 )
+ return mpLayouts[0]->GetTextBreak( nMaxWidth, nCharExtra, nFactor );
+
+ int nCharCount = mnEndCharPos - mnMinCharPos;
+ long* pCharWidths = (long*)alloca( 2*nCharCount * sizeof(long) );
+ mpLayouts[0]->FillDXArray( pCharWidths );
+
+ for( int n = 1; n < mnLevel; ++n )
+ {
+ SalLayout& rLayout = *mpLayouts[ n ];
+ rLayout.FillDXArray( pCharWidths + nCharCount );
+ for( int i = 0; i < nCharCount; ++i )
+ pCharWidths[ i ] += pCharWidths[ i + nCharCount ];
+ }
+
+ // TODO: fix nUnitsPerPixel cases
+ long nWidth = 0;
+ for( int i = 0; i < nCharCount; ++i )
+ {
+ nWidth += pCharWidths[ i ] * nFactor;
+ if( nWidth > nMaxWidth )
+ return (i + mnMinCharPos);
+ nWidth += nCharExtra;
+ }
+
+ return STRING_LEN;
}
// -----------------------------------------------------------------------
-long MultiSalLayout::FillDXArray( long* pDXArray ) const
+long MultiSalLayout::FillDXArray( long* pCharWidths ) const
{
- SalLayout& rLayout = *mpLayouts[ 0 ];
- int nWidth = rLayout.FillDXArray( pDXArray );
+ long nMaxWidth = mpLayouts[0]->FillDXArray( pCharWidths );
if( mnLevel > 1 )
{
- if( !pDXArray )
- for( int n = 1; n < mnLevel; ++n )
- nWidth += mpLayouts[ n ]->FillDXArray( NULL );
- else
+ const int nCharCount = mnEndCharPos - mnMinCharPos;
+ long* pTempWidths = NULL;
+ if( pCharWidths )
+ pTempWidths = (long*)alloca( nCharCount * sizeof(long) );
+ for( int n = 1; n < mnLevel; ++n )
{
- int nCharCapacity = mnEndCharPos - mnMinCharPos, i;
- long* pCharWidths = (long*)alloca( nCharCapacity * sizeof(long) );
- for( i = nCharCapacity-1; --i >= 0; )
- pDXArray[i+1] -= pDXArray[i];
- for( int n = 1; n < mnLevel; ++n )
- {
- nWidth += mpLayouts[ n ]->FillDXArray( pCharWidths );
- // TODO: merge the loops
- for( i = nCharCapacity-1; --i >= 0; )
- pCharWidths[i+1] -= pCharWidths[i];
- for( i = 0; i < nCharCapacity; ++i )
- pDXArray[ i ] += pCharWidths[ i ];
- }
- for( i = 1; i < nCharCapacity; ++i )
- pDXArray[ i ] += pDXArray[ i-1 ];
+ long nWidth = mpLayouts[n]->FillDXArray( pTempWidths );
+ if( nMaxWidth < nWidth )
+ nMaxWidth = nWidth;
+ if( pCharWidths )
+ for( int i = 0; i < nCharCount; ++i )
+ pCharWidths[ i ] += pTempWidths[ i ];
}
}
- return nWidth;
+ return nMaxWidth;
}
// -----------------------------------------------------------------------
-Point MultiSalLayout::GetCharPosition( int nCharIndex, bool bRTL ) const
+void MultiSalLayout::GetCaretPositions( int nMaxIndex, long* pCaretXArray ) const
{
- // TODO: merge multiple fallback levels
SalLayout& rLayout = *mpLayouts[ 0 ];
- Point aPoint = rLayout.GetCharPosition( nCharIndex, bRTL );
- return aPoint;
-}
+ rLayout.GetCaretPositions( nMaxIndex, pCaretXArray );
-// -----------------------------------------------------------------------
-
-void MultiSalLayout::GetCaretPositions( long* pCaretXArray ) const
-{
- // TODO: merge multiple fallback levels
- SalLayout& rLayout = *mpLayouts[ 0 ];
- rLayout.GetCaretPositions( pCaretXArray );
+ if( mnLevel > 1 )
+ {
+ long* pTempPos = (long*)alloca( nMaxIndex * sizeof(long) );
+ for( int n = 1; n < mnLevel; ++n )
+ {
+ mpLayouts[ n ]->GetCaretPositions( nMaxIndex, pTempPos );
+ // TODO: fix exotic cases like partly fallback
+ for( int i = 0; i < nMaxIndex; ++i )
+ if( pTempPos[i] >= 0 )
+ pCaretXArray[i] = pTempPos[i];
+ }
+ }
}
// -----------------------------------------------------------------------
@@ -1374,6 +1403,7 @@ int MultiSalLayout::GetNextGlyphs( int nLen, long* pGlyphIdxAry, Point& rPos,
for(; nLevel < mnLevel; ++nLevel, nStart=0 )
{
SalLayout& rLayout = *mpLayouts[ nLevel ];
+ rLayout.InitFont();
int nRetVal = rLayout.GetNextGlyphs( nLen, pGlyphIdxAry, rPos,
nStart, pGlyphAdvAry, pCharPosAry );
if( nRetVal )
@@ -1421,8 +1451,11 @@ bool MultiSalLayout::GetBoundRect( SalGraphics& rGraphics, Rectangle& rRect ) co
rLayout.DrawBase() = maDrawBase;
rLayout.DrawOffset() += maDrawOffset;
rLayout.InitFont();
- bRet |= rLayout.GetBoundRect( rGraphics, aRectangle );
- rRect.Union( aRectangle );
+ if( rLayout.GetBoundRect( rGraphics, aRectangle ) )
+ {
+ rRect.Union( aRectangle );
+ bRet = true;
+ }
rLayout.DrawOffset() -= maDrawOffset;
}
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index 6f597ccf8e49..76007fe593ef 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -2,8 +2,8 @@
*
* $RCSfile: gcach_ftyp.cxx,v $
*
- * $Revision: 1.87 $
- * last change: $Author: hdu $ $Date: 2002-12-12 18:12:50 $
+ * $Revision: 1.88 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -124,8 +124,12 @@ static FontFileList aFontFileList;
// -----------------------------------------------------------------------
// TODO: remove when the priorities are selected by UI
-// if (AH prio == AA prio) => antialias + autohint
-// if AH<AA => do not autohint when antialiasing
+// if (AH==0) => disable autohinting
+// if (AA==0) => disable antialiasing
+// if (EB==0) => disable embedded bitmaps
+// if (AA prio <= AH prio) => antialias + autohint
+// if (AH<AA) => do not autohint when antialiasing
+// if (EB<AH) => do not autohint for monochrome
static int nPrioEmbedded = 2;
static int nPrioAutoHint = 1;
static int nPrioAntiAlias = 1;
@@ -392,7 +396,6 @@ long FreetypeManager::AddFontDir( const String& rUrlName )
OSL_VERIFY( osl_File_E_None
== ::osl::FileBase::getSystemPathFromFileURL( aFileStatus.getFileURL(), aUSytemPath ));
::rtl::OString aCFileName = rtl::OUStringToOString( aUSytemPath, theEncoding );
-
const char* pszFontFileName = aCFileName.getStr();
FT_FaceRec_* aFaceFT = NULL;
@@ -601,6 +604,9 @@ FreetypeServerFont::FreetypeServerFont( const ImplFontSelectData& rFSD, FtFontIn
if( nPrioAutoHint <= 0 )
#endif
mnLoadFlags |= FT_LOAD_NO_HINTING;
+
+ if( (nCos!=0 && nSin!=0) || (nPrioEmbedded <= 0) )
+ mnLoadFlags |= FT_LOAD_NO_BITMAP;
}
// -----------------------------------------------------------------------
@@ -644,6 +650,7 @@ void FreetypeServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor
const FT_Size_Metrics& rMetrics = maFaceFT->size->metrics;
rTo.mnAscent = (+rMetrics.ascender + 32) >> 6;
#if (FTVERSION < 2000)
+
rTo.mnDescent = (+rMetrics.descender + 32) >> 6;
#else
rTo.mnDescent = (-rMetrics.descender + 32) >> 6;
@@ -843,12 +850,13 @@ int FreetypeServerFont::FixupGlyphIndex( int nGlyphIndex, sal_Unicode aChar ) co
nGlyphFlags |= GF_UNHINTED;
#endif
- if( nGlyphIndex !=0 )
+ if( nGlyphIndex != 0 )
nGlyphIndex |= nGlyphFlags;
return nGlyphIndex;
}
+
// -----------------------------------------------------------------------
int FreetypeServerFont::GetGlyphIndex( sal_Unicode aChar ) const
@@ -951,7 +959,7 @@ bool FreetypeServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap
nLoadFlags &= ~FT_LOAD_NO_HINTING;
#endif
- if( (nCos!=0 && nSin!=0) || (nPrioEmbedded <= nPrioAutoHint) )
+ if( nPrioEmbedded <= nPrioAutoHint )
nLoadFlags |= FT_LOAD_NO_BITMAP;
FT_Error rc = -1;
@@ -1043,7 +1051,7 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
nLoadFlags |= FT_LOAD_NO_HINTING;
#endif
- if( (nCos!=0 && nSin!=0) || (nPrioEmbedded <= nPrioAntiAlias) )
+ if( nPrioEmbedded <= nPrioAntiAlias )
nLoadFlags |= FT_LOAD_NO_BITMAP;
FT_Error rc = -1;
@@ -1495,7 +1503,6 @@ void PolyArgs::ClosePolygon()
Polygon aPoly( mnPoints, mpPointAry, (bHasOffline ? mpFlagAry : NULL) );
mrPolyPoly.Insert( aPoly );
-
mnPoints = 0;
bHasOffline = false;
}
@@ -1652,6 +1659,7 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
const USHORT nCntLangSystem = GetUShort( pScriptTable+2 );
pScriptTable += 4;
USHORT nLangsysOffset = 0;
+
for( USHORT nLangsysIndex = 0; nLangsysIndex < nCntLangSystem; ++nLangsysIndex )
{
const ULONG nTag = GetUInt( pScriptTable+0 ); // e.g. KOR/ZHS/ZHT/JAN
diff --git a/vcl/source/glyphs/gcach_layout.cxx b/vcl/source/glyphs/gcach_layout.cxx
index 61d9fe095d0f..1274cde44af6 100755
--- a/vcl/source/glyphs/gcach_layout.cxx
+++ b/vcl/source/glyphs/gcach_layout.cxx
@@ -2,8 +2,8 @@
*
* $RCSfile: gcach_layout.cxx,v $
*
- * $Revision: 1.19 $
- * last change: $Author: hdu $ $Date: 2002-12-12 13:49:17 $
+ * $Revision: 1.20 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -68,6 +68,7 @@
#endif
#ifndef _SV_GCACHFTYP_HXX
+#include <freetype/freetype.h>
#include <gcach_ftyp.hxx>
#endif
@@ -92,19 +93,16 @@ static ServerFontLayoutEngine aSimpleLayoutEngine;
// layout implementation for ServerFont
// =======================================================================
-ServerFontLayout::ServerFontLayout( ImplLayoutArgs& rArgs, ServerFont& rFont )
-: GenericSalLayout( rArgs ),
- mrServerFont( rFont )
-{
- LayoutText( rArgs );
-}
+ServerFontLayout::ServerFontLayout( ServerFont& rFont )
+: mrServerFont( rFont )
+{}
// -----------------------------------------------------------------------
bool ServerFontLayout::LayoutText( ImplLayoutArgs& rArgs )
{
ServerFontLayoutEngine* pLE = NULL;
- if( ~rArgs.mnFlags & (SAL_LAYOUT_COMPLEX_DISABLED|SAL_LAYOUT_BIDI_STRONG) )
+ if( ~rArgs.mnFlags & SAL_LAYOUT_COMPLEX_DISABLED )
pLE = mrServerFont.GetLayoutEngine();
if( !pLE )
pLE = &aSimpleLayoutEngine;
@@ -113,6 +111,36 @@ bool ServerFontLayout::LayoutText( ImplLayoutArgs& rArgs )
return bRet;
}
+// -----------------------------------------------------------------------
+
+void ServerFontLayout::AdjustLayout( ImplLayoutArgs& rArgs )
+{
+ SalLayout::AdjustLayout( rArgs );
+
+ // general justification
+ if( rArgs.mpDXArray )
+ ApplyDXArray( rArgs );
+ else if( rArgs.mnLayoutWidth )
+ Justify( rArgs.mnLayoutWidth );
+
+ // asian kerning
+ if( (rArgs.mnFlags & SAL_LAYOUT_KERNING_ASIAN)
+ && !(rArgs.mnFlags & SAL_LAYOUT_VERTICAL) )
+ ApplyAsianKerning( rArgs.mpStr, rArgs.mnLength );
+
+ // kashida justification
+ if( rArgs.mnFlags & SAL_LAYOUT_KASHIDA_JUSTIFICATON )
+ {
+ int nKashidaIndex = mrServerFont.GetGlyphIndex( 0x0640 );
+ if( nKashidaIndex != 0 )
+ {
+ const GlyphMetric& rGM = mrServerFont.GetGlyphMetric( nKashidaIndex );
+ KashidaJustify( nKashidaIndex, rGM.GetCharWidth() );
+ // TODO: kashida-GSUB/GPOS
+ }
+ }
+}
+
// =======================================================================
bool ServerFontLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rArgs )
@@ -132,9 +160,10 @@ bool ServerFontLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutAr
if( bRightToLeft )
cChar = GetMirroredChar( cChar );
int nGlyphIndex = rFont.GetGlyphIndex( cChar );
- // update fallback_runs if needed
+ // when glyph fallback is needed update LayoutArgs
if( !nGlyphIndex )
- rArgs.NeedFallback( nCharPos, bRightToLeft );
+ if( !rArgs.NeedFallback( nCharPos, bRightToLeft ) )
+ continue;
// apply pair kerning if requested
if( SAL_LAYOUT_KERNING_PAIRS & rArgs.mnFlags )
@@ -154,17 +183,6 @@ bool ServerFontLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutAr
rLayout.AppendGlyph( aGI );
}
- // apply asian kerning if requested
- if( (rArgs.mnFlags & SAL_LAYOUT_KERNING_ASIAN)
- && !(rArgs.mnFlags & SAL_LAYOUT_VERTICAL)
- && !rArgs.mpDXArray
- && !rArgs.mnLayoutWidth )
- rLayout.ApplyAsianKerning( rArgs.mpStr, rArgs.mnLength );
-
- if( rArgs.mpDXArray )
- rLayout.ApplyDXArray( rArgs.mpDXArray );
- else if( rArgs.mnLayoutWidth )
- rLayout.Justify( rArgs.mnLayoutWidth );
return true;
}
@@ -220,7 +238,6 @@ public:
virtual void transformFunits( float xFunits, float yFunits, LEPoint &pixels ) const;
};
-
// -----------------------------------------------------------------------
const void* IcuFontFromServerFont::getFontTable( LETag nICUTableTag ) const
@@ -267,7 +284,6 @@ void IcuFontFromServerFont::mapCharsToGlyphs( const LEUnicode pChars[],
if( !bReverse )
pMapper = NULL;
for( int i = 0; i < nCount; ++i )
-
pGlyphs[i] = mapCharToGlyph( pChars[nOffset+i], pMapper );
if( bReverse )
@@ -461,12 +477,13 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr
pIcuChars[ic] = static_cast<LEUnicode>( rArgs.mpStr[ic] );
}
- // allocate temporary arrays
- int nGlyphCapacity = 3 * (rArgs.mnEndCharPos - rArgs.mnMinCharPos ) + 16;
+ // allocate temporary arrays, note: round to even
+ int nGlyphCapacity = (3 * (rArgs.mnEndCharPos - rArgs.mnMinCharPos ) | 15) + 1;
+
struct IcuPosition{ float fX, fY; };
const int nAllocSize = sizeof(LEGlyphID) + sizeof(le_int32) + sizeof(IcuPosition);
LEGlyphID* pIcuGlyphs = (LEGlyphID*)alloca( nGlyphCapacity * nAllocSize + sizeof(IcuPosition) );
- le_int32* pCharIndices = (le_int32*)((char*)pIcuGlyphs + nGlyphCapacity * sizeof(le_int32) );
+ le_int32* pCharIndices = (le_int32*)((char*)pIcuGlyphs + nGlyphCapacity * sizeof(LEGlyphID) );
IcuPosition* pGlyphPositions = (IcuPosition*)((char*)pCharIndices + nGlyphCapacity * sizeof(le_int32) );
UErrorCode rcI18n = U_ZERO_ERROR;
@@ -515,7 +532,7 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr
mpIcuLE->getGlyphs( pIcuGlyphs, rcIcu );
mpIcuLE->getCharIndices( pCharIndices, rcIcu );
mpIcuLE->getGlyphPositions( &pGlyphPositions->fX, rcIcu );
- mpIcuLE->reset();
+ mpIcuLE->reset(); // TODO: get rid of this, PROBLEM: crash at exit when removed
if( LE_FAILURE(rcIcu) )
return false;
@@ -527,9 +544,10 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr
{
int nCharPos = pCharIndices[i] + nMinRunPos;
int nGlyphIndex = pIcuGlyphs[i];
- // update fallback_runs if needed
+ // when glyph fallback is needed update LayoutArgs
if( !nGlyphIndex )
- rArgs.NeedFallback( nCharPos, bRightToLeft );
+ if( !rArgs.NeedFallback( nCharPos, bRightToLeft ) )
+ continue;
// apply vertical flags, etc.
sal_Unicode aChar = rArgs.mpStr[ nCharPos ];
@@ -548,25 +566,10 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr
nGlyphCount += nRunGlyphCount;
}
- // general justification
- if( rArgs.mpDXArray )
- rLayout.ApplyDXArray( rArgs.mpDXArray );
- else if( rArgs.mnLayoutWidth )
- rLayout.Justify( rArgs.mnLayoutWidth );
-
- // kashida justification
+ // determine need for kashida justification
if( (rArgs.mpDXArray || rArgs.mnLayoutWidth)
&& ((meScriptCode == arabScriptCode) || (meScriptCode == syrcScriptCode)) )
- {
- LEGlyphID nKashidaIndex = maIcuFont.mapCharToGlyph( 0x0640, NULL );
- if( nKashidaIndex != 0 )
- {
- LEPoint aAdvance;
- maIcuFont.getGlyphAdvance( nKashidaIndex, aAdvance );
- rLayout.KashidaJustify( nKashidaIndex, (long)aAdvance.fX );
- // TODO: kashida-GSUB/GPOS
- }
- }
+ rArgs.mnFlags |= SAL_LAYOUT_KASHIDA_JUSTIFICATON;
return true;
}
@@ -579,7 +582,7 @@ ServerFontLayoutEngine* FreetypeServerFont::GetLayoutEngine()
{
// find best layout engine for font, platform, script and language
#ifdef ENABLE_ICU_LAYOUT
- if( !mpLayoutEngine )
+ if( !mpLayoutEngine && FT_IS_SFNT( maFaceFT ) )
mpLayoutEngine = new IcuLayoutEngine( *this );
#endif // ENABLE_ICU_LAYOUT
diff --git a/vcl/source/glyphs/glyphcache.cxx b/vcl/source/glyphs/glyphcache.cxx
index fc3a1b14f2d2..dc16a24e3db3 100644
--- a/vcl/source/glyphs/glyphcache.cxx
+++ b/vcl/source/glyphs/glyphcache.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: glyphcache.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: hdu $ $Date: 2002-12-04 18:31:52 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -87,6 +87,7 @@ GlyphCache::GlyphCache( ULONG nMaxSize )
: mnMaxSize(nMaxSize),
mnBytesUsed(sizeof(GlyphCache)),
mnLruIndex(0),
+ mnGlyphCount(0),
mpFtManager(NULL),
mpCurrentGCFont(NULL)
{
@@ -164,7 +165,12 @@ void GlyphCache::RemoveFont( const ImplFontData* pFontData )
if( pFontData != it->first.mpFontData )
++it;
else
+ {
+ const ServerFont* pSF = it->second;
+ if( pSF )
+ mnBytesUsed -= pSF->GetByteCount();
maFontList.erase( it++ );
+ }
}
}
@@ -226,7 +232,8 @@ ServerFont* GlyphCache::CacheFont( const ImplFontSelectData& rFontSelData )
if( it != maFontList.end() )
{
ServerFont* pFound = it->second;
- pFound->AddRef();
+ if( pFound )
+ pFound->AddRef();
return pFound;
}
@@ -236,21 +243,25 @@ ServerFont* GlyphCache::CacheFont( const ImplFontSelectData& rFontSelData )
if( !pNew && mpFtManager )
pNew = mpFtManager->CreateFont( rFontSelData );
+ maFontList[ rFontSelData ] = pNew;
if( pNew )
{
- maFontList[ rFontSelData ] = pNew;
mnBytesUsed += pNew->GetByteCount();
// schedule it for garbage collection some time later
if( !mpCurrentGCFont )
{
mpCurrentGCFont = pNew;
+ pNew->mpNextGCFont = pNew;
pNew->mpPrevGCFont = pNew;
}
- pNew->mpNextGCFont = mpCurrentGCFont;
- pNew->mpPrevGCFont = mpCurrentGCFont->mpPrevGCFont;
- mpCurrentGCFont->mpPrevGCFont->mpNextGCFont = pNew;
- mpCurrentGCFont->mpPrevGCFont = pNew;
+ else
+ {
+ pNew->mpNextGCFont = mpCurrentGCFont;
+ pNew->mpPrevGCFont = mpCurrentGCFont->mpPrevGCFont;
+ pNew->mpPrevGCFont->mpNextGCFont = pNew;
+ mpCurrentGCFont->mpPrevGCFont = pNew;
+ }
}
return pNew;
@@ -266,7 +277,11 @@ void GlyphCache::UncacheFont( ServerFont& rServerFont )
ServerFont* pFont = const_cast<ServerFont*>( &rServerFont );
if( pFont->Release() <= 0 )
// lazy release
- pFont->GarbageCollect( mnLruIndex );
+#if 1 // TODO: decide on method depending on performance impact
+ {}
+#else
+ pFont->GarbageCollect( mnLruIndex - mnGlyphCount/2 );
+#endif
}
// -----------------------------------------------------------------------
@@ -275,7 +290,11 @@ ULONG GlyphCache::CalcByteCount() const
{
ULONG nCacheSize = sizeof(*this);
for( FontList::const_iterator it = maFontList.begin(); it != maFontList.end(); ++it )
- nCacheSize += it->second->GetByteCount();
+ {
+ const ServerFont* pSF = it->second;
+ if( pSF )
+ nCacheSize += pSF->GetByteCount();
+ }
// TODO: also account something for hashtable management
return nCacheSize;
}
@@ -288,15 +307,32 @@ void GlyphCache::GarbageCollect()
ServerFont* const pServerFont = mpCurrentGCFont;
mpCurrentGCFont = mpCurrentGCFont->mpNextGCFont;
- ULONG nBytesCollected;
- if( pServerFont->GetRefCount() > 0 )
+ if( !pServerFont )
+ return;
+
+ if( (pServerFont == mpCurrentGCFont) // no other fonts
+ || (pServerFont->GetRefCount() > 0) ) // font still used
{
// try to save at least a few bytes
- pServerFont->GarbageCollect( mnLruIndex );
+ pServerFont->GarbageCollect( mnLruIndex - mnGlyphCount/2 );
+
+ // when there is a lot of memory pressure also tighten maFontList
+ if( maFontList.size() >= 200 )
+ {
+ FontList::iterator it = maFontList.begin();
+ while( it != maFontList.end() )
+ {
+ if( !it->second )
+ maFontList.erase( it++ );
+ else
+ ++it;
+ }
+ }
}
else
{
- DBG_ASSERT( (pServerFont->GetRefCount() == 0), "GlyphCache::GC detected RefCount underflow" );
+ DBG_ASSERT( (pServerFont->GetRefCount() == 0),
+ "GlyphCache::GC detected RefCount underflow" );
// now its time to remove the unreferenced font
ServerFont* const pPrev = pServerFont->mpPrevGCFont;
@@ -304,10 +340,7 @@ void GlyphCache::GarbageCollect()
pPrev->mpNextGCFont = pNext;
pNext->mpPrevGCFont = pPrev;
- if( mpCurrentGCFont == pServerFont ) // no fonts left
- mpCurrentGCFont = NULL;
-
- pServerFont->GarbageCollect( ~mnLruIndex );
+ pServerFont->GarbageCollect( mnLruIndex+0x10000000 );
mpPeer->RemovingFont( *pServerFont );
mnBytesUsed -= pServerFont->GetByteCount();
maFontList.erase( pServerFont->GetFontSelData() );
@@ -324,12 +357,12 @@ inline void GlyphCache::UsingGlyph( ServerFont&, GlyphData& rGlyphData )
// -----------------------------------------------------------------------
-
inline void GlyphCache::AddedGlyph( ServerFont& rServerFont, GlyphData& rGlyphData )
{
UsingGlyph( rServerFont, rGlyphData );
mnBytesUsed += sizeof( rGlyphData );
GrowNotify();
+ ++mnGlyphCount;
}
// -----------------------------------------------------------------------
@@ -346,6 +379,7 @@ inline void GlyphCache::RemovingGlyph( ServerFont& rSF, GlyphData& rGD, int nGly
{
mpPeer->RemovingGlyph( rSF, rGD, nGlyphIndex );
mnBytesUsed -= sizeof( GlyphData );
+ --mnGlyphCount;
}
// =======================================================================
@@ -395,6 +429,7 @@ GlyphData& ServerFont::GetGlyphData( int nGlyphIndex )
// sometimes not => we need to create and initialize it ourselves
GlyphData& rGlyphData = maGlyphList[ nGlyphIndex ];
+ mnBytesUsed += sizeof( GlyphData );
InitGlyphData( nGlyphIndex, rGlyphData );
GlyphCache::GetInstance().AddedGlyph( *this, rGlyphData );
return rGlyphData;
@@ -402,12 +437,13 @@ GlyphData& ServerFont::GetGlyphData( int nGlyphIndex )
// -----------------------------------------------------------------------
-void ServerFont::GarbageCollect( long nLruIndex )
+void ServerFont::GarbageCollect( long nMinLruIndex )
{
- for( GlyphList::iterator it = maGlyphList.begin(); it != maGlyphList.end(); )
+ GlyphList::iterator it = maGlyphList.begin();
+ while( it != maGlyphList.end() )
{
GlyphData& rGD = it->second;
- if( (ULONG)(nLruIndex - rGD.GetLruValue()) > 200 ) // TODO: change constant
+ if( (nMinLruIndex - rGD.GetLruValue()) >= 0 )
{
mnBytesUsed -= sizeof( GlyphData );
GlyphCache::GetInstance().RemovingGlyph( *this, rGD, it->first );
@@ -416,6 +452,9 @@ void ServerFont::GarbageCollect( long nLruIndex )
else
++it;
}
+
+ if( mnBytesUsed < 0 )
+ mnBytesUsed = 0; // shouldn't happen
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/helper/makefile.mk b/vcl/source/helper/makefile.mk
index d1baca08cea3..db3138edfe3d 100644
--- a/vcl/source/helper/makefile.mk
+++ b/vcl/source/helper/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.9 $
+# $Revision: 1.10 $
#
-# last change: $Author: pl $ $Date: 2002-03-01 12:56:44 $
+# last change: $Author: hr $ $Date: 2003-03-27 17:58:14 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -83,6 +83,12 @@ SLOFILES=\
SLOFILES+=$(SLO)$/xconnection.obj
.ENDIF
+.IF "$(GUI)" == "UNX"
+SLOFILES+=\
+ $(SLO)$/ppdparser.obj \
+ $(SLO)$/strhelper.obj
+.ENDIF
+
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
diff --git a/vcl/source/src/btntext.src b/vcl/source/src/btntext.src
index 5a817f61b438..1b5ea7015097 100644
--- a/vcl/source/src/btntext.src
+++ b/vcl/source/src/btntext.src
@@ -2,9 +2,9 @@
*
* $RCSfile: btntext.src,v $
*
- * $Revision: 1.28 $
+ * $Revision: 1.29 $
*
- * last change: $Author: kz $ $Date: 2002-11-27 16:22:56 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -207,7 +207,7 @@ String SV_BUTTONTEXT_RETRY
TEXT[ dutch ] = "H~erhalen";
TEXT[ chinese_simplified ] = "é‡è¯•(~R)";
TEXT[ greek ] = "ÅðáíÜëçøç";
- TEXT[ korean ] = "반복(~R)";
+ TEXT[ korean ] = "다시 ì‹œë„(~R)";
TEXT[ turkish ] = "Y~inele";
TEXT[ language_user1 ] = " ";
TEXT[ catalan ] = "~Reintenta";
@@ -311,18 +311,18 @@ String SV_BUTTONTEXT_ABORT
Text[ russian ] = "~Abort";
Text[ greek ] = "~Abort";
Text[ dutch ] = "~Abort";
- Text[ french ] = "~Abort";
- Text[ spanish ] = "~Abort";
+ Text[ french ] = "~Interrompre";
+ Text[ spanish ] = "~Cancelar";
Text[ finnish ] = "~Abort";
- Text[ italian ] = "~Abort";
+ Text[ italian ] = "~Annulla";
Text[ danish ] = "~Abort";
- Text[ swedish ] = "~Abort";
+ Text[ swedish ] = "~Avbryt";
Text[ polish ] = "~Abort";
Text[ portuguese_brazilian ] = "~Abort";
- Text[ japanese ] = "~Abort";
- Text[ korean ] = "~Abort";
- Text[ chinese_simplified ] = "~Abort";
- Text[ chinese_traditional ] = "~Abort";
+ Text[ japanese ] = "中止(~A)";
+ Text[ korean ] = "중단(~A)";
+ Text[ chinese_simplified ] = "å–消(~A)";
+ Text[ chinese_traditional ] = "中止(~A)";
Text[ turkish ] = "~Abort";
Text[ arabic ] = "~Abort";
Text[ catalan ] = "~Abort";
@@ -373,3 +373,8 @@ RETRY ~Yritäuudelleen
+
+
+
+
+
diff --git a/vcl/source/src/helptext.src b/vcl/source/src/helptext.src
index 96096751c1a6..3108a83484e3 100644
--- a/vcl/source/src/helptext.src
+++ b/vcl/source/src/helptext.src
@@ -2,9 +2,9 @@
*
* $RCSfile: helptext.src,v $
*
- * $Revision: 1.28 $
+ * $Revision: 1.29 $
*
- * last change: $Author: kz $ $Date: 2002-12-09 09:59:44 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -307,7 +307,7 @@ String SV_HELPTEXT_ALWAYSVISIBLE
TEXT[ chinese_simplified ] = "自动显示";
TEXT[ chinese_traditional ] = "自動顯示";
TEXT[ greek ] = "ÐÜíôá ïñáôÜ";
- TEXT[ korean ] = "í•­ìƒ ë³´ìž„";
+ TEXT[ korean ] = "í•­ìƒ í‘œì‹œ";
TEXT[ arabic ] = "ãÑÆí ÏÇÆãÇð";
TEXT[ turkish ] = "Daima görünür";
TEXT[ language_user1 ] = " ";
@@ -391,7 +391,7 @@ String SV_HELPTEXT_SPLITFLOATING
TEXT[ chinese_simplified ] = "浮动";
TEXT[ chinese_traditional ] = "浮動";
TEXT[ greek ] = "Êéíçôü";
- TEXT[ korean ] = "ê³ ì •ë˜ì§€ ì•Šì€";
+ TEXT[ korean ] = "부ë™ì ";
TEXT[ arabic ] = "ÚÇÆã";
TEXT[ turkish ] = "Serbest";
TEXT[ language_user1 ] = " ";
@@ -435,22 +435,22 @@ String SV_SHORTCUT_HELP
TEXT[ english_us ] = "Help" ;
TEXT[ portuguese ] = "Help";
TEXT[ russian ] = "Help";
- TEXT[ spanish ] = "Help";
- TEXT[ italian ] = "Help";
- TEXT[ swedish ] = "Help";
+ TEXT[ spanish ] = "Ayuda";
+ TEXT[ italian ] = "Guida";
+ TEXT[ swedish ] = "Hjälp";
TEXT[ polish ] = "Help";
TEXT[ portuguese_brazilian ] = "Help";
- TEXT[ japanese ] = "Help";
- TEXT[ korean ] = "Help";
+ TEXT[ japanese ] = "ヘルプ";
+ TEXT[ korean ] = "ë„움ë§";
TEXT[ turkish ] = "Help";
TEXT[ thai ] = "Help";
TEXT[ greek ] = "Help";
TEXT[ dutch ] = "Help";
- TEXT[ french ] = "Help";
+ TEXT[ french ] = "Aide";
TEXT[ finnish ] = "Help";
TEXT[ danish ] = "Help";
- TEXT[ chinese_simplified ] = "Help";
- TEXT[ chinese_traditional ] = "Help";
+ TEXT[ chinese_simplified ] = "帮助";
+ TEXT[ chinese_traditional ] = "說明";
TEXT[ arabic ] = "Help";
TEXT[ catalan ] = "Help";
};
@@ -462,22 +462,22 @@ String SV_SHORTCUT_CONTEXTHELP
TEXT[ english_us ] = "Context Help";
TEXT[ portuguese ] = "Context Help";
TEXT[ russian ] = "Context Help";
- TEXT[ spanish ] = "Context Help";
- TEXT[ italian ] = "Context Help";
- TEXT[ swedish ] = "Context Help";
+ TEXT[ spanish ] = "Ayuda contextual";
+ TEXT[ italian ] = "Guida contestuale";
+ TEXT[ swedish ] = "Sammanhangsrelaterad hjälp";
TEXT[ polish ] = "Context Help";
TEXT[ portuguese_brazilian ] = "Context Help";
- TEXT[ japanese ] = "Context Help";
- TEXT[ korean ] = "Context Help";
+ TEXT[ japanese ] = "状æ³ä¾å­˜ãƒ˜ãƒ«ãƒ—";
+ TEXT[ korean ] = "문맥 ë„움ë§";
TEXT[ turkish ] = "Context Help";
TEXT[ thai ] = "Context Help";
TEXT[ greek ] = "Context Help";
TEXT[ dutch ] = "Context Help";
- TEXT[ french ] = "Context Help";
+ TEXT[ french ] = "Aide contextuelle";
TEXT[ finnish ] = "Context Help";
TEXT[ danish ] = "Context Help";
- TEXT[ chinese_simplified ] = "Context Help";
- TEXT[ chinese_traditional ] = "Context Help";
+ TEXT[ chinese_simplified ] = "上下文帮助";
+ TEXT[ chinese_traditional ] = "上下文說明";
TEXT[ arabic ] = "Context Help";
TEXT[ catalan ] = "Context Help";
};
@@ -489,22 +489,22 @@ String SV_SHORTCUT_ACTIVEHELP
TEXT[ english_us ] = "Extended Tips";
TEXT[ portuguese ] = "Extended Tips";
TEXT[ russian ] = "Extended Tips";
- TEXT[ spanish ] = "Extended Tips";
- TEXT[ italian ] = "Extended Tips";
- TEXT[ swedish ] = "Extended Tips";
+ TEXT[ spanish ] = "Ayuda activa";
+ TEXT[ italian ] = "Guida attiva";
+ TEXT[ swedish ] = "Aktiv hjälp";
TEXT[ polish ] = "Extended Tips";
TEXT[ portuguese_brazilian ] = "Extended Tips";
- TEXT[ japanese ] = "Extended Tips";
- TEXT[ korean ] = "Extended Tips";
+ TEXT[ japanese ] = "詳細ヒント";
+ TEXT[ korean ] = "설명";
TEXT[ turkish ] = "Extended Tips";
TEXT[ thai ] = "Extended Tips";
TEXT[ greek ] = "Extended Tips";
TEXT[ dutch ] = "Extended Tips";
- TEXT[ french ] = "Extended Tips";
+ TEXT[ french ] = "Infoballon";
TEXT[ finnish ] = "Extended Tips";
TEXT[ danish ] = "Extended Tips";
- TEXT[ chinese_simplified ] = "Extended Tips";
- TEXT[ chinese_traditional ] = "Extended Tips";
+ TEXT[ chinese_simplified ] = "说明文";
+ TEXT[ chinese_traditional ] = "æè¿°æ–‡";
TEXT[ arabic ] = "Extended Tips";
TEXT[ catalan ] = "Extended Tips";
};
@@ -516,22 +516,22 @@ String SV_SHORTCUT_DOCKUNDOCK
TEXT[ english_us ] = "Dock/Undock Windows";
TEXT[ portuguese ] = "Dock/Undock Windows";
TEXT[ russian ] = "Dock/Undock Windows";
- TEXT[ spanish ] = "Dock/Undock Windows";
- TEXT[ italian ] = "Dock/Undock Windows";
- TEXT[ swedish ] = "Dock/Undock Windows";
+ TEXT[ spanish ] = "Acoplar / desprender ventanas";
+ TEXT[ italian ] = "Ancora/sgancia finestra";
+ TEXT[ swedish ] = "Förankring av fönster på/av";
TEXT[ polish ] = "Dock/Undock Windows";
TEXT[ portuguese_brazilian ] = "Dock/Undock Windows";
- TEXT[ japanese ] = "Dock/Undock Windows";
- TEXT[ korean ] = "Dock/Undock Windows";
+ TEXT[ japanese ] = "ウィンドウã®çµåˆ/切り離ã—";
+ TEXT[ korean ] = "ì°½ì„ ê³ ì •/분리";
TEXT[ turkish ] = "Dock/Undock Windows";
TEXT[ thai ] = "Dock/Undock Windows";
TEXT[ greek ] = "Dock/Undock Windows";
TEXT[ dutch ] = "Dock/Undock Windows";
- TEXT[ french ] = "Dock/Undock Windows";
+ TEXT[ french ] = "Ancrer/détacher les fenêtres";
TEXT[ finnish ] = "Dock/Undock Windows";
TEXT[ danish ] = "Dock/Undock Windows";
- TEXT[ chinese_simplified ] = "Dock/Undock Windows";
- TEXT[ chinese_traditional ] = "Dock/Undock Windows";
+ TEXT[ chinese_simplified ] = "对接/æ¾å¼€è§†çª—";
+ TEXT[ chinese_traditional ] = "固定/解除固定視窗";
TEXT[ arabic ] = "Dock/Undock Windows";
TEXT[ catalan ] = "Dock/Undock Windows";
};
@@ -543,22 +543,22 @@ String SV_SHORTCUT_NEXTSUBWINDOW
TEXT[ english_us ] = "To Next Toolbar/Window";
TEXT[ portuguese ] = "To Next Toolbar/Window";
TEXT[ russian ] = "To Next Toolbar/Window";
- TEXT[ spanish ] = "To Next Toolbar/Window";
- TEXT[ italian ] = "To Next Toolbar/Window";
- TEXT[ swedish ] = "To Next Toolbar/Window";
+ TEXT[ spanish ] = "Ir a la siguiente ventana / barra de símbolos";
+ TEXT[ italian ] = "Alla finestra/barra dei simboli seguente";
+ TEXT[ swedish ] = "Till nästa symbollist/fönster";
TEXT[ polish ] = "To Next Toolbar/Window";
TEXT[ portuguese_brazilian ] = "To Next Toolbar/Window";
- TEXT[ japanese ] = "To Next Toolbar/Window";
- TEXT[ korean ] = "To Next Toolbar/Window";
+ TEXT[ japanese ] = "次ã®ãƒ„ールãƒãƒ¼/ウィンドウã¸";
+ TEXT[ korean ] = "ë‹¤ìŒ ë„구 모ìŒ/창으로";
TEXT[ turkish ] = "To Next Toolbar/Window";
TEXT[ thai ] = "To Next Toolbar/Window";
TEXT[ greek ] = "To Next Toolbar/Window";
TEXT[ dutch ] = "To Next Toolbar/Window";
- TEXT[ french ] = "To Next Toolbar/Window";
+ TEXT[ french ] = "Aller à la barre d'outils/fenêtre suivante";
TEXT[ finnish ] = "To Next Toolbar/Window";
TEXT[ danish ] = "To Next Toolbar/Window";
- TEXT[ chinese_simplified ] = "To Next Toolbar/Window";
- TEXT[ chinese_traditional ] = "To Next Toolbar/Window";
+ TEXT[ chinese_simplified ] = "到下一个图标æ /视窗";
+ TEXT[ chinese_traditional ] = "至下一個工具列/視窗";
TEXT[ arabic ] = "To Next Toolbar/Window";
TEXT[ catalan ] = "To Next Toolbar/Window";
};
@@ -570,22 +570,22 @@ String SV_SHORTCUT_PREVSUBWINDOW
TEXT[ english_us ] = "To Previous Toolbar/Window";
TEXT[ portuguese ] = "To Previous Toolbar/Window";
TEXT[ russian ] = "To Previous Toolbar/Window";
- TEXT[ spanish ] = "To Previous Toolbar/Window";
- TEXT[ italian ] = "To Previous Toolbar/Window";
- TEXT[ swedish ] = "To Previous Toolbar/Window";
+ TEXT[ spanish ] = "Ir a la ventana / barra de símbolos previa ";
+ TEXT[ italian ] = "Alla finestra/barra dei simboli precedente";
+ TEXT[ swedish ] = "Till föregående symbollist/fönster";
TEXT[ polish ] = "To Previous Toolbar/Window";
TEXT[ portuguese_brazilian ] = "To Previous Toolbar/Window";
- TEXT[ japanese ] = "To Previous Toolbar/Window";
- TEXT[ korean ] = "To Previous Toolbar/Window";
+ TEXT[ japanese ] = "å‰ã®ãƒ„ールãƒãƒ¼/ウィンドウã¸";
+ TEXT[ korean ] = "ì´ì „ ë„구 모ìŒ/창으로";
TEXT[ turkish ] = "To Previous Toolbar/Window";
TEXT[ thai ] = "To Previous Toolbar/Window";
TEXT[ greek ] = "To Previous Toolbar/Window";
TEXT[ dutch ] = "To Previous Toolbar/Window";
- TEXT[ french ] = "To Previous Toolbar/Window";
+ TEXT[ french ] = "Aller à la barre d'outils/fenêtre précédente";
TEXT[ finnish ] = "To Previous Toolbar/Window";
TEXT[ danish ] = "To Previous Toolbar/Window";
- TEXT[ chinese_simplified ] = "To Previous Toolbar/Window";
- TEXT[ chinese_traditional ] = "To Previous Toolbar/Window";
+ TEXT[ chinese_simplified ] = "到上一个图标æ /视窗";
+ TEXT[ chinese_traditional ] = "至上一個工具列/視窗";
TEXT[ arabic ] = "To Previous Toolbar/Window";
TEXT[ catalan ] = "To Previous Toolbar/Window";
};
@@ -597,22 +597,22 @@ String SV_SHORTCUT_TODOCUMENT
TEXT[ english_us ] = "To Document";
TEXT[ portuguese ] = "To Document";
TEXT[ russian ] = "To Document";
- TEXT[ spanish ] = "To Document";
- TEXT[ italian ] = "To Document";
- TEXT[ swedish ] = "To Document";
+ TEXT[ spanish ] = "Al documento";
+ TEXT[ italian ] = "Al documento";
+ TEXT[ swedish ] = "Till dokument";
TEXT[ polish ] = "To Document";
TEXT[ portuguese_brazilian ] = "To Document";
- TEXT[ japanese ] = "To Document";
- TEXT[ korean ] = "To Document";
+ TEXT[ japanese ] = "ドキュメントã¸";
+ TEXT[ korean ] = "문서로";
TEXT[ turkish ] = "To Document";
TEXT[ thai ] = "To Document";
TEXT[ greek ] = "To Document";
TEXT[ dutch ] = "To Document";
- TEXT[ french ] = "To Document";
+ TEXT[ french ] = "Aller au document";
TEXT[ finnish ] = "To Document";
TEXT[ danish ] = "To Document";
- TEXT[ chinese_simplified ] = "To Document";
- TEXT[ chinese_traditional ] = "To Document";
+ TEXT[ chinese_simplified ] = "转到文档";
+ TEXT[ chinese_traditional ] = "至文件";
TEXT[ arabic ] = "To Document";
TEXT[ catalan ] = "To Document";
};
@@ -624,22 +624,27 @@ String SV_SHORTCUT_MENUBAR
TEXT[ english_us ] = "To Menu Bar";
TEXT[ portuguese ] = "To Menu Bar";
TEXT[ russian ] = "To Menu Bar";
- TEXT[ spanish ] = "To Menu Bar";
- TEXT[ italian ] = "To Menu Bar";
- TEXT[ swedish ] = "To Menu Bar";
+ TEXT[ spanish ] = "A la barra de menú";
+ TEXT[ italian ] = "Alla barra dei menu";
+ TEXT[ swedish ] = "Till menylist";
TEXT[ polish ] = "To Menu Bar";
TEXT[ portuguese_brazilian ] = "To Menu Bar";
- TEXT[ japanese ] = "To Menu Bar";
- TEXT[ korean ] = "To Menu Bar";
+ TEXT[ japanese ] = "メニューãƒãƒ¼ã¸";
+ TEXT[ korean ] = "메뉴 표시줄로";
TEXT[ turkish ] = "To Menu Bar";
TEXT[ thai ] = "To Menu Bar";
TEXT[ greek ] = "To Menu Bar";
TEXT[ dutch ] = "To Menu Bar";
- TEXT[ french ] = "To Menu Bar";
+ TEXT[ french ] = "Aller à la barre de menu";
TEXT[ finnish ] = "To Menu Bar";
TEXT[ danish ] = "To Menu Bar";
- TEXT[ chinese_simplified ] = "To Menu Bar";
- TEXT[ chinese_traditional ] = "To Menu Bar";
+ TEXT[ chinese_simplified ] = "转到èœå•æ ";
+ TEXT[ chinese_traditional ] = "至功能表列";
TEXT[ arabic ] = "To Menu Bar";
TEXT[ catalan ] = "To Menu Bar";
};
+
+
+
+
+
diff --git a/vcl/source/src/menu.src b/vcl/source/src/menu.src
index 73020d19b05c..6e8ea6c8c641 100644
--- a/vcl/source/src/menu.src
+++ b/vcl/source/src/menu.src
@@ -2,9 +2,9 @@
*
* $RCSfile: menu.src,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: rt $ $Date: 2001-11-16 22:04:42 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -85,8 +85,9 @@ String SV_RESID_STRING_NOSELECTIONPOSSIBLE
Text[ chinese_traditional ] = "<無法é¸æ“‡>";
Text[ arabic ] = "<áÇ íãßä ÇáÊÍÏíÏ>";
Text[ turkish ] = "<Seçim yapýlamaz>";
- Text[ catalan ] = "<Ninguna selección posible>";
+ Text[ catalan ] = "<Cap selecció possible>";
Text[ finnish ] = "<Valinta ei mahdollinen >";
+ Text[ thai ] = "<à¸à¸²à¸£à¹€à¸¥à¸·à¸­à¸à¸—ี่ไม่สามารถเป็นไปได้>";
};
Menu SV_RESID_MENU_EDIT
@@ -113,12 +114,13 @@ Menu SV_RESID_MENU_EDIT
Text[ chinese_simplified ] = "撤消命令(~U)";
Text[ chinese_traditional ] = "復原(~U)";
Text[ greek ] = "Áíáß~ñåóç";
- Text[ korean ] = "실행취소(~U)";
+ Text[ korean ] = "실행 취소(~U)";
Text[ arabic ] = "ÊÑÇÌÚ";
Text[ turkish ] = "Geri al";
Text[ language_user1 ] = " ";
- Text[ catalan ] = "~Deshacer";
- Text[ finnish ] = "~Peruuta";
+ Text[ catalan ] = "~Desfés";
+ Text[ finnish ] = "~Kumoa";
+ Text[ thai ] = "เ~ลิà¸à¸—ำ";
};
MenuItem { Separator = TRUE ; };
MenuItem
@@ -130,7 +132,7 @@ Menu SV_RESID_MENU_EDIT
Text [ italian ] = "~Taglia" ;
Text [ portuguese_brazilian ] = "Co~rtar" ;
Text [ portuguese ] = "Co~rtar" ;
- Text [ finnish ] = "L~eikkaa" ;
+ Text [ finnish ] = "~Leikkaa" ;
Text [ danish ] = "~Klip" ;
Text [ french ] = "~Couper" ;
Text [ swedish ] = "~Klipp ut" ;
@@ -147,7 +149,8 @@ Menu SV_RESID_MENU_EDIT
Text[ arabic ] = "ÞÕ";
Text[ turkish ] = "~Kes";
Text[ language_user1 ] = " ";
- Text[ catalan ] = "C~ortar";
+ Text[ catalan ] = "~Retalla";
+ Text[ thai ] = "ตั~ด";
};
MenuItem
{
@@ -158,7 +161,7 @@ Menu SV_RESID_MENU_EDIT
Text [ italian ] = "~Copia" ;
Text [ portuguese_brazilian ] = "~Copiar" ;
Text [ portuguese ] = "~Copiar" ;
- Text [ finnish ] = "~Kopioi" ;
+ Text [ finnish ] = "K~opioi" ;
Text [ danish ] = "K~opier" ;
Text [ french ] = "Co~pier" ;
Text [ swedish ] = "K~opiera" ;
@@ -167,7 +170,7 @@ Menu SV_RESID_MENU_EDIT
Text [ english_us ] = "~Copy" ;
Text[ russian ] = "~Êîïèðîâàòü";
Text[ polish ] = "Kopiuj";
- Text[ japanese ] = "コピー(~C)";
+ Text[ japanese ] = "コピー(~C)";
Text[ chinese_simplified ] = "å¤åˆ¶(~C)";
Text[ chinese_traditional ] = "複製(~C)";
Text[ greek ] = "Áíôé~ãñáöÞ";
@@ -175,7 +178,8 @@ Menu SV_RESID_MENU_EDIT
Text[ arabic ] = "äÓÎ";
Text[ turkish ] = "K~opyala";
Text[ language_user1 ] = " ";
- Text[ catalan ] = "~Copiar";
+ Text[ catalan ] = "~Copia";
+ Text[ thai ] = "~คัดลอà¸";
};
MenuItem
{
@@ -186,24 +190,25 @@ Menu SV_RESID_MENU_EDIT
Text [ italian ] = "~Incolla" ;
Text [ portuguese_brazilian ] = "~Colar" ;
Text [ portuguese ] = "Co~lar" ;
- Text [ finnish ] = "L~iit?" ;
+ Text [ finnish ] = "Lii~tä" ;
Text [ danish ] = "~Indsæt" ;
Text [ french ] = "C~oller" ;
Text [ swedish ] = "K~listra in" ;
Text [ dutch ] = "~Plakken" ;
Text [ spanish ] = "~Pegar" ;
Text [ english_us ] = "~Paste" ;
- Text[ russian ] = "Âñò~àâêà";
+ Text[ russian ] = "Âñò~àâèòü";
Text[ polish ] = "W~staw";
Text[ japanese ] = "貼り付ã‘(~P)";
- Text[ chinese_simplified ] = "æ’å…¥(~P)";
- Text[ chinese_traditional ] = "æ’å…¥(~P)";
+ Text[ chinese_simplified ] = "粘贴(~P)";
+ Text[ chinese_traditional ] = "貼上(~P)";
Text[ greek ] = "~Åðéêüëëçóç";
Text[ korean ] = "붙여넣기(~P)";
Text[ arabic ] = "áÕÞ";
Text[ turkish ] = "~Yapýþtýr";
Text[ language_user1 ] = " ";
- Text[ catalan ] = "~Pegar";
+ Text[ catalan ] = "Engan~xa";
+ Text[ thai ] = "~วาง";
};
MenuItem
{
@@ -219,7 +224,7 @@ Menu SV_RESID_MENU_EDIT
Text [ french ] = "~Supprimer" ;
Text [ swedish ] = "~Radera" ;
Text [ dutch ] = "~Wissen" ;
- Text [ spanish ] = "~Eliminar" ;
+ Text [ spanish ] = "~Borrar" ;
Text [ english_us ] = "~Delete" ;
Text[ russian ] = "~Óäàëèòü";
Text[ polish ] = "Usuñ";
@@ -231,7 +236,8 @@ Menu SV_RESID_MENU_EDIT
Text[ arabic ] = "ÍÐÝ";
Text[ turkish ] = "~Sil";
Text[ language_user1 ] = " ";
- Text[ catalan ] = "~Eliminar";
+ Text[ catalan ] = "~Suprimeix";
+ Text[ thai ] = "~ลบ";
};
MenuItem { Separator = TRUE ; };
MenuItem
@@ -243,7 +249,7 @@ Menu SV_RESID_MENU_EDIT
Text [ italian ] = "Seleziona tutto" ;
Text [ portuguese_brazilian ] = "Selecionar ~Tudo" ;
Text [ portuguese ] = "Seleccionar ~tudo" ;
- Text [ finnish ] = "Valitse ~kaikki" ;
+ Text [ finnish ] = "~Valitse kaikki" ;
Text [ danish ] = "~Marker alt" ;
Text [ french ] = "~Sélectionner tout" ;
Text [ swedish ] = "Markera ~allt" ;
@@ -260,7 +266,8 @@ Menu SV_RESID_MENU_EDIT
Text[ arabic ] = "ÊÍÏíÏ Çáßá";
Text[ turkish ] = "Tümünü seç";
Text[ language_user1 ] = " ";
- Text[ catalan ] = "Seleccionar ~todo";
+ Text[ catalan ] = "Selecciona-ho ~tot";
+ Text[ thai ] = "เลือà¸~ทั้งหมด";
};
MenuItem { Separator = TRUE ; };
MenuItem
@@ -277,7 +284,7 @@ Menu SV_RESID_MENU_EDIT
TEXT[ dutch ] = "~Speciaal teken invoegen...";
TEXT[ spanish ] = "Insertar ~símbolo...";
TEXT[ english_us ] = "~Special Character...";
- TEXT[ russian ] = "~Âñòàâèòü ñïåöèàëüíûå ñèìâîëû...";
+ TEXT[ russian ] = "Ñèìâîëû...";
TEXT[ polish ] = "Wstaw znaki specjalne...";
TEXT[ japanese ] = "記å·ã¨ç‰¹æ®Šæ–‡å­—ã®æŒ¿å…¥(~S)...";
@@ -288,8 +295,9 @@ Menu SV_RESID_MENU_EDIT
TEXT[ arabic ] = "ÅÏÑÇÌ ÑãæÒ ÎÇÕÉ";
TEXT[ turkish ] = "Özel karakter ekle...";
TEXT[ language_user1 ] = " ";
- TEXT[ catalan ] = "Insertar ~símbolo...";
- TEXT[ finnish ] = "~Erikoismerkki...";
+ TEXT[ catalan ] = "Insereix ~símbol...";
+ TEXT[ finnish ] = "Merkk~i...";
+ TEXT[ thai ] = "ตัวอัà¸à¸‚ระ~พิเศษ...";
};
};
};
@@ -303,3 +311,7 @@ Menu SV_RESID_MENU_EDIT
+
+
+
+
diff --git a/vcl/source/src/stdtext.src b/vcl/source/src/stdtext.src
index abb86ed482fc..a4916067832d 100644
--- a/vcl/source/src/stdtext.src
+++ b/vcl/source/src/stdtext.src
@@ -2,9 +2,9 @@
*
* $RCSfile: stdtext.src,v $
*
- * $Revision: 1.37 $
+ * $Revision: 1.38 $
*
- * last change: $Author: pl $ $Date: 2002-12-06 10:22:43 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -102,18 +102,18 @@ String SV_STDTEXT_DONTHINTAGAIN
Text[ russian ] = "Do not show this information again.";
Text[ greek ] = "Do not show this information again.";
Text[ dutch ] = "Do not show this information again.";
- Text[ french ] = "Do not show this information again.";
- Text[ spanish ] = "Do not show this information again.";
+ Text[ french ] = "Ne plus afficher cette information";
+ Text[ spanish ] = "No volver a mostrar esta advertencia.";
Text[ finnish ] = "Do not show this information again.";
- Text[ italian ] = "Do not show this information again.";
+ Text[ italian ] = "Non mostrare più questo avviso.";
Text[ danish ] = "Do not show this information again.";
- Text[ swedish ] = "Do not show this information again.";
+ Text[ swedish ] = "Visa inte den här informationen mer.";
Text[ polish ] = "Do not show this information again.";
Text[ portuguese_brazilian ] = "Do not show this information again.";
- Text[ japanese ] = "Do not show this information again.";
- Text[ korean ] = "Do not show this information again.";
- Text[ chinese_simplified ] = "Do not show this information again.";
- Text[ chinese_traditional ] = "Do not show this information again.";
+ Text[ japanese ] = "今後ã“ã®æƒ…報を表示ã—ãªã„。";
+ Text[ korean ] = "ì´ ì •ë³´ë¥¼ 다시 표시하지 ì•ŠìŒ";
+ Text[ chinese_simplified ] = "下次ä¸å†æ˜¾ç¤ºè¿™ä¸ªæ示。";
+ Text[ chinese_traditional ] = "ä¸å†é¡¯ç¤ºé€™é …資訊。";
Text[ turkish ] = "Do not show this information again.";
Text[ arabic ] = "Do not show this information again.";
Text[ catalan ] = "Do not show this information again.";
@@ -129,18 +129,18 @@ String SV_STDTEXT_DONTASKAGAIN
Text[ russian ] = "Do not show this question again.";
Text[ greek ] = "Do not show this question again.";
Text[ dutch ] = "Do not show this question again.";
- Text[ french ] = "Do not show this question again.";
- Text[ spanish ] = "Do not show this question again.";
+ Text[ french ] = "Ne plus afficher cette question";
+ Text[ spanish ] = "No volver a mostrar esta pregunta.";
Text[ finnish ] = "Do not show this question again.";
- Text[ italian ] = "Do not show this question again.";
+ Text[ italian ] = "Non mostrare più questa domanda.";
Text[ danish ] = "Do not show this question again.";
- Text[ swedish ] = "Do not show this question again.";
+ Text[ swedish ] = "Visa inte den här frågan mer.";
Text[ polish ] = "Do not show this question again.";
Text[ portuguese_brazilian ] = "Do not show this question again.";
- Text[ japanese ] = "Do not show this question again.";
- Text[ korean ] = "Do not show this question again.";
- Text[ chinese_simplified ] = "Do not show this question again.";
- Text[ chinese_traditional ] = "Do not show this question again.";
+ Text[ japanese ] = "今後ã“ã®è³ªå•ã‚’表示ã—ãªã„。";
+ Text[ korean ] = "ì´ ì§ˆë¬¸ì„ ë‹¤ì‹œ 표시하지 ì•ŠìŒ";
+ Text[ chinese_simplified ] = "下次ä¸å†æ˜¾ç¤ºè¿™ä¸ªæ问。";
+ Text[ chinese_traditional ] = "ä¸å†é¡¯ç¤ºé€™å€‹å•é¡Œã€‚";
Text[ turkish ] = "Do not show this question again.";
Text[ arabic ] = "Do not show this question again.";
Text[ catalan ] = "Do not show this question again.";
@@ -150,23 +150,23 @@ String SV_STDTEXT_DONTASKAGAIN
String SV_STDTEXT_DONTWARNAGAIN
{
Text = "Diese Warnung nicht mehr anzeigen.";
- Text [English] = "Do not warn me again.";
+ Text[ English] = "Do not warn me again.";
Text[ english_us ] = "Do not show warning again.";
Text[ portuguese ] = "Não mostrar mais esta observação.";
Text[ russian ] = "Íå ïîêàçûâàòü áîëüøå ýòî ïðåäóïðåæäåíèå.";
Text[ greek ] = "Íá ìçí åìöáíéóôåß îáíÜ áõôÞ ç ðëçñïöïñßá.";
Text[ dutch ] = "Deze waarschuwing niet meer weergeven.";
- Text[ french ] = "Ne plus afficher cet avertissement.";
+ Text[ french ] = "Ne plus afficher cet avertissement";
Text[ spanish ] = "No mostrar más esta advertencia.";
Text[ italian ] = "Non mostrare più questo avviso.";
Text[ danish ] = "Vis ikke denne henvisning igen.";
- Text[ swedish ] = "Visa inte den här informationen mer.";
+ Text[ swedish ] = "Visa inte den här varningen mer.";
Text[ polish ] = "Nie wyœwietlaj wiêcej ostrze¿enia.";
Text[ portuguese_brazilian ] = "Do not warn me again.";
- Text[ japanese ] = "今後ã“ã®æŒ‡ç¤ºã¯ã‚‚ã†è¡¨ç¤ºã—ãªã„。";
- Text[ korean ] = "ì´ ë©”ì‹œì§€ë¥¼ ë” ì´ìƒ 표시하지 않습니다.";
- Text[ chinese_simplified ] = "ä¸å†æ˜¾ç¤ºè¿™ä¸ªæ示。";
- Text[ chinese_traditional ] = "ä¸è¦å†é¡¯ç¤ºé€™å€‹æ示。";
+ Text[ japanese ] = "今後ã“ã®è­¦å‘Šã¯è¡¨ç¤ºã—ãªã„。";
+ Text[ korean ] = "ì´ ê²½ê³ ë¥¼ 다시 표시하지 ì•ŠìŒ";
+ Text[ chinese_simplified ] = "下次ä¸å†æ˜¾ç¤ºè¿™ä¸ªè­¦å‘Šã€‚";
+ Text[ chinese_traditional ] = "ä¸å†é¡¯ç¤ºé€™å€‹è­¦å‘Šã€‚";
Text[ turkish ] = "Do not warn me again.";
Text[ arabic ] = "Do not warn me again.";
Text[ catalan ] = "No tornis a mostrar l'advertiment.";
@@ -176,8 +176,8 @@ String SV_STDTEXT_DONTWARNAGAIN
String SV_ACCESSERROR_WRONG_VERSION
{
- Text = "Falsche Version";
- Text [English] = "Wrong version";
+ Text = "Falsche Java Access Bridge";
+ Text[ english ] = "Wrong Java Access Bridge";
Text[ english_us ] = "Wrong Version";
Text[ portuguese ] = "Wrong version";
Text[ russian ] = "Wrong version";
@@ -201,37 +201,52 @@ String SV_ACCESSERROR_WRONG_VERSION
Text[ thai ] = "Wrong version";
};
-String SV_ACCESSERROR_WRONG_VERSION_MSG
+String SV_ACCESSERROR_BRIDGE_MSG
{
- Text = "%PRODUCTNAME %PRODUCTVERSION benötigt eine Java Access Bridge 1.03 oder höher. Bitte installieren Sie die aktuellste Java Access Bridge. Klicken Sie '%IGNORE' um %PRODUCTNAME %PRODUCTVERSION ohne Unterstützung der Zugänglichkeit zu starten, oder klicken Sie '%CANCEL'.";
- Text [English] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ english_us ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
+ Text = "%PRODUCTNAME %PRODUCTVERSION benötigt eine Java Access Bridge 1.0.3 oder höhere Version, um Zugänglichkeit zu unterstützen.";
+ Text[ english ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.0.3 or later version to support accessibility.";
+ Text[ english_us ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.0.3 or later version to support accessibility.";
Text[ portuguese ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
Text[ russian ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
Text[ greek ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
Text[ dutch ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
Text[ french ] = "%PRODUCTNAME %PRODUCTVERSION requiert Java Access Bridge 1.03 ou plus. Veuillez installer la version la plus récente de Java Access Bridge. Cliquez sur \"Ignorer\" pour démarrer %PRODUCTNAME %PRODUCTVERSION sans support d'accessibilité, ou sur \"Annuler\".";
Text[ spanish ] = "%PRODUCTNAME %PRODUCTVERSION requiere la versión de Java Access Bridge 1.03 o posterior. Instale la última versión de Java Access Bridge. Pulse \"Ignorar\" para iniciar %PRODUCTNAME %PRODUCTVERSION sin el soporte de accesibilidad o pulse \"Cancelar\".";
- Text[ finnish ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
+ Text[ finnish ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click \"Ignore\" to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click \"Cancel\".";
Text[ italian ] = "%PRODUCTNAME %PRODUCTVERSION richiede una versione di Java Access Bridge 1.03 o più recente. Installate l'ultima versione di Java Access Bridge. Cliccate su \"Ignora\" per avviare %PRODUCTNAME %PRODUCTVERSION senza il supporto di accessibilità, altrimenti cliccate su \"Annulla\".";
- Text[ danish ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
+ Text[ danish ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click \"Ignore\" to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click \"Cancel\".";
Text[ swedish ] = "%PRODUCTNAME %PRODUCTVERSION kräver en Java Access Bridge 1.03 eller senare. Installera den senaste Java Access Bridge. Klicka på \"Ignorera\" för att starta %PRODUCTNAME %PRODUCTVERSION utan tillgänglighetsstöd eller klicka på \"Avbryt\".";
- Text[ polish ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
+ Text[ polish ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click \"Ignore\" to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click \"Cancel\".";
Text[ portuguese_brazilian ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
Text[ japanese ] = "%PRODUCTNAME %PRODUCTVERSION ã«ã¯ã€Java Access Bridge 1.03 以é™ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ãŒå¿…è¦ã§ã™ã€‚最新版㮠Java Access Bridge をインストールã—ã¦ãã ã•ã„。アクセシビリティã®æ”¯æ´ãªã—㧠%PRODUCTNAME %PRODUCTVERSION ã‚’èµ·å‹•ã•ã›ã‚‹ã«ã¯ã€ï¼»ç„¡è¦–ã™ã‚‹ï¼½ãƒœã‚¿ãƒ³ã‚’クリックã—ã¾ã™ã€‚ã¾ãŸã¯ï¼»ã‚­ãƒ£ãƒ³ã‚»ãƒ«ï¼½ãƒœã‚¿ãƒ³ã‚’クリックã—ã¾ã™ã€‚";
Text[ korean ] = "%PRODUCTNAME %PRODUCTVERSION ì€(는) Java Access Bridge 1.03 ì´ìƒì˜ ë²„ì „ì„ í•„ìš”ë¡œ 합니다. 최신 ë²„ì „ì˜ Java Access Bridge를 설치해주십시오. 액세스빌리티 기능 지ì›ì´ ì—†ì´ %PRODUCTNAME %PRODUCTVERSIONì„ ì‹œìž‘í•˜ì‹œë ¤ë©´ 무시 버튼 ë˜ëŠ” 취소 ë²„íŠ¼ì„ í´ë¦­í•´ì£¼ì‹­ì‹œì˜¤.";
Text[ chinese_simplified ] = "%PRODUCTNAME %PRODUCTVERSION 需è¦ä¸€ä¸ªâ€œJava Access Bridge 1.03â€æˆ–之上的版本。点击“忽略â€ï¼ŒçœåŽ»è¾…助功能支æŒã€‚而直接开始安装 %PRODUCTNAME %PRODUCTVERSION 。或者点击“å–消â€ï¼Œä¸­æ–­å®‰è£…过程。";
Text[ chinese_traditional ] = "%PRODUCTNAME %PRODUCTVERSION 需è¦ä¸€å€‹[Java Access Bridge 1.03]或之上的版本。請安è£ä¸€å€‹æœ€æ–°çš„[Java Access Bridge]版本。按一下「忽略ã€ï¼ŒçœåŽ»å”助工具支æ´ï¼Œè€Œç›´æŽ¥å•“å‹•å®‰è£ %PRODUCTNAME %PRODUCTVERSION 。或者按下「å–消ã€ï¼Œä¸­æ–·å®‰è£éŽç¨‹ã€‚";
- Text[ turkish ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ arabic ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ catalan ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ thai ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
+ Text[ turkish ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click \"Ignore\" to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click \"Cancel\".";
+ Text[ arabic ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click \"Ignore\" to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click \"Cancel\".";
+ Text[ catalan ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click \"Ignore\" to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click \"Cancel\".";
+ Text[ thai ] = "%PRODUCTNAME %PRODUCTVERSION requires a Java Access Bridge 1.03 or later version. Please install the latest Java Access Bridge. Click \"Ignore\" to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click \"Cancel\".";
+};
+
+String SV_ACCESSERROR_OK_CANCEL_MSG
+{
+ Text = "Klicken Sie '%OK', um %PRODUCTNAME %PRODUCTVERSION ohne Unterstützung der Zugänglichkeit zu starten, oder klicken Sie '%CANCEL' um %PRODUCTNAME %PRODUCTVERSION zu beenden.";
+ Text[ english ] = "Click '%OK' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL' to exit %PRODUCTNAME %PRODUCTVERSION.";
+ Text[ english_us ] = "Click '%OK' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL' to exit %PRODUCTNAME %PRODUCTVERSION.";
+ Text[ french ] = "Click '%OK' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL' to exit %PRODUCTNAME %PRODUCTVERSION.";
+ Text[ spanish ] = "Click '%OK' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL' to exit %PRODUCTNAME %PRODUCTVERSION.";
+ Text[ italian ] = "Click '%OK' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL' to exit %PRODUCTNAME %PRODUCTVERSION.";
+ Text[ swedish ] = "Click '%OK' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL' to exit %PRODUCTNAME %PRODUCTVERSION.";
+ Text[ japanese ] = "Click '%OK' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL' to exit %PRODUCTNAME %PRODUCTVERSION.";
+ Text[ korean ] = "Click '%OK' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL' to exit %PRODUCTNAME %PRODUCTVERSION.";
+ Text[ chinese_simplified ] = "Click '%OK' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL' to exit %PRODUCTNAME %PRODUCTVERSION.";
+ Text[ chinese_traditional ] = "Click '%OK' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL' to exit %PRODUCTNAME %PRODUCTVERSION.";
};
String SV_ACCESSERROR_MISSING_BRIDGE
{
Text = "Keine Java Access Bridge";
- Text [English] = "No Java Access Bridge";
+ Text[ english ] = "No Java Access Bridge";
Text[ english_us ] = "No Java Access Bridge";
Text[ portuguese ] = "No Java Access Bridge";
Text[ russian ] = "No Java Access Bridge";
@@ -255,37 +270,10 @@ String SV_ACCESSERROR_MISSING_BRIDGE
Text[ thai ] = "No Java Access Bridge";
};
-String SV_ACCESSERROR_MISSING_BRIDGE_MSG
-{
- Text = "Es wurde keine Java Access Bridge gefunden. Bitte installieren Sie eine Java Access Bridge. Klicken Sie '%IGNORE' um %PRODUCTNAME %PRODUCTVERSION ohne Unterstützung der Zugänglichkeit zu starten, oder klicken Sie '%CANCEL'.";
- Text [English] = "No Java Access Bridge was found on your system. Please install a Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ english_us ] = "No Java Access Bridge was found on your system. Please install a Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ portuguese ] = "No Java Access Bridge was found on your system. Please install a Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ russian ] = "No Java Access Bridge was found on your system. Please install a Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ greek ] = "No Java Access Bridge was found on your system. Please install a Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ dutch ] = "No Java Access Bridge was found on your system. Please install a Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ french ] = "Java Access Bridge n'a pas pu être détecté sur le système. Veuillez installer une version Java Access Bridge. Cliquez sur \"Ignorer\" pour démarrer %PRODUCTNAME %PRODUCTVERSION sans support d'accessibilité, ou sur \"Annuler\".";
- Text[ spanish ] = "Java Access Bridge no se encuentra en el sistema. Instale una versión de Java Access Bridge. Pulse \"Ignorar\" para iniciar %PRODUCTNAME %PRODUCTVERSION sin el soporte de accesibilidad o pulse \"Cancelar\".";
- Text[ finnish ] = "No Java Access Bridge was found on your system. Please install a Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ italian ] = "Non avete installato Java Access Bridge sul vostro sistema. L'installazione è necessaria. Cliccate su \"Ignora\" per avviare %PRODUCTNAME %PRODUCTVERSION senza il supporto di accessibilità, altrimenti cliccate su \"Annulla\".";
- Text[ danish ] = "No Java Access Bridge was found on your system. Please install a Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ swedish ] = "Ingen Java Access Bridge hittades i ditt system. Installera en Java Access Bridge. Klicka på \"Ignorera\" för att starta %PRODUCTNAME %PRODUCTVERSION utan tillgänglighetsstöd eller klicka på \"Avbryt\".";
- Text[ polish ] = "No Java Access Bridge was found on your system. Please install a Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ portuguese_brazilian ] = "No Java Access Bridge was found on your system. Please install a Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ japanese ] = "ãŠä½¿ã„ã®ã‚·ã‚¹ãƒ†ãƒ ã« Java Access Bridge ã¯è¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸã€‚Java Access Bridge をインストールã—ã¦ãã ã•ã„。アクセシビリティã®æ”¯æ´ãªã—㧠%PRODUCTNAME %PRODUCTVERSION ã‚’èµ·å‹•ã•ã›ã‚‹ã«ã¯ã€ï¼»ç„¡è¦–ã™ã‚‹ï¼½ãƒœã‚¿ãƒ³ã‚’クリックã—ã¾ã™ã€‚ã¾ãŸã¯ï¼»ã‚­ãƒ£ãƒ³ã‚»ãƒ«ï¼½ãƒœã‚¿ãƒ³ã‚’クリックã—ã¾ã™ã€‚";
- Text[ korean ] = "시스템ì—ì„œ Java Access Bridge를 ì°¾ì„ ìˆ˜ 없었습니다. Java Access Bridge를 설치해주십시오. 액세스빌리티 기능 지ì›ì´ 없는 %PRODUCTNAME %PRODUCTVERSIONì„ ì‹œìž‘í•˜ì‹œë ¤ë©´ 무시 버튼 ë˜ëŠ” 취소 ë²„íŠ¼ì„ í´ë¦­í•´ì£¼ì‹­ì‹œì˜¤.";
- Text[ chinese_simplified ] = "在系统内没有找到“Java Access Bridgeâ€ã€‚请安装一个“Java Access Bridgeâ€ã€‚点击“忽略â€ï¼ŒçœåŽ»è¾…助功能支æŒï¼Œè€Œç›´æŽ¥å¼€å§‹å®‰è£… %PRODUCTNAME %PRODUCTVERSION 。或者点击“å–消â€ï¼Œä¸­æ–­å®‰è£…过程。";
- Text[ chinese_traditional ] = "在系統内沒有找到[Java Access Bridge]。請安è£ä¸€å€‹[Java Access Bridge]。按一下「忽略ã€ï¼ŒçœåŽ»å”助工具支æ´ï¼Œè€Œç›´æŽ¥å•“å‹•å®‰è£ %PRODUCTNAME %PRODUCTVERSION 。或者按下「å–消ã€ï¼Œä¸­æ–·å®‰è£éŽç¨‹ã€‚";
- Text[ turkish ] = "No Java Access Bridge was found on your system. Please install a Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ arabic ] = "No Java Access Bridge was found on your system. Please install a Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ catalan ] = "No Java Access Bridge was found on your system. Please install a Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ thai ] = "No Java Access Bridge was found on your system. Please install a Java Access Bridge. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
-};
-
String SV_ACCESSERROR_FAULTY_JAVA
{
Text = "Fehlerhafte Java Installation";
- Text [English] = "Faulty Java installation";
+ Text[ english ] = "Faulty Java installation";
Text[ english_us ] = "Faulty Java Installation";
Text[ portuguese ] = "Faulty Java installation";
Text[ russian ] = "Faulty Java installation";
@@ -300,7 +288,7 @@ String SV_ACCESSERROR_FAULTY_JAVA
Text[ polish ] = "Faulty Java installation";
Text[ portuguese_brazilian ] = "Faulty Java installation";
Text[ japanese ] = "Java ã¯æ­£å¸¸ã«ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œã¦ã„ã¾ã›ã‚“";
- Text[ korean ] = "ìžë°”ê°€ 올바르게 설치ë˜ì§€ 않았습니다.";
+ Text[ korean ] = "Javaê°€ 올바르게 설치ë˜ì§€ 않았습니다.";
Text[ chinese_simplified ] = "错误的 Java 安装";
Text[ chinese_traditional ] = "錯誤的 Java 安è£";
Text[ turkish ] = "Faulty Java installation";
@@ -309,37 +297,37 @@ String SV_ACCESSERROR_FAULTY_JAVA
Text[ thai ] = "Faulty Java installation";
};
-String SV_ACCESSERROR_FAULTY_JAVA_MSG
+String SV_ACCESSERROR_JAVA_MSG
{
- Text = "%PRODUCTNAME %PRODUCTVERSION hat auf Ihrem System eine fehlerhafte Java Installation gefunden Bitte installieren Sie Java neu, oder führen Sie eine Reparatur durch. Klicken Sie '%IGNORE' um %PRODUCTNAME %PRODUCTVERSION ohne Unterstützung der Zugänglichkeit zu starten, oder klicken Sie '%CANCEL'.";
- Text [English] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ english_us ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
+ Text = "%PRODUCTNAME %PRODUCTVERSION benötigt Java 1.4.0_02 oder höhere Version, um Zugänglichkeit zu unterstützen.";
+ Text[ english ] = "%PRODUCTNAME %PRODUCTVERSION requires Java 1.4.0_02 or later version to support accessibility.";
+ Text[ english_us ] = "%PRODUCTNAME %PRODUCTVERSION requires Java 1.4.0_02 or later version to support accessibility.";
Text[ portuguese ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
Text[ russian ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
Text[ greek ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
Text[ dutch ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
Text[ french ] = "%PRODUCTNAME %PRODUCTVERSION a détecté une installation Java défectueuse sur le système. Veuillez réinstaller Java ou exécuter une réparation. Cliquez sur \"Ignorer\" pour démarrer %PRODUCTNAME %PRODUCTVERSION sans support d'accessibilité, ou sur \"Annuler\".";
Text[ spanish ] = "%PRODUCTNAME %PRODUCTVERSION ha detectado una versión defectuosa de Java en el sistema. Vuelva a instalar Java o efectúe una reparación. Pulse \"Ignorar\" para iniciar %PRODUCTNAME %PRODUCTVERSION sin el soporte de accesibilidad o pulse \"Cancelar\". ";
- Text[ finnish ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
+ Text[ finnish ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click \"Ignore\" to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click \"Cancel\".";
Text[ italian ] = "%PRODUCTNAME %PRODUCTVERSION ha rilevato un'installazione corrotta di Java sul vostro sistema. Installate nuovamente Java oppure avviate il programma di riparazione. Cliccate su \"Ignora\" per avviare %PRODUCTNAME %PRODUCTVERSION senza il supporto di accessibilità, altrimenti cliccate su \"Annulla\".";
- Text[ danish ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
+ Text[ danish ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click \"Ignore\" to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click \"Cancel\".";
Text[ swedish ] = "%PRODUCTNAME %PRODUCTVERSION har hittat en felaktig Java-installation i ditt system. Installera om Java eller reparera din nuvarande Java-installation. Klicka på \"Ignorera\" för att starta %PRODUCTNAME %PRODUCTVERSION utan tillgänglighetsstöd eller klicka på \"Avbryt\".";
- Text[ polish ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
+ Text[ polish ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click \"Ignore\" to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click \"Cancel\".";
Text[ portuguese_brazilian ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
Text[ japanese ] = "%PRODUCTNAME %PRODUCTVERSION ãŒã‚·ã‚¹ãƒ†ãƒ ã«æ­£å¸¸ã«ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œãªã‹ã£ãŸ Java を検出ã—ã¾ã—ãŸã€‚Java をインストールã—ãªãŠã™ã‹ã€ã‚»ãƒƒãƒˆã‚¢ãƒƒãƒ—プログラムã§ä¿®å¾©ã‚’è¡Œã†ã‹ã—ã¦ãã ã•ã„。アクセシビリティã®æ”¯æ´ãªã—㧠%PRODUCTNAME %PRODUCTVERSION ã‚’èµ·å‹•ã•ã›ã‚‹ã«ã¯ã€ï¼»ç„¡è¦–ã™ã‚‹ï¼½ãƒœã‚¿ãƒ³ã‚’クリックã—ã¾ã™ã€‚ã¾ãŸã¯ï¼»ã‚­ãƒ£ãƒ³ã‚»ãƒ«ï¼½ãƒœã‚¿ãƒ³ã‚’クリックã—ã¾ã™ã€‚";
Text[ korean ] = "%PRODUCTNAME %PRODUCTVERSION ì€(는) 오류가 있는 Java 설치를 발견했습니다. Java를 새로 설치하거나 복구를 실행해주십시오. 액세스빌리티 기능 지ì›ì´ ì—†ì´ %PRODUCTNAME %PRODUCTVERSIONì„ ì‹œìž‘í•˜ì‹œë ¤ë©´ 무시 버튼 ë˜ëŠ” 취소 ë²„íŠ¼ì„ í´ë¦­í•´ì£¼ì‹­ì‹œì˜¤.";
Text[ chinese_simplified ] = "%PRODUCTNAME %PRODUCTVERSION å‘现在系统内有一个错误的 Java 版本。请é‡æ–°å®‰è£… Java 或å¯åŠ¨ä¿®å¤å®‰è£…程åºã€‚点击“忽略â€ï¼ŒçœåŽ»è¾…助功能支æŒï¼Œè€Œç›´æŽ¥å¼€å§‹å®‰è£… %PRODUCTNAME %PRODUCTVERSION 。或者点击“å–消â€ï¼Œä¸­æ–­å®‰è£…过程。";
Text[ chinese_traditional ] = "%PRODUCTNAME %PRODUCTVERSION 發ç¾åœ¨ç³»çµ±å†…有一個錯誤的 Java 版本。請é‡æ–°å®‰è£ Java 或啓動修復安è£ç¨‹å¼ã€‚按一下「忽略ã€ï¼ŒçœåŽ»å”助工具支æ´ï¼Œè€Œç›´æŽ¥å•“å‹•å®‰è£ %PRODUCTNAME %PRODUCTVERSION 。或者按下「å–消ã€ï¼Œä¸­æ–·å®‰è£éŽç¨‹ã€‚";
- Text[ turkish ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ arabic ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ catalan ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ thai ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
+ Text[ turkish ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click \"Ignore\" to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click \"Cancel\".";
+ Text[ arabic ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click \"Ignore\" to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click \"Cancel\".";
+ Text[ catalan ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click \"Ignore\" to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click \"Cancel\".";
+ Text[ thai ] = "%PRODUCTNAME %PRODUCTVERSION detected a faulty Java installation on your system. Please repair or renew your Java installation. Click \"Ignore\" to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click \"Cancel\".";
};
String SV_ACCESSERROR_MISSING_JAVA
{
Text = "Fehlende Java Installation";
- Text [English] = "No Java Installation";
+ Text[ english ] = "No Java Installation";
Text[ english_us ] = "No Java Installation";
Text[ portuguese ] = "No Java Installation";
Text[ russian ] = "No Java Installation";
@@ -354,7 +342,7 @@ String SV_ACCESSERROR_MISSING_JAVA
Text[ polish ] = "No Java Installation";
Text[ portuguese_brazilian ] = "No Java Installation";
Text[ japanese ] = "Java ã¯ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œã¦ã„ã¾ã›ã‚“";
- Text[ korean ] = "ìžë°”ê°€ 설치ë˜ì§€ 않았습니다.";
+ Text[ korean ] = "Javaê°€ 설치ë˜ì§€ 않았습니다.";
Text[ chinese_simplified ] = "没有安装 Java";
Text[ chinese_traditional ] = "沒有安è£å¥½ Java";
Text[ turkish ] = "No Java Installation";
@@ -363,29 +351,51 @@ String SV_ACCESSERROR_MISSING_JAVA
Text[ thai ] = "No Java Installation";
};
-String SV_ACCESSERROR_MISSING_JAVA_MSG
+String SV_ACCESSERROR_JAVA_NOT_CONFIGURED
{
- Text = "Es wurde keine Java Installation gefunden. Bitte installieren Sie eine Java Version. Klicken Sie '%IGNORE' um %PRODUCTNAME %PRODUCTVERSION ohne Unterstützung der Zugänglichkeit zu starten, oder klicken Sie '%CANCEL' um den Start zu beenden.";
- Text [English] = "No Java installation was found on your system. Please install a version of Java. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ english_us ] = "No Java installation was found on your system. Please install a version of Java. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ portuguese ] = "No Java installation was found on your system. Please install a version of Java. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ russian ] = "No Java installation was found on your system. Please install a version of Java. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ greek ] = "No Java installation was found on your system. Please install a version of Java. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ dutch ] = "No Java installation was found on your system. Please install a version of Java. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ french ] = "Aucune installation Java n'a pu être détectée sur le système. Veuillez installer une version de Java. Cliquez sur \"Ignorer\" pour démarrer %PRODUCTNAME %PRODUCTVERSION sans support d'accessibilité, ou sur \"Annuler\".";
- Text[ spanish ] = "No se encontró ninguna instalación de Java en el sistema. Instale una versión de Java. Pulse en \"Ignorar\" para iniciar %PRODUCTNAME %PRODUCTVERSION sin el soporte de accesibilidad o pulse en \"Cancelar\". ";
- Text[ finnish ] = "No Java installation was found on your system. Please install a version of Java. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ italian ] = "Non avete installato Java sul vostro sistema. Installate una versione di Java. Cliccate su \"Ignora\" per avviare %PRODUCTNAME %PRODUCTVERSION senza il supporto di accessibilità, altrimenti cliccate su \"Annulla\".";
- Text[ danish ] = "No Java installation was found on your system. Please install a version of Java. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ swedish ] = "Ingen Java-installation hittades i ditt system. Installera en version av Java. Klicka på \"Ignorera\" för att starta %PRODUCTNAME %PRODUCTVERSION utan tillgänglighetsstöd eller klicka på \"Avbryt\".";
- Text[ polish ] = "No Java installation was found on your system. Please install a version of Java. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ portuguese_brazilian ] = "No Java installation was found on your system. Please install a version of Java. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ japanese ] = "ãŠä½¿ã„ã®ã‚·ã‚¹ãƒ†ãƒ ã« Java ã¯ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œã¦ã„ã¾ã›ã‚“。Java ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’インストールã—ã¦ãã ã•ã„。アクセシビリティã®æ”¯æ´ãªã—㧠%PRODUCTNAME %PRODUCTVERSION ã‚’èµ·å‹•ã•ã›ã‚‹ã«ã¯ã€ï¼»ç„¡è¦–ã™ã‚‹ï¼½ãƒœã‚¿ãƒ³ã‚’クリックã—ã¦ãã ã•ã„。ã¾ãŸã¯ï¼»ã‚­ãƒ£ãƒ³ã‚»ãƒ«ï¼½ãƒœã‚¿ãƒ³ã‚’クリックã—ã¦ãã ã•ã„。";
- Text[ korean ] = "ì‚¬ìš©ìž ì‹œìŠ¤í…œì— Javaê°€ 설치ë˜ì§€ 않았습니다. Java를 설치해주십시오. 액세스빌리티 기능 지ì›ì´ ì—†ì´ %PRODUCTNAME %PRODUCTVERSIONì„ ì‹œìž‘í•˜ì‹œë ¤ë©´ 무시 버튼 ë˜ëŠ” 취소 ë²„íŠ¼ì„ í´ë¦­í•´ì£¼ì‹­ì‹œì˜¤.";
- Text[ chinese_simplified ] = "在系统内没有找到一个 Java 版本。请安装一个 Java 版本。点击“忽略â€ï¼ŒçœåŽ»è¾…助功能支æŒï¼Œè€Œç›´æŽ¥å¼€å§‹å®‰è£… %PRODUCTNAME %PRODUCTVERSION 。或者点击“å–消â€ï¼Œä¸­æ–­å®‰è£…过程。";
- Text[ chinese_traditional ] = "在系統内沒有找到一個 Java 版本。 請安è£ä¸€å€‹ Java 版本。按一下「忽略ã€ï¼ŒçœåŽ»å”助工具支æ´ï¼Œè€Œç›´æŽ¥å•“å‹•å®‰è£ %PRODUCTNAME %PRODUCTVERSION 。或者按下「å–消ã€ï¼Œä¸­æ–·å®‰è£éŽç¨‹ã€‚";
- Text[ turkish ] = "No Java installation was found on your system. Please install a version of Java. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ arabic ] = "No Java installation was found on your system. Please install a version of Java. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ catalan ] = "No Java installation was found on your system. Please install a version of Java. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
- Text[ thai ] = "No Java installation was found on your system. Please install a version of Java. Click '%IGNORE' to start %PRODUCTNAME %PRODUCTVERSION without accessibility support, or click '%CANCEL'.";
+ Text = "Fehlende Java-Konfiguration";
+ Text[ english ] = "Missing Java Configuration";
+ Text[ english_us ] = "Missing Java Configuration";
+ Text[ french ] = "Missing Java Configuration";
+ Text[ spanish ] = "Missing Java Configuration";
+ Text[ italian ] = "Missing Java Configuration";
+ Text[ swedish ] = "Missing Java Configuration";
+ Text[ japanese ] = "Missing Java Configuration";
+ Text[ korean ] = "Missing Java Configuration";
+ Text[ chinese_simplified ] = "Missing Java Configuration";
+ Text[ chinese_traditional ] = "Missing Java Configuration";
};
+
+String SV_ACCESSERROR_JAVA_DISABLED
+{
+ Text = "Java deaktiviert";
+ Text[ english ] = "Java Disabled";
+ Text[ english_us ] = "Java Disabled";
+ Text[ french ] = "Java Disabled";
+ Text[ spanish ] = "Java Disabled";
+ Text[ italian ] = "Java Disabled";
+ Text[ swedish ] = "Java Disabled";
+ Text[ japanese ] = "Java Disabled";
+ Text[ korean ] = "Java Disabled";
+ Text[ chinese_simplified ] = "Java Disabled";
+ Text[ chinese_traditional ] = "Java Disabled";
+};
+
+String SV_ACCESSERROR_TURNAROUND_MSG
+{
+ Text = "Die Java Access Bridge konnte nicht gestartet werden.";
+ Text[ english ] = "The Java Access Bridge could not be started.";
+ Text[ english_us ] = "The Java Access Bridge could not be started.";
+ Text[ french ] = "The Java Access Bridge could not be started.";
+ Text[ spanish ] = "The Java Access Bridge could not be started.";
+ Text[ italian ] = "The Java Access Bridge could not be started.";
+ Text[ swedish ] = "The Java Access Bridge could not be started.";
+ Text[ japanese ] = "The Java Access Bridge could not be started.";
+ Text[ korean ] = "The Java Access Bridge could not be started.";
+ Text[ chinese_simplified ] = "The Java Access Bridge could not be started.";
+ Text[ chinese_traditional ] = "The Java Access Bridge could not be started.";
+};
+
+
+
+
diff --git a/vcl/source/src/units.src b/vcl/source/src/units.src
index 0aa3898a501c..219e7381a7b0 100644
--- a/vcl/source/src/units.src
+++ b/vcl/source/src/units.src
@@ -2,9 +2,9 @@
*
* $RCSfile: units.src,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: rt $ $Date: 2002-12-05 14:29:53 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -239,7 +239,7 @@ ItemList [ language_user1 ] =
{
< "mm" ; FUNIT_MM ; > ;
< "cm" ; FUNIT_CM ; > ;
- < "S_population" ; FUNIT_M ; > ;
+ < "m" ; FUNIT_M ; > ;
< "km" ; FUNIT_KM ; > ;
< "twips" ; FUNIT_TWIP ; > ;
< "twip" ; FUNIT_TWIP ; > ;
@@ -260,7 +260,7 @@ ItemList [ language_user1 ] =
{
< "mm" ; FUNIT_MM ; > ;
< "cm" ; FUNIT_CM ; > ;
- < "pobl_éxito" ; FUNIT_M ; > ;
+ < "m" ; FUNIT_M ; > ;
< "km" ; FUNIT_KM ; > ;
< "twips" ; FUNIT_TWIP ; > ;
< "twip" ; FUNIT_TWIP ; > ;
@@ -302,12 +302,12 @@ ItemList [ language_user1 ] =
{
< "mm" ; FUNIT_MM ; > ;
< "cm" ; FUNIT_CM ; > ;
- < "Successi popolazione" ; FUNIT_M ; > ;
+ < "m" ; FUNIT_M ; > ;
< "km" ; FUNIT_KM ; > ;
< "twips" ; FUNIT_TWIP ; > ;
< "twip" ; FUNIT_TWIP ; > ;
< "pt" ; FUNIT_POINT ; > ;
- < "PI.GRECO" ; FUNIT_PICA ; > ;
+ < "pi" ; FUNIT_PICA ; > ;
< "\"" ; FUNIT_INCH ; > ;
< "in" ; FUNIT_INCH ; > ;
< "inch" ; FUNIT_INCH ; > ;
@@ -405,23 +405,23 @@ ItemList [ language_user1 ] =
};
ItemList [ japanese ] =
{
- < "mm" ; FUNIT_MM ; > ;
- < "cm" ; FUNIT_CM ; > ;
- < "m" ; FUNIT_M ; > ;
- < "km" ; FUNIT_KM ; > ;
- < "twips" ; FUNIT_TWIP ; > ;
+ < "ミリ" ; FUNIT_MM ; > ;
+ < "センãƒ" ; FUNIT_CM ; > ;
+ < "メートル" ; FUNIT_M ; > ;
+ < "キロメートル" ; FUNIT_KM ; > ;
< "twip" ; FUNIT_TWIP ; > ;
- < "pt" ; FUNIT_POINT ; > ;
- < "pi" ; FUNIT_PICA ; > ;
+ < "twip" ; FUNIT_TWIP ; > ;
+ < "ãƒã‚¤ãƒ³ãƒˆ" ; FUNIT_POINT ; > ;
+ < "ピクセル" ; FUNIT_PICA ; > ;
< "\"" ; FUNIT_INCH ; > ;
< "in" ; FUNIT_INCH ; > ;
- < "inch" ; FUNIT_INCH ; > ;
+ < "インãƒ" ; FUNIT_INCH ; > ;
< "'" ; FUNIT_FOOT ; > ;
< "ft" ; FUNIT_FOOT ; > ;
- < "foot" ; FUNIT_FOOT ; > ;
- < "feet" ; FUNIT_FOOT ; > ;
- < "miles" ; FUNIT_MILE ; > ;
- < "mile" ; FUNIT_MILE ; > ;
+ < "フィート" ; FUNIT_FOOT ; > ;
+ < "フィート" ; FUNIT_FOOT ; > ;
+ < "マイル" ; FUNIT_MILE ; > ;
+ < "マイル" ; FUNIT_MILE ; > ;
< "%" ; FUNIT_PERCENT ; > ;
};
ItemList [ korean ] =
@@ -433,7 +433,7 @@ ItemList [ language_user1 ] =
< "twips" ; FUNIT_TWIP ; > ;
< "twip" ; FUNIT_TWIP ; > ;
< "pt" ; FUNIT_POINT ; > ;
- < "파ì´" ; FUNIT_PICA ; > ;
+ < "pi" ; FUNIT_PICA ; > ;
< "\"" ; FUNIT_INCH ; > ;
< "in" ; FUNIT_INCH ; > ;
< "inch" ; FUNIT_INCH ; > ;
@@ -468,23 +468,23 @@ ItemList [ language_user1 ] =
};
ItemList [ chinese_traditional ] =
{
- < "mm" ; FUNIT_MM ; > ;
- < "cm" ; FUNIT_CM ; > ;
- < "m" ; FUNIT_M ; > ;
- < "km" ; FUNIT_KM ; > ;
- < "twips" ; FUNIT_TWIP ; > ;
+ < "公厘" ; FUNIT_MM ; > ;
+ < "公分" ; FUNIT_CM ; > ;
+ < "公尺" ; FUNIT_M ; > ;
+ < "公里" ; FUNIT_KM ; > ;
+ < "twip" ; FUNIT_TWIP ; > ;
< "twip" ; FUNIT_TWIP ; > ;
< "pt" ; FUNIT_POINT ; > ;
< "pi" ; FUNIT_PICA ; > ;
< "\"" ; FUNIT_INCH ; > ;
< "in" ; FUNIT_INCH ; > ;
- < "inch" ; FUNIT_INCH ; > ;
+ < "英å‹" ; FUNIT_INCH ; > ;
< "'" ; FUNIT_FOOT ; > ;
- < "ft" ; FUNIT_FOOT ; > ;
- < "foot" ; FUNIT_FOOT ; > ;
- < "feet" ; FUNIT_FOOT ; > ;
- < "miles" ; FUNIT_MILE ; > ;
- < "mile" ; FUNIT_MILE ; > ;
+ < "英尺" ; FUNIT_FOOT ; > ;
+ < "英尺" ; FUNIT_FOOT ; > ;
+ < "英尺" ; FUNIT_FOOT ; > ;
+ < "英里" ; FUNIT_MILE ; > ;
+ < "英里" ; FUNIT_MILE ; > ;
< "%" ; FUNIT_PERCENT ; > ;
};
ItemList [ turkish ] =
@@ -573,3 +573,8 @@ ItemList [ language_user1 ] =
};
};
+
+
+
+
+
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 16eb0e5e1739..e0539abdb27b 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: brdwin.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: ssa $ $Date: 2002-06-27 16:17:20 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1090,6 +1090,8 @@ void ImplSmallBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice*, co
nStyle |= FRAME_DRAW_DOUBLEIN;
if ( nBorderStyle & WINDOW_BORDER_MONO )
nStyle |= FRAME_DRAW_MONO;
+ if ( nBorderStyle & WINDOW_BORDER_MENU )
+ nStyle |= FRAME_DRAW_MENU;
DecorationView aDecoView( mpOutDev );
Point aTmpPoint;
@@ -3213,7 +3215,7 @@ void ImplBorderWindow::ImplInit( Window* pParent,
{
// Alle WindowBits entfernen, die wir nicht haben wollen
WinBits nOrgStyle = nStyle;
- WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_PINABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN);
+ WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_PINABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN | WB_INTROWIN | WB_NOSHADOW);
if ( nTypeStyle & BORDERWINDOW_STYLE_APP )
nTestStyle |= WB_APP;
nStyle &= nTestStyle;
diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index aa4718e02682..25d998fc52a0 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: cursor.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: ssa $ $Date: 2001-11-26 17:12:38 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -99,6 +99,7 @@ struct ImplCursorData
Size maPixSize; // Pixel-Size
long mnPixSlant; // Pixel-Slant
short mnOrientation; // Pixel-Orientation
+ unsigned char mnDirection; // indicates writing direction
USHORT mnStyle; // Cursor-Style
BOOL mbCurVisible; // Ist Cursor aktuell sichtbar
Window* mpWindow; // Zugeordnetes Windows
@@ -116,10 +117,13 @@ static void ImplCursorInvert( ImplCursorData* pData )
nInvertStyle = INVERT_50;
else
nInvertStyle = 0;
+
Rectangle aRect( pData->maPixPos, pData->maPixSize );
- if ( pData->mnOrientation || pData->mnPixSlant )
+ if ( pData->mnDirection || pData->mnOrientation || pData->mnPixSlant )
{
Polygon aPoly( aRect );
+ aPoly[1].X() += 1; // include the right border
+ aPoly[2].X() += 1;
if ( pData->mnPixSlant )
{
Point aPoint = aPoly.GetPoint( 0 );
@@ -130,6 +134,41 @@ static void ImplCursorInvert( ImplCursorData* pData )
aPoint.X() += pData->mnPixSlant;
aPoly.SetPoint( aPoint, 1 );
}
+
+ // apply direction flag after slant to use the correct shape
+ if ( pData->mnDirection )
+ {
+ Point pAry[7];
+ int delta = 3*aRect.getWidth()+1;
+ if( pData->mnDirection == CURSOR_DIRECTION_LTR )
+ {
+ // left-to-right
+ pAry[0] = aPoly.GetPoint( 0 );
+ pAry[1] = aPoly.GetPoint( 1 );
+ pAry[2] = pAry[1];
+ pAry[2].X() += delta;
+ pAry[3] = pAry[1];
+ pAry[3].Y() += delta;
+ pAry[4] = aPoly.GetPoint( 2 );
+ pAry[5] = aPoly.GetPoint( 3 );
+ pAry[6] = aPoly.GetPoint( 4 );
+ }
+ else if( pData->mnDirection == CURSOR_DIRECTION_RTL )
+ {
+ // right-to-left
+ pAry[0] = aPoly.GetPoint( 0 );
+ pAry[1] = aPoly.GetPoint( 1 );
+ pAry[2] = aPoly.GetPoint( 2 );
+ pAry[3] = aPoly.GetPoint( 3 );
+ pAry[4] = pAry[0];
+ pAry[4].Y() += delta;
+ pAry[5] = pAry[0];
+ pAry[5].X() -= delta;
+ pAry[6] = aPoly.GetPoint( 4 );
+ }
+ aPoly = Polygon( 7, pAry);
+ }
+
if ( pData->mnOrientation )
aPoly.Rotate( pData->maPixRotOff, pData->mnOrientation );
pWindow->Invert( aPoly, nInvertStyle );
@@ -150,6 +189,7 @@ void Cursor::ImplDraw()
mpData->maPixSize = pWindow->LogicToPixel( maSize );
mpData->mnPixSlant = pWindow->LogicToPixel( Size( mnSlant, 0 ) ).Width();
mpData->mnOrientation = mnOrientation;
+ mpData->mnDirection = mnDirection;
long nOffsetY = pWindow->LogicToPixel( Size( 0, mnOffsetY ) ).Height();
// Position um den Offset korrigieren
@@ -280,6 +320,7 @@ Cursor::Cursor()
mnSlant = 0;
mnOffsetY = 0;
mnOrientation = 0;
+ mnDirection = 0;
mnStyle = 0;
mbVisible = FALSE;
}
@@ -294,6 +335,7 @@ Cursor::Cursor( const Cursor& rCursor ) :
mpWindow = NULL;
mnSlant = rCursor.mnSlant;
mnOrientation = rCursor.mnOrientation;
+ mnDirection = rCursor.mnDirection;
mnStyle = 0;
mbVisible = rCursor.mbVisible;
}
@@ -434,12 +476,24 @@ void Cursor::SetOrientation( short nNewOrientation )
// -----------------------------------------------------------------------
+void Cursor::SetDirection( unsigned char nNewDirection )
+{
+ if ( mnDirection != nNewDirection )
+ {
+ mnDirection = nNewDirection;
+ ImplNew();
+ }
+}
+
+// -----------------------------------------------------------------------
+
Cursor& Cursor::operator=( const Cursor& rCursor )
{
maPos = rCursor.maPos;
maSize = rCursor.maSize;
mnSlant = rCursor.mnSlant;
mnOrientation = rCursor.mnOrientation;
+ mnDirection = rCursor.mnDirection;
mbVisible = rCursor.mbVisible;
ImplNew();
@@ -454,6 +508,7 @@ BOOL Cursor::operator==( const Cursor& rCursor ) const
(maSize == rCursor.maSize) &&
(mnSlant == rCursor.mnSlant) &&
(mnOrientation == rCursor.mnOrientation) &&
+ (mnDirection == rCursor.mnDirection) &&
(mbVisible == rCursor.mbVisible) )
return TRUE;
else
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index 37b532df5fa0..f404effcccb6 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: decoview.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: cd $ $Date: 2003-01-09 12:01:32 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -551,27 +551,37 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect,
break;
case SYMBOL_CHECKMARK:
{
- Point aPos1( rRect.Left(), rRect.Bottom() - rRect.GetHeight() / 3 );
- Point aPos2( rRect.Left() + rRect.GetWidth()/3, rRect.Bottom() );
- Point aPos3( rRect.TopRight() );
+ // #106953# never mirror checkmarks
+ BOOL bRTL = pDev->ImplHasMirroredGraphics() && pDev->IsRTLEnabled();
+ Point aPos1( bRTL ? rRect.Right() : rRect.Left(),
+ rRect.Bottom() - rRect.GetHeight() / 3 );
+ Point aPos2( bRTL ? rRect.Right() - rRect.GetWidth()/3 : rRect.Left() + rRect.GetWidth()/3,
+ rRect.Bottom() );
+ Point aPos3( bRTL ? rRect.TopLeft() : rRect.TopRight() );
Size aRectSize( 1, 2 );
long nStepsY = aPos2.Y()-aPos1.Y();
long nX = aPos1.X();
long nY = aPos1.Y();
for ( long n = 0; n <= nStepsY; n++ )
{
+ if( bRTL )
+ nX--;
pDev->DrawRect( Rectangle( Point( nX, nY++ ), aRectSize ) );
- nX++;
+ if( !bRTL )
+ nX++;
}
nStepsY = aPos2.Y()-aPos3.Y();
nX = aPos2.X();
nY = aPos2.Y();
for ( n = 0; n <= nStepsY; n++ )
{
+ if( bRTL )
+ if ( --nX < rRect.Left() )
+ break;
pDev->DrawRect( Rectangle( Point( nX, nY-- ), aRectSize ) );
- nX++;
- if ( nX > rRect.Right() )
- break;
+ if( !bRTL )
+ if ( ++nX > rRect.Right() )
+ break;
}
}
break;
@@ -862,6 +872,10 @@ static void ImplDrawDPILineRect( OutputDevice* pDev, Rectangle& rRect,
static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
const StyleSettings& rStyleSettings, USHORT nStyle )
{
+ // mask menu style
+ BOOL bMenuStyle = nStyle & FRAME_DRAW_MENU;
+ nStyle &= ~FRAME_DRAW_MENU;
+
if ( (rStyleSettings.GetOptions() & STYLE_OPTION_MONO) ||
(pDev->GetOutDevType() == OUTDEV_PRINTER) )
nStyle |= FRAME_DRAW_MONO;
@@ -962,6 +976,8 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
else
{
pDev->ImplDraw2ColorFrame( rRect,
+ bMenuStyle ?
+ rStyleSettings.GetMenuBorderColor() :
rStyleSettings.GetLightBorderColor(),
rStyleSettings.GetDarkShadowColor() );
}
@@ -979,9 +995,11 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
}
else
{
- pDev->ImplDraw2ColorFrame( rRect,
- rStyleSettings.GetLightColor(),
- rStyleSettings.GetShadowColor() );
+ // flat menues have no shadow border
+ if( !bMenuStyle || !rStyleSettings.GetUseFlatMenues() )
+ pDev->ImplDraw2ColorFrame( rRect,
+ rStyleSettings.GetLightColor(),
+ rStyleSettings.GetShadowColor() );
}
rRect.Left()++;
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 02a3297f8ad7..9b5c523d2db1 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dialog.cxx,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: pl $ $Date: 2002-12-10 16:50:31 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -138,6 +138,9 @@ static ByteString ImplGetDialogText( Dialog* pDialog )
static BOOL ImplIsMnemonicCtrl( Window* pWindow )
{
+ if( ! pWindow->GetSettings().GetStyleSettings().GetAutoMnemonic() )
+ return FALSE;
+
if ( (pWindow->GetType() == WINDOW_RADIOBUTTON) ||
(pWindow->GetType() == WINDOW_CHECKBOX) ||
(pWindow->GetType() == WINDOW_TRISTATEBOX) ||
@@ -193,7 +196,7 @@ void ImplWindowAutoMnemonic( Window* pWindow )
if ( (pParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) == WB_DIALOGCONTROL )
{
- pGetChild = pWindow->GetWindow( WINDOW_FIRSTCHILD );
+ pGetChild = pParent->GetWindow( WINDOW_FIRSTCHILD );
while ( pGetChild )
{
pChild = pGetChild->ImplGetWindow();
@@ -531,7 +534,7 @@ void Dialog::StateChanged( StateChangedType nType )
if ( nType == STATE_CHANGE_INITSHOW )
{
- if ( Application::IsAutoMnemonicEnabled() )
+ if ( GetSettings().GetStyleSettings().GetAutoMnemonic() )
ImplWindowAutoMnemonic( this );
//if ( IsDefaultPos() && !mbFrame )
@@ -695,9 +698,14 @@ short Dialog::Execute()
ImplDelData aDelData;
ImplAddDel( &aDelData );
pSVData->maAppData.mnModalMode++;
+ //DBG_ASSERT( mpDialogParent, "Dialog::Execute() - no Parent: cannot set modal count!" );
+ if( mpDialogParent )
+ mpDialogParent->ImplIncModalCount(); // #106303# support frame based modal count
while ( !aDelData.IsDelete() && mbInExecute )
Application::Yield();
pSVData->maAppData.mnModalMode--;
+ if( mpDialogParent )
+ mpDialogParent->ImplDecModalCount(); // #106303# support frame based modal count
if ( !aDelData.IsDelete() )
ImplRemoveDel( &aDelData );
#ifdef DBG_UTIL
diff --git a/vcl/source/window/dndevdis.cxx b/vcl/source/window/dndevdis.cxx
index 1e779ac0eb19..21dd58b8719e 100644
--- a/vcl/source/window/dndevdis.cxx
+++ b/vcl/source/window/dndevdis.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dndevdis.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: obr $ $Date: 2002-04-30 15:45:40 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -105,6 +105,10 @@ void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde )
// find the window that is toplevel for this coordinates
OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+
+ // because those coordinates come from outside, they must be mirrored if RTL layout is active
+ if( Application::GetSettings().GetLayoutRTL() )
+ m_pTopWindow->ImplMirrorFramePos( location );
Window * pChildWindow = m_pTopWindow->ImplFindWindow( location );
if( NULL == pChildWindow )
@@ -113,6 +117,9 @@ void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde )
while( pChildWindow->ImplGetClientWindow() )
pChildWindow = pChildWindow->ImplGetClientWindow();
+ if( pChildWindow->ImplHasMirroredGraphics() && !pChildWindow->IsRTLEnabled() )
+ pChildWindow->ImplReMirror( location );
+
aSolarGuard.clear();
// handle the case that drop is in an other vcl window than the last dragOver
@@ -135,7 +142,6 @@ void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde )
if( nListeners == 0 ) {
OSL_TRACE( "rejecting drop due to missing listeners." );
dtde.Context->rejectDrop();
- dtde.Context->dropComplete(sal_False);
}
// this is a drop -> no further drag overs
@@ -155,6 +161,10 @@ void SAL_CALL DNDEventDispatcher::dragEnter( const DropTargetDragEnterEvent& dtd
// find the window that is toplevel for this coordinates
OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+
+ // because those coordinates come from outside, they must be mirrored if RTL layout is active
+ if( Application::GetSettings().GetLayoutRTL() )
+ m_pTopWindow->ImplMirrorFramePos( location );
Window * pChildWindow = m_pTopWindow->ImplFindWindow( location );
if( NULL == pChildWindow )
@@ -163,6 +173,9 @@ void SAL_CALL DNDEventDispatcher::dragEnter( const DropTargetDragEnterEvent& dtd
while( pChildWindow->ImplGetClientWindow() )
pChildWindow = pChildWindow->ImplGetClientWindow();
+ if( pChildWindow->ImplHasMirroredGraphics() && !pChildWindow->IsRTLEnabled() )
+ pChildWindow->ImplReMirror( location );
+
aSolarGuard.clear();
// assume pointer write operation to be atomic
@@ -211,6 +224,10 @@ void SAL_CALL DNDEventDispatcher::dragOver( const DropTargetDragEvent& dtde )
// find the window that is toplevel for this coordinates
OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+
+ // because those coordinates come from outside, they must be mirrored if RTL layout is active
+ if( Application::GetSettings().GetLayoutRTL() )
+ m_pTopWindow->ImplMirrorFramePos( location );
Window * pChildWindow = m_pTopWindow->ImplFindWindow( location );
if( NULL == pChildWindow )
@@ -219,6 +236,9 @@ void SAL_CALL DNDEventDispatcher::dragOver( const DropTargetDragEvent& dtde )
while( pChildWindow->ImplGetClientWindow() )
pChildWindow = pChildWindow->ImplGetClientWindow();
+ if( pChildWindow->ImplHasMirroredGraphics() && !pChildWindow->IsRTLEnabled() )
+ pChildWindow->ImplReMirror( location );
+
aSolarGuard.clear();
if( pChildWindow != m_pCurrentWindow )
@@ -262,6 +282,10 @@ void SAL_CALL DNDEventDispatcher::dropActionChanged( const DropTargetDragEvent&
// find the window that is toplevel for this coordinates
OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+
+ // because those coordinates come from outside, they must be mirrored if RTL layout is active
+ if( Application::GetSettings().GetLayoutRTL() )
+ m_pTopWindow->ImplMirrorFramePos( location );
Window * pChildWindow = m_pTopWindow->ImplFindWindow( location );
if( NULL == pChildWindow )
@@ -270,6 +294,9 @@ void SAL_CALL DNDEventDispatcher::dropActionChanged( const DropTargetDragEvent&
while( pChildWindow->ImplGetClientWindow() )
pChildWindow = pChildWindow->ImplGetClientWindow();
+ if( pChildWindow->ImplHasMirroredGraphics() && !pChildWindow->IsRTLEnabled() )
+ pChildWindow->ImplReMirror( location );
+
aSolarGuard.clear();
if( pChildWindow != m_pCurrentWindow )
@@ -313,6 +340,10 @@ void SAL_CALL DNDEventDispatcher::dragGestureRecognized( const DragGestureEvent&
// find the window that is toplevel for this coordinates
OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+
+ // because those coordinates come from outside, they must be mirrored if RTL layout is active
+ if( Application::GetSettings().GetLayoutRTL() )
+ m_pTopWindow->ImplMirrorFramePos( origin );
Window * pChildWindow = m_pTopWindow->ImplFindWindow( origin );
if( NULL == pChildWindow )
@@ -321,6 +352,9 @@ void SAL_CALL DNDEventDispatcher::dragGestureRecognized( const DragGestureEvent&
while( pChildWindow->ImplGetClientWindow() )
pChildWindow = pChildWindow->ImplGetClientWindow();
+ if( pChildWindow->ImplHasMirroredGraphics() && !pChildWindow->IsRTLEnabled() )
+ pChildWindow->ImplReMirror( origin );
+
aSolarGuard.clear();
fireDragGestureEvent( pChildWindow, dge.DragSource, dge.Event, origin, dge.DragAction );
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index 3f4c00c6f6c5..954982e166ce 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dockwin.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: pl $ $Date: 2002-12-11 17:44:54 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -654,11 +654,8 @@ long DockingWindow::Notify( NotifyEvent& rNEvt )
else if( rNEvt.GetType() == EVENT_KEYINPUT )
{
const KeyCode& rKey = rNEvt.GetKeyEvent()->GetKeyCode();
- if( rKey.GetCode() == KEY_F4 && rKey.GetModifier()
-#ifdef WNT
- && !rKey.IsMod2() // avoid Alt-F4 on Windows
-#endif
- )
+ if( rKey.GetCode() == KEY_F10 && rKey.GetModifier() &&
+ rKey.IsShift() && rKey.IsMod1() )
{
SetFloatingMode( !IsFloatingMode() );
return TRUE;
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 2b1597462498..5732e9b90df7 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: floatwin.cxx,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: ssa $ $Date: 2002-12-09 11:07:25 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -388,7 +388,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
if( ( (nArrangeAry[nArrangeIndex] == FLOATWIN_POPUPMODE_DOWN) ||
(nArrangeAry[nArrangeIndex] == FLOATWIN_POPUPMODE_RIGHT) )
&& ( nFlags & FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE ) )
- aPos.X() += 1;
+ aPos.X() += 2;
// Evt. noch anpassen
if ( bBreak && !(nFlags & FLOATWIN_POPUPMODE_NOAUTOARRANGE) )
@@ -448,21 +448,28 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Point& rPos, USHORT& rHitTest )
{
- // compare coordinates in absolute screen coordinates
FloatingWindow* pWin = this;
- Point aAbsolute( pReference->OutputToAbsoluteScreenPixel(
- pReference->ScreenToOutputPixel(rPos) ) );
- if( pReference->ImplHasMirroredGraphics() && !pReference->IsRTLEnabled() )
+ Point aAbsolute( rPos );
+
+ // compare coordinates in absolute screen coordinates
+ if( pReference->ImplHasMirroredGraphics() )
{
- // --- RTL --- re-mirror back to get device coordiantes
- pReference->ImplReMirror( aAbsolute );
+ if(!pReference->IsRTLEnabled() )
+ // --- RTL --- re-mirror back to get device coordiantes
+ pReference->ImplReMirror( aAbsolute );
+
+ Rectangle aRect( pReference->ScreenToOutputPixel(aAbsolute), Size(1,1) ) ;
+ aRect = pReference->ImplOutputToUnmirroredAbsoluteScreenPixel( aRect );
+ aAbsolute = aRect.TopLeft();
}
+ else
+ aAbsolute = Point( pReference->OutputToAbsoluteScreenPixel(
+ pReference->ScreenToOutputPixel(rPos) ) );
do
{
- //Rectangle devRect( OutputToAbsoluteScreenPixel( ScreenToOutputPixel(pWin->GetPosPixel()) ), pWin->GetSizePixel() ) ;
- Rectangle devRect( pWin->GetWindowExtentsRelative( NULL ) );
+ Rectangle devRect( pWin->ImplOutputToUnmirroredAbsoluteScreenPixel( Rectangle( pWin->ScreenToOutputPixel(pWin->GetPosPixel()), pWin->GetSizePixel()) ) ) ;
if ( devRect.IsInside( aAbsolute ) )
{
rHitTest = IMPL_FLOATWIN_HITTEST_WINDOW;
diff --git a/vcl/source/window/introwin.cxx b/vcl/source/window/introwin.cxx
new file mode 100644
index 000000000000..9a248117aab6
--- /dev/null
+++ b/vcl/source/window/introwin.cxx
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * $RCSfile: introwin.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _SV_INTROWIN_CXX
+
+#ifndef REMOTE_APPSERVER
+#ifndef _SV_SVSYS_HXX
+#include <svsys.h>
+#endif
+#ifndef _SV_SALFRAME_HXX
+#include <salframe.hxx>
+#endif
+#else
+#include <rmwindow.hxx>
+#endif
+
+#ifndef _DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+#ifndef _SV_RC_H
+#include <rc.h>
+#endif
+#ifndef _SV_SVDATA_HXX
+#include <svdata.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX
+#include <svapp.hxx>
+#endif
+#ifndef _SV_BRDWIN_HXX
+#include <brdwin.hxx>
+#endif
+#ifndef _SV_WINDOW_H
+#include <window.h>
+#endif
+#ifndef _SV_WRKWIN_HXX
+#include <wrkwin.hxx>
+#endif
+#ifndef _SV_OPENGL_HXX
+#include <opengl.hxx>
+#endif
+
+#include <introwin.hxx>
+
+#pragma hdrstop
+
+
+// =======================================================================
+
+void IntroWindow::ImplInitData()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ pSVData->mpIntroWindow = this;
+}
+
+// -----------------------------------------------------------------------
+
+IntroWindow::IntroWindow( ) :
+ WorkWindow( WINDOW_INTROWINDOW )
+{
+ ImplInitData();
+ WorkWindow::ImplInit( 0, WB_INTROWIN, NULL );
+}
+
+// -----------------------------------------------------------------------
+
+IntroWindow::~IntroWindow()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ if ( pSVData->mpIntroWindow == this )
+ pSVData->mpIntroWindow = NULL;
+}
+
+
diff --git a/vcl/source/window/makefile.mk b/vcl/source/window/makefile.mk
index 1cc1498a676c..8bee810368c8 100644
--- a/vcl/source/window/makefile.mk
+++ b/vcl/source/window/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.9 $
+# $Revision: 1.10 $
#
-# last change: $Author: obr $ $Date: 2002-11-21 08:18:50 $
+# last change: $Author: hr $ $Date: 2003-03-27 17:58:22 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -105,6 +105,7 @@ SLOFILES= $(SLO)$/accel.obj \
$(SLO)$/window2.obj \
$(SLO)$/winproc.obj \
$(SLO)$/wrkwin.obj \
+ $(SLO)$/introwin.obj \
$(SLO)$/scrwnd.obj \
$(SLO)$/dndevdis.obj \
$(SLO)$/dndlcon.obj \
@@ -117,6 +118,7 @@ EXCEPTIONSFILES= \
$(SLO)$/window.obj \
$(SLO)$/winproc.obj \
$(SLO)$/wrkwin.obj \
+ $(SLO)$/introwin.obj \
$(SLO)$/accel.obj \
$(SLO)$/cursor.obj \
$(SLO)$/dlgctrl.obj \
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index a164a6cde4af..6b8885c4e557 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: menu.cxx,v $
*
- * $Revision: 1.89 $
+ * $Revision: 1.90 $
*
- * last change: $Author: tbe $ $Date: 2002-12-12 18:04:56 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1864,20 +1864,24 @@ Size Menu::ImplCalcSize( Window* pWin )
Size aMaxImgSz;
long nMaxTextWidth = 0;
long nMaxAccWidth = 0;
+ long nMinMenuItemHeight = nFontHeight;
- static long nMinMenuItemHeight = 16;
-
- for ( USHORT i = (USHORT)pItemList->Count(); i; )
+ const StyleSettings& rSettings = pWin->GetSettings().GetStyleSettings();
+ if ( rSettings.GetUseImagesInMenus() )
{
- MenuItemData* pData = pItemList->GetDataFromPos( --i );
- if ( ImplIsVisible( i ) && ( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ))
+ nMinMenuItemHeight = 16;
+ for ( USHORT i = (USHORT)pItemList->Count(); i; )
{
- Size aImgSz = pData->aImage.GetSizePixel();
- if ( aImgSz.Height() > aMaxImgSz.Height() )
- aMaxImgSz.Height() = aImgSz.Height();
- if ( aImgSz.Height() > nMinMenuItemHeight )
- nMinMenuItemHeight = aImgSz.Height();
- break;
+ MenuItemData* pData = pItemList->GetDataFromPos( --i );
+ if ( ImplIsVisible( i ) && ( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ))
+ {
+ Size aImgSz = pData->aImage.GetSizePixel();
+ if ( aImgSz.Height() > aMaxImgSz.Height() )
+ aMaxImgSz.Height() = aImgSz.Height();
+ if ( aImgSz.Height() > nMinMenuItemHeight )
+ nMinMenuItemHeight = aImgSz.Height();
+ break;
+ }
}
}
@@ -1918,16 +1922,19 @@ Size Menu::ImplCalcSize( Window* pWin )
nMaxTextWidth = nTextWidth;
long nTextHeight = pWin->GetTextHeight();
- pData->aSz.Height() = std::max( std::max( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight );
-
// if ( nTextHeight > pData->aSz.Height() )
// pData->aSz.Height() = nTextHeight;
if ( bIsMenuBar )
{
+ if ( nTextHeight > pData->aSz.Height() )
+ pData->aSz.Height() = nTextHeight;
+
pData->aSz.Width() = nTextWidth + 4*nExtra;
aSz.Width() += pData->aSz.Width();
}
+ else
+ pData->aSz.Height() = std::max( std::max( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight );
}
// Accel
@@ -1961,11 +1968,12 @@ Size Menu::ImplCalcSize( Window* pWin )
if ( !bIsMenuBar )
{
+ USHORT gfxExtra = std::max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text
nCheckPos = (USHORT)nExtra;
- nImagePos = (USHORT)(nCheckPos + nFontHeight/2 + nExtra );
+ nImagePos = (USHORT)(nCheckPos + nFontHeight/2 + gfxExtra );
nTextPos = (USHORT)(nImagePos+aMaxImgSz.Width());
if ( aMaxImgSz.Width() )
- nTextPos += (USHORT)nExtra;
+ nTextPos += gfxExtra;
aSz.Width() = nTextPos + nMaxTextWidth + nExtra + nMaxAccWidth;
aSz.Width() += 10*nExtra; // etwas mehr...
@@ -2016,6 +2024,8 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
if ( aPos.Y() >= 0 )
{
long nTextOffsetY = ((pData->aSz.Height()-nFontHeight)/2);
+ if( bIsMenuBar )
+ nTextOffsetY += (aOutSz.Height()-pData->aSz.Height()) / 2;
USHORT nTextStyle = 0;
USHORT nSymbolStyle = 0;
USHORT nImageStyle = 0;
@@ -2034,12 +2044,12 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
if ( !bLayout && !bIsMenuBar && ( pData->eType == MENUITEM_SEPARATOR ) )
{
aTmpPos.Y() = aPos.Y() + ((pData->aSz.Height()-2)/2);
- aTmpPos.X() = aPos.X() + 1;
+ aTmpPos.X() = aPos.X() + 2;
pWin->SetLineColor( rSettings.GetShadowColor() );
- pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 1, aTmpPos.Y() ) );
+ pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3, aTmpPos.Y() ) );
aTmpPos.Y()++;
pWin->SetLineColor( rSettings.GetLightColor() );
- pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 1, aTmpPos.Y() ) );
+ pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3, aTmpPos.Y() ) );
pWin->SetLineColor();
}
@@ -2512,6 +2522,7 @@ Window* MenuBar::ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu )
pMenu->pWindow = pWindow;
((MenuBarWindow*)pWindow)->SetMenu( pMenu );
long nHeight = pMenu->ImplCalcSize( pWindow ).Height();
+ if( nHeight < 20 ) nHeight = 20; // leave enough space for closer
pWindow->SetPosSizePixel( 0, 0, 0, nHeight, WINDOW_POSSIZE_HEIGHT );
return pWindow;
}
@@ -2741,6 +2752,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM
}
MenuFloatingWindow* pWin = new MenuFloatingWindow( this, pW, nStyle | WB_SYSTEMWINDOW );
+ pWin->SetBorderStyle( pWin->GetBorderStyle() | WINDOW_BORDER_MENU );
pWindow = pWin;
Size aSz = ImplCalcSize( pWin );
@@ -4169,7 +4181,10 @@ void MenuBarWindow::ImplCreatePopup( BOOL bPreSelectFirst )
// Im Vollbild-Modus hat die MenuBar ggf. die Hoehe 0:
// Nicht immer einfach die Window-Hoehe nehmen, weil ItemHeight < WindowHeight.
if ( GetSizePixel().Height() )
- aItemBottomRight.Y() += pData->aSz.Height();
+ {
+ // #107747# give menuitems the height of the menubar
+ aItemBottomRight.Y() += GetOutputSizePixel().Height()-1;
+ }
// ImplExecute ist doch nicht modal...
// #99071# do not grab the focus, otherwise it will be restored to the menubar
@@ -4355,7 +4370,8 @@ void MenuBarWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
else
SetFillColor( GetSettings().GetStyleSettings().GetMenuBarColor() );
- DrawRect( Rectangle( Point( nX, 1 ), Size( pData->aSz.Width(), pData->aSz.Height()-2 ) ) );
+ // #107747# give menuitems the height of the menubar
+ DrawRect( Rectangle( Point( nX, 1 ), Size( pData->aSz.Width(), GetOutputSizePixel().Height()-2 ) ) );
pMenu->ImplPaint( this, 0, 0, pData, bHighlight );
}
return;
@@ -4376,7 +4392,8 @@ Rectangle MenuBarWindow::ImplGetItemRect( USHORT nPos )
if ( n == nPos )
{
if ( pData->eType != MENUITEM_SEPARATOR )
- aRect = Rectangle( Point( nX, 1 ), Size( pData->aSz.Width(), pData->aSz.Height()-2 ) );
+ // #107747# give menuitems the height of the menubar
+ aRect = Rectangle( Point( nX, 1 ), Size( pData->aSz.Width(), GetOutputSizePixel().Height()-2 ) );
break;
}
@@ -4681,6 +4698,7 @@ void MenuBarWindow::DataChanged( const DataChangedEvent& rDCEvt )
ImplInitMenuWindow( this, TRUE, TRUE );
// Falls sich der Font geaendert hat.
long nHeight = pMenu->ImplCalcSize( this ).Height();
+ if( nHeight < 20 ) nHeight = 20; // leave enough space for closer
SetPosSizePixel( 0, 0, 0, nHeight, WINDOW_POSSIZE_HEIGHT );
GetParent()->Resize();
Invalidate();
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 184d556c054b..59b7ba919b2e 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: splitwin.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: pl $ $Date: 2002-08-28 09:13:50 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -415,7 +415,7 @@ static void ImplDeleteSet( ImplSplitSet* pSet )
if ( pSet->mpBitmap )
delete pSet->mpBitmap;
- delete pItems;
+ delete [] pItems;
delete pSet;
}
@@ -1476,6 +1476,73 @@ void SplitWindow::ImplSetWindowSize( long nDelta )
// -----------------------------------------------------------------------
+Size SplitWindow::CalcLayoutSizePixel( const Size& aNewSize )
+{
+ Size aSize( aNewSize );
+ long nSplitSize = mpMainSet->mnSplitSize-2;
+
+ if ( mbAutoHide || mbFadeOut )
+ nSplitSize += SPLITWIN_SPLITSIZEEX;
+
+ // Wenn Fenster sizeable ist, wird die groesse automatisch nach
+ // dem MainSet festgelegt, wenn kein relatives Fenster enthalten
+ // ist
+ if ( mnWinStyle & WB_SIZEABLE )
+ {
+ long nCurSize;
+ long nCalcSize = 0;
+ USHORT i;
+
+ for ( i = 0; i < mpMainSet->mnItems; i++ )
+ {
+ if ( mpMainSet->mpItems[i].mnBits & (SWIB_RELATIVESIZE | SWIB_PERCENTSIZE) )
+ break;
+ else
+ nCalcSize += mpMainSet->mpItems[i].mnSize;
+ }
+
+ if ( i == mpMainSet->mnItems )
+ {
+ long nDelta = 0;
+ Point aPos = GetPosPixel();
+
+ if ( mbHorz )
+ nCurSize = aNewSize.Height()-mnTopBorder-mnBottomBorder;
+ else
+ nCurSize = aNewSize.Width()-mnLeftBorder-mnRightBorder;
+ nCurSize -= nSplitSize;
+ nCurSize -= (mpMainSet->mnItems-1)*mpMainSet->mnSplitSize;
+
+ nDelta = nCalcSize-nCurSize;
+ if ( !nDelta )
+ return aSize;
+
+ if ( meAlign == WINDOWALIGN_TOP )
+ {
+ aSize.Height() += nDelta;
+ }
+ else if ( meAlign == WINDOWALIGN_BOTTOM )
+ {
+ aPos.Y() -= nDelta;
+ aSize.Height() += nDelta;
+ }
+ else if ( meAlign == WINDOWALIGN_LEFT )
+ {
+ aSize.Width() += nDelta;
+ }
+ else // meAlign == WINDOWALIGN_RIGHT
+ {
+ aPos.X() -= nDelta;
+ aSize.Width() += nDelta;
+ }
+ }
+ }
+
+ return aSize;
+}
+
+// -----------------------------------------------------------------------
+
void SplitWindow::ImplCalcLayout()
{
if ( !mbCalc || !mbRecalc || !mpMainSet->mpItems )
@@ -2641,7 +2708,7 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize,
memcpy( pNewItems, pSet->mpItems, sizeof( ImplSplitItem )*nPos );
if ( nPos < pSet->mnItems )
memcpy( pNewItems+nPos+1, pSet->mpItems+nPos, sizeof( ImplSplitItem )*(pSet->mnItems-nPos) );
- delete pSet->mpItems;
+ delete[] pSet->mpItems;
pSet->mpItems = pNewItems;
pSet->mnItems++;
pSet->mbCalcPix = TRUE;
@@ -2740,7 +2807,7 @@ void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId )
}
else
{
- delete pSet->mpItems;
+ delete[] pSet->mpItems;
pSet->mpItems = NULL;
}
ImplSplitItem* pNewItems = new ImplSplitItem[pNewSet->mnItems+1];
@@ -2751,7 +2818,7 @@ void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId )
memcpy( pNewItems+nNewPos+1, pNewSet->mpItems+nNewPos,
sizeof( ImplSplitItem )*(pNewSet->mnItems-nNewPos) );
}
- delete pNewSet->mpItems;
+ delete[] pNewSet->mpItems;
pNewSet->mpItems = pNewItems;
pNewSet->mnItems++;
pNewSet->mbCalcPix = TRUE;
@@ -2790,7 +2857,7 @@ void SplitWindow::RemoveItem( USHORT nId, BOOL bHide )
}
else
{
- delete pSet->mpItems;
+ delete[] pSet->mpItems;
pSet->mpItems = NULL;
}
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index ec4b6306ac1b..d182c10bdb29 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: status.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: cd $ $Date: 2002-11-20 08:43:39 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -117,6 +117,7 @@ struct ImplStatusItem
ULONG mnHelpId;
void* mpUserData;
BOOL mbVisible;
+ XubString maAccessibleName;
};
DECLARE_LIST( ImplStatusItemList, ImplStatusItem* );
@@ -489,6 +490,9 @@ void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL
DecorationView aDecoView( this );
aDecoView.DrawFrame( aRect, nStyle );
}
+
+ if ( !ImplIsRecordLayout() )
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_DRAWITEM, (void*) pItem->mnId );
}
// -----------------------------------------------------------------------
@@ -904,6 +908,8 @@ void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth,
mbFormat = TRUE;
if ( ImplIsItemUpdate() )
Invalidate();
+
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_ITEMADDED, (void*) nItemId );
}
// -----------------------------------------------------------------------
@@ -919,6 +925,8 @@ void StatusBar::RemoveItem( USHORT nItemId )
mbFormat = TRUE;
if ( ImplIsItemUpdate() )
Invalidate();
+
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_ITEMREMOVED, (void*) nItemId );
}
}
@@ -938,6 +946,8 @@ void StatusBar::ShowItem( USHORT nItemId )
mbFormat = TRUE;
if ( ImplIsItemUpdate() )
Invalidate();
+
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_SHOWITEM, (void*) nItemId );
}
}
}
@@ -958,6 +968,8 @@ void StatusBar::HideItem( USHORT nItemId )
mbFormat = TRUE;
if ( ImplIsItemUpdate() )
Invalidate();
+
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_HIDEITEM, (void*) nItemId );
}
}
}
@@ -983,6 +995,8 @@ void StatusBar::ShowItems()
mbVisibleItems = TRUE;
if ( !mbProgressMode )
Invalidate();
+
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_SHOWALLITEMS );
}
}
@@ -995,6 +1009,8 @@ void StatusBar::HideItems()
mbVisibleItems = FALSE;
if ( !mbProgressMode )
Invalidate();
+
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_HIDEALLITEMS );
}
}
@@ -1046,6 +1062,8 @@ void StatusBar::Clear()
mbFormat = TRUE;
if ( ImplIsItemUpdate() )
Invalidate();
+
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_ALLITEMSREMOVED );
}
// -----------------------------------------------------------------------
@@ -1469,3 +1487,36 @@ Size StatusBar::CalcWindowSizePixel() const
return Size( nCalcWidth, nCalcHeight );
}
+
+
+// -----------------------------------------------------------------------
+
+void StatusBar::SetAccessibleName( USHORT nItemId, const XubString& rName )
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos != STATUSBAR_ITEM_NOTFOUND )
+ {
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+
+ if ( pItem->maAccessibleName != rName )
+ {
+ pItem->maAccessibleName = rName;
+ ImplCallEventListeners( VCLEVENT_STATUSBAR_NAMECHANGED, (void*) pItem->mnId );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+const XubString& StatusBar::GetAccessibleName( USHORT nItemId ) const
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos != STATUSBAR_ITEM_NOTFOUND )
+ return mpItemList->GetObject( nPos )->maAccessibleName;
+ else
+ return ImplGetSVEmptyStr();
+}
+
+// -----------------------------------------------------------------------
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 453192079c07..5482918e0f7d 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: toolbox.cxx,v $
*
- * $Revision: 1.57 $
+ * $Revision: 1.58 $
*
- * last change: $Author: ssa $ $Date: 2002-12-06 12:57:57 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -619,7 +619,6 @@ static void ImplCalcFloatSizes( ToolBox* pThis )
// min. Groesse berechnen
long nCalcSize = pThis->mnItemWidth;
- ImplToolItem* pItem;
std::vector< ImplToolItem >::const_iterator it;
it = pThis->mpData->m_aItems.begin();
@@ -1657,7 +1656,7 @@ ToolBox::~ToolBox()
// FloatSizeAry gegebenenfalls loeschen
if ( mpFloatSizeAry )
- delete mpFloatSizeAry;
+ delete[] mpFloatSizeAry;
// Wenn keine ToolBox-Referenzen mehr auf die Listen bestehen, dann
// Listen mit wegloeschen
@@ -2076,7 +2075,7 @@ void ToolBox::ImplFormat( BOOL bResize )
// FloatSizeAry gegebenenfalls loeschen
if ( mpFloatSizeAry )
{
- delete mpFloatSizeAry;
+ delete[] mpFloatSizeAry;
mpFloatSizeAry = NULL;
}
@@ -3548,6 +3547,8 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
Window *pWin = Application::GetFocusWindow();
if( pWin && pWin->mbToolBox && pWin != this )
bDrawHotSpot = FALSE;
+ else if( !HasFocus() && HasChildPathFocus() ) // focus is in our childwindow: no highlight
+ bDrawHotSpot = FALSE;
/*
else
if( pWin && !pWin->mbToolBox )
@@ -3714,7 +3715,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
}
// only clear highlight when focus is not in toolbar
- if ( bClearHigh && mnHighItemId && !HasFocus() )
+ if ( bClearHigh && mnHighItemId && !HasChildPathFocus() )
{
USHORT nClearPos = GetItemPos( mnHighItemId );
if ( nClearPos != TOOLBOX_ITEM_NOTFOUND )
@@ -4757,7 +4758,15 @@ BOOL ToolBox::ImplActivateItem( KeyCode aKeyCode )
mbDummy2_KeyEvt = TRUE;
Activate();
Click();
+
+ // #107776# we might be destroyed in the selecthandler
+ ImplDelData aDelData;
+ ImplAddDel( &aDelData );
Select();
+ if ( aDelData.IsDelete() )
+ return bRet;
+ ImplRemoveDel( &aDelData );
+
Deactivate();
mbDummy2_KeyEvt = FALSE;
mnMouseModifier = 0;
@@ -4831,6 +4840,11 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
USHORT nCode = aKeyCode.GetCode();
BOOL bParentIsDialog = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL );
BOOL bForwardKey = FALSE;
+
+ // #107776# we might be destroyed in the keyhandler
+ ImplDelData aDelData;
+ ImplAddDel( &aDelData );
+
switch ( nCode )
{
case KEY_UP:
@@ -4981,13 +4995,26 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
{
// do nothing to avoid key presses going into the document
// while the toolbox has the focus
- // just forward function and special keys
+ // just forward function and special keys and combinations with Alt-key
USHORT aKeyGroup = aKeyCode.GetGroup();
- if( aKeyGroup == KEYGROUP_FKEYS || aKeyGroup == KEYGROUP_MISC )
+ if( aKeyGroup == KEYGROUP_FKEYS || aKeyGroup == KEYGROUP_MISC || aKeyCode.IsMod2() )
bForwardKey = TRUE;
}
}
+ if ( aDelData.IsDelete() )
+ return;
+ ImplRemoveDel( &aDelData );
+
+ // #107251# move focus away if this toolbox was disabled during keyinput
+ if( HasFocus() && mbInputDisabled && (ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL)
+ {
+ USHORT n = 0;
+ Window *pFocusControl = ImplGetParent()->ImplGetDlgWindow( n, DLGWINDOW_FIRST );
+ if ( pFocusControl && pFocusControl != this )
+ pFocusControl->ImplControlFocus( GETFOCUS_INIT );
+ }
+
mnKeyModifier = 0;
if( bForwardKey )
@@ -5260,7 +5287,11 @@ void ToolBox::ImplShowFocus()
{
ImplToolItem* pItem = ImplGetItem( mnHighItemId );
if( pItem->mpWindow )
- DrawSelectionBackground( pItem->maRect, 2, FALSE, TRUE, pItem->mpWindow ? TRUE : FALSE );
+ {
+ Window *pWin = pItem->mpWindow->mpBorderWindow ? pItem->mpWindow->mpBorderWindow : pItem->mpWindow;
+ pWin->mbDrawSelectionBackground = TRUE;
+ pWin->Invalidate( 0 );
+ }
}
}
@@ -5273,14 +5304,9 @@ void ToolBox::ImplHideFocus()
ImplToolItem* pItem = ImplGetItem( mnHighItemId );
if( pItem->mpWindow )
{
- Rectangle aRect( pItem->maRect );
- // increase rect a little to get rid of selection border
- // see DrawSelectionBackground(...)
- aRect.nLeft -= 1;
- aRect.nTop -= 1;
- aRect.nRight += 1;
- aRect.nBottom += 1;
- Invalidate( aRect, 0);
+ Window *pWin = pItem->mpWindow->mpBorderWindow ? pItem->mpWindow->mpBorderWindow : pItem->mpWindow;
+ pWin->mbDrawSelectionBackground = FALSE;
+ pWin->Invalidate( 0 );
}
}
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index c2111b545db2..e97b3b94d127 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: window.cxx,v $
*
- * $Revision: 1.166 $
+ * $Revision: 1.167 $
*
- * last change: $Author: ssa $ $Date: 2002-12-13 09:55:57 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -208,6 +208,7 @@
#include <unowrap.hxx>
#include <dndlcon.hxx>
#include <dndevdis.hxx>
+#include <impbmpconv.hxx>
#ifndef _UNOTOOLS_CONFIGNODE_HXX_
#include <unotools/confignode.hxx>
@@ -399,44 +400,51 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
// to avoid UI scaling due to large fonts
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
- Font aFont = aStyleSettings.GetAppFont();
- aFont.SetHeight( 8 );
+ // #107886# allow scaling of the UI if the menu font is
+ // slightly larger/smaller than the 8pt default
+ int defFontheight = 8;
+ Font aFont = aStyleSettings.GetMenuFont();
+ if( abs(aFont.GetHeight() - defFontheight) == 1 )
+ defFontheight = aFont.GetHeight();
+
+ aFont = aStyleSettings.GetAppFont();
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetAppFont( aFont );
//aFont = aStyleSettings.GetHelpFont();
- //aFont.SetHeight( 8 );
+ //aFont.SetHeight( defFontheight );
//aStyleSettings.SetHelpFont( aFont );
aFont = aStyleSettings.GetTitleFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetTitleFont( aFont );
aFont = aStyleSettings.GetFloatTitleFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetFloatTitleFont( aFont );
//aFont = aStyleSettings.GetMenuFont();
- //aFont.SetHeight( 8 );
+ //aFont.SetHeight( defFontheight );
//aStyleSettings.SetMenuFont( aFont );
aFont = aStyleSettings.GetToolFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetToolFont( aFont );
aFont = aStyleSettings.GetLabelFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetLabelFont( aFont );
aFont = aStyleSettings.GetInfoFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetInfoFont( aFont );
aFont = aStyleSettings.GetRadioCheckFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetRadioCheckFont( aFont );
aFont = aStyleSettings.GetPushButtonFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetPushButtonFont( aFont );
aFont = aStyleSettings.GetFieldFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetFieldFont( aFont );
aFont = aStyleSettings.GetIconFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetIconFont( aFont );
aFont = aStyleSettings.GetGroupFont();
- aFont.SetHeight( 8 );
+ aFont.SetHeight( defFontheight );
aStyleSettings.SetGroupFont( aFont );
rSettings.SetStyleSettings( aStyleSettings );
@@ -458,8 +466,8 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
}
if( bAutoHCMode )
{
- if( rSettings.GetStyleSettings().GetFaceColor().GetLuminance() < 8 ||
- rSettings.GetStyleSettings().GetWindowColor().GetLuminance() < 8 )
+ if( rSettings.GetStyleSettings().GetFaceColor().IsDark()
+ || rSettings.GetStyleSettings().GetWindowColor().IsDark() )
{
StyleSettings aStyleSettings = rSettings.GetStyleSettings();
aStyleSettings.SetHighContrastMode( TRUE );
@@ -652,7 +660,7 @@ void Window::ImplInitData( WindowType nType )
mbCreatedWithToolkit = FALSE;
mbSuppressAccessibilityEvents = FALSE; // TRUE: do not send any accessibility events
mbEnableRTL = TRUE; // TRUE: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active
-
+ mbDrawSelectionBackground = FALSE; // TRUE: draws transparent window background to indicate (toolbox) selection
#ifdef REMOTE_APPSERVER
mpRmEvents = NULL;
@@ -742,6 +750,11 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, const ::com::sun::star::
else if( mbFloatWin )
nFrameStyle |= SAL_FRAME_STYLE_TOOLWINDOW;
+ if( nStyle & WB_INTROWIN )
+ nFrameStyle |= SAL_FRAME_STYLE_INTRO;
+
+ if( nStyle & WB_NOSHADOW )
+ nFrameStyle |= SAL_FRAME_STYLE_NOSHADOW;
SalFrame* pParentFrame = NULL;
if ( pParent )
@@ -805,6 +818,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, const ::com::sun::star::
mpFrameData->mnFirstMouseY = -1;
mpFrameData->mnLastMouseWinX = -1;
mpFrameData->mnLastMouseWinY = -1;
+ mpFrameData->mnModalMode = 0;
mpFrameData->mnMouseDownTime = 0;
mpFrameData->mnClickCount = 0;
mpFrameData->mnFirstMouseCode = 0;
@@ -899,25 +913,6 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, const ::com::sun::star::
// the correct size before we display the window
if ( nStyle & (WB_MOVEABLE | WB_SIZEABLE | WB_APP) )
mpFrame->GetClientSize( mnOutWidth, mnOutHeight );
-
-#ifndef REMOTE_APPSERVER
- if( Application::GetSettings().GetMiscSettings().GetEnableATToolSupport() )
- {
- // instanciate access bridge service
- if( !pSVData->mxAccessBridge.is() )
- {
- if( !ImplInitAccessBridge() )
- {
- AllSettings aSettings = Application::GetSettings();
- MiscSettings aMisc = aSettings.GetMiscSettings();
- aMisc.SetEnableATToolSupport( FALSE );
- aSettings.SetMiscSettings( aMisc );
- Application::SetSettings( aSettings );
- }
- }
- }
-#endif
-
}
else
{
@@ -2332,6 +2327,7 @@ void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags )
nPaintFlags = mnPaintFlags & ~(IMPL_PAINT_PAINT);
Region* pChildRegion = NULL;
+ Rectangle aSelectionRect;
if ( mnPaintFlags & IMPL_PAINT_PAINT )
{
Region* pWinChildClipRegion = ImplGetWinChildClipRegion();
@@ -2392,6 +2388,10 @@ void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags )
Erase();
}
+ // #98943# trigger drawing of toolbox selection after all childern are painted
+ if( mbDrawSelectionBackground )
+ aSelectionRect = aPaintRect;
+
Paint( aPaintRect );
if ( mpWinData )
@@ -2427,6 +2427,10 @@ void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags )
*/
InvertTracking( *(mpWinData->mpTrackRect), mpWinData->mnTrackFlags );
+ // #98943# draw toolbox selection
+ if( !aSelectionRect.IsEmpty() )
+ DrawSelectionBackground( aSelectionRect, 2, FALSE, TRUE, FALSE );
+
if ( pChildRegion )
delete pChildRegion;
}
@@ -3221,7 +3225,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
if( mpParent && !mpParent->mbFrame && mpParent->ImplHasMirroredGraphics() && !mpParent->IsRTLEnabled() )
{
// --- RTL --- (re-mirror at parent window)
- nX = mpParent->mnOutWidth - mnOutWidth - 1 - nX;
+ nX = mpParent->mnOutWidth - mnOutWidth - nX;
}
}
}
@@ -3557,6 +3561,8 @@ void Window::ImplToTop( USHORT nFlags )
nSysFlags = SAL_FRAME_TOTOP_RESTOREWHENMIN;
if ( nFlags & TOTOP_FOREGROUNDTASK )
nSysFlags = SAL_FRAME_TOTOP_FOREGROUNDTASK;
+ if ( nFlags & TOTOP_GRABFOCUSONLY )
+ nSysFlags = SAL_FRAME_TOTOP_GRABFOCUS_ONLY;
mpFrame->ToTop( nSysFlags );
}
#else
@@ -3878,7 +3884,6 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow,
}
// -----------------------------------------------------------------------
-
void Window::ImplGrabFocus( USHORT nFlags )
{
// Es soll immer das Client-Fenster den Focus bekommen. Falls
@@ -3886,6 +3891,7 @@ void Window::ImplGrabFocus( USHORT nFlags )
// muessten wir bei allen GrabFocus()-Aufrufen in VCL dafuer
// sorgen, das es an der Stelle gemacht wird. Dies wuerde
// beispielsweise bei ToTop() der Fall sein.
+
if ( mpClientWindow )
{
// Wegen nicht ganz durchdachtem Konzept muessen wir hier
@@ -3987,7 +3993,7 @@ void Window::ImplGrabFocus( USHORT nFlags )
// nicht auf ein anderes Fenster setzen darf
//DBG_WARNING( "Window::GrabFocus() - Frame doesn't have the focus" );
#ifndef REMOTE_APPSERVER
- mpFrame->ToTop( SAL_FRAME_TOTOP_GRABFOCUS );
+ mpFrame->ToTop( SAL_FRAME_TOTOP_GRABFOCUS | SAL_FRAME_TOTOP_GRABFOCUS_ONLY );
#else
mpFrame->ToTop(0);
#endif
@@ -4214,7 +4220,7 @@ void Window::ImplNewInputContext()
else
aSize.Height() = (12*pFocusWin->mnDPIY)/72;
}
- pFontEntry = pFocusWin->mpFontCache->Get( pFocusWin->mpFontList, rFont, aSize );
+ pFontEntry = pFocusWin->mpFontCache->Get( pFocusWin->mpFontList, rFont, aSize, pFocusWin->mpOutDevData ? pFocusWin->mpOutDevData->mpFirstFontSubstEntry : NULL );
if ( pFontEntry )
aNewContext.mpFont = &pFontEntry->maFontSelData;
}
@@ -4919,6 +4925,18 @@ void Window::ImplNotifyKeyMouseEventListeners( NotifyEvent& rNEvt )
if ( mbCompoundControl || ( rNEvt.GetWindow() == this ) )
ImplCallEventListeners( VCLEVENT_WINDOW_KEYUP, (void*)rNEvt.GetKeyEvent() );
}
+
+ // #106721# check if we're part of a compound control and notify
+ Window *pParent = ImplGetParent();
+ while( pParent )
+ {
+ if( pParent->IsCompoundControl() )
+ {
+ pParent->ImplNotifyKeyMouseEventListeners( rNEvt );
+ break;
+ }
+ pParent = pParent->ImplGetParent();
+ }
}
// -----------------------------------------------------------------------
@@ -5074,18 +5092,36 @@ void Window::CallEventListeners( ULONG nEvent, void* pData )
{
VclWindowEvent aEvent( this, nEvent, pData );
+ ImplDelData aDelData;
+ ImplAddDel( &aDelData );
+
ImplSVData* pSVData = ImplGetSVData();
pSVData->mpApp->ImplCallEventListeners( &aEvent );
+ if ( aDelData.IsDelete() )
+ return;
+
if ( !maEventListeners.empty() )
maEventListeners.Call( &aEvent );
+ if ( aDelData.IsDelete() )
+ return;
+
+ ImplRemoveDel( &aDelData );
+
Window* pWindow = this;
while ( pWindow )
{
+ pWindow->ImplAddDel( &aDelData );
+
if ( !pWindow->maChildEventListeners.empty() )
pWindow->maChildEventListeners.Call( &aEvent );
+ if ( aDelData.IsDelete() )
+ return;
+
+ pWindow->ImplRemoveDel( &aDelData );
+
pWindow = pWindow->GetParent();
}
}
@@ -6072,6 +6108,42 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
mpBorderWindow->Show( TRUE, nFlags );
else if ( mbFrame )
{
+ ImplSVData* pSVData = ImplGetSVData();
+ // #106431#, hide SplashScreen
+ if( pSVData->mpIntroWindow && !ImplIsWindowOrChild( pSVData->mpIntroWindow ) )
+ pSVData->mpIntroWindow->Hide();
+
+#ifndef REMOTE_APPSERVER
+ // HACK: this code belongs IMHO at the end of InitVCL, but because there is no
+ // configuration service available at this time, we need to delay it until the
+ // first (accessible) window is shown ..
+ if( ImplIsAccessibleNativeFrame() )
+ {
+ ImplSVData* pSVData = ImplGetSVData();
+
+ if( Application::GetSettings().GetMiscSettings().GetEnableATToolSupport() )
+ {
+ if( !pSVData->mxAccessBridge.is() )
+ {
+ // instanciate access bridge service
+ if( !ImplInitAccessBridge(true) )
+ {
+ AllSettings aSettings = Application::GetSettings();
+ MiscSettings aMisc = aSettings.GetMiscSettings();
+ aMisc.SetEnableATToolSupport( FALSE );
+ aSettings.SetMiscSettings( aMisc );
+ Application::SetSettings( aSettings );
+ }
+ // if the user chose to quit the app, do not show this frame ..
+ else if( pSVData->maAppData.mbAppQuit == TRUE )
+ {
+ return;
+ }
+ }
+ }
+ }
+#endif
+
//DBG_ASSERT( !mbSuppressAccessibilityEvents, "Window::Show() - Frame reactivated");
mbSuppressAccessibilityEvents = FALSE;
@@ -6159,19 +6231,19 @@ BOOL Window::ImplRegisterAccessibleNativeFrame()
ImplSVData* pSVData = ImplGetSVData();
// register proxy accessible for the new native frame window
- if(pSVData->mxAccessBridge.is())
+ if( pSVData->mxAccessBridge.is() )
{
const SystemEnvData * pEnvData = GetSystemData();
- if(pEnvData)
+ if( pEnvData )
{
Reference< XTopWindow > xTopWindow( ImplGetWindow()->GetComponentInterface(), UNO_QUERY );
- if(xTopWindow.is())
+ if( xTopWindow.is() )
{
#ifdef WNT
- pSVData->mxAccessBridge->registerAccessibleNativeFrame( makeAny((sal_uInt32) pEnvData->hWnd), GetAccessible(), xTopWindow);
+ pSVData->mxAccessBridge->registerAccessibleNativeFrame( makeAny((sal_Int32) pEnvData->hWnd), GetAccessible(), xTopWindow);
#else
- pSVData->mxAccessBridge->registerAccessibleNativeFrame( makeAny((sal_uInt32) pEnvData->aWindow), GetAccessible(), xTopWindow);
+ pSVData->mxAccessBridge->registerAccessibleNativeFrame( makeAny((sal_Int32) pEnvData->aWindow), GetAccessible(), xTopWindow);
#endif
bNativeFrameRegistered = TRUE;
mbSuppressAccessibilityEvents = FALSE; // allow accessibility events
@@ -6195,9 +6267,9 @@ void Window::ImplRevokeAccessibleNativeFrame()
if( pSVData->mxAccessBridge.is() )
{
#ifdef WNT
- pSVData->mxAccessBridge->revokeAccessibleNativeFrame(makeAny((sal_uInt32) pEnvData->hWnd));
+ pSVData->mxAccessBridge->revokeAccessibleNativeFrame(makeAny((sal_Int32) pEnvData->hWnd));
#else
- pSVData->mxAccessBridge->revokeAccessibleNativeFrame(makeAny((sal_uInt32) pEnvData->aWindow));
+ pSVData->mxAccessBridge->revokeAccessibleNativeFrame(makeAny((sal_Int32) pEnvData->aWindow));
#endif
}
}
@@ -6812,15 +6884,31 @@ Rectangle Window::ImplOutputToUnmirroredAbsoluteScreenPixel( const Rectangle &rR
Rectangle Window::GetWindowExtentsRelative( Window *pRelativeWindow )
{
+ // with decoration
+ return ImplGetWindowExtentsRelative( pRelativeWindow, FALSE );
+}
+
+Rectangle Window::GetClientWindowExtentsRelative( Window *pRelativeWindow )
+{
+ // without decoration
+ return ImplGetWindowExtentsRelative( pRelativeWindow, TRUE );
+}
+
+// -----------------------------------------------------------------------
+
+Rectangle Window::ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bClientOnly )
+{
SalFrameGeometry g = mpFrame->GetGeometry();
// make sure we use the extent of our border window,
// otherwise we miss a few pixels
- Window *pWin = mpBorderWindow ? mpBorderWindow : this;
+ Window *pWin = (!bClientOnly && mpBorderWindow) ? mpBorderWindow : this;
+
Point aPos( pWin->OutputToScreenPixel( Point(0,0) ) );
aPos.X() += g.nX;
aPos.Y() += g.nY;
Size aSize ( pWin->GetSizePixel() );
- if( mbFrame || (mpBorderWindow && mpBorderWindow->mbFrame) )
+ // #104088# do not add decoration to the workwindow to be compatible to java accessibility api
+ if( !bClientOnly && (mbFrame || (mpBorderWindow && mpBorderWindow->mbFrame && GetType() != WINDOW_WORKWINDOW)) )
{
aPos.X() -= g.nLeftDecoration;
aPos.Y() -= g.nTopDecoration;
@@ -6828,7 +6916,11 @@ Rectangle Window::GetWindowExtentsRelative( Window *pRelativeWindow )
aSize.Height() += g.nTopDecoration + g.nBottomDecoration;
}
if( pRelativeWindow )
- aPos = pRelativeWindow->AbsoluteScreenToOutputPixel( aPos );
+ {
+ // #106399# express coordinates relative to borderwindow
+ Window *pRelWin = (!bClientOnly && pRelativeWindow->mpBorderWindow) ? pRelativeWindow->mpBorderWindow : pRelativeWindow;
+ aPos = pRelWin->AbsoluteScreenToOutputPixel( aPos );
+ }
return Rectangle( aPos, aSize );
}
@@ -7346,6 +7438,18 @@ void Window::SetText( const XubString& rStr )
mpFrame->SetTitle( rStr );
ImplCallEventListeners( VCLEVENT_WINDOW_FRAMETITLECHANGED, &oldTitle );
+
+ // #107247# needed for accessibility
+ // The VCLEVENT_WINDOW_FRAMETITLECHANGED is (mis)used to notify accessible name changes.
+ // Therefore a window, which is labeled by this window, must also notify an accessible
+ // name change.
+ if ( IsReallyVisible() )
+ {
+ Window* pWindow = GetLabelFor();
+ if ( pWindow && pWindow != this )
+ pWindow->ImplCallEventListeners( VCLEVENT_WINDOW_FRAMETITLECHANGED, &oldTitle );
+ }
+
StateChanged( STATE_CHANGE_TEXT );
}
@@ -7623,13 +7727,18 @@ void Window::ImplCallActivateListeners( Window *pOld )
if ( !pOld || !ImplIsChild( pOld ) )
{
ImplCallEventListeners( VCLEVENT_WINDOW_ACTIVATE, pOld );
- if( !GetParent() || !GetParent()->IsCompoundControl() )
- {
+ // #106298# revoke the change for 105369, because this change
+ // disabled the activate event for the parent,
+ // if the parent is a compound control
+ //if( !GetParent() || !GetParent()->IsCompoundControl() )
+ //{
// #100759#, avoid walking the wrong frame's hierarchy
// eg, undocked docking windows (ImplDockFloatWin)
- if ( ImplGetParent() && mpFrameWindow == ImplGetParent()->mpFrameWindow )
+ // #104714#, revert the changes for 100759 because it has a side effect when pOld is a dialog
+ // additionally the gallery is not dockable anymore, so 100759 canot occur
+ if ( ImplGetParent() ) /* && mpFrameWindow == ImplGetParent()->mpFrameWindow ) */
ImplGetParent()->ImplCallActivateListeners( pOld );
- }
+ //}
}
}
@@ -7728,12 +7837,16 @@ Reference< XDragSource > Window::GetDragSource()
aDragSourceAL[ 1 ] = makeAny( (sal_uInt32) pEnvData->hWnd );
aDropTargetAL[ 0 ] = makeAny( (sal_uInt32) pEnvData->hWnd );
#elif defined UNX
+ aDropTargetAL.realloc( 3 );
+ aDragSourceAL.realloc( 3 );
aDragSourceSN = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.X11DragSource" );
aDropTargetSN = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.X11DropTarget" );
aDragSourceAL[ 0 ] = makeAny( Application::GetDisplayConnection() );
+ aDragSourceAL[ 2 ] = makeAny( vcl::createBmpConverter() );
aDropTargetAL[ 0 ] = makeAny( Application::GetDisplayConnection() );
aDropTargetAL[ 1 ] = makeAny( pEnvData->aShellWindow );
+ aDropTargetAL[ 2 ] = makeAny( vcl::createBmpConverter() );
#endif
if( aDragSourceSN.getLength() )
mpFrameData->mxDragSource = Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY );
@@ -7814,9 +7927,10 @@ Reference< XClipboard > Window::GetClipboard()
if( xInit.is() )
{
- Sequence< Any > aArgumentList( 2 );
+ Sequence< Any > aArgumentList( 3 );
aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() );
aArgumentList[ 1 ] = makeAny( OUString::createFromAscii( "CLIPBOARD" ) );
+ aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
xInit->initialize( aArgumentList );
}
@@ -7862,9 +7976,10 @@ Reference< XClipboard > Window::GetSelection()
if( xFactory.is() )
{
# ifdef UNX
- Sequence< Any > aArgumentList( 2 );
+ Sequence< Any > aArgumentList( 3 );
aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() );
aArgumentList[ 1 ] = makeAny( OUString::createFromAscii( "PRIMARY" ) );
+ aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
mpFrameData->mxSelection = Reference< XClipboard >( xFactory->createInstanceWithArguments(
OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboard" ), aArgumentList ), UNO_QUERY );
@@ -8050,15 +8165,21 @@ USHORT Window::GetAccessibleChildWindowCount()
pChild = pChild->mpNext;
}
- // Search also for SystemWindows.
- Window* pOverlap = GetWindow( WINDOW_OVERLAP );
- pOverlap = pOverlap->GetWindow( WINDOW_FIRSTOVERLAP );
- while ( pOverlap )
+ // #107176# ignore overlapwindows
+ // this only affects non-system floating windows
+ // which are either not accessible (like the HelpAgent) or should be changed to system windows anyway
+ /*
+ if( ImplIsOverlapWindow() )
{
- if( pOverlap->IsVisible() )
- nChildren++;
- pOverlap = pOverlap->GetWindow( WINDOW_NEXT );
+ Window* pOverlap = GetWindow( WINDOW_FIRSTOVERLAP );
+ while ( pOverlap )
+ {
+ if( pOverlap->IsVisible() )
+ nChildren++;
+ pOverlap = pOverlap->GetWindow( WINDOW_NEXT );
+ }
}
+ */
// report the menubarwindow as a child of THE workwindow
if( GetType() == WINDOW_BORDERWINDOW )
@@ -8131,19 +8252,24 @@ Window* Window::GetAccessibleChildWindow( USHORT n )
}
if ( !pChild )
{
- Window* pOverlap = GetWindow( WINDOW_OVERLAP );
- pOverlap = pOverlap->GetWindow( WINDOW_FIRSTOVERLAP );
- while ( !pChild && pOverlap )
+ // #107176# ignore overlapwindows
+ /*
+ if( ImplIsOverlapWindow() )
{
- if ( !nChildren && pOverlap->IsVisible() )
+ Window* pOverlap = GetWindow( WINDOW_FIRSTOVERLAP );
+ while ( !pChild && pOverlap )
{
- pChild = pOverlap;
- break;
+ if ( !nChildren && pOverlap->IsVisible() )
+ {
+ pChild = pOverlap;
+ break;
+ }
+ pOverlap = pOverlap->GetWindow( WINDOW_NEXT );
+ if( pOverlap && pOverlap->IsVisible() )
+ nChildren--;
}
- pOverlap = pOverlap->GetWindow( WINDOW_NEXT );
- if( pOverlap && pOverlap->IsVisible() )
- nChildren--;
}
+ */
}
if ( pChild && ( pChild->GetType() == WINDOW_BORDERWINDOW ) && ( pChild->GetChildCount() == 1 ) )
@@ -8401,6 +8527,16 @@ BOOL Window::IsAccessibilityEventsSuppressed( BOOL bTraverseParentPath )
}
}
+void Window::RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& rRect )
+{
+ if( ! mpOutDevData )
+ ImplInitOutDevData();
+ mpOutDevData->mpRecordLayout = pLayout;
+ mpOutDevData->maRecordRect = rRect;
+ Paint( rRect );
+ mpOutDevData->mpRecordLayout = NULL;
+}
+
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
@@ -8441,6 +8577,9 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight,
extern void ImplRGBtoHSB( const Color& rColor, USHORT& nHue, USHORT& nSat, USHORT& nBri );
extern Color ImplHSBtoRGB( USHORT nHue, USHORT nSat, USHORT nBri );
+ if( rRect.IsEmpty() )
+ return;
+
// colors used for item highlighting
Color aSelectionBorderCol( GetSettings().GetStyleSettings().GetHighlightColor() );
Color aSelectionFillCol( aSelectionBorderCol );
@@ -8587,3 +8726,25 @@ BOOL Window::IsTopWindow() const
return xTopWindow.is() ? TRUE : FALSE;
}
+void Window::ImplMirrorFramePos( Point &pt ) const
+{
+ pt.X() = mpFrame->maGeometry.nWidth-1-pt.X();
+}
+
+// frame based modal counter (dialogs are not modal to the whole application anymore)
+BOOL Window::IsInModalMode() const
+{
+ return (mpFrameWindow->mpFrameData->mnModalMode != 0);
+}
+void Window::ImplIncModalCount()
+{
+ mpFrameWindow->mpFrameData->mnModalMode++;
+}
+void Window::ImplDecModalCount()
+{
+ mpFrameWindow->mpFrameData->mnModalMode--;
+}
+void Window::ImplNotifyIconifiedState( BOOL bIconified )
+{
+ mpFrameWindow->ImplCallEventListeners( bIconified ? VCLEVENT_WINDOW_ICONIFIED : VCLEVENT_WINDOW_RESTORED );
+}
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 99baa3e9ae03..7619c2fa479b 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: window2.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: ssa $ $Date: 2002-12-03 14:36:25 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -110,11 +110,8 @@
#ifndef _SV_ACCESS_HXX
#include <access.hxx>
#endif
-#ifndef _SV_POLY_H
-#include <poly.h>
-#endif
-#ifndef _SV_POLY_HXX
-#include <poly.hxx>
+#ifndef _POLY_HXX
+#include <tools/poly.hxx>
#endif
#ifndef _SV_VIRDEV_HXX
#include <virdev.hxx>
@@ -550,7 +547,7 @@ void Window::Invert( const Polygon& rPoly, USHORT nFlags )
nSalFlags |= SAL_INVERT_HIGHLIGHT;
if ( nFlags & INVERT_50 )
nSalFlags |= SAL_INVERT_50;
- const SalPoint* pPtAry = (const SalPoint*)aPoly.ImplGetConstPointAry();
+ const SalPoint* pPtAry = (const SalPoint*)aPoly.GetConstPointAry();
mpGraphics->Invert( nPoints, pPtAry, nSalFlags, this );
#else
ImplServerGraphics* pGraphics = ImplGetServerGraphics();
@@ -747,7 +744,7 @@ void Window::InvertTracking( const Polygon& rPoly, USHORT nFlags )
}
}
- const SalPoint* pPtAry = (const SalPoint*)aPoly.ImplGetConstPointAry();
+ const SalPoint* pPtAry = (const SalPoint*)aPoly.GetConstPointAry();
pGraphics->Invert( nPoints, pPtAry, SAL_INVERT_TRACKFRAME, this );
#else
ImplServerGraphics* pGraphics;
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 5ae8315fced6..c3754781e170 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: winproc.cxx,v $
*
- * $Revision: 1.76 $
+ * $Revision: 1.77 $
*
- * last change: $Author: ssa $ $Date: 2002-12-12 16:46:10 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -324,7 +324,9 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
static void ImplHandleMouseHelpRequest( Window* pChild, const Point& rMousePos )
{
ImplSVData* pSVData = ImplGetSVData();
- if ( pChild != pSVData->maHelpData.mpHelpWin )
+ if ( !pSVData->maHelpData.mpHelpWin ||
+ !( pSVData->maHelpData.mpHelpWin->IsWindowOrChild( pChild ) ||
+ pChild->IsWindowOrChild( pSVData->maHelpData.mpHelpWin ) ) )
{
USHORT nHelpMode = 0;
if ( pSVData->maHelpData.mbQuickHelp )
@@ -511,7 +513,8 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave,
#endif
// no mouse messages to disabled windows
- if ( !pChild->IsEnabled() || !pChild->IsInputEnabled() )
+ // #106845# if the window was disabed during capturing we have to pass the mouse events to release capturing
+ if ( pSVData->maWinData.mpCaptureWin != pChild && (!pChild->IsEnabled() || !pChild->IsInputEnabled()) )
{
ImplHandleMouseFloatMode( pChild, aMousePos, nCode, nSVEvent, bMouseLeave );
if ( nSVEvent == EVENT_MOUSEMOVE )
@@ -1626,7 +1629,10 @@ void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight )
pWindow->mpFrameData->mbNeedSysWindow = (nNewWidth < IMPL_MIN_NEEDSYSWIN) ||
(nNewHeight < IMPL_MIN_NEEDSYSWIN);
- pWindow->mpFrameData->mbMinimized = (nNewWidth <= 0) || (nNewHeight <= 0);
+ BOOL bMinimized = (nNewWidth <= 0) || (nNewHeight <= 0);
+ if( bMinimized != pWindow->mpFrameData->mbMinimized )
+ pWindow->mpFrameWindow->ImplNotifyIconifiedState( bMinimized );
+ pWindow->mpFrameData->mbMinimized = bMinimized;
}
// -----------------------------------------------------------------------
@@ -1709,7 +1715,7 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG )
ImplSVData* pSVData = ImplGetSVData();
Window* pTopLevelWindow = mpFrameData->mpFocusWin->ImplGetFirstOverlapWindow();
if ( !pTopLevelWindow->IsInputEnabled() && pSVData->maWinData.mpLastExecuteDlg )
- pSVData->maWinData.mpLastExecuteDlg->ToTop( TOTOP_RESTOREWHENMIN );
+ pSVData->maWinData.mpLastExecuteDlg->ToTop( TOTOP_RESTOREWHENMIN | TOTOP_GRABFOCUSONLY);
else
pTopLevelWindow->GrabFocus();
}
diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx
index ff5ce667ddfa..fe39754cfe0d 100644
--- a/vcl/source/window/wrkwin.cxx
+++ b/vcl/source/window/wrkwin.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: wrkwin.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: mba $ $Date: 2002-10-11 18:08:29 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:58:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -271,31 +271,6 @@ WorkWindow::~WorkWindow()
// -----------------------------------------------------------------------
-void WorkWindow::SetIcon( USHORT nIcon )
-{
- // Should be removed in the next top level update - now in SystemWindow
- mnIcon = nIcon;
- SystemWindow::SetIcon( nIcon );
-}
-
-// -----------------------------------------------------------------------
-
-void WorkWindow::SetWindowState( const ByteString& rStr )
-{
- // Should be removed in the next top level update - now in SystemWindow
- SystemWindow::SetWindowState( rStr );
-}
-
-// -----------------------------------------------------------------------
-
-ByteString WorkWindow::GetWindowState() const
-{
- // Should be removed in the next top level update - now in SystemWindow
- return SystemWindow::GetWindowState();
-}
-
-// -----------------------------------------------------------------------
-
void WorkWindow::ShowFullScreenMode( BOOL bFullScreenMode )
{
if ( !mbFullScreenMode == !bFullScreenMode )