diff options
Diffstat (limited to 'svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx')
-rwxr-xr-x[-rw-r--r--] | svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx index 022b7505cb44..ee848c95192a 100644..100755 --- a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx @@ -30,7 +30,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" -#include "EnhancedCustomShapeFunctionParser.hxx" #include "EnhancedCustomShape2d.hxx" #include <rtl/ustring.hxx> #include <tools/fract.hxx> @@ -39,6 +38,7 @@ // we're synchronized externally. // But watch out, the parser might have // state not visible to this code! + #define BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE #if defined(VERBOSE) && defined(DBG_UTIL) #include <typeinfo> @@ -1001,6 +1001,7 @@ template< typename T > struct custom_real_parser_policies : public ::boost::spir ( '-' multiplicative_expression )* ) */ + class ExpressionGrammar : public ::boost::spirit::grammar< ExpressionGrammar > { public: @@ -1162,6 +1163,8 @@ const ParserContextSharedPtr& getParserContext() namespace EnhancedCustomShape { + + ExpressionNodeSharedPtr FunctionParser::parseFunction( const ::rtl::OUString& rFunction, const EnhancedCustomShape2d& rCustoShape ) { // TODO(Q1): Check if a combination of the RTL_UNICODETOTEXT_FLAGS_* @@ -1192,6 +1195,8 @@ ExpressionNodeSharedPtr FunctionParser::parseFunction( const ::rtl::OUString& rF ::boost::spirit::space_p ) ); OSL_DEBUG_ONLY(::std::cout.flush()); // needed to keep stdout and cout in sync + + // input fully congested by the parser? if( !aParseInfo.full ) throw ParseError( "EnhancedCustomShapeFunctionParser::parseFunction(): string not fully parseable" ); @@ -1201,7 +1206,10 @@ ExpressionNodeSharedPtr FunctionParser::parseFunction( const ::rtl::OUString& rF if( pContext->maOperandStack.size() != 1 ) throw ParseError( "EnhancedCustomShapeFunctionParser::parseFunction(): incomplete or empty expression" ); + return pContext->maOperandStack.top(); } + } + |