summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-11-30 15:12:49 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-11-30 15:12:49 +0000
commit056be7cf7d354fbae161394905bc4b454d05d41a (patch)
tree4a8894e3d3846d8987e3f6d16e63ee887731613c /vcl
parentd1ec4858282a3799ee081c7b138beea81d6d13fe (diff)
parente8e07b16888025a7c87693a5372db9d116096af5 (diff)
slideshow1: merge with DEV300 m49
Diffstat (limited to 'vcl')
-rw-r--r--vcl/aqua/inc/saldata.hxx3
-rw-r--r--vcl/aqua/inc/salgdi.h1
-rw-r--r--vcl/aqua/source/app/saldata.cxx5
-rw-r--r--vcl/aqua/source/app/salinst.cxx7
-rwxr-xr-xvcl/aqua/source/app/vclnsapp.mm20
-rwxr-xr-xvcl/aqua/source/gdi/salatslayout.cxx55
-rw-r--r--vcl/aqua/source/gdi/salatsuifontutils.cxx177
-rw-r--r--vcl/aqua/source/gdi/salgdi.cxx57
-rw-r--r--vcl/aqua/source/window/salframe.cxx3
-rwxr-xr-xvcl/aqua/source/window/salframeview.mm6
-rw-r--r--vcl/aqua/source/window/salmenu.cxx2
-rw-r--r--vcl/aqua/source/window/salobj.cxx7
-rw-r--r--vcl/inc/list.h3
-rw-r--r--vcl/inc/sft.hxx (renamed from vcl/inc/sft.h)29
-rw-r--r--vcl/inc/vcl/ImageListProvider.hxx (renamed from vcl/unx/inc/postx.h)63
-rw-r--r--vcl/inc/vcl/accel.h2
-rw-r--r--vcl/inc/vcl/button.hxx2
-rw-r--r--vcl/inc/vcl/cmdevt.hxx3
-rw-r--r--vcl/inc/vcl/event.hxx2
-rw-r--r--vcl/inc/vcl/keycod.hxx6
-rw-r--r--vcl/inc/vcl/keycodes.hxx3
-rw-r--r--vcl/inc/vcl/lstbox.hxx1
-rw-r--r--vcl/inc/vcl/outdev.hxx8
-rw-r--r--vcl/inc/vcl/salgdi.hxx2
-rw-r--r--vcl/inc/vcl/svdata.hxx1
-rw-r--r--vcl/inc/vcl/sysdata.hxx50
-rw-r--r--vcl/inc/vcl/tabctrl.hxx2
-rw-r--r--vcl/inc/vcl/toolbox.h9
-rw-r--r--vcl/inc/vcl/toolbox.hxx8
-rw-r--r--vcl/os2/inc/salgdi.h1
-rw-r--r--vcl/os2/source/gdi/salgdi3.cxx25
-rw-r--r--vcl/prj/build.lst2
-rw-r--r--vcl/prj/d.lst2
-rw-r--r--vcl/source/app/svdata.cxx14
-rw-r--r--vcl/source/control/button.cxx16
-rw-r--r--vcl/source/control/edit.cxx4
-rw-r--r--vcl/source/control/ilstbox.cxx2
-rw-r--r--vcl/source/control/imgctrl.cxx33
-rw-r--r--vcl/source/control/lstbox.cxx12
-rw-r--r--vcl/source/fontsubset/crc32.c89
-rw-r--r--vcl/source/fontsubset/crc32.h46
-rw-r--r--vcl/source/fontsubset/gsub.cxx12
-rw-r--r--vcl/source/fontsubset/gsub.h18
-rw-r--r--vcl/source/fontsubset/list.c9
-rw-r--r--vcl/source/fontsubset/makefile.mk4
-rw-r--r--vcl/source/fontsubset/sft.cxx (renamed from vcl/source/fontsubset/sft.c)334
-rw-r--r--vcl/source/fontsubset/ttcr.cxx (renamed from vcl/source/fontsubset/ttcr.c)234
-rw-r--r--vcl/source/fontsubset/ttcr.hxx (renamed from vcl/source/fontsubset/ttcr.h)47
-rw-r--r--vcl/source/fontsubset/u2big5.inc5
-rw-r--r--vcl/source/fontsubset/u2johab.inc5
-rw-r--r--vcl/source/fontsubset/u2prc.inc5
-rw-r--r--vcl/source/fontsubset/u2shiftjis.inc5
-rw-r--r--vcl/source/fontsubset/u2wansung.inc5
-rw-r--r--vcl/source/fontsubset/xlat.cxx (renamed from vcl/source/fontsubset/xlat.c)13
-rw-r--r--vcl/source/fontsubset/xlat.hxx (renamed from vcl/source/fontsubset/xlat.h)24
-rw-r--r--vcl/source/gdi/font.cxx4
-rw-r--r--vcl/source/gdi/outdev3.cxx92
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx43
-rwxr-xr-xvcl/source/gdi/sallayout.cxx6
-rwxr-xr-xvcl/source/helper/smartid.cxx2
-rw-r--r--vcl/source/window/accel.cxx3
-rw-r--r--vcl/source/window/decoview.cxx13
-rw-r--r--vcl/source/window/dialog.cxx2
-rw-r--r--vcl/source/window/dlgctrl.cxx2
-rw-r--r--vcl/source/window/keycod.cxx14
-rw-r--r--vcl/source/window/keyevent.cxx5
-rw-r--r--vcl/source/window/menu.cxx200
-rw-r--r--vcl/source/window/mouseevent.cxx4
-rw-r--r--vcl/source/window/splitwin.cxx4
-rw-r--r--vcl/source/window/toolbox.cxx4
-rw-r--r--vcl/source/window/toolbox2.cxx34
-rw-r--r--vcl/source/window/window.cxx28
-rw-r--r--vcl/source/window/winproc.cxx18
-rw-r--r--vcl/unx/gtk/a11y/atktext.cxx8
-rw-r--r--vcl/unx/gtk/app/gtkinst.cxx16
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx13
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx33
-rw-r--r--vcl/unx/headless/svpgdi.cxx16
-rw-r--r--vcl/unx/headless/svpgdi.hxx1
-rw-r--r--vcl/unx/headless/svppspgraphics.cxx16
-rw-r--r--vcl/unx/headless/svppspgraphics.hxx2
-rw-r--r--vcl/unx/inc/Xproto.h4
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkdata.hxx4
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkframe.hxx4
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkgdi.hxx4
-rw-r--r--vcl/unx/inc/prex.h81
-rw-r--r--vcl/unx/inc/pspgraphics.h1
-rw-r--r--vcl/unx/inc/saldata.hxx2
-rw-r--r--vcl/unx/inc/salgdi.h1
-rw-r--r--vcl/unx/inc/svunx.h4
-rw-r--r--vcl/unx/inc/wmadaptor.hxx4
-rw-r--r--vcl/unx/inc/xfont.hxx4
-rw-r--r--vcl/unx/source/app/i18n_cb.cxx4
-rw-r--r--vcl/unx/source/app/i18n_ic.cxx4
-rw-r--r--vcl/unx/source/app/i18n_im.cxx4
-rw-r--r--vcl/unx/source/app/i18n_status.cxx4
-rw-r--r--vcl/unx/source/app/keysymnames.cxx4
-rw-r--r--vcl/unx/source/app/randrwrapper.cxx4
-rw-r--r--vcl/unx/source/app/saldata.cxx13
-rw-r--r--vcl/unx/source/app/saldisp.cxx12
-rw-r--r--vcl/unx/source/app/sm.cxx4
-rw-r--r--vcl/unx/source/app/wmadaptor.cxx4
-rw-r--r--vcl/unx/source/fontmanager/fontmanager.cxx5
-rw-r--r--vcl/unx/source/gdi/gcach_xpeer.hxx4
-rw-r--r--vcl/unx/source/gdi/pspgraphics.cxx16
-rw-r--r--vcl/unx/source/gdi/salbmp.cxx4
-rw-r--r--vcl/unx/source/gdi/salgdi.cxx39
-rw-r--r--vcl/unx/source/gdi/salgdi3.cxx30
-rw-r--r--vcl/unx/source/gdi/salvd.cxx4
-rw-r--r--vcl/unx/source/gdi/xrender_peer.hxx4
-rw-r--r--vcl/unx/source/plugadapt/salplug.cxx20
-rw-r--r--vcl/unx/source/printergfx/glyphset.cxx5
-rw-r--r--vcl/unx/source/window/salframe.cxx24
-rw-r--r--vcl/unx/source/window/salobj.cxx6
-rw-r--r--vcl/util/linksvp/makefile.mk6
-rw-r--r--vcl/util/makefile.mk12
-rw-r--r--vcl/win/inc/salgdi.h1
-rw-r--r--vcl/win/source/gdi/salgdi3.cxx32
-rwxr-xr-xvcl/win/source/gdi/winlayout.cxx20
-rw-r--r--vcl/win/source/window/salframe.cxx9
120 files changed, 1383 insertions, 1114 deletions
diff --git a/vcl/aqua/inc/saldata.hxx b/vcl/aqua/inc/saldata.hxx
index 931369982f03..dc629b9a3b8c 100644
--- a/vcl/aqua/inc/saldata.hxx
+++ b/vcl/aqua/inc/saldata.hxx
@@ -107,9 +107,10 @@ struct SalData
bool mbIsScrollbarDoubleMax; // TODO: support DoubleMin and DoubleBoth too
SInt32 mnSystemVersion; // Store System Version
MainController* mpMainController; // Apple Remote
- bool mbIsTestTool;
NSObject* mpDockIconClickHandler;
+ long mnDPIX; // #i100617# read DPI only once per office life
+ long mnDPIY; // #i100617# read DPI only once per office life
SalData();
~SalData();
diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h
index 476400f1564b..4c52c06a7393 100644
--- a/vcl/aqua/inc/salgdi.h
+++ b/vcl/aqua/inc/salgdi.h
@@ -348,6 +348,7 @@ public:
virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
virtual SystemGraphicsData GetGraphicsData() const;
+ virtual SystemFontData GetSysFontData( int /* nFallbacklevel */ ) const;
private:
// differences between VCL, Quartz and kHiThemeOrientation coordinate systems
diff --git a/vcl/aqua/source/app/saldata.cxx b/vcl/aqua/source/app/saldata.cxx
index b110141fb224..a70854306122 100644
--- a/vcl/aqua/source/app/saldata.cxx
+++ b/vcl/aqua/source/app/saldata.cxx
@@ -61,8 +61,9 @@ SalData::SalData()
mbIsScrollbarDoubleMax( false ),
mnSystemVersion( VER_TIGER ),
mpMainController( NULL ),
- mbIsTestTool( false ),
- mpDockIconClickHandler( nil )
+ mpDockIconClickHandler( nil ),
+ mnDPIX( 0 ),
+ mnDPIY( 0 )
{
if( s_aAutoReleaseKey == 0 )
s_aAutoReleaseKey = osl_createThreadKey( releasePool );
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index 0523381b9223..b9d66d1e02d3 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -178,7 +178,6 @@ static void initNSApp()
// get System Version and store the value in GetSalData()->mnSystemVersion
[NSApp getSystemVersionMajor: (unsigned int *)major minor:(unsigned int *)minor bugFix:(unsigned int *)bugFix ];
-// -----------------------------------------------------------------------------------------------------------------
// Initialize Apple Remote
GetSalData()->mpMainController = [[MainController alloc] init];
@@ -191,13 +190,9 @@ static void initNSApp()
selector: @selector(applicationWillResignActive:)
name: @"AppleRemoteWillResignActive"
object: nil ];
-// -----------------------------------------------------------------------------------------------------------------
- if( AquaSalInstance::isOnCommandLine( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "-enableautomation" ) ) ) )
- {
+ if( ImplGetSVData()->mbIsTestTool )
[NSApp activateIgnoringOtherApps: YES];
- GetSalData()->mbIsTestTool = true;
- }
}
BOOL ImplSVMainHook( BOOL * pbInit )
diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm
index 9e933c7410b6..4ad5e7ff9271 100755
--- a/vcl/aqua/source/app/vclnsapp.mm
+++ b/vcl/aqua/source/app/vclnsapp.mm
@@ -86,7 +86,25 @@
return;
}
}
-
+
+ /*
+ * #i98949# - Cmd-M miniaturize window, Cmd-Option-M miniaturize all windows
+ */
+ if( [[pEvent charactersIgnoringModifiers] isEqualToString: @"m"] )
+ {
+ if ( nModMask == NSCommandKeyMask && ([pFrame->getWindow() styleMask] & NSMiniaturizableWindowMask) )
+ {
+ [pFrame->getWindow() performMiniaturize: nil];
+ return;
+ }
+
+ if ( nModMask == ( NSCommandKeyMask | NSAlternateKeyMask ) )
+ {
+ [NSApp miniaturizeAll: nil];
+ return;
+ }
+ }
+
/* #i89611#
Cmd-Option-Space is for some reason not consumed by the menubar,
but also not by the input method (like e.g. Cmd-Space) and stays
diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx
index 929c8dd19c64..f47920004f7a 100755
--- a/vcl/aqua/source/gdi/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/salatslayout.cxx
@@ -711,6 +711,31 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons
if( !maATSULayout )
return STRING_LEN;
+ // the semantics of the legacy use case (nCharExtra!=0) cannot be mapped to ATSUBreakLine()
+ if( nCharExtra != 0 )
+ {
+ // prepare the measurement by layouting and measuring the un-expanded/un-condensed text
+ if( !InitGIA() )
+ return STRING_LEN;
+
+ // TODO: use a better way than by testing each the char position
+ ATSUTextMeasurement nATSUSumWidth = 0;
+ const ATSUTextMeasurement nATSUMaxWidth = Vcl2Fixed( nMaxWidth / nFactor );
+ const ATSUTextMeasurement nATSUExtraWidth = Vcl2Fixed( nCharExtra ) / nFactor;
+ for( int i = 0; i < mnCharCount; ++i )
+ {
+ nATSUSumWidth += mpCharWidths[i];
+ if( nATSUSumWidth >= nATSUMaxWidth )
+ return (mnMinCharPos + i);
+ nATSUSumWidth += nATSUExtraWidth;
+ if( nATSUSumWidth >= nATSUMaxWidth )
+ if( i+1 < mnCharCount )
+ return (mnMinCharPos + i);
+ }
+
+ return STRING_LEN;
+ }
+
// get a quick overview on what could fit
const long nPixelWidth = (nMaxWidth - (nCharExtra * mnCharCount)) / nFactor;
@@ -720,10 +745,10 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons
// initial measurement of text break position
UniCharArrayOffset nBreakPos = mnMinCharPos;
const ATSUTextMeasurement nATSUMaxWidth = Vcl2Fixed( nPixelWidth );
- OSStatus nStatus = ATSUBreakLine( maATSULayout, mnMinCharPos,
+ OSStatus eStatus = ATSUBreakLine( maATSULayout, mnMinCharPos,
nATSUMaxWidth, false, &nBreakPos );
- if( (nStatus != noErr) && (nStatus != kATSULineBreakInWord) )
+ if( (eStatus != noErr) && (eStatus != kATSULineBreakInWord) )
return STRING_LEN;
// the result from ATSUBreakLine() doesn't match the semantics expected by its
@@ -734,26 +759,6 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons
if( nBreakPos >= static_cast<UniCharArrayOffset>(mnEndCharPos) )
return STRING_LEN;
- // for the nCharExtra!=0 case the resulting nBreakPos needs be involved
- if( nCharExtra != 0 )
- {
- // age-old nCharExtra!=0 semantic is quite incompatible with ATSUBreakLine()
- // TODO: use a better way than by testing each the char position
- InitGIA();
- ATSUTextMeasurement nATSUSumWidth = 0;
- const ATSUTextMeasurement nATSUMaxWidth = Vcl2Fixed( nMaxWidth / nFactor );
- const ATSUTextMeasurement nATSUExtraWidth = Vcl2Fixed( nCharExtra ) / nFactor;
- for( int i = 0; i < mnCharCount; ++i)
- {
- nATSUSumWidth += mpCharWidths[i];
- if( nATSUSumWidth >= nATSUMaxWidth )
- return (mnMinCharPos + i);
- nATSUSumWidth += nATSUExtraWidth;
- }
-
- return STRING_LEN;
- }
-
// GetTextBreak()'s callers expect it to return the "stupid visual line break".
// Returning anything else result.s in subtle problems in the application layers.
static const bool bInWord = true; // TODO: add as argument to GetTextBreak() method
@@ -762,15 +767,15 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons
// emulate stupid visual line breaking by line breaking for the remaining width
ATSUTextMeasurement nLeft, nRight, nDummy;
- nStatus = ATSUGetUnjustifiedBounds( maATSULayout, mnMinCharPos, nBreakPos-mnMinCharPos,
+ eStatus = ATSUGetUnjustifiedBounds( maATSULayout, mnMinCharPos, nBreakPos-mnMinCharPos,
&nLeft, &nRight, &nDummy, &nDummy );
- if( nStatus != noErr )
+ if( eStatus != noErr )
return nBreakPos;
const ATSUTextMeasurement nATSURemWidth = nATSUMaxWidth - (nRight - nLeft);
if( nATSURemWidth <= 0 )
return nBreakPos;
UniCharArrayOffset nBreakPosInWord = nBreakPos;
- nStatus = ATSUBreakLine( maATSULayout, nBreakPos, nATSURemWidth, false, &nBreakPosInWord );
+ eStatus = ATSUBreakLine( maATSULayout, nBreakPos, nATSURemWidth, false, &nBreakPosInWord );
return nBreakPosInWord;
}
diff --git a/vcl/aqua/source/gdi/salatsuifontutils.cxx b/vcl/aqua/source/gdi/salatsuifontutils.cxx
index 6c8fe86bdaef..595b7d276a2a 100644
--- a/vcl/aqua/source/gdi/salatsuifontutils.cxx
+++ b/vcl/aqua/source/gdi/salatsuifontutils.cxx
@@ -46,17 +46,17 @@
// and SFNT fonts on Mac usually do not contain an OS/2 table.
static void UpdateAttributesFromPSName( const String& rPSName, ImplDevFontAttributes& rDFA )
{
- // TODO: use a multi-string ignore-case matcher once it becomes available
- String aPSName = rPSName;
+ ByteString aPSName( rPSName, RTL_TEXTENCODING_UTF8 );
aPSName.ToLowerAscii();
- if( (aPSName.SearchAscii("regular") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("normal") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("roman") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("medium") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("plain") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("standard") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("std") != STRING_NOTFOUND) )
+ // TODO: use a multi-string ignore-case matcher once it becomes available
+ if( (aPSName.Search("regular") != STRING_NOTFOUND)
+ || (aPSName.Search("normal") != STRING_NOTFOUND)
+ || (aPSName.Search("roman") != STRING_NOTFOUND)
+ || (aPSName.Search("medium") != STRING_NOTFOUND)
+ || (aPSName.Search("plain") != STRING_NOTFOUND)
+ || (aPSName.Search("standard") != STRING_NOTFOUND)
+ || (aPSName.Search("std") != STRING_NOTFOUND) )
{
rDFA.meWidthType = WIDTH_NORMAL;
rDFA.meWeight = WEIGHT_NORMAL;
@@ -64,110 +64,133 @@ static void UpdateAttributesFromPSName( const String& rPSName, ImplDevFontAttrib
}
// heuristics for font weight
- if (aPSName.SearchAscii("extrablack") != STRING_NOTFOUND)
+ if (aPSName.Search("extrablack") != STRING_NOTFOUND)
rDFA.meWeight = WEIGHT_BLACK;
- else if (aPSName.SearchAscii("black") != STRING_NOTFOUND)
+ else if (aPSName.Search("black") != STRING_NOTFOUND)
rDFA.meWeight = WEIGHT_BLACK;
- //else if (aPSName.SearchAscii("book") != STRING_NOTFOUND)
+ //else if (aPSName.Search("book") != STRING_NOTFOUND)
// rDFA.meWeight = WEIGHT_SEMIBOLD;
- else if( (aPSName.SearchAscii("semibold") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("smbd") != STRING_NOTFOUND))
+ else if( (aPSName.Search("semibold") != STRING_NOTFOUND)
+ || (aPSName.Search("smbd") != STRING_NOTFOUND))
rDFA.meWeight = WEIGHT_SEMIBOLD;
- else if (aPSName.SearchAscii("ultrabold") != STRING_NOTFOUND)
+ else if (aPSName.Search("ultrabold") != STRING_NOTFOUND)
rDFA.meWeight = WEIGHT_ULTRABOLD;
- else if (aPSName.SearchAscii("extrabold") != STRING_NOTFOUND)
+ else if (aPSName.Search("extrabold") != STRING_NOTFOUND)
rDFA.meWeight = WEIGHT_BLACK;
- else if( (aPSName.SearchAscii("bold") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("-bd") != STRING_NOTFOUND))
+ else if( (aPSName.Search("bold") != STRING_NOTFOUND)
+ || (aPSName.Search("-bd") != STRING_NOTFOUND))
rDFA.meWeight = WEIGHT_BOLD;
- else if (aPSName.SearchAscii("extralight") != STRING_NOTFOUND)
+ else if (aPSName.Search("extralight") != STRING_NOTFOUND)
rDFA.meWeight = WEIGHT_ULTRALIGHT;
- else if (aPSName.SearchAscii("ultralight") != STRING_NOTFOUND)
+ else if (aPSName.Search("ultralight") != STRING_NOTFOUND)
rDFA.meWeight = WEIGHT_ULTRALIGHT;
- else if (aPSName.SearchAscii("light") != STRING_NOTFOUND)
+ else if (aPSName.Search("light") != STRING_NOTFOUND)
rDFA.meWeight = WEIGHT_LIGHT;
- else if (aPSName.SearchAscii("thin") != STRING_NOTFOUND)
+ else if (aPSName.Search("thin") != STRING_NOTFOUND)
rDFA.meWeight = WEIGHT_THIN;
- else if (aPSName.SearchAscii("-w3") != STRING_NOTFOUND)
+ else if (aPSName.Search("-w3") != STRING_NOTFOUND)
rDFA.meWeight = WEIGHT_LIGHT;
- else if (aPSName.SearchAscii("-w4") != STRING_NOTFOUND)
+ else if (aPSName.Search("-w4") != STRING_NOTFOUND)
rDFA.meWeight = WEIGHT_SEMILIGHT;
- else if (aPSName.SearchAscii("-w5") != STRING_NOTFOUND)
+ else if (aPSName.Search("-w5") != STRING_NOTFOUND)
rDFA.meWeight = WEIGHT_NORMAL;
- else if (aPSName.SearchAscii("-w6") != STRING_NOTFOUND)
+ else if (aPSName.Search("-w6") != STRING_NOTFOUND)
rDFA.meWeight = WEIGHT_SEMIBOLD;
- else if (aPSName.SearchAscii("-w7") != STRING_NOTFOUND)
+ else if (aPSName.Search("-w7") != STRING_NOTFOUND)
rDFA.meWeight = WEIGHT_BOLD;
- else if (aPSName.SearchAscii("-w8") != STRING_NOTFOUND)
+ else if (aPSName.Search("-w8") != STRING_NOTFOUND)
rDFA.meWeight = WEIGHT_ULTRABOLD;
- else if (aPSName.SearchAscii("-w9") != STRING_NOTFOUND)
+ else if (aPSName.Search("-w9") != STRING_NOTFOUND)
rDFA.meWeight = WEIGHT_BLACK;
// heuristics for font slant
- if( (aPSName.SearchAscii("italic") != STRING_NOTFOUND)
- || (aPSName.SearchAscii(" ital") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("cursive") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("-it") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("lightit") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("mediumit") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("boldit") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("cnit") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("bdcn") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("bdit") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("condit") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("bookit") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("blackit") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("libertineio") != STRING_NOTFOUND) )
+ if( (aPSName.Search("italic") != STRING_NOTFOUND)
+ || (aPSName.Search(" ital") != STRING_NOTFOUND)
+ || (aPSName.Search("cursive") != STRING_NOTFOUND)
+ || (aPSName.Search("-it") != STRING_NOTFOUND)
+ || (aPSName.Search("lightit") != STRING_NOTFOUND)
+ || (aPSName.Search("mediumit") != STRING_NOTFOUND)
+ || (aPSName.Search("boldit") != STRING_NOTFOUND)
+ || (aPSName.Search("cnit") != STRING_NOTFOUND)
+ || (aPSName.Search("bdcn") != STRING_NOTFOUND)
+ || (aPSName.Search("bdit") != STRING_NOTFOUND)
+ || (aPSName.Search("condit") != STRING_NOTFOUND)
+ || (aPSName.Search("bookit") != STRING_NOTFOUND)
+ || (aPSName.Search("blackit") != STRING_NOTFOUND) )
rDFA.meItalic = ITALIC_NORMAL;
- if( (aPSName.SearchAscii("oblique") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("inclined") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("slanted") != STRING_NOTFOUND) )
+ if( (aPSName.Search("oblique") != STRING_NOTFOUND)
+ || (aPSName.Search("inclined") != STRING_NOTFOUND)
+ || (aPSName.Search("slanted") != STRING_NOTFOUND) )
rDFA.meItalic = ITALIC_OBLIQUE;
// heuristics for font width
- if( (aPSName.SearchAscii("condensed") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("-cond") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("boldcond") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("boldcn") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("cnit") != STRING_NOTFOUND) )
+ if( (aPSName.Search("condensed") != STRING_NOTFOUND)
+ || (aPSName.Search("-cond") != STRING_NOTFOUND)
+ || (aPSName.Search("boldcond") != STRING_NOTFOUND)
+ || (aPSName.Search("boldcn") != STRING_NOTFOUND)
+ || (aPSName.Search("cnit") != STRING_NOTFOUND) )
rDFA.meWidthType = WIDTH_CONDENSED;
- else if (aPSName.SearchAscii("narrow") != STRING_NOTFOUND)
+ else if (aPSName.Search("narrow") != STRING_NOTFOUND)
rDFA.meWidthType = WIDTH_SEMI_CONDENSED;
- else if (aPSName.SearchAscii("expanded") != STRING_NOTFOUND)
+ else if (aPSName.Search("expanded") != STRING_NOTFOUND)
rDFA.meWidthType = WIDTH_EXPANDED;
- else if (aPSName.SearchAscii("wide") != STRING_NOTFOUND)
+ else if (aPSName.Search("wide") != STRING_NOTFOUND)
rDFA.meWidthType = WIDTH_EXPANDED;
// heuristics for font pitch
- if( (aPSName.SearchAscii("mono") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("courier") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("monaco") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("typewriter") != STRING_NOTFOUND) )
+ if( (aPSName.Search("mono") != STRING_NOTFOUND)
+ || (aPSName.Search("courier") != STRING_NOTFOUND)
+ || (aPSName.Search("monaco") != STRING_NOTFOUND)
+ || (aPSName.Search("typewriter") != STRING_NOTFOUND) )
rDFA.mePitch = PITCH_FIXED;
// heuristics for font family type
- if( (aPSName.SearchAscii("script") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("chancery") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("zapfino") != STRING_NOTFOUND))
+ if( (aPSName.Search("script") != STRING_NOTFOUND)
+ || (aPSName.Search("chancery") != STRING_NOTFOUND)
+ || (aPSName.Search("zapfino") != STRING_NOTFOUND))
rDFA.meFamily = FAMILY_SCRIPT;
- else if( (aPSName.SearchAscii("comic") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("outline") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("pinpoint") != STRING_NOTFOUND) )
+ else if( (aPSName.Search("comic") != STRING_NOTFOUND)
+ || (aPSName.Search("outline") != STRING_NOTFOUND)
+ || (aPSName.Search("pinpoint") != STRING_NOTFOUND) )
rDFA.meFamily = FAMILY_DECORATIVE;
- else if( (aPSName.SearchAscii("sans") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("arial") != STRING_NOTFOUND) )
+ else if( (aPSName.Search("sans") != STRING_NOTFOUND)
+ || (aPSName.Search("arial") != STRING_NOTFOUND) )
rDFA.meFamily = FAMILY_SWISS;
- else if( (aPSName.SearchAscii("roman") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("times") != STRING_NOTFOUND) )
+ else if( (aPSName.Search("roman") != STRING_NOTFOUND)
+ || (aPSName.Search("times") != STRING_NOTFOUND) )
rDFA.meFamily = FAMILY_ROMAN;
// heuristics for codepoint semantic
- if( (aPSName.SearchAscii("symbol") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("dings") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("dingbats") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("ornaments") != STRING_NOTFOUND)
- || (aPSName.SearchAscii("embellishments") != STRING_NOTFOUND) )
+ if( (aPSName.Search("symbol") != STRING_NOTFOUND)
+ || (aPSName.Search("dings") != STRING_NOTFOUND)
+ || (aPSName.Search("dingbats") != STRING_NOTFOUND)
+ || (aPSName.Search("ornaments") != STRING_NOTFOUND)
+ || (aPSName.Search("embellishments") != STRING_NOTFOUND) )
rDFA.mbSymbolFlag = true;
+
+ // #i100020# special heuristic for names with single-char styles
+ // NOTE: we are checking name that hasn't been lower-cased
+ if( rPSName.Len() > 3 )
+ {
+ int i = rPSName.Len();
+ sal_Unicode c = rPSName.GetChar( --i );
+ if( c == 'C' ) { // "capitals"
+ rDFA.meFamily = FAMILY_DECORATIVE;
+ c = rPSName.GetChar( --i );
+ }
+ if( c == 'O' ) { // CFF-based OpenType
+ c = rPSName.GetChar( --i );
+ }
+ if( c == 'I' ) { // "italic"
+ rDFA.meItalic = ITALIC_NORMAL;
+ c = rPSName.GetChar( --i );
+ }
+ if( c == 'B' ) // "bold"
+ rDFA.meWeight = WEIGHT_BOLD;
+ if( c == 'C' ) // "capitals"
+ rDFA.meFamily = FAMILY_DECORATIVE;
+ // TODO: check that all single-char styles have been resolved?
+ }
}
// -----------------------------------------------------------------------
@@ -231,9 +254,9 @@ static bool GetDevFontAttributes( ATSUFontID nFontID, ImplDevFontAttributes& rDF
continue;
// heuristic to find the most common font name
- // prefering default language names or even better the names matching to the UI language
+ // prefering default language names or even better the names matching to the UI language
int nNameValue = (eFontNameLanguage==eUILangCode) ? 0 : ((eFontNameLanguage==0) ? -10 : -20);
- rtl_TextEncoding eEncoding = RTL_TEXTENCODING_UNICODE;
+ rtl_TextEncoding eEncoding = RTL_TEXTENCODING_UNICODE;
const int nPlatformEncoding = ((int)eFontNamePlatform << 8) + (int)eFontNameScript;
switch( nPlatformEncoding )
{
@@ -259,6 +282,8 @@ static bool GetDevFontAttributes( ATSUFontID nFontID, ImplDevFontAttributes& rDF
// ignore name entries with no useful encoding
if( nNameValue <= 0 )
continue;
+ if( nNameLength >= aNameBuffer.size() )
+ continue;
// get the encoded name
aNameBuffer.reserve( nNameLength+1 ); // extra byte helps for debugging
@@ -306,7 +331,7 @@ static bool GetDevFontAttributes( ATSUFontID nFontID, ImplDevFontAttributes& rDF
case kFontStyleName:
// get a style name matching to the family name
if( nBestStyleValue < nNameValue )
- {
+ {
nBestStyleValue = nNameValue;
rDFA.maStyleName = aUtf16Name;
}
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index c39dc26f370f..b1499e2c32d5 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -36,8 +36,7 @@
#include "salbmp.h"
#include "salframe.h"
#include "salcolorutils.hxx"
-#include "list.h"
-#include "sft.h"
+#include "sft.hxx"
#include "salatsuifontutils.hxx"
#include "vcl/impfont.hxx"
@@ -58,6 +57,8 @@
#include "basegfx/polygon/b2dpolygontools.hxx"
#include "basegfx/matrix/b2dhommatrix.hxx"
+using namespace vcl;
+
typedef unsigned char Boolean; // copied from MacTypes.h, should be properly included
typedef std::vector<unsigned char> ByteVector;
@@ -400,19 +401,8 @@ void AquaSalGraphics::initResolution( NSWindow* pWin )
DBG_ERROR( "no screen found" );
}
- // equalize x- and y-resolution if they are close enough to prevent unneeded font stretching
- if( (mnRealDPIX != mnRealDPIY)
- && (10*mnRealDPIX < 13*mnRealDPIY) && (13*mnRealDPIX > 10*mnRealDPIY) )
- {
- mnRealDPIX = mnRealDPIY = (mnRealDPIX + mnRealDPIY + 1) / 2;
- }
- else // #i89650# workaround bogus device resolutions
- {
- if( mnRealDPIY < 72 )
- mnRealDPIY = 72;
- if( mnRealDPIX < mnRealDPIY ) // e.g. for TripleHead2Go only mnRealDPIX is off
- mnRealDPIX = mnRealDPIY;
- }
+ // for OSX any anisotropy reported for the display resolution is best ignored (e.g. TripleHead2Go)
+ mnRealDPIX = mnRealDPIY = (mnRealDPIX + mnRealDPIY + 1) / 2;
mfFakeDPIScale = 1.0;
}
@@ -2308,6 +2298,43 @@ void AquaSalGraphics::FreeEmbedFontData( const void* pData, long nDataLen )
// -----------------------------------------------------------------------
+SystemFontData AquaSalGraphics::GetSysFontData( int /* nFallbacklevel */ ) const
+{
+ SystemFontData aSysFontData;
+ OSStatus err;
+ aSysFontData.nSize = sizeof( SystemFontData );
+
+ // NOTE: Native ATSU font fallbacks are used, not the VCL fallbacks.
+ ATSUFontID fontId;
+ err = ATSUGetAttribute( maATSUStyle, kATSUFontTag, sizeof(fontId), &fontId, 0 );
+ if (err) fontId = 0;
+ aSysFontData.aATSUFontID = (void *) fontId;
+
+ Boolean bFbold;
+ err = ATSUGetAttribute( maATSUStyle, kATSUQDBoldfaceTag, sizeof(bFbold), &bFbold, 0 );
+ if (err) bFbold = FALSE;
+ aSysFontData.bFakeBold = (bool) bFbold;
+
+ Boolean bFItalic;
+ err = ATSUGetAttribute( maATSUStyle, kATSUQDItalicTag, sizeof(bFItalic), &bFItalic, 0 );
+ if (err) bFItalic = FALSE;
+ aSysFontData.bFakeItalic = (bool) bFItalic;
+
+ ATSUVerticalCharacterType aVerticalCharacterType;
+ err = ATSUGetAttribute( maATSUStyle, kATSUVerticalCharacterTag, sizeof(aVerticalCharacterType), &aVerticalCharacterType, 0 );
+ if (!err && aVerticalCharacterType == kATSUStronglyVertical) {
+ aSysFontData.bVerticalCharacterType = true;
+ } else {
+ aSysFontData.bVerticalCharacterType = false;
+ }
+
+ aSysFontData.bAntialias = !mbNonAntialiasedText;
+
+ return aSysFontData;
+}
+
+// -----------------------------------------------------------------------
+
SystemGraphicsData AquaSalGraphics::GetGraphicsData() const
{
SystemGraphicsData aRes;
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index 5db3ea68ab14..560d80fd75d5 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -1176,6 +1176,9 @@ void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
// set scrollbar size
aStyleSettings.SetScrollBarSize( [NSScroller scrollerWidth] );
+ // images in menus false for MacOSX
+ aStyleSettings.SetUseImagesInMenus( false );
+
rSettings.SetStyleSettings( aStyleSettings );
[mpView unlockFocus];
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index b491318bbb0d..7de43d770385 100755
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -922,7 +922,7 @@ private:
// applications and vcl's edit fields ignore key events with ALT
// however we're at a place where we know text should be inserted
// so it seems we need to strip the Alt modifier here
- if( (nLastModifiers & (NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask))
+ if( (nLastModifiers & (NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask))
== NSAlternateKeyMask )
{
nLastModifiers = 0;
@@ -1233,6 +1233,10 @@ private:
mpLastSuperEvent = mpLastEvent;
[NSApp performSelector:@selector(sendSuperEvent:) withObject: mpLastEvent];
mpLastSuperEvent = pLastSuperEvent;
+
+ std::map< NSEvent*, bool >::iterator it = GetSalData()->maKeyEventAnswer.find( mpLastEvent );
+ if( it != GetSalData()->maKeyEventAnswer.end() )
+ it->second = true;
}
}
}
diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx
index 9b4499cc1233..4fafbbdbb4cf 100644
--- a/vcl/aqua/source/window/salmenu.cxx
+++ b/vcl/aqua/source/window/salmenu.cxx
@@ -521,7 +521,7 @@ BOOL AquaSalMenu::VisibleMenuBar()
static const char *pExperimental = getenv ("AQUA_NATIVE_MENUS");
- if ( GetSalData()->mbIsTestTool || (pExperimental && !strcasecmp(pExperimental, "FALSE")) )
+ if ( ImplGetSVData()->mbIsTestTool || (pExperimental && !strcasecmp(pExperimental, "FALSE")) )
return FALSE;
// End of experimental code enable/disable part
diff --git a/vcl/aqua/source/window/salobj.cxx b/vcl/aqua/source/window/salobj.cxx
index abbea052c3d6..79da1b155cad 100644
--- a/vcl/aqua/source/window/salobj.cxx
+++ b/vcl/aqua/source/window/salobj.cxx
@@ -37,11 +37,6 @@
#include "salobj.h"
#include "salframe.h"
-// get QTMovieView
-#include "premac.h"
-#include <QTKit/QTMovieView.h>
-#include "postmac.h"
-
// =======================================================================
AquaSalObject::AquaSalObject( AquaSalFrame* pFrame ) :
@@ -66,7 +61,7 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame ) :
[mpFrame->getView() addSubview: mpClipView];
[mpClipView setHidden: YES];
}
- maSysData.pView = [[QTMovieView alloc] initWithFrame: aInitFrame];
+ maSysData.pView = [[NSView alloc] initWithFrame: aInitFrame];
if( maSysData.pView )
{
if( mpClipView )
diff --git a/vcl/inc/list.h b/vcl/inc/list.h
index b86521a1f666..b801b43d77eb 100644
--- a/vcl/inc/list.h
+++ b/vcl/inc/list.h
@@ -51,6 +51,7 @@ extern "C"
*/
typedef struct _list *list;
+ typedef void (*list_destructor)(void *);
/*- constructors and a destructor */
list listNewEmpty(void);
@@ -58,7 +59,7 @@ extern "C"
list listNewCopy(list);
#endif
void listDispose(list);
- void listSetElementDtor(list, void (*f)(void *)); /*- this function will be executed when the element is removed via listRemove() or listClear() */
+ void listSetElementDtor(list, list_destructor); /*- this function will be executed when the element is removed via listRemove() or listClear() */
/*- queries */
void * listCurrent(list);
diff --git a/vcl/inc/sft.h b/vcl/inc/sft.hxx
index efda0903afc5..5f22bc0a471f 100644
--- a/vcl/inc/sft.h
+++ b/vcl/inc/sft.hxx
@@ -46,7 +46,6 @@
* If NO_TYPE3 is defined CreateT3FromTTGlyphs() does not get compiled in.
* If NO_TYPE42 is defined Type42-related code is excluded
* If NO_TTCR is defined TrueType creation related code is excluded\
- * If NO_LIST is defined list.h and piblic functions that use it don't get compiled
*/
/*
@@ -76,20 +75,10 @@
#include <sal/types.h>
-#ifndef NO_LIST
-#include "list.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <vector>
-/*@{*/
-#ifndef __cplusplus
-#define false 0 /**< standard false value */
-#define true 1 /**< standard true value */
-#endif
-/*@}*/
+namespace vcl
+{
/*@{*/
typedef sal_Int16 F2Dot14; /**< fixed: 2.14 */
@@ -349,7 +338,6 @@ extern "C" {
*/
GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID);
-#ifndef NO_LIST
/**
* For a specified glyph adds all component glyphs IDs to the list and
* return their number. If the glyph is a single glyph it has one component
@@ -365,8 +353,7 @@ extern "C" {
* @ingroup sft
*
*/
- int GetTTGlyphComponents(TrueTypeFont *ttf, sal_uInt32 glyphID, list glyphlist);
-#endif
+ int GetTTGlyphComponents(TrueTypeFont *ttf, sal_uInt32 glyphID, std::vector< sal_uInt32 >& glyphlist);
/**
* Extracts all Name Records from the font and stores them in an allocated
@@ -606,7 +593,7 @@ extern "C" {
sal_uInt8 *cmap;
int cmapType;
sal_uInt32 (*mapper)(const sal_uInt8 *, sal_uInt32); /* character to glyphID translation function */
- void **tables; /* array of pointers to tables */
+ sal_uInt8 **tables; /* array of pointers to raw subtables in SFNT file */
sal_uInt32 *tlens; /* array of table lengths */
int kerntype; /* Defined in the KernType enum */
sal_uInt32 nkern; /* number of kern subtables */
@@ -614,10 +601,6 @@ extern "C" {
void *pGSubstitution; /* info provided by GSUB for UseGSUB() */
};
-#ifdef __cplusplus
-}
-#endif
-
/* indexes into _TrueTypeFont::tables[] and _TrueTypeFont::tlens[] */
#define O_maxp 0 /* 'maxp' */
#define O_glyf 1 /* 'glyf' */
@@ -638,4 +621,6 @@ extern "C" {
#define O_gsub 16 /* 'GSUB' */
#define NUM_TAGS 17
+} // namespace vcl
+
#endif /* __SUBFONT_H */
diff --git a/vcl/unx/inc/postx.h b/vcl/inc/vcl/ImageListProvider.hxx
index 68a2c3a31cf8..03e0646af14d 100644
--- a/vcl/unx/inc/postx.h
+++ b/vcl/inc/vcl/ImageListProvider.hxx
@@ -6,8 +6,8 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: postx.h,v $
- * $Revision: 1.7 $
+ * $RCSfile: toolbox.hxx,v $
+ * $Revision: 1.5 $
*
* This file is part of OpenOffice.org.
*
@@ -28,49 +28,30 @@
*
************************************************************************/
-#ifndef _POSTX_H
-#define _POSTX_H
+#ifndef _SV_IMAGELISTPROVIDER_HXX
+#define _SV_IMAGELISTPROVIDER_HXX
-#if defined __cplusplus
-}
-#endif
+#include <sal/types.h>
-/* X-Types */
-#undef Window
-#undef BYTE
-#undef INT8
-#undef INT64
-#undef BOOL
-#undef Font
-#undef Cursor
-#undef String
-#undef KeyCode
-#undef Region
-#undef Icon
-#undef Time
-#undef Boolean
+namespace com { namespace sun { namespace star { namespace lang { class IllegalArgumentException; }}}}
-#undef Min
-#undef Max
-#undef DestroyAll
-#undef Success
+class ImageList;
-#undef Printer
-/* #undef FontInfo */
-#undef Orientation
-#undef GetToken
-#undef ReleaseToken
-#undef InitializeToken
-#undef NextRequest
+namespace vcl
+{
+ enum ImageListType
+ {
+ IMAGELISTTYPE_UNKNOWN = 0,
+ HIGHCONTRAST_NO = 1,
+ HIGHCONTRAST_YES = 2
+ };
-#ifdef KeyPress
-#if KeyPress != 2
-Error KeyPress must be Equal 2
-#endif
-#undef KeyPress
-#endif
-#define XLIB_KeyPress 2
-
-#endif
+ /* abstract */ class IImageListProvider
+ {
+ public:
+ virtual ImageList getImageList(ImageListType) SAL_THROW (( com::sun::star::lang::IllegalArgumentException )) = 0;
+ };
+} /* vcl */
+#endif /* _SV_IMAGELISTPROVIDER_HXX */
diff --git a/vcl/inc/vcl/accel.h b/vcl/inc/vcl/accel.h
index 6d1ffd0c28ce..b63adeae9a37 100644
--- a/vcl/inc/vcl/accel.h
+++ b/vcl/inc/vcl/accel.h
@@ -57,6 +57,6 @@ public:
// -----------------
// in KEYCOD.CXX
-void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3 );
+void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3, USHORT& rCode4 );
#endif // _SV_ACCEL_H
diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx
index 7dda8702fb66..94df24a9cea7 100644
--- a/vcl/inc/vcl/button.hxx
+++ b/vcl/inc/vcl/button.hxx
@@ -103,6 +103,8 @@ public:
void SetFocusRect( const Rectangle& rFocusRect );
const Rectangle& GetFocusRect() const;
+ void SetSmallSymbol (bool bSmall=true);
+ bool IsSmallSymbol () const;
};
// --------------------
diff --git a/vcl/inc/vcl/cmdevt.hxx b/vcl/inc/vcl/cmdevt.hxx
index fde8fe83b6f2..ac9f852cd54c 100644
--- a/vcl/inc/vcl/cmdevt.hxx
+++ b/vcl/inc/vcl/cmdevt.hxx
@@ -280,14 +280,17 @@ public:
BOOL IsShift() const { return (mnCode & MODKEY_SHIFT) ? TRUE : FALSE; }
BOOL IsMod1() const { return (mnCode & MODKEY_MOD1) ? TRUE : FALSE; }
BOOL IsMod2() const { return (mnCode & MODKEY_MOD2) ? TRUE : FALSE; }
+ BOOL IsMod3() const { return (mnCode & MODKEY_MOD3) ? TRUE : FALSE; }
BOOL IsLeftShift() const { return (mnCode & MODKEY_LSHIFT) ? TRUE : FALSE; }
BOOL IsLeftMod1() const { return (mnCode & MODKEY_LMOD1) ? TRUE : FALSE; }
BOOL IsLeftMod2() const { return (mnCode & MODKEY_LMOD2) ? TRUE : FALSE; }
+ BOOL IsLeftMod3() const { return (mnCode & MODKEY_LMOD3) ? TRUE : FALSE; }
BOOL IsRightShift() const { return (mnCode & MODKEY_RSHIFT) ? TRUE : FALSE; }
BOOL IsRightMod1() const { return (mnCode & MODKEY_RMOD1) ? TRUE : FALSE; }
BOOL IsRightMod2() const { return (mnCode & MODKEY_RMOD2) ? TRUE : FALSE; }
+ BOOL IsRightMod3() const { return (mnCode & MODKEY_RMOD3) ? TRUE : FALSE; }
};
inline CommandModKeyData::CommandModKeyData()
diff --git a/vcl/inc/vcl/event.hxx b/vcl/inc/vcl/event.hxx
index 20ad3aaaf608..04ba5f7a0abf 100644
--- a/vcl/inc/vcl/event.hxx
+++ b/vcl/inc/vcl/event.hxx
@@ -176,6 +176,8 @@ public:
{ return ((mnCode & KEY_MOD1) != 0); }
BOOL IsMod2() const
{ return ((mnCode & KEY_MOD2) != 0); }
+ BOOL IsMod3() const
+ { return ((mnCode & KEY_MOD3) != 0); }
};
inline MouseEvent::MouseEvent()
diff --git a/vcl/inc/vcl/keycod.hxx b/vcl/inc/vcl/keycod.hxx
index 6c652a0e5307..cdd1ed35d80f 100644
--- a/vcl/inc/vcl/keycod.hxx
+++ b/vcl/inc/vcl/keycod.hxx
@@ -73,7 +73,7 @@ public:
KeyCode( const ResId& rResId );
KeyCode( USHORT nKey, USHORT nModifier = 0 )
{ nCode = nKey | nModifier; eFunc = KEYFUNC_DONTKNOW; }
- KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2 );
+ KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2, BOOL bMod3 );
KeyCode( KeyFuncType eFunction );
USHORT GetFullCode() const { return nCode; }
@@ -112,7 +112,7 @@ public:
BOOL operator !=( const KeyCode& rKeyCode ) const;
};
-inline KeyCode::KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2 )
+inline KeyCode::KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2, BOOL bMod3 )
{
nCode = nKey;
if( bShift )
@@ -121,6 +121,8 @@ inline KeyCode::KeyCode( USHORT nKey, BOOL bShift, BOOL bMod1, BOOL bMod2 )
nCode |= KEY_MOD1;
if( bMod2 )
nCode |= KEY_MOD2;
+ if( bMod3 )
+ nCode |= KEY_MOD3;
eFunc = KEYFUNC_DONTKNOW;
}
diff --git a/vcl/inc/vcl/keycodes.hxx b/vcl/inc/vcl/keycodes.hxx
index d90e9923f0ad..66d8a87e27a2 100644
--- a/vcl/inc/vcl/keycodes.hxx
+++ b/vcl/inc/vcl/keycodes.hxx
@@ -176,9 +176,12 @@
#define MODKEY_RMOD1 0x0008
#define MODKEY_LMOD2 0x0010
#define MODKEY_RMOD2 0x0020
+#define MODKEY_LMOD3 0x0040
+#define MODKEY_RMOD3 0x0080
#define MODKEY_SHIFT (MODKEY_LSHIFT|MODKEY_RSHIFT)
#define MODKEY_MOD1 (MODKEY_LMOD1|MODKEY_RMOD1)
#define MODKEY_MOD2 (MODKEY_LMOD2|MODKEY_RMOD2)
+#define MODKEY_MOD3 (MODKEY_LMOD3|MODKEY_RMOD3)
// ---------------
// - Mouse-Types -
diff --git a/vcl/inc/vcl/lstbox.hxx b/vcl/inc/vcl/lstbox.hxx
index eb904ddffab6..0bf281798674 100644
--- a/vcl/inc/vcl/lstbox.hxx
+++ b/vcl/inc/vcl/lstbox.hxx
@@ -57,6 +57,7 @@ private:
BOOL mbDDAutoSize;
Link maSelectHdl;
Link maDoubleClickHdl;
+ USHORT mnLineCount;
//#if 0 // _SOLAR__PRIVATE
private:
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index c0bcfa35fae5..3f821f995a51 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -53,6 +53,8 @@ class ImplFontEntry;
struct ImplObjStack;
struct ImplKernPairData;
struct SystemGraphicsData;
+struct SystemFontData;
+struct SystemTextLayoutData;
class ImplFontCache;
class ImplDevFontList;
class ImplGetDevFontList;
@@ -883,6 +885,12 @@ public:
void SetFont( const Font& rNewFont );
const Font& GetFont() const { return maFont; }
+
+ SystemFontData GetSysFontData( int nFallbacklevel ) const;
+ SystemTextLayoutData GetSysTextLayoutData( const Point& rStartPt, const XubString& rStr,
+ xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
+ const sal_Int32* pDXAry = NULL ) const;
+
void SetTextColor( const Color& rColor );
const Color& GetTextColor() const { return maTextColor; }
void SetTextFillColor();
diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx
index 2bbb44d67b42..5cf6e70f5114 100644
--- a/vcl/inc/vcl/salgdi.hxx
+++ b/vcl/inc/vcl/salgdi.hxx
@@ -57,6 +57,7 @@ struct FontSubsetInfo;
class OutputDevice;
class ServerFontLayout;
struct SystemGraphicsData;
+struct SystemFontData;
namespace basegfx {
class B2DVector;
@@ -493,6 +494,7 @@ public:
sal_uInt8 nTransparency, const OutputDevice *pOutDev );
virtual SystemGraphicsData GetGraphicsData() const = 0;
+ virtual SystemFontData GetSysFontData( int nFallbacklevel ) const = 0;
};
#endif // _SV_SALGDI_HXX
diff --git a/vcl/inc/vcl/svdata.hxx b/vcl/inc/vcl/svdata.hxx
index 18e937b25573..5d970f060448 100644
--- a/vcl/inc/vcl/svdata.hxx
+++ b/vcl/inc/vcl/svdata.hxx
@@ -342,6 +342,7 @@ struct ImplSVData
UnoWrapperBase* mpUnoWrapper;
Window* mpIntroWindow; // the splash screen
DockingManager* mpDockingManager;
+ BOOL mbIsTestTool;
vos::OThread::TThreadIdentifier mnMainThreadId;
::com::sun::star::uno::Reference<
diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx
index d98a6373d6fc..2e2a5e80e761 100644
--- a/vcl/inc/vcl/sysdata.hxx
+++ b/vcl/inc/vcl/sysdata.hxx
@@ -31,10 +31,12 @@
#ifndef _SV_SYSDATA_HXX
#define _SV_SYSDATA_HXX
+#include <vector>
+
#ifdef QUARTZ
// predeclare the native classes to avoid header/include problems
typedef struct CGContext *CGContextRef;
-typedef struct CGLayer *CGLayerRef;
+typedef struct CGLayer *CGLayerRef;
#ifdef __OBJC__
@class NSView;
#else
@@ -141,4 +143,50 @@ struct SystemWindowData
#endif
};
+
+// --------------------
+// - SystemGlyphData -
+// --------------------
+
+struct SystemGlyphData
+{
+ unsigned long index;
+ double x;
+ double y;
+};
+
+
+// --------------------
+// - SystemFontData -
+// --------------------
+
+struct SystemFontData
+{
+ unsigned long nSize; // size in bytes of this structure
+#if defined( WNT )
+ HFONT hFont; // native font object
+#elif defined( QUARTZ )
+ void* aATSUFontID; // native font object
+#elif defined( UNX )
+ void* nFontId; // native font id
+ int nFontFlags; // native font flags
+#endif
+ bool bFakeBold; // Does this font need faking the bold style
+ bool bFakeItalic; // Does this font need faking the italic style
+ bool bAntialias; // Should this font be antialiased
+ bool bVerticalCharacterType; // Is the font using vertical character type
+};
+
+// --------------------
+// - SystemTextLayoutData -
+// --------------------
+
+struct SystemTextLayoutData
+{
+ unsigned long nSize; // size in bytes of this structure
+ std::vector<SystemGlyphData> rGlyphData; // glyph data
+ int orientation; // Text orientation
+ SystemFontData aSysFontData; // Font data for the text layout
+};
+
#endif // _SV_SYSDATA_HXX
diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx
index b12d33d579a3..378459b9eadb 100644
--- a/vcl/inc/vcl/tabctrl.hxx
+++ b/vcl/inc/vcl/tabctrl.hxx
@@ -45,8 +45,10 @@ class PushButton;
// - TabControl-Types -
// --------------------
+#ifndef TAB_APPEND
#define TAB_APPEND ((USHORT)0xFFFF)
#define TAB_PAGE_NOTFOUND ((USHORT)0xFFFF)
+#endif /* !TAB_APPEND */
// --------------
// - TabControl -
diff --git a/vcl/inc/vcl/toolbox.h b/vcl/inc/vcl/toolbox.h
index 10b5199929d2..52a0db40b226 100644
--- a/vcl/inc/vcl/toolbox.h
+++ b/vcl/inc/vcl/toolbox.h
@@ -37,6 +37,7 @@
#include <vcl/image.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/controllayout.hxx>
+#include <vcl/ImageListProvider.hxx>
#include <vector>
@@ -127,7 +128,9 @@ struct ToolBoxLayoutData : public ControlLayoutData
std::vector< USHORT > m_aLineItemPositions;
};
-}
+
+} /* namespace vcl */
+
struct ImplToolBoxPrivateData
{
@@ -160,6 +163,10 @@ struct ImplToolBoxPrivateData
Wallpaper maDisplayBackground;
+ // support for highcontrast
+ vcl::IImageListProvider* mpImageListProvider;
+ vcl::ImageListType meImageListType;
+
BOOL mbIsLocked:1, // keeps last lock state from ImplDockingWindowWrapper
mbAssumeDocked:1, // only used during calculations to override current floating/popup mode
mbAssumeFloating:1,
diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx
index 463a2dffb07a..6e4c300ccc40 100644
--- a/vcl/inc/vcl/toolbox.hxx
+++ b/vcl/inc/vcl/toolbox.hxx
@@ -47,6 +47,11 @@ struct ImplToolBoxPrivateData;
class ImplTrackRect;
class PopupMenu;
+namespace vcl
+{
+ class IImageListProvider;
+}
+
// -------------------------
// - ToolBoxCustomizeEvent -
// -------------------------
@@ -299,6 +304,7 @@ private:
SAL_DLLPRIVATE ToolBox (const ToolBox &);
SAL_DLLPRIVATE ToolBox& operator= (const ToolBox &);
+ SAL_DLLPRIVATE void ImplUpdateImageList(); // called if StateChanged
public:
SAL_DLLPRIVATE void ImplFloatControl( BOOL bStart, FloatingWindow* pWindow = NULL );
SAL_DLLPRIVATE void ImplDisableFlatButtons();
@@ -632,6 +638,8 @@ public:
const Size& GetDefaultImageSize() const;
void ChangeHighlight( USHORT nPos );
+
+ void SetImageListProvider(vcl::IImageListProvider* _pProvider);
};
inline void ToolBox::CheckItem( USHORT nItemId, BOOL bCheck )
diff --git a/vcl/os2/inc/salgdi.h b/vcl/os2/inc/salgdi.h
index 5e70f50ada79..1fb51f089100 100644
--- a/vcl/os2/inc/salgdi.h
+++ b/vcl/os2/inc/salgdi.h
@@ -328,6 +328,7 @@ public:
virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
virtual SystemGraphicsData GetGraphicsData() const;
+ virtual SystemFontData GetSysFontData( int nFallbacklevel ) const;
};
// Init/Deinit Graphics
diff --git a/vcl/os2/source/gdi/salgdi3.cxx b/vcl/os2/source/gdi/salgdi3.cxx
index 15034168269e..573fa7336fb0 100644
--- a/vcl/os2/source/gdi/salgdi3.cxx
+++ b/vcl/os2/source/gdi/salgdi3.cxx
@@ -74,15 +74,14 @@
#include <ft2lib.h>
#endif
-#ifndef __SUBFONT_H
-#include <list.h>
-#include <sft.h>
-#endif
+#include "sft.hxx"
#ifdef GCP_KERN_HACK
#include <algorithm>
#endif
+using namespace vcl;
+
// -----------
// - Inlines -
// -----------
@@ -1755,3 +1754,21 @@ void Os2SalGraphics::DrawServerFontLayout( const ServerFontLayout& )
//--------------------------------------------------------------------------
+SystemFontData Os2SalGraphics::GetSysFontData( int nFallbacklevel ) const
+{
+ SystemFontData aSysFontData;
+
+ if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1;
+ if (nFallbacklevel < 0 ) nFallbacklevel = 0;
+
+ aSysFontData.nSize = sizeof( SystemFontData );
+ aSysFontData.hFont = mhFonts[nFallbacklevel];
+ aSysFontData.bFakeBold = false;
+ aSysFontData.bFakeItalic = false;
+ aSysFontData.bAntialias = true;
+ aSysFontData.bVerticalCharacterType = false;
+
+ return aSysFontData;
+}
+
+//--------------------------------------------------------------------------
diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst
index 8a894cba2e55..cd6d32dc3d2a 100644
--- a/vcl/prj/build.lst
+++ b/vcl/prj/build.lst
@@ -1,4 +1,4 @@
-vc vcl : apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools transex3 icc SO:print_header NULL
+vc vcl : apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools transex3 icc SO:print_header cpputools NULL
vc vcl usr1 - all vc_mkout NULL
vc vcl\inc nmake - all vc_inc NULL
vc vcl\source\glyphs nmake - all vc_glyphs vc_inc NULL
diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst
index 2b4b1c080838..0d349044a09a 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -147,10 +147,10 @@ mkdir: %_DEST%\inc%_EXT%\vcl\plug\vcl
..\inc\vcl\pngwrite.hxx %_DEST%\inc%_EXT%\vcl\pngwrite.hxx
..\inc\vcl\smartid.hxx %_DEST%\inc%_EXT%\vcl\smartid.hxx
..\inc\vcl\configsettings.hxx %_DEST%\inc%_EXT%\vcl\configsettings.hxx
+..\inc\vcl\ImageListProvider.hxx %_DEST%\inc%_EXT%\vcl\ImageListProvider.hxx
..\inc\vcl\fontmanager.hxx %_DEST%\inc%_EXT%\vcl\fontmanager.hxx
..\inc\vcl\printerinfomanager.hxx %_DEST%\inc%_EXT%\vcl\printerinfomanager.hxx
..\inc\vcl\jobdata.hxx %_DEST%\inc%_EXT%\vcl\jobdata.hxx
..\inc\vcl\ppdparser.hxx %_DEST%\inc%_EXT%\vcl\ppdparser.hxx
..\inc\vcl\helper.hxx %_DEST%\inc%_EXT%\vcl\helper.hxx
..\inc\vcl\strhelper.hxx %_DEST%\inc%_EXT%\vcl\strhelper.hxx
-
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index edfd6a24bff9..21e1f34c1ef5 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -117,6 +117,20 @@ void ImplInitSVData()
pImplSVData->maHelpData.mbAutoHelpId = sal_True;
pImplSVData->maHelpData.mbAutoHelpId = sal_True;
pImplSVData->maNWFData.maMenuBarHighlightTextColor = Color( COL_TRANSPARENT );
+
+ // find out whether we are running in the testtool
+ // in this case we need some special workarounds
+ sal_uInt32 nArgs = osl_getCommandArgCount();
+ for( sal_uInt32 i = 0; i < nArgs; i++ )
+ {
+ rtl::OUString aArg;
+ osl_getCommandArg( i, &aArg.pData );
+ if( aArg.equalsAscii( "-enableautomation" ) )
+ {
+ pImplSVData->mbIsTestTool = true;
+ break;
+ }
+ }
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 3a0c2af0e852..2e2342fc6fc8 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -794,6 +794,15 @@ void Button::DataChanged( const DataChangedEvent& rDCEvt )
}
}
+void Button::SetSmallSymbol (bool small)
+{
+ ImplSetSmallSymbol (small);
+}
+
+bool Button::IsSmallSymbol () const
+{
+ return mpButtonData->mbSmallSymbol;
+}
// =======================================================================
@@ -1964,7 +1973,12 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const
Size aSize;
if ( IsSymbol() )
- aSize = Size( 12, 12 );
+ {
+ if ( IsSmallSymbol ())
+ aSize = Size( 16, 12 );
+ else
+ aSize = Size( 26, 24 );
+ }
else if ( IsImage() && ! (ImplGetButtonState() & BUTTON_DRAW_NOIMAGE) )
aSize = GetModeImage().GetSizePixel();
if ( PushButton::GetText().Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 3834e4de8677..5f41a441c6a1 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2903,8 +2903,8 @@ PopupMenu* Edit::CreatePopupMenu()
pPopup->SetAccelKey( SV_MENU_EDIT_COPY, KeyCode( KEYFUNC_COPY ) );
pPopup->SetAccelKey( SV_MENU_EDIT_PASTE, KeyCode( KEYFUNC_PASTE ) );
pPopup->SetAccelKey( SV_MENU_EDIT_DELETE, KeyCode( KEYFUNC_DELETE ) );
- pPopup->SetAccelKey( SV_MENU_EDIT_SELECTALL, KeyCode( KEY_A, FALSE, TRUE, FALSE ) );
- pPopup->SetAccelKey( SV_MENU_EDIT_INSERTSYMBOL, KeyCode( KEY_S, TRUE, TRUE, FALSE ) );
+ pPopup->SetAccelKey( SV_MENU_EDIT_SELECTALL, KeyCode( KEY_A, FALSE, TRUE, FALSE, FALSE ) );
+ pPopup->SetAccelKey( SV_MENU_EDIT_INSERTSYMBOL, KeyCode( KEY_S, TRUE, TRUE, FALSE, FALSE ) );
return pPopup;
}
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index c717e491d7b2..a25ddbb68e8b 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -1124,7 +1124,7 @@ BOOL ImplListBoxWindow::SelectEntries( USHORT nSelect, LB_EVENT_TYPE eLET, BOOL
mpEntryList->SetSelectionAnchor( nSelect );
}
// MultiListBox nur mit CTRL/SHIFT oder nicht im SimpleMode
- else if( ( !mbSimpleMode /* && !bShift */ ) || ( mbSimpleMode && ( bCtrl || bShift ) || mbStackMode ) )
+ else if( ( !mbSimpleMode /* && !bShift */ ) || ( (mbSimpleMode && ( bCtrl || bShift )) || mbStackMode ) )
{
// Space fuer Selektionswechsel
if( !bShift && ( ( eLET == LET_KEYSPACE ) || ( eLET == LET_MBDOWN ) ) )
diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx
index e6930edeba95..6d4777013a73 100644
--- a/vcl/source/control/imgctrl.cxx
+++ b/vcl/source/control/imgctrl.cxx
@@ -103,13 +103,28 @@ void ImageControl::UserDraw( const UserDrawEvent& rUDEvt )
// nStyle |= IMAGE_DRAW_COLORTRANSFORM;
}
+ if ( !*pBitmap )
+ {
+ String sText( GetText() );
+ if ( !sText.Len() )
+ return;
+
+ WinBits nWinStyle = GetStyle();
+ USHORT nTextStyle = FixedText::ImplGetTextStyle( nWinStyle );
+ if ( !IsEnabled() )
+ nTextStyle |= TEXT_DRAW_DISABLE;
+
+ DrawText( rUDEvt.GetRect(), sText, nTextStyle );
+ return;
+ }
+
const Rectangle& rPaintRect = rUDEvt.GetRect();
const Size& rBitmapSize = maBmp.GetSizePixel();
if( nStyle & IMAGE_DRAW_COLORTRANSFORM )
{
// only images support IMAGE_DRAW_COLORTRANSFORM
- Image aImage( maBmp );
+ Image aImage( *pBitmap );
if ( !!aImage )
{
switch ( mnScaleMode )
@@ -153,29 +168,29 @@ void ImageControl::UserDraw( const UserDrawEvent& rUDEvt )
{
case ImageScaleMode::None:
{
- maBmp.Draw( rUDEvt.GetDevice(), lcl_centerWithin( rPaintRect, rBitmapSize ) );
+ pBitmap->Draw( rUDEvt.GetDevice(), lcl_centerWithin( rPaintRect, rBitmapSize ) );
}
break;
case ImageScaleMode::Isotropic:
{
const Size aPaintSize = lcl_calcPaintSize( rPaintRect, rBitmapSize );
- maBmp.Draw( rUDEvt.GetDevice(),
- lcl_centerWithin( rPaintRect, aPaintSize ),
- aPaintSize );
+ pBitmap->Draw( rUDEvt.GetDevice(),
+ lcl_centerWithin( rPaintRect, aPaintSize ),
+ aPaintSize );
}
break;
case ImageScaleMode::Anisotropic:
{
- maBmp.Draw( rUDEvt.GetDevice(),
- rPaintRect.TopLeft(),
- rPaintRect.GetSize() );
+ pBitmap->Draw( rUDEvt.GetDevice(),
+ rPaintRect.TopLeft(),
+ rPaintRect.GetSize() );
}
break;
default:
- OSL_ENSURE( false, "ImageControl::UserDraw: unhandled scale mode!" );
+ OSL_ENSURE( false, "ImageControl::UserDraw: unhandled scale mode!" );
break;
} // switch ( mnScaleMode )
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index 0accd17489c9..66722b70eef8 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -604,18 +604,18 @@ BOOL ListBox::IsDDAutoWidthEnabled() const
void ListBox::SetDropDownLineCount( USHORT nLines )
{
+ mnLineCount = nLines;
if ( mpFloatWin )
- mpFloatWin->SetDropDownLineCount( nLines );
+ mpFloatWin->SetDropDownLineCount( mnLineCount );
}
// -----------------------------------------------------------------------
USHORT ListBox::GetDropDownLineCount() const
{
- USHORT nLines = 0;
if ( mpFloatWin )
- nLines = mpFloatWin->GetDropDownLineCount();
- return nLines;
+ return mpFloatWin->GetDropDownLineCount();
+ return mnLineCount;
}
// -----------------------------------------------------------------------
@@ -1260,9 +1260,7 @@ Size ListBox::CalcMinimumSize() const
{
Size aSz;
if ( !IsDropDownBox() )
- {
- aSz = mpImplLB->CalcSize( mpImplLB->GetEntryList()->GetEntryCount() );
- }
+ aSz = mpImplLB->CalcSize (mnLineCount ? mnLineCount : mpImplLB->GetEntryList()->GetEntryCount());
else
{
aSz.Height() = mpImplLB->CalcSize( 1 ).Height();
diff --git a/vcl/source/fontsubset/crc32.c b/vcl/source/fontsubset/crc32.c
deleted file mode 100644
index 386b873a011c..000000000000
--- a/vcl/source/fontsubset/crc32.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: crc32.c,v $
- * $Revision: 1.3 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* $Id: crc32.c,v 1.3 2008-04-11 10:13:50 rt Exp $ */
-
-/**
- *
- * @file crc32.c
- * @brief CRC-32 calculation function
- * @author Alexander Gelfenbain
- */
-
-#include "sft.h"
-#include "crc32.h"
-
-static uint32 crcTable[256] = {
- 0x00000000UL, 0x77073096UL, 0xEE0E612CUL, 0x990951BAUL, 0x076DC419UL, 0x706AF48FUL, 0xE963A535UL, 0x9E6495A3UL,
- 0x0EDB8832UL, 0x79DCB8A4UL, 0xE0D5E91EUL, 0x97D2D988UL, 0x09B64C2BUL, 0x7EB17CBDUL, 0xE7B82D07UL, 0x90BF1D91UL,
- 0x1DB71064UL, 0x6AB020F2UL, 0xF3B97148UL, 0x84BE41DEUL, 0x1ADAD47DUL, 0x6DDDE4EBUL, 0xF4D4B551UL, 0x83D385C7UL,
- 0x136C9856UL, 0x646BA8C0UL, 0xFD62F97AUL, 0x8A65C9ECUL, 0x14015C4FUL, 0x63066CD9UL, 0xFA0F3D63UL, 0x8D080DF5UL,
- 0x3B6E20C8UL, 0x4C69105EUL, 0xD56041E4UL, 0xA2677172UL, 0x3C03E4D1UL, 0x4B04D447UL, 0xD20D85FDUL, 0xA50AB56BUL,
- 0x35B5A8FAUL, 0x42B2986CUL, 0xDBBBC9D6UL, 0xACBCF940UL, 0x32D86CE3UL, 0x45DF5C75UL, 0xDCD60DCFUL, 0xABD13D59UL,
- 0x26D930ACUL, 0x51DE003AUL, 0xC8D75180UL, 0xBFD06116UL, 0x21B4F4B5UL, 0x56B3C423UL, 0xCFBA9599UL, 0xB8BDA50FUL,
- 0x2802B89EUL, 0x5F058808UL, 0xC60CD9B2UL, 0xB10BE924UL, 0x2F6F7C87UL, 0x58684C11UL, 0xC1611DABUL, 0xB6662D3DUL,
- 0x76DC4190UL, 0x01DB7106UL, 0x98D220BCUL, 0xEFD5102AUL, 0x71B18589UL, 0x06B6B51FUL, 0x9FBFE4A5UL, 0xE8B8D433UL,
- 0x7807C9A2UL, 0x0F00F934UL, 0x9609A88EUL, 0xE10E9818UL, 0x7F6A0DBBUL, 0x086D3D2DUL, 0x91646C97UL, 0xE6635C01UL,
- 0x6B6B51F4UL, 0x1C6C6162UL, 0x856530D8UL, 0xF262004EUL, 0x6C0695EDUL, 0x1B01A57BUL, 0x8208F4C1UL, 0xF50FC457UL,
- 0x65B0D9C6UL, 0x12B7E950UL, 0x8BBEB8EAUL, 0xFCB9887CUL, 0x62DD1DDFUL, 0x15DA2D49UL, 0x8CD37CF3UL, 0xFBD44C65UL,
- 0x4DB26158UL, 0x3AB551CEUL, 0xA3BC0074UL, 0xD4BB30E2UL, 0x4ADFA541UL, 0x3DD895D7UL, 0xA4D1C46DUL, 0xD3D6F4FBUL,
- 0x4369E96AUL, 0x346ED9FCUL, 0xAD678846UL, 0xDA60B8D0UL, 0x44042D73UL, 0x33031DE5UL, 0xAA0A4C5FUL, 0xDD0D7CC9UL,
- 0x5005713CUL, 0x270241AAUL, 0xBE0B1010UL, 0xC90C2086UL, 0x5768B525UL, 0x206F85B3UL, 0xB966D409UL, 0xCE61E49FUL,
- 0x5EDEF90EUL, 0x29D9C998UL, 0xB0D09822UL, 0xC7D7A8B4UL, 0x59B33D17UL, 0x2EB40D81UL, 0xB7BD5C3BUL, 0xC0BA6CADUL,
- 0xEDB88320UL, 0x9ABFB3B6UL, 0x03B6E20CUL, 0x74B1D29AUL, 0xEAD54739UL, 0x9DD277AFUL, 0x04DB2615UL, 0x73DC1683UL,
- 0xE3630B12UL, 0x94643B84UL, 0x0D6D6A3EUL, 0x7A6A5AA8UL, 0xE40ECF0BUL, 0x9309FF9DUL, 0x0A00AE27UL, 0x7D079EB1UL,
- 0xF00F9344UL, 0x8708A3D2UL, 0x1E01F268UL, 0x6906C2FEUL, 0xF762575DUL, 0x806567CBUL, 0x196C3671UL, 0x6E6B06E7UL,
- 0xFED41B76UL, 0x89D32BE0UL, 0x10DA7A5AUL, 0x67DD4ACCUL, 0xF9B9DF6FUL, 0x8EBEEFF9UL, 0x17B7BE43UL, 0x60B08ED5UL,
- 0xD6D6A3E8UL, 0xA1D1937EUL, 0x38D8C2C4UL, 0x4FDFF252UL, 0xD1BB67F1UL, 0xA6BC5767UL, 0x3FB506DDUL, 0x48B2364BUL,
- 0xD80D2BDAUL, 0xAF0A1B4CUL, 0x36034AF6UL, 0x41047A60UL, 0xDF60EFC3UL, 0xA867DF55UL, 0x316E8EEFUL, 0x4669BE79UL,
- 0xCB61B38CUL, 0xBC66831AUL, 0x256FD2A0UL, 0x5268E236UL, 0xCC0C7795UL, 0xBB0B4703UL, 0x220216B9UL, 0x5505262FUL,
- 0xC5BA3BBEUL, 0xB2BD0B28UL, 0x2BB45A92UL, 0x5CB36A04UL, 0xC2D7FFA7UL, 0xB5D0CF31UL, 0x2CD99E8BUL, 0x5BDEAE1DUL,
- 0x9B64C2B0UL, 0xEC63F226UL, 0x756AA39CUL, 0x026D930AUL, 0x9C0906A9UL, 0xEB0E363FUL, 0x72076785UL, 0x05005713UL,
- 0x95BF4A82UL, 0xE2B87A14UL, 0x7BB12BAEUL, 0x0CB61B38UL, 0x92D28E9BUL, 0xE5D5BE0DUL, 0x7CDCEFB7UL, 0x0BDBDF21UL,
- 0x86D3D2D4UL, 0xF1D4E242UL, 0x68DDB3F8UL, 0x1FDA836EUL, 0x81BE16CDUL, 0xF6B9265BUL, 0x6FB077E1UL, 0x18B74777UL,
- 0x88085AE6UL, 0xFF0F6A70UL, 0x66063BCAUL, 0x11010B5CUL, 0x8F659EFFUL, 0xF862AE69UL, 0x616BFFD3UL, 0x166CCF45UL,
- 0xA00AE278UL, 0xD70DD2EEUL, 0x4E048354UL, 0x3903B3C2UL, 0xA7672661UL, 0xD06016F7UL, 0x4969474DUL, 0x3E6E77DBUL,
- 0xAED16A4AUL, 0xD9D65ADCUL, 0x40DF0B66UL, 0x37D83BF0UL, 0xA9BCAE53UL, 0xDEBB9EC5UL, 0x47B2CF7FUL, 0x30B5FFE9UL,
- 0xBDBDF21CUL, 0xCABAC28AUL, 0x53B39330UL, 0x24B4A3A6UL, 0xBAD03605UL, 0xCDD70693UL, 0x54DE5729UL, 0x23D967BFUL,
- 0xB3667A2EUL, 0xC4614AB8UL, 0x5D681B02UL, 0x2A6F2B94UL, 0xB40BBE37UL, 0xC30C8EA1UL, 0x5A05DF1BUL, 0x2D02EF8DUL
-};
-
-uint32 crc32(const void *ptr, size_t len)
-{
- uint32 crc = 0xFFFFFFFF;
- const byte *bp = (const byte *) ptr;
- size_t i;
-
- for (i=0; i<len; i++) {
- crc = crcTable[(crc ^ bp[i]) & 0xFF] ^ (crc >> 8);
- }
-
- return crc ^ 0xFFFFFFFF;
-}
diff --git a/vcl/source/fontsubset/crc32.h b/vcl/source/fontsubset/crc32.h
deleted file mode 100644
index fa9ef71a1432..000000000000
--- a/vcl/source/fontsubset/crc32.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: crc32.h,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* $Id: crc32.h,v 1.4 2008-04-11 10:14:08 rt Exp $ */
-
-/**
- *
- * @file crc32.h
- * @brief CRC-32 calculation function
- * @author Alexander Gelfenbain
- */
-
-#ifdef __cplusplus
-extern "C"{
-#endif
- sal_Int32 crc32(const void *ptr, sal_Int32 len);
-#ifdef __cplusplus
-}
-#endif
diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx
index e73ccccc12a4..9715e7fc8585 100644
--- a/vcl/source/fontsubset/gsub.cxx
+++ b/vcl/source/fontsubset/gsub.cxx
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: gsub.cxx,v $
- * $Revision: 1.12.18.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -31,9 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include "sft.h"
-#undef true
-#undef false
+#include "sft.hxx"
#include "gsub.h"
@@ -41,6 +36,9 @@
#include <map>
#include <algorithm>
+namespace vcl
+{
+
typedef sal_uInt32 ULONG;
typedef sal_uInt16 USHORT;
typedef sal_uInt8 FT_Byte;
@@ -355,3 +353,5 @@ int HasVerticalGSUB( struct _TrueTypeFont* pTTFile )
GlyphSubstitution* pGlyphSubstitution = (GlyphSubstitution*)pTTFile->pGSubstitution;
return pGlyphSubstitution ? +1 : 0;
}
+
+}
diff --git a/vcl/source/fontsubset/gsub.h b/vcl/source/fontsubset/gsub.h
index c64b2abb7e00..58b5b69c3e25 100644
--- a/vcl/source/fontsubset/gsub.h
+++ b/vcl/source/fontsubset/gsub.h
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: gsub.h,v $
- * $Revision: 1.6.18.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -31,20 +28,17 @@
#ifndef _PSP_GSUB_H
#define _PSP_GSUB_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+namespace vcl
+{
-int HasVerticalGSUB( struct _TrueTypeFont* pTTFile );
+int HasVerticalGSUB( struct vcl::_TrueTypeFont* pTTFile );
-int UseGSUB( struct _TrueTypeFont* pTTFile, int nGlyph, int wmode );
+int UseGSUB( struct vcl::_TrueTypeFont* pTTFile, int nGlyph, int wmode );
-int ReadGSUB( struct _TrueTypeFont* pTTFile, int nRequestedScript, int nRequestedLangsys );
+int ReadGSUB( struct vcl::_TrueTypeFont* pTTFile, int nRequestedScript, int nRequestedLangsys );
-void ReleaseGSUB( struct _TrueTypeFont* pTTFile );
+void ReleaseGSUB( struct vcl::_TrueTypeFont* pTTFile );
-#ifdef __cplusplus
}
-#endif
#endif /* _PSP_GSUB_H */
diff --git a/vcl/source/fontsubset/list.c b/vcl/source/fontsubset/list.c
index 83ebe8595a46..86864650db85 100644
--- a/vcl/source/fontsubset/list.c
+++ b/vcl/source/fontsubset/list.c
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: list.c,v $
- * $Revision: 1.8 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,8 +25,6 @@
*
************************************************************************/
-/* $Id: list.c,v 1.8 2008-06-25 14:19:44 kz Exp $ */
-
/*[]---------------------------------------------------[]*/
/*| |*/
/*| list.c - bidirectional list class |*/
@@ -67,7 +62,7 @@ typedef struct _lnode {
struct _list {
lnode *head, *tail, *cptr;
size_t aCount;
- void (*eDtor)(void *);
+ list_destructor eDtor;
};
/*- private methods */
@@ -177,7 +172,7 @@ void listDispose(list this) /*- dtor */
free(this);
}
-void listSetElementDtor(list this, void (*f)(void *))
+void listSetElementDtor(list this, list_destructor f)
{
assert(this != 0);
this->eDtor = f;
diff --git a/vcl/source/fontsubset/makefile.mk b/vcl/source/fontsubset/makefile.mk
index b1d2552752a8..b7d719f3c912 100644
--- a/vcl/source/fontsubset/makefile.mk
+++ b/vcl/source/fontsubset/makefile.mk
@@ -6,10 +6,6 @@
#
# OpenOffice.org - a multi-platform office productivity suite
#
-# $RCSfile: makefile.mk,v $
-#
-# $Revision: 1.6 $
-#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/vcl/source/fontsubset/sft.c b/vcl/source/fontsubset/sft.cxx
index be54a872fd7f..10d4cf774b04 100644
--- a/vcl/source/fontsubset/sft.c
+++ b/vcl/source/fontsubset/sft.cxx
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: sft.c,v $
- * $Revision: 1.47.4.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -49,32 +46,33 @@
#include <sys/mman.h>
#include <sys/stat.h>
#endif
-#include "sft.h"
+#include "sft.hxx"
#include "gsub.h"
#if ! (defined(NO_TTCR) && defined(NO_TYPE42))
-#include "ttcr.h"
-#endif
-#ifdef NO_LIST
-#include "list.h" /* list.h does not get included in the sft.h */
+#include "ttcr.hxx"
#endif
#ifndef NO_MAPPERS /* include MapChar() and MapString() */
-#include "xlat.h"
+#include "xlat.hxx"
#endif
#ifndef NO_TYPE3 /* include CreateT3FromTTGlyphs() */
#include <rtl/crc.h>
#endif
#include <osl/endian.h>
+#include <algorithm>
#ifdef TEST7
#include <ctype.h>
#endif
+namespace vcl
+{
+
/*- module identification */
-const char *modname = "SunTypeTools-TT";
-const char *modver = "1.0";
-const char *modextra = "gelf";
+static const char *modname = "SunTypeTools-TT";
+static const char *modver = "1.0";
+static const char *modextra = "gelf";
/*- private functions, constants and data types */ /*FOLD00*/
@@ -86,12 +84,20 @@ enum PathSegmentType {
PS_CLOSEPATH = 4
};
-typedef struct {
- int type;
+struct PSPathElement
+{
+ PathSegmentType type;
int x1, y1;
int x2, y2;
int x3, y3;
-} PSPathElement;
+
+ PSPathElement( PathSegmentType i_eType ) : type( i_eType ),
+ x1( 0 ), y1( 0 ),
+ x2( 0 ), y2( 0 ),
+ x3( 0 ), y3( 0 )
+ {
+ }
+};
/*- In horisontal writing mode right sidebearing is calculated using this formula
*- rsb = aw - (lsb + xMax - xMin) -*/
@@ -412,7 +418,7 @@ _inline const char *UnicodeRangeName(sal_uInt16 bit)
_inline sal_uInt8 *getTable(TrueTypeFont *ttf, sal_uInt32 ord)
{
- return ttf->tables[ord];
+ return (sal_uInt8*)ttf->tables[ord];
}
_inline sal_uInt32 getTableSize(TrueTypeFont *ttf, sal_uInt32 ord)
@@ -426,7 +432,7 @@ static char HexChars[] = "0123456789ABCDEF";
static HexFmt *HexFmtNew(FILE *outf)
{
- HexFmt *res = smalloc(sizeof(HexFmt));
+ HexFmt* res = (HexFmt*)smalloc(sizeof(HexFmt));
res->bufpos = res->total = 0;
res->o = outf;
return res;
@@ -515,7 +521,7 @@ static void GetMetrics(TrueTypeFont *ttf, sal_uInt32 glyphID, TTGlyphMetrics *me
}
}
-static int GetTTGlyphOutline(TrueTypeFont *, sal_uInt32 , ControlPoint **, TTGlyphMetrics *, list );
+static int GetTTGlyphOutline(TrueTypeFont *, sal_uInt32 , ControlPoint **, TTGlyphMetrics *, std::vector< sal_uInt32 >* );
/* returns the number of control points, allocates the pointArray */
static int GetSimpleTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint **pointArray, TTGlyphMetrics *metrics) /*FOLD02*/
@@ -525,7 +531,6 @@ static int GetSimpleTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoin
sal_Int16 numberOfContours;
sal_uInt16 t, instLen, lastPoint=0;
int i, j, z;
- ControlPoint* pa;
*pointArray = 0;
@@ -551,7 +556,7 @@ static int GetSimpleTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoin
instLen = GetUInt16(ptr, 10 + numberOfContours*2, 1);
p = ptr + 10 + 2 * numberOfContours + 2 + instLen;
- pa = calloc(lastPoint+1, sizeof(ControlPoint));
+ ControlPoint* pa = (ControlPoint*)calloc(lastPoint+1, sizeof(ControlPoint));
i = 0;
while (i <= lastPoint) {
@@ -608,13 +613,13 @@ static int GetSimpleTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoin
return lastPoint + 1;
}
-static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint **pointArray, TTGlyphMetrics *metrics, list glyphlist) /*FOLD02*/
+static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint **pointArray, TTGlyphMetrics *metrics, std::vector< sal_uInt32 >& glyphlist) /*FOLD02*/
{
sal_uInt16 flags, index;
sal_Int16 e, f, numberOfContours;
sal_uInt8 *table = getTable(ttf, O_glyf);
sal_uInt8 *ptr;
- list myPoints;
+ std::vector<ControlPoint> myPoints;
ControlPoint *nextComponent, *pa;
int i, np;
F16Dot16 a = 0x10000, b = 0, c = 0, d = 0x10000, m, n, abs1, abs2, abs3;
@@ -630,9 +635,6 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
return 0;
}
- myPoints = listNewEmpty();
- listSetElementDtor(myPoints, free);
-
if (metrics) {
metrics->xMin = GetInt16(ptr, 2, 1);
metrics->yMin = GetInt16(ptr, 4, 1);
@@ -649,27 +651,30 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
index = GetUInt16(ptr, 2, 1);
ptr += 4;
- if (listFind(glyphlist, (void *) (sal_IntPtr) index)) {
+ if( std::find( glyphlist.begin(), glyphlist.end(), index ) != glyphlist.end() )
+ {
#if OSL_DEBUG_LEVEL > 1
fprintf(stderr, "Endless loop found in a compound glyph.\n");
fprintf(stderr, "%d -> ", index);
- listToFirst(glyphlist);
fprintf(stderr," [");
- do {
- fprintf(stderr,"%d ", (int) listCurrent(glyphlist));
- } while (listNext(glyphlist));
+ for( std::vector< sal_uInt32 >::const_iterator it = glyphlist.begin();
+ it != glyphlist.end(); ++it )
+ {
+ fprintf( stderr,"%d ", (int) *it );
+ }
fprintf(stderr,"]\n");
/**/
#endif
}
- listAppend(glyphlist, (void *) (sal_IntPtr) index);
+ glyphlist.push_back( index );
#ifdef DEBUG2
fprintf(stderr,"glyphlist: += %d\n", index);
#endif
- if ((np = GetTTGlyphOutline(ttf, index, &nextComponent, 0, glyphlist)) == 0) {
+ if ((np = GetTTGlyphOutline(ttf, index, &nextComponent, 0, &glyphlist)) == 0)
+ {
/* XXX that probably indicates a corrupted font */
#if OSL_DEBUG_LEVEL > 1
fprintf(stderr, "An empty compound!\n");
@@ -677,20 +682,20 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
#endif
}
- listToLast(glyphlist);
#ifdef DEBUG2
- listToFirst(glyphlist);
- fprintf(stderr,"%d [", listCount(glyphlist));
- if (!listIsEmpty(glyphlist)) {
- do {
- fprintf(stderr,"%d ", (int) listCurrent(glyphlist));
- } while (listNext(glyphlist));
+ fprintf(stderr,"%d [", (int)glyphlist.size() );
+ for( std::vector< sal_uInt32 >::const_iterator it = glyphlist.begin();
+ it != glyphlist.end(); ++it )
+ {
+ fprintf( stderr,"%d ", (int) *it );
}
fprintf(stderr, "]\n");
- fprintf(stderr, "glyphlist: -= %d\n", (int) listCurrent(glyphlist));
+ if( ! glyphlist.empty() )
+ fprintf(stderr, "glyphlist: -= %d\n", (int) glyphlist.back());
#endif
- listRemove(glyphlist);
+ if( ! glyphlist.empty() )
+ glyphlist.pop_back();
if (flags & USE_MY_METRICS) {
if (metrics) GetMetrics(ttf, index, metrics);
@@ -774,18 +779,18 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
for (i=0; i<np; i++) {
F16Dot16 t;
- ControlPoint *cp = malloc(sizeof(ControlPoint));
- cp->flags = nextComponent[i].flags;
+ ControlPoint cp;
+ cp.flags = nextComponent[i].flags;
t = fixedMulDiv(a, nextComponent[i].x << 16, m) + fixedMulDiv(c, nextComponent[i].y << 16, m) + (e << 16);
- cp->x = (sal_Int16)(fixedMul(t, m) >> 16);
+ cp.x = (sal_Int16)(fixedMul(t, m) >> 16);
t = fixedMulDiv(b, nextComponent[i].x << 16, n) + fixedMulDiv(d, nextComponent[i].y << 16, n) + (f << 16);
- cp->y = (sal_Int16)(fixedMul(t, n) >> 16);
+ cp.y = (sal_Int16)(fixedMul(t, n) >> 16);
#ifdef DEBUG2
- fprintf(stderr, "( %d %d ) -> ( %d %d )\n", nextComponent[i].x, nextComponent[i].y, cp->x, cp->y);
+ fprintf(stderr, "( %d %d ) -> ( %d %d )\n", nextComponent[i].x, nextComponent[i].y, cp.x, cp.y);
#endif
- listAppend(myPoints, cp);
+ myPoints.push_back( cp );
}
free(nextComponent);
@@ -794,16 +799,12 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
- np = listCount(myPoints);
+ np = myPoints.size();
- pa = calloc(np, sizeof(ControlPoint));
+ pa = (ControlPoint*)calloc(np, sizeof(ControlPoint));
assert(pa != 0);
- listToFirst(myPoints);
- for (i=0; i<np; i++) {
- memcpy(pa+i, listCurrent(myPoints), sizeof(ControlPoint));
- listNext(myPoints);
- }
- listDispose(myPoints);
+
+ memcpy( pa, &myPoints[0], np*sizeof(ControlPoint) );
*pointArray = pa;
return np;
@@ -816,7 +817,7 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
* a composite glyph. This is a safequard against endless recursion
* in corrupted fonts.
*/
-static int GetTTGlyphOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint **pointArray, TTGlyphMetrics *metrics, list glyphlist)
+static int GetTTGlyphOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint **pointArray, TTGlyphMetrics *metrics, std::vector< sal_uInt32 >* glyphlist)
{
sal_uInt8 *ptr, *table = getTable(ttf, O_glyf);
sal_Int16 numberOfContours;
@@ -840,21 +841,15 @@ static int GetTTGlyphOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint
numberOfContours = GetInt16(ptr, 0, 1);
- if (numberOfContours >= 0) {
+ if (numberOfContours >= 0)
+ {
res=GetSimpleTTOutline(ttf, glyphID, pointArray, metrics);
- } else {
- int glyphlistFlag = 0;
- if (!glyphlist) {
- glyphlistFlag = 1;
- glyphlist = listNewEmpty();
- listAppend(glyphlist, (void *) (sal_IntPtr) glyphID);
- }
- res = GetCompoundTTOutline(ttf, glyphID, pointArray, metrics, glyphlist);
- if (glyphlistFlag) {
- glyphlistFlag = 0;
- listDispose(glyphlist);
- glyphlist = 0;
- }
+ }
+ else
+ {
+ std::vector< sal_uInt32 > aPrivList;
+ aPrivList.push_back( glyphID );
+ res = GetCompoundTTOutline(ttf, glyphID, pointArray, metrics, glyphlist ? *glyphlist : aPrivList );
}
#ifdef DEBUG3
@@ -877,22 +872,13 @@ static int GetTTGlyphOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint
#ifndef NO_TYPE3
-static PSPathElement *newPSPathElement(int t)
-{
- PSPathElement *p = malloc(sizeof(PSPathElement));
- assert(p != 0);
-
- p->type = t;
- return p;
-}
-
/*- returns the number of items in the path -*/
static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **path)
{
- list pList = listNewEmpty();
- int i = 0, pCount = 0;
- PSPathElement *p;
+ std::vector< PSPathElement > aPathList;
+ int nPathCount = 0;
+ PSPathElement p( PS_NOOP );
int x0 = 0, y0 = 0, x1 = 0, y1 = 0, x2, y2, curx, cury;
int lastOff = 0; /*- last point was off-contour */
@@ -901,7 +887,6 @@ static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **pat
int cp = 0; /*- current point */
int StartContour = 0, EndContour = 1;
- listSetElementDtor(pList, free);
*path = 0;
/* if (srcCount > 0) for(;;) */
@@ -919,21 +904,21 @@ static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **pat
break;
}
}
- p = newPSPathElement(PS_MOVETO);
+ p = PSPathElement(PS_MOVETO);
if (!(srcA[cp].flags & 1)) {
if (!(srcA[EndContour].flags & 1)) {
- p->x1 = x0 = (srcA[cp].x + srcA[EndContour].x + 1) / 2;
- p->y1 = y0 = (srcA[cp].y + srcA[EndContour].y + 1) / 2;
+ p.x1 = x0 = (srcA[cp].x + srcA[EndContour].x + 1) / 2;
+ p.y1 = y0 = (srcA[cp].y + srcA[EndContour].y + 1) / 2;
} else {
- p->x1 = x0 = srcA[EndContour].x;
- p->y1 = y0 = srcA[EndContour].y;
+ p.x1 = x0 = srcA[EndContour].x;
+ p.y1 = y0 = srcA[EndContour].y;
}
} else {
- p->x1 = x0 = srcA[cp].x;
- p->y1 = y0 = srcA[cp].y;
+ p.x1 = x0 = srcA[cp].x;
+ p.y1 = y0 = srcA[cp].y;
cp++;
}
- listAppend(pList, p);
+ aPathList.push_back( p );
lastOff = 0;
scflag = 0;
}
@@ -941,38 +926,45 @@ static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **pat
curx = srcA[cp].x;
cury = srcA[cp].y;
- if (srcA[cp].flags & 1) {
- if (lastOff) {
- p = newPSPathElement(PS_CURVETO);
- p->x1 = x0 + (2 * (x1 - x0) + 1) / 3;
- p->y1 = y0 + (2 * (y1 - y0) + 1) / 3;
- p->x2 = x1 + (curx - x1 + 1) / 3;
- p->y2 = y1 + (cury - y1 + 1) / 3;
- p->x3 = curx;
- p->y3 = cury;
- listAppend(pList, p);
- } else {
- if (!(x0 == curx && y0 == cury)) { /* eliminate empty lines */
- p = newPSPathElement(PS_LINETO);
- p->x1 = curx;
- p->y1 = cury;
- listAppend(pList, p);
+ if (srcA[cp].flags & 1)
+ {
+ if (lastOff)
+ {
+ p = PSPathElement(PS_CURVETO);
+ p.x1 = x0 + (2 * (x1 - x0) + 1) / 3;
+ p.y1 = y0 + (2 * (y1 - y0) + 1) / 3;
+ p.x2 = x1 + (curx - x1 + 1) / 3;
+ p.y2 = y1 + (cury - y1 + 1) / 3;
+ p.x3 = curx;
+ p.y3 = cury;
+ aPathList.push_back( p );
+ }
+ else
+ {
+ if (!(x0 == curx && y0 == cury))
+ { /* eliminate empty lines */
+ p = PSPathElement(PS_LINETO);
+ p.x1 = curx;
+ p.y1 = cury;
+ aPathList.push_back( p );
}
}
-
x0 = curx; y0 = cury; lastOff = 0;
- } else {
- if (lastOff) {
+ }
+ else
+ {
+ if (lastOff)
+ {
x2 = (x1 + curx + 1) / 2;
y2 = (y1 + cury + 1) / 2;
- p = newPSPathElement(PS_CURVETO);
- p->x1 = x0 + (2 * (x1 - x0) + 1) / 3;
- p->y1 = y0 + (2 * (y1 - y0) + 1) / 3;
- p->x2 = x1 + (x2 - x1 + 1) / 3;
- p->y2 = y1 + (y2 - y1 + 1) / 3;
- p->x3 = x2;
- p->y3 = y2;
- listAppend(pList, p);
+ p = PSPathElement(PS_CURVETO);
+ p.x1 = x0 + (2 * (x1 - x0) + 1) / 3;
+ p.y1 = y0 + (2 * (y1 - y0) + 1) / 3;
+ p.x2 = x1 + (x2 - x1 + 1) / 3;
+ p.y2 = y1 + (y2 - y1 + 1) / 3;
+ p.x3 = x2;
+ p.y3 = y2;
+ aPathList.push_back( p );
x0 = x2; y0 = y2;
x1 = curx; y1 = cury;
} else {
@@ -982,7 +974,7 @@ static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **pat
}
if (ecflag) {
- listAppend(pList, newPSPathElement(PS_CLOSEPATH));
+ aPathList.push_back( PSPathElement(PS_CLOSEPATH) );
scflag = 1;
ecflag = 0;
cp = EndContour + 1;
@@ -999,19 +991,14 @@ static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **pat
}
}
- if ((pCount = listCount(pList)) > 0) {
- p = calloc(pCount, sizeof(PSPathElement));
- assert(p != 0);
- listToFirst(pList);
- for (i=0; i<pCount; i++) {
- memcpy(p + i, listCurrent(pList), sizeof(PSPathElement));
- listNext(pList);
- }
- *path = p;
+ if( (nPathCount = (int)aPathList.size()) > 0)
+ {
+ *path = (PSPathElement*)calloc(nPathCount, sizeof(PSPathElement));
+ assert(*path != 0);
+ memcpy( *path, &aPathList[0], nPathCount * sizeof(PSPathElement) );
}
- listDispose(pList);
- return pCount;
+ return nPathCount;
}
#endif
@@ -1036,18 +1023,18 @@ static char *nameExtract(sal_uInt8 *name, int nTableSize, int n, int dbFlag, sal
if( ucs2result )
*ucs2result = NULL;
if (dbFlag) {
- res = malloc(1 + len/2);
+ res = (char*)malloc(1 + len/2);
assert(res != 0);
for (i = 0; i < len/2; i++) res[i] = *(ptr + i * 2 + 1);
res[len/2] = 0;
if( ucs2result )
{
- *ucs2result = malloc( len+2 );
+ *ucs2result = (sal_uInt16*)malloc( len+2 );
for (i = 0; i < len/2; i++ ) (*ucs2result)[i] = GetUInt16( ptr, 2*i, 1 );
(*ucs2result)[len/2] = 0;
}
} else {
- res = malloc(1 + len);
+ res = (char*)malloc(1 + len);
assert(res != 0);
memcpy(res, ptr, len);
res[len] = 0;
@@ -1493,7 +1480,7 @@ static void GetKern(TrueTypeFont *ttf)
if (GetUInt16(table, 0, 1) == 0) { /* Traditional Microsoft style table with USHORT version and nTables fields */
ttf->nkern = GetUInt16(table, 2, 1);
- ttf->kerntables = calloc(ttf->nkern, sizeof(sal_uInt8 *));
+ ttf->kerntables = (sal_uInt8**)calloc(ttf->nkern, sizeof(sal_uInt8 *));
assert(ttf->kerntables != 0);
memset(ttf->kerntables, 0, ttf->nkern * sizeof(sal_uInt8 *));
ttf->kerntype = KT_MICROSOFT;
@@ -1513,7 +1500,7 @@ static void GetKern(TrueTypeFont *ttf)
if (GetUInt32(table, 0, 1) == 0x00010000) { /* MacOS style kern tables: fixed32 version and sal_uInt32 nTables fields */
ttf->nkern = GetUInt32(table, 4, 1);
- ttf->kerntables = calloc(ttf->nkern, sizeof(sal_uInt8 *));
+ ttf->kerntables = (sal_uInt8**)calloc(ttf->nkern, sizeof(sal_uInt8*));
assert(ttf->kerntables != 0);
memset(ttf->kerntables, 0, ttf->nkern * sizeof(sal_uInt8 *));
ttf->kerntype = KT_APPLE_NEW;
@@ -1630,7 +1617,7 @@ int CountTTCFonts(const char* fname)
static void allocTrueTypeFont( TrueTypeFont** ttf )
{
- *ttf = calloc(1,sizeof(TrueTypeFont));
+ *ttf = (TrueTypeFont*)calloc(1,sizeof(TrueTypeFont));
if( *ttf != NULL )
{
(*ttf)->tag = 0;
@@ -1714,7 +1701,7 @@ int OpenTTFontBuffer(void* pBuffer, sal_uInt32 nLen, sal_uInt32 facenum, TrueTyp
(*ttf)->fname = NULL;
(*ttf)->fsize = nLen;
- (*ttf)->ptr = pBuffer;
+ (*ttf)->ptr = (sal_uInt8*)pBuffer;
return doOpenTTFont( facenum, *ttf );
}
@@ -1722,13 +1709,11 @@ int OpenTTFontBuffer(void* pBuffer, sal_uInt32 nLen, sal_uInt32 facenum, TrueTyp
static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
{
int i;
- sal_uInt32 version;
- sal_uInt8 *table, *offset;
sal_uInt32 length, tag;
sal_uInt32 tdoffset = 0; /* offset to TableDirectory in a TTC file. For TTF files is 0 */
int indexfmt, k;
- version = GetInt32(t->ptr, 0, 1);
+ sal_uInt32 version = GetInt32(t->ptr, 0, 1);
if ((version == 0x00010000) || (version == T_true)) {
tdoffset = 0;
@@ -1758,9 +1743,9 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
if( t->ntables >= 128 )
return SF_TTFORMAT;
- t->tables = calloc(NUM_TAGS, sizeof(void *));
+ t->tables = (sal_uInt8**)calloc(NUM_TAGS, sizeof(sal_uInt8*));
assert(t->tables != 0);
- t->tlens = calloc(NUM_TAGS, sizeof(sal_uInt32));
+ t->tlens = (sal_uInt32*)calloc(NUM_TAGS, sizeof(sal_uInt32));
assert(t->tlens != 0);
memset(t->tables, 0, NUM_TAGS * sizeof(void *));
@@ -1791,22 +1776,23 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
default: nIndex = -1; break;
}
if( nIndex >= 0 ) {
- offset = t->ptr + GetUInt32(t->ptr + tdoffset + 12, 16 * i + 8, 1);
+ sal_uInt32 nTableOffset = GetUInt32(t->ptr + tdoffset + 12, 16 * i + 8, 1);
length = GetUInt32(t->ptr + tdoffset + 12, 16 * i + 12, 1);
- t->tables[nIndex] = offset;
+ t->tables[nIndex] = t->ptr + nTableOffset;
t->tlens[nIndex] = length;
}
}
/* Fixup offsets when only a TTC extract was provided */
if( facenum == (sal_uInt32)~0 ) {
- sal_uInt8 *pHead = t->tables[O_head], *p = NULL;
+ sal_uInt8* pHead = (sal_uInt8*)t->tables[O_head];
if( !pHead )
return SF_TTFORMAT;
/* limit Head candidate to TTC extract's limits */
if( pHead > t->ptr + (t->fsize - 54) )
pHead = t->ptr + (t->fsize - 54);
/* TODO: find better method than searching head table's magic */
+ sal_uInt8* p = NULL;
for( p = pHead + 12; p > t->ptr; --p ) {
if( p[0]==0x5F && p[1]==0x0F && p[2]==0x3C && p[3]==0xF5 ) {
int nDelta = (pHead + 12) - p, j;
@@ -1861,7 +1847,7 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
return SF_TTFORMAT;
}
- table = getTable(t, O_maxp);
+ sal_uInt8* table = getTable(t, O_maxp);
t->nglyphs = GetUInt16(table, 4, 1);
table = getTable(t, O_head);
@@ -1931,10 +1917,7 @@ int GetTTGlyphPoints(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint **point
return GetTTGlyphOutline(ttf, glyphID, pointArray, 0, 0);
}
-#ifdef NO_LIST
-static
-#endif
-int GetTTGlyphComponents(TrueTypeFont *ttf, sal_uInt32 glyphID, list glyphlist)
+int GetTTGlyphComponents(TrueTypeFont *ttf, sal_uInt32 glyphID, std::vector< sal_uInt32 >& glyphlist)
{
sal_uInt8 *ptr, *glyf = getTable(ttf, O_glyf);
int n = 1;
@@ -1942,7 +1925,7 @@ int GetTTGlyphComponents(TrueTypeFont *ttf, sal_uInt32 glyphID, list glyphlist)
if (glyphID >= ttf->nglyphs) return 0;
ptr = glyf + ttf->goffsets[glyphID];
- listAppend(glyphlist, (void *) (sal_IntPtr) glyphID);
+ glyphlist.push_back( glyphID );
if (GetInt16(ptr, 0, 1) == -1) {
sal_uInt16 flags, index;
@@ -2089,8 +2072,10 @@ int CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, const char *fname, /*FO
XUnits(UPEm, metrics.xMax),
XUnits(UPEm, metrics.yMax));
- for (j = 0; j < n; j++) {
- switch (path[j].type) {
+ for (j = 0; j < n; j++)
+ {
+ switch (path[j].type)
+ {
case PS_MOVETO:
fprintf(outf, "\t%d %d moveto\n", XUnits(UPEm, path[j].x1), XUnits(UPEm, path[j].y1));
break;
@@ -2106,6 +2091,8 @@ int CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, const char *fname, /*FO
case PS_CLOSEPATH:
fprintf(outf, "\tclosepath\n");
break;
+ case PS_NOOP:
+ break;
}
}
if (n > 0) fprintf(outf, "\tfill\n"); /* if glyph is not a whitespace character */
@@ -2139,7 +2126,6 @@ int CreateTTFromTTGlyphs(TrueTypeFont *ttf,
sal_uInt8 *p;
int i;
int res;
- sal_uInt32 *gID;
TrueTypeCreatorNewEmpty(T_true, &ttcr);
@@ -2210,7 +2196,7 @@ int CreateTTFromTTGlyphs(TrueTypeFont *ttf,
/** glyf **/
glyf = TrueTypeTableNew_glyf();
- gID = scalloc(nGlyphs, sizeof(sal_uInt32));
+ sal_uInt32* gID = (sal_uInt32*)scalloc(nGlyphs, sizeof(sal_uInt32));
for (i = 0; i < nGlyphs; i++) {
gID[i] = glyfAdd(glyf, GetTTRawGlyphData(ttf, glyphArray[i]), ttf);
@@ -2277,7 +2263,7 @@ int CreateTTFromTTGlyphs(TrueTypeFont *ttf,
#ifndef NO_TYPE42
static GlyphOffsets *GlyphOffsetsNew(sal_uInt8 *sfntP)
{
- GlyphOffsets *res = smalloc(sizeof(GlyphOffsets));
+ GlyphOffsets* res = (GlyphOffsets*)smalloc(sizeof(GlyphOffsets));
sal_uInt8 *loca = NULL;
sal_uInt16 i, numTables = GetUInt16(sfntP, 4, 1);
sal_uInt32 locaLen = 0;
@@ -2298,7 +2284,7 @@ static GlyphOffsets *GlyphOffsetsNew(sal_uInt8 *sfntP)
res->nGlyphs = locaLen / ((indexToLocFormat == 1) ? 4 : 2);
assert(res->nGlyphs != 0);
- res->offs = scalloc(res->nGlyphs, sizeof(sal_uInt32));
+ res->offs = (sal_uInt32*)scalloc(res->nGlyphs, sizeof(sal_uInt32));
for (i = 0; i < res->nGlyphs; i++) {
if (indexToLocFormat == 1) {
@@ -2322,14 +2308,13 @@ static void DumpSfnts(FILE *outf, sal_uInt8 *sfntP)
{
HexFmt *h = HexFmtNew(outf);
sal_uInt16 i, numTables = GetUInt16(sfntP, 4, 1);
- sal_uInt32 j, *offs, *len;
GlyphOffsets *go = GlyphOffsetsNew(sfntP);
sal_uInt8 pad[] = {0,0,0,0}; /* zeroes */
assert(numTables <= 9); /* Type42 has 9 required tables */
- offs = scalloc(numTables, sizeof(sal_uInt32));
- len = scalloc(numTables, sizeof(sal_uInt32));
+ sal_uInt32* offs = (sal_uInt32*)scalloc(numTables, sizeof(sal_uInt32));
+// sal_uInt32* lens = (sal_uInt32*)scalloc(numTables, sizeof(sal_uInt32));
fputs("/sfnts [", outf);
HexFmtOpenString(h);
@@ -2345,7 +2330,7 @@ static void DumpSfnts(FILE *outf, sal_uInt8 *sfntP)
HexFmtBlockWrite(h, sfntP + off, len);
} else {
sal_uInt8 *glyf = sfntP + off;
- sal_uInt32 o, l;
+ sal_uInt32 o, l, j;
for (j = 0; j < go->nGlyphs - 1; j++) {
o = go->offs[j];
l = go->offs[j + 1] - o;
@@ -2359,7 +2344,7 @@ static void DumpSfnts(FILE *outf, sal_uInt8 *sfntP)
GlyphOffsetsDispose(go);
HexFmtDispose(h);
free(offs);
- free(len);
+// free(lens);
}
int CreateT42FromTTGlyphs(TrueTypeFont *ttf,
@@ -2382,8 +2367,6 @@ int CreateT42FromTTGlyphs(TrueTypeFont *ttf,
sal_uInt32 sfntLen;
int UPEm = ttf->unitsPerEm;
- sal_uInt16 *gID;
-
if (nGlyphs >= 256) return SF_GLYPHNUM;
assert(psname != 0);
@@ -2425,7 +2408,7 @@ int CreateT42FromTTGlyphs(TrueTypeFont *ttf,
/** glyf **/
glyf = TrueTypeTableNew_glyf();
- gID = scalloc(nGlyphs, sizeof(sal_uInt32));
+ sal_uInt16* gID = (sal_uInt16*)scalloc(nGlyphs, sizeof(sal_uInt32));
for (i = 0; i < nGlyphs; i++) {
gID[i] = (sal_uInt16)glyfAdd(glyf, GetTTRawGlyphData(ttf, glyphArray[i]), ttf);
@@ -2571,7 +2554,6 @@ int GetTTGlyphCount( TrueTypeFont* ttf )
TTSimpleGlyphMetrics *GetTTSimpleGlyphMetrics(TrueTypeFont *ttf, sal_uInt16 *glyphArray, int nGlyphs, int mode)
{
sal_uInt8* pTable;
- TTSimpleGlyphMetrics *res;
int i;
sal_uInt16 glyphID;
sal_uInt32 n;
@@ -2591,7 +2573,7 @@ TTSimpleGlyphMetrics *GetTTSimpleGlyphMetrics(TrueTypeFont *ttf, sal_uInt16 *gly
if (!nGlyphs || !glyphArray) return 0; /* invalid parameters */
if (!n || !pTable) return 0; /* the font does not contain the requested metrics */
- res = calloc(nGlyphs, sizeof(TTSimpleGlyphMetrics));
+ TTSimpleGlyphMetrics* res = (TTSimpleGlyphMetrics*)calloc(nGlyphs, sizeof(TTSimpleGlyphMetrics));
assert(res != 0);
for (i=0; i<nGlyphs; i++) {
@@ -2612,15 +2594,13 @@ TTSimpleGlyphMetrics *GetTTSimpleGlyphMetrics(TrueTypeFont *ttf, sal_uInt16 *gly
if( nAdvOffset >= nTableSize)
res[i].adv = 0; /* better than a crash for buggy fonts */
else
- res[i].adv = SAL_INT_CAST(
- sal_uInt16,
+ res[i].adv = static_cast<sal_uInt16>(
XUnits( UPEm, GetUInt16( pTable, nAdvOffset, 1) ) );
if( nLsbOffset >= nTableSize)
res[i].sb = 0; /* better than a crash for buggy fonts */
else
- res[i].sb = SAL_INT_CAST(
- sal_Int16,
+ res[i].sb = static_cast<sal_Int16>(
XUnits( UPEm, GetInt16( pTable, nLsbOffset, 1) ) );
}
@@ -2631,10 +2611,9 @@ TTSimpleGlyphMetrics *GetTTSimpleGlyphMetrics(TrueTypeFont *ttf, sal_uInt16 *gly
TTSimpleGlyphMetrics *GetTTSimpleCharMetrics(TrueTypeFont * ttf, sal_uInt16 firstChar, int nChars, int mode)
{
TTSimpleGlyphMetrics *res = 0;
- sal_uInt16 *str;
int i, n;
- str = malloc(nChars * 2);
+ sal_uInt16* str = (sal_uInt16*)malloc(nChars * 2);
assert(str != 0);
for (i=0; i<nChars; i++) str[i] = (sal_uInt16)(firstChar + i);
@@ -2742,7 +2721,6 @@ GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID)
sal_uInt8 *glyf = getTable(ttf, O_glyf);
sal_uInt8 *hmtx = getTable(ttf, O_hmtx);
sal_uInt32 length;
- GlyphData *d;
ControlPoint *cp;
int i, n, m;
@@ -2756,11 +2734,11 @@ GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID)
length = ttf->goffsets[glyphID+1] - ttf->goffsets[glyphID];
- d = malloc(sizeof(GlyphData)); assert(d != 0);
+ GlyphData* d = (GlyphData*)malloc(sizeof(GlyphData)); assert(d != 0);
if (length > 0) {
sal_uInt8 *srcptr = glyf + ttf->goffsets[glyphID];
- d->ptr = malloc((length + 1) & ~1); assert(d->ptr != 0);
+ d->ptr = (sal_uInt8*)malloc((length + 1) & ~1); assert(d->ptr != 0);
memcpy( d->ptr, srcptr, length );
d->compflag = (GetInt16( srcptr, 0, 1 ) < 0);
} else {
@@ -2811,7 +2789,7 @@ int GetTTNameRecords(TrueTypeFont *ttf, NameRecord **nr)
*nr = 0;
if (n == 0) return 0;
- rec = calloc(n, sizeof(NameRecord));
+ rec = (NameRecord*)calloc(n, sizeof(NameRecord));
for (i = 0; i < n; i++) {
int nStrOffset = GetUInt16(table + 6, 10 + 12 * i, 1);
@@ -2864,7 +2842,7 @@ void DisposeNameRecords(NameRecord* nr, int n)
free(nr);
}
-
+} // namespace vcl
#ifdef TEST1
diff --git a/vcl/source/fontsubset/ttcr.c b/vcl/source/fontsubset/ttcr.cxx
index e8c9d8cf74e0..7f9ae796142b 100644
--- a/vcl/source/fontsubset/ttcr.c
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: ttcr.c,v $
- * $Revision: 1.11 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,8 +25,6 @@
*
************************************************************************/
-/* $Id: ttcr.c,v 1.11 2008-04-11 10:16:51 rt Exp $ */
-
/*
* TrueTypeCreator method implementation
*
@@ -48,7 +43,22 @@
#endif
#include <assert.h>
-#include "ttcr.h"
+#include "ttcr.hxx"
+#include "list.h"
+
+
+
+namespace vcl
+{
+
+/*
+ * Private Data Types
+ */
+
+ struct _TrueTypeCreator {
+ sal_uInt32 tag; /**< TrueType file tag */
+ list tables; /**< List of table tags and pointers */
+ };
/* These must be #defined so that they can be used in initializers */
#define T_maxp 0x6D617870
@@ -159,7 +169,6 @@ _inline void PutInt16(sal_Int16 val, sal_uInt8 *ptr, sal_uInt32 offset, int bige
ptr[offset+1] = (sal_uInt8)((val >> 8) & 0xFF);
ptr[offset] = (sal_uInt8)(val & 0xFF);
}
-
}
_inline void PutUInt16(sal_uInt16 val, sal_uInt8 *ptr, sal_uInt32 offset, int bigendian)
@@ -173,10 +182,8 @@ _inline void PutUInt16(sal_uInt16 val, sal_uInt8 *ptr, sal_uInt32 offset, int bi
ptr[offset+1] = (sal_uInt8)((val >> 8) & 0xFF);
ptr[offset] = (sal_uInt8)(val & 0xFF);
}
-
}
-
_inline void PutUInt32(sal_uInt32 val, sal_uInt8 *ptr, sal_uInt32 offset, int bigendian)
{
assert(ptr != 0);
@@ -267,22 +274,16 @@ _inline void *scalloc(sal_uInt32 n, sal_uInt32 size)
void TrueTypeCreatorNewEmpty(sal_uInt32 tag, TrueTypeCreator **_this)
{
- TrueTypeCreator *ptr = smalloc(sizeof(TrueTypeCreator));
+ TrueTypeCreator* ptr = (TrueTypeCreator*)smalloc(sizeof(TrueTypeCreator));
ptr->tables = listNewEmpty();
- listSetElementDtor(ptr->tables, (void(*)(void*))TrueTypeTableDispose);
+ listSetElementDtor(ptr->tables, (list_destructor)TrueTypeTableDispose);
ptr->tag = tag;
*_this = ptr;
}
-void TrueTypeCreatorDispose(TrueTypeCreator *_this)
-{
- listDispose(_this->tables);
- free(_this);
-}
-
int AddTable(TrueTypeCreator *_this, TrueTypeTable *table)
{
if (table != 0) {
@@ -316,9 +317,7 @@ int StreamToMemory(TrueTypeCreator *_this, sal_uInt8 **ptr, sal_uInt32 *length)
sal_uInt16 numTables, searchRange=1, entrySelector=0, rangeShift;
sal_uInt32 s, offset, checkSumAdjustment = 0;
sal_uInt32 *p;
- sal_uInt8 *ttf;
int i=0, n;
- TableEntry *te;
sal_uInt8 *head = NULL; /* saved pointer to the head table data for checkSumAdjustment calculation */
if ((n = listCount(_this->tables)) == 0) return SF_TTFORMAT;
@@ -331,7 +330,7 @@ int StreamToMemory(TrueTypeCreator *_this, sal_uInt8 **ptr, sal_uInt32 *length)
numTables = (sal_uInt16) n;
- te = scalloc(n, sizeof(TableEntry));
+ TableEntry* te = (TableEntry*)scalloc(n, sizeof(TableEntry));
listToFirst(_this->tables);
for (i = 0; i < n; i++) {
@@ -357,7 +356,7 @@ int StreamToMemory(TrueTypeCreator *_this, sal_uInt8 **ptr, sal_uInt32 *length)
/* if ((te[i].length & 3) != 0) s += (4 - (te[i].length & 3)) & 3; */
}
- ttf = smalloc(s);
+ sal_uInt8* ttf = (sal_uInt8*)smalloc(s);
/* Offset Table */
PutUInt32(_this->tag, ttf, 0, 1);
@@ -486,10 +485,9 @@ typedef struct {
static sal_uInt8 *ttmalloc(sal_uInt32 nbytes)
{
sal_uInt32 n;
- sal_uInt8 *res;
n = (nbytes + 3) & (sal_uInt32) ~3;
- res = malloc(n);
+ sal_uInt8* res = (sal_uInt8*)malloc(n);
assert(res != 0);
memset(res, 0, n);
@@ -722,7 +720,7 @@ static int GetRawData_glyf(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *le
/* cmap packers */
static sal_uInt8 *PackCmapType0(CmapSubTable *s, sal_uInt32 *length)
{
- sal_uInt8 *ptr = smalloc(262);
+ sal_uInt8* ptr = (sal_uInt8*)smalloc(262);
sal_uInt8 *p = ptr + 6;
sal_uInt32 i, j;
sal_uInt16 g;
@@ -746,7 +744,7 @@ static sal_uInt8 *PackCmapType0(CmapSubTable *s, sal_uInt32 *length)
static sal_uInt8 *PackCmapType6(CmapSubTable *s, sal_uInt32 *length)
{
- sal_uInt8 *ptr = smalloc(s->n*2 + 10);
+ sal_uInt8* ptr = (sal_uInt8*)smalloc(s->n*2 + 10);
sal_uInt8 *p = ptr + 10;
sal_uInt32 i, j;
sal_uInt16 g;
@@ -784,8 +782,6 @@ static sal_uInt8 *PackCmap(CmapSubTable *s, sal_uInt32 *length)
static int GetRawData_cmap(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *len, sal_uInt32 *tag)
{
table_cmap *t;
- sal_uInt8 **subtables;
- sal_uInt32 *sizes; /* of subtables */
sal_uInt32 i;
sal_uInt32 tlen = 0;
sal_uInt32 l;
@@ -798,8 +794,8 @@ static int GetRawData_cmap(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *le
assert(t != 0);
assert(t->n != 0);
- subtables = scalloc(t->n, sizeof(sal_uInt8 *));
- sizes = scalloc(t->n, sizeof(sal_uInt32));
+ sal_uInt8** subtables = (sal_uInt8**)scalloc(t->n, sizeof(sal_uInt8 *));
+ sal_uInt32* sizes = (sal_uInt32*)scalloc(t->n, sizeof(sal_uInt32));
for (i = 0; i < t->n; i++) {
subtables[i] = PackCmap(t->s+i, &l);
@@ -837,10 +833,7 @@ static int GetRawData_cmap(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *le
static int GetRawData_name(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *len, sal_uInt32 *tag)
{
list l;
- NameRecord *nr;
sal_Int16 i=0, n; /* number of Name Records */
- sal_uInt8 *name;
- sal_uInt16 nameLen;
int stringLen = 0;
sal_uInt8 *p1, *p2;
@@ -854,7 +847,7 @@ static int GetRawData_name(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *le
if ((n = (sal_Int16)listCount(l)) == 0) return TTCR_NONAMES;
- nr = scalloc(n, sizeof(NameRecord));
+ NameRecord* nr = (NameRecord*)scalloc(n, sizeof(NameRecord));
listToFirst(l);
@@ -871,8 +864,8 @@ static int GetRawData_name(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *le
qsort(nr, n, sizeof(NameRecord), NameRecordCompareF);
- nameLen = (sal_uInt16)(stringLen + 12 * n + 6);
- name = ttmalloc(nameLen);
+ int nameLen = stringLen + 12 * n + 6;
+ sal_uInt8* name = (sal_uInt8*)ttmalloc(nameLen);
PutUInt16(0, name, 0, 1);
PutUInt16(n, name, 2, 1);
@@ -898,7 +891,7 @@ static int GetRawData_name(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *le
_this->rawdata = name;
*ptr = name;
- *len = nameLen;
+ *len = (sal_uInt16)nameLen;
*tag = T_name;
/*{int j; for(j=0; j<nameLen; j++) printf("%c", name[j]); }; */
@@ -977,11 +970,8 @@ TrueTypeTable *TrueTypeTableNew(sal_uInt32 tag,
sal_uInt32 nbytes,
sal_uInt8 *ptr)
{
- TrueTypeTable *table;
- tdata_generic *pdata;
-
- table = smalloc(sizeof(TrueTypeTable));
- pdata = (tdata_generic *) smalloc(sizeof(tdata_generic));
+ TrueTypeTable* table = (TrueTypeTable*)smalloc(sizeof(TrueTypeTable));
+ tdata_generic* pdata = (tdata_generic*)smalloc(sizeof(tdata_generic));
pdata->nbytes = nbytes;
pdata->tag = tag;
if (nbytes) {
@@ -1006,13 +996,10 @@ TrueTypeTable *TrueTypeTableNew_head(sal_uInt32 fontRevision,
sal_uInt16 lowestRecPPEM,
sal_Int16 fontDirectionHint)
{
- TrueTypeTable *table;
- sal_uInt8 *ptr;
-
assert(created != 0);
- table = smalloc(sizeof(TrueTypeTable));
- ptr = ttmalloc(TABLESIZE_head);
+ TrueTypeTable* table = (TrueTypeTable*)smalloc(sizeof(TrueTypeTable));
+ sal_uInt8* ptr = (sal_uInt8*)ttmalloc(TABLESIZE_head);
PutUInt32(0x00010000, ptr, 0, 1); /* version */
@@ -1040,11 +1027,8 @@ TrueTypeTable *TrueTypeTableNew_hhea(sal_Int16 ascender,
sal_Int16 caretSlopeRise,
sal_Int16 caretSlopeRun)
{
- TrueTypeTable *table;
- sal_uInt8 *ptr;
-
- table = smalloc(sizeof(TrueTypeTable));
- ptr = ttmalloc(TABLESIZE_hhea);
+ TrueTypeTable* table = (TrueTypeTable*)smalloc(sizeof(TrueTypeTable));
+ sal_uInt8* ptr = (sal_uInt8*)ttmalloc(TABLESIZE_hhea);
PutUInt32(0x00010000, ptr, 0, 1); /* version */
PutUInt16(ascender, ptr, 4, 1);
@@ -1068,7 +1052,7 @@ TrueTypeTable *TrueTypeTableNew_hhea(sal_Int16 ascender,
TrueTypeTable *TrueTypeTableNew_loca(void)
{
- TrueTypeTable *table = smalloc(sizeof(TrueTypeTable));
+ TrueTypeTable* table = (TrueTypeTable*)smalloc(sizeof(TrueTypeTable));
table->data = smalloc(sizeof(tdata_loca));
((tdata_loca *)table->data)->nbytes = 0;
@@ -1082,7 +1066,7 @@ TrueTypeTable *TrueTypeTableNew_loca(void)
TrueTypeTable *TrueTypeTableNew_maxp(sal_uInt8 *maxp, int size)
{
- TrueTypeTable *table = smalloc(sizeof(TrueTypeTable));
+ TrueTypeTable* table = (TrueTypeTable*)smalloc(sizeof(TrueTypeTable));
table->data = ttmalloc(TABLESIZE_maxp);
if (maxp && size == TABLESIZE_maxp) {
@@ -1097,12 +1081,12 @@ TrueTypeTable *TrueTypeTableNew_maxp(sal_uInt8 *maxp, int size)
TrueTypeTable *TrueTypeTableNew_glyf(void)
{
- TrueTypeTable *table = smalloc(sizeof(TrueTypeTable));
+ TrueTypeTable* table = (TrueTypeTable*)smalloc(sizeof(TrueTypeTable));
list l = listNewEmpty();
assert(l != 0);
- listSetElementDtor(l, FreeGlyphData);
+ listSetElementDtor(l, (list_destructor)FreeGlyphData);
table->data = l;
table->rawdata = 0;
@@ -1113,8 +1097,8 @@ TrueTypeTable *TrueTypeTableNew_glyf(void)
TrueTypeTable *TrueTypeTableNew_cmap(void)
{
- TrueTypeTable *table = smalloc(sizeof(TrueTypeTable));
- table_cmap *cmap = smalloc(sizeof(table_cmap));
+ TrueTypeTable* table = (TrueTypeTable*)smalloc(sizeof(TrueTypeTable));
+ table_cmap* cmap = (table_cmap*)smalloc(sizeof(table_cmap));
cmap->n = 0;
cmap->m = CMAP_SUBTABLE_INIT;
@@ -1140,12 +1124,12 @@ static void DisposeNameRecord(void *ptr)
static NameRecord* NameRecordNewCopy(NameRecord *nr)
{
- NameRecord *p = smalloc(sizeof(NameRecord));
+ NameRecord* p = (NameRecord*)smalloc(sizeof(NameRecord));
memcpy(p, nr, sizeof(NameRecord));
if (p->slen) {
- p->sptr = smalloc(p->slen);
+ p->sptr = (sal_uInt8*)smalloc(p->slen);
memcpy(p->sptr, nr->sptr, p->slen);
}
@@ -1154,12 +1138,12 @@ static NameRecord* NameRecordNewCopy(NameRecord *nr)
TrueTypeTable *TrueTypeTableNew_name(int n, NameRecord *nr)
{
- TrueTypeTable *table = smalloc(sizeof(TrueTypeTable));
+ TrueTypeTable* table = (TrueTypeTable*)smalloc(sizeof(TrueTypeTable));
list l = listNewEmpty();
assert(l != 0);
- listSetElementDtor(l, DisposeNameRecord);
+ listSetElementDtor(l, (list_destructor)DisposeNameRecord);
if (n != 0) {
int i;
@@ -1181,12 +1165,9 @@ TrueTypeTable *TrueTypeTableNew_post(sal_uInt32 format,
sal_Int16 underlineThickness,
sal_uInt32 isFixedPitch)
{
- TrueTypeTable *table;
- tdata_post *post;
-
assert(format == 0x00030000); /* Only format 3.0 is supported at this time */
- table = smalloc(sizeof(TrueTypeTable));
- post = smalloc(sizeof(tdata_post));
+ TrueTypeTable* table = (TrueTypeTable*)smalloc(sizeof(TrueTypeTable));
+ tdata_post* post = (tdata_post*)smalloc(sizeof(tdata_post));
post->format = format;
post->italicAngle = italicAngle;
@@ -1202,26 +1183,6 @@ TrueTypeTable *TrueTypeTableNew_post(sal_uInt32 format,
return table;
}
-
-
-void TrueTypeTableDispose(TrueTypeTable *_this)
-{
- /* XXX do a binary search */
- unsigned int i;
-
- assert(_this != 0);
-
- if (_this->rawdata) free(_this->rawdata);
-
- for(i=0; i < sizeof(vtable1)/sizeof(*vtable1); i++) {
- if (_this->tag == vtable1[i].tag) {
- vtable1[i].f(_this);
- return;
- }
- }
- assert(!"Unknown TrueType table.\n");
-}
-
int GetRawData(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *len, sal_uInt32 *tag)
{
/* XXX do a binary search */
@@ -1271,8 +1232,7 @@ void cmapAdd(TrueTypeTable *table, sal_uInt32 id, sal_uInt32 c, sal_uInt32 g)
if (!found) {
if (t->n == t->m) {
- CmapSubTable *tmp;
- tmp = scalloc(t->m + CMAP_SUBTABLE_INCR, sizeof(CmapSubTable));
+ CmapSubTable* tmp = (CmapSubTable*)scalloc(t->m + CMAP_SUBTABLE_INCR, sizeof(CmapSubTable));
memset(tmp, 0, t->m + CMAP_SUBTABLE_INCR * sizeof(CmapSubTable));
memcpy(tmp, s, sizeof(CmapSubTable) * t->m);
t->m += CMAP_SUBTABLE_INCR;
@@ -1294,13 +1254,13 @@ void cmapAdd(TrueTypeTable *table, sal_uInt32 id, sal_uInt32 c, sal_uInt32 g)
s[i].id = id;
s[i].n = 0;
s[i].m = CMAP_PAIR_INIT;
- s[i].xc = scalloc(CMAP_PAIR_INIT, sizeof(sal_uInt32));
- s[i].xg = scalloc(CMAP_PAIR_INIT, sizeof(sal_uInt32));
+ s[i].xc = (sal_uInt32*)scalloc(CMAP_PAIR_INIT, sizeof(sal_uInt32));
+ s[i].xg = (sal_uInt32*)scalloc(CMAP_PAIR_INIT, sizeof(sal_uInt32));
}
if (s[i].n == s[i].m) {
- sal_uInt32 *tmp1 = scalloc(s[i].m + CMAP_PAIR_INCR, sizeof(sal_uInt32));
- sal_uInt32 *tmp2 = scalloc(s[i].m + CMAP_PAIR_INCR, sizeof(sal_uInt32));
+ sal_uInt32* tmp1 = (sal_uInt32*)scalloc(s[i].m + CMAP_PAIR_INCR, sizeof(sal_uInt32));
+ sal_uInt32* tmp2 = (sal_uInt32*)scalloc(s[i].m + CMAP_PAIR_INCR, sizeof(sal_uInt32));
assert(tmp1 != 0);
assert(tmp2 != 0);
memcpy(tmp1, s[i].xc, sizeof(sal_uInt32) * s[i].m);
@@ -1322,7 +1282,6 @@ sal_uInt32 glyfAdd(TrueTypeTable *table, GlyphData *glyphdata, TrueTypeFont *fnt
list l;
sal_uInt32 currentID;
int ret, n, ncomponents;
- list glyphlist;
GlyphData *gd;
assert(table != 0);
@@ -1330,7 +1289,7 @@ sal_uInt32 glyfAdd(TrueTypeTable *table, GlyphData *glyphdata, TrueTypeFont *fnt
if (!glyphdata) return (sal_uInt32)~0;
- glyphlist = listNewEmpty();
+ std::vector< sal_uInt32 > glyphlist;
ncomponents = GetTTGlyphComponents(fnt, glyphdata->glyphID, glyphlist);
@@ -1344,11 +1303,15 @@ sal_uInt32 glyfAdd(TrueTypeTable *table, GlyphData *glyphdata, TrueTypeFont *fnt
glyphdata->newID = n++;
listAppend(l, glyphdata);
- if (ncomponents > 1) {
- listPositionAt(glyphlist, 1); /* glyphData->glyphID is always the first glyph on the list */
- do {
+ if (ncomponents > 1 && glyphlist.size() > 1 )
+ {
+ std::vector< sal_uInt32 >::const_iterator it = glyphlist.begin();
+ ++it;
+ /* glyphData->glyphID is always the first glyph on the list */
+ do
+ {
int found = 0;
- currentID = (sal_uIntPtr) listCurrent(glyphlist);
+ currentID = *it;
/* XXX expensive! should be rewritten with sorted arrays! */
listToFirst(l);
do {
@@ -1363,10 +1326,9 @@ sal_uInt32 glyfAdd(TrueTypeTable *table, GlyphData *glyphdata, TrueTypeFont *fnt
gd->newID = n++;
listAppend(l, gd);
}
- } while (listNext(glyphlist));
+ } while( ++it != glyphlist.end() );
}
- listDispose(glyphlist);
return ret;
}
@@ -1398,7 +1360,7 @@ static TrueTypeTable *FindTable(TrueTypeCreator *tt, sal_uInt32 tag)
do {
if (((TrueTypeTable *) listCurrent(tt->tables))->tag == tag) {
- return listCurrent(tt->tables);
+ return (TrueTypeTable*)listCurrent(tt->tables);
}
} while (listNext(tt->tables));
@@ -1428,11 +1390,10 @@ static void ProcessTables(TrueTypeCreator *tt)
sal_Int16 xMin = 0, yMin = 0, xMax = 0, yMax = 0;
sal_uInt32 i = 0;
sal_Int16 indexToLocFormat;
- sal_uInt8 *glyfPtr, *locaPtr, *hmtxPtr, *hheaPtr;
+ sal_uInt8 *hmtxPtr, *hheaPtr;
sal_uInt32 hmtxSize;
sal_uInt8 *p1, *p2;
sal_uInt16 maxPoints = 0, maxContours = 0, maxCompositePoints = 0, maxCompositeContours = 0;
- TTSimpleGlyphMetrics *met;
int nlsb = 0;
sal_uInt32 *gid; /* array of old glyphIDs */
@@ -1440,7 +1401,7 @@ static void ProcessTables(TrueTypeCreator *tt)
glyphlist = (list) glyf->data;
nGlyphs = listCount(glyphlist);
assert(nGlyphs != 0);
- gid = scalloc(nGlyphs, sizeof(sal_uInt32));
+ gid = (sal_uInt32*)scalloc(nGlyphs, sizeof(sal_uInt32));
RemoveTable(tt, T_loca);
RemoveTable(tt, T_hmtx);
@@ -1488,9 +1449,9 @@ static void ProcessTables(TrueTypeCreator *tt)
indexToLocFormat = (glyfLen / 2 > 0xFFFF) ? 1 : 0;
locaLen = indexToLocFormat ? (nGlyphs + 1) << 2 : (nGlyphs + 1) << 1;
- glyfPtr = ttmalloc(glyfLen);
- locaPtr = ttmalloc(locaLen);
- met = scalloc(nGlyphs, sizeof(TTSimpleGlyphMetrics));
+ sal_uInt8* glyfPtr = ttmalloc(glyfLen);
+ sal_uInt8* locaPtr = ttmalloc(locaLen);
+ TTSimpleGlyphMetrics* met = (TTSimpleGlyphMetrics*)scalloc(nGlyphs, sizeof(TTSimpleGlyphMetrics));
i = 0;
listToFirst(glyphlist);
@@ -1569,19 +1530,21 @@ static void ProcessTables(TrueTypeCreator *tt)
AddTable(tt, loca);
head = FindTable(tt, T_head);
- PutInt16(xMin, head->data, 36, 1);
- PutInt16(yMin, head->data, 38, 1);
- PutInt16(xMax, head->data, 40, 1);
- PutInt16(yMax, head->data, 42, 1);
- PutInt16(indexToLocFormat, head->data, 50, 1);
+ sal_uInt8* const pHeadData = (sal_uInt8*)head->data;
+ PutInt16(xMin, pHeadData, 36, 1);
+ PutInt16(yMin, pHeadData, 38, 1);
+ PutInt16(xMax, pHeadData, 40, 1);
+ PutInt16(yMax, pHeadData, 42, 1);
+ PutInt16(indexToLocFormat, pHeadData, 50, 1);
maxp = FindTable(tt, T_maxp);
- PutUInt16((sal_uInt16)nGlyphs, maxp->data, 4, 1);
- PutUInt16(maxPoints, maxp->data, 6, 1);
- PutUInt16(maxContours, maxp->data, 8, 1);
- PutUInt16(maxCompositePoints, maxp->data, 10, 1);
- PutUInt16(maxCompositeContours, maxp->data, 12, 1);
+ sal_uInt8* const pMaxpData = (sal_uInt8*)maxp->data;
+ PutUInt16((sal_uInt16)nGlyphs, pMaxpData, 4, 1);
+ PutUInt16(maxPoints, pMaxpData, 6, 1);
+ PutUInt16(maxContours, pMaxpData, 8, 1);
+ PutUInt16(maxCompositePoints, pMaxpData, 10, 1);
+ PutUInt16(maxCompositeContours, pMaxpData, 12, 1);
#if 0
/* XXX do not overwrite the existing data. Fix: re-calculate these numbers here */
@@ -1628,6 +1591,43 @@ static void ProcessTables(TrueTypeCreator *tt)
free(met);
}
+} // namespace vcl
+
+extern "C"
+{
+ /**
+ * TrueTypeCreator destructor. It calls destructors for all TrueTypeTables added to it.
+ */
+ void TrueTypeCreatorDispose(vcl::TrueTypeCreator *_this)
+ {
+ listDispose(_this->tables);
+ free(_this);
+ }
+
+
+ /**
+ * Destructor for the TrueTypeTable object.
+ */
+ void TrueTypeTableDispose(vcl::TrueTypeTable *_this)
+ {
+ /* XXX do a binary search */
+ unsigned int i;
+
+ assert(_this != 0);
+
+ if (_this->rawdata) free(_this->rawdata);
+
+ for(i=0; i < sizeof(vcl::vtable1)/sizeof(*vcl::vtable1); i++) {
+ if (_this->tag == vcl::vtable1[i].tag) {
+ vcl::vtable1[i].f(_this);
+ return;
+ }
+ }
+ assert(!"Unknown TrueType table.\n");
+ }
+}
+
+
#ifdef TEST_TTCR
int main(void)
{
diff --git a/vcl/source/fontsubset/ttcr.h b/vcl/source/fontsubset/ttcr.hxx
index 95aa1a6c9e99..5b47f09d552a 100644
--- a/vcl/source/fontsubset/ttcr.h
+++ b/vcl/source/fontsubset/ttcr.hxx
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: ttcr.h,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,8 +25,6 @@
*
************************************************************************/
-/* $Id: ttcr.h,v 1.4 2008-04-11 10:17:09 rt Exp $ */
-
/**
*
* @file ttcr.h
@@ -40,14 +35,10 @@
#ifndef __TTCR_H
#define __TTCR_H
-#include "sft.h"
-#include "list.h"
+#include "sft.hxx"
-#ifdef __cplusplus
-extern "C"
+namespace vcl
{
-#endif
-
typedef struct _TrueTypeCreator TrueTypeCreator;
/* TrueType data types */
@@ -57,11 +48,11 @@ extern "C"
} longHorMetrics;
/* A generic base class for all TrueType tables */
- typedef struct {
+ struct TrueTypeTable {
sal_uInt32 tag; /* table tag */
sal_uInt8 *rawdata; /* raw data allocated by GetRawData_*() */
void *data; /* table specific data */
- } TrueTypeTable;
+ };
/** Error codes for most functions */
enum TTCRErrCodes {
@@ -87,11 +78,6 @@ extern "C"
void TrueTypeCreatorNewEmpty(sal_uInt32 tag, TrueTypeCreator **_this);
/**
- * TrueTypeCreator destructor. It calls destructors for all TrueTypeTables added to it.
- */
- void TrueTypeCreatorDispose(TrueTypeCreator *_this);
-
-/**
* Adds a TrueType table to the TrueType creator.
* SF_TABLEFORMAT value.
* @return value of SFErrCodes type
@@ -130,10 +116,6 @@ extern "C"
*
* ============================================================================ */
-/**
- * Destructor for the TrueTypeTable object.
- */
- void TrueTypeTableDispose(TrueTypeTable *);
/**
* This function converts the data of a TrueType table to a raw array of bytes.
@@ -260,21 +242,20 @@ extern "C"
*/
void nameAdd(TrueTypeTable *, NameRecord *nr);
+} // namespace
-/*
- * Private Data Types
+extern "C"
+{
+/**
+ * Destructor for the TrueTypeTable object.
*/
+ void TrueTypeTableDispose(vcl::TrueTypeTable *);
- struct _TrueTypeCreator {
- sal_uInt32 tag; /**< TrueType file tag */
- list tables; /**< List of table tags and pointers */
- };
-
-
-
-#ifdef __cplusplus
+/**
+ * TrueTypeCreator destructor. It calls destructors for all TrueTypeTables added to it.
+ */
+ void TrueTypeCreatorDispose(vcl::TrueTypeCreator *_this);
}
-#endif
#endif /* __TTCR_H */
diff --git a/vcl/source/fontsubset/u2big5.inc b/vcl/source/fontsubset/u2big5.inc
index 2883e9d99094..951b65cffc25 100644
--- a/vcl/source/fontsubset/u2big5.inc
+++ b/vcl/source/fontsubset/u2big5.inc
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: u2big5.inc,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,6 +25,8 @@
*
************************************************************************/
+// TODO: use generic RTL_TEXTENCODING_BIG5 to get rid of this file
+
sal_uInt16pair xlat_1_3[13798] = {
{0x0020, 0x0020},{0x0021, 0x0021},{0x0022, 0x0022},{0x0023, 0x0023},{0x0024, 0x0024},{0x0025, 0x0025},{0x0026, 0x0026},{0x0027, 0x0027},
{0x0028, 0x0028},{0x0029, 0x0029},{0x002A, 0x002A},{0x002B, 0x002B},{0x002C, 0x002C},{0x002D, 0x002D},{0x002E, 0x002E},{0x002F, 0x002F},
diff --git a/vcl/source/fontsubset/u2johab.inc b/vcl/source/fontsubset/u2johab.inc
index ae07cc571fb8..f7a75afaf503 100644
--- a/vcl/source/fontsubset/u2johab.inc
+++ b/vcl/source/fontsubset/u2johab.inc
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: u2johab.inc,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,6 +25,8 @@
*
************************************************************************/
+// use generic RTL_TEXTENCODING_JOHAB to get rid of this file
+
sal_uInt16pair xlat_1_6[17141] = {
{0x0020, 0x0020},{0x0021, 0x0021},{0x0022, 0x0022},{0x0023, 0x0023},{0x0024, 0x0024},{0x0025, 0x0025},{0x0026, 0x0026},{0x0027, 0x0027},
{0x0028, 0x0028},{0x0029, 0x0029},{0x002A, 0x002A},{0x002B, 0x002B},{0x002C, 0x002C},{0x002D, 0x002D},{0x002E, 0x002E},{0x002F, 0x002F},
diff --git a/vcl/source/fontsubset/u2prc.inc b/vcl/source/fontsubset/u2prc.inc
index 2479d23ebe6f..445461b59653 100644
--- a/vcl/source/fontsubset/u2prc.inc
+++ b/vcl/source/fontsubset/u2prc.inc
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: u2prc.inc,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,6 +25,8 @@
*
************************************************************************/
+// use generic RTL_TEXTENCODING_ to get rid of this file
+
sal_uInt16pair xlat_1_4[24035] = {
{0x0020, 0x0020},{0x0021, 0x0021},{0x0022, 0x0022},{0x0023, 0x0023},{0x0024, 0x0024},{0x0025, 0x0025},{0x0026, 0x0026},{0x0027, 0x0027},
{0x0028, 0x0028},{0x0029, 0x0029},{0x002A, 0x002A},{0x002B, 0x002B},{0x002C, 0x002C},{0x002D, 0x002D},{0x002E, 0x002E},{0x002F, 0x002F},
diff --git a/vcl/source/fontsubset/u2shiftjis.inc b/vcl/source/fontsubset/u2shiftjis.inc
index fb130feaebe2..ebc6f1676784 100644
--- a/vcl/source/fontsubset/u2shiftjis.inc
+++ b/vcl/source/fontsubset/u2shiftjis.inc
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: u2shiftjis.inc,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,6 +25,8 @@
*
************************************************************************/
+// TODO: use generic RTL_TEXTENCODING_SHIFTJIS to get rid of this file
+
sal_uInt16pair xlat_1_2[7484] = {
{0x0020, 0x0020},{0x0021, 0x0021},{0x0022, 0x0022},{0x0023, 0x0023},{0x0024, 0x0024},{0x0025, 0x0025},{0x0026, 0x0026},{0x0027, 0x0027},
{0x0028, 0x0028},{0x0029, 0x0029},{0x002A, 0x002A},{0x002B, 0x002B},{0x002C, 0x002C},{0x002D, 0x002D},{0x002E, 0x002E},{0x002F, 0x002F},
diff --git a/vcl/source/fontsubset/u2wansung.inc b/vcl/source/fontsubset/u2wansung.inc
index 0cb8867f1c2a..b321c9e58bfa 100644
--- a/vcl/source/fontsubset/u2wansung.inc
+++ b/vcl/source/fontsubset/u2wansung.inc
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: u2wansung.inc,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,6 +25,8 @@
*
************************************************************************/
+// TODO: use generic RTL_TEXTENCODING_WANSUNG to get rid of this file
+
sal_uInt16pair xlat_1_5[8319] = {
{0x0020, 0x0020},{0x0021, 0x0021},{0x0022, 0x0022},{0x0023, 0x0023},{0x0024, 0x0024},{0x0025, 0x0025},{0x0026, 0x0026},{0x0027, 0x0027},
{0x0028, 0x0028},{0x0029, 0x0029},{0x002A, 0x002A},{0x002B, 0x002B},{0x002C, 0x002C},{0x002D, 0x002D},{0x002E, 0x002E},{0x002F, 0x002F},
diff --git a/vcl/source/fontsubset/xlat.c b/vcl/source/fontsubset/xlat.cxx
index 840850a020da..27b2f517f4a1 100644
--- a/vcl/source/fontsubset/xlat.c
+++ b/vcl/source/fontsubset/xlat.cxx
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: xlat.c,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,7 +25,7 @@
*
************************************************************************/
-/* $Id: xlat.c,v 1.4 2008-04-11 10:19:41 rt Exp $
+/*
*
* Data translation from Unicode to MS encodings
* If the host system provides this functionality
@@ -39,8 +36,12 @@
*
*/
-#include "xlat.h"
+#include "xlat.hxx"
+
+namespace vcl
+{
+// TODO: use generic encoding converters and get rid of the include files below
#include "u2big5.inc"
#include "u2johab.inc"
#include "u2prc.inc"
@@ -183,5 +184,5 @@ void TranslateString16(sal_uInt16 *src, sal_uInt16 *dst, sal_uInt32 n)
}
}
-
+} // namespace vcl
diff --git a/vcl/source/fontsubset/xlat.h b/vcl/source/fontsubset/xlat.hxx
index 86eca1691574..c3bd076f6fbd 100644
--- a/vcl/source/fontsubset/xlat.h
+++ b/vcl/source/fontsubset/xlat.hxx
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: xlat.h,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,25 +25,17 @@
*
************************************************************************/
-/* $Id: xlat.h,v 1.4 2008-04-11 10:19:58 rt Exp $ */
-
-/*[]---------------------------------------------------[]*/
-/*| |*/
-/*| xlat.h |*/
-/*| |*/
/*| Author: Alexander Gelfenbain |*/
-/*[]---------------------------------------------------[]*/
#ifndef __XLAT_H
#define __XLAT_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
+#include "sft.hxx"
-#include "sft.h"
+namespace vcl
+{
+// TODO: sal_UCS4
sal_uInt16 TranslateChar12(sal_uInt16);
sal_uInt16 TranslateChar13(sal_uInt16);
@@ -59,10 +48,7 @@ extern "C" {
void TranslateString14(sal_uInt16 *, sal_uInt16 *, sal_uInt32);
void TranslateString15(sal_uInt16 *, sal_uInt16 *, sal_uInt32);
void TranslateString16(sal_uInt16 *, sal_uInt16 *, sal_uInt32);
-
-#ifdef __cplusplus
}
-#endif
-
#endif /* __XLAT_H */
+
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 820b053a4211..3bbdba5dad5f 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -31,7 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include "sft.h"
+#include "sft.hxx"
#include "tools/stream.hxx"
#include "tools/vcompat.hxx"
@@ -43,6 +43,8 @@
#include <algorithm>
+using namespace vcl;
+
// =======================================================================
DBG_NAME( Font )
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 521e56da207e..537964582ceb 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -63,6 +63,7 @@
#include <vcl/outdev.hxx>
#include <vcl/edit.hxx>
#include <vcl/fontcfg.hxx>
+#include <vcl/sysdata.hxx>
#ifndef _OSL_FILE_H
#include <osl/file.h>
#endif
@@ -7700,6 +7701,97 @@ FontMetric OutputDevice::GetFontMetric( const Font& rFont ) const
// -----------------------------------------------------------------------
+/** OutputDevice::GetSysFontData
+ *
+ * @param nFallbacklevel Fallback font level (0 = best matching font)
+ *
+ * Retrieve detailed font information in platform independent structure
+ *
+ * @return SystemFontData
+ **/
+SystemFontData OutputDevice::GetSysFontData(int nFallbacklevel) const
+{
+ SystemFontData aSysFontData;
+ aSysFontData.nSize = sizeof(aSysFontData);
+
+ if (!mpGraphics) ImplGetGraphics();
+ if (mpGraphics) aSysFontData = mpGraphics->GetSysFontData(nFallbacklevel);
+
+ return aSysFontData;
+}
+
+
+// -----------------------------------------------------------------------
+
+/** OutputDevice::GetSysTextLayoutData
+ *
+ * @param rStartPt Start point of the text
+ * @param rStr Text string that will be transformed into layout of glyphs
+ * @param nIndex Position in the string from where layout will be done
+ * @param nLen Length of the string
+ * @param pDXAry Custom layout adjustment data
+ *
+ * Export finalized glyph layout data as platform independent SystemTextLayoutData
+ * (see vcl/inc/vcl/sysdata.hxx)
+ *
+ * Only parameters rStartPt and rStr are mandatory, the rest is optional
+ * (default values will be used)
+ *
+ * @return SystemTextLayoutData
+ **/
+SystemTextLayoutData OutputDevice::GetSysTextLayoutData(const Point& rStartPt, const XubString& rStr, xub_StrLen nIndex, xub_StrLen nLen,
+ const sal_Int32* pDXAry) const
+{
+ DBG_TRACE( "OutputDevice::GetSysTextLayoutData()" );
+ DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
+
+ SystemTextLayoutData aSysLayoutData;
+ aSysLayoutData.nSize = sizeof(aSysLayoutData);
+ aSysLayoutData.rGlyphData.reserve( 256 );
+
+ if ( mpMetaFile ) {
+ if (pDXAry)
+ mpMetaFile->AddAction( new MetaTextArrayAction( rStartPt, rStr, pDXAry, nIndex, nLen ) );
+ else
+ mpMetaFile->AddAction( new MetaTextAction( rStartPt, rStr, nIndex, nLen ) );
+ }
+
+ if ( !IsDeviceOutputNecessary() ) return aSysLayoutData;
+
+ SalLayout* rLayout = ImplLayout( rStr, nIndex, nLen, rStartPt, 0, pDXAry, true );
+
+ // setup glyphs
+ Point aPos;
+ sal_GlyphId aGlyphId;
+ int nFallbacklevel = 0;
+ for( int nStart = 0; rLayout->GetNextGlyphs( 1, &aGlyphId, aPos, nStart ); )
+ {
+ // NOTE: Windows backend is producing unicode chars (ucs4), so on windows,
+ // ETO_GLYPH_INDEX is unusable, unless extra glyph conversion is made.
+
+ SystemGlyphData aGlyph;
+ aGlyph.index = static_cast<unsigned long> (aGlyphId & GF_IDXMASK);
+ aGlyph.x = aPos.X();
+ aGlyph.y = aPos.Y();
+ aSysLayoutData.rGlyphData.push_back(aGlyph);
+
+ int nLevel = (aGlyphId & GF_FONTMASK) >> GF_FONTSHIFT;
+ if (nLevel > nFallbacklevel && nLevel < MAX_FALLBACK)
+ nFallbacklevel = nLevel;
+ }
+
+ // Get font data
+ aSysLayoutData.aSysFontData = GetSysFontData(nFallbacklevel);
+ aSysLayoutData.orientation = rLayout->GetOrientation();
+
+ rLayout->Release();
+
+ return aSysLayoutData;
+}
+
+// -----------------------------------------------------------------------
+
+
long OutputDevice::GetMinKashida() const
{
DBG_TRACE( "OutputDevice::GetMinKashida()" );
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 0754f5c5b3dc..05067ee2d024 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -6680,6 +6680,7 @@ void PDFWriterImpl::drawHorizontalGlyphs(
appendHex( rGlyphs[nPos].m_nMappedGlyphId, aUnkernedLine );
// check for adjustment
double fTheoreticalGlyphWidth = rGlyphs[nPos].m_aPos.X() - rGlyphs[nPos-1].m_aPos.X();
+ fTheoreticalGlyphWidth = fabs( fTheoreticalGlyphWidth ); // #i100522# workaround until #i87686# gets fixed
fTheoreticalGlyphWidth = 1000.0 * fTheoreticalGlyphWidth / fXScale / double(nPixelFontHeight);
sal_Int32 nAdjustment = rGlyphs[nPos-1].m_nNativeWidth - sal_Int32(fTheoreticalGlyphWidth+0.5);
if( nAdjustment != 0 )
@@ -6902,10 +6903,16 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT
if( aAlignOffset.X() || aAlignOffset.Y() )
aAlignOffset = aRotScale.transform( aAlignOffset );
- if( bVertical )
- drawVerticalGlyphs( aGlyphs, aLine, aAlignOffset, aRotScale, fAngle, fXScale, fSkew, nFontHeight );
- else
- drawHorizontalGlyphs( aGlyphs, aLine, aAlignOffset, fAngle, fXScale, fSkew, nFontHeight, nPixelFontHeight );
+ /* #159153# do not emit an empty glyph vector; this can happen if e.g. the original
+ string contained only on of the UTF16 BOMs
+ */
+ if( ! aGlyphs.empty() )
+ {
+ if( bVertical )
+ drawVerticalGlyphs( aGlyphs, aLine, aAlignOffset, aRotScale, fAngle, fXScale, fSkew, nFontHeight );
+ else
+ drawHorizontalGlyphs( aGlyphs, aLine, aAlignOffset, fAngle, fXScale, fSkew, nFontHeight, nPixelFontHeight );
+ }
// end textobject
aLine.append( "ET\n" );
@@ -9297,14 +9304,24 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const
delete pStream;
aLine.append( "q " );
- m_aPages.back().appendMappedLength( (sal_Int32)rTargetArea.GetWidth(), aLine, false );
+ sal_Int32 nCheckWidth = 0;
+ m_aPages.back().appendMappedLength( (sal_Int32)rTargetArea.GetWidth(), aLine, false, &nCheckWidth );
aLine.append( " 0 0 " );
- m_aPages.back().appendMappedLength( (sal_Int32)rTargetArea.GetHeight(), aLine, true );
+ sal_Int32 nCheckHeight = 0;
+ m_aPages.back().appendMappedLength( (sal_Int32)rTargetArea.GetHeight(), aLine, true, &nCheckHeight );
aLine.append( ' ' );
m_aPages.back().appendPoint( rTargetArea.BottomLeft(), aLine );
aLine.append( " cm\n/Im" );
aLine.append( it->m_nObject );
aLine.append( " Do Q\n" );
+ if( nCheckWidth == 0 || nCheckHeight == 0 )
+ {
+ // #i97512# avoid invalid current matrix
+ aLine.setLength( 0 );
+ aLine.append( "\n%jpeg image /Im" );
+ aLine.append( it->m_nObject );
+ aLine.append( " scaled to zero size, omitted\n" );
+ }
writeBuffer( aLine.getStr(), aLine.getLength() );
OStringBuffer aObjName( 16 );
@@ -9325,14 +9342,24 @@ void PDFWriterImpl::drawBitmap( const Point& rDestPoint, const Size& rDestSize,
appendNonStrokingColor( rFillColor, aLine );
aLine.append( ' ' );
}
- m_aPages.back().appendMappedLength( (sal_Int32)rDestSize.Width(), aLine, false );
+ sal_Int32 nCheckWidth = 0;
+ m_aPages.back().appendMappedLength( (sal_Int32)rDestSize.Width(), aLine, false, &nCheckWidth );
aLine.append( " 0 0 " );
- m_aPages.back().appendMappedLength( (sal_Int32)rDestSize.Height(), aLine, true );
+ sal_Int32 nCheckHeight = 0;
+ m_aPages.back().appendMappedLength( (sal_Int32)rDestSize.Height(), aLine, true, &nCheckHeight );
aLine.append( ' ' );
m_aPages.back().appendPoint( rDestPoint + Point( 0, rDestSize.Height()-1 ), aLine );
aLine.append( " cm\n/Im" );
aLine.append( rBitmap.m_nObject );
aLine.append( " Do Q\n" );
+ if( nCheckWidth == 0 || nCheckHeight == 0 )
+ {
+ // #i97512# avoid invalid current matrix
+ aLine.setLength( 0 );
+ aLine.append( "\n%bitmap image /Im" );
+ aLine.append( rBitmap.m_nObject );
+ aLine.append( " scaled to zero size, omitted\n" );
+ }
writeBuffer( aLine.getStr(), aLine.getLength() );
}
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 0358b25ca153..a96d4dc64b89 100755
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -1292,10 +1292,10 @@ void GenericSalLayout::ApplyAsianKerning( const sal_Unicode* pStr, int nLength )
{
// ignore code ranges that are not affected by asian punctuation compression
const sal_Unicode cHere = pStr[n];
- if( (0x3000 != (cHere & 0xFF00)) && (0x2010 != (cHere & 0xFFF0)) || (0xFF00 != (cHere & 0xFF00)) )
+ if( ((0x3000 != (cHere & 0xFF00)) && (0x2010 != (cHere & 0xFFF0))) || (0xFF00 != (cHere & 0xFF00)) )
continue;
const sal_Unicode cNext = pStr[n+1];
- if( (0x3000 != (cNext & 0xFF00)) && (0x2010 != (cNext & 0xFFF0)) || (0xFF00 != (cNext & 0xFF00)) )
+ if( ((0x3000 != (cNext & 0xFF00)) && (0x2010 != (cNext & 0xFFF0))) || (0xFF00 != (cNext & 0xFF00)) )
continue;
// calculate compression values
@@ -1773,7 +1773,7 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
int nStartNew[ MAX_FALLBACK ];
int nCharPos[ MAX_FALLBACK ];
sal_Int32 nGlyphAdv[ MAX_FALLBACK ];
- int nValid[ MAX_FALLBACK ];
+ int nValid[ MAX_FALLBACK ] = {0};
sal_GlyphId nDummy;
Point aPos;
diff --git a/vcl/source/helper/smartid.cxx b/vcl/source/helper/smartid.cxx
index 7ac7abe0d18b..73ad6f89a21c 100755
--- a/vcl/source/helper/smartid.cxx
+++ b/vcl/source/helper/smartid.cxx
@@ -262,6 +262,6 @@ BOOL SmartId::operator < ( const SmartId& rRight ) const
if ( HasString() )
return rRight.HasString() && rRight.HasNumeric();
else
- return rRight.HasString() || !HasNumeric() && rRight.HasNumeric();
+ return rRight.HasString() || (!HasNumeric() && rRight.HasNumeric());
}
}
diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx
index 7dfc70c0fe32..34e831d2daf8 100644
--- a/vcl/source/window/accel.cxx
+++ b/vcl/source/window/accel.cxx
@@ -231,7 +231,8 @@ void Accelerator::ImplInsertAccel( USHORT nItemId, const KeyCode& rKeyCode,
USHORT nCode1;
USHORT nCode2;
USHORT nCode3;
- ImplGetKeyCode( rKeyCode.GetFunction(), nCode1, nCode2, nCode3 );
+ USHORT nCode4;
+ ImplGetKeyCode( rKeyCode.GetFunction(), nCode1, nCode2, nCode3, nCode4 );
if ( nCode1 )
ImplInsertAccel( nItemId, KeyCode( nCode1, nCode1 ), bEnable, pAutoAccel );
if ( nCode2 )
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index 90934b382a88..8c6bb2b76463 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -944,9 +944,16 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
Color aColor = bRound ? rStyleSettings.GetShadowColor()
: pDev->GetSettings().GetStyleSettings().GetMonoColor();
// when the MonoColor wasn't set, check face color
- if ( ( ( bRound && aColor.IsDark() ) || ( aColor == Color( COL_BLACK ) ) &&
- ( pDev->GetSettings().GetStyleSettings().GetFaceColor().IsDark() ) ) )
+ if (
+ (bRound && aColor.IsDark()) ||
+ (
+ (aColor == Color(COL_BLACK)) &&
+ (pDev->GetSettings().GetStyleSettings().GetFaceColor().IsDark())
+ )
+ )
+ {
aColor = Color( COL_WHITE );
+ }
ImplDrawDPILineRect( pDev, rRect, &aColor, bRound );
}
else
@@ -1183,7 +1190,7 @@ static void ImplDrawButton( OutputDevice* pDev, Rectangle& rRect,
aFillRect.Right(), aFillRect.Top() ) );
aFillRect.Top()++;
}
- if ( ((nStyle & BUTTON_DRAW_NOBOTTOMSHADOWBORDER | BUTTON_DRAW_FLAT) == (BUTTON_DRAW_NOBOTTOMSHADOWBORDER | BUTTON_DRAW_FLAT)) &&
+ if ( (( (nStyle & BUTTON_DRAW_NOBOTTOMSHADOWBORDER) | BUTTON_DRAW_FLAT) == (BUTTON_DRAW_NOBOTTOMSHADOWBORDER | BUTTON_DRAW_FLAT)) &&
!(nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED | BUTTON_DRAW_HIGHLIGHT)) )
{
pDev->SetFillColor( rStyleSettings.GetDarkShadowColor() );
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index c949a59cb222..1fc2b9be703a 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -347,7 +347,7 @@ void Dialog::ImplInit( Window* pParent, WinBits nStyle )
{
mpWindowImpl->mbFrame = TRUE;
mpWindowImpl->mbOverlapWin = TRUE;
- SystemWindow::ImplInit( pParent, nStyle & (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_CLOSEABLE | WB_STANDALONE) | WB_CLOSEABLE, NULL );
+ SystemWindow::ImplInit( pParent, (nStyle & (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_CLOSEABLE | WB_STANDALONE)) | WB_CLOSEABLE, NULL );
// Now set all style bits
mpWindowImpl->mnStyle = nStyle;
}
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index 1e9a3350c88e..392c2ceaa478 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -1166,7 +1166,7 @@ KeyEvent Window::GetActivationKey() const
nCode = KEY_A + (nAccel-'A');
else if( nAccel >= '0' && nAccel <= '9' )
nCode = KEY_0 + (nAccel-'0');
- KeyCode aKeyCode( nCode, FALSE, FALSE, TRUE );
+ KeyCode aKeyCode( nCode, FALSE, FALSE, TRUE, FALSE );
aKeyEvent = KeyEvent( nAccel, aKeyCode );
}
return aKeyEvent;
diff --git a/vcl/source/window/keycod.cxx b/vcl/source/window/keycod.cxx
index 042eac37aa41..77af28241cb3 100644
--- a/vcl/source/window/keycod.cxx
+++ b/vcl/source/window/keycod.cxx
@@ -74,13 +74,14 @@ static USHORT aImplKeyFuncTab[(KEYFUNC_FRONT+1)*3] =
// -----------------------------------------------------------------------
-void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3 )
+void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3, USHORT& rCode4 )
{
USHORT nIndex = (USHORT)eFunc;
- nIndex *= 3;
+ nIndex *= 4;
rCode1 = aImplKeyFuncTab[nIndex];
rCode2 = aImplKeyFuncTab[nIndex+1];
rCode3 = aImplKeyFuncTab[nIndex+2];
+ rCode4 = aImplKeyFuncTab[nIndex+3];
}
// =======================================================================
@@ -88,7 +89,7 @@ void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT&
KeyCode::KeyCode( KeyFuncType eFunction )
{
USHORT nDummy;
- ImplGetKeyCode( eFunction, nCode, nDummy, nDummy );
+ ImplGetKeyCode( eFunction, nCode, nDummy, nDummy, nDummy );
eFunc = eFunction;
}
@@ -111,7 +112,7 @@ KeyCode::KeyCode( const ResId& rResId )
if ( eFunc != KEYFUNC_DONTKNOW )
{
USHORT nDummy;
- ImplGetKeyCode( eFunc, nCode, nDummy, nDummy );
+ ImplGetKeyCode( eFunc, nCode, nDummy, nDummy, nDummy );
}
else
nCode = sal::static_int_cast<USHORT>(nKeyCode | nModifier);
@@ -151,8 +152,9 @@ KeyFuncType KeyCode::GetFunction() const
USHORT nKeyCode1;
USHORT nKeyCode2;
USHORT nKeyCode3;
- ImplGetKeyCode( (KeyFuncType)i, nKeyCode1, nKeyCode2, nKeyCode3 );
- if ( (nCompCode == nKeyCode1) || (nCompCode == nKeyCode2) || (nCompCode == nKeyCode3) )
+ USHORT nKeyCode4;
+ ImplGetKeyCode( (KeyFuncType)i, nKeyCode1, nKeyCode2, nKeyCode3, nKeyCode4 );
+ if ( (nCompCode == nKeyCode1) || (nCompCode == nKeyCode2) || (nCompCode == nKeyCode3) || (nCompCode == nKeyCode4) )
return (KeyFuncType)i;
}
}
diff --git a/vcl/source/window/keyevent.cxx b/vcl/source/window/keyevent.cxx
index e3a92194040f..e8474c6efa5d 100644
--- a/vcl/source/window/keyevent.cxx
+++ b/vcl/source/window/keyevent.cxx
@@ -49,7 +49,8 @@ KeyEvent::KeyEvent( const ::com::sun::star::awt::KeyEvent& rEvent )
rEvent.KeyCode,
(rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::SHIFT) != 0,
(rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD1) != 0,
- (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD2) != 0 );
+ (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD2) != 0,
+ (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD3) != 0);
mnRepeat = 0;
mnCharCode = rEvent.KeyChar;
}
@@ -64,6 +65,8 @@ void KeyEvent::InitKeyEvent( ::com::sun::star::awt::KeyEvent& rEvent ) const
rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1;
if( GetKeyCode().IsMod2() )
rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2;
+ if( GetKeyCode().IsMod3() )
+ rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD3;
rEvent.KeyCode = GetKeyCode().GetCode();
rEvent.KeyChar = GetCharCode();
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 1318f4fa8415..adbc2a8de06e 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2323,6 +2323,8 @@ Size Menu::ImplCalcSize( Window* pWin )
if ( !bIsMenuBar && ( ( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ) ) )
{
Size aImgSz = pData->aImage.GetSizePixel();
+ aImgSz.Height() += 4; // add a border for native marks
+ aImgSz.Width() += 4; // add a border for native marks
if ( aImgSz.Width() > aMaxImgSz.Width() )
aMaxImgSz.Width() = aImgSz.Width();
if ( aImgSz.Height() > aMaxImgSz.Height() )
@@ -2336,7 +2338,11 @@ Size Menu::ImplCalcSize( Window* pWin )
{
nCheckWidth = nMaxCheckWidth;
if (nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES)
- nWidth += nCheckWidth + nExtra * 2;
+ {
+ // checks / images take the same place
+ if( ! ( ( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ) ) )
+ nWidth += nCheckWidth + nExtra * 2;
+ }
}
// Text:
@@ -2397,16 +2403,14 @@ Size Menu::ImplCalcSize( Window* pWin )
nCheckPos = (USHORT)nExtra;
if (nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES)
{
- // non-NWF case has an implicit little extra space around
- // the symbol; NWF case has not, so image pos needs to
- // be distinct in this case
+ long nImgOrChkWidth = 0;
+ nImagePos = nCheckPos;
if( nMax > 0 ) // NWF case
- nImagePos = (USHORT)(nCheckPos + nMax + nExtra );
+ nImgOrChkWidth = nMax + nExtra;
else // non NWF case
- nImagePos = (USHORT)(nCheckPos + nFontHeight/2 + gfxExtra );
- nTextPos = (USHORT)(nImagePos+aMaxImgSz.Width());
- if ( aMaxImgSz.Width() )
- nTextPos = nTextPos + gfxExtra;
+ nImgOrChkWidth = nFontHeight/2 + gfxExtra;
+ nImgOrChkWidth = Max( nImgOrChkWidth, aMaxImgSz.Width() + gfxExtra );
+ nTextPos = (USHORT)(nImagePos + nImgOrChkWidth);
}
else
{
@@ -2464,6 +2468,45 @@ Size Menu::ImplCalcSize( Window* pWin )
return aSz;
}
+static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRect, bool i_bHighlight )
+{
+ BOOL bNativeOk = FALSE;
+ if( i_pWindow->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) )
+ {
+ ImplControlValue aControlValue;
+ Region aCtrlRegion( i_rRect );
+ ControlState nState = CTRL_STATE_PRESSED | CTRL_STATE_ENABLED;
+
+ aControlValue.setTristateVal( BUTTONVALUE_ON );
+
+ bNativeOk = i_pWindow->DrawNativeControl( CTRL_TOOLBAR, PART_BUTTON,
+ aCtrlRegion, nState, aControlValue,
+ rtl::OUString() );
+ }
+
+ if( ! bNativeOk )
+ {
+ const StyleSettings& rSettings = i_pWindow->GetSettings().GetStyleSettings();
+ if( i_bHighlight )
+ {
+ i_pWindow->Push( PUSH_ALL );
+ Color aCol = rSettings.GetMenuHighlightTextColor();
+ i_pWindow->SetFillColor( rSettings.GetMenuHighlightTextColor() );
+ if( aCol.IsDark() )
+ aCol.IncreaseLuminance( 128 );
+ else
+ aCol.DecreaseLuminance( 128 );
+ i_pWindow->SetLineColor( aCol );
+ Polygon aPoly( i_rRect );
+ PolyPolygon aPolyPoly( aPoly );
+ i_pWindow->DrawTransparent( aPolyPoly, 20 );
+ i_pWindow->Pop();
+ }
+ else
+ i_pWindow->DrawSelectionBackground( i_rRect, 1, FALSE, TRUE, FALSE );
+ }
+}
+
void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* pThisItemOnly, BOOL bHighlighted, bool bLayout ) const
{
// Fuer Symbole: nFontHeight x nFontHeight
@@ -2537,15 +2580,89 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
pWin->SetLineColor();
}
+ Rectangle aOuterCheckRect( Point( aPos.X()+nCheckPos, aPos.Y() ), Size( pData->aSz.Height(), pData->aSz.Height() ) );
+ aOuterCheckRect.Left() += 1;
+ aOuterCheckRect.Right() -= 1;
+ aOuterCheckRect.Top() += 1;
+ aOuterCheckRect.Bottom() -= 1;
+
+ // CheckMark
+ if ( !bLayout && !bIsMenuBar && pData->HasCheck() )
+ {
+ // draw selection transparent marker if checked
+ // onto that either a checkmark or the item image
+ // will be painted
+ // however do not do this if native checks will be painted since
+ // the selection color too often does not fit the theme's check and/or radio
+
+ if( ! ( ( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ) ) )
+ {
+ if ( pWin->IsNativeControlSupported( CTRL_MENU_POPUP,
+ (pData->nBits & MIB_RADIOCHECK)
+ ? PART_MENU_ITEM_CHECK_MARK
+ : PART_MENU_ITEM_RADIO_MARK ) )
+ {
+ ControlPart nPart = ((pData->nBits & MIB_RADIOCHECK)
+ ? PART_MENU_ITEM_RADIO_MARK
+ : PART_MENU_ITEM_CHECK_MARK);
+
+ ControlState nState = 0;
+
+ if ( pData->bChecked )
+ nState |= CTRL_STATE_PRESSED;
+
+ if ( pData->bEnabled )
+ nState |= CTRL_STATE_ENABLED;
+
+ if ( bHighlighted )
+ nState |= CTRL_STATE_SELECTED;
+
+ long nCtrlHeight = (pData->nBits & MIB_RADIOCHECK) ? nCheckHeight : nRadioHeight;
+ aTmpPos.X() = aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - nCtrlHeight)/2;
+ aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight)/2;
+
+ Rectangle aCheckRect( aTmpPos, Size( nCtrlHeight, nCtrlHeight ) );
+ pWin->DrawNativeControl( CTRL_MENU_POPUP, nPart,
+ Region( aCheckRect ),
+ nState,
+ ImplControlValue(),
+ OUString() );
+ }
+ else if ( pData->bChecked ) // by default do nothing for unchecked items
+ {
+ ImplPaintCheckBackground( pWin, aOuterCheckRect, pThisItemOnly && bHighlighted );
+
+ SymbolType eSymbol;
+ Size aSymbolSize;
+ if ( pData->nBits & MIB_RADIOCHECK )
+ {
+ eSymbol = SYMBOL_RADIOCHECKMARK;
+ aSymbolSize = Size( nFontHeight/2, nFontHeight/2 );
+ }
+ else
+ {
+ eSymbol = SYMBOL_CHECKMARK;
+ aSymbolSize = Size( (nFontHeight*25)/40, nFontHeight/2 );
+ }
+ aTmpPos.X() = aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - aSymbolSize.Width())/2;
+ aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - aSymbolSize.Height())/2;
+ Rectangle aRect( aTmpPos, aSymbolSize );
+ aDecoView.DrawSymbol( aRect, eSymbol, pWin->GetTextColor(), nSymbolStyle );
+ }
+ }
+ }
+
// Image:
if ( !bLayout && !bIsMenuBar && ( ( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ) ) )
{
// Don't render an image for a check thing
if ((nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES) || !pData->HasCheck() )
{
- aTmpPos.Y() = aPos.Y();
- aTmpPos.X() = aPos.X() + nImagePos;
- aTmpPos.Y() += (pData->aSz.Height()-pData->aImage.GetSizePixel().Height())/2;
+ if( pData->bChecked )
+ ImplPaintCheckBackground( pWin, aOuterCheckRect, pThisItemOnly && bHighlighted );
+ aTmpPos = aOuterCheckRect.TopLeft();
+ aTmpPos.X() += (aOuterCheckRect.GetWidth()-pData->aImage.GetSizePixel().Width())/2;
+ aTmpPos.Y() += (aOuterCheckRect.GetHeight()-pData->aImage.GetSizePixel().Height())/2;
pWin->DrawImage( aTmpPos, pData->aImage, nImageStyle );
}
}
@@ -2598,65 +2715,6 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
pWin->DrawCtrlText( aTmpPos, aAccText, 0, aAccText.Len(), nTextStyle );
}
- // CheckMark
- if ( !bLayout && !bIsMenuBar && pData->HasCheck() )
- {
- if ( pWin->IsNativeControlSupported( CTRL_MENU_POPUP,
- (pData->nBits & MIB_RADIOCHECK)
- ? PART_MENU_ITEM_CHECK_MARK
- : PART_MENU_ITEM_RADIO_MARK ) )
- {
- ControlPart nPart = ((pData->nBits & MIB_RADIOCHECK)
- ? PART_MENU_ITEM_RADIO_MARK
- : PART_MENU_ITEM_CHECK_MARK);
-
- ControlState nState = 0;
-
- if ( pData->bChecked )
- nState |= CTRL_STATE_PRESSED;
-
- if ( pData->bEnabled )
- nState |= CTRL_STATE_ENABLED;
-
- if ( bHighlighted )
- nState |= CTRL_STATE_SELECTED;
-
- aTmpPos.X() = aPos.X() + nCheckPos;
- aTmpPos.Y() = aPos.Y() + nCheckPos;
-
- long nCtrlHeight = (pData->nBits & MIB_RADIOCHECK) ? nCheckHeight : nRadioHeight;
- Rectangle aCheckRect( aTmpPos, Size( nCtrlHeight, nCtrlHeight ) );
- pWin->DrawNativeControl( CTRL_MENU_POPUP, nPart,
- Region( aCheckRect ),
- nState,
- ImplControlValue(),
- OUString() );
- }
- else if ( pData->bChecked ) // by default do nothing for unchecked items
- {
- Rectangle aRect;
- SymbolType eSymbol;
- aTmpPos.Y() = aPos.Y();
- aTmpPos.Y() += nExtra/2;
- aTmpPos.Y() += pData->aSz.Height() / 2;
- if ( pData->nBits & MIB_RADIOCHECK )
- {
- aTmpPos.X() = aPos.X() + nCheckPos;
- eSymbol = SYMBOL_RADIOCHECKMARK;
- aTmpPos.Y() -= nFontHeight/4;
- aRect = Rectangle( aTmpPos, Size( nFontHeight/2, nFontHeight/2 ) );
- }
- else
- {
- aTmpPos.X() = aPos.X() + nCheckPos;
- eSymbol = SYMBOL_CHECKMARK;
- aTmpPos.Y() -= nFontHeight/4;
- aRect = Rectangle( aTmpPos, Size( (nFontHeight*25)/40, nFontHeight/2 ) );
- }
- aDecoView.DrawSymbol( aRect, eSymbol, pWin->GetTextColor(), nSymbolStyle );
- }
- }
-
// SubMenu?
if ( !bLayout && !bIsMenuBar && pData->pSubMenu )
{
diff --git a/vcl/source/window/mouseevent.cxx b/vcl/source/window/mouseevent.cxx
index 90ca259cc425..a95b90f5e1d0 100644
--- a/vcl/source/window/mouseevent.cxx
+++ b/vcl/source/window/mouseevent.cxx
@@ -52,6 +52,8 @@ MouseEvent::MouseEvent( const ::com::sun::star::awt::MouseEvent& rEvent )
mnCode |= KEY_MOD1;
if( (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD2) != 0 )
mnCode |= KEY_MOD2;
+ if( (rEvent.Modifiers & ::com::sun::star::awt::KeyModifier::MOD3) != 0 )
+ mnCode |= KEY_MOD3;
}
if( rEvent.Buttons )
@@ -75,6 +77,8 @@ void MouseEvent::InitMouseEvent( ::com::sun::star::awt::MouseEvent& rEvent ) con
rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1;
if ( IsMod2() )
rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2;
+ if ( IsMod3() )
+ rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD3;
rEvent.Buttons = 0;
if ( IsLeft() )
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index a7a21fb840ad..1e66849db73a 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -1879,7 +1879,7 @@ void SplitWindow::ImplDrawButtonRect( const Rectangle& rRect, long nSize )
DrawPixel( Point( i+1, nCenter-2+1 ), rStyleSettings.GetShadowColor() );
}
i++;
- if ( (i < nEx1) || (i > nEx2 ) && (i < nRight-3) )
+ if ( (i < nEx1) || ((i > nEx2 ) && (i < nRight-3)) )
{
DrawPixel( Point( i, nCenter+2 ), rStyleSettings.GetLightColor() );
DrawPixel( Point( i+1, nCenter+2+1 ), rStyleSettings.GetShadowColor() );
@@ -1909,7 +1909,7 @@ void SplitWindow::ImplDrawButtonRect( const Rectangle& rRect, long nSize )
DrawPixel( Point( nCenter-2+1, i+1 ), rStyleSettings.GetShadowColor() );
}
i++;
- if ( (i < nEx1) || (i > nEx2 ) && (i < nBottom-3) )
+ if ( (i < nEx1) || ((i > nEx2 ) && (i < nBottom-3)) )
{
DrawPixel( Point( nCenter+2, i ), rStyleSettings.GetLightColor() );
DrawPixel( Point( nCenter+2+1, i+1 ), rStyleSettings.GetShadowColor() );
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index bfa456757272..07d56588c80e 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1703,6 +1703,8 @@ void ToolBox::ImplInitSettings( BOOL bFont,
SetBackground( aColor );
SetPaintTransparent( FALSE );
SetParentClipMode( 0 );
+
+ ImplUpdateImageList();
}
}
}
@@ -5053,7 +5055,7 @@ void ToolBox::StateChanged( StateChangedType nType )
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( FALSE, FALSE, TRUE ); // font, foreground, background
Invalidate();
}
}
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 9e1a6671460b..7fa8f76e1586 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -49,6 +49,9 @@
#include <vcl/unohelp.hxx>
#include <unotools/confignode.hxx>
+#include <vcl/ImageListProvider.hxx>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+
using namespace vcl;
using namespace rtl;
@@ -58,7 +61,10 @@ using namespace rtl;
// -----------------------------------------------------------------------
-ImplToolBoxPrivateData::ImplToolBoxPrivateData() : m_pLayoutData( NULL )
+ImplToolBoxPrivateData::ImplToolBoxPrivateData() :
+ m_pLayoutData( NULL ),
+ mpImageListProvider( NULL ),
+ meImageListType( vcl::IMAGELISTTYPE_UNKNOWN )
{
meButtonSize = TOOLBOX_BUTTONSIZE_DONTCARE;
mpMenu = new PopupMenu();
@@ -69,6 +75,7 @@ ImplToolBoxPrivateData::ImplToolBoxPrivateData() : m_pLayoutData( NULL )
maMenubuttonItem.meState = STATE_NOCHECK;
mnMenuButtonWidth = TB_MENUBUTTON_SIZE;
+
mbIsLocked = FALSE;
mbNativeButtons = FALSE;
mbIsPaintLocked = FALSE;
@@ -2402,4 +2409,29 @@ void ToolBox::WillUsePopupMode( BOOL b )
mpData->mbWillUsePopupMode = b;
}
+void ToolBox::ImplUpdateImageList()
+{
+ if (mpData->mpImageListProvider != NULL)
+ {
+ BOOL bIsDark = GetSettings().GetStyleSettings().GetFaceColor().IsDark();
+ try
+ {
+ ImageListType eType = bIsDark ? vcl::HIGHCONTRAST_YES : vcl::HIGHCONTRAST_NO;
+
+ if (eType != mpData->meImageListType)
+ {
+ vcl::IImageListProvider* pImageListProvider = mpData->mpImageListProvider;
+ SetImageList( pImageListProvider->getImageList(eType) );
+ mpData->meImageListType = eType;
+ }
+ }
+ catch (com::sun::star::lang::IllegalArgumentException &) {}
+ }
+}
+
+void ToolBox::SetImageListProvider(vcl::IImageListProvider* _pProvider)
+{
+ mpData->mpImageListProvider = _pProvider;
+ ImplUpdateImageList();
+}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index ec16b65cf41f..676375db10bf 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -497,24 +497,6 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
}
}
- // Detect if images in menus are allowed or not
- {
- sal_Bool bTmp = sal_False, bUseImagesInMenus = sal_True;
- utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
- vcl::unohelper::GetMultiServiceFactory(),
- OUString::createFromAscii( "org.openoffice.Office.Common/View/Menu" ) ); // note: case sensisitive !
- if ( aNode.isValid() )
- {
- ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString::createFromAscii( "ShowIconsInMenues" ) );
- if( aValue >>= bTmp )
- bUseImagesInMenus = bTmp;
- }
-
- aStyleSettings = rSettings.GetStyleSettings();
- aStyleSettings.SetUseImagesInMenus( bUseImagesInMenus );
- rSettings.SetStyleSettings( aStyleSettings );
- }
-
#ifdef DBG_UTIL
// Evt. AppFont auf Fett schalten, damit man feststellen kann,
// ob fuer die Texte auf anderen Systemen genuegend Platz
@@ -2541,12 +2523,15 @@ void Window::ImplInvalidateFrameRegion( const Region* pRegion, USHORT nFlags )
if ( !ImplIsOverlapWindow() )
{
Window* pTempWindow = this;
+ USHORT nTranspPaint = IsPaintTransparent() ? IMPL_PAINT_PAINT : 0;
do
{
pTempWindow = pTempWindow->ImplGetParent();
if ( pTempWindow->mpWindowImpl->mnPaintFlags & IMPL_PAINT_PAINTCHILDS )
break;
- pTempWindow->mpWindowImpl->mnPaintFlags |= IMPL_PAINT_PAINTCHILDS;
+ pTempWindow->mpWindowImpl->mnPaintFlags |= IMPL_PAINT_PAINTCHILDS | nTranspPaint;
+ if( ! pTempWindow->IsPaintTransparent() )
+ nTranspPaint = 0;
}
while ( !pTempWindow->ImplIsOverlapWindow() );
}
@@ -6526,7 +6511,10 @@ void Window::Show( BOOL bVisible, USHORT nFlags )
if ( !mpWindowImpl->mbFrame )
{
- ImplInvalidate( NULL, INVALIDATE_NOTRANSPARENT | INVALIDATE_CHILDREN );
+ USHORT nInvalidateFlags = INVALIDATE_CHILDREN;
+ if( ! IsPaintTransparent() )
+ nInvalidateFlags |= INVALIDATE_NOTRANSPARENT;
+ ImplInvalidate( NULL, nInvalidateFlags );
ImplGenerateMouseMove();
}
}
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index a8be05bf4909..8c69c2a45daf 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1622,8 +1622,10 @@ void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight )
ImplDestroyHelpWindow( true );
}
- if ( (nNewWidth > 0) && (nNewHeight > 0) ||
- pWindow->ImplGetWindow()->ImplGetWindowImpl()->mbAllResize )
+ if (
+ (nNewWidth > 0 && nNewHeight > 0) ||
+ pWindow->ImplGetWindow()->ImplGetWindowImpl()->mbAllResize
+ )
{
if ( (nNewWidth != pWindow->GetOutputWidthPixel()) || (nNewHeight != pWindow->GetOutputHeightPixel()) )
{
@@ -1849,11 +1851,15 @@ static void ImplHandleGetFocus( Window* pWindow )
// nicht alles flackert, wenn diese den Focus bekommen
if ( !pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId )
{
+ bool bCallDirect = ImplGetSVData()->mbIsTestTool;
pWindow->ImplGetWindowImpl()->mpFrameData->mbStartFocusState = !pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus;
- Application::PostUserEvent( pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId, LINK( pWindow, Window, ImplAsyncFocusHdl ) );
+ if( ! bCallDirect )
+ Application::PostUserEvent( pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId, LINK( pWindow, Window, ImplAsyncFocusHdl ) );
Window* pFocusWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
if ( pFocusWin && pFocusWin->ImplGetWindowImpl()->mpCursor )
pFocusWin->ImplGetWindowImpl()->mpCursor->ImplShow();
+ if( bCallDirect )
+ pWindow->ImplAsyncFocusHdl( NULL );
}
}
@@ -1887,15 +1893,19 @@ static void ImplHandleLoseFocus( Window* pWindow )
// Focus-Events zeitverzoegert ausfuehren, damit bei SystemChildFenstern
// nicht alles flackert, wenn diese den Focus bekommen
+ bool bCallDirect = ImplGetSVData()->mbIsTestTool;
if ( !pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId )
{
pWindow->ImplGetWindowImpl()->mpFrameData->mbStartFocusState = !pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus;
- Application::PostUserEvent( pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId, LINK( pWindow, Window, ImplAsyncFocusHdl ) );
+ if( ! bCallDirect )
+ Application::PostUserEvent( pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId, LINK( pWindow, Window, ImplAsyncFocusHdl ) );
}
Window* pFocusWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
if ( pFocusWin && pFocusWin->ImplGetWindowImpl()->mpCursor )
pFocusWin->ImplGetWindowImpl()->mpCursor->ImplHide();
+ if( bCallDirect )
+ pWindow->ImplAsyncFocusHdl( NULL );
}
// -----------------------------------------------------------------------
diff --git a/vcl/unx/gtk/a11y/atktext.cxx b/vcl/unx/gtk/a11y/atktext.cxx
index 60975174096a..1c839ed58839 100644
--- a/vcl/unx/gtk/a11y/atktext.cxx
+++ b/vcl/unx/gtk/a11y/atktext.cxx
@@ -322,9 +322,11 @@ text_wrapper_get_text_at_offset (AtkText *text,
* which is the same index as the first character of the next line. In atk the magic offset
* '-2' is used to cover this special case.
*/
- if( -2 == offset &&
- (ATK_TEXT_BOUNDARY_LINE_START == boundary_type) ||
- (ATK_TEXT_BOUNDARY_LINE_END == boundary_type) )
+ if (
+ -2 == offset &&
+ (ATK_TEXT_BOUNDARY_LINE_START == boundary_type ||
+ ATK_TEXT_BOUNDARY_LINE_END == boundary_type)
+ )
{
accessibility::XAccessibleMultiLineText* pMultiLineText = getMultiLineText( text );
if( pMultiLineText )
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index b06a601d177e..2692177c765a 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -174,21 +174,7 @@ extern "C"
pSalData->Init();
pSalData->initNWF();
- const char* pGtkModules = getenv( "GTK_MODULES" );
- if( pGtkModules )
- {
- rtl::OString aModules( pGtkModules );
- sal_Int32 nIndex = 0;
- while( nIndex >= 0 )
- {
- rtl::OString aToken = aModules.getToken( 0, ':', nIndex );
- if( aToken.equals( "gail" ) || aToken.equals( "atk-bridge" ) )
- {
- InitAtkBridge();
- break;
- }
- }
- }
+ InitAtkBridge();
return pInstance;
}
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 04d679d8d4f1..b4a0974a5c18 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -96,6 +96,7 @@ struct NWFWidgetData
GtkWidget * gMenuItemMenuWidget;
GtkWidget * gMenuItemCheckMenuWidget;
GtkWidget * gMenuItemRadioMenuWidget;
+ GtkWidget * gImageMenuItem;
GtkWidget * gTooltipPopup;
GtkWidget * gProgressBar;
GtkWidget * gTreeView;
@@ -131,6 +132,7 @@ struct NWFWidgetData
gMenuItemMenuWidget( NULL ),
gMenuItemCheckMenuWidget( NULL ),
gMenuItemRadioMenuWidget( NULL ),
+ gImageMenuItem( NULL ),
gTooltipPopup( NULL ),
gProgressBar( NULL ),
gTreeView( NULL ),
@@ -3404,6 +3406,11 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
else
aStyleSet.SetCursorBlinkTime( STYLE_CURSOR_NOBLINKTIME );
+ gboolean showmenuicons = true;
+ pSettings = gtk_widget_get_settings( gWidgetData[m_nScreen].gImageMenuItem );
+ g_object_get( pSettings, "gtk-menu-images", &showmenuicons, (char *)NULL );
+ aStyleSet.SetUseImagesInMenus( showmenuicons );
+
// set scrollbar settings
gint slider_width = 14;
gint trough_border = 1;
@@ -3843,10 +3850,12 @@ static void NWEnsureGTKMenu( int nScreen )
gWidgetData[nScreen].gMenuItemMenuWidget = gtk_menu_item_new_with_label( "b" );
gWidgetData[nScreen].gMenuItemCheckMenuWidget = gtk_check_menu_item_new_with_label( "b" );
gWidgetData[nScreen].gMenuItemRadioMenuWidget = gtk_radio_menu_item_new_with_label( NULL, "b" );
+ gWidgetData[nScreen].gImageMenuItem = gtk_image_menu_item_new();
gtk_menu_shell_append( GTK_MENU_SHELL( gWidgetData[nScreen].gMenuWidget ), gWidgetData[nScreen].gMenuItemMenuWidget );
gtk_menu_shell_append( GTK_MENU_SHELL( gWidgetData[nScreen].gMenuWidget ), gWidgetData[nScreen].gMenuItemCheckMenuWidget );
gtk_menu_shell_append( GTK_MENU_SHELL( gWidgetData[nScreen].gMenuWidget ), gWidgetData[nScreen].gMenuItemRadioMenuWidget );
+ gtk_menu_shell_append( GTK_MENU_SHELL( gWidgetData[nScreen].gMenuWidget ), gWidgetData[nScreen].gImageMenuItem );
// do what NWAddWidgetToCacheWindow does except adding to def container
gtk_widget_realize( gWidgetData[nScreen].gMenuWidget );
@@ -3861,10 +3870,14 @@ static void NWEnsureGTKMenu( int nScreen )
gtk_widget_realize( gWidgetData[nScreen].gMenuItemRadioMenuWidget );
gtk_widget_ensure_style( gWidgetData[nScreen].gMenuItemRadioMenuWidget );
+ gtk_widget_realize( gWidgetData[nScreen].gImageMenuItem );
+ gtk_widget_ensure_style( gWidgetData[nScreen].gImageMenuItem );
+
gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuWidget );
gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuItemMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemMenuWidget );
gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuItemCheckMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemCheckMenuWidget );
gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuItemRadioMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemRadioMenuWidget );
+ gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gImageMenuItem ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gImageMenuItem );
}
}
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 2cef815d1f71..9ad5d8e13705 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -45,9 +45,9 @@
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
-#include <prex.h>
+#include <tools/prex.h>
#include <X11/Xatom.h>
-#include <postx.h>
+#include <tools/postx.h>
#include <dlfcn.h>
#include <vcl/salbtype.hxx>
@@ -75,6 +75,13 @@
#define GSS_DBUS_INTERFACE "org.gnome.ScreenSaver"
#endif
+// make compile on gtk older than 2.10
+#if GTK_MINOR_VERSION < 10
+#define GDK_SUPER_MASK (1 << 26)
+#define GDK_HYPER_MASK (1 << 27)
+#define GDK_META_MASK (1 << 28)
+#endif
+
using namespace com::sun::star;
int GtkSalFrame::m_nFloats = 0;
@@ -88,6 +95,11 @@ static USHORT GetKeyModCode( guint state )
nCode |= KEY_MOD1;
if( (state & GDK_MOD1_MASK) )
nCode |= KEY_MOD2;
+
+ // Map Meta/Super keys to MOD3 modifier on all Unix systems
+ // except Mac OS X
+ if ( (state & GDK_META_MASK ) || ( state & GDK_SUPER_MASK ) )
+ nCode |= KEY_MOD3;
return nCode;
}
@@ -2800,7 +2812,7 @@ gboolean GtkSalFrame::signalMap( GtkWidget*, GdkEvent*, gpointer frame )
GTK_YIELD_GRAB();
- if( GetX11SalData()->isTestTool() )
+ if( ImplGetSVData()->mbIsTestTool )
{
/* #i76541# testtool needs the focus to be in a new document
* however e.g. metacity does not necessarily put the focus into
@@ -2938,7 +2950,8 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
if( pEvent->keyval == GDK_Shift_L || pEvent->keyval == GDK_Shift_R ||
pEvent->keyval == GDK_Control_L || pEvent->keyval == GDK_Control_R ||
pEvent->keyval == GDK_Alt_L || pEvent->keyval == GDK_Alt_R ||
- pEvent->keyval == GDK_Meta_L || pEvent->keyval == GDK_Meta_R )
+ pEvent->keyval == GDK_Meta_L || pEvent->keyval == GDK_Meta_R ||
+ pEvent->keyval == GDK_Super_L || pEvent->keyval == GDK_Super_R )
{
SalKeyModEvent aModEvt;
@@ -2987,6 +3000,18 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
nExtModMask = MODKEY_RSHIFT;
nModMask = KEY_SHIFT;
break;
+ // Map Meta/Super to MOD3 modifier on all Unix systems
+ // except Mac OS X
+ case GDK_Meta_L:
+ case GDK_Super_L:
+ nExtModMask = MODKEY_LMOD3;
+ nModMask = KEY_MOD3;
+ break;
+ case GDK_Meta_R:
+ case GDK_Super_R:
+ nExtModMask = MODKEY_RMOD3;
+ nModMask = KEY_MOD3;
+ break;
}
if( pEvent->type == GDK_KEY_RELEASE )
{
diff --git a/vcl/unx/headless/svpgdi.cxx b/vcl/unx/headless/svpgdi.cxx
index 4ee06961444a..cd3e286d167a 100644
--- a/vcl/unx/headless/svpgdi.cxx
+++ b/vcl/unx/headless/svpgdi.cxx
@@ -558,6 +558,22 @@ BOOL SvpSalGraphics::drawEPS( long, long, long, long, void*, ULONG )
return FALSE;
}
+SystemFontData SvpSalGraphics::GetSysFontData( int nFallbacklevel ) const
+{
+ SystemFontData aSysFontData;
+
+ if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1;
+ if (nFallbacklevel < 0 ) nFallbacklevel = 0;
+
+ aSysFontData.nSize = sizeof( SystemFontData );
+ aSysFontData.nFontId = 0;
+ aSysFontData.nFontFlags = 0;
+ aSysFontData.bFakeBold = false;
+ aSysFontData.bFakeItalic = false;
+ aSysFontData.bAntialias = true;
+ return aSysFontData;
+}
+
SystemGraphicsData SvpSalGraphics::GetGraphicsData() const
{
SystemGraphicsData aRes;
diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx
index 984a77cccfad..1c71704c0031 100644
--- a/vcl/unx/headless/svpgdi.hxx
+++ b/vcl/unx/headless/svpgdi.hxx
@@ -169,6 +169,7 @@ public:
virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
virtual SystemGraphicsData GetGraphicsData() const;
+ virtual SystemFontData GetSysFontData( int nFallbacklevel ) const;
};
#endif
diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx
index 2ff48966c765..eb342a130d85 100644
--- a/vcl/unx/headless/svppspgraphics.cxx
+++ b/vcl/unx/headless/svppspgraphics.cxx
@@ -1398,6 +1398,22 @@ bool PspGraphics::filterText( const String& rOrig, String& rNewText, xub_StrLen
return bRet && m_bSwallowFaxNo;
}
+SystemFontData PspGraphics::GetSysFontData( int nFallbacklevel ) const
+{
+ SystemFontData aSysFontData;
+
+ if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1;
+ if (nFallbacklevel < 0 ) nFallbacklevel = 0;
+
+ aSysFontData.nSize = sizeof( SystemFontData );
+ aSysFontData.nFontId = 0;
+ aSysFontData.nFontFlags = 0;
+ aSysFontData.bFakeBold = false;
+ aSysFontData.bFakeItalic = false;
+ aSysFontData.bAntialias = true;
+ return aSysFontData;
+}
+
SystemGraphicsData PspGraphics::GetGraphicsData() const
{
SystemGraphicsData aRes;
diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx
index ba7d690a9f90..81e4a29b8d55 100644
--- a/vcl/unx/headless/svppspgraphics.hxx
+++ b/vcl/unx/headless/svppspgraphics.hxx
@@ -194,7 +194,9 @@ public:
virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
virtual bool filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop );
+
virtual SystemGraphicsData GetGraphicsData() const;
+ virtual SystemFontData GetSysFontData( int nFallbacklevel ) const;
};
#endif // _SVP_PSPGRAPHICS_HXX
diff --git a/vcl/unx/inc/Xproto.h b/vcl/unx/inc/Xproto.h
index 83d717818d9e..553c32221406 100644
--- a/vcl/unx/inc/Xproto.h
+++ b/vcl/unx/inc/Xproto.h
@@ -33,7 +33,7 @@
#include "sal/config.h"
-#include "prex.h"
+#include <tools/prex.h>
#if defined __GNUC__
#pragma GCC system_header
@@ -47,6 +47,6 @@
#pragma enable_warn
#endif
-#include "postx.h"
+#include <tools/postx.h>
#endif
diff --git a/vcl/unx/inc/plugins/gtk/gtkdata.hxx b/vcl/unx/inc/plugins/gtk/gtkdata.hxx
index 970a8edf02c3..fd09bcca17e3 100644
--- a/vcl/unx/inc/plugins/gtk/gtkdata.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkdata.hxx
@@ -31,11 +31,11 @@
#ifndef _VCL_GTKDATA_HXX
#define _VCL_GTKDATA_HXX
-#include <prex.h>
+#include <tools/prex.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
-#include <postx.h>
+#include <tools/postx.h>
#include <saldisp.hxx>
#include <saldata.hxx>
diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
index 1ceec7fb0c70..74394c71e4b2 100644
--- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
@@ -31,12 +31,12 @@
#ifndef _VCL_GTKFRAME_HXX
#define _VCL_GTKFRAME_HXX
-#include <prex.h>
+#include <tools/prex.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
-#include <postx.h>
+#include <tools/postx.h>
#include <vcl/salframe.hxx>
#include <vcl/sysdata.hxx>
diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
index 5211367c355a..5bc7ab40b98e 100644
--- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
@@ -31,11 +31,11 @@
#ifndef _VCL_GTKGDI_HXX
#define _VCL_GTKGDI_HXX
-#include <prex.h>
+#include <tools/prex.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
-#include <postx.h>
+#include <tools/postx.h>
#include <salgdi.h>
diff --git a/vcl/unx/inc/prex.h b/vcl/unx/inc/prex.h
deleted file mode 100644
index 131e628efe2e..000000000000
--- a/vcl/unx/inc/prex.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: prex.h,v $
- * $Revision: 1.17 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _PREX_H
-#define _PREX_H
-
-#define Window XLIB_Window
-#define BYTE XLIB_BYTE
-#define INT8 XLIB_INT8
-#define INT64 XLIB_INT64
-#define BOOL XLIB_BOOL
-#define Font XLIB_Font
-#define Cursor XLIB_Cursor
-#define String XLIB_String
-#define KeyCode XLIB_KeyCode
-#define Region XLIB_Region
-#define Icon XLIB_Icon
-#define Time XLIB_Time
-#define Region XLIB_Region
-#define Boolean XLIB_Boolean
-
-#if defined __cplusplus
-extern "C" {
-#endif
-
-#if defined(LINUX) || defined(FREEBSD) // should really check for xfree86 or for X11R6.1 and higher
-#define __XKeyboardExtension__ 1
-#else
-#define __XKeyboardExtension__ 0
-#endif
-
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/StringDefs.h>
-#include <X11/extensions/Xrender.h>
-#if __XKeyboardExtension__
-#include <X11/XKBlib.h>
-#endif
-typedef unsigned long Pixel;
-
-#undef DestroyAll
-#define DestroyAll XLIB_DestroyAll
-#define XLIB_DestroyAll 0
-#undef String
-#define String XLIB_String
-
-#undef KeyCode
-#define KeyCode XLIB_KeyCode //undef in intrinsics
-
-#define __Ol_OlXlibExt_h__
-
-#endif
-
diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h
index 5c31d889453c..219cc5f0a8ff 100644
--- a/vcl/unx/inc/pspgraphics.h
+++ b/vcl/unx/inc/pspgraphics.h
@@ -197,6 +197,7 @@ public:
virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency );
virtual SystemGraphicsData GetGraphicsData() const;
+ virtual SystemFontData GetSysFontData( int nFallbacklevel ) const;
};
#endif // _VCL_PSPGRAPHICS_H
diff --git a/vcl/unx/inc/saldata.hxx b/vcl/unx/inc/saldata.hxx
index a4326990c464..2d09bd35649e 100644
--- a/vcl/unx/inc/saldata.hxx
+++ b/vcl/unx/inc/saldata.hxx
@@ -65,7 +65,6 @@ protected:
SalXLib *pXLib_;
SalDisplay *m_pSalDisplay;
pthread_t hMainThread_;
- bool m_bIsTesttool;
public:
X11SalData();
@@ -90,7 +89,6 @@ public:
void StartTimer( ULONG nMS );
inline void StopTimer();
void Timeout() const;
- bool isTestTool() const { return m_bIsTesttool; }
static int XErrorHdl( Display*, XErrorEvent* );
static int XIOErrorHdl( Display* );
diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h
index 55c8f8303052..bfe25b84d150 100644
--- a/vcl/unx/inc/salgdi.h
+++ b/vcl/unx/inc/salgdi.h
@@ -336,6 +336,7 @@ public:
long nHeight, sal_uInt8 nTransparency );
virtual SystemGraphicsData GetGraphicsData() const;
+ virtual SystemFontData GetSysFontData( int nFallbacklevel ) const;
/* use to handle GraphicsExpose/NoExpose after XCopyArea & friends
* if pFrame is not NULL, corresponding Paint events are generated
diff --git a/vcl/unx/inc/svunx.h b/vcl/unx/inc/svunx.h
index 7e6b98b33192..02572dea9084 100644
--- a/vcl/unx/inc/svunx.h
+++ b/vcl/unx/inc/svunx.h
@@ -31,8 +31,8 @@
#ifndef _SVUNX_H
#define _SVUNX_H
-#include <prex.h>
-#include <postx.h>
+#include <tools/prex.h>
+#include <tools/postx.h>
#endif
diff --git a/vcl/unx/inc/wmadaptor.hxx b/vcl/unx/inc/wmadaptor.hxx
index a6146748fb8a..314854926ba1 100644
--- a/vcl/unx/inc/wmadaptor.hxx
+++ b/vcl/unx/inc/wmadaptor.hxx
@@ -37,9 +37,9 @@
#include <tools/gen.hxx>
#include <vcl/dllapi.h>
#ifndef _PREX_H
-#include <prex.h>
+#include <tools/prex.h>
#include <X11/Xlib.h>
-#include <postx.h>
+#include <tools/postx.h>
#endif
#include <vector>
diff --git a/vcl/unx/inc/xfont.hxx b/vcl/unx/inc/xfont.hxx
index f2a0496f545d..8b87e268ca08 100644
--- a/vcl/unx/inc/xfont.hxx
+++ b/vcl/unx/inc/xfont.hxx
@@ -31,9 +31,9 @@
#define EXTENDED_FONTSTRUCT_HXX
#ifndef _XLIB_H_
-#include <prex.h>
+#include <tools/prex.h>
#include <X11/Xlib.h>
-#include <postx.h>
+#include <tools/postx.h>
#endif
#include <tools/ref.hxx>
#include <rtl/tencinfo.h>
diff --git a/vcl/unx/source/app/i18n_cb.cxx b/vcl/unx/source/app/i18n_cb.cxx
index b40cc888e7ac..fd8b3d5af559 100644
--- a/vcl/unx/source/app/i18n_cb.cxx
+++ b/vcl/unx/source/app/i18n_cb.cxx
@@ -34,10 +34,10 @@
#include <stdio.h>
#include <string.h>
#include <sal/alloca.h>
-#include <prex.h>
+#include <tools/prex.h>
#include <X11/Xlocale.h>
#include <X11/Xlib.h>
-#include <postx.h>
+#include <tools/postx.h>
#include <salunx.h>
#include <XIM.h>
diff --git a/vcl/unx/source/app/i18n_ic.cxx b/vcl/unx/source/app/i18n_ic.cxx
index 817fc2781e8c..cacffbcfdbb1 100644
--- a/vcl/unx/source/app/i18n_ic.cxx
+++ b/vcl/unx/source/app/i18n_ic.cxx
@@ -34,10 +34,10 @@
#include <stdio.h>
#include <sal/alloca.h>
-#include <prex.h>
+#include <tools/prex.h>
#include <X11/Xlocale.h>
#include <X11/Xlib.h>
-#include <postx.h>
+#include <tools/postx.h>
#include <salunx.h>
diff --git a/vcl/unx/source/app/i18n_im.cxx b/vcl/unx/source/app/i18n_im.cxx
index a47cefcef7dd..ae472d6323f4 100644
--- a/vcl/unx/source/app/i18n_im.cxx
+++ b/vcl/unx/source/app/i18n_im.cxx
@@ -44,11 +44,11 @@
#include <sal/alloca.h>
#endif
-#include <prex.h>
+#include <tools/prex.h>
#include <X11/Xlocale.h>
#include <X11/Xlib.h>
#include <XIM.h>
-#include <postx.h>
+#include <tools/postx.h>
#include <salunx.h>
#include <saldisp.hxx>
diff --git a/vcl/unx/source/app/i18n_status.cxx b/vcl/unx/source/app/i18n_status.cxx
index b8ef7e74e635..cdaa5b1a9cf0 100644
--- a/vcl/unx/source/app/i18n_status.cxx
+++ b/vcl/unx/source/app/i18n_status.cxx
@@ -36,10 +36,10 @@
#endif
#include <sal/alloca.h>
-#include <prex.h>
+#include <tools/prex.h>
#include <X11/Xlib.h>
#include <XIM.h>
-#include <postx.h>
+#include <tools/postx.h>
#include <salunx.h>
diff --git a/vcl/unx/source/app/keysymnames.cxx b/vcl/unx/source/app/keysymnames.cxx
index 4a2bf13af3e0..188f159300b0 100644
--- a/vcl/unx/source/app/keysymnames.cxx
+++ b/vcl/unx/source/app/keysymnames.cxx
@@ -32,9 +32,9 @@
#include "precompiled_vcl.hxx"
#ifndef SOLARIS
-#include <prex.h>
+#include <tools/prex.h>
#include <X11/XKBlib.h>
-#include <postx.h>
+#include <tools/postx.h>
#endif
#include <saldisp.hxx>
diff --git a/vcl/unx/source/app/randrwrapper.cxx b/vcl/unx/source/app/randrwrapper.cxx
index b079e2909e71..8d01b64d4680 100644
--- a/vcl/unx/source/app/randrwrapper.cxx
+++ b/vcl/unx/source/app/randrwrapper.cxx
@@ -31,9 +31,9 @@
#ifdef USE_RANDR
-#include "prex.h"
+#include <tools/prex.h>
#include <X11/extensions/Xrandr.h>
-#include "postx.h"
+#include <tools/postx.h>
#include "osl/module.h"
#include "rtl/ustring.hxx"
diff --git a/vcl/unx/source/app/saldata.cxx b/vcl/unx/source/app/saldata.cxx
index 0f9e21052c50..b1f5a113828f 100644
--- a/vcl/unx/source/app/saldata.cxx
+++ b/vcl/unx/source/app/saldata.cxx
@@ -277,21 +277,8 @@ X11SalData::X11SalData()
m_pSalDisplay = NULL;
m_pInstance = NULL;
m_pPlugin = NULL;
- m_bIsTesttool = false;
hMainThread_ = pthread_self();
-
- sal_uInt32 nArgs = osl_getCommandArgCount();
- for( sal_uInt32 i = 0; i < nArgs; i++ )
- {
- rtl::OUString aArg;
- osl_getCommandArg( i, &aArg.pData );
- if( aArg.equalsAscii( "-enableautomation" ) )
- {
- m_bIsTesttool = true;
- break;
- }
- }
}
X11SalData::~X11SalData()
diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx
index b599cf0895eb..328129ef3e29 100644
--- a/vcl/unx/source/app/saldisp.cxx
+++ b/vcl/unx/source/app/saldisp.cxx
@@ -52,7 +52,7 @@
#include <osl/module.h>
#endif
-#include <prex.h>
+#include <tools/prex.h>
#include <X11/cursorfont.h>
#include "salcursors.h"
#include "invert50.h"
@@ -81,7 +81,7 @@ Status XineramaGetInfo(Display*, int, XRectangle*, unsigned char*, int*);
#endif
#endif
-#include <postx.h>
+#include <tools/postx.h>
#include <salunx.h>
#include <sal/types.h>
@@ -3412,8 +3412,8 @@ Pixel SalColormap::GetPixel( SalColor nSalColor ) const
#ifdef DBG_UTIL
else
fprintf( stderr, "SalColormap::GetPixel() 0x%06lx=%lu 0x%06lx=%lu\n",
- nSalColor, aColor.pixel,
- nInversColor, aInversColor.pixel);
+ static_cast< unsigned long >(nSalColor), aColor.pixel,
+ static_cast< unsigned long >(nInversColor), aInversColor.pixel);
#endif
}
}
@@ -3423,7 +3423,7 @@ Pixel SalColormap::GetPixel( SalColor nSalColor ) const
#ifdef DBG_UTIL
fprintf( stderr, "SalColormap::GetPixel() !XAllocColor %lx\n",
- nSalColor );
+ static_cast< unsigned long >(nSalColor) );
#endif
}
@@ -3431,7 +3431,7 @@ Pixel SalColormap::GetPixel( SalColor nSalColor ) const
{
#ifdef DBG_UTIL
fprintf( stderr, "SalColormap::GetPixel() Palette empty %lx\n",
- nSalColor);
+ static_cast< unsigned long >(nSalColor));
#endif
return nSalColor;
}
diff --git a/vcl/unx/source/app/sm.cxx b/vcl/unx/source/app/sm.cxx
index 5bc307b0146f..7e4e16579623 100644
--- a/vcl/unx/source/app/sm.cxx
+++ b/vcl/unx/source/app/sm.cxx
@@ -40,9 +40,9 @@
#include <osl/process.h>
#include <osl/security.h>
-#include <prex.h>
+#include <tools/prex.h>
#include <X11/Xatom.h>
-#include <postx.h>
+#include <tools/postx.h>
#include <sm.hxx>
#include <saldata.hxx>
#include <saldisp.hxx>
diff --git a/vcl/unx/source/app/wmadaptor.cxx b/vcl/unx/source/app/wmadaptor.cxx
index 37015b6e58d6..d15433865450 100644
--- a/vcl/unx/source/app/wmadaptor.cxx
+++ b/vcl/unx/source/app/wmadaptor.cxx
@@ -43,11 +43,11 @@
#include <rtl/locale.h>
#include <osl/process.h>
-#include <prex.h>
+#include <tools/prex.h>
#include <X11/X.h>
#include <X11/Xatom.h>
#include <X11/Xresource.h>
-#include <postx.h>
+#include <tools/postx.h>
#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
diff --git a/vcl/unx/source/fontmanager/fontmanager.cxx b/vcl/unx/source/fontmanager/fontmanager.cxx
index 73e117550a14..a116749daf47 100644
--- a/vcl/unx/source/fontmanager/fontmanager.cxx
+++ b/vcl/unx/source/fontmanager/fontmanager.cxx
@@ -63,9 +63,7 @@
#include "parseAFM.hxx"
-#define NO_LIST
-#include "sft.h"
-#undef NO_LIST
+#include "sft.hxx"
#if OSL_DEBUG_LEVEL > 1
#include <sys/times.h>
@@ -90,6 +88,7 @@
#define PRINTER_METRICDIR "fontmetric"
+using namespace vcl;
using namespace utl;
using namespace psp;
using namespace osl;
diff --git a/vcl/unx/source/gdi/gcach_xpeer.hxx b/vcl/unx/source/gdi/gcach_xpeer.hxx
index 73a924c60439..3af34ffd9297 100644
--- a/vcl/unx/source/gdi/gcach_xpeer.hxx
+++ b/vcl/unx/source/gdi/gcach_xpeer.hxx
@@ -33,9 +33,9 @@
#include <vcl/glyphcache.hxx>
-#include <prex.h>
+#include <tools/prex.h>
#include <X11/extensions/Xrender.h>
-#include <postx.h>
+#include <tools/postx.h>
#include <vcl/dllapi.h>
diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx
index 4a4bccd86d2a..e8dfe391dc86 100644
--- a/vcl/unx/source/gdi/pspgraphics.cxx
+++ b/vcl/unx/source/gdi/pspgraphics.cxx
@@ -1504,6 +1504,22 @@ SystemGraphicsData PspGraphics::GetGraphicsData() const
return aRes;
}
+SystemFontData PspGraphics::GetSysFontData( int nFallbacklevel ) const
+{
+ SystemFontData aSysFontData;
+
+ if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1;
+ if (nFallbacklevel < 0 ) nFallbacklevel = 0;
+
+ aSysFontData.nSize = sizeof( SystemFontData );
+ aSysFontData.nFontId = 0;
+ aSysFontData.nFontFlags = 0;
+ aSysFontData.bFakeBold = false;
+ aSysFontData.bFakeItalic = false;
+ aSysFontData.bAntialias = true;
+ return aSysFontData;
+}
+
bool PspGraphics::supportsOperation( OutDevSupportType ) const
{
return false;
diff --git a/vcl/unx/source/gdi/salbmp.cxx b/vcl/unx/source/gdi/salbmp.cxx
index f70f445ed28c..4db44d664c16 100644
--- a/vcl/unx/source/gdi/salbmp.cxx
+++ b/vcl/unx/source/gdi/salbmp.cxx
@@ -37,9 +37,9 @@
#ifdef FREEBSD
#include <sys/types.h>
#endif
-#include <prex.h>
+#include <tools/prex.h>
#include "Xproto.h"
-#include <postx.h>
+#include <tools/postx.h>
#include <salunx.h>
#include <osl/endian.h>
#include <rtl/memory.h>
diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx
index 1d61dbe214a2..ddff0043e792 100644
--- a/vcl/unx/source/gdi/salgdi.cxx
+++ b/vcl/unx/source/gdi/salgdi.cxx
@@ -1072,7 +1072,15 @@ struct HalfTrapCompare
}
};
-typedef std::priority_queue< HalfTrapezoid, std::vector<HalfTrapezoid>, HalfTrapCompare > HTQueue;
+typedef std::priority_queue< HalfTrapezoid, std::vector<HalfTrapezoid>, HalfTrapCompare > HTQueueBase;
+// we need a priority queue with a reserve() to prevent countless reallocations
+class HTQueue
+: public HTQueueBase
+{
+public:
+ void reserve( size_t n ) { c.reserve( n ); }
+ int capacity() { return c.capacity(); }
+};
typedef std::vector<XTrapezoid> TrapezoidVector;
@@ -1137,15 +1145,16 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly
// don't bother with polygons outside of visible area
const basegfx::B2DRange aViewRange( 0, 0, GetGraphicsWidth(), GetGraphicsHeight() );
- basegfx::B2DRange aPolyRange = basegfx::tools::getRange( rPolyPoly );
- aPolyRange.intersect( aViewRange );
- if( aPolyRange.isEmpty() )
- return true;
+ const basegfx::B2DRange aPolyRange = basegfx::tools::getRange( rPolyPoly );
+ const bool bNeedViewClip = !aPolyRange.isInside( aViewRange );
+ if( !aPolyRange.overlaps( aViewRange ) )
+ return TRUE;
// convert the polypolygon to trapezoids
// first convert the B2DPolyPolygon to HalfTrapezoids
HTQueue aHTQueue;
+ aHTQueue.reserve( 16384 ); // TODO: use decomposed number of points
for( int nOuterPolyIdx = 0; nOuterPolyIdx < nPolygonCount; ++nOuterPolyIdx )
{
::basegfx::B2DPolygon aOuterPolygon = rPolyPoly.getB2DPolygon( nOuterPolyIdx );
@@ -1156,10 +1165,15 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly
// clip polygon against view
// (the call below for removing self intersections can be made much cheaper by this)
- // TODO: move clipping before subdivision when clipPolyonRange learns to handle curves
- const basegfx::B2DPolyPolygon aClippedPolygon = basegfx::tools::clipPolygonOnRange( aOuterPolygon, aViewRange, true, false );
- if( !aClippedPolygon.count() )
- return true;
+ basegfx::B2DPolyPolygon aClippedPolygon( aOuterPolygon );
+ if( bNeedViewClip )
+ {
+ // TODO: move clipping before subdivision when clipPolyonRange learns to handle curves
+ aClippedPolygon = basegfx::tools::clipPolygonOnRange( aOuterPolygon, aViewRange, true, false );
+ DBG_ASSERT( aClippedPolygon.count(), "polygon confirmed to overlap with view should not get here" );
+ if( !aClippedPolygon.count() )
+ continue;
+ }
// test and remove self intersections
// TODO: make code intersection save, then remove this test
@@ -1172,6 +1186,8 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly
if( !nPointCount )
continue;
+ aHTQueue.reserve( aHTQueue.size() + 8 * nPointCount );
+
// convert polygon point pairs to HalfTrapezoids
// connect the polygon point with the first one if needed
XPointFixed aOldXPF = { 0, 0 };
@@ -1385,6 +1401,7 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly
rRenderPeer.FillRectangle( PictOpSrc, rEntry.m_aPicture, &aRenderColor, 0, 0, 1, 1 );
// notify xrender of target drawable
+ // TODO: cache the matching xrender picture in the X11SalGraphics
Picture aDst = rRenderPeer.CreatePicture( hDrawable_, pVisualFormat, 0, NULL );
// set clipping
@@ -1396,6 +1413,10 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly
rRenderPeer.CompositeTrapezoids( PictOpOver,
rEntry.m_aPicture, aDst, pMaskFormat, 0, 0, &aTrapVector[0], aTrapVector.size() );
+ // release xrender-counterpart of target drawable
+ // TODO: use scoped xrender picture
+ rRenderPeer.FreePicture( aDst );
+
return TRUE;
}
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index e2c41b52006b..9cbd9a075dff 100644
--- a/vcl/unx/source/gdi/salgdi3.cxx
+++ b/vcl/unx/source/gdi/salgdi3.cxx
@@ -50,6 +50,7 @@
#include "pspgraphics.h"
#include "salvd.h"
#include "xfont.hxx"
+#include <vcl/sysdata.hxx>
#include "xlfd_attr.hxx"
#include "xlfd_smpl.hxx"
#include "xlfd_extd.hxx"
@@ -797,7 +798,11 @@ CairoWrapper::CairoWrapper()
if( !XQueryExtension( GetX11SalData()->GetDisplay()->GetDisplay(), "RENDER", &nDummy, &nDummy, &nDummy ) )
return;
+#ifdef MACOSX
+ OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libcairo.2.dylib" ));
+#else
OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libcairo.so.2" ));
+#endif
mpCairoLib = osl_loadModule( aLibName.pData, SAL_LOADMODULE_DEFAULT );
if( !mpCairoLib )
return;
@@ -1703,6 +1708,31 @@ SalLayout* X11SalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe
//--------------------------------------------------------------------------
+SystemFontData X11SalGraphics::GetSysFontData( int nFallbacklevel ) const
+{
+ SystemFontData aSysFontData;
+ aSysFontData.nSize = sizeof( SystemFontData );
+ aSysFontData.nFontId = 0;
+
+ if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1;
+ if (nFallbacklevel < 0 ) nFallbacklevel = 0;
+
+ if (mpServerFont[nFallbacklevel] != NULL)
+ {
+ ServerFont* rFont = mpServerFont[nFallbacklevel];
+ aSysFontData.nFontId = rFont->GetFtFace();
+ aSysFontData.nFontFlags = rFont->GetLoadFlags();
+ aSysFontData.bFakeBold = rFont->NeedsArtificialBold();
+ aSysFontData.bFakeItalic = rFont->NeedsArtificialItalic();
+ aSysFontData.bAntialias = rFont->GetAntialiasAdvice();
+ aSysFontData.bVerticalCharacterType = rFont->GetFontSelData().mbVertical;
+ }
+
+ return aSysFontData;
+}
+
+//--------------------------------------------------------------------------
+
BOOL X11SalGraphics::CreateFontSubset(
const rtl::OUString& rToFile,
const ImplFontData* pFont,
diff --git a/vcl/unx/source/gdi/salvd.cxx b/vcl/unx/source/gdi/salvd.cxx
index 3e00dcb63bef..915c42661fdc 100644
--- a/vcl/unx/source/gdi/salvd.cxx
+++ b/vcl/unx/source/gdi/salvd.cxx
@@ -31,9 +31,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <prex.h>
+#include <tools/prex.h>
#include <X11/extensions/Xrender.h>
-#include <postx.h>
+#include <tools/postx.h>
#include <salunx.h>
#include <saldata.hxx>
diff --git a/vcl/unx/source/gdi/xrender_peer.hxx b/vcl/unx/source/gdi/xrender_peer.hxx
index 24abd9d239e2..f1e2fd77a273 100644
--- a/vcl/unx/source/gdi/xrender_peer.hxx
+++ b/vcl/unx/source/gdi/xrender_peer.hxx
@@ -31,9 +31,9 @@
#ifndef _SV_XRENDER_PEER_HXX
#define _SV_XRENDER_PEER_HXX
-#include <prex.h>
+#include <tools/prex.h>
#include <X11/extensions/Xrender.h>
-#include <postx.h>
+#include <tools/postx.h>
#include <vcl/salgtype.hxx>
#include <osl/module.h>
diff --git a/vcl/unx/source/plugadapt/salplug.cxx b/vcl/unx/source/plugadapt/salplug.cxx
index d76977944c11..2177c9549eff 100644
--- a/vcl/unx/source/plugadapt/salplug.cxx
+++ b/vcl/unx/source/plugadapt/salplug.cxx
@@ -37,9 +37,9 @@
#include <rtl/ustrbuf.hxx>
#include <svunx.h>
-#include <prex.h>
+#include <tools/prex.h>
#include <X11/Xatom.h>
-#include <postx.h>
+#include <tools/postx.h>
#include <vcl/salinst.hxx>
#include <saldata.hxx>
@@ -101,21 +101,7 @@ static SalInstance* tryInstance( const OUString& rModuleBase )
*/
if( rModuleBase.equalsAscii("gtk") )
{
- const char* gtk_modules = getenv( "GTK_MODULES" );
- if( gtk_modules )
- {
- rtl::OString aModules( gtk_modules );
- sal_Int32 nIndex = 0;
- while( nIndex >= 0 )
- {
- rtl::OString aToken = aModules.getToken( 0, ':', nIndex );
- if( aToken.equals( "atk-bridge" ) )
- {
- pCloseModule = NULL;
- break;
- }
- }
- }
+ pCloseModule = NULL;
}
GetSalData()->m_pPlugin = aMod;
diff --git a/vcl/unx/source/printergfx/glyphset.cxx b/vcl/unx/source/printergfx/glyphset.cxx
index 0d26a66cac2f..2a35e975cbab 100644
--- a/vcl/unx/source/printergfx/glyphset.cxx
+++ b/vcl/unx/source/printergfx/glyphset.cxx
@@ -34,9 +34,7 @@
#include "glyphset.hxx"
#include "psputil.hxx"
-#define NO_LIST
-#include "sft.h"
-#undef NO_LIST
+#include "sft.hxx"
#include "vcl/printergfx.hxx"
#include "vcl/fontmanager.hxx"
@@ -51,6 +49,7 @@
#include <set>
#include <map>
+using namespace vcl;
using namespace psp;
using namespace rtl;
diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx
index 8f2bccebc443..22e43999caa6 100644
--- a/vcl/unx/source/window/salframe.cxx
+++ b/vcl/unx/source/window/salframe.cxx
@@ -36,7 +36,7 @@
#include <stdlib.h>
#include <unistd.h>
-#include "prex.h"
+#include <tools/prex.h>
#include <X11/Xatom.h>
#include <X11/keysym.h>
#include "FWS.hxx"
@@ -44,7 +44,7 @@
#ifndef SOLARIS
#include <X11/extensions/dpms.h>
#endif
-#include "postx.h"
+#include <tools/postx.h>
#include "salunx.h"
#include "saldata.hxx"
@@ -2799,6 +2799,11 @@ static USHORT sal_GetCode( int state )
if( state & Mod1Mask )
nCode |= KEY_MOD2;
+ // Map Meta/Super modifier to MOD3 on all Unix systems
+ // except Mac OS X
+ if( (state & Mod3Mask) )
+ nCode |= KEY_MOD3;
+
return nCode;
}
@@ -3167,7 +3172,8 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
if( nKeySym == XK_Shift_L || nKeySym == XK_Shift_R
|| nKeySym == XK_Control_L || nKeySym == XK_Control_R
|| nKeySym == XK_Alt_L || nKeySym == XK_Alt_R
- || nKeySym == XK_Meta_L || nKeySym == XK_Meta_R )
+ || nKeySym == XK_Meta_L || nKeySym == XK_Meta_R
+ || nKeySym == XK_Super_L || nKeySym == XK_Super_R )
{
SalKeyModEvent aModEvt;
aModEvt.mnModKeyCode = 0;
@@ -3211,6 +3217,18 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
nExtModMask = MODKEY_RSHIFT;
nModMask = KEY_SHIFT;
break;
+ // Map Meta/Super keys to MOD3 modifier on all Unix systems
+ // except Mac OS X
+ case XK_Meta_L:
+ case XK_Super_L:
+ nExtModMask = MODKEY_LMOD3;
+ nModMask = KEY_MOD3;
+ break;
+ case XK_Meta_R:
+ case XK_Super_R:
+ nExtModMask = MODKEY_RMOD3;
+ nModMask = KEY_MOD3;
+ break;
}
if( pEvent->type == KeyRelease )
{
diff --git a/vcl/unx/source/window/salobj.cxx b/vcl/unx/source/window/salobj.cxx
index fd3a12ed2d34..eed6264f00bc 100644
--- a/vcl/unx/source/window/salobj.cxx
+++ b/vcl/unx/source/window/salobj.cxx
@@ -31,10 +31,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <prex.h>
+#include <tools/prex.h>
#include <X11/Xlib.h>
#include <X11/extensions/shape.h>
-#include <postx.h>
+#include <tools/postx.h>
#include <salunx.h>
#include <salstd.hxx>
@@ -474,6 +474,8 @@ static USHORT sal_GetCode( int state )
nCode |= KEY_MOD1;
if( state & Mod1Mask )
nCode |= KEY_MOD2;
+ if( state & Mod3Mask )
+ nCode |= KEY_MOD3;
return nCode;
}
diff --git a/vcl/util/linksvp/makefile.mk b/vcl/util/linksvp/makefile.mk
index 8a3c840ba627..8e7d6f35ef83 100644
--- a/vcl/util/linksvp/makefile.mk
+++ b/vcl/util/linksvp/makefile.mk
@@ -56,13 +56,7 @@ SHL1STDLIBS=\
$(VCLLIB)\
$(BASEBMPLIB)\
$(BASEGFXLIB)\
- $(SOTLIB) \
- $(UNOTOOLSLIB) \
$(TOOLSLIB) \
- $(COMPHELPERLIB) \
- $(UCBHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
$(VOSLIB) \
$(SALLIB)
.ENDIF # GUIBASE unx
diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk
index 96cf50504ef0..08d6f9197f28 100644
--- a/vcl/util/makefile.mk
+++ b/vcl/util/makefile.mk
@@ -190,8 +190,6 @@ SHL1STDLIBS+= \
$(BASEBMPLIB) \
-lAppleRemote$(DLLPOSTFIX)
-SHL1STDLIBS+= \
- -framework QTKit
LIB1FILES+= \
$(SLB)$/sala11y.lib
.ENDIF
@@ -266,13 +264,7 @@ SHL2DEPN=$(SHL1IMPLIBN) $(SHL1TARGETN)
# libs for generic plugin
SHL2STDLIBS=\
$(VCLLIB)\
- $(SOTLIB) \
- $(UNOTOOLSLIB) \
$(TOOLSLIB) \
- $(COMPHELPERLIB) \
- $(UCBHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
$(VOSLIB) \
$(BASEGFXLIB) \
$(SALLIB)
@@ -346,11 +338,7 @@ SHL4NOCHECK=TRUE
SHL4STDLIBS+=-l$(SHL2TARGET)
SHL4STDLIBS+=\
$(VCLLIB) \
- $(SOTLIB) \
- $(UNOTOOLSLIB) \
$(TOOLSLIB) \
- $(COMPHELPERLIB) \
- $(UCBHELPERLIB) \
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(VOSLIB) \
diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h
index f9d4681e0e6e..0475ea4a193e 100644
--- a/vcl/win/inc/salgdi.h
+++ b/vcl/win/inc/salgdi.h
@@ -352,6 +352,7 @@ public:
virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
virtual SystemGraphicsData GetGraphicsData() const;
+ virtual SystemFontData GetSysFontData( int nFallbacklevel ) const;
};
// Init/Deinit Graphics
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index 70701e2ee19a..99f276faa964 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -34,6 +34,10 @@
#include <string.h>
#include <malloc.h>
+#include <tools/prewin.h>
+#include <windows.h>
+#include <tools/postwin.h>
+#include <vcl/sysdata.hxx>
#include "tools/svwin.h"
#include "wincomp.hxx"
@@ -64,8 +68,7 @@
#include "basegfx/polygon/b2dpolypolygon.hxx"
#include "basegfx/matrix/b2dhommatrix.hxx"
-#include <list.h>
-#include <sft.h>
+#include "sft.hxx"
#ifdef GCP_KERN_HACK
#include <algorithm>
@@ -76,6 +79,8 @@
#include <map>
+using namespace vcl;
+
static const int MAXFONTHEIGHT = 2048;
// -----------
@@ -2848,3 +2853,26 @@ void WinSalGraphics::DrawServerFontLayout( const ServerFontLayout& )
{}
//--------------------------------------------------------------------------
+
+SystemFontData WinSalGraphics::GetSysFontData( int nFallbacklevel ) const
+{
+ SystemFontData aSysFontData;
+
+ if (nFallbacklevel >= MAX_FALLBACK) nFallbacklevel = MAX_FALLBACK - 1;
+ if (nFallbacklevel < 0 ) nFallbacklevel = 0;
+
+ aSysFontData.nSize = sizeof( SystemFontData );
+ aSysFontData.hFont = mhFonts[nFallbacklevel];
+ aSysFontData.bFakeBold = false;
+ aSysFontData.bFakeItalic = false;
+ aSysFontData.bAntialias = true;
+ aSysFontData.bVerticalCharacterType = false;
+
+ OSL_TRACE("\r\n:WinSalGraphics::GetSysFontData(): FontID: %p, Fallback level: %d",
+ aSysFontData.hFont,
+ nFallbacklevel);
+
+ return aSysFontData;
+}
+
+//--------------------------------------------------------------------------
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 34900aaa951a..0689b8710655 100755
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -36,7 +36,7 @@
#include "salgdi.h"
#include "saldata.hxx"
// for GetMirroredChar
-#include "sft.h"
+#include "sft.hxx"
#include "vcl/sallayout.hxx"
#include "vcl/svapp.hxx"
@@ -2441,9 +2441,9 @@ void UniscribeLayout::ApplyDXArray( const ImplLayoutArgs& rArgs )
if( rVisualItem.IsRTL() )
{
for( i = rVisualItem.mnMinGlyphPos; i < rVisualItem.mnEndGlyphPos; ++i )
- if ( (1U << mpVisualAttrs[i].uJustification) & 0xFF89 ) // any Arabic justification ?
- { // the last SCRIPT_JUSTIFY_xxx
- // yes // == 15 (usp 1.6)
+ if ( (1U << mpVisualAttrs[i].uJustification) & 0xFF82 ) // any Arabic justification
+ { // excluding SCRIPT_JUSTIFY_NONE
+ // yes
rVisualItem.mbHasKashidas = true;
// so prepare for kashida handling
InitKashidaHandling();
@@ -2509,10 +2509,14 @@ void UniscribeLayout::ApplyDXArray( const ImplLayoutArgs& rArgs )
for( i = nMinGlyphPos; i < nEndGlyphPos; ++i )
{
const int nXOffsetAdjust = mpJustifications[i] - mpGlyphAdvances[i];
- if( i == nMinGlyphPos )
+ // #i99862# skip diacritics, we mustn't add extra justification to diacritics
+ int nIdxAdd = i - 1;
+ while( (nIdxAdd >= nMinGlyphPos) && !mpGlyphAdvances[nIdxAdd] )
+ --nIdxAdd;
+ if( nIdxAdd < nMinGlyphPos )
rVisualItem.mnXOffset += nXOffsetAdjust;
else
- mpJustifications[i-1] += nXOffsetAdjust;
+ mpJustifications[nIdxAdd] += nXOffsetAdjust;
mpJustifications[i] -= nXOffsetAdjust;
}
}
@@ -2540,8 +2544,8 @@ void UniscribeLayout::KashidaItemFix( int nMinGlyphPos, int nEndGlyphPos )
{
// check for vowels
if( (i > nMinGlyphPos && !mpGlyphAdvances[ i-1 ])
- && (1U << mpVisualAttrs[i].uJustification) & 0xFF89 )
- {
+ && (1U << mpVisualAttrs[i].uJustification) & 0xFF83 ) // all Arabic justifiction types
+ { // including SCRIPT_JUSTIFY_NONE
// vowel, we do it like ScriptJustify does
// the vowel gets the extra width
long nSpaceAdded = mpJustifications[ i ] - mpGlyphAdvances[ i ];
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index fd0f065ce2bc..140e506686fc 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -3703,10 +3703,17 @@ BOOL WinSalFrame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangT
BYTE vkeycode = LOBYTE(scan);
BYTE shiftstate = HIBYTE(scan);
+ // Last argument is set to FALSE, because there's no decission made
+ // yet which key should be assigned to MOD3 modifier on Windows.
+ // Windows key - user's can be confused, because it should display
+ // Windows menu (applies to both left/right key)
+ // Menu key - this key is used to display context menu
+ // AltGr key - probably it has no sense
rKeyCode = KeyCode( ImplSalGetKeyCode( vkeycode ),
(shiftstate & 0x01) ? TRUE : FALSE, // shift
(shiftstate & 0x02) ? TRUE : FALSE, // ctrl
- (shiftstate & 0x04) ? TRUE : FALSE ); // alt
+ (shiftstate & 0x04) ? TRUE : FALSE, // alt
+ FALSE );
bRet = TRUE;
}
}