diff options
-rw-r--r-- | transex3/source/export2.cxx | 7 | ||||
-rw-r--r-- | transex3/source/inireader.cxx | 2 | ||||
-rw-r--r-- | vcl/inc/postgraphitestl.h | 9 | ||||
-rw-r--r-- | vcl/inc/pregraphitestl.h | 30 | ||||
-rw-r--r-- | vcl/inc/vcl/graphite_adaptors.hxx | 5 | ||||
-rw-r--r-- | vcl/inc/vcl/graphite_features.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/vcl/graphite_layout.hxx | 2 | ||||
-rw-r--r-- | vcl/source/glyphs/graphite_adaptors.cxx | 2 | ||||
-rw-r--r-- | vcl/source/glyphs/graphite_cache.cxx | 2 | ||||
-rw-r--r-- | vcl/source/glyphs/graphite_features.cxx | 6 | ||||
-rw-r--r-- | vcl/source/glyphs/graphite_layout.cxx | 10 | ||||
-rw-r--r-- | vcl/source/glyphs/graphite_textsrc.cxx | 10 | ||||
-rw-r--r-- | vcl/source/glyphs/graphite_textsrc.hxx | 4 | ||||
-rw-r--r-- | vcl/util/makefile2.pmk | 7 |
14 files changed, 78 insertions, 21 deletions
diff --git a/transex3/source/export2.cxx b/transex3/source/export2.cxx index 7815e80e033f..bf2648b0ca4f 100644 --- a/transex3/source/export2.cxx +++ b/transex3/source/export2.cxx @@ -354,17 +354,18 @@ bool Export::CopyFile( const ByteString& source , const ByteString& dest ) const int BUFFERSIZE = 8192; char buf[ BUFFERSIZE ]; - FILE* IN_FILE = fopen( source.GetBuffer() , "r" ); - FILE* OUT_FILE = fopen( dest.GetBuffer() , "w" ); - + FILE* IN_FILE = fopen( source.GetBuffer() , "r" ); if( IN_FILE == NULL ) { cerr << "Export::CopyFile WARNING: Could not open " << source.GetBuffer() << "\n"; return false; } + + FILE* OUT_FILE = fopen( dest.GetBuffer() , "w" ); if( OUT_FILE == NULL ) { cerr << "Export::CopyFile WARNING: Could not open/create " << dest.GetBuffer() << " for writing\n"; + fclose( IN_FILE ); return false; } diff --git a/transex3/source/inireader.cxx b/transex3/source/inireader.cxx index 1ff34fad8e95..63f902a5a1da 100644 --- a/transex3/source/inireader.cxx +++ b/transex3/source/inireader.cxx @@ -120,7 +120,7 @@ void INIreader::toStlString( const UnicodeString& str , string& stl_str) char* buffer = new char[ str.length()*3 ]; str.extract( 0 , str.length() , buffer ); stl_str = string( buffer ); - delete[] buffer; + delete [] buffer; } void INIreader::trim( string& str ) diff --git a/vcl/inc/postgraphitestl.h b/vcl/inc/postgraphitestl.h new file mode 100644 index 000000000000..736aa248b7ff --- /dev/null +++ b/vcl/inc/postgraphitestl.h @@ -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 <stddef.h> +#endif diff --git a/vcl/inc/pregraphitestl.h b/vcl/inc/pregraphitestl.h new file mode 100644 index 000000000000..ece0af477113 --- /dev/null +++ b/vcl/inc/pregraphitestl.h @@ -0,0 +1,30 @@ +#if defined(GRAPHITEADAPTSTL) && defined(std) +# include <ostream> +# include <istream> +# include <fstream> +# include <iostream> +# include <vector> +# include <algorithm> +# 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; diff --git a/vcl/inc/vcl/graphite_adaptors.hxx b/vcl/inc/vcl/graphite_adaptors.hxx index 41ffa00b0f8f..9a0a42c01ce0 100644 --- a/vcl/inc/vcl/graphite_adaptors.hxx +++ b/vcl/inc/vcl/graphite_adaptors.hxx @@ -58,10 +58,11 @@ #include "vcl/dllapi.h" // Libraries +#include "pregraphitestl.h" #include <graphite/GrClient.h> #include <graphite/Font.h> #include <graphite/ITextSource.h> - +#include "postgraphitestl.h" // Module type definitions and forward declarations. // @@ -121,7 +122,7 @@ public: 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 --git a/vcl/inc/vcl/graphite_features.hxx b/vcl/inc/vcl/graphite_features.hxx index 6cfe5dfca0fd..d3cfd99e0fe4 100644 --- a/vcl/inc/vcl/graphite_features.hxx +++ b/vcl/inc/vcl/graphite_features.hxx @@ -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 <graphite/GrClient.h> #include <graphite/Font.h> #include <graphite/GrFeature.h> +#include "postgraphitestl.h" namespace grutils { diff --git a/vcl/inc/vcl/graphite_layout.hxx b/vcl/inc/vcl/graphite_layout.hxx index 2ec3bc4c2391..325f67e852ce 100644 --- a/vcl/inc/vcl/graphite_layout.hxx +++ b/vcl/inc/vcl/graphite_layout.hxx @@ -43,11 +43,13 @@ #include <vector> #include <utility> // Libraries +#include "pregraphitestl.h" #include <graphite/GrClient.h> #include <graphite/Font.h> #include <graphite/GrConstants.h> #include <graphite/GrAppData.h> #include <graphite/SegmentAux.h> +#include "postgraphitestl.h" // Platform #include <vcl/sallayout.hxx> #include <vcl/dllapi.h> diff --git a/vcl/source/glyphs/graphite_adaptors.cxx b/vcl/source/glyphs/graphite_adaptors.cxx index 34e2f5f5bbe3..6c9d97e356b1 100644 --- a/vcl/source/glyphs/graphite_adaptors.cxx +++ b/vcl/source/glyphs/graphite_adaptors.cxx @@ -171,7 +171,7 @@ GraphiteFontAdaptor::~GraphiteFontAdaptor() throw() 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 --git a/vcl/source/glyphs/graphite_cache.cxx b/vcl/source/glyphs/graphite_cache.cxx index 8c514c611d2c..a2c245e21774 100644 --- a/vcl/source/glyphs/graphite_cache.cxx +++ b/vcl/source/glyphs/graphite_cache.cxx @@ -36,8 +36,10 @@ #include <tools/debug.hxx> #include <vcl/sallayout.hxx> +#include "pregraphitestl.h" #include <graphite/GrClient.h> #include <graphite/Segment.h> +#include "postgraphitestl.h" #include <rtl/ustring.hxx> #include <vcl/graphite_layout.hxx> diff --git a/vcl/source/glyphs/graphite_features.cxx b/vcl/source/glyphs/graphite_features.cxx index dae1bfc2866e..b26397aa43e5 100644 --- a/vcl/source/glyphs/graphite_features.cxx +++ b/vcl/source/glyphs/graphite_features.cxx @@ -91,7 +91,7 @@ GrFeatureParser::GrFeatureParser(gr::Font & font, const std::string features, co gr::isocode aLang = maLang; for (size_t i = pos; i < nFeatEnd; i++) aLang.rgch[i-pos] = features[i]; - std::pair<gr::LanguageIterator,gr::LanguageIterator> aSupported + sil_std::pair<gr::LanguageIterator,gr::LanguageIterator> aSupported = font.getSupportedLanguages(); gr::LanguageIterator iL = aSupported.first; while (iL != aSupported.second) @@ -142,7 +142,7 @@ void GrFeatureParser::setLang(gr::Font & font, const std::string & lang) if (lang[i] == '-') break; aLang.rgch[i] = lang[i]; } - std::pair<gr::LanguageIterator,gr::LanguageIterator> aSupported + sil_std::pair<gr::LanguageIterator,gr::LanguageIterator> aSupported = font.getSupportedLanguages(); gr::LanguageIterator iL = aSupported.first; while (iL != aSupported.second) @@ -189,7 +189,7 @@ bool GrFeatureParser::isValid(gr::Font & font, gr::FeatureSetting & setting) { 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 --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index c09062108dda..6f4e13c7985f 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -66,11 +66,13 @@ #include <unicode/uscript.h> // Graphite Libraries (must be after vcl headers on windows) +#include "pregraphitestl.h" #include <graphite/GrClient.h> #include <graphite/Font.h> #include <graphite/ITextSource.h> #include <graphite/Segment.h> #include <graphite/SegmentPainter.h> +#include "postgraphitestl.h" #include <vcl/graphite_layout.hxx> #include <vcl/graphite_features.hxx> @@ -105,8 +107,8 @@ FILE * grLog() namespace { - typedef std::pair<gr::GlyphIterator, gr::GlyphIterator> glyph_range_t; - typedef std::pair<gr::GlyphSetIterator, gr::GlyphSetIterator> glyph_set_range_t; + typedef sil_std::pair<gr::GlyphIterator, gr::GlyphIterator> glyph_range_t; + typedef sil_std::pair<gr::GlyphSetIterator, gr::GlyphSetIterator> glyph_set_range_t; inline long round(const float n) { return long(n + (n < 0 ? -0.5 : 0.5)); @@ -171,7 +173,7 @@ GraphiteLayout::Glyphs::fill_from(gr::Segment & rSegment, ImplLayoutArgs &rArgs, bool bRtl, long &rWidth, float fScaling, std::vector<int> & rChar2Base, std::vector<int> & rGlyph2Char, std::vector<int> & 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 @@ public: 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 --git a/vcl/source/glyphs/graphite_textsrc.cxx b/vcl/source/glyphs/graphite_textsrc.cxx index adc2ae99c4f8..cbbd386e734a 100644 --- a/vcl/source/glyphs/graphite_textsrc.cxx +++ b/vcl/source/glyphs/graphite_textsrc.cxx @@ -138,16 +138,16 @@ gr::isocode TextSourceAdaptor::getLanguage(gr::toffset) return unknown; } -std::pair<gr::toffset, gr::toffset> TextSourceAdaptor::propertyRange(gr::toffset nCharIdx) +sil_std::pair<gr::toffset, gr::toffset> 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 @@ size_t TextSourceAdaptor::getFontFeatures(gr::toffset, gr::FeatureSetting * sett bool TextSourceAdaptor::sameSegment(gr::toffset char_idx1, gr::toffset char_idx2) { - const std::pair<gr::toffset, gr::toffset> + const sil_std::pair<gr::toffset, gr::toffset> range1 = propertyRange(char_idx1), range2 = propertyRange(char_idx2); diff --git a/vcl/source/glyphs/graphite_textsrc.hxx b/vcl/source/glyphs/graphite_textsrc.hxx index 6f701988bb01..62d951c3f950 100644 --- a/vcl/source/glyphs/graphite_textsrc.hxx +++ b/vcl/source/glyphs/graphite_textsrc.hxx @@ -62,9 +62,11 @@ #include "vcl/dllapi.h" // Libraries +#include "pregraphitestl.h" #include <graphite/GrClient.h> #include <graphite/Font.h> #include <graphite/ITextSource.h> +#include "postgraphitestl.h" // Module type definitions and forward declarations. // @@ -91,7 +93,7 @@ public: virtual float getVerticalOffset(gr::toffset ich); virtual gr::isocode getLanguage(gr::toffset ich); - virtual std::pair<gr::toffset, gr::toffset> propertyRange(gr::toffset ich); + virtual sil_std::pair<gr::toffset, gr::toffset> propertyRange(gr::toffset ich); virtual size_t getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset); virtual bool sameSegment(gr::toffset ich1, gr::toffset ich2); diff --git a/vcl/util/makefile2.pmk b/vcl/util/makefile2.pmk index 63b2889bc15d..cb13e3b42743 100644 --- a/vcl/util/makefile2.pmk +++ b/vcl/util/makefile2.pmk @@ -36,3 +36,10 @@ VISIBILITY_HIDDEN=TRUE .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 |