29#include <config_options.h>
45 constexpr Pair() : mnA(0), mnB(0) {}
69 return p1.
A() == p2.
A() && p1.
B() == p2.
B();
114 constexpr inline Point scale(sal_Int64 nMulX, sal_Int64 nDivX,
115 sal_Int64 nMulY, sal_Int64 nDivY)
const;
185constexpr inline Point Point::scale(sal_Int64 nMulX, sal_Int64 nDivX, sal_Int64 nMulY, sal_Int64 nDivY)
const
196 const auto [num, den] = o3tl::getConversionMulDiv(eFrom, eTo);
197 return rPoint.
scale(num, den, num, den);
202template<
typename charT,
typename traits >
203inline std::basic_ostream<charT, traits> &
operator <<(
204 std::basic_ostream<charT, traits> & stream,
const Point& point )
228 bool IsEmpty()
const {
return mnA <= 0 || mnB <= 0; }
243 Size& operator -= (
const Size& rSize );
252 constexpr inline Size scale(sal_Int64 nMulX, sal_Int64 nDivX,
253 sal_Int64 nMulY, sal_Int64 nDivY)
const;
307 return Size( rVal1.
mnA*nVal2, rVal1.
mnB*nVal2 );
312 return Size( rVal1.
mnA/nVal2, rVal1.
mnB/nVal2 );
316 sal_Int64 nMulY, sal_Int64 nDivY)
const
327 const auto [num, den] = o3tl::getConversionMulDiv(eFrom, eTo);
328 return rSize.
scale(num, den, num, den);
333template<
typename charT,
typename traits >
334inline std::basic_ostream<charT, traits> &
operator <<(
335 std::basic_ostream<charT, traits> & stream,
const Size& size )
348#define RANGE_MAX LONG_MAX
375 return ((
mnA <= nIs) && (nIs <=
mnB ));
394template<
typename charT,
typename traits >
395inline std::basic_ostream<charT, traits> &
operator <<(
396 std::basic_ostream<charT, traits> & stream,
const Range& range )
403#define SELECTION_MIN LONG_MIN
404#define SELECTION_MAX LONG_MAX
424 bool operator !()
const {
return !Len(); }
438 return ((
mnA <= nIs) && (nIs <
mnB ));
457template<
typename charT,
typename traits >
458inline std::basic_ostream<charT, traits> &
operator <<(
459 std::basic_ostream<charT, traits> & stream,
const Selection& selection )
461 return stream << selection.
Min() <<
'-' << selection.
Max();
465#define RECT_MAX LONG_MAX
466#define RECT_MIN LONG_MIN
487 static constexpr short RECT_EMPTY = -32767;
534 inline void SetSize(
const Size&);
537 constexpr Size GetSize()
const {
return { GetWidth(), GetHeight() }; }
551 bool Contains(
const Point& rPOINT )
const;
558 constexpr bool IsEmpty()
const {
return IsWidthEmpty() || IsHeightEmpty(); }
591 void SaturatingSetSize(
const Size& rSize);
597 sal_Int64 nMulY, sal_Int64 nDivY)
const;
633 const std::pair<tools::Long, tools::Long> aLeftRight = std::minmax(rLT.
X(), rRB.
X());
634 const std::pair<tools::Long, tools::Long> aTopBottom = std::minmax(rLT.
Y(), rRB.
Y());
635 return { aLeftRight.first, aTopBottom.first, aLeftRight.second, aTopBottom.second };
644 if (!IsHeightEmpty())
657 if (!IsHeightEmpty())
682 else if (nHeight > 0)
690 SetWidth(rSize.
Width());
691 SetHeight(rSize.
Height());
714 if (!IsHeightEmpty())
729 return aTmpRect.
Union( rRect );
770 return Rectangle{ rRect }.operator+=(rPt);
775 return Rectangle{ rRect }.operator-=(rPt);
781 sal_Int64 nMulY, sal_Int64 nDivY)
const
789 if (!IsHeightEmpty())
799 const auto [num, den] = o3tl::getConversionMulDiv(eFrom, eTo);
800 return rRectangle.
scale(num, den, num, den);
807template<
typename charT,
typename traits >
808inline std::basic_ostream<charT, traits> &
operator <<(
809 std::basic_ostream<charT, traits> & stream,
const tools::Rectangle& rectangle )
constexpr Pair(tools::Long nA, tools::Long nB)
TOOLS_DLLPUBLIC rtl::OString toString() const
TOOLS_DLLPUBLIC size_t GetHashValue() const
constexpr Point(tools::Long nX, tools::Long nY)
constexpr tools::Long Y() const
void setX(tools::Long nX)
Point & operator/=(const tools::Long nVal)
Point & operator-=(const Point &rPoint)
void Move(tools::Long nHorzMove, tools::Long nVertMove)
Point & operator*=(const tools::Long nVal)
constexpr Point scale(sal_Int64 nMulX, sal_Int64 nDivX, sal_Int64 nMulY, sal_Int64 nDivY) const
Point & operator+=(const Point &rPoint)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
Pair const & toPair() const
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
constexpr tools::Long getX() const
constexpr tools::Long getY() const
bool Contains(tools::Long nIs) const
Pair const & toPair() const
constexpr Range(tools::Long nMin, tools::Long nMax)
bool Contains(tools::Long nIs) const
tools::Long getMin() const
void setMin(tools::Long nMin)
void setMax(tools::Long nMax)
Pair const & toPair() const
Selection(tools::Long nMin, tools::Long nMax)
Selection(tools::Long nPos)
constexpr Size(tools::Long nWidth, tools::Long nHeight)
Size & operator/=(const tools::Long nVal)
constexpr tools::Long getHeight() const
Size & operator*=(const tools::Long nVal)
constexpr Size scale(sal_Int64 nMulX, sal_Int64 nDivX, sal_Int64 nMulY, sal_Int64 nDivY) const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
Size & operator-=(const Size &rSize)
constexpr tools::Long getWidth() const
void extendBy(tools::Long x, tools::Long y)
Pair const & toPair() const
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
Size & operator+=(const Size &rSize)
constexpr tools::Long Width() const
Reference< XOutputStream > stream
Point operator/(const Point &rVal1, const tools::Long nVal2)
bool operator==(Point const &p1, Point const &p2)
bool operator!=(Point const &p1, Point const &p2)
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &stream, const Point &point)
Point operator-(const Point &rVal1, const Point &rVal2)
Point operator+(const Point &rVal1, const Point &rVal2)
Point operator*(const Point &rVal1, const tools::Long nVal2)
constexpr auto convert(N n, sal_Int64 mul, sal_Int64 div)
constexpr tools::Rectangle convert(const tools::Rectangle &rRectangle, o3tl::Length eFrom, o3tl::Length eTo)
OUString toString(OptionInfo const *info)
tools::Rectangle & operator+=(tools::Rectangle &rRect, const SvBorder &rBorder)