summaryrefslogtreecommitdiff
path: root/svx
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 /svx
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 'svx')
-rw-r--r--svx/source/sdr/primitive2d/sdrdecompositiontools.cxx2
-rw-r--r--svx/source/svdraw/svdoashp.cxx2
-rw-r--r--svx/source/svdraw/svdotext.cxx6
-rw-r--r--svx/source/svdraw/svdotextdecomposition.cxx8
-rw-r--r--svx/source/svdraw/svdview.cxx2
-rw-r--r--svx/source/unodraw/unoshtxt.cxx4
6 files changed, 12 insertions, 12 deletions
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index dcff748ea60f..9d19dd35def3 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -65,7 +65,7 @@ basegfx::B2DRange getTextAnchorRange(const attribute::SdrTextAttribute& rText,
// Take vertical text orientation into account when deciding
// which dimension is its width, and which is its height
const OutlinerParaObject& rOutlinerParaObj = rText.getOutlinerParaObject();
- const bool bVerticalWriting(rOutlinerParaObj.IsVertical());
+ const bool bVerticalWriting(rOutlinerParaObj.IsEffectivelyVertical());
const double fWidthForText = bVerticalWriting ? rSnapRange.getHeight() : rSnapRange.getWidth();
// create a range describing the wanted text position and size (aTextAnchorRange). This
// means to use the text distance values here
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index e90a257308f3..b48d6b937b41 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -2200,7 +2200,7 @@ void SdrObjCustomShape::SetVerticalWriting( bool bVertical )
DBG_ASSERT( pOutlinerParaObject, "SdrTextObj::SetVerticalWriting() without OutlinerParaObject!" );
if( !pOutlinerParaObject ||
- (pOutlinerParaObject->IsVertical() == bVertical) )
+ (pOutlinerParaObject->IsEffectivelyVertical() == bVertical) )
return;
// get item settings
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 34987b6bf34d..850cb48b0263 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1354,7 +1354,7 @@ void SdrTextObj::NbcSetOutlinerParaObjectForText( std::unique_ptr<OutlinerParaOb
if (pText && pText->GetOutlinerParaObject())
{
- SvxWritingModeItem aWritingMode(pText->GetOutlinerParaObject()->IsVertical() && pText->GetOutlinerParaObject()->IsTopToBottom()
+ SvxWritingModeItem aWritingMode(pText->GetOutlinerParaObject()->IsEffectivelyVertical() && pText->GetOutlinerParaObject()->IsTopToBottom()
? css::text::WritingMode_TB_RL
: css::text::WritingMode_LR_TB,
SDRATTR_TEXTDIRECTION);
@@ -1474,7 +1474,7 @@ bool SdrTextObj::IsVerticalWriting() const
OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
if(pOutlinerParaObject)
{
- return pOutlinerParaObject->IsVertical();
+ return pOutlinerParaObject->IsEffectivelyVertical();
}
return false;
@@ -1493,7 +1493,7 @@ void SdrTextObj::SetVerticalWriting(bool bVertical)
}
if (!pOutlinerParaObject ||
- (pOutlinerParaObject->IsVertical() == bVertical))
+ (pOutlinerParaObject->IsEffectivelyVertical() == bVertical))
return;
// get item settings
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index c6f3bbdb8193..a1e885c0e009 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -758,7 +758,7 @@ void SdrTextObj::impDecomposeAutoFitTextPrimitive(
const sal_uInt32 nAnchorTextHeight(FRound(aAnchorTextRange.getHeight() + 1));
const OutlinerParaObject* pOutlinerParaObject = rSdrAutofitTextPrimitive.getSdrText()->GetOutlinerParaObject();
OSL_ENSURE(pOutlinerParaObject, "impDecomposeBlockTextPrimitive used with no OutlinerParaObject (!)");
- const bool bVerticalWriting(pOutlinerParaObject->IsVertical());
+ const bool bVerticalWriting(pOutlinerParaObject->IsEffectivelyVertical());
const bool bTopToBottom(pOutlinerParaObject->IsTopToBottom());
const Size aAnchorTextSize(Size(nAnchorTextWidth, nAnchorTextHeight));
@@ -945,7 +945,7 @@ void SdrTextObj::impDecomposeBlockTextPrimitive(
// add one to rage sizes to get back to the old Rectangle and outliner measurements
const sal_uInt32 nAnchorTextWidth(FRound(aAnchorTextRange.getWidth() + 1));
const sal_uInt32 nAnchorTextHeight(FRound(aAnchorTextRange.getHeight() + 1));
- const bool bVerticalWriting(rSdrBlockTextPrimitive.getOutlinerParaObject().IsVertical());
+ const bool bVerticalWriting(rSdrBlockTextPrimitive.getOutlinerParaObject().IsEffectivelyVertical());
const bool bTopToBottom(rSdrBlockTextPrimitive.getOutlinerParaObject().IsTopToBottom());
const Size aAnchorTextSize(Size(nAnchorTextWidth, nAnchorTextHeight));
@@ -1197,7 +1197,7 @@ void SdrTextObj::impDecomposeStretchTextPrimitive(
// #i101957# Check for vertical text. If used, aNewTransformA
// needs to translate the text initially around object width to orient
// it relative to the topper right instead of the topper left
- const bool bVertical(rSdrStretchTextPrimitive.getOutlinerParaObject().IsVertical());
+ const bool bVertical(rSdrStretchTextPrimitive.getOutlinerParaObject().IsEffectivelyVertical());
const bool bTopToBottom(rSdrStretchTextPrimitive.getOutlinerParaObject().IsTopToBottom());
if(bVertical)
@@ -1559,7 +1559,7 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
const OutlinerParaObject* pOutlinerParaObject = rSdrChainedTextPrimitive.getSdrText()->GetOutlinerParaObject();
OSL_ENSURE(pOutlinerParaObject, "impDecomposeBlockTextPrimitive used with no OutlinerParaObject (!)");
- const bool bVerticalWriting(pOutlinerParaObject->IsVertical());
+ const bool bVerticalWriting(pOutlinerParaObject->IsEffectivelyVertical());
const bool bTopToBottom(pOutlinerParaObject->IsTopToBottom());
const Size aAnchorTextSize(Size(nAnchorTextWidth, nAnchorTextHeight));
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index b6d54499fe9b..73185618c8ae 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -1038,7 +1038,7 @@ PointerStyle SdrView::GetPreferredPointer(const Point& rMousePos, const OutputDe
if(pText && pText->HasText())
{
OutlinerParaObject* pParaObj = pText->GetOutlinerParaObject();
- if(pParaObj && pParaObj->IsVertical())
+ if(pParaObj && pParaObj->IsEffectivelyVertical())
return PointerStyle::TextVertical;
}
return PointerStyle::Text;
diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index 0cc8baffa233..7afed3609a5d 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -565,7 +565,7 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder()
}
else
{
- bool bVertical = pOutlinerParaObject && pOutlinerParaObject->IsVertical();
+ bool bVertical = pOutlinerParaObject && pOutlinerParaObject->IsEffectivelyVertical();
// set objects style sheet on empty outliner
SfxStyleSheetPool* pPool = static_cast<SfxStyleSheetPool*>(mpObject->getSdrModelFromSdrObject().GetStyleSheetPool());
@@ -578,7 +578,7 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder()
if( bVertical )
{
- mpOutliner->SetVertical( pOutlinerParaObject->GetDirectVertical());
+ mpOutliner->SetVertical( pOutlinerParaObject->GetVertical());
mpOutliner->SetRotation( pOutlinerParaObject->GetRotation());
}
}