[Libreoffice-commits] .: Branch 'libreoffice-3-4' - 15 commits - canvas/source unotools/source vcl/source vcl/unx

Petr Mladek pmladek at kemper.freedesktop.org
Wed Apr 6 05:13:00 PDT 2011


 canvas/source/cairo/cairo_canvashelper.cxx |    2 +-
 unotools/source/config/configmgr.cxx       |    2 +-
 unotools/source/misc/fontdefs.cxx          |    8 ++++++++
 vcl/source/gdi/gdimtf.cxx                  |    2 ++
 vcl/unx/kde4/KDESalGraphics.cxx            |    2 ++
 vcl/unx/kde4/KDEXLib.cxx                   |   10 ++++++++++
 6 files changed, 24 insertions(+), 2 deletions(-)

New commits:
commit 0944075553e0164a7cef09eaa35bafdffcc8ede8
Merge: 8d66230... a7febbd...
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue Apr 5 19:07:05 2011 +0200

    Merge remote-tracking branch 'origin/libreoffice-3-3' into libreoffice-3-4
    
    Conflicts:
    	svtools/source/control/toolbarmenu.cxx
    	vcl/inc/vcl/gdimtf.hxx
    	vcl/inc/vcl/settings.hxx
    	vcl/unx/inc/saldata.hxx
    	vcl/unx/kde4/KDESalGraphics.cxx

diff --cc unotools/source/config/configmgr.cxx
index 795a1b1,fa94533..70c2448
--- a/unotools/source/config/configmgr.cxx
+++ b/unotools/source/config/configmgr.cxx
@@@ -379,9 -403,9 +379,9 @@@ Any ConfigManager::GetDirectConfigPrope
  
      ::rtl::OUString sBrandName;
  #ifdef ENABLE_BROFFICE
-     LanguageType nType = MsLangId::getSystemUILanguage();
+     LanguageType nType = MsLangId::getRealLanguage( LANGUAGE_NONE );
      if ( nType == LANGUAGE_PORTUGUESE_BRAZILIAN )
 -        sBrandName = OUString::createFromAscii("BrOffice");
 +        sBrandName = OUString(RTL_CONSTASCII_USTRINGPARAM("BrOffice"));
      else
  #endif
          sBrandName = BrandName::get();
diff --cc vcl/source/gdi/gdimtf.cxx
index 5c787bb,8202bf1..4809b1f
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@@ -435,10 -435,10 +435,12 @@@ void GDIMetaFile::Play( GDIMetaFile& rM
      if ( !bRecord && !rMtf.bRecord )
      {
          MetaAction* pAction = GetCurAction();
 -        const ULONG nObjCount = Count();
 +        const sal_uLong nObjCount = Count();
 +
 +        rMtf.UseCanvas( rMtf.GetUseCanvas() || bUseCanvas );
  
+         rMtf.UseCanvas( rMtf.GetUseCanvas() || bUseCanvas );
+ 
          if( nPos > nObjCount )
              nPos = nObjCount;
  
diff --cc vcl/unx/kde4/KDESalGraphics.cxx
index 3b9a13c,925696a..6cf466d
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@@ -432,7 -354,9 +432,9 @@@ sal_Bool KDESalGraphics::drawNativeCont
      {   // reduce paint area only to the handle area
          const int width = kapp->style()->pixelMetric(QStyle::PM_ToolBarHandleExtent);
          QRect rect( 0, 0, width, widgetRect.height());
 -        pTempClipRegion = XCreateRegion();
 +        clipRegion = new QRegion( widgetRect.x(), widgetRect.y(), width, widgetRect.height());
+         XRectangle xRect = { widgetRect.x(), widgetRect.y(), width, widgetRect.height() };
+         XUnionRectWithRegion( &xRect, pTempClipRegion, pTempClipRegion );
          
          QStyleOption option;
          option.state = QStyle::State_Horizontal;
diff --cc vcl/unx/kde4/KDEXLib.cxx
index ca435c8,1bca18e..7757014
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@@ -202,20 -204,14 +202,30 @@@ void KDEXLib::Init(
  static GPollFunc old_gpoll = NULL;
  static gint gpoll_wrapper( GPollFD*, guint, gint );
  #endif
 +#ifdef QT_UNIX_EVENT_LOOP_SUPPORT
 +static int (*qt_select)(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept,
 +   const struct timeval *orig_timeout);
 +static int lo_select(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept,
 +   const struct timeval *orig_timeout);
 +#endif
 +
 +static bool ( *old_qt_event_filter )( void* );
 +static bool qt_event_filter( void* m )
 +{
 +    if( old_qt_event_filter != NULL && old_qt_event_filter( m ))
 +        return true;
 +    if( SalKDEDisplay::self() && SalKDEDisplay::self()->checkDirectInputEvent( static_cast< XEvent* >( m )))
 +        return true;
++    return false;
++}
+ 
+ static bool ( *old_qt_event_filter )( void* );
+ static bool qt_event_filter( void* m )
+ {
+     if( old_qt_event_filter != NULL && old_qt_event_filter( m ))
+         return true;
+     if( SalKDEDisplay::self() && SalKDEDisplay::self()->checkDirectInputEvent( static_cast< XEvent* >( m )))
+         return true;
      return false;
  }
  
commit a7febbdcdc9fd4a80e8357f3812456fc3fa0f39f
Author: Radek Doulik <rodo at novell.com>
Date:   Thu Mar 10 15:47:35 2011 +0100

    fix for 3.3.2 blocker fdo#34718 - change the type of nDrawerHeight to long
    
     - before it became big positive long in the called Point::Move
       function, moving the drawer under the visible area. so it was
       basically signed/unsigned problem in the layouter

diff --git a/svtools/source/toolpanel/drawerlayouter.cxx b/svtools/source/toolpanel/drawerlayouter.cxx
index df056d9..89354e2 100644
--- a/svtools/source/toolpanel/drawerlayouter.cxx
+++ b/svtools/source/toolpanel/drawerlayouter.cxx
@@ -88,7 +88,7 @@ namespace svt
         const size_t nUpperBound = !!aActivePanel ? *aActivePanel : nPanelCount - 1;
         for ( size_t i=0; i<=nUpperBound; ++i )
         {
-            sal_uInt32 nDrawerHeight = m_aDrawers[i]->GetPreferredHeightPixel();
+            long nDrawerHeight = m_aDrawers[i]->GetPreferredHeightPixel();
             m_aDrawers[i]->SetPosSizePixel(
                 aUpperDrawerPos, Size( nWidth, nDrawerHeight ) );
             aUpperDrawerPos.Move( 0, nDrawerHeight );
@@ -98,7 +98,7 @@ namespace svt
         Point aLowerDrawerPos( i_rDeckPlayground.BottomLeft() );
         for ( size_t j = nPanelCount - 1; j > nUpperBound; --j )
         {
-            sal_uInt32 nDrawerHeight = m_aDrawers[j]->GetPreferredHeightPixel();
+            long nDrawerHeight = m_aDrawers[j]->GetPreferredHeightPixel();
             m_aDrawers[j]->SetPosSizePixel(
                 Point( aLowerDrawerPos.X(), aLowerDrawerPos.Y() - nDrawerHeight + 1 ),
                 Size( nWidth, nDrawerHeight )
commit 9c59688b152ed2c4d46f9bd588c91a01247f6aeb
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue Mar 8 15:31:13 2011 +0100

    Version 3.3.2.1, tag libreoffice-3.3.2.1 (3.3.2-rc1)
commit f836140555c905f85464e6a0e355171231e81054
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Tue Feb 22 16:31:11 2011 +0100

    try to work around IM problems with KDE4 integration (bnc#665112)
    
    See comment for SalKDEDisplay::checkDirectInputEvent(). This was
    introduced when switching to using Qt event loop, Qt processes
    IM handling before LO gets a chance to do something and this conflicts.
    This is rather hackish but I have no better idea and as long as
    the IM protocol does not change it should be fine.
    
    ACK by Petr Mladek.

diff --git a/vcl/unx/kde4/KDESalDisplay.cxx b/vcl/unx/kde4/KDESalDisplay.cxx
index b1eb0d6..2524295 100644
--- a/vcl/unx/kde4/KDESalDisplay.cxx
+++ b/vcl/unx/kde4/KDESalDisplay.cxx
@@ -41,6 +41,7 @@ SalKDEDisplay::SalKDEDisplay( Display* pDisp )
 {
     assert( selfptr == NULL );
     selfptr = this;
+    xim_protocol = XInternAtom( pDisp_, "_XIM_PROTOCOL", False );
 }
 
 SalKDEDisplay::~SalKDEDisplay()
@@ -65,7 +66,32 @@ void SalKDEDisplay::Yield()
 
     XEvent event;
     XNextEvent( pDisp_, &event );
+    if( checkDirectInputEvent( &event ))
+        return;
     qApp->x11ProcessEvent( &event );
 }
 
+// HACK: When using Qt event loop, input methods (japanese, etc.) will get broken because
+// of XFilterEvent() getting called twice, once by Qt, once by LO (bnc#665112).
+// This function is therefore called before any XEvent is passed to Qt event handling
+// and if it is a keyboard event and no Qt widget is the active window (i.e. we are
+// processing events for some LO window), then feed the event only to LO directly and skip Qt
+// completely. Skipped events are KeyPress, KeyRelease and also _XIM_PROTOCOL client message
+// (seems to be necessary too, hopefully there are not other internal XIM messages that
+// would need this handling).
+bool SalKDEDisplay::checkDirectInputEvent( XEvent* ev )
+{
+    if( ev->xany.type == XLIB_KeyPress || ev->xany.type == KeyRelease
+        || ( ev->xany.type == ClientMessage && ev->xclient.message_type == xim_protocol ))
+    {
+        if( qApp->activeWindow() == NULL )
+        {
+            Dispatch(ev);
+            return true;
+        }
+    }
+    return false;
+}
+
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde4/KDESalDisplay.hxx b/vcl/unx/kde4/KDESalDisplay.hxx
index 1a79c86..25a8b9f 100644
--- a/vcl/unx/kde4/KDESalDisplay.hxx
+++ b/vcl/unx/kde4/KDESalDisplay.hxx
@@ -41,7 +41,9 @@ class SalKDEDisplay : public SalX11Display
         inline void EventGuardRelease() { osl_releaseMutex( hEventGuard_ ); }
 //        virtual long Dispatch( XEvent *event );
         virtual void Yield();
+        bool checkDirectInputEvent( XEvent* ev );
     private:
+        Atom xim_protocol;
         static SalKDEDisplay* selfptr;
 };
 
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 1084ba2..1bca18e 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -205,8 +205,19 @@ static GPollFunc old_gpoll = NULL;
 static gint gpoll_wrapper( GPollFD*, guint, gint );
 #endif
 
+static bool ( *old_qt_event_filter )( void* );
+static bool qt_event_filter( void* m )
+{
+    if( old_qt_event_filter != NULL && old_qt_event_filter( m ))
+        return true;
+    if( SalKDEDisplay::self() && SalKDEDisplay::self()->checkDirectInputEvent( static_cast< XEvent* >( m )))
+        return true;
+    return false;
+}
+
 void KDEXLib::setupEventLoop()
 {
+    old_qt_event_filter = QAbstractEventDispatcher::instance()->setEventFilter( qt_event_filter );
 #ifdef GLIB_EVENT_LOOP_SUPPORT
 // Glib is simple, it has g_main_context_set_poll_func() for wrapping the sleep call.
 // The catch is that Qt has a bug that allows triggering timers even when they should
commit 18a79a536aa38479517b1fd29eaf5e15da05d8dd
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Tue Feb 22 12:05:55 2011 +0000

    fix fdo#32640 - un-necessary reverse lookup on startup
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/vcl/unx/inc/saldata.hxx b/vcl/unx/inc/saldata.hxx
index 4164a0f..83a8ce7 100644
--- a/vcl/unx/inc/saldata.hxx
+++ b/vcl/unx/inc/saldata.hxx
@@ -87,9 +87,8 @@ public:
     void					StartTimer( ULONG nMS );
     inline	void			StopTimer();
     void					Timeout() const;
-    
-    const rtl::OUString&    GetLocalHostName() const
-    { return maLocalHostName; }
+
+    const rtl::OUString&    GetLocalHostName();
 
     static int XErrorHdl( Display*, XErrorEvent* );
     static int XIOErrorHdl( Display* );
diff --git a/vcl/unx/source/app/saldata.cxx b/vcl/unx/source/app/saldata.cxx
index bfe96f7..3840844 100644
--- a/vcl/unx/source/app/saldata.cxx
+++ b/vcl/unx/source/app/saldata.cxx
@@ -272,7 +272,13 @@ X11SalData::X11SalData()
     m_pPlugin		= NULL;
 
     hMainThread_	= pthread_self();
-    osl_getLocalHostname( &maLocalHostName.pData );
+}
+
+const rtl::OUString& X11SalData::GetLocalHostName()
+{
+    if (!maLocalHostName.getLength())
+            osl_getLocalHostname( &maLocalHostName.pData );
+    return maLocalHostName;
 }
 
 X11SalData::~X11SalData()
commit faf02acc88bc4d7ead617e8e4999ac717bbce31b
Author: Radek Doulik <rodo at novell.com>
Date:   Thu Feb 17 15:55:19 2011 +0100

    fix cairo canvas edge count calculation
    
    (cherry picked from commit abb5233c0b9b584407b4696f5db2c330ca45b632)
    
    Signed-off-by: Thorsten Behrens <tbehrens at novell.com>

diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx
index bb5f6be..29cf38e 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -1065,7 +1065,7 @@ namespace cairocanvas
 
                 if(nPointCount)
                 {
-                    const sal_uInt32 nEdgeCount(aCandidate.isClosed() ? nPointCount + 1: nPointCount);
+                    const sal_uInt32 nEdgeCount(aCandidate.isClosed() ? nPointCount: nPointCount - 1);
                     basegfx::B2DPolygon aEdge;
                     aEdge.append(aCandidate.getB2DPoint(0));
                     aEdge.append(basegfx::B2DPoint(0.0, 0.0));
commit 74b3688c6a388f077f6dd01dffee63bb872cce5c
Author: Radek Doulik <rodo at novell.com>
Date:   Wed Feb 16 18:12:33 2011 +0100

    fix cairo canvas regression - do not access polygon points outside range
    
    (cherry picked from commit a898a8cb077c05b1085da8254e66f61aa265b7dc)
    
    Signed-off-by: Thorsten Behrens <tbehrens at novell.com>

diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx
index 0294780..bb5f6be 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -1074,7 +1074,7 @@ namespace cairocanvas
                     {
                         const sal_uInt32 nNextIndex((b + 1) % nPointCount);
                         aEdge.setB2DPoint(1, aCandidate.getB2DPoint(nNextIndex));
-                        aEdge.setNextControlPoint(0, aCandidate.getNextControlPoint(b));
+                        aEdge.setNextControlPoint(0, aCandidate.getNextControlPoint(b % nPointCount));
                         aEdge.setPrevControlPoint(1, aCandidate.getPrevControlPoint(nNextIndex));
                         
                         doPolyPolygonImplementation( basegfx::B2DPolyPolygon(aEdge),
commit 104c373f43f494e059a040c323ea7e2f1b879d7c
Author: Radek Doulik <rodo at novell.com>
Date:   Tue Feb 15 17:26:00 2011 +0100

    GDIMetaFile::bUseCanvas related changes (prerequisite for fixing n#650049)
    
     - add GetUseCanvas() for read access
     - update bUseCanvas when playing on metafile

diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx
index 14cc127..4bf3d46 100644
--- a/vcl/inc/vcl/gdimtf.hxx
+++ b/vcl/inc/vcl/gdimtf.hxx
@@ -247,6 +247,7 @@ public:
     BOOL           CreateThumbnail( sal_uInt32 nMaximumExtent, BitmapEx& rBmpEx, const BitmapEx* pOverlay = NULL, const Rectangle* pOverlayRect = NULL ) const;
 
     void           UseCanvas( BOOL _bUseCanvas );
+    BOOL           GetUseCanvas() const { return bUseCanvas; }
 };
 
 /** Create a special metaaction that delegates rendering to specified
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 2c116fa..8202bf1 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -437,6 +437,8 @@ void GDIMetaFile::Play( GDIMetaFile& rMtf, ULONG nPos )
         MetaAction* pAction = GetCurAction();
         const ULONG nObjCount = Count();
 
+        rMtf.UseCanvas( rMtf.GetUseCanvas() || bUseCanvas );
+
         if( nPos > nObjCount )
             nPos = nObjCount;
 
commit dc42647b0dcce34d9c7d23758fb28741aae8eb00
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Tue Feb 15 12:46:06 2011 +0000

    disable EMF+ rendering on windows - it doesn't work yet

diff --git a/svtools/source/filter.vcl/wmf/enhwmf.cxx b/svtools/source/filter.vcl/wmf/enhwmf.cxx
index cc50b1b..1dd5c64 100644
--- a/svtools/source/filter.vcl/wmf/enhwmf.cxx
+++ b/svtools/source/filter.vcl/wmf/enhwmf.cxx
@@ -348,7 +348,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
     static sal_Bool bEnableEMFPlus = ( getenv( "EMF_PLUS_DISABLE" ) == NULL );
 #else
     // TODO: make it possible to disable emf+ on windows
-    static sal_Bool bEnableEMFPlus = sal_True;
+    static sal_Bool bEnableEMFPlus = sal_False;
 #endif
 
     while( bStatus && nRecordCount-- )
commit 5715b3d4200b8d307243a82fdadd898877f5bd63
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Thu Feb 10 17:34:10 2011 +0000

    catch exceptions from failing UNO-ness, fdo#33785 backstop.

diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index dabeeaf..2c116fa 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -512,7 +512,10 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S
     if (!win)
         win = Application::GetFirstTopLevelWindow();
 
-    if (win) {
+    if (!win)
+        return false;
+
+    try {
         const uno::Reference<rendering::XCanvas>& xCanvas = win->GetCanvas ();
         Size aSize (rDestSize.Width () + 1, rDestSize.Height () + 1);
         const uno::Reference<rendering::XBitmap>& xBitmap = xCanvas->getDevice ()->createCompatibleAlphaBitmap (vcl::unotools::integerSize2DFromSize( aSize));
@@ -566,6 +569,10 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S
                 }
             }
         }
+    } catch( uno::RuntimeException& ) {
+        throw; // runtime errors are fatal
+    } catch( uno::Exception& ) {
+        // ignore errors, no way of reporting them here
     }
 
     return false;
commit 29b510e2a77f65445831767fe2061a92b6b57279
Author: Petr Mladek <pmladek at suse.cz>
Date:   Fri Feb 11 22:36:09 2011 +0100

    use "BrOffice" name if the Brazilian UI translation is used (bnc#33744)
    
    it is not enough to check the system UI setting
    
    Signed off by Michael Meeks

diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx
index 7b57234..fa94533 100644
--- a/unotools/source/config/configmgr.cxx
+++ b/unotools/source/config/configmgr.cxx
@@ -403,7 +403,7 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
 
     ::rtl::OUString sBrandName;
 #ifdef ENABLE_BROFFICE
-    LanguageType nType = MsLangId::getSystemUILanguage();
+    LanguageType nType = MsLangId::getRealLanguage( LANGUAGE_NONE );
     if ( nType == LANGUAGE_PORTUGUESE_BRAZILIAN )
         sBrandName = OUString::createFromAscii("BrOffice");
     else
commit 3b8c4baec540c851ebf97d933e11150192defa87
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Thu Feb 10 19:21:37 2011 +0900

    GetEnglishSearchFontName() searches Takao fonts
    
    Signed-off-by: Kohei Yoshida <kyoshida at novell.com>

diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx
index e216348..4e0b812 100644
--- a/unotools/source/misc/fontdefs.cxx
+++ b/unotools/source/misc/fontdefs.cxx
@@ -91,6 +91,10 @@ static sal_Unicode const aIPAPMincho[] = { 'i', 'p', 'a', 'p', 0x660E, 0x671D, 0
 static sal_Unicode const aIPAGothic[] =  { 'i', 'p', 'a',  0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
 static sal_Unicode const aIPAPGothic[] =  { 'i', 'p', 'a', 'p', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
 static sal_Unicode const aIPAUIGothic[] =  { 'i', 'p', 'a', 'u', 'i', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
+static sal_Unicode const aTakaoMincho[] =  { 't', 'a', 'k', 'a', 'o', 0x660E, 0x671D, 0 };
+static sal_Unicode const aTakaoPMincho[] = { 't', 'a', 'k', 'a', 'o', 'p', 0x660E, 0x671D, 0 };
+static sal_Unicode const aTakaoGothic[] =  { 't', 'a', 'k', 'a', 'o',  0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
+static sal_Unicode const aTakaoPGothic[] =  { 't', 'a', 'k', 'a', 'o', 'p', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
 static sal_Unicode const aSazanamiMincho[] = { 0x3055, 0x3056, 0x306A, 0x307F, 0x660E, 0x671D, 0, 0 };
 static sal_Unicode const aSazanamiGothic[] = { 0x3055, 0x3056, 0x306A, 0x307F, 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 };
 static sal_Unicode const aKochiMincho[] = { 0x6771, 0x98A8, 0x660E, 0x671D, 0, 0 };
@@ -236,6 +240,10 @@ static ImplLocalizedFontName aImplLocalizedNamesList[] =
 {   "ipagothic",            aIPAGothic },
 {   "ipapgothic",           aIPAPGothic },
 {   "ipauigothic",          aIPAUIGothic },
+{   "takaomincho",          aTakaoMincho },
+{   "takaopmincho",         aTakaoPMincho },
+{   "takaogothic",          aTakaoGothic },
+{   "takaopgothic",         aTakaoPGothic },
 {   "sazanamimincho",       aSazanamiMincho },
 {   "sazanamigothic",       aSazanamiGothic },
 {   "kochimincho",          aKochiMincho },
commit 071354e24035aa359b416b17dcd53b6ae8e17f87
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Mon Feb 7 13:02:26 2011 +0100

    Fixed size computation for toolbar menus with controls
    (cherry picked from commit 8fc079ad197755ecb6191181de79fb60a6f6ae86)
    
    Signed-off-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index 1ac3b9d..e86644a 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -653,6 +653,51 @@ void ToolbarMenu::initWindow()
 
 // --------------------------------------------------------------------
 
+static long ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, long& rRadioHeight, long &rMaxWidth )
+{
+    rMaxWidth = rCheckHeight = rRadioHeight = 0;
+
+    ImplControlValue aVal;
+    Rectangle aNativeBounds;
+    Rectangle aNativeContent;
+    Point tmp( 0, 0 );
+    Rectangle aCtrlRegion( tmp, Size( 100, 15 ) );
+    if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM_CHECK_MARK ) )
+    {
+        if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP),
+                                          ControlPart(PART_MENU_ITEM_CHECK_MARK),
+                                          aCtrlRegion,
+                                          ControlState(CTRL_STATE_ENABLED),
+                                          aVal,
+                                          OUString(),
+                                          aNativeBounds,
+                                          aNativeContent )
+        )
+        {
+            rCheckHeight = aNativeBounds.GetHeight();
+            rMaxWidth = aNativeContent.GetWidth();
+        }
+    }
+    if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM_RADIO_MARK ) )
+    {
+        if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP),
+                                          ControlPart(PART_MENU_ITEM_RADIO_MARK),
+                                          aCtrlRegion,
+                                          ControlState(CTRL_STATE_ENABLED),
+                                          aVal,
+                                          OUString(),
+                                          aNativeBounds,
+                                          aNativeContent )
+        )
+        {
+            rRadioHeight = aNativeBounds.GetHeight();
+            rMaxWidth = Max (rMaxWidth, aNativeContent.GetWidth());
+        }
+    }
+    return (rCheckHeight > rRadioHeight) ? rCheckHeight : rRadioHeight;
+}
+
+
 Size ToolbarMenu::implCalcSize()
 {
     const long nFontHeight = GetTextHeight();
@@ -724,6 +769,28 @@ Size ToolbarMenu::implCalcSize()
                 pEntry->maSize.Height() = aControlSize.Height() + 1;
             }
 
+            if( pEntry->HasCheck() && !pEntry->mbHasImage )
+            {
+                if( this->IsNativeControlSupported( CTRL_MENU_POPUP,
+                                                     (pEntry->mnBits & MIB_RADIOCHECK)
+                                                     ? PART_MENU_ITEM_CHECK_MARK
+                                                     : PART_MENU_ITEM_RADIO_MARK ) )
+                {
+                    long nCheckHeight = 0, nRadioHeight = 0, nMaxCheckWidth = 0;
+                    ImplGetNativeCheckAndRadioSize( this, nCheckHeight, nRadioHeight, nMaxCheckWidth );
+
+                    long nCtrlHeight = (pEntry->mnBits & MIB_RADIOCHECK) ? nCheckHeight : nRadioHeight;
+                    nMaxTextWidth += nCtrlHeight + 1;
+                }
+                else if( pEntry->mbChecked )
+                {
+                    long nSymbolWidth = (nFontHeight*25)/40;
+                    if ( pEntry->mnBits & MIB_RADIOCHECK )
+                        nSymbolWidth = nFontHeight/2;
+
+                    nMaxTextWidth += nSymbolWidth;
+                }
+            }
         }
     }
     
@@ -1330,50 +1397,6 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec
     }
 }
 
-static long ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, long& rRadioHeight, long &rMaxWidth )
-{
-    rMaxWidth = rCheckHeight = rRadioHeight = 0;
-    
-    ImplControlValue aVal;
-    Rectangle aNativeBounds;
-    Rectangle aNativeContent;
-    Point tmp( 0, 0 );
-    Rectangle aCtrlRegion( tmp, Size( 100, 15 ) );
-    if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM_CHECK_MARK ) )
-    {
-        if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP),
-                                          ControlPart(PART_MENU_ITEM_CHECK_MARK),
-                                          aCtrlRegion,
-                                          ControlState(CTRL_STATE_ENABLED),
-                                          aVal,
-                                          OUString(),
-                                          aNativeBounds,
-                                          aNativeContent )
-        )
-        {
-            rCheckHeight = aNativeBounds.GetHeight();
-            rMaxWidth = aNativeContent.GetWidth();
-        }
-    }
-    if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM_RADIO_MARK ) )
-    {
-        if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP),
-                                          ControlPart(PART_MENU_ITEM_RADIO_MARK),
-                                          aCtrlRegion,
-                                          ControlState(CTRL_STATE_ENABLED),
-                                          aVal,
-                                          OUString(),
-                                          aNativeBounds,
-                                          aNativeContent )
-        )
-        {
-            rRadioHeight = aNativeBounds.GetHeight();
-            rMaxWidth = Max (rMaxWidth, aNativeContent.GetWidth());
-        }
-    }
-    return (rCheckHeight > rRadioHeight) ? rCheckHeight : rRadioHeight;
-}
-
 void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted )
 {
     USHORT nBorder = 0; long nStartY = 0; // from Menu implementations, needed when we support native menu background & scrollable menu
commit 8dd029aa89f4e980442ddc0361c8831421190823
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Thu Feb 10 12:12:28 2011 +0100

    properly fix incorrect recent backport
    
    ACK by Kendy

diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index d3eb7e7..925696a 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -354,7 +354,9 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
     {   // reduce paint area only to the handle area
         const int width = kapp->style()->pixelMetric(QStyle::PM_ToolBarHandleExtent);
         QRect rect( 0, 0, width, widgetRect.height());
-        QRegion* clipRegion = new QRegion( widgetRect.x(), widgetRect.y(), width, widgetRect.height());
+        pTempClipRegion = XCreateRegion();
+        XRectangle xRect = { widgetRect.x(), widgetRect.y(), width, widgetRect.height() };
+        XUnionRectWithRegion( &xRect, pTempClipRegion, pTempClipRegion );
         
         QStyleOption option;
         option.state = QStyle::State_Horizontal;
commit 462b3d61e352189d3d4c71acb7f62f6919381fd1
Author: bjoern.michaelsen at canonical.com <Bjoern Michaelsen>
Date:   Mon Feb 7 17:18:02 2011 +0100

    lp#696527: enable human icon theme in LibreOffice
    (cherry picked from commit 00b43fc0d82950e2abc57cca3746d395252bc9e0)
    
    Signed-off-by: Thorsten Behrens <tbehrens at novell.com>

diff --git a/vcl/inc/vcl/settings.hxx b/vcl/inc/vcl/settings.hxx
index 30308b2..5fa547d 100644
--- a/vcl/inc/vcl/settings.hxx
+++ b/vcl/inc/vcl/settings.hxx
@@ -525,7 +525,8 @@ private:
 #define STYLE_SYMBOLS_TANGO         ((ULONG)5)
 #define STYLE_SYMBOLS_OXYGEN        ((ULONG)6)
 #define STYLE_SYMBOLS_CLASSIC		((ULONG)7)
-#define STYLE_SYMBOLS_THEMES_MAX	((ULONG)8)
+#define STYLE_SYMBOLS_HUMAN		((ULONG)8)
+#define STYLE_SYMBOLS_THEMES_MAX	((ULONG)9)
 
 #define STYLE_MENUIMAGES_OFF  ((USHORT)0)
 #define STYLE_MENUIMAGES_ON   ((USHORT)1)
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 20adcc8..ddcaf0d 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -712,6 +712,7 @@ void StyleSettings::Set3DColors( const Color& rColor )
         case STYLE_SYMBOLS_TANGO:      return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("tango"));
         case STYLE_SYMBOLS_OXYGEN:     return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("oxygen"));
         case STYLE_SYMBOLS_CLASSIC:    return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("classic"));
+        case STYLE_SYMBOLS_HUMAN:      return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("human"));
     }
 
     return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("auto"));
@@ -735,6 +736,8 @@ ULONG StyleSettings::ImplNameToSymbolsStyle( const ::rtl::OUString &rName ) cons
         return STYLE_SYMBOLS_OXYGEN;
     else if ( rName == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("classic")) )
         return STYLE_SYMBOLS_CLASSIC;
+    else if ( rName == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("human")) )
+        return STYLE_SYMBOLS_HUMAN;
 
     return STYLE_SYMBOLS_AUTO;
 }


More information about the Libreoffice-commits mailing list