[Libreoffice-commits] core.git: Branch 'feature/gsoc-tiled-rendering' - 315 commits - accessibility/inc accessibility/source avmedia/source basctl/source basic/source bin/find-duplicated-sids.py bin/find-unused-defines.sh bin/find-unused-typedefs.py bin/find-unused-typedefs.sh bin/gbuild-to-ide canvas/Library_gdipluscanvas.mk canvas/source chart2/inc chart2/Library_chartcontroller.mk chart2/source chart2/uiconfig comphelper/source compilerplugins/clang configure.ac connectivity/source cppcanvas/source cui/source dbaccess/inc dbaccess/source desktop/source download.lst drawinglayer/source dtrans/source editeng/qa editeng/source embeddedobj/source embeddedobj/test embedserv/source eventattacher/source extensions/source extensions/test external/boost external/firebird external/glm external/libetonyek external/libmwaw external/libodfgen external/librevenge external/libwpd external/libwpg external/libwps external/neon extras/source filter/source forms/source formula/source fpicker/source framework/inc framework/source .gitignore helpcompiler/inc helpcontent2 hwpfilter/source i18nlangtag/source i18npool/inc i18npool/source idlc/inc idlc/source idl/inc idl/source include/basic include/canvas include/com include/comphelper include/connectivity include/cppcanvas include/dbaccess include/editeng include/filter include/formula include/i18nutil include/o3tl include/oox include/registry include/rtl include/sal include/sfx2 include/sot include/svl include/svtools include/svx include/systools include/toolkit include/tools include/unotest include/unotools include/vcl include/xmloff include/xmlscript instsetoo_native/CustomTarget_setup.mk instsetoo_native/inc_common io/source jurt/com l10ntools/inc l10ntools/source libreofficekit/qa libreofficekit/source lingucomponent/source lotuswordpro/source m4/introspection.m4 offapi/com officecfg/registry onlineupdate/source oox/inc oox/source package/inc package/source postprocess/CustomTarget_registry.mk pyuno/Library_pyuno.mk pyuno/source readlicen se_oo/license reportdesign/source RepositoryExternal.mk rsc/inc rsc/source salhelper/source sal/osl sal/qa sax/qa scaddins/source sc/CppunitTest_sc_core.mk sc/inc sc/Module_sc.mk sc/qa scripting/source sc/sdi sc/source sc/uiconfig sdext/inc sdext/source sd/inc sd/qa sd/source sd/uiconfig sfx2/inc sfx2/source sfx2/uiconfig shell/inc shell/qa shell/source slideshow/inc slideshow/source slideshow/test smoketest/smoketest.cxx solenv/bin solenv/gbuild solenv/gdb sot/source starmath/inc starmath/source stoc/source stoc/test store/source svl/qa svl/source svtools/inc svtools/source svx/Library_svx.mk svx/source sw/inc sw/qa sw/source sw/uiconfig sysui/desktop toolkit/source tools/source ucbhelper/source ucb/source udkapi/com UnoControls/source unodevtools/source unotest/source unoxml/source uui/source vbahelper/source vcl/generic vcl/inc vcl/opengl vcl/osx vcl/source vcl/unx vcl/win vcl/workben wizards/com writerfilter/inc writerfilter/source xmlhelp/source xmloff/inc xmloff/source xmlscri pt/source xmlsecurity/source
Pranav Kant
pranavk at gnome.org
Thu Aug 13 02:06:23 PDT 2015
Rebased ref, commits from common ancestor:
commit 86b5c11ffa17c3ac80b1be3b40a12b46f1fc4751
Author: Pranav Kant <pranavk at gnome.org>
Date: Thu Aug 13 02:08:21 2015 +0530
widget registration
Change-Id: I7455f6b9e3a6145b25bd081dc3a28ac011d02dcd
diff --git a/configure.ac b/configure.ac
index 7b0f031..6742d31 100644
--- a/configure.ac
+++ b/configure.ac
@@ -201,6 +201,11 @@ SRC_ROOT=`pwd`
cd $BUILDDIR
x_Cygwin=[\#]
+dnl ======================================
+dnl Required GObject introspection version
+dnl ======================================
+INTROSPECTION_REQUIRED_VERSION=1.32.0
+
dnl ===================================================================
dnl Search all the common names for GNU Make
dnl ===================================================================
@@ -12105,6 +12110,11 @@ if test "$ENABLE_JAVA" != ""; then
fi
dnl ===================================================================
+dnl Check GObject Introspection
+dnl ===================================================================
+GOBJECT_INTROSPECTION_CHECK(INTROSPECTION_REQUIRED_VERSION)
+
+dnl ===================================================================
dnl Test for the presence of Ant and that it works
dnl ===================================================================
diff --git a/m4/introspection.m4 b/m4/introspection.m4
new file mode 100644
index 0000000..aa7b3b4
--- /dev/null
+++ b/m4/introspection.m4
@@ -0,0 +1,96 @@
+dnl -*- mode: autoconf -*-
+dnl Copyright 2009 Johan Dahlin
+dnl
+dnl This file is free software; the author(s) gives unlimited
+dnl permission to copy and/or distribute it, with or without
+dnl modifications, as long as this notice is preserved.
+dnl
+
+# serial 1
+
+m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
+[
+ AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+ AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+ AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
+
+ dnl enable/disable introspection
+ m4_if([$2], [require],
+ [dnl
+ enable_introspection=yes
+ ],[dnl
+ AC_ARG_ENABLE(introspection,
+ AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
+ [Enable introspection for this build]),,
+ [enable_introspection=auto])
+ ])dnl
+
+ AC_MSG_CHECKING([for gobject-introspection])
+
+ dnl presence/version checking
+ AS_CASE([$enable_introspection],
+ [no], [dnl
+ found_introspection="no (disabled, use --enable-introspection to enable)"
+ ],dnl
+ [yes],[dnl
+ PKG_CHECK_EXISTS([gobject-introspection-1.0],,
+ AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
+ PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
+ found_introspection=yes,
+ AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
+ ],dnl
+ [auto],[dnl
+ PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
+ dnl Canonicalize enable_introspection
+ enable_introspection=$found_introspection
+ ],dnl
+ [dnl
+ AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
+ ])dnl
+
+ AC_MSG_RESULT([$found_introspection])
+
+ INTROSPECTION_SCANNER=
+ INTROSPECTION_COMPILER=
+ INTROSPECTION_GENERATE=
+ INTROSPECTION_GIRDIR=
+ INTROSPECTION_TYPELIBDIR=
+ if test "x$found_introspection" = "xyes"; then
+ INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+ INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+ INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
+ INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
+ INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+ INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
+ INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
+ INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
+ fi
+ AC_SUBST(INTROSPECTION_SCANNER)
+ AC_SUBST(INTROSPECTION_COMPILER)
+ AC_SUBST(INTROSPECTION_GENERATE)
+ AC_SUBST(INTROSPECTION_GIRDIR)
+ AC_SUBST(INTROSPECTION_TYPELIBDIR)
+ AC_SUBST(INTROSPECTION_CFLAGS)
+ AC_SUBST(INTROSPECTION_LIBS)
+ AC_SUBST(INTROSPECTION_MAKEFILE)
+
+ AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
+])
+
+
+dnl Usage:
+dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
+
+AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
+[
+ _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
+])
+
+dnl Usage:
+dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
+
+
+AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
+[
+ _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
+])
diff --git a/sysui/desktop/share/create_tree.sh b/sysui/desktop/share/create_tree.sh
index c6be0bb..04b5202 100755
--- a/sysui/desktop/share/create_tree.sh
+++ b/sysui/desktop/share/create_tree.sh
@@ -87,3 +87,15 @@ for i in base calc draw impress writer; do
cp "${APPDATA_SOURCE_DIR}/libreoffice-${i}.appdata.xml" "${DESTDIR}/${PREFIXDIR}/share/appdata/${PREFIX}-${i}.appdata.xml"
done
+# Generate gobject-introspection files
+mkdir -p "${DESTDIR}/${PREFIXDIR}/share/gir-1.0"
+"${INTROSPECTION_SCANNER}" "${SRCDIR}/include/LibreOfficeKit/LibreOfficeKitGtk.h" "${SRCDIR}/libreofficekit/source/gtk/lokdocview.cxx" \
+ "${INTROSPECTION_CFLAGS}" -I"${SRCDIR}/include/" --include=GLib-2.0 --include=GObject-2.0 --include=Gio-2.0 \
+ --library=libreofficekitgtk --library-path="${INSTALLDIR}/program/libreofficekitgtk" \
+ --include=Gdk-3.0 --include=GdkPixbuf-2.0 --include=Gtk-3.0 \
+ --namespace=LOKDocView --nsversion=0.1 --identifier-prefix=LOKDoc --symbol-prefix=lok_doc \
+ --output="${DESTDIR}/${PREFIXDIR}/share/gir-1.0/LOKDocView-0.1.gir" --warn-all --no-libtool
+
+mkdir -p "${DESTDIR}/${PREFIXDIR}/${LIBDIR}/girepository-1.0"
+"${INTROSPECTION_COMPILER}" "${DESTDIR}/${PREFIXDIR}/share/gir-1.0/LOKDocView-0.1.gir" \
+ --output="${DESTDIR}/${PREFIXDIR}/${LIBDIR}/girepository-1.0/LOKDocView-0.1.typelib"
commit 620d46f94d0065d2f06a1b882cfd6e70ed37f011
Author: Pranav Kant <pranavk at gnome.org>
Date: Sat Aug 8 21:01:20 2015 +0200
wip: bug
Change-Id: I4e144b34804d745bdccf1e454a88349191b92f5a
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 73db976..afc38ba 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -57,6 +57,25 @@ static void lcl_registerToolItem(GtkToolItem* pItem, const std::string& rName)
const float fZooms[] = { 0.25, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0, 5.0 };
+
+/// Get the visible area of the scrolled window
+static void getVisibleAreaTwips(GdkRectangle* pArea)
+{
+#if GTK_CHECK_VERSION(2,14,0) // we need gtk_adjustment_get_page_size()
+ 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));
+#endif
+}
+
static void changeZoom( GtkWidget* pButton, gpointer /* pItem */ )
{
const char *sName = gtk_tool_button_get_icon_name( GTK_TOOL_BUTTON(pButton) );
@@ -175,23 +194,6 @@ static void doCopy(GtkWidget* /*pButton*/, gpointer /*pItem*/)
free(pUsedFormat);
}
-/// Get the visible area of the scrolled window
-static void getVisibleAreaTwips(GdkRectangle* pArea)
-{
-#if GTK_CHECK_VERSION(2,14,0) // we need gtk_adjustment_get_page_size()
- 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));
-#endif
-}
/// Searches for the next or previous text of pFindbarEntry.
static void doSearch(bool bBackwards)
@@ -319,6 +321,31 @@ static void signalHyperlink(LOKDocView* /*pLOKDocView*/, char* pPayload, gpointe
}
}
+/// Cursor position changed
+static void cursorChanged(LOKDocView* pDocView, gint nX, gint nY,
+ gint nWidth, gint nHeight, gpointer /*pData*/)
+{
+ GtkAdjustment* adj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(pScrolledWindow));
+ GdkRectangle visArea;
+ gint x,y,width, height;
+ getVisibleAreaTwips(&visArea);
+ // check vertically
+ if (visArea.y > nY) {
+ y = visArea.y;
+ }
+ if (visArea.y + visArea.height < nY)
+ y = visArea.y;
+ if (visArea.x > nX) {
+ x = visArea.x;
+ }
+ if (visArea.x + visArea.width < nX)
+ x = visArea.x;
+ GtkAdjustment* vadj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(pScrolledWindow));
+ GtkAdjustment* hadj = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(pScrolledWindow));
+ gtk_adjustment_set_value(vadj, lok_doc_view_twip_to_pixel(pDocView, x));
+ gtk_adjustment_set_value(hadj, lok_doc_view_twip_to_pixel(pDocView, y));
+}
+
static void toggleToolItem(GtkWidget* pWidget, gpointer /*pData*/)
{
if (g_bToolItemBroadcast)
@@ -576,6 +603,7 @@ int main( int argc, char* argv[] )
g_signal_connect(pDocView, "part-changed", G_CALLBACK(signalPart), NULL);
g_signal_connect(pDocView, "size-changed", G_CALLBACK(signalSize), NULL);
g_signal_connect(pDocView, "hyperlink-clicked", G_CALLBACK(signalHyperlink), NULL);
+ g_signal_connect(pDocView, "cursor-changed", G_CALLBACK(cursorChanged), NULL);
// Scrolled window for DocView
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 8a2e4a2..a7befaf 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -117,6 +117,7 @@ enum
PART_CHANGED,
SIZE_CHANGED,
HYPERLINK_CLICKED,
+ CURSOR_CHANGED,
LAST_SIGNAL
};
@@ -518,6 +519,11 @@ callback (gpointer pData)
{
priv->m_aVisibleCursor = payloadToRectangle(pDocView, pCallback->m_aPayload.c_str());
priv->m_bCursorOverlayVisible = true;
+ g_signal_emit(pDocView, doc_view_signals[CURSOR_CHANGED], 0,
+ priv->m_aVisibleCursor.x,
+ priv->m_aVisibleCursor.y,
+ priv->m_aVisibleCursor.width,
+ priv->m_aVisibleCursor.height);
gtk_widget_queue_draw(GTK_WIDGET(pDocView));
}
break;
@@ -1743,6 +1749,24 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1,
G_TYPE_STRING);
+
+ /**
+ * LOKDocView::cursor-changed:
+ * @pDocView: the #LOKDocView on which the signal is emitted
+ * @aCursor: The new cursor position in pixels
+ */
+ doc_view_signals[CURSOR_CHANGED] =
+ g_signal_new("cursor-changed",
+ G_TYPE_FROM_CLASS(pGObjectClass),
+ G_SIGNAL_RUN_FIRST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_NONE, 4,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ G_TYPE_INT);
}
/**
commit 326777b5d91a7e269bb4dfa38a3263769e0b99b3
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Sun Aug 9 21:14:53 2015 -0500
remove VERBOSE use from canva
in preparation to kill --enable-verbose in configure.ac
convert modules that use VERBOSE-YES/NO (uppercase) env variable
to do things differently at compile time
Convert canvas to use SAL_INFO/SAL_WARN mechanism instead of its
home-grown 'verbose logging'.
Change-Id: I2898d2309d421457839e3cd7078166c6da919882
Reviewed-on: https://gerrit.libreoffice.org/17619
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
diff --git a/canvas/Library_gdipluscanvas.mk b/canvas/Library_gdipluscanvas.mk
index fdb3927..94efa63 100644
--- a/canvas/Library_gdipluscanvas.mk
+++ b/canvas/Library_gdipluscanvas.mk
@@ -30,12 +30,6 @@ $(eval $(call gb_Library_add_defs,gdipluscanvas,\
-UNOMINMAX \
))
-ifneq ($(strip $(VERBOSE)$(verbose)),)
-$(eval $(call gb_Library_add_defs,gdipluscanvas,\
- -DVERBOSE \
-))
-endif
-
$(eval $(call gb_Library_use_libraries,gdipluscanvas,\
cppu \
tk \
diff --git a/canvas/source/cairo/cairo_canvas.cxx b/canvas/source/cairo/cairo_canvas.cxx
index e27daa2..c8bdca8 100644
--- a/canvas/source/cairo/cairo_canvas.cxx
+++ b/canvas/source/cairo/cairo_canvas.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <tools/diagnose_ex.h>
@@ -66,7 +64,7 @@ namespace cairocanvas
4: XWindow for creating Window (or empty for VirtualDevice)
5: SystemGraphicsData as a streamed Any
*/
- VERBOSE_TRACE("Canvas created %p\n", this);
+ SAL_INFO("canvas.cairo","Canvas created " << this);
ENSURE_ARG_OR_THROW( maArguments.getLength() >= 6 &&
maArguments[0].getValueTypeClass() == uno::TypeClass_HYPER &&
@@ -108,7 +106,7 @@ namespace cairocanvas
Canvas::~Canvas()
{
- OSL_TRACE( "CairoCanvas destroyed" );
+ SAL_INFO("canvas.cairo", "CairoCanvas destroyed" );
}
void Canvas::disposeThis()
diff --git a/canvas/source/cairo/cairo_canvascustomsprite.cxx b/canvas/source/cairo/cairo_canvascustomsprite.cxx
index 1cb6d77..b3d9716 100644
--- a/canvas/source/cairo/cairo_canvascustomsprite.cxx
+++ b/canvas/source/cairo/cairo_canvascustomsprite.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <tools/diagnose_ex.h>
diff --git a/canvas/source/cairo/cairo_devicehelper.cxx b/canvas/source/cairo/cairo_devicehelper.cxx
index a59f257..a093995 100644
--- a/canvas/source/cairo/cairo_devicehelper.cxx
+++ b/canvas/source/cairo/cairo_devicehelper.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <osl/mutex.hxx>
diff --git a/canvas/source/cairo/cairo_services.cxx b/canvas/source/cairo/cairo_services.cxx
index 39a1afd..55bc4d5 100644
--- a/canvas/source/cairo/cairo_services.cxx
+++ b/canvas/source/cairo/cairo_services.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <com/sun/star/registry/XRegistryKey.hpp>
diff --git a/canvas/source/cairo/cairo_spritecanvas.cxx b/canvas/source/cairo/cairo_spritecanvas.cxx
index 87379a8..5f32a27 100644
--- a/canvas/source/cairo/cairo_spritecanvas.cxx
+++ b/canvas/source/cairo/cairo_spritecanvas.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <tools/diagnose_ex.h>
@@ -52,7 +50,7 @@ namespace cairocanvas
void SpriteCanvas::initialize()
{
- VERBOSE_TRACE("CairoSpriteCanvas created %p\n", this);
+ SAL_INFO("canvas.cairo", "CairoSpriteCanvas created " << this);
// #i64742# Only call initialize when not in probe mode
if( maArguments.getLength() == 0 )
diff --git a/canvas/source/cairo/cairo_spritecanvashelper.cxx b/canvas/source/cairo/cairo_spritecanvashelper.cxx
index a07fc1e..6fd8ef9 100644
--- a/canvas/source/cairo/cairo_spritecanvashelper.cxx
+++ b/canvas/source/cairo/cairo_spritecanvashelper.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <tools/diagnose_ex.h>
diff --git a/canvas/source/cairo/cairo_spritedevicehelper.cxx b/canvas/source/cairo/cairo_spritedevicehelper.cxx
index 6c96441..e9bd2f9 100644
--- a/canvas/source/cairo/cairo_spritedevicehelper.cxx
+++ b/canvas/source/cairo/cairo_spritedevicehelper.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <osl/mutex.hxx>
@@ -72,13 +70,13 @@ namespace cairocanvas
bool SpriteDeviceHelper::showBuffer( bool, bool )
{
- OSL_FAIL("Not supposed to be called, handled by SpriteCanvas");
+ SAL_WARN("canvas.cairo", "showBuffer Not supposed to be called, handled by SpriteCanvas");
return false;
}
bool SpriteDeviceHelper::switchBuffer( bool, bool )
{
- OSL_FAIL("Not supposed to be called, handled by SpriteCanvas");
+ SAL_WARN("canvas.cairo", "showBuffer Not supposed to be called, handled by SpriteCanvas");
return false;
}
diff --git a/canvas/source/cairo/cairo_spritehelper.cxx b/canvas/source/cairo/cairo_spritehelper.cxx
index bb06b55..ee76056 100644
--- a/canvas/source/cairo/cairo_spritehelper.cxx
+++ b/canvas/source/cairo/cairo_spritehelper.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <tools/diagnose_ex.h>
#include <rtl/math.hxx>
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index f2f552a..2510729 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -19,8 +19,6 @@
#include <math.h>
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <tools/diagnose_ex.h>
@@ -146,7 +144,7 @@ namespace cairocanvas
if( aAdvancements.getLength() != maText.Length )
{
- OSL_TRACE( "TextLayout::applyLogicalAdvancements(): mismatching number of advancements" );
+ SAL_WARN("canvas.cairo", "TextLayout::applyLogicalAdvancements(): mismatching number of advancements" );
throw lang::IllegalArgumentException();
}
@@ -300,7 +298,7 @@ namespace cairocanvas
// vertical glyph rendering is not supported in cairo for now
if (aSysFontData.bVerticalCharacterType)
{
- OSL_TRACE(":cairocanvas::TextLayout::isCairoRenderable(): ***************** VERTICAL CHARACTER STYLE!!! ****************");
+ SAL_WARN("canvas.cairo", ":cairocanvas::TextLayout::isCairoRenderable(): Vertical Character Style not supported");
return false;
}
@@ -364,13 +362,13 @@ namespace cairocanvas
if( !isCairoRenderable(aFontData.back().first) )
{
bCairoRenderable = false;
- OSL_TRACE(":cairocanvas::TextLayout::draw(S,O,p,v,r): VCL FALLBACK %s%s%s%s - %s",
- maLogicalAdvancements.getLength() ? "ADV " : "",
- aFontData.back().first.bAntialias ? "AA " : "",
- aFontData.back().first.bFakeBold ? "FB " : "",
- aFontData.back().first.bFakeItalic ? "FI " : "",
- OUStringToOString( maText.Text.copy( maText.StartPosition, maText.Length ),
- RTL_TEXTENCODING_UTF8 ).getStr());
+ SAL_INFO("canvas.cairo", ":cairocanvas::TextLayout::draw(S,O,p,v,r): VCL FALLBACK " <<
+ (maLogicalAdvancements.getLength() ? "ADV " : "") <<
+ (aFontData.back().first.bAntialias ? "AA " : "") <<
+ (aFontData.back().first.bFakeBold ? "FB " : "") <<
+ (aFontData.back().first.bFakeItalic ? "FI " : "") <<
+ " - " <<
+ maText.Text.copy( maText.StartPosition, maText.Length));
break;
}
}
@@ -519,7 +517,7 @@ namespace cairocanvas
}
cairo_show_glyphs(pSCairo.get(), &cairo_glyphs[0], cairo_glyphs.size());
}
- OSL_TRACE(":cairocanvas::TextLayout::draw(S,O,p,v,r): FAKEBOLD - dx:%d", (int) bold_dx);
+ SAL_INFO("canvas.cairo",":cairocanvas::TextLayout::draw(S,O,p,v,r): FAKEBOLD - dx:" << (int) bold_dx);
}
cairo_font_face_destroy(font_face);
diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx
index 42c37ac..d18d34a 100644
--- a/canvas/source/directx/dx_9rm.cxx
+++ b/canvas/source/directx/dx_9rm.cxx
@@ -35,8 +35,6 @@
#include <vcl/syschild.hxx>
#include <vcl/window.hxx>
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <tools/diagnose_ex.h>
#include <canvas/elapsedtime.hxx>
@@ -1159,7 +1157,7 @@ namespace dxcanvas
}
default:
- OSL_FAIL("DXRenderModule::pushVertex(): unexpected primitive type");
+ SAL_WARN("canvas.directx", "DXRenderModule::pushVertex(): unexpected primitive type");
break;
}
}
diff --git a/canvas/source/directx/dx_canvas.cxx b/canvas/source/directx/dx_canvas.cxx
index 727d909..ebf370e 100644
--- a/canvas/source/directx/dx_canvas.cxx
+++ b/canvas/source/directx/dx_canvas.cxx
@@ -19,8 +19,6 @@
#include <ctype.h>
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <tools/diagnose_ex.h>
@@ -82,7 +80,7 @@ namespace dxcanvas
if( maArguments.getLength() == 0 )
return;
- VERBOSE_TRACE( "Canvas::initialize called" );
+ SAL_INFO("canvas.directx", "Canvas::initialize called" );
// At index 1, we expect a HWND handle here, containing a
// pointer to a valid window, on which to output
@@ -143,7 +141,7 @@ namespace dxcanvas
if( maArguments.getLength() == 0 )
return;
- VERBOSE_TRACE( "BitmapCanvas::initialize called" );
+ SAL_INFO("canvas.directx", "BitmapCanvas::initialize called" );
// At index 1, we expect a HWND handle here, containing a
// pointer to a valid window, on which to output
diff --git a/canvas/source/directx/dx_canvascustomsprite.cxx b/canvas/source/directx/dx_canvascustomsprite.cxx
index 89e1b9e..7dbe80a 100644
--- a/canvas/source/directx/dx_canvascustomsprite.cxx
+++ b/canvas/source/directx/dx_canvascustomsprite.cxx
@@ -19,8 +19,6 @@
#include <ctype.h>
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <tools/diagnose_ex.h>
diff --git a/canvas/source/directx/dx_devicehelper.cxx b/canvas/source/directx/dx_devicehelper.cxx
index 1894e2d..384d635 100644
--- a/canvas/source/directx/dx_devicehelper.cxx
+++ b/canvas/source/directx/dx_devicehelper.cxx
@@ -21,8 +21,6 @@
#include <ctype.h>
#include <vcl/window.hxx>
#include <vcl/canvastools.hxx>
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <tools/diagnose_ex.h>
diff --git a/canvas/source/directx/dx_impltools.cxx b/canvas/source/directx/dx_impltools.cxx
index 499d921..98a9e49 100644
--- a/canvas/source/directx/dx_impltools.cxx
+++ b/canvas/source/directx/dx_impltools.cxx
@@ -21,8 +21,6 @@
#include <ctype.h>
#include <basegfx/numeric/ftools.hxx>
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <tools/diagnose_ex.h>
#include <com/sun/star/lang/XServiceInfo.hpp>
diff --git a/canvas/source/directx/dx_spritecanvas.cxx b/canvas/source/directx/dx_spritecanvas.cxx
index 3ec2214..d6a0e78 100644
--- a/canvas/source/directx/dx_spritecanvas.cxx
+++ b/canvas/source/directx/dx_spritecanvas.cxx
@@ -19,8 +19,6 @@
#include <ctype.h>
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <tools/diagnose_ex.h>
#include <canvas/canvastools.hxx>
@@ -68,7 +66,7 @@ namespace dxcanvas
if( maArguments.getLength() == 0 )
return;
- VERBOSE_TRACE( "SpriteCanvas::initialize called" );
+ SAL_INFO("canvas.directx", "SpriteCanvas::initialize called" );
/* aArguments:
0: ptr to creating instance (Window or VirtualDevice)
diff --git a/canvas/source/directx/dx_spritecanvashelper.cxx b/canvas/source/directx/dx_spritecanvashelper.cxx
index 6a06c6a..e596805 100644
--- a/canvas/source/directx/dx_spritecanvashelper.cxx
+++ b/canvas/source/directx/dx_spritecanvashelper.cxx
@@ -18,8 +18,6 @@
*/
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <tools/diagnose_ex.h>
diff --git a/canvas/source/directx/dx_spritedevicehelper.cxx b/canvas/source/directx/dx_spritedevicehelper.cxx
index e9d5bb4..6664f23 100644
--- a/canvas/source/directx/dx_spritedevicehelper.cxx
+++ b/canvas/source/directx/dx_spritedevicehelper.cxx
@@ -19,8 +19,6 @@
#include <ctype.h>
#include <vcl/window.hxx>
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <tools/diagnose_ex.h>
@@ -164,13 +162,13 @@ namespace dxcanvas
sal_Bool SpriteDeviceHelper::showBuffer( bool, sal_Bool )
{
- OSL_FAIL("Not supposed to be called, handled by SpriteCanvas");
+ SAL_WARN("canvas.directx", "Not supposed to be called, handled by SpriteCanvas");
return sal_False;
}
sal_Bool SpriteDeviceHelper::switchBuffer( bool, sal_Bool )
{
- OSL_FAIL("Not supposed to be called, handled by SpriteCanvas");
+ SAL_WARN("canvas.directx", "Not supposed to be called, handled by SpriteCanvas");
return sal_False;
}
diff --git a/canvas/source/directx/dx_spritehelper.cxx b/canvas/source/directx/dx_spritehelper.cxx
index 6b45d38..67dd44fe 100644
--- a/canvas/source/directx/dx_spritehelper.cxx
+++ b/canvas/source/directx/dx_spritehelper.cxx
@@ -18,8 +18,6 @@
*/
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <tools/diagnose_ex.h>
#include <rtl/math.hxx>
@@ -123,9 +121,8 @@ namespace dxcanvas
// background buffer.
// log output pos in device pixel
- VERBOSE_TRACE( "SpriteHelper::redraw(): output pos is (%f, %f)",
- rPos.getX(),
- rPos.getY() );
+ SAL_INFO("canva.directx", "SpriteHelper::redraw(): output pos is (" <<
+ rPos.getX() << "," << rPos.getY() << ")" );
const double fAlpha( getAlpha() );
const ::basegfx::B2DVector& rSize( getSizePixel() );
diff --git a/canvas/source/directx/dx_textlayout.cxx b/canvas/source/directx/dx_textlayout.cxx
index 016a330..3ff3e43 100644
--- a/canvas/source/directx/dx_textlayout.cxx
+++ b/canvas/source/directx/dx_textlayout.cxx
@@ -19,8 +19,6 @@
#include <ctype.h>
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
@@ -93,7 +91,7 @@ namespace dxcanvas
if( aAdvancements.getLength() != maText.Length )
{
- OSL_TRACE( "TextLayout::applyLogicalAdvancements(): mismatching number of advancements" );
+ SAL_WARN("canvas.directx", "TextLayout::applyLogicalAdvancements(): mismatching number of advancements" );
throw lang::IllegalArgumentException();
}
diff --git a/canvas/source/directx/dx_vcltools.cxx b/canvas/source/directx/dx_vcltools.cxx
index 92b1a2d..ace75a2 100644
--- a/canvas/source/directx/dx_vcltools.cxx
+++ b/canvas/source/directx/dx_vcltools.cxx
@@ -18,18 +18,16 @@
*/
-#include <vcl/canvastools.hxx>
+#include <tools/diagnose_ex.h>
+#include <vcl/canvastools.hxx>
#include <vcl/bitmap.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/bmpacc.hxx>
-#include <tools/diagnose_ex.h>
#include "dx_impltools.hxx"
-#include <basegfx/numeric/ftools.hxx>
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
+#include <basegfx/numeric/ftools.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/rendering/XIntegerBitmap.hpp>
diff --git a/canvas/source/opengl/ogl_canvascustomsprite.cxx b/canvas/source/opengl/ogl_canvascustomsprite.cxx
index 7d3fe0c..a1c7327 100644
--- a/canvas/source/opengl/ogl_canvascustomsprite.cxx
+++ b/canvas/source/opengl/ogl_canvascustomsprite.cxx
@@ -11,11 +11,7 @@
#include "ogl_canvastools.hxx"
#include "ogl_tools.hxx"
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <canvas/verifyinput.hxx>
-#include <tools/diagnose_ex.h>
-
#include <canvas/canvastools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
@@ -25,6 +21,7 @@
#include <basegfx/polygon/b2dpolygontriangulator.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <tools/diagnose_ex.h>
#include <GL/glew.h>
using namespace ::com::sun::star;
diff --git a/canvas/source/opengl/ogl_spritecanvas.cxx b/canvas/source/opengl/ogl_spritecanvas.cxx
index 3e56c5c..42c09e1 100644
--- a/canvas/source/opengl/ogl_spritecanvas.cxx
+++ b/canvas/source/opengl/ogl_spritecanvas.cxx
@@ -9,10 +9,6 @@
#include "ogl_spritecanvas.hxx"
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
-#include <tools/diagnose_ex.h>
-
#include <osl/mutex.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -25,6 +21,8 @@
#include <cppuhelper/implementationentry.hxx>
#include <comphelper/servicedecl.hxx>
+#include <tools/diagnose_ex.h>
+
#include "ogl_canvascustomsprite.hxx"
#define SPRITECANVAS_SERVICE_NAME "com.sun.star.rendering.SpriteCanvas.OGL"
@@ -48,7 +46,7 @@ namespace oglcanvas
if( maArguments.getLength() == 0 )
return;
- VERBOSE_TRACE( "SpriteCanvas::initialize called" );
+ SAL_INFO("canvas.ogl", "SpriteCanvas::initialize called" );
/* aArguments:
0: ptr to creating instance (Window or VirtualDevice)
diff --git a/canvas/source/opengl/ogl_spritedevicehelper.cxx b/canvas/source/opengl/ogl_spritedevicehelper.cxx
index 25c9e9b..7bab39f 100644
--- a/canvas/source/opengl/ogl_spritedevicehelper.cxx
+++ b/canvas/source/opengl/ogl_spritedevicehelper.cxx
@@ -14,7 +14,6 @@
#include "ogl_canvascustomsprite.hxx"
#include "ogl_texturecache.hxx"
-#include <canvas/verbosetrace.hxx>
#include <basegfx/tools/canvastools.hxx>
#include <basegfx/tools/unopolypolygon.hxx>
diff --git a/canvas/source/opengl/ogl_textlayout.cxx b/canvas/source/opengl/ogl_textlayout.cxx
index 88e7ebd..a6b0b24 100644
--- a/canvas/source/opengl/ogl_textlayout.cxx
+++ b/canvas/source/opengl/ogl_textlayout.cxx
@@ -9,13 +9,9 @@
#include "ogl_textlayout.hxx"
-#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
-#include <tools/diagnose_ex.h>
-
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/numeric/ftools.hxx>
-
+#include <tools/diagnose_ex.h>
using namespace ::com::sun::star;
diff --git a/canvas/source/tools/canvascustomspritehelper.cxx b/canvas/source/tools/canvascustomspritehelper.cxx
index 9203517..8198d96 100644
--- a/canvas/source/tools/canvascustomspritehelper.cxx
+++ b/canvas/source/tools/canvascustomspritehelper.cxx
@@ -18,10 +18,8 @@
*/
-#include <canvas/debug.hxx>
-#include <tools/diagnose_ex.h>
-#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
+#include <tools/diagnose_ex.h>
#include <rtl/math.hxx>
diff --git a/canvas/source/tools/spriteredrawmanager.cxx b/canvas/source/tools/spriteredrawmanager.cxx
index 5708b97..0c00f0f 100644
--- a/canvas/source/tools/spriteredrawmanager.cxx
+++ b/canvas/source/tools/spriteredrawmanager.cxx
@@ -18,7 +18,6 @@
*/
-#include <canvas/debug.hxx>
#include <tools/diagnose_ex.h>
#include <canvas/spriteredrawmanager.hxx>
diff --git a/canvas/source/vcl/canvas.cxx b/canvas/source/vcl/canvas.cxx
index b0e4bb4..b361296 100644
--- a/canvas/source/vcl/canvas.cxx
+++ b/canvas/source/vcl/canvas.cxx
@@ -19,7 +19,6 @@
#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <tools/diagnose_ex.h>
@@ -88,7 +87,7 @@ namespace vclcanvas
*/
SolarMutexGuard aGuard;
- VERBOSE_TRACE( "VCLCanvas::initialize called" );
+ SAL_INFO("canvas.vcl", "VCLCanvas::initialize called" );
ENSURE_ARG_OR_THROW( maArguments.getLength() >= 6 &&
maArguments[0].getValueTypeClass() == uno::TypeClass_HYPER,
@@ -117,7 +116,7 @@ namespace vclcanvas
Canvas::~Canvas()
{
- OSL_TRACE( "Canvas destroyed" );
+ SAL_INFO("canvas.vcl", "VCLCanvas destroyed" );
}
void Canvas::disposeThis()
diff --git a/canvas/source/vcl/canvascustomsprite.cxx b/canvas/source/vcl/canvascustomsprite.cxx
index 030c603..ae36043 100644
--- a/canvas/source/vcl/canvascustomsprite.cxx
+++ b/canvas/source/vcl/canvascustomsprite.cxx
@@ -20,7 +20,6 @@
#include <canvas/debug.hxx>
#include <tools/diagnose_ex.h>
-#include <canvas/verbosetrace.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <rtl/math.hxx>
diff --git a/canvas/source/vcl/services.cxx b/canvas/source/vcl/services.cxx
index c22cf77..36c1afb 100644
--- a/canvas/source/vcl/services.cxx
+++ b/canvas/source/vcl/services.cxx
@@ -19,7 +19,6 @@
#include <canvas/debug.hxx>
-#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <com/sun/star/registry/XRegistryKey.hpp>
diff --git a/canvas/source/vcl/spritecanvas.cxx b/canvas/source/vcl/spritecanvas.cxx
index 11901ba..be38a8e 100644
--- a/canvas/source/vcl/spritecanvas.cxx
+++ b/canvas/source/vcl/spritecanvas.cxx
@@ -20,7 +20,6 @@
#include <canvas/debug.hxx>
#include <tools/diagnose_ex.h>
-#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <com/sun/star/registry/XRegistryKey.hpp>
@@ -79,7 +78,7 @@ namespace vclcanvas
boost::ref(maCanvasHelper),
_1)));
- VERBOSE_TRACE( "VCLSpriteCanvas::initialize called" );
+ SAL_INFO("canvas.vcl", "VCLSpriteCanvas::initialize called" );
ENSURE_ARG_OR_THROW( maArguments.getLength() >= 1,
"VCLSpriteCanvas::initialize: wrong number of arguments" );
diff --git a/canvas/source/vcl/spritecanvashelper.cxx b/canvas/source/vcl/spritecanvashelper.cxx
index d7a7fee..2a51868b 100644
--- a/canvas/source/vcl/spritecanvashelper.cxx
+++ b/canvas/source/vcl/spritecanvashelper.cxx
@@ -20,7 +20,6 @@
#include <canvas/debug.hxx>
#include <tools/diagnose_ex.h>
-#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <vcl/canvastools.hxx>
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx
index e79e012..4ad2ccb 100644
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -20,7 +20,6 @@
#include <canvas/debug.hxx>
#include <tools/diagnose_ex.h>
-#include <canvas/verbosetrace.hxx>
#include <rtl/math.hxx>
@@ -97,9 +96,8 @@ namespace vclcanvas
}
// log output pos in device pixel
- VERBOSE_TRACE( "SpriteHelper::redraw(): output pos is (%f, %f)",
- rPos.getX(),
- rPos.getY() );
+ SAL_INFO("canva.vcl", "SpriteHelper::redraw(): output pos is (" <<
+ rPos.getX() << "," << rPos.getY() << ")");
const double fAlpha( getAlpha() );
@@ -332,9 +330,8 @@ namespace vclcanvas
2,'.',NULL,' ') );
rTargetSurface.DrawText( aOutPos+Point(2,2), text );
- SAL_INFO(
- "canvas.level2",
- "sprite " << this << " has prio " << getPriority());
+ SAL_INFO( "canvas.vcl",
+ "sprite " << this << " has prio " << getPriority());
}
}
}
commit 3e47219e06b9a279ba22a9bbef668731f2d3e07d
Author: Tor Lillqvist <tml at collabora.com>
Date: Mon Aug 10 19:26:57 2015 +0300
SimpleWinLayout::mbDisableGlyphs was always true
Remove dead code. Should have no effect on behaviour.
Possibly originally the intent was that mbDisableGlyphs would have
been false in most cases on NT-based Windows (all versions that we
support now). However, since dadfc60873d4dce4e0c46e1d3405f8d45535cdcf,
in 2005, mbDisableGlyphs was set to always true in the SimpleWinLayout
ctor.
Change-Id: Id929224d5656706762c2f44ee26c76f8b20ee8b8
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index 2e89269..7d05d23 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -87,7 +87,6 @@ public:
BYTE GetCharSet() const { return meWinCharSet; }
BYTE GetPitchAndFamily() const { return mnPitchAndFamily; }
- bool IsGlyphApiDisabled() const { return mbDisableGlyphApi; }
bool SupportsKorean() const { return mbHasKoreanRange; }
bool SupportsCJK() const { return mbHasCJKSupport; }
bool SupportsArabic() const { return mbHasArabicSupport; }
@@ -111,7 +110,6 @@ private:
sal_IntPtr mnId;
// some members that are initalized lazily when the font gets selected into a HDC
- mutable bool mbDisableGlyphApi;
mutable bool mbHasKoreanRange;
mutable bool mbHasCJKSupport;
#if ENABLE_GRAPHITE
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index 2e3c44a..78f1055 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -1086,7 +1086,6 @@ ImplWinFontData::ImplWinFontData( const ImplDevFontAttributes& rDFS,
int nHeight, BYTE eWinCharSet, BYTE nPitchAndFamily )
: PhysicalFontFace( rDFS, 0 ),
mnId( 0 ),
- mbDisableGlyphApi( false ),
mbHasKoreanRange( false ),
mbHasCJKSupport( false ),
#if ENABLE_GRAPHITE
@@ -1186,15 +1185,6 @@ void ImplWinFontData::UpdateFromHDC( HDC hDC ) const
}
}
#endif
-
- // even if the font works some fonts have problems with the glyph API
- // => the heuristic below tries to figure out which fonts have the problem
- TEXTMETRICA aTextMetric;
- if( ::GetTextMetricsA( hDC, &aTextMetric ) )
- if( !(aTextMetric.tmPitchAndFamily & TMPF_TRUETYPE)
- || (aTextMetric.tmPitchAndFamily & TMPF_DEVICE) )
- mbDisableGlyphApi = true;
-
}
#if ENABLE_GRAPHITE
@@ -1291,7 +1281,6 @@ void ImplWinFontData::ReadCmapTable( HDC hDC ) const
if( aRawFontData.get() ) {
CmapResult aResult;
ParseCMAP( aRawFontData.get(), aRawFontData.size(), aResult );
- mbDisableGlyphApi |= aResult.mbRecoded;
aResult.mbSymbolic = bIsSymbolFont;
if( aResult.mnRangeCount > 0 )
{
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 47c47d5..9edf88c 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -241,11 +241,9 @@ SimpleWinLayout::SimpleWinLayout(HDC hDC, BYTE nCharSet, const ImplWinFontData&
mpGlyphs2Chars( NULL ),
mpGlyphRTLFlags( NULL ),
mnWidth( 0 ),
- mbDisableGlyphs( false ),
mnNotdefWidth( -1 ),
mnCharSet( nCharSet )
{
- mbDisableGlyphs = true;
}
SimpleWinLayout::~SimpleWinLayout()
@@ -264,20 +262,8 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs )
{
// prepare layout
// TODO: fix case when recyclying old SimpleWinLayout object
- mbDisableGlyphs |= bool(rArgs.mnFlags & SalLayoutFlags::DisableGlyphProcessing);
mnCharCount = rArgs.mnEndCharPos - rArgs.mnMinCharPos;
- if( !mbDisableGlyphs )
- {
- // Win32 glyph APIs have serious problems with vertical layout
- // => workaround is to use the unicode methods then
- if( rArgs.mnFlags & SalLayoutFlags::Vertical )
- mbDisableGlyphs = true;
- else
- // use cached value from font face
- mbDisableGlyphs = mrWinFontData.IsGlyphApiDisabled();
- }
-
// TODO: use a cached value for bDisableAsianKern from upper layers
if( rArgs.mnFlags & SalLayoutFlags::KerningAsian )
{
@@ -435,9 +421,6 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs )
if( GetTextExtentPoint32W( mhDC, &cNotDef, 1, &aExtent) )
mnNotdefWidth = aExtent.cx;
}
- // use a better NotDef glyph
- if( !mbDisableGlyphs && !bSurrogate )
- mpOutGlyphs[i] = 0;
}
if( bSurrogate && ((i+1) < mnGlyphCount) )
mpOutGlyphs[i+1] = DROPPED_OUTGLYPH;
@@ -545,23 +528,21 @@ int SimpleWinLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIds, Point& rPo
{
// update return values {aGlyphId,nCharPos,nGlyphAdvance}
sal_GlyphId aGlyphId = mpOutGlyphs[ nStart ];
- if( mbDisableGlyphs )
+ if( mnLayoutFlags & SalLayoutFlags::Vertical )
{
- if( mnLayoutFlags & SalLayoutFlags::Vertical )
+ const sal_UCS4 cChar = static_cast<sal_UCS4>(aGlyphId & GF_IDXMASK);
+ if( mrWinFontData.HasGSUBstitutions( mhDC )
+ && mrWinFontData.IsGSUBstituted( cChar ) )
+ aGlyphId |= GF_GSUB | GF_ROTL;
+ else
{
- const sal_UCS4 cChar = static_cast<sal_UCS4>(aGlyphId & GF_IDXMASK);
- if( mrWinFontData.HasGSUBstitutions( mhDC )
- && mrWinFontData.IsGSUBstituted( cChar ) )
- aGlyphId |= GF_GSUB | GF_ROTL;
- else
- {
- aGlyphId |= GetVerticalFlags( cChar );
- if( (aGlyphId & GF_ROTMASK) == 0 )
- aGlyphId |= GF_VERT;
- }
+ aGlyphId |= GetVerticalFlags( cChar );
+ if( (aGlyphId & GF_ROTMASK) == 0 )
+ aGlyphId |= GF_VERT;
}
- aGlyphId |= GF_ISCHAR;
}
+ aGlyphId |= GF_ISCHAR;
+
++nCount;
*(pGlyphIds++) = aGlyphId;
if( pGlyphAdvances )
@@ -595,11 +576,6 @@ void SimpleWinLayout::DrawTextImpl(HDC hDC) const
return;
HFONT hOrigFont = DisableFontScaling();
-
- UINT mnDrawOptions = ETO_GLYPH_INDEX;
- if( mbDisableGlyphs )
- mnDrawOptions = 0;
-
Point aPos = GetDrawPosition( Point( mnBaseAdv, 0 ) );
// #108267#, break up into glyph portions of a limited size required by Win32 API
@@ -618,14 +594,14 @@ void SimpleWinLayout::DrawTextImpl(HDC hDC) const
unsigned int i = 0;
for( unsigned int n = 0; n < numGlyphPortions; ++n, i+=maxGlyphCount )
{
- ExtTextOutW(hDC, 0, 0, mnDrawOptions, NULL, mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i);
+ ExtTextOutW(hDC, 0, 0, 0, NULL, mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i);
}
- ExtTextOutW(hDC, 0, 0, mnDrawOptions, NULL, mpOutGlyphs+i, remainingGlyphs, mpGlyphAdvances+i);
+ ExtTextOutW(hDC, 0, 0, 0, NULL, mpOutGlyphs+i, remainingGlyphs, mpGlyphAdvances+i);
MoveToEx(hDC, oldPos.x, oldPos.y, (LPPOINT) NULL);
SetTextAlign(hDC, oldTa);
}
else
- ExtTextOutW(hDC, aPos.X(), aPos.Y(), mnDrawOptions, NULL, mpOutGlyphs, mnGlyphCount, mpGlyphAdvances);
+ ExtTextOutW(hDC, aPos.X(), aPos.Y(), 0, NULL, mpOutGlyphs, mnGlyphCount, mpGlyphAdvances);
if( hOrigFont )
DeleteFont(SelectFont(hDC, hOrigFont));
diff --git a/vcl/win/source/gdi/winlayout.hxx b/vcl/win/source/gdi/winlayout.hxx
index 528215f..7e135ae 100644
--- a/vcl/win/source/gdi/winlayout.hxx
+++ b/vcl/win/source/gdi/winlayout.hxx
@@ -103,7 +103,6 @@ private:
int* mpGlyphs2Chars; // map abs glyph pos to abs char pos
bool* mpGlyphRTLFlags; // BiDi status for glyphs: true=>RTL
mutable long mnWidth;
- bool mbDisableGlyphs;
int mnNotdefWidth;
BYTE mnCharSet;
commit cd064472ce4ff9d1dd6720c32fde22f36eb232f4
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Aug 10 16:44:03 2015 +0200
tdf#93325 ImplAnimView rendercontext: stop painting animgifs directly
Change-Id: I34fb235a2e44eb510a630fb8dbcc2ec68cf96b79
Reviewed-on: https://gerrit.libreoffice.org/17624
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx
index 4794cd4..2b28b3c 100644
--- a/vcl/source/gdi/impanmvw.cxx
+++ b/vcl/source/gdi/impanmvw.cxx
@@ -18,6 +18,7 @@
*/
#include "impanmvw.hxx"
+#include <window.h>
#include <vcl/virdev.hxx>
#include <vcl/window.hxx>
#include <tools/helpers.hxx>
@@ -154,6 +155,15 @@ void ImplAnimView::getPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size
void ImplAnimView::drawToPos( sal_uLong nPos )
{
VclPtr<vcl::RenderContext> pRenderContext = mpOut;
+
+ std::unique_ptr<PaintBufferGuard> pGuard;
+ if (mpOut->GetOutDevType() == OUTDEV_WINDOW)
+ {
+ vcl::Window* pWindow = static_cast<vcl::Window*>(mpOut.get());
+ pGuard.reset(new PaintBufferGuard(pWindow->ImplGetWindowImpl()->mpFrameData, pWindow));
+ pRenderContext = pGuard->GetRenderContext();
+ }
+
ScopedVclPtrInstance<VirtualDevice> aVDev;
std::unique_ptr<vcl::Region> xOldClip(!maClip.IsNull() ? new vcl::Region( pRenderContext->GetClipRegion() ) : NULL);
@@ -167,6 +177,8 @@ void ImplAnimView::drawToPos( sal_uLong nPos )
pRenderContext->SetClipRegion( maClip );
pRenderContext->DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, *aVDev.get() );
+ if (pGuard)
+ pGuard->SetPaintRect(Rectangle(maDispPt, maDispSz));
if (xOldClip)
pRenderContext->SetClipRegion(*xOldClip);
@@ -175,6 +187,15 @@ void ImplAnimView::drawToPos( sal_uLong nPos )
void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev )
{
VclPtr<vcl::RenderContext> pRenderContext = mpOut;
+
+ std::unique_ptr<PaintBufferGuard> pGuard;
+ if (!pVDev && mpOut->GetOutDevType() == OUTDEV_WINDOW)
+ {
+ vcl::Window* pWindow = static_cast<vcl::Window*>(mpOut.get());
+ pGuard.reset(new PaintBufferGuard(pWindow->ImplGetWindowImpl()->mpFrameData, pWindow));
+ pRenderContext = pGuard->GetRenderContext();
+ }
+
Rectangle aOutRect( pRenderContext->PixelToLogic( Point() ), pRenderContext->GetOutputSize() );
// check, if output lies out of display
@@ -268,6 +289,8 @@ void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev )
pRenderContext->SetClipRegion( maClip );
pRenderContext->DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, *pDev );
+ if (pGuard)
+ pGuard->SetPaintRect(Rectangle(maDispPt, maDispSz));
if( xOldClip)
{
commit 0f4b3cb7d3d68906de316a64dcec281da2a641bd
Author: Eike Rathke <erack at redhat.com>
Date: Mon Aug 10 17:04:13 2015 +0200
if we have a number formatter then use it, dammit..
Change-Id: I2d70bed4d9cf6f0ef4556a327c51fc5c10fcd2be
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index c77c9a5..3dcbf4b 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -1243,16 +1243,25 @@ sal_Int32 DiagramHelper::getDateTimeInputNumberFormat( const Reference< util::XN
sal_Int32 DiagramHelper::getPercentNumberFormat( const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
{
sal_Int32 nRet=-1;
- Reference< util::XNumberFormats > xNumberFormats( xNumberFormatsSupplier->getNumberFormats() );
- if( xNumberFormats.is() )
+ const LanguageTag& rLanguageTag = Application::GetSettings().GetLanguageTag();
+ NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
+ SvNumberFormatter* pNumFormatter = aNumberFormatterWrapper.getSvNumberFormatter();
+ if( pNumFormatter )
{
- bool bCreate = true;
- const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
- Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::PERCENT,
- rLocaleDataWrapper.getLanguageTag().getLocale(), bCreate );
- if( aKeySeq.getLength() )
+ nRet = pNumFormatter->GetStandardFormat( util::NumberFormat::PERCENT, rLanguageTag.getLanguageType() );
+ }
+ else
+ {
+ Reference< util::XNumberFormats > xNumberFormats( xNumberFormatsSupplier->getNumberFormats() );
+ if( xNumberFormats.is() )
{
- nRet = aKeySeq[0];
+ bool bCreate = true;
+ Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::PERCENT,
+ rLanguageTag.getLocale(), bCreate );
+ if( aKeySeq.getLength() )
+ {
+ nRet = aKeySeq[0];
+ }
}
}
return nRet;
commit ae9a59382f11166da44512a01ae38fc4790ac0d4
Author: Eike Rathke <erack at redhat.com>
Date: Mon Aug 10 16:40:39 2015 +0200
if we have a number formatter then use it, dammit..
Change-Id: I43b777bb0b3f53682bab7af4643b29e2bd313caa
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index 2b522b1..c77c9a5 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -1165,27 +1165,28 @@ bool DiagramHelper::isDateNumberFormat( sal_Int32 nNumberFormat, const Reference
sal_Int32 DiagramHelper::getDateNumberFormat( const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
{
sal_Int32 nRet=-1;
- Reference< util::XNumberFormats > xNumberFormats( xNumberFormatsSupplier->getNumberFormats() );
- if( xNumberFormats.is() )
- {
- bool bCreate = true;
- const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
- Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::DATE,
- rLocaleDataWrapper.getLanguageTag().getLocale(), bCreate );
- if( aKeySeq.getLength() )
- {
- nRet = aKeySeq[0];
- }
- }
//try to get a date format with full year display
+ const LanguageTag& rLanguageTag = Application::GetSettings().GetLanguageTag();
NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
SvNumberFormatter* pNumFormatter = aNumberFormatterWrapper.getSvNumberFormatter();
if( pNumFormatter )
{
- const SvNumberformat* pFormat = pNumFormatter->GetEntry( nRet );
- if( pFormat )
- nRet = pNumFormatter->GetFormatIndex( NF_DATE_SYS_DDMMYYYY, pFormat->GetLanguage() );
+ nRet = pNumFormatter->GetFormatIndex( NF_DATE_SYS_DDMMYYYY, rLanguageTag.getLanguageType() );
+ }
+ else
+ {
+ Reference< util::XNumberFormats > xNumberFormats( xNumberFormatsSupplier->getNumberFormats() );
+ if( xNumberFormats.is() )
+ {
+ bool bCreate = true;
+ Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::DATE,
+ rLanguageTag.getLocale(), bCreate );
+ if( aKeySeq.getLength() )
+ {
+ nRet = aKeySeq[0];
+ }
+ }
}
return nRet;
}
commit 131d5b01f400899470925757658841080b09283a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Aug 10 15:49:09 2015 +0200
tdf#93325 ImplAnimView: handle rendercontext
Stop accessing mpOut directly, always go via an explicit
vcl::RenderContext.
Change-Id: I742b63e0db529d1829d2339c213a0b900f727728
diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx
index 2176ee5..4794cd4 100644
--- a/vcl/source/gdi/impanmvw.cxx
+++ b/vcl/source/gdi/impanmvw.cxx
@@ -153,8 +153,9 @@ void ImplAnimView::getPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size
void ImplAnimView::drawToPos( sal_uLong nPos )
{
+ VclPtr<vcl::RenderContext> pRenderContext = mpOut;
ScopedVclPtrInstance<VirtualDevice> aVDev;
- std::unique_ptr<vcl::Region> xOldClip(!maClip.IsNull() ? new vcl::Region( mpOut->GetClipRegion() ) : NULL);
+ std::unique_ptr<vcl::Region> xOldClip(!maClip.IsNull() ? new vcl::Region( pRenderContext->GetClipRegion() ) : NULL);
aVDev->SetOutputSizePixel( maSzPix, false );
nPos = std::min( nPos, (sal_uLong) mpParent->Count() - 1UL );
@@ -163,17 +164,18 @@ void ImplAnimView::drawToPos( sal_uLong nPos )
draw( i, aVDev.get() );
if (xOldClip)
- mpOut->SetClipRegion( maClip );
+ pRenderContext->SetClipRegion( maClip );
- mpOut->DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, *aVDev.get() );
+ pRenderContext->DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, *aVDev.get() );
if (xOldClip)
- mpOut->SetClipRegion(*xOldClip);
+ pRenderContext->SetClipRegion(*xOldClip);
}
void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev )
{
- Rectangle aOutRect( mpOut->PixelToLogic( Point() ), mpOut->GetOutputSize() );
+ VclPtr<vcl::RenderContext> pRenderContext = mpOut;
+ Rectangle aOutRect( pRenderContext->PixelToLogic( Point() ), pRenderContext->GetOutputSize() );
// check, if output lies out of display
if( aOutRect.Intersection( Rectangle( maDispPt, maDispSz ) ).IsEmpty() )
@@ -219,7 +221,7 @@ void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev )
{
pDev = VclPtr<VirtualDevice>::Create();
pDev->SetOutputSizePixel( maSzPix, false );
- pDev->DrawOutDev( Point(), maSzPix, maDispPt, maDispSz, *mpOut );
+ pDev->DrawOutDev( Point(), maSzPix, maDispPt, maDispSz, *pRenderContext );
}
else
pDev = pVDev;
@@ -260,23 +262,23 @@ void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev )
if( !pVDev )
{
- std::unique_ptr<vcl::Region> xOldClip(!maClip.IsNull() ? new vcl::Region( mpOut->GetClipRegion() ) : NULL);
+ std::unique_ptr<vcl::Region> xOldClip(!maClip.IsNull() ? new vcl::Region( pRenderContext->GetClipRegion() ) : NULL);
if (xOldClip)
- mpOut->SetClipRegion( maClip );
+ pRenderContext->SetClipRegion( maClip );
- mpOut->DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, *pDev );
+ pRenderContext->DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, *pDev );
if( xOldClip)
{
- mpOut->SetClipRegion(*xOldClip);
+ pRenderContext->SetClipRegion(*xOldClip);
xOldClip.reset();
}
pDev.disposeAndClear();
- if( mpOut->GetOutDevType() == OUTDEV_WINDOW )
- static_cast<vcl::Window*>( mpOut.get() )->Sync();
+ if( pRenderContext->GetOutDevType() == OUTDEV_WINDOW )
+ static_cast<vcl::Window*>( pRenderContext.get() )->Sync();
}
}
}
commit 711b34d590e659ed754f7c57b3b5eb12acfbbd78
Author: Eike Rathke <erack at redhat.com>
Date: Mon Aug 10 15:10:09 2015 +0200
tdf#92997 obtain a date/time edit format according to field value
Bloody workaround hack for the fact that Chart does not handle
category/x-axis times internally and is not able to pass its own axis
numberformat to its own databrowser editor.
Change-Id: I016695ad0104366c0bb636b449a2014ade31aca3
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 9af794b..3162e1d 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -674,13 +674,18 @@ OUString DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const
aResult = aText;
else if( aAny>>=fDouble )
{
- sal_Int32 nLabelColor;
- sal_Int32 nDateNumberFormat = DiagramHelper::getDateNumberFormat( Reference< util::XNumberFormatsSupplier >( m_xChartDoc, uno::UNO_QUERY) );
if( ! ::rtl::math::isNan( fDouble ) && m_spNumberFormatterWrapper.get() )
{
+ // If a numberformat was available here we could directly
+ // obtain the corresponding edit format in
+ // getDateTimeInputNumberFormat() instead of doing the
+ // guess work.
+ sal_Int32 nNumberFormat = DiagramHelper::getDateTimeInputNumberFormat(
+ Reference< util::XNumberFormatsSupplier >( m_xChartDoc, uno::UNO_QUERY), fDouble );
+ sal_Int32 nLabelColor;
bool bColorChanged = false;
aResult = m_spNumberFormatterWrapper->getFormattedString(
- nDateNumberFormat, fDouble, nLabelColor, bColorChanged );
+ nNumberFormat, fDouble, nLabelColor, bColorChanged );
}
}
}
@@ -1096,18 +1101,14 @@ sal_uInt32 DataBrowser::GetNumberFormatKey( sal_Int32 nRow, sal_uInt16 nCol ) co
return m_apDataBrowserModel->getNumberFormatKey( lcl_getColumnInData( nCol ), lcl_getRowInData( nRow ));
}
-bool DataBrowser::isDateString( const OUString& aInputString, double& fOutDateValue )
+bool DataBrowser::isDateTimeString( const OUString& aInputString, double& fOutDateTimeValue )
{
sal_uInt32 nNumberFormat=0;
SvNumberFormatter* pSvNumberFormatter = m_spNumberFormatterWrapper.get() ? m_spNumberFormatterWrapper->getSvNumberFormatter() : 0;
- if( !aInputString.isEmpty() && pSvNumberFormatter && pSvNumberFormatter->IsNumberFormat( aInputString, nNumberFormat, fOutDateValue ) )
+ if( !aInputString.isEmpty() && pSvNumberFormatter && pSvNumberFormatter->IsNumberFormat( aInputString, nNumberFormat, fOutDateTimeValue ) )
{
- Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( m_xChartDoc, uno::UNO_QUERY );
- Reference< util::XNumberFormats > xNumberFormats;
- if( xNumberFormatsSupplier.is() )
- xNumberFormats = Reference< util::XNumberFormats >( xNumberFormatsSupplier->getNumberFormats() );
- if( DiagramHelper::isDateNumberFormat( nNumberFormat, xNumberFormats ) )
- return true;
+ short nType = pSvNumberFormatter->GetType( nNumberFormat);
+ return (nType & util::NumberFormat::DATE) || (nType & util::NumberFormat::TIME);
}
return false;
}
@@ -1149,10 +1150,10 @@ bool DataBrowser::SaveModified()
case DataBrowserModel::TEXTORDATE:
{
OUString aText( m_aTextEditField->GetText() );
- double fDateValue = 0.0;
+ double fValue = 0.0;
bChangeValid = false;
- if( isDateString( aText, fDateValue ) )
- bChangeValid = m_apDataBrowserModel->setCellAny( nCol, nRow, uno::makeAny( fDateValue ) );
+ if( isDateTimeString( aText, fValue ) )
+ bChangeValid = m_apDataBrowserModel->setCellAny( nCol, nRow, uno::makeAny( fValue ) );
if(!bChangeValid)
bChangeValid = m_apDataBrowserModel->setCellAny( nCol, nRow, uno::makeAny( aText ) );
}
diff --git a/chart2/source/controller/dialogs/DataBrowser.hxx b/chart2/source/controller/dialogs/DataBrowser.hxx
index 79fee95..514b697 100644
--- a/chart2/source/controller/dialogs/DataBrowser.hxx
+++ b/chart2/source/controller/dialogs/DataBrowser.hxx
@@ -86,7 +86,7 @@ public:
*/
double GetCellNumber( long nRow, sal_uInt16 nColumnId ) const;
- bool isDateString( const OUString& aInputString, double& fOutDateValue );
+ bool isDateTimeString( const OUString& aInputString, double& fOutDateTimeValue );
// Window
virtual void Resize() SAL_OVERRIDE;
diff --git a/chart2/source/inc/DiagramHelper.hxx b/chart2/source/inc/DiagramHelper.hxx
index c8bc8ed..2272d9a 100644
--- a/chart2/source/inc/DiagramHelper.hxx
+++ b/chart2/source/inc/DiagramHelper.hxx
@@ -244,6 +244,7 @@ public:
static bool isSupportingDateAxis( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& xDiagram );
static bool isDateNumberFormat( sal_Int32 nNumberFormat, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats >& xNumberFormats );
static sal_Int32 getDateNumberFormat( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
+ static sal_Int32 getDateTimeInputNumberFormat( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier, double fNumber );
static sal_Int32 getPercentNumberFormat( const ::com::sun::star::uno::Reference<
::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index 8023956..2b522b1 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -1190,6 +1190,55 @@ sal_Int32 DiagramHelper::getDateNumberFormat( const Reference< util::XNumberForm
return nRet;
}
+sal_Int32 DiagramHelper::getDateTimeInputNumberFormat( const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier, double fNumber )
+{
+ sal_Int32 nRet = 0;
+
+ // Get the most detailed date/time format according to fNumber.
+ NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
+ SvNumberFormatter* pNumFormatter = aNumberFormatterWrapper.getSvNumberFormatter();
+ if (!pNumFormatter)
+ SAL_WARN("chart2", "DiagramHelper::getDateTimeInputNumberFormat - no SvNumberFormatter");
+ else
+ {
+ // Categorize the format according to the implementation of
+ // SvNumberFormatter::GetEditFormat(), making assumptions about what
+ // would be time only.
+ /* TODO: implement a method at SvNumberFormatter that does this and
+ * call instead, if Chart isn't able transport the proper format of the
+ * Axis, which of course would be much better.. */
+ short nType;
+ if (0.0 <= fNumber && fNumber < 1.0)
+ {
+ // Clearly a time.
+ nType = util::NumberFormat::TIME;
+ nRet = pNumFormatter->GetFormatIndex( NF_TIME_HHMM, LANGUAGE_SYSTEM);
+ }
+ else if (fabs( fNumber) * 24 < 0x7fff)
+ {
+ // Assuming time within 32k hours or 3.7 years.
+ nType = util::NumberFormat::TIME;
+ nRet = pNumFormatter->GetFormatIndex( NF_TIME_HH_MMSS, LANGUAGE_SYSTEM);
+ }
+ else if (rtl::math::approxFloor( fNumber) != fNumber)
+ {
+ // Date+Time.
+ nType = util::NumberFormat::DATETIME;
+ nRet = pNumFormatter->GetFormatIndex( NF_DATETIME_SYS_DDMMYYYY_HHMMSS, LANGUAGE_SYSTEM);
+ }
+ else
+ {
+ // Date only.
+ nType = util::NumberFormat::DATE;
+ nRet = pNumFormatter->GetFormatIndex( NF_DATE_SYS_DDMMYYYY, LANGUAGE_SYSTEM);
+ }
+
+ // Obtain the corresponding edit format.
+ nRet = pNumFormatter->GetEditFormat( fNumber, nRet, nType, LANGUAGE_SYSTEM, NULL);
+ }
+ return nRet;
+}
+
sal_Int32 DiagramHelper::getPercentNumberFormat( const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
{
sal_Int32 nRet=-1;
commit 52be3fcbd960238b717a6487f0e19156825c8159
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Aug 10 12:00:34 2015 +0100
cppcheck: badBitmaskCheck
Change-Id: I0a6787379317e5077c5a4520e5144fe091a01538
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index bf90a98..da60498 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -820,7 +820,7 @@ short IconChoiceDialog::Ok()
if ( pPage->FillItemSet( &aTmp ) )
{
- _bModified |= true;
+ _bModified = true;
pExampleSet->Put( aTmp );
pOutSet->Put( aTmp );
}
@@ -829,13 +829,11 @@ short IconChoiceDialog::Ok()
}
if ( _bModified || ( pOutSet && pOutSet->Count() > 0 ) )
- _bModified |= true;
+ _bModified = true;
return _bModified ? RET_OK : RET_CANCEL;
}
-
-
void IconChoiceDialog::FocusOnIcon( sal_uInt16 nId )
{
// set focus to icon for the current visible page
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index 824447b..a179917 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -306,8 +306,6 @@ VclPtr<SfxTabPage> SvxGeneralTabPage::Create( vcl::Window* pParent, const SfxIte
return VclPtr<SvxGeneralTabPage>::Create( pParent, *rAttrSet );
}
-
-
bool SvxGeneralTabPage::FillItemSet( SfxItemSet* )
{
// remove leading and trailing whitespaces
@@ -320,13 +318,11 @@ bool SvxGeneralTabPage::FillItemSet( SfxItemSet* )
if ( m_pUseDataCB->IsChecked() != aSaveOpt.IsUseUserData() )
{
aSaveOpt.SetUseUserData( m_pUseDataCB->IsChecked() );
- bModified |= true;
+ bModified = true;
}
return bModified;
}
-
-
void SvxGeneralTabPage::Reset( const SfxItemSet* rSet )
{
SetAddress_Impl();
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index d4d9f1b..5a68179 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1156,8 +1156,6 @@ VclPtr<SfxTabPage> SvxLinguTabPage::Create( vcl::Window* pParent,
return VclPtr<SvxLinguTabPage>::Create( pParent, *rAttrSet );
}
-
-
bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet )
{
bool bModified = true; // !!!!
@@ -1315,14 +1313,12 @@ bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet )
{
rCoreSet->Put( SfxBoolItem( GetWhich( SID_AUTOSPELL_CHECK ),
bNewAutoCheck ) );
- bModified |= true;
+ bModified = true;
}
return bModified;
}
-
-
sal_uLong SvxLinguTabPage::GetDicUserData( const uno::Reference< XDictionary > &rxDic, sal_uInt16 nIdx )
{
sal_uLong nRes = 0;
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index c617d64..2c049a5 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -280,55 +280,55 @@ bool SfxSaveTabPage::FillItemSet( SfxItemSet* rSet )
{
rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_DOCINFO ),
aDocInfoCB->IsChecked() ) );
- bModified |= true;
+ bModified = true;
}
if ( aBackupCB->IsEnabled() && aBackupCB->IsValueChangedFromSaved() )
{
rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_BACKUP ),
aBackupCB->IsChecked() ) );
- bModified |= true;
+ bModified = true;
}
if ( aAutoSaveCB->IsValueChangedFromSaved() )
{
rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_AUTOSAVE ),
aAutoSaveCB->IsChecked() ) );
- bModified |= true;
+ bModified = true;
}
if ( aWarnAlienFormatCB->IsValueChangedFromSaved() )
{
rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_WARNALIENFORMAT ),
aWarnAlienFormatCB->IsChecked() ) );
- bModified |= true;
+ bModified = true;
}
if ( aAutoSaveEdit->IsValueChangedFromSaved() )
{
rSet->Put( SfxUInt16Item( GetWhich( SID_ATTR_AUTOSAVEMINUTE ),
(sal_uInt16)aAutoSaveEdit->GetValue() ) );
- bModified |= true;
+ bModified = true;
}
if ( aUserAutoSaveCB->IsValueChangedFromSaved() )
{
rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_USERAUTOSAVE ),
aUserAutoSaveCB->IsChecked() ) );
- bModified |= true;
+ bModified = true;
}
// save relatively
if ( aRelativeFsysCB->IsValueChangedFromSaved() )
{
rSet->Put( SfxBoolItem( GetWhich( SID_SAVEREL_FSYS ),
aRelativeFsysCB->IsChecked() ) );
- bModified |= true;
+ bModified = true;
}
if ( aRelativeInetCB->IsValueChangedFromSaved() )
{
rSet->Put( SfxBoolItem( GetWhich( SID_SAVEREL_INET ),
aRelativeInetCB->IsChecked() ) );
- bModified |= true;
+ bModified = true;
}
SvtModuleOptions aModuleOpt;
@@ -363,8 +363,6 @@ bool SfxSaveTabPage::FillItemSet( SfxItemSet* rSet )
return bModified;
}
-
-
bool isODFFormat( const OUString& sFilter )
{
static const char* aODFFormats[] =
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 51fbd30..70b602d 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -797,7 +797,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
if ( *pTableBck_Impl->pCellBrush != *pOldCell )
{
rCoreSet->Put( *pTableBck_Impl->pCellBrush );
- bModified |= true;
+ bModified = true;
}
}
@@ -809,7 +809,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
if ( *pTableBck_Impl->pRowBrush != *pOldRow )
{
rCoreSet->Put( *pTableBck_Impl->pRowBrush );
- bModified |= true;
+ bModified = true;
}
}
@@ -821,7 +821,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
if ( *pTableBck_Impl->pTableBrush != *pOldTable )
{
rCoreSet->Put( *pTableBck_Impl->pTableBrush );
- bModified |= true;
+ bModified = true;
}
}
@@ -829,7 +829,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
{
rCoreSet->Put( SfxUInt16Item( SID_BACKGRND_DESTINATION,
m_pTblLBox->GetSelectEntryPos() ) );
- bModified |= true;
+ bModified = true;
}
}
else if( bHighlighting )
@@ -842,7 +842,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
(*pHighlighting != *pOldChar || *pHighlighting != SvxBrushItem(SID_ATTR_BRUSH_CHAR)))
{
rCoreSet->Put( *pHighlighting );
- bModified |= true;
+ bModified = true;
}
}
}
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 3daf13f..f61e89b 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -742,14 +742,14 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
if ( !pOldBoxItem || !( *pOldBoxItem == aBoxItem ) )
{
rCoreAttrs->Put( aBoxItem );
- bAttrsChanged |= true;
+ bAttrsChanged = true;
}
const SfxPoolItem* pOld = GetOldItem( *rCoreAttrs, SID_ATTR_BORDER_INNER, false );
if ( !pOld || !( *static_cast<const SvxBoxInfoItem*>(pOld) == aBoxInfoItem ) )
{
rCoreAttrs->Put( aBoxInfoItem );
- bAttrsChanged |= true;
+ bAttrsChanged = true;
}
}
else
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index d67f496..d75cb37 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -1268,7 +1268,7 @@ bool PackageManagerImpl::synchronizeRemovedExtensions(
xPackage->revokePackage(true, xAbortChannel, xCmdEnv);
removePackage(xPackage->getIdentifier().Value, xPackage->getName(),
xAbortChannel, xCmdEnv);
- bModified |= true;
+ bModified = true;
}
}
catch( const uno::Exception & e )
@@ -1404,7 +1404,7 @@ bool PackageManagerImpl::synchronizeAddedExtensions(
//try to install the extension again.
dbData.failedPrerequisites = OUString::number(failedPrereq);
insertToActivationLayerDB(id, dbData);
- bModified |= true;
+ bModified = true;
}
}
}
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 9435f9a..2b71116 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -843,7 +843,7 @@ short SfxTabDialog::Ok()
if ( pTabPage->FillItemSet( &aTmp ) )
{
- bModified |= true;
+ bModified = true;
if (pExampleSet)
pExampleSet->Put( aTmp );
pOutSet->Put( aTmp );
@@ -853,10 +853,10 @@ short SfxTabDialog::Ok()
}
if ( pImpl->bModified || ( pOutSet && pOutSet->Count() > 0 ) )
- bModified |= true;
+ bModified = true;
if (bStandardPushed)
- bModified |= true;
+ bModified = true;
return bModified ? RET_OK : RET_CANCEL;
}
diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx
index 62a07c8..e90f74b 100644
--- a/svx/source/form/fmtextcontrolshell.cxx
+++ b/svx/source/form/fmtextcontrolshell.cxx
@@ -977,7 +977,7 @@ namespace svx
bDisable |= !aDataHelper.HasFormat( SotClipboardFormatId::STRING );
}
else
- bDisable |= true;
+ bDisable = true;
bNeedTextComponent = true;
bNeedWriteableControl = true;
@@ -995,7 +995,7 @@ namespace svx
default:
// slot is unknown at all
- bDisable |= true;
+ bDisable = true;
break;
}
SAL_WARN_IF( bNeedSelection && !bNeedTextComponent, "svx.form", "FmTextControlShell::GetTextAttributeState: bNeedSelection should imply bNeedTextComponent!" );
diff --git a/unodevtools/source/skeletonmaker/javacompskeleton.cxx b/unodevtools/source/skeletonmaker/javacompskeleton.cxx
index 4ba2e99..5679163 100644
--- a/unodevtools/source/skeletonmaker/javacompskeleton.cxx
+++ b/unodevtools/source/skeletonmaker/javacompskeleton.cxx
@@ -206,7 +206,7 @@ bool checkAttribute(
{
if (attribute & attributes[i]) {
if (!attributeValue.isEmpty()) {
- cast |= true;
+ cast = true;
attributeValue.append("|");
}
switch (attributes[i])
commit eab0ae6a51667962dff04a0f1ed2b8411a344462
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Aug 9 13:30:36 2015 +0100
cppcheck: nullPointerRedundantCheck
Change-Id: I5cac2cdb383de5448383434a910eb97061c29071
diff --git a/comphelper/source/misc/types.cxx b/comphelper/source/misc/types.cxx
index 7ece3eb..9dc225f 100644
--- a/comphelper/source/misc/types.cxx
+++ b/comphelper/source/misc/types.cxx
@@ -461,9 +461,7 @@ Type getSequenceElementType(const Type& _rSequenceType)
typelib_IndirectTypeDescription* pSequenceTD =
reinterpret_cast< typelib_IndirectTypeDescription* >(aTD.get());
- OSL_ASSERT(pSequenceTD);
- OSL_ASSERT(pSequenceTD->pType);
-
+ OSL_ASSERT(pSequenceTD && pSequenceTD->pType);
if (pSequenceTD && pSequenceTD->pType)
return Type(pSequenceTD->pType);
commit f84b07c57185fee4ad5f1f9a6276c7a9db54e00a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Aug 9 13:27:12 2015 +0100
cppcheck: variableScope
Change-Id: I41270ad017dd16567c9b68df6044f182eec0b4ce
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index 5f6e9e7..26c2551 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -905,17 +905,15 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection)
{
}
- bool bPageSet = false;
if ( bExportData )
{
- bPageSet = exportFormula(XML_FORMULA,xReportElement->getDataField());
+ const bool bPageSet = exportFormula(XML_FORMULA,xReportElement->getDataField());
if ( bPageSet )
eToken = XML_FIXED_CONTENT;
else if ( eToken == XML_IMAGE )
AddAttribute(XML_NAMESPACE_REPORT, XML_PRESERVE_IRI, xImage->getPreserveIRI() ? XML_TRUE : XML_FALSE );
}
- //if ( !bPageSet )
{
// start <report:eToken>
SvXMLElementExport aComponents(*this,XML_NAMESPACE_REPORT, eToken, false, false);
commit f2ca8ff2e68281abf6b1d805f9fd17bf0d4e7750
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Aug 9 13:17:25 2015 +0100
cppcheck: knownConditionTrueFalse
Change-Id: I0368639742e23ce449d2d4ba75f524e693d2ea65
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index 9c35e39..9e661d6 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -266,7 +266,7 @@ sal_uInt32 SwXMLWriter::_Write( const uno::Reference < task::XStatusIndicator >&
}
// export sub streams for package, else full stream into a file
- bool bWarn = false, bErr = false;
+ bool bWarn = false;
// RDF metadata: export if ODF >= 1.2
// N.B.: embedded documents have their own manifest.rdf!
@@ -327,25 +327,24 @@ sal_uInt32 SwXMLWriter::_Write( const uno::Reference < task::XStatusIndicator >&
}
}
- if( !bErr )
+ if( !bBlock )
{
- if( !bBlock )
+ if( !WriteThroughComponent(
+ xModelComp, "settings.xml", xContext,
+ (bOASIS ? "com.sun.star.comp.Writer.XMLOasisSettingsExporter"
+ : "com.sun.star.comp.Writer.XMLSettingsExporter"),
+ aEmptyArgs, aProps ) )
{
- if( !WriteThroughComponent(
- xModelComp, "settings.xml", xContext,
- (bOASIS ? "com.sun.star.comp.Writer.XMLOasisSettingsExporter"
- : "com.sun.star.comp.Writer.XMLSettingsExporter"),
- aEmptyArgs, aProps ) )
+ if( !bWarn )
{
- if( !bWarn )
- {
- bWarn = true;
- sWarnFile = "settings.xml";
- }
+ bWarn = true;
+ sWarnFile = "settings.xml";
}
}
}
+ bool bErr = false;
+
OUString sErrFile;
if( !WriteThroughComponent(
xModelComp, "styles.xml", xContext,
commit 802adf5563d3fb190b7ce964bc10a3792f99ad04
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Aug 9 13:16:12 2015 +0100
cppcheck: uselessAssignmentPtrArg
Change-Id: I0b09092b7063b959a9b32ee276c7ae8f8cbb6abc
diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index aaae935..3cfb48d 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -215,7 +215,6 @@ static void lcl_addAspect(
if ( nAspect )
{
*pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_DRAW_ASPECT ), uno::makeAny( nAspect ) );
- pStates++;
}
}
}
@@ -246,7 +245,6 @@ static void lcl_addOutplaceProperties(
aAny <<= (sal_Int32)aSize.Height();
*pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_HEIGHT ), aAny );
- pStates++;
}
}
}
@@ -317,7 +315,6 @@ static void lcl_addFrameProperties(
Any aAny2;
aAny <<= nHeight;
*pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_FRAME_MARGIN_VERT ), aAny2 );
- pStates++;
}
}
commit cb164b1d115cb848abfba934d44a4d41ff84c6fe
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Aug 9 13:12:35 2015 +0100
cppcheck: arrayIndexThenCheck
Change-Id: I66dc4dd095d4e1a9d963b1c2c6a99b16d9f9bf61
diff --git a/onlineupdate/source/libmar/sign/nss_secutil.c b/onlineupdate/source/libmar/sign/nss_secutil.c
index ac8954c..01aa573 100644
--- a/onlineupdate/source/libmar/sign/nss_secutil.c
+++ b/onlineupdate/source/libmar/sign/nss_secutil.c
@@ -158,7 +158,7 @@ SECU_FilePasswd(PK11SlotInfo *slot, PRBool retry, void *arg)
int phraseLen;
/* handle the Windows EOL case */
- while (phrases[i] != '\r' && phrases[i] != '\n' && i < nb) i++;
+ while (i < nb && phrases[i] != '\r' && phrases[i] != '\n') i++;
/* terminate passphrase */
phrases[i++] = '\0';
/* clean up any EOL before the start of the next passphrase */
commit 85e14be20f1ba961ee5f5014a845e044ce8db39b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Aug 9 13:09:22 2015 +0100
cppcheck: redundantPointerOp
Change-Id: I0101893f5e8b65fb473a321e6169c3b610b33e60
diff --git a/store/source/store.cxx b/store/source/store.cxx
index 04b9cc1..a7c9875 100644
--- a/store/source/store.cxx
+++ b/store/source/store.cxx
@@ -164,7 +164,7 @@ storeError SAL_CALL store_openFile (
xManager->acquire();
- *phFile = static_cast<storeFileHandle>(&(*xManager));
+ *phFile = xManager.get();
return store_E_None;
}
commit 058c924c9385d003eefa728be7b23b2effd73913
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Aug 9 12:47:03 2015 +0100
cppcheck: unusedVariable
Change-Id: I11e9a952fdb401e08d6095fc36f0eb2dba6e2917
diff --git a/onlineupdate/source/libmar/tool/mar.c b/onlineupdate/source/libmar/tool/mar.c
index d14690f..0cf0d9c 100644
--- a/onlineupdate/source/libmar/tool/mar.c
+++ b/onlineupdate/source/libmar/tool/mar.c
@@ -124,7 +124,6 @@ int main(int argc, char **argv) {
const char *certNames[MAX_SIGNATURES];
char *MARChannelID = MAR_CHANNEL_ID;
char *productVersion = MOZ_APP_VERSION;
- uint32_t k;
int rv = -1;
uint32_t certCount = 0;
int32_t sigIndex = -1;
commit 758b5173993bc782e0759fb4db81bd9696e4b546
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Aug 9 12:43:00 2015 +0100
cppcheck: zerodiv
Change-Id: Iaf327051d59c39cbd61e1a64bdf1ee5af5cc4f3b
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index ad96b2d..3f0e6a3 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3670,7 +3670,7 @@ void DomainMapper_Impl::CloseFieldCommand()
PropertyMapPtr pCharContext = GetTopContext();
// dHeight is the font size of the current style.
double dHeight = 0;
- if (GetPropertyFromStyleSheet(PROP_CHAR_HEIGHT) >>= dHeight)
+ if ((GetPropertyFromStyleSheet(PROP_CHAR_HEIGHT) >>= dHeight) && dHeight != 0)
// Character escapement should be given in negative percents for subscripts.
pCharContext->Insert(PROP_CHAR_ESCAPEMENT, uno::makeAny( sal_Int16(- 100 * nDown / dHeight) ) );
appendTextPortion(aContent, pCharContext);
commit 8bc5b7a41f290ab4cc999cddf5d578843559ad1f
Author: Tor Lillqvist <tml at collabora.com>
Date: Mon Aug 10 13:58:37 2015 +0300
Add missing SAL_OVERRIDEs
It is really ugly to use SAL_OVERRIDE inconsistently.
Change-Id: I8b556a9cc65e6f71198d126d07ce1559216543e9
diff --git a/vcl/win/source/gdi/winlayout.hxx b/vcl/win/source/gdi/winlayout.hxx
index 196b8e9..528215f 100644
--- a/vcl/win/source/gdi/winlayout.hxx
+++ b/vcl/win/source/gdi/winlayout.hxx
@@ -41,7 +41,7 @@ class WinLayout : public SalLayout
{
public:
WinLayout(HDC, const ImplWinFontData&, ImplWinFontEntry&, bool bUseOpenGL);
- virtual void InitFont() const;
+ virtual void InitFont() const SAL_OVERRIDE;
void SetFontScale( float f ) { mfFontScale = f; }
HFONT DisableFontScaling() const;
@@ -71,22 +71,22 @@ public:
SimpleWinLayout(HDC, BYTE nCharSet, const ImplWinFontData&, ImplWinFontEntry&, bool bUseOpenGL);
virtual ~SimpleWinLayout();
- virtual bool LayoutText( ImplLayoutArgs& );
- virtual void AdjustLayout( ImplLayoutArgs& );
+ virtual bool LayoutText( ImplLayoutArgs& ) SAL_OVERRIDE;
+ virtual void AdjustLayout( ImplLayoutArgs& ) SAL_OVERRIDE;
virtual void DrawTextImpl(HDC hDC) const SAL_OVERRIDE;
virtual int GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int&,
DeviceCoordinate* pGlyphAdvances, int* pCharIndexes,
- const PhysicalFontFace** pFallbackFonts = NULL ) const;
+ const PhysicalFontFace** pFallbackFonts = NULL ) const SAL_OVERRIDE;
- virtual DeviceCoordinate FillDXArray( DeviceCoordinate* pDXArray ) const;
+ virtual DeviceCoordinate FillDXArray( DeviceCoordinate* pDXArray ) const SAL_OVERRIDE;
virtual sal_Int32 GetTextBreak(DeviceCoordinate nMaxWidth, DeviceCoordinate nCharExtra, int nFactor) const SAL_OVERRIDE;
- virtual void GetCaretPositions( int nArraySize, long* pCaretXArray ) const;
+ virtual void GetCaretPositions( int nArraySize, long* pCaretXArray ) const SAL_OVERRIDE;
// for glyph+font+script fallback
- virtual void MoveGlyph( int nStart, long nNewXPos );
- virtual void DropGlyph( int nStart );
- virtual void Simplify( bool bIsBase );
+ virtual void MoveGlyph( int nStart, long nNewXPos ) SAL_OVERRIDE;
+ virtual void DropGlyph( int nStart ) SAL_OVERRIDE;
+ virtual void Simplify( bool bIsBase ) SAL_OVERRIDE;
protected:
void Justify( DeviceCoordinate nNewWidth );
@@ -114,22 +114,22 @@ class UniscribeLayout : public WinLayout
public:
UniscribeLayout(HDC, const ImplWinFontData&, ImplWinFontEntry&, bool bUseOpenGL);
- virtual bool LayoutText( ImplLayoutArgs& );
- virtual void AdjustLayout( ImplLayoutArgs& );
+ virtual bool LayoutText( ImplLayoutArgs& ) SAL_OVERRIDE;
+ virtual void AdjustLayout( ImplLayoutArgs& ) SAL_OVERRIDE;
virtual void DrawTextImpl(HDC hDC) const SAL_OVERRIDE;
virtual int GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int&,
DeviceCoordinate* pGlyphAdvances, int* pCharPosAry,
- const PhysicalFontFace** pFallbackFonts = NULL ) const;
+ const PhysicalFontFace** pFallbackFonts = NULL ) const SAL_OVERRIDE;
- virtual DeviceCoordinate FillDXArray( DeviceCoordinate* pDXArray ) const;
+ virtual DeviceCoordinate FillDXArray( DeviceCoordinate* pDXArray ) const SAL_OVERRIDE;
virtual sal_Int32 GetTextBreak(DeviceCoordinate nMaxWidth, DeviceCoordinate nCharExtra, int nFactor) const SAL_OVERRIDE;
- virtual void GetCaretPositions( int nArraySize, long* pCaretXArray ) const;
+ virtual void GetCaretPositions( int nArraySize, long* pCaretXArray ) const SAL_OVERRIDE;
virtual bool IsKashidaPosValid ( int nCharPos ) const SAL_OVERRIDE;
// for glyph+font+script fallback
- virtual void MoveGlyph( int nStart, long nNewXPos );
- virtual void DropGlyph( int nStart );
- virtual void Simplify( bool bIsBase );
+ virtual void MoveGlyph( int nStart, long nNewXPos ) SAL_OVERRIDE;
+ virtual void DropGlyph( int nStart ) SAL_OVERRIDE;
+ virtual void Simplify( bool bIsBase ) SAL_OVERRIDE;
virtual void DisableGlyphInjection( bool bDisable ) SAL_OVERRIDE { mbDisableGlyphInjection = bDisable; }
protected:
@@ -184,7 +184,7 @@ public:
throw()
: GraphiteLayout(pFace), mrFont(rFont) {};
virtual ~GraphiteLayoutWinImpl() throw() {};
- virtual sal_GlyphId getKashidaGlyph(int & rWidth);
+ virtual sal_GlyphId getKashidaGlyph(int & rWidth) SAL_OVERRIDE;
private:
ImplWinFontEntry & mrFont;
};
@@ -201,25 +201,25 @@ public:
virtual ~GraphiteWinLayout();
// used by upper layers
- virtual bool LayoutText( ImplLayoutArgs& ); // first step of layout
- virtual void AdjustLayout( ImplLayoutArgs& ); // adjusting after fallback etc.
+ virtual bool LayoutText( ImplLayoutArgs& ) SAL_OVERRIDE; // first step of layout
+ virtual void AdjustLayout( ImplLayoutArgs& ) SAL_OVERRIDE; // adjusting after fallback etc.
virtual void DrawTextImpl(HDC hDC) const SAL_OVERRIDE;
// methods using string indexing
virtual sal_Int32 GetTextBreak(DeviceCoordinate nMaxWidth, DeviceCoordinate nCharExtra=0, int nFactor=1) const SAL_OVERRIDE;
- virtual DeviceCoordinate FillDXArray( DeviceCoordinate* pDXArray ) const;
+ virtual DeviceCoordinate FillDXArray( DeviceCoordinate* pDXArray ) const SAL_OVERRIDE;
- virtual void GetCaretPositions( int nArraySize, long* pCaretXArray ) const;
+ virtual void GetCaretPositions( int nArraySize, long* pCaretXArray ) const SAL_OVERRIDE;
// methods using glyph indexing
virtual int GetNextGlyphs(int nLen, sal_GlyphId* pGlyphIdxAry, ::Point & rPos, int&,
DeviceCoordinate* pGlyphAdvAry = NULL, int* pCharPosAry = NULL,
- const PhysicalFontFace** pFallbackFonts = NULL ) const;
+ const PhysicalFontFace** pFallbackFonts = NULL ) const SAL_OVERRIDE;
// used by glyph+font+script fallback
- virtual void MoveGlyph( int nStart, long nNewXPos );
- virtual void DropGlyph( int nStart );
- virtual void Simplify( bool bIsBase );
+ virtual void MoveGlyph( int nStart, long nNewXPos ) SAL_OVERRIDE;
+ virtual void DropGlyph( int nStart ) SAL_OVERRIDE;
+ virtual void Simplify( bool bIsBase ) SAL_OVERRIDE;
};
#endif // ENABLE_GRAPHITE
commit 3d0e2bb23141dabacdcfa325e9cbad1ae58b7329
Author: Tor Lillqvist <tml at collabora.com>
Date: Mon Aug 10 10:26:02 2015 +0300
Avoid some ugly and pointless initial double colons
Change-Id: I0d0cb1ef1e7b7f4747204b84c7c910f174e9c7b5
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index d67fa1e..47c47d5 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -107,7 +107,7 @@ inline int ImplWinFontEntry::GetCachedGlyphWidth( int nCharCode ) const
WinLayout::WinLayout(HDC hDC, const ImplWinFontData& rWFD, ImplWinFontEntry& rWFE, bool bUseOpenGL)
: mhDC( hDC ),
- mhFont( (HFONT)::GetCurrentObject(hDC,OBJ_FONT) ),
+ mhFont( (HFONT)GetCurrentObject(hDC,OBJ_FONT) ),
mnBaseAdv( 0 ),
mfFontScale( 1.0 ),
mrWinFontData( rWFD ),
@@ -117,7 +117,7 @@ WinLayout::WinLayout(HDC hDC, const ImplWinFontData& rWFD, ImplWinFontEntry& rWF
void WinLayout::InitFont() const
{
- ::SelectObject( mhDC, mhFont );
+ SelectObject( mhDC, mhFont );
}
// Using reasonably sized fonts to emulate huge fonts works around
@@ -132,10 +132,10 @@ HFONT WinLayout::DisableFontScaling() const
return 0;
LOGFONTW aLogFont;
- ::GetObjectW( mhFont, sizeof(LOGFONTW), &aLogFont);
+ GetObjectW( mhFont, sizeof(LOGFONTW), &aLogFont);
aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight);
aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth);
- HFONT hHugeFont = ::CreateFontIndirectW( &aLogFont);
+ HFONT hHugeFont = CreateFontIndirectW( &aLogFont);
if( !hHugeFont )
return 0;
@@ -282,7 +282,7 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs )
if( rArgs.mnFlags & SalLayoutFlags::KerningAsian )
{
TEXTMETRICA aTextMetricA;
- if( ::GetTextMetricsA( mhDC, &aTextMetricA )
+ if( GetTextMetricsA( mhDC, &aTextMetricA )
&& !(aTextMetricA.tmPitchAndFamily & TMPF_FIXED_PITCH) && !(aTextMetricA.tmCharSet == 0x86) )
rArgs.mnFlags &= ~SalLayoutFlags::KerningAsian;
}
@@ -339,7 +339,7 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs )
// in the RTL case mirror the character and remember its RTL status
if( bIsRTL )
{
- cChar = ::GetMirroredChar( cChar );
+ cChar = GetMirroredChar( cChar );
mpGlyphRTLFlags[ mnGlyphCount ] = true;
}
@@ -389,12 +389,12 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs )
{
ABC aABC;
SIZE aExtent;
- if( ::GetTextExtentPoint32W( mhDC, &pCodes[0], bSurrogate ? 2 : 1, &aExtent) )
+ if( GetTextExtentPoint32W( mhDC, &pCodes[0], bSurrogate ? 2 : 1, &aExtent) )
nGlyphWidth = aExtent.cx;
- else if( ::GetCharABCWidthsW( mhDC, nCharCode, nCharCode, &aABC ) )
+ else if( GetCharABCWidthsW( mhDC, nCharCode, nCharCode, &aABC ) )
nGlyphWidth = aABC.abcA + aABC.abcB + aABC.abcC;
- else if( !::GetCharWidth32W( mhDC, nCharCode, nCharCode, &nGlyphWidth )
- && !::GetCharWidthW( mhDC, nCharCode, nCharCode, &nGlyphWidth ) )
+ else if( !GetCharWidth32W( mhDC, nCharCode, nCharCode, &nGlyphWidth )
+ && !GetCharWidthW( mhDC, nCharCode, nCharCode, &nGlyphWidth ) )
nGlyphWidth = 0;
mrWinFontEntry.CacheGlyphWidth( nCharCode, nGlyphWidth );
}
@@ -432,7 +432,7 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs )
SIZE aExtent;
WCHAR cNotDef = rArgs.mpStr[ nCharPos ];
mnNotdefWidth = 0;
- if( ::GetTextExtentPoint32W( mhDC, &cNotDef, 1, &aExtent) )
+ if( GetTextExtentPoint32W( mhDC, &cNotDef, 1, &aExtent) )
mnNotdefWidth = aExtent.cx;
}
// use a better NotDef glyph
@@ -612,20 +612,20 @@ void SimpleWinLayout::DrawTextImpl(HDC hDC) const
// #108267#,#109387# break up string into smaller chunks
// the output positions will be updated by windows (SetTextAlign)
POINT oldPos;
- UINT oldTa = ::GetTextAlign(hDC);
- ::SetTextAlign(hDC, (oldTa & ~TA_NOUPDATECP) | TA_UPDATECP);
- ::MoveToEx(hDC, aPos.X(), aPos.Y(), &oldPos);
+ UINT oldTa = GetTextAlign(hDC);
+ SetTextAlign(hDC, (oldTa & ~TA_NOUPDATECP) | TA_UPDATECP);
+ MoveToEx(hDC, aPos.X(), aPos.Y(), &oldPos);
unsigned int i = 0;
for( unsigned int n = 0; n < numGlyphPortions; ++n, i+=maxGlyphCount )
{
- ::ExtTextOutW(hDC, 0, 0, mnDrawOptions, NULL, mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i);
+ ExtTextOutW(hDC, 0, 0, mnDrawOptions, NULL, mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i);
}
- ::ExtTextOutW(hDC, 0, 0, mnDrawOptions, NULL, mpOutGlyphs+i, remainingGlyphs, mpGlyphAdvances+i);
- ::MoveToEx(hDC, oldPos.x, oldPos.y, (LPPOINT) NULL);
- ::SetTextAlign(hDC, oldTa);
+ ExtTextOutW(hDC, 0, 0, mnDrawOptions, NULL, mpOutGlyphs+i, remainingGlyphs, mpGlyphAdvances+i);
+ MoveToEx(hDC, oldPos.x, oldPos.y, (LPPOINT) NULL);
+ SetTextAlign(hDC, oldTa);
}
else
- ::ExtTextOutW(hDC, aPos.X(), aPos.Y(), mnDrawOptions, NULL, mpOutGlyphs, mnGlyphCount, mpGlyphAdvances);
+ ExtTextOutW(hDC, aPos.X(), aPos.Y(), mnDrawOptions, NULL, mpOutGlyphs, mnGlyphCount, mpGlyphAdvances);
if( hOrigFont )
DeleteFont(SelectFont(hDC, hOrigFont));
@@ -966,8 +966,8 @@ static bool bManualCellAlign = true;
static bool InitUSP()
{
// get the usp10.dll version info
- HMODULE usp10 = ::GetModuleHandle("usp10.dll");
- void *pScriptIsComplex = reinterpret_cast< void* >( ::GetProcAddress(usp10, "ScriptIsComplex"));
+ HMODULE usp10 = GetModuleHandle("usp10.dll");
+ void *pScriptIsComplex = reinterpret_cast< void* >( GetProcAddress(usp10, "ScriptIsComplex"));
int nUspVersion = 0;
rtl_uString* pModuleURL = NULL;
osl_getModuleURLFromAddress( pScriptIsComplex, &pModuleURL );
@@ -980,13 +980,13 @@ static bool InitUSP()
if( pModuleFileCStr )
{
DWORD nHandle;
- DWORD nBufSize = ::GetFileVersionInfoSizeW( const_cast<LPWSTR>(reinterpret_cast<LPCWSTR>(pModuleFileCStr)), &nHandle );
+ DWORD nBufSize = GetFileVersionInfoSizeW( const_cast<LPWSTR>(reinterpret_cast<LPCWSTR>(pModuleFileCStr)), &nHandle );
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list