[Libreoffice-commits] .: 2 commits - config/config_graphite.h.in config/.gitignore configure.ac sax/inc sax/source sc/source solenv/gbuild sw/source vcl/generic vcl/inc vcl/Library_vcl.mk vcl/source vcl/unx vcl/win

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Dec 19 03:20:24 PST 2012


 config/.gitignore                    |    4 -
 config/config_graphite.h.in          |    6 +
 configure.ac                         |    2 
 sax/inc/sax/fshelper.hxx             |  127 ++++++++++++++++++++++++++++++-----
 sax/source/tools/fshelper.cxx        |   18 +++-
 sc/source/filter/excel/xestream.cxx  |    4 -
 sc/source/filter/inc/xestream.hxx    |   36 +++++++++
 solenv/gbuild/gbuild.mk              |    1 
 sw/source/core/text/itrform2.cxx     |    2 
 vcl/Library_vcl.mk                   |    5 -
 vcl/generic/glyphs/gcach_ftyp.cxx    |    1 
 vcl/generic/glyphs/gcach_ftyp.hxx    |    1 
 vcl/generic/glyphs/glyphcache.cxx    |    1 
 vcl/generic/print/genpspgraphics.cxx |    1 
 vcl/inc/generic/glyphcache.hxx       |    1 
 vcl/inc/win/salgdi.h                 |    1 
 vcl/source/gdi/outdev3.cxx           |    1 
 vcl/unx/generic/gdi/salgdi.cxx       |    2 
 vcl/unx/generic/gdi/salgdi3.cxx      |    1 
 vcl/win/source/gdi/salgdi3.cxx       |    1 
 vcl/win/source/gdi/winlayout.cxx     |    1 
 21 files changed, 182 insertions(+), 35 deletions(-)

New commits:
commit 9c17f2b24bc97b46640b1728fb04d65b88c09f75
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Wed Dec 19 12:13:13 2012 +0100

    wrap vararg sax functions in typesafe overloads
    
    Now automatic conversions can take place (no getStr() needed),
    and there are compile errors when used improperly. The FSEND terminator
    is also no longer needed, but it's better to dump it only after
    forgetting it no longer silently breaks backports.
    
    Change-Id: Ib47e6eda2d5e12ce889b69bf2affbda3679c2d3f

diff --git a/sax/inc/sax/fshelper.hxx b/sax/inc/sax/fshelper.hxx
index c416c2a..b0b8b09 100644
--- a/sax/inc/sax/fshelper.hxx
+++ b/sax/inc/sax/fshelper.hxx
@@ -28,7 +28,37 @@
 #include <sax/fastattribs.hxx>
 
 #define FSNS(namespc, element) ((namespc << 16) | element)
-const sal_Int32 FSEND = -1; // same as XML_TOKEN_INVALID
+// Backwards compatibility for code that used FSEND to terminate the vararg.
+// As soon as no supported LO version has the varargs code, this can be removed entirely
+// (otherwise backports might break silently if people didn't add FSEND).
+// Ctor is there to get an error when trying to pass it to a vararg by accident.
+struct FSEND_t { FSEND_t() {}; };
+static const FSEND_t FSEND = FSEND_t();
+const sal_Int32 FSEND_internal = -1; // same as XML_TOKEN_INVALID
+
+#define SAX_ARGS_ARG( arg1, arg2, convert, num ) arg1##num, arg2##num convert
+#define SAX_ARGS_ARG1( arg1, arg2, convert ) SAX_ARGS_ARG( arg1, arg2, convert, 1 )
+#define SAX_ARGS_ARG2( arg1, arg2, convert ) SAX_ARGS_ARG1( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 2 )
+#define SAX_ARGS_ARG3( arg1, arg2, convert ) SAX_ARGS_ARG2( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 3 )
+#define SAX_ARGS_ARG4( arg1, arg2, convert ) SAX_ARGS_ARG3( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 4 )
+#define SAX_ARGS_ARG5( arg1, arg2, convert ) SAX_ARGS_ARG4( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 5 )
+#define SAX_ARGS_ARG6( arg1, arg2, convert ) SAX_ARGS_ARG5( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 6 )
+#define SAX_ARGS_ARG7( arg1, arg2, convert ) SAX_ARGS_ARG6( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 7 )
+#define SAX_ARGS_ARG8( arg1, arg2, convert ) SAX_ARGS_ARG7( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 8 )
+#define SAX_ARGS_ARG9( arg1, arg2, convert ) SAX_ARGS_ARG8( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 9 )
+#define SAX_ARGS_ARG10( arg1, arg2, convert ) SAX_ARGS_ARG9( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 10 )
+#define SAX_ARGS_ARG11( arg1, arg2, convert ) SAX_ARGS_ARG10( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 11 )
+#define SAX_ARGS_ARG12( arg1, arg2, convert ) SAX_ARGS_ARG11( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 12 )
+#define SAX_ARGS_ARG13( arg1, arg2, convert ) SAX_ARGS_ARG12( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 13 )
+#define SAX_ARGS_ARG14( arg1, arg2, convert ) SAX_ARGS_ARG13( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 14 )
+#define SAX_ARGS_ARG15( arg1, arg2, convert ) SAX_ARGS_ARG14( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 15 )
+#define SAX_ARGS_ARG16( arg1, arg2, convert ) SAX_ARGS_ARG15( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 16 )
+#define SAX_ARGS_ARG17( arg1, arg2, convert ) SAX_ARGS_ARG16( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 17 )
+#define SAX_ARGS_ARG18( arg1, arg2, convert ) SAX_ARGS_ARG17( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 18 )
+#define SAX_ARGS_ARG19( arg1, arg2, convert ) SAX_ARGS_ARG18( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 19 )
+#define SAX_ARGS_ARG20( arg1, arg2, convert ) SAX_ARGS_ARG19( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 20 )
+#define SAX_ARGS_ARG21( arg1, arg2, convert ) SAX_ARGS_ARG20( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 21 )
+#define SAX_ARGS_ARG22( arg1, arg2, convert ) SAX_ARGS_ARG21( arg1, arg2, convert ), SAX_ARGS_ARG( arg1, arg2, convert, 22 )
 
 namespace sax_fastparser {
 
@@ -46,30 +76,53 @@ public:
 
     ~FastSerializerHelper();
 
-    void startElementV(sal_Int32 elementTokenId, va_list args);
-    void singleElementV(sal_Int32 elementTokenId, va_list args);
-
-    inline void startElement(sal_Int32 elementTokenId, ...)
-        { va_list args; va_start( args, elementTokenId ); startElementV( elementTokenId, args ); va_end( args ); }
-    inline void singleElement(sal_Int32 elementTokenId, ...)
-        { va_list args; va_start( args, elementTokenId ); singleElementV( elementTokenId, args ); va_end( args ); }
-    inline void startElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, ...)
-        { va_list args; va_start( args, elementTokenId ); startElementV( FSNS( namespaceTokenId, elementTokenId), args ); va_end( args ); }
-    inline void singleElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, ...)
-        { va_list args; va_start( args, elementTokenId ); singleElementV( FSNS( namespaceTokenId, elementTokenId), args ); va_end( args ); }
+    /// Start an element. After the first argument there can be a number of (attribute, value) pairs.
+    void startElement(sal_Int32 elementTokenId, FSEND_t)
+        { startElementInternal( elementTokenId, FSEND_internal ); }
+    /// overload
+    void startElement(sal_Int32 elementTokenId, sal_Int32 attribute, const char* value, FSEND_t)
+        { startElementInternal( elementTokenId, attribute, value, FSEND_internal ); }
+    /// overload
+    void startElement(sal_Int32 elementTokenId, sal_Int32 attribute, const OString& value, FSEND_t)
+        { startElementInternal( elementTokenId, attribute, value.getStr(), FSEND_internal ); }
+    /// Create a single element. After the first argument there can be a number of (attribute, value) pairs.
+    void singleElement(sal_Int32 elementTokenId, FSEND_t)
+        { singleElementInternal( elementTokenId, FSEND_internal ); }
+    /// overload
+    void singleElement(sal_Int32 elementTokenId, sal_Int32 attribute, const char* value, FSEND_t)
+        { singleElementInternal( elementTokenId, attribute, value, FSEND_internal ); }
+    /// overload
+    void singleElement(sal_Int32 elementTokenId, sal_Int32 attribute, const OString& value, FSEND_t)
+        { singleElementInternal( elementTokenId, attribute, value.getStr(), FSEND_internal ); }
+    /// Start an element. After the first two arguments there can be a number of (attribute, value) pairs.
+    void startElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, FSEND_t)
+        { startElementInternal( FSNS( namespaceTokenId, elementTokenId), FSEND_internal ); }
+    /// overload
+    void startElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, sal_Int32 attribute, const char* value, FSEND_t)
+        { startElementInternal( FSNS( namespaceTokenId, elementTokenId), attribute, value, FSEND_internal ); }
+    /// overload
+    void startElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, sal_Int32 attribute, const OString& value, FSEND_t)
+        { startElementInternal( FSNS( namespaceTokenId, elementTokenId), attribute, value.getStr(), FSEND_internal ); }
+    /// Create a single element. After the first two arguments there can be a number of (attribute, value) pairs.
+    void singleElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, FSEND_t)
+        { singleElementInternal( FSNS( namespaceTokenId, elementTokenId), FSEND_internal ); }
+    /// overload
+    void singleElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, sal_Int32 attribute, const char* value, FSEND_t)
+        { singleElementInternal( FSNS( namespaceTokenId, elementTokenId), attribute, value, FSEND_internal ); }
+    /// overload
+    void singleElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, sal_Int32 attribute, const OString& value, FSEND_t)
+        { singleElementInternal( FSNS( namespaceTokenId, elementTokenId), attribute, value.getStr(), FSEND_internal ); }
     void endElement(sal_Int32 elementTokenId);
     inline void endElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId)
         { endElement( FSNS( namespaceTokenId, elementTokenId ) ); }
 
-    inline void singleElement(sal_Int32 elementTokenId, XFastAttributeListRef xAttrList)
-        { singleElementV(elementTokenId, xAttrList); }
-    void singleElementV(sal_Int32 elementTokenId, XFastAttributeListRef xAttrList);
+    void singleElement(sal_Int32 elementTokenId, XFastAttributeListRef xAttrList);
     inline void singleElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, XFastAttributeListRef xAttrList)
-        { singleElementV(FSNS( namespaceTokenId, elementTokenId), xAttrList); }
+        { singleElement(FSNS( namespaceTokenId, elementTokenId), xAttrList); }
 
-    void startElementV(sal_Int32 elementTokenId, XFastAttributeListRef xAttrList);
+    void startElement(sal_Int32 elementTokenId, XFastAttributeListRef xAttrList);
     inline void startElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, XFastAttributeListRef xAttrList)
-        { startElementV( FSNS( namespaceTokenId, elementTokenId ), xAttrList ); }
+        { startElement( FSNS( namespaceTokenId, elementTokenId ), xAttrList ); }
 
     FastSerializerHelper* write(const char* value);
     FastSerializerHelper* write(const rtl::OUString& value);
@@ -90,7 +143,45 @@ public:
             ::com::sun::star::uno::Sequence< sal_Int32 >() );
     void mergeTopMarks( MergeMarksEnum eMergeType = MERGE_MARKS_APPEND );
 
+    /*
+      Now create all the overloads in a typesafe way (i.e. without varargs) by creating a number of overloads
+      up to a certain reasonable limit (feel free to raise it). This would be a lot easier with C++11 vararg templates.
+    */
+    // now overloads for 2 and more pairs
+    #define SAX_ARGS_FUNC_DECL( argsdecl, argsuse ) \
+        void startElement(sal_Int32 elementTokenId, argsdecl, FSEND_t) \
+            { startElementInternal( elementTokenId, argsuse, FSEND_internal ); } \
+        void singleElement(sal_Int32 elementTokenId, argsdecl, FSEND_t) \
+            { singleElementInternal( elementTokenId, argsuse, FSEND_internal ); } \
+        void startElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, argsdecl, FSEND_t) \
+            { startElementInternal( FSNS( namespaceTokenId, elementTokenId), argsuse, FSEND_internal ); } \
+        void singleElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, argsdecl, FSEND_t) \
+            { singleElementInternal( FSNS( namespaceTokenId, elementTokenId), argsuse, FSEND_internal ); }
+    #define SAX_ARGS_FUNC_NUM( decl1, decl2, use1, use2, convert, num ) \
+        SAX_ARGS_FUNC_DECL( SAX_ARGS_ARG##num( decl1, decl2, ), SAX_ARGS_ARG##num( use1, use2, convert ))
+    #define SAX_ARGS_FUNC_SUBST( type, convert, num ) \
+        SAX_ARGS_FUNC_NUM( sal_Int32 attribute, type value, attribute, value, convert, num )
+    #define SAX_ARGS_FUNC( arg, convert ) SAX_ARGS_FUNC_SUBST( arg, convert, 2 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 3 ) SAX_ARGS_FUNC_SUBST( arg, convert, 4 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 5 ) SAX_ARGS_FUNC_SUBST( arg, convert, 6 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 7 ) SAX_ARGS_FUNC_SUBST( arg, convert, 8 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 9 ) SAX_ARGS_FUNC_SUBST( arg, convert, 10 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 11 ) SAX_ARGS_FUNC_SUBST( arg, convert, 12 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 13 ) SAX_ARGS_FUNC_SUBST( arg, convert, 14 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 15 ) SAX_ARGS_FUNC_SUBST( arg, convert, 16 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 17 ) SAX_ARGS_FUNC_SUBST( arg, convert, 18 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 19 ) SAX_ARGS_FUNC_SUBST( arg, convert, 20 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 21 ) SAX_ARGS_FUNC_SUBST( arg, convert, 22 )
+    SAX_ARGS_FUNC( const char*, )
+    SAX_ARGS_FUNC( const OString&, .getStr() )
+    #undef SAX_ARGS_FUNC_DECL
+    #undef SAX_ARGS_FUNC_NUM
+    #undef SAX_ARGS_FUNC_SUBST
+    #undef SAX_ARGS_FUNC
+
 private:
+    void startElementInternal(sal_Int32 elementTokenId, ...);
+    void singleElementInternal(sal_Int32 elementTokenId, ...);
 
     FastSaxSerializer* mpSerializer;
     com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastTokenHandler> mxTokenHandler;
diff --git a/sax/source/tools/fshelper.cxx b/sax/source/tools/fshelper.cxx
index ffb3506..2f3f7bf 100644
--- a/sax/source/tools/fshelper.cxx
+++ b/sax/source/tools/fshelper.cxx
@@ -47,14 +47,16 @@ FastSerializerHelper::~FastSerializerHelper()
     delete mpSerializer;
 }
 
-void FastSerializerHelper::startElementV(sal_Int32 elementTokenId, va_list args)
+void FastSerializerHelper::startElementInternal(sal_Int32 elementTokenId, ...)
 {
+    va_list args;
+    va_start( args, elementTokenId );
     FastAttributeList* pAttrList = new FastAttributeList( mxTokenHandler );
 
     while (true)
     {
         sal_Int32 nName = va_arg(args, sal_Int32);
-        if (nName == FSEND)
+        if (nName == FSEND_internal)
             break;
         const char* pValue = va_arg(args, const char*);
         if (pValue)
@@ -63,16 +65,19 @@ void FastSerializerHelper::startElementV(sal_Int32 elementTokenId, va_list args)
 
     const com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> xAttrList(pAttrList);
     mpSerializer->startFastElement(elementTokenId, xAttrList);
+    va_end( args );
 }
 
-void FastSerializerHelper::singleElementV(sal_Int32 elementTokenId, va_list args)
+void FastSerializerHelper::singleElementInternal(sal_Int32 elementTokenId, ...)
 {
+    va_list args;
+    va_start( args, elementTokenId );
     FastAttributeList* pAttrList = new FastAttributeList( mxTokenHandler );
 
     while (true)
     {
         sal_Int32 nName = va_arg(args, sal_Int32);
-        if (nName == FSEND)
+        if (nName == FSEND_internal)
             break;
         const char* pValue = va_arg(args, const char*);
         if  (pValue)
@@ -81,6 +86,7 @@ void FastSerializerHelper::singleElementV(sal_Int32 elementTokenId, va_list args
 
     const com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> xAttrList(pAttrList);
     mpSerializer->singleFastElement(elementTokenId, xAttrList);
+    va_end( args );
 }
 
 void FastSerializerHelper::endElement(sal_Int32 elementTokenId)
@@ -88,13 +94,13 @@ void FastSerializerHelper::endElement(sal_Int32 elementTokenId)
     mpSerializer->endFastElement(elementTokenId);
 }
 
-void FastSerializerHelper::startElementV(sal_Int32 elementTokenId, XFastAttributeListRef xAttrList)
+void FastSerializerHelper::startElement(sal_Int32 elementTokenId, XFastAttributeListRef xAttrList)
 {
     mpSerializer->startFastElement(elementTokenId, xAttrList);
 }
 
 
-void FastSerializerHelper::singleElementV(sal_Int32 elementTokenId, XFastAttributeListRef xAttrList)
+void FastSerializerHelper::singleElement(sal_Int32 elementTokenId, XFastAttributeListRef xAttrList)
 {
     mpSerializer->singleFastElement(elementTokenId, xAttrList);
 }
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 9df5811..a22496c 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -999,7 +999,7 @@ sax_fastparser::FSHelperPtr XclExpXmlStream::GetStreamForPath( const OUString& s
     return maOpenedStreamMap[ sPath ].second;
 }
 
-sax_fastparser::FSHelperPtr& XclExpXmlStream::WriteAttributes( sal_Int32 nAttribute, ... )
+sax_fastparser::FSHelperPtr& XclExpXmlStream::WriteAttributesInternal( sal_Int32 nAttribute, ... )
 {
     sax_fastparser::FSHelperPtr& rStream = GetCurrentStream();
 
@@ -1017,7 +1017,7 @@ sax_fastparser::FSHelperPtr& XclExpXmlStream::WriteAttributes( sal_Int32 nAttrib
         }
 
         nAttribute = va_arg( args, sal_Int32 );
-        if( nAttribute == FSEND )
+        if( nAttribute == FSEND_internal )
             break;
     } while( true );
     va_end( args );
diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx
index 3c22bda..571809c 100644
--- a/sc/source/filter/inc/xestream.hxx
+++ b/sc/source/filter/inc/xestream.hxx
@@ -311,7 +311,10 @@ public:
 
     sax_fastparser::FSHelperPtr     GetStreamForPath( const ::rtl::OUString& rPath );
 
-    sax_fastparser::FSHelperPtr&    WriteAttributes( sal_Int32 nAttribute, ... );
+    sax_fastparser::FSHelperPtr&    WriteAttributes( sal_Int32 nAttribute, const char* value, FSEND_t )
+        { return WriteAttributesInternal( nAttribute, value, FSEND_internal ); }
+    sax_fastparser::FSHelperPtr&    WriteAttributes( sal_Int32 nAttribute, const OString& value, FSEND_t )
+        { return WriteAttributesInternal( nAttribute, value.getStr(), FSEND_internal ); }
 
     sax_fastparser::FSHelperPtr     CreateOutputStream (
                                         const ::rtl::OUString& sFullStream,
@@ -331,10 +334,41 @@ public:
     virtual const oox::drawingml::table::TableStyleListPtr getTableStyles();
     virtual oox::drawingml::chart::ChartConverter* getChartConverter();
 
+    /*
+      Now create all the overloads in a typesafe way (i.e. without varargs) by creating a number of overloads
+      up to a certain reasonable limit (feel free to raise it). This would be a lot easier with C++11 vararg templates.
+    */
+    // now overloads for 2 and more pairs
+    #define SAX_ARGS_FUNC_DECL( argsdecl, argsuse ) \
+        sax_fastparser::FSHelperPtr&    WriteAttributes( argsdecl, FSEND_t ) \
+            { return WriteAttributesInternal( argsuse, FSEND_internal ); }
+    #define SAX_ARGS_FUNC_NUM( decl1, decl2, use1, use2, convert, num ) \
+        SAX_ARGS_FUNC_DECL( SAX_ARGS_ARG##num( decl1, decl2, ), SAX_ARGS_ARG##num( use1, use2, convert ))
+    #define SAX_ARGS_FUNC_SUBST( type, convert, num ) \
+        SAX_ARGS_FUNC_NUM( sal_Int32 attribute, type value, attribute, value, convert, num )
+    #define SAX_ARGS_FUNC( arg, convert ) SAX_ARGS_FUNC_SUBST( arg, convert, 2 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 3 ) SAX_ARGS_FUNC_SUBST( arg, convert, 4 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 5 ) SAX_ARGS_FUNC_SUBST( arg, convert, 6 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 7 ) SAX_ARGS_FUNC_SUBST( arg, convert, 8 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 9 ) SAX_ARGS_FUNC_SUBST( arg, convert, 10 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 11 ) SAX_ARGS_FUNC_SUBST( arg, convert, 12 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 13 ) SAX_ARGS_FUNC_SUBST( arg, convert, 14 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 15 ) SAX_ARGS_FUNC_SUBST( arg, convert, 16 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 17 ) SAX_ARGS_FUNC_SUBST( arg, convert, 18 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 19 ) SAX_ARGS_FUNC_SUBST( arg, convert, 20 ) \
+        SAX_ARGS_FUNC_SUBST( arg, convert, 21 ) SAX_ARGS_FUNC_SUBST( arg, convert, 22 )
+    SAX_ARGS_FUNC( const char*, )
+    SAX_ARGS_FUNC( const OString&, .getStr() )
+    #undef SAX_ARGS_FUNC_DECL
+    #undef SAX_ARGS_FUNC_NUM
+    #undef SAX_ARGS_FUNC_SUBST
+    #undef SAX_ARGS_FUNC
+
 private:
     virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
     virtual ::rtl::OUString implGetImplementationName() const;
     ScDocShell *getDocShell();
+    sax_fastparser::FSHelperPtr&    WriteAttributesInternal( sal_Int32 nAttribute, ... );
 
     typedef std::map< ::rtl::OUString,
         std::pair< ::rtl::OUString,
commit a6d5ed529a373863eb670cc75bd797057a339745
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Wed Dec 19 12:10:53 2012 +0100

    -DENABLE_GRAPHITE -> config_graphite.h
    
    Change-Id: I94c7865b68c65540765c9fbfba6f669055dad4ba

diff --git a/config/.gitignore b/config/.gitignore
index 325a7fd..9becb5b 100644
--- a/config/.gitignore
+++ b/config/.gitignore
@@ -1,3 +1 @@
-config_global.h
-config_vclplug.h
-config_telepathy.h
+config_*.h
diff --git a/config/config_graphite.h.in b/config/config_graphite.h.in
new file mode 100644
index 0000000..eb7a7b3
--- /dev/null
+++ b/config/config_graphite.h.in
@@ -0,0 +1,6 @@
+#ifndef CONFIG_GRAPHITE_H
+#define CONFIG_GRAPHITE_H
+
+#undef ENABLE_GRAPHITE
+
+#endif
diff --git a/configure.ac b/configure.ac
index eb0334c..819ea6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8462,6 +8462,7 @@ AC_MSG_CHECKING([whether to enable graphite support])
 if test "$_os" = "WINNT" -o "$_os" = "Linux" && test "$enable_graphite" = "" -o "$enable_graphite" != "no"; then
     AC_MSG_RESULT([yes])
     ENABLE_GRAPHITE="TRUE"
+    AC_DEFINE(ENABLE_GRAPHITE)
     AC_MSG_CHECKING([which graphite to use])
     if test "$with_system_graphite" = "yes"; then
         AC_MSG_RESULT([external])
@@ -12423,6 +12424,7 @@ fi
 
 AC_CONFIG_FILES([config_host.mk Makefile])
 AC_CONFIG_HEADERS([config/config_global.h])
+AC_CONFIG_HEADERS([config/config_graphite.h])
 AC_CONFIG_HEADERS([config/config_telepathy.h])
 AC_CONFIG_HEADERS([config/config_vclplug.h])
 AC_OUTPUT
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 1970d54..edb95c5 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -267,7 +267,6 @@ gb_GLOBALDEFS += \
 		DISABLE_EXPORT \
 		DISABLE_EXTENSIONS \
 		DISABLE_SCRIPTING \
-		ENABLE_GRAPHITE \
 	)
 
 gb_GLOBALDEFS := $(sort $(gb_GLOBALDEFS))
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 4b47621..cbdcc57 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -56,6 +56,8 @@
 
 #include <vector>
 
+#include <config_graphite.h>
+
 #if OSL_DEBUG_LEVEL > 1
 #include <ndtxt.hxx>        // pSwpHints, output operator
 #endif
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 3550beb..6480889 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -293,10 +293,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 
 ## handle Graphite
 ifeq ($(ENABLE_GRAPHITE),TRUE)
-# add defines, graphite sources for all platforms
-$(eval $(call gb_Library_add_defs,vcl,\
-    -DENABLE_GRAPHITE \
-))
+# add graphite sources for all platforms
 $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/glyphs/graphite_features \
     vcl/source/glyphs/graphite_layout \
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index 31aec55..fa256aa 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -28,6 +28,7 @@
 #include "vcl/svapp.hxx"
 #include <outfont.hxx>
 #include <impfont.hxx>
+#include <config_graphite.h>
 #ifdef ENABLE_GRAPHITE
 #include <graphite2/Font.h>
 #include <graphite_layout.hxx>
diff --git a/vcl/generic/glyphs/gcach_ftyp.hxx b/vcl/generic/glyphs/gcach_ftyp.hxx
index edd3532..9d677e1 100644
--- a/vcl/generic/glyphs/gcach_ftyp.hxx
+++ b/vcl/generic/glyphs/gcach_ftyp.hxx
@@ -24,6 +24,7 @@
 
 #include <rtl/textcvt.h>
 
+#include <config_graphite.h>
 #ifdef ENABLE_GRAPHITE
 class GraphiteFaceWrapper;
 #endif
diff --git a/vcl/generic/glyphs/glyphcache.cxx b/vcl/generic/glyphs/glyphcache.cxx
index bc3c544..deef6be 100644
--- a/vcl/generic/glyphs/glyphcache.cxx
+++ b/vcl/generic/glyphs/glyphcache.cxx
@@ -27,6 +27,7 @@
 #include <vcl/bitmap.hxx>
 #include <outfont.hxx>
 
+#include <config_graphite.h>
 #ifdef ENABLE_GRAPHITE
 #include <graphite_features.hxx>
 #endif
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index 3365fbb..27db385 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -46,6 +46,7 @@
 #include "region.h"
 #include "langboost.hxx"
 
+#include <config_graphite.h>
 #ifdef ENABLE_GRAPHITE
 #include <graphite_layout.hxx>
 #include <graphite_serverfont.hxx>
diff --git a/vcl/inc/generic/glyphcache.hxx b/vcl/inc/generic/glyphcache.hxx
index 655f2cd..9de49e7 100644
--- a/vcl/inc/generic/glyphcache.hxx
+++ b/vcl/inc/generic/glyphcache.hxx
@@ -48,6 +48,7 @@ class RawBitmap;
 class ServerFontLayout;
 #include <sallayout.hxx>
 
+#include <config_graphite.h>
 #ifdef ENABLE_GRAPHITE
 class GraphiteFaceWrapper;
 #endif
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index 7a2b804..92c0b8e 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -29,6 +29,7 @@
 #include "boost/scoped_ptr.hpp"
 #include <boost/unordered_set.hpp>
 
+#include <config_graphite.h>
 #ifdef ENABLE_GRAPHITE
 #include <graphite2/Font.h>
 #endif
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index acd50e2..c769458 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -63,6 +63,7 @@
 
 #include "osl/file.h"
 
+#include <config_graphite.h>
 #ifdef ENABLE_GRAPHITE
 #include "graphite_features.hxx"
 #endif
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index 116c6a9..48f295b 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -49,6 +49,8 @@
 #include <queue>
 #include <set>
 
+#include <config_graphite.h>
+
 // -=-= SalPolyLine =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 #define STATIC_POINTS 64
diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx
index beaf8fd..fb7027e 100644
--- a/vcl/unx/generic/gdi/salgdi3.cxx
+++ b/vcl/unx/generic/gdi/salgdi3.cxx
@@ -66,6 +66,7 @@
 #include "salframe.hxx"
 #include "outdev.h"
 
+#include <config_graphite.h>
 #ifdef ENABLE_GRAPHITE
 #include <graphite_layout.hxx>
 #include <graphite_serverfont.hxx>
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index 597df76..da4f4e0 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -64,6 +64,7 @@
 
 #include <algorithm>
 
+#include <config_graphite.h>
 #ifdef ENABLE_GRAPHITE
 #include <graphite2/Font.h>
 #endif
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 03e59a0..fcc5fdc 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -50,6 +50,7 @@
 typedef boost::unordered_map<int,int> IntMap;
 
 // Graphite headers
+#include <config_graphite.h>
 #ifdef ENABLE_GRAPHITE
 #include <i18npool/languagetag.hxx>
 #include <graphite_layout.hxx>


More information about the Libreoffice-commits mailing list