[Libreoffice-commits] core.git: Branch 'feature/gsoc-tiled-rendering' - 93 commits - android/source bean/com bean/test compilerplugins/clang configure.ac dbaccess/source download.lst extensions/source external/firebird external/liborcus external/Module_external.mk external/owncloud-android-lib include/LibreOfficeKit include/svl include/svx instsetoo_native/CustomTarget_install.mk instsetoo_native/inc_openoffice javaunohelper/com libreofficekit/Executable_gtktiledviewer.mk libreofficekit/Library_libreofficekitgtk.mk libreofficekit/Module_libreofficekit.mk libreofficekit/qa libreofficekit/source linguistic/source lotuswordpro/source Makefile.fetch odk/source oox/source pyuno/source qadevOOo/testdocs qadevOOo/tests RepositoryExternal.mk sc/qa sc/source sd/inc sd/source sfx2/source starmath/source svtools/source svx/source svx/uiconfig sw/inc sw/qa sw/source toolkit/test ucb/qa vcl/osx vcl/source writerperfect/source
Pranav Kant
pranavk at gnome.org
Wed Jun 10 07:02:30 PDT 2015
Rebased ref, commits from common ancestor:
commit cdc44d3c06b08c46f02e089eff1c329f6e7b07f9
Author: Pranav Kant <pranavk at gnome.org>
Date: Wed Jun 10 16:57:19 2015 +0530
lokdocview, gtktiledviewer: Remove gtk version checks
We already have the global ENABLE_GTK3 guard for RHEL5 baseline.
Change-Id: Id814a4063861a1e750952b44686ed24864c0394f
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index f389f7d..b1fd637 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -40,12 +40,9 @@ std::map<GtkToolItem*, std::string> g_aToolItemCommandNames;
std::map<std::string, GtkToolItem*> g_aCommandNameToolItems;
bool g_bToolItemBroadcast = true;
static GtkWidget* pVBox;
-// GtkComboBox requires gtk 2.24 or later
-#if ( GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 24 ) || GTK_MAJOR_VERSION > 2
static GtkComboBoxText* pPartSelector;
/// Should the part selector avoid calling lok::Document::setPart()?
static bool g_bPartSelectorBroadcast = true;
-#endif
GtkWidget* pFindbar;
GtkWidget* pFindbarEntry;
GtkWidget* pFindbarLabel;
@@ -117,7 +114,6 @@ static void toggleEditing(GtkWidget* /*pButton*/, gpointer /*pItem*/)
/// Toggle the visibility of the findbar.
static void toggleFindbar(GtkWidget* /*pButton*/, gpointer /*pItem*/)
{
-#if GTK_CHECK_VERSION(2,18,0) // we need gtk_widget_get_visible()
if (gtk_widget_get_visible(pFindbar))
{
gtk_widget_hide(pFindbar);
@@ -127,7 +123,6 @@ static void toggleFindbar(GtkWidget* /*pButton*/, gpointer /*pItem*/)
gtk_widget_show_all(pFindbar);
gtk_widget_grab_focus(pFindbarEntry);
}
-#endif
}
/// Get the visible area of the scrolled window
@@ -151,13 +146,11 @@ static void getVisibleAreaTwips(GdkRectangle* pArea)
static gboolean signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointer pData)
{
LOKDocView* pLOKDocView = LOK_DOC_VIEW(pDocView);
-#if GTK_CHECK_VERSION(2,18,0) // we need gtk_widget_get_visible()
if (!gtk_widget_get_visible(pFindbar) && bool(lok_doc_view_get_edit(pLOKDocView)))
{
lok_doc_view_post_key(pWidget, pEvent, pData);
return TRUE;
}
-#endif
return FALSE;
}
@@ -263,11 +256,9 @@ static void signalSearch(LOKDocView* /*pLOKDocView*/, char* /*pPayload*/, gpoint
static void signalPart(LOKDocView* /*pLOKDocView*/, int nPart, gpointer /*pData*/)
{
-#if GTK_CHECK_VERSION(2,24,0)
g_bPartSelectorBroadcast = false;
gtk_combo_box_set_active(GTK_COMBO_BOX(pPartSelector), nPart);
g_bPartSelectorBroadcast = true;
-#endif
}
/// User clicked on a cmmand button -> inform LOKDocView.
@@ -283,8 +274,6 @@ static void toggleToolItem(GtkWidget* pWidget, gpointer /*pData*/)
}
}
-// GtkComboBox requires gtk 2.24 or later
-#if ( GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 24 ) || GTK_MAJOR_VERSION > 2
static void populatePartSelector()
{
gtk_list_store_clear( GTK_LIST_STORE(
@@ -342,7 +331,6 @@ static void changePartMode( GtkWidget* pSelector, gpointer /* pItem */ )
lok_doc_view_set_partmode( LOK_DOC_VIEW(pDocView), ePartMode );
}
}
-#endif
int main( int argc, char* argv[] )
{
@@ -385,8 +373,6 @@ int main( int argc, char* argv[] )
GtkToolItem* pSeparator1 = gtk_separator_tool_item_new();
gtk_toolbar_insert( GTK_TOOLBAR(pToolbar), pSeparator1, -1);
-// GtkComboBox requires gtk 2.24 or later
-#if ( GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 24 ) || GTK_MAJOR_VERSION > 2
GtkToolItem* pPartSelectorToolItem = gtk_tool_item_new();
GtkWidget* pComboBox = gtk_combo_box_text_new();
gtk_container_add( GTK_CONTAINER(pPartSelectorToolItem), pComboBox );
@@ -401,7 +387,6 @@ int main( int argc, char* argv[] )
GtkWidget* pPartModeComboBox = gtk_combo_box_text_new();
gtk_container_add( GTK_CONTAINER(pPartModeSelectorToolItem), pPartModeComboBox );
gtk_toolbar_insert( GTK_TOOLBAR(pToolbar), pPartModeSelectorToolItem, -1 );
-#endif
gtk_toolbar_insert( GTK_TOOLBAR(pToolbar), gtk_separator_tool_item_new(), -1);
pEnableEditing = gtk_toggle_tool_button_new_from_stock(GTK_STOCK_EDIT);
@@ -490,15 +475,11 @@ int main( int argc, char* argv[] )
g_error("main: lok_doc_view_open_document() failed");
assert(lok_doc_view_get_document(LOK_DOC_VIEW(pDocView)));
- // GtkComboBox requires gtk 2.24 or later
-#if ( GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 24 ) || GTK_MAJOR_VERSION > 2
populatePartSelector();
populatePartModeSelector( GTK_COMBO_BOX_TEXT(pPartModeComboBox) );
// Connect these signals after populating the selectors, to avoid re-rendering on setting the default part/partmode.
g_signal_connect(G_OBJECT(pPartModeComboBox), "changed", G_CALLBACK(changePartMode), 0);
-
g_signal_connect(G_OBJECT(pPartSelector), "changed", G_CALLBACK(changePart), 0);
-#endif
gtk_main();
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index f25d099..ff64b5b 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -648,7 +648,6 @@ gboolean LOKDocView_Impl::renderOverlay(GtkWidget* /*widget*/, cairo_t *cr, gpoi
gboolean LOKDocView_Impl::renderOverlayImpl(cairo_t *pCairo)
{
-#if GTK_CHECK_VERSION(2,14,0) // we need gtk_widget_get_window()
if (m_bEdit && m_bCursorVisible && m_bCursorOverlayVisible && !isEmptyRectangle(m_aVisibleCursor))
{
if (m_aVisibleCursor.width < 30)
@@ -710,7 +709,6 @@ gboolean LOKDocView_Impl::renderOverlayImpl(cairo_t *pCairo)
renderGraphicHandle(pCairo, m_aGraphicSelection, m_pGraphicHandle);
}
-#endif
return FALSE;
}
@@ -1014,9 +1012,7 @@ gboolean LOKDocView_Impl::callbackImpl(CallbackData* pCallback)
case LOK_CALLBACK_HYPERLINK_CLICKED:
{
GError* pError = NULL;
-#if GTK_CHECK_VERSION(2,14,0)
gtk_show_uri(NULL, pCallback->m_aPayload.c_str(), GDK_CURRENT_TIME, &pError);
-#endif
}
break;
case LOK_CALLBACK_STATE_CHANGED:
@@ -1067,22 +1063,16 @@ void LOKDocView_Impl::callbackWorkerImpl(int nType, const char* pPayload)
{
LOKDocView_Impl::CallbackData* pCallback = new LOKDocView_Impl::CallbackData(nType, pPayload ? pPayload : "(nil)", m_pDocView);
g_info("lok_doc_view_callback_worker: %s, '%s'", LOKDocView_Impl::callbackTypeToString(nType), pPayload);
-#if GTK_CHECK_VERSION(2,12,0)
gdk_threads_add_idle(LOKDocView_Impl::callback, pCallback);
-#endif
}
void LOKDocView_Impl::globalCallbackWorkerImpl(int nType, const char* pPayload)
{
LOKDocView_Impl::CallbackData* pCallback = new LOKDocView_Impl::CallbackData(nType, pPayload ? pPayload : "(nil)", m_pDocView);
g_info("LOKDocView_Impl::globalCallbackWorkerImpl: %s, '%s'", LOKDocView_Impl::callbackTypeToString(nType), pPayload);
-#if GTK_CHECK_VERSION(2,12,0)
gdk_threads_add_idle(LOKDocView_Impl::globalCallback, pCallback);
-#endif
}
-
-
void LOKDocView_Impl::commandChanged(const std::string& rString)
{
g_signal_emit(m_pDocView, doc_view_signals[COMMAND_CHANGED], 0, rString.c_str());
commit 0eb67c0f9479ff461c3919b4dc94699667de5ad3
Author: Pranav Kant <pranavk at gnome.org>
Date: Wed Jun 10 16:28:45 2015 +0530
lokdocview: Port to gtk3; 'expose-event' -> 'draw'
Change-Id: I8d2541f5cbd2b908c2b0dc52cccf9b936bbc307a
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 33d46ac..f389f7d 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -474,6 +474,8 @@ int main( int argc, char* argv[] )
// Scrolled window for DocView
pScrolledWindow = gtk_scrolled_window_new(0, 0);
+ gtk_widget_set_hexpand (pScrolledWindow, TRUE);
+ gtk_widget_set_vexpand (pScrolledWindow, TRUE);
gtk_container_add(GTK_CONTAINER(pVBox), pScrolledWindow);
// DocView doesn't have scrolling capability, so need a viewport
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 74ebd00..f25d099 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -116,8 +116,10 @@ struct LOKDocView_Impl
~LOKDocView_Impl();
/// Connected to the destroy signal of LOKDocView, deletes its LOKDocView_Impl.
static void destroy(LOKDocView* pDocView, gpointer pData);
- /// Connected to the expose-event of the GtkDrawingArea
- static void onExposed(GtkWidget *widget, GdkEventExpose *event, gpointer user_data);
+ /// Connected to the draw of the GtkDrawingArea
+ static gboolean renderDocument(GtkWidget *widget, cairo_t *cr, gpointer user_data);
+ /// Implementation of draw event handler, invoked by renderDocument().
+ gboolean renderDocumentImpl(cairo_t* cr);
/// Receives a key press or release event.
void signalKey(GdkEventKey* pEvent);
/*
@@ -138,9 +140,9 @@ struct LOKDocView_Impl
/// Implementation of motion event handler, invoked by signalMotion().
gboolean signalMotionImpl(GdkEventButton* pEvent);
/// Receives an expose event.
- static gboolean renderOverlay(GtkWidget* pWidget, GdkEventExpose* pEvent, LOKDocView* pDocView);
+ static gboolean renderOverlay(GtkWidget* pWidget, cairo_t* cr, gpointer userdata);
/// Implementation of expose event handler (renders cursor and selection overlay), invoked by renderOverlay().
- gboolean renderOverlayImpl(GtkWidget* pEventBox);
+ gboolean renderOverlayImpl(cairo_t *cr);
/// Is rRectangle empty?
static bool isEmptyRectangle(const GdkRectangle& rRectangle);
/*
@@ -154,8 +156,6 @@ struct LOKDocView_Impl
static gboolean handleTimeout(gpointer pData);
/// Implementation of the timeout handler, invoked by handleTimeout().
gboolean handleTimeoutImpl();
- /// Implementation of expose event handler, invoked by onExposed().
- void onExposedImpl(GdkEventExpose* event);
/// Returns the GdkRectangle of a x,y,width,height string.
GdkRectangle payloadToRectangle(const char* pPayload);
/// Returns the GdkRectangles of a x1,y1,w1,h1;x2,y2,w2,h2;... string.
@@ -317,21 +317,22 @@ void LOKDocView_Impl::destroy(LOKDocView* pDocView, gpointer /*pData*/)
delete pDocView->m_pImpl;
}
-void LOKDocView_Impl::onExposed(GtkWidget* /*widget*/, GdkEventExpose* event, gpointer userdata)
+gboolean LOKDocView_Impl::renderDocument(GtkWidget* /*widget*/, cairo_t *cr, gpointer userdata)
{
LOKDocView *pDocView = LOK_DOC_VIEW (userdata);
- pDocView->m_pImpl->onExposedImpl(event);
+ return pDocView->m_pImpl->renderDocumentImpl(cr);
}
-void LOKDocView_Impl::onExposedImpl(GdkEventExpose* event)
+gboolean LOKDocView_Impl::renderDocumentImpl(cairo_t *pCairo)
{
long nDocumentWidthPixels = twipToPixel(m_nDocumentWidthTwips, m_fZoom);
long nDocumentHeightPixels = twipToPixel(m_nDocumentHeightTwips, m_fZoom);
// Total number of rows / columns in this document.
guint nRows = ceil((double)nDocumentHeightPixels / nTileSizePixels);
guint nColumns = ceil((double)nDocumentWidthPixels / nTileSizePixels);
- GdkRectangle aVisibleArea = event->area;
- cairo_t *pcairo = gdk_cairo_create(gtk_widget_get_window(GTK_WIDGET(m_pDocView)));
+ GdkRectangle aVisibleArea;
+
+ gdk_cairo_get_clip_rectangle (pCairo, &aVisibleArea);
aVisibleArea.x = pixelToTwip (aVisibleArea.x, m_fZoom);
aVisibleArea.y = pixelToTwip (aVisibleArea.y, m_fZoom);
@@ -371,16 +372,14 @@ void LOKDocView_Impl::onExposedImpl(GdkEventExpose* event)
{
Tile& currentTile = m_aTileBuffer.getTile(nRow, nColumn, m_fZoom);
GdkPixbuf* pPixBuf = currentTile.getBuffer();
-
- gdk_cairo_set_source_pixbuf (pcairo, pPixBuf,
+ gdk_cairo_set_source_pixbuf (pCairo, pPixBuf,
twipToPixel(aTileRectangleTwips.x, m_fZoom),
twipToPixel(aTileRectangleTwips.y, m_fZoom));
- cairo_paint(pcairo);
+ cairo_paint(pCairo);
}
}
}
-
- cairo_destroy(pcairo);
+ return FALSE;
}
void LOKDocView_Impl::signalKey(GdkEventKey* pEvent)
@@ -641,16 +640,15 @@ gboolean LOKDocView_Impl::signalMotionImpl(GdkEventButton* pEvent)
return FALSE;
}
-gboolean LOKDocView_Impl::renderOverlay(GtkWidget* pEventBox, GdkEventExpose* /*pEvent*/, LOKDocView* pDocView)
+gboolean LOKDocView_Impl::renderOverlay(GtkWidget* /*widget*/, cairo_t *cr, gpointer userdata)
{
- return pDocView->m_pImpl->renderOverlayImpl(pEventBox);
+ LOKDocView *pDocView = LOK_DOC_VIEW (userdata);
+ return pDocView->m_pImpl->renderOverlayImpl(cr);
}
-gboolean LOKDocView_Impl::renderOverlayImpl(GtkWidget* pWidget)
+gboolean LOKDocView_Impl::renderOverlayImpl(cairo_t *pCairo)
{
#if GTK_CHECK_VERSION(2,14,0) // we need gtk_widget_get_window()
- cairo_t* pCairo = gdk_cairo_create(gtk_widget_get_window(pWidget));
-
if (m_bEdit && m_bCursorVisible && m_bCursorOverlayVisible && !isEmptyRectangle(m_aVisibleCursor))
{
if (m_aVisibleCursor.width < 30)
@@ -712,7 +710,6 @@ gboolean LOKDocView_Impl::renderOverlayImpl(GtkWidget* pWidget)
renderGraphicHandle(pCairo, m_aGraphicSelection, m_pGraphicHandle);
}
- cairo_destroy(pCairo);
#endif
return FALSE;
}
@@ -1151,10 +1148,10 @@ static void lok_doc_view_init (LOKDocView* pDocView)
pDocView->m_pImpl = new LOKDocView_Impl(pDocView);
g_signal_connect(G_OBJECT(pDocView),
- "expose-event",
- G_CALLBACK(LOKDocView_Impl::onExposed), pDocView);
+ "draw",
+ G_CALLBACK(LOKDocView_Impl::renderDocument), pDocView);
g_signal_connect(G_OBJECT(pDocView),
- "expose-event",
+ "draw",
G_CALLBACK(LOKDocView_Impl::renderOverlay), pDocView);
gtk_widget_add_events(GTK_WIDGET(pDocView),
GDK_BUTTON_PRESS_MASK
commit 265bace4500b04c29eee1b5ed1837b8ab96d78a8
Author: Pranav Kant <pranavk at gnome.org>
Date: Wed Jun 10 16:18:06 2015 +0530
lokdocview, gtktiledviewer: Port to gtk3
Change-Id: I57f2d7b9383790e5c34fc517a905dd537519598f
diff --git a/libreofficekit/Executable_gtktiledviewer.mk b/libreofficekit/Executable_gtktiledviewer.mk
index 8a52068..31028a6 100644
--- a/libreofficekit/Executable_gtktiledviewer.mk
+++ b/libreofficekit/Executable_gtktiledviewer.mk
@@ -16,7 +16,14 @@ $(eval $(call gb_Executable_set_include,gtktiledviewer,\
$(eval $(call gb_Executable_use_externals,gtktiledviewer,\
boost_headers \
- gtk \
+))
+
+$(eval $(call gb_Executable_add_cxxflags,gtktiledviewer,\
+ $$(GTK3_CFLAGS) \
+))
+
+$(eval $(call gb_Executable_add_libs,gtktiledviewer,\
+ $(GTK3_LIBS) \
))
$(eval $(call gb_Executable_use_libraries,gtktiledviewer,\
diff --git a/libreofficekit/Library_libreofficekitgtk.mk b/libreofficekit/Library_libreofficekitgtk.mk
index 9240953..71a77e9 100644
--- a/libreofficekit/Library_libreofficekitgtk.mk
+++ b/libreofficekit/Library_libreofficekitgtk.mk
@@ -11,15 +11,19 @@ $(eval $(call gb_Library_Library,libreofficekitgtk))
$(eval $(call gb_Library_use_sdk_api,libreofficekitgtk))
-$(eval $(call gb_Library_use_externals,libreofficekitgtk,\
- gtk \
-))
-
$(eval $(call gb_Library_add_exception_objects,libreofficekitgtk,\
libreofficekit/source/gtk/lokdocview \
libreofficekit/source/gtk/tilebuffer \
))
+$(eval $(call gb_Library_add_cxxflags,libreofficekitgtk,\
+ $$(GTK3_CFLAGS) \
+))
+
+$(eval $(call gb_Library_add_libs,libreofficekitgtk,\
+ $(GTK3_LIBS) \
+))
+
ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,libreofficekitgtk,\
-ldl \
diff --git a/libreofficekit/Module_libreofficekit.mk b/libreofficekit/Module_libreofficekit.mk
index 000c2fe..217ecb2 100644
--- a/libreofficekit/Module_libreofficekit.mk
+++ b/libreofficekit/Module_libreofficekit.mk
@@ -15,7 +15,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,libreofficekit,\
CppunitTest_libreofficekit_tiledrendering \
))
-ifneq ($(ENABLE_GTK),)
+ifneq ($(ENABLE_GTK3),)
$(eval $(call gb_Module_add_targets,libreofficekit,\
Library_libreofficekitgtk \
Executable_gtktiledviewer \
@@ -24,7 +24,7 @@ $(eval $(call gb_Module_add_targets,libreofficekit,\
$(eval $(call gb_Module_add_targets,libreofficekit,\
Executable_tilebench \
))
-endif # ($(ENABLE_GTK),)
+endif # ($(ENABLE_GTK3),)
endif # ($(OS),LINUX)
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 4f74583..33d46ac 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -14,9 +14,7 @@
#include <map>
#include <boost/property_tree/json_parser.hpp>
-#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
-#include <gtk/gtk.h>
#include <LibreOfficeKit/LibreOfficeKitGtk.h>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
@@ -206,13 +204,13 @@ static gboolean signalFindbar(GtkWidget* /*pWidget*/, GdkEventKey* pEvent, gpoin
gtk_label_set_text(GTK_LABEL(pFindbarLabel), "");
switch(pEvent->keyval)
{
- case GDK_Return:
+ case GDK_KEY_Return:
{
// Search forward.
doSearch(/*bBackwards=*/false);
return TRUE;
}
- case GDK_Escape:
+ case GDK_KEY_Escape:
{
// Hide the findbar.
gtk_widget_hide(pFindbar);
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 824b948..74ebd00 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -13,8 +13,6 @@
#include <vector>
#include <string>
-#include <gdk/gdkkeysyms.h>
-
#include <com/sun/star/awt/Key.hpp>
#define LOK_USE_UNSTABLE_API
#include <LibreOfficeKit/LibreOfficeKit.h>
@@ -333,7 +331,7 @@ void LOKDocView_Impl::onExposedImpl(GdkEventExpose* event)
guint nRows = ceil((double)nDocumentHeightPixels / nTileSizePixels);
guint nColumns = ceil((double)nDocumentWidthPixels / nTileSizePixels);
GdkRectangle aVisibleArea = event->area;
- cairo_t *pcairo = gdk_cairo_create(GTK_WIDGET(m_pDocView)->window);
+ cairo_t *pcairo = gdk_cairo_create(gtk_widget_get_window(GTK_WIDGET(m_pDocView)));
aVisibleArea.x = pixelToTwip (aVisibleArea.x, m_fZoom);
aVisibleArea.y = pixelToTwip (aVisibleArea.y, m_fZoom);
@@ -398,33 +396,33 @@ void LOKDocView_Impl::signalKey(GdkEventKey* pEvent)
switch (pEvent->keyval)
{
- case GDK_BackSpace:
+ case GDK_KEY_BackSpace:
nKeyCode = com::sun::star::awt::Key::BACKSPACE;
break;
- case GDK_Return:
+ case GDK_KEY_Return:
nKeyCode = com::sun::star::awt::Key::RETURN;
break;
- case GDK_Escape:
+ case GDK_KEY_Escape:
nKeyCode = com::sun::star::awt::Key::ESCAPE;
break;
- case GDK_Tab:
+ case GDK_KEY_Tab:
nKeyCode = com::sun::star::awt::Key::TAB;
break;
- case GDK_Down:
+ case GDK_KEY_Down:
nKeyCode = com::sun::star::awt::Key::DOWN;
break;
- case GDK_Up:
+ case GDK_KEY_Up:
nKeyCode = com::sun::star::awt::Key::UP;
break;
- case GDK_Left:
+ case GDK_KEY_Left:
nKeyCode = com::sun::star::awt::Key::LEFT;
break;
- case GDK_Right:
+ case GDK_KEY_Right:
nKeyCode = com::sun::star::awt::Key::RIGHT;
break;
default:
- if (pEvent->keyval >= GDK_F1 && pEvent->keyval <= GDK_F26)
- nKeyCode = com::sun::star::awt::Key::F1 + (pEvent->keyval - GDK_F1);
+ if (pEvent->keyval >= GDK_KEY_F1 && pEvent->keyval <= GDK_KEY_F26)
+ nKeyCode = com::sun::star::awt::Key::F1 + (pEvent->keyval - GDK_KEY_F1);
else
nCharCode = gdk_keyval_to_unicode(pEvent->keyval);
}
commit 4a703594bfea83df60f0173ada3fe1b24c1f118c
Author: Pranav Kant <pranavk at gnome.org>
Date: Wed Jun 10 16:10:19 2015 +0530
lokdocview: Create LOK context inside of lok_doc_view_new
Change-Id: I675192d6bd6d10e6c7974a5de6f488f9a087ac32
diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index 24c577e..bdd2e9a 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -46,7 +46,7 @@ struct _LOKDocViewClass
GType lok_doc_view_get_type (void) G_GNUC_CONST;
-GtkWidget* lok_doc_view_new (LibreOfficeKit* pOffice );
+GtkWidget* lok_doc_view_new (const char* pPath);
gboolean lok_doc_view_open_document (LOKDocView* pDocView,
char* pPath);
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index c8b47f7..4f74583 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -19,7 +19,6 @@
#include <gtk/gtk.h>
#include <LibreOfficeKit/LibreOfficeKitGtk.h>
-#include <LibreOfficeKit/LibreOfficeKitInit.h>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#ifndef g_info
@@ -53,8 +52,6 @@ GtkWidget* pFindbar;
GtkWidget* pFindbarEntry;
GtkWidget* pFindbarLabel;
-static LibreOfficeKit* pOffice;
-
static void lcl_registerToolItem(GtkToolItem* pItem, const std::string& rName)
{
g_aToolItemCommandNames[pItem] = rName;
@@ -361,10 +358,6 @@ int main( int argc, char* argv[] )
return 1;
}
- pOffice = lok_init( argv[1] );
- if ( pOffice == NULL )
- return 1;
-
gtk_init( &argc, &argv );
GtkWidget *pWindow = gtk_window_new( GTK_WINDOW_TOPLEVEL );
@@ -469,7 +462,9 @@ int main( int argc, char* argv[] )
gtk_box_pack_end(GTK_BOX(pVBox), pFindbar, FALSE, FALSE, 0);
// Docview
- pDocView = lok_doc_view_new( pOffice );
+ pDocView = lok_doc_view_new(argv[1]);
+ if (pDocView == NULL)
+ g_error ("Error while creating LOKDocView widget");
g_signal_connect(pDocView, "edit-changed", G_CALLBACK(signalEdit), NULL);
g_signal_connect(pDocView, "command-changed", G_CALLBACK(signalCommand), NULL);
g_signal_connect(pDocView, "search-not-found", G_CALLBACK(signalSearch), NULL);
@@ -492,7 +487,7 @@ int main( int argc, char* argv[] )
int bOpened = lok_doc_view_open_document( LOK_DOC_VIEW(pDocView), argv[2] );
if (!bOpened)
- g_error("main: lok_doc_view_open_document() failed with '%s'", pOffice->pClass->getError(pOffice));
+ g_error("main: lok_doc_view_open_document() failed");
assert(lok_doc_view_get_document(LOK_DOC_VIEW(pDocView)));
// GtkComboBox requires gtk 2.24 or later
@@ -507,8 +502,6 @@ int main( int argc, char* argv[] )
gtk_main();
- pOffice->pClass->destroy( pOffice );
-
return 0;
}
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index d3d14a2..824b948 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -18,6 +18,7 @@
#include <com/sun/star/awt/Key.hpp>
#define LOK_USE_UNSTABLE_API
#include <LibreOfficeKit/LibreOfficeKit.h>
+#include <LibreOfficeKit/LibreOfficeKitInit.h>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <LibreOfficeKit/LibreOfficeKitGtk.h>
#include <rsc/rsc-vcl-shared-types.hxx>
@@ -1181,10 +1182,12 @@ static void lok_doc_view_init (LOKDocView* pDocView)
*
* Returns: The #LOKDocView widget instance.
*/
-SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new( LibreOfficeKit* pOffice )
+SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new(const char* pPath)
{
- LOKDocView* pDocView = LOK_DOC_VIEW(gtk_type_new(lok_doc_view_get_type()));
- pDocView->m_pImpl->m_pOffice = pOffice;
+ LOKDocView* pDocView = LOK_DOC_VIEW(g_object_new(LOK_TYPE_DOC_VIEW, NULL));
+ pDocView->m_pImpl->m_pOffice = lok_init (pPath);
+ if (pDocView->m_pImpl->m_pOffice == NULL)
+ return NULL;
return GTK_WIDGET( pDocView );
}
commit af65745df88fa19365b79b8a7e77ac21888f553a
Author: Pranav Kant <pranavk at gnome.org>
Date: Tue Jun 9 18:08:59 2015 +0530
lokdocview: Make this GObject class introspectable
... so that this widget can be used from other languages.
Change-Id: Icd7d6df6aa587ffdb018af0b911300dc81ec6560
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 5f642d9..d3d14a2 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -121,7 +121,7 @@ struct LOKDocView_Impl
static void onExposed(GtkWidget *widget, GdkEventExpose *event, gpointer user_data);
/// Receives a key press or release event.
void signalKey(GdkEventKey* pEvent);
- /**
+ /*
* The user drags the handle, which is below the cursor, but wants to move the
* cursor accordingly.
*
@@ -144,7 +144,7 @@ struct LOKDocView_Impl
gboolean renderOverlayImpl(GtkWidget* pEventBox);
/// Is rRectangle empty?
static bool isEmptyRectangle(const GdkRectangle& rRectangle);
- /**
+ /*
* Renders pHandle below an rCursor rectangle on pCairo.
* @param rRectangle output parameter, the rectangle that contains the rendered handle.
*/
@@ -1175,6 +1175,12 @@ static void lok_doc_view_init (LOKDocView* pDocView)
g_signal_connect(G_OBJECT(pDocView), "destroy", G_CALLBACK(LOKDocView_Impl::destroy), 0);
}
+/**
+ * lok_doc_view_new:
+ * @pOffice: The LibreOfficeKit context.
+ *
+ * Returns: The #LOKDocView widget instance.
+ */
SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new( LibreOfficeKit* pOffice )
{
LOKDocView* pDocView = LOK_DOC_VIEW(gtk_type_new(lok_doc_view_get_type()));
@@ -1182,6 +1188,13 @@ SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new( LibreOfficeKit* pOffice )
return GTK_WIDGET( pDocView );
}
+/**
+ * lok_doc_view_open_document:
+ * @pDocView: The #LOKDocView instance
+ * @pPath: The path of the document that #LOKDocView widget should try to open
+ *
+ * Returns: %TRUE if the document is loaded succesfully, %FALSE otherwise
+ */
SAL_DLLPUBLIC_EXPORT gboolean lok_doc_view_open_document( LOKDocView* pDocView, char* pPath )
{
if ( pDocView->m_pImpl->m_pDocument )
@@ -1226,11 +1239,24 @@ SAL_DLLPUBLIC_EXPORT gboolean lok_doc_view_open_document( LOKDocView* pDocView,
return TRUE;
}
+/**
+ * lok_doc_view_get_document:
+ * @pDocView: The #LOKDocView instance
+ *
+ * Returns: The #LibreOfficeKitDocument instance the widget is currently showing
+ */
SAL_DLLPUBLIC_EXPORT LibreOfficeKitDocument* lok_doc_view_get_document(LOKDocView* pDocView)
{
return pDocView->m_pImpl->m_pDocument;
}
+/**
+ * lok_doc_view_set_zoom:
+ * @pDocView: The #LOKDocView instance
+ * @fZoom: The new zoom level that pDocView must set it into.
+ *
+ * Sets the new zoom level for the widget.
+ */
SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_zoom ( LOKDocView* pDocView, float fZoom )
{
pDocView->m_pImpl->m_fZoom = fZoom;
@@ -1246,6 +1272,12 @@ SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_zoom ( LOKDocView* pDocView, float fZ
nDocumentHeightPixels);
}
+/**
+ * lok_doc_view_get_zoom:
+ * @pDocView: The #LOKDocView instance
+ *
+ * Returns: The current zoom factor value in float for pDocView
+ */
SAL_DLLPUBLIC_EXPORT float lok_doc_view_get_zoom ( LOKDocView* pDocView )
{
return pDocView->m_pImpl->m_fZoom;
@@ -1277,6 +1309,13 @@ SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_partmode( LOKDocView* pDocView,
pDocView->m_pImpl->m_pDocument->pClass->setPartMode( pDocView->m_pImpl->m_pDocument, nPartMode );
}
+/**
+ * lok_doc_view_set_edit:
+ * @pDocView: The #LOKDocView instance
+ * @bEdit: %TRUE if the pDocView should go in edit mode, %FALSE otherwise
+ *
+ * Sets the edit-mode for pDocView
+ */
SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_edit( LOKDocView* pDocView,
gboolean bEdit )
{
@@ -1294,6 +1333,12 @@ SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_edit( LOKDocView* pDocView,
gtk_widget_queue_draw(GTK_WIDGET(pDocView));
}
+/**
+ * lok_doc_view_get_edit:
+ * @pDocView: The #LOKDocView instance
+ *
+ * Returns: %TRUE if the given pDocView is in edit mode.
+ */
SAL_DLLPUBLIC_EXPORT gboolean lok_doc_view_get_edit(LOKDocView* pDocView)
{
return pDocView->m_pImpl->m_bEdit;
@@ -1310,11 +1355,29 @@ SAL_DLLPUBLIC_EXPORT void lok_doc_view_post_key(GtkWidget* /*pWidget*/, GdkEvent
pDocView->m_pImpl->signalKey(pEvent);
}
+/**
+ * lok_doc_view_pixel_to_twip:
+ * @pDocView: The #LOKDocView instance
+ * @fInput: The value in pixels to convert to twips
+ *
+ * Converts the value in pixels to twips according to zoom level.
+ *
+ * Returns: The corresponding value in twips
+ */
SAL_DLLPUBLIC_EXPORT float lok_doc_view_pixel_to_twip(LOKDocView* pDocView, float fInput)
{
return pixelToTwip(fInput, pDocView->m_pImpl->m_fZoom);
}
+/**
+ * lok_doc_view_twip_to_pixel:
+ * @pDocView: The #LOKDocView instance
+ * @fInput: The value in twips to convert to pixels
+ *
+ * Converts the value in twips to pixels according to zoom level.
+ *
+ * Returns: The corresponding value in pixels
+ */
SAL_DLLPUBLIC_EXPORT float lok_doc_view_twip_to_pixel(LOKDocView* pDocView, float fInput)
{
return twipToPixel(fInput, pDocView->m_pImpl->m_fZoom);
commit 38aa87f7e9fe8cd42942a19dbd46d8519bae42d9
Author: Pranav Kant <pranavk at gnome.org>
Date: Tue Jun 9 16:27:37 2015 +0530
lokdocview: Change parent class to GtkDrawingArea
It is not the job of the widget to provide the scroll bars.
Change-Id: Iafc5724ed5b21717d711bb8f7e1a076dd1288b76
diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index e84feee..24c577e 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -31,21 +31,23 @@ typedef struct _LOKDocViewClass LOKDocViewClass;
struct _LOKDocView
{
- GtkScrolledWindow aScrollWindow;
+ GtkDrawingArea aDrawingArea;
struct LOKDocView_Impl* m_pImpl;
};
struct _LOKDocViewClass
{
- GtkScrolledWindowClass parent_class;
- void (* edit_changed) (LOKDocView* pView, gboolean was_edit);
- void (* command_changed) (LOKDocView* pView, char* new_state);
- void (* search_not_found) (LOKDocView* pView, char* new_state);
- void (* part_changed) (LOKDocView* pView, int new_part);
+ GtkDrawingAreaClass parent_class;
+ void (* edit_changed) (LOKDocView* pView, gboolean was_edit);
+ void (* command_changed) (LOKDocView* pView, char* new_state);
+ void (* search_not_found) (LOKDocView* pView, char* new_state);
+ void (* part_changed) (LOKDocView* pView, int new_part);
};
GType lok_doc_view_get_type (void) G_GNUC_CONST;
+
GtkWidget* lok_doc_view_new (LibreOfficeKit* pOffice );
+
gboolean lok_doc_view_open_document (LOKDocView* pDocView,
char* pPath);
@@ -80,9 +82,11 @@ void lok_doc_view_post_key (GtkWidget* p
GdkEventKey* pEvent,
gpointer pData);
-/// Get the visible area of the document (in twips).
-void lok_doc_view_get_visarea (LOKDocView* pThis,
- GdkRectangle* pArea);
+float lok_doc_view_pixel_to_twip (LOKDocView* pDocView,
+ float fInput);
+
+float lok_doc_view_twip_to_pixel (LOKDocView* pDocView,
+ float fInput);
G_END_DECLS
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 38b29ee..c8b47f7 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -38,6 +38,7 @@ static GtkToolItem* pBold;
static GtkToolItem* pItalic;
static GtkToolItem* pUnderline;
static GtkToolItem* pStrikethrough;
+static GtkWidget* pScrolledWindow;
std::map<GtkToolItem*, std::string> g_aToolItemCommandNames;
std::map<std::string, GtkToolItem*> g_aCommandNameToolItems;
bool g_bToolItemBroadcast = true;
@@ -134,6 +135,23 @@ static void toggleFindbar(GtkWidget* /*pButton*/, gpointer /*pItem*/)
#endif
}
+/// Get the visible area of the scrolled window
+static void getVisibleAreaTwips(GdkRectangle* pArea)
+{
+ GtkAdjustment* pHAdjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(pScrolledWindow));
+ GtkAdjustment* pVAdjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(pScrolledWindow));
+
+ pArea->x = lok_doc_view_pixel_to_twip(LOK_DOC_VIEW(pDocView),
+ gtk_adjustment_get_value(pHAdjustment));
+ pArea->y = lok_doc_view_pixel_to_twip(LOK_DOC_VIEW(pDocView),
+ gtk_adjustment_get_value(pVAdjustment));
+ pArea->width = lok_doc_view_pixel_to_twip(LOK_DOC_VIEW(pDocView),
+ gtk_adjustment_get_page_size(pHAdjustment));
+ pArea->height = lok_doc_view_pixel_to_twip(LOK_DOC_VIEW(pDocView),
+ gtk_adjustment_get_page_size(pVAdjustment));
+}
+
+
/// Handles the key-press-event of the window.
static gboolean signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointer pData)
{
@@ -161,7 +179,7 @@ static void doSearch(bool bBackwards)
LOKDocView* pLOKDocView = LOK_DOC_VIEW(pDocView);
GdkRectangle aArea;
- lok_doc_view_get_visarea(pLOKDocView, &aArea);
+ getVisibleAreaTwips(&aArea);
aTree.put(boost::property_tree::ptree::path_type("SearchItem.SearchStartPointX/type", '/'), "long");
aTree.put(boost::property_tree::ptree::path_type("SearchItem.SearchStartPointX/value", '/'), aArea.x);
aTree.put(boost::property_tree::ptree::path_type("SearchItem.SearchStartPointY/type", '/'), "long");
@@ -461,7 +479,12 @@ int main( int argc, char* argv[] )
g_signal_connect(pWindow, "key-press-event", G_CALLBACK(signalKey), pDocView);
g_signal_connect(pWindow, "key-release-event", G_CALLBACK(signalKey), pDocView);
- gtk_container_add( GTK_CONTAINER(pVBox), pDocView );
+ // Scrolled window for DocView
+ pScrolledWindow = gtk_scrolled_window_new(0, 0);
+ gtk_container_add(GTK_CONTAINER(pVBox), pScrolledWindow);
+
+ // DocView doesn't have scrolling capability, so need a viewport
+ gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(pScrolledWindow), pDocView);
gtk_widget_show_all( pWindow );
// Hide the findbar by default.
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index ed3fc5c..5f642d9 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -41,7 +41,6 @@
struct LOKDocView_Impl
{
LOKDocView* m_pDocView;
- GtkWidget *m_pDrawingArea;
TileBuffer m_aTileBuffer;
float m_fZoom;
@@ -119,7 +118,7 @@ struct LOKDocView_Impl
/// Connected to the destroy signal of LOKDocView, deletes its LOKDocView_Impl.
static void destroy(LOKDocView* pDocView, gpointer pData);
/// Connected to the expose-event of the GtkDrawingArea
- static void on_exposed(GtkWidget *widget, GdkEvent *event, gpointer user_data);
+ static void onExposed(GtkWidget *widget, GdkEventExpose *event, gpointer user_data);
/// Receives a key press or release event.
void signalKey(GdkEventKey* pEvent);
/**
@@ -156,16 +155,8 @@ struct LOKDocView_Impl
static gboolean handleTimeout(gpointer pData);
/// Implementation of the timeout handler, invoked by handleTimeout().
gboolean handleTimeoutImpl();
- /**
- * Renders the document to a number of visible tiles.
- *
- * This method is invoked only manually, not when some Gtk signal is
- * emitted.
- *
- * @param pPartial if 0, then the full visible document is rendered, otherwise only
- * the tiles that intersect with pPartial.
- */
- void renderDocument(GdkRectangle* pPartial);
+ /// Implementation of expose event handler, invoked by onExposed().
+ void onExposedImpl(GdkEventExpose* event);
/// Returns the GdkRectangle of a x,y,width,height string.
GdkRectangle payloadToRectangle(const char* pPayload);
/// Returns the GdkRectangles of a x1,y1,w1,h1;x2,y2,w2,h2;... string.
@@ -213,7 +204,7 @@ SAL_DLLPUBLIC_EXPORT GType lok_doc_view_get_type();
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif
-G_DEFINE_TYPE(LOKDocView, lok_doc_view, GTK_TYPE_SCROLLED_WINDOW)
+G_DEFINE_TYPE(LOKDocView, lok_doc_view, GTK_TYPE_DRAWING_AREA)
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
@@ -279,7 +270,6 @@ LOKDocView_Impl::CallbackData::CallbackData(int nType, const std::string& rPaylo
LOKDocView_Impl::LOKDocView_Impl(LOKDocView* pDocView)
: m_pDocView(pDocView),
- m_pDrawingArea(gtk_drawing_area_new()),
m_aTileBuffer(TileBuffer(0,0)),
m_fZoom(1),
m_pOffice(0),
@@ -328,10 +318,70 @@ void LOKDocView_Impl::destroy(LOKDocView* pDocView, gpointer /*pData*/)
delete pDocView->m_pImpl;
}
-void LOKDocView_Impl::on_exposed(GtkWidget* /*widget*/, GdkEvent* /*event*/, gpointer userdata)
+void LOKDocView_Impl::onExposed(GtkWidget* /*widget*/, GdkEventExpose* event, gpointer userdata)
{
LOKDocView *pDocView = LOK_DOC_VIEW (userdata);
- pDocView->m_pImpl->renderDocument(0);
+ pDocView->m_pImpl->onExposedImpl(event);
+}
+
+void LOKDocView_Impl::onExposedImpl(GdkEventExpose* event)
+{
+ long nDocumentWidthPixels = twipToPixel(m_nDocumentWidthTwips, m_fZoom);
+ long nDocumentHeightPixels = twipToPixel(m_nDocumentHeightTwips, m_fZoom);
+ // Total number of rows / columns in this document.
+ guint nRows = ceil((double)nDocumentHeightPixels / nTileSizePixels);
+ guint nColumns = ceil((double)nDocumentWidthPixels / nTileSizePixels);
+ GdkRectangle aVisibleArea = event->area;
+ cairo_t *pcairo = gdk_cairo_create(GTK_WIDGET(m_pDocView)->window);
+
+ aVisibleArea.x = pixelToTwip (aVisibleArea.x, m_fZoom);
+ aVisibleArea.y = pixelToTwip (aVisibleArea.y, m_fZoom);
+ aVisibleArea.width = pixelToTwip (aVisibleArea.width, m_fZoom);
+ aVisibleArea.height = pixelToTwip (aVisibleArea.height, m_fZoom);
+
+ // Render the tiles.
+ for (guint nRow = 0; nRow < nRows; ++nRow)
+ {
+ for (guint nColumn = 0; nColumn < nColumns; ++nColumn)
+ {
+ GdkRectangle aTileRectangleTwips, aTileRectanglePixels;
+ bool bPaint = true;
+
+ // Determine size of the tile: the rightmost/bottommost tiles may
+ // be smaller, and we need the size to decide if we need to repaint.
+ if (nColumn == nColumns - 1)
+ aTileRectanglePixels.width = nDocumentWidthPixels - nColumn * nTileSizePixels;
+ else
+ aTileRectanglePixels.width = nTileSizePixels;
+ if (nRow == nRows - 1)
+ aTileRectanglePixels.height = nDocumentHeightPixels - nRow * nTileSizePixels;
+ else
+ aTileRectanglePixels.height = nTileSizePixels;
+
+ // Determine size and position of the tile in document coordinates,
+ // so we can decide if we can skip painting for partial rendering.
+ aTileRectangleTwips.x = pixelToTwip(nTileSizePixels, m_fZoom) * nColumn;
+ aTileRectangleTwips.y = pixelToTwip(nTileSizePixels, m_fZoom) * nRow;
+ aTileRectangleTwips.width = pixelToTwip(aTileRectanglePixels.width, m_fZoom);
+ aTileRectangleTwips.height = pixelToTwip(aTileRectanglePixels.height, m_fZoom);
+
+ if (!gdk_rectangle_intersect(&aVisibleArea, &aTileRectangleTwips, 0))
+ bPaint = false;
+
+ if (bPaint)
+ {
+ Tile& currentTile = m_aTileBuffer.getTile(nRow, nColumn, m_fZoom);
+ GdkPixbuf* pPixBuf = currentTile.getBuffer();
+
+ gdk_cairo_set_source_pixbuf (pcairo, pPixBuf,
+ twipToPixel(aTileRectangleTwips.x, m_fZoom),
+ twipToPixel(aTileRectangleTwips.y, m_fZoom));
+ cairo_paint(pcairo);
+ }
+ }
+ }
+
+ cairo_destroy(pcairo);
}
void LOKDocView_Impl::signalKey(GdkEventKey* pEvent)
@@ -798,75 +848,12 @@ gboolean LOKDocView_Impl::handleTimeoutImpl()
m_bCursorOverlayVisible = false;
else
m_bCursorOverlayVisible = true;
- gtk_widget_queue_draw(GTK_WIDGET(m_pDrawingArea));
+ gtk_widget_queue_draw(GTK_WIDGET(m_pDocView));
}
return G_SOURCE_CONTINUE;
}
-void LOKDocView_Impl::renderDocument(GdkRectangle* pPartial)
-{
- GdkRectangle visibleArea;
- lok_doc_view_get_visarea (m_pDocView, &visibleArea);
-
- long nDocumentWidthPixels = twipToPixel(m_nDocumentWidthTwips, m_fZoom);
- long nDocumentHeightPixels = twipToPixel(m_nDocumentHeightTwips, m_fZoom);
- // Total number of rows / columns in this document.
- guint nRows = ceil((double)nDocumentHeightPixels / nTileSizePixels);
- guint nColumns = ceil((double)nDocumentWidthPixels / nTileSizePixels);
-
- cairo_t *pcairo = gdk_cairo_create(m_pDrawingArea->window);
-
- // Render the tiles.
- for (guint nRow = 0; nRow < nRows; ++nRow)
- {
- for (guint nColumn = 0; nColumn < nColumns; ++nColumn)
- {
- GdkRectangle aTileRectangleTwips, aTileRectanglePixels;
- bool bPaint = true;
-
- // Determine size of the tile: the rightmost/bottommost tiles may
- // be smaller, and we need the size to decide if we need to repaint.
- if (nColumn == nColumns - 1)
- aTileRectanglePixels.width = nDocumentWidthPixels - nColumn * nTileSizePixels;
- else
- aTileRectanglePixels.width = nTileSizePixels;
- if (nRow == nRows - 1)
- aTileRectanglePixels.height = nDocumentHeightPixels - nRow * nTileSizePixels;
- else
- aTileRectanglePixels.height = nTileSizePixels;
-
- // Determine size and position of the tile in document coordinates,
- // so we can decide if we can skip painting for partial rendering.
- aTileRectangleTwips.x = pixelToTwip(nTileSizePixels, m_fZoom) * nColumn;
- aTileRectangleTwips.y = pixelToTwip(nTileSizePixels, m_fZoom) * nRow;
- aTileRectangleTwips.width = pixelToTwip(aTileRectanglePixels.width, m_fZoom);
- aTileRectangleTwips.height = pixelToTwip(aTileRectanglePixels.height, m_fZoom);
- if (pPartial && !gdk_rectangle_intersect(pPartial, &aTileRectangleTwips, 0))
- bPaint = false;
-
- if (!gdk_rectangle_intersect(&visibleArea, &aTileRectangleTwips, 0))
- bPaint = false;
-
- if (bPaint)
- {
- //g_info("tile_buffer_get_tile (%d, %d)", nRow, nColumn);
-
- Tile& currentTile = m_aTileBuffer.getTile(nRow, nColumn, m_fZoom);
- GdkPixbuf* pPixBuf = currentTile.getBuffer();
-
- gdk_cairo_set_source_pixbuf (pcairo, pPixBuf,
- twipToPixel(aTileRectangleTwips.x, m_fZoom),
- twipToPixel(aTileRectangleTwips.y, m_fZoom));
- cairo_paint(pcairo);
- }
- }
- }
-
- cairo_destroy(pcairo);
-}
-
-
GdkRectangle LOKDocView_Impl::payloadToRectangle(const char* pPayload)
{
GdkRectangle aRet;
@@ -978,14 +965,14 @@ gboolean LOKDocView_Impl::callbackImpl(CallbackData* pCallback)
else
m_aTileBuffer.resetAllTiles();
- gtk_widget_queue_draw(m_pDrawingArea);
+ gtk_widget_queue_draw(GTK_WIDGET(m_pDocView));
}
break;
case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
{
m_aVisibleCursor = LOKDocView_Impl::payloadToRectangle(pCallback->m_aPayload.c_str());
m_bCursorOverlayVisible = true;
- gtk_widget_queue_draw(m_pDrawingArea);
+ gtk_widget_queue_draw(GTK_WIDGET(m_pDocView));
}
break;
case LOK_CALLBACK_TEXT_SELECTION:
@@ -1025,7 +1012,7 @@ gboolean LOKDocView_Impl::callbackImpl(CallbackData* pCallback)
m_aGraphicSelection = LOKDocView_Impl::payloadToRectangle(pCallback->m_aPayload.c_str());
else
memset(&m_aGraphicSelection, 0, sizeof(m_aGraphicSelection));
- gtk_widget_queue_draw(GTK_WIDGET(m_pDrawingArea));
+ gtk_widget_queue_draw(GTK_WIDGET(m_pDocView));
}
break;
case LOK_CALLBACK_HYPERLINK_CLICKED:
@@ -1049,7 +1036,7 @@ gboolean LOKDocView_Impl::callbackImpl(CallbackData* pCallback)
case LOK_CALLBACK_DOCUMENT_SIZE_CHANGED:
{
payloadToSize(pCallback->m_aPayload.c_str(), m_nDocumentWidthTwips, m_nDocumentHeightTwips);
- gtk_widget_set_size_request(m_pDrawingArea,
+ gtk_widget_set_size_request(GTK_WIDGET(m_pDocView),
twipToPixel(m_nDocumentWidthTwips, m_fZoom),
twipToPixel(m_nDocumentHeightTwips, m_fZoom));
}
@@ -1113,7 +1100,6 @@ void LOKDocView_Impl::searchNotFound(const std::string& rString)
void LOKDocView_Impl::setPart(const std::string& rString)
{
g_signal_emit(m_pDocView, doc_view_signals[PART_CHANGED], 0, std::stoi(rString));
- renderDocument(0);
}
static void lok_doc_view_class_init (LOKDocViewClass* pClass)
@@ -1163,34 +1149,26 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
static void lok_doc_view_init (LOKDocView* pDocView)
{
- // Gtk ScrolledWindow is apparently not fully initialised yet, we specifically
- // have to set the [hv]adjustment to prevent GTK assertions from firing, see
- // https://bugzilla.gnome.org/show_bug.cgi?id=438114 for more info.
- gtk_scrolled_window_set_hadjustment( GTK_SCROLLED_WINDOW( pDocView ), NULL );
- gtk_scrolled_window_set_vadjustment( GTK_SCROLLED_WINDOW( pDocView ), NULL );
-
pDocView->m_pImpl = new LOKDocView_Impl(pDocView);
- gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW(pDocView),
- pDocView->m_pImpl->m_pDrawingArea );
- g_signal_connect(G_OBJECT(pDocView->m_pImpl->m_pDrawingArea),
+ g_signal_connect(G_OBJECT(pDocView),
"expose-event",
- G_CALLBACK(LOKDocView_Impl::on_exposed), pDocView);
- g_signal_connect(G_OBJECT(pDocView->m_pImpl->m_pDrawingArea),
+ G_CALLBACK(LOKDocView_Impl::onExposed), pDocView);
+ g_signal_connect(G_OBJECT(pDocView),
"expose-event",
G_CALLBACK(LOKDocView_Impl::renderOverlay), pDocView);
- gtk_widget_add_events(pDocView->m_pImpl->m_pDrawingArea,
+ gtk_widget_add_events(GTK_WIDGET(pDocView),
GDK_BUTTON_PRESS_MASK
|GDK_BUTTON_RELEASE_MASK
|GDK_BUTTON_MOTION_MASK);
- g_signal_connect(G_OBJECT(pDocView->m_pImpl->m_pDrawingArea),
+ g_signal_connect(G_OBJECT(pDocView),
"button-press-event",
G_CALLBACK(LOKDocView_Impl::signalButton), pDocView);
- g_signal_connect(G_OBJECT(pDocView->m_pImpl->m_pDrawingArea),
+ g_signal_connect(G_OBJECT(pDocView),
"button-release-event",
G_CALLBACK(LOKDocView_Impl::signalButton), pDocView);
- g_signal_connect(G_OBJECT(pDocView->m_pImpl->m_pDrawingArea),
+ g_signal_connect(G_OBJECT(pDocView),
"motion-notify-event",
G_CALLBACK(LOKDocView_Impl::signalMotion), pDocView);
@@ -1240,10 +1218,9 @@ SAL_DLLPUBLIC_EXPORT gboolean lok_doc_view_open_document( LOKDocView* pDocView,
pDocView->m_pImpl->m_aTileBuffer = TileBuffer(pDocView->m_pImpl->m_pDocument,
nColumns);
- gtk_widget_set_size_request(pDocView->m_pImpl->m_pDrawingArea,
+ gtk_widget_set_size_request(GTK_WIDGET(pDocView),
nDocumentWidthPixels,
nDocumentHeightPixels);
- pDocView->m_pImpl->renderDocument(0);
}
return TRUE;
@@ -1264,12 +1241,9 @@ SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_zoom ( LOKDocView* pDocView, float fZ
pDocView->m_pImpl->m_aTileBuffer = TileBuffer(pDocView->m_pImpl->m_pDocument,
nColumns);
- gtk_widget_set_size_request(pDocView->m_pImpl->m_pDrawingArea,
+ gtk_widget_set_size_request(GTK_WIDGET(pDocView),
nDocumentWidthPixels,
nDocumentHeightPixels);
-
- if ( pDocView->m_pImpl->m_pDocument )
- pDocView->m_pImpl->renderDocument(0);
}
SAL_DLLPUBLIC_EXPORT float lok_doc_view_get_zoom ( LOKDocView* pDocView )
@@ -1301,7 +1275,6 @@ SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_partmode( LOKDocView* pDocView,
int nPartMode )
{
pDocView->m_pImpl->m_pDocument->pClass->setPartMode( pDocView->m_pImpl->m_pDocument, nPartMode );
- pDocView->m_pImpl->renderDocument(0);
}
SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_edit( LOKDocView* pDocView,
@@ -1318,7 +1291,7 @@ SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_edit( LOKDocView* pDocView,
}
pDocView->m_pImpl->m_bEdit = bEdit;
g_signal_emit(pDocView, doc_view_signals[EDIT_CHANGED], 0, bWasEdit);
- gtk_widget_queue_draw(GTK_WIDGET(pDocView->m_pImpl->m_pDrawingArea));
+ gtk_widget_queue_draw(GTK_WIDGET(pDocView));
}
SAL_DLLPUBLIC_EXPORT gboolean lok_doc_view_get_edit(LOKDocView* pDocView)
@@ -1337,17 +1310,15 @@ SAL_DLLPUBLIC_EXPORT void lok_doc_view_post_key(GtkWidget* /*pWidget*/, GdkEvent
pDocView->m_pImpl->signalKey(pEvent);
}
-SAL_DLLPUBLIC_EXPORT void lok_doc_view_get_visarea(LOKDocView* pThis, GdkRectangle* pArea)
+SAL_DLLPUBLIC_EXPORT float lok_doc_view_pixel_to_twip(LOKDocView* pDocView, float fInput)
{
-#if GTK_CHECK_VERSION(2,14,0) // we need gtk_adjustment_get_page_size()
- float zoom = pThis->m_pImpl->m_fZoom;
- GtkAdjustment* pHAdjustment = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(pThis));
- pArea->x = pixelToTwip(gtk_adjustment_get_value(pHAdjustment),zoom);
- pArea->width = pixelToTwip(gtk_adjustment_get_page_size(pHAdjustment), zoom);
- GtkAdjustment* pVAdjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(pThis));
- pArea->y = pixelToTwip(gtk_adjustment_get_value(pVAdjustment), zoom);
- pArea->height = pixelToTwip(gtk_adjustment_get_page_size(pVAdjustment), zoom);
-#endif
+ return pixelToTwip(fInput, pDocView->m_pImpl->m_fZoom);
}
+SAL_DLLPUBLIC_EXPORT float lok_doc_view_twip_to_pixel(LOKDocView* pDocView, float fInput)
+{
+ return twipToPixel(fInput, pDocView->m_pImpl->m_fZoom);
+}
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 35fe915b7cf508356a88897d520b89fc986407fb
Author: Philippe Jung <phil.jung at free.fr>
Date: Wed Jun 10 15:47:52 2015 +0200
Fix sd ID conflicts and duplicates
Fix the following cases:
- two names for same ID in sd/inc/app.hrc. Two ID defined.
- ID defined in include/sfx2/sfxsids.hrc and redefined in
sd/inc/app.hrc. Only the sfx2 ID is kept
- ID defined in include/svx/svxids.hrc and redefined in
sd/inc/app.hrc. Only the svx ID is kept
Change-Id: I21c7c25cb6db3c43ea2f9aac5aac75fabe61eaf0
Reviewed-on: https://gerrit.libreoffice.org/16209
Reviewed-by: Philippe Jung <phil.jung at free.fr>
Tested-by: Philippe Jung <phil.jung at free.fr>
diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc
index 4f3d82e..747a95d 100644
--- a/sd/inc/app.hrc
+++ b/sd/inc/app.hrc
@@ -63,66 +63,74 @@
#define HID_SD_CELL_STYLE_LAST_COLUMN (HID_SD_START + 199)
#define SID_PAGESETUP (SID_SD_START+2)
+ // FREE
#define SID_COPYOBJECTS (SID_SD_START+4)
#define SID_MANAGE_LINKS (SID_SD_START+5)
+ // FREE
#define SID_CONVERT_TO_3D_LATHE (SID_SD_START+8)
#define SID_DRAWINGMODE (SID_SD_START+9)
#define SID_OUTLINEMODE (SID_SD_START+10)
#define SID_DIAMODE (SID_SD_START+11)
+ // FREE
#define SID_INSERTPAGE (SID_SD_START+14)
#define SID_INSERTFILE (SID_SD_START+15)
#define SID_INSERTSYMBOL (SID_SD_START+16)
#define SID_ZOOM_PANNING (SID_SD_START+17)
#define SID_PRESENTATION_END (SID_SD_START+18)
+ // FREE
#define SID_POSITION (SID_SD_START+22)
#define SID_MIRROR (SID_SD_START+23)
#define SID_CONVERT (SID_SD_START+24)
+ // FREE
#define SID_COMBINE (SID_SD_START+26)
#define SID_NAME_GROUP (SID_SD_START+27)
#define SID_DRAWTBX_CONNECTORS (SID_SD_START+28)
#define SID_TEXTALIGNMENT (SID_SD_START+29)
-#define SID_BEZIER_ELIMINATE_POINTS (SID_SD_START+30)
+// In svxids.hrc: SID_BEZIER_ELIMINATE_POINTS (SID_SD_START+30)
#define SID_MOREFRONT (SID_SD_START+31)
#define SID_MOREBACK (SID_SD_START+32)
-
// #i68101#
#define SID_OBJECT_TITLE_DESCRIPTION (SID_SD_START+33)
-
#define SID_VERTICAL (SID_SD_START+34)
#define SID_HORIZONTAL (SID_SD_START+35)
#define SID_CHANGEBEZIER (SID_SD_START+36)
#define SID_CHANGEPOLYGON (SID_SD_START+37)
#define SID_CAPTUREPOINT (SID_SD_START+38)
-#define SID_RULER (SID_SD_START+40)
-#define SID_INSERTLAYER (SID_SD_START+43)
-#define SID_EDIT_OUTLINER (SID_SD_START+44)
-#define SID_SWITCHPAGE (SID_SD_START+45)
-#define SID_MODIFYPAGE (SID_SD_START+46)
-#define SID_SWITCHLAYER (SID_SD_START+47)
-#define SID_MODIFYLAYER (SID_SD_START+48)
-#define SID_PAGEMODE (SID_SD_START+49)
-#define SID_LAYERMODE (SID_SD_START+50)
-#define SID_DRAW_MEASURELINE (SID_SD_START+51)
-#define SID_STARTAPP (SID_SD_START+52)
-#define SID_MASTERPAGE (SID_SD_START+53)
-#define SID_TOOL_CONNECTOR (SID_SD_START+58)
+#define SID_INSERTLAYER (SID_SD_START+39)
+// In svxids.hrc: SID_RULER (SID_SD_START+40)
+#define SID_EDIT_OUTLINER (SID_SD_START+41)
+#define SID_SWITCHPAGE (SID_SD_START+42)
+#define SID_MODIFYPAGE (SID_SD_START+43)
+#define SID_SWITCHLAYER (SID_SD_START+44)
+#define SID_MODIFYLAYER (SID_SD_START+45)
+#define SID_PAGEMODE (SID_SD_START+46)
+#define SID_LAYERMODE (SID_SD_START+47)
+#define SID_DRAW_MEASURELINE (SID_SD_START+48)
+#define SID_STARTAPP (SID_SD_START+49)
+#define SID_MASTERPAGE (SID_SD_START+50)
+ // FREE
+#define SID_TOOL_CONNECTOR (SID_SD_START+61)
#define SID_ANIMATION_OBJECTS (SID_SD_START+62)
#define SID_ANIMATION_EFFECTS (SID_SD_START+63)
#define SID_PRESENTATION_LAYOUT (SID_SD_START+64)
-#define SID_BEZIER_CONVERT (SID_SD_START+65)
-#define SID_BEZIER_EDGE (SID_SD_START+66)
-#define SID_BEZIER_SYMMTR (SID_SD_START+67)
+// In svxids.hrc: SID_BEZIER_CONVERT (SID_SD_START+65)
+// In svxids.hrc: SID_BEZIER_EDGE (SID_SD_START+66)
+// In svxids.hrc: SID_BEZIER_SYMMTR (SID_SD_START+67)
#define SID_PRESENTATION_TEMPLATES (SID_SD_START+68)
#define SID_NOTESMODE (SID_SD_START+69)
#define SID_HANDOUTMODE (SID_SD_START+70)
#define SID_LINEEND_POLYGON (SID_SD_START+71)
+ // FREE
#define SID_GRAPHIC_EXPORT (SID_SD_START+73)
#define SID_SWITCH_POINTEDIT (SID_SD_START+74)
-#define SID_TEXTEDIT (SID_SD_START+76)
+ // FREE
+// In svxids.hrc: SID_TEXTEDIT (SID_SD_START+76)
#define SID_SET_SNAPITEM (SID_SD_START+77)
+ // FREE
#define SID_DELETE_PAGE (SID_SD_START+80)
#define SID_DELETE_LAYER (SID_SD_START+81)
#define SID_DISMANTLE (SID_SD_START+82)
+ // FREE
#define SID_STATUS_PAGE (SID_SD_START+86)
#define SID_STATUS_LAYOUT (SID_SD_START+87)
#define SID_STATUS_SELMODE (SID_SD_START+88)
@@ -133,14 +141,15 @@
#define SID_CONNECT (SID_SD_START+93)
#define SID_BREAK (SID_SD_START+94)
#define SID_OBJECT_CHOOSE_MODE (SID_SD_START+95)
-#define SID_ENTER_GROUP (SID_SD_START+96)
-#define SID_LEAVE_GROUP (SID_SD_START+97)
-#define SID_SIZE_PAGE_WIDTH (SID_SD_START+98)
+// In svxids.hrc: SID_ENTER_GROUP (SID_SD_START+96)
+// In svxids.hrc: SID_LEAVE_GROUP (SID_SD_START+97)
+// In svxids.hrc: SID_SIZE_PAGE_WIDTH (SID_SD_START+98)
#define SID_SIZE_OPTIMAL (SID_SD_START+99)
#define SID_OBJECT_TRANSPARENCE (SID_SD_START+100)
#define SID_OBJECT_GRADIENT (SID_SD_START+101)
-#define SID_INSERT_IMAGE (SID_SD_START+105)
-#define SID_INSERT_MATH (SID_SD_START+106)
+ // FREE
+// In svxids.hrc: SID_INSERT_IMAGE (SID_SD_START+105)
+// In svxids.hrc: SID_INSERT_MATH (SID_SD_START+106)
#define SID_OBJECT_SHEAR (SID_SD_START+107)
#define SID_DELETE_SNAPITEM (SID_SD_START+108)
#define SID_OBJECT_CLOSE (SID_SD_START+109)
@@ -148,11 +157,11 @@
#define SID_ANIMATOR_CREATE (SID_SD_START+111)
#define SID_ANIMATOR_STATE (SID_SD_START+112)
#define SID_PRESENTATIONOBJECT (SID_SD_START+113)
-#define SID_SIZE_VISAREA (SID_SD_START+114)
-#define SID_CLEAR_UNDO_STACK (SID_SD_START+115)
-#define SID_BEHIND_OBJ (SID_SD_START+116)
+// In svxids.hrc: SID_SIZE_VISAREA (SID_SD_START+114)
+// In svxids.hrc: SID_ATTR_SYMBOLTYPE (SID_SD_START+115)
+// In svxids.hrc: SID_ATTR_SYMBOLSIZE (SID_SD_START+116)
#define SID_REVERSE_ORDER (SID_SD_START+117)
-
+#define SID_CLEAR_UNDO_STACK (SID_SD_START+118)
#define SID_CONNECTOR_ARROW_START (SID_SD_START+119)
#define SID_CONNECTOR_ARROW_END (SID_SD_START+120)
#define SID_CONNECTOR_ARROWS (SID_SD_START+121)
@@ -180,17 +189,19 @@
#define SID_CONNECTOR_LINES_CIRCLE_START (SID_SD_START+143)
#define SID_CONNECTOR_LINES_CIRCLE_END (SID_SD_START+144)
#define SID_CONNECTOR_LINES_CIRCLES (SID_SD_START+145)
-
+#define SID_BEHIND_OBJ (SID_SD_START+146)
+ // FREE
// Option pane slot IDs
#define SID_SOLID_CREATE (SID_SD_START+151)
#define SID_HELPLINES_USE (SID_SD_START+152)
-#define SID_HELPLINES_MOVE (SID_SD_START+153)
-#define SID_GRID_USE (SID_SD_START+154)
+// In svxids.hrc: SID_HELPLINES_MOVE (SID_SD_START+153)
+// In svxids.hrc: SID_GRID_USE (SID_SD_START+154)
#define SID_SNAP_BORDER (SID_SD_START+155)
#define SID_SNAP_FRAME (SID_SD_START+156)
#define SID_SNAP_POINTS (SID_SD_START+157)
#define SID_QUICKEDIT (SID_SD_START+158)
#define SID_PICK_THROUGH (SID_SD_START+159)
+ // FREE
#define SID_CONVERT_TO_1BIT_THRESHOLD (SID_SD_START+161)
#define SID_CONVERT_TO_1BIT_MATRIX (SID_SD_START+162)
#define SID_CONVERT_TO_4BIT_GRAYS (SID_SD_START+163)
@@ -198,9 +209,9 @@
#define SID_CONVERT_TO_8BIT_GRAYS (SID_SD_START+165)
#define SID_CONVERT_TO_8BIT_COLORS (SID_SD_START+166)
#define SID_CONVERT_TO_24BIT (SID_SD_START+167)
+ // FREE
#define SID_DOUBLECLICK_TEXTEDIT (SID_SD_START+169)
#define SID_CLICK_CHANGE_ROTATION (SID_SD_START+170)
-
#define SID_DRAWTBX_ARROWS (SID_SD_START+171)
#define SID_LINE_ARROW_START (SID_SD_START+172)
#define SID_LINE_ARROW_END (SID_SD_START+173)
@@ -209,22 +220,28 @@
#define SID_LINE_CIRCLE_ARROW (SID_SD_START+176)
#define SID_LINE_ARROW_SQUARE (SID_SD_START+177)
#define SID_LINE_SQUARE_ARROW (SID_SD_START+178)
+#define SID_HELPLINES_VISIBLE (SID_SD_START+179)
+#define SID_HELPLINES_FRONT (SID_SD_START+180)
+#define SID_BEFORE_OBJ (SID_SD_START+181)
+#define SID_PREVIEW_WIN (SID_SD_START+182)
+#define SID_CUSTOM_ANIMATION_PANEL (SID_SD_START+183)
+ // FREE
// and even more...
#define ID_VAL_ENDINTENS (SID_SD_START+197)
#define ID_VAL_STARTINTENS (SID_SD_START+198)
#define ID_VAL_BORDER (SID_SD_START+199)
-#define ID_VAL_MOUSESTART_X (SID_SD_START+200)
-#define ID_VAL_MOUSESTART_Y (SID_SD_START+201)
-#define ID_VAL_LENGTH_X (SID_SD_START+202)
-#define ID_VAL_LENGTH_Y (SID_SD_START+203)
-#define ID_VAL_MOUSEEND_X (SID_SD_START+204)
-#define ID_VAL_MOUSEEND_Y (SID_SD_START+205)
-#define ID_VAL_AXIS_X (SID_SD_START+206)
-#define ID_VAL_AXIS_Y (SID_SD_START+207)
-#define ID_VAL_ANGLESTART (SID_SD_START+208)
-#define ID_VAL_ANGLEEND (SID_SD_START+209)
-#define ID_VAL_CENTER_X (SID_SD_START+210)
-#define ID_VAL_CENTER_Y (SID_SD_START+211)
+// In svxids.hrc: ID_VAL_MOUSESTART_X (SID_SD_START+200)
+// In svxids.hrc: ID_VAL_MOUSESTART_Y (SID_SD_START+201)
+// In svxids.hrc: ID_VAL_LENGTH_X (SID_SD_START+202)
+// In svxids.hrc: ID_VAL_LENGTH_Y (SID_SD_START+203)
+// In svxids.hrc: ID_VAL_MOUSEEND_X (SID_SD_START+204)
+// In svxids.hrc: ID_VAL_MOUSEEND_Y (SID_SD_START+205)
+// In svxids.hrc: ID_VAL_AXIS_X (SID_SD_START+206)
+// In svxids.hrc: ID_VAL_AXIS_Y (SID_SD_START+207)
+// In svxids.hrc: ID_VAL_ANGLESTART (SID_SD_START+208)
+// In svxids.hrc: ID_VAL_ANGLEEND (SID_SD_START+209)
+// In svxids.hrc: ID_VAL_CENTER_X (SID_SD_START+210)
+// In svxids.hrc: ID_VAL_CENTER_Y (SID_SD_START+211)
#define ID_VAL_WHATPAGE (SID_SD_START+212)
#define ID_VAL_WHATLAYER (SID_SD_START+213)
#define ID_VAL_ANGLE (SID_SD_START+214)
@@ -232,6 +249,7 @@
#define ID_VAL_ISACTIVE (SID_SD_START+216)
#define ID_VAL_WHATKIND (SID_SD_START+217)
#define ID_VAL_PAGEWIDTH (SID_SD_START+218)
+ // FREE
#define ID_VAL_PAGETOP (SID_SD_START+220)
#define ID_VAL_PAGEBOTTOM (SID_SD_START+221)
#define ID_VAL_PAGELEFT (SID_SD_START+222)
@@ -242,7 +260,9 @@
#define ID_VAL_ISPAGEBACK (SID_SD_START+227)
#define ID_VAL_ISPAGEOBJ (SID_SD_START+228)
#define ID_VAL_LAYERNAME (SID_SD_START+229)
-#define ID_VAL_ISVISIBLE (SID_SD_START+230)
+
+// just for tests, namely that APP:HRC ff. has not to be build every time
+// In sfxsids.hrc: ID_VAL_DUMMY0 (SID_SD_START+230)
#define ID_VAL_ISLOCKED (SID_SD_START+231)
#define ID_VAL_ISPRINTABLE (SID_SD_START+232)
#define ID_VAL_PAGEHEIGHT (SID_SD_START+233)
@@ -252,33 +272,25 @@
#define ID_VAL_RED (SID_SD_START+237)
#define ID_VAL_GREEN (SID_SD_START+238)
#define ID_VAL_BLUE (SID_SD_START+239)
-#define ID_VAL_STYLE (SID_SD_START+240)
-#define ID_VAL_DOTS (SID_SD_START+241)
-#define ID_VAL_DOTLEN (SID_SD_START+242)
-#define ID_VAL_DASHES (SID_SD_START+243)
-#define ID_VAL_DASHLEN (SID_SD_START+244)
-#define ID_VAL_DISTANCE (SID_SD_START+245)
-#define ID_VAL_INDEX (SID_SD_START+246)
+// In svxids.hrc: ID_VAL_STYLE (SID_SD_START+240)
+// In svxids.hrc: ID_VAL_DOTS (SID_SD_START+241)
+// In svxids.hrc: ID_VAL_DOTLEN (SID_SD_START+242)
+// In svxids.hrc: ID_VAL_DASHES (SID_SD_START+243)
+// In svxids.hrc: ID_VAL_DASHLEN (SID_SD_START+244)
+// In svxids.hrc: ID_VAL_DISTANCE (SID_SD_START+245)
+// In svxids.hrc: ID_VAL_INDEX (SID_SD_START+246)
#define ID_VAL_WIDTH (SID_SD_START+247)
-
-// just for tests, namely that APP:HRC ff. has not to be build every time
-#define ID_VAL_DUMMY0 (SID_SD_START+230)
-#define ID_VAL_DUMMY1 (SID_SD_START+231)
-#define ID_VAL_DUMMY2 (SID_SD_START+232)
-#define ID_VAL_DUMMY3 (SID_SD_START+233)
-#define ID_VAL_DUMMY4 (SID_SD_START+234)
-#define ID_VAL_DUMMY5 (SID_SD_START+235)
-#define ID_VAL_DUMMY6 (SID_SD_START+236)
-
+#define SID_GRID_FRONT (SID_SD_START+248)
+#define ID_VAL_ISVISIBLE (SID_SD_START+249)
#define SID_MOVETO (SID_SD_START+250)
#define SID_LINETO (SID_SD_START+251)
-#define SID_BEZIERTO (SID_SD_START+252)
+// In svxids.hrc: SID_BEZIERTO (SID_SD_START+252)
#define SID_PAGESIZE (SID_SD_START+253)
#define SID_PAGEMARGIN (SID_SD_START+254)
#define SID_ZOOMING (SID_SD_START+255)
#define SID_SELECTAT (SID_SD_START+256)
#define SID_COLORVIEW (SID_SD_START+257)
-
+ // FREE
#define SID_GETRED (SID_SD_START+259)
#define SID_GETBLUE (SID_SD_START+260)
#define SID_GETGREEN (SID_SD_START+261)
@@ -287,7 +299,7 @@
#define SID_GRADIENT (SID_SD_START+264)
#define SID_SETLINESTYLE (SID_SD_START+265)
#define SID_SETLINEWIDTH (SID_SD_START+266)
-#define SID_DASH (SID_SD_START+267)
+// In svxids.hrc: SID_DASH (SID_SD_START+267)
#define SID_RENAMEPAGE (SID_SD_START+268)
#define SID_RENAMELAYER (SID_SD_START+269)
#define SID_HATCH (SID_SD_START+270)
@@ -305,10 +317,11 @@
#define SID_ORIGINAL_SIZE (SID_SD_START+282)
#define SID_PAGES_PER_ROW (SID_SD_START+284)
#define SID_TEXT_FITTOSIZE (SID_SD_START+285)
-#define SID_TEXT_FITTOSIZE_VERTICAL (SID_SD_START+286)
+// In svxids.hrc: SID_TEXT_FITTOSIZE_VERTICAL (SID_SD_START+286)
#define SID_NAVIGATOR_PAGENAME (SID_SD_START+287)
#define SID_NAVIGATOR_STATE (SID_SD_START+288)
#define SID_NAVIGATOR_INIT (SID_SD_START+289)
+ // FREE
#define SID_NAVIGATOR_PEN (SID_SD_START+291)
#define SID_NAVIGATOR_PAGE (SID_SD_START+292)
#define SID_NAVIGATOR_OBJECT (SID_SD_START+293)
@@ -339,17 +352,21 @@
#define SID_DRAWTBX_INSERT (SID_SD_START+318)
#define SID_POLYGON_MORPHING (SID_SD_START+319)
#define SID_MEASURE_DLG (SID_SD_START+320)
-#define SID_GRID_VISIBLE (SID_SD_START+322)
-#define SID_GRID_FRONT (SID_SD_START+323)
-#define SID_HELPLINES_VISIBLE (SID_SD_START+324)
-#define SID_HELPLINES_FRONT (SID_SD_START+325)
-#define SID_BEFORE_OBJ (SID_SD_START+326)
-#define SID_PREVIEW_WIN (SID_SD_START+327)
-#define SID_CUSTOM_ANIMATION_PANEL (SID_SD_START+328)
+ // FREE
+// In svxids.hrc: SID_GRID_VISIBLE (SID_SD_START+322)
+// In svxids.hrc: ID_VAL_USEFIRSTROWSTYLE (SID_SD_START+323)
+// In svxids.hrc: ID_VAL_USELASTROWSTYLE (SID_SD_START+324)
+// In svxids.hrc: ID_VAL_USEBANDINGROWSTYLE (SID_SD_START+325)
+// In svxids.hrc: ID_VAL_USEFIRSTCOLUMNSTYLE (SID_SD_START+326)
+// In svxids.hrc: ID_VAL_USELASTCOLUMNSTYLE (SID_SD_START+327)
+// In svxids.hrc: ID_VAL_USEBANDINGCOLUMNSTYLE (SID_SD_START+328)
+
+
#define SID_PREVIEW_STATE (SID_SD_START+329)
+ // FREE
#define SID_CUSTOM_ANIMATION_SCHEMES_PANEL (SID_SD_START+333)
#define SID_SLIDE_TRANSITIONS_PANEL (SID_SD_START+334)
-// free
+ // FREE
#define SID_PHOTOALBUM (SID_SD_START+336)
#define SID_REMOTE_DLG (SID_SD_START+337)
#define SID_CONNECTION_DLG (SID_SD_START+338)
@@ -360,13 +377,13 @@
#define SID_EXPAND_PAGE (SID_SD_START+343)
#define SID_SUMMARY_PAGE (SID_SD_START+344)
#define SID_LEAVE_ALL_GROUPS (SID_SD_START+345)
-// free
+ // FREE
#define SID_SLIDE_MASTERPAGE (SID_SD_START+348)
#define SID_HANDOUT_MASTERPAGE (SID_SD_START+349)
#define SID_NOTES_MASTERPAGE (SID_SD_START+350)
#define SID_TITLE_MASTERPAGE (SID_SD_START+351)
#define SID_INSERTPAGE_QUICK (SID_SD_START+352)
-// free
+ // FREE
#define SID_INSERT_FLD_PAGE_TITLE (SID_SD_START+356)
#define SID_INSERT_FLD_DATE_VAR (SID_SD_START+357)
#define SID_INSERT_FLD_DATE_FIX (SID_SD_START+358)
@@ -377,58 +394,59 @@
#define SID_INSERT_FLD_FILE (SID_SD_START+363)
#define SID_INSERT_FLD_AUTHOR (SID_SD_START+364)
#define SID_CUSTOMSHOW_DLG (SID_SD_START+365)
-
#define SID_OUTPUT_QUALITY_COLOR (SID_SD_START+366)
#define SID_OUTPUT_QUALITY_GRAYSCALE (SID_SD_START+367)
#define SID_OUTPUT_QUALITY_BLACKWHITE (SID_SD_START+368)
#define SID_PREVIEW_QUALITY_COLOR (SID_SD_START+369)
+ // FREE
#define SID_VECTORIZE (SID_SD_START+372)
-
#define SID_INSERT_FLD_PAGES (SID_SD_START+373)
-
+ // FREE
#define SID_CONVERT_TO_BITMAP (SID_SD_START+378)
#define SID_CONVERT_TO_METAFILE (SID_SD_START+379)
-
#define SID_PACKNGO (SID_SD_START+380)
-
#define SID_CONVERT_TO_CONTOUR (SID_SD_START+381)
-
#define SID_EDIT_HYPERLINK (SID_SD_START+382)
-
+#define ID_VAL_DUMMY1 (SID_SD_START+383)
+#define ID_VAL_DUMMY2 (SID_SD_START+384)
+#define ID_VAL_DUMMY3 (SID_SD_START+385)
+#define ID_VAL_DUMMY4 (SID_SD_START+386)
+#define ID_VAL_DUMMY5 (SID_SD_START+387)
+#define ID_VAL_DUMMY6 (SID_SD_START+388)
+ // FREE
#define SID_OUTPUT_QUALITY_CONTRAST (SID_SD_START+400)
#define SID_PREVIEW_QUALITY_CONTRAST (SID_SD_START+401)
-
+ // FREE
#define SID_RENAMEPAGE_QUICK (SID_SD_START+405)
-
#define SID_SWITCH_SHELL (SID_SD_START+406)
-
#define SID_HEADER_AND_FOOTER (SID_SD_START+407)
#define SID_MASTER_LAYOUTS (SID_SD_START+408)
-
+ // FREE
#define SID_INSERT_PAGE_NUMBER (SID_SD_START+411)
#define SID_INSERT_DATE_TIME (SID_SD_START+412)
-
#define SID_SDMODE_FLAG (SID_SD_START+413)
+// Enum in the middle of IDs...
#define SD_DRAW_MODE 1
#define SD_IMPRESS_MODE 2
#define SID_LEFT_PANE_IMPRESS (SID_SD_START+414)
#define SID_LEFT_PANE_DRAW (SID_SD_START+415)
- // FREE
+ // FREE
#define SID_NOTES_WINDOW (SID_SD_START+417)
#define SID_SWITCH_SHELL_PANE (SID_SD_START+418)
+ // FREE
#define SID_NORMAL_MULTI_PANE_GUI (SID_SD_START+420)
#define SID_SLIDE_SORTER_MULTI_PANE_GUI (SID_SD_START+421)
#define SID_SELECT_BACKGROUND (SID_SD_START+422)
-
+ // FREE
// Slots for the tool pane popup
#define SID_TP_APPLY_TO_ALL_SLIDES (SID_SD_START+425)
#define SID_TP_APPLY_TO_SELECTED_SLIDES (SID_SD_START+426)
#define SID_TP_USE_FOR_NEW_PRESENTATIONS (SID_SD_START+427)
#define SID_TP_SHOW_LARGE_PREVIEW (SID_SD_START+428)
#define SID_TP_SHOW_SMALL_PREVIEW (SID_SD_START+429)
-// SID_SD_START+430 is unused
+ // FREE
#define SID_INSERT_MASTER_PAGE (SID_SD_START+431)
#define SID_DELETE_MASTER_PAGE (SID_SD_START+432)
#define SID_RENAME_MASTER_PAGE (SID_SD_START+433)
@@ -445,7 +463,7 @@
#define SID_ADD_MOTION_PATH (SID_SD_START+442)
#define SID_TABLE_TOOLBOX (SID_SD_START+443)
-// free
+ // FREE
#define SID_ZOOM_MODE (SID_SD_START+447)
#define SID_HIDE_LAST_LEVEL (SID_SD_START+448)
#define SID_SHOW_NEXT_LEVEL (SID_SD_START+449)
diff --git a/sd/source/ui/func/fusnapln.cxx b/sd/source/ui/func/fusnapln.cxx
index 2ae7004..4014137 100644
--- a/sd/source/ui/func/fusnapln.cxx
+++ b/sd/source/ui/func/fusnapln.cxx
@@ -21,6 +21,7 @@
#include <svl/aeitem.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/request.hxx>
+#include <svx/svxids.hrc>
#include "strings.hrc"
commit 342d84218c17da40d0a4f96bc3b07b536d64517a
Author: Jan Holesovsky <kendy at collabora.com>
Date: Wed Jun 10 15:01:15 2015 +0200
sc tiled editing: Mapping has to be turned off after drawing the buttons.
Otherwise the redlines are on wrong positions in the tiled rendering case.
Also - we are actually never call with something else than MAP_PIXEL, so
let's kill the resetting of the mapmode; let's see if some obscure corner case
bites us here.
Change-Id: I8da07dd5448b8863df3148882ec50e6746760cca
diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx
index 90d8783..f020024 100644
--- a/sc/source/ui/cctrl/dpcontrol.cxx
+++ b/sc/source/ui/cctrl/dpcontrol.cxx
@@ -95,11 +95,6 @@ void ScDPFieldButton::setPopupLeft(bool b)
void ScDPFieldButton::draw()
{
- bool bOldMapEnabled = mpOutDev->IsMapModeEnabled();
-
- if (mpOutDev->GetMapMode().GetMapUnit() != MAP_PIXEL )
- mpOutDev->EnableMapMode(false);
-
if (mbBaseButton)
{
// Background
@@ -146,8 +141,6 @@ void ScDPFieldButton::draw()
if (mbPopupButton)
drawPopupButton();
-
- mpOutDev->EnableMapMode(bOldMapEnabled);
}
void ScDPFieldButton::getPopupBoundingBox(Point& rPos, Size& rSize) const
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index c8f234b..a5042cd 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -763,6 +763,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
aOutputData.DrawStrings(true); // in logic MapMode if bLogicText is set
aOutputData.DrawEdit(true);
+ // the buttons are painted in absolute coordinates
if (bIsTiledRendering)
{
// Tiled offset nScrX, nScrY
@@ -777,6 +778,8 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
DrawButtons(nX1, nX2, rTableInfo, pContentDev); // Pixel
+ pContentDev->SetMapMode(MAP_PIXEL);
+
aOutputData.DrawClipMarks();
// Szenario / ChangeTracking muss auf jeden Fall nach DrawGrid sein, auch bei !bGridFirst
commit 54253f382e77483b2831af82cf90e2afb0cd55db
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Jun 10 15:24:18 2015 +0200
Ensure single RTTI symbol instance
...to make typeid comparison in sw::UnoCursorPointer::SwClientNotify work also
under the Itanium C++ ABI/libc++ semantics (as used on Mac OS X), not only the
less strict GCC/libstc++ semantics (as typically used on Linux). This caused
CppunitTest_sw_uiwriter's testUnoCursorPointer to fail on Mac OS X.
(DocDisposingHint and LegacyModifyHint need to be SW_DLLPUBLIC even though they
are nominally only used inside the sw library, because they are also used from
the CppunitTest_sw_uiwriter test code.)
Change-Id: Ideceade22ca3049ae287aea468de93c72bee5fdc
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index ce8bd7a..db28e0b 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -65,9 +65,10 @@ template<typename E, typename S> class SwIterator;
namespace sw
{
class ClientIteratorBase;
- struct LegacyModifyHint SAL_FINAL: SfxHint
+ struct SW_DLLPUBLIC LegacyModifyHint SAL_FINAL: SfxHint
{
LegacyModifyHint(const SfxPoolItem* pOld, const SfxPoolItem* pNew) : m_pOld(pOld), m_pNew(pNew) {};
+ virtual ~LegacyModifyHint();
const SfxPoolItem* m_pOld;
const SfxPoolItem* m_pNew;
};
diff --git a/sw/inc/unocrsr.hxx b/sw/inc/unocrsr.hxx
index 6f382ef..32006a4 100644
--- a/sw/inc/unocrsr.hxx
+++ b/sw/inc/unocrsr.hxx
@@ -24,9 +24,10 @@
namespace sw
{
- struct DocDisposingHint SAL_FINAL : public SfxHint
+ struct SW_DLLPUBLIC DocDisposingHint SAL_FINAL : public SfxHint
{
- DocDisposingHint() {};
+ DocDisposingHint() {}
+ virtual ~DocDisposingHint();
};
}
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 1545605..57af4a8 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -96,9 +96,7 @@ public:
void testTdf86639();
void testTdf90883TableBoxGetCoordinates();
void testEmbeddedDataSource();
-#if 0
void testUnoCursorPointer();
-#endif
CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward);
@@ -137,9 +135,7 @@ public:
CPPUNIT_TEST(testTdf86639);
CPPUNIT_TEST(testTdf90883TableBoxGetCoordinates);
CPPUNIT_TEST(testEmbeddedDataSource);
-#if 0
CPPUNIT_TEST(testUnoCursorPointer);
-#endif
CPPUNIT_TEST_SUITE_END();
private:
@@ -1030,7 +1026,6 @@ void SwUiWriterTest::testEmbeddedDataSource()
#endif
}
-#if 0
void SwUiWriterTest::testUnoCursorPointer()
{
auto xDocComponent(loadFromDesktop(
@@ -1049,7 +1044,6 @@ void SwUiWriterTest::testUnoCursorPointer()
xDocComponent->dispose();
CPPUNIT_ASSERT(!static_cast<bool>(pCursor));
}
-#endif
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index 127a774..f3a4aa0 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -23,6 +23,7 @@
#include <swcache.hxx>
#include <swfntcch.hxx>
+sw::LegacyModifyHint::~LegacyModifyHint() {}
TYPEINIT0( SwClient );
diff --git a/sw/source/core/unocore/unocrsr.cxx b/sw/source/core/unocore/unocrsr.cxx
index bca0bb7..04f30ce 100644
--- a/sw/source/core/unocore/unocrsr.cxx
+++ b/sw/source/core/unocore/unocrsr.cxx
@@ -25,6 +25,8 @@
#include <rootfrm.hxx>
#include <calbck.hxx>
+sw::DocDisposingHint::~DocDisposingHint() {}
+
IMPL_FIXEDMEMPOOL_NEWDEL( SwUnoCrsr )
SwUnoCrsr::SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing )
commit 172a96e5246c7847313838464c671dccfd564ab8
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Wed Jun 10 15:21:43 2015 +0300
bSwitchOff is always false now
Change-Id: Ic79c0f1cf2816da60962f67c57efb75685d984f1
diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index bbee427..c4befa0 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -265,7 +265,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq)
}
else
{
- mpView->ChangeMarkedObjectsBulletsNumbering( bToggle, nSId == FN_SVX_SET_BULLET, bInMasterView ? 0 : pNumRule, false );
+ mpView->ChangeMarkedObjectsBulletsNumbering( bToggle, nSId == FN_SVX_SET_BULLET, bInMasterView ? 0 : pNumRule );
}
if ( bInMasterView )
{
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index 14a0ab0..d7945c4 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -244,8 +244,7 @@ public:
void ChangeMarkedObjectsBulletsNumbering(
const bool bToggle,
const bool bHandleBullets,
- const SvxNumRule* pNumRule,
- const bool bSwitchOff);
+ const SvxNumRule* pNumRule);
void SetPossibilitiesDirty() { bPossibilitiesDirty = true; }
void SetMoveAllowed( bool bSet ) { bMoveAllowed = bSet; }
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 291accf..b424cf7 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -1326,8 +1326,7 @@ bool View::ShouldToggleOn(
void View::ChangeMarkedObjectsBulletsNumbering(
const bool bToggle,
const bool bHandleBullets,
- const SvxNumRule* pNumRule,
- const bool bSwitchOff )
+ const SvxNumRule* pNumRule )
{
SdrModel* pSdrModel = GetModel();
vcl::Window* pWindow = dynamic_cast< vcl::Window* >(GetFirstOutputDevice());
@@ -1337,9 +1336,7 @@ void View::ChangeMarkedObjectsBulletsNumbering(
const bool bUndoEnabled = pSdrModel->IsUndoEnabled();
SdrUndoGroup* pUndoGroup = bUndoEnabled ? new SdrUndoGroup(*pSdrModel) : 0;
- const bool bToggleOn =
- !bSwitchOff
- && ShouldToggleOn( bToggle, bHandleBullets );
+ const bool bToggleOn = ShouldToggleOn( bToggle, bHandleBullets );
boost::scoped_ptr<SdrOutliner> pOutliner(SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, *pSdrModel));
boost::scoped_ptr<OutlinerView> pOutlinerView(new OutlinerView(pOutliner.get(), pWindow));
commit 71b35212265bb93b10ca35ab964a36e6b6cc552b
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Wed Jun 10 15:15:56 2015 +0300
tdf#88290 Adapt the numbering popup to more than 8 items
The items count of NumberingTypeMgr is limited by 8, but
some languages have more items, so remove that limitation.
Also fix the behavior of the 10th item. The old sidebar
popup had a "None" item, whose id was 10 (defined by
DEFAULT_NONE from include/svx/nbdtmg.hxx), and that causes
now the 10th item to behave as on/off toggle. Since we
don't have a "None" item anymore, get rid of that behavior
completely.
Change-Id: I5546ca637f9951cc093a7bbf8fda11dc35341d4e
diff --git a/include/svx/nbdtmg.hxx b/include/svx/nbdtmg.hxx
index 7695e5c..d400a87 100644
--- a/include/svx/nbdtmg.hxx
+++ b/include/svx/nbdtmg.hxx
@@ -27,7 +27,6 @@
namespace svx { namespace sidebar {
#define DEFAULT_BULLET_TYPES 8
-#define DEFAULT_NONE 10
#define DEFAULT_NUM_VALUSET_COUNT 8
#define DEFAULT_NUMBERING_CACHE_FORMAT_VERSION 0x10
diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index 2ee2ddb..bbee427 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -182,17 +182,12 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq)
sal_uInt16 nIdx = pItem->GetValue();
bool bToggle = false;
- bool bSwitchOff = false;
if( nIdx == (sal_uInt16)0xFFFF )
{
// If the nIdx is (sal_uInt16)0xFFFF, means set bullet status to on/off
nIdx = 1;
bToggle = true;
}
- else if (nIdx == DEFAULT_NONE)
- {
- bSwitchOff = true;
- }
nIdx--;
sal_uInt32 nNumItemId = SID_ATTR_NUMBERING_RULE;
@@ -266,18 +261,11 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq)
if ( pOLV )
{
- if ( bSwitchOff )
- {
- pOLV->SwitchOffBulletsNumbering( true );
- }
- else
- {
- pOLV->ToggleBulletsNumbering( bToggle, nSId == FN_SVX_SET_BULLET, bInMasterView ? 0 : pNumRule );
- }
+ pOLV->ToggleBulletsNumbering( bToggle, nSId == FN_SVX_SET_BULLET, bInMasterView ? 0 : pNumRule );
}
else
{
- mpView->ChangeMarkedObjectsBulletsNumbering( bToggle, nSId == FN_SVX_SET_BULLET, bInMasterView ? 0 : pNumRule, bSwitchOff );
+ mpView->ChangeMarkedObjectsBulletsNumbering( bToggle, nSId == FN_SVX_SET_BULLET, bInMasterView ? 0 : pNumRule, false );
}
if ( bInMasterView )
{
diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index a5183c1..f92c0f0 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -577,9 +577,6 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
boost::scoped_ptr<SvxNumRule> pNumRule;
const SfxPoolItem* pTmpItem=NULL;
sal_uInt16 nNumItemId = SID_ATTR_NUMBERING_RULE;
-
- rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,DEFAULT_NONE));
- rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,DEFAULT_NONE));
sal_uInt16 nActNumLvl = mpDrawView->GetSelectionLevel();
pTmpItem=GetNumBulletItem(aNewAttr, nNumItemId);
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index 6fc1fd7..69384f1 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -1302,7 +1302,7 @@ void NumberingTypeMgr::Init()
{
aNumberings = xDefNum->getDefaultContinuousNumberingLevels( aLocale );
- sal_Int32 nLength = aNumberings.getLength() > DEFAULT_NUM_VALUSET_COUNT ? DEFAULT_NUM_VALUSET_COUNT :aNumberings.getLength();
+ sal_Int32 nLength = aNumberings.getLength();
const Sequence<PropertyValue>* pValuesArr = aNumberings.getConstArray();
for(sal_Int32 i = 0; i < nLength; i++)
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 36bb996..61398c8 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1794,8 +1794,6 @@ void SwTextShell::GetState( SfxItemSet &rSet )
{
SwNumRule* pCurRule = const_cast<SwNumRule*>(GetShell().GetNumRuleAtCurrCrsrPos());
sal_uInt16 nActNumLvl = USHRT_MAX;
- rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,DEFAULT_NONE));
- rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,DEFAULT_NONE));
if( pCurRule )
{
nActNumLvl = GetShell().GetNumLevel();
diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx
index 30bf893..c61382c 100644
--- a/sw/source/uibase/shells/txtnum.cxx
+++ b/sw/source/uibase/shells/txtnum.cxx
@@ -251,45 +251,38 @@ void SwTextShell::ExecSetNumber(SfxRequest &rReq)
if ( pItem != NULL )
{
const sal_uInt16 nChoosenItemIdx = pItem->GetValue();
- if ( nChoosenItemIdx == DEFAULT_NONE )
+ svx::sidebar::NBOTypeMgrBase* pNBOTypeMgr =
+ nSlot == FN_SVX_SET_NUMBER
+ ? svx::sidebar::NBOutlineTypeMgrFact::CreateInstance( svx::sidebar::eNBOType::NUMBERING )
+ : svx::sidebar::NBOutlineTypeMgrFact::CreateInstance( svx::sidebar::eNBOType::BULLETS );
+ if ( pNBOTypeMgr != NULL )
{
- GetShell().DelNumRules();
- }
- else
- {
- svx::sidebar::NBOTypeMgrBase* pNBOTypeMgr =
- nSlot == FN_SVX_SET_NUMBER
- ? svx::sidebar::NBOutlineTypeMgrFact::CreateInstance( svx::sidebar::eNBOType::NUMBERING )
- : svx::sidebar::NBOutlineTypeMgrFact::CreateInstance( svx::sidebar::eNBOType::BULLETS );
- if ( pNBOTypeMgr != NULL )
+ const SwNumRule* pNumRuleAtCurrentSelection = GetShell().GetNumRuleAtCurrentSelection();
+ sal_uInt16 nActNumLvl = USHRT_MAX;
+ if ( pNumRuleAtCurrentSelection != NULL )
{
- const SwNumRule* pNumRuleAtCurrentSelection = GetShell().GetNumRuleAtCurrentSelection();
- sal_uInt16 nActNumLvl = USHRT_MAX;
- if ( pNumRuleAtCurrentSelection != NULL )
+ const sal_uInt16 nLevel = GetShell().GetNumLevel();
+ if ( nLevel < MAXLEVEL )
{
- const sal_uInt16 nLevel = GetShell().GetNumLevel();
- if ( nLevel < MAXLEVEL )
- {
- nActNumLvl = 1 << nLevel;
- }
+ nActNumLvl = 1 << nLevel;
}
- SwNumRule aNewNumRule(
- pNumRuleAtCurrentSelection != NULL ? pNumRuleAtCurrentSelection->GetName() : GetShell().GetUniqueNumRuleName(),
- numfunc::GetDefaultPositionAndSpaceMode() );
- SvxNumRule aNewSvxNumRule = pNumRuleAtCurrentSelection != NULL
- ? pNumRuleAtCurrentSelection->MakeSvxNumRule()
- : aNewNumRule.MakeSvxNumRule();
- // set unit attribute to NB Manager
- SfxItemSet aSet( GetPool(), SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL, 0 );
- aSet.Put( SvxNumBulletItem( aNewSvxNumRule ) );
- pNBOTypeMgr->SetItems( &aSet );
- pNBOTypeMgr->ApplyNumRule( aNewSvxNumRule, nChoosenItemIdx - 1, nActNumLvl );
-
- aNewNumRule.SetSvxRule( aNewSvxNumRule, GetShell().GetDoc() );
- aNewNumRule.SetAutoRule( true );
- const bool bCreateNewList = ( pNumRuleAtCurrentSelection == NULL );
- GetShell().SetCurNumRule( aNewNumRule, bCreateNewList );
}
+ SwNumRule aNewNumRule(
+ pNumRuleAtCurrentSelection != NULL ? pNumRuleAtCurrentSelection->GetName() : GetShell().GetUniqueNumRuleName(),
+ numfunc::GetDefaultPositionAndSpaceMode() );
+ SvxNumRule aNewSvxNumRule = pNumRuleAtCurrentSelection != NULL
+ ? pNumRuleAtCurrentSelection->MakeSvxNumRule()
+ : aNewNumRule.MakeSvxNumRule();
+ // set unit attribute to NB Manager
+ SfxItemSet aSet( GetPool(), SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL, 0 );
+ aSet.Put( SvxNumBulletItem( aNewSvxNumRule ) );
+ pNBOTypeMgr->SetItems( &aSet );
+ pNBOTypeMgr->ApplyNumRule( aNewSvxNumRule, nChoosenItemIdx - 1, nActNumLvl );
+
+ aNewNumRule.SetSvxRule( aNewSvxNumRule, GetShell().GetDoc() );
+ aNewNumRule.SetAutoRule( true );
+ const bool bCreateNewList = ( pNumRuleAtCurrentSelection == NULL );
+ GetShell().SetCurNumRule( aNewNumRule, bCreateNewList );
}
}
}
commit ada6281a5bd74d0ff6ae578d57f39f65b7c25103
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Jun 10 14:40:57 2015 +0200
configure: make the error message for pkg-config on Mac more actionable
Change-Id: Ia7f99123625df28cd5459ee6d488e02b20d386f0
diff --git a/configure.ac b/configure.ac
index 178c663..0595b16 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5079,7 +5079,7 @@ if test $_os = Darwin; then
if test "$enable_bogus_pkg_config" = "yes"; then
AC_MSG_RESULT([yes, user-approved from unknown origin.])
else
- AC_MSG_ERROR([yes, from unknown origin. This *will* break the build. Please remove or hide $PKG_CONFIG])
+ AC_MSG_ERROR([yes, from unknown origin. This *will* break the build. Please modify your PATH variable so that $PKG_CONFIG is no longer found by configure scripts.])
fi
fi
else
commit 4897f10beab678494a7c2dfdc140c424154e9f8c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Jun 10 14:22:26 2015 +0200
SfxObjectShell::CopyStoragesOfUnknownMediaType: still try to copy Base streams
When Base is embedded in a Writer document, we still need this when the
document is saved for the first time after embedding.
Change-Id: I1103da01838abd4ac1b03dc4d44e10db3ce650bc
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 826d024..2c16494 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3484,12 +3484,11 @@ bool SfxObjectShell::CopyStoragesOfUnknownMediaType( const uno::Reference< embed
case SotClipboardFormatId::STARCALC_8:
case SotClipboardFormatId::STARCHART_8:
case SotClipboardFormatId::STARMATH_8:
- case SotClipboardFormatId::STARBASE_8:
break;
default:
{
- OSL_ENSURE( aSubElements[nInd] == "Configurations2" || !xTarget->hasByName( aSubElements[nInd] ),
+ OSL_ENSURE( aSubElements[nInd] == "Configurations2" || nFormat == SotClipboardFormatId::STARBASE_8 || !xTarget->hasByName( aSubElements[nInd] ),
"The target storage is an output storage, the element should not exist in the target!\n" );
if ( !xTarget->hasByName( aSubElements[nInd] ) )
commit 23c467fd7a1932015ef209f9db49acd167fd713f
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Jun 10 14:20:28 2015 +0200
SwDBManager::LoadAndRegisterDataSource: restore lost hunk
Accidently removed in commit f01f31201f9b26b3071ab25f9a5a3a0311ff7423
(SwDBManager: extract StoreEmbeddedDataSource() from registration code,
2015-06-09).
Change-Id: I27e47249b92b8fd19dcd09a1226f5e80184ea8db
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index ccd1372..6dc0bb4 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -2611,6 +2611,12 @@ OUString SwDBManager::LoadAndRegisterDataSource(const DBConnURITypes type, const
uno::Reference<embed::XStorage> xStorage = pDocShell->GetStorage();
SwDBManager::StoreEmbeddedDataSource(xStore, xStorage, aStreamRelPath, aOwnURL);
+
+ // Refer to the sub-storage name in the document settings, so
+ // we can load it again next time the file is imported.
+ uno::Reference<lang::XMultiServiceFactory> xFactory(pDocShell->GetModel(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY);
+ xPropertySet->setPropertyValue("EmbeddedDatabaseName", uno::makeAny(aStreamRelPath));
}
}
xDBContext->registerObject( sFind, xNewInstance );
commit 1ee5e1a17cbd50f84990fb43fac7e8c811e604a9
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Jun 10 13:07:17 2015 +0200
pyuno: remove obsolete LC_NUMERIC to "C" mangling code
The CPython changelog says for version 2.4:
- Python no longer relies on the LC_NUMERIC locale setting to be
the "C" locale; as a result, it no longer tries to prevent changing
the LC_NUMERIC category.
Change-Id: I6d63c4dedca48c99bf81135d69285d9116a19740
diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx
index 309f148..2509997 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -29,7 +29,6 @@
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/bootstrap.hxx>
-#include <locale.h>
#include <typelib/typedescription.hxx>
@@ -982,26 +981,6 @@ Any Runtime::extractUnoException( const PyRef & excType, const PyRef &excValue,
}
-static const char * g_NUMERICID = "pyuno.lcNumeric";
-static ::std::vector< OString > g_localeList;
-
-static const char *ensureUnlimitedLifetime( const char *str )
-{
- int size = g_localeList.size();
- int i;
- for( i = 0 ; i < size ; i ++ )
- {
- if( 0 == strcmp( g_localeList[i].getStr(), str ) )
- break;
- }
- if( i == size )
- {
- g_localeList.push_back( str );
- }
- return g_localeList[i].getStr();
-}
-
-
PyThreadAttach::PyThreadAttach( PyInterpreterState *interp)
throw ( com::sun::star::uno::RuntimeException )
{
@@ -1009,35 +988,18 @@ PyThreadAttach::PyThreadAttach( PyInterpreterState *interp)
if( !tstate )
throw RuntimeException( "Couldn't create a pythreadstate" );
PyEval_AcquireThread( tstate);
- // set LC_NUMERIC to "C"
- const char * oldLocale =
- ensureUnlimitedLifetime( setlocale( LC_NUMERIC, 0 ) );
- setlocale( LC_NUMERIC, "C" );
- PyRef locale( // python requires C locale
- PyLong_FromVoidPtr( const_cast<char *>(oldLocale) ), SAL_NO_ACQUIRE);
- PyDict_SetItemString(
- PyThreadState_GetDict(), g_NUMERICID, locale.get() );
}
PyThreadAttach::~PyThreadAttach()
{
- PyObject *value =
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list