]> git.pld-linux.org Git - packages/libreoffice.git/blob - openoffice-gui-fonts-kde.patch
- DON'T hardcode java paths!
[packages/libreoffice.git] / openoffice-gui-fonts-kde.patch
1 Index: vcl/unx/inc/kdeint.hxx
2 ===================================================================
3 RCS file: /cvs/gsl/vcl/unx/inc/kdeint.hxx,v
4 retrieving revision 1.4
5 diff -u -3 -p -r1.4 kdeint.hxx
6 --- vcl/unx/inc/kdeint.hxx      10 Jun 2002 17:27:27 -0000      1.4
7 +++ vcl/unx/inc/kdeint.hxx      22 Oct 2003 17:14:11 -0000
8 @@ -74,6 +74,8 @@ class KDEIntegrator : public DtIntegrato
9  private:
10         KDEIntegrator( SalFrame* );
11  
12 +       Font parseKDEFont( const ByteString& rLine );
13 +
14  public:
15         virtual ~KDEIntegrator();
16  
17 Index: vcl/unx/source/gdi/kdeint.cxx
18 ===================================================================
19 RCS file: /cvs/gsl/vcl/unx/source/gdi/kdeint.cxx,v
20 retrieving revision 1.10
21 diff -u -3 -p -r1.10 kdeint.cxx
22 --- vcl/unx/source/gdi/kdeint.cxx       16 Jul 2003 17:46:57 -0000      1.10
23 +++ vcl/unx/source/gdi/kdeint.cxx       23 Oct 2003 09:34:24 -0000
24 @@ -89,6 +89,46 @@ static char* pTryFiles[] =
25         "~/.kderc"
26    };
27  
28 +Font KDEIntegrator::parseKDEFont( const ByteString& rLine )
29 +{
30 +    rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
31 +
32 +       Font aFont;
33 +    xub_StrLen nIndex = 0;
34 +
35 +    ByteString aToken = rLine.GetToken( 0, ',', nIndex );
36 +
37 +    if( aToken.Len() ) {
38 +       aFont.SetName( String( aToken, osl_getThreadTextEncoding() ) );
39 +    }
40 +
41 +    aToken = rLine.GetToken( 0, ',', nIndex );
42 +    aFont.SetHeight( aToken.ToInt32() );
43 +
44 +    aToken = rLine.GetToken( 2, ',', nIndex );
45 +
46 +    if( aToken.Len() ) {
47 +        int nWeight = aToken.ToInt32();
48 +        if( nWeight < 30) {
49 +            aFont.SetWeight( WEIGHT_LIGHT );
50 +        }
51 +        else if( nWeight > 70) {
52 +            aFont.SetWeight( WEIGHT_BOLD );
53 +        }
54 +    }
55 +
56 +    aToken = rLine.GetToken( 0, ',', nIndex );
57 +    if( aToken.Len() ) {
58 +        int nItalic = aToken.ToInt32();
59 +        if( nItalic == 1) {
60 +            aFont.SetItalic( ITALIC_NORMAL );
61 +        }
62 +    }
63 +
64 +    return aFont;
65 +
66 +}
67 +
68  void KDEIntegrator::GetSystemLook( AllSettings& rSettings )
69  {
70      rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
71 @@ -227,12 +267,10 @@ void KDEIntegrator::GetSystemLook( AllSe
72                         aLine = aConfig.ReadKey( "font" );
73                         if( aLine.Len() )
74                           {
75 -                               Font aFont = aStyleSettings.GetAppFont();
76 -                               aFont.SetName( String( aLine, gsl_getSystemTextEncoding() ) );
77 -                               
78 +                               Font aFont = parseKDEFont(aLine);
79 +
80                                 aStyleSettings.SetAppFont( aFont );
81                                 aStyleSettings.SetHelpFont( aFont );
82 -                               aStyleSettings.SetMenuFont( aFont );
83                                 aStyleSettings.SetToolFont( aFont );
84                                 aStyleSettings.SetLabelFont( aFont );
85                                 aStyleSettings.SetInfoFont( aFont );
86 @@ -241,6 +279,14 @@ void KDEIntegrator::GetSystemLook( AllSe
87                                 aStyleSettings.SetFieldFont( aFont );
88                                 aStyleSettings.SetIconFont( aFont );
89                                 aStyleSettings.SetGroupFont( aFont );
90 +                         }
91 +
92 +                       aLine = aConfig.ReadKey( "menuFont" );
93 +                       if( aLine.Len() )
94 +                         {
95 +                               Font aFont = parseKDEFont(aLine);
96 +
97 +                               aStyleSettings.SetMenuFont( aFont );
98                           }
99                   }
100                 
This page took 0.037002 seconds and 3 git commands to generate.