From: Victor Cebollada Date: Thu, 29 Oct 2015 10:58:17 +0000 (+0000) Subject: Fix Kloc issues. X-Git-Tag: dali_1.1.9~7^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=4469fbe38e5ce460187346003a013552a9d393a5 Fix Kloc issues. Change-Id: I339d9a45ebe0db37d885bd658ade44035586a9e5 Signed-off-by: Victor Cebollada --- diff --git a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp index 12de684..fd0bcae 100644 --- a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp @@ -282,7 +282,7 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr if( impl.mController ) { float height = value.Get< float >(); - if ( impl.mController->GetUnderlineHeight() != height ) + if( fabsf( impl.mController->GetUnderlineHeight() - height ) > Math::MACHINE_EPSILON_1000 ) { impl.mController->SetUnderlineHeight( height ); impl.mRenderer.Reset(); diff --git a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h index e4cef74..4444d0c 100644 --- a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h @@ -38,9 +38,6 @@ namespace Toolkit namespace Internal { -namespace -{ - enum PopupCustomisations { POPUP_MAXIMUM_SIZE, @@ -49,8 +46,6 @@ enum PopupCustomisations OPTION_DIVIDER_SIZE }; -} // namespace - class TextSelectionPopup : public Control { public: diff --git a/dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.h b/dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.h index 92aa391..7997bfa 100644 --- a/dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.h +++ b/dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.h @@ -36,11 +36,6 @@ namespace Toolkit namespace Internal { -namespace -{ - -} // namespace - class TextSelectionToolbar : public Control { public: diff --git a/dali-toolkit/internal/text/layouts/layout-engine.cpp b/dali-toolkit/internal/text/layouts/layout-engine.cpp index 54a957c..ad513a8 100644 --- a/dali-toolkit/internal/text/layouts/layout-engine.cpp +++ b/dali-toolkit/internal/text/layouts/layout-engine.cpp @@ -766,10 +766,12 @@ struct LayoutEngine::Impl { if( isLastLine && !isRTL ) { + // Add the length of the white saces at the end of the line. lineLength += line.extraLength; if( lineLength > boxWidth ) { - lineLength = boxWidth; + // The line's length is longer than the box's width. + // Set the line's offset to 0 and nothing else to do. line.alignmentOffset = 0.f; break; } diff --git a/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp b/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp index 8653b43..5592589 100644 --- a/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp +++ b/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp @@ -232,7 +232,7 @@ struct AtlasRenderer::Impl currentUnderlinePosition = ceil( fabsf( fontMetrics.underlinePosition ) ); const float descender = ceil( fabsf( fontMetrics.descender ) ); - if ( underlineHeight == ZERO ) + if( fabsf( underlineHeight ) < Math::MACHINE_EPSILON_1000 ) { currentUnderlineThickness = fontMetrics.underlineThickness; @@ -252,7 +252,7 @@ struct AtlasRenderer::Impl { currentUnderlinePosition = descender; } - if ( ZERO == currentUnderlinePosition ) + if( fabsf( currentUnderlinePosition ) < Math::MACHINE_EPSILON_1000 ) { // Move offset down by one ( EFL behavior ) currentUnderlinePosition = ONE; diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index eddde06..f7958ff 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -667,7 +667,7 @@ float Controller::GetHeightForWidth( float width ) ProcessModifyEvents(); Size layoutSize; - if( width != mImpl->mVisualModel->mControlSize.width ) + if( fabsf( width - mImpl->mVisualModel->mControlSize.width ) > Math::MACHINE_EPSILON_1000 ) { // Operations that can be done only once until the text changes. const OperationsMask onlyOnceOperations = static_cast( CONVERT_TO_UTF32 |