--- configure.in.orig 2009-10-21 16:57:59.000000000 +0100 +++ configure.in 2009-10-21 16:58:08.000000000 +0100 @@ -4562,12 +4562,6 @@ AC_MSG_RESULT([external]) SYSTEM_GRAPHITE=YES PKG_CHECK_MODULES( GRAPHITE, silgraphite ) - AC_MSG_CHECKING([STL compatibility]) - if test "$WITH_STLPORT" != "no"; then - AC_MSG_ERROR([to use system graphite you need to use --without-stlport]) - else - AC_MSG_RESULT([OK]) - fi else AC_MSG_RESULT([internal]) SYSTEM_GRAPHITE=NO diff -ru vcl.orig/inc/vcl/graphite_adaptors.hxx vcl/inc/vcl/graphite_adaptors.hxx --- vcl.orig/inc/vcl/graphite_adaptors.hxx 2010-01-07 11:50:10.000000000 +0000 +++ vcl/inc/vcl/graphite_adaptors.hxx 2010-01-11 16:00:47.000000000 +0000 @@ -58,10 +58,11 @@ #include "vcl/dllapi.h" // Libraries +#include "pregraphitestl.h" #include #include #include - +#include "postgraphitestl.h" // Module type definitions and forward declarations. // @@ -121,7 +122,7 @@ const grutils::GrFeatureParser * features() const { return mpFeatures; }; private: - virtual void UniqueCacheInfo(std::wstring &, bool &, bool &); + virtual void UniqueCacheInfo(sil_std::wstring &, bool &, bool &); FreetypeServerFont& mrFont; FontProperties maFontProperties; diff -ru vcl.orig/inc/vcl/graphite_features.hxx vcl/inc/vcl/graphite_features.hxx --- vcl.orig/inc/vcl/graphite_features.hxx 2010-01-07 11:50:10.000000000 +0000 +++ vcl/inc/vcl/graphite_features.hxx 2010-01-11 16:00:47.000000000 +0000 @@ -32,10 +32,11 @@ // Parse a string of features specified as ; separated pairs. // e.g. // 1001=1&2002=2&fav1=0 - +#include "pregraphitestl.h" #include #include #include +#include "postgraphitestl.h" namespace grutils { diff -ru vcl.orig/inc/vcl/graphite_layout.hxx vcl/inc/vcl/graphite_layout.hxx --- vcl.orig/inc/vcl/graphite_layout.hxx 2010-01-07 11:50:10.000000000 +0000 +++ vcl/inc/vcl/graphite_layout.hxx 2010-01-11 16:00:47.000000000 +0000 @@ -43,11 +43,13 @@ #include #include // Libraries +#include "pregraphitestl.h" #include #include #include #include #include +#include "postgraphitestl.h" // Platform #include #include diff -ru vcl.orig/source/glyphs/graphite_adaptors.cxx vcl/source/glyphs/graphite_adaptors.cxx --- vcl.orig/source/glyphs/graphite_adaptors.cxx 2010-01-07 11:50:09.000000000 +0000 +++ vcl/source/glyphs/graphite_adaptors.cxx 2010-01-11 16:00:47.000000000 +0000 @@ -169,7 +169,7 @@ mpFeatures = NULL; } -void GraphiteFontAdaptor::UniqueCacheInfo(std::wstring & face_name_out, bool & bold_out, bool & italic_out) +void GraphiteFontAdaptor::UniqueCacheInfo(sil_std::wstring & face_name_out, bool & bold_out, bool & italic_out) { face_name_out = maFontProperties.szFaceName; bold_out = maFontProperties.fBold; diff -ru vcl.orig/source/glyphs/graphite_cache.cxx vcl/source/glyphs/graphite_cache.cxx --- vcl.orig/source/glyphs/graphite_cache.cxx 2010-01-07 11:50:09.000000000 +0000 +++ vcl/source/glyphs/graphite_cache.cxx 2010-01-11 16:00:47.000000000 +0000 @@ -36,8 +36,10 @@ #include #include +#include "pregraphitestl.h" #include #include +#include "postgraphitestl.h" #include #include diff -ru vcl.orig/source/glyphs/graphite_features.cxx vcl/source/glyphs/graphite_features.cxx --- vcl.orig/source/glyphs/graphite_features.cxx 2010-01-07 11:50:09.000000000 +0000 +++ vcl/source/glyphs/graphite_features.cxx 2010-01-11 16:00:47.000000000 +0000 @@ -91,7 +91,7 @@ gr::isocode aLang = maLang; for (size_t i = pos; i < nFeatEnd; i++) aLang.rgch[i-pos] = features[i]; - std::pair aSupported + sil_std::pair aSupported = font.getSupportedLanguages(); gr::LanguageIterator iL = aSupported.first; while (iL != aSupported.second) @@ -142,7 +142,7 @@ if (lang[i] == '-') break; aLang.rgch[i] = lang[i]; } - std::pair aSupported + sil_std::pair aSupported = font.getSupportedLanguages(); gr::LanguageIterator iL = aSupported.first; while (iL != aSupported.second) @@ -189,7 +189,7 @@ { return false; } - std::pair< gr::FeatureSettingIterator, gr::FeatureSettingIterator > + sil_std::pair< gr::FeatureSettingIterator, gr::FeatureSettingIterator > validValues = font.getFeatureSettings(i); gr::FeatureSettingIterator j = validValues.first; while (j != validValues.second) diff -ru vcl.orig/source/glyphs/graphite_layout.cxx vcl/source/glyphs/graphite_layout.cxx --- vcl.orig/source/glyphs/graphite_layout.cxx 2010-01-07 11:50:09.000000000 +0000 +++ vcl/source/glyphs/graphite_layout.cxx 2010-01-11 16:00:47.000000000 +0000 @@ -66,11 +66,13 @@ #include // Graphite Libraries (must be after vcl headers on windows) +#include "pregraphitestl.h" #include #include #include #include #include +#include "postgraphitestl.h" #include #include @@ -105,8 +107,8 @@ namespace { - typedef std::pair glyph_range_t; - typedef std::pair glyph_set_range_t; + typedef sil_std::pair glyph_range_t; + typedef sil_std::pair glyph_set_range_t; inline long round(const float n) { return long(n + (n < 0 ? -0.5 : 0.5)); @@ -171,7 +173,7 @@ bool bRtl, long &rWidth, float fScaling, std::vector & rChar2Base, std::vector & rGlyph2Char, std::vector & rCharDxs) { // Create a glyph item for each of the glyph and append it to the base class glyph list. - typedef std::pair< gr::GlyphSetIterator, gr::GlyphSetIterator > GrGlyphSet; + typedef sil_std::pair< gr::GlyphSetIterator, gr::GlyphSetIterator > GrGlyphSet; int nChar = rArgs.mnEndCharPos - rArgs.mnMinCharPos; glyph_range_t iGlyphs = rSegment.glyphs(); int nGlyphs = iGlyphs.second - iGlyphs.first; @@ -586,7 +588,7 @@ sal_Int32 hashCode(const grutils::GrFeatureParser * mpFeatures) { // is this sufficient? - std::wstring aFace; + sil_std::wstring aFace; bool bBold; bool bItalic; UniqueCacheInfo(aFace, bBold, bItalic); diff -ru vcl.orig/source/glyphs/graphite_textsrc.cxx vcl/source/glyphs/graphite_textsrc.cxx --- vcl.orig/source/glyphs/graphite_textsrc.cxx 2010-01-07 11:50:09.000000000 +0000 +++ vcl/source/glyphs/graphite_textsrc.cxx 2010-01-11 16:00:47.000000000 +0000 @@ -138,16 +138,16 @@ return unknown; } -std::pair TextSourceAdaptor::propertyRange(gr::toffset nCharIdx) +sil_std::pair TextSourceAdaptor::propertyRange(gr::toffset nCharIdx) { if (nCharIdx < unsigned(maLayoutArgs.mnMinCharPos)) - return std::make_pair(0, maLayoutArgs.mnMinCharPos); + return sil_std::make_pair(0, maLayoutArgs.mnMinCharPos); if (nCharIdx < mnEnd) - return std::make_pair(maLayoutArgs.mnMinCharPos, mnEnd); + return sil_std::make_pair(maLayoutArgs.mnMinCharPos, mnEnd); - return std::make_pair(mnEnd, maLayoutArgs.mnLength); + return sil_std::make_pair(mnEnd, maLayoutArgs.mnLength); } size_t TextSourceAdaptor::getFontFeatures(gr::toffset, gr::FeatureSetting * settings) @@ -159,7 +159,7 @@ bool TextSourceAdaptor::sameSegment(gr::toffset char_idx1, gr::toffset char_idx2) { - const std::pair + const sil_std::pair range1 = propertyRange(char_idx1), range2 = propertyRange(char_idx2); diff -ru vcl.orig/source/glyphs/graphite_textsrc.hxx vcl/source/glyphs/graphite_textsrc.hxx --- vcl.orig/source/glyphs/graphite_textsrc.hxx 2010-01-07 11:50:09.000000000 +0000 +++ vcl/source/glyphs/graphite_textsrc.hxx 2010-01-11 16:00:47.000000000 +0000 @@ -62,9 +62,11 @@ #include "vcl/dllapi.h" // Libraries +#include "pregraphitestl.h" #include #include #include +#include "postgraphitestl.h" // Module type definitions and forward declarations. // @@ -91,7 +93,7 @@ virtual float getVerticalOffset(gr::toffset ich); virtual gr::isocode getLanguage(gr::toffset ich); - virtual std::pair propertyRange(gr::toffset ich); + virtual sil_std::pair propertyRange(gr::toffset ich); virtual size_t getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset); virtual bool sameSegment(gr::toffset ich1, gr::toffset ich2); diff -ru vcl.orig/util/makefile2.pmk vcl/util/makefile2.pmk --- vcl.orig/util/makefile2.pmk 2010-01-07 11:50:11.000000000 +0000 +++ vcl/util/makefile2.pmk 2010-01-11 16:00:47.000000000 +0000 @@ -36,3 +36,10 @@ .IF "$(GUIBASE)"=="aqua" CFLAGSCXX+=$(OBJCXXFLAGS) .ENDIF # "$(GUIBASE)"=="aqua" + +#building with stlport, but graphite was not built with stlport +.IF "$(USE_SYSTEM_STL)"!="YES" +.IF "$(SYSTEM_GRAPHITE)"=="YES" +CDEFS += -DGRAPHITEADAPTSTL +.ENDIF +.ENDIF --- /dev/null 2009-11-23 08:25:49.916291467 +0000 +++ vcl/inc/pregraphitestl.h 2010-01-12 09:49:26.000000000 +0000 @@ -0,0 +1,30 @@ +#if defined(GRAPHITEADAPTSTL) && defined(std) +# include +# include +# include +# include +# include +# include +# define std_was_redefined_as_stlport std +# undef std +# define _STLP_OUTERMOST_HEADER_ID 0xdeadbeaf +# pragma GCC visibility push(default) +# include _STLP_NATIVE_HEADER(exception_defines.h) +# include _STLP_NATIVE_HEADER(limits) +# include _STLP_NATIVE_HEADER(memory) +# include _STLP_NATIVE_HEADER(exception) +# include _STLP_NATIVE_HEADER(iosfwd) +# include _STLP_NATIVE_HEADER(algorithm) +# include _STLP_NATIVE_HEADER(string) +# include _STLP_NATIVE_HEADER(streambuf) +# include _STLP_NATIVE_HEADER(ios) +# include _STLP_NATIVE_HEADER(locale) +# include _STLP_NATIVE_HEADER(stdexcept) +# include _STLP_NATIVE_HEADER(ostream) +# include _STLP_NATIVE_HEADER(istream) +# include _STLP_NATIVE_HEADER(iostream) +# include _STLP_NATIVE_HEADER(vector) +# pragma GCC visibility pop +#endif +//sil_std resolves to the std that Graphite was built with +namespace sil_std = std; --- /dev/null 2009-11-23 08:25:49.916291467 +0000 +++ vcl/inc/postgraphitestl.h 2010-01-12 10:46:40.000000000 +0000 @@ -0,0 +1,9 @@ +#ifdef std_was_redefined_as_stlport +// put things back the way they were +# define std std_was_redefined_as_stlport +# undef _STLP_OUTERMOST_HEADER_ID +// force config to be re-read +# undef _STLP_NOTHROW_INHERENTLY +# undef _STLP_CONFIG_H +# include +#endif