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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Nov 5 11:21:11 UTC 2018


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

New commits:
commit 9709061a570a4867a4c5898ffed936b4b47ce90f
Author:     Mark Hung <marklh9 at gmail.com>
AuthorDate: Wed Oct 31 23:55:31 2018 +0800
Commit:     Mark Hung <marklh9 at gmail.com>
CommitDate: Mon Nov 5 12:20:15 2018 +0100

    tdf#37636 take care of MetaOverlineColorAction in mtfrenderer.
    
    Keep the overline color in DevOutState so that it can be
    used in text actions later.
    
    Change-Id: Ia584de9b78e1adf6862c09fb50cbed1f16e2ad0b
    Reviewed-on: https://gerrit.libreoffice.org/62829
    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 36f4c6fda57f..0c24d5f75366 100644
--- a/cppcanvas/source/inc/outdevstate.hxx
+++ b/cppcanvas/source/inc/outdevstate.hxx
@@ -50,6 +50,7 @@ namespace cppcanvas
                 fillColor(),
                 textColor(),
                 textFillColor(),
+                textOverlineColor(),
                 textLineColor(),
 
                 xFont(),
@@ -75,6 +76,7 @@ namespace cppcanvas
                 isLineColorSet( false ),
                 isFillColorSet( false ),
                 isTextFillColorSet( false ),
+                isTextOverlineColorSet( false ),
                 isTextLineColorSet( false )
             {
             }
@@ -87,6 +89,7 @@ namespace cppcanvas
             css::uno::Sequence< double >                                             fillColor;
             css::uno::Sequence< double >                                             textColor;
             css::uno::Sequence< double >                                             textFillColor;
+            css::uno::Sequence< double >                                             textOverlineColor;
             css::uno::Sequence< double >                                             textLineColor;
 
             /** Current font.
@@ -116,6 +119,7 @@ namespace cppcanvas
             bool                                                                     isLineColorSet;
             bool                                                                     isFillColorSet;
             bool                                                                     isTextFillColorSet;
+            bool                                                                     isTextOverlineColorSet;
             bool                                                                     isTextLineColorSet;
         };
     }
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 237f69bf7af3..cee91bcd3853 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -356,6 +356,12 @@ namespace cppcanvas
                     aCalculatedNewState.isTextLineColorSet = rNewState.isTextLineColorSet;
                 }
 
+                if( aCalculatedNewState.pushFlags & PushFlags::OVERLINECOLOR )
+                {
+                    aCalculatedNewState.textOverlineColor = rNewState.textOverlineColor;
+                    aCalculatedNewState.isTextOverlineColorSet = rNewState.isTextOverlineColorSet;
+                }
+
                 if( aCalculatedNewState.pushFlags & PushFlags::TEXTLAYOUTMODE )
                 {
                     aCalculatedNewState.textAlignment = rNewState.textAlignment;
@@ -1473,6 +1479,22 @@ namespace cppcanvas
                         }
                         break;
 
+                    case MetaActionType::OVERLINECOLOR:
+                        if( !rParms.maTextColor.is_initialized() )
+                        {
+                            setStateColor( static_cast<MetaOverlineColorAction*>(pCurrAct),
+                                           rStates.getState().isTextOverlineColorSet,
+                                           rStates.getState().textOverlineColor,
+                                           rCanvas );
+                        }
+                        else
+                        {
+                            bool bSetting(static_cast<MetaOverlineColorAction*>(pCurrAct)->IsSetting());
+
+                            rStates.getState().isTextOverlineColorSet = bSetting;
+                        }
+                        break;
+
                     case MetaActionType::TEXTALIGN:
                     {
                         ::cppcanvas::internal::OutDevState& rState = rStates.getState();
@@ -2921,6 +2943,7 @@ namespace cppcanvas
                 // setup default text color to black
                 rState.textColor =
                     rState.textFillColor =
+                    rState.textOverlineColor =
                     rState.textLineColor = tools::intSRGBAToDoubleSequence( 0x000000FF );
             }
 
@@ -2941,9 +2964,11 @@ namespace cppcanvas
             {
                 ::cppcanvas::internal::OutDevState& rState = aStateStack.getState();
                 rState.isTextFillColorSet = true;
+                rState.isTextOverlineColorSet = true;
                 rState.isTextLineColorSet = true;
                 rState.textColor =
                     rState.textFillColor =
+                    rState.textOverlineColor =
                     rState.textLineColor = tools::intSRGBAToDoubleSequence( *rParams.maTextColor );
             }
             if( rParams.maFontName.is_initialized() ||


More information about the Libreoffice-commits mailing list