summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--l10ntools/java/jpropex/java/JPropEx.java11
-rw-r--r--l10ntools/java/jpropex/java/SdfData.java2
-rw-r--r--l10ntools/java/jpropex/java/SdfEntity.java1
-rw-r--r--l10ntools/prj/d.lst3
-rw-r--r--l10ntools/scripts/localize.pl124
-rw-r--r--l10ntools/scripts/tool/l10ntool.py3
-rw-r--r--l10ntools/scripts/tool/xhtex.py7
-rw-r--r--svtools/source/brwbox/brwbox2.cxx7
-rwxr-xr-xvcl/aqua/inc/salframeview.h4
-rwxr-xr-xvcl/aqua/source/window/salframeview.mm65
-rw-r--r--vcl/source/gdi/metaact.cxx2
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/outdev2.cxx11
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx6
-rw-r--r--vcl/source/window/dlgctrl.cxx101
-rw-r--r--vcl/unx/source/fontmanager/fontconfig.cxx17
-rw-r--r--vcl/unx/source/gdi/pspgraphics.cxx11
16 files changed, 167 insertions, 208 deletions
diff --git a/l10ntools/java/jpropex/java/JPropEx.java b/l10ntools/java/jpropex/java/JPropEx.java
index f068f93ad18b..9ff8bf96fe44 100644
--- a/l10ntools/java/jpropex/java/JPropEx.java
+++ b/l10ntools/java/jpropex/java/JPropEx.java
@@ -141,9 +141,12 @@ public class JPropEx
private SdfEntity prepareSdfObj( String filename )
{
- String path = makeAbs( filename );
- //String path = makeAbs( inputFileArg );
- path = path.replace( rootArg + "/" , "" );
+ String path = makeAbs( filename ).trim();
+ String myRootArg = makeAbs( rootArg ).trim();
+ myRootArg = myRootArg.replace( "\\","/");
+ myRootArg += "/";
+ path = path.replace("\\","/");
+ path = path.replace( myRootArg, "" );
path = path.replace("/","\\");
// TODO: Make this static
java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -176,7 +179,7 @@ public class JPropEx
{
BufferedReader in = new BufferedReader( new FileReader( filename.substring( 1 ) ) );
while( in.ready() )
- lines.add( in.readLine() );
+ lines.add( in.readLine().trim() );
}
catch( IOException e )
{
diff --git a/l10ntools/java/jpropex/java/SdfData.java b/l10ntools/java/jpropex/java/SdfData.java
index 6f79909df1b2..98eddbeca20f 100644
--- a/l10ntools/java/jpropex/java/SdfData.java
+++ b/l10ntools/java/jpropex/java/SdfData.java
@@ -68,7 +68,7 @@ public class SdfData
BufferedReader in;
try
{
- in = new BufferedReader( new FileReader( filename ) );
+ in = new BufferedReader( new InputStreamReader( new FileInputStream( filename ), "UTF-8" ) );
SdfEntity entity;
while( in.ready() )
{
diff --git a/l10ntools/java/jpropex/java/SdfEntity.java b/l10ntools/java/jpropex/java/SdfEntity.java
index c2f6a5d788b1..7723238815e7 100644
--- a/l10ntools/java/jpropex/java/SdfEntity.java
+++ b/l10ntools/java/jpropex/java/SdfEntity.java
@@ -97,7 +97,6 @@ public class SdfEntity implements Cloneable{
}
public void setProperties( String line ){
-
if( line != null )
{
String[] splitted = line.split("\t",15);
diff --git a/l10ntools/prj/d.lst b/l10ntools/prj/d.lst
index 9d493e1e9673..29dd21cee543 100644
--- a/l10ntools/prj/d.lst
+++ b/l10ntools/prj/d.lst
@@ -59,7 +59,8 @@ mkdir: %_DEST%\bin%_EXT%\help\com\sun\star\help
..\%__SRC%\bin\sdf.pyc %_DEST%\bin%_EXT%\sdf.pyc
..\%__SRC%\bin\xhtex.py %_DEST%\bin%_EXT%\xhtex.py
..\%__SRC%\bin\xtxex.py %_DEST%\bin%_EXT%\xtxex.py
-
+..\%__SRC%\bin\xhtex.pyc %_DEST%\bin%_EXT%\xhtex.pyc
+..\%__SRC%\bin\xtxex.pyc %_DEST%\bin%_EXT%\xtxex.pyc
..\inc\export.hxx %_DEST%\inc%_EXT%\l10ntools\export.hxx
..\inc\l10ntools\directory.hxx %_DEST%\inc%_EXT%\l10ntools\directory.hxx
..\inc\l10ntools\file.hxx %_DEST%\inc%_EXT%\l10ntools\file.hxx
diff --git a/l10ntools/scripts/localize.pl b/l10ntools/scripts/localize.pl
index 7a9d8beb6f15..230b6d46f395 100644
--- a/l10ntools/scripts/localize.pl
+++ b/l10ntools/scripts/localize.pl
@@ -87,7 +87,6 @@ my @sdfparticles;
#### main ####
parse_options();
-check_modules_scm();
my $binpath = '';
if( defined $ENV{UPDMINOREXT} )
@@ -159,7 +158,7 @@ sub splitfile{
next if( $prj eq "binfilter" ); # Don't merge strings into binfilter module
chomp( $line );
- if( is_openoffice_module( $prj ) )
+ if( $force_ooo_module )
{
$string_hash_ooo { $lang }{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } = $line;
}
@@ -171,97 +170,25 @@ sub splitfile{
}
close( MYFILE );
- if( !defined $ENV{SRC_ROOT} ){
- print "Error, no SRC_ROOT in env found.\n";
+ if( !defined $ENV{SOURCE_ROOT_DIR} ){
+ print "Error, no SOURCE_ROOT_DIR in env found.\n";
exit( -1 );
}
- my $src_root = $ENV{SRC_ROOT};
- my $so_l10n_path = $src_root."/l10n_so/source";
- my $ooo_l10n_path = $src_root."/l10n/source";
+ my $src_root = $ENV{SOURCE_ROOT_DIR};
+ my $so_l10n_path = $src_root."/sun/l10n_so/source";
+ my $ooo_l10n_path = $src_root."/ooo/l10n/source";
#print "$so_l10n_path\n";
#print "$ooo_l10n_path\n";
- write_sdf( \%string_hash_so , $so_l10n_path );
- write_sdf( \%string_hash_ooo , $ooo_l10n_path );
-
-}
-sub check_modules_scm
-{
- #my @ooo_modules;
- #my @so_modules;
- my $src_path = $ENV{ SRC_ROOT } ;
- my $last_dir = getcwd();
- chdir $src_path ;
- my @modules = <*/.svn/entries>;
-
- foreach my $module ( @modules )
+ if( $force_ooo_module )
{
- #print "$module \n";
- if( open ( FILE , "<$module" ) )
- {
- while( <FILE> )
- {
-
- my @path = split ( "/" , $module ) ;
-
- if( /svn.services.openoffice.org/ )
- {
- my $mod = $path[ 0 ];
- #push @ooo_modules , $mod;
- $is_ooo_module{ $mod } = "true";
- # print "$module -> ooo ";
- }
- elsif ( /jumbo2.germany.sun.com/ )
- {
- my $mod = $path[ 0 ];
- #push @so_modules , $mod;
- # print "$module -> so ";
- #$so_lookup_hash{ $mod } = "true";
- }
- #else
- #{
- # print "ERROR: Is $module a SO or OOo module? Can not parese the $module/.svn/entries file ... please check mwsfinnish/merge/splitsdf.pl line 280\n";
- # exit -1;
- #}
- }
- }
+ write_sdf( \%string_hash_ooo , $ooo_l10n_path );
+ }
+ else
+ {
+ write_sdf( \%string_hash_so , $so_l10n_path );
}
- chdir $last_dir ;
- #print "OOO\n";
- #print @ooo_modules;
- #print "\nSO\n";
- #print @so_modules;
-}
-
-
-#sub parse
-#{
-# my $command = "$CVS_BINARY -d:pserver:anoncvs\@anoncvs.services.openoffice.org:/cvs co -c";
-# my $output = `$command`;
-# my $rc = $? << 8;
-# if ( $output eq "" || $rc < 0 ){
-# print STDERR "ERROR: Can not fetch cvs alias list, please login to the cvs server and press at the password prompt just return\ncvs -d:pserver:anoncvs\@anoncvs.services.openoffice.org:/cvs login\n";
-# exit ( -1 );
-# }
-# my @list = split /\n/ , $output ;
-# foreach my $string( @list )
-# {
-#
-# # print "Found '$1'\n" , if( $string =~ /^(\w*)/ && $1 ne "" );
-#
-# $is_ooo_module{ $1 } = "TRUE", if( $string =~ /^(\w*)/ && $1 ne "" );
-# }
-# # foreach my $key( keys( %is_ooo_module ) )
-# #{
-# # print "$key\n";
-# #}
-#}
-sub is_openoffice_module
-{
- my $module = shift;
- return "TRUE", if ( $force_ooo_module || defined $is_ooo_module{ $module } );
- return "";
}
sub write_sdf
@@ -458,16 +385,9 @@ sub collectfiles{
# $| = 1;
STDOUT->autoflush( 1 );
- ### Search sdf particles
- #print STDOUT "### Searching sdf particles\n";
my $working_path = getcwd();
chdir $ENV{SOURCE_ROOT_DIR}, if defined $ENV{SOURCE_ROOT_DIR};
- #chdir $srcpath;
- #find ( { wanted => \&wanted , follow => 1 }, getcwd() );
- #chdir $working_path;
add_paths( $langhash_ref );
- #my $nFound = $#sdfparticles +1;
- #print "\n $nFound files found !\n";
my ( $LOCALIZEPARTICLE , $localizeSDF ) = File::Temp::tempfile();
close( $LOCALIZEPARTICLE );
@@ -591,7 +511,6 @@ sub collectfiles{
}
}
close ALLPARTICLES_MERGED;
-#***************
# Hash of array
my %output;
@@ -1156,22 +1075,3 @@ sub usage{
print STDERR "\nlocalize -m -l cs -f my.sdf\n( Merge cs translation into the sourcecode ) \n";
}
-# my $line = defined $_ ? $_ : '';
-# my $leftpart = defined $2 ? $2 : '';
-# my $prj = defined $3 ? $3 : '';
-# my $file = defined $4 ? $4 : '';
-# my $dummy = defined $5 ? $5 : '';
-# my $type = defined $6 ? $6 : '';
-# my $gid = defined $7 ? $7 : '';
-# my $lid = defined $8 ? $8 : '';
-# my $helpid = defined $9 ? $9 : '';
-# my $plattform = defined $10 ? $10 : '';
-# my $width = defined $11 ? $11 : '';
-# my $lang = defined $12 ? $12 : '';
-# my $rightpart = defined $13 ? $13 : '';
-# my $text = defined $14 ? $14 : '';
-# my $helptext = defined $15 ? $15 : '';
-# my $quickhelptext = defined $16 ? $16 : '';
-# my $title = defined $17 ? $17 : '';
-# my $timestamp = defined $18 ? $18 : '';
-
diff --git a/l10ntools/scripts/tool/l10ntool.py b/l10ntools/scripts/tool/l10ntool.py
index 70d88674f07b..f1630027ccdc 100644
--- a/l10ntools/scripts/tool/l10ntool.py
+++ b/l10ntools/scripts/tool/l10ntool.py
@@ -66,11 +66,10 @@ class AbstractL10nTool:
pass
################################################################################################
-
+
def format_outputfile(self, filename, language):
extension = filename[filename.rfind('.')+1:]
file = filename[:filename.rfind('.')]
-
# Python 2.3.x friendly
return self.get_outputfile_format_str().replace('[', '%(').replace(']',')s') % \
{ 'filename': filename, 'fileNoExt': file, 'language': language, 'extension': extension, 'path_prefix': self._options.path_prefix,
diff --git a/l10ntools/scripts/tool/xhtex.py b/l10ntools/scripts/tool/xhtex.py
index ae973aacc555..d916fc675944 100644
--- a/l10ntools/scripts/tool/xhtex.py
+++ b/l10ntools/scripts/tool/xhtex.py
@@ -56,13 +56,14 @@ class Xhtex(AbstractL10nTool):
if elem.childNodes[0].nodeType == elem.TEXT_NODE and elem.getAttribute("id").strip():
obj = self.prepare_sdf_line(inputfile=inputfilename, lang=lang, id=elem.getAttribute("id").strip())
if sdfdata[obj.get_id()]:
- elem.childNodes[0].data = str(sdfdata[obj.get_id()].text)
+ elem.childNodes[0].data = unicode(str(sdfdata[obj.get_id()].text),"utf8")
+
def merge_title(self, list, sdfdata, lang, inputfilename):
for elem in list:
obj = self.prepare_sdf_line(inputfile=inputfilename, lang=lang, id=elem.getAttribute("id").strip())
if elem.getAttribute("id").strip() and sdfdata[obj.get_id()]:
- elem.setAttribute("title", str(sdfdata[obj.get_id()].text))
+ elem.setAttribute("title", unicode(str(sdfdata[obj.get_id()].text),"utf8"))
# L10N tool
def __init__(self):
@@ -97,7 +98,7 @@ class Xhtex(AbstractL10nTool):
try:
f = open(outputfilename, "w+")
str = dom.toxml()
- f.write(str)
+ f.write(str.encode("utf-8"))
except IOError:
print "ERROR: Can not write file " + outputfilename
sys.exit(-1)
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index 68cf316e813b..53c2a5ac86f6 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -613,13 +613,6 @@ void BrowseBox::Resize()
if (IsZoom())
nSBSize = (ULONG)(nSBSize * (double)GetZoom());
- long nSize = pDataWin->GetPosPixel().Y();
- if( !getDataWindow()->bNoHScroll )
- nSize += aHScroll.GetSizePixel().Height();
-
- if ( GetOutputSizePixel().Height() < nSize )
- return;
-
DoHideCursor( "Resize" );
USHORT nOldVisibleRows =
(USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
diff --git a/vcl/aqua/inc/salframeview.h b/vcl/aqua/inc/salframeview.h
index 0174c1a68832..d812523c472d 100755
--- a/vcl/aqua/inc/salframeview.h
+++ b/vcl/aqua/inc/salframeview.h
@@ -77,6 +77,10 @@
id mpMouseEventListener;
id mDraggingDestinationHandler;
NSEvent* mpLastSuperEvent;
+
+ // #i102807# used by magnify event handler
+ NSTimeInterval mfLastMagnifyTime;
+ float mfMagnifyDeltaSum;
}
+(void)unsetMouseFrame: (AquaSalFrame*)pFrame;
-(id)initWithSalFrame: (AquaSalFrame*)pFrame;
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index 25dadf0e592b..2f9959ab43f4 100755
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -378,6 +378,7 @@ static AquaSalFrame* getMouseContainerFrame()
mpLastSuperEvent = nil;
}
+ mfLastMagnifyTime = 0.0;
return self;
}
@@ -637,21 +638,40 @@ private:
// TODO: ?? -(float)magnification;
if( AquaSalFrame::isAlive( mpFrame ) )
- {
- mpFrame->mnLastEventTime = static_cast<ULONG>( [pEvent timestamp] * 1000.0 );
+ {
+ const NSTimeInterval fMagnifyTime = [pEvent timestamp];
+ mpFrame->mnLastEventTime = static_cast<ULONG>( fMagnifyTime * 1000.0 );
mpFrame->mnLastModifierFlags = [pEvent modifierFlags];
-
- float dZ = 0.0;
- for(;;)
+
+ // check if this is a new series of magnify events
+ static const NSTimeInterval fMaxDiffTime = 0.3;
+ const bool bNewSeries = (fMagnifyTime - mfLastMagnifyTime > fMaxDiffTime);
+
+ if( bNewSeries )
+ mfMagnifyDeltaSum = 0.0;
+ mfMagnifyDeltaSum += [pEvent deltaZ];
+
+ mfLastMagnifyTime = [pEvent timestamp];
+ // TODO: change to 0.1 when COMMAND_WHEEL_ZOOM handlers allow finer zooming control
+ static const float fMagnifyFactor = 0.25;
+ static const float fMinMagnifyStep = 15.0 / fMagnifyFactor;
+ if( fabs(mfMagnifyDeltaSum) <= fMinMagnifyStep )
+ return;
+
+ // adapt NSEvent-sensitivity to application expectations
+ // TODO: rather make COMMAND_WHEEL_ZOOM handlers smarter
+ const float fDeltaZ = mfMagnifyDeltaSum * fMagnifyFactor;
+ int nDeltaZ = FRound( fDeltaZ );
+ if( !nDeltaZ )
{
- dZ += [pEvent deltaZ];
- NSEvent* pNextEvent = [NSApp nextEventMatchingMask: NSScrollWheelMask
- untilDate: nil inMode: NSDefaultRunLoopMode dequeue: YES ];
- if( !pNextEvent )
- break;
- pEvent = pNextEvent;
+ // handle new series immediately
+ if( !bNewSeries )
+ return;
+ nDeltaZ = (fDeltaZ >= 0.0) ? +1 : -1;
}
-
+ // eventually give credit for delta sum
+ mfMagnifyDeltaSum -= nDeltaZ / fMagnifyFactor;
+
NSPoint aPt = [NSEvent mouseLocation];
mpFrame->CocoaToVCL( aPt );
@@ -667,18 +687,15 @@ private:
if( Application::GetSettings().GetLayoutRTL() )
aEvent.mnX = mpFrame->maGeometry.nWidth-1-aEvent.mnX;
- if( dZ != 0.0 )
- {
- aEvent.mnDelta = static_cast<long>(floor(dZ));
- aEvent.mnNotchDelta = dZ < 0 ? -1 : 1;
- if( aEvent.mnDelta == 0 )
- aEvent.mnDelta = aEvent.mnNotchDelta;
- aEvent.mbHorz = FALSE;
- aEvent.mnScrollLines = dZ > 0 ? dZ/WHEEL_EVENT_FACTOR : -dZ/WHEEL_EVENT_FACTOR;
- if( aEvent.mnScrollLines == 0 )
- aEvent.mnScrollLines = 1;
- mpFrame->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
- }
+ aEvent.mnDelta = nDeltaZ;
+ aEvent.mnNotchDelta = (nDeltaZ >= 0) ? +1 : -1;
+ if( aEvent.mnDelta == 0 )
+ aEvent.mnDelta = aEvent.mnNotchDelta;
+ aEvent.mbHorz = FALSE;
+ aEvent.mnScrollLines = nDeltaZ;
+ if( aEvent.mnScrollLines == 0 )
+ aEvent.mnScrollLines = 1;
+ mpFrame->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
}
}
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 94f07b8f17d1..8c1545758c3b 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -3793,7 +3793,6 @@ MetaAction* MetaFloatTransparentAction::Clone()
void MetaFloatTransparentAction::Move( long nHorzMove, long nVertMove )
{
maPoint.Move( nHorzMove, nVertMove );
- maMtf.Move(nHorzMove, nVertMove);
}
// ------------------------------------------------------------------------
@@ -3804,7 +3803,6 @@ void MetaFloatTransparentAction::Scale( double fScaleX, double fScaleY )
ImplScaleRect( aRectangle, fScaleX, fScaleY );
maPoint = aRectangle.TopLeft();
maSize = aRectangle.GetSize();
- maMtf.Scale(fScaleX, fScaleY);
}
// ------------------------------------------------------------------------
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index bea307a4c38d..06dcd73cc3d4 100644..100755
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -1988,7 +1988,15 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
const long nSrcWidth = aBmpRect.GetWidth(), nSrcHeight = aBmpRect.GetHeight();
const long nDstWidth = aDstRect.GetWidth(), nDstHeight = aDstRect.GetHeight();
const long nOutWidth = aOutSz.Width(), nOutHeight = aOutSz.Height();
- const long nOffX = aDstRect.Left() - aOutPt.X(), nOffY = aDstRect.Top() - aOutPt.Y();
+ // calculate offset in original bitmap
+ // in RTL case this is a little more complicated since the contents of the
+ // bitmap is not mirrored (it never is), however the paint region and bmp region
+ // are in mirrored coordinates, so the intersection of (aOutPt,aOutSz) with these
+ // is content wise somewhere else and needs to take mirroring into account
+ const long nOffX = IsRTLEnabled()
+ ? aOutSz.Width() - aDstRect.GetWidth() - (aDstRect.Left() - aOutPt.X())
+ : aDstRect.Left() - aOutPt.X(),
+ nOffY = aDstRect.Top() - aOutPt.Y();
long nX, nOutX, nY, nOutY;
long nMirrOffX = 0;
long nMirrOffY = 0;
@@ -2002,7 +2010,6 @@ void OutputDevice::ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha,
for( nX = 0L, nOutX = nOffX; nX < nDstWidth; nX++, nOutX++ )
{
pMapX[ nX ] = aBmpRect.Left() + nOutX * nSrcWidth / nOutWidth;
-
if( bHMirr )
pMapX[ nX ] = nMirrOffX - pMapX[ nX ];
}
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 7b7f3bbcb4d3..580161da8a4e 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -8499,6 +8499,7 @@ void PDFWriterImpl::beginRedirect( SvStream* pStream, const Rectangle& rTargetRe
{
push( PUSH_ALL );
+ // force reemitting clip region
clearClipRegion();
updateGraphicsState();
@@ -8542,7 +8543,10 @@ SvStream* PDFWriterImpl::endRedirect()
}
pop();
- // force reemitting colors
+ // force reemitting colors and clip region
+ clearClipRegion();
+ m_aCurrentPDFState.m_bClipRegion = m_aGraphicsStack.front().m_bClipRegion;
+ m_aCurrentPDFState.m_aClipRegion = m_aGraphicsStack.front().m_aClipRegion;
m_aCurrentPDFState.m_aLineColor = Color( COL_TRANSPARENT );
m_aCurrentPDFState.m_aFillColor = Color( COL_TRANSPARENT );
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index 64f2b7e0d2a1..055b7e9fe80b 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -1058,29 +1058,10 @@ static sal_Unicode getAccel( const String& rStr )
return nChar;
}
-Window* Window::GetLabelFor() const
+static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window* pLabel, sal_Unicode nAccel )
{
- if ( mpWindowImpl->mbDisableAccessibleLabelForRelation )
- return NULL;
-
Window* pWindow = NULL;
- Window* pFrameWindow = ImplGetFrameWindow();
-
- WinBits nFrameStyle = pFrameWindow->GetStyle();
- if( ! ( nFrameStyle & WB_DIALOGCONTROL )
- || ( nFrameStyle & WB_NODIALOGCONTROL )
- )
- return NULL;
-
- if ( mpWindowImpl->mpRealParent )
- pWindow = mpWindowImpl->mpRealParent->GetParentLabelFor( this );
-
- if( pWindow )
- return pWindow;
- sal_Unicode nAccel = getAccel( GetText() );
-
- WindowType nMyType = GetType();
if( nMyType == WINDOW_FIXEDTEXT ||
nMyType == WINDOW_FIXEDLINE ||
nMyType == WINDOW_GROUPBOX )
@@ -1092,7 +1073,7 @@ Window* Window::GetLabelFor() const
// get index, form start and form end
USHORT nIndex=0, nFormStart=0, nFormEnd=0;
pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow,
- const_cast<Window*>(this),
+ pLabel,
nIndex,
nFormStart,
nFormEnd );
@@ -1139,32 +1120,39 @@ Window* Window::GetLabelFor() const
return pWindow;
}
-// -----------------------------------------------------------------------
-
-Window* Window::GetLabeledBy() const
+Window* Window::GetLabelFor() const
{
- if ( mpWindowImpl->mbDisableAccessibleLabeledByRelation )
+ if ( mpWindowImpl->mbDisableAccessibleLabelForRelation )
return NULL;
Window* pWindow = NULL;
Window* pFrameWindow = ImplGetFrameWindow();
+ WinBits nFrameStyle = pFrameWindow->GetStyle();
+ if( ! ( nFrameStyle & WB_DIALOGCONTROL )
+ || ( nFrameStyle & WB_NODIALOGCONTROL )
+ )
+ return NULL;
+
if ( mpWindowImpl->mpRealParent )
- pWindow = mpWindowImpl->mpRealParent->GetParentLabeledBy( this );
+ pWindow = mpWindowImpl->mpRealParent->GetParentLabelFor( this );
if( pWindow )
return pWindow;
- // #i62723#, #104191# checkboxes and radiobuttons are not supposed to have labels
- if( GetType() == WINDOW_CHECKBOX || GetType() == WINDOW_RADIOBUTTON )
- return NULL;
+ sal_Unicode nAccel = getAccel( GetText() );
-// if( ! ( GetType() == WINDOW_FIXEDTEXT ||
-// GetType() == WINDOW_FIXEDLINE ||
-// GetType() == WINDOW_GROUPBOX ) )
- // #i100833# MT 2010/02: Group box and fixed lines can also lable a fixed text.
- // See tools/options/print for example.
- WindowType nMyType = GetType();
+ pWindow = ImplGetLabelFor( pFrameWindow, GetType(), const_cast<Window*>(this), nAccel );
+ if( ! pWindow && mpWindowImpl->mpRealParent )
+ pWindow = ImplGetLabelFor( mpWindowImpl->mpRealParent, GetType(), const_cast<Window*>(this), nAccel );
+ return pWindow;
+}
+
+// -----------------------------------------------------------------------
+
+static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Window* pLabeled )
+{
+ Window* pWindow = NULL;
if ( (nMyType != WINDOW_GROUPBOX) && (nMyType != WINDOW_FIXEDLINE) )
{
// search for a control that labels this window
@@ -1176,16 +1164,16 @@ Window* Window::GetLabeledBy() const
// get form start and form end and index of this control
USHORT nIndex, nFormStart, nFormEnd;
Window* pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow,
- const_cast<Window*>(this),
+ pLabeled,
nIndex,
nFormStart,
nFormEnd );
if( pSWindow && nIndex != nFormStart )
{
- if( GetType() == WINDOW_PUSHBUTTON ||
- GetType() == WINDOW_HELPBUTTON ||
- GetType() == WINDOW_OKBUTTON ||
- GetType() == WINDOW_CANCELBUTTON )
+ if( nMyType == WINDOW_PUSHBUTTON ||
+ nMyType == WINDOW_HELPBUTTON ||
+ nMyType == WINDOW_OKBUTTON ||
+ nMyType == WINDOW_CANCELBUTTON )
{
nFormStart = nIndex-1;
}
@@ -1217,6 +1205,39 @@ Window* Window::GetLabeledBy() const
return pWindow;
}
+Window* Window::GetLabeledBy() const
+{
+ if ( mpWindowImpl->mbDisableAccessibleLabeledByRelation )
+ return NULL;
+
+ Window* pWindow = NULL;
+ Window* pFrameWindow = ImplGetFrameWindow();
+
+ if ( mpWindowImpl->mpRealParent )
+ {
+ pWindow = mpWindowImpl->mpRealParent->GetParentLabeledBy( this );
+
+ if( pWindow )
+ return pWindow;
+ }
+
+ // #i62723#, #104191# checkboxes and radiobuttons are not supposed to have labels
+ if( GetType() == WINDOW_CHECKBOX || GetType() == WINDOW_RADIOBUTTON )
+ return NULL;
+
+// if( ! ( GetType() == WINDOW_FIXEDTEXT ||
+// GetType() == WINDOW_FIXEDLINE ||
+// GetType() == WINDOW_GROUPBOX ) )
+ // #i100833# MT 2010/02: Group box and fixed lines can also lable a fixed text.
+ // See tools/options/print for example.
+
+ pWindow = ImplGetLabeledBy( pFrameWindow, GetType(), const_cast<Window*>(this) );
+ if( ! pWindow && mpWindowImpl->mpRealParent )
+ pWindow = ImplGetLabeledBy( mpWindowImpl->mpRealParent, GetType(), const_cast<Window*>(this) );
+
+ return pWindow;
+}
+
// -----------------------------------------------------------------------
KeyEvent Window::GetActivationKey() const
diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx
index 03816857f27c..5b18ec002aa9 100644
--- a/vcl/unx/source/fontmanager/fontconfig.cxx
+++ b/vcl/unx/source/fontmanager/fontconfig.cxx
@@ -509,22 +509,29 @@ namespace
std::vector<lang_and_family>::const_iterator aEnd = families.end();
bool alreadyclosematch = false;
- for (std::vector<lang_and_family>::const_iterator aIter = families.begin(); aIter != aEnd; ++aIter)
+ for( std::vector<lang_and_family>::const_iterator aIter = families.begin(); aIter != aEnd; ++aIter )
{
const char *pLang = (const char*)aIter->first;
- //perfect
- if( rtl_str_compare(pLang,sFullMatch.getStr() ) == 0)
+ if( rtl_str_compare( pLang, sFullMatch.getStr() ) == 0)
{
+ // both language and country match
candidate = aIter->second;
break;
}
- else if( (rtl_str_compare(pLang,sLangMatch.getStr()) == 0) && (!alreadyclosematch))
+ else if( alreadyclosematch )
+ continue;
+ else if( rtl_str_compare( pLang, sLangMatch.getStr()) == 0)
{
+ // just the language matches
candidate = aIter->second;
alreadyclosematch = true;
}
+ else if( rtl_str_compare( pLang, "en") == 0)
+ {
+ // fallback to the english family name
+ candidate = aIter->second;
+ }
}
-
return candidate;
}
}
diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx
index d3eb103b9dd6..feffdc1adbb6 100644
--- a/vcl/unx/source/gdi/pspgraphics.cxx
+++ b/vcl/unx/source/gdi/pspgraphics.cxx
@@ -694,7 +694,7 @@ void PspServerFontLayout::InitFont() const
static void DrawPrinterLayout( const SalLayout& rLayout, ::psp::PrinterGfx& rGfx, bool bIsPspServerFontLayout )
{
const int nMaxGlyphs = 200;
- sal_GlyphId aGlyphAry[ nMaxGlyphs ];
+ sal_uInt32 aGlyphAry[ nMaxGlyphs ]; // TODO: use sal_GlyphId
sal_Int32 aWidthAry[ nMaxGlyphs ];
sal_Int32 aIdxAry [ nMaxGlyphs ];
sal_Unicode aUnicodes[ nMaxGlyphs ];
@@ -720,15 +720,20 @@ static void DrawPrinterLayout( const SalLayout& rLayout, ::psp::PrinterGfx& rGfx
#ifdef ENABLE_GRAPHITE
else if (pGrLayout)
{
+ #if 0 // HACK: disabled for now due to #i114460#, see #desc12 there
+ // TODO: get rid of glyph->string mapping altogether for printing
+ // TODO: fix GraphiteServerFontLayout's returned aCharPosAry
+ // TODO: fix PrinterGfx's caching?
pText = pGrLayout->getTextPtr();
nMinCharPos = pGrLayout->getMinCharPos();
nMaxCharPos = pGrLayout->getMaxCharPos();
+ #endif
}
#endif
}
for( int nStart = 0;; )
{
- int nGlyphCount = rLayout.GetNextGlyphs( nMaxGlyphs, aGlyphAry, aPos, nStart, aWidthAry, bIsPspServerFontLayout ? aCharPosAry : NULL );
+ int nGlyphCount = rLayout.GetNextGlyphs( nMaxGlyphs, aGlyphAry, aPos, nStart, aWidthAry, pText ? aCharPosAry : NULL );
if( !nGlyphCount )
break;
@@ -738,7 +743,7 @@ static void DrawPrinterLayout( const SalLayout& rLayout, ::psp::PrinterGfx& rGfx
nXOffset += aWidthAry[ i ];
aIdxAry[ i ] = nXOffset / nUnitsPerPixel;
sal_Int32 nGlyphIdx = aGlyphAry[i] & (GF_IDXMASK | GF_ROTMASK);
- if( bIsPspServerFontLayout )
+ if( pText )
aUnicodes[i] = (aCharPosAry[i] >= nMinCharPos && aCharPosAry[i] <= nMaxCharPos) ? pText[ aCharPosAry[i] ] : 0;
else
aUnicodes[i] = (aGlyphAry[i] & GF_ISCHAR) ? nGlyphIdx : 0;