Code

now that selection description includes style (filtered, clipped), we need to update...
[inkscape.git] / src / color-profile.cpp
index 9ac1f6414d25ad92483c00030a9e9ea8bab18dcf..a562d756c7967c5d0abf7fcc111362db25384075 100644 (file)
@@ -254,10 +254,10 @@ void ColorProfile::set( SPObject *object, unsigned key, gchar const *value )
                     //# 1.  Get complete URI of document
                     gchar const *docbase = SP_DOCUMENT_URI( doc );
                     if (!docbase)
-                        {
-                        g_warning("null docbase");
+                    {
+                        // Normal for files that have not yet been saved.
                         docbase = "";
-                        }
+                    }
                     //g_message("docbase:%s\n", docbase);
                     org::w3c::dom::URI docUri(docbase);
                     //# 2. Get href of icc file.  we don't care if it's rel or abs
@@ -265,7 +265,7 @@ void ColorProfile::set( SPObject *object, unsigned key, gchar const *value )
                     //# 3.  Resolve the href according the docBase.  This follows
                     //      the w3c specs.  All absolute and relative issues are considered
                     org::w3c::dom::URI cprofUri = docUri.resolve(hrefUri);
-                    gchar* fullname = (gchar *)cprofUri.getNativePath().c_str();
+                    gchar* fullname = g_strdup((gchar *)cprofUri.getNativePath().c_str());
                     cprof->_clearProfile();
                     cprof->profHandle = cmsOpenProfileFromFile( fullname, "r" );
                     if ( cprof->profHandle ) {
@@ -275,7 +275,7 @@ void ColorProfile::set( SPObject *object, unsigned key, gchar const *value )
 #ifdef DEBUG_LCMS
                     DEBUG_MESSAGE( lcmsOne, "cmsOpenProfileFromFile( '%s'...) = %p", fullname, (void*)cprof->profHandle );
 #endif // DEBUG_LCMS
-
+                    g_free(fullname);
 #endif // ENABLE_LCMS
                 }
             }
@@ -561,6 +561,7 @@ Glib::ustring Inkscape::get_path_for_profile(Glib::ustring const& name)
 
     return result;
 }
+#endif // ENABLE_LCMS
 
 std::list<Glib::ustring> ColorProfile::getProfileDirs() {
     std::list<Glib::ustring> sources;
@@ -587,6 +588,7 @@ std::list<Glib::ustring> ColorProfile::getProfileDirs() {
     return sources;
 }
 
+#if ENABLE_LCMS
 static void findThings() {
     std::list<Glib::ustring> sources = ColorProfile::getProfileDirs();
 
@@ -858,9 +860,9 @@ cmsHTRANSFORM Inkscape::colorprofile_get_display_transform()
                 dwFlags |= cmsFLAGS_PRESERVEBLACK;
             }
 #endif // defined(cmsFLAGS_PRESERVEBLACK)
-            transf = cmsCreateProofingTransform( ColorProfile::getSRGBProfile(), TYPE_RGB_8, hprof, TYPE_RGB_8, proofProf, intent, proofIntent, dwFlags );
+            transf = cmsCreateProofingTransform( ColorProfile::getSRGBProfile(), TYPE_ARGB_8, hprof, TYPE_ARGB_8, proofProf, intent, proofIntent, dwFlags );
         } else if ( hprof ) {
-            transf = cmsCreateTransform( ColorProfile::getSRGBProfile(), TYPE_RGB_8, hprof, TYPE_RGB_8, intent, 0 );
+            transf = cmsCreateTransform( ColorProfile::getSRGBProfile(), TYPE_ARGB_8, hprof, TYPE_ARGB_8, intent, 0 );
         }
     }
 
@@ -1018,9 +1020,9 @@ cmsHTRANSFORM Inkscape::colorprofile_get_display_per( Glib::ustring const& id )
                             dwFlags |= cmsFLAGS_PRESERVEBLACK;
                         }
 #endif // defined(cmsFLAGS_PRESERVEBLACK)
-                        item.transf = cmsCreateProofingTransform( ColorProfile::getSRGBProfile(), TYPE_RGB_8, item.hprof, TYPE_RGB_8, proofProf, intent, proofIntent, dwFlags );
+                        item.transf = cmsCreateProofingTransform( ColorProfile::getSRGBProfile(), TYPE_ARGB_8, item.hprof, TYPE_ARGB_8, proofProf, intent, proofIntent, dwFlags );
                     } else if ( item.hprof ) {
-                        item.transf = cmsCreateTransform( ColorProfile::getSRGBProfile(), TYPE_RGB_8, item.hprof, TYPE_RGB_8, intent, 0 );
+                        item.transf = cmsCreateTransform( ColorProfile::getSRGBProfile(), TYPE_ARGB_8, item.hprof, TYPE_ARGB_8, intent, 0 );
                     }
                 }