From: Seoyeon Kim Date: Mon, 5 Nov 2018 08:19:23 +0000 (+0900) Subject: Revert "[Tizen] Sorts text sequences in LTR and RTL by system language direction." X-Git-Tag: accepted/tizen/5.0/unified/20181106.070355~23 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=2accb5b436636636fc78cfc0f1b5838381b8c1cd Revert "[Tizen] Sorts text sequences in LTR and RTL by system language direction." This reverts commit f77a142d5fe5bd5972e5d940b3077634f3b9408a. --- diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-text-abstraction.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-text-abstraction.cpp index bef3271..75312ef 100755 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-text-abstraction.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-text-abstraction.cpp @@ -70,8 +70,7 @@ public: } return bidirectionalSupportHandle; } - BidiInfoIndex CreateInfo( const Character* const paragraph, Length numberOfCharacters, - bool matchSystemLanguageDirection, LayoutDirection::Type layoutDirection ){return 0;} + BidiInfoIndex CreateInfo( const Character* const paragraph, Length numberOfCharacters ){return 0;} void DestroyInfo( BidiInfoIndex bidiInfoIndex ) { @@ -303,11 +302,9 @@ BidirectionalSupport BidirectionalSupport::Get() } BidiInfoIndex BidirectionalSupport::CreateInfo( const Character* const paragraph, - Length numberOfCharacters, - bool matchSystemLanguageDirection, - LayoutDirection::Type layoutDirection ) + Length numberOfCharacters ) { - return GetImplementation( *this ).CreateInfo( paragraph, numberOfCharacters, matchSystemLanguageDirection, layoutDirection ); + return GetImplementation( *this ).CreateInfo( paragraph, numberOfCharacters ); } void BidirectionalSupport::DestroyInfo( BidiInfoIndex bidiInfoIndex ) diff --git a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp index 5196d17..af57128 100755 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp @@ -1226,10 +1226,6 @@ void TextEditor::OnInitialize() mController->SetNoTextDoubleTapAction( Controller::NoTextTap::HIGHLIGHT ); mController->SetNoTextLongPressAction( Controller::NoTextTap::HIGHLIGHT ); - // Sets layoutDirection value - Dali::LayoutDirection::Type layoutDirection = static_cast( self.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get() ); - mController->SetLayoutDirection( layoutDirection ); - // Forward input events to controller EnableGestureDetection( static_cast( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) ); GetTapGestureDetector().SetMaximumTapsRequired( 2 ); diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp index 5077ced..d4485ba 100755 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -1286,10 +1286,6 @@ void TextField::OnInitialize() mController->SetNoTextDoubleTapAction( Controller::NoTextTap::HIGHLIGHT ); mController->SetNoTextLongPressAction( Controller::NoTextTap::HIGHLIGHT ); - // Sets layoutDirection value - Dali::LayoutDirection::Type layoutDirection = static_cast( self.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get() ); - mController->SetLayoutDirection( layoutDirection ); - // Forward input events to controller EnableGestureDetection( static_cast( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) ); GetTapGestureDetector().SetMaximumTapsRequired( 2 ); 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 376709a..7a8c283 100755 --- a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp @@ -884,10 +884,6 @@ void TextLabel::OnInitialize() // Enable the text ellipsis. mController->SetTextElideEnabled( true ); // If false then text larger than control will overflow - // Sets layoutDirection value - Dali::LayoutDirection::Type layoutDirection = static_cast( self.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get() ); - mController->SetLayoutDirection( layoutDirection ); - Layout::Engine& engine = mController->GetLayoutEngine(); engine.SetCursorWidth( 0u ); // Do not layout space for the cursor. } diff --git a/dali-toolkit/internal/text/bidirectional-support.cpp b/dali-toolkit/internal/text/bidirectional-support.cpp old mode 100755 new mode 100644 index 9f9bddc..57dc613 --- a/dali-toolkit/internal/text/bidirectional-support.cpp +++ b/dali-toolkit/internal/text/bidirectional-support.cpp @@ -88,9 +88,7 @@ void SetBidirectionalInfo( const Vector& text, const Vector& lineBreakInfo, CharacterIndex startIndex, Length numberOfCharacters, - Vector& bidirectionalInfo, - bool matchSystemLanguageDirection, - Dali::LayoutDirection::Type layoutDirection ) + Vector& bidirectionalInfo ) { // Find where to insert the new paragraphs. BidirectionalRunIndex bidiInfoIndex = 0u; @@ -167,9 +165,7 @@ void SetBidirectionalInfo( const Vector& text, // Create the bidirectional info for the whole paragraph and store the index to the table with this info in the run. bidirectionalRun.bidirectionalInfoIndex = bidirectionalSupport.CreateInfo( textBuffer + bidirectionalRun.characterRun.characterIndex, - bidirectionalRun.characterRun.numberOfCharacters, - matchSystemLanguageDirection, - layoutDirection ); + bidirectionalRun.characterRun.numberOfCharacters ); bidirectionalInfo.Insert( bidirectionalInfo.Begin() + bidiInfoIndex, bidirectionalRun ); ++bidiInfoIndex; diff --git a/dali-toolkit/internal/text/bidirectional-support.h b/dali-toolkit/internal/text/bidirectional-support.h old mode 100755 new mode 100644 index c29f401..39ec9d6 --- a/dali-toolkit/internal/text/bidirectional-support.h +++ b/dali-toolkit/internal/text/bidirectional-support.h @@ -20,7 +20,6 @@ // EXTERNAL INCLUDES #include -#include // INTERNAL INCLUDES #include @@ -46,17 +45,13 @@ namespace Text * @param[in] startIndex The character from where the bidirectional info is set. * @param[in] numberOfCharacters The number of characters. * @param[out] bidirectionalInfo Vector with the bidirectional infor for each paragraph. - * @param[in] matchSystemLanguageDirection Whether match for system language direction or not. - * @param[in] layoutDirection The direction of the system language. */ void SetBidirectionalInfo( const Vector& text, const Vector& scripts, const Vector& lineBreakInfo, CharacterIndex startIndex, Length numberOfCharacters, - Vector& bidirectionalInfo, - bool matchSystemLanguageDirection = false, - Dali::LayoutDirection::Type layoutDirection = LayoutDirection::LEFT_TO_RIGHT ); + Vector& bidirectionalInfo ); /** * Sets the visual to logical map tables. diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index 97a3da9..caefc0c 100755 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -963,9 +963,7 @@ bool Controller::Impl::UpdateModel( OperationsMask operationsRequired ) lineBreakInfo, startIndex, requestedNumberOfCharacters, - bidirectionalInfo, - mModel->mMatchSystemLanguageDirection, - mLayoutDirection ); + bidirectionalInfo ); if( 0u != bidirectionalInfo.Count() ) { diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 5d0543c..f0b496f 100755 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -427,11 +427,6 @@ void Controller::SetMatchSystemLanguageDirection( bool match ) mImpl->mModel->mMatchSystemLanguageDirection = match; } -void Controller::SetLayoutDirection( Dali::LayoutDirection::Type layoutDirection ) -{ - mImpl->mLayoutDirection = layoutDirection; -} - void Controller::SetLineWrapMode( Text::LineWrap::Mode lineWrapMode ) { diff --git a/dali-toolkit/internal/text/text-controller.h b/dali-toolkit/internal/text/text-controller.h index 33f1f8f..f92a69d 100755 --- a/dali-toolkit/internal/text/text-controller.h +++ b/dali-toolkit/internal/text/text-controller.h @@ -1255,13 +1255,6 @@ public: // Queries & retrieves. */ void SetMatchSystemLanguageDirection( bool match ); - /** - * @brief Sets layoutDirection value - * @param[in] layoutDirection The value of system language direction - */ - void SetLayoutDirection( Dali::LayoutDirection::Type layoutDirection ); - - public: // Relayout. /** diff --git a/docs/content/images/text-controls/HelloWorld-Default-BEGIN.png b/docs/content/images/text-controls/HelloWorld-Default-BEGIN.png deleted file mode 100755 index ca9d860..0000000 Binary files a/docs/content/images/text-controls/HelloWorld-Default-BEGIN.png and /dev/null differ diff --git a/docs/content/images/text-controls/HelloWorld-Default-CENTER.png b/docs/content/images/text-controls/HelloWorld-Default-CENTER.png deleted file mode 100755 index cb28206..0000000 Binary files a/docs/content/images/text-controls/HelloWorld-Default-CENTER.png and /dev/null differ diff --git a/docs/content/images/text-controls/HelloWorld-Default-END.png b/docs/content/images/text-controls/HelloWorld-Default-END.png index 204ba94..3302d08 100755 Binary files a/docs/content/images/text-controls/HelloWorld-Default-END.png and b/docs/content/images/text-controls/HelloWorld-Default-END.png differ diff --git a/docs/content/images/text-controls/HelloWorld-System-BEGIN.png b/docs/content/images/text-controls/HelloWorld-System-BEGIN.png deleted file mode 100755 index 11c8eda..0000000 Binary files a/docs/content/images/text-controls/HelloWorld-System-BEGIN.png and /dev/null differ diff --git a/docs/content/images/text-controls/HelloWorld-System-CENTER.png b/docs/content/images/text-controls/HelloWorld-System-CENTER.png deleted file mode 100755 index cb28206..0000000 Binary files a/docs/content/images/text-controls/HelloWorld-System-CENTER.png and /dev/null differ diff --git a/docs/content/images/text-controls/HelloWorld-System-END.png b/docs/content/images/text-controls/HelloWorld-System-END.png index d8c674b..2794090 100755 Binary files a/docs/content/images/text-controls/HelloWorld-System-END.png and b/docs/content/images/text-controls/HelloWorld-System-END.png differ diff --git a/docs/content/images/text-controls/LTR_RTL.png b/docs/content/images/text-controls/LTR_RTL.png deleted file mode 100755 index d9defc3..0000000 Binary files a/docs/content/images/text-controls/LTR_RTL.png and /dev/null differ diff --git a/docs/content/images/text-controls/LTR_order.png b/docs/content/images/text-controls/LTR_order.png deleted file mode 100755 index 6e8a3c1..0000000 Binary files a/docs/content/images/text-controls/LTR_order.png and /dev/null differ diff --git a/docs/content/images/text-controls/RTL_order.png b/docs/content/images/text-controls/RTL_order.png deleted file mode 100755 index b97e0f8..0000000 Binary files a/docs/content/images/text-controls/RTL_order.png and /dev/null differ diff --git a/docs/content/shared-javascript-and-cpp-documentation/text-label.md b/docs/content/shared-javascript-and-cpp-documentation/text-label.md index 8b9d4d6..9b463e4 100755 --- a/docs/content/shared-javascript-and-cpp-documentation/text-label.md +++ b/docs/content/shared-javascript-and-cpp-documentation/text-label.md @@ -90,14 +90,14 @@ label.HorizontalAlignment = "BEGIN"; // "CENTER" or "END" -The text's alignment and order can be modified to match the direction of the system language. +The text's alignment can be modified to match the direction of the system language. -If the MATCH_SYSTEM_LANGUAGE_DIRECTION property is set to true then the direction of the text is ignored, instead the text is aligned and ordered as the system default language. +If the MATCH_SYSTEM_LANGUAGE_DIRECTION property is set to true then the direction of the text is ignored, instead the text is aligned as the system default language. ~~~{.cpp} // C++ -label.SetProperty( Toolkit::DevelTextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, true ); +label.SetProperty( TextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, true ); ~~~ ~~~{.js} @@ -109,19 +109,8 @@ label.matchSystemLanguageDirection = true; | | | |--|--| | Current system language direction left-to-right | | -| MATCH_SYSTEM_LANGUAGE_DIRECTION set to TRUE. | MATCH_SYSTEM_LANGUAGE_DIRECTION set to FALSE (default). | -| BEGIN alignment | BEGIN alignment | -| ![ ](../assets/img/text-controls/HelloWorld-System-BEGIN.png) ![ ](HelloWorld-System-BEGIN.png) | ![ ](../assets/img/text-controls/HelloWorld-Default-BEGIN.png) ![ ](HelloWorld-Default-BEGIN.png) | -| CENTER alignment | CENTER alignment | -| ![ ](../assets/img/text-controls/HelloWorld-System-CENTER.png) ![ ](HelloWorld-System-CENTER.png) | ![ ](../assets/img/text-controls/HelloWorld-Default-CENTER.png) ![ ](HelloWorld-Default-CENTER.png) | -| END alignment | END alignment | -| ![ ](../assets/img/text-controls/HelloWorld-System-END.png) ![ ](HelloWorld-System-END.png) | ![ ](../assets/img/text-controls/HelloWorld-Default-END.png) ![ ](HelloWorld-Default-END.png) | - - -| | | -|--|--| -| Current system language direction left-to-right | Current system language direction right-to-left | -| ![ ](../assets/img/text-controls/LTR_order.png) ![ ](LTR_order.png) | ![ ](../assets/img/text-controls/RTL_order.png) ![ ](RTL_order.png) | +| END alignment and MATCH_SYSTEM_LANGUAGE_DIRECTION set to TRUE. | END alignment and MATCH_SYSTEM_LANGUAGE_DIRECTION set to FALSE (default). | +| ![ ](HelloWorld-System-END.png) | ![ ](HelloWorld-Default-END.png) | The examples above assume that the TextLabel size greater than the minimum required.