summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2012-06-03 15:33:36 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2012-06-04 11:44:48 +0200
commit086abe9eddd55573d8c04728649b574338176410 (patch)
treeb6e82555648977255ead36489d8acded8d3497b6 /vcl
parent67673e9ba6788f4c85bfdaac6091148086f12941 (diff)
Replace the module icc functionality by a use of lcms2
Change-Id: I989af1147711f0175bf889bc55043b2d84a49b38
Diffstat (limited to 'vcl')
-rw-r--r--vcl/Library_vcl.mk1
-rw-r--r--vcl/prj/build.lst2
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx12
3 files changed, 12 insertions, 3 deletions
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 75a1059b512e..d397f04a8b9b 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -93,6 +93,7 @@ endif
$(eval $(call gb_Library_use_externals,vcl,\
icule \
icuuc \
+ lcms2 \
))
$(eval $(call gb_Library_add_cobjects,vcl,\
diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst
index b5fd5eb2c506..3e8293973ffd 100644
--- a/vcl/prj/build.lst
+++ b/vcl/prj/build.lst
@@ -1,4 +1,4 @@
-vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost officecfg DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt CAIRO:cairo FREETYPE:freetype FONTCONFIG:fontconfig shell NULL
+vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost officecfg DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools cpputools svl LCMS2:lcms2 LIBXSLT:libxslt CAIRO:cairo FREETYPE:freetype FONTCONFIG:fontconfig shell NULL
vc vcl usr1 - all vc_mkout NULL
vc vcl\prj nmake - all vc_prj NULL
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index c1159759e912..059f291981e0 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -71,7 +71,7 @@
#include <textlayout.hxx>
#include <salgdi.hxx>
-#include <icc/sRGB-IEC61966-2.1.hxx>
+#include <lcms2.h>
#include <comphelper/processfactory.hxx>
@@ -6202,7 +6202,15 @@ sal_Int32 PDFWriterImpl::emitOutputIntent()
osl_getFilePos( m_aFile, &nBeginStreamPos );
beginCompression();
checkAndEnableStreamEncryption( nICCObject );
- sal_Int32 nStreamSize = writeBuffer( nsRGB_ICC_profile, (sal_Int32) sizeof( nsRGB_ICC_profile ) );
+ cmsHPROFILE hProfile = cmsCreate_sRGBProfile();
+ sal_uInt32 nBytesNeeded = 0;
+ cmsSaveProfileToMem(hProfile, NULL, &nBytesNeeded);
+ if (!nBytesNeeded)
+ return 0;
+ std::vector<unsigned char> xBuffer(nBytesNeeded);
+ cmsSaveProfileToMem(hProfile, &xBuffer[0], &nBytesNeeded);
+ cmsCloseProfile(hProfile);
+ sal_Int32 nStreamSize = writeBuffer( &xBuffer[0], (sal_Int32) xBuffer.size() );
disableStreamEncryption();
endCompression();
sal_uInt64 nEndStreamPos = 0;