From 1cfa72a83101d7ea1f89b2c20a6c29d12e8da933 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Wed, 21 Jul 2021 13:36:13 +0300 Subject: IsVertical->IsEffectivelyVertical, GetDirectVertical->GetVertical Before commit 653b53287ca09a9ffe3f5ce0242919e719c1086c, editengine objects had a pair IsVertical/SetVertical, which queried and set a boolean flag (and SetVertical also had a second argument to set another flag). The mentioned commit had introduced an inconsistency, changing SetVertical to only set a single flag, but at the same time making IsVertical to return a synthesized result from two values: vertical and rotation. Additionally, GetDirectVertical was introduced to complement SetVertical. In many places, the use of synthetic IsVertical looks suspicious, especially where it is used in combinations with SetVertical. But here I don't change existing logic, and only rename the methods, so that in case someone sees an actual problem, it would be easier to spot the method mismatch. The end result is that now we have a proper getter/setter pair GetVertical/SetVertical, and also IsEffectivelyVertical, named to reflect that it calculates its return value. Change-Id: I38e2b7c5bd7af0787dd7a1c48e1385138dac80b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119315 Tested-by: Mike Kaganski Reviewed-by: Mike Kaganski --- forms/source/richtext/specialdispatchers.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'forms') diff --git a/forms/source/richtext/specialdispatchers.cxx b/forms/source/richtext/specialdispatchers.cxx index 9617cde6f048..db7ef6807df8 100644 --- a/forms/source/richtext/specialdispatchers.cxx +++ b/forms/source/richtext/specialdispatchers.cxx @@ -93,7 +93,7 @@ namespace frm EditEngine* pEngine = getEditView() ? getEditView()->GetEditEngine() : nullptr; OSL_ENSURE( pEngine, "OParagraphDirectionDispatcher::dispatch: no edit engine - but not yet disposed?" ); - if ( pEngine && pEngine->IsVertical() ) + if ( pEngine && pEngine->IsEffectivelyVertical() ) aEvent.IsEnabled = false; return aEvent; @@ -117,7 +117,7 @@ namespace frm if ( !pEngine ) return; - pEngine->SetVertical( !pEngine->IsVertical() ); + pEngine->SetVertical( !pEngine->IsEffectivelyVertical() ); } @@ -129,7 +129,7 @@ namespace frm OSL_ENSURE( pEngine, "OTextDirectionDispatcher::dispatch: no edit engine - but not yet disposed?" ); aEvent.IsEnabled = true; - aEvent.State <<= pEngine && pEngine->IsVertical(); + aEvent.State <<= pEngine && pEngine->IsEffectivelyVertical(); return aEvent; } -- cgit