diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2007-10-29 06:31:22 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2007-10-29 06:31:22 +0000 |
| commit | 2fdddba9c5f231b4e25edebe3de1e005c06f7022 (patch) | |
| tree | 6caf051e65e439c3cf7c8113fce8fb3d492a7ffd | |
| parent | LPE: implement 'edit next LPE parameter'. Accessible through key '7'. (diff) | |
| download | inkscape-2fdddba9c5f231b4e25edebe3de1e005c06f7022.tar.gz inkscape-2fdddba9c5f231b4e25edebe3de1e005c06f7022.zip | |
Adding function to locate profile by bane
(bzr r3969)
| -rw-r--r-- | src/profile-manager.cpp | 17 | ||||
| -rw-r--r-- | src/profile-manager.h | 5 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/profile-manager.cpp b/src/profile-manager.cpp index c2d344629..19655e0a1 100644 --- a/src/profile-manager.cpp +++ b/src/profile-manager.cpp @@ -10,6 +10,7 @@ #include "profile-manager.h" #include "document.h" +#include "color-profile.h" namespace Inkscape { @@ -62,6 +63,22 @@ void ProfileManager::_resourcesChanged() } } +ColorProfile* ProfileManager::find(gchar const* name) +{ + ColorProfile* match = 0; + if ( name ) { + unsigned int howMany = childCount(NULL); + for ( unsigned int index = 0; index < howMany; index++ ) { + SPObject *obj = nthChildOf(NULL, index); + ColorProfile* prof = reinterpret_cast<ColorProfile*>(obj); + if ( prof && prof->name && !strcmp(name, prof->name) ) { + match = prof; + break; + } + } + } + return match; +} } diff --git a/src/profile-manager.h b/src/profile-manager.h index c52101ca3..61e22615f 100644 --- a/src/profile-manager.h +++ b/src/profile-manager.h @@ -15,9 +15,10 @@ class SPDocument; - namespace Inkscape { +class ColorProfile; + class ProfileManager : public DocumentSubset, public GC::Finalized { @@ -25,6 +26,8 @@ public: ProfileManager(SPDocument *document); ~ProfileManager(); + ColorProfile* find(gchar const* name); + private: ProfileManager(ProfileManager const &); // no copy void operator=(ProfileManager const &); // no assign |
