summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-08-03 13:05:24 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-08-03 21:57:23 +0200
commit81302f33073e7629d724ed269f1fa21dad29e141 (patch)
tree59c1a5422fee301751c170e6ea24a3ca9b0caddc /sw
parent83b25e4b9fa8f95c24759a64f8cb9716ee34a4a3 (diff)
Move angle normalization code from various places to tools
Also rename svx angle normalization functions in include/svx/svdtrans.hxx, that deal with 100ths of degree, to avoid confusion: NormAngle180 -> NormAngle18000; NormAngle360 -> NormAngle36000. Some places were fixed that previously returned inclusive ranges (i.e., both 0 and 360), see changes in these files: chart2/source/view/main/PlottingPositionHelper.cxx chart2/source/view/main/PolarLabelPositionHelper.cxx chart2/source/view/main/ShapeFactory.cxx filter/source/graphicfilter/idxf/dxf2mtf.cxx sw/source/core/graphic/grfatr.cxx (the latter now matches the comment in the function). Change-Id: I9f274bbb4168360d60dceff02aeba6332c519a59 Reviewed-on: https://gerrit.libreoffice.org/58556 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/graphic/grfatr.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/graphic/grfatr.cxx b/sw/source/core/graphic/grfatr.cxx
index a9b318aebbe6..4b73f2e078c2 100644
--- a/sw/source/core/graphic/grfatr.cxx
+++ b/sw/source/core/graphic/grfatr.cxx
@@ -155,7 +155,7 @@ sal_Int16 SwRotationGrf::checkAndCorrectValue(sal_Int16 nValue)
DBG_ASSERT(false, "SwRotationGrf: Value is in 10th degree and *has* to be in [0 .. 3600[ (!)");
return 3600 + (nValue % 3600);
}
- else if (nValue > 3600)
+ else if (nValue >= 3600)
{
// bigger range, use modulo
DBG_ASSERT(false, "SwRotationGrf: Value is in 10th degree and *has* to be in [0 .. 3600[ (!)");
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 9b1040de6d6f..98ec36fe9534 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -689,7 +689,7 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const
aRect = pObj->GetLogicRect();
// rotating to vertical means swapping height and width as seen in SvxMSDffManager::ImportShape
- const long nAngle = NormAngle360( pObj->GetRotateAngle() );
+ const long nAngle = NormAngle36000( pObj->GetRotateAngle() );
const bool bAllowSwap = pObj->GetObjIdentifier() != OBJ_LINE && pObj->GetObjIdentifier() != OBJ_GRUP;
if ( bAllowSwap && (( nAngle > 4500 && nAngle <= 13500 ) || ( nAngle > 22500 && nAngle <= 31500 )) )
{