Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

all : inkscape-layers

inkscape-layers : inkscape-layers.cpp trim-cpp/trim.hpp
inkscape-layers : inkscape-layers.cpp
g++ -std=c++11 $^ `pkg-config libxml++-2.6 --cflags --libs` -o $@

clean :
Expand Down
15 changes: 11 additions & 4 deletions inkscape-layers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <string.h>
#include <stdlib.h>

#include "trim-cpp/trim.hpp"

#define NAME_MODE_DEFAULT 0
#define NAME_MODE_LABEL 1
Expand Down Expand Up @@ -212,7 +211,15 @@ Mode
if ( outputDirectory.length() == 0 ) outputDirectory = inputFilename.substr(0, pathEnd);

outputBaseName = inputFilename.substr(pathEnd, extensionStart - pathEnd);

/* HACK :( */
/* commented for filename without prefix
layerFilenamePrefix = outputDirectory + outputBaseName + "-";
*/

layerFilenamePrefix = outputDirectory;

/*KCAH :( */

if ( extensionStart == std::string::npos ) {
layerFilenameSuffix = "";
Expand Down Expand Up @@ -264,7 +271,7 @@ isVisible
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

style = layer->get_attribute_value("style").raw();
Trim::inPlace(style);
// Trim::inPlace(style);

if ( (displayBegin = style.find("display")) == std::string::npos ) return true;
if ( (valueBegin = style.find(':', displayBegin)) == std::string::npos ) return true;
Expand All @@ -273,7 +280,7 @@ isVisible
valueLength = valueEnd - valueBegin;

value = style.substr(valueBegin, valueLength);
Trim::inPlace(value);
// Trim::inPlace(value);
return value.compare("none") != 0;
}

Expand All @@ -290,7 +297,7 @@ makeVisible
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

style = layer->get_attribute_value("style").raw();
Trim::inPlace(style);
// Trim::inPlace(style);

if ( (displayBegin = style.find("display")) == std::string::npos ) return;
if ( (valueBegin = style.find(':', displayBegin)) == std::string::npos ) return;
Expand Down
1 change: 0 additions & 1 deletion trim-cpp
Submodule trim-cpp deleted from 693393