diff options
Diffstat (limited to 'libreofficekit')
4 files changed, 26 insertions, 3 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx b/libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx index ab28f23578ec..077e2577f384 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-application-window.cxx @@ -442,6 +442,16 @@ gtv_application_window_get_child_window_by_id(GtvApplicationWindow* window, cons return ret; } +// temporary function to invalidate all opened dialogs +// because currently the dialog id returned in dialog invalidation payload +// doesn't match our hard-coded list of dialog ids (uno commands) for some dialogs +GList* +gtv_application_window_get_all_child_windows(GtvApplicationWindow* window) +{ + GtvApplicationWindowPrivate* priv = getPrivate(window); + return priv->m_pChildWindows; +} + GtvApplicationWindow* gtv_application_window_new(GtkApplication* app) { diff --git a/libreofficekit/qa/gtktiledviewer/gtv-application-window.hxx b/libreofficekit/qa/gtktiledviewer/gtv-application-window.hxx index c16425566967..239471ae4ac8 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-application-window.hxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-application-window.hxx @@ -105,6 +105,8 @@ void gtv_application_window_unregister_child_window(GtvApplicationWindow* window GtkWindow* gtv_application_window_get_child_window_by_id(GtvApplicationWindow* window, const gchar* pWinId); +GList* gtv_application_window_get_all_child_windows(GtvApplicationWindow* window); + G_END_DECLS #endif /* GTV_APPLICATION_WINDOW_H */ diff --git a/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx b/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx index 2a620b58000d..7a9fa7712900 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx @@ -63,11 +63,13 @@ pixelToTwip(float fInput) return (fInput / 96 / 1.0 /* zoom */) * 1440.0f; } +#if 0 static float twipToPixel(float fInput) { return fInput / 1440.0f * 96 * 1.0 /* zoom */; } +#endif static void gtv_lok_dialog_draw(GtkWidget* pDialogDrawingArea, cairo_t* pCairo, gpointer) diff --git a/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx b/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx index a549d852c786..8f86ecd43ca7 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx @@ -281,14 +281,23 @@ void LOKDocViewSigHandlers::comment(LOKDocView* pDocView, gchar* pComment, gpoin } } -void LOKDocViewSigHandlers::dialogInvalidate(LOKDocView* pDocView, gchar* pDialogId, gpointer) +void LOKDocViewSigHandlers::dialogInvalidate(LOKDocView* pDocView, gchar* /*pDialogId*/, gpointer) { GtvApplicationWindow* window = GTV_APPLICATION_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(pDocView))); - GtkWindow* pDialog = gtv_application_window_get_child_window_by_id(window, pDialogId); - if (pDialog) +// GtkWindow* pDialog = gtv_application_window_get_child_window_by_id(window, pDialogId); + + // temporary hack to invalidate all open dialogs + GList* pChildWins = gtv_application_window_get_all_child_windows(window); + GList* pIt = nullptr; + for (pIt = pChildWins; pIt != nullptr; pIt = pIt->next) + { + gtv_lok_dialog_invalidate(GTV_LOK_DIALOG(pIt->data)); + } +/* if (pDialog) { gtv_lok_dialog_invalidate(GTV_LOK_DIALOG(pDialog)); } +*/ } gboolean LOKDocViewSigHandlers::configureEvent(GtkWidget* pWidget, GdkEventConfigure* /*pEvent*/, gpointer /*pData*/) |