28#include <osl/diagnose.h>
54 OSL_ENSURE(_pWin && pListBox,
"OConnectionLine::GetSourceTextPos : invalid call !");
59 const tools::Long nRowHeight = pListBox->get_widget().get_height_rows(1);
60 aReturn.
SetTop( _aConnPos.
Y() - nRowHeight );
62 if (_aDescrLinePos.
X() < _aConnPos.
X())
64 aReturn.
SetLeft( _aDescrLinePos.
X() );
65 aReturn.
SetRight( aReturn.
Left() + _aConnPos.
X() - _aDescrLinePos.
X() );
70 aReturn.
SetRight( aReturn.
Left() + _aDescrLinePos.
X() - _aConnPos.
X() );
87 std::unique_ptr<weld::TreeIter> xEntry;
104 _rNewConPos.
AdjustY(nEntryPos);
115 if( _rNewConPos.
Y() > nListBoxBottom )
116 _rNewConPos.
setY( nListBoxBottom + 2 );
121 _rNewDescrPos.
setY( _rNewConPos.
Y() );
126 : m_pTabConn( _pConn )
132 : m_pTabConn(nullptr)
165 return aBoundingRect;
203 return aBoundingRect;
209 _rNewDescrPos.
setX( _rNewConPos.
X() );
216 _rNewDescrPos.
setX( _rNewConPos.
X() );
226 if( !pSourceWin || !pDestWin )
229 int nSourceEntry = pSourceWin->
GetListBox()->GetEntryFromText(
GetData()->GetSourceFieldName() );
230 int nDestEntry = pDestWin->
GetListBox()->GetEntryFromText(
GetData()->GetDestFieldName() );
233 Point aSourceCenter( 0, 0 );
234 Point aDestCenter( 0, 0 );
245 if( aDestCenter.
X() > aSourceCenter.
X() )
247 pFirstWin = pSourceWin;
248 pSecondWin = pDestWin;
255 if (pFirstWin == pSecondWin && nSourceEntry != nDestEntry)
256 calcPointX2(pFirstWin,*pFirstConPos,*pFirstDescrPos);
258 calcPointX1(pFirstWin,*pFirstConPos,*pFirstDescrPos);
259 calcPointX2(pSecondWin,*pSecondConPos,*pSecondDescrPos);
272 const sal_uInt16 nRectSize = 3;
297 Point aVector(nRectSize,nRectSize);
311 double a = std::hypot(
v.X(),
v.Y());
312 double l = (
v.X() *
w.Y() -
v.Y() *
w.X()) /
a;
313 double a2 =
w.X()*
v.X()+
w.Y()*
v.Y();
351 aDest.
setX( aDest.
X() / 2 );
352 aDest.
setY( aDest.
Y() / 2 );
const tools::Long DESCRIPT_LINE_WIDTH
static double dist_Euklid(const Point &p1, const Point &p2, const Point &pM, Point &q)
static void calcPointX1(const OTableWindow *_pWin, Point &_rNewConPos, Point &_rNewDescrPos)
const tools::Long HIT_SENSITIVE_RADIUS
static void calcPointX2(const OTableWindow *_pWin, Point &_rNewConPos, Point &_rNewDescrPos)
static const AllSettings & GetSettings()
void SetWidth(double nWidth)
void DrawPolyLine(const tools::Polygon &rPoly)
void DrawRect(const tools::Rectangle &rRect)
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
the class OConnectionLineData contains the data of a connection e.g.
OConnectionLine & operator=(const OConnectionLine &rLine)
void Draw(OutputDevice *pOutDev)
bool CheckHit(const Point &rMousePos) const
tools::Rectangle GetBoundingRect() const
VclPtr< OTableConnection > m_pTabConn
OConnectionLine(OTableConnection *pConn, OConnectionLineDataRef pLineData)
OConnectionLineDataRef m_pData
const OConnectionLineDataRef & GetData() const
Point getMidPoint() const
tools::Rectangle GetDestTextPos() const
tools::Rectangle GetSourceTextPos() const
Point m_aSourceDescrLinePos
Point m_aDestDescrLinePos
const weld::TreeView & get_widget() const
const VclPtr< OTableWindowListBox > & GetListBox() const
virtual Point GetPosPixel() const
virtual Size GetSizePixel() const
virtual std::unique_ptr< TreeIter > make_iterator(const TreeIter *pOrig=nullptr) const=0
virtual bool get_iter_first(TreeIter &rIter) const=0
virtual int get_height_rows(int nRows) const=0
bool iter_nth_sibling(TreeIter &rIter, int nChild) const
virtual tools::Rectangle get_row_area(const weld::TreeIter &rIter) const=0
ControllerFrame_Data * m_pData