summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2022-06-29 00:06:03 +1000
committerTomaž Vajngerl <quikee@gmail.com>2022-07-11 11:06:53 +0200
commit934985becc567114c3f38a72322056a628aad7c9 (patch)
tree54530473a4d3a0a5876aff68b3727d51fa4dc88d /sw/source/filter
parenta19e01812b60580c656cf31619e212803e2ca0fa (diff)
tools: rename getHeight/Width() to GetOpenHeight/Width()
By default Rectangle uses closed interval, if we really want to use half open intervals then we should specifically say as such in the name. Change-Id: Id7a91120ba1a1a4bc330014216b73a692dbf03a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136575 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/html/htmlflywriter.cxx4
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx17
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx12
3 files changed, 17 insertions, 16 deletions
diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx
index 0e27a89d8516..00d6db3dc16f 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -934,9 +934,9 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma
const tools::Rectangle& rSnapRect = pObject->GetSnapRect();
aFrameSize.emplace();
aFrameSize->SetWidthSizeType(SwFrameSize::Fixed);
- aFrameSize->SetWidth(rSnapRect.getWidth());
+ aFrameSize->SetWidth(rSnapRect.getOpenWidth());
aFrameSize->SetHeightSizeType(SwFrameSize::Fixed);
- aFrameSize->SetHeight(rSnapRect.getHeight());
+ aFrameSize->SetHeight(rSnapRect.getOpenHeight());
pFSItem = &*aFrameSize;
}
if( (nFrameOptions & HtmlFrmOpts::Size) &&
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index c3c5b742e1ed..c3524d3c74d3 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -158,8 +158,8 @@ void lcl_calculateMSOBaseRectangle(const SdrObject& rObj, double& rfMSOLeft, dou
// directly usable as 'base rectangle'.
double fCenterX = (rObj.GetSnapRect().Left() + rObj.GetSnapRect().Right()) / 2.0;
double fCenterY = (rObj.GetSnapRect().Top() + rObj.GetSnapRect().Bottom()) / 2.0;
- double fHalfWidth = rObj.GetLogicRect().getWidth() / 2.0;
- double fHalfHeight = rObj.GetLogicRect().getHeight() / 2.0;
+ double fHalfWidth = rObj.GetLogicRect().getOpenWidth() / 2.0;
+ double fHalfHeight = rObj.GetLogicRect().getOpenHeight() / 2.0;
// MSO swaps width and height depending on rotation angle; exception: Word 2007 (vers 12) never
// swaps width and height for images.
@@ -334,9 +334,9 @@ tools::Polygon lcl_CreateContourPolygon(SdrObject* pSdrObj)
basegfx::B2DHomMatrix aTranslateToOrigin(
basegfx::utils::createTranslateB2DHomMatrix(-aCenter.X(), -aCenter.Y()));
aPolyPolygon.transform(aTranslateToOrigin);
- const double fWidth(pSdrObj->GetLogicRect().getWidth());
+ const double fWidth(pSdrObj->GetLogicRect().getOpenWidth());
double fScaleX = fWidth == 0.0 ? 1.0 : 21600.0 / fWidth;
- const double fHeight(pSdrObj->GetLogicRect().getHeight());
+ const double fHeight(pSdrObj->GetLogicRect().getOpenHeight());
double fScaleY = fHeight == 0.0 ? 1.0 : 21600.0 / fHeight;
basegfx::B2DHomMatrix aScale(basegfx::utils::createScaleB2DHomMatrix(fScaleX, fScaleY));
aPolyPolygon.transform(aScale);
@@ -386,9 +386,9 @@ tools::Polygon lcl_CreateContourPolygon(SdrObject* pSdrObj)
basegfx::utils::createTranslateB2DHomMatrix(-aCenter.X(), -aCenter.Y()));
aPolyPolygon.transform(aTranslateToOrigin);
- const double fWidth(pSdrObj->GetLogicRect().getWidth());
+ const double fWidth(pSdrObj->GetLogicRect().getOpenWidth());
double fScaleX = fWidth == 0.0 ? 1.0 : 21600.0 / fWidth;
- const double fHeight(pSdrObj->GetLogicRect().getHeight());
+ const double fHeight(pSdrObj->GetLogicRect().getOpenHeight());
double fScaleY = fHeight == 0.0 ? 1.0 : 21600.0 / fHeight;
basegfx::B2DHomMatrix aScale(
basegfx::utils::createScaleB2DHomMatrix(fScaleX, fScaleY));
@@ -1384,7 +1384,8 @@ void DocxSdrExport::writeDMLDrawing(const SdrObject* pSdrObject, const SwFrameFo
m_pImpl->getExport().DocxAttrOutput().GetSdtEndBefore(pSdrObject);
sax_fastparser::FSHelperPtr pFS = m_pImpl->getSerializer();
- Size aSize(pSdrObject->GetLogicRect().getWidth(), pSdrObject->GetLogicRect().getHeight());
+ Size aSize(pSdrObject->GetLogicRect().getOpenWidth(),
+ pSdrObject->GetLogicRect().getOpenHeight());
startDMLAnchorInline(pFrameFormat, aSize);
rtl::Reference<sax_fastparser::FastAttributeList> pDocPrAttrList
@@ -1665,7 +1666,7 @@ void DocxSdrExport::writeDiagram(const SdrObject* sdrObject, const SwFrameFormat
uno::UNO_QUERY);
// write necessary tags to document.xml
- Size aSize(sdrObject->GetSnapRect().getWidth(), sdrObject->GetSnapRect().getHeight());
+ Size aSize(sdrObject->GetSnapRect().getOpenWidth(), sdrObject->GetSnapRect().getOpenHeight());
startDMLAnchorInline(&rFrameFormat, aSize);
m_pImpl->getDrawingML()->SetFS(m_pImpl->getSerializer());
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index d2de899f2d3d..bcfc410ffb6e 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -676,8 +676,8 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const
const bool bAllowSwap = pObj->GetObjIdentifier() != SdrObjKind::Line && pObj->GetObjIdentifier() != SdrObjKind::Group;
if ( bAllowSwap && (( nAngle > 4500_deg100 && nAngle <= 13500_deg100 ) || ( nAngle > 22500_deg100 && nAngle <= 31500_deg100 )) )
{
- const tools::Long nWidth = aRect.getWidth();
- const tools::Long nHeight = aRect.getHeight();
+ const tools::Long nWidth = aRect.getOpenWidth();
+ const tools::Long nHeight = aRect.getOpenHeight();
aRect.setWidth( nHeight );
aRect.setHeight( nWidth );
bHasHeightWidthSwapped = true;
@@ -749,10 +749,10 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const
{
SwTwips nXOff;
SwTwips nYOff;
- SwTwips nSnapWidth = pObj->GetSnapRect().getWidth();
- SwTwips nSnapHeight = pObj->GetSnapRect().getHeight();
- SwTwips nLogicWidth = pObj->GetLogicRect().getWidth();
- SwTwips nLogicHeight = pObj->GetLogicRect().getHeight();
+ SwTwips nSnapWidth = pObj->GetSnapRect().getOpenWidth();
+ SwTwips nSnapHeight = pObj->GetSnapRect().getOpenHeight();
+ SwTwips nLogicWidth = pObj->GetLogicRect().getOpenWidth();
+ SwTwips nLogicHeight = pObj->GetLogicRect().getOpenHeight();
// +1 for to compensate integer arithmetic rounding errors
if(bHasHeightWidthSwapped)
{