summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-07-21 13:36:13 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-07-21 14:03:49 +0200
commit1cfa72a83101d7ea1f89b2c20a6c29d12e8da933 (patch)
tree318032bd20ff9943c9039b539c8a68c6a71b4e10 /sc
parent99cd1d8834bb708afc81c825ff2b7992b7acb37d (diff)
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 <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/column2.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuconrec.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuconstr.cxx2
-rw-r--r--sc/source/ui/drawfunc/fudraw.cxx2
-rw-r--r--sc/source/ui/drawfunc/fusel.cxx2
-rw-r--r--sc/source/ui/drawfunc/futext.cxx4
-rw-r--r--sc/source/ui/view/gridwin.cxx4
-rw-r--r--sc/source/ui/view/viewdata.cxx4
8 files changed, 11 insertions, 11 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 21ae683ae443..d434239e0502 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -470,7 +470,7 @@ tools::Long ScColumn::GetNeededSize(
pEngine->SetDefaults(std::move(pSet));
}
- bool bEngineVertical = pEngine->IsVertical();
+ bool bEngineVertical = pEngine->IsEffectivelyVertical();
pEngine->SetVertical( bAsianVertical );
pEngine->SetUpdateMode( true );
diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx
index 2a927f999164..6e9056027009 100644
--- a/sc/source/ui/drawfunc/fuconrec.cxx
+++ b/sc/source/ui/drawfunc/fuconrec.cxx
@@ -140,7 +140,7 @@ bool FuConstRectangle::MouseButtonUp(const MouseEvent& rMEvt)
if ( auto pSdrTextObj = dynamic_cast<SdrTextObj*>( pObj) )
pSdrTextObj->ForceOutlinerParaObject();
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
- if( pOPO && !pOPO->IsVertical() )
+ if( pOPO && !pOPO->IsEffectivelyVertical() )
pOPO->SetVertical( true );
}
}
diff --git a/sc/source/ui/drawfunc/fuconstr.cxx b/sc/source/ui/drawfunc/fuconstr.cxx
index 28ce53300be9..1064a30e1093 100644
--- a/sc/source/ui/drawfunc/fuconstr.cxx
+++ b/sc/source/ui/drawfunc/fuconstr.cxx
@@ -149,7 +149,7 @@ bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
if ( dynamic_cast<const SdrTextObj*>( pObj) != nullptr && dynamic_cast<const SdrUnoObj*>( pObj) == nullptr )
{
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
- bool bVertical = ( pOPO && pOPO->IsVertical() );
+ bool bVertical = ( pOPO && pOPO->IsEffectivelyVertical() );
sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT;
rViewShell.GetViewData().GetDispatcher().
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index ab70e9094615..b55ccdfecd17 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -163,7 +163,7 @@ static bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell& rViewShell, const
// but with bCursorToEnd instead of mouse position
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
- bool bVertical = ( pOPO && pOPO->IsVertical() );
+ bool bVertical = ( pOPO && pOPO->IsEffectivelyVertical() );
sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT;
// don't switch shells if text shell is already active
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index 02af11bfe7ca..0e103948835f 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -481,7 +481,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
else if ( dynamic_cast<const SdrTextObj*>( pObj) != nullptr && dynamic_cast<const SdrUnoObj*>( pObj) == nullptr && dynamic_cast<const SdrMediaObj*>( pObj) == nullptr )
{
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
- bool bVertical = ( pOPO && pOPO->IsVertical() );
+ bool bVertical = ( pOPO && pOPO->IsEffectivelyVertical() );
sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT;
rViewShell.GetViewData().GetDispatcher().
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index e80ecb39bbf3..dc2f1d8ec8fb 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -191,7 +191,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
bool bVertical = ( nSlotID == SID_DRAW_TEXT_VERTICAL );
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
if ( pOPO )
- bVertical = pOPO->IsVertical(); // content wins
+ bVertical = pOPO->IsEffectivelyVertical(); // content wins
pO->SetVertical( bVertical );
//!?? the default values are not correct when result is without outliner ???!?
@@ -576,7 +576,7 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel,
bool bVertical = ( nSlotID == SID_DRAW_TEXT_VERTICAL );
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
if ( pOPO )
- bVertical = pOPO->IsVertical(); // content wins
+ bVertical = pOPO->IsEffectivelyVertical(); // content wins
pO->SetVertical( bVertical );
//!?? without returned Outliner the defaults are not correct ???!?
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index effb52c917c1..87ac3d9b9ebe 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2574,7 +2574,7 @@ void ScGridWindow::MouseMove( const MouseEvent& rMEvt )
bool bAlt = rMEvt.IsMod2();
if ( !bAlt && !nButtonDown && ScGlobal::ShouldOpenURL() && pFld )
SetPointer( PointerStyle::RefHand );
- else if ( pEditView->GetEditEngine()->IsVertical() )
+ else if ( pEditView->GetEditEngine()->IsEffectivelyVertical() )
SetPointer( PointerStyle::TextVertical );
else
SetPointer( PointerStyle::Text );
@@ -3172,7 +3172,7 @@ void ScGridWindow::SelectForContextMenu( const Point& rPosPixel, SCCOL nCellX, S
tools::Rectangle aVisArea = pEditView->GetVisArea();
Point aTextPos = PixelToLogic( rPosPixel );
- if ( pEditEngine->IsVertical() ) // have to manually transform position
+ if ( pEditEngine->IsEffectivelyVertical() ) // have to manually transform position
{
aTextPos -= aOutputArea.TopRight();
tools::Long nTemp = -aTextPos.X();
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 1e045bf35ca4..6809df0b38e5 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1586,7 +1586,7 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
bool bBreak = ( eJust == SvxCellHorJustify::Block ) ||
pPattern->GetItem(ATTR_LINEBREAK).GetValue();
- bool bAsianVertical = pNewEngine->IsVertical(); // set by InputHandler
+ bool bAsianVertical = pNewEngine->IsEffectivelyVertical(); // set by InputHandler
tools::Rectangle aPixRect = ScEditUtil(&mrDoc, nNewX, nNewY, nTabNo, GetScrPos(nNewX, nNewY, eWhich),
pWin->GetOutDev(), nPPTX,nPPTY,GetZoomX(),GetZoomY() ).
@@ -1879,7 +1879,7 @@ void ScViewData::EditGrowX()
tools::Long nTextWidth = pEngine->CalcTextWidth();
bool bChanged = false;
- bool bAsianVertical = pEngine->IsVertical();
+ bool bAsianVertical = pEngine->IsEffectivelyVertical();
// get bGrow... variables the same way as in SetEditEngine
const ScPatternAttr* pPattern = rLocalDoc.GetPattern( nEditCol, nEditRow, nTabNo );