[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/unx

2013-09-05 Thread Stephan Bergmann
 vcl/unx/generic/desktopdetect/desktopdetector.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 39808b3e742684a1238dcddb1a057a89769ccb71
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Sep 5 11:08:23 2013 +0200

Consistently use rtl_getAppCommandArg here

...2a9c1d1a75b7d4e79dfbc6be3dada1a1e959e58e Make dialogs fail with an 
exception
in headless tests missed one of the osl_getCommandArg calls, which can 
lead to
problems when there are any -env: arguments preceeding the --display 
argument.
Reported by renduly on IRC.

Change-Id: I98dd24be840d561dce51034088f3e44adff9f2ff
(cherry picked from commit 379a53017447fbf2a459f82ae8905b6683e80e8d)
Reviewed-on: https://gerrit.libreoffice.org/5822
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx 
b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
index 8b7714d..b005b79 100644
--- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx
+++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
@@ -317,7 +317,7 @@ DESKTOP_DETECTOR_PUBLIC DesktopType 
get_desktop_environment()
 rtl_getAppCommandArg( i, aParam.pData );
 if( i  nParams-1  (aParam == -display || aParam == 
--display ) )
 {
-osl_getCommandArg( i+1, aParam.pData );
+rtl_getAppCommandArg( i+1, aParam.pData );
 aBParm = OUStringToOString( aParam, 
osl_getThreadTextEncoding() );
 pDisplayStr = aBParm.getStr();
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/unx

2013-09-03 Thread Caolán McNamara
 vcl/unx/gtk/window/gtkframe.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 85049f0986dbfd277dd449b908d126065c92b7d3
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Sep 3 12:24:34 2013 +0100

Resolves: rhbz#993963 NULL m_pWindow on firefox deleted plugin

(cherry picked from commit 4a4ed52e57b540167c3ca45e6e762b9e21e874de)

Conflicts:
vcl/unx/gtk/window/gtksalframe.cxx

Change-Id: Idb12b12e4313668bf3390a97551c688ee0dcde67
Reviewed-on: https://gerrit.libreoffice.org/5774
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index fc5154b..05f7faa 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -2719,7 +2719,7 @@ void GtkSalFrame::SetParent( SalFrame* pNewParent )
 
 void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, 
SalX11Screen nXScreen )
 {
-bool bWasVisible = IS_WIDGET_MAPPED(m_pWindow);
+bool bWasVisible = m_pWindow ? IS_WIDGET_MAPPED(m_pWindow) : false;
 if( bWasVisible )
 Show( sal_False );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/unx

2013-08-26 Thread Stephan Bergmann
 vcl/unx/generic/app/saldata.cxx |   25 +++--
 vcl/unx/gtk/app/gtkdata.cxx |   12 +---
 2 files changed, 16 insertions(+), 21 deletions(-)

New commits:
commit 8ea056e716d87c07343adc8532ce6f265de13624
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Aug 23 12:03:45 2013 +0200

rhbz#1000150: Do not call exit upon XIOError

...as done in _XIOError (libX11-1.6.0/src/XlibInt.c) after calling the 
XIOError
handler function (either the one supplied with XSetIOErrorHandler or
_XDefaultIOError), as that calls the atexit handlers, which can wreak havoc 
in
unrelated threads that happen to be running in parallel, leading to 
arbitrary
crashes.  So avoid that by always calling _exit already from our XIOError
handler.

The old code was careful to /not/ call _exit when the XIOError happened on 
any
thread but the main one, but I do not see the sense of that---after all,
_XIOError will inevitably call exit afterwards, so this cannot be a way to
ignore XIOErrors from special threads (that are set up say for the sole
purpose of trying out known-shaky activities without affecting the 
stability
of the whole process).  And findings like comment 12 to
https://bugzilla.redhat.com/show_bug.cgi?id=831628#c12 [abrt]
libreoffice-core-3.5.4.2-1.fc17: ICEConnectionWorker thread still running 
during
exit (it is very likely that this is not a normal exit from reaching the 
end
of main, but rather some explicit call to exit from some error handling 
code)
make it clear that we apparenly do suffer from such calls to _XIOError - 
exit
on non-main threads.

I have no idea why vcl/unx/gtk has its own XIOErrorHdl that is substantially
different from the vcl/unx/generic one, though.

cherry picked from commit ffea65915b9cc6d4f3c01f829552702654a040f9, plus
follow-up b240a1c188b58e3e717335339bfc3f5e20bb2bf4:

rhbz#1000150: Do not call exit upon XIOError, take two

The _XDefaultIOError handler (libX11-1.6.0/src/XlibInt.c) already calls 
exit
(even though _XIOError calling _XDefaultIOError would call exit 
afterwards,
too), so our XIOError handler must not call aOrigXIOErrorHandler.

Change-Id: Ida7d407cf5f0fa4e719118cab5e725144ceb3a35
Reviewed-on: https://gerrit.libreoffice.org/5596
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx
index f02a25b..9b1b9de 100644
--- a/vcl/unx/generic/app/saldata.cxx
+++ b/vcl/unx/generic/app/saldata.cxx
@@ -313,22 +313,19 @@ int X11SalData::XErrorHdl( Display *pDisplay, XErrorEvent 
*pEvent )
 
 int X11SalData::XIOErrorHdl( Display * )
 {
-if (::osl::Thread::getCurrentIdentifier() != 
Application::GetMainThreadIdentifier())
+if (::osl::Thread::getCurrentIdentifier() == 
Application::GetMainThreadIdentifier())
 {
-pthread_exit(NULL);
-return 0;
+/*  #106197# hack: until a real shutdown procedure exists
+ *  _exit ASAP
+ */
+if( ImplGetSVData()-maAppData.mbAppQuit )
+_exit(1);
+
+// really bad hack
+if( ! SessionManagerClient::checkDocumentsSaved() )
+/* oslSignalAction eToDo = */ osl_raiseSignal 
(OSL_SIGNAL_USER_X11SUBSYSTEMERROR, NULL);
 }
 
-/*  #106197# hack: until a real shutdown procedure exists
- *  _exit ASAP
- */
-if( ImplGetSVData()-maAppData.mbAppQuit )
-_exit(1);
-
-// really bad hack
-if( ! SessionManagerClient::checkDocumentsSaved() )
-/* oslSignalAction eToDo = */ osl_raiseSignal 
(OSL_SIGNAL_USER_X11SUBSYSTEMERROR, NULL);
-
 std::fprintf( stderr, X IO Error\n );
 std::fflush( stdout );
 std::fflush( stderr );
@@ -337,7 +334,7 @@ int X11SalData::XIOErrorHdl( Display * )
  *  do apply here. Since there is nothing to be done after an XIO
  *  error we have to _exit immediately.
  */
-_exit(0);
+_exit(1);
 return 0;
 }
 
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 14a1949..2f7cc3f 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -519,14 +519,12 @@ GtkData::GtkData( SalInstance *pInstance )
 
 XIOErrorHandler aOrigXIOErrorHandler = NULL;
 
-int XIOErrorHdl(Display *pDisplay)
+int XIOErrorHdl(Display *)
 {
-if (::osl::Thread::getCurrentIdentifier() != 
Application::GetMainThreadIdentifier())
-{
-pthread_exit(NULL);
-return 0;
-}
-return aOrigXIOErrorHandler ? aOrigXIOErrorHandler(pDisplay) : 0;
+fprintf(stderr, X IO Error\n);
+_exit(1);
+// avoid crashes in unrelated threads that still run while atexit
+// handlers are in progress
 }
 
 GtkData::~GtkData()
___
Libreoffice-commits mailing list

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/unx

2013-07-11 Thread David Tardon
 vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx |   22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

New commits:
commit 532025b2b9ef6b30ab7fbf7efc2b922fbc3ab971
Author: David Tardon dtar...@redhat.com
Date:   Thu Jul 11 09:25:16 2013 +0200

rhbz#980387 fix filter selection from file ext.

... for filters that have more than one extension associated with them
(e.g., JPEG).

(cherry picked from commit 70376f610a7eb876739829e1f362bc94b21cb82f)
Signed-off-by: David Tardon dtar...@redhat.com

Conflicts:
vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx

Change-Id: Ic6b16d3b4aa17580404d02a9fb7b087b9aa52fc2
Reviewed-on: https://gerrit.libreoffice.org/4824
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx 
b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index f2e1141..b952f30 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -33,6 +33,7 @@
 #include com/sun/star/ui/dialogs/TemplateDescription.hpp
 #include com/sun/star/ui/dialogs/ControlActions.hpp
 #include com/sun/star/uno/Any.hxx
+#include comphelper/string.hxx
 #include osl/mutex.hxx
 #include unx/gtk/gtkinst.hxx
 
@@ -794,6 +795,25 @@ uno::Sequencertl::OUString SAL_CALL 
SalGtkFilePicker::getFiles() throw( uno::R
 return aFiles;
 }
 
+namespace
+{
+
+bool lcl_matchFilter( const rtl::OUString rFilter, const rtl::OUString rExt )
+{
+const int nCount = comphelper::string::getTokenCount( rFilter, ';' );
+
+for ( int n = 0; n != nCount; ++n )
+{
+const rtl::OUString aToken = comphelper::string::getToken( rFilter, n, 
';' );
+if ( aToken == rExt )
+return true;
+}
+
+return false;
+}
+
+}
+
 uno::Sequencertl::OUString SAL_CALL SalGtkFilePicker::getSelectedFiles() 
throw( uno::RuntimeException )
 {
 SolarMutexGuard g;
@@ -856,7 +876,7 @@ uno::Sequencertl::OUString SAL_CALL 
SalGtkFilePicker::getSelectedFiles() throw
   ++aListIter
 )
 {
-if( aListIter-getFilter().equalsIgnoreAsciiCase( 
aStarDot+sExtension ) )
+if( lcl_matchFilter( aListIter-getFilter(), 
aStarDot+sExtension ) )
 {
 if( aNewFilter.isEmpty() )
 aNewFilter = aListIter-getTitle();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/unx

2013-06-03 Thread Michael Meeks
 vcl/unx/gtk/window/gtkframe.cxx |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 2d03cef0145db7475db66dd611c22c6e6fc51b48
Author: Michael Meeks michael.me...@suse.com
Date:   Mon Jun 3 09:27:26 2013 +0100

fdo#56583 - avoid setting user time on unrealized windows.

Change-Id: Iab776088b1d168295d636069e1a92ba948241653
Reviewed-on: https://gerrit.libreoffice.org/4143
Reviewed-by: Petr Mladek pmla...@suse.cz
Tested-by: Petr Mladek pmla...@suse.cz

diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index d783e95..fc5154b 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -1011,9 +1011,17 @@ static void lcl_set_user_time( GtkWindow* i_pWindow, 
guint32 i_nTime )
 bGetSetUserTimeFn = false;
 p_gdk_x11_window_set_user_time = 
(setUserTimeFn)osl_getAsciiFunctionSymbol( GetSalData()-m_pPlugin, 
gdk_x11_window_set_user_time );
 }
+bool bSet = false;
 if( p_gdk_x11_window_set_user_time )
-p_gdk_x11_window_set_user_time( 
widget_get_window(GTK_WIDGET(i_pWindow)), i_nTime );
-else
+{
+GdkWindow* pWin = widget_get_window(GTK_WIDGET(i_pWindow));
+if( pWin ) // only if the window is realized.
+{
+p_gdk_x11_window_set_user_time( pWin, i_nTime );
+bSet = true;
+}
+}
+if( !bSet )
 {
 Display* pDisplay = GetGtkSalData()-GetGtkDisplay()-GetDisplay();
 Atom nUserTime = XInternAtom( pDisplay, _NET_WM_USER_TIME, True );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/unx

2013-05-28 Thread Abdulaziz A Alayed
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit d2fcf1ec2e1363d568f1f2023e21013b968f4354
Author: Abdulaziz A Alayed aala...@kacst.edu.sa
Date:   Fri May 24 13:11:31 2013 +0300

fdo#63254 UI:Horizontal scroll bar isn't displayed when RTL tab

opened with LTR UI.

Change-Id: Iff6899539fe0b1788df7b09f91f850b91bcdb811
Reviewed-on: https://gerrit.libreoffice.org/4024
Reviewed-by: Stephan Bergmann sberg...@redhat.com
Tested-by: Stephan Bergmann sberg...@redhat.com
Signed-off-by: Petr Mladek pmla...@suse.cz

diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx 
b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
old mode 100644
new mode 100755
index e15fbfa..1455850
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -1041,8 +1041,9 @@ sal_Bool GtkSalGraphics::getNativeControlRegion(  
ControlType nType,
 rNativeContentRegion.Right() = rNativeContentRegion.Left() + 1;
 if (!rNativeContentRegion.GetHeight())
 rNativeContentRegion.Bottom() = rNativeContentRegion.Top() + 1;
-
-returnVal = true;
+//fdo#63254 horizontal scrool bar isn't displayed in RTL tab
+// with LTR UI in calc
+returnVal =Application::GetSettings().GetLayoutRTL();
 
 //See fdo#44582, Horizontal scrollbar in navigator window is broken
 if ((nPart==PART_BUTTON_LEFT || nPart==PART_BUTTON_RIGHT)  
Application::GetSettings().GetLayoutRTL())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/unx

2013-04-30 Thread Michael Meeks
 vcl/unx/gtk/app/gtksys.cxx  |   12 
 vcl/unx/gtk/window/gtkframe.cxx |   11 +++
 2 files changed, 23 insertions(+)

New commits:
commit ff3ce21011beda7c835db0979292d29dfa832d6b
Author: Michael Meeks michael.me...@suse.com
Date:   Tue Apr 30 11:19:56 2013 +0100

fdo#62815 - tolerate crazy / out-of-bound ScreenNumbers for FullScreen

Thus making the gtk+ backend more similar to the generic backend
in this regard; also be more strict about invalid monitors - empty
screens.

Change-Id: Ia4f2e1205cb1d309fb1bb01f9631167339a3478e

Signed-off-by: Petr Mladek pmla...@suse.cz

diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
index bc06b25..c822fd2 100644
--- a/vcl/unx/gtk/app/gtksys.cxx
+++ b/vcl/unx/gtk/app/gtksys.cxx
@@ -70,6 +70,13 @@ struct GdkRectangleEqual
 
 }
 
+/**
+ * GtkSalSystem::countScreenMonitors()
+ *
+ * This method builds the vector which allows us to map from VCL's
+ * idea of linear integer ScreenNumber to to gtk+'s rather more
+ * complicated screen + monitor concept.
+ */
 void
 GtkSalSystem::countScreenMonitors()
 {
@@ -134,6 +141,11 @@ GtkSalSystem::getScreenMonitorFromIdx (int nIdx, gint 
nMonitor)
 break;
 }
 nMonitor = nIdx;
+
+// handle invalid monitor indexes as non-existent screens
+if (nMonitor  0 || (pScreen  nMonitor = gdk_screen_get_n_monitors 
(pScreen)))
+pScreen = NULL;
+
 return pScreen;
 }
 
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index eb87e74..d783e95 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -2059,7 +2059,15 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, 
int eType, Rectangle *pSiz
 return;
 
 gint nMonitor;
+bool bSameMonitor = false;
 GdkScreen *pScreen = getDisplay()-getSystem()-getScreenMonitorFromIdx( 
nNewScreen, nMonitor );
+if (!pScreen)
+{
+g_warning (Attempt to move GtkSalFrame to invalid screen %d = 
+   fallback to current\n, nNewScreen);
+pScreen = gtk_widget_get_screen( m_pWindow );
+bSameMonitor = true;
+}
 
 // Heavy lifting, need to move screen ...
 if( pScreen != gtk_widget_get_screen( m_pWindow ))
@@ -2067,6 +2075,9 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, int 
eType, Rectangle *pSiz
 
 gint nOldMonitor = gdk_screen_get_monitor_at_window(
 pScreen, widget_get_window( m_pWindow ) );
+if (bSameMonitor)
+nMonitor = nOldMonitor;
+
 #if OSL_DEBUG_LEVEL  1
 if( nMonitor == nOldMonitor )
 g_warning( An apparently pointless SetScreen - should we elide it ? 
);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/unx

2013-04-26 Thread Caolán McNamara
 vcl/unx/gtk/window/gtkframe.cxx |   38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 6264733282ff93d8bbb561f67b880424f31a1f7d
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Apr 25 14:04:56 2013 +0100

Resolves: fdo#63802 return true if we have known empty context

i.e. false for we can't provide context, and true for
we can provide context, even if there isn't any

Still looks to me that there's a bug in the si-phonetic-dynamic
im (or something in the stack) that assumes that returning
false once means it will always return false and give up
for ever

fix indent while I'm at it

also let si-phonetic-dynamic survive libreoffice losing focus and regain it
cycle and still use surrounding text. It should be safe to report that we 
can
provide surrounding text but there isn't any during the time window when 
there
is no focus window, because the focus in event was received but it hasn't
arrived yet because that happens on a postuserevent.

(cherry picked from commit 21fb092398fb21256b0e546e7f38c5e6de4654f2)

Change-Id: I0481c42208953f2a0618aaed7b0d9e9f3e7bda07
Reviewed-on: https://gerrit.libreoffice.org/3608
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 03f8c59..eb87e74 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -4223,13 +4223,9 @@ uno::Referenceaccessibility::XAccessibleEditableText
 return uno::Reference accessibility::XAccessibleEditableText ();
 }
 
-static uno::Referenceaccessibility::XAccessibleEditableText lcl_GetxText()
+static uno::Referenceaccessibility::XAccessibleEditableText 
lcl_GetxText(Window *pFocusWin)
 {
 uno::Referenceaccessibility::XAccessibleEditableText xText;
-Window* pFocusWin = ImplGetSVData()-maWinData.mpFocusWin;
-if (!pFocusWin)
-return xText;
-
 try
 {
 uno::Reference accessibility::XAccessible  xAccessible( 
pFocusWin-GetAccessible( true ) );
@@ -4238,36 +4234,40 @@ static 
uno::Referenceaccessibility::XAccessibleEditableText lcl_GetxText()
 }
 catch(const uno::Exception e)
 {
-g_warning( Exception in getting input method surrounding text );
+SAL_WARN( vcl.gtk, Exception in getting input method surrounding 
text:   e.Message);
 }
 return xText;
 }
 
 gboolean GtkSalFrame::IMHandler::signalIMRetrieveSurrounding( GtkIMContext* 
pContext, gpointer /*im_handler*/ )
 {
-uno::Referenceaccessibility::XAccessibleEditableText xText = 
lcl_GetxText();
+Window *pFocusWin = Application::GetFocusWindow();
+if (!pFocusWin)
+return true;
 
+uno::Referenceaccessibility::XAccessibleEditableText xText = 
lcl_GetxText(pFocusWin);
 if (xText.is())
 {
 sal_uInt32 nPosition = xText-getCaretPosition();
-rtl::OUString sAllText = xText-getText();
-if (sAllText.isEmpty())
-return sal_False;
-rtl::OString sUTF = rtl::OUStringToOString(sAllText, 
RTL_TEXTENCODING_UTF8);
-rtl::OUString sCursorText(sAllText.copy(0, nPosition));
-gtk_im_context_set_surrounding(pContext, sUTF.getStr(), sUTF.getLength(),
-rtl::OUStringToOString(sCursorText, 
RTL_TEXTENCODING_UTF8).getLength());
-return sal_True;
+OUString sAllText = xText-getText();
+OString sUTF = OUStringToOString(sAllText, RTL_TEXTENCODING_UTF8);
+OUString sCursorText(sAllText.copy(0, nPosition));
+gtk_im_context_set_surrounding(pContext, sUTF.getStr(), 
sUTF.getLength(),
+OUStringToOString(sCursorText, RTL_TEXTENCODING_UTF8).getLength());
+return true;
 }
 
-return sal_False;
+return false;
 }
 
 gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, 
gint offset, gint nchars,
 gpointer /*im_handler*/ )
 {
-uno::Referenceaccessibility::XAccessibleEditableText xText = 
lcl_GetxText();
+Window *pFocusWin = Application::GetFocusWindow();
+if (!pFocusWin)
+return true;
 
+uno::Referenceaccessibility::XAccessibleEditableText xText = 
lcl_GetxText(pFocusWin);
 if (xText.is())
 {
 sal_uInt32 nPosition = xText-getCaretPosition();
@@ -4282,10 +4282,10 @@ gboolean 
GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint
 nDeleteEnd = xText-getCharacterCount();
 
 xText-deleteText(nDeletePos, nDeleteEnd);
-return sal_True;
+return true;
 }
 
-return sal_False;
+return false;
 }
 
 Size GtkSalDisplay::GetScreenSize( int nDisplayScreen )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/unx

2013-03-15 Thread Fridrich Štrba
 vcl/unx/gtk/app/gtksys.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 978ea3352ce3214bb10aeb39a3dcdf7cdc4cc60e
Author: Fridrich Å trba fridrich.st...@bluewin.ch
Date:   Sat Mar 16 01:00:19 2013 +0100

Fix build

Change-Id: I2d203f8fb585b37524e63b94a6d1e15881a11882
Reviewed-on: https://gerrit.libreoffice.org/2767
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
index 48bc239..bc06b25 100644
--- a/vcl/unx/gtk/app/gtksys.cxx
+++ b/vcl/unx/gtk/app/gtksys.cxx
@@ -18,6 +18,7 @@
  */
 
 #include string.h
+#include gmodule.h
 #include gtk/gtk.h
 #include unx/gtk/gtkinst.hxx
 #include unx/gtk/gtksys.hxx
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/unx

2013-03-15 Thread Caolán McNamara
 vcl/unx/gtk/app/gtksys.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit ff8d03d3871818238f8986b76ff901e4eb6fb701
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Mar 15 10:38:06 2013 +

Resolves: rhbz#906137 slide show inverts outputs

we go to some effort to determine the right value of ret
and then throw it away and return 0

regression since 4a7e3482912c90b73d6e12c82bcd9ce31975e3f1

Change-Id: I652cfbe44fdab6560c1c8dc8fe25d6211b5357cb
(cherry picked from commit 67aae198f80195e77bd62e7675a372312075b126)
Reviewed-on: https://gerrit.libreoffice.org/2743
Reviewed-by: Michael Meeks michael.me...@suse.com
Tested-by: Michael Meeks michael.me...@suse.com

diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
index b7996c1..f5862c2 100644
--- a/vcl/unx/gtk/app/gtksys.cxx
+++ b/vcl/unx/gtk/app/gtksys.cxx
@@ -179,14 +179,14 @@ namespace {
 static int _fallback_get_primary_monitor (GdkScreen *pScreen)
 {
 // Use monitor name as primacy heuristic
-int ret = -1;
 int max = gdk_screen_get_n_monitors (pScreen);
-for (int i = 0; i  max  ret  0; i++)
+for (int i = 0; i  max; ++i)
 {
 char *name = gdk_screen_get_monitor_plug_name (pScreen, i);
-if (name  !g_ascii_strncasecmp (name, LVDS, 4))
-ret = i;
+bool bLaptop = (name  !g_ascii_strncasecmp (name, LVDS, 4));
 g_free (name);
+if (bLaptop)
+return i;
 }
 return 0;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/unx

2013-03-15 Thread Caolán McNamara
 vcl/unx/gtk/app/gtksys.cxx |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit e00ed9262e16ad2a9b421ff004f94096d36d9e17
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Mar 15 11:00:56 2013 +

Related: rhbz#906137 g_module_symbol returned nothing

for gdk_screen_get_primary_monitor but osl_getAsciiFunctionSymbol does the
right thing

Change-Id: Ibf1a17724a9393d95c4fbe0d26aa82148eea33a9
Reviewed-on: https://gerrit.libreoffice.org/2744
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
index f5862c2..48bc239 100644
--- a/vcl/unx/gtk/app/gtksys.cxx
+++ b/vcl/unx/gtk/app/gtksys.cxx
@@ -18,7 +18,6 @@
  */
 
 #include string.h
-#include gmodule.h
 #include gtk/gtk.h
 #include unx/gtk/gtkinst.hxx
 #include unx/gtk/gtksys.hxx
@@ -201,11 +200,8 @@ static int _get_primary_monitor (GdkScreen *pScreen)
 // Perhaps we have a newer gtk+ with this symbol:
 if (!get_fn)
 {
-GModule *module = g_module_open (NULL, (GModuleFlags) 0);
-if (!g_module_symbol (module, gdk_screen_get_primary_monitor,
-  (gpointer *)get_fn))
-get_fn = NULL;
-g_module_close (module);
+get_fn = (int(*)(GdkScreen*))osl_getAsciiFunctionSymbol(NULL,
+gdk_screen_get_primary_monitor);
 }
 #if GTK_CHECK_VERSION(2,14,0)
 if (!get_fn)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/unx

2013-02-16 Thread Caolán McNamara
 vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit f27f13b8e8865f0e39fbb9489ed1c0b65857b90e
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Feb 15 13:41:11 2013 +

Resolves: rhbz#910176 cannot select directory with gnome folder picker

 gtk documentation
gtk_file_chooser_get_current_folder_uri ()

Gets the current folder of chooser as an URI.

Note that this is the folder that the file chooser is currently displaying 
...
which is not the same as the currently-selected folder if the chooser is in
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER mode ... to get the currently-selected
folder in that mode, use gtk_file_chooser_get_uri() as the usual way to get 
the
selection.


 offapi documentation
XFolderPicker

getDisplayDirectory:
Returns the root directory that the FolderPicker is showing.
getDirectory
Returns the selected directory


so  getDisplayDirectory - gtk_file_chooser_get_current_folder_uri
and getDirectory - gtk_file_chooser_get_uri

Change-Id: Iaa5ab16a250cd59fe5e8bd02149298eef6d1dec2
(cherry picked from commit 914de32b27c7fe164b21f9247275ee3117c0864b)
Reviewed-on: https://gerrit.libreoffice.org/2170
Reviewed-by: Björn Michaelsen bjoern.michael...@canonical.com
Tested-by: Björn Michaelsen bjoern.michael...@canonical.com

diff --git a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx 
b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
index 931f197..d062cda 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
@@ -95,7 +95,7 @@ rtl::OUString SAL_CALL 
SalGtkFolderPicker::getDisplayDirectory() throw( uno::Run
 
 gchar* pCurrentFolder =
 gtk_file_chooser_get_current_folder_uri( GTK_FILE_CHOOSER( m_pDialog ) 
);
-::rtl::OUString aCurrentFolderName = uritounicode(pCurrentFolder);
+OUString aCurrentFolderName = uritounicode(pCurrentFolder);
 g_free( pCurrentFolder );
 
 return aCurrentFolderName;
@@ -103,7 +103,16 @@ rtl::OUString SAL_CALL 
SalGtkFolderPicker::getDisplayDirectory() throw( uno::Run
 
 rtl::OUString SAL_CALL SalGtkFolderPicker::getDirectory() throw( 
uno::RuntimeException )
 {
-return getDisplayDirectory();
+SolarMutexGuard g;
+
+OSL_ASSERT( m_pDialog != NULL );
+
+gchar* pSelectedFolder =
+gtk_file_chooser_get_uri( GTK_FILE_CHOOSER( m_pDialog ) );
+OUString aSelectedFolderName = uritounicode(pSelectedFolder);
+g_free( pSelectedFolder );
+
+return aSelectedFolderName;
 }
 
 void SAL_CALL SalGtkFolderPicker::setDescription( const rtl::OUString 
rDescription )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits