[Libreoffice-commits] libcdr.git: src/lib

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Feb 18 13:29:55 UTC 2020


 src/lib/CDRParser.cpp |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 6d37a8e264957f28ff0b6016e91806ac6bb67fdf
Author:     Fridrich Štrba <fridrich.strba at bluewin.ch>
AuthorDate: Tue Feb 18 14:29:32 2020 +0100
Commit:     Fridrich Štrba <fridrich.strba at bluewin.ch>
CommitDate: Tue Feb 18 14:29:32 2020 +0100

    Resolve colour palettes for x6 text colours too
    
    Change-Id: I88ba199fa77913e0bb075004f052bf8226efec52

diff --git a/src/lib/CDRParser.cpp b/src/lib/CDRParser.cpp
index eb43b39..91d2e27 100644
--- a/src/lib/CDRParser.cpp
+++ b/src/lib/CDRParser.cpp
@@ -155,6 +155,9 @@ static int parseColourString(const char *colourString, libcdr::CDRColor &colour,
   if (colourModel)
     colour.m_colorModel = get(colourModel);
 
+  if (colourPalette)
+    colour.m_colorPalette = get(colourPalette);
+
   if (val.size() >= 5)
   {
     colour.m_colorValue = val[0] | (val[1] << 8) | (val[2] << 16) | (val[3] << 24);
@@ -172,7 +175,7 @@ static int parseColourString(const char *colourString, libcdr::CDRColor &colour,
   }
   else if (val.size() >= 2)
   {
-    if (colour.m_colorModel == 25)
+    if (colour.m_colorModel == 25 || colour.m_colorModel == 14)
       colour.m_colorValue = (val[1] << 16) | val[0];
     else
     {
@@ -3070,6 +3073,7 @@ void libcdr::CDRParser::_readX6StyleString(librevenge::RVNGInputStream *input, u
       {
         double opacity = 1.0;
         parseColourString(color.get().c_str(), style.m_lineStyle.color, opacity);
+        _resolveColorPalette(style.m_lineStyle.color);
       }
     }
 
@@ -3083,12 +3087,14 @@ void libcdr::CDRParser::_readX6StyleString(librevenge::RVNGInputStream *input, u
       {
         double opacity = 1.0;
         parseColourString(color1.get().c_str(), style.m_fillStyle.color1, opacity);
+        _resolveColorPalette(style.m_fillStyle.color1);
       }
       boost::optional<std::string> color2 = pt.get_optional<std::string>("character.fill.primaryColor");
       if (!!color2)
       {
         double opacity = 1.0;
         parseColourString(color2.get().c_str(), style.m_fillStyle.color2, opacity);
+        _resolveColorPalette(style.m_fillStyle.color2);
       }
     }
   }


More information about the Libreoffice-commits mailing list