Commits

Vladimir Glazunov  committed 0c6007b Merge

CWS-TOOLING: integrate CWS vcl116

  • Participants
  • Parent commits 506fc2a, 23fb3bf

Comments (0)

Files changed (53)

File officecfg/registry/data/org/openoffice/VCL.xcu

             <value>Default</value>
         </prop>
     </node>
+    <node oor:name="WM" oor:op="replace">
+        <prop oor:name="ShouldSwitchWorkspace" oor:op="replace" oor:type="xs:string">
+            <value></value>
+        </prop>
+    </node>
   </node>
   <node oor:name="DefaultFonts">
     <node oor:name="en" oor:op="replace">
       </node>
       <node oor:name="arial" oor:op="replace">
         <prop oor:name="SubstFonts">
-          <value>liberationsans;albany;albanyamt;nimbussansl;helvetica;lucidasans;lucida;geneva;helmet;nimbussans;andalesansui;arialunicodems;lucidaunicode</value>
-        </prop>
-        <prop oor:name="SubstFontsMS"><value></value></prop>
+          <value>liberationsans;albany;albanyamt;arimo;nimbussansl;helvetica;lucidasans;lucida;geneva;helmet;nimbussans;andalesansui;arialunicodems;lucidaunicode</value>
+        </prop>
         <prop oor:name="SubstFontsPS"><value>Helvetica</value></prop>
         <prop oor:name="SubstFontsHTML"><value>sans-serif</value></prop>
         <prop oor:name="FontWeight"><value>Normal</value></prop>
         <prop oor:name="SubstFonts">
           <value>arialnarrowmt;liberationsansnarrow;helveticanarrow;helmetcondensed;dejavusanscondensed;nimbussanslcondensed;nimbussanscondensed</value>
         </prop>
-        <prop oor:name="SubstFontsMS">
-          <value></value>
-        </prop>
-        <prop oor:name="SubstFontsPS">
-          <value></value>
-        </prop>
-        <prop oor:name="SubstFontsHTML">
-          <value></value>
-        </prop>
-        <prop oor:name="FontWeight">
-          <value>Normal</value>
-        </prop>
-        <prop oor:name="FontWidth">
-          <value>Condensed</value>
-        </prop>
-        <prop oor:name="FontType">
-          <value>Normal,SansSerif</value>
-        </prop>
+        <prop oor:name="FontWeight"><value>Normal</value></prop>
+        <prop oor:name="FontWidth"><value>Condensed</value></prop>
+        <prop oor:name="FontType"><value>Normal,SansSerif</value></prop>
       </node>
       <node oor:name="arialunicode" oor:op="replace">
         <prop oor:name="SubstFonts">
           <value>Normal,SansSerif,Full</value>
         </prop>
       </node>
+      <node oor:name="arimo" oor:op="replace">
+        <prop oor:name="SubstFonts">
+          <value>arial;liberationsans;albany;albanyamt;helvetica;</value>
+        </prop>
+        <prop oor:name="SubstFontsMS"><value>arial</value></prop>
+        <prop oor:name="SubstFontsPS"><value>helvetica</value></prop>
+        <prop oor:name="SubstFontsHTML"><value>sans-serif</value></prop>
+        <prop oor:name="FontWeight"><value>Normal</value></prop>
+        <prop oor:name="FontWidth"><value>Normal</value></prop>
+        <prop oor:name="FontType"><value>Standard,Normal,SansSerif</value></prop>
+      </node>
       <node oor:name="arioso" oor:op="replace">
         <prop oor:name="SubstFonts">
           <value>palacescript;palacescriptmt;arioso;shelley;zapfchancery;itczapfchancery;monotypecorsiva;corsiva;chancery;chanceryl;lucidacalligraphy;lucidahandwriting;andymt;comicsansms;andy;kidprint;</value>
       </node>
       <node oor:name="courier" oor:op="replace">
 	<prop oor:name="SubstFonts">
-          <value>cumberland;cumberlandamt;liberationmono;couriernew;nimbusmonol;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
+          <value>cumberland;cumberlandamt;cousine;liberationmono;couriernew;nimbusmonol;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
         </prop>
 	<prop oor:name="SubstFontsMS"><value>Courier New</value></prop>
 	<prop oor:name="SubstFontsPS"><value></value></prop>
       </node>
       <node oor:name="couriernew" oor:op="replace">
 	<prop oor:name="SubstFonts">
-	  <value>cumberland;cumberlandamt;liberationmono;dejavusansmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
-        </prop>
-	<prop oor:name="SubstFontsMS"><value></value></prop>
+	  <value>cumberland;cumberlandamt;cousine;liberationmono;dejavusansmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol</value>
+        </prop>
+	<prop oor:name="SubstFontsPS"><value>Courier</value></prop>
+	<prop oor:name="SubstFontsHTML"><value>monospace</value></prop>
+	<prop oor:name="FontWeight"><value>Normal</value></prop>
+	<prop oor:name="FontWidth"><value>Normal</value></prop>
+	<prop oor:name="FontType"><value>Standard,Normal,Fixed,Typewriter</value></prop>
+      </node>
+      <node oor:name="cousine" oor:op="replace">
+	<prop oor:name="SubstFonts">
+	  <value>couriernew;cumberland;cumberlandamt;liberationmono;courier</value>
+        </prop>
+	<prop oor:name="SubstFontsMS"><value>Courier New</value></prop>
 	<prop oor:name="SubstFontsPS"><value>Courier</value></prop>
 	<prop oor:name="SubstFontsHTML"><value>monospace</value></prop>
 	<prop oor:name="FontWeight"><value>Normal</value></prop>
         <prop oor:name="SubstFonts">
           <value>thorndale;thorndaleamt;liberationserif;nimbusromanno9l;times;timesroman;newyork;timmons;lucidaserif;lucidabright;roman;nimbusromanno9;bookman;itcbookman;garamond;garamondmt;palatino</value>
         </prop>
-        <prop oor:name="SubstFontsMS"><value></value></prop>
         <prop oor:name="SubstFontsPS"><value>Times</value></prop>
         <prop oor:name="SubstFontsHTML"><value>serif</value></prop>
         <prop oor:name="FontWeight"><value>Normal</value></prop>
         <prop oor:name="FontWidth"><value>Normal</value></prop>
         <prop oor:name="FontType"><value>Normal,Serif</value></prop>
       </node>
+      <node oor:name="timos" oor:op="replace">
+        <prop oor:name="SubstFonts">
+          <value>timesnewroman;thorndale;thorndaleamt;liberationserif;nimbusromanno9l;times;timesroman;newyork;timmons</value>
+        </prop>
+        <prop oor:name="SubstFontsMS"><value>Times New Roman</value></prop>
+        <prop oor:name="SubstFontsPS"><value>Times</value></prop>
+        <prop oor:name="SubstFontsHTML"><value>serif</value></prop>
+        <prop oor:name="FontWeight"><value>Normal</value></prop>
+        <prop oor:name="FontWidth"><value>Normal</value></prop>
+        <prop oor:name="FontType"><value>Standard,Normal,Serif</value></prop>
+      </node>
       <node oor:name="tmsrmn" oor:op="replace">
         <prop oor:name="SubstFonts">
           <value>thorndaleamt;thorndale;timesnewroman;liberationserif;nimbusromanno9l;times;timesroman;newyork;timmons;serif;lucidaserif;lucidabright;roman;nimbusromanno9;bookman;itcbookman;garamond;garamondmt;palatino</value>

File testautomation/framework/required/includes/window_functions.inc

 
     printlog( "Update test for window functions" )
 
-    if ( gtSysName = "Mac OS X" ) then
-        qaErrorLog( "#i114476# No testing for Mac as some Window attributes do not exist" )
-        goto endsub
-    endif
-
-
     printlog( "Create initial document" )
     gApplication = "WRITER"
     hInitSingleDoc()
     if ( DocumentWriter.IsMin() ) then
         printlog( "Window is minimized" )
     else
-        qaerrorlog( "#i32672# Window not minimized" )
+        warnlog( "Window not minimized" )
     endif
 
     kontext "DocumentWriter"

File vcl/aqua/inc/salinst.h

     virtual vos::IMutex*		GetYieldMutex();
     virtual ULONG				ReleaseYieldMutex();
     virtual void				AcquireYieldMutex( ULONG nCount );
+    virtual bool                CheckYieldMutex();
     virtual void				Yield( bool bWait, bool bHandleAllCurrentEvents );
     virtual bool				AnyInput( USHORT nType );
-    virtual SalMenu*			CreateMenu( BOOL bMenuBar );
+    virtual SalMenu*			CreateMenu( BOOL bMenuBar, Menu* pVCLMenu );
     virtual void				DestroyMenu( SalMenu* );
     virtual SalMenuItem*		CreateMenuItem( const SalItemParams* pItemData );
     virtual void				DestroyMenuItem( SalMenuItem* );

File vcl/aqua/source/app/salinst.cxx

 
 // -----------------------------------------------------------------------
 
+bool AquaSalInstance::CheckYieldMutex()
+{
+    bool bRet = true;
+
+	SalYieldMutex* pYieldMutex = mpSalYieldMutex;
+	if ( pYieldMutex->GetThreadId() !=
+		 vos::OThread::getCurrentIdentifier() )
+	{
+	    bRet = false;
+	}
+    
+    return bRet;
+}
+
+// -----------------------------------------------------------------------
+
 bool AquaSalInstance::isNSAppThread() const
 {
     return vos::OThread::getCurrentIdentifier() == maMainThread;

File vcl/aqua/source/app/vclnsapp.mm

 
 -(NSApplicationTerminateReply)applicationShouldTerminate: (NSApplication *) app
 {
+    YIELD_GUARD;
+    
     SalData* pSalData = GetSalData();
     #if 1 // currently do some really bad hack
     if( ! pSalData->maFrames.empty() )
 
 -(void)systemColorsChanged: (NSNotification*) pNotification
 {
+    YIELD_GUARD;
+    
     const SalData* pSalData = GetSalData();
 	if( !pSalData->maFrames.empty() )
 		pSalData->maFrames.front()->CallCallback( SALEVENT_SETTINGSCHANGED, NULL );
 
 -(void)screenParametersChanged: (NSNotification*) pNotification
 {
+    YIELD_GUARD;
+    
     SalData* pSalData = GetSalData();
     std::list< AquaSalFrame* >::iterator it;
     for( it = pSalData->maFrames.begin(); it != pSalData->maFrames.end(); ++it )

File vcl/aqua/source/dtrans/DataFlavorMapping.cxx

 	  
 	  if (isByteSequenceType(data.getValueType()))
 		{
+		  /*
+		     the HTMLFormatDataProvider prepends segment information to HTML
+		     this is useful for exchange with MS Word (which brings this stuff from Windows)
+		     but annoying for other applications. Since this extension is not a standard datatype
+		     on the Mac, let us not provide but provide normal HTML
+		     
 		  if ([systemFlavor caseInsensitiveCompare: NSHTMLPboardType] == NSOrderedSame)
 			{
 			  dp = DataProviderPtr_t(new HTMLFormatDataProvider(data));
 			}
-		  else if ([systemFlavor caseInsensitiveCompare: NSPICTPboardType] == NSOrderedSame)
+		  else
+		  */
+		  if ([systemFlavor caseInsensitiveCompare: NSPICTPboardType] == NSOrderedSame)
 			{
 			  dp = DataProviderPtr_t(new BMPDataProvider(data, PICTImageFileType));
 			}

File vcl/aqua/source/window/salframe.cxx

     VCLToCocoa( aStateRect );
     aStateRect = [NSWindow frameRectForContentRect: aStateRect styleMask: mnStyleMask];
     
-    // relase and acquire mutex again since this call can block waiting for an internal lock
+    [mpWindow setFrame: aStateRect display: NO];
+    if( pState->mnState == SAL_FRAMESTATE_MINIMIZED )
+        [mpWindow miniaturize: NSApp];
+    else if( [mpWindow isMiniaturized] )
+        [mpWindow deminiaturize: NSApp];
+        
+
+    /* ZOOMED is not really maximized (actually it toggles between a user set size and
+       the program specified one), but comes closest since the default behavior is
+       "maximized" if the user did not intervene
+    */
+    if( pState->mnState == SAL_FRAMESTATE_MAXIMIZED )
     {
-        [mpWindow setFrame: aStateRect display: NO];
+        if(! [mpWindow isZoomed])
+            [mpWindow zoom: NSApp];
+    }
+    else
+    {
+        if( [mpWindow isZoomed] )
+            [mpWindow zoom: NSApp];
     }
 
-    // FIXME: HTH maximized state ?
-    
     // get new geometry
     UpdateFrameGeometry();
     
     pState->mnWidth     = long(aStateRect.size.width);
     pState->mnHeight    = long(aStateRect.size.height);
     
-    // FIXME: HTH maximized state ?
-    
     if( [mpWindow isMiniaturized] )
         pState->mnState = SAL_FRAMESTATE_MINIMIZED;
     else if( ! [mpWindow isZoomed] )

File vcl/aqua/source/window/salmenu.cxx

 
 -(void)showPreferences: (id) sender
 {
+    YIELD_GUARD;
+
     [self showDialog: SHOWDIALOG_ID_PREFERENCES];
 }
 -(void)showAbout: (id) sender
 {
+    YIELD_GUARD;
+
     [self showDialog: SHOWDIALOG_ID_ABOUT];
 }
 @end
 
 // =======================================================================
 
-SalMenu* AquaSalInstance::CreateMenu( BOOL bMenuBar )
+SalMenu* AquaSalInstance::CreateMenu( BOOL bMenuBar, Menu* pVCLMenu )
 {
     initAppMenu();
     
     AquaSalMenu *pAquaSalMenu = new AquaSalMenu( bMenuBar );
+    pAquaSalMenu->mpVCLMenu = pVCLMenu;
 
     return pAquaSalMenu;
 }

File vcl/inc/vcl/arrange.hxx

         
         sal_uInt64 getMap( sal_uInt32 i_nX, sal_uInt32 i_nY )
         { return static_cast< sal_uInt64 >(i_nX) | (static_cast< sal_uInt64>(i_nY) << 32 ); }
+        
+        static void distributeExtraSize( std::vector<long>& io_rSizes, const std::vector<sal_Int32>& i_rPrios, long i_nExtraWidth );
 
-        Size getOptimalSize( WindowSizeType, std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights ) const;
+        Size getOptimalSize( WindowSizeType,
+                             std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights,
+                             std::vector<sal_Int32>& o_rColumnPrio, std::vector<sal_Int32>& o_rRowPrio
+                            ) const;
     protected:
         virtual Element* getElement( size_t i_nIndex )
         { return i_nIndex < m_aElements.size() ? &m_aElements[ i_nIndex ] : 0; }

File vcl/inc/vcl/outdev.hxx

 #define TEXT_DRAW_MULTILINE             ((USHORT)0x1000)
 #define TEXT_DRAW_WORDBREAK             ((USHORT)0x2000)
 #define TEXT_DRAW_NEWSELLIPSIS          ((USHORT)0x4000)
+// in the long run we should make text style flags longer
+// but at the moment we can get away with this 2 bit field for ellipsis style
+#define TEXT_DRAW_CENTERELLIPSIS        (TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_PATHELLIPSIS)
 
 #define TEXT_DRAW_WORDBREAK_HYPHENATION (((USHORT)0x8000) | TEXT_DRAW_WORDBREAK)
 
 
     /** Added return value to see if EPS could be painted directly.
         Theoreticaly, handing over a matrix would be needed to handle
-        painting rotated EPS files (e.g. contained m�n Metafiles). This
+        painting rotated EPS files (e.g. contained in Metafiles). This
         would then need to be supported for Mac and PS printers, but
         that's too much for now, wrote #i107046# for this */
     bool                DrawEPS( const Point& rPt, const Size& rSz,

File vcl/inc/vcl/print.hxx

     PrinterController( const boost::shared_ptr<Printer>& );
 public:
     enum NupOrderType
-    { LRTB, TBLR };
+    { LRTB, TBLR, TBRL, RLTB };
     struct MultiPageSetup
     {
         // all metrics in 100th mm

File vcl/inc/vcl/prndlg.hxx

             VirtualDevice       maPageVDev;
             rtl::OUString       maReplacementString;
             rtl::OUString       maToolTipString;
+            FixedLine           maHorzDim;
+            FixedLine           maVertDim;
             
             bool useHCColorReplacement() const;
         public:

File vcl/inc/vcl/salinst.hxx

 class SalSession;
 struct SystemGraphicsData;
 struct SystemWindowData;
+class Menu;
 
 namespace vos { class IMutex; }
 
     virtual vos::IMutex*		GetYieldMutex() = 0;
     virtual ULONG				ReleaseYieldMutex() = 0;
     virtual void				AcquireYieldMutex( ULONG nCount ) = 0;
+    // return true, if yield mutex is owned by this thread, else false
+    virtual bool                CheckYieldMutex() = 0;
 
 	// wait next event and dispatch
     // must returned by UserEvent (SalFrame::PostEvent)
     virtual bool				AnyInput( USHORT nType ) = 0;
 
                             // Menues
-    virtual SalMenu*        CreateMenu( BOOL bMenuBar ) = 0;
-    virtual void            DestroyMenu( SalMenu* pMenu) = 0;
-    virtual SalMenuItem*    CreateMenuItem( const SalItemParams* pItemData ) = 0;
-    virtual void            DestroyMenuItem( SalMenuItem* pItem ) = 0;
+    virtual SalMenu*        CreateMenu( BOOL bMenuBar, Menu* pMenu );
+    virtual void            DestroyMenu( SalMenu* pMenu);
+    virtual SalMenuItem*    CreateMenuItem( const SalItemParams* pItemData );
+    virtual void            DestroyMenuItem( SalMenuItem* pItem );
 
     // may return NULL to disable session management
     virtual SalSession*		CreateSalSession() = 0;

File vcl/inc/vcl/svdata.hxx

 #ifndef _SV_SVDATA_HXX
 #define _SV_SVDATA_HXX
 
-#ifndef _VOS_THREAD_HXX
-#include <vos/thread.hxx>
-#endif
-#include <tools/string.hxx>
-#include <tools/gen.hxx>
-#include <tools/shl.hxx>
-#include <tools/link.hxx>
-#include <vcl/vclevent.hxx>
-#include <vcl/sv.h>
-#include <tools/color.hxx>
-#include <tools/debug.hxx>
-#include <vcl/dllapi.h>
-#include <com/sun/star/uno/Reference.hxx>
-#include <unotools/options.hxx>
+#include "vos/thread.hxx"
+#include "tools/string.hxx"
+#include "tools/gen.hxx"
+#include "tools/shl.hxx"
+#include "tools/link.hxx"
+#include "tools/fldunit.hxx"
+#include "vcl/vclevent.hxx"
+#include "vcl/sv.h"
+#include "tools/color.hxx"
+#include "tools/debug.hxx"
+#include "vcl/dllapi.h"
+#include "com/sun/star/uno/Reference.hxx"
+#include "unotools/options.hxx"
 
 namespace com {
 namespace sun {
 // - ImplSVCtrlData -
 // ------------------
 
+typedef std::vector< std::pair< String, FieldUnit > > FieldUnitStringList;
+
 struct ImplSVCtrlData
 {
     ImageList*              mpCheckImgList;     // ImageList for CheckBoxes
     ULONG                   mnLastRadioFColor;  // Letzte FaceColor fuer RadioImage
     ULONG                   mnLastRadioWColor;  // Letzte WindowColor fuer RadioImage
     ULONG                   mnLastRadioLColor;  // Letzte LightColor fuer RadioImage
+    FieldUnitStringList*    mpFieldUnitStrings; // list with field units
+    FieldUnitStringList*    mpCleanUnitStrings; // same list but with some "fluff" like spaces removed
 };
 
 
 
 bool ImplInitAccessBridge( BOOL bAllowCancel, BOOL &rCancelled );
 
+FieldUnitStringList* ImplGetFieldUnits();
+FieldUnitStringList* ImplGetCleanedFieldUnits();
+
+
 // -----------------------------------------------------------------------
 
 // -----------------

File vcl/inc/vcl/svids.hrc

 #define SV_PRINT_PRT_NUP_ORIENTATION_PORTRAIT     1
 #define SV_PRINT_PRT_NUP_ORIENTATION_LANDSCAPE    2
 
-#define SV_PRINT_PRT_NUP_ORDER_LRTD               0
-#define SV_PRINT_PRT_NUP_ORDER_TDLR               1
+#define SV_PRINT_PRT_NUP_ORDER_LRTB               0
+#define SV_PRINT_PRT_NUP_ORDER_TBLR               1
+#define SV_PRINT_PRT_NUP_ORDER_TBRL               2
+#define SV_PRINT_PRT_NUP_ORDER_RLTB               3
 
 #define SV_PRINT_TAB_JOB                    2
 #define SV_PRINT_PRINTERS_FL                1
 #define SV_ACCESSERROR_JAVA_NOT_CONFIGURED  10507
 #define SV_ACCESSERROR_JAVA_DISABLED        10508
 #define SV_ACCESSERROR_TURNAROUND_MSG       10509
-#define SV_ACCESSERROR_LAST			    	SV_ACCESSERROR_TURNAROUND_MSG
+#define SV_ACCESSERROR_NO_FONTS             10510
+#define SV_ACCESSERROR_LAST			    	SV_ACCESSERROR_NO_FONTS
 
 #define SV_SHORTCUT_HELP                    10600
 #define SV_SHORTCUT_CONTEXTHELP             10601

File vcl/os2/inc/salinst.h

     virtual vos::IMutex*		GetYieldMutex();
     virtual ULONG				ReleaseYieldMutex();
     virtual void				AcquireYieldMutex( ULONG nCount );
+    virtual bool                CheckYieldMutex();
     virtual void				Yield( bool, bool );
     virtual bool				AnyInput( USHORT nType );
-    virtual SalMenu*				CreateMenu( BOOL bMenuBar );
-    virtual void				DestroyMenu( SalMenu* );
-    virtual SalMenuItem*			CreateMenuItem( const SalItemParams* pItemData );
-    virtual void				DestroyMenuItem( SalMenuItem* );
     virtual SalSession*                         CreateSalSession();
     virtual void*				GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
     virtual void				AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);

File vcl/os2/source/app/salinst.cxx

 
 // -----------------------------------------------------------------------
 
-#ifdef DBG_UTIL
-
-void ImplDbgTestSolarMutex()
+bool Os2SalInstance::CheckYieldMutex()
 {
+    bool bRet = true;
 	SalData*	pSalData = GetSalData();
 	ULONG		nCurThreadId = GetCurrentThreadId();
 	if ( pSalData->mnAppThreadId != nCurThreadId )
             SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
 			if ( pYieldMutex->mnThreadId != nCurThreadId )
 			{
-				DBG_ERROR( "SolarMutex not locked, and not thread save code in VCL is called from outside of the main thread" );
+				bRet = false;
 			}
 		}
 	}
             SalYieldMutex* pYieldMutex = pSalData->mpFirstInstance->mpSalYieldMutex;
 			if ( pYieldMutex->mnThreadId != nCurThreadId )
 			{
-				DBG_ERROR( "SolarMutex not locked in the main thread" );
+				bRet = false;
 			}
 		}
 	}
+	return bRet;
 }
 
-#endif
-
 // =======================================================================
 
 void InitSalData()

File vcl/os2/source/window/makefile.mk

 			salobj.cxx 
 
 SLOFILES=	$(SLO)$/salframe.obj 	\
-			$(SLO)$/salobj.obj $(SLO)$/salmenu.obj
+			$(SLO)$/salobj.obj
 
 # --- Targets ------------------------------------------------------
 

File vcl/os2/source/window/salmenu.cxx

-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define INCL_DOS
-#define INCL_PM
-#define INCL_WIN
-#include <svpm.h>
-#include <saldata.hxx>
-#include <salinst.h>
-#include <salmenu.h>
-
-
-// =======================================================================
-
-// Os2SalInst factory methods
-
-SalMenu* Os2SalInstance::CreateMenu( BOOL bMenuBar )
-{
-    return NULL;  // no support for native menues
-}
-
-void Os2SalInstance::DestroyMenu( SalMenu* pSalMenu )
-{
-    delete pSalMenu;
-}
-
-
-SalMenuItem* Os2SalInstance::CreateMenuItem( const SalItemParams* pItemData )
-{
-    return NULL;  // no support for native menues
-}
-
-void Os2SalInstance::DestroyMenuItem( SalMenuItem* pSalMenuItem )
-{
-    delete pSalMenuItem;
-}
-
-
-// =======================================================================
-
-
-/*
- * Os2SalMenu
- */
-
-
-Os2SalMenu::~Os2SalMenu()
-{
-}
-
-BOOL Os2SalMenu::VisibleMenuBar()
-{
-    return FALSE; 
-}
-
-void Os2SalMenu::SetFrame( const SalFrame *pFrame )
-{
-}
-
-void Os2SalMenu::InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos )
-{
-}
-
-void Os2SalMenu::RemoveItem( unsigned nPos )
-{
-}
-
-void Os2SalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos )
-{
-}
-
-void Os2SalMenu::CheckItem( unsigned nPos, BOOL bCheck )
-{
-}
-
-void Os2SalMenu::EnableItem( unsigned nPos, BOOL bEnable )
-{
-}
-
-void Os2SalMenu::SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage )
-{
-}
-
-void Os2SalMenu::SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText )
-{
-}
-
-void Os2SalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName )
-{
-}
-
-void Os2SalMenu::GetSystemMenuData( SystemMenuData* pData )
-{
-}
-
-// =======================================================================
-
-/*
- * SalMenuItem
- */
-
-
-Os2SalMenuItem::~Os2SalMenuItem()
-{
-}
-
-// -------------------------------------------------------------------
-

File vcl/source/app/dbggui.cxx

 #include <cmath>
 #include <limits.h>
 
-#include <vcl/svdata.hxx>
-#include <svsys.h>
+#include "vcl/svdata.hxx"
+#include "svsys.h"
 
 #ifdef WNT
 #undef min
 #endif
-#include <tools/debug.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/event.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/button.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/group.hxx>
-#include <vcl/field.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/wrkwin.hxx>
-#include <vcl/sound.hxx>
-#include <vcl/threadex.hxx>
-#include <vcl/dbggui.hxx>
-#include <com/sun/star/i18n/XCharacterClassification.hpp>
+#include "tools/debug.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/event.hxx"
+#include "vcl/lstbox.hxx"
+#include "vcl/button.hxx"
+#include "vcl/edit.hxx"
+#include "vcl/fixed.hxx"
+#include "vcl/group.hxx"
+#include "vcl/field.hxx"
+#include "vcl/msgbox.hxx"
+#include "vcl/wrkwin.hxx"
+#include "vcl/sound.hxx"
+#include "vcl/threadex.hxx"
+#include "vcl/dbggui.hxx"
+#include "com/sun/star/i18n/XCharacterClassification.hpp"
 
-#include <vcl/unohelp.hxx>
-#include <vcl/unohelp2.hxx>
-#include <vos/mutex.hxx>
+#include "vcl/unohelp.hxx"
+#include "vcl/unohelp2.hxx"
+#include "vos/mutex.hxx"
+#include "vcl/salinst.hxx"
 
 #include <map>
 #include <algorithm>
 
 // =======================================================================
 
-#ifdef WNT
-void ImplDbgTestSolarMutex();
-#endif
+void ImplDbgTestSolarMutex()
+{
+    bool bCheck = ImplGetSVData()->mpDefInst->CheckYieldMutex();
+    OSL_ENSURE( bCheck, "SolarMutex not locked" );
+}
 
 // =======================================================================
 
 {
     DbgSetPrintMsgBox( DbgPrintMsgBox );
     DbgSetPrintWindow( DbgPrintWindow );
-#ifdef WNT
     DbgSetTestSolarMutex( ImplDbgTestSolarMutex );
-#endif
 }
 
 // -----------------------------------------------------------------------
 {
     DbgSetPrintMsgBox( NULL );
     DbgSetPrintWindow( NULL );
-#ifdef WNT
     DbgSetTestSolarMutex( NULL );
-#endif
 
     DbgWindow* pDbgWindow = ImplGetSVData()->maWinData.mpDbgWin;
     if ( pDbgWindow )

File vcl/source/app/salvtables.cxx

     // do nothing
 }
 
+SalMenu* SalInstance::CreateMenu( BOOL, Menu* )
+{
+    // default: no native menus
+    return NULL;
+}
+
+void SalInstance::DestroyMenu( SalMenu* pMenu )
+{
+    (void)pMenu;
+    OSL_ENSURE( pMenu == 0, "DestroyMenu called with non-native menus" );
+}
+
+SalMenuItem* SalInstance::CreateMenuItem( const SalItemParams* )
+{
+    return NULL;
+}
+
+void SalInstance::DestroyMenuItem( SalMenuItem* pItem )
+{
+    (void)pItem;
+    OSL_ENSURE( pItem == 0, "DestroyMenu called with non-native menus" );
+}
+
 SalTimer::~SalTimer()
 {
 }

File vcl/source/app/svdata.cxx

 
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_vcl.hxx"
+
 #include <string.h>
 
-#ifndef _SV_SVSYS_HXX
-#include <svsys.h>
-#endif
-#include <vcl/salinst.hxx>
-#include <vcl/salframe.hxx>
+#include "rtl/instance.hxx"
+#include "osl/process.h"
+#include "osl/file.hxx"
 
-#ifndef _VOS_MUTEX_HXX
-#include <vos/mutex.hxx>
-#endif
+#include "svsys.h"
 
-#include <osl/process.h>
-#include <osl/file.hxx>
-#include <uno/current_context.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <tools/debug.hxx>
-#include <unotools/fontcfg.hxx>
-#include <vcl/configsettings.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/window.h>
-#include <vcl/svapp.hxx>
-#include <vcl/wrkwin.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/unohelp.hxx>
-#include <vcl/button.hxx> // for Button::GetStandardText
-#include <vcl/dockwin.hxx>  // for DockingManager
-#include <vcl/salimestatus.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/awt/XExtendedToolkit.hpp>
-#include <com/sun/star/java/JavaNotConfiguredException.hpp>
-#include <com/sun/star/java/JavaVMCreationFailureException.hpp>
-#include <com/sun/star/java/MissingJavaRuntimeException.hpp>
-#include <com/sun/star/java/JavaDisabledException.hpp>
+#include "tools/debug.hxx"
+#include "tools/resary.hxx"
 
-#include <com/sun/star/lang/XComponent.hpp>
+#include "vcl/salinst.hxx"
+#include "vcl/salframe.hxx"
+#include "vcl/configsettings.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/window.h"
+#include "vcl/svapp.hxx"
+#include "vcl/wrkwin.hxx"
+#include "vcl/msgbox.hxx"
+#include "vcl/unohelp.hxx"
+#include "vcl/button.hxx" // for Button::GetStandardText
+#include "vcl/dockwin.hxx"  // for DockingManager
+#include "vcl/salimestatus.hxx"
+#include "vcl/salsys.hxx"
+#include "vcl/svids.hrc"
+
+#include "unotools/fontcfg.hxx"
+
+#include "vos/mutex.hxx"
+
+#include "cppuhelper/implbase1.hxx"
+#include "uno/current_context.hxx"
+
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/lang/XComponent.hpp"
+#include "com/sun/star/awt/XExtendedToolkit.hpp"
+#include "com/sun/star/java/JavaNotConfiguredException.hpp"
+#include "com/sun/star/java/JavaVMCreationFailureException.hpp"
+#include "com/sun/star/java/MissingJavaRuntimeException.hpp"
+#include "com/sun/star/java/JavaDisabledException.hpp"
 
 #include <stdio.h>
-#include <vcl/salsys.hxx>
-#include <vcl/svids.hrc>
-#include <rtl/instance.hxx>
 
 using namespace com::sun::star::uno;
 using namespace com::sun::star::lang;
         delete pSVData->maAppData.mpMSFTempFileName;
         pSVData->maAppData.mpMSFTempFileName = NULL;
     }
+    
+    if( pSVData->maCtrlData.mpFieldUnitStrings )
+        delete pSVData->maCtrlData.mpFieldUnitStrings, pSVData->maCtrlData.mpFieldUnitStrings = NULL;
+    if( pSVData->maCtrlData.mpCleanUnitStrings )
+        delete pSVData->maCtrlData.mpCleanUnitStrings, pSVData->maCtrlData.mpCleanUnitStrings = NULL;
 }
 
 // -----------------------------------------------------------------------
     return ResId( nId, *pMgr );
 }
 
+FieldUnitStringList* ImplGetFieldUnits()
+{
+    ImplSVData* pSVData = ImplGetSVData();
+    if( ! pSVData->maCtrlData.mpFieldUnitStrings )
+    {
+        ResMgr* pResMgr = ImplGetResMgr();
+        if( pResMgr )
+        {
+            ResStringArray aUnits( ResId (SV_FUNIT_STRINGS, *pResMgr) );
+            sal_uInt32 nUnits = aUnits.Count();
+            pSVData->maCtrlData.mpFieldUnitStrings = new FieldUnitStringList();
+            pSVData->maCtrlData.mpFieldUnitStrings->reserve( nUnits );
+            for( sal_uInt32 i = 0; i < nUnits; i++ )
+            {
+                std::pair< String, FieldUnit > aElement( aUnits.GetString(i), static_cast<FieldUnit>(aUnits.GetValue(i)) );
+                pSVData->maCtrlData.mpFieldUnitStrings->push_back( aElement );
+            }
+        }
+    }
+    return pSVData->maCtrlData.mpFieldUnitStrings;
+}
+
+FieldUnitStringList* ImplGetCleanedFieldUnits()
+{
+    ImplSVData* pSVData = ImplGetSVData();
+    if( ! pSVData->maCtrlData.mpCleanUnitStrings )
+    {
+        FieldUnitStringList* pUnits = ImplGetFieldUnits();
+        if( pUnits )
+        {
+            size_t nUnits = pUnits->size();
+            pSVData->maCtrlData.mpCleanUnitStrings = new FieldUnitStringList();
+            pSVData->maCtrlData.mpCleanUnitStrings->reserve( nUnits );
+            for( size_t i = 0; i < nUnits; i++ )
+            {
+                String aUnit( (*pUnits)[i].first );
+                aUnit.EraseAllChars( sal_Unicode( ' ' ) );
+                aUnit.ToLowerAscii();
+                std::pair< String, FieldUnit > aElement( aUnit, (*pUnits)[i].second );
+                pSVData->maCtrlData.mpCleanUnitStrings->push_back( aElement );
+            }
+        }
+    }
+    return pSVData->maCtrlData.mpCleanUnitStrings;
+}
+
 DockingManager* ImplGetDockingManager()
 {
     ImplSVData* pSVData = ImplGetSVData();

File vcl/source/control/edit.cxx

 			}
 			break;
 
+			/* #i101255# disable autocomplete tab forward/backward
+			   users expect tab/shif-tab to move the focus to other controls
+			   not suddenly to cycle the autocompletion
 			case KEY_TAB:
 			{
 				if ( !mbReadOnly && maAutocompleteHdl.IsSet() &&
 				}
 			}
 			break;
+			*/
 
 			default:
 			{

File vcl/source/control/field.cxx

 
 using namespace ::com::sun::star;
 
-static ResStringArray *strAllUnits = NULL;
-
 // -----------------------------------------------------------------------
 
 #define FORMAT_NUMERIC       1
 
 // #104355# support localized mesaurements
 
-static String ImplMetricToString( FieldUnit rUnit )
+static const String& ImplMetricToString( FieldUnit rUnit )
 {
-    if( !strAllUnits )
+    FieldUnitStringList* pList = ImplGetFieldUnits();
+    if( pList )
     {
-        ResMgr* pResMgr = ImplGetResMgr();
-        strAllUnits = new ResStringArray( ResId (SV_FUNIT_STRINGS, *pResMgr) );
+        // return unit's default string (ie, the first one )
+        for( FieldUnitStringList::const_iterator it = pList->begin(); it != pList->end(); ++it )
+        {
+            if ( it->second == rUnit )
+                return it->first;
+        }
     }
-    // return unit's default string (ie, the first one )
-    for( USHORT i=0; i < strAllUnits->Count(); i++ )
-        if( (FieldUnit) strAllUnits->GetValue( i ) == rUnit )
-            return strAllUnits->GetString( i );
-
-    return String();
+
+    return String::EmptyString();
 }
 
 static FieldUnit ImplStringToMetric( const String &rMetricString )
 {
-    if( !strAllUnits )
+    FieldUnitStringList* pList = ImplGetCleanedFieldUnits();
+    if( pList )
     {
-        ResMgr* pResMgr = ImplGetResMgr();
-        strAllUnits = new ResStringArray( ResId (SV_FUNIT_STRINGS, *pResMgr) );
+        // return FieldUnit
+        String aStr( rMetricString );
+        aStr.ToLowerAscii();
+        aStr.EraseAllChars( sal_Unicode( ' ' ) );
+        for( FieldUnitStringList::const_iterator it = pList->begin(); it != pList->end(); ++it )
+        {
+            if ( it->first.Equals( aStr ) )
+                return it->second;
+        }
     }
-    // return FieldUnit
-    String aStr( rMetricString );
-    aStr.ToLowerAscii();
-    for( USHORT i=0; i < strAllUnits->Count(); i++ )
-        if ( strAllUnits->GetString( i ).Equals( aStr ) )
-            return (FieldUnit) strAllUnits->GetValue( i );
 
     return FUNIT_NONE;
 }

File vcl/source/control/fixed.cxx

 
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_vcl.hxx"
-#include <vcl/decoview.hxx>
-#include <vcl/event.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/controldata.hxx>
-#include <vcl/window.h>
+#include "vcl/decoview.hxx"
+#include "vcl/event.hxx"
+#include "vcl/fixed.hxx"
+#include "vcl/controldata.hxx"
+#include "vcl/window.h"
 
-#include <tools/rc.h>
+#include "tools/rc.h"
 
 // =======================================================================
 
     String*					pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
 
     DecorationView aDecoView( this );
-	if ( !aText.Len() || (nWinStyle & WB_VERT) )
+	if ( !aText.Len() )
 	{
         if( !pVector )
         {
             }
         }
 	}
+	else if( (nWinStyle & WB_VERT) )
+	{
+	    long nWidth = GetTextWidth( aText );
+	    Push( PUSH_FONT );
+	    Font aFont( GetFont() );
+	    aFont.SetOrientation( 900 );
+	    SetFont( aFont );
+	    Point aStartPt( aOutSize.Width()/2, aOutSize.Height()-1 );
+	    if( (nWinStyle & WB_VCENTER) )
+	        aStartPt.Y() -= (aOutSize.Height() - nWidth)/2;
+	    Point aTextPt( aStartPt );
+	    aTextPt.X() -= GetTextHeight()/2;
+	    DrawText( aTextPt, aText, 0, STRING_LEN, pVector, pDisplayText );
+	    Pop();
+	    if( aOutSize.Height() - aStartPt.Y() > FIXEDLINE_TEXT_BORDER )
+	        aDecoView.DrawSeparator( Point( aStartPt.X(), aOutSize.Height()-1 ),
+	                                 Point( aStartPt.X(), aStartPt.Y() + FIXEDLINE_TEXT_BORDER ) );
+	    if( aStartPt.Y() - nWidth - FIXEDLINE_TEXT_BORDER > 0 )
+	        aDecoView.DrawSeparator( Point( aStartPt.X(), aStartPt.Y() - nWidth - FIXEDLINE_TEXT_BORDER ),
+	                                 Point( aStartPt.X(), 0 ) );
+	}
 	else
 	{
 		USHORT		nStyle = TEXT_DRAW_MNEMONIC | TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_ENDELLIPSIS;
 		Rectangle	aRect( 0, 0, aOutSize.Width(), aOutSize.Height() );
         const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+        if( (nWinStyle & WB_CENTER) )
+            nStyle |= TEXT_DRAW_CENTER;
 
 		if ( !IsEnabled() )
 			nStyle |= TEXT_DRAW_DISABLE;
         {
             long nTop = aRect.Top() + ((aRect.GetHeight()-1)/2);
             aDecoView.DrawSeparator( Point( aRect.Right()+FIXEDLINE_TEXT_BORDER, nTop ), Point( aOutSize.Width()-1, nTop ), false );
+            if( aRect.Left() > FIXEDLINE_TEXT_BORDER )
+                aDecoView.DrawSeparator( Point( 0, nTop ), Point( aRect.Left()-FIXEDLINE_TEXT_BORDER, nTop ), false );
         }
     }
 }

File vcl/source/gdi/outdev3.cxx

 
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_vcl.hxx"
-#include <cstring>
-#include <i18npool/mslangid.hxx>
-
-#ifndef _SV_SVSYS_HXX
-#include <svsys.h>
-#endif
-#include <vcl/salgdi.hxx>
-#include <vcl/sallayout.hxx>
-#include <rtl/tencinfo.h>
-#include <tools/debug.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/metric.hxx>
-#include <vcl/impfont.hxx>
-#include <vcl/metaact.hxx>
-#include <vcl/gdimtf.hxx>
-#include <vcl/outdata.hxx>
-#include <vcl/outfont.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
-#include <basegfx/polygon/b2dpolypolygon.hxx>
-#include <basegfx/matrix/b2dhommatrix.hxx>
-#include <tools/poly.hxx>
-#include <vcl/outdev.h>
-#include <vcl/virdev.hxx>
-#include <vcl/print.hxx>
-#include <vcl/event.hxx>
-#include <vcl/window.h>
-#include <vcl/window.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/bmpacc.hxx>
-#include <unotools/fontcvt.hxx>
-#include <vcl/outdev.hxx>
-#include <vcl/edit.hxx>
-#include <unotools/fontcfg.hxx>
-#include <vcl/sysdata.hxx>
-#include <vcl/textlayout.hxx>
-#ifndef _OSL_FILE_H
-#include <osl/file.h>
-#endif
+
+#include "i18npool/mslangid.hxx"
+
+#include "svsys.h"
+#include "vcl/salgdi.hxx"
+#include "vcl/sallayout.hxx"
+#include "rtl/tencinfo.h"
+#include "tools/debug.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/metric.hxx"
+#include "vcl/impfont.hxx"
+#include "vcl/metaact.hxx"
+#include "vcl/gdimtf.hxx"
+#include "vcl/outdata.hxx"
+#include "vcl/outfont.hxx"
+#include "basegfx/polygon/b2dpolygon.hxx"
+#include "basegfx/polygon/b2dpolypolygon.hxx"
+#include "basegfx/matrix/b2dhommatrix.hxx"
+#include "tools/poly.hxx"
+#include "vcl/outdev.h"
+#include "vcl/virdev.hxx"
+#include "vcl/print.hxx"
+#include "vcl/event.hxx"
+#include "vcl/window.h"
+#include "vcl/window.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/bmpacc.hxx"
+#include "unotools/fontcvt.hxx"
+#include "vcl/outdev.hxx"
+#include "vcl/edit.hxx"
+#include "unotools/fontcfg.hxx"
+#include "vcl/sysdata.hxx"
+#include "vcl/textlayout.hxx"
+#include "vcl/svids.hrc"
+#include "osl/file.h"
 #ifdef ENABLE_GRAPHITE
-#include <vcl/graphite_features.hxx>
+#include "vcl/graphite_features.hxx"
 #endif
 #ifdef USE_BUILTIN_RASTERIZER
-#include <vcl/glyphcache.hxx>
+#include "vcl/glyphcache.hxx"
 #endif
 
-#include <vcl/unohelp.hxx>
-#include <pdfwriter_impl.hxx>
-#include <vcl/controllayout.hxx>
-#include <rtl/logfile.hxx>
-
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUES_HDL_
-#include <com/sun/star/beans/PropertyValues.hdl>
-#endif
-#include <com/sun/star/i18n/XBreakIterator.hpp>
-#include <com/sun/star/i18n/WordType.hpp>
-#include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
+#include "vcl/unohelp.hxx"
+#include "pdfwriter_impl.hxx"
+#include "vcl/controllayout.hxx"
+#include "rtl/logfile.hxx"
+
+#include "com/sun/star/beans/PropertyValues.hpp"
+#include "com/sun/star/i18n/XBreakIterator.hpp"
+#include "com/sun/star/i18n/WordType.hpp"
+#include "com/sun/star/linguistic2/XLinguServiceManager.hpp"
 
 #if defined UNX
 #define GLYPH_FONT_HEIGHT   128
 #define GLYPH_FONT_HEIGHT   256
 #endif
 
-#include <sal/alloca.h>
+#include "sal/alloca.h"
 
 #include <cmath>
 #include <cstring>
             mpGraphics->GetDevFontList( mpFontList );
         }
     }
+    if( meOutDevType == OUTDEV_WINDOW && ! mpFontList->Count() )
+    {
+        String aError( RTL_CONSTASCII_USTRINGPARAM( "Application error: no fonts and no vcl resource found on your system" ) );
+        ResMgr* pMgr = ImplGetResMgr();
+        if( pMgr )
+        {
+            String aResStr( ResId( SV_ACCESSERROR_NO_FONTS, *pMgr ) );
+            if( aResStr.Len() )
+                aError = aResStr;
+        }
+        Application::Abort( aError );
+    }
 }
 
 // =======================================================================
 
     if ( nIndex != STRING_LEN )
     {
-        if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
+        if( (nStyle & TEXT_DRAW_CENTERELLIPSIS) == TEXT_DRAW_CENTERELLIPSIS )
+        {
+            String aTmpStr( aStr );
+            xub_StrLen nEraseChars = 4;
+            while( nEraseChars < aStr.Len() && _rLayout.GetTextWidth( aTmpStr, 0, aTmpStr.Len() ) > nMaxWidth )
+            {
+                aTmpStr = aStr;
+                xub_StrLen i = (aTmpStr.Len() - nEraseChars)/2;
+                aTmpStr.Erase( i, nEraseChars++ );
+                aTmpStr.InsertAscii( "...", i );
+            }
+            aStr = aTmpStr;
+        }
+        else if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
         {
             aStr.Erase( nIndex );
             if ( nIndex > 1 )

File vcl/source/gdi/print2.cxx

             break;
 
 		case META_LINE_ACTION:
-            aActionBounds = Rectangle( static_cast<const MetaLineAction&>(rAct).GetStartPoint(), 
-                                       static_cast<const MetaLineAction&>(rAct).GetEndPoint() );
+		{
+			const MetaLineAction& rMetaLineAction = static_cast<const MetaLineAction&>(rAct);
+            aActionBounds = Rectangle( rMetaLineAction.GetStartPoint(),  rMetaLineAction.GetEndPoint() );
+			const long nLineWidth(rMetaLineAction.GetLineInfo().GetWidth());
+			if(nLineWidth)
+			{
+				const long nHalfLineWidth((nLineWidth + 1) / 2);
+				aActionBounds.Left() -= nHalfLineWidth;
+				aActionBounds.Top() -= nHalfLineWidth;
+				aActionBounds.Right() += nHalfLineWidth;
+				aActionBounds.Bottom() += nHalfLineWidth;
+			}
             break;
+		}
 
 		case META_RECT_ACTION:
             aActionBounds = static_cast<const MetaRectAction&>(rAct).GetRect();
             break;
 
 		case META_POLYLINE_ACTION:
-            aActionBounds = static_cast<const MetaPolyLineAction&>(rAct).GetPolygon().GetBoundRect();
+		{
+			const MetaPolyLineAction& rMetaPolyLineAction = static_cast<const MetaPolyLineAction&>(rAct);
+            aActionBounds = rMetaPolyLineAction.GetPolygon().GetBoundRect();
+			const long nLineWidth(rMetaPolyLineAction.GetLineInfo().GetWidth());
+			if(nLineWidth)
+			{
+				const long nHalfLineWidth((nLineWidth + 1) / 2);
+				aActionBounds.Left() -= nHalfLineWidth;
+				aActionBounds.Top() -= nHalfLineWidth;
+				aActionBounds.Right() += nHalfLineWidth;
+				aActionBounds.Bottom() += nHalfLineWidth;
+			}
             break;
+		}
 
 		case META_POLYGON_ACTION:
             aActionBounds = static_cast<const MetaPolygonAction&>(rAct).GetPolygon().GetBoundRect();

File vcl/source/gdi/print3.cxx

                     nCellX = (nSubPage / rMPS.nRows);
                     nCellY = (nSubPage % rMPS.nRows);
                     break;
+                case PrinterController::RLTB:
+                    nCellX = rMPS.nColumns - 1 - (nSubPage % rMPS.nColumns);
+                    nCellY = (nSubPage / rMPS.nColumns);
+                    break;
+                case PrinterController::TBRL:
+                    nCellX = rMPS.nColumns - 1 - (nSubPage / rMPS.nRows);
+                    nCellY = (nSubPage % rMPS.nRows);
+                    break;
                 }
                 // scale the metafile down to a sub page size
                 double fScaleX = double(aSubPageSize.Width())/double(aPageSize.aSize.Width());

File vcl/source/src/print.src

         {
             HelpID = "vcl:ListBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_ORDER_BOX";
             Pos = MAP_APPFONT( 0, 0 );
-            Size = MAP_APPFONT( 10, 20 );
+            Size = MAP_APPFONT( 10, 50 );
             DropDown = TRUE;
             Border = TRUE;
             CurPos = 0;
             StringList [en-US] =
             {
-                < "left to right, then down"; SV_PRINT_PRT_NUP_ORDER_LRTD; >;
-                < "top to bottom, then right"; SV_PRINT_PRT_NUP_ORDER_TDLR; >;
+                < "left to right, then down"; SV_PRINT_PRT_NUP_ORDER_LRTB; >;
+                < "top to bottom, then right"; SV_PRINT_PRT_NUP_ORDER_TBLR; >;
+                < "top to bottom, then left"; SV_PRINT_PRT_NUP_ORDER_TBRL; >;
+                < "right to left, then down"; SV_PRINT_PRT_NUP_ORDER_RLTB; >;
             };
             HelpText [en-US] = "Select order in which pages are to be printed.";
         };

File vcl/source/src/stdtext.src

     Text [ en-US ] = "The Java Access Bridge could not be started.";
 };
 
+String SV_ACCESSERROR_NO_FONTS
+{
+    Text [ en-US ] = "No fonts could be found on the system.";
+};
+
 String SV_STDTEXT_ABOUT
 {
     Text [ en-US ] = "About %PRODUCTNAME";

File vcl/source/window/arrange.cxx

 {
 }
 
-Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights ) const
+Size MatrixArranger::getOptimalSize( WindowSizeType i_eType,
+                                     std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights,
+                                     std::vector<sal_Int32>& o_rColumnPrio, std::vector<sal_Int32>& o_rRowPrio
+                                    ) const
 {
     Size aMatrixSize( 2*m_nOuterBorder, 2*m_nOuterBorder );
     
     // now allocate row and column depth vectors
     o_rColumnWidths = std::vector< long >( nColumns, 0 );
     o_rRowHeights   = std::vector< long >( nRows, 0 );
+    o_rColumnPrio   = std::vector< sal_Int32 >( nColumns, 0 );
+    o_rRowPrio      = std::vector< sal_Int32 >( nRows, 0 );
     
     // get sizes an allocate them into rows/columns
     for( std::vector< MatrixElement >::const_iterator it = m_aElements.begin();
             o_rColumnWidths[ it->m_nX ] = aSize.Width();
         if( aSize.Height() > o_rRowHeights[ it->m_nY ] )
             o_rRowHeights[ it->m_nY ] = aSize.Height();
+        if( it->m_nExpandPriority > o_rColumnPrio[ it->m_nX ] )
+            o_rColumnPrio[ it->m_nX ] = it->m_nExpandPriority;
+        if( it->m_nExpandPriority > o_rRowPrio[ it->m_nY ] )
+            o_rRowPrio[ it->m_nY ] = it->m_nExpandPriority;
     }
     
     // add up sizes
 Size MatrixArranger::getOptimalSize( WindowSizeType i_eType ) const
 {
     std::vector<long> aColumnWidths, aRowHeights;
-    return getOptimalSize( i_eType, aColumnWidths, aRowHeights );
+    std::vector<sal_Int32> aColumnPrio, aRowPrio;
+    return getOptimalSize( i_eType, aColumnWidths, aRowHeights, aColumnPrio, aRowPrio );
 }
 
+void MatrixArranger::distributeExtraSize( std::vector<long>& io_rSizes, const std::vector<sal_Int32>& i_rPrios, long i_nExtraWidth )
+{
+    if( ! io_rSizes.empty()  && io_rSizes.size() == i_rPrios.size() ) // sanity check
+    {
+        // find all elements with the highest expand priority
+        size_t nElements = io_rSizes.size();
+        std::vector< size_t > aIndices;
+        sal_Int32 nHighPrio = 0;
+        for( size_t i = 0; i < nElements; i++ )
+        {
+            sal_Int32 nCurPrio = i_rPrios[ i ];
+            if( nCurPrio > nHighPrio )
+            {
+                aIndices.clear();
+                nHighPrio = nCurPrio;
+            }
+            if( nCurPrio == nHighPrio )
+                aIndices.push_back( i );
+        }
+        
+        // distribute extra space evenly among collected elements
+        nElements = aIndices.size();
+        if( nElements > 0 )
+        {
+            long nDelta = i_nExtraWidth / nElements;
+            for( size_t i = 0; i < nElements; i++ )
+            {
+                io_rSizes[ aIndices[i] ] += nDelta;
+                i_nExtraWidth -= nDelta;
+            }
+            // add the last pixels to the last row element
+            if( i_nExtraWidth > 0 && nElements > 0 )
+                io_rSizes[aIndices.back()] += i_nExtraWidth;
+        }
+    }
+}
+
+
 void MatrixArranger::resize()
 {
     // assure that we have at least one row and column
     
     // check if we can get optimal size, else fallback to minimal size
     std::vector<long> aColumnWidths, aRowHeights;
-    Size aOptSize( getOptimalSize( WINDOWSIZE_PREFERRED, aColumnWidths, aRowHeights ) );
+    std::vector<sal_Int32> aColumnPrio, aRowPrio;
+    Size aOptSize( getOptimalSize( WINDOWSIZE_PREFERRED, aColumnWidths, aRowHeights, aColumnPrio, aRowPrio ) );
     if( aOptSize.Height() > m_aManagedArea.GetHeight() ||
         aOptSize.Width() > m_aManagedArea.GetWidth() )
     {
         std::vector<long> aMinColumnWidths, aMinRowHeights;
-        getOptimalSize( WINDOWSIZE_MINIMUM, aMinColumnWidths, aMinRowHeights );
+        getOptimalSize( WINDOWSIZE_MINIMUM, aMinColumnWidths, aMinRowHeights, aColumnPrio, aRowPrio );
         if( aOptSize.Height() > m_aManagedArea.GetHeight() )
             aRowHeights = aMinRowHeights;
         if( aOptSize.Width() > m_aManagedArea.GetWidth() )
             aColumnWidths = aMinColumnWidths;
     }
     
-    // FIXME: distribute extra space available
+    // distribute extra space available
+    long nExtraSize = m_aManagedArea.GetWidth();
+    for( size_t i = 0; i < aColumnWidths.size(); ++i )
+        nExtraSize -= aColumnWidths[i] + m_nBorderX;
+    if( nExtraSize > 0 )
+        distributeExtraSize( aColumnWidths, aColumnPrio, nExtraSize );
+    nExtraSize =  m_aManagedArea.GetHeight();
+    for( size_t i = 0; i < aRowHeights.size(); ++i )
+        nExtraSize -= aRowHeights[i] + m_nBorderY;
+    if( nExtraSize > 0 )
+        distributeExtraSize( aRowHeights, aRowPrio, nExtraSize );
     
     // prepare offsets
     std::vector<long> aColumnX( aColumnWidths.size() );

File vcl/source/window/menu.cxx

     mpLayoutData	= NULL;
 	mpFirstDel      = NULL;         // Dtor notification list
     // Native-support: returns NULL if not supported
-    mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar );
+    mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar, this );
 }
 
 Menu* Menu::ImplGetStartedFrom() const
 
     if ( !bIsMenuBar )
     {
+        // popup menus should not be wider than half the screen
+        // except on rather small screens
+        // TODO: move GetScreenNumber from SystemWindow to Window ?
+        // currently we rely on internal privileges
+        unsigned int nScreenNumber = pWin->ImplGetWindowImpl()->mpFrame->maGeometry.nScreenNumber;
+        Rectangle aDispRect( Application::GetScreenPosSizePixel( nScreenNumber ) );
+        long nScreenWidth = aDispRect.GetWidth() >= 800 ? aDispRect.GetWidth() : 800;
+        if( nMaxWidth > nScreenWidth/2 )
+            nMaxWidth = nScreenWidth/2;
+        
         USHORT gfxExtra = (USHORT) Max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text
         nCheckPos = (USHORT)nExtra;
 		if (nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES)
     }
 }
 
+static String getShortenedString( const String& i_rLong, Window* i_pWin, long i_nMaxWidth )
+{
+    xub_StrLen nPos = STRING_NOTFOUND;
+    String aNonMnem( OutputDevice::GetNonMnemonicString( i_rLong, nPos ) );
+    aNonMnem = i_pWin->GetEllipsisString( aNonMnem, i_nMaxWidth, TEXT_DRAW_CENTERELLIPSIS );
+    // re-insert mnemonic
+    if( nPos != STRING_NOTFOUND )
+    {
+        if( nPos < aNonMnem.Len() && i_rLong.GetChar(nPos+1) == aNonMnem.GetChar(nPos) )
+        {
+            rtl::OUStringBuffer aBuf( i_rLong.Len() );
+            aBuf.append( aNonMnem.GetBuffer(), nPos );
+            aBuf.append( sal_Unicode('~') );
+            aBuf.append( aNonMnem.GetBuffer()+nPos );
+            aNonMnem = aBuf.makeStringAndClear();
+        }
+    }
+    return aNonMnem;
+}
+
 void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* pThisItemOnly, BOOL bHighlighted, bool bLayout ) const
 {
     // Fuer Symbole: nFontHeight x nFontHeight
                             pWin->GetSettings().GetStyleSettings().GetMenuColor();
                         pWin->SetBackground( Wallpaper( aBg ) );
                     }
-                    pWin->DrawCtrlText( aTmpPos, pData->aText, 0, pData->aText.Len(), nStyle, pVector, pDisplayText );
+                    // how much space is there for the text ?
+                    long nMaxItemTextWidth = aOutSz.Width() - aTmpPos.X() - nExtra - nOuterSpace;
+                    if( !bIsMenuBar && pData->aAccelKey.GetCode() && !ImplAccelDisabled() )
+                    {
+                        XubString aAccText = pData->aAccelKey.GetName();
+                        nMaxItemTextWidth -= pWin->GetTextWidth( aAccText ) + 3*nExtra;
+                    }
+                    if( !bIsMenuBar && pData->pSubMenu )
+                    {
+                        nMaxItemTextWidth -= nFontHeight - nExtra;
+                    }
+                    String aItemText( getShortenedString( pData->aText, pWin, nMaxItemTextWidth ) );
+                    pWin->DrawCtrlText( aTmpPos, aItemText, 0, aItemText.Len(), nStyle, pVector, pDisplayText );
                     if( bSetTmpBackground )
                         pWin->SetBackground();
                 }

File vcl/source/window/printdlg.cxx

     , maOrigSize( 10, 10 )
     , maPageVDev( *this )
     , maToolTipString( String( VclResId( SV_PRINT_PRINTPREVIEW_TXT ) ) )
+    , maHorzDim( this, WB_HORZ | WB_CENTER  )
+    , maVertDim( this, WB_VERT | WB_VCENTER )
 {
     SetPaintTransparent( TRUE );
     SetBackground();
         maPageVDev.SetBackground( GetSettings().GetStyleSettings().GetWindowColor() );
     else
         maPageVDev.SetBackground( Color( COL_WHITE ) );
+    maHorzDim.Show();
+    maVertDim.Show();
+    
+    maHorzDim.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "2.0in" ) ) );
+    maVertDim.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "2.0in" ) ) );
 }
 
 PrintDialog::PrintPreviewWindow::~PrintPreviewWindow()
 void PrintDialog::PrintPreviewWindow::Resize()
 {
     Size aNewSize( GetSizePixel() );
+    long nTextHeight = maHorzDim.GetTextHeight();
     // leave small space for decoration
-    aNewSize.Width() -= 2;
-    aNewSize.Height() -= 2;
+    aNewSize.Width() -= nTextHeight + 2;
+    aNewSize.Height() -= nTextHeight + 2;
     Size aScaledSize;
     double fScale = 1.0;
     
     }
     
     maPageVDev.SetOutputSizePixel( aScaledSize, FALSE );
+
+    // position dimension lines
+    Point aRef( nTextHeight + (aNewSize.Width() - maPreviewSize.Width())/2,
+                nTextHeight + (aNewSize.Height() - maPreviewSize.Height())/2 );
+    maHorzDim.SetPosSizePixel( Point( aRef.X(), aRef.Y() - nTextHeight ),
+                               Size( maPreviewSize.Width(), nTextHeight ) );
+    maVertDim.SetPosSizePixel( Point( aRef.X() - nTextHeight, aRef.Y() ),
+                               Size( nTextHeight, maPreviewSize.Height() ) );
+    
 }
 
 void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
 {
+    long nTextHeight = maHorzDim.GetTextHeight(); 
     Size aSize( GetSizePixel() );
+    aSize.Width()  -= nTextHeight;
+    aSize.Height() -= nTextHeight;
     if( maReplacementString.getLength() != 0 )
     {
         // replacement is active
         Push();
-        Rectangle aTextRect( Point( 0, 0 ), aSize );
+        Rectangle aTextRect( Point( nTextHeight, nTextHeight ), aSize );
         DecorationView aVw( this );
         aVw.DrawFrame( aTextRect, FRAME_DRAW_GROUP );
         aTextRect.Left()   += 2;
     {
         GDIMetaFile aMtf( maMtf );
     
-        Point aOffset( (aSize.Width() - maPreviewSize.Width()) / 2,
-                       (aSize.Height() - maPreviewSize.Height()) / 2 );
+        Point aOffset( (aSize.Width() - maPreviewSize.Width()) / 2 + nTextHeight,
+                       (aSize.Height() - maPreviewSize.Height()) / 2 + nTextHeight );
     
         Size aVDevSize( maPageVDev.GetOutputSizePixel() );
         const Size aLogicSize( maPageVDev.PixelToLogic( aVDevSize, MapMode( MAP_100TH_MM ) ) );
 {
     rtl::OUStringBuffer aBuf( 256 );
     aBuf.append( maToolTipString );
-    #if OSL_DEBUG_LEVEL > 0
-    aBuf.appendAscii( "\n---\nPageSize: " );
-    aBuf.append( sal_Int32( i_rOrigSize.Width()/100) );
-    aBuf.appendAscii( "mm x " );
-    aBuf.append( sal_Int32( i_rOrigSize.Height()/100) );
-    aBuf.appendAscii( "mm" );
-    #endif
     SetQuickHelpText( aBuf.makeStringAndClear() );
     maMtf = i_rNewPreview;
     if( useHCColorReplacement() )
     maReplacementString = i_rReplacement;
     maPageVDev.SetReferenceDevice( i_nDPIX, i_nDPIY );
     maPageVDev.EnableOutput( TRUE );
+
+    // use correct measurements
+    const LocaleDataWrapper& rLocWrap( GetSettings().GetLocaleDataWrapper() );
+    MapUnit eUnit = MAP_MM;
+    int nDigits = 0;
+    if( rLocWrap.getMeasurementSystemEnum() == MEASURE_US )
+    {
+        eUnit = MAP_100TH_INCH;
+        nDigits = 2;
+    }
+    Size aLogicPaperSize( LogicToLogic( i_rOrigSize, MapMode( MAP_100TH_MM ), MapMode( eUnit ) ) );
+    String aNumText( rLocWrap.getNum( aLogicPaperSize.Width(), nDigits ) );
+    aBuf.append( aNumText );
+    aBuf.appendAscii( eUnit == MAP_MM ? "mm" : "in" );
+    maHorzDim.SetText( aBuf.makeStringAndClear() );
+    
+    aNumText = rLocWrap.getNum( aLogicPaperSize.Height(), nDigits );
+    aBuf.append( aNumText );
+    aBuf.appendAscii( eUnit == MAP_MM ? "mm" : "in" );
+    maVertDim.SetText( aBuf.makeStringAndClear() );
+
     Resize();
     Invalidate();
 }
         int nX = 0, nY = 0;
         switch( mnOrderMode )
         {
-        case SV_PRINT_PRT_NUP_ORDER_LRTD:
+        case SV_PRINT_PRT_NUP_ORDER_LRTB:
             nX = (i % mnColumns); nY = (i / mnColumns);
             break;
-        case SV_PRINT_PRT_NUP_ORDER_TDLR:
+        case SV_PRINT_PRT_NUP_ORDER_TBLR:
             nX = (i / mnRows); nY = (i % mnRows);
             break;
+        case SV_PRINT_PRT_NUP_ORDER_RLTB:
+            nX = mnColumns - 1 - (i % mnColumns); nY = (i / mnColumns);
+            break;
+        case SV_PRINT_PRT_NUP_ORDER_TBRL:
+            nX = mnColumns - 1 - (i / mnRows); nY = (i % mnRows);
+            break;
         }
         Size aTextSize( GetTextWidth( aPageText ), nTextHeight );
         int nDeltaX = (aSubSize.Width() - aTextSize.Width()) / 2;
     
     int nOrderMode = int(sal_IntPtr(maNUpPage.maNupOrderBox.GetEntryData( 
                            maNUpPage.maNupOrderBox.GetSelectEntryPos() )));
-    if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_LRTD )
+    if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_LRTB )
         aMPS.nOrder = PrinterController::LRTB;
-    else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TDLR )
+    else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TBLR )
         aMPS.nOrder = PrinterController::TBLR;
+    else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_RLTB )
+        aMPS.nOrder = PrinterController::RLTB;
+    else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TBRL )
+        aMPS.nOrder = PrinterController::TBRL;
     
     int nOrientationMode = int(sal_IntPtr(maNUpPage.maNupOrientationBox.GetEntryData( 
                                  maNUpPage.maNupOrientationBox.GetSelectEntryPos() )));

File vcl/source/window/window.cxx

 		if( bDark )
 			aSelectionFillCol = COL_BLACK;
 		else
-			nPercent = bRoundEdges ? 90 : 80;  // just checked (light)
+			nPercent = 80;  // just checked (light)
 	}
     else
     {
                 nPercent = 0;
             }
             else
-                nPercent = bRoundEdges ? 50 : 20;          // selected, pressed or checked ( very dark )
+                nPercent = bRoundEdges ? 40 : 20;          // selected, pressed or checked ( very dark )
 		}
         else if( bChecked || highlight == 1 )
 		{
                 nPercent = 0;
             }
             else
-                nPercent = bRoundEdges ? 70 : 35;          // selected, pressed or checked ( very dark )
+                nPercent = bRoundEdges ? 60 : 35;          // selected, pressed or checked ( very dark )
 		}
         else
 		{
                     nPercent = 0;
             }
             else
-                nPercent = bRoundEdges ? 80 : 70;          // selected ( dark )
+                nPercent = 70;          // selected ( dark )
 		}
     }
 

File vcl/unx/gtk/app/gtkdata.cxx

             {
                 gint nMonitors = gdk_screen_get_n_monitors(pScreen);
                 m_aXineramaScreens = std::vector<Rectangle>();
+                m_aXineramaScreenIndexMap = std::vector<int>(nMonitors);
                 for (gint i = 0; i < nMonitors; ++i)
                 {
                     GdkRectangle dest;
                     gdk_screen_get_monitor_geometry(pScreen, i, &dest);
-                    addXineramaScreenUnique( dest.x, dest.y, dest.width, dest.height );
+                    m_aXineramaScreenIndexMap[i] = addXineramaScreenUnique( dest.x, dest.y, dest.width, dest.height );
                 }
                 m_bXinerama = m_aXineramaScreens.size() > 1;
                 if( ! m_aFrames.empty() )
     }
 }
 
+extern "C"
+{
+    typedef gint(* screen_get_primary_monitor)(GdkScreen *screen);
+}
+
+int GtkSalDisplay::GetDefaultMonitorNumber() const
+{
+    int n = 0;
+    GdkScreen* pScreen = gdk_display_get_screen( m_pGdkDisplay, m_nDefaultScreen );
+#if GTK_CHECK_VERSION(2,20,0)
+    n = m_aXineramaScreenIndexMap[gdk_screen_get_primary_monitor(pScreen)];
+#else
+    static screen_get_primary_monitor sym_gdk_screen_get_primary_monitor =
+        (screen_get_primary_monitor)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_primary_monitor" );
+    if (sym_gdk_screen_get_primary_monitor)
+        n = m_aXineramaScreenIndexMap[sym_gdk_screen_get_primary_monitor( pScreen )];
+#endif
+    return n;
+}
+
 void GtkSalDisplay::initScreen( int nScreen ) const
 {
     if( nScreen < 0 || nScreen >= static_cast<int>(m_aScreens.size()) )

File vcl/unx/headless/svpinst.cxx

 	}
 }
 
+bool SvpSalInstance::CheckYieldMutex()
+{
+    bool bRet = true;
+
+	if ( m_aYieldMutex.GetThreadId() !=
+		 vos::OThread::getCurrentIdentifier() )
+	{
+	    bRet = false;
+	}
+    
+    return bRet;
+}
+
 void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents )
 {
 	// first, check for already queued events.
     return false;
 }
 
-SalMenu* SvpSalInstance::CreateMenu( BOOL )
-{
-    return NULL;
-}
-
-void SvpSalInstance::DestroyMenu( SalMenu* )
-{
-}
-
-SalMenuItem* SvpSalInstance::CreateMenuItem( const SalItemParams* )
-{
-    return NULL;
-}
-
-void SvpSalInstance::DestroyMenuItem( SalMenuItem* )
-{
-}
-
 SalSession* SvpSalInstance::CreateSalSession()
 {
     return NULL;

File vcl/unx/headless/svpinst.hxx

     virtual vos::IMutex*	GetYieldMutex();
     virtual ULONG			ReleaseYieldMutex();
     virtual void			AcquireYieldMutex( ULONG nCount );
+    virtual bool            CheckYieldMutex();
 
 	// wait next event and dispatch
     // must returned by UserEvent (SalFrame::PostEvent)
     virtual void			Yield( bool bWait, bool bHandleAllCurrentEvents );
     virtual bool			AnyInput( USHORT nType );
 
-                            // Menues
-    virtual SalMenu*        CreateMenu( BOOL bMenuBar );
-    virtual void            DestroyMenu( SalMenu* pMenu);
-    virtual SalMenuItem*    CreateMenuItem( const SalItemParams* pItemData );
-    virtual void            DestroyMenuItem( SalMenuItem* pItem );
-
     // may return NULL to disable session management
     virtual SalSession*		CreateSalSession();
 

File vcl/unx/inc/plugins/gtk/gtkdata.hxx

     GdkDisplay*						m_pGdkDisplay;
 	GdkCursor                      *m_aCursors[ POINTER_COUNT ];
     bool                            m_bStartupCompleted;
+    std::vector< int >              m_aXineramaScreenIndexMap;
+
 	GdkCursor* getFromXPM( const char *pBitmap, const char *pMask,
 						   int nWidth, int nHeight, int nXHot, int nYHot );