[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.0' - 3 commits - configure.ac filter/source include/svtools svtools/source
Tomaž Vajngerl
tomaz.vajngerl at collabora.com
Mon Oct 19 05:31:08 PDT 2015
configure.ac | 18 ++++++++++++++++++
filter/source/graphic/GraphicExportFilter.cxx | 5 ++++-
include/svtools/DocumentToGraphicRenderer.hxx | 3 ++-
svtools/source/filter/DocumentToGraphicRenderer.cxx | 9 ++++++++-
4 files changed, 32 insertions(+), 3 deletions(-)
New commits:
commit cc2e615219bd434b81ec826401413bf1d18ce104
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Mon Oct 19 14:04:21 2015 +0200
Writer image export: cmd. line, default to white background
This commit fixes the writer image export (jpeg, png) that didn't
work because the export pixel size was set to 0 by default. Now
the default is set to document size (which depends on system DPI).
When exporting to a PNG the background was transparent, which may
not be desired. The background color is now by default white and
can be changed for DocumentToGraphicRenderer, but the dialog or
command line don't support such an option - for now.
Change-Id: I16ffd3cd60c47b52768f43ae4c4c170fc821033b
diff --git a/filter/source/graphic/GraphicExportFilter.cxx b/filter/source/graphic/GraphicExportFilter.cxx
index 2f4caba..604e4b3 100644
--- a/filter/source/graphic/GraphicExportFilter.cxx
+++ b/filter/source/graphic/GraphicExportFilter.cxx
@@ -112,7 +112,10 @@ sal_Bool SAL_CALL GraphicExportFilter::filter( const Sequence<PropertyValue>& rD
Size aTargetSizePixel(mTargetWidth, mTargetHeight);
- Graphic aGraphic = aRenderer.renderToGraphic( aCurrentPage, aDocumentSizePixel, aTargetSizePixel );
+ if (mTargetWidth == 0 || mTargetHeight == 0)
+ aTargetSizePixel = aDocumentSizePixel;
+
+ Graphic aGraphic = aRenderer.renderToGraphic(aCurrentPage, aDocumentSizePixel, aTargetSizePixel, COL_WHITE);
GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
diff --git a/include/svtools/DocumentToGraphicRenderer.hxx b/include/svtools/DocumentToGraphicRenderer.hxx
index 68cdf2a..09de00e 100644
--- a/include/svtools/DocumentToGraphicRenderer.hxx
+++ b/include/svtools/DocumentToGraphicRenderer.hxx
@@ -49,7 +49,8 @@ public:
Size getDocumentSizeIn100mm( sal_Int32 aCurrentPage );
- Graphic renderToGraphic(sal_Int32 aCurrentPage, Size aDocumentSizePixel, Size aTargetSizePixel);
+ Graphic renderToGraphic(sal_Int32 aCurrentPage, Size aDocumentSizePixel,
+ Size aTargetSizePixel, Color aPageColor = COL_TRANSPARENT);
};
#endif
diff --git a/svtools/source/filter/DocumentToGraphicRenderer.cxx b/svtools/source/filter/DocumentToGraphicRenderer.cxx
index d410f4c..e33a94e 100644
--- a/svtools/source/filter/DocumentToGraphicRenderer.cxx
+++ b/svtools/source/filter/DocumentToGraphicRenderer.cxx
@@ -94,7 +94,8 @@ Size DocumentToGraphicRenderer::getDocumentSizeIn100mm(sal_Int32 aCurrentPage)
Graphic DocumentToGraphicRenderer::renderToGraphic(
sal_Int32 aCurrentPage,
Size aDocumentSizePixel,
- Size aTargetSizePixel)
+ Size aTargetSizePixel,
+ Color aPageColor)
{
if (!mxModel.is() || !mxController.is() || !mxRenderable.is())
@@ -127,6 +128,12 @@ Graphic DocumentToGraphicRenderer::renderToGraphic(
aMtf.Record( pOutputDev );
+ if (aPageColor != Color(COL_TRANSPARENT))
+ {
+ pOutputDev->SetBackground(Wallpaper(aPageColor));
+ pOutputDev->Erase();
+ }
+
uno::Any aSelection;
aSelection <<= mxDocument;
mxRenderable->render(aCurrentPage - 1, aSelection, renderProps );
commit 6406d0b2bcdd69293f2553c7a73d9fb404df524e
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date: Wed Oct 14 14:02:14 2015 +0200
add warning with install command when android support repository is missing
Change-Id: I21f4bc6fe6cb10e57c45880a4b6d1be2e4fb88d2
(cherry picked from commit 7df1b63be25d7b7eaeccb3b13a81b4370240bc10)
diff --git a/configure.ac b/configure.ac
index 7710d8f..e33c888 100644
--- a/configure.ac
+++ b/configure.ac
@@ -815,6 +815,14 @@ if echo "$host_os" | grep -q linux-android ; then
add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION"
add_warning "or adjust $SRC_ROOT/android/source/build.gradle accordingly"
fi
+ if test ! -f "$ANDROID_SDK_HOME/extras/android/m2repository/source.properties"; then
+ AC_MSG_WARN([android support repository not found - install with
+ $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository
+ to allow the build to download the specified version of the android support libraries])
+ add_warning "android support repository not found - install with"
+ add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository"
+ add_warning "to allow the build to download the specified version of the android support libraries"
+ fi
fi
if test "$_os" = "AIX"; then
commit 3140e1b17d9f8dc50d8eb1c8789462f2a1b51a48
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date: Tue Oct 13 12:47:07 2015 +0200
add warning with install instructions when android build-tools are not found
Change-Id: I987262e4e9ae99c889285658fc9f840655d29191
(cherry picked from commit 2ca4748a2e04b37c18f6f572bcf323cd857fef34)
diff --git a/configure.ac b/configure.ac
index 6ec22c2..7710d8f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -805,6 +805,16 @@ if echo "$host_os" | grep -q linux-android ; then
if test ! -d "$ANDROID_SDK_HOME/platforms"; then
AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
fi
+
+ BUILD_TOOLS_VERSION=`$SED -n -e 's/.*buildToolsVersion "\(.*\)"/\1/p' $SRC_ROOT/android/source/build.gradle`
+ if test ! -d "$ANDROID_SDK_HOME/build-tools/$BUILD_TOOLS_VERSION"; then
+ AC_MSG_WARN([android build-tools $BUILD_TOOLS_VERSION not found - install with
+ $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION
+ or adjust change $SRC_ROOT/android/source/build.gradle accordingly])
+ add_warning "android build-tools $BUILD_TOOLS_VERSION not found - install with"
+ add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION"
+ add_warning "or adjust $SRC_ROOT/android/source/build.gradle accordingly"
+ fi
fi
if test "$_os" = "AIX"; then
More information about the Libreoffice-commits
mailing list