[Libreoffice-commits] .: 2 commits - filter/source sd/CppunitTest_sd_filters_test.mk sd/Module_sd.mk
Thorsten Behrens
thorsten at kemper.freedesktop.org
Tue Jan 24 14:21:14 PST 2012
filter/source/svg/svgexport.cxx | 38 +++++++-------------------------------
filter/source/svg/svgreader.cxx | 6 +++---
filter/source/svg/svgwriter.hxx | 6 ------
sd/CppunitTest_sd_filters_test.mk | 2 +-
sd/Module_sd.mk | 13 +------------
5 files changed, 12 insertions(+), 53 deletions(-)
New commits:
commit efc28fae8d9453ff313f363d28e5a94ccd3adc4a
Author: Thorsten Behrens <tbehrens at suse.com>
Date: Tue Jan 24 23:19:22 2012 +0100
Disable svg font embedding for sd filters test, enable again.
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 1d63611..24aa950 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -27,8 +27,6 @@
************************************************************************/
-#define ITEMID_FIELD 0
-
#include "svgwriter.hxx"
#include "svgfontexport.hxx"
#include "svgfilter.hxx"
@@ -37,6 +35,7 @@
#include <com/sun/star/util/MeasureUnit.hpp>
+#include <rtl/bootstrap.hxx>
#include <svtools/miscopt.hxx>
#include <svx/unopage.hxx>
#include <svx/unoshape.hxx>
@@ -488,9 +487,14 @@ sal_Bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
// font embedding
const char* pSVGDisableFontEmbedding = getenv( "SVG_DISABLE_FONT_EMBEDDING" );
+ rtl::OUString aEmbedFontEnv(
+ RTL_CONSTASCII_USTRINGPARAM("${SVG_DISABLE_FONT_EMBEDDING}"));
+ rtl::Bootstrap::expandMacros(aEmbedFontEnv);
+ const bool bEmbedFonts=pSVGDisableFontEmbedding ? false : (
+ aEmbedFontEnv.getLength() ? false : true);
maFilterData[ 1 ].Name = B2UCONST( SVG_PROP_EMBEDFONTS );
- maFilterData[ 1 ].Value <<= (sal_Bool) ( pSVGDisableFontEmbedding ? sal_False : sal_True );
+ maFilterData[ 1 ].Value <<= (sal_Bool) (bEmbedFonts);
// Native decoration
maFilterData[ 2 ].Name = B2UCONST( SVG_PROP_NATIVEDECORATION );
diff --git a/sd/CppunitTest_sd_filters_test.mk b/sd/CppunitTest_sd_filters_test.mk
index b4de440..5b89b8f 100644
--- a/sd/CppunitTest_sd_filters_test.mk
+++ b/sd/CppunitTest_sd_filters_test.mk
@@ -123,7 +123,7 @@ $(eval $(call gb_CppunitTest_add_old_components,sd_filters_test,\
$(eval $(call gb_CppunitTest_set_args,sd_filters_test,\
--headless \
--protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
- "-env:CONFIGURATION_LAYERS=xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry) module:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry/spool)" \
+ "-env:CONFIGURATION_LAYERS=xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry) -env:SVG_DISABLE_FONT_EMBEDDING=YEAH module:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry/spool)" \
))
# .../spool is required for the (somewhat strange) filter configuration
diff --git a/sd/Module_sd.mk b/sd/Module_sd.mk
index f015d04..edc6f25 100644
--- a/sd/Module_sd.mk
+++ b/sd/Module_sd.mk
@@ -52,18 +52,7 @@ endif
$(eval $(call gb_Module_add_subsequentcheck_targets,sd,\
JunitTest_sd_unoapi \
+ CppunitTest_sd_regression_test \
))
-#TODO: Disabled for now, needs work by Thorsten Behrens to get "don't embed font
-# config" taken into account, otherwise leads to failures like
-# regression-test.cxx:84:Assertion
-# Test name: SdFiltersTest::test
-# assertion failed
-# - Expression: false
-# - Mismatch between reference file and exported file in line 60.
-# Expected: <font-face font-family="StarSymbol embedded" units-per-em="2048"
-# font-weight="normal" font-style="normal" ascent="1693" descent="318"/>
-# Found : <font-face font-family="StarSymbol embedded" units-per-em="2048"
-# font-weight="normal" font-style="normal" ascent="1640" descent="397"/>
-# CppunitTest_sd_regression_test \
# vim: set noet sw=4 ts=4:
commit e5e0aae1e220cdde7b06c899425dcabd912048d1
Author: Thorsten Behrens <tbehrens at suse.com>
Date: Tue Jan 24 22:23:19 2012 +0100
Remove dead code from svg filter
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 905bd62..1d63611 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -38,7 +38,6 @@
#include <com/sun/star/util/MeasureUnit.hpp>
#include <svtools/miscopt.hxx>
-#include <svtools/FilterConfigItem.hxx>
#include <svx/unopage.hxx>
#include <svx/unoshape.hxx>
#include <svx/svdpage.hxx>
@@ -482,18 +481,6 @@ sal_Bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
// if no filter data is given use stored/prepared ones
if( !maFilterData.getLength() )
{
-#ifdef _SVG_USE_CONFIG
- FilterConfigItem aCfgItem( String( RTL_CONSTASCII_USTRINGPARAM( SVG_EXPORTFILTER_CONFIGPATH ) ) );
-
- aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( SVG_PROP_TINYPROFILE ) ), sal_True );
- aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( SVG_PROP_EMBEDFONTS ) ), sal_True );
- aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( SVG_PROP_NATIVEDECORATION ) ), sal_False );
- aCfgItem.ReadString( String( RTL_CONSTASCII_USTRINGPARAM( SVG_PROP_NATIVEDECORATION ) ), B2UCONST( "xlist" ) );
- aCfgItem.ReadString( String( RTL_CONSTASCII_USTRINGPARAM( SVG_PROP_OPACITY ) ), sal_True );
- aCfgItem.ReadString( String( RTL_CONSTASCII_USTRINGPARAM( SVG_PROP_GRADIENT ) ), sal_True );
-
- maFilterData = aCfgItem.GetFilterData();
-#else
maFilterData.realloc( 6 );
maFilterData[ 0 ].Name = B2UCONST( SVG_PROP_TINYPROFILE );
@@ -526,7 +513,6 @@ sal_Bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
// Tiny Gradient
maFilterData[ 5 ].Name = B2UCONST( SVG_PROP_GRADIENT );
maFilterData[ 5 ].Value <<= (sal_Bool) sal_False;
-#endif
}
if( xOStm.is() && xServiceFactory.is() )
@@ -713,20 +699,6 @@ sal_Bool SVGFilter::implExportDocument()
if( mpSVGExport->IsUseTinyProfile() )
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "baseProfile", B2UCONST( "tiny" ) );
-// enabling _SVG_WRITE_EXTENTS means that the slide size is not adapted
-// to the size of the browser window, moreover the slide is top left aligned
-// instead of centered.
-#undef _SVG_WRITE_EXTENTS
-#ifdef _SVG_WRITE_EXTENTS
- aAttr = OUString::valueOf( nDocWidth * 0.01 );
- aAttr += B2UCONST( "mm" );
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "width", aAttr );
-
- aAttr = OUString::valueOf( nDocHeight * 0.01 );
- aAttr += B2UCONST( "mm" );
- mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "height", aAttr );
-#endif
-
aAttr = B2UCONST( "0 0 " );
aAttr += OUString::valueOf( nDocWidth );
aAttr += B2UCONST( " " );
diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx
index c25bdbc..f941cba 100644
--- a/filter/source/svg/svgreader.cxx
+++ b/filter/source/svg/svgreader.cxx
@@ -1771,7 +1771,7 @@ static void writeShapes( StatePool& rStat
visitElements(aVisitor, xElem);
}
-#ifdef VERBOSE
+#if OSL_DEBUG_LEVEL > 2
struct DumpingVisitor
{
void operator()( const uno::Reference<xml::dom::XElement>& xElem )
@@ -1986,7 +1986,7 @@ sal_Bool SVGReader::parseAndConvert()
annotateStyles(aStatePool,aStateMap,aInitialState,
xDocElem,m_xDocumentHandler);
-#ifdef VERBOSE
+#if OSL_DEBUG_LEVEL > 2
dumpTree(xDocElem);
#endif
@@ -2767,7 +2767,7 @@ bool importSvg(SvStream & rStream, Graphic & rGraphic )
uno::Reference<xml::sax::XDocumentHandler>());
svgi::visitElements(aVisitor, xDocElem);
-#ifdef VERBOSE
+#if OSL_DEBUG_LEVEL > 2
dumpTree(xDocElem);
#endif
diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx
index 75a50b8..4b9e2fa 100644
--- a/filter/source/svg/svgwriter.hxx
+++ b/filter/source/svg/svgwriter.hxx
@@ -60,12 +60,6 @@
// -----------------------------------------------------------------------------
-#define _SVG_WRITE_EXTENTS 1
-#undef _SVG_WRITE_TEXT_DESC
-#undef _SVG_USE_CONFIG
-
-// -----------------------------------------------------------------------------
-
#define NMSP_CPPU cppu
#define NMSP_UNO com::sun::star::uno
#define NMSP_LANG com::sun::star::lang
More information about the Libreoffice-commits
mailing list