emfio/source/reader/emfreader.cxx |   28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

New commits:
commit 1849e2d46c42412e2d98c80aef1c9f8f2f524b5a
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Feb 18 17:36:57 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Wed Feb 19 06:46:48 2025 +0100

    partially implement EMR_CREATECOLORSPACE
    
    just enough to make it stop spitting out hundreds of warnings
    when I am debugging
    
    Change-Id: Icbfcd334ee568c2154f665fc31646982cceb52aa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181846
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/emfio/source/reader/emfreader.cxx 
b/emfio/source/reader/emfreader.cxx
index 9cdbeedda898..31903c4ce10f 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -2136,6 +2136,33 @@ namespace emfio
                     }
                     break;
 
+                    case EMR_CREATECOLORSPACE :
+                    {
+                        sal_uInt32 nRemainingRecSize = nRecSize - 8;
+                        if (nRemainingRecSize < 5)
+                            bStatus = false;
+                        else
+                        {
+                            // index of the logical color space object in the 
EMF object table
+                            sal_Int32 ihCS(0);
+                            mpInputStream->ReadInt32(ihCS);
+                            sal_Int32 nDescChars = nRemainingRecSize - 4;
+                            OUString aDesc;
+                            for (sal_Int32 i=0; i < nDescChars; i++)
+                            {
+                                unsigned char cChar(0);
+                                mpInputStream->ReadUChar(cChar);
+                                if (cChar == 0)
+                                    break;
+                                aDesc = aDesc + 
OUStringChar(static_cast<sal_Unicode>(cChar));
+                            }
+                            // if it's the standard color space name, no need 
to do anything
+                            if (aDesc != "COSP")
+                                SAL_WARN("emfio", "TODO: color space change 
for EMR_CREATECOLORSPACE not implemented: '" << aDesc << "' " << nDescChars);
+                        }
+                    }
+                    break;
+
                     case EMR_MASKBLT :
                     case EMR_PLGBLT :
                     case EMR_SETDIBITSTODEVICE :
@@ -2149,7 +2176,6 @@ namespace emfio
                     case EMR_ANGLEARC :
                     case EMR_SETCOLORADJUSTMENT :
                     case EMR_POLYDRAW16 :
-                    case EMR_CREATECOLORSPACE :
                     case EMR_SETCOLORSPACE :
                     case EMR_DELETECOLORSPACE :
                     case EMR_GLSRECORD :

Reply via email to