[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/unx

2023-05-09 Thread Caolán McNamara (via logerrit)
 vcl/source/gdi/metaact.cxx  |3 +++
 vcl/unx/generic/window/screensaverinhibitor.cxx |   12 +++-
 2 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 4a8a24be5a378308680a0b6e2e246d5d9df414c4
Author: Caolán McNamara 
AuthorDate: Mon May 8 10:43:07 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue May 9 11:20:08 2023 +0200

Related: tdf#142176 document what the other inhibit options are

via an enum like the gtk one so it can be seen how to inhibit logging
out due to unsaved changes

Change-Id: I07609cfb7a97b5b6c1b94a09b7b79bcca308d5d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151559
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/vcl/unx/generic/window/screensaverinhibitor.cxx 
b/vcl/unx/generic/window/screensaverinhibitor.cxx
index ec19fad09e5d..a2274028b526 100644
--- a/vcl/unx/generic/window/screensaverinhibitor.cxx
+++ b/vcl/unx/generic/window/screensaverinhibitor.cxx
@@ -207,6 +207,16 @@ void ScreenSaverInhibitor::inhibitFDOPM( bool bInhibit, 
const char* appname, con
 #endif // ENABLE_GIO
 }
 
+#if ENABLE_GIO
+enum ApplicationInhibitFlags
+{
+APPLICATION_INHIBIT_LOGOUT  = (1 << 0),
+APPLICATION_INHIBIT_SWITCH  = (1 << 1),
+APPLICATION_INHIBIT_SUSPEND = (1 << 2),
+APPLICATION_INHIBIT_IDLE= (1 << 3) // Inhibit the session being marked 
as idle
+};
+#endif
+
 void ScreenSaverInhibitor::inhibitGSM( bool bInhibit, const char* appname, 
const char* reason, const unsigned int xid )
 {
 #if ENABLE_GIO
@@ -218,7 +228,7 @@ void ScreenSaverInhibitor::inhibitGSM( bool bInhibit, const 
char* appname, const
   appname,
   xid,
   reason,
-  8 //Inhibit 
the session being marked as idle
+  
APPLICATION_INHIBIT_IDLE
  ),
 G_DBUS_CALL_FLAGS_NONE, 
-1, nullptr,  );
  },
commit b7ec54b7c6e85d507066442de3b7398f34bbb653
Author: Caolán McNamara 
AuthorDate: Tue May 9 08:45:34 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue May 9 11:19:57 2023 +0200

ofz#58756 Integer-overflow

Change-Id: Ie2782c1d68f73e5e88cf868eb1ce106ec0c181b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151558
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 107972fe8765..22093a95735e 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -973,6 +973,9 @@ MetaBmpScalePartAction::MetaBmpScalePartAction( const 
Point& rDstPt, const Size&
 
 void MetaBmpScalePartAction::Execute( OutputDevice* pOut )
 {
+if (!AllowRect(pOut->LogicToPixel(tools::Rectangle(maDstPt, maDstSz
+return;
+
 pOut->DrawBitmap( maDstPt, maDstSz, maSrcPt, maSrcSz, maBmp );
 }
 


[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/unx

2022-07-19 Thread offtkp (via logerrit)
 vcl/source/treelist/transfer.cxx |8 
 vcl/unx/gtk3/gtkinst.cxx |9 +
 2 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 7785a62cd74e5924e4ade4d69519966c63a0decf
Author: offtkp 
AuthorDate: Sat Jul 16 19:16:01 2022 +0300
Commit: Tomaž Vajngerl 
CommitDate: Tue Jul 19 13:24:22 2022 +0200

Replace old png writer in transfer.cxx

Change-Id: I1423bd4e7650da71f31de50df8a88ee3c09db33b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137135
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx
index 4506fa2ffea7..f2c453792a6f 100644
--- a/vcl/source/treelist/transfer.cxx
+++ b/vcl/source/treelist/transfer.cxx
@@ -64,7 +64,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -668,9 +668,9 @@ bool TransferableHelper::SetBitmapEx( const BitmapEx& 
rBitmapEx, const DataFlavo
 
 aFilterData.getArray()[aFilterData.getLength() - 1].Value <<= 1;
 #endif
-vcl::PNGWriter aPNGWriter(rBitmapEx, );
-
-aPNGWriter.Write(aMemStm);
+vcl::PngImageWriter aPNGWriter(aMemStm);
+aPNGWriter.setParameters(aFilterData);
+aPNGWriter.write(rBitmapEx);
 }
 else
 {
commit 20d0d2d2ff5ee0b8e1f40ca1adda115a82d974b6
Author: offtkp 
AuthorDate: Sat Jul 16 19:18:43 2022 +0300
Commit: Tomaž Vajngerl 
CommitDate: Tue Jul 19 13:24:09 2022 +0200

Replace old png writer in gtkinst.cxx

Change-Id: I5a9aefe1b957b800b5c56f3200d28ef727324cac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137136
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index c88c6886ee85..4aacd3979b4e 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -86,7 +86,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -4814,9 +4814,10 @@ namespace
 // We "know" that this gets passed to zlib's deflateInit2_(). 1 means 
best speed.
 css::uno::Sequence aFilterData{ 
comphelper::makePropertyValue(
 "Compression", sal_Int32(1)) };
-
-vcl::PNGWriter aWriter(aImage.GetBitmapEx(), );
-aWriter.Write(aMemStm);
+auto aBitmapEx = aImage.GetBitmapEx();
+vcl::PngImageWriter aWriter(aMemStm);
+aWriter.setParameters(aFilterData);
+aWriter.write(aBitmapEx);
 
 return load_icon_from_stream(aMemStm);
 }


[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/unx

2019-12-30 Thread Tomaž Vajngerl (via logerrit)
 vcl/source/gdi/pdfwriter_impl.hxx |   24 
 vcl/unx/gtk3/gtk3gtkobject.cxx|4 ++--
 2 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 69b221263be58118b3293363ab9ecf7581c50c6f
Author: Tomaž Vajngerl 
AuthorDate: Mon Dec 30 17:50:25 2019 +0100
Commit: Tomaž Vajngerl 
CommitDate: Mon Dec 30 19:45:18 2019 +0100

pdf: move PDFAnnotation out of PDFWriterImpl class

Change-Id: I37db3419eeaa8c5f8096a663a2ccede178bfadf7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86016
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/source/gdi/pdfwriter_impl.hxx 
b/vcl/source/gdi/pdfwriter_impl.hxx
index 8ee67280c962..1e6f40c24843 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -348,6 +348,18 @@ struct PDFOutlineEntry
 {}
 };
 
+struct PDFAnnotation
+{
+sal_Int32   m_nObject;
+tools::Rectangle   m_aRect;
+sal_Int32   m_nPage;
+
+PDFAnnotation()
+: m_nObject( -1 ),
+  m_nPage( -1 )
+{}
+};
+
 }
 
 class PDFWriterImpl : public VirtualDevice
@@ -357,18 +369,6 @@ class PDFWriterImpl : public VirtualDevice
 public:
 friend struct vcl::pdf::PDFPage;
 
-struct PDFAnnotation
-{
-sal_Int32   m_nObject;
-tools::Rectangle   m_aRect;
-sal_Int32   m_nPage;
-
-PDFAnnotation()
-: m_nObject( -1 ),
-  m_nPage( -1 )
-{}
-};
-
 struct PDFLink : public PDFAnnotation
 {
 sal_Int32   m_nDest; // set to -1 for URL, to a dest 
else
commit 82a22f62e5b1c7bfa7fb117a0423475f10410194
Author: Stephan Bergmann 
AuthorDate: Sun Dec 29 23:24:42 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Dec 30 19:45:10 2019 +0100

Fix GDK_KEY_RELEASE -> GDK_KEY_RELEASE_MASK

...as found with recent Clang 10 trunk:

> vcl/unx/gtk3/gtk3gtkobject.cxx:255:76: error: bitwise operation between 
different enumeration types ('GdkEventMask' and 'GdkEventType') is deprecated 
[-Werror,-Wdeprecated-enum-enum-conversion]
> gtk_widget_add_events( GTK_WIDGET( m_pSocket ), 
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE );
> 
~~ ^ ~~~

This is presumably a typo originating with
31fa4545985acc1594107e087cedc2d99b3d0f0b "split the gtk2 and gtk2 
gtkobjects".


states that the "gint events" parameter of gtk_widget_add_events is "an 
event
mask, see GdkEventMask", and /usr/include/gtk-3.0/gdk/gdktypes.h has

> typedef enum
> {
[...]
>   GDK_KEY_PRESS_MASK= 1 << 10,
>   GDK_KEY_RELEASE_MASK  = 1 << 11,
[...]
> } GdkEventMask;

while /usr/include/gtk-3.0/gdk/gdkevents.h (both
gtk3-devel-3.24.13-1.fc31.x86_64) has

> typedef enum
> {
[...]
>   GDK_KEY_PRESS = 8,
>   GDK_KEY_RELEASE   = 9,
[...]
> } GdkEventType;

Change-Id: I23acfef5e59803d2b71eed6c65a78e9895e415af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85971
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/vcl/unx/gtk3/gtk3gtkobject.cxx b/vcl/unx/gtk3/gtk3gtkobject.cxx
index d038a6121432..9b9fff958908 100644
--- a/vcl/unx/gtk3/gtk3gtkobject.cxx
+++ b/vcl/unx/gtk3/gtk3gtkobject.cxx
@@ -252,9 +252,9 @@ void GtkSalObject::signalDestroy( GtkWidget* pObj, gpointer 
object )
 void GtkSalObjectBase::SetForwardKey( bool bEnable )
 {
 if( bEnable )
-gtk_widget_add_events( GTK_WIDGET( m_pSocket ), GDK_KEY_PRESS_MASK | 
GDK_KEY_RELEASE );
+gtk_widget_add_events( GTK_WIDGET( m_pSocket ), GDK_KEY_PRESS_MASK | 
GDK_KEY_RELEASE_MASK );
 else
-gtk_widget_set_events( GTK_WIDGET( m_pSocket ), ~(GDK_KEY_PRESS_MASK | 
GDK_KEY_RELEASE) & gtk_widget_get_events( GTK_WIDGET( m_pSocket ) ) );
+gtk_widget_set_events( GTK_WIDGET( m_pSocket ), ~(GDK_KEY_PRESS_MASK | 
GDK_KEY_RELEASE_MASK) & gtk_widget_get_events( GTK_WIDGET( m_pSocket ) ) );
 }
 
 GtkSalObjectWidgetClip::GtkSalObjectWidgetClip(GtkSalFrame* pParent, bool 
bShow)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/unx writerfilter/source xmlhelp/source xmloff/source

2019-02-10 Thread Libreoffice Gerrit user
 vcl/source/app/help.cxx|2 
 vcl/source/app/svmain.cxx  |2 
 vcl/source/control/ctrl.cxx|2 
 vcl/source/control/field.cxx   |2 
 vcl/source/control/imgctrl.cxx |2 
 vcl/source/control/notebookbar.cxx |4 
 vcl/source/edit/vclmedit.cxx   |2 
 vcl/source/filter/graphicfilter.cxx|8 
 vcl/source/filter/wmf/emfwr.cxx|4 
 vcl/source/filter/wmf/wmfwr.cxx|   14 
 vcl/source/fontsubset/cff.cxx  |   16 -
 vcl/source/gdi/gradient.cxx|4 
 vcl/source/gdi/metaact.cxx |2 
 vcl/source/gdi/pdfextoutdevdata.cxx|2 
 vcl/source/gdi/pdfwriter_impl.cxx  |4 
 vcl/source/graphic/UnoGraphicDescriptor.cxx|2 
 vcl/source/outdev/gradient.cxx |   32 +-
 vcl/source/outdev/text.cxx |2 
 vcl/source/treelist/svimpbox.cxx   |4 
 vcl/source/treelist/transfer.cxx   |2 
 vcl/source/treelist/transfer2.cxx  |   16 -
 vcl/source/window/accel.cxx|2 
 vcl/source/window/accessibility.cxx|4 
 vcl/source/window/dialog.cxx   |   20 -
 vcl/source/window/dlgctrl.cxx  |2 
 vcl/source/window/dndlistenercontainer.cxx |6 
 vcl/source/window/menu.cxx |4 
 vcl/source/window/paint.cxx|8 
 vcl/source/window/seleng.cxx   |2 
 vcl/source/window/syswin.cxx   |2 
 vcl/source/window/window.cxx   |4 
 vcl/unx/generic/app/i18n_cb.cxx|   34 +-
 vcl/unx/generic/dtrans/X11_selection.cxx   |2 
 vcl/unx/generic/gdi/gdiimpl.cxx|8 
 vcl/unx/generic/gdi/salvd.cxx  |2 
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |4 
 vcl/unx/generic/glyphs/glyphcache.cxx  |4 
 vcl/unx/generic/printer/ppdparser.cxx  |2 
 vcl/unx/generic/window/salframe.cxx|   22 -
 vcl/unx/glxtest.cxx|2 
 vcl/unx/gtk/a11y/atkfactory.cxx|6 
 vcl/unx/gtk/a11y/atkutil.cxx   |4 
 vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx   |2 
 vcl/unx/gtk3/gtk3gtkdata.cxx   |6 
 vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx  |3 
 writerfilter/source/dmapper/DomainMapper.cxx   |8 
 writerfilter/source/dmapper/DomainMapperTableManager.cxx   |   22 -
 writerfilter/source/dmapper/DomainMapper_Impl.cxx  |   12 
 writerfilter/source/dmapper/DomainMapper_Impl.hxx  |2 
 writerfilter/source/dmapper/NumberingManager.cxx   |6 
 writerfilter/source/dmapper/ThemeTable.cxx |   24 -
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx|   12 
 xmlhelp/source/cxxhelp/provider/content.cxx|2 
 xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx  |2 
 xmlhelp/source/treeview/tvread.cxx |   36 +-
 xmloff/source/chart/SchXMLExport.cxx   |4 
 xmloff/source/core/XMLEmbeddedObjectImportContext.cxx  |   18 -
 xmloff/source/core/nmspmap.cxx |2 
 xmloff/source/draw/eventimp.cxx|  192 ++---
 xmloff/source/draw/sdxmlexp.cxx|2 
 xmloff/source/draw/ximpshap.cxx|2 
 xmloff/source/draw/ximpstyl.cxx|2 
 xmloff/source/forms/elementexport.cxx  |   12 
 xmloff/source/forms/elementimport.cxx  |2 
 xmloff/source/style/DrawAspectHdl.cxx  |2 
 xmloff/source/style/ImageStyle.cxx |2 
 xmloff/source/style/PageMasterImportPropMapper.cxx |6 
 xmloff/source/style/XMLClipPropertyHandler.cxx |2 
 xmloff/source/style/XMLPercentOrMeasurePropertyHandler.cxx |2 
 xmloff/source/style/shadwhdl.cxx   |2 
 xmloff/source/style/xmlbahdl.cxx   |8 
 xmloff/source/table/XMLTableExport.cxx |   31 +-
 xmloff/source/text/XMLIndexTabStopEntryContext.cxx |2 
 

[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/unx vcl/workben xmloff/qa xmloff/source

2018-10-18 Thread Libreoffice Gerrit user
 vcl/source/app/svapp.cxx |   86 ++--
 vcl/source/font/font.cxx |6 -
 vcl/source/fontsubset/ttcr.cxx   |4 
 vcl/source/window/debugevent.cxx |6 -
 vcl/source/window/layout.cxx |2 
 vcl/unx/generic/app/i18n_ic.cxx  |2 
 vcl/unx/generic/app/saldisp.cxx  |   17 +---
 vcl/unx/generic/fontmanager/fontmanager.cxx  |2 
 vcl/unx/gtk3/gtk3gtkinst.cxx |2 
 vcl/workben/vcldemo.cxx  |   12 +-
 xmloff/qa/unit/uxmloff.cxx   |2 
 xmloff/source/forms/controlpropertymap.cxx   |   48 ---
 xmloff/source/forms/gridcolumnproptranslator.cxx |4 
 xmloff/source/style/xmlexppr.cxx |2 
 xmloff/source/transform/EventMap.cxx |4 
 xmloff/source/transform/EventMap.hxx |4 
 xmloff/source/transform/EventOASISTContext.cxx   |4 
 xmloff/source/transform/EventOOoTContext.cxx |   12 +-
 xmloff/source/transform/OOo2Oasis.cxx|   82 +--
 xmloff/source/transform/Oasis2OOo.cxx|   96 +++
 xmloff/source/transform/PropertyActionsOASIS.cxx |   26 +++---
 xmloff/source/transform/PropertyActionsOASIS.hxx |   26 +++---
 xmloff/source/transform/PropertyActionsOOo.cxx   |   36 
 xmloff/source/transform/PropertyActionsOOo.hxx   |   36 
 xmloff/source/transform/StyleOASISTContext.cxx   |2 
 xmloff/source/transform/StyleOOoTContext.cxx |2 
 xmloff/source/transform/TransformerActions.cxx   |4 
 xmloff/source/transform/TransformerActions.hxx   |4 
 xmloff/source/transform/TransformerBase.cxx  |4 
 xmloff/source/transform/TransformerBase.hxx  |4 
 xmloff/source/transform/TransformerTokenMap.cxx  |2 
 xmloff/source/transform/TransformerTokenMap.hxx  |2 
 32 files changed, 249 insertions(+), 296 deletions(-)

New commits:
commit 265072a4cafd9f8552264448e2fc049ae3ac97e5
Author: Noel Grandin 
AuthorDate: Thu Oct 18 11:54:34 2018 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 19 07:57:49 2018 +0200

loplugin:staticvar in vcl

Change-Id: I2bdab84dc81e0545aa96542caec213db61765f68
Reviewed-on: https://gerrit.libreoffice.org/61922
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index a43b830ded2b..fb8ec12d28d7 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -89,65 +89,35 @@ void InitSettings(ImplSVData* pSVData);
 }
 
 // keycodes handled internally by VCL
-class ImplReservedKey
-{
-public:
-explicit ImplReservedKey( vcl::KeyCode aKeyCode )
-: mKeyCode(aKeyCode)
-{
-}
-
-vcl::KeyCode mKeyCode;
-};
-
-typedef std::pair ReservedKeys;
-namespace
-{
-struct ImplReservedKeysImpl
-{
-ReservedKeys* operator()()
-{
-static ImplReservedKey ImplReservedKeys[] =
-{
-ImplReservedKey(vcl::KeyCode(KEY_F1,0)  ),
-ImplReservedKey(vcl::KeyCode(KEY_F1,KEY_SHIFT)  ),
-ImplReservedKey(vcl::KeyCode(KEY_F1,KEY_MOD1)   ),
-ImplReservedKey(vcl::KeyCode(KEY_F2,KEY_SHIFT)  ),
-ImplReservedKey(vcl::KeyCode(KEY_F4,KEY_MOD1)   ),
-ImplReservedKey(vcl::KeyCode(KEY_F4,KEY_MOD2)   ),
-ImplReservedKey(vcl::KeyCode(KEY_F4,KEY_MOD1|KEY_MOD2)  ),
-ImplReservedKey(vcl::KeyCode(KEY_F6,0)  ),
-ImplReservedKey(vcl::KeyCode(KEY_F6,KEY_MOD1)   ),
-ImplReservedKey(vcl::KeyCode(KEY_F6,KEY_SHIFT)  ),
-ImplReservedKey(vcl::KeyCode(KEY_F6,KEY_MOD1|KEY_SHIFT) ),
-ImplReservedKey(vcl::KeyCode(KEY_F10,0) )
+static vcl::KeyCode const ReservedKeys[]
+{
+vcl::KeyCode(KEY_F1,0)  ,
+vcl::KeyCode(KEY_F1,KEY_SHIFT)  ,
+vcl::KeyCode(KEY_F1,KEY_MOD1)   ,
+vcl::KeyCode(KEY_F2,KEY_SHIFT)  ,
+vcl::KeyCode(KEY_F4,KEY_MOD1)   ,
+vcl::KeyCode(KEY_F4,KEY_MOD2)   ,
+vcl::KeyCode(KEY_F4,KEY_MOD1|KEY_MOD2)  ,
+vcl::KeyCode(KEY_F6,0)  ,
+vcl::KeyCode(KEY_F6,KEY_MOD1)   ,
+vcl::KeyCode(KEY_F6,KEY_SHIFT)  ,
+vcl::KeyCode(KEY_F6,KEY_MOD1|KEY_SHIFT) ,
+vcl::KeyCode(KEY_F10,0)
 #ifdef UNX
 ,
-ImplReservedKey(vcl::KeyCode(KEY_1,KEY_SHIFT|KEY_MOD1)),
-ImplReservedKey(vcl::KeyCode(KEY_2,KEY_SHIFT|KEY_MOD1)),
-ImplReservedKey(vcl::KeyCode(KEY_3,KEY_SHIFT|KEY_MOD1)),
-

[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/unx

2016-10-11 Thread Khaled Hosny
 vcl/source/gdi/sallayout.cxx|4 
 vcl/unx/generic/glyphs/gcach_layout.cxx |   30 +++---
 2 files changed, 11 insertions(+), 23 deletions(-)

New commits:
commit f48cbaac0a2a7278f366a3b0118b399c0a938a44
Author: Khaled Hosny 
Date:   Tue Oct 11 14:53:06 2016 +0200

tdf#103103: Many Arabic fonts dont render correctly

Revert the remaining bits of 1da9b4c24e806ad2447b4a656e2a7192755bb6a8,
the rest was reverted in 6323e6628668849438e6e19ba7ad2c6598263261.

This break many assumptions made by GenericSalLayout::ApplyDXArray().

Change-Id: I25fbafe06032ab1e8860df6c5932a7157575aa32

diff --git a/vcl/unx/generic/glyphs/gcach_layout.cxx 
b/vcl/unx/generic/glyphs/gcach_layout.cxx
index 38d7e84..46420cb 100644
--- a/vcl/unx/generic/glyphs/gcach_layout.cxx
+++ b/vcl/unx/generic/glyphs/gcach_layout.cxx
@@ -21,7 +21,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
@@ -309,16 +308,14 @@ static unsigned int 
unicodeDecomposeCompatibility(hb_unicode_funcs_t* /*ufuncs*/
 {
 return 0;
 }
-#endif
 
 static hb_unicode_funcs_t* getUnicodeFuncs()
 {
 static hb_unicode_funcs_t* ufuncs = 
hb_unicode_funcs_create(hb_icu_get_unicode_funcs());
-#if !HB_VERSION_ATLEAST(1, 1, 0)
 hb_unicode_funcs_set_decompose_compatibility_func(ufuncs, 
unicodeDecomposeCompatibility, nullptr, nullptr);
-#endif
 return ufuncs;
 }
+#endif
 
 class HbLayoutEngine : public ServerFontLayoutEngine
 {
@@ -492,8 +489,8 @@ bool HbLayoutEngine::Layout(ServerFontLayout& rLayout, 
ImplLayoutArgs& rArgs)
 nHbFlags |= HB_BUFFER_FLAG_EOT; /* End-of-text */
 
 hb_buffer_t *pHbBuffer = hb_buffer_create();
-static hb_unicode_funcs_t* pHbUnicodeFuncs = getUnicodeFuncs();
 #if !HB_VERSION_ATLEAST(1, 1, 0)
+static hb_unicode_funcs_t* pHbUnicodeFuncs = getUnicodeFuncs();
 hb_buffer_set_unicode_funcs(pHbBuffer, pHbUnicodeFuncs);
 #endif
 hb_buffer_set_direction(pHbBuffer, bRightToLeft ? 
HB_DIRECTION_RTL: HB_DIRECTION_LTR);
@@ -503,9 +500,6 @@ bool HbLayoutEngine::Layout(ServerFontLayout& rLayout, 
ImplLayoutArgs& rArgs)
 hb_buffer_add_utf16(
 pHbBuffer, reinterpret_cast(pStr), nLength,
 nMinRunPos, nRunLen);
-#if HB_VERSION_ATLEAST(0, 9, 42)
-hb_buffer_set_cluster_level(pHbBuffer, 
HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS);
-#endif
 hb_shape(pHbFont, pHbBuffer, nullptr, 0);
 
 int nRunGlyphCount = hb_buffer_get_length(pHbBuffer);
@@ -554,12 +548,15 @@ bool HbLayoutEngine::Layout(ServerFontLayout& rLayout, 
ImplLayoutArgs& rArgs)
 //   but usually harmless), so we try to sniff what HarfBuzz 
thinks
 //   about this glyph by checking if it gives it a zero advance
 //   width.
-// * If the font has no GDEF table, we then check the unicode 
class
-//   of the glyph. If it is a non spacing mark then the glyph 
is a
-//   diacritic. This is only done if the HarfBuzz version is 
>= 0.9.42
-//   Else, we fallback to setting bDiacritic to true if the x 
advance
-//   of the glyph is zero. This maybe wrong in some cases but 
needs to
-//   be kept until the base version of HarfBuzz can be updated.
+// * If the font has no GDEF table, we just check if the glyph 
has
+//   zero advance width, but this is stupid and can be wrong. A
+//   better way would to check the character's Unicode 
combining
+//   class, but unfortunately HarfBuzz gives combining marks 
the
+//   cluster value of its base character, so nCharPos will be
+//   pointing to the wrong character (but HarfBuzz might change
+//   this in the future).
+//   Newer versions of HarfBuzz can control this behaviour with
+//   hb_buffer_set_cluster_level().
 bool bDiacritic = false;
 if (hb_ot_layout_has_glyph_classes(mpHbFace))
 {
@@ -570,14 +567,9 @@ bool HbLayoutEngine::Layout(ServerFontLayout& rLayout, 
ImplLayoutArgs& rArgs)
 }
 else
 {
-#if HB_VERSION_ATLEAST(0, 9, 42)
-if(hb_unicode_general_category (pHbUnicodeFuncs, aChar) == 
HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
-bDiacritic = true;
-#else
 // the font lacks GDEF table
 if (pHbPositions[i].x_advance == 0)
 bDiacritic = true;
-#endif
 }
 
 if (bDiacritic)
commit faddf2aefd5874b2bbd6c3b7bbed0812de911f47
Author: Khaled Hosny 
Date:   Tue Oct 11 15:11:58 2016 +0200

Revert "Hack to make Arabic subtending marks work"

This reverts 

[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/unx

2016-07-21 Thread Caolán McNamara
 vcl/source/control/field2.cxx   |2 +-
 vcl/unx/gtk/a11y/atkfactory.cxx |6 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 82913e694a4169f9ddeef399e659aec78cc9c8d6
Author: Caolán McNamara 
Date:   Thu Jul 21 12:18:36 2016 +0100

Resolves: tdf#100558 last 'section' of date field not incremented

presumably a regression from...

commit 3cad6c806e5247ce20b78eb688551aa5d872b934
Author: Chr. Rossmanith 
Date:   Fri Mar 1 21:47:10 2013 +0100

Replace (Xub)String with OUString in vcl(field)

where UniString::Search returned a max short on not-found
while OUString::indexOf returns a -1

Change-Id: Ia3ef80dd318375ccdb3bdcee9bed7b70bf67cae1

diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 27b6b41..6076074 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -1351,7 +1351,7 @@ void DateField::ImplDateSpinArea( bool bUp )
 for ( sal_Int8 i = 1; i <= 3; i++ )
 {
 nPos = aText.indexOf( aDateSep, nPos );
-if ( nPos >= (sal_Int32)aSelection.Max() )
+if (nPos < 0 || nPos >= (sal_Int32)aSelection.Max())
 {
 nDateArea = i;
 break;
commit 27328034f5e2644b4a0287532e762e87ea36c4a0
Author: Caolán McNamara 
Date:   Thu Jul 21 11:55:13 2016 +0100

gtk3-a11y: our eventbox is inside a grid now

Change-Id: Icb49d6274b09fb426ab6c0f9f67b7c71c4ef9a31

diff --git a/vcl/unx/gtk/a11y/atkfactory.cxx b/vcl/unx/gtk/a11y/atkfactory.cxx
index bca68a6..2f51f14 100644
--- a/vcl/unx/gtk/a11y/atkfactory.cxx
+++ b/vcl/unx/gtk/a11y/atkfactory.cxx
@@ -109,7 +109,11 @@ wrapper_factory_create_accessible( GObject *obj )
 if (!pEventBox)
 return atk_noop_object_wrapper_new();
 
-GtkWidget* pTopLevel = gtk_widget_get_parent(pEventBox);
+GtkWidget* pTopLevelGrid = gtk_widget_get_parent(pEventBox);
+if (!pTopLevelGrid)
+return atk_noop_object_wrapper_new();
+
+GtkWidget* pTopLevel = gtk_widget_get_parent(pTopLevelGrid);
 if (!pTopLevel)
 return atk_noop_object_wrapper_new();
 #else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/unx

2016-07-04 Thread Caolán McNamara
 vcl/source/window/winproc.cxx |4 
 vcl/unx/gtk3/gtk3gtkframe.cxx |3 ---
 2 files changed, 7 deletions(-)

New commits:
commit 43fbd02a82f9c87c75e83671c95c2617cc30d035
Author: Caolán McNamara 
Date:   Mon Jul 4 11:35:36 2016 +0100

this flush refers to the gtk2/X impl

where there is two connections to the display, for gtk3 there
is just the one connection

Change-Id: I2da02efa12205ab4ca39d9585965e5d6d0adf474

diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index b0a4e62..8e12b96 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -1462,9 +1462,6 @@ void GtkSalFrame::Show( bool bVisible, bool 
/*bNoActivate*/ )
 gtk_widget_hide( m_pWindow );
 if( m_pIMHandler )
 m_pIMHandler->focusChanged( false );
-// flush here; there may be a very seldom race between
-// the display connection used for clipboard and our connection
-Flush();
 }
 }
 }
commit a760ff5b41612c0c6aefeac5fb06691f819ceee2
Author: Caolán McNamara 
Date:   Fri Jul 1 21:17:18 2016 +0100

lets assume its ok this was commented out

Change-Id: Ic22c8b1f0f0b9e7427eae756f9f16630f951baa6

diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 7333612..5093c1e 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -364,10 +364,6 @@ bool ImplHandleMouseEvent( const VclPtr& 
xWindow, MouseNotifyEvent
 const OutputDevice *pChildWinOutDev = pChild->GetOutDev();
 pChildWinOutDev->ReMirror( aMousePos );
 }
-// no mouse messages to system object windows ?
-// !!!KA: Is it OK to comment this out? !!!
-//if ( pChild->ImplGetWindowImpl()->mpSysObj )
-//return false;
 
 // no mouse messages to disabled windows
 // #106845# if the window was disabled during capturing we have to 
pass the mouse events to release capturing
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/unx

2015-11-30 Thread Caolán McNamara
 vcl/source/window/seleng.cxx   |2 +-
 vcl/source/window/toolbox.cxx  |6 --
 vcl/source/window/toolbox2.cxx |6 --
 vcl/unx/gtk/gtksalframe.cxx|   14 --
 4 files changed, 21 insertions(+), 7 deletions(-)

New commits:
commit 503864037b2f6b73979f46d11df5d365b81f9dcf
Author: Caolán McNamara 
Date:   Mon Nov 30 16:42:15 2015 +

gtk3: implement GetIndicatorState

Change-Id: I006c739a9dc876dd9ec83375f76fd1343b39557a

diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index b465404..64994bf 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -2770,8 +2770,18 @@ KeyIndicatorState GtkSalFrame::GetIndicatorState()
 #if !GTK_CHECK_VERSION(3,0,0)
 return GetGtkSalData()->GetGtkDisplay()->GetIndicatorState();
 #else
-g_warning ("missing get indicator state");
-return KeyIndicatorState::NONE;
+KeyIndicatorState nState = KeyIndicatorState::NONE;
+
+GdkKeymap *pKeyMap = gdk_keymap_get_for_display(getGdkDisplay());
+
+if (gdk_keymap_get_caps_lock_state(pKeyMap))
+nState |= KeyIndicatorState::CAPSLOCK;
+if (gdk_keymap_get_num_lock_state(pKeyMap))
+nState |= KeyIndicatorState::NUMLOCK;
+if (gdk_keymap_get_scroll_lock_state(pKeyMap))
+nState |= KeyIndicatorState::SCROLLLOCK;
+
+return nState;
 #endif
 }
 
commit a4e58b509828d806513217efc03134845629cccd
Author: Caolán McNamara 
Date:   Mon Nov 30 16:18:35 2015 +

silence ReleaseMouse warning

Change-Id: I615b4877ab29075ed45149259260acfb2563cad8

diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx
index 69b220b..6aefea1 100644
--- a/vcl/source/window/seleng.cxx
+++ b/vcl/source/window/seleng.cxx
@@ -280,7 +280,7 @@ bool SelectionEngine::SelMouseButtonUp( const MouseEvent& 
rMEvt )
 
 void SelectionEngine::ReleaseMouse()
 {
-if (!pWin)
+if (!pWin || !pWin->IsMouseCaptured())
 return;
 pWin->ReleaseMouse();
 }
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 4105b58..311d12e 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1251,7 +1251,8 @@ void ImplTBDragMgr::Dragging( const Point& rPos )
 void ImplTBDragMgr::EndDragging( bool bOK )
 {
 mpDragBox->HideTracking();
-mpDragBox->ReleaseMouse();
+if (mpDragBox->IsMouseCaptured())
+mpDragBox->ReleaseMouse();
 mpDragBox->mbDragging = false;
 mbShowDragRect = false;
 Application::RemoveAccel(  );
@@ -3346,7 +3347,8 @@ void ToolBox::ImplFloatControl( bool bStart, 
FloatingWindow* pFloatWindow )
 
 mbDrag = false;
 EndTracking();
-ReleaseMouse();
+if (IsMouseCaptured())
+ReleaseMouse();
 }
 else
 {
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index dddb65f..2bcb44e 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1335,7 +1335,8 @@ void ToolBox::EndSelection()
 if (mnCurPos != TOOLBOX_ITEM_NOTFOUND)
 InvalidateItem(mnCurPos);
 EndTracking();
-ReleaseMouse();
+if (IsMouseCaptured())
+ReleaseMouse();
 Deactivate();
 }
 
@@ -1378,7 +1379,8 @@ void ToolBox::SetItemDown( sal_uInt16 nItemId, bool 
bDown, bool bRelease )
 mbDrag = false;
 mbSelection = false;
 EndTracking();
-ReleaseMouse();
+if (IsMouseCaptured())
+ReleaseMouse();
 Deactivate();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/unx

2015-08-23 Thread Khaled Hosny
 vcl/source/gdi/salgdilayout.cxx   |4 ++-
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |   29 +++---
 2 files changed, 25 insertions(+), 8 deletions(-)

New commits:
commit e2582341af9f6b756e5d95c8ddd99652b62d1a41
Author: Khaled Hosny khaledho...@eglug.org
Date:   Mon Aug 17 04:00:49 2015 +0200

Fix GTK3 right-to-left rendering of spin buttons

The button were not drawn at all

Change-Id: I51dfa30a6daa1034b5e978b09bcdfcc83e859f3d
Reviewed-on: https://gerrit.libreoffice.org/17790
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx 
b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 8ee0d0a..7344423 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -139,25 +139,40 @@ Rectangle GtkSalGraphics::NWGetSpinButtonRect( 
ControlPart nPart, Rectangle aAre
 buttonRect.SetSize(Size(buttonWidth, buttonHeight));
 buttonRect.setY(aAreaRect.Top());
 buttonRect.Bottom() = buttonRect.Top() + aAreaRect.GetHeight();
+Rectangle partRect(buttonRect);
 if ( nPart == PART_BUTTON_UP )
 {
-buttonRect.setX(aAreaRect.Left() + (aAreaRect.GetWidth() - 
buttonRect.GetWidth()));
+if (AllSettings::GetLayoutRTL())
+partRect.setX(aAreaRect.Left());
+else
+partRect.setX(aAreaRect.Left() + (aAreaRect.GetWidth() - 
buttonRect.GetWidth()));
 }
 else if( nPart == PART_BUTTON_DOWN )
 {
-buttonRect.setX(aAreaRect.Left() + (aAreaRect.GetWidth() - 
2*buttonRect.GetWidth()));
+if (AllSettings::GetLayoutRTL())
+partRect.setX(aAreaRect.Left() + buttonRect.GetWidth());
+else
+partRect.setX(aAreaRect.Left() + (aAreaRect.GetWidth() - 2 * 
buttonRect.GetWidth()));
 }
 else
 {
-buttonRect.Right() = (aAreaRect.Left() + (aAreaRect.GetWidth() - 
2*buttonRect.GetWidth()))-1;
-buttonRect.Left()   = aAreaRect.Left();
-buttonRect.Top()= aAreaRect.Top();
-buttonRect.Bottom() = aAreaRect.Bottom();
+if (AllSettings::GetLayoutRTL())
+{
+partRect.Right() = aAreaRect.Left() + aAreaRect.GetWidth();
+partRect.Left()  = aAreaRect.Left() + (2 * buttonRect.GetWidth()) 
- 1;
+}
+else
+{
+partRect.Right() = (aAreaRect.Left() + (aAreaRect.GetWidth() - 2 * 
buttonRect.GetWidth())) - 1;
+partRect.Left()  = aAreaRect.Left();
+}
+partRect.Top()= aAreaRect.Top();
+partRect.Bottom() = aAreaRect.Bottom();
 }
 
 gtk_style_context_restore(mpSpinStyle);
 
-return buttonRect;
+return partRect;
 }
 
 Rectangle GtkSalGraphics::NWGetScrollButtonRect( ControlPart nPart, Rectangle 
aAreaRect )
commit fff3c9d6e56ae380437333f9c15ff63742904f25
Author: Caolán McNamara caol...@redhat.com
Date:   Sun Aug 23 20:46:53 2015 +0100

don't mirror 0, RECT_EMPTY, 0, RECT_EMPTY rectangle

leave it untouched to make gtk3 rtl spin buttons possible
where the additional mirrorValue contains the region
of the spinbuttons to render within this rectangle

Change-Id: I2648d98ed36373c95947cc4d78e2e54797f01155
Reviewed-on: https://gerrit.libreoffice.org/17940
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index 2771c9d6..df124a9 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -703,7 +703,9 @@ bool SalGraphics::DrawNativeControl( ControlType nType, 
ControlPart nPart, const
 if( (m_nLayout  SalLayoutFlags::BiDiRtl) || (pOutDev  
pOutDev-IsRTLEnabled()) )
 {
 Rectangle rgn( rControlRegion );
-mirror( rgn, pOutDev );
+Rectangle aNull;
+if (rgn != aNull)
+mirror(rgn, pOutDev);
 std::unique_ptr ImplControlValue  mirrorValue( aValue.clone());
 mirror( *mirrorValue, pOutDev );
 bool bRet = drawNativeControl( nType, nPart, rgn, nState, 
*mirrorValue, aCaption );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/unx

2015-04-27 Thread Caolán McNamara
 vcl/source/window/winproc.cxx |   62 +++--
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |  119 --
 2 files changed, 108 insertions(+), 73 deletions(-)

New commits:
commit fc1605e4dc88b6c563dc0712954f58d8bb6979a7
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Apr 27 12:48:07 2015 +0100

don't dismiss floating windows on wheel, etc gestures outside area

so if you are not exactly over the active floating listbox menu
and use the scroll mouse then it still gets the scroll event
instead of popping down and delivering it to the underlying
window.

Change-Id: I6ab0b725af2a8adc712bfe4ec586dcd64a2efdd7

diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 6cb1c90..139d771 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1376,17 +1376,6 @@ protected:
 
 public:
 
-struct WindowDescription
-{
-vcl::Window *m_pMouseWindow;
-bool m_bIsFloat;
-WindowDescription(vcl::Window *pMouseWindow, bool bIsFloat)
-: m_pMouseWindow(pMouseWindow)
-, m_bIsFloat(bIsFloat)
-{
-}
-};
-
 HandleGestureEventBase(vcl::Window *pWindow, const Point rMousePos)
 : m_pSVData(ImplGetSVData())
 , m_pWindow(pWindow)
@@ -1394,10 +1383,9 @@ public:
 {
 }
 bool Setup();
-WindowDescription FindTarget();
-vcl::Window *Dispatch(const WindowDescription rTarget);
+vcl::Window* FindTarget();
+vcl::Window* Dispatch(vcl::Window* pTarget);
 virtual bool CallCommand(vcl::Window *pWindow, const Point rMousePos) = 0;
-void Teardown(const WindowDescription rTarget);
 virtual ~HandleGestureEventBase() {}
 };
 
@@ -1414,10 +1402,9 @@ bool HandleGestureEventBase::Setup()
 return true;
 }
 
-HandleGestureEventBase::WindowDescription HandleGestureEventBase::FindTarget()
+vcl::Window* HandleGestureEventBase::FindTarget()
 {
 // first check any floating window ( eg. drop down listboxes)
-bool bIsFloat = false;
 vcl::Window *pMouseWindow = NULL;
 
 if (m_pSVData-maWinData.mpFirstFloat  
!m_pSVData-maWinData.mpCaptureWin 
@@ -1425,10 +1412,14 @@ HandleGestureEventBase::WindowDescription 
HandleGestureEventBase::FindTarget()
 {
 HitTest nHitTest = HITTEST_OUTSIDE;
 pMouseWindow = m_pSVData-maWinData.mpFirstFloat-ImplFloatHitTest( 
m_pWindow, m_aMousePos, nHitTest );
+if (!pMouseWindow)
+pMouseWindow = m_pSVData-maWinData.mpFirstFloat;
 }
 // then try the window directly beneath the mouse
 if( !pMouseWindow )
+{
 pMouseWindow = m_pWindow-ImplFindWindow( m_aMousePos );
+}
 else
 {
 // transform coordinates to float window frame coordinates
@@ -1437,7 +1428,6 @@ HandleGestureEventBase::WindowDescription 
HandleGestureEventBase::FindTarget()
   pMouseWindow-AbsoluteScreenToOutputPixel(
m_pWindow-OutputToAbsoluteScreenPixel(
 m_pWindow-ScreenToOutputPixel( m_aMousePos ) ) ) ) );
-bIsFloat = true;
 }
 
 while (acceptableWheelScrollTarget(pMouseWindow))
@@ -1448,13 +1438,11 @@ HandleGestureEventBase::WindowDescription 
HandleGestureEventBase::FindTarget()
 pMouseWindow = pMouseWindow-GetParent();
 }
 
-return WindowDescription(pMouseWindow, bIsFloat);
+return pMouseWindow;
 }
 
-vcl::Window *HandleGestureEventBase::Dispatch(const WindowDescription rTarget)
+vcl::Window *HandleGestureEventBase::Dispatch(vcl::Window* pMouseWindow)
 {
-vcl::Window *pMouseWindow = rTarget.m_pMouseWindow;
-
 vcl::Window *pDispatchedTo = NULL;
 
 if (acceptableWheelScrollTarget(pMouseWindow)  pMouseWindow-IsEnabled())
@@ -1493,23 +1481,6 @@ vcl::Window *HandleGestureEventBase::Dispatch(const 
WindowDescription rTarget)
 return pDispatchedTo;
 }
 
-void HandleGestureEventBase::Teardown(const WindowDescription rTarget)
-{
-// close floaters
-if (!rTarget.m_bIsFloat  m_pSVData-maWinData.mpFirstFloat)
-{
-FloatingWindow* pLastLevelFloat = 
m_pSVData-maWinData.mpFirstFloat-ImplFindLastLevelFloat();
-if( pLastLevelFloat )
-{
-sal_uLong nPopupFlags = pLastLevelFloat-GetPopupModeFlags();
-if ( nPopupFlags  FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE )
-{
-pLastLevelFloat-EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | 
FLOATWIN_POPUPMODEEND_CLOSEALL );
-}
-}
-}
-}
-
 class HandleWheelEvent : public HandleGestureEventBase
 {
 private:
@@ -1554,21 +1525,19 @@ bool HandleWheelEvent::HandleEvent(const 
SalWheelMouseEvent rEvt)
 if (!Setup())
 return false;
 
-WindowDescription aTarget = FindTarget();
+vcl::Window *pMouseWindow = FindTarget();
 
 // avoid the problem that scrolling via wheel to this point brings a widget
 // under the mouse that also accepts wheel commands, so stick with the 

[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/unx

2015-01-25 Thread Caolán McNamara
 vcl/source/filter/wmf/winwmf.cxx |5 +
 vcl/unx/generic/gdi/gdiimpl.cxx  |2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 2b95714814b60a3d703525a7a5df453e5b87988c
Author: Caolán McNamara caol...@redhat.com
Date:   Sun Jan 25 15:04:48 2015 +

coverity#982431 Division or modulo by float zero

and

coverity#982432 Division or modulo by float zero

Change-Id: I1b9036d85c4b31b8136a96d330d95d7b024530aa

diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index aef13a1..3c8ed8b 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -250,6 +250,11 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
 {
 short nXNum = 0, nXDenom = 0, nYNum = 0, nYDenom = 0;
 pWMF-ReadInt16( nYDenom ).ReadInt16( nYNum ).ReadInt16( nXDenom 
).ReadInt16( nXNum );
+if (!nYDenom || !nXDenom)
+{
+pWMF-SetError( SVSTREAM_FILEFORMAT_ERROR );
+break;
+}
 pOut-ScaleDevExt( (double)nXNum / nXDenom, (double)nYNum / 
nYDenom );
 }
 break;
commit e3c70196e7f640cfde360b9832e91bec4eb7ab26
Author: Caolán McNamara caol...@redhat.com
Date:   Sun Jan 25 14:44:20 2015 +

coverity#1266437 Unintended comparison to logical negation

Change-Id: Ia4fc4ccbdfe3586afc78a16378ef0b3859308d64

diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx
index 7eddf05..17a9a10 100644
--- a/vcl/unx/generic/gdi/gdiimpl.cxx
+++ b/vcl/unx/generic/gdi/gdiimpl.cxx
@@ -1230,7 +1230,7 @@ void X11SalGraphicsImpl::SetROPFillColor( SalROPColor 
nROPColor )
 
 void X11SalGraphicsImpl::SetXORMode( bool bSet, bool )
 {
-if( !mbXORMode == bSet )
+if (mbXORMode != bSet)
 {
 mbXORMode   = bSet;
 mbPenGC = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/unx

2014-04-26 Thread Caolán McNamara
 vcl/source/window/menu.cxx  |   21 +
 vcl/unx/generic/app/i18n_im.cxx |9 ++---
 2 files changed, 23 insertions(+), 7 deletions(-)

New commits:
commit 39a060442cb1148e976c4f2316d0449dd285e8df
Author: Caolán McNamara caol...@redhat.com
Date:   Sat Apr 26 19:08:48 2014 +0100

given the explanation of MenuFloatingWindow::InitClipRegion()...

should not be virtual then prior to 95711f5b9e7b6a982d1762d37d5a38e0f40b86f9
the menu ImplInitClipRegion had nothing to do with the outdev
ImplInitClipRegion and so all the original ImplInitClipRegion calls here 
should
now be routed to InitMenuClipRegion which was removed by In fact
InitMenuClipRegion() is unused so restore that

Change-Id: Id208b30561803ee774e10d44e19ed0808f824766

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 40f7c55..ae8e74a 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -509,6 +509,7 @@ private:
 virtual voidDataChanged( const DataChangedEvent rDCEvt ) SAL_OVERRIDE;
 protected:
 Region  ImplCalcClipRegion( bool bIncludeLogo = true ) const;
+voidInitMenuClipRegion();
 voidImplDrawScroller( bool bUp );
 using Window::ImplScroll;
 voidImplScroll( const Point rMousePos );
@@ -3999,7 +4000,7 @@ MenuFloatingWindow::~MenuFloatingWindow()
 
 void MenuFloatingWindow::Resize()
 {
-InitClipRegion();
+InitMenuClipRegion();
 }
 
 long MenuFloatingWindow::ImplGetStartY() const
@@ -4031,6 +4032,18 @@ Region MenuFloatingWindow::ImplCalcClipRegion( bool 
bIncludeLogo ) const
 return aRegion;
 }
 
+void MenuFloatingWindow::InitMenuClipRegion()
+{
+if ( IsScrollMenu() )
+{
+SetClipRegion( ImplCalcClipRegion() );
+}
+else
+{
+SetClipRegion();
+}
+}
+
 void MenuFloatingWindow::ImplHighlightItem( const MouseEvent rMEvt, bool 
bMBDown )
 {
 if( ! pMenu )
@@ -4255,7 +4268,7 @@ void MenuFloatingWindow::EnableScrollMenu( bool b )
 bScrollMenu = b;
 nScrollerHeight = b ? (sal_uInt16) 
GetSettings().GetStyleSettings().GetScrollBarSize() /2 : 0;
 bScrollDown = true;
-InitClipRegion();
+InitMenuClipRegion();
 }
 
 void MenuFloatingWindow::Execute()
@@ -5005,7 +5018,7 @@ void MenuFloatingWindow::Paint( const Rectangle )
CTRL_STATE_ENABLED,
aVal,
OUString() );
-InitClipRegion();
+InitMenuClipRegion();
 }
 if ( IsScrollMenu() )
 {
@@ -5039,7 +5052,7 @@ void MenuFloatingWindow::ImplDrawScroller( bool bUp )
 
 aDecoView.DrawSymbol( aRect, eSymbol, 
GetSettings().GetStyleSettings().GetButtonTextColor(), nStyle );
 
-InitClipRegion();
+InitMenuClipRegion();
 }
 
 void MenuFloatingWindow::RequestHelp( const HelpEvent rHEvt )
commit 506bf3bc3f65834c1f69d7d5ea38221e67b00346
Author: Caolán McNamara caol...@redhat.com
Date:   Sat Apr 26 15:36:19 2014 +0100

coverity#708651 Uninitialized pointer field

Change-Id: If2c5d406994902839c4c81a947fc46a06056fe90

diff --git a/vcl/unx/generic/app/i18n_im.cxx b/vcl/unx/generic/app/i18n_im.cxx
index acbca69..7522416 100644
--- a/vcl/unx/generic/app/i18n_im.cxx
+++ b/vcl/unx/generic/app/i18n_im.cxx
@@ -245,10 +245,13 @@ SalI18N_InputMethod::PosixLocale()
 
 // Constructor / Destructor / Initialisation
 
-SalI18N_InputMethod::SalI18N_InputMethod( ) : mbUseable( 
bUseInputMethodDefault ),
-  maMethod( (XIM)NULL ),
-mpStyles( (XIMStyles*)NULL )
+SalI18N_InputMethod::SalI18N_InputMethod( )
+: mbUseable( bUseInputMethodDefault )
+, maMethod( (XIM)NULL )
+, mpStyles( (XIMStyles*)NULL )
 {
+maDestroyCallback.callback = (XIMProc)NULL;
+maDestroyCallback.client_data = (XPointer)NULL;
 const char *pUseInputMethod = getenv( SAL_USEINPUTMETHOD );
 if ( pUseInputMethod != NULL )
 mbUseable = pUseInputMethod[0] != '\0' ;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits