diff --git a/src/eepp/ui/css/stylesheetspecification.cpp b/src/eepp/ui/css/stylesheetspecification.cpp index 65176a1ee..eb67b31f1 100644 --- a/src/eepp/ui/css/stylesheetspecification.cpp +++ b/src/eepp/ui/css/stylesheetspecification.cpp @@ -428,24 +428,19 @@ static bool isNth( int a, int b, int count ) { } void StyleSheetSpecification::registerDefaultNodeSelectors() { - mNodeSelectors["empty"] = []( const UIWidget* node, int a, int b, - const FunctionString& data ) -> bool { + mNodeSelectors["empty"] = []( const UIWidget* node, int, int, const FunctionString& ) -> bool { return node->getFirstChild() == NULL; }; - mNodeSelectors["first-child"] = []( const UIWidget* node, int a, int b, - const FunctionString& data ) -> bool { + mNodeSelectors["first-child"] = []( const UIWidget* node, int, int, + const FunctionString& ) -> bool { return NULL != node->getParent() && node->getParent()->getFirstChild() == node; }; - mNodeSelectors["enabled"] = []( const UIWidget* node, int a, int b, - const FunctionString& data ) -> bool { - return node->isEnabled(); - }; - mNodeSelectors["disabled"] = []( const UIWidget* node, int a, int b, - const FunctionString& data ) -> bool { - return !node->isEnabled(); - }; - mNodeSelectors["first-of-type"] = []( const UIWidget* node, int a, int b, - const FunctionString& data ) -> bool { + mNodeSelectors["enabled"] = []( const UIWidget* node, int, int, + const FunctionString& ) -> bool { return node->isEnabled(); }; + mNodeSelectors["disabled"] = []( const UIWidget* node, int, int, + const FunctionString& ) -> bool { return !node->isEnabled(); }; + mNodeSelectors["first-of-type"] = []( const UIWidget* node, int, int, + const FunctionString& ) -> bool { Node* child = NULL != node->getParent() ? node->getParent()->getFirstChild() : NULL; Uint32 type = node->getType(); while ( NULL != child ) { @@ -456,12 +451,12 @@ void StyleSheetSpecification::registerDefaultNodeSelectors() { }; return false; }; - mNodeSelectors["last-child"] = []( const UIWidget* node, int a, int b, - const FunctionString& data ) -> bool { + mNodeSelectors["last-child"] = []( const UIWidget* node, int, int, + const FunctionString& ) -> bool { return NULL != node->getParent() && node->getParent()->getLastChild() == node; }; - mNodeSelectors["last-of-type"] = []( const UIWidget* node, int a, int b, - const FunctionString& data ) -> bool { + mNodeSelectors["last-of-type"] = []( const UIWidget* node, int, int, + const FunctionString& ) -> bool { Node* child = NULL != node->getParent() ? node->getParent()->getLastChild() : NULL; Uint32 type = node->getType(); while ( NULL != child ) { @@ -472,12 +467,12 @@ void StyleSheetSpecification::registerDefaultNodeSelectors() { }; return false; }; - mNodeSelectors["only-child"] = []( const UIWidget* node, int a, int b, - const FunctionString& data ) -> bool { + mNodeSelectors["only-child"] = []( const UIWidget* node, int, int, + const FunctionString& ) -> bool { return NULL != node->getParent() && node->getParent()->getChildCount() == 1; }; - mNodeSelectors["only-of-type"] = []( const UIWidget* node, int a, int b, - const FunctionString& data ) -> bool { + mNodeSelectors["only-of-type"] = []( const UIWidget* node, int, int, + const FunctionString& ) -> bool { Node* child = NULL != node->getParent() ? node->getParent()->getFirstChild() : NULL; Uint32 type = node->getType(); Uint32 typeCount = 0; @@ -492,30 +487,30 @@ void StyleSheetSpecification::registerDefaultNodeSelectors() { return typeCount == 1; }; mNodeSelectors["nth-child"] = []( const UIWidget* node, int a, int b, - const FunctionString& data ) -> bool { + const FunctionString& ) -> bool { return isNth( a, b, node->getNodeIndex() + 1 ); }; mNodeSelectors["nth-last-child"] = []( const UIWidget* node, int a, int b, - const FunctionString& data ) -> bool { + const FunctionString& ) -> bool { return isNth( a, b, node->getChildCount() - node->getNodeIndex() ); }; mNodeSelectors["nth-of-type"] = []( const UIWidget* node, int a, int b, - const FunctionString& data ) -> bool { + const FunctionString& ) -> bool { return isNth( a, b, node->getNodeOfTypeIndex() + 1 ); }; mNodeSelectors["nth-last-of-type"] = []( const UIWidget* node, int a, int b, - const FunctionString& data ) -> bool { + const FunctionString& ) -> bool { return node->getParent() != NULL ? isNth( a, b, node->getParent()->getChildOfTypeCount( node->getType() ) - node->getNodeOfTypeIndex() ) : false; }; - mNodeSelectors["checked"] = []( const UIWidget* node, int a, int b, - const FunctionString& data ) -> bool { + mNodeSelectors["checked"] = []( const UIWidget* node, int, int, + const FunctionString& ) -> bool { return 0 != ( node->getFlags() & UI_CHECKED ); }; - mNodeSelectors["not"] = []( const UIWidget* node, int a, int b, + mNodeSelectors["not"] = []( const UIWidget* node, int, int, const FunctionString& data ) -> bool { if ( !data.isEmpty() && !data.getParameters().empty() && data.getName() == "not" ) { for ( const auto& param : data.getParameters() ) { @@ -641,8 +636,8 @@ static int getIndexEndingWith( const std::vector& vec, const std::s } void StyleSheetSpecification::registerDefaultShorthandParsers() { - mShorthandParsers["empty"] = []( const ShorthandDefinition* shorthand, - std::string value ) -> std::vector { + mShorthandParsers["empty"] = []( const ShorthandDefinition*, + std::string ) -> std::vector { return {}; }; diff --git a/src/thirdparty/efsw b/src/thirdparty/efsw index d73a45ffa..f3914e475 160000 --- a/src/thirdparty/efsw +++ b/src/thirdparty/efsw @@ -1 +1 @@ -Subproject commit d73a45ffa7b79bcbd299e782d9263a5d946acf7a +Subproject commit f3914e475cc8cec461ac05060470c6510ee81246 diff --git a/src/tools/ecode/appconfig.cpp b/src/tools/ecode/appconfig.cpp index 064043edb..9aeaccb51 100644 --- a/src/tools/ecode/appconfig.cpp +++ b/src/tools/ecode/appconfig.cpp @@ -318,6 +318,8 @@ static void loadDocuments( UICodeEditorSplitter* editorSplitter, std::shared_ptr for ( const auto& file : j["files"] ) { if ( !file.contains( "type" ) || file["type"] == "editor" ) { std::string path( file["path"] ); + if ( !FileSystem::fileExists( path ) ) + return; TextRange selection( TextRange::fromString( file["selection"] ) ); editorSplitter->loadAsyncFileFromPathInNewTab( path, pool,