[Libreoffice-commits] core.git: cppcanvas/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Oct 30 23:29:00 UTC 2018


 cppcanvas/source/inc/outdevstate.hxx          |    4 ++--
 cppcanvas/source/mtfrenderer/implrenderer.cxx |   14 ++++++++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 144416c428712b039927ff9d6b1eae05bc2c2478
Author:     Mark Hung <marklh9 at gmail.com>
AuthorDate: Wed Oct 24 00:03:41 2018 +0800
Commit:     Mark Hung <marklh9 at gmail.com>
CommitDate: Wed Oct 31 00:28:33 2018 +0100

    tdf#43671 creatCanvasFont with EmphasisMark.
    
    Change-Id: I8c7592e9bdb212fcbb07655e81faadd07ed880f7
    Reviewed-on: https://gerrit.libreoffice.org/62244
    Tested-by: Jenkins
    Reviewed-by: Mark Hung <marklh9 at gmail.com>

diff --git a/cppcanvas/source/inc/outdevstate.hxx b/cppcanvas/source/inc/outdevstate.hxx
index 1a087fdc63c4..36f4c6fda57f 100644
--- a/cppcanvas/source/inc/outdevstate.hxx
+++ b/cppcanvas/source/inc/outdevstate.hxx
@@ -57,7 +57,7 @@ namespace cppcanvas
                 mapModeTransform(),
                 fontRotation(0.0),
 
-                textEmphasisMarkStyle(FontEmphasisMark::NONE),
+                textEmphasisMark(FontEmphasisMark::NONE),
                 pushFlags(PushFlags::ALL),
                 textDirection(css::rendering::TextDirection::WEAK_LEFT_TO_RIGHT),
                 textAlignment(0), // TODO(Q2): Synchronize with implrenderer
@@ -99,7 +99,7 @@ namespace cppcanvas
             ::basegfx::B2DHomMatrix                                                  mapModeTransform;
             double                                                                   fontRotation;
 
-            FontEmphasisMark                                                         textEmphasisMarkStyle;
+            FontEmphasisMark                                                         textEmphasisMark;
             PushFlags                                                                pushFlags;
             sal_Int8                                                                 textDirection;
             sal_Int8                                                                 textAlignment;
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 8108ffbb4564..237f69bf7af3 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -306,7 +306,7 @@ namespace cppcanvas
                     aCalculatedNewState.textOverlineStyle       = rNewState.textOverlineStyle;
                     aCalculatedNewState.textUnderlineStyle      = rNewState.textUnderlineStyle;
                     aCalculatedNewState.textStrikeoutStyle      = rNewState.textStrikeoutStyle;
-                    aCalculatedNewState.textEmphasisMarkStyle   = rNewState.textEmphasisMarkStyle;
+                    aCalculatedNewState.textEmphasisMark        = rNewState.textEmphasisMark;
                     aCalculatedNewState.isTextEffectShadowSet   = rNewState.isTextEffectShadowSet;
                     aCalculatedNewState.isTextWordUnderlineSet  = rNewState.isTextWordUnderlineSet;
                     aCalculatedNewState.isTextOutlineModeSet    = rNewState.isTextOutlineModeSet;
@@ -840,6 +840,16 @@ namespace cppcanvas
             }
             aFontRequest.CellSize = (rState.mapModeTransform * vcl::unotools::b2DSizeFromSize(rFontSizeLog)).getY();
 
+            if (rFont.GetEmphasisMark() != FontEmphasisMark::NONE)
+            {
+                uno::Sequence< beans::PropertyValue > aProperties(1);
+                aProperties[0].Name = "EmphasisMark";
+                aProperties[0].Value <<= sal_uInt32(rFont.GetEmphasisMark());
+                return rParms.mrCanvas->getUNOCanvas()->createFont(aFontRequest,
+                                                                aProperties,
+                                                                aFontMatrix);
+            }
+
             return rParms.mrCanvas->getUNOCanvas()->createFont( aFontRequest,
                                                                 uno::Sequence< beans::PropertyValue >(),
                                                                 aFontMatrix );
@@ -1488,7 +1498,7 @@ namespace cppcanvas
                             (*rParms.maFontUnderline ? sal_Int8(LINESTYLE_SINGLE) : sal_Int8(LINESTYLE_NONE)) :
                             static_cast<sal_Int8>(rFont.GetUnderline());
                         rState.textStrikeoutStyle       = static_cast<sal_Int8>(rFont.GetStrikeout());
-                        rState.textEmphasisMarkStyle    = rFont.GetEmphasisMark() & FontEmphasisMark::Style;
+                        rState.textEmphasisMark         = rFont.GetEmphasisMark();
                         rState.isTextEffectShadowSet    = rFont.IsShadow();
                         rState.isTextWordUnderlineSet   = rFont.IsWordLineMode();
                         rState.isTextOutlineModeSet     = rFont.IsOutline();


More information about the Libreoffice-commits mailing list