summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-12 09:52:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-26 07:35:36 +0100
commit4fbd63860500b2db76df4d5aedbe5e3aa31fac69 (patch)
tree5fa96dc262ba651e82244b0f9e508f79e88ea2df /drawinglayer
parent62fa5bb8c1299469eacc21cb35ee670b65120713 (diff)
switching long to a 64-bit type on 64-bit windows
(*) create a rewriting plugin to do most of the work, heavily based on the fakebool plugin (*) but there are still a number of "long"s in the codebase that will need to be done by hand (*) the plugin needs lots of handholding, due to needing to add #include and update macros Change-Id: I8184d7000ca482c0469514bb73178c3a1123b1e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104203 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/textprimitive2d.cxx3
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx8
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx26
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx9
-rw-r--r--drawinglayer/source/tools/wmfemfhelper.cxx2
5 files changed, 26 insertions, 22 deletions
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index a756fc22899c..1cd145c33839 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -202,7 +202,8 @@ TextSimplePortionPrimitive2D::TextSimplePortionPrimitive2D(
const basegfx::B2DHomMatrix& rNewTransform, const OUString& rText, sal_Int32 nTextPosition,
sal_Int32 nTextLength, const std::vector<double>& rDXArray,
const attribute::FontAttribute& rFontAttribute, const css::lang::Locale& rLocale,
- const basegfx::BColor& rFontColor, bool bFilled, long nWidthToFill, const Color& rTextFillColor)
+ const basegfx::BColor& rFontColor, bool bFilled, tools::Long nWidthToFill,
+ const Color& rTextFillColor)
: BufferedDecompositionPrimitive2D()
, maTextTransform(rNewTransform)
, maText(rText)
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 13883b50412f..04603bc03f77 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2331,10 +2331,10 @@ VclMetafileProcessor2D::CreateBufferDevice(const basegfx::B2DRange& rCandidateRa
constexpr double fMaxQuadratPixels = 500000;
basegfx::B2DRange aViewRange(rCandidateRange);
aViewRange.transform(maCurrentTransformation);
- rRectLogic = tools::Rectangle(static_cast<long>(std::floor(aViewRange.getMinX())),
- static_cast<long>(std::floor(aViewRange.getMinY())),
- static_cast<long>(std::ceil(aViewRange.getMaxX())),
- static_cast<long>(std::ceil(aViewRange.getMaxY())));
+ rRectLogic = tools::Rectangle(static_cast<tools::Long>(std::floor(aViewRange.getMinX())),
+ static_cast<tools::Long>(std::floor(aViewRange.getMinY())),
+ static_cast<tools::Long>(std::ceil(aViewRange.getMaxX())),
+ static_cast<tools::Long>(std::ceil(aViewRange.getMaxY())));
const tools::Rectangle aRectPixel(mpOutputDevice->LogicToPixel(rRectLogic));
rSizePixel = aRectPixel.GetSize();
const double fViewVisibleArea(rSizePixel.getWidth() * rSizePixel.getHeight());
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 1e5a04baf30d..266e118f19ef 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -1045,10 +1045,11 @@ void VclPixelProcessor2D::processGlowPrimitive2D(const primitive2d::GlowPrimitiv
bitmapRange.intersect(viewRange);
if (!bitmapRange.isEmpty())
{
- const tools::Rectangle aRect(static_cast<long>(std::floor(bitmapRange.getMinX())),
- static_cast<long>(std::floor(bitmapRange.getMinY())),
- static_cast<long>(std::ceil(bitmapRange.getMaxX())),
- static_cast<long>(std::ceil(bitmapRange.getMaxY())));
+ const tools::Rectangle aRect(
+ static_cast<tools::Long>(std::floor(bitmapRange.getMinX())),
+ static_cast<tools::Long>(std::floor(bitmapRange.getMinY())),
+ static_cast<tools::Long>(std::ceil(bitmapRange.getMaxX())),
+ static_cast<tools::Long>(std::ceil(bitmapRange.getMaxY())));
BitmapEx bmpEx = mpOutputDevice->GetBitmapEx(aRect.TopLeft(), aRect.GetSize());
mpOutputDevice->SetAntialiasing(aPrevAA);
@@ -1106,10 +1107,11 @@ void VclPixelProcessor2D::processSoftEdgePrimitive2D(
bitmapRange.intersect(viewRange);
if (!bitmapRange.isEmpty())
{
- const tools::Rectangle aRect(static_cast<long>(std::floor(bitmapRange.getMinX())),
- static_cast<long>(std::floor(bitmapRange.getMinY())),
- static_cast<long>(std::ceil(bitmapRange.getMaxX())),
- static_cast<long>(std::ceil(bitmapRange.getMaxY())));
+ const tools::Rectangle aRect(
+ static_cast<tools::Long>(std::floor(bitmapRange.getMinX())),
+ static_cast<tools::Long>(std::floor(bitmapRange.getMinY())),
+ static_cast<tools::Long>(std::ceil(bitmapRange.getMaxX())),
+ static_cast<tools::Long>(std::ceil(bitmapRange.getMaxY())));
BitmapEx bitmap = mpOutputDevice->GetBitmapEx(aRect.TopLeft(), aRect.GetSize());
AlphaMask aMask = bitmap.GetAlpha();
@@ -1155,10 +1157,10 @@ void VclPixelProcessor2D::processShadowPrimitive2D(const primitive2d::ShadowPrim
process(rCandidate);
- const tools::Rectangle aRect(static_cast<long>(std::floor(aRange.getMinX())),
- static_cast<long>(std::floor(aRange.getMinY())),
- static_cast<long>(std::ceil(aRange.getMaxX())),
- static_cast<long>(std::ceil(aRange.getMaxY())));
+ const tools::Rectangle aRect(static_cast<tools::Long>(std::floor(aRange.getMinX())),
+ static_cast<tools::Long>(std::floor(aRange.getMinY())),
+ static_cast<tools::Long>(std::ceil(aRange.getMaxX())),
+ static_cast<tools::Long>(std::ceil(aRange.getMaxY())));
BitmapEx bitmapEx = mpOutputDevice->GetBitmapEx(aRect.TopLeft(), aRect.GetSize());
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 042ca9d765cd..9f5f5d77c0d5 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -290,7 +290,8 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
sal_Int32 nPos = rTextCandidate.getTextPosition();
sal_Int32 nLen = rTextCandidate.getTextLength();
- long* pDXArray = !aTransformedDXArray.empty() ? aTransformedDXArray.data() : nullptr;
+ tools::Long* pDXArray
+ = !aTransformedDXArray.empty() ? aTransformedDXArray.data() : nullptr;
if (rTextCandidate.isFilled())
{
@@ -299,12 +300,12 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
rTextCandidate.getTextTransform().decompose(aOldFontScaling, aOldTranslate,
fOldRotate, fOldShearX);
- long nWidthToFill = static_cast<long>(
+ tools::Long nWidthToFill = static_cast<tools::Long>(
rTextCandidate.getWidthToFill() * aFontScaling.getX() / aOldFontScaling.getX());
- long nWidth
+ tools::Long nWidth
= mpOutputDevice->GetTextArray(rTextCandidate.getText(), pDXArray, 0, 1);
- long nChars = 2;
+ tools::Long nChars = 2;
if (nWidth)
nChars = nWidthToFill / nWidth;
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx
index 60bf9ea6ae9f..8439b10957de 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -1844,7 +1844,7 @@ namespace wmfemfhelper
{
// prepare DXArray (if used)
std::vector< double > aDXArray;
- long* pDXArray = pA->GetDXArray();
+ tools::Long* pDXArray = pA->GetDXArray();
if(pDXArray)
{