Kaydet (Commit) 9709061a authored tarafından Mark Hung's avatar Mark Hung

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: 's avatarMark Hung <marklh9@gmail.com>
üst 729af052
...@@ -50,6 +50,7 @@ namespace cppcanvas ...@@ -50,6 +50,7 @@ namespace cppcanvas
fillColor(), fillColor(),
textColor(), textColor(),
textFillColor(), textFillColor(),
textOverlineColor(),
textLineColor(), textLineColor(),
xFont(), xFont(),
...@@ -75,6 +76,7 @@ namespace cppcanvas ...@@ -75,6 +76,7 @@ namespace cppcanvas
isLineColorSet( false ), isLineColorSet( false ),
isFillColorSet( false ), isFillColorSet( false ),
isTextFillColorSet( false ), isTextFillColorSet( false ),
isTextOverlineColorSet( false ),
isTextLineColorSet( false ) isTextLineColorSet( false )
{ {
} }
...@@ -87,6 +89,7 @@ namespace cppcanvas ...@@ -87,6 +89,7 @@ namespace cppcanvas
css::uno::Sequence< double > fillColor; css::uno::Sequence< double > fillColor;
css::uno::Sequence< double > textColor; css::uno::Sequence< double > textColor;
css::uno::Sequence< double > textFillColor; css::uno::Sequence< double > textFillColor;
css::uno::Sequence< double > textOverlineColor;
css::uno::Sequence< double > textLineColor; css::uno::Sequence< double > textLineColor;
/** Current font. /** Current font.
...@@ -116,6 +119,7 @@ namespace cppcanvas ...@@ -116,6 +119,7 @@ namespace cppcanvas
bool isLineColorSet; bool isLineColorSet;
bool isFillColorSet; bool isFillColorSet;
bool isTextFillColorSet; bool isTextFillColorSet;
bool isTextOverlineColorSet;
bool isTextLineColorSet; bool isTextLineColorSet;
}; };
} }
......
...@@ -356,6 +356,12 @@ namespace cppcanvas ...@@ -356,6 +356,12 @@ namespace cppcanvas
aCalculatedNewState.isTextLineColorSet = rNewState.isTextLineColorSet; aCalculatedNewState.isTextLineColorSet = rNewState.isTextLineColorSet;
} }
if( aCalculatedNewState.pushFlags & PushFlags::OVERLINECOLOR )
{
aCalculatedNewState.textOverlineColor = rNewState.textOverlineColor;
aCalculatedNewState.isTextOverlineColorSet = rNewState.isTextOverlineColorSet;
}
if( aCalculatedNewState.pushFlags & PushFlags::TEXTLAYOUTMODE ) if( aCalculatedNewState.pushFlags & PushFlags::TEXTLAYOUTMODE )
{ {
aCalculatedNewState.textAlignment = rNewState.textAlignment; aCalculatedNewState.textAlignment = rNewState.textAlignment;
...@@ -1473,6 +1479,22 @@ namespace cppcanvas ...@@ -1473,6 +1479,22 @@ namespace cppcanvas
} }
break; 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: case MetaActionType::TEXTALIGN:
{ {
::cppcanvas::internal::OutDevState& rState = rStates.getState(); ::cppcanvas::internal::OutDevState& rState = rStates.getState();
...@@ -2921,6 +2943,7 @@ namespace cppcanvas ...@@ -2921,6 +2943,7 @@ namespace cppcanvas
// setup default text color to black // setup default text color to black
rState.textColor = rState.textColor =
rState.textFillColor = rState.textFillColor =
rState.textOverlineColor =
rState.textLineColor = tools::intSRGBAToDoubleSequence( 0x000000FF ); rState.textLineColor = tools::intSRGBAToDoubleSequence( 0x000000FF );
} }
...@@ -2941,9 +2964,11 @@ namespace cppcanvas ...@@ -2941,9 +2964,11 @@ namespace cppcanvas
{ {
::cppcanvas::internal::OutDevState& rState = aStateStack.getState(); ::cppcanvas::internal::OutDevState& rState = aStateStack.getState();
rState.isTextFillColorSet = true; rState.isTextFillColorSet = true;
rState.isTextOverlineColorSet = true;
rState.isTextLineColorSet = true; rState.isTextLineColorSet = true;
rState.textColor = rState.textColor =
rState.textFillColor = rState.textFillColor =
rState.textOverlineColor =
rState.textLineColor = tools::intSRGBAToDoubleSequence( *rParams.maTextColor ); rState.textLineColor = tools::intSRGBAToDoubleSequence( *rParams.maTextColor );
} }
if( rParams.maFontName.is_initialized() || if( rParams.maFontName.is_initialized() ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment